From 4dee4cb5b31a7f1dcd2c7b3d72f74b78d2fe3f29 Mon Sep 17 00:00:00 2001
From: gongchunyi <deslre0381@gmail.com>
Date: 星期五, 18 九月 2026 15:56:41 +0800
Subject: [PATCH] fix: 质检是否入库
---
src/views/basicData/product/ImportExcel/index.vue | 23 ++++-------------------
1 files changed, 4 insertions(+), 19 deletions(-)
diff --git a/src/views/basicData/product/ImportExcel/index.vue b/src/views/basicData/product/ImportExcel/index.vue
index 22df1f7..90f569c 100644
--- a/src/views/basicData/product/ImportExcel/index.vue
+++ b/src/views/basicData/product/ImportExcel/index.vue
@@ -26,36 +26,21 @@
name: "浜у搧缁存姢瀵煎叆",
});
-const props = defineProps({
- productId: { type: [String, Number], default: "" },
-});
const emits = defineEmits(["uploadSuccess"]);
const fileUploadRef = ref();
const upload = reactive({
- // 鏄惁鏄剧ず寮瑰嚭灞傦紙渚涘簲鍟嗗鍏ワ級
open: false,
- // 寮瑰嚭灞傛爣棰橈紙渚涘簲鍟嗗鍏ワ級
- title: "",
+ title: "浜у搧瀵煎叆",
// 鏄惁绂佺敤涓婁紶
isUploading: false,
// 璁剧疆涓婁紶鐨勮姹傚ご閮�
headers: { Authorization: "Bearer " + getToken() },
});
-// 涓婁紶鐨勫湴鍧�锛堟惡甯� productId 鍙傛暟锛屼紶缁欏悗绔殑 importProduct 鎺ュ彛锛�
-const uploadUrl = computed(
- () =>
- import.meta.env.VITE_APP_BASE_API +
- "/basic/product/import" +
- (props.productId ? `?productId=${props.productId}` : "")
-);
+// 涓婁紶鐨勫湴鍧�
+const uploadUrl = computed(() => import.meta.env.VITE_APP_BASE_API + "/basic/product/import");
// 鐐瑰嚮瀵煎叆
const handleImport = () => {
- if (!props.productId) {
- ElMessage({ message: "璇峰厛閫夋嫨浜у搧", type: "warning" });
- return;
- }
upload.open = true;
- upload.title = "浜у搧瀵煎叆";
};
const submitFileForm = () => {
@@ -70,7 +55,7 @@
const handleFileSuccess = (response) => {
const { code, msg } = response;
if (code == 200) {
- ElMessage({ message: "瀵煎叆鎴愬姛", type: "success" });
+ ElMessage({ message: msg || "瀵煎叆鎴愬姛", type: "success" });
upload.open = false;
emits("uploadSuccess");
} else {
--
Gitblit v1.9.3