diff --git a/.env.development b/.env.development
index b8ccd8b..fbcc74b 100644
--- a/.env.development
+++ b/.env.development
@@ -1,5 +1,5 @@
VITE_APP_NAME=后台管理(开发环境)
-#VITE_API_URL=http://127.0.0.1:9200/api
+VITE_API_URL=http://127.0.0.1:9200/api
#VITE_SERVER_API_URL=http://127.0.0.1:8000/api
diff --git a/index.html b/index.html
index e45f55e..61c5811 100644
--- a/index.html
+++ b/index.html
@@ -4,7 +4,7 @@
-
网宿软件
+ 麦芽知电子商务
diff --git a/src/views/cms/dashboard/index.vue b/src/views/cms/dashboard/index.vue
index 49aa343..ba6d0d9 100644
--- a/src/views/cms/dashboard/index.vue
+++ b/src/views/cms/dashboard/index.vue
@@ -139,8 +139,7 @@
网宿软件麦芽知电子商务
diff --git a/src/views/shop/dashboard/index.vue b/src/views/shop/dashboard/index.vue
index 57c7718..0b8e886 100644
--- a/src/views/shop/dashboard/index.vue
+++ b/src/views/shop/dashboard/index.vue
@@ -143,8 +143,7 @@
网宿软件麦芽知电子商务
diff --git a/src/views/shop/shopDealerOrder/index.vue b/src/views/shop/shopDealerOrder/index.vue
index ac0f157..c44b4da 100644
--- a/src/views/shop/shopDealerOrder/index.vue
+++ b/src/views/shop/shopDealerOrder/index.vue
@@ -241,25 +241,25 @@
align: 'center'
},
{
- title: '一级佣金(10%)',
+ title: '一级佣金',
dataIndex: 'firstNickname',
key: 'firstNickname',
align: 'center'
},
{
- title: '二级佣金(5%)',
+ title: '二级佣金',
dataIndex: 'secondNickname',
key: 'secondNickname',
align: 'center'
},
{
- title: '一级门店分红(2%/3%)',
+ title: '一级门店分红',
dataIndex: 'firstDividendUserName',
key: 'firstDividendUserName',
align: 'center'
},
{
- title: '二级门店分红(1%)',
+ title: '二级门店分红',
dataIndex: 'secondDividendUserName',
key: 'secondDividendUserName',
align: 'center'
diff --git a/src/views/shop/shopGoods/components/shopGoodsEdit.vue b/src/views/shop/shopGoods/components/shopGoodsEdit.vue
index 19e9b9c..e54ec4a 100644
--- a/src/views/shop/shopGoods/components/shopGoodsEdit.vue
+++ b/src/views/shop/shopGoods/components/shopGoodsEdit.vue
@@ -439,7 +439,7 @@
:un-checked-value="0"
/>
-
+
+
+ 分销设置
+
+
+
+
+
+
+ 固定金额
+ 百分比(0.1代表10%)
+
+
+
+
+ {{
+ form.commissionType === 20 ? '%' : '元'
+ }}
+
+
+
+
+ {{
+ form.commissionType === 20 ? '%' : '元'
+ }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{
+ form.commissionType === 20 ? '%' : '元'
+ }}
+
+
+
+
+ {{
+ form.commissionType === 20 ? '%' : '元'
+ }}
+
+
+
@@ -988,6 +1097,14 @@ const form = reactive({
categoryName: undefined,
specs: 0,
commissionRole: 0,
+ // 分销佣金(新字段,后端保持 snake_case)
+ isOpenCommission: 0,
+ commissionType: 10,
+ firstMoney: 0,
+ secondMoney: 0,
+ thirdMoney: 0,
+ firstDividend: 0,
+ secondDividend: 0,
position: undefined,
price: undefined,
originPrice: undefined,
@@ -1724,6 +1841,29 @@ const save = () => {
if (ensureTag.value.length) form.ensureTag = ensureTag.value.join();
if (canUseDate.value.length) form.canUseDate = canUseDate.value.join();
+ // 分销关闭时,避免把历史值一并保存到后端
+ if (form.isOpenCommission !== 1) {
+ form.commissionType = 10;
+ form.firstMoney = 0;
+ form.secondMoney = 0;
+ form.thirdMoney = 0;
+ form.firstDividend = 0;
+ form.secondDividend = 0;
+ }
+ if (form.isOpenCommission === 1 && form.commissionType === 20) {
+ // 百分比:约定 0-100(后端如用万分比/小数可再调整)
+ const invalidPercent =
+ (form.firstMoney ?? 0) > 100 ||
+ (form.secondMoney ?? 0) > 100 ||
+ (form.thirdMoney ?? 0) > 100 ||
+ (form.firstMoney ?? 0) < 0 ||
+ (form.secondMoney ?? 0) < 0 ||
+ (form.thirdMoney ?? 0) < 0;
+ if (invalidPercent) {
+ return message.error('佣金百分比需在 0~100 之间');
+ }
+ }
+
// if (form.dealerGift && !form.dealerGiftNum) return message.error('请输入经销商赠品数量');
if (form.commissionRole === 1) {
for (let i = 0; i < form.goodsRoleCommission.length; i++) {
@@ -1875,6 +2015,9 @@ watch(
ensureTagItem.value = '';
if (props.data) {
assignObject(form, props.data);
+ if (form.commissionType === undefined || form.commissionType === null) {
+ form.commissionType = 10;
+ }
if (props.data.image) {
images.value.push({
uid: uuid(),
diff --git a/src/views/shop/shopOrder/components/deliveryModal.vue b/src/views/shop/shopOrder/components/deliveryModal.vue
index 43fc9ee..e918e9e 100644
--- a/src/views/shop/shopOrder/components/deliveryModal.vue
+++ b/src/views/shop/shopOrder/components/deliveryModal.vue
@@ -3,7 +3,7 @@
toDateString(text)
},
{
title: '操作',
key: 'action',
- width: 280,
+ width: 220,
fixed: 'right',
align: 'center',
hideInSetting: true