785da13d38eb5b4adcd718ef65842d1a92f30a9d.svn-base 35 KB

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