修复订单发布与核销并发状态覆盖
This commit is contained in:
@@ -351,8 +351,9 @@ export function formatWorkOrderEvent(event: WorkOrderEvent): EventNodeStyle {
|
||||
case 'voucher_backfilled':
|
||||
return { title: '回填了电子凭证信息', color: 'default' }
|
||||
case 'assign_voucher_consume_failed':
|
||||
case 'publish_voucher_consume_failed':
|
||||
return { title: '电子凭证核销失败,本次操作未生效', color: 'red' }
|
||||
case 'publish_voucher_consume_failed':
|
||||
return { title: '订单已发布,但电子凭证核销未完成', color: 'orange' }
|
||||
|
||||
default:
|
||||
// 通用状态流转兜底
|
||||
|
||||
@@ -566,11 +566,13 @@ export default function WorkOrdersPanel() {
|
||||
return runAction(
|
||||
() => publishAdminWorkOrder(row.workOrderId),
|
||||
(response) =>
|
||||
response.data.hallVisible
|
||||
? response.data.voucherConsume.voucherCount > 0
|
||||
? '电子凭证已自动核销,订单已展示在大厅'
|
||||
: '订单已展示在大厅'
|
||||
: '订单已进入大厅等待队列',
|
||||
!response.data.voucherConsume.ok
|
||||
? '订单已发布,但电子凭证核销未完成'
|
||||
: response.data.hallVisible
|
||||
? response.data.voucherConsume.voucherCount > 0
|
||||
? '订单已发布,电子凭证已顺带核销'
|
||||
: '订单已展示在大厅'
|
||||
: '订单已进入大厅等待队列',
|
||||
)
|
||||
}
|
||||
|
||||
@@ -582,11 +584,11 @@ export default function WorkOrdersPanel() {
|
||||
|
||||
let skipFutureConfirm = false
|
||||
modal.confirm({
|
||||
title: '确认发布并核销该订单?',
|
||||
title: '确认发布该订单?',
|
||||
content: (
|
||||
<div>
|
||||
<Typography.Paragraph>
|
||||
如订单关联电子凭证,系统会先自动核销,成功后再发布到大厅。核销后即使下架也不会自动恢复凭证。
|
||||
如订单关联电子凭证,系统会在发布后顺带尝试核销;核销失败不影响订单发布。
|
||||
</Typography.Paragraph>
|
||||
<Checkbox
|
||||
onChange={(event) => {
|
||||
@@ -597,7 +599,7 @@ export default function WorkOrdersPanel() {
|
||||
</Checkbox>
|
||||
</div>
|
||||
),
|
||||
okText: '发布并核销',
|
||||
okText: '发布订单',
|
||||
cancelText: '取消',
|
||||
onOk: () => {
|
||||
if (skipFutureConfirm) setSkipPublishConfirm()
|
||||
|
||||
Reference in New Issue
Block a user