diff --git a/.env.development b/.env.development
index e7990eb..274b324 100644
--- a/.env.development
+++ b/.env.development
@@ -8,12 +8,12 @@ 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
# 图片访问基础地址
-# 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/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/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/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/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..37c81ee
--- /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..442d64d
--- /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..b445e05 100644
--- a/src/views/supermarket/supermarketSpu/form.vue
+++ b/src/views/supermarket/supermarketSpu/form.vue
@@ -1,8 +1,8 @@
-
+
-
-
+
+
@@ -27,7 +27,7 @@
-
+
@@ -75,13 +75,13 @@
-
+
@@ -110,7 +110,7 @@
- ???
+
@@ -183,24 +183,11 @@
- aaaa
-
-
-
-
-
-
-
+
+
+
+
+
@@ -220,9 +207,14 @@
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';
+import { TabPaneName } from 'element-plus';
+
const emit = defineEmits(['refresh']);
const tabPaneEnum = ['基础信息', '包装单位', '辅助条码'];
@@ -268,6 +260,8 @@ const form = reactive({
inventoryUpperLimit: 0,
inventoryLowerLimit: 0,
grossMargin: 0,
+ supermarketUnitEntityList: [],
+ supermarketAuxiliaryCodeEntityList: [],
});
// 定义校验规则
const dataRules = {
@@ -285,24 +279,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 +292,29 @@ 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;
+ currentTabPaneIndex.value = 0;
form.id = '';
+ form.supermarketUnitEntityList = [];
+ form.supermarketAuxiliaryCodeEntityList = [];
// 重置表单数据
nextTick(() => {
@@ -353,18 +347,42 @@ 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 = [];
+ }
+ }
+};
+
+// tab栏切换
+const handleTabChange = (name: TabPaneName) => {
+ currentTabPaneIndex.value = tabPaneEnum.findIndex((item) => item === name);
};
// 提交
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');
@@ -380,10 +398,3 @@ defineExpose({
openDialog,
});
-
-
diff --git a/src/views/supermarket/supermarketSpu/index.vue b/src/views/supermarket/supermarketSpu/index.vue
index 7bc8043..17ba7b1 100644
--- a/src/views/supermarket/supermarketSpu/index.vue
+++ b/src/views/supermarket/supermarketSpu/index.vue
@@ -53,36 +53,44 @@
@sort-change="sortChangeHandle"
>
-
+
-
-
-
+
+
+ {{ supermarketCategory?.find((item: any) => item.id === scope.row.categoryId)?.name }}
+
+
+
+
+
+
+
+
-
-
+
+
-
+
-
+
-
-
-
+
+
+
@@ -105,13 +113,13 @@