f5d9d2c956a3eaa0a3fea3964fb4bc6a3fce45be.svn-base 43 KB

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