From 51c6f3fa2f6170933ad0dfad3f251cf45f425984 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=B5=B5=E5=BF=A0=E6=9E=97?= <170083662@qq.com>
Date: Wed, 28 Jan 2026 17:01:08 +0800
Subject: [PATCH] =?UTF-8?q?feat(cms):=20=E6=96=B0=E5=A2=9E=E7=BD=91?=
=?UTF-8?q?=E7=AB=99=E8=AE=A2=E5=8D=95=E6=A8=A1=E5=9D=97=E5=B9=B6=E5=AE=8C?=
=?UTF-8?q?=E5=96=84=E7=9B=B8=E5=85=B3=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 在开发环境配置文件中启用API URL
- 新增网站订单编辑组件,支持添加和修改订单功能
- 调整发货模态框宽度为50%
- 将页面标题从"网宿软件"更新为"麦芽知电子商务"
- 重构网站订单模型定义,增加多个订单相关字段
- 更新网站订单API接口,移除模块前缀
- 在商品模型中新增分销佣金相关字段
- 实现完整的网站订单管理页面,包含表格展示和操作功能
---
.env.development | 2 +-
index.html | 2 +-
src/api/cms/cmsOrder/index.ts | 29 +-
src/api/cms/cmsOrder/model/index.ts | 155 +++-
src/api/shop/shopGoods/model/index.ts | 13 +
.../cms/cmsOrder/components/cmsOrderEdit.vue | 757 ++++++++++++++++++
src/views/cms/cmsOrder/components/search.vue | 42 +
src/views/cms/cmsOrder/index.vue | 662 +++++++++++++++
src/views/cms/dashboard/index.vue | 3 +-
src/views/shop/dashboard/index.vue | 3 +-
src/views/shop/shopDealerOrder/index.vue | 8 +-
.../shopGoods/components/shopGoodsEdit.vue | 145 +++-
.../shopOrder/components/deliveryModal.vue | 2 +-
src/views/shop/shopOrder/index.vue | 10 +-
14 files changed, 1773 insertions(+), 60 deletions(-)
create mode 100644 src/views/cms/cmsOrder/components/cmsOrderEdit.vue
create mode 100644 src/views/cms/cmsOrder/components/search.vue
create mode 100644 src/views/cms/cmsOrder/index.vue
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