2d530acbdbd9ef400f6652d239e65faeaf1dc159.svn-base 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595
  1. <template>
  2. <div>
  3. <el-card class="box-card">
  4. <div class="search_wrapper">
  5. <el-form :inline="true" :model="problemSearch" class="demo-form-inline">
  6. <el-form-item label="工程名称">
  7. <el-input v-model="problemSearch.nm" clearable></el-input>
  8. </el-form-item>
  9. <el-form-item label="问题类别">
  10. <el-select v-model="problemSearch.inspPblmName" clearable>
  11. <el-option :label="item.inspPblmsName" :value="item.inspPblmsName" v-for="(item,index) in problemType" :key="index"></el-option>
  12. </el-select>
  13. </el-form-item>
  14. <!--<el-form-item label="问题状态">-->
  15. <!--<el-select v-model="problemSearch.reviConc" clearable>-->
  16. <!--<el-option :label="item.name" :value="item.value" v-for="(item,index) in problemStatus" :key="index"></el-option>-->
  17. <!--</el-select>-->
  18. <!--</el-form-item>-->
  19. <el-form-item label="是否典型">
  20. <el-select v-model="problemSearch.ifCasePblm" clearable placeholder="请选择">
  21. <el-option
  22. v-for="item in supervision"
  23. :key="item.value"
  24. :label="item.label"
  25. :value="item.value"
  26. ></el-option>
  27. </el-select>
  28. </el-form-item>
  29. <el-form-item label="严重程度">
  30. <el-select v-model="problemSearch.inspPblmCate" clearable>
  31. <el-option :label="item.name" :value="item.value" v-for="(item,index) in severity" :key="index"></el-option>
  32. </el-select>
  33. </el-form-item>
  34. <el-form-item label="发现时间">
  35. <el-date-picker
  36. v-model="findTime"
  37. type="daterange"
  38. value-format="yyyy-MM-dd"
  39. range-separator="至"
  40. start-placeholder="开始日期"
  41. end-placeholder="结束日期">
  42. </el-date-picker>
  43. </el-form-item>
  44. </el-form>
  45. <div>
  46. <el-button type="primary" @click="search">查询</el-button>
  47. <el-button type="primary" @click="toAddProblem" v-if="ownPriv('manage')">新增问题</el-button>
  48. </div>
  49. </div>
  50. <el-table
  51. :data="tableData"
  52. border
  53. :height="tableHeight"
  54. v-loading="loading"
  55. style="width: 100%">
  56. <el-table-column
  57. fixed
  58. prop="nm"
  59. show-overflow-tooltip
  60. label="工程名称"
  61. min-width="180">
  62. </el-table-column>
  63. <el-table-column
  64. min-width="140"
  65. prop="inspPblmsName"
  66. label="问题类别"
  67. show-overflow-tooltip
  68. ></el-table-column>
  69. <el-table-column
  70. show-overflow-tooltip
  71. prop="inspPblmDesc"
  72. label="督查问题描述"
  73. min-width="150">
  74. </el-table-column>
  75. <el-table-column
  76. prop="inspPblmCate"
  77. label="严重程度"
  78. min-width="90">
  79. <template slot-scope="scope">
  80. {{scope.row.inspPblmCate | inspPblmCate}}
  81. </template>
  82. </el-table-column>
  83. <el-table-column
  84. prop="ifCasePblm"
  85. label="是否典型"
  86. min-width="90">
  87. <template slot-scope="scope">
  88. {{scope.row.ifCasePblm == '1' ? '典型' : scope.row.ifCasePblm == '0' ? '非典型' : ''}}
  89. </template>
  90. </el-table-column>
  91. <el-table-column
  92. prop="collTime"
  93. label="发现时间"
  94. min-width="150">
  95. <template slot-scope="scope">
  96. {{scope.row.collTime ? formatDateTime(scope.row.collTime) : ''}}
  97. </template>
  98. </el-table-column>
  99. <!--<el-table-column-->
  100. <!--prop="reviConc"-->
  101. <!--label="问题状态"-->
  102. <!--min-width="90">-->
  103. <!--<template slot-scope="scope">-->
  104. <!--<p v-if="scope.row.reviConc == 0">新问题</p>-->
  105. <!--<p v-if="scope.row.reviConc == 1">未复查</p>-->
  106. <!--<p v-if="scope.row.reviConc == 2">已复查</p>-->
  107. <!--</template>-->
  108. <!--</el-table-column>-->
  109. <!-- <el-table-column
  110. prop="zip"
  111. label="复查时间"
  112. width="120">
  113. </el-table-column> -->
  114. <!--<el-table-column-->
  115. <!--prop="hasVedio"-->
  116. <!--label="有无多媒体"-->
  117. <!--min-width="100">-->
  118. <!--<template slot-scope="scope">-->
  119. <!--<p v-if="scope.row.hasVedio == 1">是</p>-->
  120. <!--<p v-if="scope.row.hasVedio == 0">否</p>-->
  121. <!--</template>-->
  122. <!--</el-table-column>-->
  123. <el-table-column
  124. fixed="right"
  125. label="操作"
  126. min-width="130">
  127. <template slot-scope="scope">
  128. <el-button type="text" size="small" v-if="ownPriv('manage') && (!scope.row.reviConc || scope.row.reviConc =='0')" @click="toEditProblem(scope.row)">编辑</el-button>
  129. <el-button type="text" size="small" v-if="ownPriv('manage') && (scope.row.reviConc == '1' || scope.row.reviConc =='2')" @click="toRecheckProblem(scope.row)">复查</el-button>
  130. <el-button type="text" size="small" @click="toShowDetail(scope.row)">详情</el-button>
  131. <el-button type="text" size="small" title="删除问题" @click="deteleProblem(scope.row)" v-if="ownPriv('manage')">删除</el-button>
  132. </template>
  133. </el-table-column>
  134. </el-table>
  135. <el-pagination :pager-count="5" :current-page="pageIndex"
  136. :page-size="pageSize" layout="total, prev, pager, next" :total="total"
  137. @current-change="pageIndexChange" @size-change="handleSizeChange"
  138. ></el-pagination>
  139. </el-card>
  140. <!-- 修改组件 -->
  141. <problem-edit :editId="problemId" @closeEditDialog="closeEditDialog" v-if="edit_dialogVisible"></problem-edit>
  142. <!-- 详情组件-->
  143. <el-dialog
  144. class="custom_dialog"
  145. title="问题详情"
  146. width="60%"
  147. append-to-body
  148. :visible.sync="supervisionDetailsVisible">
  149. <supervision-details ref="xianqing" :problemId="problemId"></supervision-details>
  150. <span slot="footer">
  151. <el-button style="margin-top:5px;" @click="supervisionDetailsVisible = false">返回</el-button>
  152. </span>
  153. </el-dialog>
  154. <problemDialog
  155. v-if="showAddProblemDialog"
  156. :objId="currentRow.objId"
  157. objName="淤地坝"
  158. @closeDialog="closePlDialog"
  159. :currentObjectRgstrId="currentRow.id"
  160. :showAddProblemDialog="showAddProblemDialog">
  161. </problemDialog>
  162. </div>
  163. </template>
  164. <script>
  165. import {formatDateTime2} from '../../../utils/gw_date.js'
  166. import request from '../../../utils/gw_ajax_request.js'
  167. import problemDialog from "../../duChaWenTi/addProblem/yudiba_problem_dialog.vue";
  168. export default {
  169. props: ['unitProblemInfo','currentRow','villType','unitLevel','tabType'],
  170. data(){
  171. return{
  172. tableHeight: window.innerHeight - 330,
  173. tableData:[
  174. {
  175. date: '',
  176. name: '',
  177. province: '',
  178. city: '',
  179. address: '',
  180. zip: ''
  181. }
  182. ],
  183. problemSearch:{
  184. inspPblmName: '',
  185. inspPblmCate: '',
  186. reviConc: '',
  187. pType: '',
  188. pageSize: '10',
  189. pageNum: 1
  190. },
  191. problemForm:{
  192. objId: '',
  193. objType: '',
  194. problemType: '',
  195. inspPblmDesc: '',
  196. pblmsTypeId: '',
  197. qualityTypeId: '',
  198. pblmsId: '',
  199. defectTypeId: '',
  200. ifCasePblm: '',
  201. inspPblmCate: '',
  202. weigui: '',
  203. hetong: '',
  204. quanlity: '',
  205. gongcheng: '',
  206. gwComFiles: []
  207. },
  208. rectifyForm: {
  209. rectConc: '',
  210. rectMeas: '',
  211. collTime: '',
  212. gwComFiles: [{
  213. id: "",
  214. filePath: "",
  215. bizId: ""
  216. }]
  217. },
  218. weigui: {
  219. pblmRelDics: [],
  220. pblmSn: ''
  221. },
  222. hetong: {
  223. pblmRelDics: [],
  224. pblmSn: ''
  225. },
  226. quanlity: {
  227. pblmRelDics: [],
  228. pblmSn: ''
  229. },
  230. gongcheng: {
  231. pblmRelDics: [],
  232. pblmSn: ''
  233. },
  234. pblmPointNum: '',
  235. pblmDescList: '',
  236. pblmDescListHetong: '',
  237. pblmAttach: [],
  238. pblmsTypeId: '',
  239. pblmId: '',
  240. imgList: [],
  241. videoList:[],
  242. audioList: [],
  243. pblmStat: '',
  244. gwComFiles: [],
  245. problemType: [],
  246. problemStatus: [],
  247. severity:[
  248. {name: '一般',value:'0'},
  249. {name: '较重',value:'1'},
  250. {name: '严重',value:'2'},
  251. // {name: '非常严重',value:'3'}
  252. ],
  253. dialogType: '添加',
  254. dialogVisible: true,
  255. add_dialogVisible: false,
  256. recheck_dialogVisible: false,
  257. chooseWeiguiProblem: false,
  258. chooseHeTongProblem: false,
  259. chooseQuanlityProblem: false,
  260. chooseGongchengProblem: false,
  261. checked: false,
  262. problemId: '',
  263. supervisionDetailsVisible:false,
  264. projectType: '',
  265. reviConc: '',
  266. findTime: [],
  267. rectifyRow: {},
  268. isRectify: false,
  269. rectifyId: '',
  270. activeName: 'problem-detail',
  271. pageIndex: 1,
  272. pageSize: 20,
  273. total: 0,
  274. loading: false,
  275. showWenTiTianBaoPl: false,
  276. //问题修改弹窗
  277. problemInfo: null,
  278. rectifyProblemInfo: null,
  279. edit_dialogVisible: false,
  280. recheck_edit_dialogVisible: false,
  281. showAddProblemDialog: false,
  282. supervision: [
  283. {
  284. value: "1",
  285. label: "是"
  286. },
  287. {
  288. value: "0",
  289. label: "否"
  290. }
  291. ]
  292. }
  293. },
  294. computed: {
  295. persId() {
  296. return localStorage.getItem("userid")
  297. ? localStorage.getItem("userid")
  298. : "1098101939614724096";
  299. },
  300. formatDateTime(){
  301. return formatDateTime2
  302. }
  303. },
  304. components: {
  305. upload: resolve => {
  306. require(["../../../widgets/uploadFile.vue"], resolve);
  307. },
  308. // 修改问题
  309. problemEdit: resolve => {
  310. require(["../../duChaWenTi/yuDiBaProblemModify.vue"], resolve);
  311. },
  312. //详情页
  313. supervisionDetails: resolve => {
  314. require(["../../duChaWenTi/supervisionDetails_yudiba.vue"], resolve);
  315. },
  316. problemDialog: problemDialog
  317. },
  318. mounted(){
  319. this.getproblemSmallType();
  320. },
  321. activated(){
  322. this.search()
  323. },
  324. methods:{
  325. search(){
  326. this.searchList()
  327. },
  328. closePlDialog(val) {
  329. this.showAddProblemDialog = false;
  330. this.search()
  331. },
  332. searchList(){
  333. console.log(this.currentRow);
  334. this.loading = true
  335. this.problemSearch.persId = this.persId
  336. this.problemSearch.pType = this.villType
  337. this.problemSearch.pageSize = this.pageSize
  338. this.problemSearch.pageNum = this.pageIndex
  339. console.log(this.findTime)
  340. if(this.findTime && this.findTime.length){
  341. this.problemSearch['startTime'] = this.findTime[0]
  342. this.problemSearch['endTime'] = this.findTime[1]
  343. this.problemSearch.reviConc = this.problemSearch.reviConc || "0"
  344. }else{
  345. this.problemSearch['startTime'] = ''
  346. this.problemSearch['endTime'] = ''
  347. }
  348. // if(this.currentRow.code){
  349. if(this.currentRow.objId){
  350. delete this.problemSearch.orgId;
  351. this.problemSearch.objId = this.currentRow.objId;
  352. }else{
  353. delete this.problemSearch.objId;
  354. this.problemSearch.orgId = this.currentRow.id;
  355. }
  356. this.problemSearch.tabType = this.tabType;
  357. request.post(`/dc/insp/pblm/page/sdPblm`, this.problemSearch).then(res => {
  358. if (res.success) {
  359. this.tableData = res.data.list;
  360. this.total = res.data.total;
  361. }
  362. this.loading = false
  363. });
  364. },
  365. toAddProblem(){
  366. if(this.problemSearch.objId){
  367. this.showAddProblemDialog = true
  368. }else{
  369. this.$message.error("请选择左侧工程");
  370. }
  371. },
  372. toEditProblem(row){
  373. this.dialogType = '修改'
  374. this.problemId = row.pblmId
  375. this.problemInfo = row
  376. this.projectType = row.objType
  377. this.edit_dialogVisible = true
  378. },
  379. // 查看详情
  380. toShowDetail(row){
  381. this.problemId = row.pblmId
  382. this.supervisionDetailsVisible = true
  383. },
  384. deteleProblem(row){
  385. this.$confirm('确认删除当前问题吗?', '提示', {
  386. confirmButtonText: '确定',
  387. cancelButtonText: '取消',
  388. type: 'warning'
  389. }).then(() => {
  390. request.get(`/dc/insp/pblm/delete/${row.pblmId}/${this.persId}`).then(res=>{
  391. if(res.success){
  392. this.$message.success('删除成功')
  393. this.searchList()
  394. }else{
  395. this.$message.error(res.message)
  396. }
  397. })
  398. }).catch(() => {
  399. });
  400. },
  401. // 文件上传
  402. submitUpload() {
  403. this.$refs.upload.submit();
  404. },
  405. updatefilelist(arg) {
  406. if(this.isRectify){
  407. request.post('/dc/insp/rectFdbk',{
  408. id: this.pblmId,
  409. gwComFiles: arg
  410. }).then(res => {
  411. this.removeNewSupervision()
  412. });
  413. }else{
  414. if(this.dialogType == '修改'){
  415. this.problemForm.gwComFiles = this.problemForm.gwComFiles.concat(arg)
  416. }else{
  417. this.problemForm.gwComFiles = arg
  418. }
  419. request.post('/dc/insp/pblm/update',{
  420. pblmId: this.pblmId,
  421. gwComFiles: this.problemForm.gwComFiles,
  422. pblmStat: this.pblmStat
  423. }).then(res => {
  424. this.searchList()
  425. this.removeNewSupervision()
  426. });
  427. }
  428. },
  429. removeNewSupervision(arg){
  430. if (arg) {
  431. console.log(arg);
  432. var args = this.gwComFiles.concat(arg);
  433. this.updatefilelist(args);
  434. }
  435. this.$message.success('保存成功')
  436. this.$emit('closeDialog')
  437. this.gwComFiles = [];
  438. this.$refs.uploadFile.init();
  439. },
  440. handleDetailClick(tab, event) {
  441. console.log(tab, event);
  442. },
  443. pageIndexChange(val) {
  444. this.pageIndex = val;
  445. this.searchList();
  446. },
  447. handleSizeChange(val) {
  448. this.pageSize = val;
  449. this.searchList();
  450. },
  451. showPlDialog() {
  452. this.showWenTiTianBaoPl = true;
  453. },
  454. // closePlDialog(val) {
  455. // this.showWenTiTianBaoPl = false;
  456. // },
  457. // 控制修改弹窗
  458. closeEditDialog(){
  459. this.edit_dialogVisible = false
  460. this.problemId = "";
  461. this.searchList()
  462. },
  463. getproblemSmallType() {
  464. let result = [];
  465. request.get('/dc/insp/pblms/getPblmType', {
  466. params: {
  467. type: '11',
  468. pguid: '11000000000000000000000000000000'
  469. }
  470. }).then(res => {
  471. if (res.success) {
  472. res.data.forEach((ele) => {
  473. let haveinspPblmsName = false;
  474. result.forEach((inspPblm) => {
  475. if (inspPblm['inspPblmsName'] == ele.inspPblmsName) {
  476. //
  477. let havechekPoint = false;
  478. inspPblm['checkPoints'].forEach((chekPoint) => {
  479. if (chekPoint['checkPointName'] == ele.checkPoint) {
  480. //
  481. chekPoint['pblmDescs'].push({
  482. pblmDesc: ele.pblmDesc,
  483. sn: ele.sn,
  484. guid: ele.guid,
  485. });
  486. havechekPoint = true;
  487. }
  488. });
  489. if (!havechekPoint) {
  490. let newCheckPoint = {};
  491. newCheckPoint['checkPointName'] = ele.checkPoint;
  492. newCheckPoint['sort2'] = ele.sort2;
  493. newCheckPoint['pblmDescs'] = [{
  494. pblmDesc: ele.pblmDesc,
  495. sn: ele.sn,
  496. guid: ele.guid,
  497. }]
  498. inspPblm['checkPoints'].push(newCheckPoint);
  499. }
  500. haveinspPblmsName = true;
  501. }
  502. });
  503. if (!haveinspPblmsName) {
  504. let haveinspPblmsObj = {};
  505. haveinspPblmsObj['inspPblmsName'] = ele.inspPblmsName;
  506. haveinspPblmsObj['sort1'] = ele.sort1;
  507. haveinspPblmsObj['checkPoints'] = [{
  508. checkPointName: ele.checkPoint,
  509. sort2: ele.sort2,
  510. pblmDescs: [{
  511. pblmDesc: ele.pblmDesc,
  512. sn: ele.sn,
  513. guid: ele.guid,
  514. }]
  515. }];
  516. result.push(haveinspPblmsObj);
  517. }
  518. })
  519. this.problemType = result;
  520. console.log(this.problemType);
  521. }
  522. })
  523. },
  524. },
  525. watch:{
  526. tabType(val){
  527. if(val){
  528. this.searchList();
  529. }
  530. },
  531. 'currentRow.id':{
  532. deep: true,
  533. handler(newVal,oldVal){
  534. this.searchList()
  535. }
  536. },
  537. 'problemForm.problemType':{
  538. deep: true,
  539. handler(newVal,oldVal){
  540. this.convertGroup()
  541. }
  542. },
  543. 'unitProblemInfo.id':{
  544. deep: true,
  545. handler(newVal,oldVal){
  546. this.searchList()
  547. }
  548. }
  549. },
  550. filters:{
  551. inspPblmCate(val){
  552. if(!val || val == ''){
  553. return ''
  554. }
  555. if(val == '0'){
  556. return '一般'
  557. }else if(val == '1'){
  558. return '较重'
  559. }else if(val == '2'){
  560. return '严重'
  561. }
  562. // else if(val == '3'){
  563. // return '非常严重'
  564. // }
  565. else{
  566. return val
  567. }
  568. },
  569. }
  570. }
  571. </script>
  572. <style lang="scss">
  573. .search_wrapper{
  574. display: flex;
  575. justify-content: space-between;
  576. div:last-child{
  577. min-width: 160px;
  578. }
  579. }
  580. .slide-line{
  581. width: 96%;
  582. margin-left: 3%;
  583. height: 1px;
  584. margin-bottom: 10px;
  585. border-bottom: dashed 1px #DCDFE6;
  586. }
  587. .detail_dialog .el-dialog__body{
  588. padding: 0 20px 30px;
  589. }
  590. </style>