lilei há 2 anos atrás
pai
commit
cf21c4ad6b

BIN
public/templ/采购单产品导入模板.xlsx


+ 7 - 26
src/views/purchasingManagement/purchaseOrder/importGuideModal.vue

@@ -18,8 +18,12 @@
             <li>1) 导入的Excel文件中必须包含名为“产品编码”、“数量”的列,且名称必须相同</li>
             <li>2) 除了“产品编码”、“数量”两列,其他列可自定义,不影响数据导入</li>
             <li>3) 如果导入的产品已经存在,则不会导入该行</li>
+            <li>
+              <a :href="filePath" style="margin: 5px 0 0;display: block;">
+                <a-icon type="download" style="padding-right: 5px;" />下载导入模板
+              </a>
+            </li>
           </ul>
-          <a-button type="link" icon="download" style="padding: 0 0 0 23px;" @click="handleExport">下载导入模板</a-button>
         </div>
         <div class="explain-item">
           <div class="explain-tit">
@@ -66,8 +70,6 @@
 import { commonMixin } from '@/utils/mixin'
 import ChooseImportModal from './chooseImportModal.vue'
 import { Upload } from '@/components'
-import { purchaseDetailDownload } from '@/api/purchase'
-import { downloadExcel } from '@/libs/JGPrint.js'
 export default {
   name: 'ImportGuideModal',
   components: { ChooseImportModal, Upload },
@@ -90,7 +92,8 @@ export default {
       paramsData: null,
       uploadParams: {
         savePathType: 'local'
-      }
+      },
+      filePath: location.protocol + '//' +location.host + '/templ/采购单产品导入模板.xlsx'
     }
   },
   methods: {
@@ -120,28 +123,6 @@ export default {
       this.openImportModal = false
       this.isShow = false
     },
-    //  导出
-    handleExport () {
-      const _this = this
-      _this.spinning = true
-      purchaseDetailDownload({}).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 {
-		  const fileName = '采购单产品导入模板'
-		  downloadExcel(res, fileName)
-        }
-      })
-    }
   },
   watch: {
     //  父页面传过来的弹框状态