45afdbdcb076632949ee6a09a13a0a3350a8c3be.svn-base 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. <template>
  2. <div id="fpxMain" 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_fpx_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="tableData_fpxList" 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="name" label="名称" width="150" align="center" show-overflow-tooltip>
  29. </el-table-column>
  30. <el-table-column prop="code" label="编码" width="150" align="center" show-overflow-tooltip>
  31. </el-table-column>
  32. <el-table-column fixed="right" label="操作" min-width="200" align="center">
  33. <template slot-scope="scope">
  34. <el-button type="text" size="small" @click="SwzInfo(scope.row,'location')">定位</el-button>
  35. <!-- <el-button type="text" size="small" @click="SwzInfo(scope.row,'baseInfo')">基础信息</el-button> -->
  36. </template>
  37. </el-table-column>
  38. </el-table>
  39. <div class="block">
  40. <el-pagination background @size-change="handleSizeChange_fpx"
  41. @current-change="handleCurrentChange_fpx" :page-sizes="[10,50, 100, 200]"
  42. :page-size="15" layout="total,sizes, prev, pager, next" :pager-count="5"
  43. :total="recordTotal_fpx">
  44. </el-pagination>
  45. </div>
  46. </el-col>
  47. </div>
  48. </div>
  49. </el-col>
  50. </el-row>
  51. </div>
  52. </template>
  53. <script>
  54. import provTreeList from '../../../widgets/provTreeListAndChina'
  55. import request from '../../../utils/gw_ajax_request.js';
  56. import {getFuPinXianPage} from '../../../api/zhxxAPI.js'
  57. import {exportModel} from "@util/gw_exportModel";
  58. export default {
  59. name: "InfoSurfaceWater",
  60. components:{
  61. provTreeList
  62. },
  63. props:["dcztStatus","dcztDisabled","currentAdCode","layerId"],
  64. data() {
  65. return {
  66. currentType:'',
  67. rootCode:'000000',
  68. rootType:'2',
  69. model_fpx_name:'',
  70. recordTotal_dxs:'',
  71. tableData_fpxList:[],
  72. recordTotal_fpx:0,
  73. pageSize_fpx: 10,
  74. pageIndex_fpx: 1,
  75. loading: false,
  76. adCode:'',
  77. exportLoading:false,
  78. }
  79. },
  80. computed: {
  81. recPersId() {
  82. return localStorage.getItem("userid") ? localStorage.getItem("userid") : ''
  83. }
  84. },
  85. watch:{
  86. currentAdCode(n,o){
  87. if(n == '0000000000'){
  88. n = '';
  89. }
  90. this.adCode = n;
  91. this.loadTableFpx();
  92. },
  93. layerId(n,o){
  94. if(n == 'mapServer_fpx'){//扶贫县 全部
  95. this.currentType = 'fpx';
  96. }else if(n == 'mapServer_zdx'){//重点扶贫县
  97. this.currentType = 'zdx';
  98. }else if(n == 'mapServer_bjx'){//边境扶贫县
  99. this.currentType = 'bjx';
  100. }else if(n == 'mapServer_tcx'){//天窗扶贫县
  101. this.currentType = 'tcx';
  102. }else if(n == 'mapServer_ddfp'){//定点扶贫县
  103. this.currentType = 'ddfp';
  104. }
  105. }
  106. },
  107. mounted(){
  108. let _this = this;
  109. if(_this.layerId == 'mapServer_fpx'){//扶贫县 全部
  110. _this.currentType = 'fpx';
  111. }else if(_this.layerId == 'mapServer_zdx'){//重点扶贫县
  112. _this.currentType = 'zdx';
  113. }else if(_this.layerId == 'mapServer_bjx'){//边境扶贫县
  114. _this.currentType = 'bjx';
  115. }else if(_this.layerId == 'mapServer_tcx'){//天窗扶贫县
  116. _this.currentType = 'tcx';
  117. }else if(_this.layerId == 'mapServer_ddfp'){//定点扶贫县
  118. _this.currentType = 'ddfp';
  119. }
  120. _this.dczt = _this.dcztStatus;
  121. _this.loadTableFpx();
  122. },
  123. methods:{
  124. indexMethod_country(index) {
  125. return (index + 1) + this.pageSize_fpx * (this.pageIndex_fpx - 1)
  126. },
  127. provTreeSelectChangeHandler(params) {
  128. if(params.code == '000000000000'){
  129. this.adCode = '';
  130. }else{
  131. this.adCode = params.code;
  132. }
  133. this.$nextTick(()=>{
  134. this.pageSize_fpx = 10;
  135. this.pageIndex_fpx = 1;
  136. this.loadTableFpx();
  137. })
  138. },
  139. searchByName() {
  140. this.loadTableFpx();
  141. },
  142. async exPort(){
  143. let _self = this;
  144. this.exportLoading = true;
  145. let data = {};
  146. data.code = _self.adCode;
  147. data.name = _self.model_fpx_name;
  148. data[_self.currentType] = '1';
  149. data.isExport = '1';
  150. let datas = JSON.stringify(data);
  151. let url = `/pdcApi/att/pkx/base/page`;
  152. let downloadName = '';
  153. if(_self.currentType == 'fpx'){
  154. downloadName = '扶贫县.xls';
  155. }else if(_self.currentType == 'zdx'){
  156. downloadName = '重点扶贫县.xls';
  157. }else if(_self.currentType == 'bjx'){
  158. downloadName = '边境扶贫县.xls';
  159. }else if(_self.currentType == 'tcx'){
  160. downloadName = '天窗扶贫县.xls';
  161. }else if(_self.currentType == 'ddfp'){
  162. downloadName = '定点扶贫县.xls';
  163. }
  164. let type = "post";
  165. let result = await exportModel(type,url,downloadName,datas);
  166. this.exportLoading = result;
  167. },
  168. loadTableFpx() {
  169. let _this = this;
  170. _this.loading = true;
  171. let str = _this.currentType;
  172. let obj = {
  173. 'code':_this.adCode,
  174. 'name':_this.model_fpx_name,
  175. 'pageNum': _this.pageIndex_fpx,
  176. 'pageSize': _this.pageSize_fpx,
  177. }
  178. obj[_this.currentType] = '1';
  179. getFuPinXianPage(obj).then((res)=>{
  180. if (res.success) {
  181. _this.$nextTick(function () {
  182. _this.loading = false;
  183. var obj = res.data;
  184. _this.tableData_fpxList = obj.list;
  185. _this.recordTotal_fpx = obj.total;
  186. })
  187. }
  188. })
  189. },
  190. handleSizeChange_fpx (pageSize) {
  191. this.pageSize_fpx = pageSize;
  192. this.loadTableFpx();
  193. },
  194. handleCurrentChange_fpx (pageNum) {
  195. this.pageIndex_fpx = pageNum;
  196. this.loadTableFpx();
  197. },
  198. bShuikuStatistic(){
  199. },
  200. SwzInfo(row,info){
  201. this.$emit('SwzInfo',row,info);
  202. },
  203. },
  204. }
  205. </script>
  206. <style>
  207. #fpxMain .el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content {
  208. background-color: #558ed0;
  209. }
  210. </style>