feat(cms): 新增网站订单模块并完善相关功能

- 在开发环境配置文件中启用API URL
- 新增网站订单编辑组件,支持添加和修改订单功能
- 调整发货模态框宽度为50%
- 将页面标题从"网宿软件"更新为"麦芽知电子商务"
- 重构网站订单模型定义,增加多个订单相关字段
- 更新网站订单API接口,移除模块前缀
- 在商品模型中新增分销佣金相关字段
- 实现完整的网站订单管理页面,包含表格展示和操作功能
This commit is contained in:
2026-01-28 17:01:08 +08:00
parent f3a59f9755
commit 51c6f3fa2f
14 changed files with 1773 additions and 60 deletions

View File

@@ -143,8 +143,7 @@
<a-descriptions-item label="技术支持">
<span
class="cursor-pointer"
@click="openNew(`https://websoft.top`)"
>网宿软件</span
>麦芽知电子商务</span
>
</a-descriptions-item>
</a-descriptions>

View File

@@ -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'

View File

@@ -439,7 +439,7 @@
:un-checked-value="0"
/>
</a-form-item>
<a-form-item label="是否开启分红角色功能" v-if="!merchantId">
<a-form-item label="是否开启分红功能" v-if="!merchantId">
<a-switch
size="small"
v-model:checked="form.commissionRole"
@@ -459,6 +459,115 @@
</a-input>
</a-space>
</a-form-item>
<a-divider orientation="left">分销设置</a-divider>
<a-form-item label="是否开启分销" name="isOpenCommission">
<a-switch
size="small"
v-model:checked="form.isOpenCommission"
:checked-value="1"
:un-checked-value="0"
/>
</a-form-item>
<template v-if="form.isOpenCommission === 1">
<a-form-item label="分佣类型" name="commissionType">
<a-radio-group v-model:value="form.commissionType">
<a-radio :value="10">固定金额</a-radio>
<a-radio :value="20">百分比(0.1代表10%)</a-radio>
</a-radio-group>
</a-form-item>
<a-form-item
:label="form.commissionType === 20 ? '一级佣金(%)' : '一级佣金(元)'"
name="firstMoney"
>
<a-input-number
v-model:value="form.firstMoney"
:min="0"
:max="form.commissionType === 20 ? 1 : undefined"
:precision="2"
style="width: 250px"
:placeholder="
form.commissionType === 20
? '请输入一级佣金百分比'
: '请输入一级佣金金额'
"
>
<template #addonAfter>{{
form.commissionType === 20 ? '%' : '元'
}}</template>
</a-input-number>
</a-form-item>
<a-form-item
:label="form.commissionType === 20 ? '二级佣金(%)' : '二级佣金(元)'"
name="secondMoney"
>
<a-input-number
v-model:value="form.secondMoney"
:min="0"
:max="form.commissionType === 20 ? 1 : undefined"
:precision="2"
style="width: 250px"
:placeholder="
form.commissionType === 20
? '请输入二级佣金百分比'
: '请输入二级佣金金额'
"
>
<template #addonAfter>{{
form.commissionType === 20 ? '%' : '元'
}}</template>
</a-input-number>
</a-form-item>
<!-- <a-form-item-->
<!-- :label="form.commissionType === 20 ? '三级佣金(%)' : '三级佣金(元)'"-->
<!-- name="thirdMoney"-->
<!-- >-->
<!-- <a-input-number-->
<!-- v-model:value="form.thirdMoney"-->
<!-- :min="0"-->
<!-- :max="form.commissionType === 20 ? 100 : undefined"-->
<!-- :precision="2"-->
<!-- style="width: 250px"-->
<!-- :placeholder="-->
<!-- form.commissionType === 20-->
<!-- ? '请输入三级佣金百分比'-->
<!-- : '请输入三级佣金金额'-->
<!-- "-->
<!-- >-->
<!-- <template #addonAfter>{{-->
<!-- form.commissionType === 20 ? '%' : '元'-->
<!-- }}</template>-->
<!-- </a-input-number>-->
<!-- </a-form-item>-->
<a-form-item label="一级分红" name="firstDividend">
<a-input-number
v-model:value="form.firstDividend"
:min="0"
:max="form.commissionType === 20 ? 1 : undefined"
:precision="2"
style="width: 250px"
placeholder="请输入一级分红"
>
<template #addonAfter>{{
form.commissionType === 20 ? '%' : '元'
}}</template>
</a-input-number>
</a-form-item>
<a-form-item label="二级分红" name="secondDividend">
<a-input-number
v-model:value="form.secondDividend"
:min="0"
:max="form.commissionType === 20 ? 1 : undefined"
:precision="2"
style="width: 250px"
placeholder="请输入二级分红"
>
<template #addonAfter>{{
form.commissionType === 20 ? '%' : '元'
}}</template>
</a-input-number>
</a-form-item>
</template>
<template v-if="form.type === 1 || merchantId">
<a-form-item label="可用日期">
<a-select v-model:value="canUseDate" mode="multiple">
@@ -988,6 +1097,14 @@ const form = reactive<ShopGoods>({
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(),

View File

@@ -3,7 +3,7 @@
<a-modal
:visible="visible"
title="订单发送货"
width="600px"
width="50%"
:confirm-loading="loading"
@update:visible="updateVisible"
@ok="handleSubmit"

View File

@@ -324,14 +324,12 @@
title: '订单编号',
dataIndex: 'orderNo',
key: 'orderNo',
align: 'center',
width: 200
align: 'center'
},
{
title: '商品信息',
dataIndex: 'orderGoods',
key: 'orderGoods',
width: 360
key: 'orderGoods'
},
{
title: '实付金额',
@@ -390,15 +388,13 @@
dataIndex: 'createTime',
key: 'createTime',
align: 'center',
width: 180,
sorter: true,
ellipsis: true,
customRender: ({ text }) => toDateString(text)
},
{
title: '操作',
key: 'action',
width: 280,
width: 220,
fixed: 'right',
align: 'center',
hideInSetting: true