From c444bc8607e206d5fa1b87fd224311778c4f6a69 Mon Sep 17 00:00:00 2001
From: ctw <>
Date: Fri, 3 Jan 2025 11:49:03 +0800
Subject: [PATCH] =?UTF-8?q?=E5=8C=85=E8=A3=85=E5=8D=95=E4=BD=8D=E5=92=8C?=
=?UTF-8?q?=E8=BE=85=E5=8A=A9=E6=9D=A1=E7=A0=81=E6=B7=BB=E5=8A=A0=E6=A0=A1?=
=?UTF-8?q?=E9=AA=8C?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../supermarketAuxiliaryCode/form.vue | 2 +-
.../supermarketAuxiliaryCode/index.vue | 55 ++++++------
.../components/supermarketUnit/index.vue | 65 +++++++-------
src/views/supermarket/supermarketSpu/form.vue | 90 +++++++++++--------
4 files changed, 116 insertions(+), 96 deletions(-)
diff --git a/src/views/supermarket/supermarketSpu/components/supermarketAuxiliaryCode/form.vue b/src/views/supermarket/supermarketSpu/components/supermarketAuxiliaryCode/form.vue
index df8ed9f..02bb08e 100644
--- a/src/views/supermarket/supermarketSpu/components/supermarketAuxiliaryCode/form.vue
+++ b/src/views/supermarket/supermarketSpu/components/supermarketAuxiliaryCode/form.vue
@@ -2,7 +2,7 @@
-
+
diff --git a/src/views/supermarket/supermarketSpu/components/supermarketAuxiliaryCode/index.vue b/src/views/supermarket/supermarketSpu/components/supermarketAuxiliaryCode/index.vue
index 37c81ee..e62fbab 100644
--- a/src/views/supermarket/supermarketSpu/components/supermarketAuxiliaryCode/index.vue
+++ b/src/views/supermarket/supermarketSpu/components/supermarketAuxiliaryCode/index.vue
@@ -45,28 +45,30 @@
> -->
-
-
-
-
-
-
-
-
- 编辑
-
-
- 删除
-
-
-
-
+
+
+
+
+
+
+
+
+
+ 编辑
+
+
+ 删除
+
+
+
+
+
@@ -110,13 +112,14 @@ const tableStyle = {
const getDataList = (formData: any) => {
console.log(formData);
- const index = supermarketAuxiliaryCodeEntityList.value.findIndex((item: any) => item.id === formData.id);
- if (index === -1) {
- supermarketAuxiliaryCodeEntityList.value.push(formData);
+ const index = supermarketAuxiliaryCodeEntityList.value?.findIndex((item: any) => item.id === formData.id);
+ if (supermarketAuxiliaryCodeEntityList.value == null || index == undefined) {
+ supermarketAuxiliaryCodeEntityList.value = [{ ...formData, isNew: true }];
+ } else if (index === -1) {
+ supermarketAuxiliaryCodeEntityList.value.push({ ...formData, isNew: true });
} else {
supermarketAuxiliaryCodeEntityList.value[index] = formData;
}
- console.log('a', supermarketAuxiliaryCodeEntityList.value);
};
// 清空搜索条件
// const resetQuery = () => {
diff --git a/src/views/supermarket/supermarketSpu/components/supermarketUnit/index.vue b/src/views/supermarket/supermarketSpu/components/supermarketUnit/index.vue
index 442d64d..fbf3a8f 100644
--- a/src/views/supermarket/supermarketSpu/components/supermarketUnit/index.vue
+++ b/src/views/supermarket/supermarketSpu/components/supermarketUnit/index.vue
@@ -53,33 +53,35 @@
> -->
-
-
-
-
-
-
-
-
- 正常
- 停销
-
-
-
-
-
-
-
-
-
-
-
- 编辑
-
- 删除
-
-
-
+
+
+
+
+
+
+
+
+
+ 正常
+ 停销
+
+
+
+
+
+
+
+
+
+
+
+ 编辑
+
+ 删除
+
+
+
+
@@ -122,13 +124,14 @@ const tableStyle = {
const getDataList = (formData: any) => {
console.log(formData);
- const index = supermarketUnitEntityList.value.findIndex((item: any) => item.id === formData.id);
- if (index === -1) {
- supermarketUnitEntityList.value.push(formData);
+ const index = supermarketUnitEntityList.value?.findIndex((item: any) => item.id === formData.id);
+ if (supermarketUnitEntityList.value == null || index == undefined) {
+ supermarketUnitEntityList.value = [{ ...formData, isNew: true }];
+ } else if (index === -1) {
+ supermarketUnitEntityList.value.push({ ...formData, isNew: true });
} else {
supermarketUnitEntityList.value[index] = formData;
}
- console.log('a', supermarketUnitEntityList.value);
};
// 清空搜索条件
diff --git a/src/views/supermarket/supermarketSpu/form.vue b/src/views/supermarket/supermarketSpu/form.vue
index b445e05..a0d69d1 100644
--- a/src/views/supermarket/supermarketSpu/form.vue
+++ b/src/views/supermarket/supermarketSpu/form.vue
@@ -4,179 +4,179 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
{{ item.label }}
-
+
-
+
-
+
-
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -203,7 +203,7 @@
-