9e5d06915239045f4db217d6dcef9acc74d4cf1e.svn-base 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. <template>
  2. <div v-loading='exportLoading'>
  3. <el-row>
  4. <el-col :span="24">
  5. <div class="grid-content bg-purple-light">
  6. <div style="padding:5px;">
  7. <span style="font-size: 12px;margin-left: 10px;">名称:</span>
  8. <el-input style="width:130px;" class="kjr-input" size="mini"
  9. v-model="model_country_name" 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:0px;">
  16. <el-table :data="tableData_countrywaterList" height="510" border stripe
  17. style="width: 100%" v-loading="loading">
  18. <el-table-column type="index" min-width="50" label="序号" align="center"
  19. :index="indexMethod_country">
  20. </el-table-column>
  21. <el-table-column prop="adCode" label="行政区划代码" min-width="110" align="center">
  22. </el-table-column>
  23. <el-table-column prop="adName" label="名称" min-width="160" align="center" sortable>
  24. </el-table-column>
  25. <el-table-column prop="adGrad" label="行政区划等级" min-width="120" align="center"
  26. :formatter="formatter_country_xzqh">
  27. </el-table-column>
  28. <el-table-column fixed="right" label="操作" min-width="200" align="center">
  29. <template slot-scope="scope">
  30. <el-button type="text" size="small" @click="ryInfo(scope.row,'location')">定位</el-button>
  31. <!-- <el-button type="text" size="small" @click="ryInfo(scope.row,'baseInfo')">基础信息</el-button> -->
  32. <el-button type="text" size="small" @click="ryInfo(scope.row,'dcInfo')">督查信息</el-button>
  33. </template>
  34. </el-table-column>
  35. </el-table>
  36. <div class="block" style='text-align: center;'>
  37. <el-pagination background @size-change="handleSizeChange_country"
  38. @current-change="handleCurrentChange_country" :page-sizes="[10,50, 100, 200]"
  39. :page-size="15" layout="total,sizes, prev, pager, next"
  40. :total="recordTotal_country">
  41. </el-pagination>
  42. </div>
  43. </div>
  44. </div>
  45. </el-col>
  46. </el-row>
  47. </div>
  48. </template>
  49. <script>
  50. import request from '../../../utils/gw_ajax_request.js';
  51. import {exportModel} from "@util/gw_exportModel";
  52. export default {
  53. name: "peopleDrink",
  54. props:["currentAdCode"],
  55. data() {
  56. return {
  57. model_country_name:'',
  58. tableData_countrywaterList:[],
  59. pageSize_country: 10,
  60. pageIndex_country: 1,
  61. recordTotal_country: 0,
  62. loading: false,
  63. objtype: '23',
  64. exportLoading:false,
  65. }
  66. },
  67. mounted(){
  68. this.loadTableCountry();
  69. },
  70. methods:{
  71. searchByName(){
  72. this.loadTableCountry();
  73. },
  74. async exPort(){
  75. this.exportLoading = true;
  76. let url = `/pdcApi/dc/insp/obj/getObjByPersId?persGuid=${localStorage.getItem("userid")}&objType=${this.objtype}&adName=${this.model_country_name}&adCode=${this.currentAdCode}&isExport=1`;
  77. let downloadName = "督查县.xls";
  78. let type = "get";
  79. let result = await exportModel(type,url,downloadName);
  80. this.exportLoading = result;
  81. },
  82. loadTableCountry() {
  83. this.loading = true;
  84. request.get(`/dc/insp/obj/getPageByPersId`, {
  85. params: {
  86. persGuid: localStorage.getItem("userid"),
  87. objType: this.objtype,
  88. pageNum: this.pageIndex_country,
  89. pageSize: this.pageSize_country,
  90. adName: this.model_country_name,
  91. adCode: this.currentAdCode
  92. }
  93. })
  94. .then((res) => {
  95. this.loading = false;
  96. if (res.success) {
  97. var obj = res.data;
  98. this.tableData_countrywaterList = obj.list;
  99. this.recordTotal_country = obj.total;
  100. }
  101. })
  102. },
  103. location2() {
  104. },
  105. indexMethod_country(index) {
  106. return (index + 1) + this.pageSize_country * (this.pageIndex_country - 1)
  107. },
  108. formatter_country_xzqh(row, column) {
  109. switch (row.adGrad) {
  110. case "1":
  111. return "中国"
  112. break;
  113. case "2":
  114. return "省级"
  115. break;
  116. case "3":
  117. return "市级"
  118. break;
  119. case "4":
  120. return "县级"
  121. break;
  122. case "5":
  123. return "乡级"
  124. break;
  125. case "6":
  126. return "乡级"
  127. break;
  128. default:
  129. return "--"
  130. break;
  131. }
  132. },
  133. handleSizeChange_country: function (pageSize) {
  134. this.pageSize_country = pageSize;
  135. this.loadTableCountry();
  136. },
  137. handleCurrentChange_country: function (pageNum) {
  138. this.pageIndex_country = pageNum;
  139. this.loadTableCountry();
  140. },
  141. ryInfo(row,info){
  142. this.$emit('ryInfo',row,info)
  143. },
  144. },
  145. watch:{
  146. currentAdCode(){
  147. this.loadTableCountry();
  148. }
  149. }
  150. }
  151. </script>
  152. <style scoped>
  153. </style>