feat(chat): 调拨工作台接入类型配置与待匹配面板
来源选择卡改为加载启用类型(单一飞行请求,空态引导先到管理页配置), 调拨类型为匹配必选项(422 提示);批次号派生接转换规则(deriveBatchNo 三态: 原始值/前缀替换/无规则),与后端转换引擎同口径。 首页面板新增第四张待匹配卡(indigo):待匹配桶=启用类型范围并集内无有效明细的 异动档记录,只读抽屉查看、去匹配直达;四语言文案补齐。
This commit is contained in:
1 parent
3a19f9c27d
commit
e4100815a0
18 files changed
+651
-100
No files matched your search
@@ -0,0 +1,90 @@
|
||||
<!--
|
||||
features/chat/components/messages/TransferPendingMatchPanel.vue
|
||||
用途:「待匹配」桶只读清单(D16,规格 §10/§12.3)——已抓取尚未匹配的外部收料
|
||||
记录(档记录尚无 items),首页待办看板第 4 张卡的抽屉数据源。
|
||||
依赖:props.records(GET /backlog/pending-match 投影)、i18n chat.transfer.transferPendingMatch*。
|
||||
逻辑:纯只读——无勾选列、无执行入口(记录尚未经匹配/库存核对,不可执行);
|
||||
顶部「去匹配」按钮上抛 go-match,由父级切到库存匹配入口(来源选择卡);
|
||||
清单按后端稳定排序(收料日期→来源→单号)渲染,数量为档原值文本。
|
||||
-->
|
||||
<script setup lang="ts">
|
||||
import type { TransferPendingMatchRecord } from '../../types/transfer.types';
|
||||
|
||||
defineProps<{
|
||||
records: TransferPendingMatchRecord[];
|
||||
busy?: boolean;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
/** 「去匹配」引导:切到现有库存匹配入口(来源选择卡),本桶不提供任何执行动作。 */
|
||||
'go-match': [];
|
||||
refresh: [];
|
||||
}>();
|
||||
|
||||
function rowKey(record: TransferPendingMatchRecord): string {
|
||||
return `${record.ledger_record_id}|${record.doc_no}`;
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="my-2 rounded-2xl border border-brand-100 bg-surface p-4 shadow-sm" data-testid="transfer-pending-match-panel">
|
||||
<div class="mb-2 flex items-center justify-between gap-2">
|
||||
<div class="min-w-0">
|
||||
<h3 class="text-sm font-bold text-primary">{{ $t('chat.transfer.transferPendingMatchTitle') }}</h3>
|
||||
<p class="mt-0.5 text-xs text-muted">{{ $t('chat.transfer.transferPendingMatchReadOnlyHint') }}</p>
|
||||
</div>
|
||||
<div class="flex shrink-0 items-center gap-2">
|
||||
<button
|
||||
type="button"
|
||||
class="rounded-lg border border-default px-2 py-1 text-xs text-secondary hover-surface-soft"
|
||||
data-testid="transfer-pending-match-refresh"
|
||||
@click="emit('refresh')"
|
||||
>
|
||||
{{ $t('chat.transfer.refreshProgress') }}
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="rounded-lg bg-indigo-600 px-4 py-1.5 text-sm font-bold text-white hover:bg-indigo-700 disabled:cursor-not-allowed disabled:opacity-40"
|
||||
:disabled="busy"
|
||||
data-testid="transfer-pending-match-go"
|
||||
@click="emit('go-match')"
|
||||
>
|
||||
{{ $t('chat.transfer.transferPendingMatchGoMatch') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="records.length" class="overflow-x-auto">
|
||||
<table class="w-full min-w-[720px] text-xs" data-testid="transfer-pending-match-table">
|
||||
<thead>
|
||||
<tr class="border-b border-default bg-surface-soft text-left text-[11px] text-muted">
|
||||
<th class="whitespace-nowrap p-2">{{ $t('chat.transfer.transferPendingMatchColSource') }}</th>
|
||||
<th class="whitespace-nowrap p-2">{{ $t('chat.transfer.transferPendingMatchColDocNo') }}</th>
|
||||
<th class="whitespace-nowrap p-2">{{ $t('chat.transfer.transferPendingMatchColMaterial') }}</th>
|
||||
<th class="p-2">{{ $t('chat.transfer.transferPendingMatchColName') }}</th>
|
||||
<th class="whitespace-nowrap p-2">{{ $t('chat.transfer.transferPendingMatchColDate') }}</th>
|
||||
<th class="whitespace-nowrap p-2">{{ $t('chat.transfer.transferPendingMatchColQuantity') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr
|
||||
v-for="record in records"
|
||||
:key="rowKey(record)"
|
||||
class="border-b border-subtle"
|
||||
:data-testid="`transfer-pending-match-${record.doc_no}`"
|
||||
>
|
||||
<td class="whitespace-nowrap p-2">{{ record.source_code }}</td>
|
||||
<td class="whitespace-nowrap p-2 font-semibold">{{ record.doc_no }}</td>
|
||||
<td class="whitespace-nowrap p-2">{{ record.material_code || '—' }}</td>
|
||||
<td class="p-2">{{ record.material_name || '—' }}</td>
|
||||
<td class="whitespace-nowrap p-2">{{ record.movement_date || '—' }}</td>
|
||||
<td class="whitespace-nowrap p-2">{{ record.quantity ?? '—' }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div v-else class="rounded-lg bg-surface-soft p-3 text-xs text-muted" data-testid="transfer-pending-match-empty">
|
||||
{{ $t('chat.transfer.transferPendingMatchEmpty') }}
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
Reference in new issue
Block a user