7360acedfe21f40fb170a8e18f07e187f3490ac1.svn-base 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599
  1. <template>
  2. <div style="height:100%;width:100%;" class="tb_wrapper">
  3. <el-container style="height:100%;width:100%;">
  4. <el-aside width="320px" style="float:left"
  5. :style="{'max-height':testHeight+'px','height':testHeight+'px'}">
  6. <tb-left-tree orgType="029" :isAll="viewPriv" @treeNodeClickHandler="treeNodeClickHandler"
  7. @organList="getOrganList"
  8. @changeYear="changeYear"></tb-left-tree>
  9. </el-aside>
  10. <!-- 主要窗口 -->
  11. <el-main id="dxdcListMaindf">
  12. <el-row class="search_item_wrapper">
  13. <el-col :span="24">
  14. <el-form :inline="true" size="mini" class="demo-form-inline" label-width="96px" label-position="right">
  15. <el-form-item label="督查状态">
  16. <el-select v-model="dcType" clearable placeholder="督查状态">
  17. <el-option label="未督查" value="0"></el-option>
  18. <el-option label="督查中" value="1"></el-option>
  19. <el-option label="已督查" value="2"></el-option>
  20. </el-select>
  21. </el-form-item>
  22. <el-form-item label="所在位置">
  23. <el-input v-model="adName" clearable placeholder="所在位置"></el-input>
  24. </el-form-item>
  25. <el-form-item label="险工险段名称">
  26. <el-input v-model="rsvrName" placeholder="险工险段名称"></el-input>
  27. </el-form-item>
  28. <el-form-item label="所在组">
  29. <el-autocomplete v-model="groupName" clearable value-key='nm'
  30. :fetch-suggestions="querySearchAsync" placeholder="请输入内容"
  31. @select="handleSelect"></el-autocomplete>
  32. </el-form-item>
  33. <el-form-item label="督查时间">
  34. <div style="display: flex;">
  35. <el-date-picker
  36. v-model="dateRange"
  37. type="daterange"
  38. value-format="yyyy-MM-dd"
  39. style="width:100%"
  40. range-separator="至"
  41. start-placeholder="开始日期"
  42. end-placeholder="结束日期"
  43. ></el-date-picker>
  44. </div>
  45. </el-form-item>
  46. <el-form-item style="float: right">
  47. <div class="tb_btn_wrapper">
  48. <el-button type="primary" @click="onSubmit">查询</el-button>
  49. <el-button type="success" @click="reSet">重置</el-button>
  50. </div>
  51. </el-form-item>
  52. </el-form>
  53. </el-col>
  54. </el-row>
  55. <div class="table_wrapper">
  56. <!-- <div class="table_operate">-->
  57. <!-- <el-button type="success" style="float:right;margin-left:5px"-->
  58. <!-- @click="showPlDialog"-->
  59. <!-- icon="el-icon-upload2"-->
  60. <!-- :disabled="disabled"-->
  61. <!-- >批量填报-->
  62. <!-- </el-button>-->
  63. <!-- <el-button type="success" style="float:right;"-->
  64. <!-- @click="downloadTemplate"-->
  65. <!-- :icon="downIcon"-->
  66. <!-- >下载模版-->
  67. <!-- </el-button>-->
  68. <!-- </div>-->
  69. <el-table
  70. ref="table"
  71. border
  72. stripe
  73. :height="tableHeight"
  74. :data="dfDataList"
  75. style="width: 100%"
  76. v-loading="expLoading">
  77. <el-table-column type="index" label="序号" width="60" align="center" fixed="left">
  78. <template slot-scope="scope">
  79. <span>{{(pageIndex - 1) * pageSize + (scope.$index + 1)}}</span>
  80. </template>
  81. </el-table-column>
  82. <el-table-column prop="nm" label="险工险段名称" min-width="130" align="center"
  83. fixed="left"></el-table-column>
  84. <el-table-column
  85. prop="location"
  86. min-width="200"
  87. label="险工险段所在位置">
  88. </el-table-column>
  89. <el-table-column prop="groupName" label="所在组" show-overflow-tooltip min-width="150"
  90. align="center"></el-table-column>
  91. <el-table-column prop="intm" label="督查时间" show-overflow-tooltip min-width="200"
  92. align="center"></el-table-column>
  93. <el-table-column
  94. prop="state"
  95. label="督查状态"
  96. align="center"
  97. min-width="130">
  98. <template slot-scope="scope">
  99. <span
  100. style="color: #ED2B2F;"
  101. v-if="scope.row.state == 0"
  102. >未督查</span>
  103. <span
  104. style="color:#F88D2E"
  105. v-if="scope.row.state == 1"
  106. >督查中</span>
  107. <span
  108. style="color:#00BE6D"
  109. v-if="scope.row.state == 2"
  110. >已督查</span>
  111. </template>
  112. </el-table-column>
  113. <el-table-column
  114. v-for="(column,index) in fillTableData"
  115. :key="index"
  116. :prop="column.prop"
  117. :label='column.label'
  118. align="center"
  119. min-width="130">
  120. <template slot-scope="scope">
  121. <p style="cursor:pointer;color:#F56C6C;"
  122. v-if="scope.row[column.prop] == 0 || !scope.row[column.prop]">待填报</p>
  123. <p style="cursor:pointer;color:#fbb56d" v-if="scope.row[column.prop] == 1">未完成</p>
  124. <p style="cursor:pointer;color:#67C23A" v-if="scope.row[column.prop] == 2">已完成</p>
  125. <p style="cursor:pointer;color:#67C23A"
  126. v-if="column.prop == 'viewStat' && scope.row[column.prop] != 0">已填报</p>
  127. <p style="cursor:pointer;color:#F56C6C;"
  128. v-if="column.prop == 'viewStat' && scope.row[column.prop] == 0">未填报</p>
  129. </template>
  130. </el-table-column>
  131. <el-table-column align="center" label="操作" min-width="220" fixed="right" v-if="hasPriv">
  132. <template slot-scope="scope">
  133. <!-- scope.row.state != 3 已填报的暂时不显示查看 后期改为scope.row.state != 2 -->
  134. <div v-if="scope.row.state != 2">
  135. <el-button size="mini" type="warning" v-if="!scope.row.rgstrId"
  136. @click="toAddMember('填报',scope.row)"><i class="el-icon-edit"></i> 填报
  137. </el-button>
  138. <el-button size="mini" type="warning" v-if="scope.row.rgstrId"
  139. @click="toAddMember('编辑',scope.row)"><i class="el-icon-edit"></i> 编辑
  140. </el-button>
  141. <el-button size="mini" type="danger" @click="deleteMember(scope.row)"><i class="el-icon-delete"></i>
  142. 删除
  143. </el-button>
  144. <el-button size="mini" type="primary" @click="submitHandler(scope.row)"><i
  145. class="el-icon-success"></i> 提交
  146. </el-button>
  147. </div>
  148. <div v-else>
  149. <el-button size="mini" type="primary" @click="toView(scope.row)">查看</el-button>
  150. </div>
  151. </template>
  152. </el-table-column>
  153. <el-table-column align="center" label="操作" min-width="120" fixed="right" v-if="viewPriv">
  154. <template slot-scope="scope">
  155. <el-button size="mini" type="primary"
  156. @click="toView(scope.row)">查看
  157. </el-button>
  158. </template>
  159. </el-table-column>
  160. </el-table>
  161. <el-pagination background :pager-count="5" :current-page="pageIndex"
  162. :page-size="pageSize" :page-sizes="[10, 20, 30, 40, 50, 100]"
  163. layout="total, sizes, prev, pager, next" :total="total"
  164. @current-change="pageIndexChange" @size-change="handleSizeChange"
  165. ></el-pagination>
  166. </div>
  167. </el-main>
  168. <!-- </el-container> -->
  169. <diFangTianBao v-if="showShuiKuTianBao" :rowData="rowData" :currentObjectRgstrId="currentObjectRgstrId"
  170. :currentResCode="currentResCode" :currentObjectId="currentObjectId"
  171. :currentObjectName="currentResName"
  172. @cancelHandler="cancelHandler" @addShuiKuSuccess="addShuiKuSuccess" pType="29">
  173. </diFangTianBao>
  174. <!-- 督查信息查看 -->
  175. <difangView v-if="dfInfoDialog"
  176. :currentDuchaTpe="true"
  177. :rowData="rowData"
  178. :currentObjectId="currentObjectId"
  179. :currentObjectRgstrId="currentObjectRgstrId"
  180. :currentResCode="currentResCode"
  181. :currentObjectName="currentResName"
  182. @cancelHandler="dfCancelHandler"></difangView>
  183. </el-container>
  184. <!-- 添加/编辑人员弹窗 -->
  185. <!-- 上传模板弹窗 -->
  186. <tianBaoPiLiangCom v-if="showtianBaoPiLiangCom"
  187. :showtianBaoPiLiangCom="showtianBaoPiLiangCom"
  188. :id="currentNodeId"
  189. :preUrl="'/bis/insp/waga/sap/rgstr'"
  190. :dialogTitle="'堤防险工险段批量填报'"
  191. @closePlDialog="closePlDialog"></tianBaoPiLiangCom>
  192. </div>
  193. </template>
  194. <script>
  195. import request from '../../utils/gw_ajax_request.js'
  196. import {dateFormat} from '../../utils/gw_date.js'
  197. import {downloadTemplateSet} from '@util/gw_exportModel.js'
  198. import {getList_df} from "../../api/duChaTianBao.js";
  199. import provTreeList from "../../widgets/provTreeList.vue";
  200. import diFangTianBao from "../duChaTianBao/diFangTianbao.vue"
  201. import tianBaoPiLiangCom from "../duChaTianBao/tianBaoPiLiangCom.vue"
  202. import addvSearch from "../../widgets/addvSearch.vue"
  203. import tbLeftTree from "./dctb_lefttree.vue"
  204. export default {
  205. components: {
  206. provTreeList: provTreeList,
  207. diFangTianBao: diFangTianBao,
  208. tianBaoPiLiangCom: tianBaoPiLiangCom,
  209. addvSearch,
  210. tbLeftTree,
  211. difangView: resolve => {
  212. require(["../zongHeXinXiOl/components/popupWindow/dfxgxd/main.vue"], resolve);
  213. }, //查看弹窗
  214. },
  215. props: [],
  216. data() {
  217. return {
  218. dateRange: [],
  219. tableHeight: 50,
  220. lyjg: [],
  221. engScales: [
  222. {id: '4', name: '小(1)型'},
  223. {id: '5', name: '小(2)型'},
  224. ],
  225. engScale: '',
  226. orgName: '',
  227. groupName: '',
  228. groupId: '',
  229. groups: [],
  230. // sttm:'',
  231. // ettm:'',
  232. adName: '',
  233. treeData: [],
  234. dxdcMainHeight: window.innerHeight - 304,
  235. testHeight: window.innerHeight - 90,
  236. dfDataList: [],
  237. pageIndex: 1,
  238. pageSize: 20,
  239. total: 0,
  240. currentResCode: '',
  241. currentResName: '',
  242. currentObjectId: '',
  243. currentObjectRgstrId: '',
  244. currentObjectInfoObject: null,
  245. showShuiKuTianBao: false,
  246. currentAdCode: '',
  247. currentNodeId: '',
  248. rsvrName: '',
  249. dcType: '',
  250. rowData: '',
  251. disabled: true,
  252. showtianBaoPiLiangCom: false,
  253. downIcon: 'el-icon-download',
  254. expLoading: false,
  255. $el: '',
  256. fillTableData: [
  257. // {
  258. // label: '管理责任体系',
  259. // prop: "mrsCiStat"
  260. // },
  261. // {
  262. // label: '安全管理',
  263. // prop: "safeStat"
  264. // },
  265. // {
  266. // label: "日常管理与维护",
  267. // prop: "dmamStat"
  268. // },
  269. // {
  270. // label: "工程实体检查",
  271. // prop: "proenStat"
  272. // }
  273. {
  274. label: "基本情况表",
  275. prop: "baseInfoState"
  276. }
  277. ],
  278. newYear: "",
  279. dfInfoDialog: false
  280. };
  281. },
  282. computed: {
  283. persId() {
  284. return localStorage.getItem("userid")
  285. ? localStorage.getItem("userid")
  286. : "1098101939614724096";
  287. },
  288. isAdmin() {
  289. return localStorage.getItem("isAdmin") ? localStorage.getItem("isAdmin") : ''
  290. },
  291. hasPriv() {
  292. return this.ownPriv('manage')
  293. },
  294. viewPriv() {
  295. return this.ownPriv('view')
  296. }
  297. },
  298. mounted() {
  299. this.$nextTick(function () {
  300. this.tableHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 50;
  301. let _self = this;
  302. window.onresize = function () {
  303. _self.tableHeight = window.innerHeight - _self.$refs.table.$el.offsetTop - 50
  304. }
  305. })
  306. // this.getDfDataList();
  307. this.getAllGroup();
  308. },
  309. activated() {
  310. },
  311. watch: {
  312. currentNodeId(n, o) {
  313. if (n) {
  314. this.getDfDataList();
  315. }
  316. },
  317. groupName(n, o) {
  318. if (n == '') {
  319. this.groupId = '';
  320. }
  321. },
  322. },
  323. methods: {
  324. changeYear(val) {
  325. this.newYear = val;
  326. this.currentNodeId = '';
  327. this.getDfDataList();
  328. },
  329. reSet() {
  330. this.groupName = "";
  331. this.rsvrName = "";
  332. this.dcType = "";
  333. this.adName = "";
  334. this.dateRange = [];
  335. },
  336. //获取所有的组
  337. getAllGroup() {
  338. var _self = this;
  339. request.get('/dc/user/getGroupByPersid', {
  340. params: {
  341. 'persid': this.persId,
  342. 'ptype': '29'
  343. }
  344. }).then((res) => {
  345. if (res.success) {
  346. _self.groups = res.data;
  347. }
  348. })
  349. },
  350. querySearchAsync(queryString, cb) {
  351. var restaurants = this.groups;
  352. var results = queryString ? restaurants.filter(this.createStateFilter(queryString)) : restaurants;
  353. clearTimeout(this.timeout);
  354. this.timeout = setTimeout(() => {
  355. cb(results);
  356. }, 1500 * Math.random());
  357. },
  358. createStateFilter(queryString) {
  359. return (state) => {
  360. return (state.nm.toLowerCase().indexOf(queryString.toLowerCase()) != -1);
  361. };
  362. },
  363. handleSelect(item) {
  364. console.log(item);
  365. this.groupId = item.id;
  366. },
  367. getOrganList(data) {
  368. this.lyjg = data
  369. },
  370. treeNodeClickHandler(data) {
  371. this.currentNodeId = data.id;
  372. },
  373. provTreeSelectChangeHandler: function (params) {
  374. this.currentAdCode = params.likeCode;
  375. this.getDfDataList();
  376. },
  377. formatDate(row, column) {
  378. if (row.uptm) {
  379. return (dateFormat(row.uptm, 'yyyy-MM-dd'));
  380. }
  381. },
  382. formatEngScal(row, column) {
  383. let engScal = row.engScal;
  384. let _engScal = '其他';
  385. switch (engScal) {
  386. case '1' :
  387. _engScal = '大(1)型';
  388. break;
  389. case '2' :
  390. _engScal = '大(2)型';
  391. break;
  392. case '3' :
  393. _engScal = '中型';
  394. break;
  395. case '4' :
  396. _engScal = '小(1)型';
  397. break;
  398. case '5' :
  399. _engScal = '小(2)型';
  400. break;
  401. case '9' :
  402. _engScal = '其他';
  403. break;
  404. }
  405. return _engScal;
  406. },
  407. getDfDataList: function () {
  408. let paramStartDate = '';
  409. let paramEndDate = '';
  410. if (this.dateRange && this.dateRange.length > 1 && this.dateRange[0] != '' && this.dateRange[1] != '') {
  411. paramStartDate = this.dateRange[0];
  412. paramEndDate = this.dateRange[1];
  413. }
  414. let data = {
  415. 'presId': this.persId,
  416. "pType": "29",
  417. "pageSize": this.pageSize,
  418. 'pageNum': this.pageIndex,
  419. 'plnaId': this.currentNodeId,
  420. 'rsName': this.rsvrName,
  421. 'state': this.dcType,
  422. 'adName': this.adName,
  423. 'sttm': paramStartDate,
  424. 'entm': paramEndDate,
  425. 'riverId': this.orgName,
  426. 'engScal': this.engScale,
  427. 'groupId': this.groupId,
  428. 'year': this.newYear
  429. }
  430. if (this.viewPriv) data['isAll'] = 1
  431. getList_df(data).then(
  432. (res) => {
  433. console.log(res);
  434. res.data.list.forEach((item) => {
  435. if (item.intm) {
  436. item.intm = item.intm.substr(0, 16);
  437. }
  438. if (item.uptm) {
  439. item.uptm = item.uptm.substr(0, 16);
  440. }
  441. })
  442. this.dfDataList = res.data.list;
  443. this.total = res.data.total;
  444. }
  445. );
  446. },
  447. onSubmit() {
  448. this.getDfDataList();
  449. },
  450. toAddMember(type, rowData) {
  451. var _self = this;
  452. this.rowData = rowData;
  453. console.log(rowData);
  454. _self.currentResCode = this.rowData.code;
  455. _self.currentObjectId = this.rowData.objId;
  456. _self.currentObjectRgstrId = this.rowData.rgstrId;
  457. _self.currentResName = this.rowData.nm;
  458. _self.showShuiKuTianBao = true;
  459. },
  460. cancelHandler() {
  461. this.showShuiKuTianBao = false;
  462. },
  463. addShuiKuSuccess() {
  464. this.getDfDataList();
  465. },
  466. deleteMember(obj) {
  467. console.log(obj);
  468. var _self = this;
  469. this.$confirm('此操作将督查对象从列表中删除,确认删除该险工险段吗?', '提示', {
  470. confirmButtonText: '确定',
  471. cancelButtonText: '取消',
  472. type: 'warning'
  473. }).then(() => {
  474. request.get(`/supervision/plan/cleanObjDataByObjId?objType=29&objId=${obj.objId}`).then((res) => {
  475. if (res.success) {
  476. _self.pageIndexChange();
  477. _self.$message.success('删除成功')
  478. } else {
  479. _self.$message.error(res.message)
  480. }
  481. });
  482. }).catch(() => {
  483. });
  484. },
  485. submitHandler(rowData) {
  486. console.log(rowData)
  487. var _self = this;
  488. if (rowData.baseInfoState != '2') {
  489. this.$message({
  490. message: '基本情况表未完成!',
  491. type: 'warning'
  492. });
  493. return
  494. }
  495. // } else if (rowData.safeStat != '2') {
  496. // this.$message({
  497. // message: '安全管理填报未完成!',
  498. // type: 'warning'
  499. // });
  500. // return
  501. // } else if (rowData.dmamStat != '2') {
  502. // this.$message({
  503. // message: '日常管理与维护填报未完成',
  504. // type: 'warning'
  505. // });
  506. // return
  507. // } else if (rowData.proenStat != '2') {
  508. // this.$message({
  509. // message: '工程实体检查填报未完成',
  510. // type: 'warning'
  511. // });
  512. // return
  513. // }
  514. this.$confirm('请确认所有信息填报完毕?', '提示', {
  515. confirmButtonText: '确定',
  516. cancelButtonText: '取消',
  517. type: 'warning'
  518. }).then(() => {
  519. let formObj = {
  520. "persId": this.persId,
  521. "id": rowData.rgstrId,
  522. "objId": rowData.objId,
  523. "state": "2"
  524. }
  525. request.post('/bis/insp/waga/sap/rgstr', formObj).then((res) => {
  526. if (res.success) {
  527. _self.addShuiKuSuccess();
  528. _self.$message.success("提交成功");
  529. } else {
  530. _self.cancelHandler();
  531. }
  532. });
  533. }).catch(() => {
  534. });
  535. },
  536. pageIndexChange(val) {
  537. console.log(val);
  538. this.pageIndex = val;
  539. this.getDfDataList();
  540. },
  541. handleSizeChange(val) {
  542. this.pageSize = val;
  543. this.getDfDataList();
  544. },
  545. // 下载填报模板
  546. downloadTemplate() {
  547. let href = '/padApi/bis/insp/waga/sap/rgstr/downTemplate?plnaId=' + this.currentNodeId + '&presId=' + this.persId + '&pType=29';
  548. downloadTemplateSet(href, '堤防险工险段填报模板.xls');
  549. this.disabled = false;
  550. },
  551. showPlDialog() {
  552. this.showtianBaoPiLiangCom = true
  553. },
  554. closePlDialog(val) {
  555. this.showtianBaoPiLiangCom = false
  556. },
  557. toView(rowData) {
  558. this.rowData = rowData;
  559. this.currentResCode = this.rowData.code;
  560. this.currentObjectId = this.rowData.objId;
  561. this.currentObjectRgstrId = this.rowData.rgstrId;
  562. this.currentResName = this.rowData.nm;
  563. this.dfInfoDialog = true;
  564. },
  565. dfCancelHandler() {
  566. this.dfInfoDialog = false;
  567. },
  568. },
  569. };
  570. </script>
  571. <style lang="scss">
  572. @import "../../assets/sass/tbPublicCss.scss";
  573. .el-table .warning-row {
  574. background: oldlace;
  575. }
  576. .el-table .success-row {
  577. background: #f0f9eb;
  578. }
  579. #dxdcListMaindf {
  580. overflow-y: hidden;
  581. }
  582. </style>