Browse Source

附件下载

gks 1 year ago
parent
commit
12e7e119f2
1 changed files with 13 additions and 1 deletions
  1. 13 1
      src/views/norm/quotaBonded.vue

+ 13 - 1
src/views/norm/quotaBonded.vue

@@ -168,7 +168,7 @@
               <el-form-item v-if="dict.confirmWay == '附件'" label-width="70px" prop="linkUrls" label="上传附件">
                 <el-upload :on-exceed="exceedHandle" :limit="1" :disabled="isAppoval && (dict.isF == undefined ? true : false)" class="upload-demo" ref="upload"
                   :headers="upload.headers" :action="upload.url" :on-success="handleFileSuccess.bind(null, index)"
-                  :auto-upload="true" :file-list="dict.fileList" :on-remove="handleRemove" :on-change="handleChange" >
+                  :auto-upload="true" :file-list="dict.fileList" :on-preview="handleDownload" :on-remove="handleRemove" :on-change="handleChange" >
                   <el-button :disabled="isAppoval && (dict.isF == undefined ? true : false)" slot="trigger" size="small" type="primary">选取文件</el-button>
                 </el-upload>
               </el-form-item>
@@ -253,6 +253,9 @@ import {
   setAdminApprove,
   setAdminReport,
 } from "@/api/norm/QUOTABONDED";
+import {
+  fileDownloadFun,
+} from "@/api/portal/JOINTCONFERENCE/JOINTCONFERENCE";
 import { listQUOTAFEERole } from "@/api/norm/QUOTAFEE";
 import { listAllBONDED } from "@/api/portal/BONDED/BONDED.js";
 import { uploadFiles, downloadFiles } from "@/api/common";
@@ -808,6 +811,15 @@ export default {
       );
     },
 
+    handleDownload(file){
+      let path = file.url.replace("/profile", "");
+      let name = file.name;
+      fileDownloadFun({ fileName: path, delete: false }).then((res) => {
+        let bolb = new Blob([res]);
+        saveAs(bolb, name);
+      });
+    },
+
     handleChange(file, fileList) { },
     handleRemove(file, fileList) {
       this.fileList = fileList;