fac10c8a315c083cb26cf57f538b1d42011abc3a.svn-base 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524
  1. <template>
  2. <el-dialog title="整改详情" :visible.sync="dialogFormVisible" @close="closeDialog"
  3. :close-on-click-modal="false" :modal-append-to-body="true" :append-to-body="true" width="50%" class="outerDialog custom_dialog">
  4. <div
  5. style="width:49%;overflow-y:auto;max-height:52vh;float:left;border:1px solid #d5d5ff;margin-right:5px;">
  6. <p style="font-weight:bolder;background-color:#d5d5ff;padding:3px;margin-bottom: 10px;">基本信息</p>
  7. <el-form :model="formInline" label-width="110px" :rules="zhengGaiForm" ref="formInline">
  8. <el-form-item label="整改状态:" prop="rectConc">
  9. <el-select v-model="formInline.rectConc" placeholder="请选择" clearable>
  10. <el-option
  11. v-for="item in rectifyStatus"
  12. :key="item.value"
  13. :label="item.label"
  14. :value="item.value">
  15. </el-option>
  16. </el-select>
  17. </el-form-item>
  18. <!--<el-form-item label="审核状态:">-->
  19. <!--<el-select v-model="formInline.chkState" placeholder="请选择">-->
  20. <!--<el-option-->
  21. <!--v-for="item in chkState"-->
  22. <!--:key="item.value"-->
  23. <!--:label="item.label"-->
  24. <!--:value="item.value">-->
  25. <!--</el-option>-->
  26. <!--</el-select>-->
  27. <!--</el-form-item>-->
  28. <el-form-item label="整改时间:" prop="rectTm" clearable>
  29. <el-date-picker
  30. v-model="formInline.rectTm"
  31. type="date"
  32. placeholder="选择整改时间"
  33. size="small"
  34. value-format="yyyy-MM-dd">
  35. </el-date-picker>
  36. </el-form-item>
  37. <el-form-item label="备注描述:">
  38. <el-input v-model="formInline.rectNote" type="textarea" :rows="5" autocomplete="off"></el-input>
  39. </el-form-item>
  40. </el-form>
  41. </div>
  42. <div
  43. style="width: 49%;float: left;border: 1px solid rgb(213, 213, 255);margin-right: 5px;overflow-y: auto;max-height: 52vh;"
  44. >
  45. <p style="font-weight:bolder;background-color:#d5d5ff;padding:3px;">多媒体信息</p>
  46. <el-tabs style="margin:0px 5px">
  47. <el-tab-pane :label="picturetabName">
  48. <el-row style="text-align:right;">
  49. <el-button :v-if="!addPicPanel?addPicPanel:addPicPanel"
  50. size="mini"
  51. type="text"
  52. :icon="!addPicPanel?'el-icon-circle-plus-outline':'el-icon-circle-close-outline'"
  53. @click="addPic"
  54. >{{!addPicPanel?"添加":"取消"}}</el-button>
  55. </el-row>
  56. <el-row v-show="addPicPanel">
  57. <upload
  58. ref="uploadFile"
  59. :url="`/pdcApi/file/insert?bizId=`"
  60. @uploadOver="removeNewSupervision"
  61. ></upload>
  62. </el-row>
  63. <el-row>
  64. <div style="overflow-y:auto;overflow-x:hidden;max-height:30vh;padding:10px;">
  65. <div class="upload-container" id="imgView">
  66. <div
  67. v-if="editPicRefresh"
  68. v-for="(item, index) in pictureArray"
  69. :key="index"
  70. class="image-preview image-app-preview">
  71. <div class="image-preview-wrapper">
  72. <img :src="`${hostUrl}/${item.filePath}`">
  73. <div class="image-preview-action">
  74. <i @click="removeFile(item.id)" class="el-icon-delete"></i>
  75. <i @click="editPicEvent(item)" class="el-icon-edit-outline"></i>
  76. </div>
  77. </div>
  78. </div>
  79. </div>
  80. </div>
  81. </el-row>
  82. </el-tab-pane>
  83. <el-tab-pane :label="audiotabName">
  84. <el-table border :data="audioArray" style="width: 100%;margin: 0 auto;">
  85. <el-table-column header-align="center" align="center" label="音频">
  86. <template slot-scope="scope">
  87. <elaudio
  88. style="margin-left:15%;width:100px;height:30px;"
  89. :theUrl="`${hostUrl}/${scope.row.filePath}`"
  90. ></elaudio>
  91. <!-- <span>{{scope.row.fileTitle}}</span> -->
  92. </template>
  93. </el-table-column>
  94. <el-table-column header-align="center" align="center" label="操作">
  95. <template slot-scope="scope">
  96. <el-button
  97. size="mini"
  98. @click="removeFile(scope.row.id,scope.$index)"
  99. type="danger"
  100. >删除</el-button>
  101. </template>
  102. </el-table-column>
  103. </el-table>
  104. </el-tab-pane>
  105. <el-tab-pane :label="videotabName">
  106. <el-table border :data="videoArray" style="width: 100%;margin: 0 auto;">
  107. <el-table-column header-align="center" align="center" label="视频">
  108. <template slot-scope="scope">
  109. <!-- <span>{{scope.row.fileTitle}}</span> -->
  110. <video-player
  111. class="vjs-custom-skin"
  112. ref="videoPlayer"
  113. :options="scope.row"
  114. :playsinline="true"
  115. ></video-player>
  116. </template>
  117. </el-table-column>
  118. <el-table-column header-align="center" align="center" label="操作">
  119. <template slot-scope="scope">
  120. <el-button
  121. size="mini"
  122. @click="removeFile(scope.row.id,scope.$index)"
  123. type="danger"
  124. >删除</el-button>
  125. </template>
  126. </el-table-column>
  127. </el-table>
  128. </el-tab-pane>
  129. <el-tab-pane :label="filetabName">
  130. <el-table border :data="fileArray" style="width: 100%;margin: 0 auto;">
  131. <el-table-column header-align="center" align="center" label="文档">
  132. <template slot-scope="scope">
  133. <p>
  134. <a :href="`${hostUrl}/${scope.row.filePath}`" target="_blank" rel="noopener noreferrer">
  135. {{scope.row.fileName}}
  136. </a>
  137. </p>
  138. </template>
  139. </el-table-column>
  140. <el-table-column header-align="center" align="center" label="操作">
  141. <template slot-scope="scope">
  142. <el-button
  143. size="mini"
  144. @click="removeFile(scope.row.id,scope.$index)"
  145. type="danger"
  146. >删除</el-button>
  147. </template>
  148. </el-table-column>
  149. </el-table>
  150. </el-tab-pane>
  151. </el-tabs>
  152. </div>
  153. <div slot="footer" class="dialog-footer">
  154. <el-button size="mini" @click="closeDialog">取 消</el-button>
  155. <el-button size="mini" type="primary" @click="addFile('formInline')">保 存</el-button>
  156. </div>
  157. <EditPicOnline
  158. ref="editPicWeakupEvnent"
  159. v-if="editPicDialog"
  160. :picUrl="picUrl"
  161. @cancelHandler="cancelHandler"
  162. @editPicData="editPicDataEvent"
  163. ></EditPicOnline>
  164. </el-dialog>
  165. </template>
  166. <script>
  167. import request from '@util/gw_ajax_request'
  168. import {dateFormat} from '@util/gw_date';
  169. import elaudio from "../../widgets/elAudioShort.vue";
  170. import {
  171. findPageInfoShuiKu,
  172. getShuiKuWenTi,
  173. getXSKProblemNewExport,
  174. findPageInfo,
  175. getXSKProblemNew,
  176. removeSupervise,
  177. showDetailsXq,
  178. submitUpload,
  179. creatSupervise,
  180. getSupervisdByID,
  181. deleteFileById,
  182. updatelist,
  183. getEngId
  184. } from "@api/duChaAPI.js";
  185. import { hostUrl } from "@util/global_variable.js";
  186. import Viewer from 'viewerjs';
  187. import 'viewerjs/dist/viewer.css';
  188. export default {
  189. props: ['listId', 'rowId'],
  190. data() {
  191. //这里存放数据
  192. return {
  193. dialogFormVisible: true,
  194. formInline: {
  195. "id": "",
  196. "rectConc": "",
  197. "chkState": "",
  198. "rectTm": "",
  199. "rectNote": "",
  200. "rectPersId": "",
  201. },
  202. gwComFileList: [],
  203. rectifyStatus: [
  204. {label: '未整改', value: '1'},
  205. {label: '整改中', value: '2'},
  206. {label: '已整改', value: '3'},
  207. {label: '不具备整改条件', value: '4'}
  208. ],
  209. chkState:[
  210. {label: '未审核', value: '0'},
  211. {label: '销号', value: '1'},
  212. {label: '待复查', value: '2'},
  213. {label: '驳回', value: '3'}
  214. ],
  215. isAdd: null,
  216. picturetabName: "",
  217. addPicPanel: false,
  218. // 修改督查
  219. pictureArray: [],
  220. audioArray: [],
  221. videoArray: [],
  222. fileArray: [],
  223. audiotabName: "",
  224. videotabName: "",
  225. filetabName: "",
  226. changeSupervisionVisible: false,
  227. changeSupervisionLoading: false,
  228. editPicRefresh:true,
  229. editPicDialog:false,
  230. picUrl:"",
  231. picId:"",
  232. downloadIcon:"el-icon-download",
  233. gwComFiles:[],
  234. zhengGaiForm:{
  235. rectConc:[{ required: true, message: '整改状态不能为空'}],
  236. rectTm: [{ required: true, message: '整改时间不能为空'}]
  237. }
  238. }
  239. },
  240. components: {
  241. upload: resolve => {
  242. require(["@widget/uploadFile.vue"], resolve);
  243. },
  244. elaudio: elaudio,
  245. EditPicOnline: resolve => {
  246. require(["../../widgets/EditPicOnline/EditPicOnline.vue"], resolve);
  247. }
  248. },
  249. computed: {
  250. persId() {
  251. return localStorage.getItem("userid") ? localStorage.getItem("userid") : "1098101939614724096";
  252. },
  253. hostUrl(){
  254. return hostUrl
  255. }
  256. },
  257. //监控data中的数据变化
  258. watch: {
  259. rowId(n) {
  260. this.rowId = n;
  261. this.getRowIddata();
  262. }
  263. },
  264. //方法集合
  265. methods: {
  266. getRowIddata() {
  267. var _this = this;
  268. request.get(`/bis/insp/rect/pblm/${this.rowId}`).then(res => {
  269. if (Object.keys(res.data).length) {
  270. this.formInline = res.data;
  271. this.formInline.rectTm = dateFormat(this.formInline.rectTm, "yyyy-MM-dd");
  272. this.gwComFiles = res.data.gwFiles;
  273. res.data.gwFiles.forEach(item => {
  274. if (
  275. item.fileExt == "mp3" ||
  276. item.fileExt == "MP3" ||
  277. item.fileExt == "m4a"
  278. ) {
  279. this.audioArray.push(item);
  280. } else if (
  281. item.fileExt == "jpg" ||
  282. item.fileExt == "JPG" ||
  283. item.fileExt == "png" ||
  284. item.fileExt == "PNG" ||
  285. item.fileExt == "JPEG" ||
  286. item.fileExt == "jpeg"
  287. ) {
  288. this.pictureArray.push(item);
  289. } else if (item.fileExt == "mp4" || item.fileExt == "MP4") {
  290. this.videoArray.push({
  291. id: item.id,
  292. bizId: item.bizId,
  293. width: "130",
  294. height: "130",
  295. autoplay: false,
  296. muted: true,
  297. language: "en",
  298. playbackRates: [0.7, 1.0, 1.5, 2.0],
  299. sources: [
  300. {
  301. type: "video/mp4",
  302. // mp4
  303. src: this.hostUrl + item.filePath
  304. // webm
  305. // src: "https://cdn.theguardian.tv/webM/2015/07/20/150716YesMen_synd_768k_vp8.webm"
  306. }
  307. ]
  308. });
  309. } else {
  310. this.fileArray.push(item);
  311. }
  312. });
  313. _this.$nextTick(function(){
  314. var ViewerDom = document.getElementById('imgView');
  315. var viewer = new Viewer(ViewerDom, {})
  316. });
  317. this.picturetabName = "图片资料(" + this.pictureArray.length + ")";
  318. this.audiotabName = "音频资料(" + this.audioArray.length + ")";
  319. this.videotabName = "视频资料(" + this.videoArray.length + ")";
  320. this.filetabName = "其它资料(" + this.fileArray.length + ")";
  321. }
  322. })
  323. },
  324. //保存
  325. addFile(formName) {
  326. this.$refs[formName].validate((valid) => {
  327. if(valid){
  328. this.formInline.id = this.rowId;
  329. this.formInline.rectPersId = this.persId;
  330. request.post(`/bis/insp/rect/pblm/update`, this.formInline).then(res => {
  331. if (res.success) {
  332. this.$nextTick(()=>{
  333. if (this.$refs.uploadFile.submitUpload(res.data.id)) {
  334. this.removeNewSupervision();
  335. this.$message.success("操作成功");
  336. this.addPicPanel = false;
  337. }
  338. })
  339. }
  340. }).catch(err => {
  341. this.$message.error(err)
  342. })
  343. }
  344. })
  345. },
  346. closeDialog() {
  347. this.$emit('dialogClose')
  348. },
  349. removeNewSupervision(arg) {
  350. if (arg) {
  351. console.log(arg);
  352. this.$message.success('上传成功');
  353. }
  354. this.getRowIddata();
  355. this.closeDialog();
  356. this.$refs.uploadFile.init();
  357. },
  358. addPic() {
  359. this.addPicPanel = !this.addPicPanel;
  360. },
  361. // 删除图片文件
  362. removeFile(id, index) {
  363. var _self = this;
  364. this.$confirm("此操作将永久删除该文件, 是否继续?", "提示", {
  365. confirmButtonText: "确定",
  366. cancelButtonText: "返回",
  367. type: "warning"
  368. }).then(
  369. res => {
  370. if (res === "confirm") {
  371. deleteFileById(id).then(res => {
  372. if (res.success) {
  373. this.gwComFiles.forEach(item => {
  374. if (
  375. item.fileExt == "mp3" ||
  376. item.fileExt == "MP3" ||
  377. item.fileExt == "m4a"
  378. ) {
  379. this.audioArray.splice(index, 1);
  380. } else if (
  381. item.fileExt == "jpg" ||
  382. item.fileExt == "JPG" ||
  383. item.fileExt == "png" ||
  384. item.fileExt == "PNG" ||
  385. item.fileExt == "JPEG" ||
  386. item.fileExt == "jpeg"
  387. ) {
  388. this.pictureArray.splice(index, 1);
  389. } else if (item.fileExt == "mp4" || item.fileExt == "MP4") {
  390. this.videoArray.splice(index, 1);
  391. }else{
  392. this.fileArray.splice(index,1);
  393. }
  394. });
  395. _self.getRowIddata();
  396. } else {
  397. this.$message.warning(res.message);
  398. }
  399. });
  400. }
  401. },
  402. res => {
  403. console.log("返回");
  404. }
  405. );
  406. },
  407. //图片编辑
  408. editPicEvent(item){
  409. this.picUrl = this.hostUrl + "/" + item.filePath;
  410. this.editPicDialog = true;
  411. this.editPicRefresh = false;
  412. this.picId = item.id;
  413. },
  414. cancelHandler() {
  415. this.editPicDialog = false;
  416. this.editPicRefresh = true;
  417. },
  418. editPicDataEvent(item){
  419. request.post(`/file/updateFile?bizId=${this.rowId}&id=${this.picId}`,item,{headers:{'Content-Type': 'multipart/form-data'}}).then(res => {
  420. console.log(res);
  421. if(res.success){
  422. this.pictureArray = [];
  423. this.getRowIddata();
  424. }
  425. });
  426. },
  427. },
  428. //生命周期 - 创建完成(可以访问当前this实例)
  429. created() {
  430. },
  431. //生命周期 - 挂载完成(可以访问DOM元素)
  432. mounted() {
  433. this.getRowIddata();
  434. }
  435. }
  436. </script>
  437. <style lang="scss">
  438. .custom_dialog {
  439. .el-dialog__body{
  440. height: 50vh !important;
  441. }
  442. }
  443. .upload-container {
  444. width: 100%;
  445. position: relative;
  446. .image-uploader {
  447. width: 35%;
  448. float: left;
  449. }
  450. .image-preview {
  451. width: 200px;
  452. height: 200px;
  453. position: relative;
  454. border: 1px dashed #d9d9d9;
  455. float: left;
  456. // margin-left: 50px;
  457. .image-preview-wrapper {
  458. position: relative;
  459. width: 100%;
  460. height: 100%;
  461. img {
  462. width: 100%;
  463. height: 100%;
  464. }
  465. }
  466. .image-preview-action {
  467. position: absolute;
  468. width: 100%;
  469. height: 30px;
  470. left: 0;
  471. bottom: 0;
  472. cursor: default;
  473. text-align: center;
  474. color: #fff;
  475. opacity: 0;
  476. font-size: 20px;
  477. background-color: rgba(0, 0, 0, 0.5);
  478. transition: opacity 0.3s;
  479. cursor: pointer;
  480. text-align: center;
  481. line-height: 30px;
  482. .el-icon-delete {
  483. font-size: 25px;
  484. }
  485. .el-icon-edit-outline {
  486. font-size: 25px;
  487. }
  488. }
  489. &:hover {
  490. .image-preview-action {
  491. opacity: 1;
  492. }
  493. }
  494. }
  495. .image-app-preview {
  496. margin-bottom: 10px;
  497. width: 40vh;
  498. height: 180px;
  499. position: relative;
  500. border: 1px dashed #d9d9d9;
  501. float: left;
  502. // margin-left: 50px;
  503. .app-fake-conver {
  504. height: 44px;
  505. position: absolute;
  506. width: 100%; // background: rgba(0, 0, 0, .1);
  507. text-align: center;
  508. line-height: 64px;
  509. color: #fff;
  510. }
  511. }
  512. }
  513. </style>