fix(shipping-notice): 任务中心OT直链补case_no锚点并修复工作台装配期懒加载竞态
This commit is contained in:
1 parent
65f751daf4
commit
0333d713e0
6 files changed
+136
-26
No files matched your search
@@ -142,6 +142,16 @@ const lineRows = computed(() => {
|
||||
return Array.isArray(item?.notice_line_summary) ? item!.notice_line_summary : [];
|
||||
});
|
||||
|
||||
/**
|
||||
* 数量/缺口展示值:后端 Numeric(24,8) 透出形如 "24.00000000",
|
||||
* 统一转 number 去尾零(24.00000000→24、2.50000000→2.5),缺失保持 —。
|
||||
*/
|
||||
function formatQty(value: unknown): string {
|
||||
if (value === null || value === undefined || value === '') return '—';
|
||||
const num = Number(value);
|
||||
return Number.isFinite(num) ? String(num) : String(value);
|
||||
}
|
||||
|
||||
watch(() => props.item, (item) => {
|
||||
if (!item) return;
|
||||
const stage = defaultLifecycleTarget(item);
|
||||
@@ -173,7 +183,7 @@ onBeforeUnmount(() => document.removeEventListener('keydown', onEsc));
|
||||
data-testid="my-todos-drawer-scrim"
|
||||
@click="emit('close')"
|
||||
/>
|
||||
<aside class="flex w-[34rem] max-w-[94vw] flex-col bg-surface shadow-2xl">
|
||||
<aside class="flex w-[52rem] max-w-[94vw] flex-col bg-surface shadow-2xl">
|
||||
<div class="border-b border-default px-5 py-4">
|
||||
<div class="flex items-start justify-between gap-3">
|
||||
<h3 class="break-all font-mono text-base font-bold text-primary" data-testid="my-todos-drawer-title">
|
||||
@@ -238,14 +248,14 @@ onBeforeUnmount(() => document.removeEventListener('keydown', onEsc));
|
||||
<table class="w-full border-collapse text-xs" data-testid="my-todos-drawer-lines">
|
||||
<thead>
|
||||
<tr class="border-b border-default bg-surface-soft/60 text-left text-muted">
|
||||
<th class="px-2.5 py-2 font-medium">{{ $t('workspace.shippingNotice.myTodos.drawer.lineTable.lineNo') }}</th>
|
||||
<th class="px-2.5 py-2 font-medium">{{ $t('workspace.shippingNotice.myTodos.drawer.lineTable.partNumber') }}</th>
|
||||
<th class="px-2.5 py-2 font-medium">{{ $t('workspace.shippingNotice.myTodos.drawer.lineTable.customerPartNumber') }}</th>
|
||||
<th class="px-2.5 py-2 font-medium">{{ $t('workspace.shippingNotice.myTodos.drawer.lineTable.reservationId') }}</th>
|
||||
<th class="px-2.5 py-2 font-medium">{{ $t('workspace.shippingNotice.myTodos.drawer.lineTable.shipmentQty') }}</th>
|
||||
<th class="px-2.5 py-2 font-medium">{{ $t('workspace.shippingNotice.myTodos.drawer.lineTable.availableQty') }}</th>
|
||||
<th class="px-2.5 py-2 font-medium">{{ $t('workspace.shippingNotice.myTodos.drawer.lineTable.shortageQty') }}</th>
|
||||
<th class="px-2.5 py-2 font-medium">{{ $t('workspace.shippingNotice.myTodos.drawer.lineTable.status') }}</th>
|
||||
<th class="whitespace-nowrap px-2.5 py-2 font-medium">{{ $t('workspace.shippingNotice.myTodos.drawer.lineTable.lineNo') }}</th>
|
||||
<th class="whitespace-nowrap px-2.5 py-2 font-medium">{{ $t('workspace.shippingNotice.myTodos.drawer.lineTable.partNumber') }}</th>
|
||||
<th class="whitespace-nowrap px-2.5 py-2 font-medium">{{ $t('workspace.shippingNotice.myTodos.drawer.lineTable.customerPartNumber') }}</th>
|
||||
<th class="whitespace-nowrap px-2.5 py-2 font-medium">{{ $t('workspace.shippingNotice.myTodos.drawer.lineTable.reservationId') }}</th>
|
||||
<th class="whitespace-nowrap px-2.5 py-2 font-medium">{{ $t('workspace.shippingNotice.myTodos.drawer.lineTable.shipmentQty') }}</th>
|
||||
<th class="whitespace-nowrap px-2.5 py-2 font-medium">{{ $t('workspace.shippingNotice.myTodos.drawer.lineTable.availableQty') }}</th>
|
||||
<th class="whitespace-nowrap px-2.5 py-2 font-medium">{{ $t('workspace.shippingNotice.myTodos.drawer.lineTable.shortageQty') }}</th>
|
||||
<th class="whitespace-nowrap px-2.5 py-2 font-medium">{{ $t('workspace.shippingNotice.myTodos.drawer.lineTable.status') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -255,18 +265,18 @@ onBeforeUnmount(() => document.removeEventListener('keydown', onEsc));
|
||||
class="border-b border-[#f0f3f8]"
|
||||
>
|
||||
<td class="px-2.5 py-2 font-mono">{{ line.line_no }}</td>
|
||||
<td class="px-2.5 py-2 font-mono">{{ line.part_number || '—' }}</td>
|
||||
<td class="px-2.5 py-2">{{ line.customer_part_number || '—' }}</td>
|
||||
<td class="px-2.5 py-2 font-mono">{{ line.reservation_id || '—' }}</td>
|
||||
<td class="px-2.5 py-2 tabular-nums">{{ line.shipment_qty ?? '—' }}</td>
|
||||
<td class="px-2.5 py-2 tabular-nums">{{ line.available_qty ?? '—' }}</td>
|
||||
<td class="whitespace-nowrap px-2.5 py-2 font-mono">{{ line.part_number || '—' }}</td>
|
||||
<td class="whitespace-nowrap px-2.5 py-2">{{ line.customer_part_number || '—' }}</td>
|
||||
<td class="whitespace-nowrap px-2.5 py-2 font-mono">{{ line.reservation_id || '—' }}</td>
|
||||
<td class="whitespace-nowrap px-2.5 py-2 tabular-nums">{{ formatQty(line.shipment_qty) }}</td>
|
||||
<td class="whitespace-nowrap px-2.5 py-2 tabular-nums">{{ formatQty(line.available_qty) }}</td>
|
||||
<td
|
||||
class="px-2.5 py-2 tabular-nums"
|
||||
class="whitespace-nowrap px-2.5 py-2 tabular-nums"
|
||||
:class="Number(line.shortage_qty || 0) > 0 ? 'font-bold text-red-600' : ''"
|
||||
>
|
||||
{{ line.shortage_qty ?? '—' }}
|
||||
{{ formatQty(line.shortage_qty) }}
|
||||
</td>
|
||||
<td class="px-2.5 py-2">{{ line.inventory_status || '—' }}</td>
|
||||
<td class="whitespace-nowrap px-2.5 py-2">{{ line.inventory_status || '—' }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
Reference in new issue
Block a user