From ec7bdf965d4d7be3483046ece279b4ceea182163 Mon Sep 17 00:00:00 2001
From: yaowanxin <3588231647@qq.com>
Date: 星期三, 31 十二月 2025 10:36:43 +0800
Subject: [PATCH] 按模版进行产品导入,引用模板下载,更新模板下载接口路径
---
src/components/Upload/FileUpload.vue | 6 +++---
src/views/basicData/product/ImportExcel/index.vue | 8 +++++---
2 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/src/components/Upload/FileUpload.vue b/src/components/Upload/FileUpload.vue
index 1ac0344..65c6374 100644
--- a/src/components/Upload/FileUpload.vue
+++ b/src/components/Upload/FileUpload.vue
@@ -6,7 +6,7 @@
});
const props = defineProps({
- downloadTemplate: Function,
+ // downloadTemplate: Function,
showTips: Boolean,
accept: {
type: String,
@@ -31,7 +31,7 @@
default: 1,
},
});
-const emits = defineEmits(["success", "remove"]);
+const emits = defineEmits(["success", "remove", "downloadTemplate"]);
const uploadRef = ref();
const fileList = ref([]);
@@ -85,7 +85,7 @@
type="primary"
link
class="reset-margin"
- @click="props.downloadTemplate()"
+ @click="emits('downloadTemplate')"
>
<span style="font-size: 12px; font-weight: normal">涓嬭浇妯℃澘</span>
</el-button>
diff --git a/src/views/basicData/product/ImportExcel/index.vue b/src/views/basicData/product/ImportExcel/index.vue
index 0dc4ea6..fe77420 100644
--- a/src/views/basicData/product/ImportExcel/index.vue
+++ b/src/views/basicData/product/ImportExcel/index.vue
@@ -5,7 +5,7 @@
<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"
@@ -23,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: "浜у搧缁存姢瀵煎叆",
});
@@ -45,6 +46,7 @@
headers: { Authorization: "Bearer " + getToken() },
// 涓婁紶鐨勫湴鍧�
url: import.meta.env.VITE_APP_BASE_API + "/system/supplier/import",
+ updateSupport: true,
});
// 鐐瑰嚮瀵煎叆
const handleImport = () => {
@@ -54,7 +56,7 @@
// 涓嬭浇妯℃澘
const downloadTemplate = () =>{
- proxy.download("/basic/customer/downloadTemplate", {}, "浜у搧瀵煎叆妯℃澘.xlsx");
+ proxy.download("/basic/product/downloadTemplate", {}, "浜у搧瀵煎叆妯℃澘.xlsx");
}
const submitFileForm = () => {
--
Gitblit v1.9.3