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
@@ -18,9 +18,11 @@ import type {
|
||||
TransferMatchingItem,
|
||||
TransferMatchingSummary,
|
||||
TransferRunResult,
|
||||
TransferPendingMatchRecord,
|
||||
TransferSourceFileStatus,
|
||||
TransferSourceOption,
|
||||
TransferType,
|
||||
TransferTypeOption,
|
||||
} from '../types/transfer.types';
|
||||
|
||||
const BASE = '/api/in-transit-transfer';
|
||||
@@ -33,10 +35,18 @@ export interface CreateMatchingPayload {
|
||||
business_date?: string;
|
||||
receipt_date_from?: string;
|
||||
receipt_date_to?: string;
|
||||
/** 调拨业务类型;缺省为在途仓至HUB仓 */
|
||||
/** 调拨业务类型 code(Task 7 接口化:来源选择卡接口选项所选值;缺省行为由后端匹配链路决定) */
|
||||
transfer_type?: TransferType;
|
||||
}
|
||||
|
||||
/**
|
||||
* 调拨类型配置列表(Task 5 契约:仅 enabled、sort_order 升序,最小暴露
|
||||
* {code, names, sort_order, transform_rules} 四键;配置缺失返回空数组)。
|
||||
* 来源选择卡类型选项的唯一数据源(Task 7 接口化,替代写死三选项)。
|
||||
*/
|
||||
export const fetchTransferTypes = () =>
|
||||
requestJson<TransferTypeOption[]>(`${BASE}/transfer-types`, { headers: getAuthHeaders() });
|
||||
|
||||
/** 创建匹配(只读) */
|
||||
export const createTransferMatching = (payload: CreateMatchingPayload) =>
|
||||
requestJson<TransferMatchingSummary>(BASE + '/matchings', {
|
||||
@@ -213,10 +223,18 @@ export const downloadTransferSourceFiles = (sourceCodes: string[]) =>
|
||||
export const listTransferBacklog = () =>
|
||||
requestJson<TransferBacklogItem[]>(`${BASE}/backlog`, { headers: getAuthHeaders() });
|
||||
|
||||
/** 待处理异常汇总(含 3/5/7 天老化分级) */
|
||||
/** 待处理异常汇总(含 3/5/7 天老化分级 + 待匹配桶计数 pending_match D16) */
|
||||
export const getTransferBacklogSummary = () =>
|
||||
requestJson<TransferBacklogSummary>(`${BASE}/backlog/summary`, { headers: getAuthHeaders() });
|
||||
|
||||
/**
|
||||
* 「待匹配」桶清单(D16 只读):启用类型范围并集内已落档、尚未被任何匹配圈定的
|
||||
* 外部收料记录。无 item_id——不可勾选执行,仅用于首页第 4 张卡的只读抽屉清单
|
||||
* 与「去匹配」引导(入口=createTransferMatching 的来源选择卡)。
|
||||
*/
|
||||
export const listPendingMatchRecords = () =>
|
||||
requestJson<TransferPendingMatchRecord[]>(`${BASE}/backlog/pending-match`, { headers: getAuthHeaders() });
|
||||
|
||||
/** 来源实例列表(平台 DBS/Crane 仅分组,每来源附收料文件状态) */
|
||||
export const listTransferSources = () =>
|
||||
requestJson<TransferSourceOption[]>(`${BASE}/sources`, { headers: getAuthHeaders() });
|
||||
|
||||
@@ -23,7 +23,9 @@ const api = vi.hoisted(() => ({
|
||||
downloadTransferExceptions: vi.fn(),
|
||||
listTransferBacklog: vi.fn(),
|
||||
getTransferBacklogSummary: vi.fn(),
|
||||
listPendingMatchRecords: vi.fn(),
|
||||
listTransferSources: vi.fn(),
|
||||
fetchTransferTypes: vi.fn(),
|
||||
listExecutableTransferItems: vi.fn(),
|
||||
fetchExecutedOrders: vi.fn(),
|
||||
}));
|
||||
@@ -43,13 +45,20 @@ describe('TransferHomePanel chat home entry', () => {
|
||||
beforeEach(() => {
|
||||
vi.clearAllMocks();
|
||||
api.getTransferBacklogSummary.mockResolvedValue({
|
||||
recoverable: 6, closed: 2, unknown: 1, aging: { warn_3d: 3, escalate_5d: 2, critical_7d: 1 },
|
||||
recoverable: 6, closed: 2, unknown: 1, pending_match: 3, aging: { warn_3d: 3, escalate_5d: 2, critical_7d: 1 },
|
||||
});
|
||||
api.listTransferBacklog.mockResolvedValue([]);
|
||||
api.listExecutableTransferItems.mockResolvedValue({ items: [], counts: { executable_count: 0 } });
|
||||
// 「待匹配」桶只读清单(D16 第 4 卡抽屉数据源;默认空,专项用例自行覆盖)。
|
||||
api.listPendingMatchRecords.mockResolvedValue([]);
|
||||
api.listExecutableTransferItems.mockResolvedValue({ items: [], counts: { executable_count: 0 } });
|
||||
api.listTransferSources.mockResolvedValue([
|
||||
{ source_code: 'DBS-AWSBI', display_name: 'AWSBI', platform: 'dbs', enabled: true, has_ready_file: true, file_status: 'ready' },
|
||||
]);
|
||||
// 调拨类型配置(Task 7 接口化):source-select 子视图挂载时并行拉取,不 mock 会成未处理 rejection。
|
||||
api.fetchTransferTypes.mockResolvedValue([
|
||||
{ code: 'in_transit_to_hub', names: { 'zh-CN': '在途仓至HUB仓' }, sort_order: 10, transform_rules: [] },
|
||||
]);
|
||||
// 已执行卡片入口挂载拉分组计数(pageSize=1);不 mock 会因组件静默失败成为未处理 rejection。
|
||||
api.fetchExecutedOrders.mockResolvedValue({
|
||||
groups: { success: 0, failed: 0, executing: 0, result_unknown: 0 },
|
||||
@@ -137,6 +146,41 @@ describe('TransferHomePanel chat home entry', () => {
|
||||
expect(wrapper.text()).not.toContain('INV-001');
|
||||
});
|
||||
|
||||
it('待办看板渲染第 4 张「待匹配」卡(计数=summary.pending_match)', async () => {
|
||||
const wrapper = mountHome();
|
||||
await flushPromises();
|
||||
// [断言意图] D16 第 4 卡:计数消费 backlogSummary.pending_match(不额外拉清单)。
|
||||
expect(wrapper.find('[data-testid="transfer-home-pending-match"]').exists()).toBe(true);
|
||||
expect(wrapper.find('[data-testid="transfer-home-pending-match"]').text()).toContain('3');
|
||||
// 首屏只取计数:抽屉清单延迟到进入子视图才拉。
|
||||
expect(api.listPendingMatchRecords).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('点击「待匹配」卡进只读抽屉:清单渲染、无勾选/执行入口,「去匹配」切来源选择卡', async () => {
|
||||
api.listPendingMatchRecords.mockResolvedValue([
|
||||
{ ledger_record_id: 101, doc_no: 'HOM-901', material_code: 'MAT-9', material_name: '未匹配物料',
|
||||
movement_date: '2026-08-04', source_code: 'DBS-AWSBI', quantity: '55' },
|
||||
]);
|
||||
|
||||
const wrapper = mountHome();
|
||||
await flushPromises();
|
||||
await wrapper.find('[data-testid="transfer-home-pending-match"]').trigger('click');
|
||||
await flushPromises();
|
||||
// [断言意图] 抽屉=只读清单:进入子视图才拉清单,行字段可见。
|
||||
expect(api.listPendingMatchRecords).toHaveBeenCalled();
|
||||
expect(wrapper.find('[data-testid="transfer-pending-match-panel"]').exists()).toBe(true);
|
||||
expect(wrapper.find('[data-testid="transfer-pending-match-HOM-901"]').exists()).toBe(true);
|
||||
expect(wrapper.text()).toContain('MAT-9');
|
||||
// [断言意图] 不可勾选执行:抽屉内无任何复选框与「生成调拨单」按钮(记录尚未匹配/未库存核对)。
|
||||
expect(wrapper.find('[data-testid="transfer-pending-match-panel"]').find('input[type="checkbox"]').exists()).toBe(false);
|
||||
expect(wrapper.find('[data-testid="transfer-executable-generate"]').exists()).toBe(false);
|
||||
|
||||
// [断言意图] 「去匹配」=现有库存匹配入口(来源选择卡),非行执行。
|
||||
await wrapper.find('[data-testid="transfer-pending-match-go"]').trigger('click');
|
||||
await flushPromises();
|
||||
expect(wrapper.find('[data-testid="transfer-source-select-card"]').exists()).toBe(true);
|
||||
});
|
||||
|
||||
it('点击已执行统计卡片进入明细列表子视图:initial-group 透传且 flow-active=true', async () => {
|
||||
// 卡片分组计数非零(入口可见);列表 mock 返回空单(本例只验证接线,不验证行渲染)。
|
||||
api.fetchExecutedOrders.mockResolvedValue({
|
||||
|
||||
@@ -1,16 +1,20 @@
|
||||
<!--
|
||||
features/chat/components/messages/TransferHomePanel.vue
|
||||
用途:在途仓自动调拨 Agent 的 Chat 首页入口区——上区「库存匹配」动作入口,
|
||||
中区「待办看板」三队列(可调拨明细/待恢复异常/已人工关闭;结果未知行
|
||||
2026-09-29 起不再设首页卡——行级在待办池只读且无独立出口,统一走下方
|
||||
执行看板的结果未知单据 [重新触发],池内仍可经结果筛选查看),
|
||||
中区「待办看板」四队列(待匹配/可调拨明细/待恢复异常/已人工关闭;「待匹配」
|
||||
为 2026-10-14 D16 新增第 4 卡:已落档尚未匹配的外部收料记录,只读抽屉清单
|
||||
+「去匹配」引导,不可勾选执行;结果未知行 2026-09-29 起不再设首页卡——行级
|
||||
在待办池只读且无独立出口,统一走下方执行看板的结果未知单据 [重新触发],
|
||||
池内仍可经结果筛选查看),
|
||||
下区「执行看板」统计卡片入口(四张分组计数卡,点击跳转明细列表子视图),
|
||||
点击进入对应处理视图(复用自驱动的 TransferMessageView / TransferExecutedOrders)。
|
||||
依赖:TransferMessageView(复用自驱动卡片)、TransferExecutedCards(已执行卡片入口)、
|
||||
TransferExecutedOrders(已执行明细列表子视图)、useChatTransfer、i18n chat.transfer.*。
|
||||
TransferExecutedOrders(已执行明细列表子视图)、TransferPendingMatchPanel
|
||||
(待匹配只读抽屉)、useChatTransfer、i18n chat.transfer.*。
|
||||
逻辑:home 时仅拉待办汇总计数与可调拨明细(首屏不拉全量待办列表,命中
|
||||
首页预取单飞);'executed' 子视图由 openExecuted(group) 进入(卡片带入
|
||||
初始分组)并挂载列表组件;其余非 home 视图渲染 TransferMessageView
|
||||
首页预取单飞);'pending-match' 子视图挂载时现拉只读清单(计数卡消费
|
||||
backlogSummary.pending_match);'executed' 子视图由 openExecuted(group) 进入
|
||||
(卡片带入初始分组)并挂载列表组件;其余非 home 视图渲染 TransferMessageView
|
||||
(backlog 切片在其挂载时自拉全量列表)。卡片不注入消息流,因此无需后端 ChatLog 消息。
|
||||
-->
|
||||
<script setup lang="ts">
|
||||
@@ -18,6 +22,7 @@ import { computed, onMounted, ref, watch } from 'vue';
|
||||
import TransferMessageView from './TransferMessageView.vue';
|
||||
import TransferExecutedCards from './TransferExecutedCards.vue';
|
||||
import TransferExecutedOrders from './TransferExecutedOrders.vue';
|
||||
import TransferPendingMatchPanel from './TransferPendingMatchPanel.vue';
|
||||
import { useChatTransfer } from '../../composables/useChatTransfer';
|
||||
|
||||
const props = defineProps<{
|
||||
@@ -29,7 +34,7 @@ const emit = defineEmits<{
|
||||
'flow-active': [active: boolean];
|
||||
}>();
|
||||
|
||||
type HomeView = 'home' | 'source-select' | 'backlog' | 'executable' | 'executed';
|
||||
type HomeView = 'home' | 'source-select' | 'backlog' | 'executable' | 'executed' | 'pending-match';
|
||||
/** 待处理池结果筛选(与 TransferBacklogSummaryCard 的筛选选项一致)。 */
|
||||
type BacklogFilter = 'all' | 'recoverable' | 'closed' | 'unknown';
|
||||
|
||||
@@ -53,13 +58,18 @@ function openExecuted(group: 'success' | 'failed' | 'executing' | 'result_unknow
|
||||
}
|
||||
|
||||
/** home 视图仅拉待办汇总计数与可调拨明细——计数卡只消费计数,
|
||||
* 68.5kB 级全量待办列表延迟到切片子视图(TransferMessageView backlog)自行加载 */
|
||||
* 68.5kB 级全量待办列表延迟到切片子视图(TransferMessageView backlog)自行加载;
|
||||
* 'pending-match' 子视图现拉只读清单(D16:不做缓存,匹配后数据即变) */
|
||||
async function loadHomeSummary() {
|
||||
if (view.value !== 'home') return;
|
||||
await Promise.all([
|
||||
transfer.loadBacklogSummary().catch(() => undefined),
|
||||
transfer.loadExecutableItems().catch(() => undefined),
|
||||
]);
|
||||
if (view.value === 'home') {
|
||||
await Promise.all([
|
||||
transfer.loadBacklogSummary().catch(() => undefined),
|
||||
transfer.loadExecutableItems().catch(() => undefined),
|
||||
]);
|
||||
}
|
||||
if (view.value === 'pending-match') {
|
||||
await transfer.loadPendingMatchRecords().catch(() => undefined);
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => { void loadHomeSummary(); });
|
||||
@@ -110,10 +120,20 @@ function goBack() {
|
||||
</button>
|
||||
</section>
|
||||
|
||||
<!-- 待办看板 -->
|
||||
<!-- 待办看板(D16:第 1 张=待匹配·靛蓝;其余三卡样式与语义不变) -->
|
||||
<section aria-label="待办看板">
|
||||
<p class="mb-2 text-sm font-bold text-secondary">{{ $t('chat.transfer.homeBoardLabel') }}</p>
|
||||
<div class="grid grid-cols-2 gap-3 lg:grid-cols-3">
|
||||
<div class="grid grid-cols-2 gap-3 lg:grid-cols-4">
|
||||
<button
|
||||
type="button"
|
||||
data-testid="transfer-home-pending-match"
|
||||
class="rounded-2xl border border-indigo-200 bg-indigo-50 p-4 text-left transition-colors hover:bg-indigo-100"
|
||||
@click="view = 'pending-match'"
|
||||
>
|
||||
<b class="block text-2xl leading-none text-indigo-600">{{ transfer.backlogSummary.value?.pending_match ?? 0 }}</b>
|
||||
<b class="mt-2 block text-sm font-bold text-primary">{{ $t('chat.transfer.transferPendingMatch') }}</b>
|
||||
<span class="mt-1 block text-xs text-secondary">{{ $t('chat.transfer.transferPendingMatchHint') }}</span>
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
data-testid="transfer-home-executable"
|
||||
@@ -160,6 +180,23 @@ function goBack() {
|
||||
<TransferExecutedOrders :initial-group="executedGroup" @back="goBack" />
|
||||
</div>
|
||||
|
||||
<!-- 「待匹配」只读抽屉(D16:清单 + 去匹配引导;无勾选/执行入口) -->
|
||||
<div v-else-if="view === 'pending-match'" class="w-full max-w-[min(96vw,1500px)] pr-2">
|
||||
<button
|
||||
type="button"
|
||||
data-testid="transfer-home-back"
|
||||
class="mb-2 rounded-lg px-2 py-1 text-sm font-bold text-brand-600 transition-colors hover:bg-brand-50"
|
||||
@click="goBack"
|
||||
>
|
||||
← {{ $t('chat.transfer.homeBack') }}
|
||||
</button>
|
||||
<TransferPendingMatchPanel
|
||||
:records="transfer.pendingMatchRecords.value"
|
||||
@go-match="view = 'source-select'"
|
||||
@refresh="() => transfer.loadPendingMatchRecords()"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<!-- 子流程:复用自驱动的 TransferMessageView(宽表格需要全宽,上限对齐消息气泡宽布局) -->
|
||||
<div v-else class="w-full max-w-[min(96vw,1500px)] pr-2">
|
||||
<button
|
||||
|
||||
@@ -27,6 +27,7 @@ const api = vi.hoisted(() => ({
|
||||
listTransferBacklog: vi.fn(),
|
||||
getTransferBacklogSummary: vi.fn(),
|
||||
listTransferSources: vi.fn(),
|
||||
fetchTransferTypes: vi.fn(),
|
||||
retriggerTransferDocument: vi.fn(),
|
||||
closeTransferDocument: vi.fn(),
|
||||
}));
|
||||
@@ -301,10 +302,16 @@ describe('TransferMessageView self-driving wiring', () => {
|
||||
expect(toastText).toContain('仍阻断');
|
||||
});
|
||||
|
||||
it('来源实例选择:加载列表 → 确认范围 → 创建匹配并切换匹配卡(默认携带 D+1 日期范围)', async () => {
|
||||
it('来源实例选择:加载列表与类型配置 → 确认范围 → 创建匹配并切换匹配卡(默认携带 D+1 日期范围)', async () => {
|
||||
// [断言意图] Task 7 接口化:挂载时并行拉取来源列表与调拨类型配置(fetchTransferTypes),
|
||||
// 类型选项=接口数据渲染进来源卡;确认仍携带缺省(首项)类型 code。
|
||||
api.listTransferSources.mockResolvedValue([
|
||||
{ source_code: 'DBS-AWSBI', display_name: 'AWSBI', platform: 'dbs', enabled: true, has_ready_file: true, file_status: 'ready' },
|
||||
]);
|
||||
api.fetchTransferTypes.mockResolvedValue([
|
||||
{ code: 'in_transit_to_hub', names: { 'zh-CN': '在途仓至HUB仓' }, sort_order: 10, transform_rules: [] },
|
||||
{ code: 'hub_to_hub', names: { 'zh-CN': 'HUB仓间调拨' }, sort_order: 30, transform_rules: [] },
|
||||
]);
|
||||
api.createTransferMatching.mockResolvedValue(payload.summary);
|
||||
api.getTransferMatching.mockResolvedValue({
|
||||
summary: payload.summary,
|
||||
@@ -317,7 +324,12 @@ describe('TransferMessageView self-driving wiring', () => {
|
||||
global: { plugins: [i18n] },
|
||||
});
|
||||
await flushPromises();
|
||||
expect(api.listTransferSources).toHaveBeenCalled();
|
||||
expect(api.fetchTransferTypes).toHaveBeenCalled();
|
||||
expect(wrapper.find('[data-testid="transfer-source-select-card"]').exists()).toBe(true);
|
||||
// 类型选项=接口下发数据渲染(Task 7 接口化)
|
||||
expect(wrapper.find('[data-testid="transfer-type-option-in_transit_to_hub"]').exists()).toBe(true);
|
||||
expect(wrapper.find('[data-testid="transfer-type-option-hub_to_hub"]').exists()).toBe(true);
|
||||
|
||||
await wrapper.find('[data-testid="transfer-source-option-DBS-AWSBI"] input').setValue(true);
|
||||
await wrapper.find('[data-testid="transfer-source-confirm"]').trigger('click');
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
matching_id 时按 ID 恢复匹配卡(最近匹配入口);勾选/执行按明细 item_id;
|
||||
来源选择卡重试收料 RPA 为 202 异步——存在抓取中来源时组合式函数自动轮询
|
||||
GET /sources,RPA 回调收口后状态自动刷新,离开来源卡即停轮询;
|
||||
来源选择卡挂载时并行拉取来源列表与调拨类型配置(Task 7 接口化,
|
||||
类型选项=GET /transfer-types 接口下发);
|
||||
恢复处理 = 按明细 id 重查库存(batch-requery 唯一后端),完成后刷新待处理池并
|
||||
统计提示,不再跳转匹配卡;预检卡提交 202(D8)→ 切融合卡 kind='run'(run_no 传卡,
|
||||
轮询由融合卡自驱动,父级停自身轮询),门禁 4xx → useMessage 行内报错 + 预检状态刷新;
|
||||
@@ -82,6 +84,8 @@ onMounted(() => {
|
||||
}
|
||||
if (kind.value === 'source-select') {
|
||||
void transfer.loadSources();
|
||||
// 调拨类型配置(Task 7 接口化):类型选项=接口下发,与来源列表并行拉取。
|
||||
void transfer.loadTransferTypes();
|
||||
}
|
||||
if (kind.value === 'executable') {
|
||||
void transfer.loadExecutableItems();
|
||||
@@ -412,6 +416,7 @@ async function onSourceRetry(sourceCodes: string[]) {
|
||||
<TransferSourceSelectCard
|
||||
v-else-if="mode === 'source-select'"
|
||||
:sources="transfer.sourceOptions.value"
|
||||
:transfer-types="transfer.transferTypes.value"
|
||||
:busy="busy"
|
||||
:retrying="retryingSource"
|
||||
@confirm="onSourceConfirm"
|
||||
|
||||
@@ -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>
|
||||
@@ -1,18 +1,22 @@
|
||||
/**
|
||||
* features/chat/components/messages/TransferSourceSelectCard.spec.ts
|
||||
* 用途:来源实例选择卡——平台分组、全选已启用、清空、按收料文件状态门禁确认、
|
||||
* 确认提交、重试收料 RPA。
|
||||
* 确认提交、重试收料 RPA;调拨类型选项=接口下发(Task 7 接口化):
|
||||
* 选项渲染/名称多语言回退/空配置空态/确认禁用,「即将上线」占位不再出现。
|
||||
* 依赖:@vue/test-utils、i18n。
|
||||
* 逻辑:平台 DBS/Crane 仅分组;实例为选择与执行边界(决策 2/3/4);
|
||||
* 确认需至少一个 has_ready_file(兜底告警);混合选择(含非就绪项)先披露范围
|
||||
* 再确认(知情部分确认 2026-10-09,替代历史静默剔除),提交范围 ready-only;
|
||||
* 重试门禁=仅 fetching 在途不可重试(ready 亦可强制重抓,2026-09-29 去管控)。
|
||||
* 重试门禁=仅 fetching 在途不可重试(ready 亦可强制重抓,2026-09-29 去管控);
|
||||
* 类型选项=props.transferTypes 接口真相(enabled 过滤与排序在后端契约内,
|
||||
* 前端不过滤),名称 names[locale]→zh-CN→en→code 回退,空列表空态+确认禁用。
|
||||
*/
|
||||
import { mount } from '@vue/test-utils';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import i18n from '@/i18n';
|
||||
import TransferSourceSelectCard from './TransferSourceSelectCard.vue';
|
||||
import { eligibleReceiptDateTo } from './transferDate';
|
||||
import type { TransferTypeOption } from '../../types/transfer.types';
|
||||
|
||||
const readySources = [
|
||||
{ source_code: 'DBS-AWSBI', display_name: 'AWSBI 在途仓', platform: 'dbs', enabled: true, has_ready_file: true, file_status: 'ready' },
|
||||
@@ -20,9 +24,25 @@ const readySources = [
|
||||
{ source_code: 'CRANE-SZ', display_name: '深圳在途仓', platform: 'crane', enabled: true, has_ready_file: true, file_status: 'ready' },
|
||||
];
|
||||
|
||||
function mountCard(props = {}, sources = readySources) {
|
||||
/** 接口下发的调拨类型选项(GET /transfer-types data 逐项形状,最小暴露四键)。 */
|
||||
const defaultTransferTypes: TransferTypeOption[] = [
|
||||
{
|
||||
code: 'in_transit_to_hub',
|
||||
names: { 'zh-CN': '在途仓至HUB仓', 'en': 'In-transit to HUB' },
|
||||
sort_order: 10,
|
||||
transform_rules: [{ field: 'lot_no', op: 'prefix_replace', source: 'WTP', target: 'HOW' }],
|
||||
},
|
||||
{
|
||||
code: 'hub_to_hub',
|
||||
names: { 'zh-CN': 'HUB仓间调拨' },
|
||||
sort_order: 30,
|
||||
transform_rules: [],
|
||||
},
|
||||
];
|
||||
|
||||
function mountCard(props = {}, sources = readySources, transferTypes: TransferTypeOption[] = defaultTransferTypes) {
|
||||
return mount(TransferSourceSelectCard, {
|
||||
props: { sources, ...props },
|
||||
props: { sources, transferTypes, ...props },
|
||||
global: { plugins: [i18n] },
|
||||
});
|
||||
}
|
||||
@@ -261,19 +281,62 @@ describe('TransferSourceSelectCard', () => {
|
||||
expect(wrapper.emitted('retry')?.[0][0]).toEqual(['CRANE-EXP']);
|
||||
});
|
||||
|
||||
it('确认默认携带调拨类型 in_transit_to_hub', async () => {
|
||||
// [断言意图] 类型 1 为缺省选中值,确认事件第三参回传类型。
|
||||
it('确认默认携带首个接口选项的调拨类型 code(缺省选中第一项)', async () => {
|
||||
// [断言意图] 类型选项接口化(Task 7)后缺省选中不再是写死字面量,
|
||||
// 而是接口下发列表的首项(现行配置首项= in_transit_to_hub),确认事件第三参回传。
|
||||
const wrapper = mountCard();
|
||||
expect(wrapper.find('[data-testid="transfer-type-option-in_transit_to_hub"]').classes()).toContain('bg-brand-600');
|
||||
await wrapper.find('[data-testid="transfer-source-option-DBS-AWSBI"] input').setValue(true);
|
||||
await wrapper.find('[data-testid="transfer-source-confirm"]').trigger('click');
|
||||
expect(wrapper.emitted('confirm')?.[0][2]).toBe('in_transit_to_hub');
|
||||
});
|
||||
|
||||
it('调拨类型 2/3 占位禁用且不可选中', async () => {
|
||||
// [断言意图] 一期仅开放类型 1;占位类型按钮 disabled,防止发起未支持链路。
|
||||
it('调拨类型选项=接口下发数据逐项渲染,名称按 names 多语言显示,「即将上线」占位不再出现', () => {
|
||||
// [断言意图] 选项即接口真相:props 给几个渲染几个(enabled 过滤与排序在后端契约内),
|
||||
// 名称取 names[locale];写死三选项数组与「即将上线」徽标必须彻底消失。
|
||||
const wrapper = mountCard();
|
||||
expect((wrapper.find('[data-testid="transfer-type-option-hub_repair_out"]').element as HTMLButtonElement).disabled).toBe(true);
|
||||
expect((wrapper.find('[data-testid="transfer-type-option-hub_to_hub"]').element as HTMLButtonElement).disabled).toBe(true);
|
||||
expect((wrapper.find('[data-testid="transfer-type-option-in_transit_to_hub"]').element as HTMLButtonElement).disabled).toBe(false);
|
||||
const options = wrapper.findAll('button[data-testid^="transfer-type-option-"]');
|
||||
expect(options).toHaveLength(2);
|
||||
expect(wrapper.find('[data-testid="transfer-type-option-in_transit_to_hub"]').text()).toContain('在途仓至HUB仓');
|
||||
expect(wrapper.find('[data-testid="transfer-type-option-hub_to_hub"]').text()).toContain('HUB仓间调拨');
|
||||
expect(wrapper.text()).not.toContain('即将上线');
|
||||
});
|
||||
|
||||
it('类型名称回退:names 缺当前 locale 时依次回退 zh-CN → en → code', () => {
|
||||
// [断言意图] 规格 §12.2 名称回退链:locale → zh-CN → en → code(code 是终极兜底,
|
||||
// 未配置任何名称也不出现空白按钮)。
|
||||
const types: TransferTypeOption[] = [
|
||||
{ code: 'only_en', names: { en: 'Only EN' }, sort_order: 1, transform_rules: [] },
|
||||
{ code: 'no_names', names: {}, sort_order: 2, transform_rules: [] },
|
||||
];
|
||||
const wrapper = mountCard({}, readySources, types);
|
||||
expect(wrapper.find('[data-testid="transfer-type-option-only_en"]').text()).toContain('Only EN');
|
||||
expect(wrapper.find('[data-testid="transfer-type-option-no_names"]').text()).toContain('no_names');
|
||||
});
|
||||
|
||||
it('点击类型按钮切换选中(选中态高亮),确认携带所选 code', async () => {
|
||||
// [断言意图] 选中类型 code 随 confirm 事件上抛(现有签名不变):
|
||||
// 点击第二项后确认,第三参必须是其 code 而非缺省首项。
|
||||
const wrapper = mountCard();
|
||||
await wrapper.find('[data-testid="transfer-type-option-hub_to_hub"]').trigger('click');
|
||||
expect(wrapper.find('[data-testid="transfer-type-option-hub_to_hub"]').classes()).toContain('bg-brand-600');
|
||||
await wrapper.find('[data-testid="transfer-source-option-DBS-AWSBI"] input').setValue(true);
|
||||
await wrapper.find('[data-testid="transfer-source-confirm"]').trigger('click');
|
||||
expect(wrapper.emitted('confirm')?.[0][2]).toBe('hub_to_hub');
|
||||
});
|
||||
|
||||
it('类型配置为空:渲染空态文案,确认按钮禁用且 title 说明原因', () => {
|
||||
// [断言意图] 空配置空态(规格 §12.2):空态文案 chat.transfer.transferTypeEmpty +
|
||||
// 确认禁用(disabled + tooltip 说明原因),防止用户在无类型可配时发起匹配。
|
||||
const wrapper = mountCard({}, readySources, []);
|
||||
const empty = wrapper.find('[data-testid="transfer-type-empty"]');
|
||||
expect(empty.exists()).toBe(true);
|
||||
expect(empty.text()).toContain('暂无可用调拨类型');
|
||||
const confirm = wrapper.find('[data-testid="transfer-source-confirm"]');
|
||||
expect((confirm.element as HTMLButtonElement).disabled).toBe(true);
|
||||
expect(confirm.attributes('title') ?? '').toContain('暂无可用调拨类型');
|
||||
// 空态下不再渲染任何类型按钮,也不出现「即将上线」历史占位。
|
||||
expect(wrapper.find('button[data-testid^="transfer-type-option-"]').exists()).toBe(false);
|
||||
expect(wrapper.text()).not.toContain('即将上线');
|
||||
});
|
||||
});
|
||||
@@ -2,7 +2,8 @@
|
||||
features/chat/components/messages/TransferSourceSelectCard.vue
|
||||
用途:来源实例选择卡(决策 2/3/4:手工两步第一步)——按平台 DBS/Crane 分组勾选实例,
|
||||
选择调拨类型后“确认范围并匹配”发起匹配。
|
||||
依赖:props.sources、i18n chat.transfer.*。
|
||||
依赖:props.sources、props.transferTypes(GET /transfer-types 接口下发,Task 7 接口化)、
|
||||
i18n chat.transfer.*。
|
||||
逻辑:匹配参数区(调拨类型 + 收料日期,确认时一并提交)→ 选择辅助/上下文操作条
|
||||
(有选中时原位替换辅助区,承载批量重试/下载/清空选择)→ 平台分组来源列表
|
||||
(平台仅分组不可直接执行)→ 底部唯一实心主按钮「确认范围并匹配」(未选禁用);
|
||||
@@ -10,32 +11,35 @@
|
||||
(知情部分确认 2026-10-09,替代历史静默剔除),全就绪直达;
|
||||
门禁「至少一 ready」保留为兜底告警;重试除抓取中(fetching)外均可触发
|
||||
(ready 亦可强制重抓,2026-09-29 去管控),徽标独立文案;
|
||||
调拨类型决定收料数据范围(类型 1 仅纳入 INVOICE 前缀 HOM/HOX/WTP),
|
||||
类型 2/3 一期占位(禁用,后端同样 fail-closed)。
|
||||
调拨类型选项=接口下发数据(enabled 过滤与 sort_order 排序在后端契约内,
|
||||
前端不加工),名称按 names[locale]→zh-CN→en→code 回退;配置为空渲染空态
|
||||
transferTypeEmpty 且确认按钮禁用(tooltip 说明原因);缺省选中接口列表首项。
|
||||
-->
|
||||
<script setup lang="ts">
|
||||
import { computed, ref, watch } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useMessage } from '@/shared/composables/useMessage';
|
||||
import { eligibleReceiptDateTo } from './transferDate';
|
||||
import type { TransferSourceOption, TransferType } from '../../types/transfer.types';
|
||||
import type { TransferSourceOption, TransferTypeOption } from '../../types/transfer.types';
|
||||
|
||||
const props = defineProps<{
|
||||
sources: TransferSourceOption[];
|
||||
/** 调拨类型选项(接口下发真相;空数组=无可用类型,渲染空态并禁用确认) */
|
||||
transferTypes: TransferTypeOption[];
|
||||
busy?: boolean;
|
||||
/** 正在重试收料 RPA 的来源编码集合 */
|
||||
retrying?: Set<string>;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
confirm: [sourceCodes: string[], dateRange?: { from?: string; to?: string }, transferType?: TransferType];
|
||||
confirm: [sourceCodes: string[], dateRange?: { from?: string; to?: string }, transferType?: string];
|
||||
/** 批量重试收料 RPA:传来源编码列表 */
|
||||
retry: [sourceCodes: string[]];
|
||||
download: [sourceCodes: string[]];
|
||||
}>();
|
||||
|
||||
const { warning: notifyWarning } = useMessage();
|
||||
const { t } = useI18n();
|
||||
const { t, locale } = useI18n();
|
||||
|
||||
const selected = ref<Set<string>>(new Set());
|
||||
/** 收料日期范围(匹配查询范围):默认 D+1 规则日期(T-1),上限同(输入期限制,
|
||||
@@ -50,20 +54,24 @@ const dateRangeInvalid = computed(() => {
|
||||
const to = dateTo.value || null;
|
||||
return from !== null && to !== null && from > to;
|
||||
});
|
||||
/** 调拨业务类型:决定本次匹配纳入哪些收料数据;一期仅类型 1 开放。 */
|
||||
const transferType = ref<TransferType>('in_transit_to_hub');
|
||||
/** 调拨业务类型 code(Task 7 接口化):决定本次匹配纳入哪些收料数据与转换规则;
|
||||
* 空配置(无可选类型)时为 null,确认按钮禁用兜底。 */
|
||||
const transferType = ref<string | null>(null);
|
||||
|
||||
/** 类型选项元数据;enabled=false 为占位类型(UI 禁用 + 后端 fail-closed 双保险)。 */
|
||||
const transferTypeOptions: Array<{ value: TransferType; enabled: boolean }> = [
|
||||
{ value: 'in_transit_to_hub', enabled: true },
|
||||
{ value: 'hub_repair_out', enabled: false },
|
||||
{ value: 'hub_to_hub', enabled: false },
|
||||
];
|
||||
|
||||
function transferTypeLabel(value: TransferType): string {
|
||||
return t(`chat.transfer.transferType.${value}`);
|
||||
/** 选项名称多语言回退(规格 §12.2):names[当前locale] → zh-CN → en → code。 */
|
||||
function transferTypeLabel(option: TransferTypeOption): string {
|
||||
return option.names?.[locale.value] ?? option.names?.['zh-CN'] ?? option.names?.en ?? option.code;
|
||||
}
|
||||
|
||||
// 选项到达/变化时同步选中值:缺省选接口列表首项;当前选中不在列表(配置被禁用/
|
||||
// 删除)时回落首项;空列表清空选中(空态下确认禁用兜底)。
|
||||
watch(() => props.transferTypes, (types) => {
|
||||
const codes = types.map((option) => option.code);
|
||||
if (transferType.value === null || !codes.includes(transferType.value)) {
|
||||
transferType.value = codes[0] ?? null;
|
||||
}
|
||||
}, { immediate: true });
|
||||
|
||||
const platforms = computed(() => [...new Set(props.sources.map((source) => source.platform))]);
|
||||
const selectedCount = computed(() => selected.value.size);
|
||||
|
||||
@@ -85,8 +93,10 @@ const batchRetryDisabled = computed(() => props.busy || selectedRetryableCount.v
|
||||
const selectedHasReadyFile = computed(() =>
|
||||
[...selected.value].some((code) => props.sources.find((s) => s.source_code === code)?.has_ready_file),
|
||||
);
|
||||
// 空类型配置(Task 7 接口化空态)同样禁用确认:无类型可选时不允许发起匹配。
|
||||
const confirmDisabled = computed(() =>
|
||||
props.busy || selectedCount.value === 0 || !selectedHasReadyFile.value || dateRangeInvalid.value,
|
||||
props.busy || selectedCount.value === 0 || !selectedHasReadyFile.value || dateRangeInvalid.value
|
||||
|| props.transferTypes.length === 0,
|
||||
);
|
||||
const downloadDisabled = computed(() => props.busy || !selectedHasReadyFile.value);
|
||||
|
||||
@@ -190,7 +200,7 @@ function confirm() {
|
||||
showPartialConfirm.value = true;
|
||||
return;
|
||||
}
|
||||
emit('confirm', readyCodes, { from: dateFrom.value || undefined, to: dateTo.value || undefined }, transferType.value);
|
||||
emit('confirm', readyCodes, { from: dateFrom.value || undefined, to: dateTo.value || undefined }, transferType.value ?? undefined);
|
||||
}
|
||||
|
||||
/** 已选来源中的 ready 来源码(每次 emit 时现算,避免披露期间勾选变化导致口径过期)。 */
|
||||
@@ -204,7 +214,7 @@ function selectedReadyCodes(): string[] {
|
||||
function proceedPartialConfirm() {
|
||||
const readyCodes = selectedReadyCodes();
|
||||
showPartialConfirm.value = false;
|
||||
emit('confirm', readyCodes, { from: dateFrom.value || undefined, to: dateTo.value || undefined }, transferType.value);
|
||||
emit('confirm', readyCodes, { from: dateFrom.value || undefined, to: dateTo.value || undefined }, transferType.value ?? undefined);
|
||||
}
|
||||
|
||||
/** 披露后取消:收回披露条,可调整勾选或等待其余来源就绪。 */
|
||||
@@ -227,21 +237,26 @@ watch(selected, () => {
|
||||
<p class="mb-2 text-[11px] font-bold text-muted">{{ $t('chat.transfer.matchParams') }}</p>
|
||||
<div class="flex flex-wrap items-center gap-2">
|
||||
<span class="text-xs font-bold text-secondary">{{ $t('chat.transfer.transferTypeLabel') }}</span>
|
||||
<!-- [Task 7 接口化空态] 配置为空:空态文案 + 确认按钮禁用(tooltip 说明原因);
|
||||
选项即接口真相(enabled 过滤/排序在后端),前端不加工不过滤。 -->
|
||||
<span
|
||||
v-if="transferTypes.length === 0"
|
||||
class="text-xs font-bold text-amber-600"
|
||||
data-testid="transfer-type-empty"
|
||||
>⚠ {{ $t('chat.transfer.transferTypeEmpty') }}</span>
|
||||
<button
|
||||
v-for="option in transferTypeOptions"
|
||||
:key="option.value"
|
||||
v-for="option in transferTypes"
|
||||
:key="option.code"
|
||||
type="button"
|
||||
class="rounded-full border px-3 py-1 text-xs font-bold disabled:cursor-not-allowed disabled:opacity-40"
|
||||
:class="transferType === option.value
|
||||
:class="transferType === option.code
|
||||
? 'border-brand-600 bg-brand-600 text-white hover:bg-brand-700'
|
||||
: 'border-brand-200 text-brand-700 hover:bg-brand-50'"
|
||||
:disabled="busy || !option.enabled"
|
||||
:title="option.enabled ? undefined : t('chat.transfer.transferTypeComingSoon')"
|
||||
:data-testid="`transfer-type-option-${option.value}`"
|
||||
@click="transferType = option.value"
|
||||
:disabled="busy"
|
||||
:data-testid="`transfer-type-option-${option.code}`"
|
||||
@click="transferType = option.code"
|
||||
>
|
||||
{{ transferTypeLabel(option.value) }}
|
||||
<span v-if="!option.enabled" class="ml-1 font-normal opacity-70">{{ t('chat.transfer.transferTypeComingSoon') }}</span>
|
||||
{{ transferTypeLabel(option) }}
|
||||
</button>
|
||||
</div>
|
||||
<div class="mt-2 flex flex-wrap items-center gap-2">
|
||||
@@ -473,6 +488,7 @@ watch(selected, () => {
|
||||
type="button"
|
||||
class="rounded-lg bg-brand-600 px-4 py-1.5 text-sm font-bold text-white hover:bg-brand-700 disabled:cursor-not-allowed disabled:opacity-40"
|
||||
:disabled="confirmDisabled"
|
||||
:title="transferTypes.length === 0 ? $t('chat.transfer.transferTypeEmpty') : undefined"
|
||||
data-testid="transfer-source-confirm"
|
||||
@click="confirm"
|
||||
>
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
/**
|
||||
* features/chat/components/messages/transferBatch.spec.ts
|
||||
* 用途:覆盖批号转换规则。
|
||||
* 用途:覆盖批号转换规则(Task 7 接口化:deriveBatchNo 支持 TransformRule 形参)。
|
||||
* 依赖:transferBatch、vitest。
|
||||
* 逻辑:WTP 前缀替换为 HOW;其余原样;空值安全。
|
||||
* 逻辑:三态契约——未传 rules(旧调用点/过渡期)保持现行 WTP→HOW 兼容行为;
|
||||
* 显式传 rules=[] 恒等不转换(类型未配置=恒等);传规则按序链式前缀替换
|
||||
* (与后端 field_transforms 引擎同语义,仅 lot_no 字段命中)。
|
||||
*/
|
||||
|
||||
import { describe, expect, it } from 'vitest';
|
||||
@@ -25,3 +27,39 @@ describe('transferBatch', () => {
|
||||
expect(deriveBatchNo(undefined)).toBe('');
|
||||
});
|
||||
});
|
||||
|
||||
describe('transferBatch deriveBatchNo 规则三态(Task 7 接口化)', () => {
|
||||
const wtpToHow = [{ field: 'lot_no', op: 'prefix_replace', source: 'WTP', target: 'HOW' }];
|
||||
|
||||
it('未传 rules(旧调用点兼容窗):保持现行 WTP→HOW 行为', () => {
|
||||
// [断言意图] 既有调用点(匹配卡/可执行卡/待处理池/已执行单)未传规则时
|
||||
// 行为必须与改造前逐字节一致——迁移期兼容窗的回归锁。
|
||||
expect(deriveBatchNo('WTP26082728')).toBe('HOW26082728');
|
||||
expect(deriveBatchNo('wtp26082728')).toBe('HOW26082728');
|
||||
expect(deriveBatchNo('HS000131')).toBe('HS000131');
|
||||
expect(deriveBatchNo('')).toBe('');
|
||||
expect(deriveBatchNo(null)).toBe('');
|
||||
});
|
||||
|
||||
it('显式传空数组 rules=[]:恒等不转换(类型未配置=恒等)', () => {
|
||||
// [断言意图] 空规则是显式「该类型不做字段转换」的契约(与后端 parse_transform_rules
|
||||
// 空=恒等同口径),不得回落 WTP→HOW 缺省。
|
||||
expect(deriveBatchNo('WTP26082728', [])).toBe('WTP26082728');
|
||||
expect(deriveBatchNo('HS000131', [])).toBe('HS000131');
|
||||
});
|
||||
|
||||
it('传规则:按序链式前缀替换(与后端 field_transforms 同语义),非 lot_no 字段规则不命中', () => {
|
||||
// [断言意图] 规则引擎展示侧镜像:仅 lot_no 规则生效;前缀匹配大小写不敏感
|
||||
// (result 大写判 startsWith,替换拼接按原值切片);多条规则按配置序链式派生。
|
||||
expect(deriveBatchNo('WTP1', wtpToHow)).toBe('HOW1');
|
||||
expect(deriveBatchNo('wtp1', wtpToHow)).toBe('HOW1');
|
||||
expect(deriveBatchNo('HS000131', wtpToHow)).toBe('HS000131');
|
||||
// 非 lot_no 字段的规则不得影响批号展示。
|
||||
expect(deriveBatchNo('WTP1', [{ field: 'material_no', op: 'prefix_replace', source: 'WTP', target: 'HOW' }])).toBe('WTP1');
|
||||
// 链式:WTP→HOW 后继续 HOW→HOWX(WTP1 → HOW1 → HOWX1)。
|
||||
expect(deriveBatchNo('WTP1', [
|
||||
{ field: 'lot_no', op: 'prefix_replace', source: 'WTP', target: 'HOW' },
|
||||
{ field: 'lot_no', op: 'prefix_replace', source: 'HOW', target: 'HOWX' },
|
||||
])).toBe('HOWX1');
|
||||
});
|
||||
});
|
||||
@@ -1,16 +1,56 @@
|
||||
/**
|
||||
* features/chat/components/messages/transferBatch.ts
|
||||
* 用途:在途调拨批号转换规则(拨出/拨入批号展示)。
|
||||
* 依赖:无。
|
||||
* 逻辑:原批号以 WTP 开头时替换前缀为 HOW 获得真实批号;其余规则不变、原样展示。
|
||||
* 本函数是后端 movement_contract.external_lot_no(库存查询/建单下传侧唯一实现)
|
||||
* 的展示侧镜像,两侧行为须逐字节一致,改动必须双侧同步。
|
||||
* 用途:在途调拨批号转换规则(拨出/拨入批号展示)——Task 7 接口化后由所选调拨
|
||||
* 类型的 transform_rules 驱动;本函数是后端 field_transforms.apply_field_transforms
|
||||
* (库存查询/建单下传侧唯一实现)的展示侧镜像,两侧行为须逐字节一致,改动必须双侧同步。
|
||||
* 依赖:../types/transfer.types(TransferTransformRule)。
|
||||
* 逻辑:三态契约——未传 rules(旧调用点/过渡期兼容窗)保持现行 WTP→HOW 缺省行为;
|
||||
* 显式传 rules=[] 恒等不转换(类型未配置=恒等,与后端 parse_transform_rules 空规则同口径);
|
||||
* 传规则按序链式前缀替换(仅 lot_no 字段命中,前缀大小写不敏感)。
|
||||
*/
|
||||
import type { TransferTransformRule } from '../../types/transfer.types';
|
||||
|
||||
/** 原批号(如 WMS 的 WTP26082728)→ 真实批号(HOW26082728);空值/非 WTP 原样返回。 */
|
||||
export function deriveBatchNo(lotNo: string | null | undefined): string {
|
||||
/**
|
||||
* 旧调用点兼容缺省规则(未传 rules 时生效):现行 WTP→HOW 前缀替换。
|
||||
* 过渡期兼容窗(Task 7 裁定):待调用方全部改为按所选类型显式传规则后可移除。
|
||||
*/
|
||||
const LEGACY_LOT_NO_RULES: TransferTransformRule[] = [
|
||||
{ field: 'lot_no', op: 'prefix_replace', source: 'WTP', target: 'HOW' },
|
||||
];
|
||||
|
||||
/**
|
||||
* 原批号 → 派生批号(展示侧)。
|
||||
*
|
||||
* 【AI 触发时机】:卡片渲染批号列(匹配卡/可执行卡/待处理池/已执行单)时调用,
|
||||
* 把 WMS 原批号(如 WTP26082728)按所选调拨类型的转换规则派生为真实批号(HOW26082728)。
|
||||
*
|
||||
* 核心逻辑:[STEP 1] 空值清洗(null/空串/纯空白 → 空串原样返回);
|
||||
* [STEP 2] rules 缺省回落 LEGACY_LOT_NO_RULES(兼容窗),显式 [] 为恒等(无转换);
|
||||
* [STEP 3] 按规则序链式求值(applyLotNoTransforms,与后端引擎同语义)。
|
||||
*
|
||||
* @param lotNo - 原批号(行上 lot_no 原值,永不被改写,只返回派生新值)
|
||||
* @param rules - 所选调拨类型的 transform_rules(GET /transfer-types 下发);
|
||||
* 业务约束:调用方未升级传参时保持缺省(兼容窗),显式传 [] 表示该类型不做转换
|
||||
* @returns 派生后的批号;空输入返回空串
|
||||
*/
|
||||
export function deriveBatchNo(lotNo: string | null | undefined, rules?: TransferTransformRule[]): string {
|
||||
const value = String(lotNo ?? '').trim();
|
||||
if (!value) return '';
|
||||
if (value.toUpperCase().startsWith('WTP')) return `HOW${value.slice(3)}`;
|
||||
return value;
|
||||
return applyLotNoTransforms(value, rules ?? LEGACY_LOT_NO_RULES);
|
||||
}
|
||||
|
||||
/**
|
||||
* 按规则序链式派生 lot_no 展示值(后端 apply_field_transforms('lot_no', …) 的镜像)。
|
||||
* 核心逻辑:仅 field=lot_no 的规则命中;op=prefix_replace 且当前值前缀匹配(大小写
|
||||
* 不敏感)时替换前缀,未命中规则恒等;空值短路透传。
|
||||
*/
|
||||
function applyLotNoTransforms(value: string, rules: TransferTransformRule[]): string {
|
||||
let result = value;
|
||||
for (const rule of rules) {
|
||||
if (rule.field !== 'lot_no' || !result) continue;
|
||||
if (rule.op === 'prefix_replace' && result.toUpperCase().startsWith(rule.source.toUpperCase())) {
|
||||
result = rule.target + result.slice(rule.source.length);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -5,7 +5,8 @@
|
||||
* 逻辑:断言按钮禁用、勾选禁用、融合卡单行常驻展开(历史回放旧 result 投影兼容)、
|
||||
* 异常展示、下载按钮与结果页不出现“查看执行审计”入口(决策 19);
|
||||
* 计数卡新字段(待查库存/已失效,历史缺省按 0)与 pending 徽标
|
||||
* (evidence-sync,2026-09-25)。
|
||||
* (evidence-sync,2026-09-25);匹配卡批号列 deriveBatchNo 旧路径兼容
|
||||
* (Task 7 规则化后未传规则仍 WTP→HOW)。
|
||||
*/
|
||||
import { mount } from '@vue/test-utils';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
@@ -98,6 +99,17 @@ describe('TransferMatchCard', () => {
|
||||
expect(wrapper.emitted('execute')?.[0][0]).toEqual([101]);
|
||||
});
|
||||
|
||||
it('批号列展示派生批号:未传规则走 transferBatch 旧路径(WTP→HOW 兼容行为)', () => {
|
||||
// [断言意图] Task 7 deriveBatchNo 规则化后的调用方回归锁:匹配卡批号列
|
||||
// 不传规则(过渡期兼容窗),WTP 批号必须仍派生为 HOW 真实批号。
|
||||
const itemsWithLot = [{ ...items[0], lot_no: 'WTP26082728' }];
|
||||
const wrapper = mount(TransferMatchCard, {
|
||||
props: { summary, items: itemsWithLot, selected: new Set<number>() },
|
||||
...mountOptions,
|
||||
});
|
||||
expect(wrapper.find('[data-testid="transfer-item-INV-001"]').text()).toContain('HOW26082728');
|
||||
});
|
||||
|
||||
it('库存数量下方小字展示查询时刻(HH:mm)', () => {
|
||||
const wrapper = mount(TransferMatchCard, {
|
||||
props: { summary, items, selected: new Set<number>() },
|
||||
|
||||
@@ -23,10 +23,12 @@ const api = vi.hoisted(() => ({
|
||||
downloadTransferErpInventory: vi.fn(),
|
||||
downloadTransferExceptions: vi.fn(),
|
||||
listTransferSources: vi.fn(),
|
||||
fetchTransferTypes: vi.fn(),
|
||||
retryTransferSourceRpa: vi.fn(),
|
||||
listTransferBacklog: vi.fn(),
|
||||
getTransferBacklogSummary: vi.fn(),
|
||||
listExecutableTransferItems: vi.fn(),
|
||||
listPendingMatchRecords: vi.fn(),
|
||||
}));
|
||||
|
||||
vi.mock('../api/transfer.api', () => api);
|
||||
@@ -382,10 +384,61 @@ describe('useChatTransfer 来源状态轮询(收料 RPA 202 异步收口)',
|
||||
});
|
||||
});
|
||||
|
||||
describe('useChatTransfer 调拨类型加载(Task 7 接口化,模块级单飞)', () => {
|
||||
/** GET /transfer-types data 形状(最小暴露四键;enabled 过滤与排序在后端契约内) */
|
||||
const typesPayload = [
|
||||
{ code: 'in_transit_to_hub', names: { 'zh-CN': '在途仓至HUB仓' }, sort_order: 10, transform_rules: [{ field: 'lot_no', op: 'prefix_replace', source: 'WTP', target: 'HOW' }] },
|
||||
{ code: 'hub_to_hub', names: { 'zh-CN': 'HUB仓间调拨' }, sort_order: 30, transform_rules: [] },
|
||||
];
|
||||
|
||||
beforeEach(() => {
|
||||
vi.clearAllMocks();
|
||||
});
|
||||
|
||||
it('loadTransferTypes 拉取并写入 transferTypes(选项即接口真相,前端不加工)', async () => {
|
||||
// [断言意图] 接口返回逐键透传进 transferTypes ref——前端不做类型白名单过滤
|
||||
// (开发期窗口:新建自定义类型提交匹配由后端枚举校验兜底)。
|
||||
api.fetchTransferTypes.mockResolvedValue(typesPayload);
|
||||
const transfer = useChatTransfer();
|
||||
const types = await transfer.loadTransferTypes();
|
||||
expect(api.fetchTransferTypes).toHaveBeenCalledTimes(1);
|
||||
expect(transfer.transferTypes.value).toEqual(typesPayload);
|
||||
expect(types).toEqual(typesPayload);
|
||||
});
|
||||
|
||||
it('模块级单飞:多实例并发调用共享同一在途请求,只打一次点', async () => {
|
||||
// [断言意图] 会话内多条来源选择消息/重复进入卡片并发挂载时共享同一 Promise,
|
||||
// 防止并发重复请求(与首页看板预取单飞同模式)。
|
||||
api.fetchTransferTypes.mockResolvedValue(typesPayload);
|
||||
const a = useChatTransfer();
|
||||
const b = useChatTransfer();
|
||||
await Promise.all([a.loadTransferTypes(), b.loadTransferTypes()]);
|
||||
expect(api.fetchTransferTypes).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it('请求落定清槽:下次调用现发拿新鲜配置(不做长缓存)', async () => {
|
||||
// [断言意图] 类型配置可能被管理员调整:单飞只去重「在途」并发,
|
||||
// 落定后清槽,顺序调用各自现发(与来源列表拉取的新鲜度口径一致)。
|
||||
api.fetchTransferTypes.mockResolvedValue(typesPayload);
|
||||
const transfer = useChatTransfer();
|
||||
await transfer.loadTransferTypes();
|
||||
await transfer.loadTransferTypes();
|
||||
expect(api.fetchTransferTypes).toHaveBeenCalledTimes(2);
|
||||
});
|
||||
|
||||
it('reset 清空 transferTypes', async () => {
|
||||
api.fetchTransferTypes.mockResolvedValue(typesPayload);
|
||||
const transfer = useChatTransfer();
|
||||
await transfer.loadTransferTypes();
|
||||
transfer.reset();
|
||||
expect(transfer.transferTypes.value).toHaveLength(0);
|
||||
});
|
||||
});
|
||||
|
||||
describe('useChatTransfer 首页看板预取(会话引导期单飞)', () => {
|
||||
/** 标准看板载荷(供预取槽位消费;单飞槽位是模块级状态,用例结束前必须双槽消费完) */
|
||||
const backlogSummaryPayload = {
|
||||
recoverable: 3, closed: 1, unknown: 0,
|
||||
recoverable: 3, closed: 1, unknown: 0, pending_match: 2,
|
||||
aging: { warn_3d: 1, escalate_5d: 0, critical_7d: 0 },
|
||||
};
|
||||
const executablePayload = { items: [{ item_id: 21 }], counts: { executable_count: 1 } };
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
* 4s 轮询 GET /sources 直至全部脱离 fetching(ready/failed/expired/none);
|
||||
* 勾选集合以明细行 item_id 为键(历史回放行无 item_id 不可选);
|
||||
* 恢复处理 = 按明细 id 重查库存(batch-requery 是唯一后端);
|
||||
* 调拨类型配置(Task 7 接口化)= 模块级单飞拉取 GET /transfer-types,
|
||||
* 并发挂载共享同一在途请求,落定清槽不做长缓存;
|
||||
* 防重复点击(busy);错误统一 useMessage 展示 BusinessError;
|
||||
* 首页看板支持会话引导期预取(prefetchTransferHomeBoard 单飞,
|
||||
* loadBacklogSummary/loadExecutableItems 挂载时消费同一 Promise)。
|
||||
@@ -26,10 +28,12 @@ import {
|
||||
downloadTransferExceptions,
|
||||
downloadTransferReceiptFiles,
|
||||
executeTransferItems,
|
||||
fetchTransferTypes,
|
||||
getTransferBacklogSummary,
|
||||
getTransferMatching,
|
||||
getTransferRun,
|
||||
listExecutableTransferItems,
|
||||
listPendingMatchRecords,
|
||||
listTransferBacklog,
|
||||
listTransferSources,
|
||||
manualCloseTransferItem,
|
||||
@@ -44,10 +48,12 @@ import type {
|
||||
TransferMatchingDetail,
|
||||
TransferMatchingItem,
|
||||
TransferMatchingSummary,
|
||||
TransferPendingMatchRecord,
|
||||
TransferRunResult,
|
||||
TransferSourceOption,
|
||||
TransferSourceProgress,
|
||||
TransferType,
|
||||
TransferTypeOption,
|
||||
} from '../types/transfer.types';
|
||||
|
||||
/** Run 轮询间隔(ms):D9 融合卡「调拨单清单=进度=结果」按 4s 定时拉取 GET /runs/{run_no} */
|
||||
@@ -73,6 +79,23 @@ const SOURCE_POLL_MAX_CONSECUTIVE_FAILURES = 3;
|
||||
let homeBoardPrefetchSummary: Promise<TransferBacklogSummary> | null = null;
|
||||
let homeBoardPrefetchExecutable: ReturnType<typeof listExecutableTransferItems> | null = null;
|
||||
|
||||
/**
|
||||
* 调拨类型配置拉取(模块级单飞,Task 7 接口化):来源选择卡可能随会话消息多次挂载
|
||||
* (历史回放/刷新),并发调用共享同一在途请求防重复打点;请求落定即清槽
|
||||
* (配置可能被管理员调整,不做长缓存,顺序调用各自现发拿新鲜数据)。
|
||||
*/
|
||||
let transferTypesInFlight: Promise<TransferTypeOption[]> | null = null;
|
||||
|
||||
/** 模块级单飞拉取调拨类型:并发调用共享同一在途 Promise;落定(成功/失败)后清槽。 */
|
||||
function fetchTransferTypesOnce(): Promise<TransferTypeOption[]> {
|
||||
if (!transferTypesInFlight) {
|
||||
transferTypesInFlight = fetchTransferTypes().finally(() => {
|
||||
transferTypesInFlight = null;
|
||||
});
|
||||
}
|
||||
return transferTypesInFlight;
|
||||
}
|
||||
|
||||
/** 提前发起首页看板两请求(幂等:任一槽位在途/未消费时不重复发)。 */
|
||||
export function prefetchTransferHomeBoard(): void {
|
||||
if (homeBoardPrefetchSummary || homeBoardPrefetchExecutable) return;
|
||||
@@ -120,7 +143,10 @@ export function useChatTransfer() {
|
||||
const backlog = ref<TransferBacklogItem[]>([]);
|
||||
const backlogSummary = ref<TransferBacklogSummary | null>(null);
|
||||
const executableItems = ref<TransferMatchingItem[]>([]);
|
||||
/** 「待匹配」桶只读清单(D16:已落档尚未匹配的外部收料记录;无 item_id 不可执行) */
|
||||
const pendingMatchRecords = ref<TransferPendingMatchRecord[]>([]);
|
||||
const sourceOptions = ref<TransferSourceOption[]>([]);
|
||||
const transferTypes = ref<TransferTypeOption[]>([]);
|
||||
const selected = ref<Set<number>>(new Set());
|
||||
const busy = ref(false);
|
||||
const error = ref('');
|
||||
@@ -148,7 +174,8 @@ export function useChatTransfer() {
|
||||
const selectedCount = computed(() => selected.value.size);
|
||||
const estimatedQuantity = computed(() => matching.value?.estimated_transfer_quantity ?? '0');
|
||||
|
||||
/** 创建匹配(缺文件时来源级阶段展示等待/失败);transferType 决定收料数据范围,缺省在途仓至HUB仓 */
|
||||
/** 创建匹配(缺文件时来源级阶段展示等待/失败);transferType 为所选类型配置 code
|
||||
* (Task 7 接口化,来源选择卡接口选项选定值),决定收料数据范围与字段转换规则。 */
|
||||
async function createMatching(
|
||||
sourceCodes: string[],
|
||||
businessDate?: string,
|
||||
@@ -384,6 +411,18 @@ export function useChatTransfer() {
|
||||
return sourceOptions.value;
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载调拨类型配置(Task 7 接口化:来源选择卡类型选项的唯一数据源)。
|
||||
* 【AI 触发时机】:TransferMessageView 挂载 kind='source-select' 时调用;
|
||||
* 命中模块级单飞则复用在途请求,否则现发 GET /transfer-types 并写入 transferTypes。
|
||||
* 前端不加工不过滤(enabled 过滤/sort_order 排序在后端契约内,选项即接口真相)。
|
||||
*/
|
||||
async function loadTransferTypes() {
|
||||
const types = await fetchTransferTypesOnce();
|
||||
transferTypes.value = types;
|
||||
return types;
|
||||
}
|
||||
|
||||
/**
|
||||
* 停止来源状态轮询(幂等):递增 generation 使在途回调失效并清掉未触发定时器。
|
||||
* 【AI 触发时机】:离开来源选择卡(确认匹配切匹配卡/回放替换 payload)与
|
||||
@@ -495,6 +534,13 @@ export function useChatTransfer() {
|
||||
return executableItems.value;
|
||||
}
|
||||
|
||||
/** 加载「待匹配」桶只读清单(D16:待办看板第 4 张卡抽屉数据源;计数走 backlogSummary.pending_match)。
|
||||
* 匹配点选后记录被圈定即离开本桶,抽屉数据每次打开现拉(不做缓存)。 */
|
||||
async function loadPendingMatchRecords() {
|
||||
pendingMatchRecords.value = await listPendingMatchRecords();
|
||||
return pendingMatchRecords.value;
|
||||
}
|
||||
|
||||
/** 批量重查库存(单行隔离,结果由调用方刷新列表后展示) */
|
||||
async function batchRequery(itemIds: number[]): Promise<TransferBatchResult> {
|
||||
return batchRequeryTransferItems(itemIds);
|
||||
@@ -532,7 +578,9 @@ export function useChatTransfer() {
|
||||
backlog.value = [];
|
||||
backlogSummary.value = null;
|
||||
executableItems.value = [];
|
||||
pendingMatchRecords.value = [];
|
||||
sourceOptions.value = [];
|
||||
transferTypes.value = [];
|
||||
selected.value = new Set();
|
||||
error.value = '';
|
||||
}
|
||||
@@ -548,7 +596,9 @@ export function useChatTransfer() {
|
||||
backlog,
|
||||
backlogSummary,
|
||||
executableItems,
|
||||
pendingMatchRecords,
|
||||
sourceOptions,
|
||||
transferTypes,
|
||||
selected,
|
||||
selectedCount,
|
||||
executableItemIds,
|
||||
@@ -568,11 +618,13 @@ export function useChatTransfer() {
|
||||
retry,
|
||||
manualClose,
|
||||
loadSources,
|
||||
loadTransferTypes,
|
||||
retrySourceRpa,
|
||||
retrySourcesRpaBatch,
|
||||
loadBacklog,
|
||||
loadBacklogSummary,
|
||||
loadExecutableItems,
|
||||
loadPendingMatchRecords,
|
||||
batchRequery,
|
||||
resume,
|
||||
batchManualClose,
|
||||
|
||||
@@ -6,8 +6,32 @@
|
||||
* 单(TransferDocument)状态八态与 Run 调拨单清单(orders)对齐后端 Task 11 序列化。
|
||||
*/
|
||||
|
||||
/** 调拨业务类型(与后端 TransferType 枚举一致;类型 2/3 一期占位未开放) */
|
||||
export type TransferType = 'in_transit_to_hub' | 'hub_repair_out' | 'hub_to_hub';
|
||||
/**
|
||||
* 调拨业务类型(Task 7 配置化):code 由管理端调拨类型配置定义,前端不再枚举
|
||||
* 三值字面量(选项=GET /transfer-types 接口真相)。既有调用点(confirm 事件 /
|
||||
* createMatching payload)沿用此别名,值为任意配置 code 字符串。
|
||||
*/
|
||||
export type TransferType = string;
|
||||
|
||||
/** 调拨类型字段转换规则(与后端 field_transforms.TransformRule 对齐;一期仅 lot_no/prefix_replace) */
|
||||
export interface TransferTransformRule {
|
||||
field: string;
|
||||
op: string;
|
||||
source: string;
|
||||
target: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 调拨类型选项(GET /transfer-types data 逐项,最小暴露四键;enabled 过滤与
|
||||
* sort_order 升序由后端契约保证,前端原样透传不加工)。
|
||||
*/
|
||||
export interface TransferTypeOption {
|
||||
code: string;
|
||||
/** 多语言名称(zh-CN/zh-TW/en/th…);展示回退链 locale → zh-CN → en → code */
|
||||
names: Record<string, string>;
|
||||
sort_order: number;
|
||||
transform_rules: TransferTransformRule[];
|
||||
}
|
||||
|
||||
/** 匹配计数 */
|
||||
export interface TransferMatchingCounts {
|
||||
@@ -230,11 +254,12 @@ export interface TransferDocumentRetryResult {
|
||||
blocked: { invoice_no: string; item_id: number; reason: string }[];
|
||||
total: number;
|
||||
}
|
||||
/** 待处理池汇总 */
|
||||
/** 待处理池汇总(pending_match=「待匹配」桶计数 D16:已落档尚未匹配的外部收料记录) */
|
||||
export interface TransferBacklogSummary {
|
||||
recoverable: number;
|
||||
closed: number;
|
||||
unknown: number;
|
||||
pending_match: number;
|
||||
aging: {
|
||||
warn_3d: number;
|
||||
escalate_5d: number;
|
||||
@@ -242,6 +267,20 @@ export interface TransferBacklogSummary {
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* 「待匹配」桶记录(D16 只读投影):档记录尚无 items(未匹配/未库存核对),
|
||||
* 无 item_id——不可勾选执行,仅提供只读清单与「去匹配」引导。
|
||||
*/
|
||||
export interface TransferPendingMatchRecord {
|
||||
ledger_record_id: number;
|
||||
doc_no: string;
|
||||
material_code?: string | null;
|
||||
material_name?: string | null;
|
||||
movement_date?: string | null;
|
||||
source_code: string;
|
||||
quantity?: string | null;
|
||||
}
|
||||
|
||||
/** 来源实例选项(决策 3:平台仅分组,实例为执行边界) */
|
||||
export interface TransferSourceOption {
|
||||
source_code: string;
|
||||
|
||||
@@ -442,6 +442,7 @@
|
||||
"po_reservation": "Relation: PO + reservation ID",
|
||||
"po_fallback": "Relation: matched by PO",
|
||||
"mpn_fallback": "Relation: missing PO + part number",
|
||||
"reservation_heuristic": "Relation: bare-number reservation fallback (confirmation pending)",
|
||||
"unknown": "Relation pending confirmation"
|
||||
},
|
||||
"shippingOrderExtractionEmailSupplementField": {
|
||||
@@ -3878,12 +3879,7 @@
|
||||
"noBacklog": "No backlog exceptions",
|
||||
"sourceSelectTitle": "Select receipt source instances",
|
||||
"transferTypeLabel": "Transfer type",
|
||||
"transferType": {
|
||||
"in_transit_to_hub": "In-transit to HUB",
|
||||
"hub_repair_out": "HUB repair outbound",
|
||||
"hub_to_hub": "HUB to HUB"
|
||||
},
|
||||
"transferTypeComingSoon": "Coming soon",
|
||||
"transferTypeEmpty": "No transfer types available. Please contact an administrator to configure them in the admin console.",
|
||||
"matchParams": "Matching parameters",
|
||||
"selectAll": "Select all in group",
|
||||
"selectEnabledAll": "Select all enabled",
|
||||
@@ -3928,6 +3924,18 @@
|
||||
"homeBoardLabel": "To-do board",
|
||||
"homeExecutable": "Executable items",
|
||||
"homeExecutableHint": "Select rows and generate transfer orders",
|
||||
"transferPendingMatch": "Pending match",
|
||||
"transferPendingMatchHint": "External receipts captured but not matched yet",
|
||||
"transferPendingMatchTitle": "Receipts pending match",
|
||||
"transferPendingMatchEmpty": "No external receipts pending match",
|
||||
"transferPendingMatchGoMatch": "Go to match",
|
||||
"transferPendingMatchReadOnlyHint": "Records are not matched yet and cannot be executed; go to match to create executable items",
|
||||
"transferPendingMatchColSource": "Source",
|
||||
"transferPendingMatchColDocNo": "Doc No.",
|
||||
"transferPendingMatchColMaterial": "Material",
|
||||
"transferPendingMatchColName": "Name",
|
||||
"transferPendingMatchColDate": "Receipt date",
|
||||
"transferPendingMatchColQuantity": "Qty",
|
||||
"executableTitle": "Executable items",
|
||||
"executableEmpty": "No executable items",
|
||||
"executableSelectedCount": "{count} executable rows selected",
|
||||
|
||||
@@ -442,6 +442,7 @@
|
||||
"po_reservation": "วิธีเชื่อมโยง: PO + รหัสการจอง",
|
||||
"po_fallback": "วิธีเชื่อมโยง: จับคู่ด้วย PO",
|
||||
"mpn_fallback": "วิธีเชื่อมโยง: ไม่มี PO + หมายเลขชิ้นส่วน",
|
||||
"reservation_heuristic": "วิธีเชื่อมโยง: เติมรหัสการจองจากตัวเลขล้วน (รอยืนยัน)",
|
||||
"unknown": "รอยืนยันวิธีเชื่อมโยง"
|
||||
},
|
||||
"shippingOrderExtractionEmailSupplementField": {
|
||||
@@ -3878,12 +3879,7 @@
|
||||
"noBacklog": "ไม่มีรายการค้างดำเนินการ",
|
||||
"sourceSelectTitle": "เลือกแหล่งรับของ",
|
||||
"transferTypeLabel": "ประเภทการโอนย้าย",
|
||||
"transferType": {
|
||||
"in_transit_to_hub": "ระหว่างทางไปยัง HUB",
|
||||
"hub_repair_out": "ส่งออกซ่อมจาก HUB",
|
||||
"hub_to_hub": "โอนระหว่าง HUB"
|
||||
},
|
||||
"transferTypeComingSoon": "เร็ว ๆ นี้",
|
||||
"transferTypeEmpty": "ยังไม่มีประเภทการโอนย้ายที่พร้อมใช้งาน กรุณาติดต่อผู้ดูแลระบบเพื่อกำหนดค่าในหน้าผู้ดูแล",
|
||||
"matchParams": "พารามิเตอร์การจับคู่",
|
||||
"selectAll": "เลือกทั้งกลุ่ม",
|
||||
"selectEnabledAll": "เลือกที่เปิดใช้งานทั้งหมด",
|
||||
@@ -3928,6 +3924,18 @@
|
||||
"homeBoardLabel": "บอร์ดงานที่ต้องดำเนินการ",
|
||||
"homeExecutable": "รายการที่โอนได้",
|
||||
"homeExecutableHint": "เลือกแถวเพื่อสร้างใบโอน",
|
||||
"transferPendingMatch": "รอจับคู่",
|
||||
"transferPendingMatchHint": "บันทึกการรับสินค้าภายนอกที่ดึงมาแล้วแต่ยังไม่จับคู่",
|
||||
"transferPendingMatchTitle": "บันทึกการรับสินค้ารอจับคู่",
|
||||
"transferPendingMatchEmpty": "ไม่มีบันทึกการรับสินค้าภายนอกรอจับคู่",
|
||||
"transferPendingMatchGoMatch": "ไปจับคู่",
|
||||
"transferPendingMatchReadOnlyHint": "บันทึกยังไม่จับคู่ จึงดำเนินการไม่ได้ กดไปจับคู่เพื่อสร้างรายการที่โอนได้",
|
||||
"transferPendingMatchColSource": "แหล่งข้อมูล",
|
||||
"transferPendingMatchColDocNo": "เลขที่เอกสาร",
|
||||
"transferPendingMatchColMaterial": "รหัสสินค้า",
|
||||
"transferPendingMatchColName": "ชื่อสินค้า",
|
||||
"transferPendingMatchColDate": "วันที่รับสินค้า",
|
||||
"transferPendingMatchColQuantity": "จำนวน",
|
||||
"executableTitle": "รายการที่โอนได้",
|
||||
"executableEmpty": "ไม่มีรายการที่โอนได้",
|
||||
"executableSelectedCount": "เลือกแล้ว {count} รายการ",
|
||||
|
||||
@@ -476,6 +476,7 @@
|
||||
"po_reservation": "关联方式:PO + 预约号",
|
||||
"po_fallback": "关联方式:按 PO 匹配",
|
||||
"mpn_fallback": "关联方式:PO 缺失 + 料号",
|
||||
"reservation_heuristic": "关联方式:预约单号裸数字兜底(待人工确认)",
|
||||
"unknown": "关联方式待确认"
|
||||
},
|
||||
"shippingOrderExtractionEmailSupplementField": {
|
||||
@@ -3877,12 +3878,7 @@
|
||||
"noBacklog": "暂无待处理异常",
|
||||
"sourceSelectTitle": "选择收料来源实例",
|
||||
"transferTypeLabel": "调拨类型",
|
||||
"transferType": {
|
||||
"in_transit_to_hub": "在途仓至HUB仓",
|
||||
"hub_repair_out": "HUB仓维修出",
|
||||
"hub_to_hub": "HUB仓间调拨"
|
||||
},
|
||||
"transferTypeComingSoon": "即将上线",
|
||||
"transferTypeEmpty": "暂无可用调拨类型,请联系管理员在管理端配置",
|
||||
"matchParams": "匹配参数",
|
||||
"selectAll": "本组全选",
|
||||
"selectEnabledAll": "全选已启用",
|
||||
@@ -3927,6 +3923,18 @@
|
||||
"homeBoardLabel": "待办看板",
|
||||
"homeExecutable": "可调拨明细",
|
||||
"homeExecutableHint": "勾选后按行生成调拨单",
|
||||
"transferPendingMatch": "待匹配",
|
||||
"transferPendingMatchHint": "已抓取尚未匹配的外部收料记录",
|
||||
"transferPendingMatchTitle": "待匹配收料记录",
|
||||
"transferPendingMatchEmpty": "暂无待匹配的外部收料记录",
|
||||
"transferPendingMatchGoMatch": "去匹配",
|
||||
"transferPendingMatchReadOnlyHint": "记录尚未匹配,暂不可执行;点「去匹配」按类型圈定生成可调拨明细",
|
||||
"transferPendingMatchColSource": "来源",
|
||||
"transferPendingMatchColDocNo": "单号",
|
||||
"transferPendingMatchColMaterial": "料号",
|
||||
"transferPendingMatchColName": "品名",
|
||||
"transferPendingMatchColDate": "收料日期",
|
||||
"transferPendingMatchColQuantity": "数量",
|
||||
"executableTitle": "可调拨明细",
|
||||
"executableEmpty": "暂无可调拨明细",
|
||||
"executableSelectedCount": "已选 {count} 笔可执行明细",
|
||||
|
||||
@@ -442,6 +442,7 @@
|
||||
"po_reservation": "關聯方式:PO + 預約號",
|
||||
"po_fallback": "關聯方式:依 PO 配對",
|
||||
"mpn_fallback": "關聯方式:PO 缺失 + 料號",
|
||||
"reservation_heuristic": "關聯方式:預約單號裸數字兜底(待人工確認)",
|
||||
"unknown": "關聯方式待確認"
|
||||
},
|
||||
"shippingOrderExtractionEmailSupplementField": {
|
||||
@@ -3878,12 +3879,7 @@
|
||||
"noBacklog": "暫無待處理異常",
|
||||
"sourceSelectTitle": "選擇收料來源實例",
|
||||
"transferTypeLabel": "調撥類型",
|
||||
"transferType": {
|
||||
"in_transit_to_hub": "在途倉至HUB倉",
|
||||
"hub_repair_out": "HUB倉維修出",
|
||||
"hub_to_hub": "HUB倉間調撥"
|
||||
},
|
||||
"transferTypeComingSoon": "即將上線",
|
||||
"transferTypeEmpty": "暫無可用調撥類型,請聯絡管理員在管理端配置",
|
||||
"matchParams": "匹配參數",
|
||||
"selectAll": "本組全選",
|
||||
"selectEnabledAll": "全選已啟用",
|
||||
@@ -3928,6 +3924,18 @@
|
||||
"homeBoardLabel": "待辦看板",
|
||||
"homeExecutable": "可調撥明細",
|
||||
"homeExecutableHint": "勾選後按行產生調撥單",
|
||||
"transferPendingMatch": "待匹配",
|
||||
"transferPendingMatchHint": "已抓取尚未匹配的外部收料記錄",
|
||||
"transferPendingMatchTitle": "待匹配收料記錄",
|
||||
"transferPendingMatchEmpty": "暫無待匹配的外部收料記錄",
|
||||
"transferPendingMatchGoMatch": "去匹配",
|
||||
"transferPendingMatchReadOnlyHint": "記錄尚未匹配,暫不可執行;點「去匹配」按類型圈定產生可調撥明細",
|
||||
"transferPendingMatchColSource": "來源",
|
||||
"transferPendingMatchColDocNo": "單號",
|
||||
"transferPendingMatchColMaterial": "料號",
|
||||
"transferPendingMatchColName": "品名",
|
||||
"transferPendingMatchColDate": "收料日期",
|
||||
"transferPendingMatchColQuantity": "數量",
|
||||
"executableTitle": "可調撥明細",
|
||||
"executableEmpty": "暫無可調撥明細",
|
||||
"executableSelectedCount": "已選 {count} 筆可執行明細",
|
||||
|
||||
Reference in new issue
Block a user