diff --git a/.env.development b/.env.development
index e0df6a1..a4aba57 100644
--- a/.env.development
+++ b/.env.development
@@ -9,11 +9,13 @@ 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://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://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 8401510..0bde02a 100644
--- a/src/views/canteen/canteenOnlineCategory/form.vue
+++ b/src/views/canteen/canteenOnlineCategory/form.vue
@@ -1,102 +1,123 @@
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
- 开启状态
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
\ No newline at end of file
+
diff --git a/src/views/canteen/canteenOnlineCategory/index.vue b/src/views/canteen/canteenOnlineCategory/index.vue
index a2d5e63..9bfe42e 100644
--- a/src/views/canteen/canteenOnlineCategory/index.vue
+++ b/src/views/canteen/canteenOnlineCategory/index.vue
@@ -29,18 +29,17 @@
@queryTable="getDataList">
-
-
-
-
+
+
{
useMessage().error(err.msg);
}
};
-
\ No newline at end of file
+
diff --git a/src/views/canteen/canteenOnlineSpu/form.vue b/src/views/canteen/canteenOnlineSpu/form.vue
index 29a02ad..1ca7793 100644
--- a/src/views/canteen/canteenOnlineSpu/form.vue
+++ b/src/views/canteen/canteenOnlineSpu/form.vue
@@ -1,188 +1,163 @@
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+ 0
+
+
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
- 0
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ item.label }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+ {{ item.label }}
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
\ No newline at end of file
+
diff --git a/src/views/canteen/canteenOnlineSpu/index.vue b/src/views/canteen/canteenOnlineSpu/index.vue
index b97dc34..39e9bfa 100644
--- a/src/views/canteen/canteenOnlineSpu/index.vue
+++ b/src/views/canteen/canteenOnlineSpu/index.vue
@@ -34,35 +34,25 @@
@queryTable="getDataList">
-
-
-
-
+
-
-
+
-
-
+
+
-
-
-
-
-
@@ -152,4 +142,4 @@ const handleDelete = async (ids: string[]) => {
useMessage().error(err.msg);
}
};
-
\ No newline at end of file
+
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;
diff --git a/src/views/supermarket/supermarketSpu/components/supermarketUnit/form.vue b/src/views/supermarket/supermarketSpu/components/supermarketUnit/form.vue
index d4c8ee0..07acd9d 100644
--- a/src/views/supermarket/supermarketSpu/components/supermarketUnit/form.vue
+++ b/src/views/supermarket/supermarketSpu/components/supermarketUnit/form.vue
@@ -35,11 +35,29 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -71,6 +89,10 @@ const form = reactive({
unit: '',
status: '',
packageNum: 0,
+ purchasePrice: '',
+ retailPrice: '',
+ promotionPrice: '',
+ costPrice: '',
});
// 定义校验规则
@@ -80,7 +102,8 @@ const dataRules = ref({
unit: [{ required: true, message: '单位不能为空', trigger: 'blur' }],
status: [{ required: true, message: '状态不能为空', trigger: 'blur' }],
packageNum: [{ required: true, message: '内装数量不能为空', trigger: 'blur' }],
- spuId: [{ required: true, message: 'spuId不能为空', trigger: 'blur' }],
+ purchasePrice: [{ required: true, message: '进价不能为空', trigger: 'blur' }],
+ retailPrice: [{ required: true, message: '零售价不能为空', trigger: 'blur' }],
});
// 打开弹窗
diff --git a/src/views/supermarket/supermarketSpu/components/supermarketUnit/index.vue b/src/views/supermarket/supermarketSpu/components/supermarketUnit/index.vue
index fbf3a8f..7b4ad08 100644
--- a/src/views/supermarket/supermarketSpu/components/supermarketUnit/index.vue
+++ b/src/views/supermarket/supermarketSpu/components/supermarketUnit/index.vue
@@ -67,8 +67,8 @@
-
-
+
+
diff --git a/src/views/supermarket/supermarketSpu/form.vue b/src/views/supermarket/supermarketSpu/form.vue
index a0d69d1..48d9007 100644
--- a/src/views/supermarket/supermarketSpu/form.vue
+++ b/src/views/supermarket/supermarketSpu/form.vue
@@ -110,40 +110,40 @@
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -156,11 +156,11 @@
-
-
-
-
-
+
+
+
+
+
@@ -207,9 +207,7 @@
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 { getSupplierTypeOptions } from '/@/api/supermarketerp/smErpSupplier';
import { rule } from '/@/utils/validate';
import supermarketAuxiliaryCode from './components/supermarketAuxiliaryCode/index.vue';
import supermarketUnit from './components/supermarketUnit/index.vue';
@@ -294,20 +292,6 @@ 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;
- });
};
// 打开弹窗
@@ -315,8 +299,6 @@ const openDialog = async (id: string) => {
visible.value = true;
currentTabPaneIndex.value = 0;
form.id = '';
- form.supermarketUnitEntityList = [];
- form.supermarketAuxiliaryCodeEntityList = [];
// 重置表单数据
dataFormRef.value?.resetFields();
@@ -350,8 +332,8 @@ const openDialog = async (id: string) => {
// 获取货商选项
if (supplierOptions.value.length <= 0) {
try {
- const res = await fetchList();
- supplierOptions.value = res.data.records;
+ const res = await getSupplierTypeOptions();
+ supplierOptions.value = res.data;
} catch (error) {
supplierOptions.value = [];
}
@@ -368,6 +350,7 @@ const onSubmit = async () => {
console.log(form);
const valid = await dataFormRef.value.validate().catch(() => {});
+ if (!valid) useMessage().warning('基础信息必填项未填写完整');
if (!form.supermarketUnitEntityList || form.supermarketUnitEntityList.length <= 0) useMessage().warning('请添加包装单位');
if (!form.supermarketAuxiliaryCodeEntityList || form.supermarketAuxiliaryCodeEntityList.length <= 0) useMessage().warning('请添加辅助条码');
if (!valid) return false;
diff --git a/vite.config.ts b/vite.config.ts
index 759a73a..8fbe8e0 100644
--- a/vite.config.ts
+++ b/vite.config.ts
@@ -9,8 +9,8 @@ import viteCompression from 'vite-plugin-compression';
// @ts-ignore
import { svgBuilder } from '/@/components/IconSelector/index';
-import dns from 'node:dns'
-dns.setDefaultResultOrder('verbatim')
+import dns from 'node:dns';
+dns.setDefaultResultOrder('verbatim');
const pathResolve = (dir: string) => {
return resolve(__dirname, '.', dir);
@@ -24,7 +24,7 @@ const alias: Record = {
const viteConfig = defineConfig((mode: ConfigEnv) => {
const env = loadEnv(mode.mode, process.cwd());
// 判断是否开发环境
- const isDev = env.ENV === 'development'
+ const isDev = env.ENV === 'development';
return {
plugins: [
vue(), // Vue 插件
@@ -77,18 +77,18 @@ const viteConfig = defineConfig((mode: ConfigEnv) => {
},
},
build: {
- outDir: 'dist', // 打包输出目录
+ outDir: 'dist', // 打包输出目录//
chunkSizeWarningLimit: 1500, // 代码分包阈值
// 开发使用 esbuild 更快,生产环境打包使用 terser 可以删除更多注释
- minify: isDev ? 'esbuild' : 'terser',
+ minify: isDev ? 'esbuild' : 'terser',
terserOptions: {
compress: {
drop_console: true, // 删除 console
drop_debugger: true, // 删除 debugger
},
format: {
- comments: false // 删除所有注释
- }
+ comments: false, // 删除所有注释
+ },
},
rollupOptions: {
output: {