f1cd933df297fec78d781085f7ac5cc485ed7c40.svn-base 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. <template>
  2. <div id="skMain" v-loading='exportLoading'>
  3. <el-row style="margin-bottom:5px;">
  4. <el-col :span="24">
  5. <div class="grid-content bg-purple-light">
  6. <div style="padding:15px 5px 5px 5px;">
  7. <span style="font-size: 12px;margin-left: 10px;">名称:</span>
  8. <el-input style="width:150px;" class="kjr-input" size="mini" v-model="model_name"
  9. placeholder="请输入名称查询" @keydown.enter.native="searchByName" clearable>
  10. </el-input>
  11. &nbsp;&nbsp;&nbsp;
  12. <el-button @click="searchByName" size="mini" type="primary">查询</el-button>
  13. <el-button @click="exPort" size="mini" type="success">导出</el-button>
  14. </div>
  15. <div style="padding:5px;">
  16. <el-col :span="5">
  17. <div style="height: 500px;overflow: auto">
  18. <provTreeList :rootCode="rootCode" :rootType="rootType"
  19. @provTreeSelectChange="provTreeSelectChangeHandler"
  20. >
  21. </provTreeList>
  22. </div>
  23. </el-col>
  24. <el-col :span="19">
  25. <el-table :data="tableDataList" v-loading="loading" height="500" border stripe style="width: 100%">
  26. <el-table-column type="index" width="50" label="序号" align="center" :index="indexMethod_country">
  27. </el-table-column>
  28. <el-table-column prop="nm" label="工程名称" min-width="130" align="center" show-overflow-tooltip></el-table-column>
  29. <el-table-column prop="adCode" label="行政区编码" min-width="120" align="center"></el-table-column>
  30. <el-table-column prop="pcX" label="经度" min-width="120" align="center"></el-table-column>
  31. <el-table-column prop="pcY" label="纬度" min-width="120" align="center" show-overflow-tooltip>
  32. </el-table-column>
  33. <el-table-column fixed="right" label="操作" min-width="180" align="center">
  34. <template slot-scope="scope">
  35. <el-button type="text" size="small" @click="szyAllQyshInfo(scope.row,'location')">定位</el-button>
  36. <el-button type="text" size="small" @click="szyAllQyshInfo(scope.row,'baseInfo')">基础信息</el-button>
  37. </template>
  38. </el-table-column>
  39. </el-table>
  40. <div class="block">
  41. <el-pagination background @size-change="handleSizeChange"
  42. @current-change="handleCurrentChange" :page-sizes="[10,50, 100, 200]"
  43. :page-size="15" layout="total,sizes, prev, pager, next" :pager-count="5"
  44. :total="recordTotal">
  45. </el-pagination>
  46. </div>
  47. </el-col>
  48. </div>
  49. </div>
  50. </el-col>
  51. </el-row>
  52. </div>
  53. </template>
  54. <script>
  55. import provTreeList from '../../../../widgets/provTreeListAndChina'
  56. import request from '../../../../utils/gw_ajax_request.js';
  57. import {exportModel} from "@util/gw_exportModel";
  58. import {getBasePage} from '../../../../api/zhxxAPI.js'
  59. export default {
  60. name: "resevoirList",
  61. components:{
  62. provTreeList
  63. },
  64. props:["dcztDisabled","currentAdCode"],
  65. data() {
  66. return {
  67. rootCode:'000000',
  68. rootType:'2',
  69. model_name:'',
  70. dczt:'',
  71. tableDataList:[],
  72. recordTotal:0,
  73. pageSize: 10,
  74. pageIndex: 1,
  75. loading: false,
  76. isDczt:false,
  77. adCode:'',
  78. exportLoading:false,
  79. }
  80. },
  81. computed: {
  82. recPersId() {
  83. return localStorage.getItem("userid") ? localStorage.getItem("userid") : ''
  84. }
  85. },
  86. mounted(){
  87. let _this = this;
  88. _this.loadTableYdb();
  89. },
  90. methods:{
  91. indexMethod_country(index) {
  92. return (index + 1) + this.pageSize * (this.pageIndex - 1)
  93. },
  94. provTreeSelectChangeHandler(params) {
  95. this.adCode = params.code;
  96. if(this.adCode == "000000000000"){
  97. this.adCode = '';
  98. }
  99. this.$nextTick(()=>{
  100. this.pageSize = 10;
  101. this.pageIndex = 1;
  102. this.loadTableYdb();
  103. })
  104. },
  105. searchByName() {
  106. this.loadTableYdb();
  107. },
  108. async exPort(){
  109. this.exportLoading = true;
  110. let url = '/pdcApi/dc/general/info/getBasePage?objType=12&adCode='+this.adCode+'&pageNum='+this.pageIndex+'&pageSize='+this.pageSize+'&name='+this.model_name+'&isExport=1';
  111. let downloadName = "全部取用水户.xls";
  112. let type = "get";
  113. let result = await exportModel(type,url,downloadName);
  114. this.exportLoading = result;
  115. },
  116. loadTableYdb() {
  117. let _this = this;
  118. _this.loading = true;
  119. getBasePage('12',_this.adCode,_this.pageIndex,_this.pageSize,_this.model_name).then((res)=>{
  120. if (res.success) {
  121. _this.$nextTick()
  122. _this.loading = false;
  123. var obj = res.data;
  124. _this.tableDataList = obj.list;
  125. _this.recordTotal = obj.total;
  126. }
  127. })
  128. },
  129. handleSizeChange (pageSize) {
  130. this.pageSize = pageSize;
  131. this.loadTableYdb();
  132. },
  133. handleCurrentChange (pageNum) {
  134. this.pageIndex = pageNum;
  135. this.loadTableYdb();
  136. },
  137. bShuikuStatistic(){
  138. },
  139. szyAllQyshInfo(row,info){
  140. this.$emit('szyAllQyshInfo',row,info);
  141. },
  142. formatGateType:function(row, column){
  143. return row.type == "1" ? '水库'
  144. : row.type == "2" ? '湖泊'
  145. : row.type == "3" ? '河流'
  146. :row.type == "9" ? '其他':'';
  147. },
  148. },
  149. watch:{
  150. currentAdCode(n,o){
  151. this.adCode = n;
  152. this.loadTableYdb();
  153. }
  154. }
  155. }
  156. </script>
  157. <style>
  158. #skMain .el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content {
  159. background-color: #558ed0;
  160. }
  161. </style>