fix(orders): 优化线下付款订单状态和发货操作逻辑
- 调整确认收款操作描述为“确认已收到线下付款” - 增加线下付款已发货待收款状态显示处理 - 支持线下付款订单先发货后确认收款的发货操作 - 修改发货按钮显示条件,提升线下付款订单兼容性
This commit is contained in:
@@ -38,7 +38,7 @@ const OP_LABEL: Record<OpType, string> = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const OP_DESC: Record<OpType, string> = {
|
const OP_DESC: Record<OpType, string> = {
|
||||||
confirmPay: '确认已收到线下付款,订单将进入待发货状态',
|
confirmPay: '确认已收到线下付款',
|
||||||
complete: '同时变更支付状态为已付款、收货状态为已收货、订单状态为已完成',
|
complete: '同时变更支付状态为已付款、收货状态为已收货、订单状态为已完成',
|
||||||
editPrice: '修改订单实付金额',
|
editPrice: '修改订单实付金额',
|
||||||
ship: '选择发货人员并生成发货单,订单将进入已发货状态',
|
ship: '选择发货人员并生成发货单,订单将进入已发货状态',
|
||||||
@@ -101,6 +101,8 @@ function getStatusText(order: ShopOrder): string {
|
|||||||
if (order.orderStatus === 1) return '已完成'
|
if (order.orderStatus === 1) return '已完成'
|
||||||
if (order.orderStatus === 2) return '已关闭'
|
if (order.orderStatus === 2) return '已关闭'
|
||||||
if (order.payStatus === false || order.payStatus === null) {
|
if (order.payStatus === false || order.payStatus === null) {
|
||||||
|
// 线下付款·已发货待收款(先发货后结款)
|
||||||
|
if (order.payType === 9 && order.deliveryStatus === 20) return '已发货待收款'
|
||||||
// 线下付款待确认收款
|
// 线下付款待确认收款
|
||||||
if (order.payType === 9) return '待确认收款'
|
if (order.payType === 9) return '待确认收款'
|
||||||
return '待收款'
|
return '待收款'
|
||||||
@@ -135,10 +137,15 @@ function getOrderActions(order: ShopOrder): { label: string; type: OpType }[] {
|
|||||||
if (!order.payStatus && order.payType === 9 && order.orderStatus === 0) {
|
if (!order.payStatus && order.payType === 9 && order.orderStatus === 0) {
|
||||||
actions.push({label: '确认收款', type: 'confirmPay'})
|
actions.push({label: '确认收款', type: 'confirmPay'})
|
||||||
}
|
}
|
||||||
// 发货:确认收款后、且尚未发货(deliveryStatus<20)时显示
|
// 发货:
|
||||||
if (order.payStatus && (order.deliveryStatus == null || order.deliveryStatus < 20) && order.orderStatus !== 1) {
|
// - 已付款且未发货:正常发货
|
||||||
|
// - 线下付款未付款且未发货:支持先发货后结款
|
||||||
|
if (order.orderStatus !== 1) {
|
||||||
|
const notShipped = order.deliveryStatus == null || order.deliveryStatus < 20
|
||||||
|
if (notShipped && (order.payStatus || order.payType === 9)) {
|
||||||
actions.push({label: '发货', type: 'ship'})
|
actions.push({label: '发货', type: 'ship'})
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// 确认完成:仅在确认收款后显示(已付款才能确认完成)
|
// 确认完成:仅在确认收款后显示(已付款才能确认完成)
|
||||||
if (order.payStatus) {
|
if (order.payStatus) {
|
||||||
actions.push({label: '确认完成', type: 'complete'})
|
actions.push({label: '确认完成', type: 'complete'})
|
||||||
|
|||||||
Reference in New Issue
Block a user