80a5f29d02d9f72d731439b3d27fe1fe540f7bc5.svn-base 42 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028
  1. <template>
  2. <div>
  3. <el-container>
  4. <el-aside
  5. width="318px"
  6. style="border-right:2px solid #d5d5ff;float:left;height:calc(100vh - 100px);text-align: center;">
  7. <el-button size="mini" :class="tabType==1 ? 'skactive' : 'sknormal'" @click="tabChange('1')">当前数据
  8. </el-button>
  9. <!-- <el-button size="mini" :class="tabType==2 ? 'skactive' : 'sknormal'" @click="tabChange('2')">历史数据-->
  10. <!-- </el-button>-->
  11. <el-button size="mini" :class="tabType==0 ? 'skactive' : 'sknormal'" @click="tabChange('0')">全部数据
  12. </el-button>
  13. <div class="tree" style="height: 100%;width: 100%;overflow: auto;display: inline-flex;">
  14. <el-tree
  15. :highlight-current="true"
  16. style=" height: calc(100% - 50px);"
  17. :data="treeData"
  18. node-key="id"
  19. show-checkbox
  20. @check-change="treeNodeClickHandler"
  21. ref="jigou_tree">
  22. <div class="custom-tree-node" slot-scope="{ node, data }">
  23. <span style="float:left;">
  24. {{ data.pnm}}
  25. </span>
  26. <div
  27. style="float:right;display: flex;justify-content: flex-end;align-items: center;width:50%;">
  28. <span style="color:blue;width:80px;"></span>
  29. </div>
  30. </div>
  31. </el-tree>
  32. </div>
  33. </el-aside>
  34. <el-main style="margin:0px;padding:10px;overflow-y:hidden;" class="shuiku" v-loading="exportLoading">
  35. <div class="search_wrapper">
  36. <el-form :inline="true" :model="problemSearch" class="demo-form-inline">
  37. <el-form-item label="督查对象名称">
  38. <el-input v-model="problemSearch.nm" clearable></el-input>
  39. </el-form-item>
  40. <el-form-item label="问题类别">
  41. <el-select v-model="problemSearch.inspPblmName" clearable>
  42. <el-option :label="item.inspPblmsName" :value="item.inspPblmsName"
  43. v-for="(item,index) in problemType" :key="index"></el-option>
  44. </el-select>
  45. </el-form-item>
  46. <!--<el-form-item label="严重程度">-->
  47. <!--<el-select v-model="problemSearch.inspPblmCate" clearable>-->
  48. <!--<el-option :label="item.name" :value="item.value" v-for="(item,index) in severity" :key="index"></el-option>-->
  49. <!--</el-select>-->
  50. <!--</el-form-item>-->
  51. <el-form-item label="是否典型">
  52. <el-select v-model="problemSearch.ifCasePblm" clearable placeholder="请选择">
  53. <el-option
  54. v-for="item in supervision"
  55. :key="item.value"
  56. :label="item.label"
  57. :value="item.value"
  58. ></el-option>
  59. </el-select>
  60. </el-form-item>
  61. <el-form-item label="发现时间">
  62. <el-date-picker
  63. v-model="findTime"
  64. type="daterange"
  65. value-format="yyyy-MM-dd"
  66. range-separator="至"
  67. start-placeholder="开始日期"
  68. end-placeholder="结束日期">
  69. </el-date-picker>
  70. </el-form-item>
  71. <el-form-item label="问题督查状态:">
  72. <el-select v-model="problemSearch.state" clearable placeholder="请选择">
  73. <el-option
  74. v-for="item in stateList"
  75. :key="item.value"
  76. :label="item.label"
  77. :value="item.value"
  78. ></el-option>
  79. </el-select>
  80. </el-form-item>
  81. </el-form>
  82. <div>
  83. <el-button
  84. style="color:rgba(255,255,255,1);float:right;margin-right:10px;"
  85. type="success"
  86. icon="el-icon-upload2"
  87. @click="showPlDialog"
  88. :disabled="uploadDisabled"> 批 量 填 报
  89. </el-button>
  90. <el-button style="color:rgba(255,255,255,1);float:right;margin-right:20px;margin-bottom:5px"
  91. type="primary"
  92. icon="el-icon-search"
  93. @click="search">&nbsp;&nbsp; 查&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;询&nbsp;&nbsp;
  94. </el-button>
  95. <el-button style="color:rgba(255,255,255,1);float:right;margin-right:10px;margin-bottom:5px;"
  96. type="success"
  97. icon="el-icon-download"
  98. @click="exportWord">导出WORD
  99. </el-button>
  100. <el-button
  101. style="color:rgba(255,255,255,1);float:right;margin-right:10px;"
  102. type="success"
  103. icon="el-icon-download"
  104. @click="downloadTemplate">导出EXCEL
  105. </el-button>
  106. <el-button
  107. style="color:rgba(255,255,255,1);float:right;margin-right:10px;"
  108. type="success"
  109. @click="submitBtn"
  110. >问题提交
  111. </el-button>
  112. <el-button
  113. v-if="isGd"
  114. style="color:rgba(255,255,255,1);float:right;margin-right:10px;margin-top:5px;"
  115. type="success"
  116. icon="el-icon-download"
  117. @click="toForm"
  118. >导出一表一单
  119. </el-button>
  120. <YuDiBaWentiPl v-if="showTianBaoPl"
  121. :showTianBaoPl="showTianBaoPl"
  122. titleName="节水管理与评价"
  123. @closePlDialog="closePlDialog">
  124. </YuDiBaWentiPl>
  125. </div>
  126. </div>
  127. <el-table
  128. :data="tableData"
  129. border
  130. :height="tableHeight"
  131. v-loading="loading"
  132. style="width: 100%"
  133. @selection-change="handleSelectionChange">
  134. <el-table-column
  135. type="selection"
  136. min-width="55">
  137. </el-table-column>
  138. <el-table-column
  139. fixed
  140. prop="nm"
  141. show-overflow-tooltip
  142. label="督查对象名称"
  143. min-width="180">
  144. </el-table-column>
  145. <el-table-column
  146. min-width="140"
  147. prop="inspPblmsName"
  148. label="问题类别"
  149. show-overflow-tooltip
  150. ></el-table-column>
  151. <!--<el-table-column-->
  152. <!--show-overflow-tooltip-->
  153. <!--prop="inspPblmName"-->
  154. <!--label="检查事项"-->
  155. <!--min-width="150">-->
  156. <!--</el-table-column>-->
  157. <el-table-column
  158. show-overflow-tooltip
  159. prop="inspPblmDesc"
  160. label="详细描述"
  161. min-width="150">
  162. </el-table-column>
  163. <!--<el-table-column-->
  164. <!--prop="inspPblmCate"-->
  165. <!--label="严重程度"-->
  166. <!--min-width="90">-->
  167. <!--<template slot-scope="scope">-->
  168. <!--{{scope.row.inspPblmCate | inspPblmCate}}-->
  169. <!--</template>-->
  170. <!--</el-table-column>-->
  171. <el-table-column
  172. prop="ifCasePblm"
  173. label="是否典型"
  174. min-width="90">
  175. <template slot-scope="scope">
  176. {{scope.row.ifCasePblm == '1' ? '典型' : scope.row.ifCasePblm == '0' ? '非典型' : ''}}
  177. </template>
  178. </el-table-column>
  179. <el-table-column
  180. prop="collTime"
  181. label="发现时间"
  182. min-width="150">
  183. <template slot-scope="scope">
  184. {{scope.row.collTime ? formatDateTime(scope.row.collTime) : ''}}
  185. </template>
  186. </el-table-column>
  187. <el-table-column
  188. header-align="center"
  189. align="center"
  190. min-width="100"
  191. prop="state"
  192. label="问题督查状态">
  193. <template slot-scope="scope">
  194. <p v-if="Number(scope.row.state) === 0"><span class="inspPblmCate"
  195. style="background: #F56C6C;">未提交</span>
  196. </p>
  197. <p v-if="scope.row.state == 2"><span class="inspPblmCate"
  198. style="background: #409EFF;">已提交</span>
  199. </p>
  200. <p v-if="scope.row.state == 3"><span class="inspPblmCate"
  201. style="background: #67C23A;">已发布</span>
  202. </p>
  203. </template>
  204. </el-table-column>
  205. <!-- <el-table-column
  206. prop="zip"
  207. label="复查时间"
  208. width="120">
  209. </el-table-column> -->
  210. <!--<el-table-column-->
  211. <!--prop="hasVedio"-->
  212. <!--label="有无多媒体"-->
  213. <!--min-width="100">-->
  214. <!--<template slot-scope="scope">-->
  215. <!--<p v-if="scope.row.hasVedio == 1">是</p>-->
  216. <!--<p v-if="scope.row.hasVedio == 0">否</p>-->
  217. <!--</template>-->
  218. <!--</el-table-column>-->
  219. <el-table-column
  220. fixed="right"
  221. label="操作"
  222. min-width="130">
  223. <template slot-scope="scope">
  224. <span style="margin-right:10px;" v-if="ownPriv('manage')">
  225. <el-button icon="el-icon-s-flag" type="text" v-if="scope.row.quote == '1'" title="已被督查简报引用"
  226. @click="changeSfYy(scope.row.pblmId,1)"></el-button>
  227. <i class="el-icon-s-flag" v-else title="未被督查简报引用" @click="changeSfYy(scope.row.pblmId,0)"
  228. style="cursor: pointer;"></i>
  229. </span>
  230. <el-button icon="el-icon-edit" title="修改问题" type="text"
  231. v-if="ownPriv('manage') && (!scope.row.reviConc || scope.row.reviConc =='0')"
  232. @click="toEditProblem(scope.row)"></el-button>
  233. <el-button icon="el-icon-edit" title="修改问题" type="text"
  234. v-if="ownPriv('manage') && (scope.row.reviConc == '1' || scope.row.reviConc =='2')"
  235. @click="toRecheckProblem(scope.row)"></el-button>
  236. <el-button icon="el-icon-view" title="查看详情" type="text"
  237. @click="toShowDetail(scope.row)"></el-button>
  238. <el-button icon="el-icon-delete" type="text" title="删除问题" @click="deteleProblem(scope.row)"
  239. v-if="ownPriv('manage')"></el-button>
  240. </template>
  241. </el-table-column>
  242. </el-table>
  243. <el-pagination :pager-count="5" :current-page="pageIndex"
  244. :page-size="pageSize" layout="total, prev, pager, next" :total="total"
  245. @current-change="pageIndexChange" @size-change="handleSizeChange"
  246. ></el-pagination>
  247. </el-main>
  248. </el-container>
  249. <!-- 修改组件 -->
  250. <problem-edit :editId="problemId" @closeEditDialog="closeEditDialog" v-if="edit_dialogVisible"
  251. :dcType="15"></problem-edit>
  252. <!-- 详情组件-->
  253. <el-dialog
  254. class="custom_dialog"
  255. title="问题详情"
  256. width="60%"
  257. append-to-body
  258. v-if="supervisionDetailsVisible"
  259. :visible.sync="supervisionDetailsVisible">
  260. <supervision-details ref="xianqing" :problemId="problemId" objType="15"></supervision-details>
  261. <span slot="footer">
  262. <el-button style="margin-top:5px;" @click="supervisionDetailsVisible = false">返回</el-button>
  263. </span>
  264. </el-dialog>
  265. </div>
  266. </template>
  267. <script>
  268. import {pblmSubmit} from "@api/duChaAPI.js";
  269. import {formatDateTime2} from '../../utils/gw_date.js'
  270. import request from '../../utils/gw_ajax_request.js'
  271. import {hostUrl} from "@util/global_variable.js";
  272. import YuDiBaWentiPl from './problemBatchImp/tongYongWenti_piliang.vue'
  273. import {exportModel} from "@util/gw_exportModel";
  274. export default {
  275. props: [],
  276. data() {
  277. return {
  278. tabType: "0",//0全部数据,1当前数据,2历史数据
  279. currentRow: {},
  280. edit_dialogVisible: false,
  281. tableHeight: window.innerHeight - 250,
  282. tableData: [
  283. {
  284. date: '',
  285. name: '',
  286. province: '',
  287. city: '',
  288. address: '',
  289. zip: ''
  290. }
  291. ],
  292. problemSearch: {
  293. problemType: '',
  294. inspPblmCate: '',
  295. reviConc: '',
  296. regid: '',
  297. regId: '',
  298. pType: '',
  299. pageSize: '20',
  300. pageNum: 1,
  301. nm: '',
  302. state: ''
  303. },
  304. stateList: [
  305. {
  306. label: '未提交',
  307. value: '0'
  308. },
  309. {
  310. label: '已提交',
  311. value: '2'
  312. },
  313. {
  314. label: '已发布',
  315. value: '3'
  316. }
  317. ],
  318. problemForm: {
  319. objId: '',
  320. objType: '',
  321. problemType: '',
  322. inspPblmDesc: '',
  323. pblmsTypeId: '',
  324. qualityTypeId: '',
  325. pblmsId: '',
  326. defectTypeId: '',
  327. ifCasePblm: '',
  328. inspPblmCate: '',
  329. weigui: '',
  330. hetong: '',
  331. quanlity: '',
  332. gongcheng: '',
  333. gwComFiles: []
  334. },
  335. rectifyForm: {
  336. rectConc: '',
  337. rectMeas: '',
  338. collTime: '',
  339. gwComFiles: [{
  340. id: "",
  341. filePath: "",
  342. bizId: ""
  343. }]
  344. },
  345. weigui: {
  346. pblmRelDics: [],
  347. pblmSn: ''
  348. },
  349. hetong: {
  350. pblmRelDics: [],
  351. pblmSn: ''
  352. },
  353. quanlity: {
  354. pblmRelDics: [],
  355. pblmSn: ''
  356. },
  357. gongcheng: {
  358. pblmRelDics: [],
  359. pblmSn: ''
  360. },
  361. pblmPointNum: '',
  362. pblmDescList: '',
  363. pblmDescListHetong: '',
  364. pblmAttach: [],
  365. pblmsTypeId: '',
  366. pblmId: '',
  367. imgList: [],
  368. videoList: [],
  369. audioList: [],
  370. pblmStat: '',
  371. gwComFiles: [],
  372. problemType: [],
  373. problemStatus: [
  374. {name: '已复查', value: '2'},
  375. {name: '未复查', value: '1'},
  376. {name: '新问题', value: '0'}
  377. ],
  378. rectifyStatus: [
  379. {name: '未整改', value: '0'},
  380. {name: '整改中', value: '1'},
  381. {name: '已整改', value: '2'}
  382. ],
  383. severity: [
  384. {name: '一般', value: '0'},
  385. {name: '较重', value: '1'},
  386. {name: '严重', value: '2'},
  387. // {name: '非常严重',value:'3'}
  388. ],
  389. dialogType: '添加',
  390. dialogVisible: true,
  391. add_dialogVisible: false,
  392. recheck_dialogVisible: false,
  393. chooseWeiguiProblem: false,
  394. chooseHeTongProblem: false,
  395. chooseQuanlityProblem: false,
  396. chooseGongchengProblem: false,
  397. checked: false,
  398. problemId: '',
  399. supervisionDetailsVisible: false,
  400. projectType: '',
  401. reviConc: '',
  402. findTime: [],
  403. rectifyRow: {},
  404. isRectify: false,
  405. rectifyId: '',
  406. activeName: 'problem-detail',
  407. pageIndex: 1,
  408. pageSize: 20,
  409. total: 0,
  410. treeData: [],
  411. findUseOrgArray: [],
  412. treeNodeArray: [],
  413. loading: true,
  414. multipleSelection: [], // 已选
  415. rectifyProblemInfo: null,
  416. exportLoading: false,
  417. datas: {},
  418. showTianBaoPl: false,
  419. orgIds: '',
  420. uploadDisabled: true,
  421. supervision: [
  422. {
  423. value: "1",
  424. label: "是"
  425. },
  426. {
  427. value: "0",
  428. label: "否"
  429. }
  430. ]
  431. }
  432. },
  433. computed: {
  434. persId() {
  435. return localStorage.getItem("userid")
  436. ? localStorage.getItem("userid")
  437. : "1098101939614724096";
  438. },
  439. formatDateTime() {
  440. return formatDateTime2
  441. },
  442. hostUrl() {
  443. return hostUrl
  444. },
  445. isGd(){
  446. if(localStorage.getItem('currentRlcode').substring(0,2)=="44"){
  447. return true;
  448. }else{
  449. return false;
  450. }
  451. }
  452. },
  453. components: {
  454. upload: resolve => {
  455. require(["../../widgets/uploadFile.vue"], resolve);
  456. },
  457. // 修改问题
  458. problemEdit: resolve => {
  459. require(["../duChaWenTi/fenshuiguankongProblemModify.vue"], resolve);
  460. },
  461. //详情页
  462. supervisionDetails: resolve => {
  463. require(["../duChaWenTi/supervisionDetails_shuiyuandiNew.vue"], resolve);
  464. },
  465. YuDiBaWentiPl: YuDiBaWentiPl
  466. },
  467. mounted() {
  468. // this.getLeftTreeData();
  469. // this.searchList()
  470. // this.getproblemSmallType();
  471. },
  472. activated() {
  473. this.getLeftTreeData();
  474. this.search();
  475. this.getproblemSmallType();
  476. this.findParams = {
  477. hasVedio: "",
  478. adCode: "",
  479. pblmStat: "",
  480. inspPblmCate: "",
  481. ifCasePblm: "",
  482. nm: "",
  483. rsName: "",
  484. adFullName: "",
  485. startTime: "",
  486. endTime: "",
  487. inspPblmName: "",
  488. persId: localStorage.getItem("userid")
  489. }
  490. },
  491. methods: {
  492. tabChange(tabType) {
  493. this.tabType = tabType;
  494. this.getLeftTreeData();
  495. this.search();
  496. },
  497. getLeftTreeData() {
  498. var _self = this;
  499. request.get("/dc/organization/base/getAllNode", {
  500. params: {
  501. userId: this.persId,
  502. orgType: "015",
  503. tabType: this.tabType
  504. }
  505. }).then(res => {
  506. let data = res.data;
  507. data.forEach(ele => {
  508. if (ele.pid == null || ele.pid == "") {
  509. ele.pid = "015";
  510. }
  511. });
  512. data = _self.getTrees(data);
  513. _self.treeData = data;
  514. console.log(data);
  515. });
  516. },
  517. search() {
  518. this.searchList()
  519. },
  520. async searchList() {
  521. let _self = this;
  522. this.problemSearch.persId = this.persId
  523. this.problemSearch.pType = '15'
  524. this.problemSearch.pageSize = this.pageSize
  525. this.problemSearch.pageNum = this.pageIndex
  526. console.log(this.findTime)
  527. if (this.findTime && this.findTime.length) {
  528. this.problemSearch['startTime'] = this.findTime[0]
  529. this.problemSearch['endTime'] = this.findTime[1]
  530. this.problemSearch.reviConc = this.problemSearch.reviConc || "0"
  531. } else {
  532. this.problemSearch['startTime'] = ''
  533. this.problemSearch['endTime'] = ''
  534. }
  535. this.problemSearch.tabType = this.tabType;
  536. await request.get("/dc/organization/base/getAllNode", {
  537. params: {
  538. userId: this.persId,
  539. orgType: "015",
  540. tabType: this.tabType
  541. }
  542. }).then(res => {
  543. _self.loading = true;
  544. let orgAllNode = res.data;
  545. let data = _self.problemSearch;
  546. _self.findUseOrgArray = [];
  547. _self.treeNodeArray.forEach(item => {
  548. if (item.id.length < 12) {
  549. orgAllNode.forEach(orgItem => {
  550. if (orgItem.id.startsWith(item.code)) {
  551. _self.findUseOrgArray.push(orgItem.id);
  552. }
  553. });
  554. }
  555. _self.findUseOrgArray.push(item.id);
  556. });
  557. if (_self.findUseOrgArray.length > 0) {
  558. data["orgIds"] = _self.findUseOrgArray.join(",");
  559. this.orgIds = _self.findUseOrgArray.join(",");
  560. } else {
  561. data["orgIds"] = "";
  562. }
  563. request.post(`/dc/insp/pblm/page/cityPblm`, this.problemSearch).then(res => {
  564. _self.loading = false;
  565. this.tableData = res.data.list;
  566. this.total = res.data.total;
  567. });
  568. })
  569. },
  570. async submitBtn() {
  571. if (this.multipleSelection.length === 0) {
  572. this.$message.warning('请至少选择一条问题');
  573. return;
  574. }
  575. let newArray = this.multipleSelection.map((item) => {
  576. return {
  577. "objId": item.objId,
  578. "objType": item.objType,
  579. "state": "3"
  580. }
  581. });
  582. const {success, message} = await pblmSubmit(newArray);
  583. if (success) {
  584. this.$message.success('问题发布成功');
  585. this.search();
  586. } else {
  587. this.$message.warning(message);
  588. }
  589. },
  590. toEditProblem(row) {
  591. this.dialogType = '修改'
  592. this.unitProblemInfo = row
  593. this.problemId = row.pblmId
  594. this.edit_dialogVisible = true
  595. },
  596. // 复查
  597. toRecheckProblem(row) {
  598. this.rectifyProblemInfo = row
  599. this.dialogType = row.reviConc == '1' ? '添加' : row.reviConc == '2' ? '修改' : '添加'
  600. this.rectifyForm.rectConc = row.rectConc
  601. this.rectifyForm.rectMeas = row.rectMeas
  602. Object.assign(this.rectifyRow, row)
  603. if (this.dialogType == '添加') {
  604. this.rectifyForm.collTime = ''
  605. } else {
  606. this.rectifyForm.collTime = this.formatDateTime(row.collTime)
  607. }
  608. this.recheck_dialogVisible = true
  609. },
  610. // 查看详情
  611. toShowDetail(row) {
  612. this.problemId = row.pblmId
  613. this.rectifyId = row.guid
  614. this.reviConc = row.reviConc
  615. this.supervisionDetailsVisible = true
  616. },
  617. deteleProblem(row) {
  618. this.$confirm('确认删除当前问题吗?', '提示', {
  619. confirmButtonText: '确定',
  620. cancelButtonText: '取消',
  621. type: 'warning'
  622. }).then(() => {
  623. request.get(`/dc/insp/pblm/delete/${row.pblmId}/${this.persId}`).then(res => {
  624. if (res.success) {
  625. this.$message.success('删除成功')
  626. this.searchList()
  627. } else {
  628. this.$message.error(res.message)
  629. }
  630. })
  631. }).catch(() => {
  632. });
  633. },
  634. // 文件上传
  635. submitUpload() {
  636. this.$refs.upload.submit();
  637. },
  638. updatefilelist(arg) {
  639. if (this.isRectify) {
  640. request.post('/dc/insp/rectFdbk', {
  641. id: this.pblmId,
  642. gwComFiles: arg
  643. }).then(res => {
  644. this.removeNewSupervision()
  645. });
  646. } else {
  647. if (this.dialogType == '修改') {
  648. this.problemForm.gwComFiles = this.problemForm.gwComFiles.concat(arg)
  649. } else {
  650. this.problemForm.gwComFiles = arg
  651. }
  652. request.post('/dc/insp/pblm/update', {
  653. pblmId: this.pblmId,
  654. gwComFiles: this.problemForm.gwComFiles,
  655. pblmStat: this.pblmStat
  656. }).then(res => {
  657. this.searchList()
  658. this.removeNewSupervision()
  659. });
  660. }
  661. },
  662. removeNewSupervision(arg) {
  663. if (arg) {
  664. console.log(arg);
  665. var args = this.gwComFiles.concat(arg);
  666. this.updatefilelist(args);
  667. }
  668. this.$message.success('保存成功')
  669. this.$emit('closeDialog')
  670. this.gwComFiles = [];
  671. this.$refs.uploadFile.init();
  672. },
  673. handleClose() {
  674. this.$emit('dialogClose')
  675. },
  676. handleDetailClick(tab, event) {
  677. console.log(tab, event);
  678. },
  679. pageIndexChange(val) {
  680. this.pageIndex = val;
  681. this.searchList();
  682. },
  683. handleSizeChange(val) {
  684. this.pageSize = val;
  685. this.searchList();
  686. },
  687. //格式化树形数据
  688. getTrees(list) {
  689. //@wxcwater重写方法 适应多个树
  690. let highLevelLength = 99;//预设最大节点id长度,目前最大应该为12,所以设置为99保证正常
  691. let _self = this;
  692. list.forEach((item, index) => {
  693. item['pidLength'] = item.pid && item.pid != '' ? item.pid.length : 0;
  694. if (highLevelLength > item.pidLength) {
  695. highLevelLength = item.pidLength;
  696. }
  697. });
  698. console.log(highLevelLength);
  699. let heightLevelNode = [];
  700. list.forEach((item, index) => {
  701. if (highLevelLength >= item.pidLength) {
  702. heightLevelNode.push(item);
  703. }
  704. });
  705. list.forEach((item, index) => {
  706. heightLevelNode.forEach((pItem) => {
  707. _self.addTreeNode(pItem, item);
  708. });
  709. });
  710. console.log(heightLevelNode);
  711. return heightLevelNode;
  712. },
  713. addTreeNode: function (treeNode, leafNode) {
  714. let _self = this;
  715. if (!treeNode.hasOwnProperty('children')) {
  716. treeNode['children'] = [];
  717. }
  718. if (leafNode.pid == treeNode.id) {
  719. treeNode.children.push(leafNode);
  720. return;
  721. }
  722. treeNode.children.forEach((item) => {
  723. _self.addTreeNode(item, leafNode);
  724. });
  725. },
  726. //树节点点击事件
  727. treeNodeClickHandler: function () {
  728. let cNarray = this.$refs["jigou_tree"].getCheckedNodes();
  729. console.log(cNarray);
  730. this.treeNodeArray = cNarray;
  731. },
  732. // 已选择项
  733. handleSelectionChange(val) {
  734. this.multipleSelection = val;
  735. },
  736. closeEditDialog() {
  737. this.edit_dialogVisible = false;
  738. this.problemId = "";
  739. this.searchList();
  740. },
  741. async exportWord() {
  742. let _self = this;
  743. _self.exportLoading = true;
  744. await request.get("/dc/organization/base/getAllNode", {
  745. params: {
  746. userId: this.persId,
  747. orgType: "015"
  748. }
  749. }).then(res => {
  750. let orgAllNode = res.data;
  751. let data = _self.findParams;
  752. data.pageNum = _self.pageIndex;
  753. data.pageSize = _self.pageSize;
  754. data.pType = "15";
  755. data.orgIds = _self.orgIds;
  756. this.datas = data;
  757. _self.treeNodeArray.forEach(item => {
  758. if (item.id.length < 12) {
  759. orgAllNode.forEach(orgItem => {
  760. if (orgItem.id.startsWith(item.id)) {
  761. _self.findUseOrgArray.push(orgItem.id);
  762. }
  763. });
  764. } else {
  765. _self.findUseOrgArray.push(item.id);
  766. }
  767. });
  768. });
  769. //下载word文档2
  770. await request.post('/pblm/doc', this.datas).then(res => {
  771. if (res.success) {
  772. _self.exportLoading = false;
  773. console.log(this.response)
  774. var a = document.createElement('a');
  775. a.href = `${this.hostUrl}${res.data.downloadPath}`;
  776. //设置文件名称
  777. a.download = '节水管理与评价问题详情.doc';
  778. a.click();
  779. } else {
  780. _self.$mesage.error(res.message);
  781. }
  782. }).catch(res => {
  783. _self.$mesage.error(res.message);
  784. })
  785. },
  786. toForm(){
  787. var idArr = [];
  788. if(this.multipleSelection && this.multipleSelection.length==0){
  789. this.$message.warning("请选择数据");
  790. return false;
  791. }else{
  792. this.multipleSelection.forEach((item)=>{
  793. idArr.push(item.pblmId);
  794. })
  795. }
  796. var ids = idArr.join(",");
  797. let host = hostUrl;
  798. let nginx = '/pageofficePath/';
  799. let href = 'pageoffice://|' + host + nginx + '/pageoffice/pblm/list/word?ids='+ids+'&filename=pblm|width=1100px;height=800px;ismodal=false;||91A4EE66EC1921F376873E85D6C74FFA|A890649B44577C32CE1930797E1299F9';
  800. let a = document.createElement('a'); // 创建a标签
  801. a.setAttribute('href', href);// href链接
  802. a.click();// 自执行点击事件
  803. },
  804. // 下载模板
  805. async downloadTemplate() {
  806. await this.searchList();
  807. await this.downloadTemplateSet();
  808. this.uploadDisabled = false;
  809. },
  810. async downloadTemplateSet() {
  811. // 根据过滤条件下载数据
  812. let datas = JSON.stringify(this.findParams);
  813. let url = '/pdcApi/dc/imp/pblm/download?userId=' + this.persId + '&orgType=015&orgIds=' + this.orgIds + 'datas=' + datas;
  814. let downloadName = "节水管理与评价问题.xls";
  815. let type = "get";
  816. await exportModel(type, url, downloadName);
  817. },
  818. //切换问题是否被督查简报调用
  819. changeSfYy(row, val) {
  820. this.$confirm('此问题将切换是否被督查简报引用, 是否继续?', '提示', {
  821. confirmButtonText: '确定',
  822. cancelButtonText: '取消',
  823. type: 'warning'
  824. }).then(() => {
  825. if (val) {
  826. request.post(`/dc/insp/pblm/update`, {
  827. "pblmId": row,
  828. "quote": 0
  829. }).then(res => {
  830. if (res.success) {
  831. this.search();
  832. }
  833. })
  834. } else {
  835. request.post(`/dc/insp/pblm/update`, {
  836. "pblmId": row,
  837. "quote": 1
  838. }).then(res => {
  839. if (res.success) {
  840. this.search();
  841. }
  842. })
  843. }
  844. }).catch(() => {
  845. this.$message({
  846. type: 'info',
  847. message: '已取消切换'
  848. });
  849. });
  850. },
  851. showPlDialog() {
  852. this.showTianBaoPl = true
  853. },
  854. closePlDialog(val) {
  855. this.showTianBaoPl = false
  856. this.search();
  857. },
  858. getproblemSmallType() {
  859. let result = [];
  860. request.get('/dc/insp/pblms/getPblmType', {
  861. params: {
  862. type: '15',
  863. pguid: '15000000000000000000000000000000'
  864. }
  865. }).then(res => {
  866. if (res.success) {
  867. res.data.forEach((ele) => {
  868. let haveinspPblmsName = false;
  869. result.forEach((inspPblm) => {
  870. if (inspPblm['inspPblmsName'] == ele.inspPblmsName) {
  871. //
  872. let havechekPoint = false;
  873. inspPblm['checkPoints'].forEach((chekPoint) => {
  874. if (chekPoint['checkPointName'] == ele.checkPoint) {
  875. //
  876. chekPoint['pblmDescs'].push({
  877. pblmDesc: ele.pblmDesc,
  878. sn: ele.sn,
  879. guid: ele.guid,
  880. });
  881. havechekPoint = true;
  882. }
  883. });
  884. if (!havechekPoint) {
  885. let newCheckPoint = {};
  886. newCheckPoint['checkPointName'] = ele.checkPoint;
  887. newCheckPoint['sort2'] = ele.sort2;
  888. newCheckPoint['pblmDescs'] = [{
  889. pblmDesc: ele.pblmDesc,
  890. sn: ele.sn,
  891. guid: ele.guid,
  892. }]
  893. inspPblm['checkPoints'].push(newCheckPoint);
  894. }
  895. haveinspPblmsName = true;
  896. }
  897. });
  898. if (!haveinspPblmsName) {
  899. let haveinspPblmsObj = {};
  900. haveinspPblmsObj['inspPblmsName'] = ele.inspPblmsName;
  901. haveinspPblmsObj['sort1'] = ele.sort1;
  902. haveinspPblmsObj['checkPoints'] = [{
  903. checkPointName: ele.checkPoint,
  904. sort2: ele.sort2,
  905. pblmDescs: [{
  906. pblmDesc: ele.pblmDesc,
  907. sn: ele.sn,
  908. guid: ele.guid,
  909. }]
  910. }];
  911. result.push(haveinspPblmsObj);
  912. }
  913. })
  914. this.problemType = result;
  915. console.log(this.problemType);
  916. }
  917. })
  918. },
  919. },
  920. watch: {
  921. // 'weigui.pblmSn':{
  922. // deep: true,
  923. // handler(val){
  924. // this.showPblmList(this.weigui,this.problemForm.weigui,'违规')
  925. // }
  926. // },
  927. // 'hetong.pblmSn':{
  928. // deep: true,
  929. // handler(val){
  930. // this.showPblmList(this.hetong,this.problemForm.hetong,'合同')
  931. // }
  932. // },
  933. // 'quanlity.pblmSn':{
  934. // deep: true,
  935. // handler(val){
  936. // this.showPblmList(this.quanlity,this.problemForm.quanlity,'质量')
  937. // }
  938. // },
  939. // 'gongcheng.pblmSn':{
  940. // deep: true,
  941. // handler(val){
  942. // this.showPblmList(this.gongcheng,this.problemForm.gongcheng,'工程')
  943. // }
  944. // }
  945. },
  946. filters: {
  947. inspPblmCate(val) {
  948. if (!val || val == '') {
  949. return ''
  950. }
  951. if (val == '0') {
  952. return '一般'
  953. } else if (val == '1') {
  954. return '较重'
  955. } else if (val == '2') {
  956. return '严重'
  957. } else {
  958. return val
  959. }
  960. },
  961. }
  962. }
  963. </script>
  964. <style lang="scss">
  965. .search_wrapper {
  966. display: flex;
  967. justify-content: space-between;
  968. min-height: 110px;
  969. div:last-child {
  970. min-width: 160px;
  971. }
  972. }
  973. .slide-line {
  974. width: 96%;
  975. margin-left: 3%;
  976. height: 1px;
  977. margin-bottom: 10px;
  978. border-bottom: dashed 1px #DCDFE6;
  979. }
  980. .detail_dialog .el-dialog__body {
  981. padding: 0 20px 30px;
  982. }
  983. .inspPblmCate {
  984. padding: 2px 10px;
  985. border-radius: 10px;
  986. color: #ffffff;
  987. -webkit-border-radius: 10px;
  988. -moz-border-radius: 10px;
  989. border-radius: 10px;
  990. }
  991. .skactive {
  992. background: #3f8eff !important;
  993. color: white !important;
  994. margin-top: 5px;
  995. margin-bottom: 5px;
  996. }
  997. .sknormal {
  998. background: white;
  999. margin-top: 5px;
  1000. margin-bottom: 5px;
  1001. }
  1002. </style>