Преглед изворни кода

个贷产品一键全部下载

wucl пре 11 месеци
родитељ
комит
6f20b77e3a

+ 6 - 1
src/api/modules/personalProduction.js

@@ -17,7 +17,12 @@ export default {
       return request.get(`personalProduction/remove/${params}`)
    },
    downloadPkg(params){
-      return request.get(`personalProduction/downloadPkg/${params}`)
+      return request({
+         url: `personalProduction/downloadPkg/${params}`,
+         method: 'get',
+         data: null,
+         responseType: 'blob'
+       })
    },
    checkPass(params){
       return request.put(`personalProduction/pass`,params)

+ 28 - 12
src/views/personal/readonlyDetail.vue

@@ -776,6 +776,7 @@
                 <h3 class="title">
                   <div class="avatar-wrapper icon-title">产品</div>
                   <div class="icon-info">产品信息</div>
+                  <el-button type="text" style="margin-left: 20px;" @click="downloadAll()">全部下载</el-button>
                 </h3>
               </el-divider>
             </div>
@@ -783,7 +784,7 @@
         </div>
         <div style="display: flex;margin-top: 100px; width: 100%;">
           <el-card :body-style="{ padding: '0px' }" shadow="always"
-            style="margin-left: 5%; margin-right: 5%; width: 20%;" v-if="hasStatement">
+            style="margin-left: 5%; margin-right: 5%; width: 20%;">
             <img :src="statementCardPNG" class="image">
             <div style="padding: 14px;">
               <span>房地产意见书</span>
@@ -804,7 +805,7 @@
 
           </el-card>
           <el-card :body-style="{ padding: '0px' }" shadow="always"
-            style="margin-left: 5%; margin-right: 5%;width: 20%;" v-if="hasReport">
+            style="margin-left: 5%; margin-right: 5%;width: 20%;">
             <img :src="technicCardPNG" class="image">
             <div style="padding: 14px;">
               <span>技术报告</span>
@@ -824,8 +825,7 @@
               <el-button type="text" style="position: relative; left: 10px;top: -4px;" disabled>手动上传</el-button>
             </el-upload>
           </el-card>
-          <el-card :body-style="{ padding: '0px' }" shadow="always" style="margin-left: 5%; margin-right: 5%;width: 20%;"
-            v-if="hasReport">
+          <el-card :body-style="{ padding: '0px' }" shadow="always" style="margin-left: 5%; margin-right: 5%;width: 20%;">
             <img :src="finalCardPNG" class="image">
             <div style="padding: 14px;">
               <span>结果报告</span>
@@ -1234,8 +1234,8 @@ export default {
       inWarehouseDialog: false,
       warehouseTip: null,
       productionId: null,
-      hasStatement: false,
-      hasReport: false,
+      // hasStatement: false,
+      // hasReport: false,
       feedback: null,
       checkDialog: false,
       checkProDTO: {
@@ -1329,12 +1329,12 @@ export default {
             if (res.data.feedback) {
               this.feedback = JSON.parse(res.data.feedback);
               this.nodeBusinessInfo.production = this.feedback;
-              if (this.feedback.includes("STATEMENT")) {
-                this.hasStatement = true;
-              }
-              if (this.feedback.includes("REPORT")) {
-                this.hasReport = true;
-              }
+              // if (this.feedback.includes("STATEMENT")) {
+              //   this.hasStatement = true;
+              // }
+              // if (this.feedback.includes("REPORT")) {
+              //   this.hasReport = true;
+              // }
             } else {
               this.feedback = [];
             }
@@ -1514,6 +1514,22 @@ export default {
         });
       }
     },
+
+    downloadAll(){
+      if (this.target.id) {
+        let fileName = this.businessSubId;
+        this.$api.personalProduction.downloadPkg(this.target.id).then(res=>{
+          let blob = new Blob([res],{type:"application/octet-stream;"})
+            const url = window.URL.createObjectURL(blob);
+            const link = document.createElement('a');
+            link.href = url;
+            console.log(blob)
+            link.setAttribute('download',fileName+'产品包.zip');
+            document.body.appendChild(link);
+            link.click();
+        })
+      }
+    }
   }
 }
 </script>

+ 11 - 1
src/views/personal/todoDetail.vue

@@ -2563,7 +2563,17 @@ export default {
     },
     downloadAll(){
       if (this.target.id) {
-        this.$api.personalProduction.downloadPkg(this.target.id);
+        let fileName = this.businessSubId;
+        this.$api.personalProduction.downloadPkg(this.target.id).then(res=>{
+          let blob = new Blob([res],{type:"application/octet-stream;"})
+            const url = window.URL.createObjectURL(blob);
+            const link = document.createElement('a');
+            link.href = url;
+            console.log(blob)
+            link.setAttribute('download',fileName+'产品包.zip');
+            document.body.appendChild(link);
+            link.click();
+        })
       }
     }
   }