17b3f9ae65943a09e1ad6d2c40d3829e8218e3cc.svn-base 38 KB

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