lilei 1 anno fa
parent
commit
b6f7ec7890
1 ha cambiato i file con 11 aggiunte e 2 eliminazioni
  1. 11 2
      src/views/salesReturnManagement/billOfLading/detail.vue

+ 11 - 2
src/views/salesReturnManagement/billOfLading/detail.vue

@@ -120,8 +120,8 @@
             <a-col :span="16">
               <a-form-model-item style="margin-bottom:10px" label="附件" :label-col="{span:2}" :wrapper-col="{span:22}">
                 <div style="line-height:26px;">
-                  <div v-for="item in form.attachmentList" :key="item.id">
-                    <a :href="item.filePath" download target="_blank">{{ item.fileName }}</a>
+                  <div v-for="item in form.attachmentList" :key="item.id" @click="dowloadExcel(item.filePath)">
+                    <a href="#">{{ item.fileName }}</a>
                   </div>
                 </div>
               </a-form-model-item>
@@ -242,6 +242,15 @@ export default {
     }
   },
   methods: {
+    dowloadExcel (url) {
+      const elt = document.createElement('a')
+      elt.setAttribute('href', url)
+      elt.setAttribute('download', '')
+      elt.style.display = 'none'
+      document.body.appendChild(elt)
+      elt.click()
+      document.body.removeChild(elt)
+    },
     // 打印预览/快捷打印
     handlePrint (type) {
       const _this = this