f447a042a78f05ddb5796f71f85c5ad71a74df6c.svn-base 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695
  1. <!-- -->
  2. <template>
  3. <div :style="{'height':testHeight1+'px'}">
  4. <!-- 查询展示 -->
  5. <div class="search" style="margin-top:10px;height:49vh">
  6. <el-table
  7. border
  8. :height="tableHeight"
  9. ref="multipleTable"
  10. :data="searchResult"
  11. tooltip-effect="dark"
  12. style="width: 100%"
  13. >
  14. <el-table-column align="center" type="index" label="序号" min-width="60" fixed>
  15. <template slot-scope="scope">{{ (currentPage - 1) * pageSize + (scope.$index + 1) }}</template>
  16. </el-table-column>
  17. <el-table-column
  18. header-align="center"
  19. align="center"
  20. min-width="55"
  21. prop="inspPblmCate"
  22. label="程度"
  23. fixed
  24. >
  25. <template slot-scope="scope">
  26. <p style="color:#27C19F;" v-if="scope.row.inspPblmCate == 0">一般</p>
  27. <p style="color:#E6A23C;" v-if="scope.row.inspPblmCate == 1">较重</p>
  28. <p style="color:#F56C6C;" v-if="scope.row.inspPblmCate == 2">严重</p>
  29. <p style="color:#F56C6C;" v-if="scope.row.inspPblmCate == 3">特别严重</p>
  30. </template>
  31. </el-table-column>
  32. <el-table-column
  33. header-align="center"
  34. align="center"
  35. min-width="60"
  36. prop="province"
  37. label="省" v-if="isXj"
  38. show-overflow-tooltip
  39. ></el-table-column>
  40. <el-table-column
  41. header-align="center"
  42. align="center"
  43. min-width="60"
  44. prop="city"
  45. :label="ownAdName"
  46. show-overflow-tooltip
  47. ></el-table-column>
  48. <el-table-column
  49. header-align="center"
  50. align="center"
  51. min-width="60"
  52. prop="country"
  53. label="县"
  54. v-if="isXj"
  55. show-overflow-tooltip
  56. ></el-table-column>
  57. <el-table-column
  58. header-align="center"
  59. align="center"
  60. min-width="120"
  61. prop="nm"
  62. label="督查水闸名称"
  63. show-overflow-tooltip
  64. ></el-table-column>
  65. <el-table-column
  66. header-align="center"
  67. align="center"
  68. min-width="140"
  69. prop="inspPblmsName"
  70. label="问题类别"
  71. show-overflow-tooltip
  72. ></el-table-column>
  73. <el-table-column
  74. header-align="center"
  75. align="center"
  76. min-width="230"
  77. prop="checkPoint"
  78. label="检查项目"
  79. show-overflow-tooltip
  80. ></el-table-column>
  81. <!-- <el-table-column
  82. header-align="center"
  83. align="center"
  84. min-width="60"
  85. prop="ifCasePblm"
  86. label="典型"
  87. >
  88. <template slot-scope="scope">
  89. <p v-if="scope.row.ifCasePblm == 1">是</p>
  90. <p v-if="scope.row.ifCasePblm == 0">否</p>
  91. </template>
  92. </el-table-column>-->
  93. <el-table-column
  94. header-align="center"
  95. align="center"
  96. min-width="80"
  97. prop="persName"
  98. label="上报人"
  99. ></el-table-column>
  100. <el-table-column
  101. header-align="center"
  102. align="center"
  103. min-width="80"
  104. show-overflow-tooltip
  105. prop="orgNm"
  106. label="所在组"
  107. ></el-table-column>
  108. <el-table-column
  109. prop="collTime"
  110. label="上报时间"
  111. :formatter="timestampToTime"
  112. sortable
  113. align="center"
  114. min-width="120"
  115. show-overflow-tooltip
  116. ></el-table-column>
  117. </el-table>
  118. <!-- 分页 -->
  119. <div class="paginationWarpper">
  120. <el-pagination
  121. class="paginationCenter"
  122. background
  123. @size-change="handleSizeChange"
  124. @current-change="search"
  125. :current-page.sync="currentPage"
  126. :page-sizes="[10, 20, 50, 100]"
  127. :page-size="pageSize"
  128. layout="total, sizes, prev, pager, next, jumper"
  129. :total="total"
  130. ></el-pagination>
  131. </div>
  132. </div>
  133. </div>
  134. </template>
  135. <script>
  136. //这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
  137. //例如:import 《组件名称》 from '《组件路径》';
  138. import {
  139. findPageInfoShuiKu,
  140. getShuiKuWenTi,
  141. getXSKProblemNewExport,
  142. findPageInfo,
  143. getSzwtTable,
  144. removeSupervise,
  145. showDetailsXq,
  146. submitUpload,
  147. creatSupervise,
  148. getSupervisdByID,
  149. deleteFileById,
  150. updatelist,
  151. getEngId,
  152. } from "@api/duChaAPI.js";
  153. import request from "@util/gw_ajax_request.js";
  154. import { hostUrl } from "@util/global_variable.js";
  155. import elaudio from "@widget/elAudioShort.vue";
  156. import inuptWithDuChaTreeNode from "@widget/inuptWithDuChaTreeNode.vue";
  157. import inputWidthDuChaNodes from "@widget/inputWithDuChaNodes.vue";
  158. import inputWidthDuChaShuiKu from "@widget/inputWith_sk.vue";
  159. export default {
  160. //import引入的组件需要注入到对象中才能使用
  161. components: {
  162. //详情页
  163. supervisionDetails: resolve => {
  164. require(["../../../../duChaWenTi/supervisionDetails_shuiku.vue"], resolve);
  165. },
  166. },
  167. props: ["activedName","currentResCode"],
  168. data() {
  169. //这里存放数据
  170. return {
  171. testHeight1:window.innerHeight * 0.5,
  172. tableHeight: window.innerHeight - 380,
  173. supervisionState: [
  174. {
  175. value: "0",
  176. label: "一般"
  177. },
  178. {
  179. value: "1",
  180. label: "较重"
  181. },
  182. {
  183. value: "2",
  184. label: "严重"
  185. },
  186. {
  187. value: "3",
  188. label: "特别严重"
  189. }
  190. ],
  191. supervision: [
  192. {
  193. value: "1",
  194. label: "是"
  195. },
  196. {
  197. value: "0",
  198. label: "否"
  199. }
  200. ],
  201. updateIdXiuGai: "",
  202. pblmId: "",
  203. addPicPanel: false,
  204. supervisionDetailsVisible:false,
  205. currentProblemId: "",
  206. currentPage: 1, // 页码
  207. pageSize: 20,
  208. loading: false,
  209. total: 0, // 总数
  210. searchResult: [], // 结果
  211. userId: localStorage.getItem("userid"),
  212. pictureArray: [],
  213. audioArray: [],
  214. videoArray: [],
  215. fileArray: [],
  216. audiotabName: "",
  217. videotabName: "",
  218. filetabName:"",
  219. picturetabName: "",
  220. deleteId: "",
  221. playerOptions: {
  222. height: "120",
  223. autoplay: true,
  224. muted: true,
  225. language: "en",
  226. playbackRates: [0.7, 1.0, 1.5, 2.0],
  227. sources: [
  228. {
  229. type: "video/mp4",
  230. // mp4
  231. src: "http://vjs.zencdn.net/v/oceans.mp4"
  232. // webm
  233. // src: "https://cdn.theguardian.tv/webM/2015/07/20/150716YesMen_synd_768k_vp8.webm"
  234. },
  235. {
  236. type: "video/mp4",
  237. // mp4
  238. src: "http://vjs.zencdn.net/v/oceans.mp4"
  239. // webm
  240. // src: "https://cdn.theguardian.tv/webM/2015/07/20/150716YesMen_synd_768k_vp8.webm"
  241. },
  242. {
  243. type: "video/mp4",
  244. // mp4
  245. src: "http://vjs.zencdn.net/v/oceans.mp4"
  246. // webm
  247. // src: "https://cdn.theguardian.tv/webM/2015/07/20/150716YesMen_synd_768k_vp8.webm"
  248. },
  249. {
  250. type: "video/mp4",
  251. // mp4
  252. src: "http://vjs.zencdn.net/v/oceans.mp4"
  253. // webm
  254. // src: "https://cdn.theguardian.tv/webM/2015/07/20/150716YesMen_synd_768k_vp8.webm"
  255. }
  256. ]
  257. },
  258. changeSupervisionVisible: false,
  259. changeSupervisionLoading: false,
  260. changeSupervision: {
  261. nm: "",
  262. presId: localStorage.getItem("userid"),
  263. endTime: "",
  264. pblmId: "",
  265. objId: "",
  266. objType: "",
  267. inspGroupId: "",
  268. inspPblmName: "",
  269. inspPblmDesc: "",
  270. pblmLong: "",
  271. pblmLat: "",
  272. pblmStat: "",
  273. ifCasePblm: "",
  274. inspPblmOrgName: "",
  275. pblmPersName: "",
  276. inspPblmCate: "",
  277. reviOpin: "",
  278. reviConc: "",
  279. reviOrgGuid: "",
  280. collTime: "",
  281. recPers: "",
  282. gwComFiles: [
  283. {
  284. id: "",
  285. filePath: "",
  286. bizId: ""
  287. }
  288. ]
  289. },
  290. // 文件弹框
  291. fileList: [], // 当前文件列表
  292. flash: false,
  293. // 督查类型
  294. supervisionTypeList: [
  295. {
  296. value: "1",
  297. label: "小水库"
  298. }
  299. ],
  300. leibie: [],
  301. // 查询
  302. value6: [],
  303. findParams: {
  304. hasVedio:"",
  305. adCode: "",
  306. pblmStat: "",
  307. inspPblmCate: "",
  308. ifCasePblm: "",
  309. nm: "",
  310. rsName: "",
  311. adFullName: "",
  312. startTime: "",
  313. endTime: "",
  314. objType: 1,
  315. inspPblmName: "",
  316. persId: localStorage.getItem("userid")
  317. },
  318. currentPage: 1, // 页码
  319. pageSize: 20, // 条数
  320. loading: false,
  321. total: 0, // 总数
  322. searchResult: [], // 结果
  323. crId: "", // 当前督查id
  324. // 督查详情
  325. userid: localStorage.getItem("userid"),
  326. supervisionDetailsVisible: false,
  327. problemDeleteVisible: false,
  328. supervisionDetails: {},
  329. pblmId: "",
  330. gwComFiles: [],
  331. pblscr: "",
  332. pblscrList: [
  333. {
  334. lable: "我的问题",
  335. value: localStorage.getItem("userid")
  336. }
  337. ],
  338. pblscrGroup: ""
  339. };
  340. },
  341. //监听属性 类似于data概念
  342. computed: {
  343. hostUrl(){
  344. return hostUrl
  345. }
  346. },
  347. //监控data中的数据变化
  348. watch: {
  349. activedName() {
  350. this.search();
  351. },
  352. currentResCode(oldValue,newValue){
  353. this.currentResCode = newValue;
  354. this.search();
  355. }
  356. },
  357. //方法集合
  358. methods: {
  359. handleSizeChange(pageSize) {
  360. this.pageSize = pageSize;
  361. this.search();
  362. },
  363. // 查询
  364. search() {
  365. this.loading = true;
  366. let _self = this;
  367. let data = {};
  368. data["gateName"] = "";
  369. data["inspPblmName"] = "";
  370. data["objType"] = 6;
  371. data["persId"] = _self.userId;
  372. data["pageNum"] = _self.currentPage;
  373. data["recPers"] = _self.userId;
  374. data["pageSize"] = _self.pageSize;
  375. data["villType"] = "7";
  376. data["codes"] = _self.currentResCode;
  377. getSzwtTable(data).then(res => {
  378. _self.loading = false;
  379. if (res.success) {
  380. _self.searchResult = res.data.list;
  381. _self.total = res.data.total;
  382. } else {
  383. }
  384. });
  385. },
  386. timestampToTime(row, column) {
  387. var date = new Date(row.collTime);
  388. var Y = date.getFullYear() + "-";
  389. var M =
  390. (date.getMonth() + 1 < 10
  391. ? "0" + (date.getMonth() + 1)
  392. : date.getMonth() + 1) + "-";
  393. var D =
  394. (date.getDate() < 10 ? "0" + date.getDate() : date.getDate()) + " ";
  395. var h =
  396. (date.getHours() < 10 ? "0" + date.getHours() : date.getHours()) + ":";
  397. var m =
  398. date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
  399. return Y + M + D + h + m;
  400. },
  401. // 详情弹框
  402. showDetails(id) {
  403. this.currentProblemId = id;
  404. this.supervisionDetailsVisible = true;
  405. },
  406. // 修改弹窗显示
  407. changeSup(id) {
  408. this.pictureArray = [];
  409. this.audioArray = [];
  410. this.videoArray = [];
  411. this.fileArray = [];
  412. this.updateIdXiuGai = id;
  413. showDetailsXq(this.updateIdXiuGai).then(res => {
  414. // if(this.usersId==)
  415. this.changeSupervision = res.data;
  416. this.changeSupervisionVisible = true;
  417. res.data.gwComFiles.forEach(item => {
  418. if (
  419. item.fileExt == "mp3" ||
  420. item.fileExt == "MP3" ||
  421. item.fileExt == "m4a"
  422. ) {
  423. this.audioArray.push(item);
  424. } else if (
  425. item.fileExt == "jpg" ||
  426. item.fileExt == "JPG" ||
  427. item.fileExt == "png" ||
  428. item.fileExt == "PNG" ||
  429. item.fileExt == "JPEG" ||
  430. item.fileExt == "jpeg"
  431. ) {
  432. this.pictureArray.push(item);
  433. } else if (item.fileExt == "mp4" || item.fileExt == "MP4") {
  434. this.videoArray.push({
  435. id: item.id,
  436. bizId: item.bizId,
  437. width: "130",
  438. height: "130",
  439. autoplay: false,
  440. muted: true,
  441. language: "en",
  442. playbackRates: [0.7, 1.0, 1.5, 2.0],
  443. sources: [
  444. {
  445. type: "video/mp4",
  446. // mp4
  447. src: `${this.hostUrl}/${item.filePath}`,
  448. // webm
  449. // src: "https://cdn.theguardian.tv/webM/2015/07/20/150716YesMen_synd_768k_vp8.webm"
  450. }
  451. ]
  452. });
  453. }else{
  454. this.fileArray.push(item);
  455. }
  456. });
  457. this.picturetabName = "图片资料(" + this.pictureArray.length + ")";
  458. this.audiotabName = "音频资料(" + this.audioArray.length + ")";
  459. this.videotabName = "视频资料(" + this.videoArray.length + ")";
  460. this.filetabName = "其它资料(" + this.fileArray.length + ")";
  461. });
  462. },
  463. // 提交修改信息
  464. changeSupervisionInfo() {
  465. this.changeSupervisionVisible = true;
  466. this.$refs.changeSupFrom.validate(valid => {
  467. if (valid) {
  468. this.changeSupervisionLoading = true;
  469. let data = this.changeSupervision;
  470. updatelist(data).then(res => {
  471. this.pblmId = res.data.pblmId;
  472. this.gwComFiles = res.data.gwComFiles;
  473. if (res.success) {
  474. this.removeNewSupervision();
  475. this.successInfo();
  476. if (this.$refs.uploadFile.submitUpload(data.pblmId)) {
  477. this.removeNewSupervision();
  478. this.successInfo();
  479. this.addPicPanel = false;
  480. this.changeSupervisionLoading = false;
  481. }
  482. } else {
  483. this.failInfo();
  484. }
  485. });
  486. }
  487. });
  488. },
  489. removeNewSupervision(arg) {
  490. if (arg) {
  491. console.log(arg);
  492. var args = this.gwComFiles.concat(arg);
  493. this.updatefilelist(args);
  494. }
  495. this.search();
  496. this.gwComFiles = [];
  497. this.newSupervisionVisible = false;
  498. this.changeSupervisionVisible = false;
  499. this.newSupervision = {
  500. id: "",
  501. checkPoint: "",
  502. presId: localStorage.getItem("userid"),
  503. dataStat: "",
  504. nm: "",
  505. endTime: "",
  506. pblmId: "",
  507. objId: "",
  508. objType: "",
  509. inspGroupId: "",
  510. inspPblmCate: "",
  511. inspPblmName: "",
  512. inspPblmDesc: "",
  513. pblmLong: "",
  514. pblmLat: "",
  515. pblmStat: "",
  516. ifCasePblm: "",
  517. inspPblmOrgName: "",
  518. pblmPersName: "",
  519. inspPblmCate: "",
  520. reviOpin: "",
  521. reviConc: "",
  522. reviOrgGuid: "",
  523. collTime: "",
  524. recPers: "",
  525. note: ""
  526. };
  527. // this.$refs.uploadFile.init();
  528. },
  529. // 删除图片文件
  530. removeFile(id, index) {
  531. // this.updateIdXiuGai = this.updateIdXiuGai;
  532. var _self = this;
  533. this.$confirm("此操作将永久删除该文件, 是否继续?", "提示", {
  534. confirmButtonText: "确定",
  535. cancelButtonText: "返回",
  536. type: "warning"
  537. }).then(
  538. res => {
  539. if (res === "confirm") {
  540. deleteFileById(id, this.userId).then(res => {
  541. if (res.success) {
  542. // this.changeSupervision.gwComFiles.splice(index, 1);
  543. this.changeSupervision.gwComFiles.forEach(item => {
  544. if (
  545. item.fileExt == "mp3" ||
  546. item.fileExt == "MP3" ||
  547. item.fileExt == "m4a"
  548. ) {
  549. this.audiotabName.splice(index, 1);
  550. } else if (
  551. item.fileExt == "jpg" ||
  552. item.fileExt == "JPG" ||
  553. item.fileExt == "png" ||
  554. item.fileExt == "PNG" ||
  555. item.fileExt == "JPEG" ||
  556. item.fileExt == "jpeg"
  557. ) {
  558. this.pictureArray.splice(index, 1);
  559. } else if (item.fileExt == "mp4" || item.fileExt == "MP4") {
  560. this.videoArray.splice(index, 1);
  561. }
  562. });
  563. _self.changeSup(this.updateIdXiuGai);
  564. } else {
  565. this.failInfo();
  566. }
  567. });
  568. }
  569. },
  570. res => {
  571. console.log("返回");
  572. }
  573. );
  574. },
  575. // 操作成功反馈
  576. successInfo() {
  577. this.$message({
  578. type: "success",
  579. message: "操作成功!"
  580. });
  581. },
  582. // 操作失败反馈
  583. failInfo(val) {
  584. this.$message.error(val);
  585. },
  586. // 清空选择
  587. toggleSelection(rows) {
  588. this.$refs.multipleTable.clearSelection();
  589. },
  590. // 已选择项
  591. handleSelectionChange(val) {
  592. this.multipleSelection = val;
  593. },
  594. // 文件上传
  595. submitUpload() {
  596. this.$refs.upload.submit();
  597. },
  598. handleRemove(file, fileList) {
  599. console.log(file, fileList);
  600. },
  601. handlePreview(file) {
  602. console.log(file);
  603. },
  604. addPic() {
  605. this.addPicPanel = !this.addPicPanel;
  606. },
  607. // 删除弹窗
  608. removeSuperviseOne(id) {
  609. this.deleteId = id;
  610. this.problemDeleteVisible = true;
  611. },
  612. deleteSuccess() {
  613. this.problemDeleteVisible = false;
  614. this.search();
  615. },
  616. changeSupervisionVisiblefalse() {
  617. this.$nextTick(() => {
  618. if (this.flash) {
  619. this.flash = false;
  620. this.search();
  621. }
  622. });
  623. this.changeSupervisionVisible = false;
  624. this.changeSupervision = {
  625. dataStat: "",
  626. nm: "",
  627. endTime: "",
  628. pblmId: "",
  629. objId: "",
  630. objType: "",
  631. inspGroupId: "",
  632. inspPblmCate: "",
  633. inspPblmName: "",
  634. inspPblmDesc: "",
  635. pblmLong: "",
  636. pblmLat: "",
  637. pblmStat: "",
  638. ifCasePblm: "",
  639. inspPblmOrgName: "",
  640. pblmPersName: "",
  641. inspPblmCate: "",
  642. reviOpin: "",
  643. reviConc: "",
  644. reviOrgGuid: "",
  645. collTime: "",
  646. recPers: "",
  647. note: "",
  648. gwComFiles: [
  649. {
  650. id: "",
  651. filePath: "",
  652. bizId: ""
  653. }
  654. ]
  655. };
  656. this.$refs.uploadFile.init();
  657. this.addPicPanel = false;
  658. },
  659. },
  660. //生命周期 - 创建完成(可以访问当前this实例)
  661. created() {
  662. this.addPicPanel = false;
  663. if (this.userId) {
  664. console.log("已经登录");
  665. this.search();
  666. } else {
  667. this.$router.push("/login");
  668. }
  669. },
  670. //生命周期 - 挂载完成(可以访问DOM元素)
  671. mounted() {
  672. this.search();
  673. },
  674. beforeCreate() {}, //生命周期 - 创建之前
  675. beforeMount() {}, //生命周期 - 挂载之前
  676. beforeUpdate() {}, //生命周期 - 更新之前
  677. updated() {}, //生命周期 - 更新之后
  678. beforeDestroy() {}, //生命周期 - 销毁之前
  679. destroyed() {}, //生命周期 - 销毁完成
  680. activated() {} //如果页面有keep-alive缓存功能,这个函数会触发
  681. };
  682. </script>
  683. <style rel="stylesheet/scss" lang="scss" scoped>
  684. </style>