6cc641048733dcf44fd9b20cd69c333bf65dcc1a.svn-base 39 KB

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