From ec7bdf965d4d7be3483046ece279b4ceea182163 Mon Sep 17 00:00:00 2001
From: yaowanxin <3588231647@qq.com>
Date: 星期三, 31 十二月 2025 10:36:43 +0800
Subject: [PATCH] 按模版进行产品导入,引用模板下载,更新模板下载接口路径

---
 src/views/basicData/product/ImportExcel/index.vue |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/src/views/basicData/product/ImportExcel/index.vue b/src/views/basicData/product/ImportExcel/index.vue
index c25d254..fe77420 100644
--- a/src/views/basicData/product/ImportExcel/index.vue
+++ b/src/views/basicData/product/ImportExcel/index.vue
@@ -5,12 +5,13 @@
   <el-dialog v-model="upload.open" :title="upload.title">
     <FileUpload
       ref="fileUploadRef"
-      accept=".xlsx, .xls"
+      accept=".xlsx,.xls"
       :headers="upload.headers"
       :action="upload.url + '?updateSupport=' + upload.updateSupport"
       :disabled="upload.isUploading"
-      :showTip="false"
+      :showTip="true"
       @success="handleFileSuccess"
+      @downloadTemplate="downloadTemplate"
     />
     <template #footer>
       <div class="dialog-footer">
@@ -22,11 +23,12 @@
 </template>
 
 <script setup>
-import { reactive } from "vue";
+import { reactive, ref, getCurrentInstance } from "vue";
 import { getToken } from "@/utils/auth.js";
 import { FileUpload } from "@/components/Upload";
 import { ElMessage } from "element-plus";
 
+const { proxy } = getCurrentInstance();
 defineOptions({
   name: "浜у搧缁存姢瀵煎叆",
 });
@@ -44,6 +46,7 @@
   headers: { Authorization: "Bearer " + getToken() },
   // 涓婁紶鐨勫湴鍧�
   url: import.meta.env.VITE_APP_BASE_API + "/system/supplier/import",
+  updateSupport: true,
 });
 // 鐐瑰嚮瀵煎叆
 const handleImport = () => {
@@ -51,6 +54,11 @@
   upload.title = "浜у搧瀵煎叆";
 };
 
+// 涓嬭浇妯℃澘
+const downloadTemplate = () =>{
+  proxy.download("/basic/product/downloadTemplate", {}, "浜у搧瀵煎叆妯℃澘.xlsx");
+}
+
 const submitFileForm = () => {
   fileUploadRef.value.uploadApi();
 };

--
Gitblit v1.9.3