diff --git a/src/modules/order-management/inboundOrders.test.mjs b/src/modules/order-management/inboundOrders.test.mjs index 45d5392..d4ed904 100644 --- a/src/modules/order-management/inboundOrders.test.mjs +++ b/src/modules/order-management/inboundOrders.test.mjs @@ -42,3 +42,23 @@ test('preserves overseas API diagnostic metadata without rendering it as a busin assert.match(overseasHttp, /body\.traceId, body\.requestId/) assert.doesNotMatch(view, /requestId|traceId/) }) + +test('renders inbound workflow statuses in Chinese and keeps desktop values on one line', () => { + for (const [status, label] of [ + ['PENDING_ASSIGNMENT', '待分配'], ['PDA_PENDING', '待收货'], ['ASSIGNED', '已分配'], + ['SIGNED', '已签收'], ['PICKING', '拣货中'], ['PARTIAL_INBOUND', '部分入库'], + ]) assert.match(view, new RegExp(`${status}: '${label}'`)) + assert.match(view, /label="状态" width="120" show-overflow-tooltip/) + assert.match(view, /\.detail-grid div \{ min-width: 0;/) + assert.match(view, /\.detail-grid dd \{[^}]*overflow: hidden;[^}]*text-overflow: ellipsis;[^}]*white-space: nowrap;/) +}) + +test('uses the formal inbound status selector and presents destination fields without mixing receiving warehouses', () => { + assert.match(view, /const inboundStatusOptions = \[/) + assert.match(view, /label="作业状态">([]) const detail = ref(null) const total = ref(0) +const inboundStatusOptions = [ + { label: '待分配', value: 'PENDING_ASSIGNMENT' }, + { label: '已分配', value: 'ASSIGNED' }, + { label: '待收货', value: 'PDA_PENDING' }, + { label: '已签收', value: 'SIGNED' }, + { label: '拣货中', value: 'PICKING' }, + { label: '部分入库', value: 'PARTIAL_INBOUND' }, + { label: '已完成', value: 'COMPLETED' }, +] const query = reactive({ page: 1, size: 20, planNo: '', inboundCode: '', destinationWarehouseCode: '', status: '', appointmentStatus: '', dispatchStatus: '', createdDates: [] as string[], @@ -18,9 +27,20 @@ function overseasWarehouseLabel(code: unknown, name: unknown) { if (typeof code !== 'string' || !code.trim() || typeof name !== 'string' || !name.trim()) return '—' return `${code.trim()} · ${name.trim()}` } +function destinationWarehouseLabel(...values: unknown[]) { + const parts = values + .filter((value): value is string => typeof value === 'string' && Boolean(value.trim())) + .map((value) => value.trim()) + return [...new Set(parts)].join(' · ') || '—' +} function dateTime(value: unknown) { return value ? new Date(String(value)).toLocaleString('zh-CN', { hour12: false }) : '—' } function statusLabel(value: unknown) { - return ({ PENDING: '待处理', PROCESSING: '处理中', COMPLETED: '已完成', CANCELLED: '已取消', UNAPPOINTED: '未预约', SUCCESS: '预约成功', FAILED: '预约失败', SCHEDULED: '已排车', UNSCHEDULED: '未排车' } as Record)[String(value)] || text(value) + return ({ + PENDING: '待处理', PROCESSING: '处理中', PENDING_ASSIGNMENT: '待分配', PDA_PENDING: '待收货', + ASSIGNED: '已分配', SIGNED: '已签收', PICKING: '拣货中', PARTIAL_INBOUND: '部分入库', + COMPLETED: '已完成', CANCELLED: '已取消', UNAPPOINTED: '未预约', SUCCESS: '预约成功', + FAILED: '预约失败', SCHEDULED: '已排车', UNSCHEDULED: '未排车', + } as Record)[String(value)] || text(value) } function errorMessage(cause: unknown) { return cause instanceof Error ? cause.message : '请求失败,请稍后重试' } @@ -74,7 +94,7 @@ onMounted(() => void load()) - + @@ -91,10 +111,10 @@ onMounted(() => void load()) - - - - + + + + @@ -112,14 +132,14 @@ onMounted(() => void load()) - - + + - + @@ -136,7 +156,7 @@ onMounted(() => void load()) .filter-card :deep(.el-input), .filter-card :deep(.el-select) { width: 190px; } .pagination { justify-content: flex-end; margin-top: 18px; } .detail-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; } -.detail-grid div { padding: 18px 20px; border-right: 1px solid #ebeef5; border-bottom: 1px solid #ebeef5; } +.detail-grid div { min-width: 0; padding: 18px 20px; border-right: 1px solid #ebeef5; border-bottom: 1px solid #ebeef5; } .detail-grid dt { margin-bottom: 7px; color: #8492a6; font-size: 13px; } -.detail-grid dd { margin: 0; overflow-wrap: anywhere; color: #1f2937; } +.detail-grid dd { margin: 0; overflow: hidden; color: #1f2937; text-overflow: ellipsis; white-space: nowrap; }