fix(store): 修复门店订单管理页操作按钮与标签筛选问题

- 调整已关闭标签参数,移除待发货状态,避免混入错误订单
- 修改金额按钮仅在未付款状态下显示,确认收款后隐藏
- 确认完成按钮改为仅在已付款状态下显示,避免过早显示
- 优化订单操作按钮显示逻辑,确保按钮状态与订单支付状态一致
This commit is contained in:
2026-07-17 01:26:31 +08:00
parent 1077b16f58
commit 48f8c4a343
2 changed files with 25 additions and 6 deletions

View File

@@ -21,8 +21,8 @@ const TABS: { key: TabKey; label: string; params: Partial<ShopOrderParam>[] }[]
{key: 'all', label: '全部', params: [{}]},
// 已完成statusFilter=5与后台管理一致
{key: 'completed', label: '已完成', params: [{statusFilter: 5}]},
// 待处理:合并 statusFilter=1待发货 statusFilter=8(已关闭)
{key: 'pending', label: '已关闭', params: [{statusFilter: 1}, {statusFilter: 8}]},
// 待处理:已关闭订单 statusFilter=8
{key: 'pending', label: '已关闭', params: [{statusFilter: 8}]},
]
// ─── 操作类型 ─────────────────────────────────────────────────────
@@ -123,14 +123,16 @@ function isOrderActionable(order: ShopOrder): boolean {
function getOrderActions(order: ShopOrder): { label: string; type: OpType }[] {
if (!isOrderActionable(order)) return []
const actions: { label: string; type: OpType }[] = []
// 修改金额(门店权限
actions.push({label: '修改金额', type: 'editPrice'})
// 修改金额:仅在确认收款前显示(未付款时才可改价
if (!order.payStatus) {
actions.push({label: '修改金额', type: 'editPrice'})
}
// 线下付款·待确认收款:显示"确认收款"按钮
if (!order.payStatus && order.payType === 9 && order.orderStatus === 0) {
actions.push({label: '确认收款', type: 'confirmPay'})
}
// 确认完成
if (order.orderStatus !== 1 && order.orderStatus !== 2) {
// 确认完成:仅在确认收款后显示(已付款才能确认完成)
if (order.payStatus) {
actions.push({label: '确认完成', type: 'complete'})
}
return actions