feat(shipping-notice): 新增库存确认来源接口及相关逻辑

This commit is contained in:
hugo committed 2026-07-13 21:53:45 +08:00
1 parent a31735b689
commit 0a9bd6415d
69 files changed
+8442 -775

No files matched your search

@@ -141,6 +141,31 @@ const inventorySnapshotLabel = (triggerType?: string | null) => {
return map[key] || map.on_demand;
};
const inventorySourceStatusLabel = (status?: string | null) => {
const key = String(status || '').trim();
if (!key) return '—';
const i18nKey = `workspace.shippingNotice.inventorySource.statusLabels.${key}`;
return te(i18nKey) ? t(i18nKey) : key;
};
const inventorySourceMethodLabel = (method?: string | null) => {
const key = String(method || '').trim();
if (!key) return '—';
const i18nKey = `workspace.shippingNotice.inventorySource.methodLabels.${key}`;
return te(i18nKey) ? t(i18nKey) : key;
};
const hasInventorySourceFields = computed(() => {
const item = detail.value;
if (!item) return false;
return !!(
item.inventory_source_code
|| item.inventory_site_id
|| item.inventory_warehouse_id
|| item.inventory_source_status
);
});
const loadCases = async () => {
loading.value = true;
try {
@@ -388,6 +413,45 @@ onMounted(async () => {
<div><dt class="text-muted">{{ $t('workspace.shippingNotice.fields.freightRef') }}</dt><dd>{{ detail.freight_ref_no || '—' }}</dd></div>
</dl>
<div
v-if="hasInventorySourceFields"
class="rounded-2xl border border-default/80 bg-surface px-4 py-3 text-sm"
>
<h3 class="mb-2 text-sm font-semibold text-secondary">
{{ $t('workspace.shippingNotice.inventorySource.title') }}
</h3>
<dl class="grid gap-2 sm:grid-cols-2">
<div>
<dt class="text-xs text-muted">{{ $t('workspace.shippingNotice.inventorySource.sourceCode') }}</dt>
<dd class="font-mono">{{ detail.inventory_source_code || '—' }}</dd>
</div>
<div>
<dt class="text-xs text-muted">{{ $t('workspace.shippingNotice.inventorySource.status') }}</dt>
<dd>{{ inventorySourceStatusLabel(detail.inventory_source_status) }}</dd>
</div>
<div>
<dt class="text-xs text-muted">{{ $t('workspace.shippingNotice.inventorySource.siteId') }}</dt>
<dd class="font-mono">{{ detail.inventory_site_id || '—' }}</dd>
</div>
<div>
<dt class="text-xs text-muted">{{ $t('workspace.shippingNotice.inventorySource.warehouseId') }}</dt>
<dd class="font-mono">{{ detail.inventory_warehouse_id || '—' }}</dd>
</div>
<div>
<dt class="text-xs text-muted">{{ $t('workspace.shippingNotice.inventorySource.method') }}</dt>
<dd>{{ inventorySourceMethodLabel(detail.inventory_source_method) }}</dd>
</div>
<div>
<dt class="text-xs text-muted">{{ $t('workspace.shippingNotice.inventorySource.configVersion') }}</dt>
<dd class="font-mono text-xs">{{ detail.inventory_source_config_version || '—' }}</dd>
</div>
<div>
<dt class="text-xs text-muted">{{ $t('workspace.shippingNotice.inventorySource.confirmedBy') }}</dt>
<dd class="font-mono">{{ detail.inventory_source_confirmed_by ?? '—' }}</dd>
</div>
</dl>
</div>
<div
v-if="detail.inventory_snapshot"
class="rounded-2xl border border-default/80 bg-surface px-4 py-3 text-sm"