44fed89ad423be56c9eeaca0662ca5ef1e6a3eef.svn-base 43 KB

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