cabb62ead0a5fb68d805c3208450411d2039230e.svn-base 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678
  1. <template>
  2. <!-- 修改弹框 -->
  3. <el-dialog
  4. width="60%"
  5. class="outerDialog custom_dialog"
  6. title="修改督查问题"
  7. :modal = true
  8. @close="closeModal"
  9. :append-to-body = true
  10. :visible.sync="changeSupervisionVisible">
  11. <div class="scroll_wrapper">
  12. <div
  13. style="width:49%;overflow-y:auto;max-height:58vh;float:left;border:1px solid #d5d5ff;margin-right:5px;">
  14. <p style="font-weight:bolder;background-color:#d5d5ff;padding:3px;">基本信息</p>
  15. <el-form ref="changeSupFrom" :rules="rules1" :model="changeSupervision" label-width="120px">
  16. <el-form-item label="督查对象名称" prop="newVillName">
  17. <el-input v-model="changeSupervision.newVillName" clearable :readonly="true"></el-input>
  18. </el-form-item>
  19. <el-form-item label="问题类别" prop="inspPblmsName">
  20. <el-select v-model="t1" value-key="inspPblmsName" placeholder="请选择" disabled @change="problemListChange">
  21. <el-option v-for="(item,index) in problemList" :key="index" :label="item.inspPblmsName" :value="item">
  22. </el-option>
  23. </el-select>
  24. </el-form-item>
  25. <el-form-item label="检查项目" prop="checkPoint" style="text-align:left">
  26. <el-select v-model="t2" placeholder="请选择" value-key="checkPointName" @change="currentCheckPointListChange">
  27. <el-option v-for="(item,index) in currentCheckPointList" :key="index" :label="item.checkPointName" :value="item">
  28. </el-option>
  29. </el-select>
  30. </el-form-item>
  31. <el-form-item label="详细描述" prop="inspPblmDesc">
  32. <el-input type="textarea" :rows="2" v-model="changeSupervision.inspPblmDesc" clearable></el-input>
  33. </el-form-item>
  34. <el-form-item label="上报人" prop="persName">
  35. <el-input
  36. resize="none"
  37. type="input"
  38. :rows="3"
  39. readonly
  40. placeholder="请输入"
  41. v-model.trim="changeSupervision.persName"
  42. ></el-input>
  43. </el-form-item>
  44. <el-form-item label="上报时间" prop="collTime">
  45. <el-date-picker v-model="changeSupervision.collTime" readonly type="date"></el-date-picker>
  46. </el-form-item>
  47. </el-form>
  48. </div>
  49. <div
  50. style="width: 49%;float: left;border: 1px solid rgb(213, 213, 255);margin-right: 5px;overflow-y: auto;max-height: 58vh;">
  51. <p style="font-weight:bolder;background-color:#d5d5ff;padding:3px;">多媒体信息</p>
  52. <el-tabs style="margin:0px 5px">
  53. <el-tab-pane :label="picturetabName">
  54. <el-row style="text-align:right;">
  55. <el-button
  56. :v-if="!addPicPanel?addPicPanel:addPicPanel"
  57. size="mini"
  58. type="text"
  59. :icon="!addPicPanel?'el-icon-circle-plus-outline':'el-icon-circle-close-outline'"
  60. @click="addPic"
  61. >{{!addPicPanel?"添加":"取消"}}</el-button>
  62. </el-row>
  63. <!-- 该上传组件之前用v-if="addPicPanel 控制显示隐藏,发现在点击编辑问题时,如果不上传图片,之间点击确认时会报错 add by lch -->
  64. <el-row v-show="addPicPanel"> <!-- v-if="addPicPanel" -->
  65. <upload
  66. ref="uploadFile"
  67. :url="`/pdcApi/file/insert?bizId=`"
  68. @uploadOver="removeNewSupervision"
  69. ></upload>
  70. </el-row>
  71. <el-row>
  72. <div style="overflow-y:auto;overflow-x:hidden;max-height:30vh;padding:10px;">
  73. <div class="upload-container">
  74. <div
  75. v-for="(item, index) in pictureArray"
  76. :key="index"
  77. class="image-preview image-app-preview"
  78. >
  79. <div class="image-preview-wrapper">
  80. <img :src="`${hostUrl}/${item.filePath}`">
  81. <div class="image-preview-action">
  82. <i @click="removeFile(item.id)" class="el-icon-delete"></i>
  83. </div>
  84. </div>
  85. </div>
  86. </div>
  87. </div>
  88. </el-row>
  89. </el-tab-pane>
  90. <el-tab-pane :label="audiotabName">
  91. <el-table border :data="audioArray" style="width: 100%;margin: 0 auto;">
  92. <el-table-column header-align="center" align="center" label="音频">
  93. <template slot-scope="scope">
  94. <elaudio
  95. style="margin-left:15%;width:100px;height:30px;"
  96. :theUrl="`${hostUrl}/${scope.row.filePath}`"
  97. ></elaudio>
  98. </template>
  99. </el-table-column>
  100. <el-table-column header-align="center" align="center" label="操作">
  101. <template slot-scope="scope">
  102. <el-button
  103. size="mini"
  104. @click="removeFile(scope.row.id,scope.$index)"
  105. type="danger"
  106. >删除</el-button>
  107. </template>
  108. </el-table-column>
  109. </el-table>
  110. </el-tab-pane>
  111. <el-tab-pane :label="videotabName">
  112. <el-table border :data="videoArray" style="width: 100%;margin: 0 auto;">
  113. <el-table-column header-align="center" align="center" label="视频">
  114. <template slot-scope="scope">
  115. <video-player
  116. class="vjs-custom-skin"
  117. ref="videoPlayer"
  118. :options="scope.row"
  119. :playsinline="true"
  120. ></video-player>
  121. </template>
  122. </el-table-column>
  123. <el-table-column header-align="center" align="center" label="操作">
  124. <template slot-scope="scope">
  125. <el-button
  126. size="mini"
  127. @click="removeFile(scope.row.id,scope.$index)"
  128. type="danger"
  129. >删除</el-button>
  130. </template>
  131. </el-table-column>
  132. </el-table>
  133. </el-tab-pane>
  134. <el-tab-pane :label="filetabName">
  135. <el-table border :data="fileArray" style="width: 100%;margin: 0 auto;">
  136. <el-table-column header-align="center" align="center" label="文档">
  137. <template slot-scope="scope">
  138. <p>
  139. <a :href="`${hostUrl}/${scope.row.filePath}`" target="_blank" rel="noopener noreferrer">
  140. {{scope.row.fileName}}
  141. </a>
  142. </p>
  143. </template>
  144. </el-table-column>
  145. <el-table-column header-align="center" align="center" label="操作">
  146. <template slot-scope="scope">
  147. <el-button
  148. size="mini"
  149. @click="removeFile(scope.row.id,scope.$index)"
  150. type="danger"
  151. >删除</el-button>
  152. </template>
  153. </el-table-column>
  154. </el-table>
  155. </el-tab-pane>
  156. </el-tabs>
  157. </div>
  158. </div>
  159. <span slot="footer">
  160. <el-button type="primary" @click="changeSupervisionInfo" :loding="changeSupervisionLoading">保存</el-button>
  161. <el-button @click="changeSupervisionVisiblefalse">取消</el-button>
  162. </span>
  163. </el-dialog>
  164. </template>
  165. <script>
  166. import {showDetailsXq,updatelist,deleteFileById} from "@api/duChaAPI.js";
  167. import request from "@util/gw_ajax_request.js";
  168. import {hostUrl} from '@util/global_variable'
  169. export default {
  170. props: ['editId'],
  171. data(){
  172. return{
  173. changeSupervisionVisible: true,
  174. changeSupervisionLoading: false,
  175. changeSupervision: {},
  176. rules1: {
  177. inspPblmName: [
  178. {
  179. required: true,
  180. message: "请输入问题名称",
  181. trigger: "blur"
  182. },
  183. {
  184. min: 1,
  185. max: 999,
  186. message: "不超过100字符",
  187. trigger: "blur"
  188. }
  189. ],
  190. inspPblmDesc: [
  191. {
  192. required: true,
  193. message: "请输入问题描述",
  194. trigger: "blur"
  195. }
  196. ],
  197. recPers: [
  198. {
  199. required: true,
  200. message: "请输入记录人",
  201. trigger: "blur"
  202. },
  203. {
  204. min: 1,
  205. max: 999,
  206. message: "不超过100字符",
  207. trigger: "blur"
  208. }
  209. ],
  210. objType: [
  211. {
  212. required: true,
  213. message: "请选择督查对象类型",
  214. trigger: "change"
  215. }
  216. ],
  217. objId: [
  218. {
  219. required: true,
  220. message: "请选择督查对象类型",
  221. trigger: "change"
  222. }
  223. ],
  224. inspPblmType: [
  225. {
  226. required: true,
  227. message: "请选择督查问题类型",
  228. trigger: "change"
  229. }
  230. ],
  231. dataStat: [
  232. {
  233. required: true,
  234. message: "请选择数据状态",
  235. trigger: "change"
  236. }
  237. ],
  238. collTime: [
  239. {
  240. required: true,
  241. message: "请选择采集时间",
  242. trigger: "change"
  243. }
  244. ],
  245. ifCasePblm: [
  246. {
  247. required: true,
  248. message: "请选择是否典型",
  249. trigger: "change"
  250. }
  251. ],
  252. pblmStat: [
  253. {
  254. required: true,
  255. message: "请选择问题类型",
  256. trigger: "change"
  257. }
  258. ],
  259. inspPblmCate: [
  260. {
  261. required: true,
  262. message: "请选择问题程度",
  263. trigger: "change"
  264. },
  265. {
  266. trigger: "change"
  267. }
  268. ]
  269. },
  270. supervisionState: [
  271. {
  272. value: "0",
  273. label: "一般"
  274. },
  275. {
  276. value: "1",
  277. label: "较重"
  278. },
  279. {
  280. value: "2",
  281. label: "严重"
  282. },
  283. {
  284. value: "3",
  285. label: "特别严重"
  286. }
  287. ],
  288. supervision: [
  289. {
  290. value: "1",
  291. label: "是"
  292. },
  293. {
  294. value: "0",
  295. label: "否"
  296. }
  297. ],
  298. addPicPanel: false,
  299. gwComFiles: [],
  300. picturetabName: "",
  301. audiotabName: "",
  302. videotabName: "",
  303. filetabName: "",
  304. pictureArray: [],
  305. audioArray: [],
  306. videoArray: [],
  307. fileArray:[],
  308. updateIdXiuGai: "",
  309. pblmId: "",
  310. t1: {},
  311. t2: {},
  312. t3: {},
  313. problemList: [],
  314. currentCheckPointList: [],
  315. currentProblemDescList: [],
  316. xiangqingmiaoshu: '',
  317. wenTiLeiBie:"",
  318. jianChaXiangMu:"",
  319. }
  320. },
  321. components:{
  322. upload: resolve => {
  323. require(["@widget/uploadFile.vue"], resolve);
  324. },
  325. },
  326. computed:{
  327. hostUrl(){
  328. return hostUrl
  329. },
  330. persId() {
  331. return localStorage.getItem("userid") ? localStorage.getItem("userid") : "1098101939614724096";
  332. }
  333. },
  334. mounted(){
  335. this.getproblemSmallType();
  336. },
  337. methods:{
  338. // 修改弹窗显示
  339. changeSup(id) {
  340. this.pictureArray = [];
  341. this.audioArray = [];
  342. this.videoArray = [];
  343. this.fileArray = [];
  344. this.updateIdXiuGai = id;
  345. let _this = this
  346. showDetailsXq(this.updateIdXiuGai).then(res => {
  347. // if(this.usersId==)
  348. this.changeSupervision = res.data;
  349. this.t1['inspPblmsName'] = this.changeSupervision.inspPblmsName
  350. this.problemList.forEach(ele=>{
  351. if(ele.inspPblmsName == _this.t1.inspPblmsName){
  352. _this.problemListChange(ele)
  353. }
  354. })
  355. this.t2['checkPointName'] = this.changeSupervision.checkPoint
  356. this.currentCheckPointList.forEach(ele=>{
  357. if(ele.checkPointName == _this.t2.checkPointName){
  358. _this.currentCheckPointListChange(ele)
  359. }
  360. })
  361. this.t3['pblmDesc'] = this.changeSupervision.pblmDesc
  362. res.data.gwComFiles.forEach(item => {
  363. if (
  364. item.fileExt == "mp3" ||
  365. item.fileExt == "MP3" ||
  366. item.fileExt == "m4a"
  367. ) {
  368. this.audioArray.push(item);
  369. } else if (
  370. item.fileExt == "jpg" ||
  371. item.fileExt == "JPG" ||
  372. item.fileExt == "png" ||
  373. item.fileExt == "PNG" ||
  374. item.fileExt == "JPEG" ||
  375. item.fileExt == "jpeg"
  376. ) {
  377. this.pictureArray.push(item);
  378. } else if (item.fileExt == "mp4" || item.fileExt == "MP4") {
  379. this.videoArray.push({
  380. id: item.id,
  381. bizId: item.bizId,
  382. width: "130",
  383. height: "130",
  384. autoplay: false,
  385. muted: true,
  386. language: "en",
  387. playbackRates: [0.7, 1.0, 1.5, 2.0],
  388. sources: [
  389. {
  390. type: "video/mp4",
  391. src: this.hostUrl + item.filePath
  392. }
  393. ]
  394. });
  395. }else{
  396. this.fileArray.push(item);
  397. }
  398. });
  399. this.picturetabName = "图片资料(" + this.pictureArray.length + ")";
  400. this.audiotabName = "音频资料(" + this.audioArray.length + ")";
  401. this.videotabName = "视频资料(" + this.videoArray.length + ")";
  402. this.filetabName = "其它资料(" + this.fileArray.length + ")";
  403. });
  404. },
  405. // 仅用于添加图片成功后查询信息
  406. getProblemInfo(id){
  407. showDetailsXq(this.updateIdXiuGai).then(res => {
  408. this.changeSupervision = res.data;
  409. });
  410. },
  411. // 提交修改信息
  412. changeSupervisionInfo() {
  413. console.log(this)
  414. var _self = this;
  415. this.$refs.changeSupFrom.validate(valid => {
  416. if (valid) {
  417. this.$nextTick(()=>{
  418. if (_self.$refs.uploadFile.submitUpload(_self.changeSupervision.pblmId)) {
  419. _self.removeNewSupervision();
  420. }
  421. setTimeout(()=>{
  422. _self.changeSupervisionLoading = true;
  423. _self.changeSupervision.checkPoint = _self.jianChaXiangMu
  424. _self.changeSupervision.inspPblmName = _self.wenTiLeiBie
  425. _self.changeSupervision.inspPlbmType = _self.t2.sort2;
  426. _self.changeSupervision.pblmsTypeId = _self.t2.guid;
  427. let data = _self.changeSupervision;
  428. updatelist(data).then(res => {
  429. _self.pblmId = res.data.pblmId;
  430. _self.gwComFiles = res.data.gwComFiles;
  431. if (res.success) {
  432. _self.changeSupervisionLoading = false;
  433. _self.successInfo();
  434. _self.addPicPanel = false;
  435. } else {
  436. _self.failInfo();
  437. _self.$emit('closeEditDialog')
  438. }
  439. });
  440. },500)
  441. })
  442. }
  443. });
  444. },
  445. removeNewSupervision(arg) {
  446. if (arg) {
  447. var args = this.gwComFiles.concat(arg);
  448. }
  449. this.getProblemInfo(this.editId)
  450. this.gwComFiles = [];
  451. },
  452. changeSupervisionVisiblefalse() {
  453. this.$emit('closeEditDialog')
  454. this.$refs.uploadFile.init();
  455. this.addPicPanel = false;
  456. },
  457. addPic() {
  458. this.addPicPanel = !this.addPicPanel;
  459. },
  460. // 删除图片文件
  461. removeFile(id, index) {
  462. // this.updateIdXiuGai = this.updateIdXiuGai;
  463. var _self = this;
  464. this.$confirm("此操作将永久删除该文件, 是否继续?", "提示", {
  465. confirmButtonText: "确定",
  466. cancelButtonText: "返回",
  467. type: "warning"
  468. }).then(
  469. res => {
  470. if (res === "confirm") {
  471. deleteFileById(id, this.persId).then(res => {
  472. if (res.success) {
  473. this.changeSupervision.gwComFiles.forEach(item => {
  474. if (
  475. item.fileExt == "mp3" ||
  476. item.fileExt == "MP3" ||
  477. item.fileExt == "m4a"
  478. ) {
  479. this.audiotabName.splice(index, 1);
  480. } else if (
  481. item.fileExt == "jpg" ||
  482. item.fileExt == "JPG" ||
  483. item.fileExt == "png" ||
  484. item.fileExt == "PNG" ||
  485. item.fileExt == "JPEG" ||
  486. item.fileExt == "jpeg"
  487. ) {
  488. this.pictureArray.splice(index, 1);
  489. } else if (item.fileExt == "mp4" || item.fileExt == "MP4") {
  490. this.videoArray.splice(index, 1);
  491. }
  492. });
  493. _self.changeSup(this.updateIdXiuGai);
  494. } else {
  495. this.failInfo();
  496. }
  497. });
  498. }
  499. },
  500. res => {
  501. console.log("返回");
  502. }
  503. )
  504. },
  505. // 操作成功反馈
  506. successInfo() {
  507. this.$message({
  508. type: "success",
  509. message: "操作成功!"
  510. });
  511. this.$emit('closeEditDialog')
  512. },
  513. // 操作失败反馈
  514. failInfo(val) {
  515. this.$message.error(val);
  516. },
  517. // 文件上传
  518. submitUpload() {
  519. this.$refs.upload.submit();
  520. },
  521. closeModal(){
  522. this.$emit('closeEditDialog')
  523. },
  524. getproblemSmallType() {
  525. let result = [];
  526. request.get('/dc/insp/pblms/getPblmType', {
  527. params: {
  528. type: 28,
  529. pguid: `28000000000000000000000000000000`
  530. }
  531. }).then(res => {
  532. if (res.success) {
  533. res.data.forEach((ele) => {
  534. let haveinspPblmsName = false;
  535. result.forEach((inspPblm) => {
  536. if (inspPblm['inspPblmsName'] == ele.inspPblmsName) {
  537. //
  538. let havechekPoint = false;
  539. inspPblm['checkPoints'].forEach((chekPoint) => {
  540. if (chekPoint['checkPointName'] == ele.checkPoint) {
  541. havechekPoint = true;
  542. }
  543. });
  544. if (!havechekPoint) {
  545. let newCheckPoint = {};
  546. newCheckPoint['checkPointName'] = ele.checkPoint;
  547. newCheckPoint['sort2'] = ele.sort2;
  548. newCheckPoint['guid'] = ele.guid
  549. inspPblm['checkPoints'].push(newCheckPoint);
  550. }
  551. haveinspPblmsName = true;
  552. }
  553. });
  554. if (!haveinspPblmsName) {
  555. let haveinspPblmsObj = {};
  556. haveinspPblmsObj['inspPblmsName'] = ele.inspPblmsName;
  557. haveinspPblmsObj['sort1'] = ele.sort1;
  558. haveinspPblmsObj['checkPoints'] = [{
  559. checkPointName: ele.checkPoint,
  560. sort2: ele.sort2,
  561. guid: ele.guid
  562. }];
  563. result.push(haveinspPblmsObj);
  564. }
  565. })
  566. this.problemList = result;
  567. this.changeSup(this.editId)
  568. }
  569. })
  570. },
  571. problemListChange: function (item) {
  572. this.t1 = item
  573. this.wenTiLeiBie = item.inspPblmsName;
  574. this.currentCheckPointList = item.checkPoints;
  575. },
  576. currentCheckPointListChange: function (item) {
  577. this.jianChaXiangMu = item.checkPointName;
  578. this.currentProblemDescList = item.pblmDescs;
  579. },
  580. currentProblemDescListChange: function (item) {
  581. this.xiangqingmiaoshu = item.pblmDesc;
  582. console.log(item);
  583. },
  584. },
  585. watch:{
  586. editId(val){
  587. this.changeSup(val)
  588. },
  589. 't3': {
  590. handler: function (val, oldVal) {
  591. },
  592. deep: true
  593. },
  594. }
  595. }
  596. </script>
  597. <style scoped lang="scss">
  598. .scroll_wrapper{
  599. overflow: hidden;
  600. }
  601. .scroll_wrapper .el-form{
  602. padding-top: 5px;
  603. padding-right: 5px;
  604. }
  605. .upload-container {
  606. width: 100%;
  607. position: relative;
  608. .image-uploader {
  609. width: 35%;
  610. float: left;
  611. }
  612. .image-preview {
  613. width: 200px;
  614. height: 200px;
  615. position: relative;
  616. border: 1px dashed #d9d9d9;
  617. float: left;
  618. // margin-left: 50px;
  619. .image-preview-wrapper {
  620. position: relative;
  621. width: 100%;
  622. height: 100%;
  623. img {
  624. width: 100%;
  625. height: 100%;
  626. }
  627. }
  628. .image-preview-action {
  629. position: absolute;
  630. width: 100%;
  631. height: 100%;
  632. left: 0;
  633. top: 0;
  634. color: #fff;
  635. opacity: 0;
  636. font-size: 20px;
  637. background-color: rgba(0, 0, 0, 0.5);
  638. transition: opacity 0.3s;
  639. cursor: pointer;
  640. text-align: center;
  641. line-height: 200px;
  642. .el-icon-delete {
  643. font-size: 36px;
  644. }
  645. }
  646. &:hover {
  647. .image-preview-action {
  648. opacity: 1;
  649. }
  650. }
  651. }
  652. .image-app-preview {
  653. margin-bottom: 10px;
  654. width: 40vh;
  655. height: 180px;
  656. position: relative;
  657. border: 1px dashed #d9d9d9;
  658. float: left;
  659. // margin-left: 50px;
  660. .app-fake-conver {
  661. height: 44px;
  662. position: absolute;
  663. width: 100%; // background: rgba(0, 0, 0, .1);
  664. text-align: center;
  665. line-height: 64px;
  666. color: #fff;
  667. }
  668. }
  669. }
  670. </style>