c7320ecd1ebdb6246b59b8bed9df107929ecea24.svn-base 42 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024
  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-button
  82. style="color:rgba(255,255,255,1);float:right;margin-right:10px;"
  83. type="success"
  84. @click="submitBtn"
  85. >问题提交
  86. </el-button>
  87. <el-button style="color:rgba(255,255,255,1);float:right;margin-right:20px"
  88. type="primary"
  89. icon="el-icon-search"
  90. @click="search">&nbsp;&nbsp; 查&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;询&nbsp;&nbsp;
  91. </el-button>
  92. <el-button
  93. v-if="isGd"
  94. style="color:rgba(255,255,255,1);float:right;margin-right:10px;margin-top:5px;"
  95. type="success"
  96. icon="el-icon-download"
  97. @click="toForm"
  98. >导出一表一单
  99. </el-button>
  100. </el-form>
  101. <div>
  102. <!--<el-button-->
  103. <!--style="color:rgba(255,255,255,1);float:right;margin-right:10px;"-->
  104. <!--type="success"-->
  105. <!--icon="el-icon-upload2"-->
  106. <!--@click="showPlDialog"-->
  107. <!--:disabled="uploadDisabled"> 批 量 填 报 </el-button>-->
  108. <!--<el-button style="color:rgba(255,255,255,1);float:right;margin-right:10px;margin-bottom:5px;"-->
  109. <!--type="success"-->
  110. <!--icon="el-icon-download"-->
  111. <!--@click="exportWord">导出WORD-->
  112. <!--</el-button>-->
  113. <!--<el-button-->
  114. <!--style="color:rgba(255,255,255,1);float:right;margin-right:10px;"-->
  115. <!--type="success"-->
  116. <!--icon="el-icon-download"-->
  117. <!--@click="downloadTemplate"-->
  118. <!--&gt;导出EXCEL</el-button>-->
  119. <YuDiBaWentiPl v-if="showTianBaoPl"
  120. :showTianBaoPl="showTianBaoPl"
  121. titleName="水源地"
  122. @closePlDialog="closePlDialog">
  123. </YuDiBaWentiPl>
  124. </div>
  125. </div>
  126. <el-table
  127. :data="tableData"
  128. border
  129. :height="tableHeight"
  130. v-loading="loading"
  131. style="width: 100%"
  132. @selection-change="handleSelectionChange"
  133. >
  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" :dcType="14" @closeEditDialog="closeEditDialog"
  251. v-if="edit_dialogVisible"></problem-edit>
  252. <!-- 详情组件-->
  253. <el-dialog
  254. class="custom_dialog"
  255. title="问题详情"
  256. width="60%"
  257. v-if="supervisionDetailsVisible"
  258. append-to-body
  259. :visible.sync="supervisionDetailsVisible">
  260. <supervision-details ref="xianqing" :problemId="problemId" objType="14"></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: "014",
  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 = "014";
  510. }
  511. });
  512. data = _self.getTrees(data);
  513. _self.treeData = data;
  514. console.log(data);
  515. });
  516. },
  517. search() {
  518. this.searchList()
  519. },
  520. toForm(){
  521. var idArr = [];
  522. if(this.multipleSelection && this.multipleSelection.length==0){
  523. this.$message.warning("请选择数据");
  524. return false;
  525. }else{
  526. this.multipleSelection.forEach((item)=>{
  527. idArr.push(item.pblmId);
  528. })
  529. }
  530. var ids = idArr.join(",");
  531. let host = hostUrl;
  532. let nginx = '/pageofficePath/';
  533. let href = 'pageoffice://|' + host + nginx + '/pageoffice/pblm/list/word?ids='+ids+'&filename=pblm|width=1100px;height=800px;ismodal=false;||91A4EE66EC1921F376873E85D6C74FFA|A890649B44577C32CE1930797E1299F9';
  534. let a = document.createElement('a'); // 创建a标签
  535. a.setAttribute('href', href);// href链接
  536. a.click();// 自执行点击事件
  537. },
  538. async searchList() {
  539. let _self = this;
  540. this.problemSearch.persId = this.persId
  541. this.problemSearch.pType = '14'
  542. this.problemSearch.pageSize = this.pageSize
  543. this.problemSearch.pageNum = this.pageIndex
  544. console.log(this.findTime)
  545. if (this.findTime && this.findTime.length) {
  546. this.problemSearch['startTime'] = this.findTime[0]
  547. this.problemSearch['endTime'] = this.findTime[1]
  548. this.problemSearch.reviConc = this.problemSearch.reviConc || "0"
  549. } else {
  550. this.problemSearch['startTime'] = ''
  551. this.problemSearch['endTime'] = ''
  552. }
  553. this.problemSearch.tabType = this.tabType;
  554. await request.get("/dc/organization/base/getAllNode", {
  555. params: {
  556. userId: this.persId,
  557. orgType: "014",
  558. tabType: this.tabType
  559. }
  560. }).then(res => {
  561. _self.loading = true;
  562. let orgAllNode = res.data;
  563. let data = _self.problemSearch;
  564. _self.findUseOrgArray = [];
  565. _self.treeNodeArray.forEach(item => {
  566. if (item.id.length < 12) {
  567. orgAllNode.forEach(orgItem => {
  568. if (orgItem.id.startsWith(item.code)) {
  569. _self.findUseOrgArray.push(orgItem.id);
  570. }
  571. });
  572. }
  573. _self.findUseOrgArray.push(item.id);
  574. });
  575. if (_self.findUseOrgArray.length > 0) {
  576. data["orgIds"] = _self.findUseOrgArray.join(",");
  577. this.orgIds = _self.findUseOrgArray.join(",");
  578. } else {
  579. data["orgIds"] = "";
  580. }
  581. request.post(`/dc/insp/pblm/page/cityPblm`, this.problemSearch).then(res => {
  582. _self.loading = false;
  583. this.tableData = res.data.list;
  584. this.total = res.data.total;
  585. });
  586. })
  587. },
  588. async submitBtn() {
  589. if (this.multipleSelection.length === 0) {
  590. this.$message.warning('请至少选择一条问题');
  591. return;
  592. }
  593. let newArray = this.multipleSelection.map((item) => {
  594. return {
  595. "objId": item.objId,
  596. "objType": item.objType,
  597. "state": "3"
  598. }
  599. });
  600. const {success, message} = await pblmSubmit(newArray);
  601. if (success) {
  602. this.$message.success('问题发布成功');
  603. this.search();
  604. } else {
  605. this.$message.warning(message);
  606. }
  607. },
  608. toEditProblem(row) {
  609. this.dialogType = '修改'
  610. this.unitProblemInfo = row
  611. this.problemId = row.pblmId
  612. this.edit_dialogVisible = true
  613. },
  614. // 复查
  615. toRecheckProblem(row) {
  616. this.rectifyProblemInfo = row
  617. this.dialogType = row.reviConc == '1' ? '添加' : row.reviConc == '2' ? '修改' : '添加'
  618. this.rectifyForm.rectConc = row.rectConc
  619. this.rectifyForm.rectMeas = row.rectMeas
  620. Object.assign(this.rectifyRow, row)
  621. if (this.dialogType == '添加') {
  622. this.rectifyForm.collTime = ''
  623. } else {
  624. this.rectifyForm.collTime = this.formatDateTime(row.collTime)
  625. }
  626. this.recheck_dialogVisible = true
  627. },
  628. // 查看详情
  629. toShowDetail(row) {
  630. this.problemId = row.pblmId
  631. this.rectifyId = row.guid
  632. this.reviConc = row.reviConc
  633. this.supervisionDetailsVisible = true
  634. },
  635. deteleProblem(row) {
  636. this.$confirm('确认删除当前问题吗?', '提示', {
  637. confirmButtonText: '确定',
  638. cancelButtonText: '取消',
  639. type: 'warning'
  640. }).then(() => {
  641. request.get(`/dc/insp/pblm/delete/${row.pblmId}/${this.persId}`).then(res => {
  642. if (res.success) {
  643. this.$message.success('删除成功')
  644. this.searchList()
  645. } else {
  646. this.$message.error(res.message)
  647. }
  648. })
  649. }).catch(() => {
  650. });
  651. },
  652. // 文件上传
  653. submitUpload() {
  654. this.$refs.upload.submit();
  655. },
  656. updatefilelist(arg) {
  657. if (this.isRectify) {
  658. request.post('/dc/insp/rectFdbk', {
  659. id: this.pblmId,
  660. gwComFiles: arg
  661. }).then(res => {
  662. this.removeNewSupervision()
  663. });
  664. } else {
  665. if (this.dialogType == '修改') {
  666. this.problemForm.gwComFiles = this.problemForm.gwComFiles.concat(arg)
  667. } else {
  668. this.problemForm.gwComFiles = arg
  669. }
  670. request.post('/dc/insp/pblm/update', {
  671. pblmId: this.pblmId,
  672. gwComFiles: this.problemForm.gwComFiles,
  673. pblmStat: this.pblmStat
  674. }).then(res => {
  675. this.searchList()
  676. this.removeNewSupervision()
  677. });
  678. }
  679. },
  680. removeNewSupervision(arg) {
  681. if (arg) {
  682. console.log(arg);
  683. var args = this.gwComFiles.concat(arg);
  684. this.updatefilelist(args);
  685. }
  686. this.$message.success('保存成功')
  687. this.$emit('closeDialog')
  688. this.gwComFiles = [];
  689. this.$refs.uploadFile.init();
  690. },
  691. handleClose() {
  692. this.$emit('dialogClose')
  693. },
  694. handleDetailClick(tab, event) {
  695. console.log(tab, event);
  696. },
  697. pageIndexChange(val) {
  698. this.pageIndex = val;
  699. this.searchList();
  700. },
  701. handleSizeChange(val) {
  702. this.pageSize = val;
  703. this.searchList();
  704. },
  705. //格式化树形数据
  706. getTrees(list) {
  707. //@wxcwater重写方法 适应多个树
  708. let highLevelLength = 99;//预设最大节点id长度,目前最大应该为12,所以设置为99保证正常
  709. let _self = this;
  710. list.forEach((item, index) => {
  711. item['pidLength'] = item.pid && item.pid != '' ? item.pid.length : 0;
  712. if (highLevelLength > item.pidLength) {
  713. highLevelLength = item.pidLength;
  714. }
  715. });
  716. console.log(highLevelLength);
  717. let heightLevelNode = [];
  718. list.forEach((item, index) => {
  719. if (highLevelLength >= item.pidLength) {
  720. heightLevelNode.push(item);
  721. }
  722. });
  723. list.forEach((item, index) => {
  724. heightLevelNode.forEach((pItem) => {
  725. _self.addTreeNode(pItem, item);
  726. });
  727. });
  728. console.log(heightLevelNode);
  729. return heightLevelNode;
  730. },
  731. addTreeNode: function (treeNode, leafNode) {
  732. let _self = this;
  733. if (!treeNode.hasOwnProperty('children')) {
  734. treeNode['children'] = [];
  735. }
  736. if (leafNode.pid == treeNode.id) {
  737. treeNode.children.push(leafNode);
  738. return;
  739. }
  740. treeNode.children.forEach((item) => {
  741. _self.addTreeNode(item, leafNode);
  742. });
  743. },
  744. //树节点点击事件
  745. treeNodeClickHandler: function () {
  746. let cNarray = this.$refs["jigou_tree"].getCheckedNodes();
  747. console.log(cNarray);
  748. this.treeNodeArray = cNarray;
  749. },
  750. // 已选择项
  751. handleSelectionChange(val) {
  752. this.multipleSelection = val;
  753. },
  754. closeEditDialog() {
  755. this.edit_dialogVisible = false;
  756. this.problemId = "";
  757. this.searchList();
  758. },
  759. async exportWord() {
  760. let _self = this;
  761. _self.exportLoading = true;
  762. await request.get("/dc/organization/base/getAllNode", {
  763. params: {
  764. userId: this.persId,
  765. orgType: "014"
  766. }
  767. }).then(res => {
  768. let orgAllNode = res.data;
  769. let data = _self.findParams;
  770. data.pageNum = _self.pageIndex;
  771. data.pageSize = _self.pageSize;
  772. data.pType = "14";
  773. data.orgIds = _self.orgIds;
  774. this.datas = data;
  775. _self.treeNodeArray.forEach(item => {
  776. if (item.id.length < 12) {
  777. orgAllNode.forEach(orgItem => {
  778. if (orgItem.id.startsWith(item.id)) {
  779. _self.findUseOrgArray.push(orgItem.id);
  780. }
  781. });
  782. } else {
  783. _self.findUseOrgArray.push(item.id);
  784. }
  785. });
  786. });
  787. //下载word文档2
  788. await request.post('/pblm/doc', this.datas).then(res => {
  789. if (res.success) {
  790. _self.exportLoading = false;
  791. console.log(this.response)
  792. var a = document.createElement('a');
  793. a.href = `${this.hostUrl}${res.data.downloadPath}`;
  794. //设置文件名称
  795. a.download = '分水及管控问题详情.doc';
  796. a.click();
  797. } else {
  798. _self.$mesage.error(res.message);
  799. }
  800. }).catch(res => {
  801. _self.$mesage.error(res.message);
  802. })
  803. },
  804. // 下载模板
  805. async downloadTemplate() {
  806. await this.searchList();
  807. await this.downloadTemplateSet();
  808. this.uploadDisabled = false;
  809. },
  810. async downloadTemplateSet() {
  811. let url = '/pdcApi/dc/imp/pblm/download?userId=' + this.persId + '&orgType=014&orgIds=' + this.orgIds;
  812. let downloadName = "分水及管控问题.xls";
  813. let type = "get";
  814. await exportModel(type, url, downloadName);
  815. },
  816. //切换问题是否被督查简报调用
  817. changeSfYy(row, val) {
  818. this.$confirm('此问题将切换是否被督查简报引用, 是否继续?', '提示', {
  819. confirmButtonText: '确定',
  820. cancelButtonText: '取消',
  821. type: 'warning'
  822. }).then(() => {
  823. if (val) {
  824. request.post(`/dc/insp/pblm/update`, {
  825. "pblmId": row,
  826. "quote": 0
  827. }).then(res => {
  828. if (res.success) {
  829. this.search();
  830. }
  831. })
  832. } else {
  833. request.post(`/dc/insp/pblm/update`, {
  834. "pblmId": row,
  835. "quote": 1
  836. }).then(res => {
  837. if (res.success) {
  838. this.search();
  839. }
  840. })
  841. }
  842. }).catch(() => {
  843. this.$message({
  844. type: 'info',
  845. message: '已取消切换'
  846. });
  847. });
  848. },
  849. showPlDialog() {
  850. this.showTianBaoPl = true
  851. },
  852. closePlDialog(val) {
  853. this.showTianBaoPl = false
  854. this.search();
  855. },
  856. getproblemSmallType() {
  857. let result = [];
  858. request.get('/dc/insp/pblms/getPblmType', {
  859. params: {
  860. type: '14',
  861. pguid: '14000000000000000000000000000000'
  862. }
  863. }).then(res => {
  864. if (res.success) {
  865. res.data.forEach((ele) => {
  866. let haveinspPblmsName = false;
  867. result.forEach((inspPblm) => {
  868. if (inspPblm['inspPblmsName'] == ele.inspPblmsName) {
  869. //
  870. let havechekPoint = false;
  871. inspPblm['checkPoints'].forEach((chekPoint) => {
  872. if (chekPoint['checkPointName'] == ele.checkPoint) {
  873. //
  874. chekPoint['pblmDescs'].push({
  875. pblmDesc: ele.pblmDesc,
  876. sn: ele.sn,
  877. guid: ele.guid,
  878. });
  879. havechekPoint = true;
  880. }
  881. });
  882. if (!havechekPoint) {
  883. let newCheckPoint = {};
  884. newCheckPoint['checkPointName'] = ele.checkPoint;
  885. newCheckPoint['sort2'] = ele.sort2;
  886. newCheckPoint['pblmDescs'] = [{
  887. pblmDesc: ele.pblmDesc,
  888. sn: ele.sn,
  889. guid: ele.guid,
  890. }]
  891. inspPblm['checkPoints'].push(newCheckPoint);
  892. }
  893. haveinspPblmsName = true;
  894. }
  895. });
  896. if (!haveinspPblmsName) {
  897. let haveinspPblmsObj = {};
  898. haveinspPblmsObj['inspPblmsName'] = ele.inspPblmsName;
  899. haveinspPblmsObj['sort1'] = ele.sort1;
  900. haveinspPblmsObj['checkPoints'] = [{
  901. checkPointName: ele.checkPoint,
  902. sort2: ele.sort2,
  903. pblmDescs: [{
  904. pblmDesc: ele.pblmDesc,
  905. sn: ele.sn,
  906. guid: ele.guid,
  907. }]
  908. }];
  909. result.push(haveinspPblmsObj);
  910. }
  911. })
  912. this.problemType = result;
  913. console.log(this.problemType);
  914. }
  915. })
  916. },
  917. },
  918. watch: {
  919. // 'weigui.pblmSn':{
  920. // deep: true,
  921. // handler(val){
  922. // this.showPblmList(this.weigui,this.problemForm.weigui,'违规')
  923. // }
  924. // },
  925. // 'hetong.pblmSn':{
  926. // deep: true,
  927. // handler(val){
  928. // this.showPblmList(this.hetong,this.problemForm.hetong,'合同')
  929. // }
  930. // },
  931. // 'quanlity.pblmSn':{
  932. // deep: true,
  933. // handler(val){
  934. // this.showPblmList(this.quanlity,this.problemForm.quanlity,'质量')
  935. // }
  936. // },
  937. // 'gongcheng.pblmSn':{
  938. // deep: true,
  939. // handler(val){
  940. // this.showPblmList(this.gongcheng,this.problemForm.gongcheng,'工程')
  941. // }
  942. // }
  943. },
  944. filters: {
  945. inspPblmCate(val) {
  946. if (!val || val == '') {
  947. return ''
  948. }
  949. if (val == '0') {
  950. return '一般'
  951. } else if (val == '1') {
  952. return '较重'
  953. } else if (val == '2') {
  954. return '严重'
  955. } else {
  956. return val
  957. }
  958. },
  959. }
  960. }
  961. </script>
  962. <style lang="scss">
  963. .search_wrapper {
  964. display: flex;
  965. justify-content: space-between;
  966. min-height: 110px;
  967. div:last-child {
  968. min-width: 160px;
  969. }
  970. }
  971. .slide-line {
  972. width: 96%;
  973. margin-left: 3%;
  974. height: 1px;
  975. margin-bottom: 10px;
  976. border-bottom: dashed 1px #DCDFE6;
  977. }
  978. .detail_dialog .el-dialog__body {
  979. padding: 0 20px 30px;
  980. }
  981. .inspPblmCate {
  982. padding: 2px 10px;
  983. border-radius: 10px;
  984. color: #ffffff;
  985. -webkit-border-radius: 10px;
  986. -moz-border-radius: 10px;
  987. border-radius: 10px;
  988. }
  989. .skactive {
  990. background: #3f8eff !important;
  991. color: white !important;
  992. margin-top: 5px;
  993. margin-bottom: 5px;
  994. }
  995. .sknormal {
  996. background: white;
  997. margin-top: 5px;
  998. margin-bottom: 5px;
  999. }
  1000. </style>