瀏覽代碼

bug 修复

lilei 2 年之前
父節點
當前提交
6aa3c444e5
共有 1 個文件被更改,包括 4 次插入26 次删除
  1. 4 26
      src/views/salesReturnManagement/salesReturn/importGuideModal.vue

+ 4 - 26
src/views/salesReturnManagement/salesReturn/importGuideModal.vue

@@ -122,37 +122,15 @@ export default {
       this.openImportModal = false
       this.isShow = false
     },
-    //  导出
+    // 下载模板
     handleExport () {
-      const _this = this
-      _this.spinning = true
-      salesReturnDownload({}).then(res => {
-        _this.spinning = false
-        if (res.type == 'application/json') {
-          var reader = new FileReader()
-          reader.addEventListener('loadend', function () {
-            const obj = JSON.parse(reader.result)
-            _this.$notification.error({
-              message: '提示',
-              description: obj.message
-            })
-          })
-          reader.readAsText(res)
-        } else {
-          this.download(res)
-        }
-      })
-    },
-    download (data) {
-      if (!data) { return }
-      const url = window.URL.createObjectURL(new Blob([data]))
       const link = document.createElement('a')
       link.style.display = 'none'
-      link.href = url
-      const fname = '销售退货单产品导入模板'
-      link.setAttribute('download', fname + '.xlsx')
+      link.href = 'https://jianguan-images.oss-cn-beijing.aliyuncs.com/template/XiaoShouTuiHuoMingXiDaoRu.xlsx'
+      link.setAttribute('download', '销售退货导入模板' + '.xlsx')
       document.body.appendChild(link)
       link.click()
+      document.body.removeChild(link)
     }
   },
   watch: {