diff --git a/src/views/order/orderManagement/config/order-common-config.ts b/src/views/order/orderManagement/config/order-common-config.ts index 7e94bdb6..6729d9b1 100644 --- a/src/views/order/orderManagement/config/order-common-config.ts +++ b/src/views/order/orderManagement/config/order-common-config.ts @@ -1149,8 +1149,25 @@ export const outboundStatusFilterOptions = [ export const interceptStatusFilterOptions = [ { label: '无', value: 'none' }, - { label: '待拦截', value: 'pending' }, - { label: '已拦截', value: 'success' }, + { label: '请求拦截中', value: 'requesting' }, + { label: '已请求拦截', value: 'requested' }, + { label: '拦截中', value: 'intercepting' }, + { label: '在途拦截成功', value: 'intercepted_in_transit' }, + { label: '库内拦截成功', value: 'intercepted_at_warehouse' }, + { label: '退回中', value: 'returning' }, + { label: '已退回', value: 'returned' }, + { label: '已误派送', value: 'delivered_by_mistake' }, + { label: '超时', value: 'timeout' }, + { label: '已取消', value: 'cancelled' }, + { label: '失败', value: 'failed' }, + { label: '异常', value: 'exception' }, + { label: '已拦截(历史)', value: 'intercepted' }, +] + +/** 拦截条件(待处理 / 异常订单):只区分是否拦截(none 或非 none) */ +export const interceptFlagFilterOptions = [ + { label: '否', value: '__intercept_flag_no__', operator: 'eq', conditionValue: 'none' }, + { label: '是', value: '__intercept_flag_yes__', operator: 'ne', conditionValue: 'none' }, ] export const pendingOrderStatusFilterOptions = [ @@ -1271,6 +1288,8 @@ export const outboundStatusScanField = scanWorkflowField({ label: '数据归档' export const claimStatusScanField = scanWorkflowField({ label: '认领状态', value: 'claim_status', type: 'select', options: claimStatusFilterOptions }) export const lockStatusScanField = scanWorkflowField({ label: '锁定状态', value: 'lock_status', type: 'select', options: lockStatusFilterOptions }) export const interceptStatusScanField = scanWorkflowField({ label: '拦截状态', value: 'intercept_status', type: 'select', options: interceptStatusFilterOptions }) +/** 是否拦截(待处理 / 异常订单):否 = eq none,是 = ne none */ +export const interceptFlagScanField = scanWorkflowField({ label: '是否拦截', value: 'intercept_status', type: 'select', options: interceptFlagFilterOptions }) /** ScanBox:波次分配 → where.wave_id 为 { operator: 'eq'|'ne', value: 0 } */ export const waveAssignmentScanField = scanBasicField({ @@ -1758,6 +1777,7 @@ export const pendingAvailableFields = [ { ...packStatusScanField, group: SCAN_PROCESS_STATUS_GROUP }, { ...printStatusScanField, group: SCAN_PROCESS_STATUS_GROUP }, { ...lockStatusScanField, group: SCAN_PROCESS_STATUS_GROUP }, + { ...interceptFlagScanField, group: SCAN_PROCESS_STATUS_GROUP }, { ...orderStatusScanField(pendingOrderStatusFilterOptions), group: SCAN_PROCESS_STATUS_GROUP }, // 收货信息 { ...receiverNameScanField, group: SCAN_RECEIVING_INFO_GROUP }, @@ -2126,7 +2146,7 @@ export const expectionOrderAvailableFields = [ { ...postStatusScanField, group: SCAN_PROCESS_STATUS_GROUP }, { ...pickStatusScanField, group: SCAN_PROCESS_STATUS_GROUP }, { ...packStatusScanField, group: SCAN_PROCESS_STATUS_GROUP }, - { ...interceptStatusScanField, group: SCAN_PROCESS_STATUS_GROUP }, + { ...interceptFlagScanField, group: SCAN_PROCESS_STATUS_GROUP }, { ...recheckStatusScanField, group: SCAN_PROCESS_STATUS_GROUP }, { ...printStatusScanField, group: SCAN_PROCESS_STATUS_GROUP }, { ...lockStatusScanField, group: SCAN_PROCESS_STATUS_GROUP }, diff --git a/src/views/order/orderManagement/pendingOrder.vue b/src/views/order/orderManagement/pendingOrder.vue index 04cd05ab..b980113e 100644 --- a/src/views/order/orderManagement/pendingOrder.vue +++ b/src/views/order/orderManagement/pendingOrder.vue @@ -1041,6 +1041,16 @@ async function handleConfirmInterceptBatch() { ElMessage.error('选中行缺少有效订单 id,请刷新后重试') return } + // 提交前按列表最新数据二次校验,防止行数据过期导致非拦截订单被提交 + const idSet = new Set(ids) + const freshNonIntercept = list.value.filter((item: any) => { + const n = normalizePositiveIntId(item?.id) + return n !== null && idSet.has(n) && !isActiveInterceptStatus(resolveOrderInterceptStatus(item)) + }) + if (freshNonIntercept.length) { + ElMessage.warning('选中的订单中存在非拦截状态订单,请取消勾选后再操作') + return + } if (confirmInterceptLoading.value) return try { await ElMessageBox.confirm( diff --git a/src/views/order/orderManagement/utils/order-index-helpers.ts b/src/views/order/orderManagement/utils/order-index-helpers.ts index 9c94adcb..c94feca4 100644 --- a/src/views/order/orderManagement/utils/order-index-helpers.ts +++ b/src/views/order/orderManagement/utils/order-index-helpers.ts @@ -421,18 +421,23 @@ export function normalizeOrderListRow(row: any) { return normalized } -/** 行级拦截状态(优先 intercept_status,兼容 interceptStatus) */ +/** 行级拦截状态(优先 intercept_status,兼容 interceptStatus;none / 0 / false / 空 视为无拦截) */ export function resolveOrderInterceptStatus(row?: Record | null): string { if (!row || typeof row !== 'object') return 'none' const value = row.intercept_status ?? row.interceptStatus - if (value === undefined || value === null || value === '') return 'none' + if (value === undefined || value === null || value === '' || value === false) { + return 'none' + } + const normalized = String(value).trim().toLowerCase() + if (!normalized || ['none', '0', 'false', 'no'].includes(normalized)) return 'none' return String(value).trim() } -/** 是否为有效拦截状态(非 none / 空) */ +/** 是否为有效拦截状态(非 none / 0 / false / 空) */ export function isActiveInterceptStatus(value: unknown): boolean { - const normalized = String(value ?? 'none').trim().toLowerCase() - return normalized !== '' && normalized !== 'none' + if (value === false || value === null || value === undefined) return false + const normalized = String(value).trim().toLowerCase() + return normalized !== '' && !['none', '0', 'false', 'no'].includes(normalized) } /** 行级复核状态(优先 recheck_status,兼容历史 inspection_status) */