a1f4df292b1e28cf451e919fb822c22c3bbb65fa.svn-base 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549
  1. <template>
  2. <div style="height:100%;width:100%;">
  3. <el-container style="height:100%;width:100%;">
  4. <el-aside width="320px" style="border-right:2px solid #d5d5ff;float:left"
  5. :style="{'max-height':testHeight+'px','height':testHeight+'px'}">
  6. <tb-left-tree orgType="030" @treeNodeClickHandler="treeNodeClickHandler" @organList="getOrganList"
  7. @changeYear="changeYear"></tb-left-tree>
  8. </el-aside>
  9. <!-- 主要窗口 -->
  10. <el-main id="dxdcListMaindf" style="padding:5px 20px;">
  11. <el-row>
  12. <el-col :span="24">
  13. <el-form :inline="true" size="mini" class="demo-form-inline" style="padding-left: 10px;">
  14. <el-form-item label="督查状态">
  15. <el-select v-model="dcType" clearable placeholder="督查状态">
  16. <el-option label="未督查" value="0"></el-option>
  17. <el-option label="督查中" value="1"></el-option>
  18. <el-option label="已督查" value="2"></el-option>
  19. </el-select>
  20. </el-form-item>
  21. <el-form-item label="超标洪预案名称">
  22. <el-input v-model="name" placeholder="超标洪预案名称" clearable></el-input>
  23. </el-form-item>
  24. <el-form-item label="项目类别">
  25. <el-select v-model="type" clearable placeholder="督查状态">
  26. <el-option :label="item.label" :value="item.value" v-for="item in typeList" :key="item.value"></el-option>
  27. </el-select>
  28. </el-form-item>
  29. <el-form-item label="所在组">
  30. <el-autocomplete v-model="groupName" clearable value-key='nm'
  31. :fetch-suggestions="querySearchAsync" placeholder="请输入内容"
  32. @select="handleSelect"></el-autocomplete>
  33. </el-form-item>
  34. <el-form-item label="督查时间">
  35. <div style="display: flex;">
  36. <el-date-picker
  37. v-model="dateRange"
  38. type="daterange"
  39. value-format="yyyy-MM-dd"
  40. style="width:100%"
  41. range-separator="至"
  42. start-placeholder="开始日期"
  43. end-placeholder="结束日期"
  44. ></el-date-picker>
  45. </div>
  46. </el-form-item>
  47. <el-form-item>
  48. <el-button type="primary" @click="onSubmit" icon="el-icon-search">查询</el-button>
  49. <el-button type="success" @click="reFresh" icon="el-icon-refresh">刷新</el-button>
  50. </el-form-item>
  51. </el-form>
  52. </el-col>
  53. </el-row>
  54. <el-table
  55. ref="table"
  56. border
  57. :height="tableHeight"
  58. :data="chbDataList"
  59. style="width: 100%"
  60. v-loading="expLoading">
  61. <el-table-column prop="nm" label="督查项目" min-width="130" align="center"
  62. fixed="left"></el-table-column>
  63. <el-table-column
  64. prop="type"
  65. min-width="200"
  66. label="类别"
  67. :formatter="typeFormatter">
  68. </el-table-column>
  69. <el-table-column prop="groupName" label="所在组" show-overflow-tooltip min-width="150"
  70. align="center"></el-table-column>
  71. <el-table-column prop="intm" label="督查时间" show-overflow-tooltip min-width="200"
  72. align="center"></el-table-column>
  73. <el-table-column
  74. prop="state"
  75. label="督查状态"
  76. align="center"
  77. min-width="130">
  78. <template slot-scope="scope">
  79. <span style="padding: 3px 10px;background:#F56C6C;border-radius:15px;color:rgba(255,255,255,1)"
  80. v-if="scope.row.state == 0"
  81. >未督查</span>
  82. <span
  83. style="padding: 3px 10px;background:#FBB56D;border-radius:15px;color:rgba(255,255,255,1)"
  84. v-if="scope.row.state == 1"
  85. >督查中</span>
  86. <span
  87. style="padding: 3px 10px;background:#63C25E;border-radius:15px;color:rgba(255,255,255,1)"
  88. v-if="scope.row.state == 2"
  89. >已督查</span>
  90. </template>
  91. </el-table-column>
  92. <el-table-column
  93. v-for="(column,index) in fillTableData"
  94. :key="index"
  95. :prop="column.prop"
  96. :label='column.label'
  97. align="center"
  98. min-width="130">
  99. <template slot-scope="scope">
  100. <p style="cursor:pointer;color:#F56C6C;"
  101. v-if="scope.row[column.prop] == 0 || !scope.row[column.prop]">待填报</p>
  102. <p style="cursor:pointer;color:#fbb56d" v-if="scope.row[column.prop] == 1">未完成</p>
  103. <p style="cursor:pointer;color:#67C23A" v-if="scope.row[column.prop] == 2">已完成</p>
  104. <p style="cursor:pointer;color:#67C23A"
  105. v-if="column.prop == 'viewStat' && scope.row[column.prop] != 0">已填报</p>
  106. <p style="cursor:pointer;color:#F56C6C;"
  107. v-if="column.prop == 'viewStat' && scope.row[column.prop] == 0">未填报</p>
  108. </template>
  109. </el-table-column>
  110. <el-table-column align="center" label="操作" min-width="360" fixed="right" v-if="ownPriv('manage') || ownPriv('revoke')">
  111. <template slot-scope="scope">
  112. <div style="display: flex;justify-content: center">
  113. <div v-if="ownPriv('manage')">
  114. <el-button size="mini" type="success" :disabled="scope.row.state == '2'" v-if="!scope.row.rgstrId" plain
  115. @click="toAddMember('填报',scope.row)">编辑
  116. </el-button>
  117. <el-button size="mini" type="success" :disabled="scope.row.state == '2'" v-if="scope.row.rgstrId" plain
  118. @click="toAddMember('编辑',scope.row)">填报
  119. </el-button>
  120. <el-button size="mini" type="danger" plain @click="deleteMember(scope.row)" :disabled="scope.row.state == '2'">删除</el-button>
  121. <el-button size="mini" type="danger" plain @click="submitHandler(scope.row)" :disabled="scope.row.state == '2'">提交</el-button>
  122. </div>
  123. <el-button size="mini" style="margin-left: 10px;" type="warning" v-if="scope.row.rgstrId && scope.row.state == '2'" plain @click="toCheck(scope.row)">查看</el-button>
  124. <div v-if="ownPriv('revoke')" style="padding-left: 10px;">
  125. <el-button size="mini" type="warning" v-if="scope.row.rgstrId && scope.row.state == '2'" plain @click="revoke(scope.row)">撤回</el-button>
  126. </div>
  127. </div>
  128. </template>
  129. </el-table-column>
  130. </el-table>
  131. <el-pagination background :pager-count="5" :current-page="pageIndex"
  132. :page-size="pageSize" :page-sizes="[10, 20, 30, 40, 50, 100]"
  133. layout="sizes, total, prev, pager, next" :total="total"
  134. @current-change="pageIndexChange" @size-change="handleSizeChange"
  135. ></el-pagination>
  136. </el-main>
  137. <!-- </el-container> -->
  138. <chaoBiaoTianbao v-if="showShuiKuTianBao" :rowData="rowData" :currentObjectRgstrId="currentObjectRgstrId"
  139. :currentResCode="currentResCode" :currentObjectId="currentObjectId"
  140. :currentObjectName="currentResName"
  141. :openType="openType"
  142. @cancelHandler="cancelHandler" @addShuiKuSuccess="addShuiKuSuccess" pType="30">
  143. </chaoBiaoTianbao>
  144. </el-container>
  145. </div>
  146. </template>
  147. <script>
  148. import request from '@util/gw_ajax_request.js'
  149. import {dateFormat} from '@util/gw_date.js'
  150. import provTreeList from "@widget/provTreeList.vue";
  151. import chaoBiaoTianbao from "../duChaTianBao/chaobiao/chaoBiaoTianbao.vue"
  152. import addvSearch from "@widget/addvSearch.vue"
  153. import tbLeftTree from "./dctb_lefttree.vue"
  154. export default {
  155. components: {
  156. provTreeList: provTreeList,
  157. chaoBiaoTianbao: chaoBiaoTianbao,
  158. addvSearch,
  159. tbLeftTree
  160. },
  161. props: [],
  162. data() {
  163. return {
  164. dateRange: [],
  165. tableHeight: 50,
  166. lyjg: [],
  167. orgName: '',
  168. groupName: '',
  169. groupId: '',
  170. groups: [],
  171. adName: '',
  172. treeData: [],
  173. dxdcMainHeight: window.innerHeight - 304,
  174. testHeight: window.innerHeight - 111,
  175. chbDataList: [],
  176. pageIndex: 1,
  177. pageSize: 20,
  178. total: 0,
  179. currentResCode: '',
  180. currentResName: '',
  181. currentObjectId: '',
  182. currentObjectRgstrId: '',
  183. currentObjectInfoObject: null,
  184. showShuiKuTianBao: false,
  185. currentAdCode: '',
  186. currentNodeId: '',
  187. name: '',
  188. type: '',
  189. dcType: '',
  190. rowData: '',
  191. disabled: true,
  192. showShuiKuTianBaoPl: false,
  193. expLoading: false,
  194. $el: '',
  195. fillTableData: [
  196. {
  197. label: '预案编制情况',
  198. prop: "planStat"
  199. },
  200. {
  201. label: '原因分析和整改意见',
  202. prop: "reasonStat"
  203. }
  204. ],
  205. typeList: [
  206. {label: '流域内大江大河', value: '1'},
  207. {label: '流域内跨省大江大河重要支流', value: '2'},
  208. {label: '非跨省大江大河重要支流和其他重要河流', value: '3'},
  209. {label: '全国重点防洪城市', value: '4'},
  210. {label: '全国重要防洪城市', value: '5'},
  211. ],
  212. newYear: "",
  213. openType:false
  214. };
  215. },
  216. computed: {
  217. persId() {
  218. return localStorage.getItem("userid")
  219. ? localStorage.getItem("userid")
  220. : "1098101939614724096";
  221. },
  222. isAdmin() {
  223. return localStorage.getItem("isAdmin") ? localStorage.getItem("isAdmin") : ''
  224. },
  225. hasPriv() {
  226. return this.ownPriv('manage')
  227. }
  228. },
  229. mounted() {
  230. this.$nextTick(function () {
  231. this.tableHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 50;
  232. let _self = this;
  233. window.onresize = function () {
  234. _self.tableHeight = window.innerHeight - _self.$refs.table.$el.offsetTop - 50
  235. }
  236. })
  237. // this.getChbDataList();
  238. this.getAllGroup();
  239. },
  240. activated() {
  241. },
  242. watch: {
  243. currentNodeId(n, o) {
  244. this.getChbDataList();
  245. },
  246. groupName(n, o) {
  247. if (n == '') {
  248. this.groupId = '';
  249. }
  250. },
  251. },
  252. methods: {
  253. changeYear(val) {
  254. this.newYear = val;
  255. this.getChbDataList();
  256. },
  257. reFresh() {
  258. this.currentNodeId = "";
  259. this.name = "";
  260. this.type = "";
  261. this.dcType = "";
  262. this.getChbDataList();
  263. },
  264. //获取所有的组
  265. getAllGroup() {
  266. var _self = this;
  267. request.get('/dc/user/getGroupByPersid', {
  268. params: {
  269. 'persid': this.persId,
  270. 'ptype': '30'
  271. }
  272. }).then((res) => {
  273. if (res.success) {
  274. _self.groups = res.data;
  275. }
  276. })
  277. },
  278. querySearchAsync(queryString, cb) {
  279. var restaurants = this.groups;
  280. var results = queryString ? restaurants.filter(this.createStateFilter(queryString)) : restaurants;
  281. clearTimeout(this.timeout);
  282. this.timeout = setTimeout(() => {
  283. cb(results);
  284. }, 1500 * Math.random());
  285. },
  286. createStateFilter(queryString) {
  287. return (state) => {
  288. return (state.nm.toLowerCase().indexOf(queryString.toLowerCase()) != -1);
  289. };
  290. },
  291. handleSelect(item) {
  292. console.log(item);
  293. this.groupId = item.id;
  294. },
  295. getOrganList(data) {
  296. this.lyjg = data
  297. },
  298. treeNodeClickHandler(data) {
  299. this.currentNodeId = data.id;
  300. },
  301. provTreeSelectChangeHandler: function (params) {
  302. this.currentAdCode = params.likeCode;
  303. this.getChbDataList();
  304. },
  305. getChbDataList(){
  306. this.expLoading = true;
  307. let paramStartDate = '';
  308. let paramEndDate = '';
  309. if(this.dateRange&&this.dateRange.length>1&&this.dateRange[0]!=''&&this.dateRange[1]!=''){
  310. paramStartDate = this.dateRange[0];
  311. paramEndDate = this.dateRange[1];
  312. }
  313. let params = {
  314. "sttm": paramStartDate,
  315. "entm": paramEndDate,
  316. "pageSize": this.pageSize,
  317. "pageNum": this.pageIndex,
  318. "groupId": this.groupId,
  319. "rsName": this.name,
  320. "efpType": this.type,
  321. "state": this.dcType,
  322. "pType": 30,
  323. "adName": this.adName,
  324. "presId": this.persId,
  325. "plnaId": this.currentNodeId
  326. };
  327. request.post(`/bis/insp/efp/rgstr/findEfpPage`,params).then(res =>{
  328. if(res.success){
  329. this.expLoading = false;
  330. if(res.data.list){
  331. res.data.list.forEach((item)=>{
  332. if(item.intm && item.uptm){
  333. item.intm = item.intm.substr(0,10);
  334. item.uptm = item.uptm.substr(0,10);
  335. }
  336. })
  337. }
  338. this.chbDataList = res.data.list;
  339. this.total = res.data.total;
  340. }
  341. })
  342. },
  343. onSubmit() {
  344. this.getChbDataList();
  345. },
  346. toCheck(rowData){
  347. var _self = this;
  348. this.rowData = rowData;
  349. _self.currentResCode = this.rowData.code;
  350. _self.currentObjectId = this.rowData.objId;
  351. _self.currentObjectRgstrId = this.rowData.rgstrId;
  352. _self.currentResName = this.rowData.nm;
  353. _self.showShuiKuTianBao = true;
  354. _self.openType = false;
  355. },
  356. toAddMember(type, rowData) {
  357. var _self = this;
  358. this.rowData = rowData;
  359. // ;
  360. console.log(rowData);
  361. // getrgstrIdObject(rowData.code,rowData.objId,_self.pageIndex).then(
  362. // (res) =>{
  363. // console.log(res);
  364. _self.currentResCode = this.rowData.code;
  365. _self.currentObjectId = this.rowData.objId;
  366. _self.currentObjectRgstrId = this.rowData.rgstrId;
  367. _self.currentResName = this.rowData.nm;
  368. _self.showShuiKuTianBao = true;
  369. _self.openType = true;
  370. // 获取完成
  371. // },
  372. // (err) =>{
  373. // }
  374. // );
  375. },
  376. cancelHandler() {
  377. this.showShuiKuTianBao = false;
  378. },
  379. addShuiKuSuccess() {
  380. this.getChbDataList();
  381. },
  382. deleteMember(obj) {
  383. console.log(obj);
  384. var _self = this;
  385. this.$confirm('此操作将督查对象从列表中删除,确认删除该超标洪预案吗?', '提示', {
  386. confirmButtonText: '确定',
  387. cancelButtonText: '取消',
  388. type: 'warning'
  389. }).then(() => {
  390. request.get(`/supervision/plan/cleanObjDataByObjId?objType=1&objId=${obj.objId}`).then((res) => {
  391. if (res.success) {
  392. _self.pageIndexChange();
  393. _self.$message.success('删除成功')
  394. } else {
  395. _self.$message.error(res.message)
  396. }
  397. });
  398. }).catch(() => {
  399. });
  400. },
  401. revoke(rowData) {
  402. var _self = this;
  403. this.$confirm('确定要撤销当前信息吗?', '提示', {
  404. confirmButtonText: '确定',
  405. cancelButtonText: '取消',
  406. type: 'warning'
  407. }).then(() => {
  408. let formObj = {
  409. "persId": this.persId,
  410. "id": rowData.rgstrId,
  411. "objId": rowData.objId,
  412. "state": "1"
  413. }
  414. request.post('/bis/insp/efp/rgstr', formObj).then((res) => {
  415. if (res.success) {
  416. _self.addShuiKuSuccess();
  417. _self.$message.success("提交成功");
  418. } else {
  419. _self.cancelHandler();
  420. }
  421. });
  422. }).catch(() => {
  423. });
  424. },
  425. submitHandler(rowData) {
  426. console.log(rowData)
  427. var _self = this;
  428. if (rowData.planStat != '2') {
  429. this.$message({
  430. message: '预案编制情况填报未完成!',
  431. type: 'warning'
  432. });
  433. return
  434. } else if (rowData.reasonStat != '2') {
  435. this.$message({
  436. message: '原因分析和整改意见填报未完成!',
  437. type: 'warning'
  438. });
  439. return
  440. }
  441. this.$confirm('请确认所有信息填报完毕?', '提示', {
  442. confirmButtonText: '确定',
  443. cancelButtonText: '取消',
  444. type: 'warning'
  445. }).then(() => {
  446. let formObj = {
  447. "persId": this.persId,
  448. "id": rowData.rgstrId,
  449. "objId": rowData.objId,
  450. "state": "2"
  451. }
  452. request.post('/bis/insp/efp/rgstr', formObj).then((res) => {
  453. if (res.success) {
  454. _self.addShuiKuSuccess();
  455. _self.$message.success("提交成功");
  456. } else {
  457. _self.cancelHandler();
  458. }
  459. });
  460. }).catch(() => {
  461. });
  462. },
  463. pageIndexChange(val) {
  464. console.log(val);
  465. this.pageIndex = val;
  466. this.getChbDataList();
  467. },
  468. handleSizeChange(val) {
  469. this.pageSize = val;
  470. this.getChbDataList();
  471. },
  472. // 下载填报模板
  473. downloadTemplate() {
  474. this.downloadTemplateSet();
  475. this.disabled = false;
  476. },
  477. downloadTemplateSet() {
  478. let href = '/api/dc/impExcel/downloadTemplate/df?userId=' + this.persId + '&id='
  479. + this.currentNodeId
  480. + '&orgIds=';
  481. const a = document.createElement('a'); // 创建a标签
  482. a.setAttribute('download', '小超标洪预案填报模板.xls');// download属性
  483. a.setAttribute('href', href);// href链接
  484. a.click();// 自执行点击事件
  485. },
  486. showPlDialog() {
  487. this.showShuiKuTianBaoPl = true
  488. },
  489. closePlDialog(val) {
  490. this.showShuiKuTianBaoPl = false
  491. },
  492. // 类型格式化
  493. typeFormatter(row, column) {
  494. let type = row.type;
  495. let _type = '其他';
  496. switch (type) {
  497. case '1' :
  498. _type = '流域内大江大河';
  499. break;
  500. case '2' :
  501. _type = '流域内跨省大江大河重要支流';
  502. break;
  503. case '3' :
  504. _type = '非跨省大江大河重要支流和其他重要河流';
  505. break;
  506. case '4' :
  507. _type = '全国重点防洪城市';
  508. break;
  509. case '5' :
  510. _type = '全国重要防洪城市';
  511. break;
  512. default:
  513. _type = '其他';
  514. break;
  515. }
  516. return _type;
  517. },
  518. },
  519. };
  520. </script>
  521. <style>
  522. .el-table .warning-row {
  523. background: oldlace;
  524. }
  525. .el-table .success-row {
  526. background: #f0f9eb;
  527. }
  528. #dxdcListMaindf {
  529. overflow-y: hidden;
  530. }
  531. </style>