From 57059f7d99eba4a3349bf849b7071b5b0239aa0f Mon Sep 17 00:00:00 2001
From: ctw <>
Date: Tue, 31 Dec 2024 15:50:39 +0800
Subject: [PATCH 1/4] =?UTF-8?q?=E5=AE=8C=E5=96=84=E5=95=86=E5=93=81?=
=?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=9A=84=E5=8C=85=E8=A3=85=E5=8D=95=E4=BD=8D?=
=?UTF-8?q?=E5=92=8C=E8=BE=85=E5=8A=A9=E6=9D=A1=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
package.json | 1 +
.../supermarketAuxiliaryCode/form.vue | 101 ++++++++++
.../supermarketAuxiliaryCode/index.vue | 163 +++++++++++++++++
.../components/supermarketUnit/form.vue | 134 ++++++++++++++
.../components/supermarketUnit/index.vue | 172 ++++++++++++++++++
src/views/supermarket/supermarketSpu/form.vue | 105 ++++++-----
.../supermarket/supermarketSpu/index.vue | 36 ++--
7 files changed, 654 insertions(+), 58 deletions(-)
create mode 100644 src/views/supermarket/supermarketSpu/components/supermarketAuxiliaryCode/form.vue
create mode 100644 src/views/supermarket/supermarketSpu/components/supermarketAuxiliaryCode/index.vue
create mode 100644 src/views/supermarket/supermarketSpu/components/supermarketUnit/form.vue
create mode 100644 src/views/supermarket/supermarketSpu/components/supermarketUnit/index.vue
diff --git a/package.json b/package.json
index 8c4350c..b9cca10 100644
--- a/package.json
+++ b/package.json
@@ -35,6 +35,7 @@
"json-editor-vue3": "^1.1.1",
"lodash": "^4.17.21",
"mitt": "^3.0.0",
+ "nanoid": "^3.3.8",
"nprogress": "^0.2.0",
"pinia": "2.0.32",
"postcss": "8.4.40",
diff --git a/src/views/supermarket/supermarketSpu/components/supermarketAuxiliaryCode/form.vue b/src/views/supermarket/supermarketSpu/components/supermarketAuxiliaryCode/form.vue
new file mode 100644
index 0000000..df8ed9f
--- /dev/null
+++ b/src/views/supermarket/supermarketSpu/components/supermarketAuxiliaryCode/form.vue
@@ -0,0 +1,101 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/supermarket/supermarketSpu/components/supermarketAuxiliaryCode/index.vue b/src/views/supermarket/supermarketSpu/components/supermarketAuxiliaryCode/index.vue
new file mode 100644
index 0000000..926b5ca
--- /dev/null
+++ b/src/views/supermarket/supermarketSpu/components/supermarketAuxiliaryCode/index.vue
@@ -0,0 +1,163 @@
+
+
+
+
+
+
+ 新 增
+
+
+
+
+
+
+
+
+
+
+
+
+ 编辑
+
+
+ 删除
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/supermarket/supermarketSpu/components/supermarketUnit/form.vue b/src/views/supermarket/supermarketSpu/components/supermarketUnit/form.vue
new file mode 100644
index 0000000..d4c8ee0
--- /dev/null
+++ b/src/views/supermarket/supermarketSpu/components/supermarketUnit/form.vue
@@ -0,0 +1,134 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/supermarket/supermarketSpu/components/supermarketUnit/index.vue b/src/views/supermarket/supermarketSpu/components/supermarketUnit/index.vue
new file mode 100644
index 0000000..d5f3da4
--- /dev/null
+++ b/src/views/supermarket/supermarketSpu/components/supermarketUnit/index.vue
@@ -0,0 +1,172 @@
+
+
+
+
+
+ 新 增
+
+
+
+
+
+
+
+
+
+
+
+
+ 正常
+ 停销
+
+
+
+
+
+
+
+
+
+
+
+ 编辑
+
+ 删除
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/supermarket/supermarketSpu/form.vue b/src/views/supermarket/supermarketSpu/form.vue
index 4657bdd..cd071cc 100644
--- a/src/views/supermarket/supermarketSpu/form.vue
+++ b/src/views/supermarket/supermarketSpu/form.vue
@@ -1,8 +1,8 @@
-
+
-
+
@@ -75,13 +75,13 @@
-
+
@@ -110,7 +110,7 @@
- ???
+
@@ -183,24 +183,11 @@
- aaaa
-
-
-
-
-
-
-
+
+
+
+
+
@@ -220,9 +207,13 @@
import { useDict } from '/@/hooks/dict';
import { useMessage } from '/@/hooks/message';
import { getObj, addObj, putObj, getSupermarketCategory, getSupermarketBrand } from '/@/api/supermarket/supermarketSpu';
+import { getObj as getSupermarketUnit } from '/@/api/supermarket/supermarketUnit';
+import { getObj as getSupermarketAuxiliaryCode } from '/@/api/supermarket/supermarketAuxiliaryCode';
+import { fetchList } from '/@/api/supermarketerp/smErpSupplier';
import { rule } from '/@/utils/validate';
-import { BasicTableProps, useTable } from '/@/hooks/table';
-import { fetchList } from '/@/api/supermarket/supermarketAuxiliaryCode';
+import supermarketAuxiliaryCode from './components/supermarketAuxiliaryCode/index.vue';
+import supermarketUnit from './components/supermarketUnit/index.vue';
+
const emit = defineEmits(['refresh']);
const tabPaneEnum = ['基础信息', '包装单位', '辅助条码'];
@@ -268,6 +259,8 @@ const form = reactive({
inventoryUpperLimit: 0,
inventoryLowerLimit: 0,
grossMargin: 0,
+ supermarketUnitEntityList: [],
+ supermarketAuxiliaryCodeEntityList: [],
});
// 定义校验规则
const dataRules = {
@@ -285,24 +278,7 @@ const dataRules = {
const { supermarket_nature, status } = useDict('supermarket_nature', 'status');
const categoryOptions = ref([]); // 商品分类的下拉选项
const brandOptions = ref([]); // 超市品牌的下拉选项
-
-// 辅助条码state
-const auxiliaryCodeState: BasicTableProps = reactive({
- queryForm: {},
- pageList: fetchList,
-});
-const auxiliaryCodeTableRef = ref();
-// 辅助条码多选变量
-const auxiliaryCodeSelectObjs = ref([]) as any;
-const { getDataList: getAuxiliaryCodeList, tableStyle } = useTable(auxiliaryCodeState);
-// 辅助条码多选事件
-const auxiliaryCodeSelectionChangHandle = (objs: { id: string }[]) => {
- auxiliaryCodeSelectObjs.value = objs;
-};
-// 表格行点击事件
-const HandleAuxiliaryCodeRowClick = (row: any) => {
- auxiliaryCodeTableRef.value.toggleRowSelection(row);
-};
+const supplierOptions = ref([]); // 货商的下拉选项
// 初始化表单数据
const getsupermarketSpuData = (id: string) => {
@@ -315,12 +291,28 @@ const getsupermarketSpuData = (id: string) => {
.finally(() => {
loading.value = false;
});
+ getSupermarketUnit(id)
+ .then((res: any) => {
+ form.supermarketUnitEntityList = res.data;
+ })
+ .finally(() => {
+ loading.value = false;
+ });
+ getSupermarketAuxiliaryCode(id)
+ .then((res: any) => {
+ form.supermarketAuxiliaryCodeEntityList = res.data;
+ })
+ .finally(() => {
+ loading.value = false;
+ });
};
// 打开弹窗
const openDialog = async (id: string) => {
visible.value = true;
form.id = '';
+ form.supermarketUnitEntityList = [];
+ form.supermarketAuxiliaryCodeEntityList = [];
// 重置表单数据
nextTick(() => {
@@ -353,18 +345,37 @@ const openDialog = async (id: string) => {
}
}
- // 获取辅助条码列表
- getAuxiliaryCodeList();
+ // 获取货商选项
+ if (supplierOptions.value.length <= 0) {
+ try {
+ const res = await fetchList();
+ supplierOptions.value = res.data.records;
+ } catch (error) {
+ supplierOptions.value = [];
+ }
+ }
};
// 提交
const onSubmit = async () => {
+ console.log(form);
+
const valid = await dataFormRef.value.validate().catch(() => {});
if (!valid) return false;
try {
loading.value = true;
- form.id ? await putObj(form) : await addObj(form);
+ if (form.id) {
+ await putObj(form);
+ } else {
+ form.supermarketUnitEntityList.map((item: any) => {
+ item.id = '';
+ });
+ form.supermarketAuxiliaryCodeEntityList.map((item: any) => {
+ item.id = '';
+ });
+ await addObj(form);
+ }
useMessage().success(form.id ? '修改成功' : '添加成功');
visible.value = false;
emit('refresh');
diff --git a/src/views/supermarket/supermarketSpu/index.vue b/src/views/supermarket/supermarketSpu/index.vue
index 7bc8043..cf54c36 100644
--- a/src/views/supermarket/supermarketSpu/index.vue
+++ b/src/views/supermarket/supermarketSpu/index.vue
@@ -53,12 +53,16 @@
@sort-change="sortChangeHandle"
>
-
+
-
+
+
+ {{ supermarketCategory?.find((item: any) => item.id === scope.row.categoryId).name }}
+
+
@@ -67,22 +71,22 @@
-
-
+
+
-
+
-
+
-
-
-
+
+
+
@@ -105,13 +109,12 @@
From 8e22166f2ea3b96ad8d2d5beda7c2b19eb85bc46 Mon Sep 17 00:00:00 2001
From: ctw <>
Date: Tue, 31 Dec 2024 17:13:29 +0800
Subject: [PATCH 2/4] =?UTF-8?q?=E8=8F=9C=E5=93=81=E5=88=86=E7=B1=BB?=
=?UTF-8?q?=E6=97=B6=E6=AE=B5=E6=94=B9=E4=B8=BA=E5=A4=9A=E9=80=89=E3=80=82?=
=?UTF-8?q?=E5=95=86=E5=93=81=E7=AE=A1=E7=90=86=E6=98=BE=E7=A4=BA=E5=B0=81?=
=?UTF-8?q?=E9=9D=A2=E5=9B=BE=E3=80=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/canteen/canteenCategory/form.vue | 167 +++++++--------
src/views/canteen/canteenCategory/index.vue | 201 +++++++++---------
src/views/supermarket/supermarketSpu/form.vue | 24 +--
.../supermarket/supermarketSpu/index.vue | 11 +-
4 files changed, 204 insertions(+), 199 deletions(-)
diff --git a/src/views/canteen/canteenCategory/form.vue b/src/views/canteen/canteenCategory/form.vue
index ad333f8..b38dc3f 100644
--- a/src/views/canteen/canteenCategory/form.vue
+++ b/src/views/canteen/canteenCategory/form.vue
@@ -1,101 +1,99 @@
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
diff --git a/src/views/canteen/canteenCategory/index.vue b/src/views/canteen/canteenCategory/index.vue
index 3da8798..f00ea30 100644
--- a/src/views/canteen/canteenCategory/index.vue
+++ b/src/views/canteen/canteenCategory/index.vue
@@ -1,135 +1,134 @@
-
-
-
-
-
-
-
-
-
- 查询
-
- 重置
-
-
-
-
-
-
- 新 增
-
-
- 删除
-
-
-
-
-
+
+
+
+
+
+
+
+ 查询
+ 重置
+
+
+
+
+
+
+ 新 增
+
+
+ 删除
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 编辑
- 删除
-
-
-
-
-
+ @sort-change="sortChangeHandle"
+ >
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 编辑
+ 删除
+
+
+
+
+
-
-
-
-
+
+
+
diff --git a/src/views/supermarket/supermarketSpu/form.vue b/src/views/supermarket/supermarketSpu/form.vue
index cd071cc..b445e05 100644
--- a/src/views/supermarket/supermarketSpu/form.vue
+++ b/src/views/supermarket/supermarketSpu/form.vue
@@ -1,8 +1,8 @@
-
-
+
+
@@ -27,7 +27,7 @@
-
+
@@ -183,10 +183,10 @@
-
+
-
+
@@ -213,6 +213,7 @@ import { fetchList } from '/@/api/supermarketerp/smErpSupplier';
import { rule } from '/@/utils/validate';
import supermarketAuxiliaryCode from './components/supermarketAuxiliaryCode/index.vue';
import supermarketUnit from './components/supermarketUnit/index.vue';
+import { TabPaneName } from 'element-plus';
const emit = defineEmits(['refresh']);
@@ -310,6 +311,7 @@ const getsupermarketSpuData = (id: string) => {
// 打开弹窗
const openDialog = async (id: string) => {
visible.value = true;
+ currentTabPaneIndex.value = 0;
form.id = '';
form.supermarketUnitEntityList = [];
form.supermarketAuxiliaryCodeEntityList = [];
@@ -356,6 +358,11 @@ const openDialog = async (id: string) => {
}
};
+// tab栏切换
+const handleTabChange = (name: TabPaneName) => {
+ currentTabPaneIndex.value = tabPaneEnum.findIndex((item) => item === name);
+};
+
// 提交
const onSubmit = async () => {
console.log(form);
@@ -391,10 +398,3 @@ defineExpose({
openDialog,
});
-
-
diff --git a/src/views/supermarket/supermarketSpu/index.vue b/src/views/supermarket/supermarketSpu/index.vue
index cf54c36..e39e767 100644
--- a/src/views/supermarket/supermarketSpu/index.vue
+++ b/src/views/supermarket/supermarketSpu/index.vue
@@ -60,11 +60,15 @@
- {{ supermarketCategory?.find((item: any) => item.id === scope.row.categoryId).name }}
+ {{ supermarketCategory?.find((item: any) => item.id === scope.row.categoryId)?.name }}
-
-
+
+
+
+
+
+
@@ -112,6 +116,7 @@ import { BasicTableProps, useTable } from '/@/hooks/table';
import { fetchList, delObjs, getSupermarketCategory } from '/@/api/supermarket/supermarketSpu';
import { useMessage, useMessageBox } from '/@/hooks/message';
import { useDict } from '/@/hooks/dict';
+const imageBaseUrl = import.meta.env.VITE_IMAGE_BASE_PATH;
// 引入组件
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
From eb091b43fe0d50fda468d4d99f629c8736e6a4a2 Mon Sep 17 00:00:00 2001
From: ctw <>
Date: Tue, 31 Dec 2024 17:14:37 +0800
Subject: [PATCH 3/4] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.env.development | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.env.development b/.env.development
index 4998990..e86dfbb 100644
--- a/.env.development
+++ b/.env.development
@@ -8,7 +8,7 @@ VITE_OPEN = true
ENV = 'development'
# ADMIN 服务地址
-VITE_ADMIN_PROXY_PATH = http://localhost:9999
+VITE_ADMIN_PROXY_PATH = http://123.156.230.15:8089/api/
#VITE_ADMIN_PROXY_PATH = http://192.168.110.156:9999
# 图片访问基础地址
From 49ded5ac77e19f6818ca6102aead1b2401a9f900 Mon Sep 17 00:00:00 2001
From: ctw <>
Date: Tue, 31 Dec 2024 17:30:02 +0800
Subject: [PATCH 4/4] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=9B=BE=E7=89=87?=
=?UTF-8?q?=E9=A2=84=E8=A7=88?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.env.development | 4 ++--
src/views/canteen/canteenSpu/index.vue | 8 ++++----
.../components/supermarketAuxiliaryCode/index.vue | 2 +-
.../supermarketSpu/components/supermarketUnit/index.vue | 2 +-
src/views/supermarket/supermarketSpu/index.vue | 4 ++--
5 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/.env.development b/.env.development
index 9d43790..274b324 100644
--- a/.env.development
+++ b/.env.development
@@ -12,8 +12,8 @@ VITE_ADMIN_PROXY_PATH = http://123.156.230.15:8089/api/
#VITE_ADMIN_PROXY_PATH = http://192.168.110.156:9999
# 图片访问基础地址
-# VITE_IMAGE_BASE_PATH = http://123.156.230.15:8089/api
-VITE_IMAGE_BASE_PATH = http://localhost:9999
+VITE_IMAGE_BASE_PATH = http://123.156.230.15:8089/api
+# VITE_IMAGE_BASE_PATH = http://localhost:9999
# 代码生成服务地址
VITE_GEN_PROXY_PATH = http://192.168.110.156:5003
diff --git a/src/views/canteen/canteenSpu/index.vue b/src/views/canteen/canteenSpu/index.vue
index a17b979..bbba1ca 100644
--- a/src/views/canteen/canteenSpu/index.vue
+++ b/src/views/canteen/canteenSpu/index.vue
@@ -50,10 +50,10 @@
-
+
-
+
@@ -64,9 +64,9 @@
-
+
-
+
diff --git a/src/views/supermarket/supermarketSpu/components/supermarketAuxiliaryCode/index.vue b/src/views/supermarket/supermarketSpu/components/supermarketAuxiliaryCode/index.vue
index 926b5ca..37c81ee 100644
--- a/src/views/supermarket/supermarketSpu/components/supermarketAuxiliaryCode/index.vue
+++ b/src/views/supermarket/supermarketSpu/components/supermarketAuxiliaryCode/index.vue
@@ -74,7 +74,7 @@
-