dd5f4fda6adb1b59eebb2bc2f6c75b369a8f12d4.svn-base 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886
  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')">当前数据</el-button>
  8. <!-- <el-button size="mini" :class="tabType==2 ? 'skactive' : 'sknormal'" @click="tabChange('2')">历史数据</el-button>-->
  9. <el-button size="mini" :class="tabType==0 ? 'skactive' : 'sknormal'" @click="tabChange('0')">全部数据</el-button>
  10. <div class="tree" style="height: 100%;width: 100%;overflow: auto;display: inline-flex;">
  11. <el-tree
  12. :highlight-current="true"
  13. style="height: calc(100% - 50px);"
  14. :data="treeData"
  15. node-key="id"
  16. show-checkbox
  17. @check-change="handleCheckChange"
  18. ref="jigou_tree">
  19. <div class="custom-tree-node" slot-scope="{ node, data }">
  20. <span style="float:left;">
  21. {{ data.pnm}}
  22. </span>
  23. <div style="float:right;display: flex;justify-content: flex-end;align-items: center;width:50%;">
  24. <span style="color:blue;width:80px;"></span>
  25. </div>
  26. </div>
  27. </el-tree>
  28. </div>
  29. </el-aside>
  30. <el-main style="margin:0px;padding:10px;overflow-y:hidden;" class="shuiku" v-loading="exportLoading">
  31. <div class="search_wrapper">
  32. <el-form :inline="true" :model="problemSearch" class="demo-form-inline">
  33. <el-form-item label="问题类别">
  34. <el-select v-model="problemSearch.problemType" clearable>
  35. <el-option :label="item.pblmType" :value="item.value" v-for="(item,index) in problemType" :key="index"></el-option>
  36. </el-select>
  37. </el-form-item>
  38. <!-- <el-form-item label="问题状态">-->
  39. <!-- <el-select v-model="problemSearch.reviConc" clearable>-->
  40. <!-- <el-option :label="item.name" :value="item.value" v-for="(item,index) in problemStatus" :key="index"></el-option>-->
  41. <!-- </el-select>-->
  42. <!-- </el-form-item>-->
  43. <!-- <el-form-item label="整改情况">
  44. <el-select v-model="problemSearch.region" clearable :disabled="problemSearch.reviConc !== '2'">
  45. <el-option :label="item.name" :value="item.value" v-for="(item,index) in rectifyStatus" :key="index"></el-option>
  46. </el-select>
  47. </el-form-item> -->
  48. <el-form-item label="严重程度">
  49. <el-select v-model="problemSearch.inspPblmCate" clearable>
  50. <el-option :label="item.name" :value="item.value" v-for="(item,index) in severity" :key="index"></el-option>
  51. </el-select>
  52. </el-form-item>
  53. <el-form-item label="发现时间">
  54. <el-date-picker
  55. v-model="findTime"
  56. type="daterange"
  57. value-format="yyyy-MM-dd"
  58. range-separator="至"
  59. start-placeholder="开始日期"
  60. end-placeholder="结束日期">
  61. </el-date-picker>
  62. </el-form-item>
  63. <el-form-item label="问题督查状态:">
  64. <el-select v-model="problemSearch.state" clearable placeholder="请选择">
  65. <el-option
  66. v-for="item in stateList"
  67. :key="item.value"
  68. :label="item.label"
  69. :value="item.value"
  70. ></el-option>
  71. </el-select>
  72. </el-form-item>
  73. <!-- <el-form-item label="复查时间">
  74. <el-date-picker
  75. v-model="problemSearch.recheckDate"
  76. type="daterange"
  77. value-format="yyyy-MM-dd"
  78. range-separator="至"
  79. start-placeholder="开始日期"
  80. end-placeholder="结束日期">
  81. </el-date-picker>
  82. </el-form-item> -->
  83. </el-form>
  84. <div>
  85. <el-button style="color:rgba(255,255,255,1);float:right;margin-right:10px;margin-bottom:5px;"
  86. type="success"
  87. icon="el-icon-download"
  88. @click="exportExcel">导出EXCEL
  89. </el-button>
  90. <!-- <el-button style="color:rgba(255,255,255,1);float:right;margin-right:10px;margin-bottom:5px;"-->
  91. <!-- type="success"-->
  92. <!-- icon="el-icon-download"-->
  93. <!-- @click="exportWord">导出WORD-->
  94. <!-- </el-button>-->
  95. <el-button
  96. style="color:rgba(255,255,255,1);float:right;margin-right:10px;margin-bottom:5px;"
  97. type="success"
  98. @click="submitBtn"
  99. >问 题 提 交
  100. </el-button>
  101. <el-button style="color:rgba(255,255,255,1);float:right;margin-right:10px;"
  102. type="primary"
  103. icon="el-icon-search"
  104. @click="search">&nbsp;查&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;询&nbsp;
  105. </el-button>
  106. </div>
  107. </div>
  108. <el-table
  109. v-loading="loading"
  110. :data="tableData"
  111. border
  112. @selection-change="handleSelectionChange"
  113. @row-click="openDetails"
  114. :height="tableHeight"
  115. style="width: 100%">
  116. <el-table-column
  117. type="selection"
  118. min-width="55">
  119. </el-table-column>
  120. <el-table-column
  121. fixed
  122. prop="nm"
  123. show-overflow-tooltip
  124. label="工程名称"
  125. width="180">
  126. </el-table-column>
  127. <el-table-column
  128. prop="inspPblmName"
  129. label="问题类别"
  130. width="180">
  131. </el-table-column>
  132. <!-- <el-table-column
  133. prop="reviOrg"
  134. label="责任单位"
  135. width="180">
  136. </el-table-column> -->
  137. <el-table-column
  138. label="单位名称"
  139. show-overflow-tooltip
  140. width="180">
  141. <template slot-scope="scope">
  142. {{ scope.row.firstName ? scope.row.firstName : scope.row.secondName ? scope.row.secondName : scope.row.thirdName}}
  143. </template>
  144. </el-table-column>
  145. <el-table-column
  146. show-overflow-tooltip
  147. prop="inspPblmDesc"
  148. label="质量问题信息"
  149. width="150">
  150. </el-table-column>
  151. <el-table-column
  152. prop="inspPblmCate"
  153. label="程度"
  154. width="100">
  155. <template slot-scope="scope">
  156. <p v-if="scope.row.inspPblmCate == 0"><span class="inspPblmCate" style="background: #27C19F;">一般</span></p>
  157. <p v-if="scope.row.inspPblmCate == 1"><span class="inspPblmCate" style="background: #E6A23C;" >较重</span></p>
  158. <p v-if="scope.row.inspPblmCate == 2"><span class="inspPblmCate" style="background: #F56C6C;" >严重</span></p>
  159. <p v-if="scope.row.inspPblmCate == 3"><span class="inspPblmCate" style="background: #795548;">特别严重</span></p>
  160. </template>
  161. </el-table-column>
  162. <el-table-column
  163. prop="ifCasePblm"
  164. label="是否典型"
  165. width="90">
  166. <template slot-scope="scope">
  167. {{scope.row.ifCasePblm == '1' ? '典型' : scope.row.ifCasePblm == '0' ? '非典型' : ''}}
  168. </template>
  169. </el-table-column>
  170. <el-table-column
  171. header-align="center"
  172. align="center"
  173. min-width="100"
  174. prop="state"
  175. label="问题督查状态">
  176. <template slot-scope="scope">
  177. <p v-if="Number(scope.row.state) === 0"><span class="inspPblmCate"
  178. style="background: #F56C6C;">未提交</span>
  179. </p>
  180. <p v-if="scope.row.state == 2"><span class="inspPblmCate"
  181. style="background: #409EFF;">已提交</span>
  182. </p>
  183. <p v-if="scope.row.state == 3"><span class="inspPblmCate"
  184. style="background: #67C23A;">已发布</span>
  185. </p>
  186. </template>
  187. </el-table-column>
  188. <el-table-column
  189. show-overflow-tooltip
  190. prop="attachWgName"
  191. label="违规行为附件"
  192. width="120">
  193. </el-table-column>
  194. <el-table-column
  195. show-overflow-tooltip
  196. prop="attachWgSn"
  197. label="违规行为序号"
  198. width="120">
  199. </el-table-column>
  200. <el-table-column
  201. show-overflow-tooltip
  202. prop="attachHetongName"
  203. label="合同管理附件"
  204. width="120">
  205. </el-table-column>
  206. <el-table-column
  207. show-overflow-tooltip
  208. prop="attachHetongSn"
  209. label="合同管理序号"
  210. width="120">
  211. </el-table-column>
  212. <el-table-column
  213. show-overflow-tooltip
  214. prop="attachDefName"
  215. label="缺陷管理附件"
  216. width="120">
  217. </el-table-column>
  218. <el-table-column
  219. show-overflow-tooltip
  220. prop="attachDefSn"
  221. label="缺陷管理序号"
  222. width="120">
  223. </el-table-column>
  224. <el-table-column
  225. show-overflow-tooltip
  226. prop="persName"
  227. label="上报人"
  228. width="100">
  229. </el-table-column>
  230. <el-table-column
  231. show-overflow-tooltip
  232. prop="orgNm"
  233. label="所在组"
  234. width="150">
  235. </el-table-column>
  236. <el-table-column
  237. prop="collTime"
  238. label="发现时间"
  239. width="150">
  240. <template slot-scope="scope">
  241. {{scope.row.collTime ? formatDateTime(scope.row.collTime) : ''}}
  242. </template>
  243. </el-table-column>
  244. <!-- <el-table-column-->
  245. <!-- prop="reviConc"-->
  246. <!-- label="问题状态"-->
  247. <!-- width="90">-->
  248. <!-- <template slot-scope="scope">-->
  249. <!-- <p v-if="scope.row.reviConc == 0">新问题</p>-->
  250. <!-- <p v-if="scope.row.reviConc == 1">未复查</p>-->
  251. <!-- <p v-if="scope.row.reviConc == 2">已复查</p>-->
  252. <!-- </template>-->
  253. <!-- </el-table-column>-->
  254. <!-- <el-table-column
  255. prop="zip"
  256. label="复查时间"
  257. width="120">
  258. </el-table-column> -->
  259. <el-table-column
  260. prop="hasVedio"
  261. label="有无多媒体"
  262. width="100">
  263. <template slot-scope="scope">
  264. <p v-if="scope.row.hasVedio == 1">是</p>
  265. <p v-if="scope.row.hasVedio == 0">否</p>
  266. </template>
  267. </el-table-column>
  268. <el-table-column
  269. fixed="right"
  270. label="操作"
  271. min-width="100">
  272. <template slot-scope="scope">
  273. <el-button type="text" icon="el-icon-edit" title="修改问题" v-if="ownPriv('manage') && (!scope.row.reviConc || scope.row.reviConc =='0')" @click.native.stop="toEditProblem(scope.row)"></el-button>
  274. <el-button type="text" icon="el-icon-edit" title="修改问题" v-if="ownPriv('manage') && (scope.row.reviConc == '1' || scope.row.reviConc =='2')" @click.native.stop="toRecheckProblem(scope.row)"></el-button>
  275. <el-button type="text" icon="el-icon-view" title="查看详情" @click.native.stop="toShowDetail(scope.row)"></el-button>
  276. <el-button type="text" icon="el-icon-delete" title="删除问题" @click.native.stop="deteleProblem(scope.row)" v-if="ownPriv('manage')"></el-button>
  277. </template>
  278. </el-table-column>
  279. </el-table>
  280. <el-pagination :pager-count="5" :current-page="pageIndex" background
  281. :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total"
  282. :page-sizes="[10, 20, 50, 100]"
  283. @current-change="pageIndexChange" @size-change="handleSizeChange"
  284. ></el-pagination>
  285. </el-main>
  286. </el-container>
  287. <problem-modify :problemId="problemId" :projectType="projectType" :villType="'8'" :unitProblemInfo="unitProblemInfo" unitLevel="一级管理单位" v-if="add_dialogVisible" @closeEditDialog="closeEditDialog"></problem-modify>
  288. <rectify-modify :problemId="problemId" :projectType="projectType" :villType="'8'" :rectifyProblemInfo="rectifyProblemInfo" v-if="recheck_dialogVisible" @closeEditDialog="closeRectifyEditDialog"></rectify-modify>
  289. <el-dialog class="outerDialog custom_dialog detail_dialog" width="60%" title="" v-if="supervisionDetailsVisible" :visible.sync="supervisionDetailsVisible">
  290. <el-tabs v-model="activeName" @tab-click="handleDetailClick">
  291. <el-tab-pane label="问题详情" name="problem-detail">
  292. <problem-detail :problemId="problemId" :projectType="projectType" :reviConc="reviConc"></problem-detail>
  293. </el-tab-pane>
  294. <el-tab-pane label="整改详情" name="rectify-detail" v-if="reviConc == '2'">
  295. <rectify-detail :rectifyId="rectifyId"></rectify-detail>
  296. </el-tab-pane>
  297. </el-tabs>
  298. <span slot="footer">
  299. <el-button style="margin-top:5px;" @click="supervisionDetailsVisible = false">返回</el-button>
  300. </span>
  301. </el-dialog>
  302. </div>
  303. </template>
  304. <script>
  305. import {formatDateTime2} from '../../utils/gw_date.js'
  306. import {exportModel} from "@util/gw_exportModel";
  307. import request from '../../utils/gw_ajax_request.js'
  308. import { hostUrl } from "@util/global_variable.js";
  309. import problemModify from '../duChaTianBao/project/problemModify.vue'
  310. import rectifyModify from '../duChaTianBao/project/rectifyModify.vue'
  311. import problemDetail from '../duChaTianBao/project/problemDetails.vue'
  312. import rectifyDetail from '../duChaTianBao/project/rectifyDetails.vue'
  313. import {pblmSubmit} from "../../api/duChaAPI.js";
  314. export default {
  315. props: [],
  316. data(){
  317. return{
  318. tabType:"0",//0全部数据,1当前数据,2历史数据
  319. tableHeight: window.innerHeight - 250,
  320. tableData:[
  321. {
  322. date: '',
  323. name: '',
  324. province: '',
  325. city: '',
  326. address: '',
  327. zip: ''
  328. }
  329. ],
  330. problemSearch:{
  331. problemType: '',
  332. inspPblmCate: '',
  333. reviConc: '',
  334. regid: '',
  335. regId: '',
  336. pType: '',
  337. pageSize: '20',
  338. pageNum: 1
  339. },
  340. problemForm:{
  341. objId: '',
  342. objType: '',
  343. problemType: '',
  344. inspPblmDesc: '',
  345. pblmsTypeId: '',
  346. qualityTypeId: '',
  347. pblmsId: '',
  348. defectTypeId: '',
  349. ifCasePblm: '',
  350. inspPblmCate: '',
  351. weigui: '',
  352. hetong: '',
  353. quanlity: '',
  354. gongcheng: '',
  355. gwComFiles: []
  356. },
  357. rectifyForm: {
  358. rectConc: '',
  359. rectMeas: '',
  360. collTime: '',
  361. gwComFiles: [{
  362. id: "",
  363. filePath: "",
  364. bizId: ""
  365. }]
  366. },
  367. weigui: {
  368. pblmRelDics: [],
  369. pblmSn: ''
  370. },
  371. hetong: {
  372. pblmRelDics: [],
  373. pblmSn: ''
  374. },
  375. quanlity: {
  376. pblmRelDics: [],
  377. pblmSn: ''
  378. },
  379. gongcheng: {
  380. pblmRelDics: [],
  381. pblmSn: ''
  382. },
  383. pblmPointNum: '',
  384. pblmDescList: '',
  385. pblmDescListHetong: '',
  386. pblmAttach: [],
  387. pblmsTypeId: '',
  388. pblmId: '',
  389. imgList: [],
  390. videoList:[],
  391. audioList: [],
  392. pblmStat: '',
  393. gwComFiles: [],
  394. problemType: [
  395. {pblmType: '违规行为',value:'0'},
  396. {pblmType: '质量缺陷',value:'1'},
  397. {pblmType: '合同问题',value:'2'},
  398. {pblmType: '工程缺陷',value:'3'}
  399. ],
  400. problemStatus: [
  401. {name: '已复查',value:'2'},
  402. {name: '未复查',value:'1'},
  403. {name: '新问题',value:'0'}
  404. ],
  405. rectifyStatus: [
  406. {name: '未整改',value:'0'},
  407. {name: '整改中',value:'1'},
  408. {name: '已整改',value:'2'}
  409. ],
  410. severity:[
  411. {name: '一般',value:'0'},
  412. {name: '较重',value:'1'},
  413. {name: '严重',value:'2'},
  414. {name: '非常严重',value:'3'}
  415. ],
  416. dialogType: '添加',
  417. dialogVisible: true,
  418. add_dialogVisible: false,
  419. recheck_dialogVisible: false,
  420. chooseWeiguiProblem: false,
  421. chooseHeTongProblem: false,
  422. chooseQuanlityProblem: false,
  423. chooseGongchengProblem: false,
  424. checked: false,
  425. problemId: '',
  426. supervisionDetailsVisible:false,
  427. projectType: '',
  428. reviConc: '',
  429. findTime: [],
  430. stateList: [
  431. {
  432. label: '未提交',
  433. value: '0'
  434. },
  435. {
  436. label: '已提交',
  437. value: '2'
  438. },
  439. {
  440. label: '已发布',
  441. value: '3'
  442. }
  443. ],
  444. rectifyRow: {},
  445. isRectify: false,
  446. rectifyId: '',
  447. activeName: 'problem-detail',
  448. pageIndex: 1,
  449. pageSize: 20,
  450. total: 0,
  451. treeData: [],
  452. findUseOrgArray: [],
  453. treeNodeArray: [],
  454. loading: true,
  455. multipleSelection: [], // 已选
  456. rectifyProblemInfo: null,
  457. exportLoading: false,
  458. datas: {}
  459. }
  460. },
  461. computed: {
  462. persId() {
  463. return localStorage.getItem("userid")
  464. ? localStorage.getItem("userid")
  465. : "1098101939614724096";
  466. },
  467. formatDateTime(){
  468. return formatDateTime2
  469. },
  470. hostUrl(){
  471. return hostUrl
  472. }
  473. },
  474. components: {
  475. upload: resolve => {
  476. require(["../../widgets/uploadFile.vue"], resolve);
  477. },
  478. problemModify: problemModify,
  479. problemDetail: problemDetail,
  480. rectifyDetail: rectifyDetail,
  481. rectifyModify: rectifyModify
  482. },
  483. mounted(){
  484. this.getLeftTreeData();
  485. this.searchList()
  486. },
  487. activated(){
  488. // 监督司提的一个优化,来回切换页签的时候,能不能不主动刷新页面,这样他们不方便来回对比数据
  489. // this.getLeftTreeData();
  490. // this.search();
  491. this.findParams = {
  492. hasVedio:"",
  493. adCode: "",
  494. pblmStat: "",
  495. inspPblmCate: "",
  496. ifCasePblm: "",
  497. nm: "",
  498. rsName: "",
  499. adFullName: "",
  500. startTime: "",
  501. endTime: "",
  502. objType: 1,
  503. inspPblmName: "",
  504. persId: localStorage.getItem("userid")
  505. }
  506. },
  507. methods:{
  508. openDetails(row){
  509. this.problemId = row.pblmId
  510. this.rectifyId = row.guid
  511. this.projectType = row.villType == '8' ? '1' : row.villType == '9' ? '2' : '1'
  512. this.reviConc = row.reviConc
  513. this.supervisionDetailsVisible = true
  514. },
  515. tabChange(tabType){
  516. this.tabType = tabType;
  517. this.getLeftTreeData();
  518. this.searchList()
  519. },
  520. getLeftTreeData() {
  521. var _self = this;
  522. request.get("/dc/organization/base/getAllNode", {
  523. params: {
  524. userId: this.persId,
  525. orgType: "007",
  526. tabType:this.tabType
  527. }
  528. }).then(res => {
  529. let data = res.data;
  530. data.forEach(ele => {
  531. if (ele.pid == null || ele.pid == "") {
  532. ele.pid = "007";
  533. }
  534. });
  535. data = _self.getTrees(data);
  536. _self.treeData = data;
  537. console.log(data);
  538. });
  539. },
  540. search(){
  541. this.searchList()
  542. },
  543. searchList(){
  544. let _self = this;
  545. this.problemSearch.persId = this.persId
  546. this.problemSearch.pType = '7'
  547. // this.problemSearch.regid = this.unitProblemInfo.oneUnitId ? this.unitProblemInfo.oneUnitId : this.unitProblemInfo.id //管理单位唯一标识
  548. // this.problemSearch.regId = this.unitProblemInfo.oneUnitId ? this.unitProblemInfo.oneUnitId : this.unitProblemInfo.id //管理单位唯一标识
  549. this.problemSearch.pageSize = this.pageSize
  550. this.problemSearch.pageNum = this.pageIndex
  551. this.problemSearch.reviConc = "0"
  552. console.log(this.findTime)
  553. if(this.findTime && this.findTime.length){
  554. this.problemSearch['startTime'] = this.findTime[0]
  555. this.problemSearch['endTime'] = this.findTime[1]
  556. }else{
  557. this.problemSearch['startTime'] = ''
  558. this.problemSearch['endTime'] = ''
  559. }
  560. this.problemSearch.tabType = this.tabType;
  561. request.get("/dc/organization/base/getAllNode", {params: {userId: this.userId,orgType: "007",tabType:this.tabType}}).then(res => {
  562. _self.loading = true;
  563. let orgAllNode = res.data;
  564. let data = _self.problemSearch;
  565. _self.findUseOrgArray = [];
  566. _self.treeNodeArray.forEach(item => {
  567. if (item.id.length < 12) {
  568. orgAllNode.forEach(orgItem => {
  569. if (orgItem.id.startsWith(item.code)) {
  570. _self.findUseOrgArray.push(orgItem.id);
  571. }
  572. });
  573. }
  574. _self.findUseOrgArray.push(item.id);
  575. });
  576. if (_self.findUseOrgArray.length > 0) {
  577. data["orgIds"] = _self.findUseOrgArray.join(",");
  578. } else {
  579. data["orgIds"] = "";
  580. }
  581. request.post(`/dc/insp/pblm/page/keyReg`, this.problemSearch).then(res => {
  582. _self.loading = false;
  583. _self.multipleSelection = [];
  584. if (res.success) {
  585. this.tableData = res.data.list;
  586. this.total = res.data.total;
  587. if(this.problemSearch.pType == '7'){
  588. this.tableData.forEach(ele=>{
  589. ele['reviOrg'] = this.unitLevel
  590. })
  591. }
  592. }
  593. });
  594. });
  595. },
  596. toEditProblem(row){
  597. this.dialogType = '修改'
  598. this.unitProblemInfo = row
  599. this.problemId = row.pblmId
  600. this.projectType = row.villType == '8' ? '1' : row.villType == '9' ? '2' : '1'
  601. this.add_dialogVisible = true
  602. },
  603. // 复查
  604. toRecheckProblem(row){
  605. this.rectifyProblemInfo = row
  606. this.problemId = row.pblmId
  607. this.projectType = row.villType == '8' ? '1' : row.villType == '9' ? '2' : '1'
  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. handleClose(){
  645. this.$emit('dialogClose')
  646. },
  647. handleDetailClick(tab, event) {
  648. console.log(tab, event);
  649. },
  650. pageIndexChange(val) {
  651. this.pageIndex = val;
  652. this.searchList();
  653. },
  654. handleSizeChange(val) {
  655. this.pageSize = val;
  656. this.searchList();
  657. },
  658. //格式化树形数据
  659. getTrees(list) {
  660. //@wxcwater重写方法 适应多个树
  661. let highLevelLength = 99;//预设最大节点id长度,目前最大应该为12,所以设置为99保证正常
  662. let _self =this;
  663. list.forEach((item,index)=>{
  664. item['pidLength'] = item.pid&&item.pid!=''?item.pid.length:0;
  665. if(highLevelLength>item.pidLength){
  666. highLevelLength = item.pidLength;
  667. }
  668. });
  669. console.log(highLevelLength);
  670. let heightLevelNode = [];
  671. list.forEach((item,index)=>{
  672. if(highLevelLength>=item.pidLength){
  673. heightLevelNode.push(item);
  674. }
  675. });
  676. list.forEach((item,index)=>{
  677. heightLevelNode.forEach((pItem)=>{
  678. _self.addTreeNode(pItem,item);
  679. });
  680. });
  681. console.log(heightLevelNode);
  682. return heightLevelNode;
  683. },
  684. addTreeNode:function(treeNode,leafNode){
  685. let _self = this;
  686. if(!treeNode.hasOwnProperty('children')){
  687. treeNode['children'] = [];
  688. }
  689. if(leafNode.pid == treeNode.id){
  690. treeNode.children.push(leafNode);
  691. return;
  692. }
  693. treeNode.children.forEach((item) => {
  694. _self.addTreeNode(item,leafNode);
  695. });
  696. },
  697. handleCheckChange(data, checked, indeterminate) {
  698. let cNarray = this.$refs["jigou_tree"].getCheckedNodes();
  699. console.log(cNarray);
  700. this.treeNodeArray = cNarray;
  701. },
  702. // 已选择项
  703. handleSelectionChange(val) {
  704. this.multipleSelection = val;
  705. },
  706. closeEditDialog(){
  707. this.add_dialogVisible = false
  708. this.searchList()
  709. },
  710. closeRectifyEditDialog(){
  711. this.recheck_dialogVisible = false
  712. this.searchList()
  713. },
  714. async submitBtn() {
  715. if (this.multipleSelection.length === 0) {
  716. this.$message.warning('请至少选择一条问题');
  717. return;
  718. }
  719. let newArray = this.multipleSelection.map((item) => {
  720. return {
  721. "objId": item.objId,
  722. "objType": item.objType,
  723. "state": "3"
  724. }
  725. });
  726. const {success, message} = await pblmSubmit(newArray);
  727. if (success) {
  728. this.$message.success('问题发布成功');
  729. this.search();
  730. } else {
  731. this.$message.warning(message);
  732. }
  733. },
  734. async exportExcel() {
  735. let _self = this;
  736. _self.exportLoading = true;
  737. await request.get("/dc/organization/base/getAllNode", {
  738. params: {
  739. userId: this.persId,
  740. orgType: "007"
  741. }
  742. }).then(res => {
  743. let orgAllNode = res.data;
  744. let data = _self.problemSearch;
  745. data.pageNum = _self.pageIndex;
  746. data.pageSize = _self.pageSize;
  747. data.villType = "9";
  748. data.pType = "7";
  749. this.datas = JSON.stringify(data);
  750. _self.treeNodeArray.forEach(item => {
  751. console.log(item);
  752. if (item.id.length < 12) {
  753. orgAllNode.forEach(orgItem => {
  754. if (orgItem.id.startsWith(item.id)) {
  755. _self.findUseOrgArray.push(orgItem.id);
  756. }
  757. });
  758. } else {
  759. _self.findUseOrgArray.push(item.id);
  760. }
  761. });
  762. });
  763. let url = "/pdcApi/dc/insp/pblm/page/keyReg/export";
  764. let type = "post";
  765. let exportName = "水利工程运行问题列表.xls"
  766. let result = await exportModel(type,url,exportName,this.datas);
  767. _self.exportLoading = result;
  768. },
  769. async exportWord() {
  770. let _self = this;
  771. _self.exportLoading = true;
  772. await request.get("/dc/organization/base/getAllNode", {
  773. params: {
  774. userId: this.persId,
  775. orgType: "007"
  776. }
  777. }).then(res => {
  778. let orgAllNode = res.data;
  779. let data = _self.problemSearch;
  780. data.pageNum = _self.pageIndex;
  781. data.pageSize = _self.pageSize;
  782. data.villType = "9";
  783. data.pType = "7";
  784. this.datas = data;
  785. _self.treeNodeArray.forEach(item => {
  786. if (item.id.length < 12) {
  787. orgAllNode.forEach(orgItem => {
  788. if (orgItem.id.startsWith(item.id)) {
  789. _self.findUseOrgArray.push(orgItem.id);
  790. }
  791. });
  792. } else {
  793. _self.findUseOrgArray.push(item.id);
  794. }
  795. });
  796. });
  797. //下载word文档2
  798. await request.post('/keyReg/doc',this.datas).then(res=>{
  799. if(res.success){
  800. _self.exportLoading = false;
  801. console.log(this.response)
  802. var a = document.createElement('a');
  803. a.href = `${this.hostUrl}${res.data.downloadPath}`;
  804. //设置文件名称
  805. a.download = '水利工程运行问题详情.doc';
  806. a.click();
  807. // window.open(`${this.hostUrl}${res.data.downloadPath}`)
  808. }else{
  809. _self.$mesage.error(res.message)
  810. }
  811. }).catch(res=>{
  812. _self.$mesage.error(res.message)
  813. })
  814. },
  815. },
  816. watch:{
  817. },
  818. filters:{
  819. inspPblmCate(val){
  820. if(!val || val == ''){
  821. return ''
  822. }
  823. if(val == '0'){
  824. return '一般'
  825. }else if(val == '1'){
  826. return '较重'
  827. }else if(val == '2'){
  828. return '严重'
  829. }else if(val == '3'){
  830. return '非常严重'
  831. }else{
  832. return val
  833. }
  834. },
  835. }
  836. }
  837. </script>
  838. <style lang="scss">
  839. .search_wrapper{
  840. display: flex;
  841. justify-content: space-between;
  842. min-height: 110px;
  843. div:last-child{
  844. min-width: 160px;
  845. }
  846. }
  847. .slide-line{
  848. width: 96%;
  849. margin-left: 3%;
  850. height: 1px;
  851. margin-bottom: 10px;
  852. border-bottom: dashed 1px #DCDFE6;
  853. }
  854. .detail_dialog .el-dialog__body{
  855. padding: 0 20px 30px;
  856. }
  857. .inspPblmCate{
  858. padding: 2px 10px;
  859. border-radius:10px;
  860. color: #ffffff;
  861. -webkit-border-radius: 10px;
  862. -moz-border-radius: 10px;
  863. border-radius: 10px;
  864. }
  865. .skactive{
  866. background: #3f8eff !important;
  867. color:white !important;
  868. margin-top: 5px;
  869. margin-bottom: 5px;
  870. }
  871. .sknormal{
  872. background: white;
  873. margin-top: 5px;
  874. margin-bottom: 5px;
  875. }
  876. </style>