fa6beb96caf70953155caca7a212fe189a6b8470.svn-base 38 KB

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