feat(order): 调整订单状态相关文案及逻辑
- 将“已取消”改为“已关闭”及相关状态文案调整- 更新订单状态判断逻辑,适配新的状态值 - 修改订单搜索组件中的选项文案 - 调整订单列表中操作按钮的提示信息 - 优化订单数据查询条件,增加type过滤项- 更新导出表格的字段展示内容与结构 - 新增资金流水类型“新人注册奖”的显示支持 - 移除无用的时间格式化工具引入声明
This commit is contained in:
@@ -200,12 +200,12 @@ const columns = ref<ColumnItem[]>([
|
|||||||
key: 'isInvoice',
|
key: 'isInvoice',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
title: '订单状态',
|
// title: '订单状态',
|
||||||
dataIndex: 'orderStatus',
|
// dataIndex: 'orderStatus',
|
||||||
key: 'orderStatus',
|
// key: 'orderStatus',
|
||||||
align: 'center',
|
// align: 'center',
|
||||||
},
|
// },
|
||||||
// {
|
// {
|
||||||
// title: '支付时间',
|
// title: '支付时间',
|
||||||
// dataIndex: 'payTime',
|
// dataIndex: 'payTime',
|
||||||
|
|||||||
@@ -53,7 +53,6 @@
|
|||||||
import { message, Modal } from 'ant-design-vue';
|
import { message, Modal } from 'ant-design-vue';
|
||||||
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
||||||
import type { EleProTable } from 'ele-admin-pro';
|
import type { EleProTable } from 'ele-admin-pro';
|
||||||
import { toDateString } from 'ele-admin-pro';
|
|
||||||
import type {
|
import type {
|
||||||
DatasourceFunction,
|
DatasourceFunction,
|
||||||
ColumnItem
|
ColumnItem
|
||||||
@@ -124,7 +123,8 @@
|
|||||||
10: { text: '佣金收入', color: 'success' },
|
10: { text: '佣金收入', color: 'success' },
|
||||||
20: { text: '提现支出', color: 'warning' },
|
20: { text: '提现支出', color: 'warning' },
|
||||||
30: { text: '转账支出', color: 'error' },
|
30: { text: '转账支出', color: 'error' },
|
||||||
40: { text: '转账收入', color: 'processing' }
|
40: { text: '转账收入', color: 'processing' },
|
||||||
|
50: { text: '新人注册奖', color: 'processing' }
|
||||||
};
|
};
|
||||||
const type = typeMap[text] || { text: '未知', color: 'default' };
|
const type = typeMap[text] || { text: '未知', color: 'default' };
|
||||||
return { type: 'tag', props: { color: type.color }, children: type.text };
|
return { type: 'tag', props: { color: type.color }, children: type.text };
|
||||||
@@ -137,7 +137,7 @@
|
|||||||
align: 'center',
|
align: 'center',
|
||||||
customRender: ({ text, record }) => {
|
customRender: ({ text, record }) => {
|
||||||
const amount = parseFloat(text || '0').toFixed(2);
|
const amount = parseFloat(text || '0').toFixed(2);
|
||||||
const isIncome = record.flowType === 10 || record.flowType === 40;
|
const isIncome = record.flowType === 10 || record.flowType === 40 || record.flowType === 50;
|
||||||
return {
|
return {
|
||||||
type: 'span',
|
type: 'span',
|
||||||
props: {
|
props: {
|
||||||
|
|||||||
@@ -66,8 +66,11 @@
|
|||||||
'税费',
|
'税费',
|
||||||
'实发金额',
|
'实发金额',
|
||||||
'一级佣金30%',
|
'一级佣金30%',
|
||||||
|
'一级佣金收益',
|
||||||
'二级佣金10%',
|
'二级佣金10%',
|
||||||
|
'二级佣金收益',
|
||||||
'三级佣金60%',
|
'三级佣金60%',
|
||||||
|
'三级佣金收益',
|
||||||
'月份',
|
'月份',
|
||||||
'创建时间',
|
'创建时间',
|
||||||
'结算时间',
|
'结算时间',
|
||||||
@@ -90,9 +93,12 @@
|
|||||||
`${d.settledPrice}`,
|
`${d.settledPrice}`,
|
||||||
`${d.rate}`,
|
`${d.rate}`,
|
||||||
`${d.payPrice}`,
|
`${d.payPrice}`,
|
||||||
`${d.firstNickname}(${d.firstUserId}),收益:${d.firstMoney}`,
|
`${d.firstNickname}(${d.firstUserId})`,
|
||||||
`${d.secondNickname}(${d.secondUserId}),收益:${d.secondMoney}`,
|
`${d.firstMoney}`,
|
||||||
`${d.thirdNickname}(${d.thirdUserId}),收益:${d.thirdMoney}`,
|
`${d.secondNickname}(${d.secondUserId})`,
|
||||||
|
`${d.secondMoney}`,
|
||||||
|
`${d.thirdNickname}(${d.thirdUserId})`,
|
||||||
|
`${d.thirdMoney}`,
|
||||||
`${d.month}`,
|
`${d.month}`,
|
||||||
`${d.createTime}`,
|
`${d.createTime}`,
|
||||||
`${d.settleTime}`,
|
`${d.settleTime}`,
|
||||||
|
|||||||
@@ -83,7 +83,7 @@
|
|||||||
style="width: 88px;"
|
style="width: 88px;"
|
||||||
@change="onType"
|
@change="onType"
|
||||||
>
|
>
|
||||||
<a-select-option value="">全部</a-select-option>
|
<a-select-option value="">不限</a-select-option>
|
||||||
<a-select-option value="userId">
|
<a-select-option value="userId">
|
||||||
用户ID
|
用户ID
|
||||||
</a-select-option>
|
</a-select-option>
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
<a-tab-pane key="unreceived" tab="待收货"/>
|
<a-tab-pane key="unreceived" tab="待收货"/>
|
||||||
<a-tab-pane key="completed" tab="已完成"/>
|
<a-tab-pane key="completed" tab="已完成"/>
|
||||||
<a-tab-pane key="refunded" tab="退货/售后"/>
|
<a-tab-pane key="refunded" tab="退货/售后"/>
|
||||||
<a-tab-pane key="cancelled" tab="已取消"/>
|
<a-tab-pane key="cancelled" tab="已关闭"/>
|
||||||
</a-tabs>
|
</a-tabs>
|
||||||
<ele-pro-table
|
<ele-pro-table
|
||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
@@ -83,8 +83,8 @@
|
|||||||
<template v-if="column.key === 'orderStatus'">
|
<template v-if="column.key === 'orderStatus'">
|
||||||
<a-tag v-if="record.orderStatus === 0">未完成</a-tag>
|
<a-tag v-if="record.orderStatus === 0">未完成</a-tag>
|
||||||
<a-tag v-if="record.orderStatus === 1" color="green">已完成</a-tag>
|
<a-tag v-if="record.orderStatus === 1" color="green">已完成</a-tag>
|
||||||
<a-tag v-if="record.orderStatus === 2" color="red">已取消</a-tag>
|
<a-tag v-if="record.orderStatus === 2">已关闭</a-tag>
|
||||||
<a-tag v-if="record.orderStatus === 3" color="red">取消中</a-tag>
|
<a-tag v-if="record.orderStatus === 3" color="red">关闭中</a-tag>
|
||||||
<a-tag v-if="record.orderStatus === 4" color="red">退款申请中</a-tag>
|
<a-tag v-if="record.orderStatus === 4" color="red">退款申请中</a-tag>
|
||||||
<a-tag v-if="record.orderStatus === 5" color="red">退款被拒绝</a-tag>
|
<a-tag v-if="record.orderStatus === 5" color="red">退款被拒绝</a-tag>
|
||||||
<a-tag v-if="record.orderStatus === 6" color="orange">退款成功</a-tag>
|
<a-tag v-if="record.orderStatus === 6" color="orange">退款成功</a-tag>
|
||||||
@@ -116,7 +116,7 @@
|
|||||||
@click.stop="handleCancelOrder(record)"
|
@click.stop="handleCancelOrder(record)"
|
||||||
>
|
>
|
||||||
<span class="ele-text-warning">
|
<span class="ele-text-warning">
|
||||||
<CloseOutlined /> 取消
|
<CloseOutlined /> 关闭
|
||||||
</span>
|
</span>
|
||||||
</a>
|
</a>
|
||||||
</template>
|
</template>
|
||||||
@@ -174,7 +174,7 @@
|
|||||||
</a>
|
</a>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<!-- 删除操作 - 已完成、已取消、退款成功的订单可以删除 -->
|
<!-- 删除操作 - 已完成、已关闭、退款成功的订单可以删除 -->
|
||||||
<template v-if="canDeleteOrder(record)">
|
<template v-if="canDeleteOrder(record)">
|
||||||
<a-divider type="vertical"/>
|
<a-divider type="vertical"/>
|
||||||
<a-popconfirm
|
<a-popconfirm
|
||||||
@@ -258,6 +258,7 @@ const datasource: DatasourceFunction = ({
|
|||||||
if (filters) {
|
if (filters) {
|
||||||
where.status = filters.status;
|
where.status = filters.status;
|
||||||
}
|
}
|
||||||
|
where.type = 0;
|
||||||
return pageShopOrder({
|
return pageShopOrder({
|
||||||
...where,
|
...where,
|
||||||
...orders,
|
...orders,
|
||||||
@@ -316,7 +317,7 @@ const columns = ref<ColumnItem[]>([
|
|||||||
title: '订单状态',
|
title: '订单状态',
|
||||||
dataIndex: 'orderStatus',
|
dataIndex: 'orderStatus',
|
||||||
key: 'orderStatus',
|
key: 'orderStatus',
|
||||||
align: 'center',
|
align: 'center'
|
||||||
},
|
},
|
||||||
// {
|
// {
|
||||||
// title: '备注',
|
// title: '备注',
|
||||||
@@ -395,7 +396,7 @@ const onTabs = () => {
|
|||||||
filterParams.statusFilter = 5;
|
filterParams.statusFilter = 5;
|
||||||
break;
|
break;
|
||||||
case 'cancelled':
|
case 'cancelled':
|
||||||
// 已取消:order_status = 2
|
// 已关闭:order_status = 2
|
||||||
filterParams.statusFilter = 8;
|
filterParams.statusFilter = 8;
|
||||||
break;
|
break;
|
||||||
case 'refunded':
|
case 'refunded':
|
||||||
@@ -452,7 +453,7 @@ const query = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* 辅助判断函数 */
|
/* 辅助判断函数 */
|
||||||
// 判断是否为取消状态
|
// 判断是否为关闭状态
|
||||||
const isCancelledStatus = (orderStatus?: number) => {
|
const isCancelledStatus = (orderStatus?: number) => {
|
||||||
return [2, 3].includes(orderStatus || 0);
|
return [2, 3].includes(orderStatus || 0);
|
||||||
};
|
};
|
||||||
@@ -464,7 +465,7 @@ const isRefundStatus = (orderStatus?: number) => {
|
|||||||
|
|
||||||
// 判断是否可以删除订单
|
// 判断是否可以删除订单
|
||||||
const canDeleteOrder = (order: ShopOrder) => {
|
const canDeleteOrder = (order: ShopOrder) => {
|
||||||
// 已完成、已取消、退款成功的订单可以删除 (原来是[1, 2, 6],后面改成只有取消的订单能删除)
|
// 已完成、已关闭、退款成功的订单可以删除 (原来是[1, 2, 6],后面改成只有关闭的订单能删除)
|
||||||
return [2].includes(order.orderStatus || 0);
|
return [2].includes(order.orderStatus || 0);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -475,21 +476,21 @@ const handleEditOrder = (record: ShopOrder) => {
|
|||||||
// TODO: 实现订单修改功能
|
// TODO: 实现订单修改功能
|
||||||
};
|
};
|
||||||
|
|
||||||
// 取消订单
|
// 关闭订单
|
||||||
const handleCancelOrder = (record: ShopOrder) => {
|
const handleCancelOrder = (record: ShopOrder) => {
|
||||||
Modal.confirm({
|
Modal.confirm({
|
||||||
title: '确认取消订单',
|
title: '确认关闭订单',
|
||||||
content: '确定要取消此订单吗?取消后无法恢复。',
|
content: '确定要关闭此订单吗?关闭后无法恢复。',
|
||||||
onOk: async () => {
|
onOk: async () => {
|
||||||
try {
|
try {
|
||||||
await updateShopOrder({
|
await updateShopOrder({
|
||||||
...record,
|
...record,
|
||||||
orderStatus: 2 // 已取消
|
orderStatus: 2 // 已关闭
|
||||||
});
|
});
|
||||||
message.success('订单已取消');
|
message.success('订单已关闭');
|
||||||
reload();
|
reload();
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
message.error(error.message || '取消订单失败');
|
message.error(error.message || '关闭订单失败');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user