e71c3ac3fb41298b2eb2f04d3ba1414a38d8941c.svn-base 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572
  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="水库编码" style="margin-left: 5px">-->
  15. <!--<el-input v-model="formInline.rsCode" :placeholder="autoInput" clearable></el-input>-->
  16. <!--</el-form-item>-->
  17. <el-form-item label="水库名称">
  18. <el-input v-model="formInline.rsName" :placeholder="autoInput" clearable></el-input>
  19. </el-form-item>
  20. <el-form-item label="水库类型">
  21. <el-select v-model="formInline.rsType" :placeholder="autoSort" clearable >
  22. <el-option v-for="item in options"
  23. :key="item.value"
  24. :label="item.label"
  25. :value="item.value"
  26. >
  27. </el-option>
  28. </el-select>
  29. </el-form-item>
  30. <el-form-item label="工程规模">
  31. <el-select v-model="formInline.engScal" :placeholder="autoSort" clearable >
  32. <el-option v-for="item in engScalOptions"
  33. :key="item.value"
  34. :label="item.label"
  35. :value="item.value"
  36. >
  37. </el-option>
  38. </el-select>
  39. </el-form-item>
  40. <!--<el-form-item label="水库管理单位代码">-->
  41. <!--<el-input v-model="formInline.rsAdmCode" :placeholder="autoInput" clearable></el-input>-->
  42. <!--</el-form-item>-->
  43. <!--<br/>-->
  44. <!--<el-form-item label="水库位置">-->
  45. <!--<el-input v-model="formInline.adFullName" :placeholder="autoInput" clearable></el-input>-->
  46. <!--</el-form-item>-->
  47. <!--<el-form-item label="管理单位名称">-->
  48. <!--<el-input v-model="formInline.rsAdmName" :placeholder="autoInput" clearable></el-input>-->
  49. <!--</el-form-item>-->
  50. <!--<el-form-item label="行政区划">-->
  51. <!--<el-input v-model="formInline.addvcd" :placeholder="autoInput" clearable ></el-input>-->
  52. <!--</el-form-item>-->
  53. <el-form-item style="margin: 0">
  54. <el-button type="primary" @click="onSearch" icon="el-icon-search">查询</el-button>
  55. </el-form-item>
  56. <el-form-item style="margin: 0 5px">
  57. <el-button type="info" plain @click="empty" icon="el-icon-refresh">重置</el-button>
  58. </el-form-item>
  59. <el-form-item>
  60. <el-button type="success" @click="exportExcel" icon="el-icon-sort-up">导出Excel</el-button>
  61. </el-form-item>
  62. <el-form-item>
  63. <el-button type="primary" @click="showDialog(1,null)" icon="el-icon-edit">批量编辑</el-button>
  64. </el-form-item>
  65. <!-- <el-form-item style="margin: 0 5px" v-if="ownPriv('manage')">
  66. <el-button type="info" plain @click="batchImport" icon="el-icon-menu">导入</el-button>
  67. </el-form-item> -->
  68. <!-- 水库基础信息批量导入弹窗 -->
  69. <shui-ku-cha-xun-pl v-if="showShuiKuChaXunPl" @closePlDialog="closePlDialog"
  70. :rsNameStr="formInline.rsName"
  71. :rsTypeStr="formInline.rsType"
  72. :pageStr="page.pageNum"
  73. :admDiv="formInline.addvcd"
  74. ></shui-ku-cha-xun-pl>
  75. </el-form>
  76. </el-card>
  77. <el-card class="ducha_table" :body-style="{ 'padding': '0 5px' }">
  78. <el-main style="padding: 5px!important;">
  79. <el-table :data="tableList" style="width: 100%" :row-class-name="tableRowClassName"
  80. ref="singleTable"
  81. v-loading="tableLoading"
  82. border
  83. @selection-change="handleSelectionChange"
  84. :height="dxdcMainHeight+'px'"
  85. :render-header="renderHeader"
  86. >
  87. <el-table-column
  88. type="selection"
  89. min-width="55">
  90. </el-table-column>
  91. <el-table-column type="index" width="70" :index="getIndex" label="序号" show-overflow-tooltip></el-table-column>
  92. <el-table-column prop="rsCode" label="水库编码" min-width="130" show-overflow-tooltip></el-table-column>
  93. <el-table-column prop="rsName" label="水库名称" min-width="130" show-overflow-tooltip></el-table-column>
  94. <!--<el-table-column prop="location" label="水库位置" min-width="180" show-overflow-tooltip></el-table-column>-->
  95. <!--<el-table-column prop="adName" label="水库位置" min-width="180" show-overflow-tooltip></el-table-column>-->
  96. <!--<el-table-column prop="adFullName" label="水库位置" min-width="200" show-overflow-tooltip></el-table-column>-->
  97. <el-table-column prop="rsType" label="水库类型" min-min-width="80" :formatter="formatRsType" show-overflow-tooltip></el-table-column>
  98. <el-table-column prop="rsAdmCode" label="管理单位代码" min-width="120" show-overflow-tooltip></el-table-column>
  99. <el-table-column prop="rsAdmName" label="管理单位名称" min-width="180" show-overflow-tooltip></el-table-column>
  100. <!--<el-table-column prop="rsAdmDep" label="水库归口管理部门" min-width="150" show-overflow-tooltip></el-table-column>-->
  101. <!--<el-table-column prop="admAttRel" label="管理单位隶属关系" min-width="180" show-overflow-tooltip></el-table-column>-->
  102. <!--<el-table-column prop="longitude" label="经度" min-width="180" show-overflow-tooltip></el-table-column>-->
  103. <!--<el-table-column prop="latitude" label="纬度" min-width="180" show-overflow-tooltip></el-table-column>-->
  104. <el-table-column prop="admDiv" label="行政区划" min-width="130" show-overflow-tooltip></el-table-column>
  105. <el-table-column prop="provincial" label="是否省属" width="100" >
  106. <template slot-scope="scope">
  107. <span v-if="scope.row.provincial=='1'">是</span>
  108. <span v-if="scope.row.provincial=='2'">否</span>
  109. </template>
  110. </el-table-column>
  111. <el-table-column prop="engScal"
  112. label="工程规模"
  113. min-width="130"
  114. :formatter="formatEngScal"
  115. show-overflow-tooltip
  116. >
  117. </el-table-column>
  118. <el-table-column prop="limStag" label="防洪限制水位(米)" min-width="130" show-overflow-tooltip></el-table-column>
  119. <el-table-column prop="totCap" label="总库容(万立方米)" min-width="130" show-overflow-tooltip></el-table-column>
  120. <!--<el-table-column prop="damTypeMat" label="挡水主坝类型按材料分" min-width="180"></el-table-column>-->
  121. <!--<el-table-column prop="damTypeStr" label="挡水主坝类型按结构分" min-width="180"></el-table-column>-->
  122. <el-table-column prop="damSizeHig" label="主坝尺寸坝高(米)" min-width="130" show-overflow-tooltip></el-table-column>
  123. <!--<el-table-column prop="centerX" label="经度" min-width="180" show-overflow-tooltip></el-table-column>-->
  124. <!--<el-table-column prop="centerY" label="纬度" min-width="180" show-overflow-tooltip></el-table-column>-->
  125. <el-table-column label="行政责任人信息" align="center">
  126. <el-table-column prop="wiunWaoLegPers1" label="责任人姓名" min-width="130" show-overflow-tooltip align="center"></el-table-column>
  127. <el-table-column prop="wiunWaoLegPersTel1" label="责任人电话" min-width="130" show-overflow-tooltip align="center"></el-table-column>
  128. <el-table-column prop="wiunWaoLegPersDuty1" label="责任人职务" min-width="130" show-overflow-tooltip align="center"></el-table-column>
  129. </el-table-column>
  130. <el-table-column label="技术责任人信息" align="center">
  131. <el-table-column prop="techPers1" label="责任人姓名" min-width="130" show-overflow-tooltip align="center"></el-table-column>
  132. <el-table-column prop="techPersTel1" label="责任人电话" min-width="130" show-overflow-tooltip align="center"></el-table-column>
  133. <el-table-column prop="techPersDuty1" label="责任人职务" min-width="130" show-overflow-tooltip align="center"></el-table-column>
  134. </el-table-column>
  135. <el-table-column label="巡查责任人信息" align="center">
  136. <el-table-column prop="patrolPers1" label="责任人姓名" min-width="130" show-overflow-tooltip align="center"></el-table-column>
  137. <el-table-column prop="patrolPersTel1" label="责任人电话" min-width="130" show-overflow-tooltip align="center"></el-table-column>
  138. <el-table-column prop="patrolPersDuty1" label="责任人职务" min-width="130" show-overflow-tooltip align="center"></el-table-column>
  139. <!-- <el-table-column prop="patrolPersDuty"
  140. label="责任人身份"
  141. min-width="130"
  142. show-overflow-tooltip
  143. align="center"
  144. :formatter="formatPatrolPersDuty"
  145. ></el-table-column> -->
  146. </el-table-column>
  147. <el-table-column label="操作" align="center" fixed="right" min-width="100">
  148. <template slot-scope="scope">
  149. <el-button type="primary" icon="el-icon-edit" @click="showDialog(0,scope.row)">编辑</el-button>
  150. </template>
  151. </el-table-column>
  152. <el-table-column label="设置监控" align="center" fixed="right" min-width="120" v-if="isFj">
  153. <template slot-scope="scope">
  154. <el-button type="primary" icon="el-icon-edit" v-if="isFj" @click="showDialogView(scope.row)">绑定监控</el-button>
  155. </template>
  156. </el-table-column>
  157. </el-table>
  158. </el-main>
  159. <el-footer class="el-footer-style">
  160. <el-pagination
  161. style="text-align:center;"
  162. small
  163. background
  164. :current-page.sync="page.pageNum"
  165. :page-size="page.pageSize"
  166. :page-sizes="[10, 20, 30, 40, 50, 100]"
  167. layout="sizes, total, prev, pager, next,jumper"
  168. :total="showResultCount"
  169. @current-change="pageIndexChange"
  170. @size-change="handleSizeChange"
  171. ></el-pagination>
  172. </el-footer>
  173. </el-card>
  174. </el-col>
  175. <el-dialog
  176. class="outerDialog custom_dialog"
  177. title="编辑是否省属"
  178. width="400px"
  179. :visible.sync="isVisible">
  180. <div style="width: 100%;height:100%;">
  181. <el-form ref="addForm" label-width="80px">
  182. <el-form-item label="是否省属" required>
  183. <el-select v-model="provincial" clearable placeholder="请选择" style="width: 100%;">
  184. <el-option label="是" value="1"></el-option>
  185. <el-option label="否" value="2"></el-option>
  186. </el-select>
  187. </el-form-item>
  188. <el-form-item style="text-align: center">
  189. <el-button @click="isVisible=false" style="margin-bottom: 30px;">取消</el-button>
  190. <el-button type="primary" @click="submit" style="margin-bottom: 30px;">确定</el-button>
  191. </el-form-item>
  192. </el-form>
  193. </div>
  194. </el-dialog>
  195. <el-dialog
  196. class="outerDialog custom_dialog"
  197. title="绑定监控点"
  198. width="400px"
  199. :visible.sync="isVisibleView">
  200. <div style="width: 100%;height:100%;">
  201. <el-form ref="addForm" label-width="80px">
  202. <el-form-item label="监控点" required>
  203. <el-select v-model="viewList" clearable multiple filterable collapse-tags placeholder="请选择" style="width: 100%;">
  204. <el-option :label="item.indexName" :value="item.indexCode" v-for="(item,index) in allViewList"></el-option>
  205. </el-select>
  206. </el-form-item>
  207. <el-form-item style="text-align: center">
  208. <el-button @click="isVisibleView=false" style="margin-bottom: 30px;">取消</el-button>
  209. <el-button type="primary" @click="submitView" style="margin-bottom: 30px;">确定</el-button>
  210. </el-form-item>
  211. </el-form>
  212. </div>
  213. </el-dialog>
  214. </el-row>
  215. </template>
  216. <style>
  217. .el-table {
  218. }
  219. .el-table .warning-row {
  220. background: oldlace;
  221. }
  222. .el-table .success-row {
  223. background: #f0f9eb;
  224. }
  225. .ducha_form {
  226. /*width: 100%;*/
  227. /*height: 70px;*/
  228. }
  229. .ducha_form .el-input {
  230. width: 150px !important;
  231. }
  232. .ducha_form label {
  233. /*margin-left: 15px;*/
  234. }
  235. .ducha_table{
  236. }
  237. .el-footer-style {
  238. text-align: center;
  239. width:100%;
  240. }
  241. .sh-form-inline {
  242. }
  243. </style>
  244. <script>
  245. // 造数据
  246. let options = [{
  247. value: "'1'",
  248. label: '山丘水库'
  249. }, {
  250. value: "'2'",
  251. label: '平原水库'
  252. },{
  253. value: "'3'",
  254. label: '地下水库'
  255. }];
  256. // 工程规模
  257. let engScalLabels = [ '大(1)型','大(2)型','中型','小(1)型','小(2)型','其他'];
  258. let engScalValues = ['1','2','3','4','5','9'];
  259. let engScalOptions = [engScalLabels.length];
  260. for(let i=0;i<engScalLabels.length;i++){
  261. engScalOptions[i] = {'label':engScalLabels[i],'value':engScalValues[i]};
  262. }
  263. import provTreeList from '../../../widgets/provTreeList';
  264. import request from '../../../utils/gw_ajax_request.js';
  265. import shuiKuChaXunPl from './shuiKuChaXun_piliang.vue';
  266. import { exportModel } from "@util/gw_exportModel";
  267. export default {
  268. name: "shuiKuChaXun",
  269. components:{
  270. provTreeList: provTreeList,
  271. shuiKuChaXunPl: shuiKuChaXunPl
  272. },
  273. data() {
  274. return {
  275. tableLoading:true,
  276. tableList: [],
  277. page:{
  278. pageNum: 1,
  279. pageSize: 20,
  280. },
  281. showResultCount: 0,
  282. options: options,
  283. engScalOptions: engScalOptions,
  284. autoSort: '请选择',
  285. autoInput: '请输入',
  286. formInline: {
  287. rsCode: '',
  288. rsName: '',
  289. rsType: '',
  290. rsAdmCode: '',
  291. rsAdmName: '',
  292. location: '',
  293. adName: '',
  294. adFullName: '',
  295. addvcd: '',
  296. engScal: ''
  297. },
  298. rootCode:'000000',
  299. // rootType:'1',
  300. rootType:'2',
  301. formStyle: {
  302. width: '100%',
  303. height: '70px',
  304. },
  305. // dxdcMainHeight: window.innerHeight - 197,
  306. dxdcMainHeight: window.innerHeight - 200,
  307. dxdcAsideHeight: window.innerHeight - 90,
  308. showShuiKuChaXunPl: false,
  309. multipleSelection:[],
  310. isVisible:false,
  311. isVisibleView:false,
  312. provincial:"",
  313. isMul:false,
  314. currentRow:{},
  315. viewList:[],
  316. allViewList:[]
  317. }
  318. },
  319. computed: {
  320. isFj(){
  321. if(localStorage.getItem('currentRlcode').substring(0,2)=="35"){
  322. return true;
  323. }else{
  324. return false;
  325. }
  326. }
  327. },
  328. mounted() {
  329. this.getShuiKuList()
  330. },
  331. activated(){
  332. this.getShuiKuList()
  333. },
  334. methods: {
  335. submit(){
  336. if(!this.provincial){
  337. this.$message.warning("请选择是否省属");
  338. return false;
  339. }
  340. if(this.isMul){
  341. var list = [];
  342. this.multipleSelection.forEach((item,index)=>{
  343. list.push(item.rsCode);
  344. })
  345. request.put('/dc/insp/rsvrRgstr/attRsBase/provincial',{provincial:this.provincial,rsCodes:list}).then((res)=>{
  346. if(res.success){
  347. this.multipleSelection = [];
  348. this.isVisible = false;
  349. this.getShuiKuList();
  350. }
  351. })
  352. }else{
  353. var params = {
  354. rsCodes:[this.currentRow.rsCode],
  355. provincial:this.provincial
  356. }
  357. request.put('/dc/insp/rsvrRgstr/attRsBase/provincial',params).then((res)=>{
  358. if(res.success){
  359. this.isVisible = false;
  360. this.getShuiKuList();
  361. }
  362. })
  363. }
  364. },
  365. submitView(){
  366. // //debugger
  367. let newList = [];
  368. if(this.viewList && this.viewList.length==0){
  369. this.$message.warning("请选择监控点");
  370. return false;
  371. }
  372. this.allViewList.forEach((item,index)=>{
  373. if(this.viewList.indexOf(item.indexCode)>-1){
  374. item.rsCode = this.currentRow.rsCode;
  375. newList.push(item);
  376. }
  377. })
  378. request.post('/bis/insp/rsvr/camera/batch ',newList).then((res)=>{
  379. if(res.success){
  380. this.isVisibleView = false;
  381. this.getShuiKuList();
  382. }
  383. })
  384. },
  385. getAllViewList(rsName,rsCode){
  386. const _this = this;
  387. request.get('/bis/insp/rsvr/camera/selectOptions?rsName='+rsName).then((res)=>{
  388. _this.allViewList = res.data;
  389. _this.getSelectViewList(rsCode);
  390. })
  391. },
  392. showDialogView(row){
  393. this.currentRow = row;
  394. this.isVisibleView = true;
  395. this.viewList = [];
  396. this.allViewList = [];
  397. this.getAllViewList(row.rsName,row.rsCode);
  398. },
  399. getSelectViewList(rsCode){
  400. const _this = this;
  401. request.get('/bis/insp/rsvr/camera/'+rsCode).then((res)=>{
  402. if(res.data){
  403. res.data.forEach((item,index)=>{
  404. _this.viewList.push(item.indexCode);
  405. })
  406. }
  407. })
  408. },
  409. showDialog(t,row){
  410. if(t==1){
  411. this.provincial = "";
  412. this.isMul = true;
  413. if(!this.multipleSelection || this.multipleSelection.length==0){
  414. this.$message.warning("请选择数据");
  415. return false;
  416. }
  417. }else{
  418. this.currentRow = row;
  419. this.isMul = false;
  420. }
  421. this.isVisible = true;
  422. },
  423. handleSelectionChange(val) {
  424. this.multipleSelection = val;
  425. },
  426. empty(){
  427. this.formInline = {};
  428. },
  429. formatRsType(row,column){
  430. let rsType = row.rsType;
  431. let _rsType = '其他';
  432. switch (rsType) {
  433. case '1' : _rsType = '山丘水库';break;
  434. case '2' : _rsType = '平原水库';break;
  435. case '3' : _rsType = '地下水库';break;
  436. }
  437. return _rsType;
  438. },
  439. formatEngScal(row,column){
  440. let engScal = row.engScal;
  441. let _engScal = '其他';
  442. switch (engScal) {
  443. case '1' : _engScal = '大(1)型';break;
  444. case '2' : _engScal = '大(2)型';break;
  445. case '3' : _engScal = '中型';break;
  446. case '4' : _engScal = '小(1)型';break;
  447. case '5' : _engScal = '小(2)型';break;
  448. case '9' : _engScal = '其他';break;
  449. }
  450. return _engScal;
  451. },
  452. formatPatrolPersDuty(row,column){
  453. return row.patorPersDuty == '1' ? '专职' : row.patorPersDuty == '2' ? '兼职' : '';
  454. },
  455. provTreeSelectChangeHandler: function(params) {
  456. // this.formInline.addvcd = params.code;
  457. this.formInline.addvcd = params.likeCode;
  458. // this.formInline.rsAdmCode = params.likeCode;
  459. this.getShuiKuList();
  460. },
  461. getIndex(index){
  462. return (index + this.page.pageSize * (this.page.pageNum - 1)) + 1
  463. },
  464. onSearch(){
  465. this.getShuiKuList();
  466. },
  467. pageIndexChange(val){
  468. this.page.pageNum = val;
  469. this.getShuiKuList();
  470. },
  471. handleSizeChange(val){
  472. this.page.pageSize = val;
  473. this.getShuiKuList();
  474. },
  475. renderHeader(){
  476. },
  477. tableRowClassName({row, rowIndex}) {
  478. // if (rowIndex === 1) {
  479. // return 'warning-row';
  480. // } else if (rowIndex === 3) {
  481. // return 'success-row';
  482. // }
  483. return '';
  484. },
  485. getShuiKuList(){
  486. let params = {
  487. 'pageSize': this.page.pageSize,
  488. 'pageNum': this.page.pageNum,
  489. 'rsCode': this.formInline.rsCode,
  490. 'rsName': this.formInline.rsName,
  491. 'rsType': this.formInline.rsType,
  492. 'rsAdmCode': this.formInline.rsAdmCode,
  493. 'rsAdmName': this.formInline.rsAdmName,
  494. 'adName': this.formInline.adName,
  495. 'adFullName': this.formInline.adFullName,
  496. 'admDiv': this.formInline.addvcd,
  497. 'engScal': this.formInline.engScal,
  498. };
  499. var _self = this;
  500. request.post('/dc/insp/rsvrRgstr/attRsBase',params).then((res)=>{
  501. let data = res.data
  502. this.tableList = data.list
  503. this.showResultCount = data.total
  504. this.tableLoading = false
  505. this.$nextTick(()=>{
  506. _self.$refs.singleTable.clearSelection();
  507. })
  508. })
  509. console.log('高度:'+ parseInt(this.formStyle.height.replace('px','')/2) )
  510. },
  511. batchImport(){
  512. this.showShuiKuChaXunPl = true
  513. },
  514. closePlDialog(){
  515. this.showShuiKuChaXunPl = false
  516. },
  517. getStrParams(obj) {
  518. let str = '?';
  519. for(let key of Object.keys(obj)) {
  520. str += `${key}=${obj[key]}&`;
  521. }
  522. str = str.slice(0, str.length - 1);
  523. return str;
  524. },
  525. // 导出Excel
  526. async exportExcel(){
  527. this.tableLoading = true;
  528. let type = "get";
  529. let url = `/pdcApi/dc/export/attRsBase${this.getStrParams(Object.assign(this.formInline, this.page))}`;
  530. let downloadName = "Excel.xls";
  531. await exportModel(type,url,downloadName).catch((err) => {
  532. this.$message.error("导出失败");
  533. this.tableLoading = false;
  534. })
  535. this.$message.success("导出成功");
  536. this.tableLoading = false;
  537. }
  538. },
  539. watch: {
  540. },
  541. }
  542. </script>