3e536cda80acef2df7811a27f14f2dba50e8813a.svn-base 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269
  1. <template>
  2. <el-row>
  3. <el-col :span="3">
  4. <div>
  5. <provTreeList :rootCode="rootCode" :rootType="rootType" @provTreeSelectChange="provTreeSelectChangeHandler"
  6. :style="{'max-height':dxdcAsideHeight+'px'}"
  7. >
  8. </provTreeList>
  9. </div>
  10. </el-col>
  11. <el-col :span="21">
  12. <el-card class="ducha_form" :body-style="{ 'padding': '20px 5px' }" :style="formStyle">
  13. <el-form :inline="true" :model="formInline" class="sh-form-inline">
  14. <el-form-item label="地下水监测站名称">
  15. <el-input v-model="formInline.stnm" :placeholder="autoInput" clearable></el-input>
  16. </el-form-item>
  17. <el-form-item label="地下水监测站类型">
  18. <el-select v-model="formInline.sttp" :placeholder="autoSort" clearable >
  19. <el-option v-for="item in options"
  20. :key="item.value"
  21. :label="item.label"
  22. :value="item.value"
  23. >
  24. </el-option>
  25. </el-select>
  26. </el-form-item>
  27. <!-- <el-form-item label="行政区划">
  28. <el-input v-model="formInline.adcd" :placeholder="autoInput" clearable ></el-input>
  29. </el-form-item> -->
  30. <el-form-item style="margin: 0">
  31. <el-button type="primary" @click="onSearch" icon="el-icon-search">查询</el-button>
  32. </el-form-item>
  33. <el-form-item style="margin: 0 5px">
  34. <el-button type="info" plain @click="empty" icon="el-icon-refresh">重置</el-button>
  35. </el-form-item>
  36. <el-form-item style="margin: 0">
  37. <el-button type="success" @click="exportExcel" icon="el-icon-sort-up">导出Excel</el-button>
  38. </el-form-item>
  39. <!-- <el-form-item style="margin: 0 5px" v-if="ownPriv('manage')">
  40. <el-button type="info" plain @click="batchImport" icon="el-icon-menu">导入</el-button>
  41. </el-form-item> -->
  42. <!-- 地下水监测站基础信息批量导入弹窗 -->
  43. <di-xia-shui-cha-xun-pl v-if="showDiXiaShuiChaXunPl" @closePlDialog="closePlDialog"
  44. :stnmStr="formInline.stnm"
  45. :sttpStr="formInline.sttp"
  46. :pageStr="page.pageNum"
  47. :adcd="formInline.adcd"
  48. >
  49. </di-xia-shui-cha-xun-pl>
  50. </el-form>
  51. </el-card>
  52. <el-card class="ducha_table" :body-style="{ 'padding': '0 5px' }">
  53. <el-main style="margin: 0 -5px;padding: 0">
  54. <el-table :data="tableList" style="width: 100%"
  55. ref="singleTable"
  56. v-loading="tableLoading"
  57. border
  58. :height="dxdcMainHeight+'px'"
  59. :render-header="renderHeader"
  60. >
  61. <el-table-column type="index" min-width="80" :index="getIndex" label="序号" show-overflow-tooltip></el-table-column>
  62. <el-table-column prop="stcd" label="监测站编码" min-width="100" show-overflow-tooltip></el-table-column>
  63. <el-table-column prop="stnm" label="监测站名称" min-width="100" show-overflow-tooltip></el-table-column>
  64. <el-table-column prop="adcd" label="行政区划代码" min-width="100" show-overflow-tooltip></el-table-column>
  65. <el-table-column prop="adnm" label="行政区划名称" min-width="130" show-overflow-tooltip></el-table-column>
  66. <el-table-column prop="sttp" label="监测站类型" min-min-width="130" :formatter="formatSttp" show-overflow-tooltip></el-table-column>
  67. <el-table-column prop="stlc" label="监测站位置" min-min-width="130" show-overflow-tooltip></el-table-column>
  68. <el-table-column prop="rvnm" label="监测站所属流域" min-min-width="130" show-overflow-tooltip></el-table-column>
  69. <el-table-column prop="mnun" label="管理单位" min-min-width="130" show-overflow-tooltip></el-table-column>
  70. <el-table-column prop="esstym" label="设站日期" min-min-width="130" show-overflow-tooltip></el-table-column>
  71. </el-table>
  72. </el-main>
  73. <el-footer class="el-footer-style">
  74. <el-pagination
  75. style="text-align:center;"
  76. small
  77. background
  78. :current-page.sync="page.pageNum"
  79. :page-size="page.pageSize"
  80. :page-sizes="[10, 20, 30, 40, 50, 100]"
  81. layout="sizes, total, prev, pager, next,jumper"
  82. :total="showResultCount"
  83. @current-change="pageIndexChange"
  84. @size-change="handleSizeChange"
  85. ></el-pagination>
  86. </el-footer>
  87. </el-card>
  88. </el-col>
  89. </el-row>
  90. </template>
  91. <style>
  92. .el-table .warning-row {
  93. background: oldlace;
  94. }
  95. .el-table .success-row {
  96. background: #f0f9eb;
  97. }
  98. .ducha_form .el-input {
  99. width: 200px !important;
  100. }
  101. .el-footer-style {
  102. text-align: center;
  103. width:100%;
  104. }
  105. </style>
  106. <script>
  107. // 监测站类别国家级:NATIONAL 省级自动:PROVAUTO 省级人工:PROVHAND 省级监测站(未知手动自动):PROV
  108. const options = [{
  109. value: 'NATIONAL',
  110. label: '国家级'
  111. }, {
  112. value: 'PROVAUTO',
  113. label: '省级自动'
  114. },{
  115. value: 'PROVHAND',
  116. label: '省级人工'
  117. },{
  118. value: 'PROV',
  119. label: '省级监测站(未知手动自动)'
  120. }];
  121. import provTreeList from '../../../widgets/provTreeList';
  122. import request from '../../../utils/gw_ajax_request.js';
  123. import diXiaShuiChaXunPl from './diXiaShuiChaXun_piliang';
  124. import { exportModel } from "@util/gw_exportModel";
  125. export default {
  126. name: "diXiaShuiChaXun",
  127. components:{
  128. provTreeList: provTreeList,
  129. diXiaShuiChaXunPl: diXiaShuiChaXunPl
  130. },
  131. data() {
  132. return {
  133. tableLoading:true,
  134. tableList: [],
  135. page:{
  136. pageNum: 1,
  137. pageSize: 20,
  138. },
  139. showResultCount: 0,
  140. options: options,
  141. autoSort: '请选择',
  142. autoInput: '请输入',
  143. formInline: {
  144. stnm: '',
  145. sttp: '',
  146. adcd: '',
  147. },
  148. rootCode:'000000',
  149. rootType:'2',
  150. formStyle: {
  151. width: '100%',
  152. height: '70px',
  153. },
  154. dxdcMainHeight: window.innerHeight - 197,
  155. dxdcAsideHeight: window.innerHeight - 90,
  156. showDiXiaShuiChaXunPl: false,
  157. }
  158. },
  159. mounted() {
  160. this.getDataList()
  161. },
  162. activated(){
  163. this.getDataList()
  164. },
  165. methods: {
  166. empty(){
  167. this.formInline = {};
  168. },
  169. formatSttp(row,column){
  170. let sttp = row.sttp;
  171. let _sttp = '';
  172. switch (sttp) {
  173. case 'NATIONAL' : _sttp = '国家级';break;
  174. case 'PROVAUTO' : _sttp = '省级自动';break;
  175. case 'PROVHAND' : _sttp = '省级人工';break;
  176. case 'PROV' : _sttp = '省级监测站(未知手动自动)';break;
  177. }
  178. return _sttp;
  179. },
  180. provTreeSelectChangeHandler: function(params) {
  181. this.formInline.adcd = params.likeCode;
  182. this.getDataList();
  183. },
  184. getIndex(index){
  185. return (index + this.page.pageSize * (this.page.pageNum - 1)) + 1
  186. },
  187. onSearch(){
  188. this.getDataList();
  189. },
  190. pageIndexChange(val){
  191. this.page.pageNum = val;
  192. this.getDataList();
  193. },
  194. handleSizeChange(val){
  195. this.page.pageSize = val;
  196. this.getDataList();
  197. },
  198. renderHeader(){
  199. },
  200. getDataList(){
  201. let params = {
  202. 'pageSize': this.page.pageSize,
  203. 'pageNum': this.page.pageNum,
  204. 'stnm': this.formInline.stnm,
  205. 'sttp': this.formInline.sttp,
  206. 'adcd': this.formInline.adcd,
  207. };
  208. request.post('/dc/insp/attGrwBase/pageInfo',params).then((res)=>{
  209. let data = res.data
  210. this.tableList = data.list
  211. this.showResultCount = data.total
  212. this.tableLoading = false
  213. })
  214. },
  215. batchImport(){
  216. this.showDiXiaShuiChaXunPl = true
  217. },
  218. closePlDialog(){
  219. this.showDiXiaShuiChaXunPl = false
  220. },
  221. getStrParams(obj) {
  222. let str = '?';
  223. for(let key of Object.keys(obj)) {
  224. str += `${key}=${obj[key]}&`;
  225. }
  226. str = str.slice(0, str.length - 1);
  227. return str;
  228. },
  229. // 导出Excel
  230. async exportExcel(){
  231. this.tableLoading = true;
  232. let type = "get";
  233. let url = `/pdcApi/dc/export/attGrwBase${this.getStrParams(Object.assign(this.formInline, this.page))}`;
  234. let downloadName = "Excel.xls";
  235. await exportModel(type,url,downloadName).catch((err) => {
  236. this.$message.error("导出失败");
  237. this.tableLoading = false;
  238. })
  239. this.$message.success("导出成功");
  240. this.tableLoading = false;
  241. },
  242. },
  243. computed: {
  244. },
  245. watch: {
  246. },
  247. }
  248. </script>