diff --git a/.env.development b/.env.development
index 4bc442c..a4aba57 100644
--- a/.env.development
+++ b/.env.development
@@ -8,12 +8,14 @@ VITE_OPEN = true
ENV = 'development'
# ADMIN 服务地址
-#VITE_ADMIN_PROXY_PATH = http://123.156.230.15:8089/api/
- VITE_ADMIN_PROXY_PATH = http://localhost:9999
+# VITE_ADMIN_PROXY_PATH = http://123.156.230.15:8089/api/
+VITE_ADMIN_PROXY_PATH = http://pjcloud.center.takin.cc/
+# VITE_ADMIN_PROXY_PATH = http://localhost: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://pjcloud.center.takin.cc
+# VITE_IMAGE_BASE_PATH = http://localhost:9999
# 代码生成服务地址
VITE_GEN_PROXY_PATH = http://192.168.110.156:5003
diff --git a/src/views/canteen/canteenOnlineCategory/form.vue b/src/views/canteen/canteenOnlineCategory/form.vue
index d9a8266..0bde02a 100644
--- a/src/views/canteen/canteenOnlineCategory/form.vue
+++ b/src/views/canteen/canteenOnlineCategory/form.vue
@@ -1,102 +1,123 @@
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
diff --git a/src/views/canteen/canteenOnlineSpu/form.vue b/src/views/canteen/canteenOnlineSpu/form.vue
index f185a80..1ca7793 100644
--- a/src/views/canteen/canteenOnlineSpu/form.vue
+++ b/src/views/canteen/canteenOnlineSpu/form.vue
@@ -1,154 +1,163 @@
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+ 0
+
+
+
-
-
-
- 0
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
+ {{ item.label }}
+
+
+
-
-
-
- {{ item.label }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
diff --git a/src/views/canteen/canteenSpu/form.vue b/src/views/canteen/canteenSpu/form.vue
index 55c67db..6e9cc50 100644
--- a/src/views/canteen/canteenSpu/form.vue
+++ b/src/views/canteen/canteenSpu/form.vue
@@ -2,12 +2,19 @@
+
+
+
+
+
+
+
-
+
@@ -21,17 +28,17 @@
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
@@ -65,23 +72,23 @@
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
@@ -99,6 +106,7 @@ import { useMessage } from '/@/hooks/message';
import { getObj, addObj, putObj } from '/@/api/canteen/canteenSpu';
import { getAllSimple } from '/@/api/canteen/canteenCategory';
import { rule } from '/@/utils/validate';
+import { selectMerchantList } from '/@/api/canteen/merchantInfo';
const emit = defineEmits(['refresh']);
// 定义变量内容
@@ -107,10 +115,12 @@ const visible = ref(false);
const loading = ref(false);
// 定义字典
const { spu_status } = useDict('spu_status');
+const merchantInfo = ref([]); // 商户信息
// 提交表单数据
const form = reactive({
id: '',
+ merchantId: '',
name: '',
introduction: '',
description: '',
@@ -127,12 +137,12 @@ const form = reactive({
salesCount: '',
virtualSalesCount: '',
browseCount: '',
- merchantId: '',
deptId: '',
});
// 定义校验规则
const dataRules = ref({
+ merchantId: [{ required: true, message: '商户不能为空', trigger: 'blur' }],
name: [{ required: true, message: '商品名称不能为空', trigger: 'blur' }],
picUrl: [{ required: true, message: '商品封面图不能为空', trigger: 'blur' }],
sort: [{ validator: rule.number, trigger: 'blur' }],
@@ -146,14 +156,23 @@ const dataRules = ref({
});
// 打开弹窗
-const openDialog = (id: string) => {
+const openDialog = async (id: string) => {
visible.value = true;
form.id = '';
// 重置表单数据
- nextTick(() => {
- dataFormRef.value?.resetFields();
- });
+ dataFormRef.value?.resetFields();
+
+ if (merchantInfo.value.length <= 0) {
+ try {
+ // 获取商户下拉框选项
+ const res = await selectMerchantList('1');
+ merchantInfo.value = res.data;
+ } catch (error) {
+ merchantInfo.value = [];
+ loading.value = false;
+ }
+ }
// 获取canteenSpu信息
if (id) {
@@ -194,7 +213,7 @@ const getcanteenSpuData = (id: string) => {
loading.value = false;
});
};
-const categoryList = ref([]); // 商品分类树
+const categoryList = ref([]); // 商品分类树
onMounted(async () => {
const data = await getAllSimple();
categoryList.value = data.data;