1ee3642ce65328bdd8f90b071415be2cb4ade77b.svn-base 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554
  1. <template>
  2. <div style="height:100%;width:100%;">
  3. <el-container style="height:100%;width:100%;">
  4. <!-- <el-aside width="200px" style="border:1px solid #d5d5ff">
  5. <p style="font-weight:bolder;background-color:#d5d5ff;padding:3px;">
  6. <i class="el-icon-share"></i>督查分工
  7. </p>
  8. <provTreeList
  9. rootCode
  10. :style="{'max-height':dxdcAsideHeight+'px','height':dxdcAsideHeight+'px'}"
  11. @provTreeSelectChange="provTreeSelectChangeHandler"
  12. ></provTreeList>
  13. </el-aside> -->
  14. <el-aside width="320px" style="border-right:2px solid #d5d5ff;float:left"
  15. :style="{'max-height':testHeight+'px','height':testHeight+'px'}">
  16. <el-tree
  17. :highlight-current="true"
  18. style="height:100%;"
  19. :data="treeData"
  20. node-key="id"
  21. :expand-on-click-node="false"
  22. @node-click='treeNodeClickHandler'
  23. ref="jigou_tree"
  24. >
  25. <div class="custom-tree-node" slot-scope="{ node, data }">
  26. <span style="float:left:">{{ data.pnm}}
  27. </span>
  28. </div>
  29. </el-tree>
  30. </el-aside>
  31. <el-main id="dxdcListMainsk" style="padding:5px 20px;">
  32. <el-row :gutter="10" style="margin:5px -5px 15px -5px;">
  33. <el-col :span="24">
  34. <el-tag size="small" style="width: 175px;text-align: center;">
  35. <i class="el-icon-info"></i>
  36. <span style="margin-left: 5px">暗访小水库总计:</span>
  37. <span style="font-weight: 700;margin-left: 5px">{{this.total}}</span>
  38. </el-tag>
  39. </el-col>
  40. </el-row>
  41. <el-row>
  42. <el-col :span="24">
  43. <el-form :inline="true" size="mini" class="demo-form-inline" style="padding-left: 10px;">
  44. <el-form-item label="督查状态">
  45. <el-select v-model="dcType" clearable placeholder="督查状态">
  46. <el-option label="未督查" value="0"></el-option>
  47. <el-option label="督查中" value="1"></el-option>
  48. <el-option label="已督查" value="2"></el-option>
  49. </el-select>
  50. </el-form-item>
  51. <el-form-item label="行政区名称">
  52. <el-input v-model="adName" placeholder="行政区名称"></el-input>
  53. </el-form-item>
  54. <el-form-item label="水库名称">
  55. <el-input v-model="rsvrName" placeholder="水库名称"></el-input>
  56. </el-form-item>
  57. <el-form-item label="工程规模">
  58. <el-select v-model="engScale" clearable placeholder="工程规模">
  59. <el-option v-for="item in engScales" :key="item.id" :label="item.name" :value="item.id"></el-option>
  60. </el-select>
  61. </el-form-item>
  62. <el-form-item label="检查单位">
  63. <el-select v-model="orgName" clearable placeholder="检查单位">
  64. <el-option v-for="item in lyjg" :key="item.id" :label="item.pnm" :value="item.id"></el-option>
  65. </el-select>
  66. </el-form-item>
  67. <el-form-item label="所在组">
  68. <el-autocomplete v-model="groupName" clearable value-key='nm' :fetch-suggestions="querySearchAsync"
  69. placeholder="请选择所在组"
  70. @select="handleSelect" :clear="handleClear" @change="handleChange"></el-autocomplete>
  71. </el-form-item>
  72. <el-form-item label="督查时间">
  73. <div style="display: flex;">
  74. <el-date-picker v-model="sttm" type="date" value-format="yyyy-MM-dd"
  75. placeholder="选择日期"></el-date-picker>
  76. <p style="padding-left: 10px;padding-right: 10px;">至</p>
  77. <el-date-picker v-model="ettm" type="date" value-format="yyyy-MM-dd"
  78. placeholder="选择日期"></el-date-picker>
  79. </div>
  80. </el-form-item>
  81. <el-form-item>
  82. <el-button type="primary" @click="onSubmit">查询</el-button>
  83. </el-form-item>
  84. </el-form>
  85. </el-col>
  86. </el-row>
  87. <el-table
  88. border
  89. :data="skDataList"
  90. style="width: 100%"
  91. :height="tableHeight"
  92. >
  93. <el-table-column prop="province" label="省" v-if="isXj" show-overflow-tooltip min-width="100"
  94. align="center"></el-table-column>
  95. <el-table-column prop="city" :label="ownAdName" show-overflow-tooltip min-width="100" align="center"></el-table-column>
  96. <el-table-column prop="county" label="县" v-if="isXj" show-overflow-tooltip min-width="100"
  97. align="center"></el-table-column>
  98. <el-table-column prop="nm" label="水库名称" min-width="130" align="center"></el-table-column>
  99. <el-table-column prop="riverName" label="检查单位" show-overflow-tooltip min-width="120"
  100. align="center"></el-table-column>
  101. <el-table-column prop="groupName" label="所在组" show-overflow-tooltip min-width="150"
  102. align="center"></el-table-column>
  103. <el-table-column prop="intm1" label="督查时间" show-overflow-tooltip min-width="150"
  104. align="center"></el-table-column>
  105. <el-table-column prop="state" label="督查状态" align="center" min-width="120">
  106. <template slot-scope="scope">
  107. <span
  108. style="padding: 3px 10px;background:#27C19F;border-radius:15px;color:rgba(255,255,255,1)"
  109. v-if="scope.row.state == 0"
  110. >未督查</span>
  111. <span
  112. style="padding: 3px 10px;background:#27C19F;border-radius:15px;color:rgba(255,255,255,1)"
  113. v-if="scope.row.state == 1"
  114. >督查中</span>
  115. <span
  116. style="padding: 3px 10px;background:#27C19F;border-radius:15px;color:rgba(255,255,255,1)"
  117. v-if="scope.row.state == 2"
  118. >已督查</span>
  119. </template>
  120. </el-table-column>
  121. <el-table-column prop="engScal" label="工程规模" :formatter="formatEngScal" min-width="130"
  122. align="center"></el-table-column>
  123. <el-table-column prop="hystSite" min-width="200" show-overflow-tooltip label="水库所在位置"
  124. align="center"></el-table-column>
  125. <el-table-column prop="rsAdmName" min-width="180" show-overflow-tooltip label="管理单位"
  126. align="center"></el-table-column>
  127. <el-table-column prop="totCap" label="总库容(万m³)" min-width="130" align="center"></el-table-column>
  128. <!-- <el-table-column prop="baseStat" label="基本信息状态" align="center" min-width="130">
  129. <template slot-scope="scope">
  130. <p style="cursor:pointer;color:#67C23A" v-if="scope.row.baseStat == 1">已填报</p>
  131. <p style="cursor:pointer;color:#F56C6C;" v-if="scope.row.baseStat == 0">未填报</p>
  132. </template>
  133. </el-table-column>
  134. <el-table-column prop="presStat" label="责任人状态" align="center" min-width="130">
  135. <template slot-scope="scope">
  136. <p style="cursor:pointer;color:#67C23A" v-if="scope.row.presStat == 1">已填报</p>
  137. <p style="cursor:pointer;color:#F56C6C;" v-if="scope.row.presStat == 0">未填报</p>
  138. </template>
  139. </el-table-column>
  140. <el-table-column prop="resRunStat" label="安全管理运行状态" align="center" min-width="130">
  141. <template slot-scope="scope">
  142. <p style="cursor:pointer;color:#67C23A" v-if="scope.row.resRunStat == 1">已填报</p>
  143. <p style="cursor:pointer;color:#F56C6C;" v-if="scope.row.resRunStat == 0">未填报</p>
  144. </template>
  145. </el-table-column>
  146. <el-table-column prop="viewStat" label="走访用户状态" align="center" min-width="130">
  147. <template slot-scope="scope">
  148. <p style="cursor:pointer;color:#67C23A" v-if="scope.row.viewStat == 1">已填报</p>
  149. <p style="cursor:pointer;color:#F56C6C;" v-if="scope.row.viewStat == 0">未填报</p>
  150. </template>
  151. </el-table-column> -->
  152. <el-table-column
  153. align="center"
  154. show-overflow-tooltip
  155. label="操作"
  156. min-width="150"
  157. fixed="right"
  158. >
  159. <template slot-scope="scope">
  160. <el-button
  161. type="success"
  162. size="mini"
  163. plain
  164. :disabled="scope.row.rgstrId == ''"
  165. @click="toAddMember('详情',scope.row)"
  166. >详情
  167. </el-button>
  168. <el-button type="primary" plain @click="showQus(scope.row)">问题</el-button>
  169. <!-- <el-button type="success" v-if="scope.row.rgstrId" plain @click="toAddMember('详情',scope.row)">详情</el-button> -->
  170. </template>
  171. </el-table-column>
  172. </el-table>
  173. <el-pagination
  174. style="text-align:center;"
  175. background
  176. :pager-count="5"
  177. :current-page="pageIndex"
  178. :page-size="pageSize"
  179. :page-sizes="[10, 20, 30, 40, 50, 100]"
  180. layout="sizes, total, prev, pager, next"
  181. :total="total"
  182. @current-change="pageIndexChange"
  183. @size-change="handleSizeChange"
  184. ></el-pagination>
  185. </el-main>
  186. <!-- </el-container> -->
  187. <shuiKuTianBaoShow
  188. v-if="showShuiKuTianBao"
  189. :currentObjectRgstrId="currentObjectRgstrId"
  190. :currentResCode="currentResCode"
  191. :currentObjectId="currentObjectId"
  192. :currentObjectName="currentResName"
  193. @cancelHandler="cancelHandler"
  194. @addShuiKuSuccess="addShuiKuSuccess"
  195. ></shuiKuTianBaoShow>
  196. <rsrvQueDialogShow
  197. v-if="rsrvQueDialogShowItem"
  198. :currentObjectRgstrId="currentObjectRgstrId"
  199. :currentObjectId="currentObjectId"
  200. :currentObjectName="currentResName"
  201. :objType="1"
  202. @cancelHandler="cancelHandler"
  203. @addShuiKuSuccess="addShuiKuSuccess"
  204. ></rsrvQueDialogShow>
  205. </el-container>
  206. <!-- 添加/编辑人员弹窗 -->
  207. </div>
  208. </template>
  209. <script>
  210. import request from '../../utils/gw_ajax_request.js'
  211. import {getSKList_xsk, getrgstrIdObject, getLyjglist} from "../../api/duChaTianBao.js";
  212. import provTreeList from "../../widgets/provTreeList.vue";
  213. import shuiKuTianBaoShow from "../duChaTianBao/shuiKuTianbaoShow.vue";
  214. import {dateFormat} from '../../utils/gw_date.js'
  215. export default {
  216. components: {
  217. provTreeList: provTreeList,
  218. shuiKuTianBaoShow: shuiKuTianBaoShow,
  219. rsrvQueDialogShow: resolve => {
  220. require(["./rsrvQueDialogShow.vue"], resolve);
  221. }
  222. },
  223. props: [],
  224. data() {
  225. return {
  226. lyjg: [],
  227. engScales: [
  228. {id: '4', name: '小(1)型'},
  229. {id: '5', name: '小(2)型'},
  230. ],
  231. engScale: '',
  232. orgName: '',
  233. groupName: '',
  234. groupId: '',
  235. groups: [],
  236. sttm: '',
  237. ettm: '',
  238. rsvrName: '',
  239. adName: '',
  240. dcType: '',
  241. skDataList: [],
  242. treeData: [],
  243. testHeight: window.innerHeight - 111,
  244. dxdcMainHeight: window.innerHeight - 274,
  245. dxdcAsideHeight: window.innerHeight - 120,
  246. pageIndex: 1,
  247. pageSize: 10,
  248. total: 0,
  249. tableHeight: window.innerHeight - 330,
  250. currentResCode: "",
  251. currentObjectId: "",
  252. currentResName: "",
  253. currentObjectRgstrId: "",
  254. currentObjectInfoObject: null,
  255. showShuiKuTianBao: false,
  256. rsrvQueDialogShowItem: false,
  257. objId: "",
  258. adCode: '',
  259. currentNodeId: '',
  260. };
  261. },
  262. computed: {
  263. persId() {
  264. return localStorage.getItem("userid")
  265. ? localStorage.getItem("userid")
  266. : "1098101939614724096";
  267. }
  268. },
  269. mounted() {
  270. // this.getLeftTreeData();
  271. this.getSkDataList();
  272. this.getAllGroup();
  273. let h = document.getElementById("dxdcListMainsk").offsetHeight;
  274. // this.tableHeight = h - 100;
  275. // console.log("tableHeight" + this.tableHeight);
  276. },
  277. watch: {
  278. currentNodeId(n, o) {
  279. this.getSkDataList();
  280. },
  281. groupName(n, o) {
  282. if (n == '') {
  283. this.groupId = '';
  284. }
  285. }
  286. },
  287. activated() {
  288. this.getLeftTreeData();
  289. this.currentNodeId = "";
  290. this.rsvrName = "";
  291. this.dcType = "";
  292. this.getSkDataList();
  293. },
  294. methods: {
  295. //获取所有的组
  296. getAllGroup() {
  297. var _self = this;
  298. request.get('/dc/user/getGroupByPersid', {params: {'persid': this.persId, 'ptype': '1'}}).then((res) => {
  299. if (res.success) {
  300. _self.groups = res.data;
  301. }
  302. })
  303. },
  304. querySearchAsync(queryString, cb) {
  305. var restaurants = this.groups;
  306. var results = queryString ? restaurants.filter(this.createStateFilter(queryString)) : restaurants;
  307. clearTimeout(this.timeout);
  308. this.timeout = setTimeout(() => {
  309. cb(results);
  310. }, 1500 * Math.random());
  311. },
  312. createStateFilter(queryString) {
  313. return (state) => {
  314. return (state.nm.toLowerCase().indexOf(queryString.toLowerCase()) != -1);
  315. };
  316. },
  317. handleSelect(item) {
  318. this.groupId = item.id;
  319. },
  320. handleChange(item) {
  321. console.log(item);
  322. },
  323. handleClear(item) {
  324. console.log(item);
  325. },
  326. getLeftTreeData() {
  327. var _self = this;
  328. _self.lyjg = [];
  329. request.get('/dc/organization/base/getAllNode', {
  330. params: {
  331. 'userId': this.persId,
  332. 'orgType': '001'
  333. }
  334. }).then((res) => {
  335. let data = res.data
  336. data.forEach(ele => {
  337. if (ele.pid == null || ele.pid == '') {
  338. ele.pid = '001'
  339. }
  340. if (ele.id.length == 6) {
  341. _self.lyjg.push(ele);
  342. }
  343. });
  344. data = _self.getTrees(data)
  345. _self.treeData = data;
  346. console.log(data);
  347. // _self.duChaType = _self.treeData[0].id.substring(2,3);
  348. })
  349. },
  350. //格式化树形数据
  351. // getTrees(list, pId) {
  352. // let items = {};
  353. // // 获取每个节点的直属子节点,*记住是直属,不是所有子节点
  354. // for(let i = 0; i < list.length; i++) {
  355. // let key = list[i].parentId ? list[i].parentId : list[i].pid;
  356. // if(items[key]) {
  357. // items[key].push(list[i]);
  358. // } else {
  359. // items[key] = [];
  360. // items[key].push(list[i]);
  361. // }
  362. // }
  363. // return this.formatTree(items, pId);
  364. // },
  365. getTrees(list) {
  366. //@wxcwater重写方法 适应多个树
  367. let highLevelLength = 99;//预设最大节点id长度,目前最大应该为12,所以设置为99保证正常
  368. let _self = this;
  369. list.forEach((item, index) => {
  370. item['pidLength'] = item.pid && item.pid != '' ? item.pid.length : 0;
  371. if (highLevelLength > item.pidLength) {
  372. highLevelLength = item.pidLength;
  373. }
  374. });
  375. console.log(highLevelLength);
  376. let heightLevelNode = [];
  377. list.forEach((item, index) => {
  378. if (highLevelLength >= item.pidLength) {
  379. heightLevelNode.push(item);
  380. }
  381. });
  382. list.forEach((item, index) => {
  383. heightLevelNode.forEach((pItem) => {
  384. _self.addTreeNode(pItem, item);
  385. });
  386. });
  387. console.log(heightLevelNode);
  388. return heightLevelNode;
  389. },
  390. addTreeNode: function (treeNode, leafNode) {
  391. let _self = this;
  392. if (!treeNode.hasOwnProperty('children')) {
  393. treeNode['children'] = [];
  394. }
  395. if (leafNode.pid == treeNode.id) {
  396. treeNode.children.push(leafNode);
  397. return;
  398. }
  399. treeNode.children.forEach((item) => {
  400. _self.addTreeNode(item, leafNode);
  401. });
  402. },
  403. /**利用递归格式化每个节点**/
  404. formatTree(items, pId) {
  405. let result = [];
  406. if (!items[pId]) {
  407. return result;
  408. }
  409. for (let t of items[pId]) {
  410. t.children = this.formatTree(items, t.id)
  411. result.push(t);
  412. }
  413. return result;
  414. },
  415. treeNodeClickHandler: function (data, node, tree) {
  416. this.currentNodeId = data.id;
  417. },
  418. provTreeSelectChangeHandler: function (params) {
  419. this.adCode = params.likeCode;
  420. this.getSkDataList();
  421. },
  422. formatEngScal(row, column) {
  423. let engScal = row.engScal;
  424. let _engScal = "其他";
  425. switch (engScal) {
  426. case "1":
  427. _engScal = "大(1)型";
  428. break;
  429. case "2":
  430. _engScal = "大(2)型";
  431. break;
  432. case "3":
  433. _engScal = "中型";
  434. break;
  435. case "4":
  436. _engScal = "小(1)型";
  437. break;
  438. case "5":
  439. _engScal = "小(2)型";
  440. break;
  441. case "9":
  442. _engScal = "其他";
  443. break;
  444. }
  445. return _engScal;
  446. },
  447. getSkDataList: function () {
  448. let _self = this;
  449. let data = {
  450. persId: _self.persId,
  451. pageSize: _self.pageSize,
  452. pageIndex: _self.pageIndex,
  453. currentNodeId: _self.currentNodeId,
  454. rsvrName: _self.rsvrName,
  455. dcType: _self.dcType,
  456. adName: _self.adName,
  457. sttm: _self.sttm,
  458. ettm: _self.ettm,
  459. orgName: _self.orgName,
  460. engScale: _self.engScale,
  461. groupId: _self.groupId
  462. };
  463. getSKList_xsk(data).then(res => {
  464. console.log(res);
  465. res.data.list.forEach((item) => {
  466. item.intm1 = dateFormat(item.intm, 'yyyy-MM-dd');
  467. })
  468. this.skDataList = res.data.list;
  469. this.total = res.data.total;
  470. });
  471. },
  472. onSubmit() {
  473. this.getSkDataList();
  474. },
  475. toAddMember(type, rowData) {
  476. var _self = this;
  477. console.log(rowData);
  478. getrgstrIdObject(rowData.code, rowData.objId, _self.pageIndex).then(
  479. res => {
  480. console.log(res);
  481. _self.currentResCode = res.data.rsCode;
  482. _self.currentObjectId = res.data.objId;
  483. _self.currentObjectRgstrId = res.data.rgstrId;
  484. _self.currentResName = res.data.rsvrNm;
  485. _self.showShuiKuTianBao = true;
  486. // 获取完成
  487. },
  488. err => {
  489. }
  490. );
  491. },
  492. showQus(rowId) {
  493. var _self = this;
  494. _self.currentObjectId = rowId.objId;
  495. _self.currentResName = rowId.nm;
  496. _self.currentObjectRgstrId = rowId.rgstrId;
  497. _self.rsrvQueDialogShowItem = true;
  498. },
  499. cancelHandler() {
  500. this.showShuiKuTianBao = false;
  501. this.rsrvQueDialogShowItem = false;
  502. },
  503. addShuiKuSuccess() {
  504. this.showShuiKuTianBao = false;
  505. },
  506. deleteMember(obj) {
  507. },
  508. pageIndexChange(val) {
  509. console.log(val);
  510. this.pageIndex = val;
  511. this.getSkDataList();
  512. }
  513. , handleSizeChange(val) {
  514. this.pageSize = val;
  515. this.getSkDataList();
  516. },
  517. }
  518. };
  519. </script>
  520. <style>
  521. #dcdxHeader {
  522. padding: 15px 20px;
  523. }
  524. #dxdcFooter {
  525. text-align: center;
  526. }
  527. #dxdcAside {
  528. border: 1px solid #d5d5ff;
  529. }
  530. .el-table .warning-row {
  531. background: oldlace;
  532. }
  533. .el-table .success-row {
  534. background: #f0f9eb;
  535. }
  536. </style>