feat(in-transit-transfer): inbound/outbound 幂等重命名与解析用途分层
- receipt→inbound 三件套改名(回调桥/文件门禁/触发服务),回调链幂等去重,迁移 tt14 同步台账键与测试基建 - 库存解析用途分层 onhand/inbound/outbound(迁移 tt15):解析档案、文件存储与下载名按用途隔离,管理端表单同步 - 「成熟」概念退役(迁移 tt16):数据无成熟属性,日期边界由调用方入参严格判定 - backlog 新增重解析服务,在途重识别投影 processing,EML 父项不再停留处理中 - 收料 RPA 回调/归档/排程链路同步改名挂点,运维脚本复位假完成状态 - 文档随批:ADR 0003 模块边界决策、10-15/10-16 计划与设计、调拨文档族与 demand/tec/funclist - 同步 chat/errors 文案四语言、调拨前端卡片与 e2e、测试全家
This commit is contained in:
1 parent
43dceaf027
commit
8102a1fe44
151 files changed
+8057
-2382
No files matched your search
+1
-1
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* features/admin/modules/shipping-inventory/movementParsingProfileForm.ts
|
||||
* 用途:组装收料异动解析规则(purpose='movement')的标准字段映射载荷。
|
||||
* 用途:组装入站解析规则(purpose='inbound')的标准异动字段映射载荷。
|
||||
* 依赖:无外部依赖。
|
||||
* 逻辑:标准异动字段目录由后端 /admin/shipping-notice/movement-fields 只读下发,
|
||||
* 本模块只做裁剪与校验——映射键是契约 code,必填字段缺失阻断保存;
|
||||
|
||||
@@ -28,6 +28,8 @@ vi.mock('@/shared/utils/auth', () => ({
|
||||
import {
|
||||
cancelTransferRun,
|
||||
createTransferMatching,
|
||||
downloadTransferInboundFiles,
|
||||
downloadTransferSourceFiles,
|
||||
executeTransferItems,
|
||||
getTransferBacklogSummary,
|
||||
getTransferMatching,
|
||||
@@ -52,6 +54,32 @@ describe('transfer.api JSON request contract', () => {
|
||||
expect(init.body).toBe(JSON.stringify({ source_codes: ['DBS-AWSBI'], business_date: '2026-08-18' }));
|
||||
});
|
||||
|
||||
it('创建匹配查询范围参数名为 movement_date_from/to(Task 3 契约更名)', () => {
|
||||
// [断言意图] 后端 /matchings 入参更名(Task 3):查询范围参数名为
|
||||
// movement_date_from/to;body 键名必须逐字对齐,错名会被后端当作缺省
|
||||
// (范围不生效)而非报错。
|
||||
createTransferMatching({ source_codes: ['DBS-AWSBI'], movement_date_from: '2026-09-26', movement_date_to: '2026-09-26' });
|
||||
const [, init] = requestJson.mock.calls[0] as [string, RequestInit];
|
||||
expect(init.body).toBe(JSON.stringify({ source_codes: ['DBS-AWSBI'], movement_date_from: '2026-09-26', movement_date_to: '2026-09-26' }));
|
||||
});
|
||||
|
||||
it('下载出入站来源文件走 GET /runs/{run_no}/inbound-files(Task 3 路由更名)', () => {
|
||||
// [断言意图] Task 3 路由更名(出入站来源文件 inbound-files)后前端 URL 逐字对齐;
|
||||
// blob 端点只需鉴权头(既有契约)。
|
||||
downloadTransferInboundFiles('RUN-1');
|
||||
const [url, init] = requestBlob.mock.calls[0] as [string, RequestInit];
|
||||
expect(url).toBe('/api/in-transit-transfer/runs/RUN-1/inbound-files');
|
||||
expect(init.headers).toBeDefined();
|
||||
});
|
||||
|
||||
it('按来源打包下载走 POST /sources/inbound-files(Task 3 路由更名)', () => {
|
||||
downloadTransferSourceFiles(['DBS-AWSBI']);
|
||||
const [url, init] = requestBlob.mock.calls[0] as [string, RequestInit];
|
||||
expect(url).toBe('/api/in-transit-transfer/sources/inbound-files');
|
||||
expect(init.method).toBe('POST');
|
||||
expect(init.body).toBe(JSON.stringify({ source_codes: ['DBS-AWSBI'] }));
|
||||
});
|
||||
|
||||
it('按明细行执行调拨 POST /items/execute 带 application/json 与 item_ids 契约', () => {
|
||||
// [断言意图] 行式执行(2026-09-23 item-centric 重构):执行不再挂在旧匹配详情端点下,
|
||||
// 改为独立 items/execute,body 键从 invoice_nos 改为 item_ids;JSON 头契约不变。
|
||||
@@ -88,7 +116,7 @@ describe('transfer.api JSON request contract', () => {
|
||||
// (Task 11)一致,前端只透传不加工;类型层 TransferRunResult 必含 orders: TransferOrder[]。
|
||||
const order: TransferOrder = {
|
||||
doc_no: 'HTT-OR-26092300001',
|
||||
receipt_date: '2026-09-23',
|
||||
movement_date: '2026-09-23',
|
||||
from_warehouse: 'HTT-B25',
|
||||
to_warehouse: 'HTT-B02',
|
||||
status: 'success',
|
||||
@@ -153,7 +181,7 @@ describe('transfer.api D8 异步 202 契约(真实 requestJson:200/202 均
|
||||
vi.stubGlobal('fetch', fetchMock);
|
||||
const order: TransferOrder = {
|
||||
doc_no: 'HTT-OR-26092300002',
|
||||
receipt_date: '2026-09-23',
|
||||
movement_date: '2026-09-23',
|
||||
from_warehouse: 'HTT-B25',
|
||||
to_warehouse: 'HTT-B02',
|
||||
status: 'executing',
|
||||
|
||||
@@ -19,6 +19,8 @@ import type {
|
||||
TransferMatchingSummary,
|
||||
TransferRunResult,
|
||||
TransferPendingMatchRecord,
|
||||
TransferPendingMatchReparsePreview,
|
||||
TransferPendingMatchReparseResult,
|
||||
TransferSourceFileStatus,
|
||||
TransferSourceOption,
|
||||
TransferType,
|
||||
@@ -33,8 +35,9 @@ const jsonHeaders = () => ({ 'Content-Type': 'application/json', ...getAuthHeade
|
||||
export interface CreateMatchingPayload {
|
||||
source_codes: string[];
|
||||
business_date?: string;
|
||||
receipt_date_from?: string;
|
||||
receipt_date_to?: string;
|
||||
/** 匹配查询范围(异动日期;Task 3 契约更名后参数名,旧名见 git 历史) */
|
||||
movement_date_from?: string;
|
||||
movement_date_to?: string;
|
||||
/** 调拨业务类型 code(Task 7 接口化:来源选择卡接口选项所选值;缺省行为由后端匹配链路决定) */
|
||||
transfer_type?: TransferType;
|
||||
}
|
||||
@@ -176,9 +179,9 @@ export const manualCloseTransferItem = (itemId: number, reason: string) =>
|
||||
body: JSON.stringify({ reason }),
|
||||
});
|
||||
|
||||
/** 下载收料来源文件(zip) */
|
||||
export const downloadTransferReceiptFiles = (runNo: string) =>
|
||||
requestBlob(`${BASE}/runs/${runNo}/receipt-files`, { headers: getAuthHeaders() });
|
||||
/** 下载出入站来源文件(zip;Task 3 路由更名后端点为 inbound-files) */
|
||||
export const downloadTransferInboundFiles = (runNo: string) =>
|
||||
requestBlob(`${BASE}/runs/${runNo}/inbound-files`, { headers: getAuthHeaders() });
|
||||
|
||||
/** 下载匹配冻结的 ERP 库存表(csv) */
|
||||
export const downloadTransferErpInventory = (runNo: string) =>
|
||||
@@ -211,31 +214,81 @@ export const requeryTransferMatchingItems = (matchingNo: string, invoiceNos?: st
|
||||
{ method: 'POST', body: JSON.stringify(invoiceNos ? { invoice_nos: invoiceNos } : {}), headers: { ...getAuthHeaders(), 'Content-Type': 'application/json' } },
|
||||
);
|
||||
|
||||
/** 按选中来源打包下载各自最新归档收料文件(zip) */
|
||||
/** 按选中来源打包下载各自最新归档入站文件(zip;Task 3 路由更名) */
|
||||
export const downloadTransferSourceFiles = (sourceCodes: string[]) =>
|
||||
requestBlob(`${BASE}/sources/receipt-files`, {
|
||||
requestBlob(`${BASE}/sources/inbound-files`, {
|
||||
method: 'POST',
|
||||
headers: { ...getAuthHeaders(), 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ source_codes: sourceCodes }),
|
||||
});
|
||||
|
||||
/** 待处理异常列表(可恢复/已关闭/结果未知 + 老化等级) */
|
||||
export const listTransferBacklog = () =>
|
||||
requestJson<TransferBacklogItem[]>(`${BASE}/backlog`, { headers: getAuthHeaders() });
|
||||
/**
|
||||
* 待处理异常池分页查询(2026-10-16 服务端分页 + 筛选下推:池为无界增长集合,
|
||||
* 全量拉取在千行级放大载荷与老化查询规模;后端不带分页参数时返回全量数组为
|
||||
* 兼容口径,本前端恒走分页)。
|
||||
* keyword/resultFilter 对应后端 keyword/result_filter(筛选在服务端执行,
|
||||
* total=筛选后全量计数);返回 {items=当前页切片, total, page, page_size}。
|
||||
*/
|
||||
export interface TransferBacklogPageQuery {
|
||||
page: number;
|
||||
pageSize: number;
|
||||
keyword?: string;
|
||||
resultFilter?: 'all' | 'recoverable' | 'closed' | 'unknown';
|
||||
}
|
||||
|
||||
export const listTransferBacklogPage = (query: TransferBacklogPageQuery) => {
|
||||
const params = new URLSearchParams({
|
||||
page: String(query.page),
|
||||
page_size: String(query.pageSize),
|
||||
});
|
||||
if (query.keyword?.trim()) params.set('keyword', query.keyword.trim());
|
||||
if (query.resultFilter && query.resultFilter !== 'all') params.set('result_filter', query.resultFilter);
|
||||
return requestJson<{ items: TransferBacklogItem[]; total: number; page: number; page_size: number }>(
|
||||
`${BASE}/backlog?${params.toString()}`,
|
||||
{ headers: getAuthHeaders() },
|
||||
);
|
||||
};
|
||||
|
||||
/** 待处理异常汇总(含 3/5/7 天老化分级 + 待匹配桶计数 pending_match D16) */
|
||||
export const getTransferBacklogSummary = () =>
|
||||
requestJson<TransferBacklogSummary>(`${BASE}/backlog/summary`, { headers: getAuthHeaders() });
|
||||
|
||||
/**
|
||||
* 「待匹配」桶清单(D16 只读):启用类型范围并集内已落档、尚未被任何匹配圈定的
|
||||
* 外部收料记录。无 item_id——不可勾选执行,仅用于首页第 4 张卡的只读抽屉清单
|
||||
* 与「去匹配」引导(入口=createTransferMatching 的来源选择卡)。
|
||||
* 「待匹配」桶分页清单(D16 只读,2026-10-16 服务端分页:桶为 951 行级大池,
|
||||
* 全量序列化/传输从 O(桶) 降到 O(页))。无 item_id——不可勾选执行,仅用于
|
||||
* 首页第 4 张卡的只读抽屉清单与「去匹配」引导。
|
||||
* 返回 {records=当前页切片, total=桶全量计数, page, page_size}。
|
||||
*/
|
||||
export const listPendingMatchRecords = () =>
|
||||
requestJson<TransferPendingMatchRecord[]>(`${BASE}/backlog/pending-match`, { headers: getAuthHeaders() });
|
||||
export const listPendingMatchRecordsPage = (query: { page: number; pageSize: number }) =>
|
||||
requestJson<{ records: TransferPendingMatchRecord[]; total: number; page: number; page_size: number }>(
|
||||
`${BASE}/backlog/pending-match?page=${query.page}&page_size=${query.pageSize}`,
|
||||
{ headers: getAuthHeaders() },
|
||||
);
|
||||
|
||||
/** 来源实例列表(平台 DBS/Crane 仅分组,每来源附收料文件状态) */
|
||||
/**
|
||||
* 「清空并重新解析」预检(后端 Task 7,只读零副作用):确认弹窗唯一数据源。
|
||||
* 返回 {files, profile|None, clearable_rows, kept_rows}——弹窗展示文件份数/
|
||||
* 规则 code+version(profile=null=未绑定解析规则)/将清除与证据缺失保留行数。
|
||||
*/
|
||||
export const fetchPendingMatchReparsePreview = (sourceCode: string) =>
|
||||
requestJson<TransferPendingMatchReparsePreview>(
|
||||
`${BASE}/backlog/pending-match/reparse-preview?source_code=${encodeURIComponent(sourceCode)}`,
|
||||
{ headers: getAuthHeaders() },
|
||||
);
|
||||
|
||||
/**
|
||||
* 「清空并重新解析」执行(后端 Task 7,单事务由后端服务提交并落审计)。
|
||||
* 任一归档解析失败整体中止(TRANSFER.REPARSE_PARSE_FAILED,一行不删)→
|
||||
* requestJson 抛 BusinessError,由调用方展示「中止未删」语义。
|
||||
*/
|
||||
export const reparsePendingMatch = (sourceCode: string) =>
|
||||
requestJson<TransferPendingMatchReparseResult>(`${BASE}/backlog/pending-match/reparse`, {
|
||||
method: 'POST',
|
||||
headers: jsonHeaders(),
|
||||
body: JSON.stringify({ source_code: sourceCode }),
|
||||
});
|
||||
|
||||
/** 来源实例列表(平台 DBS/Crane 仅分组,每来源附入站文件状态) */
|
||||
export const listTransferSources = () =>
|
||||
requestJson<TransferSourceOption[]>(`${BASE}/sources`, { headers: getAuthHeaders() });
|
||||
|
||||
@@ -248,7 +301,7 @@ export interface TransferRetryRpaReparseResult {
|
||||
}
|
||||
|
||||
/** 来源重试(解析失败分层 2026-09-29):parse_failed 先本地重解析返回 200 reparse 结果,
|
||||
* 其余状态重新触发一次收料 RPA 抓取(202 + fetching / 配置缺失 fail-closed) */
|
||||
* 其余状态重新触发一次入站 RPA 抓取(202 + fetching / 配置缺失 fail-closed) */
|
||||
export const retryTransferSourceRpa = (sourceCode: string) =>
|
||||
requestJson<TransferRetryRpaReparseResult | TransferSourceFileStatus>(`${BASE}/sources/${encodeURIComponent(sourceCode)}/retry-rpa`, {
|
||||
method: 'POST',
|
||||
|
||||
@@ -2,23 +2,37 @@
|
||||
features/chat/components/messages/TransferBacklogSummaryCard.vue
|
||||
用途:待处理异常卡(可恢复/已关闭/结果未知三组)——列与匹配窗口一致,
|
||||
支持关键字/结果筛选、多选批量操作(重查/恢复/关闭)与行级快捷操作。
|
||||
依赖:props.items、i18n chat.transfer.*、transferBatch.deriveBatchNo、transferFormat.formatQuantity。
|
||||
逻辑:仅 blocked_recoverable 可勾选与操作;result_unknown / manually_closed 只读;
|
||||
依赖:Element Plus ElTable/ElTableColumn/ElSelect/ElOption/ElPagination、
|
||||
props.items(服务端返回的当前页切片)+ props.total(筛选后全量计数)、
|
||||
i18n chat.transfer.*、transferBatch.deriveBatchNo、transferFormat.formatQuantity。
|
||||
逻辑:2026-10-16 服务端分页 + 筛选下推(后端 GET /backlog page/page_size/
|
||||
keyword/result_filter)——本组件只持有筛选 UI 态并向父级上抛 query-change,
|
||||
由宿主经 useChatTransfer.loadBacklog 拉取当前页;行渲染/勾选/批量语义:
|
||||
仅 blocked_recoverable 可勾选与操作;result_unknown / manually_closed 只读;
|
||||
可恢复行按 result_code 细分徽标(blocked_file_removed=文件已移除);
|
||||
blocked_file_removed 行行内仅留「关闭」(重查不可恢复——消失证据
|
||||
无法由重查翻回,唯一出口=人工关闭或等文件重新同步);
|
||||
批量按钮与行内按钮同用短文案键(重查/恢复/关闭,2026-10-12 文案一致化,
|
||||
完整语义经 title 悬浮),勾选计数保留;
|
||||
勾选集合为卡片本地态,操作经 emit 交父组件调用批量端点并刷新。
|
||||
完整语义经 title 悬浮)。
|
||||
勾选集合跨页保留(翻页/筛选不清空;批量计数=勾选总数,后端逐行校验兜底);
|
||||
关键字 300ms 防抖后上抛,筛选/翻页变更即上抛,首挂载上抛初始切片查询
|
||||
(首页计数卡进入时 initialFilter 直接生效)。
|
||||
行定位:el-table 行不支持逐行 attr,行 testid 改经 row-class-name 注入
|
||||
(transfer-backlog-row-<invoice_no>,spec/e2e 用类选择器等价定位)。
|
||||
-->
|
||||
<script setup lang="ts">
|
||||
import { computed, ref } from 'vue';
|
||||
import { computed, onBeforeUnmount, onMounted, ref, watch } from 'vue';
|
||||
import { ElPagination, ElTable, ElTableColumn, ElSelect, ElOption } from 'element-plus';
|
||||
import { TRANSFER_PAGE_SIZE } from '../../composables/useChatTransfer';
|
||||
import { deriveBatchNo } from './transferBatch';
|
||||
import { formatQuantity } from './transferFormat';
|
||||
import type { TransferBacklogItem } from '../../types/transfer.types';
|
||||
|
||||
const props = defineProps<{
|
||||
/** 当前页行切片(服务端分页返回;筛选在服务端执行)。 */
|
||||
items: TransferBacklogItem[];
|
||||
/** 筛选后全量计数(分页器数据源;不传视为 0=隐藏分页条)。 */
|
||||
total?: number;
|
||||
busy?: boolean;
|
||||
/** 初始结果筛选(首页计数卡切片进入:closed 卡落「已关闭」切片等)。 */
|
||||
initialFilter?: 'all' | 'recoverable' | 'closed' | 'unknown';
|
||||
@@ -31,12 +45,19 @@ const emit = defineEmits<{
|
||||
requery: [itemIds: number[]];
|
||||
close: [item: TransferBacklogItem];
|
||||
batchClose: [itemIds: number[]];
|
||||
/** 查询变更(翻页/筛选/首挂载):宿主据此调用 loadBacklog 拉取对应页。 */
|
||||
'query-change': [query: { page: number; keyword: string; resultFilter: 'all' | 'recoverable' | 'closed' | 'unknown' }];
|
||||
}>();
|
||||
|
||||
/** 勾选集合(本地视图态;仅可恢复行可勾选)。 */
|
||||
/** 每页行数(与组合式函数 loadBacklog 默认 pageSize 同源:TRANSFER_PAGE_SIZE)。 */
|
||||
const PAGE_SIZE = TRANSFER_PAGE_SIZE;
|
||||
|
||||
/** 勾选集合(本地视图态;仅可恢复行可勾选;跨页保留——批量计数=勾选总数,
|
||||
* 行状态变化由后端批量端点逐行校验兜底)。 */
|
||||
const selectedIds = ref<Set<number>>(new Set());
|
||||
const keyword = ref('');
|
||||
const resultFilter = ref<'all' | 'recoverable' | 'closed' | 'unknown'>(props.initialFilter ?? 'all');
|
||||
const currentPage = ref(1);
|
||||
|
||||
function isActionable(item: TransferBacklogItem): boolean {
|
||||
return item.status === 'blocked_recoverable';
|
||||
@@ -50,27 +71,10 @@ function isFileRemoved(item: TransferBacklogItem): boolean {
|
||||
return item.result_code === 'blocked_file_removed';
|
||||
}
|
||||
|
||||
const filtered = computed(() =>
|
||||
props.items.filter((item) => {
|
||||
const kw = keyword.value.trim().toLowerCase();
|
||||
if (kw) {
|
||||
const haystack = [item.invoice_no, item.material_no, item.material_name, item.source_code]
|
||||
.map((value) => String(value ?? '').toLowerCase());
|
||||
if (!haystack.some((value) => value.includes(kw))) return false;
|
||||
}
|
||||
if (resultFilter.value === 'recoverable' && item.status !== 'blocked_recoverable') return false;
|
||||
if (resultFilter.value === 'closed' && item.status !== 'manually_closed') return false;
|
||||
if (resultFilter.value === 'unknown' && item.status !== 'result_unknown') return false;
|
||||
return true;
|
||||
}),
|
||||
);
|
||||
|
||||
const selectedActionableIds = computed(() =>
|
||||
filtered.value.filter((item) => isActionable(item) && selectedIds.value.has(item.item_id)).map((item) => item.item_id),
|
||||
);
|
||||
const selectedActionableIds = computed(() => [...selectedIds.value]);
|
||||
|
||||
const allFilteredSelected = computed(() => {
|
||||
const actionable = filtered.value.filter(isActionable);
|
||||
const actionable = props.items.filter(isActionable);
|
||||
return actionable.length > 0 && actionable.every((item) => selectedIds.value.has(item.item_id));
|
||||
});
|
||||
|
||||
@@ -83,7 +87,7 @@ function toggleRow(item: TransferBacklogItem, checked: boolean) {
|
||||
|
||||
function toggleAll(checked: boolean) {
|
||||
const next = new Set(selectedIds.value);
|
||||
for (const item of filtered.value.filter(isActionable)) {
|
||||
for (const item of props.items.filter(isActionable)) {
|
||||
if (checked) next.add(item.item_id);
|
||||
else next.delete(item.item_id);
|
||||
}
|
||||
@@ -94,12 +98,39 @@ function clearSelection() {
|
||||
selectedIds.value = new Set();
|
||||
}
|
||||
|
||||
/** 行操作后/刷新后清理已消失行的勾选残留。 */
|
||||
function pruneSelection() {
|
||||
const alive = new Set(props.items.map((item) => item.item_id));
|
||||
selectedIds.value = new Set([...selectedIds.value].filter((id) => alive.has(id)));
|
||||
// [STEP 1] 查询上抛:翻页/筛选立即上抛,关键字 300ms 防抖(服务端逐次查询防抖动);
|
||||
// 首挂载即上抛初始切片查询(宿主不再兜底首拉,避免双请求)。
|
||||
function emitQuery() {
|
||||
emit('query-change', { page: currentPage.value, keyword: keyword.value.trim(), resultFilter: resultFilter.value });
|
||||
}
|
||||
defineExpose({ pruneSelection });
|
||||
|
||||
watch(currentPage, () => emitQuery());
|
||||
|
||||
watch(resultFilter, () => {
|
||||
if (currentPage.value !== 1) currentPage.value = 1; // 翻页 watch 负责上抛
|
||||
else emitQuery();
|
||||
});
|
||||
|
||||
let keywordTimer: ReturnType<typeof setTimeout> | undefined;
|
||||
watch(keyword, () => {
|
||||
clearTimeout(keywordTimer);
|
||||
keywordTimer = setTimeout(() => {
|
||||
if (currentPage.value !== 1) currentPage.value = 1;
|
||||
else emitQuery();
|
||||
}, 300);
|
||||
});
|
||||
|
||||
onBeforeUnmount(() => clearTimeout(keywordTimer));
|
||||
|
||||
onMounted(() => emitQuery());
|
||||
|
||||
// [STEP 2] 行操作/刷新后总行数变小:收拢当前页防空白页(越界时回落末页并重查)。
|
||||
watch(() => props.total, (total = 0) => {
|
||||
const maxPage = Math.max(1, Math.ceil(total / PAGE_SIZE));
|
||||
if (currentPage.value > maxPage) {
|
||||
currentPage.value = maxPage; // 翻页 watch 负责上抛
|
||||
}
|
||||
});
|
||||
|
||||
function agingLabel(level: string): string {
|
||||
const map: Record<string, string> = {
|
||||
@@ -116,6 +147,16 @@ function rowKey(item: TransferBacklogItem): string {
|
||||
return `${item.item_id}|${item.invoice_no}`;
|
||||
}
|
||||
|
||||
/**
|
||||
* el-table 行类:注入行定位类(替代旧行 testid)+ 不可操作行置灰(同旧行样式)。
|
||||
*/
|
||||
function rowClassName({ row }: { row: TransferBacklogItem }): string {
|
||||
return [
|
||||
`transfer-backlog-row-${row.invoice_no}`,
|
||||
isActionable(row) ? '' : 'bg-surface-soft text-muted',
|
||||
].filter(Boolean).join(' ');
|
||||
}
|
||||
|
||||
/** 结果徽标文案键:可恢复行按 result_code 细分(blocked_file_removed=文件已移除),其余按状态。 */
|
||||
function resultLabelKey(item: TransferBacklogItem): string {
|
||||
if (item.status === 'result_unknown') return 'chat.transfer.resultUnknown';
|
||||
@@ -140,7 +181,7 @@ function resultLabelKey(item: TransferBacklogItem): string {
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- 批量操作条:勾选 ≥1 行时原位替换筛选区 -->
|
||||
<!-- 批量操作条:勾选 ≥1 行时原位替换筛选区(跨页勾选同样计入) -->
|
||||
<div v-if="selectedActionableIds.length" class="mb-2 flex flex-wrap items-center gap-2">
|
||||
<span class="text-xs font-bold text-secondary" data-testid="transfer-backlog-selected-count">
|
||||
{{ $t('chat.transfer.selectedRows', { count: selectedActionableIds.length }) }}
|
||||
@@ -193,138 +234,156 @@ function resultLabelKey(item: TransferBacklogItem): string {
|
||||
:placeholder="$t('chat.transfer.filterPlaceholder')"
|
||||
data-testid="transfer-backlog-filter"
|
||||
/>
|
||||
<select
|
||||
v-model="resultFilter"
|
||||
class="rounded-lg border border-default bg-surface px-2 py-1 text-xs text-primary"
|
||||
data-testid="transfer-backlog-result-filter"
|
||||
>
|
||||
<option value="all">{{ $t('chat.transfer.filterAll') }}</option>
|
||||
<option value="recoverable">{{ $t('chat.transfer.homeRecoverable') }}</option>
|
||||
<option value="closed">{{ $t('chat.transfer.homeClosed') }}</option>
|
||||
<option value="unknown">{{ $t('chat.transfer.homeUnknown') }}</option>
|
||||
</select>
|
||||
<!-- el-select 默认 width:100%(EP 样式会覆盖工具类),外包定宽容器锁定紧凑尺寸,
|
||||
与关键字输入并排一行,避免筛选区独占两行 -->
|
||||
<div class="w-32 shrink-0">
|
||||
<el-select
|
||||
v-model="resultFilter"
|
||||
size="small"
|
||||
data-testid="transfer-backlog-result-filter"
|
||||
:aria-label="$t('chat.transfer.colResult')"
|
||||
>
|
||||
<el-option value="all" :label="$t('chat.transfer.filterAll')" />
|
||||
<el-option value="recoverable" :label="$t('chat.transfer.homeRecoverable')" />
|
||||
<el-option value="closed" :label="$t('chat.transfer.homeClosed')" />
|
||||
<el-option value="unknown" :label="$t('chat.transfer.homeUnknown')" />
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="filtered.length" class="overflow-x-auto">
|
||||
<table class="w-full min-w-[1360px] text-xs" data-testid="transfer-backlog-table">
|
||||
<thead>
|
||||
<tr class="border-b border-default bg-surface-soft text-left text-[11px] text-muted">
|
||||
<th class="p-2">
|
||||
<input
|
||||
type="checkbox"
|
||||
:checked="allFilteredSelected"
|
||||
data-testid="transfer-backlog-select-all"
|
||||
@change="toggleAll(($event.target as HTMLInputElement).checked)"
|
||||
/>
|
||||
</th>
|
||||
<!-- 表头全列 nowrap:防「拨出仓库/匹配结果」等折行;品名列吃剩余宽度 -->
|
||||
<th class="whitespace-nowrap p-2">{{ $t('chat.transfer.colSource') }}</th>
|
||||
<th class="whitespace-nowrap p-2">{{ $t('chat.transfer.colInvoice') }}</th>
|
||||
<th class="whitespace-nowrap p-2">{{ $t('chat.transfer.colReceiptDate') }}</th>
|
||||
<th class="whitespace-nowrap p-2">{{ $t('chat.transfer.colMaterial') }}</th>
|
||||
<th class="whitespace-nowrap p-2">{{ $t('chat.transfer.colName') }}</th>
|
||||
<th class="whitespace-nowrap p-2">{{ $t('chat.transfer.colFromWarehouse') }}</th>
|
||||
<th class="whitespace-nowrap p-2">{{ $t('chat.transfer.colFromBatch') }}</th>
|
||||
<th class="whitespace-nowrap p-2">{{ $t('chat.transfer.colFromQty') }}</th>
|
||||
<th class="whitespace-nowrap p-2">{{ $t('chat.transfer.colToWarehouse') }}</th>
|
||||
<th class="whitespace-nowrap p-2">{{ $t('chat.transfer.colToQty') }}</th>
|
||||
<th class="whitespace-nowrap p-2">{{ $t('chat.transfer.colResult') }}</th>
|
||||
<th class="whitespace-nowrap p-2">{{ $t('chat.transfer.colAging') }}</th>
|
||||
<th class="whitespace-nowrap p-2">{{ $t('chat.transfer.colAction') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr
|
||||
v-for="item in filtered"
|
||||
:key="rowKey(item)"
|
||||
class="border-b border-subtle"
|
||||
:class="{ 'bg-surface-soft text-muted': !isActionable(item) }"
|
||||
:data-testid="`transfer-backlog-${item.invoice_no}`"
|
||||
<!-- EP 表格壳:数据=服务端返回的当前页切片;横向滚动由 el-table 内建(列 min-width 撑开) -->
|
||||
<el-table
|
||||
v-if="items.length"
|
||||
:data="items"
|
||||
:row-key="rowKey"
|
||||
:row-class-name="rowClassName"
|
||||
size="small"
|
||||
class="text-xs"
|
||||
data-testid="transfer-backlog-table"
|
||||
>
|
||||
<el-table-column width="36" class-name="whitespace-nowrap">
|
||||
<template #header>
|
||||
<input
|
||||
type="checkbox"
|
||||
:checked="allFilteredSelected"
|
||||
data-testid="transfer-backlog-select-all"
|
||||
@change="toggleAll(($event.target as HTMLInputElement).checked)"
|
||||
/>
|
||||
</template>
|
||||
<template #default="{ row }">
|
||||
<input
|
||||
type="checkbox"
|
||||
:checked="selectedIds.has(row.item_id)"
|
||||
:disabled="!isActionable(row as TransferBacklogItem) || busy"
|
||||
:data-testid="`transfer-backlog-check-${row.invoice_no}`"
|
||||
@change="toggleRow(row as TransferBacklogItem, ($event.target as HTMLInputElement).checked)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('chat.transfer.colSource')" prop="source_code" min-width="110" class-name="whitespace-nowrap" />
|
||||
<el-table-column :label="$t('chat.transfer.colInvoice')" prop="invoice_no" min-width="130" class-name="whitespace-nowrap">
|
||||
<template #default="{ row }">
|
||||
<span class="font-semibold">{{ row.invoice_no }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('chat.transfer.colMovementDate')" min-width="100" class-name="whitespace-nowrap">
|
||||
<template #default="{ row }">{{ row.movement_date || '—' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('chat.transfer.colMaterial')" prop="material_no" min-width="110" class-name="whitespace-nowrap" />
|
||||
<el-table-column :label="$t('chat.transfer.colName')" min-width="140">
|
||||
<template #default="{ row }">{{ row.material_name || '—' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('chat.transfer.colFromWarehouse')" min-width="110" class-name="whitespace-nowrap">
|
||||
<template #default="{ row }">{{ row.from_warehouse || '—' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('chat.transfer.colFromBatch')" min-width="110" class-name="whitespace-nowrap">
|
||||
<template #default="{ row }">{{ deriveBatchNo(row.lot_no ?? '') || '—' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('chat.transfer.colFromQty')" min-width="90" class-name="whitespace-nowrap">
|
||||
<template #default="{ row }">{{ formatQuantity(row.external_quantity) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('chat.transfer.colToWarehouse')" min-width="110" class-name="whitespace-nowrap">
|
||||
<template #default="{ row }">{{ row.to_warehouse || '—' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('chat.transfer.colToQty')" min-width="90" class-name="whitespace-nowrap">
|
||||
<template #default="{ row }">{{ formatQuantity(row.movement_quantity) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('chat.transfer.colResult')" min-width="110">
|
||||
<template #default="{ row }">
|
||||
<span
|
||||
class="whitespace-nowrap rounded-full px-2 py-0.5 font-bold"
|
||||
:class="{
|
||||
'bg-red-50 text-red-700': row.status === 'blocked_recoverable',
|
||||
'bg-amber-50 text-amber-700': row.status === 'result_unknown',
|
||||
'bg-surface-soft text-muted': row.status === 'manually_closed',
|
||||
}"
|
||||
:title="row.reason || undefined"
|
||||
data-testid="transfer-backlog-result"
|
||||
>
|
||||
<td class="p-2">
|
||||
<input
|
||||
type="checkbox"
|
||||
:checked="selectedIds.has(item.item_id)"
|
||||
:disabled="!isActionable(item) || busy"
|
||||
:data-testid="`transfer-backlog-check-${item.invoice_no}`"
|
||||
@change="toggleRow(item, ($event.target as HTMLInputElement).checked)"
|
||||
/>
|
||||
</td>
|
||||
<!-- 除品名外全列 nowrap:日期/仓库/料号带连字符,列宽不足时从连字符处折行;
|
||||
操作列三按钮保持一行 -->
|
||||
<td class="whitespace-nowrap p-2">{{ item.source_code }}</td>
|
||||
<td class="whitespace-nowrap p-2 font-semibold">{{ item.invoice_no }}</td>
|
||||
<td class="whitespace-nowrap p-2">{{ item.receipt_date || '—' }}</td>
|
||||
<td class="whitespace-nowrap p-2">{{ item.material_no }}</td>
|
||||
<td class="p-2">{{ item.material_name || '—' }}</td>
|
||||
<td class="whitespace-nowrap p-2">{{ item.from_warehouse || '—' }}</td>
|
||||
<td class="whitespace-nowrap p-2">{{ deriveBatchNo(item.lot_no ?? '') || '—' }}</td>
|
||||
<td class="whitespace-nowrap p-2">{{ formatQuantity(item.external_quantity) }}</td>
|
||||
<td class="whitespace-nowrap p-2">{{ item.to_warehouse || '—' }}</td>
|
||||
<td class="whitespace-nowrap p-2">{{ formatQuantity(item.receipt_quantity) }}</td>
|
||||
<td class="p-2">
|
||||
<span
|
||||
class="whitespace-nowrap rounded-full px-2 py-0.5 font-bold"
|
||||
:class="{
|
||||
'bg-red-50 text-red-700': item.status === 'blocked_recoverable',
|
||||
'bg-amber-50 text-amber-700': item.status === 'result_unknown',
|
||||
'bg-surface-soft text-muted': item.status === 'manually_closed',
|
||||
}"
|
||||
:title="item.reason || undefined"
|
||||
data-testid="transfer-backlog-result"
|
||||
>
|
||||
{{
|
||||
$t(resultLabelKey(item))
|
||||
}}
|
||||
</span>
|
||||
</td>
|
||||
<td class="whitespace-nowrap p-2">{{ $t(agingLabel(item.aging_level)) }}</td>
|
||||
<td class="whitespace-nowrap p-2">
|
||||
<template v-if="isActionable(item)">
|
||||
<!-- 失效行(文件已移除)隐藏重查/恢复处理:重查会被后端拒绝
|
||||
(TRANSFER.RETRY_NOT_ALLOWED),恢复处理也无济于事,只留关闭出口 -->
|
||||
<button
|
||||
v-if="!isFileRemoved(item)"
|
||||
type="button"
|
||||
class="mr-1 rounded border border-brand-200 px-1 py-0.5 text-[10px] font-bold text-brand-700 transition hover:bg-brand-50 disabled:opacity-40"
|
||||
:data-testid="`transfer-backlog-requery-${item.invoice_no}`"
|
||||
:disabled="busy"
|
||||
@click="emit('retry', item.item_id)"
|
||||
>
|
||||
{{ $t('chat.transfer.requeryRow') }}
|
||||
</button>
|
||||
<button
|
||||
v-if="!isFileRemoved(item)"
|
||||
type="button"
|
||||
class="mr-1 rounded border border-brand-200 px-1 py-0.5 text-[10px] font-bold text-brand-700 transition hover:bg-brand-50 disabled:opacity-40"
|
||||
:title="$t('chat.transfer.resumeAction')"
|
||||
:data-testid="`transfer-backlog-resume-${item.invoice_no}`"
|
||||
:disabled="busy"
|
||||
@click="emit('resume', [item.item_id])"
|
||||
>
|
||||
{{ $t('chat.transfer.resumeActionShort') }}
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="rounded border border-red-200 px-1 py-0.5 text-[10px] font-bold text-red-600 transition hover:bg-red-50 disabled:opacity-40"
|
||||
:title="$t('chat.transfer.manualClose')"
|
||||
:data-testid="`transfer-backlog-close-${item.invoice_no}`"
|
||||
:disabled="busy"
|
||||
@click="emit('close', item)"
|
||||
>
|
||||
{{ $t('chat.transfer.manualCloseShort') }}
|
||||
</button>
|
||||
</template>
|
||||
<span v-else-if="item.status === 'result_unknown'" class="text-[11px] text-muted">
|
||||
{{ $t('chat.transfer.resultUnknownReadonly') }}
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{{ $t(resultLabelKey(row as TransferBacklogItem)) }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('chat.transfer.colAging')" min-width="90" class-name="whitespace-nowrap">
|
||||
<template #default="{ row }">{{ $t(agingLabel(row.aging_level)) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('chat.transfer.colAction')" min-width="150" class-name="whitespace-nowrap">
|
||||
<template #default="{ row }">
|
||||
<template v-if="isActionable(row as TransferBacklogItem)">
|
||||
<!-- 失效行(文件已移除)隐藏重查/恢复处理:重查会被后端拒绝
|
||||
(TRANSFER.RETRY_NOT_ALLOWED),恢复处理也无济于事,只留关闭出口 -->
|
||||
<button
|
||||
v-if="!isFileRemoved(row as TransferBacklogItem)"
|
||||
type="button"
|
||||
class="mr-1 rounded border border-brand-200 px-1 py-0.5 text-[10px] font-bold text-brand-700 transition hover:bg-brand-50 disabled:opacity-40"
|
||||
:data-testid="`transfer-backlog-requery-${row.invoice_no}`"
|
||||
:disabled="busy"
|
||||
@click="emit('retry', row.item_id)"
|
||||
>
|
||||
{{ $t('chat.transfer.requeryRow') }}
|
||||
</button>
|
||||
<button
|
||||
v-if="!isFileRemoved(row as TransferBacklogItem)"
|
||||
type="button"
|
||||
class="mr-1 rounded border border-brand-200 px-1 py-0.5 text-[10px] font-bold text-brand-700 transition hover:bg-brand-50 disabled:opacity-40"
|
||||
:title="$t('chat.transfer.resumeAction')"
|
||||
:data-testid="`transfer-backlog-resume-${row.invoice_no}`"
|
||||
:disabled="busy"
|
||||
@click="emit('resume', [row.item_id])"
|
||||
>
|
||||
{{ $t('chat.transfer.resumeActionShort') }}
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="rounded border border-red-200 px-1 py-0.5 text-[10px] font-bold text-red-600 transition hover:bg-red-50 disabled:opacity-40"
|
||||
:title="$t('chat.transfer.manualClose')"
|
||||
:data-testid="`transfer-backlog-close-${row.invoice_no}`"
|
||||
:disabled="busy"
|
||||
@click="emit('close', row as TransferBacklogItem)"
|
||||
>
|
||||
{{ $t('chat.transfer.manualCloseShort') }}
|
||||
</button>
|
||||
</template>
|
||||
<span v-else-if="row.status === 'result_unknown'" class="text-[11px] text-muted">
|
||||
{{ $t('chat.transfer.resultUnknownReadonly') }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div v-else class="rounded-lg bg-surface-soft p-3 text-xs text-muted">
|
||||
{{ $t('chat.transfer.noBacklog') }}
|
||||
</div>
|
||||
<!-- 服务端分页条(单页时隐藏):total=筛选后全量计数;文案走全局 ElConfigProvider 四语言 -->
|
||||
<el-pagination
|
||||
v-if="(total ?? 0) > PAGE_SIZE"
|
||||
:current-page="currentPage"
|
||||
:total="total ?? 0"
|
||||
:page-size="PAGE_SIZE"
|
||||
layout="total, prev, pager, next, jumper"
|
||||
size="small"
|
||||
class="mt-2 justify-end"
|
||||
data-testid="transfer-backlog-pagination"
|
||||
@current-change="(page: number) => { currentPage = page }"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
@@ -0,0 +1,58 @@
|
||||
/**
|
||||
* features/chat/components/messages/TransferExecutableCard.spec.ts
|
||||
* 用途:验证可调拨明细卡的客户端分页——50/页切片渲染、翻页余量、
|
||||
* 关键字筛选变更重置回第 1 页(防"停在末页筛选后空白")。
|
||||
* 依赖:@vue/test-utils、i18n。纯组件 props 驱动,无需 mock API。
|
||||
* 逻辑:分页为纯渲染切片,勾选/批量语义不在本套件(由 MessageView 接线覆盖)。
|
||||
*/
|
||||
import { mount, flushPromises } from '@vue/test-utils';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import i18n from '@/i18n';
|
||||
import TransferExecutableCard from './TransferExecutableCard.vue';
|
||||
|
||||
function makeItems(count: number) {
|
||||
return Array.from({ length: count }, (_, i) => ({
|
||||
item_id: i + 1,
|
||||
source_code: 'DBS-AWSBI',
|
||||
material_no: `MAT-${i + 1}`,
|
||||
material_name: '物料',
|
||||
specification: '',
|
||||
invoice_no: `INV-${String(i + 1).padStart(3, '0')}`,
|
||||
movement_date: '2026-09-01',
|
||||
from_warehouse: 'DBS-TRANSIT',
|
||||
from_quantity: '1',
|
||||
to_warehouse: 'HUB-CN01',
|
||||
to_quantity: '1',
|
||||
result: 'executable',
|
||||
lot_no: 'LOT-1',
|
||||
}));
|
||||
}
|
||||
|
||||
function mountCard(items: ReturnType<typeof makeItems>) {
|
||||
return mount(TransferExecutableCard, {
|
||||
props: { items },
|
||||
global: { plugins: [i18n] },
|
||||
});
|
||||
}
|
||||
|
||||
describe('TransferExecutableCard 客户端分页', () => {
|
||||
it('55 行只渲染首页 50 行,翻页渲染余量 5 行', async () => {
|
||||
const wrapper = mountCard(makeItems(55));
|
||||
// [断言意图] 首页切片=50 行(非全量 55),DOM 规模被页大小约束。
|
||||
expect(wrapper.findAll('tbody tr')).toHaveLength(50);
|
||||
await wrapper.find('.btn-next').trigger('click');
|
||||
await flushPromises();
|
||||
expect(wrapper.findAll('tbody tr')).toHaveLength(5);
|
||||
});
|
||||
|
||||
it('关键字筛选变更重置回第 1 页(末页筛选不再空白)', async () => {
|
||||
// [断言意图] 停在第 2 页(余量 5 行)时输入关键字:命中 11 行
|
||||
// (MAT-1、MAT-10~19),若未重置页码则第 2 页切片为空——行数断言同时锁两件事。
|
||||
const wrapper = mountCard(makeItems(55));
|
||||
await wrapper.find('.btn-next').trigger('click');
|
||||
expect(wrapper.findAll('tbody tr')).toHaveLength(5);
|
||||
await wrapper.find('[data-testid="transfer-executable-filter"]').setValue('MAT-1');
|
||||
await flushPromises();
|
||||
expect(wrapper.findAll('tbody tr')).toHaveLength(11);
|
||||
});
|
||||
});
|
||||
@@ -1,13 +1,17 @@
|
||||
<!--
|
||||
features/chat/components/messages/TransferExecutableCard.vue
|
||||
用途:可调拨明细卡——全局可执行行队列(跨匹配范围):勾选明细行后按行生成调拨单。
|
||||
依赖:props.items、i18n chat.transfer.*、transferBatch.deriveBatchNo。
|
||||
逻辑:行由后端按业务稳定键排序(收料日期→Invoice→创建时间);勾选为卡片本地态;
|
||||
依赖:Element Plus ElPagination(客户端分页,2026-10-16)、props.items、
|
||||
i18n chat.transfer.*、transferBatch.deriveBatchNo。
|
||||
逻辑:行由后端按业务稳定键排序(异动日期→Invoice→创建时间);勾选为卡片本地态;
|
||||
stale/file_current 行置灰提示(执行门禁在后端,失败经 BusinessError 展示);
|
||||
无 item_id 的历史回放行禁选。
|
||||
客户端分页(2026-10-16):集合天然有界(仅当日成熟可执行行)但为防增长后
|
||||
DOM 失控,50/页切片渲染;关键字筛选变更回第 1 页,勾选集合跨页保留。
|
||||
-->
|
||||
<script setup lang="ts">
|
||||
import { computed, ref } from 'vue';
|
||||
import { computed, ref, watch } from 'vue';
|
||||
import { ElPagination } from 'element-plus';
|
||||
import { deriveBatchNo } from './transferBatch';
|
||||
import { formatQuantity } from './transferFormat';
|
||||
import { parseApiUtcDate } from '@/shared/utils/dateTime';
|
||||
@@ -24,10 +28,14 @@ const emit = defineEmits<{
|
||||
requery: [itemIds: number[]];
|
||||
}>();
|
||||
|
||||
/** 勾选集合(本地视图态,按明细行 item_id)。 */
|
||||
/** 勾选集合(本地视图态,按明细行 item_id;跨页保留——批量计数按全量过滤行)。 */
|
||||
const selectedIds = ref<Set<number>>(new Set());
|
||||
const keyword = ref('');
|
||||
|
||||
/** 客户端分页(50/页):可执行池量级小但无硬上限,切片渲染防 DOM 失控。 */
|
||||
const PAGE_SIZE = 50;
|
||||
const currentPage = ref(1);
|
||||
|
||||
const filtered = computed(() =>
|
||||
props.items.filter((item) => {
|
||||
const kw = keyword.value.trim().toLowerCase();
|
||||
@@ -38,6 +46,19 @@ const filtered = computed(() =>
|
||||
}),
|
||||
);
|
||||
|
||||
const pagedItems = computed(() =>
|
||||
filtered.value.slice((currentPage.value - 1) * PAGE_SIZE, currentPage.value * PAGE_SIZE),
|
||||
);
|
||||
|
||||
// 筛选变更回第 1 页;刷新后行数减少时收拢当前页防空白页
|
||||
watch(keyword, () => {
|
||||
currentPage.value = 1;
|
||||
});
|
||||
watch(() => filtered.value.length, (len) => {
|
||||
const maxPage = Math.max(1, Math.ceil(len / PAGE_SIZE));
|
||||
if (currentPage.value > maxPage) currentPage.value = maxPage;
|
||||
});
|
||||
|
||||
const checked = computed(() =>
|
||||
filtered.value.filter((item) => item.item_id != null && selectedIds.value.has(item.item_id)),
|
||||
);
|
||||
@@ -132,7 +153,7 @@ function checkedTime(item: TransferMatchingItem): string {
|
||||
<!-- 表头全列 nowrap:防「拨出仓库/投入数量」等折行;品名列吃剩余宽度 -->
|
||||
<th class="whitespace-nowrap p-2">{{ $t('chat.transfer.colSource') }}</th>
|
||||
<th class="whitespace-nowrap p-2">{{ $t('chat.transfer.colInvoice') }}</th>
|
||||
<th class="whitespace-nowrap p-2">{{ $t('chat.transfer.colReceiptDate') }}</th>
|
||||
<th class="whitespace-nowrap p-2">{{ $t('chat.transfer.colMovementDate') }}</th>
|
||||
<th class="whitespace-nowrap p-2">{{ $t('chat.transfer.colMaterial') }}</th>
|
||||
<th class="whitespace-nowrap p-2">{{ $t('chat.transfer.colName') }}</th>
|
||||
<th class="whitespace-nowrap p-2">{{ $t('chat.transfer.colFromWarehouse') }}</th>
|
||||
@@ -146,7 +167,7 @@ function checkedTime(item: TransferMatchingItem): string {
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr
|
||||
v-for="item in filtered"
|
||||
v-for="item in pagedItems"
|
||||
:key="rowKey(item)"
|
||||
class="border-b border-subtle"
|
||||
:class="{ 'bg-surface-soft text-muted': item.stale || item.file_current === false }"
|
||||
@@ -164,7 +185,7 @@ function checkedTime(item: TransferMatchingItem): string {
|
||||
<!-- 除品名外全列 nowrap:日期/仓库/料号带连字符,列宽不足时从连字符处折行 -->
|
||||
<td class="whitespace-nowrap p-2">{{ item.source_code }}</td>
|
||||
<td class="whitespace-nowrap p-2 font-semibold">{{ item.invoice_no }}</td>
|
||||
<td class="whitespace-nowrap p-2">{{ item.receipt_date || '—' }}</td>
|
||||
<td class="whitespace-nowrap p-2">{{ item.movement_date || '—' }}</td>
|
||||
<td class="whitespace-nowrap p-2">{{ item.material_no }}</td>
|
||||
<td class="p-2">{{ item.material_name }}</td>
|
||||
<td class="whitespace-nowrap p-2">{{ item.from_warehouse }}</td>
|
||||
@@ -197,7 +218,18 @@ function checkedTime(item: TransferMatchingItem): string {
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div v-else class="rounded-lg bg-surface-soft p-3 text-xs text-muted" data-testid="transfer-executable-empty">
|
||||
<!-- 客户端分页(单页时隐藏):文案走全局 ElConfigProvider 四语言 locale -->
|
||||
<el-pagination
|
||||
v-if="filtered.length > PAGE_SIZE"
|
||||
v-model:current-page="currentPage"
|
||||
:total="filtered.length"
|
||||
:page-size="PAGE_SIZE"
|
||||
layout="total, prev, pager, next, jumper"
|
||||
size="small"
|
||||
class="mt-2 justify-end"
|
||||
data-testid="transfer-executable-pagination"
|
||||
/>
|
||||
<div v-else-if="!filtered.length" class="rounded-lg bg-surface-soft p-3 text-xs text-muted" data-testid="transfer-executable-empty">
|
||||
{{ $t('chat.transfer.executableEmpty') }}
|
||||
</div>
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ const FAILED_TICKET = {
|
||||
submit_timestamp: '2026-08-06 09:00:00',
|
||||
status: 'business_failed',
|
||||
status_group: 'failed',
|
||||
receipt_date: '2026-08-05',
|
||||
movement_date: '2026-08-05',
|
||||
from_warehouse: 'DBS-TRANSIT',
|
||||
to_warehouse: 'HUB-CN01',
|
||||
erp_document_no: null,
|
||||
@@ -47,7 +47,7 @@ const UNKNOWN_TICKET = {
|
||||
submit_timestamp: '2026-08-06 10:00:00',
|
||||
status: 'result_unknown',
|
||||
status_group: 'result_unknown',
|
||||
receipt_date: '2026-08-05',
|
||||
movement_date: '2026-08-05',
|
||||
from_warehouse: 'DBS-TRANSIT',
|
||||
to_warehouse: 'HUB-CN02',
|
||||
erp_document_no: null,
|
||||
|
||||
@@ -6,20 +6,25 @@
|
||||
result_unknown 行仅 [重新触发],D11 无关闭入口;动作按钮与状态徽标
|
||||
同簇靠右、紧跟状态展示,2026-09-29 布局调整)+ 上一页/下一页分页;
|
||||
无自动轮询(进入拉一次 + 手动刷新)。
|
||||
依赖:transfer.api(fetchExecutedOrders/closeTransferDocument/retriggerTransferDocument)、
|
||||
依赖:Element Plus ElDialog/ElTable/ElTableColumn(2026-10-16 EP 组件化:
|
||||
关闭单弹层壳与展开明细表格迁 EP,单列表卡片形态与交互不变)、
|
||||
transfer.api(fetchExecutedOrders/closeTransferDocument/retriggerTransferDocument)、
|
||||
transferBatch.deriveBatchNo(拨出批号展示侧 WTP→HOW 镜像)、
|
||||
useMessage、i18n chat.transfer.homeExecuted.*。
|
||||
逻辑:props.initialGroup(首页卡片点击带入的初始分组,''=全部)→ mounted→load;
|
||||
[全部] 点击→清 statusGroup+page=1;日期范围变更→page=1+load(后端按收料
|
||||
[全部] 点击→清 statusGroup+page=1;日期范围变更→page=1+load(后端按异动
|
||||
日期过滤);[返回]→emit('back') 由首页面板切回卡片视图;关闭单走 D18
|
||||
原因必填弹窗(同单行影响面 + 「关闭调拨单≠ERP 无单」红线)→close→load。
|
||||
行为与融合卡(TransferResultCard)一致。列表排序(收料日期→数据源→库位
|
||||
弹层壳禁 ESC/遮罩点击/X 关闭(仅收起/确认按钮可关,防误触关闭高危操作)。
|
||||
行为与融合卡(TransferResultCard)一致。列表排序(异动日期→数据源→库位
|
||||
升序)与分组计数恒全量由后端保证,本视图不消费计数
|
||||
(计数展示在首页 TransferExecutedCards)。
|
||||
-->
|
||||
<script setup lang="ts">
|
||||
import { computed, onMounted, ref } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { ElDialog, ElTable, ElTableColumn } from 'element-plus';
|
||||
import { transferDialogShellAttrs } from './transferDialogShell';
|
||||
import { useMessage } from '@/shared/composables/useMessage';
|
||||
import {
|
||||
closeTransferDocument,
|
||||
@@ -256,7 +261,7 @@ onMounted(() => { void load(); });
|
||||
>
|
||||
<div class="flex flex-wrap items-center justify-between gap-2 px-3 py-2 text-xs">
|
||||
<span class="font-semibold text-secondary">
|
||||
{{ order.receipt_date || '—' }} · {{ order.from_warehouse }}→{{ order.to_warehouse }}
|
||||
{{ order.movement_date || '—' }} · {{ order.from_warehouse }}→{{ order.to_warehouse }}
|
||||
· {{ $t('chat.transfer.materialCount', { count: order.items.length }) }}
|
||||
</span>
|
||||
<!-- 状态徽标与单据级行内动作(D11/D18)同簇靠右:处置动作紧跟状态,扫读动线「状态→处置」 -->
|
||||
@@ -306,34 +311,25 @@ onMounted(() => { void load(); });
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 展开明细(invoice 粒度行集) -->
|
||||
<!-- 展开明细(invoice 粒度行集;EP 表格壳:空态/样式与业务表格一致) -->
|
||||
<div
|
||||
v-if="expandedDocNo === order.doc_no"
|
||||
class="border-t border-subtle px-3 py-2"
|
||||
:data-testid="`transfer-executed-items-${order.doc_no}`"
|
||||
>
|
||||
<table class="w-full text-xs">
|
||||
<thead>
|
||||
<tr class="text-left text-[11px] text-muted">
|
||||
<th class="p-1">{{ $t('chat.transfer.colInvoice') }}</th>
|
||||
<th class="p-1">{{ $t('chat.transfer.colMaterial') }}</th>
|
||||
<th class="p-1">{{ $t('chat.transfer.colName') }}</th>
|
||||
<th class="p-1">{{ $t('chat.transfer.colFromBatch') }}</th>
|
||||
<th class="p-1">{{ $t('chat.transfer.colToQty') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="item in order.items" :key="`${order.doc_no}|${item.invoice_no}|${item.material_no}`" class="border-t border-subtle">
|
||||
<td class="p-1">{{ item.invoice_no }}</td>
|
||||
<td class="p-1">{{ item.material_no }}</td>
|
||||
<td class="p-1">{{ item.material_name }}</td>
|
||||
<!-- 拨出批号展示外部形态(WTP→HOW 镜像转换,与匹配卡/可调拨明细/待办池同规则;
|
||||
行上数据保持文件原形态,转换只发生在展示侧) -->
|
||||
<td class="p-1">{{ deriveBatchNo(item.lot_no) || '—' }}</td>
|
||||
<td class="p-1">{{ item.quantity }}<template v-if="item.unit"> {{ item.unit }}</template></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<el-table :data="order.items" size="small" class="text-xs">
|
||||
<el-table-column :label="$t('chat.transfer.colInvoice')" prop="invoice_no" min-width="120" class-name="whitespace-nowrap" />
|
||||
<el-table-column :label="$t('chat.transfer.colMaterial')" prop="material_no" min-width="110" class-name="whitespace-nowrap" />
|
||||
<el-table-column :label="$t('chat.transfer.colName')" prop="material_name" min-width="140" />
|
||||
<!-- 拨出批号展示外部形态(WTP→HOW 镜像转换,与匹配卡/可调拨明细/待办池同规则;
|
||||
行上数据保持文件原形态,转换只发生在展示侧) -->
|
||||
<el-table-column :label="$t('chat.transfer.colFromBatch')" min-width="120" class-name="whitespace-nowrap">
|
||||
<template #default="{ row }">{{ deriveBatchNo(row.lot_no) || '—' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('chat.transfer.colToQty')" min-width="90" class-name="whitespace-nowrap">
|
||||
<template #default="{ row }">{{ row.quantity }}<template v-if="row.unit"> {{ row.unit }}</template></template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -363,57 +359,63 @@ onMounted(() => { void load(); });
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- 关闭单确认弹层(D18:原因必填 + 同单行影响面 + 「关闭调拨单≠ERP 无单」红线) -->
|
||||
<div
|
||||
<!-- 关闭单确认弹层(D18:原因必填 + 同单行影响面 + 「关闭调拨单≠ERP 无单」红线)。
|
||||
v-if + model-value=true:打开即渲染、关闭即卸载(无过渡等待,测试语义同旧行为) -->
|
||||
<el-dialog
|
||||
v-if="closeTarget"
|
||||
class="fixed inset-0 z-50 flex items-center justify-center bg-slate-900/40 p-4"
|
||||
data-testid="transfer-executed-close-dialog"
|
||||
:model-value="true"
|
||||
v-bind="transferDialogShellAttrs"
|
||||
width="28rem"
|
||||
class="rounded-2xl bg-surface"
|
||||
>
|
||||
<div class="w-full max-w-md rounded-2xl bg-surface p-5 shadow-xl">
|
||||
<h3 class="text-base font-bold text-primary">
|
||||
<template #header>
|
||||
<h3
|
||||
class="text-base font-bold text-primary"
|
||||
data-testid="transfer-executed-close-dialog"
|
||||
>
|
||||
{{ $t('chat.transfer.homeExecuted.closeDialog.title', { docNo: closeTarget.doc_no }) }}
|
||||
</h3>
|
||||
<p class="mt-1 text-xs text-muted">
|
||||
{{ $t('chat.transfer.homeExecuted.closeDialog.redlineReopen') }}
|
||||
</p>
|
||||
<ul class="mt-2 max-h-32 overflow-y-auto rounded-lg bg-surface-soft p-2 text-[11px] text-secondary">
|
||||
<li v-for="item in closeTarget.items" :key="`${item.invoice_no}|${item.material_no}`">
|
||||
{{ item.invoice_no }} · {{ item.material_no }} {{ item.material_name }} ·
|
||||
{{ item.quantity }}<template v-if="item.unit"> {{ item.unit }}</template>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="mt-2 list-disc pl-4 text-xs font-bold text-red-600">
|
||||
<li>{{ $t('chat.transfer.homeExecuted.closeDialog.redlineWhole') }}</li>
|
||||
<li>{{ $t('chat.transfer.homeExecuted.closeDialog.redlineResidue') }}</li>
|
||||
<li>{{ $t('chat.transfer.homeExecuted.closeDialog.redlineErpCheck') }}</li>
|
||||
</ul>
|
||||
<textarea
|
||||
v-model="closeDialog.reason"
|
||||
rows="3"
|
||||
class="mt-3 w-full rounded-lg border border-default p-2 text-sm"
|
||||
:placeholder="$t('chat.transfer.homeExecuted.closeDialog.reasonRequired')"
|
||||
data-testid="transfer-executed-close-reason"
|
||||
/>
|
||||
<div class="mt-4 flex justify-end gap-2">
|
||||
<button
|
||||
type="button"
|
||||
class="rounded-lg border border-default px-4 py-1.5 text-sm text-secondary hover-surface-soft"
|
||||
data-testid="transfer-executed-close-dismiss"
|
||||
@click="closeDialog = { docNo: '', reason: '' }"
|
||||
>
|
||||
{{ $t('chat.transfer.orderClose.dismiss') }}
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="rounded-lg bg-red-600 px-4 py-1.5 text-sm font-bold text-white hover:bg-red-700 disabled:cursor-not-allowed disabled:opacity-40"
|
||||
data-testid="transfer-executed-close-confirm"
|
||||
:disabled="!closeDialog.reason.trim() || actionBusy"
|
||||
@click="confirmCloseOrder"
|
||||
>
|
||||
{{ $t('chat.transfer.homeExecuted.closeDialog.confirm') }}
|
||||
</button>
|
||||
</div>
|
||||
</template>
|
||||
<p class="text-xs text-muted">
|
||||
{{ $t('chat.transfer.homeExecuted.closeDialog.redlineReopen') }}
|
||||
</p>
|
||||
<ul class="mt-2 max-h-32 overflow-y-auto rounded-lg bg-surface-soft p-2 text-[11px] text-secondary">
|
||||
<li v-for="item in closeTarget.items" :key="`${item.invoice_no}|${item.material_no}`">
|
||||
{{ item.invoice_no }} · {{ item.material_no }} {{ item.material_name }} ·
|
||||
{{ item.quantity }}<template v-if="item.unit"> {{ item.unit }}</template>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="mt-2 list-disc pl-4 text-xs font-bold text-red-600">
|
||||
<li>{{ $t('chat.transfer.homeExecuted.closeDialog.redlineWhole') }}</li>
|
||||
<li>{{ $t('chat.transfer.homeExecuted.closeDialog.redlineResidue') }}</li>
|
||||
<li>{{ $t('chat.transfer.homeExecuted.closeDialog.redlineErpCheck') }}</li>
|
||||
</ul>
|
||||
<textarea
|
||||
v-model="closeDialog.reason"
|
||||
rows="3"
|
||||
class="mt-3 w-full rounded-lg border border-default p-2 text-sm"
|
||||
:placeholder="$t('chat.transfer.homeExecuted.closeDialog.reasonRequired')"
|
||||
data-testid="transfer-executed-close-reason"
|
||||
/>
|
||||
<div class="mt-4 flex justify-end gap-2">
|
||||
<button
|
||||
type="button"
|
||||
class="rounded-lg border border-default px-4 py-1.5 text-sm text-secondary hover-surface-soft"
|
||||
data-testid="transfer-executed-close-dismiss"
|
||||
@click="closeDialog = { docNo: '', reason: '' }"
|
||||
>
|
||||
{{ $t('chat.transfer.orderClose.dismiss') }}
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="rounded-lg bg-red-600 px-4 py-1.5 text-sm font-bold text-white hover:bg-red-700 disabled:cursor-not-allowed disabled:opacity-40"
|
||||
data-testid="transfer-executed-close-confirm"
|
||||
:disabled="!closeDialog.reason.trim() || actionBusy"
|
||||
@click="confirmCloseOrder"
|
||||
>
|
||||
{{ $t('chat.transfer.homeExecuted.closeDialog.confirm') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</section>
|
||||
</template>
|
||||
@@ -1,6 +1,6 @@
|
||||
<!--
|
||||
features/chat/components/messages/TransferFileProgressCard.vue
|
||||
用途:来源实例级收料文件准备进度(决策 18:来源隔离展示,不伪造总百分比)。
|
||||
用途:来源实例级入站文件准备进度(决策 18:来源隔离展示,不伪造总百分比)。
|
||||
依赖:props.sources、i18n chat.transfer.*。
|
||||
逻辑:按来源显示 file_ready / waiting_rpa_callback / failed 阶段与文件信息。
|
||||
-->
|
||||
|
||||
@@ -18,21 +18,25 @@ const api = vi.hoisted(() => ({
|
||||
getTransferRun: vi.fn(),
|
||||
retryTransferItem: vi.fn(),
|
||||
manualCloseTransferItem: vi.fn(),
|
||||
downloadTransferReceiptFiles: vi.fn(),
|
||||
downloadTransferInboundFiles: vi.fn(),
|
||||
downloadTransferErpInventory: vi.fn(),
|
||||
downloadTransferExceptions: vi.fn(),
|
||||
listTransferBacklog: vi.fn(),
|
||||
listTransferBacklogPage: vi.fn(),
|
||||
getTransferBacklogSummary: vi.fn(),
|
||||
listPendingMatchRecords: vi.fn(),
|
||||
listPendingMatchRecordsPage: vi.fn(),
|
||||
listTransferSources: vi.fn(),
|
||||
fetchTransferTypes: vi.fn(),
|
||||
listExecutableTransferItems: vi.fn(),
|
||||
fetchExecutedOrders: vi.fn(),
|
||||
// Task 8 维护链路端点(待匹配抽屉「清空重解析」;本套件不触发,仅补齐 mock 模块形状)
|
||||
fetchPendingMatchReparsePreview: vi.fn(),
|
||||
reparsePendingMatch: vi.fn(),
|
||||
}));
|
||||
|
||||
vi.mock('@/features/chat/api/transfer.api', () => api);
|
||||
|
||||
import TransferHomePanel from './TransferHomePanel.vue';
|
||||
import TransferBacklogSummaryCard from './TransferBacklogSummaryCard.vue';
|
||||
|
||||
function mountHome() {
|
||||
return mount(TransferHomePanel, {
|
||||
@@ -47,10 +51,10 @@ describe('TransferHomePanel chat home entry', () => {
|
||||
api.getTransferBacklogSummary.mockResolvedValue({
|
||||
recoverable: 6, closed: 2, unknown: 1, pending_match: 3, aging: { warn_3d: 3, escalate_5d: 2, critical_7d: 1 },
|
||||
});
|
||||
api.listTransferBacklog.mockResolvedValue([]);
|
||||
api.listTransferBacklogPage.mockResolvedValue({ items: [], total: 0, page: 1, page_size: 20 });
|
||||
api.listExecutableTransferItems.mockResolvedValue({ items: [], counts: { executable_count: 0 } });
|
||||
// 「待匹配」桶只读清单(D16 第 4 卡抽屉数据源;默认空,专项用例自行覆盖)。
|
||||
api.listPendingMatchRecords.mockResolvedValue([]);
|
||||
api.listPendingMatchRecordsPage.mockResolvedValue({ records: [], total: 0, page: 1, page_size: 20 });
|
||||
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' },
|
||||
@@ -79,21 +83,21 @@ describe('TransferHomePanel chat home entry', () => {
|
||||
expect(api.getTransferBacklogSummary).toHaveBeenCalled();
|
||||
// [断言意图] 首屏只取计数:计数卡不消费全量待办列表(68.5kB 级),
|
||||
// /backlog 全量列表延迟到切片子视图(TransferMessageView backlog 挂载)自行加载。
|
||||
expect(api.listTransferBacklog).not.toHaveBeenCalled();
|
||||
expect(api.listTransferBacklogPage).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('点击“匹配可调拨库存”今日待办入口独立触发来源选择卡(复用 TransferMessageView)', async () => {
|
||||
api.createTransferMatching.mockResolvedValue({
|
||||
matching_id: 'MTG-1', status: 'ready_to_execute', business_date: '2026-08-06',
|
||||
eligible_receipt_date_to: '2026-08-05', expires_at: '',
|
||||
counts: { file_invoice_count: 1, not_matured_count: 0, matched_count: 1, executable_count: 1, blocked_count: 0 },
|
||||
expires_at: '',
|
||||
counts: { file_invoice_count: 1, matched_count: 1, executable_count: 1, blocked_count: 0 },
|
||||
estimated_transfer_quantity: '1200', estimated_external_write_count: 1, matching_hash: 'sha256:x',
|
||||
});
|
||||
api.getTransferMatching.mockResolvedValue({
|
||||
summary: {
|
||||
matching_id: 'MTG-1', status: 'ready_to_execute', business_date: '2026-08-06',
|
||||
eligible_receipt_date_to: '2026-08-05', expires_at: '',
|
||||
counts: { file_invoice_count: 1, not_matured_count: 0, matched_count: 1, executable_count: 1, blocked_count: 0 },
|
||||
expires_at: '',
|
||||
counts: { file_invoice_count: 1, matched_count: 1, executable_count: 1, blocked_count: 0 },
|
||||
estimated_transfer_quantity: '1200', estimated_external_write_count: 1, matching_hash: 'sha256:x',
|
||||
},
|
||||
items: [{
|
||||
@@ -114,16 +118,27 @@ describe('TransferHomePanel chat home entry', () => {
|
||||
|
||||
it('点击历史待办计数卡独立触发 backlog 卡片,并按计数卡切片初始筛选', async () => {
|
||||
// [断言意图] 两张计数卡不再落入同一份全量列表:可恢复/已关闭
|
||||
// 各自带对应 resultFilter 打开待处理池(否则 0 行的已关闭被 50 行可恢复淹没);
|
||||
// 各自携带对应 resultFilter 打开待处理池(否则 0 行的已关闭被 50 行可恢复淹没);
|
||||
// 结果未知无首页卡(2026-09-29),unknown 切片仅池内筛选可达。
|
||||
api.listTransferBacklog.mockResolvedValue([
|
||||
// 2026-10-16 服务端分页+筛选下推:mock 按查询参数返回对应切片,
|
||||
// 同时验证切片条件真实透传到 API(query-change 接线端到端)。
|
||||
const poolItems = [
|
||||
{ item_id: 7, source_code: 'DBS-AWSBI', invoice_no: 'INV-001', material_no: 'MAT-1',
|
||||
status: 'blocked_recoverable', reason: '收料 1200 / ERP 1000', age_days: 1, aging_level: 'normal' },
|
||||
status: 'blocked_recoverable', reason: '异动 1200 / ERP 1000', age_days: 1, aging_level: 'normal' },
|
||||
{ item_id: 8, source_code: 'DBS-AWSBI', invoice_no: 'INV-002', material_no: 'MAT-2',
|
||||
status: 'manually_closed', reason: '线下处理', age_days: 2, aging_level: 'closed' },
|
||||
{ item_id: 9, source_code: 'DBS-AWSBI', invoice_no: 'INV-003', material_no: 'MAT-3',
|
||||
status: 'result_unknown', reason: '待人工核实', age_days: 3, aging_level: 'result_unknown' },
|
||||
]);
|
||||
];
|
||||
const filterStatus: Record<string, string> = {
|
||||
recoverable: 'blocked_recoverable', closed: 'manually_closed', unknown: 'result_unknown',
|
||||
};
|
||||
api.listTransferBacklogPage.mockImplementation((query: { resultFilter?: string }) => {
|
||||
const items = query.resultFilter && query.resultFilter !== 'all'
|
||||
? poolItems.filter((entry) => entry.status === filterStatus[query.resultFilter as string])
|
||||
: poolItems;
|
||||
return Promise.resolve({ items, total: items.length, page: 1, page_size: 20 });
|
||||
});
|
||||
|
||||
const wrapper = mountHome();
|
||||
await flushPromises();
|
||||
@@ -131,8 +146,10 @@ describe('TransferHomePanel chat home entry', () => {
|
||||
await wrapper.find('[data-testid="transfer-home-recoverable"]').trigger('click');
|
||||
await flushPromises();
|
||||
expect(wrapper.find('[data-testid="transfer-backlog-card"]').exists()).toBe(true);
|
||||
expect(api.listTransferBacklog).toHaveBeenCalled();
|
||||
expect((wrapper.find('[data-testid="transfer-backlog-result-filter"]').element as HTMLSelectElement).value).toBe('recoverable');
|
||||
expect(api.listTransferBacklogPage).toHaveBeenCalled();
|
||||
// [断言意图] 结果筛选迁 EP el-select(非原生 select),初始切片断言改走组件 prop
|
||||
// (等价语义:计数卡切片落入对应 resultFilter)。
|
||||
expect(wrapper.findComponent(TransferBacklogSummaryCard).props('initialFilter')).toBe('recoverable');
|
||||
// 切片后仅可见对应状态行。
|
||||
expect(wrapper.text()).toContain('INV-001');
|
||||
expect(wrapper.text()).not.toContain('INV-002');
|
||||
@@ -141,7 +158,7 @@ describe('TransferHomePanel chat home entry', () => {
|
||||
await flushPromises();
|
||||
await wrapper.find('[data-testid="transfer-home-closed"]').trigger('click');
|
||||
await flushPromises();
|
||||
expect((wrapper.find('[data-testid="transfer-backlog-result-filter"]').element as HTMLSelectElement).value).toBe('closed');
|
||||
expect(wrapper.findComponent(TransferBacklogSummaryCard).props('initialFilter')).toBe('closed');
|
||||
expect(wrapper.text()).toContain('INV-002');
|
||||
expect(wrapper.text()).not.toContain('INV-001');
|
||||
});
|
||||
@@ -153,23 +170,27 @@ describe('TransferHomePanel chat home entry', () => {
|
||||
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();
|
||||
expect(api.listPendingMatchRecordsPage).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' },
|
||||
]);
|
||||
api.listPendingMatchRecordsPage.mockResolvedValue({
|
||||
records: [
|
||||
{ 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' },
|
||||
],
|
||||
total: 1, page: 1, page_size: 20,
|
||||
});
|
||||
|
||||
const wrapper = mountHome();
|
||||
await flushPromises();
|
||||
await wrapper.find('[data-testid="transfer-home-pending-match"]').trigger('click');
|
||||
await flushPromises();
|
||||
// [断言意图] 抽屉=只读清单:进入子视图才拉清单,行字段可见。
|
||||
expect(api.listPendingMatchRecords).toHaveBeenCalled();
|
||||
expect(api.listPendingMatchRecordsPage).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);
|
||||
// [断言意图] 行定位:el-table 行类 transfer-pending-match-row-<doc_no>(EP 化后行无逐行 attr)。
|
||||
expect(wrapper.find('.transfer-pending-match-row-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);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
features/chat/components/messages/TransferHomePanel.vue
|
||||
用途:在途仓自动调拨 Agent 的 Chat 首页入口区——上区「库存匹配」动作入口,
|
||||
中区「待办看板」四队列(待匹配/可调拨明细/待恢复异常/已人工关闭;「待匹配」
|
||||
为 2026-10-14 D16 新增第 4 卡:已落档尚未匹配的外部收料记录,只读抽屉清单
|
||||
为 2026-10-14 D16 新增第 4 卡:已落档尚未匹配的外部入站记录,只读抽屉清单
|
||||
+「去匹配」引导,不可勾选执行;结果未知行 2026-09-29 起不再设首页卡——行级
|
||||
在待办池只读且无独立出口,统一走下方执行看板的结果未知单据 [重新触发],
|
||||
池内仍可经结果筛选查看),
|
||||
@@ -68,7 +68,8 @@ async function loadHomeSummary() {
|
||||
]);
|
||||
}
|
||||
if (view.value === 'pending-match') {
|
||||
await transfer.loadPendingMatchRecords().catch(() => undefined);
|
||||
// 服务端分页(2026-10-16):每次进入抽屉回到第 1 页(D16 不做缓存,匹配后数据即变)
|
||||
await transfer.loadPendingMatchRecords({ page: 1 }).catch(() => undefined);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -192,7 +193,9 @@ function goBack() {
|
||||
</button>
|
||||
<TransferPendingMatchPanel
|
||||
:records="transfer.pendingMatchRecords.value"
|
||||
:total="transfer.pendingMatchTotal.value"
|
||||
@go-match="view = 'source-select'"
|
||||
@page-change="(query) => transfer.loadPendingMatchRecords(query)"
|
||||
@refresh="() => transfer.loadPendingMatchRecords()"
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -1,11 +1,17 @@
|
||||
<!--
|
||||
features/chat/components/messages/TransferManualCloseDialog.vue
|
||||
用途:人工关闭弹窗(原因必填;关闭后永久排除,历史保留);count>1 时按批量文案展示。
|
||||
依赖:props(open/invoiceNo/count)、i18n chat.transfer.*。
|
||||
依赖:Element Plus ElDialog(弹层壳:焦点圈定/滚动锁定/aria 语义)、
|
||||
props(open/invoiceNo/count)、i18n chat.transfer.*。
|
||||
逻辑:原因为空时确认按钮禁用;确认时 emit confirm(reason)。
|
||||
弹层壳 2026-10-16 由原生 fixed 遮罩迁 EP el-dialog(视觉与交互不变:
|
||||
禁 ESC/遮罩点击关闭与右上角 X,仅取消/确认按钮可关,防止误触关闭危险操作);
|
||||
v-if+model-value=true 挂载即渲染(EP onMounted 对初值 true 同步置 rendered)。
|
||||
-->
|
||||
<script setup lang="ts">
|
||||
import { ref, watch } from 'vue';
|
||||
import { ElDialog } from 'element-plus';
|
||||
import { transferDialogShellAttrs } from './transferDialogShell';
|
||||
|
||||
const props = defineProps<{
|
||||
open: boolean;
|
||||
@@ -30,45 +36,50 @@ watch(
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div
|
||||
<el-dialog
|
||||
v-if="open"
|
||||
class="fixed inset-0 z-50 flex items-center justify-center bg-slate-900/40 p-4"
|
||||
data-testid="transfer-manual-close-dialog"
|
||||
:model-value="true"
|
||||
v-bind="transferDialogShellAttrs"
|
||||
width="28rem"
|
||||
class="rounded-2xl bg-surface"
|
||||
>
|
||||
<div class="w-full max-w-md rounded-2xl bg-surface p-5 shadow-xl">
|
||||
<h3 class="text-base font-bold text-primary">
|
||||
<template #header>
|
||||
<h3
|
||||
class="text-base font-bold text-primary"
|
||||
data-testid="transfer-manual-close-dialog"
|
||||
>
|
||||
{{ $t(count && count > 1 ? 'chat.transfer.batchCloseTitle' : 'chat.transfer.manualCloseTitle', count && count > 1 ? { count } : {}) }}
|
||||
</h3>
|
||||
<p class="mt-1 text-xs text-muted">
|
||||
<template v-if="count && count > 1">{{ $t('chat.transfer.manualCloseHint') }}</template>
|
||||
<template v-else>{{ invoiceNo }} · {{ $t('chat.transfer.manualCloseHint') }}</template>
|
||||
</p>
|
||||
<textarea
|
||||
v-model="reason"
|
||||
rows="3"
|
||||
class="mt-3 w-full rounded-lg border border-default p-2 text-sm"
|
||||
:placeholder="$t('chat.transfer.closeReasonPlaceholder')"
|
||||
data-testid="transfer-close-reason"
|
||||
/>
|
||||
<div class="mt-4 flex justify-end gap-2">
|
||||
<button
|
||||
type="button"
|
||||
class="rounded-lg border border-default px-4 py-1.5 text-sm text-secondary hover-surface-soft"
|
||||
data-testid="transfer-close-cancel"
|
||||
@click="emit('cancel')"
|
||||
>
|
||||
{{ $t('chat.transfer.cancel') }}
|
||||
</button>
|
||||
<button
|
||||
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="!reason.trim()"
|
||||
data-testid="transfer-close-confirm"
|
||||
@click="emit('confirm', reason.trim())"
|
||||
>
|
||||
{{ $t('chat.transfer.confirmClose') }}
|
||||
</button>
|
||||
</div>
|
||||
</template>
|
||||
<p class="text-xs text-muted">
|
||||
<template v-if="count && count > 1">{{ $t('chat.transfer.manualCloseHint') }}</template>
|
||||
<template v-else>{{ invoiceNo }} · {{ $t('chat.transfer.manualCloseHint') }}</template>
|
||||
</p>
|
||||
<textarea
|
||||
v-model="reason"
|
||||
rows="3"
|
||||
class="mt-3 w-full rounded-lg border border-default p-2 text-sm"
|
||||
:placeholder="$t('chat.transfer.closeReasonPlaceholder')"
|
||||
data-testid="transfer-close-reason"
|
||||
/>
|
||||
<div class="mt-4 flex justify-end gap-2">
|
||||
<button
|
||||
type="button"
|
||||
class="rounded-lg border border-default px-4 py-1.5 text-sm text-secondary hover-surface-soft"
|
||||
data-testid="transfer-close-cancel"
|
||||
@click="emit('cancel')"
|
||||
>
|
||||
{{ $t('chat.transfer.cancel') }}
|
||||
</button>
|
||||
<button
|
||||
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="!reason.trim()"
|
||||
data-testid="transfer-close-confirm"
|
||||
@click="emit('confirm', reason.trim())"
|
||||
>
|
||||
{{ $t('chat.transfer.confirmClose') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
@@ -18,11 +18,9 @@ function buildSummary(): TransferMatchingSummary {
|
||||
matching_id: 'MTG-T',
|
||||
status: 'completed',
|
||||
business_date: '2026-08-06',
|
||||
eligible_receipt_date_to: '2026-08-06',
|
||||
expires_at: '2026-08-06T23:59:59',
|
||||
counts: {
|
||||
file_invoice_count: 0,
|
||||
not_matured_count: 0,
|
||||
matched_count: 0,
|
||||
executable_count: 0,
|
||||
blocked_count: 0,
|
||||
@@ -72,7 +70,7 @@ describe('TransferMatchCard 来源失败顶栏', () => {
|
||||
});
|
||||
|
||||
/** [2026-10-12 单据数口径修正] 预计 ERP 单据数按执行建单五元组去重。
|
||||
* 行分组键 = (external_org, source_code, receipt_date, from_warehouse,
|
||||
* 行分组键 = (external_org, source_code, movement_date, from_warehouse,
|
||||
* to_warehouse),与后端 execution_service.prepare_execution 同口径:
|
||||
* 同组多行执行期合并一张 ERP 单,预估数不得等于可执行行数。 */
|
||||
function buildItem(overrides: Partial<TransferMatchingItem>): TransferMatchingItem {
|
||||
@@ -83,7 +81,7 @@ function buildItem(overrides: Partial<TransferMatchingItem>): TransferMatchingIt
|
||||
material_name: '连接器组件',
|
||||
specification: 'A 型',
|
||||
invoice_no: 'HOM-001',
|
||||
receipt_date: '2026-08-05',
|
||||
movement_date: '2026-08-05',
|
||||
from_warehouse: 'DBS-TRANSIT',
|
||||
from_quantity: '100',
|
||||
to_warehouse: 'HUB-CN01',
|
||||
@@ -94,19 +92,19 @@ function buildItem(overrides: Partial<TransferMatchingItem>): TransferMatchingIt
|
||||
};
|
||||
}
|
||||
|
||||
/** 计数卡第 5 格 = 预计 ERP 单据(可执行/未成熟/阻断/数量/单据/待查/失效)。 */
|
||||
/** 计数卡第 4 格 = 预计 ERP 单据(可执行/阻断/数量/单据/待查/失效)。 */
|
||||
function estimateCardText(wrapper: ReturnType<typeof mount>): string {
|
||||
const cells = wrapper.find('[data-testid="transfer-match-counts"]').findAll('div.rounded-lg');
|
||||
return cells[4]?.text() ?? '';
|
||||
return cells[3]?.text() ?? '';
|
||||
}
|
||||
|
||||
describe('TransferMatchCard 预计 ERP 单据数(五元组去重)', () => {
|
||||
const sameGroupA = buildItem({ item_id: 1, invoice_no: 'HOM-001' });
|
||||
const sameGroupB = buildItem({ item_id: 2, invoice_no: 'HOX-002' });
|
||||
const crossDate = buildItem({ item_id: 3, invoice_no: 'HOM-003', receipt_date: '2026-08-04' });
|
||||
const crossDate = buildItem({ item_id: 3, invoice_no: 'HOM-003', movement_date: '2026-08-04' });
|
||||
|
||||
it('计数卡:同组两行 + 跨日一行 → 预估 2(不等于可执行行数 3)', () => {
|
||||
// [断言意图] 锁定五元组去重口径:receipt_date 入键,同组合并、跨组拆分,
|
||||
// [断言意图] 锁定五元组去重口径:movement_date 入键,同组合并、跨组拆分,
|
||||
// 历史快照旧口径(=行数)持久值不再上屏。
|
||||
const wrapper = mount(TransferMatchCard, {
|
||||
props: {
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
features/chat/components/messages/TransferMatchCard.vue
|
||||
用途:匹配卡——计数 + 来源失败提示 + 调拨明细表(含筛选)+ 勾选 + “直接生成调拨单”按钮。
|
||||
依赖:props(summary/items/sources/selected/busy)、i18n chat.transfer.*。
|
||||
逻辑:明细表渲染 filtered(关键字/结果筛选生效);阻断/未成熟项 checkbox 禁用;
|
||||
逻辑:明细表渲染 filtered(关键字/结果筛选生效);阻断项 checkbox 禁用;
|
||||
勾选键 = 明细行 item_id(历史回放行无 item_id 禁用防误选);
|
||||
库存数量下方小字透出查询时刻(checked_at);stale 行置灰 + 重查提示;
|
||||
file_current=false 行提示文件已更新(自动对齐语义);blocked_file_removed
|
||||
徽标独立文案;pending_stock_check 行徽标「待查库存」(amber 与未成熟同色系);
|
||||
徽标独立文案;pending_stock_check 行徽标「待查库存」(amber 提示色);
|
||||
计数卡透出待查库存(pending_stock_check_count)/已失效(invalid_count),
|
||||
历史回放缺省按 0 展示;blocked_file_removed 行退出主视图(表格不渲染),
|
||||
表格下方折叠提示去待处理异常池处理——重查救不了已消失的行,主清单只留
|
||||
@@ -18,7 +18,7 @@
|
||||
顶栏按 error_code 客户端排除,历史卡片回放同样生效;
|
||||
[2026-10-12 单据数口径修正] 预计 ERP 单据数(计数卡=全部可执行行、
|
||||
生成按钮旁=勾选可执行行)按执行建单五元组 (external_org, source_code,
|
||||
receipt_date, from_warehouse, to_warehouse) 去重实时计算(与后端
|
||||
movement_date, from_warehouse, to_warehouse) 去重实时计算(与后端
|
||||
execution_service 同键),同组多行合并一张单——原「=可执行行数」口径
|
||||
高估单据数误导用户。
|
||||
-->
|
||||
@@ -74,7 +74,7 @@ const failedSources = computed(() =>
|
||||
|
||||
/** 筛选与全选状态(表格交互本地态,勾选集合仍由父级持有)。 */
|
||||
const keyword = ref('');
|
||||
const resultFilter = ref<'all' | 'executable' | 'blocked' | 'not_matured'>('all');
|
||||
const resultFilter = ref<'all' | 'executable' | 'blocked'>('all');
|
||||
|
||||
function isBlocked(item: TransferMatchingItem): boolean {
|
||||
return String(item.result).startsWith('blocked_');
|
||||
@@ -113,7 +113,6 @@ const filtered = computed(() =>
|
||||
}
|
||||
if (resultFilter.value === 'executable' && item.result !== 'executable') return false;
|
||||
if (resultFilter.value === 'blocked' && !isBlocked(item)) return false;
|
||||
if (resultFilter.value === 'not_matured' && item.result !== 'not_matured') return false;
|
||||
return true;
|
||||
}),
|
||||
);
|
||||
@@ -151,13 +150,13 @@ const executableCheckedItemIds = computed(() =>
|
||||
|
||||
/** [2026-10-12 单据数口径修正] 执行建单五元组键(与后端 execution_service.
|
||||
* prepare_execution 分组建单同键同 .trim() 规范化):(external_org, source_code,
|
||||
* receipt_date, from_warehouse, to_warehouse),同组多行执行期合并一张 ERP 单。
|
||||
* movement_date, from_warehouse, to_warehouse),同组多行执行期合并一张 ERP 单。
|
||||
* 老卡片行缺 external_org 按 '' 参与(分组退化为四元组,仅跨组织同仓库配置下有差异)。 */
|
||||
function documentGroupKey(item: TransferMatchingItem): string {
|
||||
return [
|
||||
(item.external_org ?? '').trim(),
|
||||
(item.source_code ?? '').trim(),
|
||||
(item.receipt_date ?? '').trim(),
|
||||
(item.movement_date ?? '').trim(),
|
||||
(item.from_warehouse ?? '').trim(),
|
||||
(item.to_warehouse ?? '').trim(),
|
||||
].join('\u001f');
|
||||
@@ -195,7 +194,6 @@ function checkedAtLabel(item: TransferMatchingItem): string | null {
|
||||
function resultLabel(result: string): string {
|
||||
const map: Record<string, string> = {
|
||||
executable: 'chat.transfer.resultExecutable',
|
||||
not_matured: 'chat.transfer.resultNotMatured',
|
||||
pending_stock_check: 'chat.transfer.resultPendingStockCheck',
|
||||
blocked_quantity_mismatch: 'chat.transfer.resultBlocked',
|
||||
blocked_inventory_not_found: 'chat.transfer.resultBlocked',
|
||||
@@ -235,15 +233,11 @@ function reasonTitle(item: TransferMatchingItem): string | undefined {
|
||||
<span class="text-xs text-muted">{{ $t('chat.transfer.businessDate') }}:{{ summary.business_date }}</span>
|
||||
</div>
|
||||
|
||||
<div class="mb-3 grid grid-cols-2 gap-2 sm:grid-cols-7" data-testid="transfer-match-counts">
|
||||
<div class="mb-3 grid grid-cols-2 gap-2 sm:grid-cols-6" data-testid="transfer-match-counts">
|
||||
<div class="rounded-lg bg-surface-soft p-2 text-center">
|
||||
<div class="text-lg font-black text-brand-600">{{ summary.counts.executable_count }}</div>
|
||||
<div class="text-[11px] text-muted">{{ $t('chat.transfer.executableCount') }}</div>
|
||||
</div>
|
||||
<div class="rounded-lg bg-surface-soft p-2 text-center">
|
||||
<div class="text-lg font-black text-secondary">{{ summary.counts.not_matured_count }}</div>
|
||||
<div class="text-[11px] text-muted">{{ $t('chat.transfer.notMaturedCount') }}</div>
|
||||
</div>
|
||||
<div class="rounded-lg bg-surface-soft p-2 text-center">
|
||||
<div class="text-lg font-black text-secondary">{{ summary.counts.blocked_count }}</div>
|
||||
<div class="text-[11px] text-muted">{{ $t('chat.transfer.blockedCount') }}</div>
|
||||
@@ -293,7 +287,6 @@ function reasonTitle(item: TransferMatchingItem): string | undefined {
|
||||
<option value="all">{{ $t('chat.transfer.filterAll') }}</option>
|
||||
<option value="executable">{{ $t('chat.transfer.resultExecutable') }}</option>
|
||||
<option value="blocked">{{ $t('chat.transfer.resultBlocked') }}</option>
|
||||
<option value="not_matured">{{ $t('chat.transfer.resultNotMatured') }}</option>
|
||||
</select>
|
||||
<button
|
||||
type="button"
|
||||
@@ -320,7 +313,7 @@ function reasonTitle(item: TransferMatchingItem): string | undefined {
|
||||
<!-- 表头全列 nowrap:防「拨出仓库/投入数量」等折行;品名列吃剩余宽度 -->
|
||||
<th class="whitespace-nowrap p-2">{{ $t('chat.transfer.colSource') }}</th>
|
||||
<th class="whitespace-nowrap p-2">{{ $t('chat.transfer.colInvoice') }}</th>
|
||||
<th class="whitespace-nowrap p-2">{{ $t('chat.transfer.colReceiptDate') }}</th>
|
||||
<th class="whitespace-nowrap p-2">{{ $t('chat.transfer.colMovementDate') }}</th>
|
||||
<th class="whitespace-nowrap p-2">{{ $t('chat.transfer.colMaterial') }}</th>
|
||||
<th class="whitespace-nowrap p-2">{{ $t('chat.transfer.colName') }}</th>
|
||||
<th class="whitespace-nowrap p-2">{{ $t('chat.transfer.colFromWarehouse') }}</th>
|
||||
@@ -334,7 +327,7 @@ function reasonTitle(item: TransferMatchingItem): string | undefined {
|
||||
<tbody>
|
||||
<tr
|
||||
v-for="item in filtered"
|
||||
:key="`${item.source_code}|${item.invoice_no}|${item.material_no}|${item.receipt_date ?? ''}`"
|
||||
:key="`${item.source_code}|${item.invoice_no}|${item.material_no}|${item.movement_date ?? ''}`"
|
||||
class="border-b border-subtle"
|
||||
:class="{ 'bg-surface-soft text-muted': !isSelectable(item), 'opacity-60': item.stale === true }"
|
||||
:data-testid="`transfer-item-${item.invoice_no}`"
|
||||
@@ -351,7 +344,7 @@ function reasonTitle(item: TransferMatchingItem): string | undefined {
|
||||
<!-- 除品名外全列 nowrap:日期/仓库/料号带连字符,列宽不足时从连字符处折行 -->
|
||||
<td class="whitespace-nowrap p-2">{{ item.source_code }}</td>
|
||||
<td class="whitespace-nowrap p-2 font-semibold">{{ item.invoice_no }}</td>
|
||||
<td class="whitespace-nowrap p-2">{{ item.receipt_date || '—' }}</td>
|
||||
<td class="whitespace-nowrap p-2">{{ item.movement_date || '—' }}</td>
|
||||
<td class="whitespace-nowrap p-2">{{ item.material_no }}</td>
|
||||
<td class="p-2">{{ item.material_name }}</td>
|
||||
<td class="whitespace-nowrap p-2">{{ item.from_warehouse }}</td>
|
||||
@@ -377,8 +370,8 @@ function reasonTitle(item: TransferMatchingItem): string | undefined {
|
||||
class="whitespace-nowrap rounded-full px-2 py-0.5 font-bold"
|
||||
:class="{
|
||||
'bg-emerald-50 text-emerald-700': item.result === 'executable',
|
||||
'bg-amber-50 text-amber-700': item.result === 'not_matured' || item.result === 'pending_stock_check',
|
||||
'bg-red-50 text-red-700': !isSelectable(item) && item.result !== 'not_matured' && item.result !== 'pending_stock_check',
|
||||
'bg-amber-50 text-amber-700': item.result === 'pending_stock_check',
|
||||
'bg-red-50 text-red-700': !isSelectable(item) && item.result !== 'pending_stock_check',
|
||||
}"
|
||||
:title="reasonTitle(item)"
|
||||
data-testid="transfer-item-result"
|
||||
|
||||
@@ -10,6 +10,9 @@ import { mount, flushPromises } from '@vue/test-utils';
|
||||
import { describe, expect, it, vi, beforeEach } from 'vitest';
|
||||
import i18n from '@/i18n';
|
||||
|
||||
// EP el-table 在 jsdom 挂载较重(整文件连跑时部分用例超默认 5s),本 spec 放宽到 30s。
|
||||
vi.setConfig({ testTimeout: 30000 });
|
||||
|
||||
const api = vi.hoisted(() => ({
|
||||
createTransferMatching: vi.fn(),
|
||||
getTransferMatching: vi.fn(),
|
||||
@@ -21,10 +24,10 @@ const api = vi.hoisted(() => ({
|
||||
manualCloseTransferItem: vi.fn(),
|
||||
batchRequeryTransferItems: vi.fn(),
|
||||
batchManualCloseTransferItems: vi.fn(),
|
||||
downloadTransferReceiptFiles: vi.fn(),
|
||||
downloadTransferInboundFiles: vi.fn(),
|
||||
downloadTransferErpInventory: vi.fn(),
|
||||
downloadTransferExceptions: vi.fn(),
|
||||
listTransferBacklog: vi.fn(),
|
||||
listTransferBacklogPage: vi.fn(),
|
||||
getTransferBacklogSummary: vi.fn(),
|
||||
listTransferSources: vi.fn(),
|
||||
fetchTransferTypes: vi.fn(),
|
||||
@@ -46,7 +49,14 @@ vi.mock('@/shared/composables/useMessage', () => ({
|
||||
}));
|
||||
|
||||
import TransferMessageView from './TransferMessageView.vue';
|
||||
import { eligibleReceiptDateTo } from './transferDate';
|
||||
import { defaultMovementDate } from './transferDate';
|
||||
|
||||
/**
|
||||
* 待处理池服务端分页 envelope(2026-10-16):items=当前页切片,total=筛选后全量计数。
|
||||
*/
|
||||
function backlogPage(items: unknown[], total = items.length) {
|
||||
return { items, total, page: 1, page_size: 20 };
|
||||
}
|
||||
|
||||
const payload = {
|
||||
kind: 'match',
|
||||
@@ -54,9 +64,8 @@ const payload = {
|
||||
matching_id: 'MTG-1',
|
||||
status: 'ready_to_execute',
|
||||
business_date: '2026-08-06',
|
||||
eligible_receipt_date_to: '2026-08-05',
|
||||
expires_at: '',
|
||||
counts: { file_invoice_count: 1, not_matured_count: 0, matched_count: 1, executable_count: 1, blocked_count: 0 },
|
||||
counts: { file_invoice_count: 1, matched_count: 1, executable_count: 1, blocked_count: 0 },
|
||||
estimated_transfer_quantity: '1200',
|
||||
estimated_external_write_count: 1,
|
||||
matching_hash: 'sha256:x',
|
||||
@@ -64,7 +73,7 @@ const payload = {
|
||||
items: [{
|
||||
item_id: 101,
|
||||
source_code: 'DBS-AWSBI', material_no: 'MAT-1', material_name: '连接器组件', specification: 'A',
|
||||
invoice_no: 'INV-001', receipt_date: '2026-08-05', from_warehouse: 'DBS-TRANSIT', from_quantity: '1200',
|
||||
invoice_no: 'INV-001', movement_date: '2026-08-05', from_warehouse: 'DBS-TRANSIT', from_quantity: '1200',
|
||||
to_warehouse: 'HUB-CN01', to_quantity: '1200', result: 'executable',
|
||||
}],
|
||||
sources: [{ source_code: 'DBS-AWSBI', stage: 'file_ready', file_no: 'REC-1' }],
|
||||
@@ -93,7 +102,7 @@ describe('TransferMessageView self-driving wiring', () => {
|
||||
vi.clearAllMocks();
|
||||
api.executeTransferItems.mockResolvedValue({ run_no: 'RUN-1', status: 'success' });
|
||||
api.getTransferRun.mockResolvedValue(runPayload.run);
|
||||
api.downloadTransferReceiptFiles.mockResolvedValue({ blob: new Blob(['z']), filename: 'r.zip' });
|
||||
api.downloadTransferInboundFiles.mockResolvedValue({ blob: new Blob(['z']), filename: 'r.zip' });
|
||||
api.downloadTransferErpInventory.mockResolvedValue({ blob: new Blob(['c']), filename: 'e.csv' });
|
||||
});
|
||||
|
||||
@@ -117,15 +126,15 @@ describe('TransferMessageView self-driving wiring', () => {
|
||||
expect(wrapper.find('[data-testid="transfer-result-card"]').exists()).toBe(true);
|
||||
});
|
||||
|
||||
it('结果卡下载按钮调用下载 API(收料来源文件 + ERP 库存表)', async () => {
|
||||
it('结果卡下载按钮调用下载 API(出入站来源文件 + ERP 库存表)', async () => {
|
||||
const wrapper = mount(TransferMessageView, {
|
||||
props: { payload: runPayload },
|
||||
global: { plugins: [i18n] },
|
||||
});
|
||||
await wrapper.find('[data-testid="transfer-download-receipt"]').trigger('click');
|
||||
await wrapper.find('[data-testid="transfer-download-inbound"]').trigger('click');
|
||||
await wrapper.find('[data-testid="transfer-download-erp"]').trigger('click');
|
||||
await flushPromises();
|
||||
expect(api.downloadTransferReceiptFiles).toHaveBeenCalledWith('RUN-1');
|
||||
expect(api.downloadTransferInboundFiles).toHaveBeenCalledWith('RUN-1');
|
||||
expect(api.downloadTransferErpInventory).toHaveBeenCalledWith('RUN-1');
|
||||
});
|
||||
|
||||
@@ -138,12 +147,12 @@ describe('TransferMessageView self-driving wiring', () => {
|
||||
});
|
||||
|
||||
it('backlog 视图拉取待处理列表,行级重查/关闭调用对应 API', async () => {
|
||||
api.listTransferBacklog.mockResolvedValue([{
|
||||
api.listTransferBacklogPage.mockResolvedValue(backlogPage([{
|
||||
item_id: 7, source_code: 'DBS-AWSBI', invoice_no: 'INV-001', material_no: 'MAT-1',
|
||||
status: 'blocked_recoverable', reason: '收料 1200 / ERP 1000', age_days: 1, aging_level: 'normal',
|
||||
receipt_date: '2026-08-05', material_name: '连接器组件', from_warehouse: 'DBS-TRANSIT',
|
||||
to_warehouse: 'HUB-CN01', lot_no: 'LOT-10', receipt_quantity: '1200', external_quantity: '1000',
|
||||
}]);
|
||||
status: 'blocked_recoverable', reason: '异动 1200 / ERP 1000', age_days: 1, aging_level: 'normal',
|
||||
movement_date: '2026-08-05', material_name: '连接器组件', from_warehouse: 'DBS-TRANSIT',
|
||||
to_warehouse: 'HUB-CN01', lot_no: 'LOT-10', movement_quantity: '1200', external_quantity: '1000',
|
||||
}]));
|
||||
api.getTransferBacklogSummary.mockResolvedValue({
|
||||
recoverable: 1, closed: 0, unknown: 0, aging: { warn_3d: 0, escalate_5d: 0, critical_7d: 0 },
|
||||
});
|
||||
@@ -172,10 +181,10 @@ describe('TransferMessageView self-driving wiring', () => {
|
||||
});
|
||||
|
||||
it('backlog 批量:勾选后操作条出现,重查/恢复/批量关闭调用对应端点', async () => {
|
||||
api.listTransferBacklog.mockResolvedValue([
|
||||
api.listTransferBacklogPage.mockResolvedValue(backlogPage([
|
||||
{ item_id: 7, source_code: 'DBS-AWSBI', invoice_no: 'INV-001', material_no: 'MAT-1', status: 'blocked_recoverable', reason: '', age_days: 0, aging_level: 'normal' },
|
||||
{ item_id: 8, source_code: 'DBS-AWSBI', invoice_no: 'INV-002', material_no: 'MAT-2', status: 'result_unknown', reason: '', age_days: 2, aging_level: 'result_unknown' },
|
||||
]);
|
||||
]));
|
||||
api.getTransferBacklogSummary.mockResolvedValue({
|
||||
recoverable: 1, closed: 0, unknown: 1, aging: { warn_3d: 0, escalate_5d: 0, critical_7d: 0 },
|
||||
});
|
||||
@@ -216,11 +225,11 @@ describe('TransferMessageView self-driving wiring', () => {
|
||||
|
||||
it('backlog 结果徽标:blocked_file_removed 行显示「文件已移除」,普通阻断仍为「已阻断」', async () => {
|
||||
// [断言意图] F1(2026-09-23 评审修复):backlog 行带 result_code 后,
|
||||
// 收料行已从最新文件移除(blocked_file_removed)的行必须与普通数量阻断区分展示。
|
||||
api.listTransferBacklog.mockResolvedValue([
|
||||
{ item_id: 9, source_code: 'DBS-AWSBI', invoice_no: 'INV-009', material_no: 'MAT-9', status: 'blocked_recoverable', result_code: 'blocked_file_removed', reason: '收料行已从最新文件移除', age_days: 0, aging_level: 'normal' },
|
||||
{ item_id: 10, source_code: 'DBS-AWSBI', invoice_no: 'INV-010', material_no: 'MAT-10', status: 'blocked_recoverable', result_code: 'blocked_quantity_mismatch', reason: '收料 300 / ERP 280', age_days: 0, aging_level: 'normal' },
|
||||
]);
|
||||
// 入站行已从最新文件移除(blocked_file_removed)的行必须与普通数量阻断区分展示。
|
||||
api.listTransferBacklogPage.mockResolvedValue(backlogPage([
|
||||
{ item_id: 9, source_code: 'DBS-AWSBI', invoice_no: 'INV-009', material_no: 'MAT-9', status: 'blocked_recoverable', result_code: 'blocked_file_removed', reason: '入站行已从最新文件移除', age_days: 0, aging_level: 'normal' },
|
||||
{ item_id: 10, source_code: 'DBS-AWSBI', invoice_no: 'INV-010', material_no: 'MAT-10', status: 'blocked_recoverable', result_code: 'blocked_quantity_mismatch', reason: '异动 300 / ERP 280', age_days: 0, aging_level: 'normal' },
|
||||
]));
|
||||
api.getTransferBacklogSummary.mockResolvedValue({
|
||||
recoverable: 2, closed: 0, unknown: 0, aging: { warn_3d: 0, escalate_5d: 0, critical_7d: 0 },
|
||||
});
|
||||
@@ -230,13 +239,94 @@ describe('TransferMessageView self-driving wiring', () => {
|
||||
global: { plugins: [i18n] },
|
||||
});
|
||||
await flushPromises();
|
||||
const removedBadge = wrapper.find('[data-testid="transfer-backlog-INV-009"] [data-testid="transfer-backlog-result"]');
|
||||
const normalBadge = wrapper.find('[data-testid="transfer-backlog-INV-010"] [data-testid="transfer-backlog-result"]');
|
||||
// [断言意图] EP el-table 行不支持逐行 attr,行定位改经 row-class-name 注入的
|
||||
// transfer-backlog-row-<invoice_no> 类(等价定位同一行),徽标 testid 不变。
|
||||
const removedBadge = wrapper.find('.transfer-backlog-row-INV-009 [data-testid="transfer-backlog-result"]');
|
||||
const normalBadge = wrapper.find('.transfer-backlog-row-INV-010 [data-testid="transfer-backlog-result"]');
|
||||
expect(removedBadge.text()).toContain('文件已移除');
|
||||
expect(normalBadge.text()).toContain('已阻断');
|
||||
expect(normalBadge.text()).not.toContain('文件已移除');
|
||||
});
|
||||
|
||||
it('backlog 服务端分页:翻页携带 page 参数重查,当前页渲染切片', async () => {
|
||||
// [断言意图] 大池(现网 951/324 行级)走服务端分页(2026-10-16):待办卡
|
||||
// 翻页上抛 query-change → loadBacklog 合并页码重查;首拉由卡片挂载
|
||||
// query-change 触发且携带默认切片查询(page=1)。
|
||||
api.listTransferBacklogPage
|
||||
.mockResolvedValue(backlogPage(
|
||||
Array.from({ length: 20 }, (_, i) => ({
|
||||
item_id: 100 + i,
|
||||
source_code: 'DBS-AWSBI',
|
||||
invoice_no: `INV-${String(i + 1).padStart(3, '0')}`,
|
||||
material_no: `MAT-${i + 1}`,
|
||||
status: 'blocked_recoverable',
|
||||
reason: '异动 300 / ERP 280',
|
||||
age_days: 0,
|
||||
aging_level: 'normal',
|
||||
})),
|
||||
25,
|
||||
))
|
||||
.mockResolvedValueOnce(backlogPage(
|
||||
Array.from({ length: 20 }, (_, i) => ({
|
||||
item_id: 100 + i,
|
||||
source_code: 'DBS-AWSBI',
|
||||
invoice_no: `INV-${String(i + 1).padStart(3, '0')}`,
|
||||
material_no: `MAT-${i + 1}`,
|
||||
status: 'blocked_recoverable',
|
||||
reason: '异动 300 / ERP 280',
|
||||
age_days: 0,
|
||||
aging_level: 'normal',
|
||||
})),
|
||||
25,
|
||||
))
|
||||
.mockResolvedValueOnce(backlogPage(
|
||||
[{
|
||||
item_id: 120,
|
||||
source_code: 'DBS-AWSBI',
|
||||
invoice_no: 'INV-021',
|
||||
material_no: 'MAT-21',
|
||||
status: 'blocked_recoverable',
|
||||
reason: '异动 300 / ERP 280',
|
||||
age_days: 0,
|
||||
aging_level: 'normal',
|
||||
}],
|
||||
25,
|
||||
));
|
||||
api.getTransferBacklogSummary.mockResolvedValue({
|
||||
recoverable: 25, closed: 0, unknown: 0, aging: { warn_3d: 0, escalate_5d: 0, critical_7d: 0 },
|
||||
});
|
||||
|
||||
const wrapper = mount(TransferMessageView, {
|
||||
props: { payload: { kind: 'backlog' } },
|
||||
global: { plugins: [i18n] },
|
||||
});
|
||||
await flushPromises();
|
||||
// [断言意图] 首拉=卡片挂载上抛的默认查询(page=1)。
|
||||
expect(api.listTransferBacklogPage).toHaveBeenLastCalledWith(
|
||||
expect.objectContaining({ page: 1, pageSize: 20, resultFilter: 'all' }),
|
||||
);
|
||||
expect(wrapper.findAll('tr.el-table__row')).toHaveLength(20);
|
||||
// 翻页:query-change(page=2) → 服务端重查,渲染第 2 页切片。
|
||||
await wrapper.find('.btn-next').trigger('click');
|
||||
await flushPromises();
|
||||
expect(api.listTransferBacklogPage).toHaveBeenLastCalledWith(
|
||||
expect.objectContaining({ page: 2, pageSize: 20 }),
|
||||
);
|
||||
expect(wrapper.findAll('tr.el-table__row')).toHaveLength(1);
|
||||
expect(wrapper.find('.transfer-backlog-row-INV-021').exists()).toBe(true);
|
||||
// [断言意图] 勾选跨页保留:第 2 页勾选 INV-021,翻页/刷新后批量条计数不丢。
|
||||
await wrapper.find('[data-testid="transfer-backlog-check-INV-021"]').setValue(true);
|
||||
// [断言意图] 操作后无参重拉沿用最近查询(page=2,不跳回第 1 页)。
|
||||
await wrapper.find('[data-testid="transfer-backlog-requery-INV-021"]').trigger('click');
|
||||
await flushPromises();
|
||||
expect(api.listTransferBacklogPage).toHaveBeenLastCalledWith(
|
||||
expect.objectContaining({ page: 2, pageSize: 20 }),
|
||||
);
|
||||
await wrapper.find('.btn-prev').trigger('click');
|
||||
await flushPromises();
|
||||
expect(wrapper.find('[data-testid="transfer-backlog-selected-count"]').text()).toContain('1');
|
||||
});
|
||||
|
||||
it('可调拨明细视图:加载全局可执行行,勾选后按行生成调拨单', async () => {
|
||||
// [断言意图] 行归属解耦后的执行入口:executable 视图聚合全部可执行行,
|
||||
// 勾选(item_id)→ /items/execute → 结果卡,恢复后的行在此闭环。
|
||||
@@ -268,10 +358,10 @@ describe('TransferMessageView self-driving wiring', () => {
|
||||
// [断言意图] 行式执行重构(2026-09-23):恢复处理不再重建/打开匹配卡,
|
||||
// 语义收敛为按明细 id 重查库存;结果按 status 统计(ready_to_execute=已恢复),
|
||||
// 完成后留在待处理池(fail-closed),toast 汇总 recovered/blocked。
|
||||
api.listTransferBacklog.mockResolvedValue([
|
||||
api.listTransferBacklogPage.mockResolvedValue(backlogPage([
|
||||
{ item_id: 7, source_code: 'DBS-AWSBI', invoice_no: 'INV-001', material_no: 'MAT-1', status: 'blocked_recoverable', reason: '', age_days: 0, aging_level: 'normal' },
|
||||
{ item_id: 8, source_code: 'DBS-AWSBI', invoice_no: 'INV-002', material_no: 'MAT-2', status: 'blocked_recoverable', reason: '', age_days: 1, aging_level: 'normal' },
|
||||
]);
|
||||
]));
|
||||
api.getTransferBacklogSummary.mockResolvedValue({
|
||||
recoverable: 2, closed: 0, unknown: 0, aging: { warn_3d: 0, escalate_5d: 0, critical_7d: 0 },
|
||||
});
|
||||
@@ -302,7 +392,7 @@ describe('TransferMessageView self-driving wiring', () => {
|
||||
expect(toastText).toContain('仍阻断');
|
||||
});
|
||||
|
||||
it('来源实例选择:加载列表与类型配置 → 确认范围 → 创建匹配并切换匹配卡(默认携带 D+1 日期范围)', async () => {
|
||||
it('来源实例选择:加载列表与类型配置 → 确认范围 → 创建匹配并切换匹配卡(默认携带 T−2 日期范围)', async () => {
|
||||
// [断言意图] Task 7 接口化:挂载时并行拉取来源列表与调拨类型配置(fetchTransferTypes),
|
||||
// 类型选项=接口数据渲染进来源卡;确认仍携带缺省(首项)类型 code。
|
||||
api.listTransferSources.mockResolvedValue([
|
||||
@@ -334,10 +424,10 @@ describe('TransferMessageView self-driving wiring', () => {
|
||||
await wrapper.find('[data-testid="transfer-source-option-DBS-AWSBI"] input').setValue(true);
|
||||
await wrapper.find('[data-testid="transfer-source-confirm"]').trigger('click');
|
||||
await flushPromises();
|
||||
const cutoff = eligibleReceiptDateTo();
|
||||
const defaultDate = defaultMovementDate();
|
||||
expect(api.createTransferMatching).toHaveBeenCalledWith({
|
||||
source_codes: ['DBS-AWSBI'], business_date: undefined,
|
||||
receipt_date_from: cutoff, receipt_date_to: cutoff,
|
||||
movement_date_from: defaultDate, movement_date_to: defaultDate,
|
||||
transfer_type: 'in_transit_to_hub',
|
||||
});
|
||||
expect(wrapper.find('[data-testid="transfer-match-card"]').exists()).toBe(true);
|
||||
@@ -367,12 +457,12 @@ function t13Run(status: string, orders: Array<Record<string, unknown>>) {
|
||||
/** T0:提交后立即(单已建好,全部待处理)。 */
|
||||
const t13Pending = t13Run('queued', [
|
||||
{
|
||||
doc_no: 'HTT-OR-1', receipt_date: '2026-09-23', from_warehouse: 'B25', to_warehouse: 'B02',
|
||||
doc_no: 'HTT-OR-1', movement_date: '2026-09-23', from_warehouse: 'B25', to_warehouse: 'B02',
|
||||
status: 'pending', erp_document_no: null, error_message: null,
|
||||
lines: [t13Line('M001', '材料甲', 'V1', '100.000000'), t13Line('M002', '材料乙', 'V2', '500.000000')],
|
||||
},
|
||||
{
|
||||
doc_no: 'HTT-OR-2', receipt_date: '2026-09-19', from_warehouse: 'B25', to_warehouse: 'B02',
|
||||
doc_no: 'HTT-OR-2', movement_date: '2026-09-19', from_warehouse: 'B25', to_warehouse: 'B02',
|
||||
status: 'pending', erp_document_no: null, error_message: null,
|
||||
lines: [t13Line('M003', '材料丙', 'V3', '55.000000')],
|
||||
},
|
||||
@@ -381,16 +471,16 @@ const t13Pending = t13Run('queued', [
|
||||
/** T1:执行中(轮询刷新,逐单亮结果)。 */
|
||||
const t13Executing = t13Run('executing', [
|
||||
{
|
||||
doc_no: 'D-EXE', receipt_date: '2026-09-23', from_warehouse: 'B25', to_warehouse: 'B02',
|
||||
doc_no: 'D-EXE', movement_date: '2026-09-23', from_warehouse: 'B25', to_warehouse: 'B02',
|
||||
status: 'executing', erp_document_no: null, error_message: null,
|
||||
lines: [t13Line('M001', '材料甲', 'V1', '100.000000')],
|
||||
},
|
||||
{
|
||||
doc_no: 'D-OK', receipt_date: '2026-09-19', from_warehouse: 'B25', to_warehouse: 'B02',
|
||||
doc_no: 'D-OK', movement_date: '2026-09-19', from_warehouse: 'B25', to_warehouse: 'B02',
|
||||
status: 'success', erp_document_no: '1401-2609230008', error_message: null, lines: [],
|
||||
},
|
||||
{
|
||||
doc_no: 'D-BUS', receipt_date: '2026-09-21', from_warehouse: 'B25', to_warehouse: 'B02',
|
||||
doc_no: 'D-BUS', movement_date: '2026-09-21', from_warehouse: 'B25', to_warehouse: 'B02',
|
||||
status: 'business_failed', erp_document_no: null, error_message: null,
|
||||
lines: [t13Line('M003', '材料丙', 'V3', '55.000000')],
|
||||
},
|
||||
@@ -399,17 +489,17 @@ const t13Executing = t13Run('executing', [
|
||||
/** T2:终态部分失败(成功 + 结果未知 + 业务失败)。 */
|
||||
const t13Partial = t13Run('partial_failed', [
|
||||
{
|
||||
doc_no: 'D-OK', receipt_date: '2026-09-23', from_warehouse: 'B25', to_warehouse: 'B02',
|
||||
doc_no: 'D-OK', movement_date: '2026-09-23', from_warehouse: 'B25', to_warehouse: 'B02',
|
||||
status: 'success', erp_document_no: '1401-2609230007', error_message: null,
|
||||
lines: [t13Line('M001', '材料甲', 'V1', '100.000000')],
|
||||
},
|
||||
{
|
||||
doc_no: 'D-UNK', receipt_date: '2026-09-20', from_warehouse: 'B25', to_warehouse: 'B02',
|
||||
doc_no: 'D-UNK', movement_date: '2026-09-20', from_warehouse: 'B25', to_warehouse: 'B02',
|
||||
status: 'result_unknown', erp_document_no: null, error_message: null,
|
||||
lines: [t13Line('M002', '材料乙', 'V2', '500.000000')],
|
||||
},
|
||||
{
|
||||
doc_no: 'D-FAIL', receipt_date: '2026-09-21', from_warehouse: 'B25', to_warehouse: 'B02',
|
||||
doc_no: 'D-FAIL', movement_date: '2026-09-21', from_warehouse: 'B25', to_warehouse: 'B02',
|
||||
status: 'business_failed', erp_document_no: null, error_message: null,
|
||||
lines: [t13Line('MAT-1', '连接器组件', 'LOT-10', '1200.000000', '料号无有效成本')],
|
||||
},
|
||||
@@ -433,7 +523,7 @@ describe('融合卡(Task 13):调拨单清单=进度=结果', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('T0 全待处理:卡顶「排队中」,单行=收料日期·仓库·物料数·合计+待处理徽标,行明细常驻展开,非终态无下载区', async () => {
|
||||
it('T0 全待处理:卡顶「排队中」,单行=异动日期·仓库·物料数·合计+待处理徽标,行明细常驻展开,非终态无下载区', async () => {
|
||||
api.getTransferRun.mockResolvedValue(t13Pending);
|
||||
const wrapper = mountRunView();
|
||||
await flushPromises();
|
||||
@@ -550,7 +640,7 @@ describe('融合卡(Task 13):调拨单清单=进度=结果', () => {
|
||||
// POST /documents/{doc_no}/retry(按单圈行重查+自动重跑)。
|
||||
api.getTransferRun.mockResolvedValue(t13Run('failed', [
|
||||
{
|
||||
doc_no: 'D-FAIL', receipt_date: '2026-08-05', from_warehouse: 'DBS-TRANSIT', to_warehouse: 'HUB-CN01',
|
||||
doc_no: 'D-FAIL', movement_date: '2026-08-05', from_warehouse: 'DBS-TRANSIT', to_warehouse: 'HUB-CN01',
|
||||
status: 'business_failed', erp_document_no: null, error_message: null,
|
||||
lines: [t13Line('MAT-1', '连接器组件', '', '1200.000000')],
|
||||
},
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
依赖:Transfer*Card、useChatTransfer、i18n chat.transfer.*。
|
||||
逻辑:payload 作为初始状态(ChatLog 回放;历史行无 item_id 仅展示不可选);仅携带
|
||||
matching_id 时按 ID 恢复匹配卡(最近匹配入口);勾选/执行按明细 item_id;
|
||||
来源选择卡重试收料 RPA 为 202 异步——存在抓取中来源时组合式函数自动轮询
|
||||
来源选择卡重试入站 RPA 为 202 异步——存在抓取中来源时组合式函数自动轮询
|
||||
GET /sources,RPA 回调收口后状态自动刷新,离开来源卡即停轮询;
|
||||
来源选择卡挂载时并行拉取来源列表与调拨类型配置(Task 7 接口化,
|
||||
类型选项=GET /transfer-types 接口下发);
|
||||
@@ -70,18 +70,17 @@ const busy = ref(false);
|
||||
const closeTarget = ref<TransferBacklogItem | null>(null);
|
||||
/** 批量标记无需处理的明细 id 集合(与单行关闭共用同一弹窗)。 */
|
||||
const batchCloseIds = ref<number[]>([]);
|
||||
/** 正在重试收料 RPA 的来源编码集合(按来源独立展示重试中)。 */
|
||||
/** 正在重试入站 RPA 的来源编码集合(按来源独立展示重试中)。 */
|
||||
const retryingSource = ref<Set<string>>(new Set());
|
||||
/** 上次提交执行的明细行快照(失败单「重查库存」按物料/收料日期关联 item_id 用)。 */
|
||||
/** 上次提交执行的明细行快照(失败单「重查库存」按物料/异动日期关联 item_id 用)。 */
|
||||
const lastExecutedItems = ref<TransferMatchingItem[]>([]);
|
||||
|
||||
const transfer = useChatTransfer();
|
||||
|
||||
/** 待处理异常视图:进入时拉取列表与汇总 */
|
||||
/** 待处理异常视图:进入时拉取列表与汇总(2026-10-16 服务端分页:首拉由
|
||||
* 待办卡挂载时上抛 query-change 触发(携带计数卡切片 initialFilter),
|
||||
* 此处不再兜底首拉避免双请求)。 */
|
||||
onMounted(() => {
|
||||
if (kind.value === 'backlog') {
|
||||
void transfer.loadBacklog();
|
||||
}
|
||||
if (kind.value === 'source-select') {
|
||||
void transfer.loadSources();
|
||||
// 调拨类型配置(Task 7 接口化):类型选项=接口下发,与来源列表并行拉取。
|
||||
@@ -92,6 +91,11 @@ onMounted(() => {
|
||||
}
|
||||
});
|
||||
|
||||
/** 待办卡查询变更(翻页/筛选/首挂载):转调组合式函数按服务端分页拉取。 */
|
||||
function onBacklogQueryChange(query: { page: number; keyword: string; resultFilter: 'all' | 'recoverable' | 'closed' | 'unknown' }) {
|
||||
void transfer.loadBacklog(query);
|
||||
}
|
||||
|
||||
/** payload 更新时重置本地状态(历史回放/刷新);初始化组合式函数上下文 */
|
||||
function applyPayload(payload?: Record<string, unknown> | null) {
|
||||
if (!payload) return;
|
||||
@@ -125,13 +129,13 @@ watch(mode, (value) => {
|
||||
if (value !== 'source-select') transfer.stopSourcePolling();
|
||||
});
|
||||
|
||||
/** 打包下载选中来源的最新归档收料文件 */
|
||||
/** 打包下载选中来源的最新归档入站文件 */
|
||||
async function onDownloadSources(sourceCodes: string[]) {
|
||||
if (!sourceCodes.length) return;
|
||||
busy.value = true;
|
||||
try {
|
||||
const result = await downloadTransferSourceFiles(sourceCodes);
|
||||
triggerBlobDownload(result.blob, result.filename ?? `receipt-files-${sourceCodes.length}.zip`);
|
||||
triggerBlobDownload(result.blob, result.filename ?? `inbound-files-${sourceCodes.length}.zip`);
|
||||
} catch (e) {
|
||||
reportError(e);
|
||||
} finally {
|
||||
@@ -261,9 +265,9 @@ async function onOrderClosed() {
|
||||
}
|
||||
}
|
||||
|
||||
async function onDownloadReceipt() {
|
||||
async function onDownloadInbound() {
|
||||
try {
|
||||
await transfer.downloadReceiptFiles();
|
||||
await transfer.downloadInboundFiles();
|
||||
} catch (e) {
|
||||
reportError(e);
|
||||
}
|
||||
@@ -364,7 +368,7 @@ async function onCloseConfirm(reason: string) {
|
||||
}
|
||||
}
|
||||
|
||||
/** 来源实例选择确认 → 创建匹配并切换匹配卡(决策 4:两步第一步;收料日期范围为查询范围;调拨类型决定数据范围) */
|
||||
/** 来源实例选择确认 → 创建匹配并切换匹配卡(决策 4:两步第一步;异动日期范围为查询范围;调拨类型决定数据范围) */
|
||||
async function onSourceConfirm(
|
||||
sourceCodes: string[],
|
||||
dateRange?: { from?: string; to?: string },
|
||||
@@ -384,7 +388,7 @@ async function onSourceConfirm(
|
||||
}
|
||||
}
|
||||
|
||||
/** 对来源(单个或批量)重新触发收料 RPA 抓取,重试期间标记该来源(busy 独立于 confirm busy)。 */
|
||||
/** 对来源(单个或批量)重新触发入站 RPA 抓取,重试期间标记该来源(busy 独立于 confirm busy)。 */
|
||||
async function onSourceRetry(sourceCodes: string[]) {
|
||||
const codes = Array.isArray(sourceCodes) ? sourceCodes : [sourceCodes];
|
||||
retryingSource.value = new Set([...retryingSource.value, ...codes]);
|
||||
@@ -450,7 +454,7 @@ async function onSourceRetry(sourceCodes: string[]) {
|
||||
v-else-if="(mode === 'run' || mode === 'result') && (runNo || run?.run_no)"
|
||||
:run-no="runNo || String(run?.run_no ?? '')"
|
||||
:initial-run="run"
|
||||
@download-receipt="onDownloadReceipt"
|
||||
@download-inbound="onDownloadInbound"
|
||||
@download-erp="onDownloadErp"
|
||||
@download-exceptions="onDownloadExceptions"
|
||||
@retry="onOrderRetry"
|
||||
@@ -459,8 +463,10 @@ async function onSourceRetry(sourceCodes: string[]) {
|
||||
<TransferBacklogSummaryCard
|
||||
v-else-if="mode === 'backlog'"
|
||||
:items="transfer.backlog.value"
|
||||
:total="transfer.backlogTotal.value"
|
||||
:busy="busy"
|
||||
:initial-filter="backlogInitialFilter"
|
||||
@query-change="onBacklogQueryChange"
|
||||
@retry="onBacklogRetry"
|
||||
@requery="onBacklogRequery"
|
||||
@resume="onBacklogResume"
|
||||
|
||||
@@ -0,0 +1,206 @@
|
||||
/**
|
||||
* features/chat/components/messages/TransferPendingMatchPanel.spec.ts
|
||||
* 用途:验证「待匹配」抽屉的「清空并重新解析」维护链路(Task 8,后端 Task 7)——
|
||||
* 来源行按钮渲染、点击先调预检(GET reparse-preview)、确认弹窗展示预检数据
|
||||
* (文件份数/规则 code+version/将清除与证据缺失保留行数)、确认后调执行端点
|
||||
* (POST reparse)、成功后 emit refresh 并展示结果摘要(清除 N/重落 M)、
|
||||
* 失败在弹窗内展示后端中止原因(解析失败未删任何数据)。
|
||||
* 依赖:vi.mock(transfer.api)、@vue/test-utils、i18n(真实实例,R4:键值纯文本无插值)。
|
||||
* 逻辑:数值断言取自 mock 载荷(与文案键解耦,防 red 阶段误判);确认弹窗数据必须
|
||||
* 来自预检接口而非本地猜测(断言 preview 调用先于弹窗内容)。
|
||||
*/
|
||||
import { mount, flushPromises } from '@vue/test-utils';
|
||||
import { describe, expect, it, vi, beforeEach } from 'vitest';
|
||||
import i18n from '@/i18n';
|
||||
import { BusinessError } from '@/shared/api/client';
|
||||
|
||||
const api = vi.hoisted(() => ({
|
||||
// useChatTransfer 全量依赖(vi.mock 工厂整模块替换,按 composable 导入面列出)
|
||||
createTransferMatching: vi.fn(),
|
||||
getTransferMatching: vi.fn(),
|
||||
executeTransferItems: vi.fn(),
|
||||
getTransferRun: vi.fn(),
|
||||
cancelTransferRun: vi.fn(),
|
||||
retryTransferItem: vi.fn(),
|
||||
manualCloseTransferItem: vi.fn(),
|
||||
batchRequeryTransferItems: vi.fn(),
|
||||
downloadTransferInboundFiles: vi.fn(),
|
||||
downloadTransferErpInventory: vi.fn(),
|
||||
downloadTransferExceptions: vi.fn(),
|
||||
listTransferSources: vi.fn(),
|
||||
fetchTransferTypes: vi.fn(),
|
||||
retryTransferSourceRpa: vi.fn(),
|
||||
retryTransferSourcesRpaBatch: vi.fn(),
|
||||
listTransferBacklogPage: vi.fn(),
|
||||
getTransferBacklogSummary: vi.fn(),
|
||||
listExecutableTransferItems: vi.fn(),
|
||||
listPendingMatchRecordsPage: vi.fn(),
|
||||
// Task 7 维护链路端点(本组件被测面)
|
||||
fetchPendingMatchReparsePreview: vi.fn(),
|
||||
reparsePendingMatch: vi.fn(),
|
||||
}));
|
||||
|
||||
vi.mock('@/features/chat/api/transfer.api', () => api);
|
||||
|
||||
import TransferPendingMatchPanel from './TransferPendingMatchPanel.vue';
|
||||
|
||||
/** 两个来源的待匹配记录(同来源多行验证按钮行级渲染) */
|
||||
const records = [
|
||||
{ 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' },
|
||||
{ ledger_record_id: 102, doc_no: 'HOM-902', material_code: 'MAT-8', material_name: '未匹配物料二',
|
||||
movement_date: '2026-08-05', source_code: 'DBS-AWSBI', quantity: '12' },
|
||||
{ ledger_record_id: 103, doc_no: 'HOM-903', material_code: 'MAT-7', material_name: '未匹配物料三',
|
||||
movement_date: '2026-08-05', source_code: 'CRANE-FP', quantity: '3' },
|
||||
];
|
||||
|
||||
/** 预检载荷(数值刻意互异:文件 2 份/规则 v3/清除 12/保留 4,供弹窗文案断言) */
|
||||
const previewPayload = {
|
||||
files: [
|
||||
{ archived_at: '2026-08-03T10:00:00', sha256: 'sha-aaa', rows: 7 },
|
||||
{ archived_at: '2026-08-04T10:00:00', sha256: 'sha-bbb', rows: 5 },
|
||||
],
|
||||
profile: { code: 'DBS-INV', version: 3 },
|
||||
clearable_rows: 12,
|
||||
kept_rows: 4,
|
||||
};
|
||||
|
||||
/** 执行结果载荷(cleared/reinserted 与预检不同值,断言摘要来自执行端点而非预检) */
|
||||
const reparsePayload = {
|
||||
source_code: 'DBS-AWSBI',
|
||||
cleared: 12,
|
||||
reinserted: 10,
|
||||
date_skipped: 0,
|
||||
kept_unrebuildable: 4,
|
||||
unlinked_items: 2,
|
||||
files: [{ file_id: 5, sha256: 'sha-aaa', archived_at: '2026-08-03T10:00:00', inserted: 10 }],
|
||||
};
|
||||
|
||||
function mountPanel() {
|
||||
return mount(TransferPendingMatchPanel, {
|
||||
props: { records },
|
||||
global: { plugins: [i18n] },
|
||||
});
|
||||
}
|
||||
|
||||
/** el-table 行渲染晚于 mount 同步时刻(EP 表格数据经内部 store 下一 tick 上屏),统一先 flush。 */
|
||||
async function mountFlushedPanel(customRecords: typeof records = records) {
|
||||
const wrapper = mount(TransferPendingMatchPanel, {
|
||||
props: { records: customRecords },
|
||||
global: { plugins: [i18n] },
|
||||
});
|
||||
await flushPromises();
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
/** 打开确认弹窗的公共前置:点击首行按钮并等待预检返回 */
|
||||
async function openDialog(wrapper: ReturnType<typeof mountPanel>) {
|
||||
await wrapper.find('[data-testid="transfer-pending-match-reparse"]').trigger('click');
|
||||
await flushPromises();
|
||||
}
|
||||
|
||||
describe('TransferPendingMatchPanel 清空重解析(Task 8)', () => {
|
||||
beforeEach(() => {
|
||||
vi.clearAllMocks();
|
||||
api.listPendingMatchRecordsPage.mockResolvedValue({ records: [], total: 0, page: 1, page_size: 20 });
|
||||
api.fetchPendingMatchReparsePreview.mockResolvedValue(previewPayload);
|
||||
api.reparsePendingMatch.mockResolvedValue(reparsePayload);
|
||||
});
|
||||
|
||||
it('来源行渲染「清空重解析」按钮:每行一个,携带行来源', async () => {
|
||||
const wrapper = await mountFlushedPanel();
|
||||
const buttons = wrapper.findAll('[data-testid="transfer-pending-match-reparse"]');
|
||||
// [断言意图] 行级入口:按钮数=记录数(非按来源聚合条),首按钮指向首行来源。
|
||||
expect(buttons).toHaveLength(records.length);
|
||||
expect(buttons[0].attributes('data-source')).toBe('DBS-AWSBI');
|
||||
expect(buttons[2].attributes('data-source')).toBe('CRANE-FP');
|
||||
});
|
||||
|
||||
it('点击后先调预检并弹确认:展示文件份数/规则 code+version/清除与保留行数', async () => {
|
||||
// [断言意图] 确认弹窗数据必须来自预检接口:点击即调 reparse-preview(带行来源),
|
||||
// 弹窗内容展示预检四要素(份数 2 / DBS-INV v3 / 清除 12 / 保留 4)。
|
||||
const wrapper = await mountFlushedPanel();
|
||||
await openDialog(wrapper);
|
||||
expect(api.fetchPendingMatchReparsePreview).toHaveBeenCalledWith('DBS-AWSBI');
|
||||
const dialog = wrapper.find('[data-testid="transfer-pending-match-reparse-dialog"]');
|
||||
expect(dialog.exists()).toBe(true);
|
||||
expect(wrapper.find('[data-testid="transfer-pending-match-reparse-files"]').text()).toContain('2');
|
||||
const profile = wrapper.find('[data-testid="transfer-pending-match-reparse-profile"]').text();
|
||||
expect(profile).toContain('DBS-INV');
|
||||
expect(profile).toContain('3');
|
||||
const rows = wrapper.find('[data-testid="transfer-pending-match-reparse-rows"]').text();
|
||||
expect(rows).toContain('12');
|
||||
expect(rows).toContain('4');
|
||||
});
|
||||
|
||||
it('来源未绑定解析规则时弹窗展示「未绑定规则」文案而非 code+version', async () => {
|
||||
// [断言意图] profile=null(无已发布入站规则=无重建通道)必须显式披露,
|
||||
// 不允许渲染成空串或 undefined。
|
||||
api.fetchPendingMatchReparsePreview.mockResolvedValue({ ...previewPayload, profile: null });
|
||||
const wrapper = await mountFlushedPanel();
|
||||
await openDialog(wrapper);
|
||||
expect(wrapper.find('[data-testid="transfer-pending-match-reparse-profile"]').text()).not.toContain('DBS-INV');
|
||||
expect(wrapper.find('[data-testid="transfer-pending-match-reparse-profile-empty"]').exists()).toBe(true);
|
||||
});
|
||||
|
||||
it('确认后调执行端点,成功后 emit refresh 并展示结果摘要(清除/重落)', async () => {
|
||||
const wrapper = await mountFlushedPanel();
|
||||
await openDialog(wrapper);
|
||||
await wrapper.find('[data-testid="transfer-pending-match-reparse-confirm"]').trigger('click');
|
||||
await flushPromises();
|
||||
// [断言意图] 执行走 POST reparse(带来源);成功后向上冒泡 refresh 让宿主
|
||||
// 重拉待匹配清单,并在弹窗内展示执行端点返回的计数摘要。
|
||||
expect(api.reparsePendingMatch).toHaveBeenCalledWith('DBS-AWSBI');
|
||||
expect(wrapper.emitted('refresh')).toBeTruthy();
|
||||
const summary = wrapper.find('[data-testid="transfer-pending-match-reparse-result"]').text();
|
||||
expect(summary).toContain('12');
|
||||
expect(summary).toContain('10');
|
||||
});
|
||||
|
||||
it('执行失败在弹窗内展示中止原因(解析失败一行未删),不 emit refresh', async () => {
|
||||
// [断言意图] 后端整体中止(TRANSFER.REPARSE_PARSE_FAILED)→ 弹窗保持打开并
|
||||
// 透出后端 reason(含「未删任何数据」语义);失败不得触发清单刷新。
|
||||
api.reparsePendingMatch.mockRejectedValue(
|
||||
new BusinessError({ message: '归档 1 份解析失败:b.xlsx', code: 'TRANSFER.REPARSE_PARSE_FAILED' }),
|
||||
);
|
||||
const wrapper = await mountFlushedPanel();
|
||||
await openDialog(wrapper);
|
||||
await wrapper.find('[data-testid="transfer-pending-match-reparse-confirm"]').trigger('click');
|
||||
await flushPromises();
|
||||
expect(wrapper.emitted('refresh')).toBeFalsy();
|
||||
const error = wrapper.find('[data-testid="transfer-pending-match-reparse-error"]');
|
||||
expect(error.exists()).toBe(true);
|
||||
expect(error.text()).toContain('归档 1 份解析失败:b.xlsx');
|
||||
});
|
||||
|
||||
it('待匹配清单服务端分页:翻页上抛 page-change 由宿主拉取对应页', async () => {
|
||||
// [断言意图] 服务端分页契约(2026-10-16):组件只持页码 UI 态——
|
||||
// 渲染 props.records(服务端当前页切片),DOM 随页大小有界。
|
||||
// 翻页只上抛 page-change 由宿主拉取(服务端分页,2026-10-16)。
|
||||
const pageRecords = Array.from({ length: 20 }, (_, i) => ({
|
||||
ledger_record_id: 200 + i,
|
||||
doc_no: `HOM-${900 + i}`,
|
||||
material_code: `MAT-${i}`,
|
||||
material_name: '未匹配物料',
|
||||
movement_date: '2026-08-05',
|
||||
source_code: 'DBS-AWSBI',
|
||||
quantity: '1',
|
||||
}));
|
||||
const wrapper = await mountFlushedPanel(pageRecords);
|
||||
// 注入 total=25(模拟服务端返回的桶全量计数)触发分页条渲染。
|
||||
await wrapper.setProps({ total: 25 });
|
||||
expect(wrapper.findAll('tr.el-table__row')).toHaveLength(20);
|
||||
await wrapper.find('.btn-next').trigger('click');
|
||||
// [断言意图] 组件不自行改数据:翻页仅上抛 page-change({page:2})。
|
||||
expect(wrapper.emitted('page-change')?.[0][0]).toEqual({ page: 2 });
|
||||
});
|
||||
|
||||
it('取消关闭弹窗且不发任何执行请求', async () => {
|
||||
const wrapper = await mountFlushedPanel();
|
||||
await openDialog(wrapper);
|
||||
await wrapper.find('[data-testid="transfer-pending-match-reparse-cancel"]').trigger('click');
|
||||
await flushPromises();
|
||||
expect(wrapper.find('[data-testid="transfer-pending-match-reparse-dialog"]').exists()).toBe(false);
|
||||
expect(api.reparsePendingMatch).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
@@ -1,29 +1,167 @@
|
||||
<!--
|
||||
features/chat/components/messages/TransferPendingMatchPanel.vue
|
||||
用途:「待匹配」桶只读清单(D16,规格 §10/§12.3)——已抓取尚未匹配的外部收料
|
||||
记录(档记录尚无 items),首页待办看板第 4 张卡的抽屉数据源。
|
||||
依赖:props.records(GET /backlog/pending-match 投影)、i18n chat.transfer.transferPendingMatch*。
|
||||
逻辑:纯只读——无勾选列、无执行入口(记录尚未经匹配/库存核对,不可执行);
|
||||
顶部「去匹配」按钮上抛 go-match,由父级切到库存匹配入口(来源选择卡);
|
||||
清单按后端稳定排序(收料日期→来源→单号)渲染,数量为档原值文本。
|
||||
用途:「待匹配」桶清单(D16,规格 §10/§12.3)+「清空并重新解析」维护入口(Task 8,
|
||||
规格 §6,后端 Task 7)——已抓取尚未匹配的外部入站记录(档记录尚无 items),
|
||||
首页待办看板第 4 张卡的抽屉数据源;解析规则修改后可按来源清空旧映射档行、
|
||||
以当前绑定入站解析规则重建(确认弹窗数据来自预检接口,执行失败透出中止未删语义)。
|
||||
依赖:Element Plus ElTable/ElTableColumn/ElDialog(2026-10-16 EP 组件化:表格与确认
|
||||
弹层壳迁 EP,预检→确认→执行语义不变)、props.records(GET /backlog/pending-match
|
||||
投影)、fetchPendingMatchReparsePreview(预检,只读)、
|
||||
useChatTransfer().reparsePendingMatch(执行+刷新桶)、i18n chat.transfer.*。
|
||||
逻辑:清单主体仍按后端稳定排序只读渲染(无勾选列,不可执行;「去匹配」上抛 go-match
|
||||
由父级切库存匹配入口);行级「清空重解析」按钮点击先调预检(GET reparse-preview)
|
||||
再弹确认——弹窗展示文件份数/规则 code+version(或「未绑定解析规则」)/将清除行数/
|
||||
证据缺失保留行数,数据只来自预检响应、禁止本地估算;确认调执行端点(单事务在后端),
|
||||
成功后 emit refresh 由宿主重拉清单并展示结果摘要(清除 N/重落 M),失败在弹窗内
|
||||
透出后端 reason(解析失败一行未删)。行定位:el-table 行不支持逐行 attr,
|
||||
行 testid 改经 row-class-name 注入(transfer-pending-match-row-<doc_no>)。
|
||||
弹层壳禁 ESC/遮罩点击/X 关闭(仅取消/确认按钮可关,防误触关闭维护操作)。
|
||||
服务端分页(2026-10-16):后端接口分页 envelope,本组件只持页码 UI 态,
|
||||
翻页上抛 page-change 由宿主(TransferHomePanel)拉取当前页。
|
||||
文案遵守 R4:chat.transfer 新键一律纯文本(无 {xxx} 插值,vue-i18n 11.4.7
|
||||
深层嵌套键命名插值异常),动态数量由脚本拼接。
|
||||
-->
|
||||
<script setup lang="ts">
|
||||
import type { TransferPendingMatchRecord } from '../../types/transfer.types';
|
||||
import { computed, ref, watch } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { ElDialog, ElPagination, ElTable, ElTableColumn } from 'element-plus';
|
||||
import { TRANSFER_PAGE_SIZE } from '../../composables/useChatTransfer';
|
||||
import { transferDialogShellAttrs } from './transferDialogShell';
|
||||
import { fetchPendingMatchReparsePreview } from '../../api/transfer.api';
|
||||
import { useChatTransfer } from '../../composables/useChatTransfer';
|
||||
import type {
|
||||
TransferPendingMatchRecord,
|
||||
TransferPendingMatchReparsePreview,
|
||||
TransferPendingMatchReparseResult,
|
||||
} from '../../types/transfer.types';
|
||||
|
||||
defineProps<{
|
||||
const props = defineProps<{
|
||||
/** 当前页记录切片(服务端分页返回;父级经 loadPendingMatchRecords 拉取)。 */
|
||||
records: TransferPendingMatchRecord[];
|
||||
/** 桶全量计数(分页器数据源;不传视为 0=隐藏分页条)。 */
|
||||
total?: number;
|
||||
busy?: boolean;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
/** 「去匹配」引导:切到现有库存匹配入口(来源选择卡),本桶不提供任何执行动作。 */
|
||||
/** 「去匹配」引导:切到现有库存匹配入口(来源选择卡),清单本身不提供执行动作。 */
|
||||
'go-match': [];
|
||||
refresh: [];
|
||||
/** 翻页:宿主据此调用 loadPendingMatchRecords({page}) 拉取对应页(服务端分页)。 */
|
||||
'page-change': [query: { page: number }];
|
||||
}>();
|
||||
|
||||
const { t } = useI18n();
|
||||
// 维护链路专用实例(组件自驱动,模式同 TransferMessageView):仅消费 reparsePendingMatch
|
||||
const transfer = useChatTransfer();
|
||||
|
||||
/** 分页页码(本地 UI 态;数据由父级按 page-change 拉取后经 props 回流)。
|
||||
* 翻页/收拢统一经 watch(currentPage) 上抛(单一出口,收拢也通知宿主重拉)。 */
|
||||
const PAGE_SIZE = TRANSFER_PAGE_SIZE;
|
||||
const currentPage = ref(1);
|
||||
|
||||
watch(currentPage, (page) => emit('page-change', { page }));
|
||||
|
||||
// 桶变小(清空重解析/刷新)后收拢当前页防空白页:页码变化经上述 watch 上抛,
|
||||
// 宿主重拉后 props.records/total 回流,避免停留在越界空页。
|
||||
watch(() => props.total, (total = 0) => {
|
||||
const maxPage = Math.max(1, Math.ceil(total / PAGE_SIZE));
|
||||
if (currentPage.value > maxPage) currentPage.value = maxPage;
|
||||
});
|
||||
|
||||
/**
|
||||
* 确认弹窗状态:source=当前操作来源;preview=预检数据(弹窗内容唯一数据源);
|
||||
* previewLoading=预检在途;confirming=执行在途(防重复点击);result=执行成功摘要;
|
||||
* errorMessage=中止原因(预检失败或后端整体中止 TRANSFER.REPARSE_PARSE_FAILED 透传)。
|
||||
*/
|
||||
const dialogSource = ref<string | null>(null);
|
||||
const preview = ref<TransferPendingMatchReparsePreview | null>(null);
|
||||
const previewLoading = ref(false);
|
||||
const confirming = ref(false);
|
||||
const result = ref<TransferPendingMatchReparseResult | null>(null);
|
||||
const errorMessage = ref('');
|
||||
|
||||
function rowKey(record: TransferPendingMatchRecord): string {
|
||||
return `${record.ledger_record_id}|${record.doc_no}`;
|
||||
}
|
||||
|
||||
/** el-table 行类:注入行定位类(替代旧行 testid)。 */
|
||||
function rowClassName({ row }: { row: TransferPendingMatchRecord }): string {
|
||||
return `transfer-pending-match-row-${row.doc_no}`;
|
||||
}
|
||||
|
||||
/**
|
||||
* 点击来源行「清空重解析」:先调预检(只读零副作用),成功才进入确认态。
|
||||
* 【AI 触发时机】用户点击行级按钮时调用;禁止跳过预检直接执行
|
||||
* (确认弹窗必须展示预检数据,让操作者在执行前看到重建范围)。
|
||||
*
|
||||
* @param sourceCode - 行来源实例编码(业务约束:来自待匹配记录,禁止传显示名)
|
||||
*/
|
||||
async function openReparseDialog(sourceCode: string) {
|
||||
dialogSource.value = sourceCode;
|
||||
preview.value = null;
|
||||
result.value = null;
|
||||
errorMessage.value = '';
|
||||
previewLoading.value = true;
|
||||
try {
|
||||
preview.value = await fetchPendingMatchReparsePreview(sourceCode);
|
||||
} catch (e) {
|
||||
// 预检失败(网络/权限等):错误落弹窗内文案,不进入可确认态(confirm 由 !preview 拦截)
|
||||
errorMessage.value = e instanceof Error ? e.message : String(e);
|
||||
} finally {
|
||||
previewLoading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
/** 关闭确认弹窗并清空全部弹窗态(取消/成功后关闭共用,幂等)。 */
|
||||
function closeReparseDialog() {
|
||||
dialogSource.value = null;
|
||||
preview.value = null;
|
||||
result.value = null;
|
||||
errorMessage.value = '';
|
||||
}
|
||||
|
||||
/**
|
||||
* 确认执行清空重建:调 POST reparse(单事务在后端,先全量预解析、失败一行不删)。
|
||||
* 成功 → 展示结果摘要(清除 N/重落 M)并 emit refresh 让宿主重拉待匹配清单;
|
||||
* 失败 → 弹窗保持打开并透出后端 reason(含「中止未删」语义),不刷新清单。
|
||||
*/
|
||||
async function confirmReparse() {
|
||||
if (!dialogSource.value || confirming.value) return;
|
||||
confirming.value = true;
|
||||
errorMessage.value = '';
|
||||
try {
|
||||
result.value = await transfer.reparsePendingMatch(dialogSource.value);
|
||||
emit('refresh');
|
||||
} catch (e) {
|
||||
errorMessage.value = e instanceof Error ? e.message : String(e);
|
||||
} finally {
|
||||
confirming.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
// —— R4 纯文本拼接文案:vue-i18n 11.4.7 深层嵌套键命名插值异常,禁 {xxx} 占位;
|
||||
// 动态数量一律「纯文本键 + 脚本拼接」(先例 shippingOrderReview.releaseBar.missingPrefix/Suffix)。
|
||||
const filesLine = computed(() =>
|
||||
preview.value
|
||||
? `${t('chat.transfer.reparseFilesPrefix')}${preview.value.files.length}${t('chat.transfer.reparseFilesSuffix')}`
|
||||
: '',
|
||||
);
|
||||
const profileLine = computed(() => {
|
||||
const profile = preview.value?.profile;
|
||||
if (!profile) return '';
|
||||
return `${t('chat.transfer.reparseProfilePrefix')}${profile.code}${t('chat.transfer.reparseProfileVersionPrefix')}${profile.version}`;
|
||||
});
|
||||
const rowsLine = computed(() =>
|
||||
preview.value
|
||||
? `${t('chat.transfer.reparseRowsClearPrefix')}${preview.value.clearable_rows}${t('chat.transfer.reparseRowsClearSuffix')}${t('chat.transfer.reparseRowsKeptPrefix')}${preview.value.kept_rows}${t('chat.transfer.reparseRowsKeptSuffix')}`
|
||||
: '',
|
||||
);
|
||||
const successLine = computed(() =>
|
||||
result.value
|
||||
? `${t('chat.transfer.reparseSuccessPrefix')}${result.value.cleared}${t('chat.transfer.reparseSuccessReinsertPrefix')}${result.value.reinserted}${t('chat.transfer.reparseSuccessSuffix')}`
|
||||
: '',
|
||||
);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -54,37 +192,132 @@ function rowKey(record: TransferPendingMatchRecord): string {
|
||||
</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}`"
|
||||
<!-- EP 表格壳:只读清单(数据=服务端当前页切片),横向滚动由 el-table 内建;行级维护入口语义不变 -->
|
||||
<el-table
|
||||
v-if="records.length"
|
||||
:data="records"
|
||||
:row-key="rowKey"
|
||||
:row-class-name="rowClassName"
|
||||
size="small"
|
||||
class="text-xs"
|
||||
data-testid="transfer-pending-match-table"
|
||||
>
|
||||
<el-table-column :label="$t('chat.transfer.transferPendingMatchColSource')" prop="source_code" min-width="110" class-name="whitespace-nowrap" />
|
||||
<el-table-column :label="$t('chat.transfer.transferPendingMatchColDocNo')" prop="doc_no" min-width="120" class-name="whitespace-nowrap">
|
||||
<template #default="{ row }">
|
||||
<span class="font-semibold">{{ row.doc_no }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('chat.transfer.transferPendingMatchColMaterial')" min-width="110" class-name="whitespace-nowrap">
|
||||
<template #default="{ row }">{{ row.material_code || '—' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('chat.transfer.transferPendingMatchColName')" min-width="140">
|
||||
<template #default="{ row }">{{ row.material_name || '—' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('chat.transfer.transferPendingMatchColDate')" min-width="100" class-name="whitespace-nowrap">
|
||||
<template #default="{ row }">{{ row.movement_date || '—' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('chat.transfer.transferPendingMatchColQuantity')" min-width="90" class-name="whitespace-nowrap">
|
||||
<template #default="{ row }">{{ row.quantity ?? '—' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('chat.transfer.colAction')" min-width="120" class-name="whitespace-nowrap">
|
||||
<template #default="{ row }">
|
||||
<!-- 行级维护入口(Task 8):点击先调预检再弹确认,不在行上直接执行 -->
|
||||
<button
|
||||
type="button"
|
||||
class="rounded-lg border border-indigo-200 px-2 py-0.5 text-[11px] font-bold text-indigo-600 hover:bg-indigo-50 disabled:cursor-not-allowed disabled:opacity-40"
|
||||
:disabled="busy"
|
||||
:data-source="row.source_code"
|
||||
data-testid="transfer-pending-match-reparse"
|
||||
@click="openReparseDialog(row.source_code)"
|
||||
>
|
||||
<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.reparseButton') }}
|
||||
</button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- 服务端分页条(单页时隐藏):total=桶全量计数,页码变化统一经 watch 上抛;
|
||||
文案走全局 ElConfigProvider 四语言 locale -->
|
||||
<el-pagination
|
||||
v-if="(total ?? 0) > PAGE_SIZE"
|
||||
v-model:current-page="currentPage"
|
||||
:total="total ?? 0"
|
||||
:page-size="PAGE_SIZE"
|
||||
layout="total, prev, pager, next, jumper"
|
||||
size="small"
|
||||
class="mt-2 justify-end"
|
||||
data-testid="transfer-pending-match-pagination"
|
||||
/>
|
||||
<div v-else-if="!records.length" class="rounded-lg bg-surface-soft p-3 text-xs text-muted" data-testid="transfer-pending-match-empty">
|
||||
{{ $t('chat.transfer.transferPendingMatchEmpty') }}
|
||||
</div>
|
||||
|
||||
<!-- 「清空并重新解析」确认弹层(Task 8;内容唯一数据源=预检接口,禁止本地估算)。
|
||||
v-if + model-value=true:打开即渲染、关闭即卸载(无过渡等待,测试语义同旧行为) -->
|
||||
<el-dialog
|
||||
v-if="dialogSource"
|
||||
:model-value="true"
|
||||
v-bind="transferDialogShellAttrs"
|
||||
width="28rem"
|
||||
class="rounded-2xl bg-surface"
|
||||
>
|
||||
<template #header>
|
||||
<h3 class="text-base font-bold text-primary" data-testid="transfer-pending-match-reparse-dialog">
|
||||
{{ $t('chat.transfer.reparseTitle') }}
|
||||
</h3>
|
||||
</template>
|
||||
<p class="text-xs font-semibold text-secondary">{{ dialogSource }}</p>
|
||||
|
||||
<p v-if="previewLoading" class="mt-3 text-xs text-muted" data-testid="transfer-pending-match-reparse-loading">
|
||||
…
|
||||
</p>
|
||||
|
||||
<ul v-else-if="preview" class="mt-3 space-y-1 rounded-lg bg-surface-soft p-3 text-xs text-secondary">
|
||||
<li data-testid="transfer-pending-match-reparse-files">{{ filesLine }}</li>
|
||||
<li data-testid="transfer-pending-match-reparse-profile">
|
||||
<template v-if="preview.profile">{{ profileLine }}</template>
|
||||
<span v-else class="font-bold text-amber-600" data-testid="transfer-pending-match-reparse-profile-empty">
|
||||
{{ $t('chat.transfer.reparseProfileEmpty') }}
|
||||
</span>
|
||||
</li>
|
||||
<li data-testid="transfer-pending-match-reparse-rows">{{ rowsLine }}</li>
|
||||
</ul>
|
||||
|
||||
<p
|
||||
v-if="result"
|
||||
class="mt-3 rounded-lg bg-emerald-50 px-3 py-2 text-xs font-bold text-emerald-700"
|
||||
data-testid="transfer-pending-match-reparse-result"
|
||||
>
|
||||
{{ successLine }}
|
||||
</p>
|
||||
<p
|
||||
v-if="errorMessage"
|
||||
class="mt-3 rounded-lg bg-red-50 px-3 py-2 text-xs font-bold text-red-600"
|
||||
data-testid="transfer-pending-match-reparse-error"
|
||||
>
|
||||
{{ $t('chat.transfer.reparseFailedPrefix') }}{{ errorMessage }}
|
||||
</p>
|
||||
|
||||
<div class="mt-4 flex justify-end gap-2">
|
||||
<button
|
||||
type="button"
|
||||
class="rounded-lg border border-default px-4 py-1.5 text-sm text-secondary hover-surface-soft"
|
||||
data-testid="transfer-pending-match-reparse-cancel"
|
||||
@click="closeReparseDialog"
|
||||
>
|
||||
{{ $t('chat.transfer.cancel') }}
|
||||
</button>
|
||||
<button
|
||||
v-if="!result"
|
||||
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="!preview || confirming"
|
||||
data-testid="transfer-pending-match-reparse-confirm"
|
||||
@click="confirmReparse"
|
||||
>
|
||||
{{ $t('chat.transfer.reparseButton') }}
|
||||
</button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
@@ -1,7 +1,7 @@
|
||||
<!--
|
||||
features/chat/components/messages/TransferResultCard.vue
|
||||
用途:融合卡(D9:调拨单清单=进度=结果)——props { run_no } 自驱动轮询 GET /runs/{run_no},
|
||||
逐单展示「收料日期 · 拨出→拨入 · N 物料 · 合计」与状态徽标(待处理/执行中/ERP 单号/失败),
|
||||
逐单展示「异动日期 · 拨出→拨入 · N 物料 · 合计」与状态徽标(待处理/执行中/ERP 单号/失败),
|
||||
行明细常驻展开(Invoice | 料号 | 品名 | 拨出批号 | 投入数量,列序对齐可调拨明细);
|
||||
单据级动作与状态徽标同排头部右侧(2026-09-29 方案A):result_unknown [重新触发]
|
||||
(D11 唯一出口,幂等只触发末步);失败行 [重试](emit 上抛,复用既有 batch-requery)+
|
||||
@@ -33,7 +33,7 @@ const props = defineProps<{
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
downloadReceipt: [];
|
||||
downloadInbound: [];
|
||||
downloadErp: [];
|
||||
downloadExceptions: [];
|
||||
/** 失败单 [重试]:上抛父级调 POST /documents/{doc_no}/retry(一键重查+自动重跑)。 */
|
||||
@@ -67,7 +67,7 @@ const orders = computed<TransferOrder[]>(() => {
|
||||
if (Array.isArray(data.orders) && data.orders.length) return data.orders;
|
||||
return (data.result?.external_documents ?? []).map((doc) => ({
|
||||
doc_no: doc.document_no,
|
||||
receipt_date: '',
|
||||
movement_date: '',
|
||||
from_warehouse: doc.from_warehouse,
|
||||
to_warehouse: doc.to_warehouse,
|
||||
status: 'success' as const,
|
||||
@@ -319,7 +319,7 @@ async function confirmCloseOrder() {
|
||||
>
|
||||
<div class="flex flex-wrap items-center justify-between gap-2 px-3 py-2 text-xs">
|
||||
<span class="font-semibold text-secondary" :data-testid="`transfer-order-summary-${order.doc_no}`">
|
||||
{{ order.receipt_date || '—' }} · {{ order.from_warehouse }}→{{ order.to_warehouse }}
|
||||
{{ order.movement_date || '—' }} · {{ order.from_warehouse }}→{{ order.to_warehouse }}
|
||||
· {{ $t('chat.transfer.materialCount', { count: order.lines.length }) }}
|
||||
<template v-if="order.lines.length"> · {{ orderTotalQuantity(order) }} {{ orderUnit(order) }}</template>
|
||||
</span>
|
||||
@@ -423,7 +423,7 @@ async function confirmCloseOrder() {
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<!-- 终态动作:下载异常清单 / 收料文件 / ERP 库存表(父级经 useChatTransfer 真实下载) -->
|
||||
<!-- 终态动作:下载异常清单 / 入站文件 / ERP 库存表(父级经 useChatTransfer 真实下载) -->
|
||||
<div v-if="terminal" class="mt-3 flex flex-wrap gap-2 border-t border-subtle pt-3" data-testid="transfer-result-downloads">
|
||||
<button
|
||||
type="button"
|
||||
@@ -436,10 +436,10 @@ async function confirmCloseOrder() {
|
||||
<button
|
||||
type="button"
|
||||
class="rounded-lg border border-brand-200 px-3 py-1.5 text-xs font-bold text-brand-700 hover:bg-brand-50"
|
||||
data-testid="transfer-download-receipt"
|
||||
@click="emit('downloadReceipt')"
|
||||
data-testid="transfer-download-inbound"
|
||||
@click="emit('downloadInbound')"
|
||||
>
|
||||
{{ $t('chat.transfer.downloadReceiptFiles') }}
|
||||
{{ $t('chat.transfer.downloadInboundFiles') }}
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* features/chat/components/messages/TransferSourceSelectCard.spec.ts
|
||||
* 用途:来源实例选择卡——平台分组、全选已启用、清空、按收料文件状态门禁确认、
|
||||
* 确认提交、重试收料 RPA;调拨类型选项=接口下发(Task 7 接口化):
|
||||
* 用途:来源实例选择卡——平台分组、全选已启用、清空、按入站文件状态门禁确认、
|
||||
* 确认提交、重试入站 RPA;调拨类型选项=接口下发(Task 7 接口化):
|
||||
* 选项渲染/名称多语言回退/空配置空态/确认禁用,「即将上线」占位不再出现。
|
||||
* 依赖:@vue/test-utils、i18n。
|
||||
* 逻辑:平台 DBS/Crane 仅分组;实例为选择与执行边界(决策 2/3/4);
|
||||
@@ -15,7 +15,7 @@ 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 { defaultMovementDate, shanghaiBusinessDate } from './transferDate';
|
||||
import type { TransferTypeOption } from '../../types/transfer.types';
|
||||
|
||||
const readySources = [
|
||||
@@ -156,8 +156,8 @@ describe('TransferSourceSelectCard', () => {
|
||||
});
|
||||
|
||||
it('parse_failed 显示解析失败徽标且可重试', async () => {
|
||||
// [断言意图] 当日收料文件解析失败(file_status=parse_failed)不得误报就绪;
|
||||
// 与 none/failed/expired 一样允许重新触发收料 RPA。
|
||||
// [断言意图] 当日入站文件解析失败(file_status=parse_failed)不得误报就绪;
|
||||
// 与 none/failed/expired 一样允许重新触发入站 RPA。
|
||||
const wrapper = mountCard({}, [
|
||||
{ source_code: 'DSV-BAD', display_name: 'bad', platform: 'dbs', enabled: true, has_ready_file: false, file_status: 'parse_failed' as const },
|
||||
]);
|
||||
@@ -189,24 +189,28 @@ describe('TransferSourceSelectCard', () => {
|
||||
expect(wrapper.emitted('confirm')).toBeUndefined();
|
||||
});
|
||||
|
||||
it('D+1 规则提示收进 ⓘ 悬浮(title),不再平铺占宽', () => {
|
||||
it('日期默认值提示收进 ⓘ 悬浮(title),不再平铺占宽', () => {
|
||||
// [断言意图] 长规则文案通过原生 title 渐进披露,紧凑日期行不换行错位。
|
||||
const wrapper = mountCard();
|
||||
const title = wrapper.find('[data-testid="transfer-source-date-hint"]').attributes('title') ?? '';
|
||||
expect(title).toContain('D+1 规则');
|
||||
expect(title).toContain('业务日期前一天');
|
||||
expect(title).toContain('T−2');
|
||||
expect(title).toContain('业务日期');
|
||||
});
|
||||
|
||||
it('收料日期默认为 D+1 规则日期(T-1)且上限锁定(输入期限制)', () => {
|
||||
// [断言意图] 默认值与 max 均为上海口径 T-1,未来日期在选择器层面不可选。
|
||||
it('异动日期默认 T−2、上限=业务日期当天(成熟规则退役后仅入参限界),movementDateLabel 文案渲染', () => {
|
||||
// [断言意图] 默认值=T−2 产品默认作业点(非强制边界);max=上海口径业务日期
|
||||
// 当天(更近日期允许显式选择,未来日期由后端 MOVEMENT_DATE_RANGE_INVALID 卡控);
|
||||
// 日期标签 i18n 键 chat.transfer.movementDateLabel(Task 5,值=异动日期)。
|
||||
const wrapper = mountCard();
|
||||
const from = wrapper.find('[data-testid="transfer-source-date-from"]').element as HTMLInputElement;
|
||||
const to = wrapper.find('[data-testid="transfer-source-date-to"]').element as HTMLInputElement;
|
||||
const cutoff = eligibleReceiptDateTo();
|
||||
expect(from.value).toBe(cutoff);
|
||||
expect(to.value).toBe(cutoff);
|
||||
expect(from.max).toBe(cutoff);
|
||||
expect(to.max).toBe(cutoff);
|
||||
const today = shanghaiBusinessDate();
|
||||
expect(from.value).toBe(defaultMovementDate());
|
||||
expect(to.value).toBe(defaultMovementDate());
|
||||
expect(from.max).toBe(today);
|
||||
expect(to.max).toBe(today);
|
||||
// i18n 键更名后标签正常解析(深层嵌套纯文本键,不依赖命名插值)。
|
||||
expect(wrapper.find('[data-testid="transfer-source-params"]').text()).toContain('异动日期');
|
||||
});
|
||||
|
||||
it('起始晚于截止时行内提示并禁用确认(不等提交报错)', async () => {
|
||||
@@ -258,19 +262,19 @@ describe('TransferSourceSelectCard', () => {
|
||||
expect(wrapper.emitted('retry')?.[0][0]).toEqual(['DBS-AWSBI', 'DBS-AWSSG', 'CRANE-SZ']);
|
||||
});
|
||||
|
||||
it('空数据来源显示「无收料数据」徽标而非抓取失败', async () => {
|
||||
// [断言意图] 抓取成功但当日无收料记录(file_status=no_data)属业务结果,
|
||||
// 必须如实展示"无收料数据",不得与"抓取失败"混淆(2026-10-08 PRD01 误标事故)。
|
||||
it('空数据来源显示「无入站数据」徽标而非抓取失败', async () => {
|
||||
// [断言意图] 抓取成功但当日无入站记录(file_status=no_data)属业务结果,
|
||||
// 必须如实展示"无入站数据",不得与"抓取失败"混淆(2026-10-08 PRD01 误标事故)。
|
||||
const wrapper = mountCard({}, [
|
||||
{ source_code: 'CRANE-NODATA', display_name: '空数据在途仓', platform: 'crane', enabled: true, has_ready_file: false, file_status: 'no_data' },
|
||||
]);
|
||||
expect(wrapper.find('[data-testid="transfer-source-status-CRANE-NODATA"]').text()).toBe('无收料数据');
|
||||
expect(wrapper.find('[data-testid="transfer-source-status-CRANE-NODATA"]').text()).toBe('无入站数据');
|
||||
expect((wrapper.find('[data-testid="transfer-source-retry-CRANE-NODATA"]').element as HTMLButtonElement).disabled).toBe(false);
|
||||
});
|
||||
|
||||
it('已过期来源显示「文件已过期」徽标且可重试', async () => {
|
||||
// [断言意图] 保留期已到的来源不得误报就绪(has_ready_file=false);
|
||||
// expired 状态与 none/failed 一样允许重新触发收料 RPA。
|
||||
// expired 状态与 none/failed 一样允许重新触发入站 RPA。
|
||||
const wrapper = mountCard({}, [
|
||||
{ source_code: 'CRANE-EXP', display_name: '过期在途仓', platform: 'crane', enabled: true, has_ready_file: false, file_status: 'expired' },
|
||||
]);
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
选择调拨类型后“确认范围并匹配”发起匹配。
|
||||
依赖:props.sources、props.transferTypes(GET /transfer-types 接口下发,Task 7 接口化)、
|
||||
i18n chat.transfer.*。
|
||||
逻辑:匹配参数区(调拨类型 + 收料日期,确认时一并提交)→ 选择辅助/上下文操作条
|
||||
逻辑:匹配参数区(调拨类型 + 异动日期,确认时一并提交)→ 选择辅助/上下文操作条
|
||||
(有选中时原位替换辅助区,承载批量重试/下载/清空选择)→ 平台分组来源列表
|
||||
(平台仅分组不可直接执行)→ 底部唯一实心主按钮「确认范围并匹配」(未选禁用);
|
||||
确认只提交具备 ready 文件的来源:混合选择(含非就绪项)先披露范围再确认
|
||||
@@ -19,7 +19,7 @@
|
||||
import { computed, ref, watch } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useMessage } from '@/shared/composables/useMessage';
|
||||
import { eligibleReceiptDateTo } from './transferDate';
|
||||
import { defaultMovementDate, shanghaiBusinessDate } from './transferDate';
|
||||
import type { TransferSourceOption, TransferTypeOption } from '../../types/transfer.types';
|
||||
|
||||
const props = defineProps<{
|
||||
@@ -27,13 +27,13 @@ const props = defineProps<{
|
||||
/** 调拨类型选项(接口下发真相;空数组=无可用类型,渲染空态并禁用确认) */
|
||||
transferTypes: TransferTypeOption[];
|
||||
busy?: boolean;
|
||||
/** 正在重试收料 RPA 的来源编码集合 */
|
||||
/** 正在重试入站 RPA 的来源编码集合 */
|
||||
retrying?: Set<string>;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
confirm: [sourceCodes: string[], dateRange?: { from?: string; to?: string }, transferType?: string];
|
||||
/** 批量重试收料 RPA:传来源编码列表 */
|
||||
/** 批量重试入站 RPA:传来源编码列表 */
|
||||
retry: [sourceCodes: string[]];
|
||||
download: [sourceCodes: string[]];
|
||||
}>();
|
||||
@@ -42,11 +42,12 @@ const { warning: notifyWarning } = useMessage();
|
||||
const { t, locale } = useI18n();
|
||||
|
||||
const selected = ref<Set<string>>(new Set());
|
||||
/** 收料日期范围(匹配查询范围):默认 D+1 规则日期(T-1),上限同(输入期限制,
|
||||
* 不等提交报错);后端 RECEIPT_DATE_RANGE_INVALID 卡控保留为双保险。 */
|
||||
const maxReceiptDate = eligibleReceiptDateTo();
|
||||
const dateFrom = ref(maxReceiptDate);
|
||||
const dateTo = ref(maxReceiptDate);
|
||||
/** 异动日期范围(匹配查询范围):默认 T−2 产品默认作业点;输入上限=业务日期
|
||||
* 当天(成熟规则已退役,日期边界只由入参给定);未来日期由后端
|
||||
* MOVEMENT_DATE_RANGE_INVALID 兜底卡控。 */
|
||||
const maxMovementDate = shanghaiBusinessDate();
|
||||
const dateFrom = ref(defaultMovementDate());
|
||||
const dateTo = ref(defaultMovementDate());
|
||||
|
||||
/** 起始不得晚于截止(清空视为不限,提交 undefined)。 */
|
||||
const dateRangeInvalid = computed(() => {
|
||||
@@ -54,7 +55,7 @@ const dateRangeInvalid = computed(() => {
|
||||
const to = dateTo.value || null;
|
||||
return from !== null && to !== null && from > to;
|
||||
});
|
||||
/** 调拨业务类型 code(Task 7 接口化):决定本次匹配纳入哪些收料数据与转换规则;
|
||||
/** 调拨业务类型 code(Task 7 接口化):决定本次匹配纳入哪些入站数据与转换规则;
|
||||
* 空配置(无可选类型)时为 null,确认按钮禁用兜底。 */
|
||||
const transferType = ref<string | null>(null);
|
||||
|
||||
@@ -164,7 +165,7 @@ function clearSelected() {
|
||||
selected.value = new Set();
|
||||
}
|
||||
|
||||
/** 批量重试收料 RPA:仅触发所选来源中可重试的那部分。 */
|
||||
/** 批量重试入站 RPA:仅触发所选来源中可重试的那部分。 */
|
||||
function batchRetry() {
|
||||
const codes = [...selected.value].filter(
|
||||
(code) => props.sources.some((s) => s.source_code === code && isRetryable(s)),
|
||||
@@ -232,7 +233,7 @@ watch(selected, () => {
|
||||
<div class="my-2 rounded-2xl border border-brand-100 bg-surface p-4 shadow-sm" data-testid="transfer-source-select-card">
|
||||
<h3 class="mb-3 text-sm font-bold text-primary">{{ $t('chat.transfer.sourceSelectTitle') }}</h3>
|
||||
|
||||
<!-- [ZONE 1] 匹配参数区:调拨类型 + 收料日期同组(确认匹配时一并提交,参数先行定范围)。 -->
|
||||
<!-- [ZONE 1] 匹配参数区:调拨类型 + 异动日期同组(确认匹配时一并提交,参数先行定范围)。 -->
|
||||
<div class="mb-3 rounded-lg border border-subtle p-3" data-testid="transfer-source-params">
|
||||
<p class="mb-2 text-[11px] font-bold text-muted">{{ $t('chat.transfer.matchParams') }}</p>
|
||||
<div class="flex flex-wrap items-center gap-2">
|
||||
@@ -260,11 +261,11 @@ watch(selected, () => {
|
||||
</button>
|
||||
</div>
|
||||
<div class="mt-2 flex flex-wrap items-center gap-2">
|
||||
<span class="text-xs font-bold text-secondary">{{ $t('chat.transfer.receiptDateLabel') }}</span>
|
||||
<span class="text-xs font-bold text-secondary">{{ $t('chat.transfer.movementDateLabel') }}</span>
|
||||
<input
|
||||
v-model="dateFrom"
|
||||
type="date"
|
||||
:max="maxReceiptDate"
|
||||
:max="maxMovementDate"
|
||||
class="rounded-lg border border-default bg-surface px-2 py-1 text-xs text-primary"
|
||||
data-testid="transfer-source-date-from"
|
||||
/>
|
||||
@@ -272,7 +273,7 @@ watch(selected, () => {
|
||||
<input
|
||||
v-model="dateTo"
|
||||
type="date"
|
||||
:max="maxReceiptDate"
|
||||
:max="maxMovementDate"
|
||||
:min="dateFrom || undefined"
|
||||
class="rounded-lg border border-default bg-surface px-2 py-1 text-xs text-primary"
|
||||
data-testid="transfer-source-date-to"
|
||||
@@ -280,12 +281,12 @@ watch(selected, () => {
|
||||
<!-- D+1 规则属低频说明:收进原生 title 悬浮(渐进披露),避免长文案挤压布局。 -->
|
||||
<span
|
||||
class="cursor-help text-xs text-muted"
|
||||
:title="$t('chat.transfer.receiptDateHint')"
|
||||
:title="$t('chat.transfer.movementDateHint')"
|
||||
data-testid="transfer-source-date-hint"
|
||||
>ⓘ</span>
|
||||
<!-- 输入期校验:起始晚于截止时行内提示并禁用确认(不等提交报错)。 -->
|
||||
<span v-if="dateRangeInvalid" class="text-xs font-bold text-red-600" data-testid="transfer-source-date-invalid">
|
||||
{{ $t('chat.transfer.receiptDateInvalid') }}
|
||||
{{ $t('chat.transfer.movementDateInvalid') }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -405,7 +406,7 @@ watch(selected, () => {
|
||||
>
|
||||
{{ t('chat.transfer.fileFailed') }}
|
||||
</span>
|
||||
<!-- 无收料数据(no_data):抓取成功但当日无收料记录,属业务结果而非故障;当日稍后到货可重抓补数 -->
|
||||
<!-- 无入站数据(no_data):抓取成功但当日无入站记录,属业务结果而非故障;当日稍后到货可重抓补数 -->
|
||||
<span
|
||||
v-else-if="source.file_status === 'no_data'"
|
||||
class="inline-flex items-center gap-1 rounded-full bg-sky-50 px-2 py-0.5 text-[10px] font-bold text-sky-700"
|
||||
@@ -420,7 +421,7 @@ watch(selected, () => {
|
||||
>
|
||||
{{ t('chat.transfer.fileExpired') }}
|
||||
</span>
|
||||
<!-- 解析失败(parse_failed):当日收料文件解析失败;重试按状态分层——parse_failed=本地重解析,其余状态=重新触发收料 RPA 重抓 -->
|
||||
<!-- 解析失败(parse_failed):当日入站文件解析失败;重试按状态分层——parse_failed=本地重解析,其余状态=重新触发入站 RPA 重抓 -->
|
||||
<span
|
||||
v-else-if="source.file_status === 'parse_failed'"
|
||||
class="inline-flex items-center gap-1 rounded-full bg-red-50 px-2 py-0.5 text-[10px] font-bold text-red-700"
|
||||
@@ -439,7 +440,7 @@ watch(selected, () => {
|
||||
type="button"
|
||||
class="ml-1 inline-flex h-6 w-6 items-center justify-center rounded-md border border-default text-sm text-muted hover:border-brand-200 hover:text-brand-700 disabled:cursor-not-allowed disabled:opacity-40"
|
||||
:disabled="busy || !isRetryable(source) || retrying?.has(source.source_code)"
|
||||
:title="t('chat.transfer.retryReceipt')"
|
||||
:title="t('chat.transfer.retryInbound')"
|
||||
:data-testid="`transfer-source-retry-${source.source_code}`"
|
||||
@click.stop="emit('retry', [source.source_code])"
|
||||
>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* (evidence-sync,2026-09-25);匹配卡批号列 deriveBatchNo 旧路径兼容
|
||||
* (Task 7 规则化后未传规则仍 WTP→HOW)。
|
||||
*/
|
||||
import { mount } from '@vue/test-utils';
|
||||
import { mount, flushPromises } from '@vue/test-utils';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import i18n from '@/i18n';
|
||||
import TransferFileProgressCard from './TransferFileProgressCard.vue';
|
||||
@@ -22,9 +22,8 @@ const summary = {
|
||||
matching_id: 'MTG-1',
|
||||
status: 'ready_to_execute',
|
||||
business_date: '2026-08-06',
|
||||
eligible_receipt_date_to: '2026-08-05',
|
||||
expires_at: '',
|
||||
counts: { file_invoice_count: 3, not_matured_count: 1, matched_count: 2, executable_count: 2, blocked_count: 0 },
|
||||
counts: { file_invoice_count: 3, matched_count: 3, executable_count: 2, blocked_count: 1 },
|
||||
estimated_transfer_quantity: '2400',
|
||||
estimated_external_write_count: 2,
|
||||
matching_hash: 'sha256:x',
|
||||
@@ -32,7 +31,7 @@ const summary = {
|
||||
|
||||
const items = [
|
||||
{ item_id: 101, source_code: 'DBS-AWSBI', material_no: 'MAT-1', material_name: '连接器', specification: 'A', invoice_no: 'INV-001', from_warehouse: 'DBS-TRANSIT', from_quantity: '1200', to_warehouse: 'HUB-CN01', to_quantity: '1200', result: 'executable', checked_at: '2026-09-23T09:05:00+08:00' },
|
||||
{ item_id: 102, source_code: 'DBS-AWSBI', material_no: 'MAT-2', material_name: '控制器', specification: 'B', invoice_no: 'INV-041', from_warehouse: '', from_quantity: null, to_warehouse: '', to_quantity: '400', result: 'not_matured' },
|
||||
{ item_id: 102, source_code: 'DBS-AWSBI', material_no: 'MAT-2', material_name: '控制器', specification: 'B', invoice_no: 'INV-041', from_warehouse: '', from_quantity: null, to_warehouse: '', to_quantity: '400', result: 'result_unknown' },
|
||||
];
|
||||
|
||||
describe('TransferFileProgressCard', () => {
|
||||
@@ -50,16 +49,17 @@ describe('TransferFileProgressCard', () => {
|
||||
});
|
||||
|
||||
describe('TransferMatchCard', () => {
|
||||
it('勾选键为明细行 item_id:阻断/未成熟项 checkbox 禁用,可执行项可选', () => {
|
||||
it('勾选键为明细行 item_id:可执行项可选,终态行(result_unknown)checkbox 禁用', () => {
|
||||
const wrapper = mount(TransferMatchCard, {
|
||||
props: { summary, items, selected: new Set<number>([101]) },
|
||||
...mountOptions,
|
||||
});
|
||||
const executableCheck = wrapper.find('[data-testid="transfer-check-INV-001"]');
|
||||
const maturedCheck = wrapper.find('[data-testid="transfer-check-INV-041"]');
|
||||
const terminalCheck = wrapper.find('[data-testid="transfer-check-INV-041"]');
|
||||
expect((executableCheck.element as HTMLInputElement).disabled).toBe(false);
|
||||
expect((executableCheck.element as HTMLInputElement).checked).toBe(true);
|
||||
expect((maturedCheck.element as HTMLInputElement).disabled).toBe(true);
|
||||
// [断言意图] blocked 行可勾(供重查),终态行(result_unknown,不可执行不可重查)禁用。
|
||||
expect((terminalCheck.element as HTMLInputElement).disabled).toBe(true);
|
||||
});
|
||||
|
||||
it('历史回放行(无 item_id)checkbox 禁用,防误选', () => {
|
||||
@@ -157,7 +157,7 @@ describe('TransferMatchCard', () => {
|
||||
expect(legacyWrapper.find('[data-testid="transfer-match-counts"]').text()).toContain('已失效 0 行');
|
||||
});
|
||||
|
||||
it('pending_stock_check 行徽标展示「待查库存」(amber 同未成熟色系)', () => {
|
||||
it('pending_stock_check 行徽标展示「待查库存」(amber 提示色)', () => {
|
||||
// [断言意图] evidence-sync(2026-09-25):文件已落地未查 ERP 的行为
|
||||
// pending_stock_check,徽标须用独立文案且为 amber 族(非阻断红)。
|
||||
const pendingItems = [{ ...items[0], result: 'pending_stock_check' }];
|
||||
@@ -205,15 +205,15 @@ describe('TransferMatchCard', () => {
|
||||
expect(wrapper.find('[data-testid="transfer-file-removed-hint"]').exists()).toBe(true);
|
||||
});
|
||||
|
||||
it('同 Invoice 跨收料日期拆单(重复 invoice_no)时,筛选后仅渲染匹配行', async () => {
|
||||
it('同 Invoice 跨异动日期拆单(重复 invoice_no)时,筛选后仅渲染匹配行', async () => {
|
||||
// [断言意图] 回归防线(2026-09-21):拆单设计下 invoice_no 不再唯一,
|
||||
// 行 key 若仍用 invoice_no 会出现重复 key,Vue 列表 diff 错乱导致
|
||||
// 筛选后不匹配行残留/克隆(用户输入 HOX 仍见 SLC2PHX 行)。
|
||||
// 行身份 = (来源, Invoice, 料号, 收料日期),key 必须用同一粒度。
|
||||
// 行身份 = (来源, Invoice, 料号, 异动日期),key 必须用同一粒度。
|
||||
const dupItems = [
|
||||
{ item_id: 201, source_code: 'CRANE', material_no: 'M-1', material_name: '机框', specification: '', invoice_no: 'HOX-1', receipt_date: '2026-09-11', from_warehouse: 'HTP-D43', from_quantity: null, to_warehouse: 'HTP-D49', to_quantity: '36', result: 'blocked_quantity_mismatch' },
|
||||
{ item_id: 202, source_code: 'CRANE', material_no: 'M-2', material_name: '护罩', specification: '', invoice_no: 'DUP-1', receipt_date: '2026-09-03', from_warehouse: 'HTP-D43', from_quantity: null, to_warehouse: 'HTP-D49', to_quantity: '36', result: 'blocked_quantity_mismatch' },
|
||||
{ item_id: 203, source_code: 'CRANE', material_no: 'M-2', material_name: '护罩', specification: '', invoice_no: 'DUP-1', receipt_date: '2026-09-04', from_warehouse: 'HTP-D43', from_quantity: null, to_warehouse: 'HTP-D49', to_quantity: '36', result: 'blocked_quantity_mismatch' },
|
||||
{ item_id: 201, source_code: 'CRANE', material_no: 'M-1', material_name: '机框', specification: '', invoice_no: 'HOX-1', movement_date: '2026-09-11', from_warehouse: 'HTP-D43', from_quantity: null, to_warehouse: 'HTP-D49', to_quantity: '36', result: 'blocked_quantity_mismatch' },
|
||||
{ item_id: 202, source_code: 'CRANE', material_no: 'M-2', material_name: '护罩', specification: '', invoice_no: 'DUP-1', movement_date: '2026-09-03', from_warehouse: 'HTP-D43', from_quantity: null, to_warehouse: 'HTP-D49', to_quantity: '36', result: 'blocked_quantity_mismatch' },
|
||||
{ item_id: 203, source_code: 'CRANE', material_no: 'M-2', material_name: '护罩', specification: '', invoice_no: 'DUP-1', movement_date: '2026-09-04', from_warehouse: 'HTP-D43', from_quantity: null, to_warehouse: 'HTP-D49', to_quantity: '36', result: 'blocked_quantity_mismatch' },
|
||||
];
|
||||
const wrapper = mount(TransferMatchCard, {
|
||||
props: { summary, items: dupItems, selected: new Set<number>() },
|
||||
@@ -242,7 +242,7 @@ describe('TransferResultCard(Task 13 融合卡)', () => {
|
||||
posting_status: 'posted',
|
||||
lines: [{ material_no: 'MAT-1', material_name: '连接器', specification: 'A', invoice_no: 'INV-001', quantity: '1200' }],
|
||||
}],
|
||||
exceptions: [{ source_code: 'DBS-AWSBI', invoice_no: 'INV-999', material_no: 'MAT-9', reason: 'business_failed', facts: '收料 300 / ERP 280' }],
|
||||
exceptions: [{ source_code: 'DBS-AWSBI', invoice_no: 'INV-999', material_no: 'MAT-9', reason: 'business_failed', facts: '异动 300 / ERP 280' }],
|
||||
},
|
||||
};
|
||||
const mountCard = () => mount(TransferResultCard, { props: { runNo: 'RUN-1', initialRun: run }, ...mountOptions });
|
||||
@@ -264,12 +264,12 @@ describe('TransferResultCard(Task 13 融合卡)', () => {
|
||||
expect(wrapper.find('[data-testid="transfer-exceptions-area"]').text()).toContain('INV-999');
|
||||
});
|
||||
|
||||
it('提供下载按钮(收料来源文件 + ERP 库存表 + 异常清单)', async () => {
|
||||
it('提供下载按钮(出入站来源文件 + ERP 库存表 + 异常清单)', async () => {
|
||||
const wrapper = mountCard();
|
||||
await wrapper.find('[data-testid="transfer-download-receipt"]').trigger('click');
|
||||
await wrapper.find('[data-testid="transfer-download-inbound"]').trigger('click');
|
||||
await wrapper.find('[data-testid="transfer-download-erp"]').trigger('click');
|
||||
await wrapper.find('[data-testid="transfer-download-exceptions"]').trigger('click');
|
||||
expect(wrapper.emitted('downloadReceipt')).toBeTruthy();
|
||||
expect(wrapper.emitted('downloadInbound')).toBeTruthy();
|
||||
expect(wrapper.emitted('downloadErp')).toBeTruthy();
|
||||
expect(wrapper.emitted('downloadExceptions')).toBeTruthy();
|
||||
});
|
||||
@@ -286,6 +286,8 @@ describe('TransferManualCloseDialog', () => {
|
||||
props: { open: true, invoiceNo: 'INV-001' },
|
||||
...mountOptions,
|
||||
});
|
||||
// [断言意图] EP el-dialog 挂载后下一 tick 才渲染弹层内容,先 flush 再断言。
|
||||
await flushPromises();
|
||||
const confirm = wrapper.find('[data-testid="transfer-close-confirm"]');
|
||||
expect((confirm.element as HTMLButtonElement).disabled).toBe(true);
|
||||
await wrapper.find('[data-testid="transfer-close-reason"]').setValue('线下已处理');
|
||||
|
||||
@@ -1,21 +1,24 @@
|
||||
/**
|
||||
* features/chat/components/messages/transferDate.spec.ts
|
||||
* 用途:锁定 T+2 成熟口径的截止日计算(与后端 date_policy 同口径,默认 lag=2)。
|
||||
* 用途:锁定匹配日期默认值(T−2 产品默认作业点)与上海业务日计算(与后端
|
||||
* date_policy 同口径)。
|
||||
* 依赖:被测纯函数 transferDate.ts。
|
||||
* 逻辑:直接注入 UTC 时刻构造上海业务日,断言跨日/跨月边界不漂移。
|
||||
* 【成熟规则已退役 2026-10-16】原「可匹配截止日」断言改为默认值语义
|
||||
* (T−2 仅是选择器默认,非强制边界;输入上限=业务日期当天)。
|
||||
*/
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { eligibleReceiptDateTo, shanghaiBusinessDate } from './transferDate';
|
||||
import { defaultMovementDate, shanghaiBusinessDate } from './transferDate';
|
||||
|
||||
describe('eligibleReceiptDateTo(T+2 口径)', () => {
|
||||
it('T=2026-09-28 → 截止 2026-09-26(T-2,海外时差)', () => {
|
||||
describe('defaultMovementDate(T−2 默认作业点)', () => {
|
||||
it('T=2026-09-28 → 默认 2026-09-26(T-2)', () => {
|
||||
// 上海 9-28 13:00 = UTC 05:00。
|
||||
expect(eligibleReceiptDateTo(new Date('2026-09-28T05:00:00Z'))).toBe('2026-09-26');
|
||||
expect(defaultMovementDate(new Date('2026-09-28T05:00:00Z'))).toBe('2026-09-26');
|
||||
});
|
||||
|
||||
it('UTC 月末跨界仍按上海业务日回退 2 天', () => {
|
||||
// 上海 10-01 00:30 = UTC 9-30 16:30 → T=10-01,截止 09-29。
|
||||
expect(eligibleReceiptDateTo(new Date('2026-09-30T16:30:00Z'))).toBe('2026-09-29');
|
||||
// 上海 10-01 00:30 = UTC 9-30 16:30 → T=10-01,默认 09-29。
|
||||
expect(defaultMovementDate(new Date('2026-09-30T16:30:00Z'))).toBe('2026-09-29');
|
||||
});
|
||||
|
||||
it('shanghaiBusinessDate 返回上海业务日(UTC 17:00 = 上海次日)', () => {
|
||||
|
||||
@@ -1,15 +1,17 @@
|
||||
/**
|
||||
* features/chat/components/messages/transferDate.ts
|
||||
* 用途:在途调拨业务日期工具——按 Asia/Shanghai 计算业务日期(T)与
|
||||
* T+lag 成熟规则的可匹配截止日(T - lag,lag 默认 2 即 T+2),
|
||||
* 与后端 date_policy 完全同口径。
|
||||
* 用途:在途调拨业务日期工具——按 Asia/Shanghai 计算业务日期(T)、
|
||||
* 匹配日期默认值(T−2 产品默认作业点)与输入上限(T 当天)。
|
||||
* 依赖:无(纯函数,便于单测)。
|
||||
* 逻辑:浏览器本地时区不可靠(部署/用户时区任意),必须固定上海时区口径,
|
||||
* 否则前端日期上限与后端 TRANSFER.RECEIPT_DATE_RANGE_INVALID 卡控会漂移。
|
||||
* 否则前端日期默认/上限与后端 TRANSFER.MOVEMENT_DATE_RANGE_INVALID
|
||||
* 卡控会漂移。
|
||||
* 【成熟规则已退役 2026-10-16】数据无成熟属性——T−2 只是日期选择器的
|
||||
* 默认值(非强制边界),输入上限=业务日期当天;未来日期由后端卡控。
|
||||
*/
|
||||
|
||||
/** 成熟滞后天数:与后端 IN_TRANSIT_TRANSFER_MATURITY_LAG_DAYS 默认值一致(T+2,海外时差余量)。 */
|
||||
const MATURITY_LAG_DAYS = 2;
|
||||
/** 匹配日期默认回看天数:T−2 为产品默认作业点(与排程任务常用 T−N 偏移一致)。 */
|
||||
const DEFAULT_LOOKBACK_DAYS = 2;
|
||||
|
||||
/** Asia/Shanghai 当前业务日期(YYYY-MM-DD)。 */
|
||||
export function shanghaiBusinessDate(now: Date = new Date()): string {
|
||||
@@ -22,9 +24,9 @@ export function shanghaiBusinessDate(now: Date = new Date()): string {
|
||||
}).format(now);
|
||||
}
|
||||
|
||||
/** T+lag 规则可匹配截止日(业务日期 T - lag 天,默认 T-2,YYYY-MM-DD)。 */
|
||||
export function eligibleReceiptDateTo(now: Date = new Date()): string {
|
||||
/** 匹配日期默认值(业务日期 T − 2 天,YYYY-MM-DD):仅是选择器默认,非强制边界。 */
|
||||
export function defaultMovementDate(now: Date = new Date()): string {
|
||||
const business = new Date(`${shanghaiBusinessDate(now)}T00:00:00Z`);
|
||||
business.setUTCDate(business.getUTCDate() - MATURITY_LAG_DAYS);
|
||||
business.setUTCDate(business.getUTCDate() - DEFAULT_LOOKBACK_DAYS);
|
||||
return business.toISOString().slice(0, 10);
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* features/chat/components/messages/transferDialogShell.ts
|
||||
* 用途:在途调拨确认弹层壳(ElDialog)共享配置——人工关闭/清空重解析/关闭单
|
||||
* 三处高危确认弹窗统一的防误触语义与居中形态。
|
||||
* 依赖:无(纯常量,供组件模板 v-bind 展开)。
|
||||
* 逻辑:禁 ESC / 遮罩点击 / 右上角 X 关闭——确认类危险操作仅经取消/确认按钮关闭,
|
||||
* 与 EP 化前原生遮罩层行为一致;alignCenter 对齐原 fixed 居中布局。
|
||||
*/
|
||||
|
||||
/** ElDialog 防误触共享配置:`v-bind="transferDialogShellAttrs"` 展开到组件标签。 */
|
||||
export const transferDialogShellAttrs = {
|
||||
alignCenter: true,
|
||||
closeOnClickModal: false,
|
||||
closeOnPressEscape: false,
|
||||
showClose: false,
|
||||
} as const;
|
||||
@@ -24,9 +24,14 @@ describe('transfer i18n four-language consistency', () => {
|
||||
});
|
||||
|
||||
it('每个 transfer 文案值非空', () => {
|
||||
// 允许为空白名单:en.reparseFilesSuffix 有意置空——前缀 "Archived files: "
|
||||
// 已表义,再拼 " archived" 会重复("Archived files: 3 archived");
|
||||
// zh-CN/zh-TW/th 的计数词(" 份"/" ไฟล์")语义必需,仍须非空。
|
||||
const allowEmpty = new Set(['en.reparseFilesSuffix']);
|
||||
for (const [name, pack] of Object.entries(packages)) {
|
||||
const transfer = (pack as Record<string, { transfer: Record<string, unknown> }>).transfer;
|
||||
for (const [key, value] of Object.entries(transfer)) {
|
||||
if (allowEmpty.has(`${name}.${key}`)) continue;
|
||||
expect(String(value).trim().length, `${name}.transfer.${key}`).toBeGreaterThan(0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
import { afterEach, describe, expect, it, vi, beforeEach } from 'vitest';
|
||||
import { effectScope } from 'vue';
|
||||
import { BusinessError } from '@/shared/api/client';
|
||||
|
||||
const api = vi.hoisted(() => ({
|
||||
createTransferMatching: vi.fn(),
|
||||
@@ -19,16 +20,18 @@ const api = vi.hoisted(() => ({
|
||||
retryTransferItem: vi.fn(),
|
||||
manualCloseTransferItem: vi.fn(),
|
||||
batchRequeryTransferItems: vi.fn(),
|
||||
downloadTransferReceiptFiles: vi.fn(),
|
||||
downloadTransferInboundFiles: vi.fn(),
|
||||
downloadTransferErpInventory: vi.fn(),
|
||||
downloadTransferExceptions: vi.fn(),
|
||||
listTransferSources: vi.fn(),
|
||||
fetchTransferTypes: vi.fn(),
|
||||
retryTransferSourceRpa: vi.fn(),
|
||||
listTransferBacklog: vi.fn(),
|
||||
listTransferBacklogPage: vi.fn(),
|
||||
getTransferBacklogSummary: vi.fn(),
|
||||
listExecutableTransferItems: vi.fn(),
|
||||
listPendingMatchRecords: vi.fn(),
|
||||
listPendingMatchRecordsPage: vi.fn(),
|
||||
fetchPendingMatchReparsePreview: vi.fn(),
|
||||
reparsePendingMatch: vi.fn(),
|
||||
}));
|
||||
|
||||
vi.mock('../api/transfer.api', () => api);
|
||||
@@ -39,9 +42,8 @@ const summary = {
|
||||
matching_id: 'MTG-20260806-001',
|
||||
status: 'ready_to_execute',
|
||||
business_date: '2026-08-06',
|
||||
eligible_receipt_date_to: '2026-08-05',
|
||||
expires_at: '',
|
||||
counts: { file_invoice_count: 2, not_matured_count: 0, matched_count: 2, executable_count: 2, blocked_count: 0 },
|
||||
counts: { file_invoice_count: 2, matched_count: 2, executable_count: 2, blocked_count: 0 },
|
||||
estimated_transfer_quantity: '2400',
|
||||
estimated_external_write_count: 2,
|
||||
matching_hash: 'sha256:abc',
|
||||
@@ -53,7 +55,7 @@ const detail = {
|
||||
items: [
|
||||
{ item_id: 11, source_code: 'DBS-AWSBI', material_no: 'MAT-1', material_name: 'x', specification: 'y', invoice_no: 'INV-001', from_warehouse: 'DBS-TRANSIT', from_quantity: '1200', to_warehouse: 'HUB-CN01', to_quantity: '1200', result: 'executable' },
|
||||
{ item_id: 12, source_code: 'DBS-AWSBI', material_no: 'MAT-2', material_name: 'x', specification: 'y', invoice_no: 'INV-002', from_warehouse: 'DBS-TRANSIT', from_quantity: '1200', to_warehouse: 'HUB-CN01', to_quantity: '1200', result: 'executable' },
|
||||
{ item_id: 13, source_code: 'DBS-AWSBI', material_no: 'MAT-3', material_name: 'x', specification: 'y', invoice_no: 'INV-041', from_warehouse: '', from_quantity: null, to_warehouse: '', to_quantity: '400', result: 'not_matured' },
|
||||
{ item_id: 13, source_code: 'DBS-AWSBI', material_no: 'MAT-3', material_name: 'x', specification: 'y', invoice_no: 'INV-041', from_warehouse: '', from_quantity: null, to_warehouse: '', to_quantity: '400', result: 'blocked_quantity_mismatch' },
|
||||
],
|
||||
};
|
||||
|
||||
@@ -70,7 +72,7 @@ describe('useChatTransfer', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('创建匹配后默认按 item_id 勾选全部可执行行,未成熟项不可勾选', async () => {
|
||||
it('创建匹配后默认按 item_id 勾选全部可执行行,阻断项不可勾选', async () => {
|
||||
const transfer = useChatTransfer();
|
||||
await transfer.createMatching(['DBS-AWSBI'], '2026-08-06');
|
||||
expect(transfer.matchingId.value).toBe('MTG-20260806-001');
|
||||
@@ -79,6 +81,30 @@ describe('useChatTransfer', () => {
|
||||
expect(transfer.selected.value.has(13)).toBe(false);
|
||||
});
|
||||
|
||||
it('创建匹配携带异动日期范围:参数名 movement_date_from/to(Task 3 契约更名)', async () => {
|
||||
// [断言意图] 匹配查询范围参数对齐后端 /matchings 新契约(Task 3 更名):
|
||||
// 参数名为 movement_date_from/to;日期值透传来源选择卡的 D+1 规则区间。
|
||||
const transfer = useChatTransfer();
|
||||
await transfer.createMatching(['DBS-AWSBI'], undefined, { from: '2026-09-26', to: '2026-09-26' });
|
||||
expect(api.createTransferMatching).toHaveBeenCalledWith(
|
||||
expect.objectContaining({ movement_date_from: '2026-09-26', movement_date_to: '2026-09-26' }),
|
||||
);
|
||||
});
|
||||
|
||||
it('downloadInboundFiles 按 run_no 调下载 API,文件名缺省回退 inbound-files-<run_no>.zip', async () => {
|
||||
// [断言意图] 下载出入站来源文件走 /runs/{run_no}/inbound-files(Task 3 路由更名):
|
||||
// 组合式函数按 run_no 调 API;后端未回 filename 时前端回退 inbound-files- 前缀命名。
|
||||
api.downloadTransferInboundFiles.mockResolvedValue({ blob: new Blob(['zip']), filename: 'inbound-files.zip' });
|
||||
const transfer = useChatTransfer();
|
||||
transfer.runNo.value = 'RUN-20260806-001';
|
||||
await transfer.downloadInboundFiles();
|
||||
expect(api.downloadTransferInboundFiles).toHaveBeenCalledWith('RUN-20260806-001');
|
||||
|
||||
api.downloadTransferInboundFiles.mockResolvedValue({ blob: new Blob(['zip']), filename: null });
|
||||
await transfer.downloadInboundFiles();
|
||||
expect(api.downloadTransferInboundFiles).toHaveBeenCalledTimes(2);
|
||||
});
|
||||
|
||||
it('执行时按明细行 id 提交勾选范围并恢复 Run', async () => {
|
||||
const transfer = useChatTransfer();
|
||||
await transfer.createMatching(['DBS-AWSBI']);
|
||||
@@ -286,7 +312,7 @@ describe('useChatTransfer Run 轮询(D8 异步 202 / D9 融合卡数据源)'
|
||||
});
|
||||
});
|
||||
|
||||
describe('useChatTransfer 来源状态轮询(收料 RPA 202 异步收口)', () => {
|
||||
describe('useChatTransfer 来源状态轮询(入站 RPA 202 异步收口)', () => {
|
||||
/** 来源选择卡轮询用例的标准来源载荷(file_status 可变,驱动 fetching→终态分支) */
|
||||
const sourceOptionsWith = (file_status: string) => [
|
||||
{
|
||||
@@ -308,7 +334,7 @@ describe('useChatTransfer 来源状态轮询(收料 RPA 202 异步收口)',
|
||||
vi.useRealTimers();
|
||||
});
|
||||
|
||||
it('重试收料 RPA 后来源处于抓取中即自动轮询,收口(ready)后停止', async () => {
|
||||
it('重试入站 RPA 后来源处于抓取中即自动轮询,收口(ready)后停止', async () => {
|
||||
// [断言意图] 重试 202 返回后 loadSources 首帧仍是 fetching(RPA 回调未到),
|
||||
// 轮询必须自动接管:收口帧把 抓取中→ready 投影进 sourceOptions(修复状态卡死),
|
||||
// 全部来源脱离 fetching 即停——再推进 20s 也不产生新请求。
|
||||
@@ -435,6 +461,50 @@ describe('useChatTransfer 调拨类型加载(Task 7 接口化,模块级单
|
||||
});
|
||||
});
|
||||
|
||||
describe('useChatTransfer 待匹配清空重解析(Task 8 维护链路)', () => {
|
||||
/** POST /backlog/pending-match/reparse data 形状(后端 Task 7 ReparseOutcome 序列化) */
|
||||
const reparsePayload = {
|
||||
source_code: 'DBS-AWSBI',
|
||||
cleared: 12,
|
||||
reinserted: 10,
|
||||
date_skipped: 0,
|
||||
kept_unrebuildable: 4,
|
||||
unlinked_items: 2,
|
||||
files: [{ file_id: 5, sha256: 'sha-aaa', archived_at: '2026-08-03T10:00:00', inserted: 10 }],
|
||||
};
|
||||
|
||||
beforeEach(() => {
|
||||
vi.clearAllMocks();
|
||||
api.listPendingMatchRecordsPage.mockResolvedValue({ records: [], total: 0, page: 1, page_size: 20 });
|
||||
});
|
||||
|
||||
it('reparsePendingMatch 调 POST reparse 并在成功后刷新待匹配清单', async () => {
|
||||
// [断言意图] 维护链路唯一编排点:按来源调执行端点,成功即重拉待匹配清单
|
||||
// (桶内容已被清空重建,宿主面板经 emit refresh 再拉一次,组合式函数自身
|
||||
// 状态也必须同步,保证 reset/恢复路径拿到新桶)。
|
||||
api.reparsePendingMatch.mockResolvedValue(reparsePayload);
|
||||
const transfer = useChatTransfer();
|
||||
await transfer.loadPendingMatchRecords();
|
||||
const result = await transfer.reparsePendingMatch('DBS-AWSBI');
|
||||
expect(api.reparsePendingMatch).toHaveBeenCalledWith('DBS-AWSBI');
|
||||
expect(api.listPendingMatchRecordsPage).toHaveBeenCalledTimes(2); // 初始 1 + 重建后刷新 1
|
||||
expect(result.cleared).toBe(12);
|
||||
expect(transfer.pendingMatchRecords.value).toEqual([]);
|
||||
});
|
||||
|
||||
it('执行失败原样上抛(TRANSFER.REPARSE_PARSE_FAILED 中止未删语义由调用方展示)', async () => {
|
||||
// [断言意图] 失败不吞错、不刷新:BusinessError 透传给调用方(弹窗内展示
|
||||
// 「中止未删」),且失败路径不产生待匹配清单重拉。
|
||||
api.reparsePendingMatch.mockRejectedValue(
|
||||
new BusinessError({ message: '归档解析失败', code: 'TRANSFER.REPARSE_PARSE_FAILED' }),
|
||||
);
|
||||
const transfer = useChatTransfer();
|
||||
await expect(transfer.reparsePendingMatch('DBS-AWSBI'))
|
||||
.rejects.toMatchObject({ code: 'TRANSFER.REPARSE_PARSE_FAILED' });
|
||||
expect(api.listPendingMatchRecordsPage).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
||||
describe('useChatTransfer 首页看板预取(会话引导期单飞)', () => {
|
||||
/** 标准看板载荷(供预取槽位消费;单飞槽位是模块级状态,用例结束前必须双槽消费完) */
|
||||
const backlogSummaryPayload = {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* 依赖:transfer.api、transfer.types、useMessage、Vue refs/computed/effect scope。
|
||||
* 逻辑:前端只消费稳定 DTO;Run 是异步真相源——提交只拿 {run_no,status:'queued'},
|
||||
* 进度/结果由 4s 轮询 getTransferRun 获取,终态(run.status)即停,刷新/重进由 GET 恢复;
|
||||
* 来源收料 RPA 同为异步收口——重试 202 后投影 fetching,存在 fetching 来源时
|
||||
* 来源入站 RPA 同为异步收口——重试 202 后投影 fetching,存在 fetching 来源时
|
||||
* 4s 轮询 GET /sources 直至全部脱离 fetching(ready/failed/expired/none);
|
||||
* 勾选集合以明细行 item_id 为键(历史回放行无 item_id 不可选);
|
||||
* 恢复处理 = 按明细 id 重查库存(batch-requery 是唯一后端);
|
||||
@@ -26,21 +26,23 @@ import {
|
||||
createTransferMatching,
|
||||
downloadTransferErpInventory,
|
||||
downloadTransferExceptions,
|
||||
downloadTransferReceiptFiles,
|
||||
downloadTransferInboundFiles,
|
||||
executeTransferItems,
|
||||
fetchTransferTypes,
|
||||
getTransferBacklogSummary,
|
||||
getTransferMatching,
|
||||
getTransferRun,
|
||||
listExecutableTransferItems,
|
||||
listPendingMatchRecords,
|
||||
listTransferBacklog,
|
||||
listPendingMatchRecordsPage,
|
||||
listTransferBacklogPage,
|
||||
listTransferSources,
|
||||
manualCloseTransferItem,
|
||||
reparsePendingMatch as reparsePendingMatchApi,
|
||||
retryTransferItem,
|
||||
retryTransferSourceRpa,
|
||||
retryTransferSourcesRpaBatch,
|
||||
} from '../api/transfer.api';
|
||||
import type { TransferBacklogPageQuery } from '../api/transfer.api';
|
||||
import type {
|
||||
TransferBacklogItem,
|
||||
TransferBacklogSummary,
|
||||
@@ -48,6 +50,7 @@ import type {
|
||||
TransferMatchingDetail,
|
||||
TransferMatchingItem,
|
||||
TransferMatchingSummary,
|
||||
TransferPendingMatchReparseResult,
|
||||
TransferPendingMatchRecord,
|
||||
TransferRunResult,
|
||||
TransferSourceOption,
|
||||
@@ -131,6 +134,9 @@ export function isTerminalRunStatus(status: string | null | undefined): boolean
|
||||
return typeof status === 'string' && TERMINAL_RUN_STATUSES.has(status);
|
||||
}
|
||||
|
||||
/** 调拨列表统一每页行数(待办池/待匹配桶与已执行明细同口径;组件分页条同值引用)。 */
|
||||
export const TRANSFER_PAGE_SIZE = 20;
|
||||
|
||||
export function useChatTransfer() {
|
||||
const { error: notifyError } = useMessage();
|
||||
|
||||
@@ -142,9 +148,18 @@ export function useChatTransfer() {
|
||||
const run = ref<TransferRunResult | null>(null);
|
||||
const backlog = ref<TransferBacklogItem[]>([]);
|
||||
const backlogSummary = ref<TransferBacklogSummary | null>(null);
|
||||
/** 待处理池服务端分页查询(2026-10-16:组件经 loadBacklog(partial) 更新,
|
||||
* 操作后无参重拉沿用最近查询;total=筛选后全量计数供分页器)。 */
|
||||
const backlogQuery = ref<TransferBacklogPageQuery>({ page: 1, pageSize: TRANSFER_PAGE_SIZE, keyword: '', resultFilter: 'all' });
|
||||
const backlogTotal = ref(0);
|
||||
// 待办池在途请求代数(loadBacklog 竞态守卫:仅最新代响应落地)
|
||||
let backlogLoadGeneration = 0;
|
||||
const executableItems = ref<TransferMatchingItem[]>([]);
|
||||
/** 「待匹配」桶只读清单(D16:已落档尚未匹配的外部收料记录;无 item_id 不可执行) */
|
||||
/** 「待匹配」桶只读清单(D16:已落档尚未匹配的外部入站记录;无 item_id 不可执行)。
|
||||
* 服务端分页(2026-10-16):records=当前页切片,total=桶全量计数。 */
|
||||
const pendingMatchRecords = ref<TransferPendingMatchRecord[]>([]);
|
||||
const pendingMatchTotal = ref(0);
|
||||
const pendingMatchPage = ref(1);
|
||||
const sourceOptions = ref<TransferSourceOption[]>([]);
|
||||
const transferTypes = ref<TransferTypeOption[]>([]);
|
||||
const selected = ref<Set<number>>(new Set());
|
||||
@@ -158,13 +173,13 @@ export function useChatTransfer() {
|
||||
// 轮询连接状态(交互细则 #2:单次失败保留旧值继续轮询,连续失败显示「连接中…」不清空画面)
|
||||
const pollConnecting = ref(false);
|
||||
// 来源状态轮询状态(实例级闭包,generation 语义同 Run 轮询):
|
||||
// 收料 RPA 是异步回调收口(重试 202 后状态先投影 fetching,终态靠后端回调落库),
|
||||
// 入站 RPA 是异步回调收口(重试 202 后状态先投影 fetching,终态靠后端回调落库),
|
||||
// 前端必须轮询 GET /sources 才能把 抓取中→ready/failed 反映到来源选择卡
|
||||
let sourcePollTimer: ReturnType<typeof setTimeout> | null = null;
|
||||
let sourcePollGeneration = 0;
|
||||
let sourcePollConsecutiveFailures = 0;
|
||||
|
||||
/** 全部可执行明细行 id(阻断/未成熟/无 item_id 的历史行不可勾选) */
|
||||
/** 全部可执行明细行 id(阻断/无 item_id 的历史行不可勾选) */
|
||||
const executableItemIds = computed(() =>
|
||||
items.value
|
||||
.filter((item) => item.result === 'executable' && item.item_id != null)
|
||||
@@ -175,7 +190,7 @@ export function useChatTransfer() {
|
||||
const estimatedQuantity = computed(() => matching.value?.estimated_transfer_quantity ?? '0');
|
||||
|
||||
/** 创建匹配(缺文件时来源级阶段展示等待/失败);transferType 为所选类型配置 code
|
||||
* (Task 7 接口化,来源选择卡接口选项选定值),决定收料数据范围与字段转换规则。 */
|
||||
* (Task 7 接口化,来源选择卡接口选项选定值),决定入站数据范围与字段转换规则。 */
|
||||
async function createMatching(
|
||||
sourceCodes: string[],
|
||||
businessDate?: string,
|
||||
@@ -188,8 +203,8 @@ export function useChatTransfer() {
|
||||
const summary = await createTransferMatching({
|
||||
source_codes: sourceCodes,
|
||||
business_date: businessDate,
|
||||
receipt_date_from: dateRange?.from,
|
||||
receipt_date_to: dateRange?.to,
|
||||
movement_date_from: dateRange?.from,
|
||||
movement_date_to: dateRange?.to,
|
||||
transfer_type: transferType,
|
||||
});
|
||||
matchingId.value = summary.matching_id;
|
||||
@@ -215,7 +230,7 @@ export function useChatTransfer() {
|
||||
matching.value = detail.summary;
|
||||
items.value = detail.items;
|
||||
sources.value = detail.sources;
|
||||
// 默认勾选全部可执行明细行(按 item_id);阻断/未成熟/无 item_id 不可选
|
||||
// 默认勾选全部可执行明细行(按 item_id);阻断/无 item_id 不可选
|
||||
selected.value = new Set(
|
||||
detail.items
|
||||
.filter((item) => item.result === 'executable' && item.item_id != null)
|
||||
@@ -378,11 +393,11 @@ export function useChatTransfer() {
|
||||
return result;
|
||||
}
|
||||
|
||||
/** 下载收料来源文件(zip) */
|
||||
async function downloadReceiptFiles() {
|
||||
/** 下载出入站来源文件(zip;Task 3 路由更名后端点为 inbound-files) */
|
||||
async function downloadInboundFiles() {
|
||||
if (!runNo.value) return null;
|
||||
const result = await downloadTransferReceiptFiles(runNo.value);
|
||||
saveBlob(result.blob, result.filename ?? `receipt-files-${runNo.value}.zip`);
|
||||
const result = await downloadTransferInboundFiles(runNo.value);
|
||||
saveBlob(result.blob, result.filename ?? `inbound-files-${runNo.value}.zip`);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -402,7 +417,7 @@ export function useChatTransfer() {
|
||||
return result;
|
||||
}
|
||||
|
||||
/** 加载来源实例列表(决策 3:平台仅分组,每来源附收料文件状态);
|
||||
/** 加载来源实例列表(决策 3:平台仅分组,每来源附入站文件状态);
|
||||
* 载入后按快照同步来源轮询:存在 fetching 来源即自动接管(触发重试后 RPA 异步收口,
|
||||
* 终态 ready/failed 只有重拉 /sources 才可见——否则来源卡永远停在「抓取中」)。 */
|
||||
async function loadSources() {
|
||||
@@ -489,8 +504,8 @@ export function useChatTransfer() {
|
||||
}
|
||||
}
|
||||
|
||||
/** 对指定来源重试收料,并刷新来源状态(解析失败分层:parse_failed 先本地重解析
|
||||
* 返回 200——ready/parse_failed,无轮询;其余状态仍触发收料 RPA 返回 202 + fetching,
|
||||
/** 对指定来源重试入站抓取,并刷新来源状态(解析失败分层:parse_failed 先本地重解析
|
||||
* 返回 200——ready/parse_failed,无轮询;其余状态仍触发入站 RPA 返回 202 + fetching,
|
||||
* loadSources 观察到 fetching 即自动开始来源轮询,RPA 回调收口后状态自动刷新) */
|
||||
async function retrySourceRpa(sourceCode: string) {
|
||||
const status = await retryTransferSourceRpa(sourceCode);
|
||||
@@ -507,12 +522,24 @@ export function useChatTransfer() {
|
||||
return result;
|
||||
}
|
||||
|
||||
/** 加载待处理异常列表与汇总 */
|
||||
async function loadBacklog() {
|
||||
const [items, summary] = await Promise.all([listTransferBacklog(), getTransferBacklogSummary()]);
|
||||
backlog.value = items;
|
||||
/**
|
||||
* 加载待处理池(服务端分页 + 筛选下推)与汇总。
|
||||
* 传 partial query(page/keyword/resultFilter)即合并进实例查询态;
|
||||
* 无参调用(操作后刷新/挂载兜底)沿用最近查询,页码与筛选不跳变。
|
||||
* generation 守卫:快速翻页/防抖并发下仅最新在途响应落地(防旧页覆盖新页)。
|
||||
*/
|
||||
async function loadBacklog(query?: Partial<TransferBacklogPageQuery>) {
|
||||
if (query) backlogQuery.value = { ...backlogQuery.value, ...query };
|
||||
const generation = ++backlogLoadGeneration;
|
||||
const [pageData, summary] = await Promise.all([
|
||||
listTransferBacklogPage(backlogQuery.value),
|
||||
getTransferBacklogSummary(),
|
||||
]);
|
||||
if (generation !== backlogLoadGeneration) return { items: [], summary };
|
||||
backlog.value = pageData.items;
|
||||
backlogTotal.value = pageData.total;
|
||||
backlogSummary.value = summary;
|
||||
return { items, summary };
|
||||
return { items: pageData.items, summary };
|
||||
}
|
||||
|
||||
/** 首页看板计数(仅汇总,不拉全量列表——列表延迟到切片子视图加载);
|
||||
@@ -534,13 +561,36 @@ export function useChatTransfer() {
|
||||
return executableItems.value;
|
||||
}
|
||||
|
||||
/** 加载「待匹配」桶只读清单(D16:待办看板第 4 张卡抽屉数据源;计数走 backlogSummary.pending_match)。
|
||||
* 匹配点选后记录被圈定即离开本桶,抽屉数据每次打开现拉(不做缓存)。 */
|
||||
async function loadPendingMatchRecords() {
|
||||
pendingMatchRecords.value = await listPendingMatchRecords();
|
||||
/**
|
||||
* 加载「待匹配」桶分页清单(服务端分页;传 {page} 即翻页,无参沿用最近页——
|
||||
* 清空重解析/刷新后桶内容变化但页码口径不跳变)。
|
||||
*/
|
||||
async function loadPendingMatchRecords(query?: { page?: number }) {
|
||||
if (query?.page) pendingMatchPage.value = query.page;
|
||||
const data = await listPendingMatchRecordsPage({ page: pendingMatchPage.value, pageSize: TRANSFER_PAGE_SIZE });
|
||||
pendingMatchRecords.value = data.records;
|
||||
pendingMatchTotal.value = data.total;
|
||||
return pendingMatchRecords.value;
|
||||
}
|
||||
|
||||
/**
|
||||
* 待匹配桶「清空并重新解析」(后端 Task 7 维护链路,单事务由后端提交并落审计)。
|
||||
* 【AI 触发时机】:仅待匹配抽屉确认弹窗点击「清空重解析」确认时调用;
|
||||
* 禁止在运行期入站落地链路调用(运行期走 evidence_sync,当日 fail-closed 语义)。
|
||||
* 核心逻辑:[STEP 1] POST /backlog/pending-match/reparse(后端先全量预解析,
|
||||
* 任一归档解析失败整体中止抛 TRANSFER.REPARSE_PARSE_FAILED,一行不删);
|
||||
* [STEP 2] 成功即刷新本实例待匹配清单(桶内容已被清空重建);失败原样上抛
|
||||
* BusinessError 由调用方展示「中止未删」语义,不刷新。
|
||||
*
|
||||
* @param sourceCode - 来源实例编码(必传,来自预检通过的待匹配行)
|
||||
* @returns 执行结果计数(cleared/reinserted/date_skipped/kept_unrebuildable/unlinked_items/files)
|
||||
*/
|
||||
async function reparsePendingMatch(sourceCode: string): Promise<TransferPendingMatchReparseResult> {
|
||||
const result = await reparsePendingMatchApi(sourceCode);
|
||||
await loadPendingMatchRecords();
|
||||
return result;
|
||||
}
|
||||
|
||||
/** 批量重查库存(单行隔离,结果由调用方刷新列表后展示) */
|
||||
async function batchRequery(itemIds: number[]): Promise<TransferBatchResult> {
|
||||
return batchRequeryTransferItems(itemIds);
|
||||
@@ -595,8 +645,10 @@ export function useChatTransfer() {
|
||||
pollConnecting,
|
||||
backlog,
|
||||
backlogSummary,
|
||||
backlogTotal,
|
||||
executableItems,
|
||||
pendingMatchRecords,
|
||||
pendingMatchTotal,
|
||||
sourceOptions,
|
||||
transferTypes,
|
||||
selected,
|
||||
@@ -625,10 +677,11 @@ export function useChatTransfer() {
|
||||
loadBacklogSummary,
|
||||
loadExecutableItems,
|
||||
loadPendingMatchRecords,
|
||||
reparsePendingMatch,
|
||||
batchRequery,
|
||||
resume,
|
||||
batchManualClose,
|
||||
downloadReceiptFiles,
|
||||
downloadInboundFiles,
|
||||
downloadErpInventory,
|
||||
downloadExceptions,
|
||||
reset,
|
||||
|
||||
@@ -15,7 +15,7 @@ const api = vi.hoisted(() => ({
|
||||
getTransferRun: vi.fn(),
|
||||
retryTransferItem: vi.fn(),
|
||||
manualCloseTransferItem: vi.fn(),
|
||||
downloadTransferReceiptFiles: vi.fn(),
|
||||
downloadTransferInboundFiles: vi.fn(),
|
||||
downloadTransferErpInventory: vi.fn(),
|
||||
downloadTransferExceptions: vi.fn(),
|
||||
}));
|
||||
@@ -30,9 +30,8 @@ const detail: TransferMatchingDetail = {
|
||||
matching_id: 'MTG-20260806-001',
|
||||
status: 'ready_to_execute',
|
||||
business_date: '2026-08-06',
|
||||
eligible_receipt_date_to: '2026-08-05',
|
||||
expires_at: '',
|
||||
counts: { file_invoice_count: 3, not_matured_count: 1, matched_count: 2, executable_count: 2, blocked_count: 0 },
|
||||
counts: { file_invoice_count: 3, matched_count: 3, executable_count: 2, blocked_count: 1 },
|
||||
estimated_transfer_quantity: '2400',
|
||||
estimated_external_write_count: 2,
|
||||
matching_hash: 'sha256:abc',
|
||||
@@ -41,7 +40,7 @@ const detail: TransferMatchingDetail = {
|
||||
items: [
|
||||
{ item_id: 11, source_code: 'DBS-AWSBI', material_no: 'MAT-1', material_name: '连接器组件', specification: 'A', invoice_no: 'INV-001', from_warehouse: 'DBS-TRANSIT', from_quantity: '1200', to_warehouse: 'HUB-CN01', to_quantity: '1200', result: 'executable' },
|
||||
{ item_id: 12, source_code: 'DBS-AWSBI', material_no: 'MAT-2', material_name: '控制器组件', specification: 'B', invoice_no: 'INV-002', from_warehouse: 'DBS-TRANSIT', from_quantity: '1200', to_warehouse: 'HUB-CN01', to_quantity: '1200', result: 'executable' },
|
||||
{ item_id: 13, source_code: 'DBS-AWSSG', material_no: 'MAT-41', material_name: '连接器', specification: 'C', invoice_no: 'INV-041', from_warehouse: '', from_quantity: null, to_warehouse: '', to_quantity: '400', result: 'not_matured' },
|
||||
{ item_id: 13, source_code: 'DBS-AWSSG', material_no: 'MAT-41', material_name: '连接器', specification: 'C', invoice_no: 'INV-041', from_warehouse: '', from_quantity: null, to_warehouse: '', to_quantity: '400', result: 'blocked_quantity_mismatch' },
|
||||
],
|
||||
};
|
||||
|
||||
@@ -72,14 +71,14 @@ describe('in-transit-transfer e2e contract', () => {
|
||||
api.getTransferMatching.mockResolvedValue(detail);
|
||||
api.executeTransferItems.mockResolvedValue({ run_no: 'RUN-20260806-001', status: 'success' });
|
||||
api.getTransferRun.mockResolvedValue(runResult);
|
||||
api.downloadTransferReceiptFiles.mockResolvedValue({ blob: new Blob(['zip']), filename: 'receipt-files.zip' });
|
||||
api.downloadTransferInboundFiles.mockResolvedValue({ blob: new Blob(['zip']), filename: 'inbound-files.zip' });
|
||||
api.downloadTransferErpInventory.mockResolvedValue({ blob: new Blob(['csv']), filename: 'erp.csv' });
|
||||
});
|
||||
|
||||
it('主路径:匹配 → 只选 item 11 → 按明细行生成调拨单 → 结果按 ERP 单号聚合', async () => {
|
||||
const transfer = useChatTransfer();
|
||||
await transfer.createMatching(['DBS-AWSBI', 'DBS-AWSSG'], '2026-08-06');
|
||||
// 未成熟项默认不勾选
|
||||
// 阻断项默认不勾选
|
||||
expect(transfer.selected.value.has(13)).toBe(false);
|
||||
// 取消 item 12,只执行 item 11
|
||||
transfer.toggleSelect(12, false);
|
||||
@@ -96,12 +95,12 @@ describe('in-transit-transfer e2e contract', () => {
|
||||
expect(transfer.run.value?.result.external_documents[0].material_count).toBe(2);
|
||||
});
|
||||
|
||||
it('下载:收料来源文件与 ERP 库存表(决策 21/22 前端入口)', async () => {
|
||||
it('下载:出入站来源文件与 ERP 库存表(决策 21/22 前端入口)', async () => {
|
||||
const transfer = useChatTransfer();
|
||||
transfer.runNo.value = 'RUN-20260806-001';
|
||||
await transfer.downloadReceiptFiles();
|
||||
await transfer.downloadInboundFiles();
|
||||
await transfer.downloadErpInventory();
|
||||
expect(api.downloadTransferReceiptFiles).toHaveBeenCalledWith('RUN-20260806-001');
|
||||
expect(api.downloadTransferInboundFiles).toHaveBeenCalledWith('RUN-20260806-001');
|
||||
expect(api.downloadTransferErpInventory).toHaveBeenCalledWith('RUN-20260806-001');
|
||||
});
|
||||
|
||||
|
||||
@@ -36,7 +36,6 @@ export interface TransferTypeOption {
|
||||
/** 匹配计数 */
|
||||
export interface TransferMatchingCounts {
|
||||
file_invoice_count: number;
|
||||
not_matured_count: number;
|
||||
matched_count: number;
|
||||
executable_count: number;
|
||||
blocked_count: number;
|
||||
@@ -58,7 +57,6 @@ export interface TransferMatchingSummary {
|
||||
matching_id: string;
|
||||
status: string;
|
||||
business_date: string;
|
||||
eligible_receipt_date_to: string;
|
||||
expires_at: string;
|
||||
counts: TransferMatchingCounts;
|
||||
estimated_transfer_quantity: string;
|
||||
@@ -75,7 +73,8 @@ export interface TransferMatchingItem {
|
||||
material_name: string;
|
||||
specification: string;
|
||||
invoice_no: string;
|
||||
receipt_date?: string | null;
|
||||
/** 明细异动日期(Task 3 序列化键更名,明细 movement 语义;旧名见 git 历史) */
|
||||
movement_date?: string | null;
|
||||
from_warehouse: string;
|
||||
from_quantity: string | null;
|
||||
to_warehouse: string;
|
||||
@@ -89,7 +88,7 @@ export interface TransferMatchingItem {
|
||||
checked_at?: string | null;
|
||||
/** 匹配新鲜度:超过 TTL(10 分钟)为 true,执行门禁会拦截 */
|
||||
stale?: boolean;
|
||||
/** 行评估所用收料文件版本与来源最新可用文件是否一致;false = 文件已更新需重新匹配 */
|
||||
/** 行评估所用入站文件版本与来源最新可用文件是否一致;false = 文件已更新需重新匹配 */
|
||||
file_current?: boolean;
|
||||
/** [2026-10-12 单据数口径修正] 执行建单五元组首键(路由解析所得外部组织);
|
||||
* 匹配评估路径透出,历史回放缺省——预估 ERP 单据数按五元组去重的分组输入 */
|
||||
@@ -159,7 +158,7 @@ export type TransferOrderStatus = 'pending' | 'executing' | 'success' | 'duplica
|
||||
|
||||
/** 单内行(ERP 写入行粒度聚合:物料+批号;quantity 为 6 位小数字符串,与 D14 快照口径一致) */
|
||||
export interface TransferOrderLine {
|
||||
/** 行级溯源收料通知号(2026-09-29 契约扩充;一行恒对应一张 invoice,旧 payload 缺省) */
|
||||
/** 行级溯源入站通知号(2026-09-29 契约扩充;一行恒对应一张 invoice,旧 payload 缺省) */
|
||||
invoice_no?: string;
|
||||
material_no: string;
|
||||
material_name: string;
|
||||
@@ -175,7 +174,8 @@ export interface TransferOrderLine {
|
||||
*/
|
||||
export interface TransferOrder {
|
||||
doc_no: string;
|
||||
receipt_date: string;
|
||||
/** 单异动日期(Task 3 序列化键更名后键名;旧名见 git 历史) */
|
||||
movement_date: string;
|
||||
from_warehouse: string;
|
||||
to_warehouse: string;
|
||||
status: TransferOrderStatus;
|
||||
@@ -215,17 +215,17 @@ export interface TransferBacklogItem {
|
||||
material_no: string;
|
||||
status: string;
|
||||
reason: string;
|
||||
/** 最近一次结果码(如 blocked_file_removed=收料行已从最新文件移除);缺省为普通阻断 */
|
||||
/** 最近一次结果码(如 blocked_file_removed=入站行已从最新文件移除);缺省为普通阻断 */
|
||||
result_code?: string | null;
|
||||
age_days: number;
|
||||
aging_level: string;
|
||||
last_attempt_at?: string | null;
|
||||
receipt_date?: string | null;
|
||||
movement_date?: string | null;
|
||||
material_name?: string | null;
|
||||
from_warehouse?: string | null;
|
||||
to_warehouse?: string | null;
|
||||
lot_no?: string | null;
|
||||
receipt_quantity?: string | null;
|
||||
movement_quantity?: string | null;
|
||||
external_quantity?: string | null;
|
||||
}
|
||||
|
||||
@@ -254,7 +254,7 @@ export interface TransferDocumentRetryResult {
|
||||
blocked: { invoice_no: string; item_id: number; reason: string }[];
|
||||
total: number;
|
||||
}
|
||||
/** 待处理池汇总(pending_match=「待匹配」桶计数 D16:已落档尚未匹配的外部收料记录) */
|
||||
/** 待处理池汇总(pending_match=「待匹配」桶计数 D16:已落档尚未匹配的外部入站记录) */
|
||||
export interface TransferBacklogSummary {
|
||||
recoverable: number;
|
||||
closed: number;
|
||||
@@ -281,21 +281,57 @@ export interface TransferPendingMatchRecord {
|
||||
quantity?: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 「清空并重新解析」预检投影(GET /backlog/pending-match/reparse-preview,
|
||||
* 后端 Task 7;确认弹窗唯一数据源——禁止用本地记录数估算弹窗内容)。
|
||||
* files[].rows 为按溯源文件计数的预估口径,精确值以执行结果为准。
|
||||
*/
|
||||
export interface TransferPendingMatchReparsePreview {
|
||||
/** 可重建归档文件概要(归档时间升序;sha256 为归档证据指纹) */
|
||||
files: Array<{ archived_at: string; sha256: string; rows: number }>;
|
||||
/** 来源当前绑定的已发布入站解析规则;null=未绑定(无重建通道,弹窗须显式披露) */
|
||||
profile: { code: string; version: number } | null;
|
||||
/** 可删可重建行数(删除范围三重过滤口径) */
|
||||
clearable_rows: number;
|
||||
/** 证据缺失保留行数(归档已清理/过保留期/无溯源,原样留存) */
|
||||
kept_rows: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 「清空并重新解析」执行结果(POST /backlog/pending-match/reparse 单事务返回,
|
||||
* 后端 Task 7 ReparseOutcome 序列化;解析失败为 4xx AppError 无本响应)。
|
||||
*/
|
||||
export interface TransferPendingMatchReparseResult {
|
||||
source_code: string;
|
||||
/** 删除的旧映射档行数 */
|
||||
cleared: number;
|
||||
/** 重落新插入档行数 */
|
||||
reinserted: number;
|
||||
/** 重落时异动日期空值被滤行数(常规为 0) */
|
||||
date_skipped: number;
|
||||
/** 证据缺失保留行数 */
|
||||
kept_unrebuildable: number;
|
||||
/** 删除前被置空 ledger_record_id 的废弃 items 数(R9 解绑) */
|
||||
unlinked_items: number;
|
||||
/** 逐文件重落概要(归档时间升序) */
|
||||
files: Array<{ file_id: number; sha256: string; archived_at: string; inserted: number }>;
|
||||
}
|
||||
|
||||
/** 来源实例选项(决策 3:平台仅分组,实例为执行边界) */
|
||||
export interface TransferSourceOption {
|
||||
source_code: string;
|
||||
display_name: string;
|
||||
platform: string;
|
||||
enabled: boolean;
|
||||
/** 收料文件状态:ready / fetching / failed / parse_failed / expired / none(只读投影货代收料事实;parse_failed=当日可用收料文件解析失败) */
|
||||
/** 入站文件状态:ready / fetching / failed / parse_failed / expired / none(只读投影货代入站事实;parse_failed=当日可用入站文件解析失败) */
|
||||
file_status?: 'ready' | 'fetching' | 'failed' | 'no_data' | 'parse_failed' | 'expired' | 'none';
|
||||
/** 是否已有当前可用的收料文件(门禁:无 ready 文件禁止确认匹配) */
|
||||
/** 是否已有当前可用的入站文件(门禁:无 ready 文件禁止确认匹配) */
|
||||
has_ready_file?: boolean;
|
||||
file_no?: string | null;
|
||||
file_sha256?: string | null;
|
||||
}
|
||||
|
||||
/** 来源收料文件状态(门禁 + 状态标识 + 重试返回) */
|
||||
/** 来源入站文件状态(门禁 + 状态标识 + 重试返回) */
|
||||
export interface TransferSourceFileStatus {
|
||||
source_code: string;
|
||||
file_status: 'ready' | 'fetching' | 'failed' | 'no_data' | 'parse_failed' | 'expired' | 'none';
|
||||
@@ -335,7 +371,8 @@ export interface TransferExecutedOrder {
|
||||
submit_timestamp: string;
|
||||
status: TransferOrderStatus;
|
||||
status_group: keyof TransferOrderGroups;
|
||||
receipt_date: string;
|
||||
/** 单异动日期(Task 3 序列化键更名后键名;旧名见 git 历史) */
|
||||
movement_date: string;
|
||||
from_warehouse: string;
|
||||
to_warehouse: string;
|
||||
erp_document_no: string | null;
|
||||
|
||||
@@ -2723,7 +2723,7 @@
|
||||
"blockReason": "Reason to address",
|
||||
"manualReason": "Manual reason",
|
||||
"confirmBlocked": "Build eligibility is not satisfied. Resolve inventory or validation issues before confirming.",
|
||||
"autoCreateBlocked": "Manual build is eligible but automatic creation is not; after confirmation, a human will drive it forward.",
|
||||
"autoCreateBlocked": "Manual creation qualified, but auto-creation is not; after confirmation it will proceed manually.",
|
||||
"autoGateProgressHint": "Auto-create eligibility is met — waiting for the system to start.",
|
||||
"autoGateWaitingHint": "Auto-create eligibility is met — waiting for the system to start.",
|
||||
"autoGateRunningHint": "The system is creating the order and progressing automatically.",
|
||||
@@ -2762,8 +2762,7 @@
|
||||
"inventory_source_unresolved": "Inventory source unresolved",
|
||||
"effective_reservation_missing": "A valid reservation number is missing",
|
||||
"unknown": "The system found an item that needs confirmation"
|
||||
},
|
||||
"autoCreateBlocked": "Manual creation qualified, but auto-creation is not; after confirmation it will proceed manually."
|
||||
}
|
||||
},
|
||||
"inventoryCandidates": {
|
||||
"title": "Manual inventory selection",
|
||||
@@ -3784,31 +3783,30 @@
|
||||
"missingInvoices": "Missing invoices"
|
||||
},
|
||||
"transfer": {
|
||||
"fileProgressTitle": "Receipt file preparation",
|
||||
"fileProgressTitle": "Inbound file preparation",
|
||||
"stageFileReady": "File ready",
|
||||
"stageWaitingRpa": "RPA fetching",
|
||||
"stageFailed": "Failed",
|
||||
"matchTitle": "Transferable stock list",
|
||||
"businessDate": "Business date",
|
||||
"executableCount": "Executable",
|
||||
"notMaturedCount": "Immature receipts",
|
||||
"blockedCount": "Blocked",
|
||||
"estimatedQuantity": "Est. transfer qty",
|
||||
"estimatedExternalWrites": "Est. ERP documents",
|
||||
"pendingStockCheckCount": "Pending stock check",
|
||||
"invalidRowCount": "{count} invalid rows",
|
||||
"reasonQuantityMismatch": "ERP book stock quantity does not match the received quantity",
|
||||
"reasonQuantityMismatch": "ERP book stock quantity does not match the movement quantity",
|
||||
"reasonInventoryNotFound": "No ERP stock record for this lot; stock is shown as 0",
|
||||
"reasonExternalQueryFailed": "External system query failed",
|
||||
"reasonFutureDate": "Receipt date is after the business date",
|
||||
"reasonFutureDate": "Movement date is after the business date",
|
||||
"selectedCount": "{count} selected",
|
||||
"generateTransfer": "Generate transfer orders",
|
||||
"colSource": "Source",
|
||||
"colSource": "Inbound source",
|
||||
"colMaterial": "Material",
|
||||
"colName": "Name",
|
||||
"colSpec": "Spec",
|
||||
"colInvoice": "Invoice",
|
||||
"colReceiptDate": "Receipt Date",
|
||||
"colMovementDate": "Movement Date",
|
||||
"colFromWarehouse": "From warehouse",
|
||||
"colFromQty": "Stock qty",
|
||||
"stockCheckedAtTitle": "Stock checked at {time}",
|
||||
@@ -3817,21 +3815,20 @@
|
||||
"filterPlaceholder": "Filter by material / name / Invoice / batch",
|
||||
"filterAll": "All results",
|
||||
"requerySelected": "Requery selected",
|
||||
"receiptDateLabel": "Receipt date",
|
||||
"receiptDateTo": "Receipt date end",
|
||||
"receiptDateHint": "Defaults to the D+1 rule date (day before business date, the matching cutoff); end cannot exceed it and start cannot be after end",
|
||||
"movementDateLabel": "Movement date",
|
||||
"movementDateTo": "Movement date end",
|
||||
"movementDateHint": "Defaults to T−2 (2 days before business date); end must not exceed the business date, start must not exceed end",
|
||||
"requeryRow": "Requery",
|
||||
"colToQty": "To qty",
|
||||
"colResult": "Result",
|
||||
"resultExecutable": "Executable",
|
||||
"resultNotMatured": "Same-day receipt",
|
||||
"resultBlocked": "Blocked",
|
||||
"resultUnknown": "Result unknown",
|
||||
"resultFileRemoved": "Removed from file",
|
||||
"resultPendingStockCheck": "Pending stock check",
|
||||
"staleRow": "Stale — requery",
|
||||
"fileChangedRow": "File updated; data will realign",
|
||||
"fileRemovedQuarantined": "{count} more rows were invalidated (removed from the receipt file) and are hidden from this list; handle them under Pending Exceptions (mark as no further action).",
|
||||
"fileRemovedQuarantined": "{count} more rows were invalidated (removed from the inbound file) and are hidden from this list; handle them under Pending Exceptions (mark as no further action).",
|
||||
"runProgress": "Transfer run progress",
|
||||
"runExecuting": "Executing",
|
||||
"runSuccess": "Completed",
|
||||
@@ -3847,7 +3844,7 @@
|
||||
"exceptionBusinessFailed": "Business failed",
|
||||
"exceptionTechnicalFailed": "Technical failed",
|
||||
"exceptionMatchExpired": "Matching expired",
|
||||
"downloadReceiptFiles": "Download receipt files",
|
||||
"downloadInboundFiles": "Download inbound source files",
|
||||
"downloadErpInventory": "Download ERP inventory",
|
||||
"downloadExceptions": "Download exceptions Excel",
|
||||
"backlogTitle": "Backlog exceptions",
|
||||
@@ -3857,7 +3854,7 @@
|
||||
"colAction": "Actions",
|
||||
"selectedRows": "{count} selected",
|
||||
"clearSelection": "Clear selection",
|
||||
"receiptDateInvalid": "Start date cannot be after end date",
|
||||
"movementDateInvalid": "Start date cannot be after end date",
|
||||
"toastRequeryDone": "Requery done: {ok} rows updated, {failed} failed",
|
||||
"toastRequeryRecovered": "Resume done: {recovered} executable · {blocked} still blocked",
|
||||
"toastExecuteFileChanged": "{count} rows with file updated — re-match",
|
||||
@@ -3877,7 +3874,7 @@
|
||||
"statusClosed": "Manually closed",
|
||||
"resultUnknownReadonly": "Read-only; verify per SOP",
|
||||
"noBacklog": "No backlog exceptions",
|
||||
"sourceSelectTitle": "Select receipt source instances",
|
||||
"sourceSelectTitle": "Select inbound source instances",
|
||||
"transferTypeLabel": "Transfer type",
|
||||
"transferTypeEmpty": "No transfer types available. Please contact an administrator to configure them in the admin console.",
|
||||
"matchParams": "Matching parameters",
|
||||
@@ -3890,7 +3887,7 @@
|
||||
"homeWelcome": "Hello, you are in",
|
||||
"homeTodayLabel": "Today's tasks",
|
||||
"homeTodayAction": "Match transferable stock",
|
||||
"homeTodayHint": "After selecting source instances, the system uses yesterday as the business date by default.",
|
||||
"homeTodayHint": "After selecting source instances, the system processes transferable movement records with yesterday as the business date by default.",
|
||||
"homeHistoryLabel": "Pending tasks",
|
||||
"homeRecoverable": "Pending recovery",
|
||||
"homeRecoverableHint": "Requery stock or resume in one click",
|
||||
@@ -3898,21 +3895,21 @@
|
||||
"homeClosedHint": "View reason and restore processing",
|
||||
"homeUnknown": "Unknown result",
|
||||
"homeBack": "Back to home",
|
||||
"retryReceipt": "Retry receipt RPA",
|
||||
"retryInbound": "Retry inbound RPA",
|
||||
"retrying": "Retrying…",
|
||||
"fileReady": "File ready",
|
||||
"fileFetching": "Fetching",
|
||||
"fileFailed": "Fetch failed",
|
||||
"fileNoData": "No receipt data",
|
||||
"fileNoData": "No inbound data",
|
||||
"fileExpired": "File expired",
|
||||
"fileParseFailed": "Parse failed",
|
||||
"sourceErrorTitle": "Source processing failed",
|
||||
"fileNone": "Pending",
|
||||
"needReadyFile": "A selected source has no receipt file / is fetching / failed. Retry receipt RPA first.",
|
||||
"needReadyFile": "A selected source has no inbound file / is fetching / failed. Retry inbound RPA first.",
|
||||
"selectVisible": "Select visible",
|
||||
"selectRetryable": "Select retryable",
|
||||
"batchRetry": "Batch retry RPA",
|
||||
"downloadFiles": "Download receipt files",
|
||||
"downloadFiles": "Download inbound files",
|
||||
"selectedRetryableCount": "{count} retryable",
|
||||
"noRetryable": "No selected source needs retry (fetching in progress)",
|
||||
"partialConfirmSummary": "{total} selected · {ready} ready to match · {unready} not ready",
|
||||
@@ -3925,17 +3922,32 @@
|
||||
"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",
|
||||
"transferPendingMatchHint": "External movement records captured but not matched yet",
|
||||
"transferPendingMatchTitle": "Movement records pending match",
|
||||
"transferPendingMatchEmpty": "No external movement records 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",
|
||||
"transferPendingMatchColDate": "Movement date",
|
||||
"transferPendingMatchColQuantity": "Qty",
|
||||
"reparseButton": "Clear & Reparse",
|
||||
"reparseTitle": "Clear and re-parse",
|
||||
"reparseFilesPrefix": "Archived files: ",
|
||||
"reparseFilesSuffix": "",
|
||||
"reparseProfilePrefix": "Rule ",
|
||||
"reparseProfileVersionPrefix": " v",
|
||||
"reparseProfileEmpty": "No parsing rule bound",
|
||||
"reparseRowsClearPrefix": "Will clear ",
|
||||
"reparseRowsClearSuffix": " rows",
|
||||
"reparseRowsKeptPrefix": "; ",
|
||||
"reparseRowsKeptSuffix": " rows kept (missing evidence)",
|
||||
"reparseSuccessPrefix": "Cleared ",
|
||||
"reparseSuccessReinsertPrefix": " rows, re-landed ",
|
||||
"reparseSuccessSuffix": " rows",
|
||||
"reparseFailedPrefix": "Re-parse aborted, nothing deleted: ",
|
||||
"executableTitle": "Executable items",
|
||||
"executableEmpty": "No executable items",
|
||||
"executableSelectedCount": "{count} executable rows selected",
|
||||
|
||||
@@ -575,11 +575,10 @@
|
||||
"VOUCHER_CHECK_OA_SALES_RELEASE_INVALID": "Sales-release data is invalid. Provide a valid invoice number and delivery number.",
|
||||
"VOUCHER_CHECK_OA_SALES_RELEASE_PARTIAL": "Some sales-release PDFs failed to fetch.",
|
||||
"TRANSFER_PERMISSION_DENIED": "No in-transit transfer permission.",
|
||||
"TRANSFER_RECEIPT_NOT_MATURED": "Same-day receipt is not matured yet.",
|
||||
"TRANSFER_FILE_NOT_READY": "Receipt file is not ready.",
|
||||
"TRANSFER_FILE_SCHEMA_INVALID": "Receipt file schema or field validation failed.",
|
||||
"TRANSFER_FILE_NOT_READY": "Inbound file is not ready.",
|
||||
"TRANSFER_FILE_SCHEMA_INVALID": "Inbound file schema or field validation failed.",
|
||||
"TRANSFER_INVOICE_CONFLICT": "Invoice conflict (multiple materials or dates).",
|
||||
"TRANSFER_QUANTITY_MISMATCH": "Receipt quantity does not equal ERP inventory; blocked.",
|
||||
"TRANSFER_QUANTITY_MISMATCH": "Movement quantity does not equal ERP inventory; blocked.",
|
||||
"TRANSFER_ERP_INVENTORY_NOT_FOUND": "ERP inventory not found for this invoice.",
|
||||
"TRANSFER_MATCH_EXPIRED": "Matching expired or snapshot changed; re-run matching.",
|
||||
"TRANSFER_CONFIRMATION_REQUIRED": "Matching is not ready for execution.",
|
||||
@@ -597,7 +596,7 @@
|
||||
"TRANSFER.BATCH_ITEMS_REQUIRED": "Item ids are required.",
|
||||
"TRANSFER.EXECUTE_ITEMS_INVALID": "Some rows do not exist or are not executable; refresh and retry.",
|
||||
"TRANSFER.ITEMS_STALE": "Some rows were evaluated too long ago; re-run the matching.",
|
||||
"TRANSFER.FILE_CHANGED": "The receipt file has changed; re-run the matching before executing.",
|
||||
"TRANSFER.FILE_CHANGED": "The inbound file has changed; re-run the matching before executing.",
|
||||
"TRANSFER.ORG_REQUIRED": "External organization code is required.",
|
||||
"TRANSFER.RETRIGGER_NOT_ALLOWED": "Only result_unknown tickets can be retriggered; closing and recreating is forbidden.",
|
||||
"TRANSFER.RETRY_NOT_ALLOWED": "This row was removed along with the file and cannot be requeried; mark it as no further action or wait for the file to re-sync.",
|
||||
|
||||
@@ -2723,7 +2723,7 @@
|
||||
"blockReason": "เหตุผลที่ต้องดำเนินการ",
|
||||
"manualReason": "เหตุผลด้วยตนเอง",
|
||||
"confirmBlocked": "ร่างยังไม่ผ่านคุณสมบัติการสร้างคำสั่ง โปรดแก้ปัญหาแหล่งสต็อกหรือการตรวจสอบก่อนยืนยัน",
|
||||
"autoCreateBlocked": "ผ่านคุณสมบัติสร้างด้วยตนเอง แต่ไม่ผ่านการสร้างอัตโนมัติ หลังยืนยันผู้ใช้จะเป็นผู้ดำเนินการต่อ",
|
||||
"autoCreateBlocked": "人工建单资格已通过,但自动建单资格未通过;确认后将由人工推进。",
|
||||
"autoGateProgressHint": "ผ่านคุณสมบัติสร้างอัตโนมัติแล้ว — รอระบบเริ่มทำงาน",
|
||||
"autoGateWaitingHint": "ผ่านคุณสมบัติสร้างอัตโนมัติแล้ว — รอระบบเริ่มทำงาน",
|
||||
"autoGateRunningHint": "ระบบกำลังสร้างออเดอร์และดำเนินการต่อโดยอัตโนมัติ",
|
||||
@@ -2762,8 +2762,7 @@
|
||||
"inventory_source_unresolved": "ยังไม่ระบุแหล่งสต็อก",
|
||||
"effective_reservation_missing": "ไม่มีหมายเลขการจองที่ถูกต้อง",
|
||||
"unknown": "ระบบพบรายการที่ต้องยืนยันด้วยตนเอง"
|
||||
},
|
||||
"autoCreateBlocked": "人工建单资格已通过,但自动建单资格未通过;确认后将由人工推进。"
|
||||
}
|
||||
},
|
||||
"inventoryCandidates": {
|
||||
"title": "เลือกแหล่งสต็อกด้วยตนเอง",
|
||||
@@ -3784,31 +3783,30 @@
|
||||
"missingInvoices": "invoice ที่ขาด"
|
||||
},
|
||||
"transfer": {
|
||||
"fileProgressTitle": "การเตรียมไฟล์รับของ",
|
||||
"fileProgressTitle": "การเตรียมไฟล์รับเข้า",
|
||||
"stageFileReady": "ไฟล์พร้อม",
|
||||
"stageWaitingRpa": "RPA กำลังดึงข้อมูล",
|
||||
"stageFailed": "ล้มเหลว",
|
||||
"matchTitle": "รายการสต็อกที่โอนได้",
|
||||
"businessDate": "วันที่ธุรกิจ",
|
||||
"executableCount": "ดำเนินการได้",
|
||||
"notMaturedCount": "รับของที่ยังไม่ถึงกำหนด",
|
||||
"blockedCount": "ถูกบล็อก",
|
||||
"estimatedQuantity": "จำนวนโอนโดยประมาณ",
|
||||
"estimatedExternalWrites": "เอกสาร ERP โดยประมาณ",
|
||||
"pendingStockCheckCount": "รอตรวจสอบสต๊อก",
|
||||
"invalidRowCount": "{count} แถวหมดอายุ",
|
||||
"reasonQuantityMismatch": "ปริมาณสต๊อกตามบัญชี ERP ไม่ตรงกับปริมาณที่รับสินค้า",
|
||||
"reasonQuantityMismatch": "ปริมาณสต๊อกตามบัญชี ERP ไม่ตรงกับปริมาณเคลื่อนไหว",
|
||||
"reasonInventoryNotFound": "ไม่มีระเบียนสต๊อก ERP สำหรับล็อตนี้ แสดงสต๊อกเป็น 0",
|
||||
"reasonExternalQueryFailed": "การสอบถามระบบภายนอกล้มเหลว",
|
||||
"reasonFutureDate": "วันที่รับสินค้าหลังวันที่ทำธุรกรรม",
|
||||
"reasonFutureDate": "วันที่เคลื่อนไหวหลังวันที่ทำธุรกรรม",
|
||||
"selectedCount": "เลือก {count} รายการ",
|
||||
"generateTransfer": "สร้างใบโอน",
|
||||
"colSource": "แหล่งรับของ",
|
||||
"colSource": "แหล่งรับเข้า",
|
||||
"colMaterial": "รหัสวัสดุ",
|
||||
"colName": "ชื่อ",
|
||||
"colSpec": "สเปก",
|
||||
"colInvoice": "Invoice",
|
||||
"colReceiptDate": "วันที่รับสินค้า",
|
||||
"colMovementDate": "วันที่เคลื่อนไหว",
|
||||
"colFromWarehouse": "คลังต้นทาง",
|
||||
"colFromQty": "จำนวนสต๊อก",
|
||||
"stockCheckedAtTitle": "เวลาตรวจสอบสต๊อก: {time}",
|
||||
@@ -3817,21 +3815,20 @@
|
||||
"filterPlaceholder": "กรองตามรหัสวัสดุ / ชื่อ / Invoice / ล็อต",
|
||||
"filterAll": "ทุกผลลัพธ์",
|
||||
"requerySelected": "ตรวจซ้ำที่เลือก",
|
||||
"receiptDateLabel": "วันที่รับสินค้า",
|
||||
"receiptDateTo": "วันที่รับสินค้าสิ้นสุด",
|
||||
"receiptDateHint": "ค่าเริ่มต้นเป็นวันตามกฎ D+1 (วันก่อนวันทำการ ซึ่งเป็นเส้นตายการจับคู่); วันสิ้นสุดต้องไม่เกินวันนี้และวันเริ่มต้นต้องไม่ช้ากว่าวันสิ้นสุด",
|
||||
"movementDateLabel": "วันที่เคลื่อนไหว",
|
||||
"movementDateTo": "วันที่เคลื่อนไหวสิ้นสุด",
|
||||
"movementDateHint": "ค่าเริ่มต้น T−2 (2 วันก่อนวันที่ทำรายการ) วันสิ้นสุดต้องไม่เกินวันที่ทำรายการ และวันเริ่มต้นต้องไม่เกินวันสิ้นสุด",
|
||||
"requeryRow": "ตรวจซ้ำ",
|
||||
"colToQty": "จำนวนปลายทาง",
|
||||
"colResult": "ผลการจับคู่",
|
||||
"resultExecutable": "ดำเนินการได้",
|
||||
"resultNotMatured": "รับของวันนี้",
|
||||
"resultBlocked": "ถูกบล็อก",
|
||||
"resultUnknown": "ผลไม่ทราบ",
|
||||
"resultFileRemoved": "ถูกลบออกจากไฟล์",
|
||||
"resultPendingStockCheck": "รอตรวจสอบสต๊อก",
|
||||
"staleRow": "ข้อมูลหมดอายุ กรุณาตรวจซ้ำ",
|
||||
"fileChangedRow": "ไฟล์อัปเดตแล้ว ข้อมูลจะจัดตำแหน่งใหม่อัตโนมัติ",
|
||||
"fileRemovedQuarantined": "อีก {count} รายการถือเป็นยกเลิกเนื่องจากถูกลบออกจากไฟล์รับของ และถูกซ่อนจากรายการนี้ โปรดดำเนินการใน「ข้อยกเว้นที่รอดำเนินการ」โดยสามารถทำเครื่องหมายว่าไม่จำเป็นต้องดำเนินการต่อ",
|
||||
"fileRemovedQuarantined": "อีก {count} รายการถือเป็นยกเลิกเนื่องจากถูกลบออกจากไฟล์รับเข้า และถูกซ่อนจากรายการนี้ โปรดดำเนินการใน「ข้อยกเว้นที่รอดำเนินการ」โดยสามารถทำเครื่องหมายว่าไม่จำเป็นต้องดำเนินการต่อ",
|
||||
"runProgress": "ความคืบหน้าการโอน",
|
||||
"runExecuting": "กำลังดำเนินการ",
|
||||
"runSuccess": "เสร็จสิ้น",
|
||||
@@ -3847,7 +3844,7 @@
|
||||
"exceptionBusinessFailed": "ธุรกิจล้มเหลว",
|
||||
"exceptionTechnicalFailed": "เทคนิคล้มเหลว",
|
||||
"exceptionMatchExpired": "การจับคู่หมดอายุ",
|
||||
"downloadReceiptFiles": "ดาวน์โหลดไฟล์รับของ",
|
||||
"downloadInboundFiles": "ดาวน์โหลดไฟล์ต้นทางรับเข้า",
|
||||
"downloadErpInventory": "ดาวน์โหลดสต็อก ERP",
|
||||
"downloadExceptions": "ดาวน์โหลด Excel ข้อผิดพลาด",
|
||||
"backlogTitle": "รายการค้างดำเนินการ",
|
||||
@@ -3857,7 +3854,7 @@
|
||||
"colAction": "การดำเนินการ",
|
||||
"selectedRows": "เลือกแล้ว {count} แถว",
|
||||
"clearSelection": "ล้างการเลือก",
|
||||
"receiptDateInvalid": "วันเริ่มต้นต้องไม่ช้ากว่าวันสิ้นสุด",
|
||||
"movementDateInvalid": "วันเริ่มต้นต้องไม่ช้ากว่าวันสิ้นสุด",
|
||||
"toastRequeryDone": "ตรวจซ้ำเสร็จ: อัปเดตแล้ว {ok} แถว ล้มเหลว {failed} แถว",
|
||||
"toastRequeryRecovered": "กู้คืนเสร็จสิ้น: {recovered} รายการดำเนินการได้ · {blocked} รายการยังถูกบล็อก",
|
||||
"toastExecuteFileChanged": "{count} รายการไฟล์มีการเปลี่ยนแปลง กรุณาจับคู่ใหม่",
|
||||
@@ -3877,7 +3874,7 @@
|
||||
"statusClosed": "ปิดด้วยมือแล้ว",
|
||||
"resultUnknownReadonly": "อ่านอย่างเดียว ตรวจตาม SOP",
|
||||
"noBacklog": "ไม่มีรายการค้างดำเนินการ",
|
||||
"sourceSelectTitle": "เลือกแหล่งรับของ",
|
||||
"sourceSelectTitle": "เลือกแหล่งรับเข้า",
|
||||
"transferTypeLabel": "ประเภทการโอนย้าย",
|
||||
"transferTypeEmpty": "ยังไม่มีประเภทการโอนย้ายที่พร้อมใช้งาน กรุณาติดต่อผู้ดูแลระบบเพื่อกำหนดค่าในหน้าผู้ดูแล",
|
||||
"matchParams": "พารามิเตอร์การจับคู่",
|
||||
@@ -3890,7 +3887,7 @@
|
||||
"homeWelcome": "สวัสดี คุณได้เข้าสู่",
|
||||
"homeTodayLabel": "งานวันนี้",
|
||||
"homeTodayAction": "จับคู่สต็อกที่โอนได้",
|
||||
"homeTodayHint": "หลังจากเลือกแหล่งรับ ระบบจะใช้เมื่อวานเป็นวันที่ทำรายการโดยค่าเริ่มต้น",
|
||||
"homeTodayHint": "หลังจากเลือกแหล่ง ระบบจะดำเนินการรายการเคลื่อนไหวที่โอนได้โดยใช้เมื่อวานเป็นวันที่ทำรายการโดยค่าเริ่มต้น",
|
||||
"homeHistoryLabel": "งานค้าง",
|
||||
"homeRecoverable": "รายการผิดปกติรอกู้คืน",
|
||||
"homeRecoverableHint": "ตรวจซ้ำสต็อกหรือดำเนินการต่อได้ทันที",
|
||||
@@ -3898,21 +3895,21 @@
|
||||
"homeClosedHint": "สามารถดูสาเหตุและกู้คืนการดำเนินการได้",
|
||||
"homeUnknown": "ผลลัพธ์ไม่ทราบ",
|
||||
"homeBack": "กลับหน้าหลัก",
|
||||
"retryReceipt": "ลองใหม่ RPA รับของ",
|
||||
"retryInbound": "ลองใหม่ RPA รับเข้า",
|
||||
"retrying": "กำลังลองใหม่…",
|
||||
"fileReady": "ไฟล์พร้อมแล้ว",
|
||||
"fileFetching": "กำลังดึง",
|
||||
"fileFailed": "ดึงล้มเหลว",
|
||||
"fileNoData": "ไม่มีข้อมูลการรับสินค้า",
|
||||
"fileNoData": "ไม่มีข้อมูลการรับเข้า",
|
||||
"fileExpired": "ไฟล์หมดอายุ",
|
||||
"fileParseFailed": "แยกวิเคราะห์ไม่สำเร็จ",
|
||||
"sourceErrorTitle": "ประมวลผลแหล่งข้อมูลล้มเหลว",
|
||||
"fileNone": "รอดำเนินการ",
|
||||
"needReadyFile": "แหล่งที่เลือกไม่มีไฟล์รับของ / กำลังดึง / ล้มเหลว โปรดลอง RPA รับของก่อน",
|
||||
"needReadyFile": "แหล่งที่เลือกไม่มีไฟล์รับเข้า / กำลังดึง / ล้มเหลว โปรดลอง RPA รับเข้าก่อน",
|
||||
"selectVisible": "เลือกที่เห็นทั้งหมด",
|
||||
"selectRetryable": "เลือกที่ลองใหม่ได้",
|
||||
"batchRetry": "ลองใหม่เป็นชุด",
|
||||
"downloadFiles": "ดาวน์โหลดไฟล์การรับสินค้า",
|
||||
"downloadFiles": "ดาวน์โหลดไฟล์รับเข้า",
|
||||
"selectedRetryableCount": "ลองใหม่ได้ {count} รายการ",
|
||||
"noRetryable": "ไม่มีแหล่งที่เลือกต้องลองใหม่ (กำลังดึงข้อมูล)",
|
||||
"partialConfirmSummary": "เลือก {total} แหล่ง · พร้อมจับคู่ {ready} แหล่ง · ยังไม่พร้อม {unready} แหล่ง",
|
||||
@@ -3925,17 +3922,32 @@
|
||||
"homeExecutable": "รายการที่โอนได้",
|
||||
"homeExecutableHint": "เลือกแถวเพื่อสร้างใบโอน",
|
||||
"transferPendingMatch": "รอจับคู่",
|
||||
"transferPendingMatchHint": "บันทึกการรับสินค้าภายนอกที่ดึงมาแล้วแต่ยังไม่จับคู่",
|
||||
"transferPendingMatchTitle": "บันทึกการรับสินค้ารอจับคู่",
|
||||
"transferPendingMatchEmpty": "ไม่มีบันทึกการรับสินค้าภายนอกรอจับคู่",
|
||||
"transferPendingMatchHint": "บันทึกการเคลื่อนไหวภายนอกที่ดึงมาแล้วแต่ยังไม่จับคู่",
|
||||
"transferPendingMatchTitle": "บันทึกการเคลื่อนไหวรอจับคู่",
|
||||
"transferPendingMatchEmpty": "ไม่มีบันทึกการเคลื่อนไหวภายนอกรอจับคู่",
|
||||
"transferPendingMatchGoMatch": "ไปจับคู่",
|
||||
"transferPendingMatchReadOnlyHint": "บันทึกยังไม่จับคู่ จึงดำเนินการไม่ได้ กดไปจับคู่เพื่อสร้างรายการที่โอนได้",
|
||||
"transferPendingMatchColSource": "แหล่งข้อมูล",
|
||||
"transferPendingMatchColDocNo": "เลขที่เอกสาร",
|
||||
"transferPendingMatchColMaterial": "รหัสสินค้า",
|
||||
"transferPendingMatchColName": "ชื่อสินค้า",
|
||||
"transferPendingMatchColDate": "วันที่รับสินค้า",
|
||||
"transferPendingMatchColDate": "วันที่เคลื่อนไหว",
|
||||
"transferPendingMatchColQuantity": "จำนวน",
|
||||
"reparseButton": "ล้างและวิเคราะห์ใหม่",
|
||||
"reparseTitle": "ล้างและวิเคราะห์ใหม่ทั้งหมด",
|
||||
"reparseFilesPrefix": "ไฟล์ที่เก็บถาวร: ",
|
||||
"reparseFilesSuffix": " ไฟล์",
|
||||
"reparseProfilePrefix": "ใช้กฎ ",
|
||||
"reparseProfileVersionPrefix": " v",
|
||||
"reparseProfileEmpty": "ยังไม่ผูกกฎการแยกวิเคราะห์",
|
||||
"reparseRowsClearPrefix": "จะล้าง ",
|
||||
"reparseRowsClearSuffix": " แถว",
|
||||
"reparseRowsKeptPrefix": "; เก็บไว้ ",
|
||||
"reparseRowsKeptSuffix": " แถว (ขาดหลักฐาน)",
|
||||
"reparseSuccessPrefix": "ล้างแล้ว ",
|
||||
"reparseSuccessReinsertPrefix": " แถว และนำกลับเข้า ",
|
||||
"reparseSuccessSuffix": " แถว",
|
||||
"reparseFailedPrefix": "ยกเลิกการวิเคราะห์ใหม่ ไม่มีข้อมูลถูกลบ: ",
|
||||
"executableTitle": "รายการที่โอนได้",
|
||||
"executableEmpty": "ไม่มีรายการที่โอนได้",
|
||||
"executableSelectedCount": "เลือกแล้ว {count} รายการ",
|
||||
|
||||
@@ -575,11 +575,10 @@
|
||||
"VOUCHER_CHECK_OA_SALES_RELEASE_INVALID": "ข้อมูลใบอนุญาตปล่อยสินค้าไม่ถูกต้อง กรุณาระบุเลขที่ใบแจ้งหนี้และเลขที่ใบส่งที่ถูกต้อง",
|
||||
"VOUCHER_CHECK_OA_SALES_RELEASE_PARTIAL": "ดึง PDF ใบอนุญาตปล่อยสินค้าบางไฟล์ไม่สำเร็จ",
|
||||
"TRANSFER_PERMISSION_DENIED": "ไม่มีสิทธิ์โอนระหว่างคลัง",
|
||||
"TRANSFER_RECEIPT_NOT_MATURED": "การรับของวันนี้ยังไม่พร้อมดำเนินการ",
|
||||
"TRANSFER_FILE_NOT_READY": "ไฟล์รับของยังไม่พร้อม",
|
||||
"TRANSFER_FILE_SCHEMA_INVALID": "โครงสร้างหรือฟิลด์ไฟล์รับของไม่ถูกต้อง",
|
||||
"TRANSFER_FILE_NOT_READY": "ไฟล์รับเข้ายังไม่พร้อม",
|
||||
"TRANSFER_FILE_SCHEMA_INVALID": "โครงสร้างหรือฟิลด์ไฟล์รับเข้าไม่ถูกต้อง",
|
||||
"TRANSFER_INVOICE_CONFLICT": "Invoice ขัดแย้ง (หลายรหัสวัสดุหรือหลายวันที่)",
|
||||
"TRANSFER_QUANTITY_MISMATCH": "จำนวนรับของไม่เท่ากับสต็อก ERP ถูกบล็อก",
|
||||
"TRANSFER_QUANTITY_MISMATCH": "จำนวนเคลื่อนไหวไม่เท่ากับสต็อก ERP ถูกบล็อก",
|
||||
"TRANSFER_ERP_INVENTORY_NOT_FOUND": "ไม่พบสต็อก ERP สำหรับ Invoice นี้",
|
||||
"TRANSFER_MATCH_EXPIRED": "การจับคู่หมดอายุหรือข้อมูลเปลี่ยน กรุณาจับคู่ใหม่",
|
||||
"TRANSFER_CONFIRMATION_REQUIRED": "การจับคู่ยังไม่พร้อมดำเนินการ",
|
||||
@@ -597,7 +596,7 @@
|
||||
"TRANSFER.BATCH_ITEMS_REQUIRED": "กรุณาระบุรายการที่ต้องการดำเนินการ",
|
||||
"TRANSFER.EXECUTE_ITEMS_INVALID": "บางรายการไม่มีอยู่หรือดำเนินการไม่ได้ กรุณารีเฟรชแล้วลองใหม่",
|
||||
"TRANSFER.ITEMS_STALE": "ผลการจับคู่ของบางรายการหมดอายุแล้ว กรุณาจับคู่ใหม่",
|
||||
"TRANSFER.FILE_CHANGED": "ไฟล์รับสินค้ามีการเปลี่ยนแปลง กรุณาจับคู่ใหม่ก่อนดำเนินการ",
|
||||
"TRANSFER.FILE_CHANGED": "ไฟล์รับเข้ามีการเปลี่ยนแปลง กรุณาจับคู่ใหม่ก่อนดำเนินการ",
|
||||
"TRANSFER.ORG_REQUIRED": "กรุณาระบุรหัสองค์กรภายนอก",
|
||||
"TRANSFER.RETRIGGER_NOT_ALLOWED": "เฉพาะตั๋วที่ผลลัพธ์ไม่ทราบแน่ชัด (result_unknown) เท่านั้นที่ทริกเกอร์ซ้ำได้ ห้ามปิดแล้วสร้างใหม่",
|
||||
"TRANSFER.RETRY_NOT_ALLOWED": "แถวนี้ถูกลบออกไปพร้อมกับไฟล์และตรวจซ้ำไม่ได้ โปรดทำเครื่องหมายว่าไม่จำเป็นต้องดำเนินการต่อ หรือรอให้ไฟล์ซิงก์ใหม่",
|
||||
|
||||
@@ -3783,31 +3783,30 @@
|
||||
"missingInvoices": "缺件 invoice"
|
||||
},
|
||||
"transfer": {
|
||||
"fileProgressTitle": "收料文件准备",
|
||||
"fileProgressTitle": "出入站文件准备",
|
||||
"stageFileReady": "文件就绪",
|
||||
"stageWaitingRpa": "RPA 抓取中",
|
||||
"stageFailed": "失败",
|
||||
"matchTitle": "可调拨清单",
|
||||
"businessDate": "业务日期",
|
||||
"executableCount": "可执行",
|
||||
"notMaturedCount": "未成熟收料",
|
||||
"blockedCount": "阻断",
|
||||
"estimatedQuantity": "预计调拨数量",
|
||||
"estimatedExternalWrites": "预计 ERP 单据",
|
||||
"pendingStockCheckCount": "待查库存",
|
||||
"invalidRowCount": "已失效 {count} 行",
|
||||
"reasonQuantityMismatch": "ERP 账面库存数量与收料数量不一致",
|
||||
"reasonQuantityMismatch": "ERP 账面库存数量与异动数量不一致",
|
||||
"reasonInventoryNotFound": "ERP 无此批号的库存记录,库存按 0 展示",
|
||||
"reasonExternalQueryFailed": "外部系统查询失败",
|
||||
"reasonFutureDate": "收料日期晚于业务日期",
|
||||
"reasonFutureDate": "异动日期晚于业务日期",
|
||||
"selectedCount": "已选 {count} 张",
|
||||
"generateTransfer": "生成调拨单",
|
||||
"colSource": "收料来源",
|
||||
"colSource": "出入站来源",
|
||||
"colMaterial": "料号",
|
||||
"colName": "品名",
|
||||
"colSpec": "规格",
|
||||
"colInvoice": "Invoice",
|
||||
"colReceiptDate": "收料日期",
|
||||
"colMovementDate": "异动日期",
|
||||
"colFromWarehouse": "拨出仓库",
|
||||
"colFromQty": "库存数量",
|
||||
"stockCheckedAtTitle": "库存查询时刻:{time}",
|
||||
@@ -3816,21 +3815,20 @@
|
||||
"filterPlaceholder": "按料号 / 品名 / Invoice / 批号筛选",
|
||||
"filterAll": "全部结果",
|
||||
"requerySelected": "重查选中",
|
||||
"receiptDateLabel": "收料日期",
|
||||
"receiptDateTo": "收料日期止",
|
||||
"receiptDateHint": "默认为 D+1 规则日期(业务日期前一天,即可匹配截止日);截止不超出该日,起始不得晚于截止",
|
||||
"movementDateLabel": "异动日期",
|
||||
"movementDateTo": "异动日期止",
|
||||
"movementDateHint": "默认 T−2(业务日期前 2 天);截止不得晚于业务日期,起始不得晚于截止",
|
||||
"requeryRow": "重查",
|
||||
"colToQty": "拨入数量",
|
||||
"colResult": "匹配结果",
|
||||
"resultExecutable": "可执行",
|
||||
"resultNotMatured": "当天收料",
|
||||
"resultBlocked": "已阻断",
|
||||
"resultUnknown": "结果未知",
|
||||
"resultFileRemoved": "文件已移除",
|
||||
"resultPendingStockCheck": "待查库存",
|
||||
"staleRow": "数据已过期,请重查",
|
||||
"fileChangedRow": "文件已更新,将自动对齐",
|
||||
"fileRemovedQuarantined": "另有 {count} 行已随收料文件移除而失效,已移出本清单;请到「待处理异常」处理,可标记无需继续处理。",
|
||||
"fileRemovedQuarantined": "另有 {count} 行已随入站文件移除而失效,已移出本清单;请到「待处理异常」处理,可标记无需继续处理。",
|
||||
"runProgress": "调拨执行进度",
|
||||
"runExecuting": "执行中",
|
||||
"runSuccess": "已完成",
|
||||
@@ -3846,7 +3844,7 @@
|
||||
"exceptionBusinessFailed": "业务失败",
|
||||
"exceptionTechnicalFailed": "技术失败",
|
||||
"exceptionMatchExpired": "匹配已失效",
|
||||
"downloadReceiptFiles": "下载收料来源文件",
|
||||
"downloadInboundFiles": "下载出入站来源文件",
|
||||
"downloadErpInventory": "下载 ERP 库存表",
|
||||
"downloadExceptions": "下载异常 Excel",
|
||||
"backlogTitle": "待处理异常",
|
||||
@@ -3856,7 +3854,7 @@
|
||||
"colAction": "操作",
|
||||
"selectedRows": "已选 {count} 行",
|
||||
"clearSelection": "取消选择",
|
||||
"receiptDateInvalid": "起始日期不得晚于截止日期",
|
||||
"movementDateInvalid": "起始日期不得晚于截止日期",
|
||||
"toastRequeryDone": "重查完成:{ok} 行已更新,{failed} 行失败",
|
||||
"toastRequeryRecovered": "恢复完成:{recovered} 笔已可执行 · {blocked} 笔仍阻断",
|
||||
"toastExecuteFileChanged": "{count} 笔文件已更新,请重新匹配",
|
||||
@@ -3876,7 +3874,7 @@
|
||||
"statusClosed": "已人工关闭",
|
||||
"resultUnknownReadonly": "只读,按 SOP 人工核实",
|
||||
"noBacklog": "暂无待处理异常",
|
||||
"sourceSelectTitle": "选择收料来源实例",
|
||||
"sourceSelectTitle": "选择出入站来源实例",
|
||||
"transferTypeLabel": "调拨类型",
|
||||
"transferTypeEmpty": "暂无可用调拨类型,请联系管理员在管理端配置",
|
||||
"matchParams": "匹配参数",
|
||||
@@ -3889,7 +3887,7 @@
|
||||
"homeWelcome": "你好,您已进入",
|
||||
"homeTodayLabel": "今日待办",
|
||||
"homeTodayAction": "匹配可调拨库存",
|
||||
"homeTodayHint": "选择来源实例后,系统默认以昨天为业务日期处理可成熟收料。",
|
||||
"homeTodayHint": "选择来源实例后,系统默认以昨天为业务日期处理可调拨异动。",
|
||||
"homeHistoryLabel": "历史待办",
|
||||
"homeRecoverable": "待恢复异常",
|
||||
"homeRecoverableHint": "可重查库存或一键恢复处理",
|
||||
@@ -3897,21 +3895,21 @@
|
||||
"homeClosedHint": "可查看原因并恢复处理",
|
||||
"homeUnknown": "结果未知",
|
||||
"homeBack": "返回首页",
|
||||
"retryReceipt": "重试收料 RPA",
|
||||
"retryInbound": "重试入站 RPA",
|
||||
"retrying": "重试中…",
|
||||
"fileReady": "文件已就绪",
|
||||
"fileFetching": "抓取中",
|
||||
"fileFailed": "抓取失败",
|
||||
"fileNoData": "无收料数据",
|
||||
"fileNoData": "无入站数据",
|
||||
"fileExpired": "文件已过期",
|
||||
"fileParseFailed": "解析失败",
|
||||
"sourceErrorTitle": "来源处理失败",
|
||||
"fileNone": "待抓取",
|
||||
"needReadyFile": "所选来源存在无收料文件/或抓取中/或失败,请先重试收料 RPA",
|
||||
"needReadyFile": "所选来源存在无入站文件/或抓取中/或失败,请先重试入站 RPA",
|
||||
"selectVisible": "全选可见",
|
||||
"selectRetryable": "只选可重试",
|
||||
"batchRetry": "批量重试 RPA",
|
||||
"downloadFiles": "下载收料文件",
|
||||
"downloadFiles": "下载入站文件",
|
||||
"selectedRetryableCount": "其中 {count} 个可重试",
|
||||
"noRetryable": "所选来源均无需重试(抓取中)",
|
||||
"partialConfirmSummary": "已选 {total} 个来源 · 可匹配 {ready} 个 · 暂不可匹配 {unready} 个",
|
||||
@@ -3924,17 +3922,32 @@
|
||||
"homeExecutable": "可调拨明细",
|
||||
"homeExecutableHint": "勾选后按行生成调拨单",
|
||||
"transferPendingMatch": "待匹配",
|
||||
"transferPendingMatchHint": "已抓取尚未匹配的外部收料记录",
|
||||
"transferPendingMatchTitle": "待匹配收料记录",
|
||||
"transferPendingMatchEmpty": "暂无待匹配的外部收料记录",
|
||||
"transferPendingMatchHint": "已抓取尚未匹配的外部异动记录",
|
||||
"transferPendingMatchTitle": "待匹配出入站记录",
|
||||
"transferPendingMatchEmpty": "暂无待匹配的外部异动记录",
|
||||
"transferPendingMatchGoMatch": "去匹配",
|
||||
"transferPendingMatchReadOnlyHint": "记录尚未匹配,暂不可执行;点「去匹配」按类型圈定生成可调拨明细",
|
||||
"transferPendingMatchColSource": "来源",
|
||||
"transferPendingMatchColDocNo": "单号",
|
||||
"transferPendingMatchColMaterial": "料号",
|
||||
"transferPendingMatchColName": "品名",
|
||||
"transferPendingMatchColDate": "收料日期",
|
||||
"transferPendingMatchColDate": "异动日期",
|
||||
"transferPendingMatchColQuantity": "数量",
|
||||
"reparseButton": "清空重解析",
|
||||
"reparseTitle": "清空并重新解析",
|
||||
"reparseFilesPrefix": "归档文件 ",
|
||||
"reparseFilesSuffix": " 份",
|
||||
"reparseProfilePrefix": "使用规则 ",
|
||||
"reparseProfileVersionPrefix": " v",
|
||||
"reparseProfileEmpty": "未绑定解析规则",
|
||||
"reparseRowsClearPrefix": "将清除 ",
|
||||
"reparseRowsClearSuffix": " 行",
|
||||
"reparseRowsKeptPrefix": ";证据缺失保留 ",
|
||||
"reparseRowsKeptSuffix": " 行",
|
||||
"reparseSuccessPrefix": "已清除 ",
|
||||
"reparseSuccessReinsertPrefix": " 行,重落 ",
|
||||
"reparseSuccessSuffix": " 行",
|
||||
"reparseFailedPrefix": "重解析中止,未删除任何数据:",
|
||||
"executableTitle": "可调拨明细",
|
||||
"executableEmpty": "暂无可调拨明细",
|
||||
"executableSelectedCount": "已选 {count} 笔可执行明细",
|
||||
|
||||
@@ -575,11 +575,10 @@
|
||||
"VOUCHER_CHECK_OA_SALES_RELEASE_INVALID": "销货放行单数据无效:请提供合法的发票号和销货单号。",
|
||||
"VOUCHER_CHECK_OA_SALES_RELEASE_PARTIAL": "销货放行单拉取部分失败。",
|
||||
"TRANSFER_PERMISSION_DENIED": "无在途调拨权限。",
|
||||
"TRANSFER_RECEIPT_NOT_MATURED": "当天收料尚未成熟,不可查询或调拨。",
|
||||
"TRANSFER_FILE_NOT_READY": "收料文件尚未就绪。",
|
||||
"TRANSFER_FILE_SCHEMA_INVALID": "收料文件结构或字段校验失败。",
|
||||
"TRANSFER_FILE_NOT_READY": "入站文件尚未就绪。",
|
||||
"TRANSFER_FILE_SCHEMA_INVALID": "入站文件结构或字段校验失败。",
|
||||
"TRANSFER_INVOICE_CONFLICT": "同一 Invoice 存在冲突(多料号或多日期)。",
|
||||
"TRANSFER_QUANTITY_MISMATCH": "收料数量与 ERP 库存不相等,已阻断。",
|
||||
"TRANSFER_QUANTITY_MISMATCH": "异动数量与 ERP 库存不相等,已阻断。",
|
||||
"TRANSFER_ERP_INVENTORY_NOT_FOUND": "ERP 未找到该 Invoice 库存。",
|
||||
"TRANSFER_MATCH_EXPIRED": "匹配已过期或快照变化,请重新匹配。",
|
||||
"TRANSFER_CONFIRMATION_REQUIRED": "匹配未就绪,无法执行。",
|
||||
@@ -597,7 +596,7 @@
|
||||
"TRANSFER.BATCH_ITEMS_REQUIRED": "请提供要操作的明细行。",
|
||||
"TRANSFER.EXECUTE_ITEMS_INVALID": "部分明细行不存在或不可执行,请刷新后重试。",
|
||||
"TRANSFER.ITEMS_STALE": "部分明细行匹配结果已过期,请重新匹配。",
|
||||
"TRANSFER.FILE_CHANGED": "收料文件已更新,请重新匹配后再执行。",
|
||||
"TRANSFER.FILE_CHANGED": "入站文件已更新,请重新匹配后再执行。",
|
||||
"TRANSFER.ORG_REQUIRED": "外部组织代码不能为空。",
|
||||
"TRANSFER.RETRIGGER_NOT_ALLOWED": "仅结果未知(result_unknown)票允许重新触发;禁止关闭后重建。",
|
||||
"TRANSFER.RETRY_NOT_ALLOWED": "该行已随文件移除,无法重查;请标记无需继续处理或等待文件重新同步。",
|
||||
|
||||
@@ -2723,7 +2723,7 @@
|
||||
"blockReason": "需要處理的原因",
|
||||
"manualReason": "人工說明",
|
||||
"confirmBlocked": "目前草稿未滿足建單資格,請先處理庫存源或校驗問題後再確認。",
|
||||
"autoCreateBlocked": "人工建單資格已通過,但自動建單資格未通過;確認後將由人工推進。",
|
||||
"autoCreateBlocked": "人工建单资格已通过,但自动建单资格未通过;确认后将由人工推进。",
|
||||
"autoGateProgressHint": "已滿足自動建單條件,等待系統啟動。",
|
||||
"autoGateWaitingHint": "已滿足自動建單條件,等待系統啟動。",
|
||||
"autoGateRunningHint": "系統正在自動建單並推進。",
|
||||
@@ -2762,8 +2762,7 @@
|
||||
"inventory_source_unresolved": "庫存源未解析",
|
||||
"effective_reservation_missing": "缺少有效的預約單號",
|
||||
"unknown": "系統發現一項需要人工確認的內容"
|
||||
},
|
||||
"autoCreateBlocked": "人工建单资格已通过,但自动建单资格未通过;确认后将由人工推进。"
|
||||
}
|
||||
},
|
||||
"inventoryCandidates": {
|
||||
"title": "人工選擇庫存源",
|
||||
@@ -3784,31 +3783,30 @@
|
||||
"missingInvoices": "缺件 invoice"
|
||||
},
|
||||
"transfer": {
|
||||
"fileProgressTitle": "收料檔案準備",
|
||||
"fileProgressTitle": "出入站檔案準備",
|
||||
"stageFileReady": "檔案就緒",
|
||||
"stageWaitingRpa": "RPA 擷取中",
|
||||
"stageFailed": "失敗",
|
||||
"matchTitle": "可調撥清單",
|
||||
"businessDate": "業務日期",
|
||||
"executableCount": "可執行",
|
||||
"notMaturedCount": "未成熟收料",
|
||||
"blockedCount": "阻斷",
|
||||
"estimatedQuantity": "預計調撥數量",
|
||||
"estimatedExternalWrites": "預計 ERP 單據",
|
||||
"pendingStockCheckCount": "待查庫存",
|
||||
"invalidRowCount": "已失效 {count} 行",
|
||||
"reasonQuantityMismatch": "ERP 帳面庫存數量與收料數量不一致",
|
||||
"reasonQuantityMismatch": "ERP 帳面庫存數量與異動數量不一致",
|
||||
"reasonInventoryNotFound": "ERP 無此批號的庫存記錄,庫存按 0 顯示",
|
||||
"reasonExternalQueryFailed": "外部系統查詢失敗",
|
||||
"reasonFutureDate": "收料日期晚於業務日期",
|
||||
"reasonFutureDate": "異動日期晚於業務日期",
|
||||
"selectedCount": "已選 {count} 張",
|
||||
"generateTransfer": "產生調撥單",
|
||||
"colSource": "收料來源",
|
||||
"colSource": "出入站來源",
|
||||
"colMaterial": "料號",
|
||||
"colName": "品名",
|
||||
"colSpec": "規格",
|
||||
"colInvoice": "Invoice",
|
||||
"colReceiptDate": "收料日期",
|
||||
"colMovementDate": "異動日期",
|
||||
"colFromWarehouse": "撥出倉庫",
|
||||
"colFromQty": "庫存數量",
|
||||
"stockCheckedAtTitle": "庫存查詢時刻:{time}",
|
||||
@@ -3817,21 +3815,20 @@
|
||||
"filterPlaceholder": "按料號 / 品名 / Invoice / 批號篩選",
|
||||
"filterAll": "全部結果",
|
||||
"requerySelected": "重查選中",
|
||||
"receiptDateLabel": "收料日期",
|
||||
"receiptDateTo": "收料日期止",
|
||||
"receiptDateHint": "預設為 D+1 規則日期(業務日期前一天,即可匹配截止日);截止不超出該日,起始不得晚於截止",
|
||||
"movementDateLabel": "異動日期",
|
||||
"movementDateTo": "異動日期止",
|
||||
"movementDateHint": "預設 T−2(業務日期前 2 天);截止不得晚於業務日期,起始不得晚於截止",
|
||||
"requeryRow": "重查",
|
||||
"colToQty": "撥入數量",
|
||||
"colResult": "匹配結果",
|
||||
"resultExecutable": "可執行",
|
||||
"resultNotMatured": "當天收料",
|
||||
"resultBlocked": "已阻斷",
|
||||
"resultUnknown": "結果未知",
|
||||
"resultFileRemoved": "檔案已移除",
|
||||
"resultPendingStockCheck": "待查庫存",
|
||||
"staleRow": "資料已過期,請重查",
|
||||
"fileChangedRow": "檔案已更新,將自動對齊",
|
||||
"fileRemovedQuarantined": "另有 {count} 筆已隨收料檔案移除而失效,已移出本清單;請到「待處理異常」處理,可標記無需繼續處理。",
|
||||
"fileRemovedQuarantined": "另有 {count} 筆已隨入站檔案移除而失效,已移出本清單;請到「待處理異常」處理,可標記無需繼續處理。",
|
||||
"runProgress": "調撥執行進度",
|
||||
"runExecuting": "執行中",
|
||||
"runSuccess": "已完成",
|
||||
@@ -3847,7 +3844,7 @@
|
||||
"exceptionBusinessFailed": "業務失敗",
|
||||
"exceptionTechnicalFailed": "技術失敗",
|
||||
"exceptionMatchExpired": "匹配已失效",
|
||||
"downloadReceiptFiles": "下載收料來源檔案",
|
||||
"downloadInboundFiles": "下載出入站來源檔案",
|
||||
"downloadErpInventory": "下載 ERP 庫存表",
|
||||
"downloadExceptions": "下載異常 Excel",
|
||||
"backlogTitle": "待處理異常",
|
||||
@@ -3857,7 +3854,7 @@
|
||||
"colAction": "操作",
|
||||
"selectedRows": "已選 {count} 行",
|
||||
"clearSelection": "取消選擇",
|
||||
"receiptDateInvalid": "起始日期不得晚於截止日期",
|
||||
"movementDateInvalid": "起始日期不得晚於截止日期",
|
||||
"toastRequeryDone": "重查完成:{ok} 行已更新,{failed} 行失敗",
|
||||
"toastRequeryRecovered": "恢復完成:{recovered} 筆已可執行 · {blocked} 筆仍阻斷",
|
||||
"toastExecuteFileChanged": "{count} 筆檔案已更新,請重新匹配",
|
||||
@@ -3877,7 +3874,7 @@
|
||||
"statusClosed": "已人工關閉",
|
||||
"resultUnknownReadonly": "唯讀,依 SOP 人工核實",
|
||||
"noBacklog": "暫無待處理異常",
|
||||
"sourceSelectTitle": "選擇收料來源實例",
|
||||
"sourceSelectTitle": "選擇出入站來源實例",
|
||||
"transferTypeLabel": "調撥類型",
|
||||
"transferTypeEmpty": "暫無可用調撥類型,請聯絡管理員在管理端配置",
|
||||
"matchParams": "匹配參數",
|
||||
@@ -3890,7 +3887,7 @@
|
||||
"homeWelcome": "你好,您已進入",
|
||||
"homeTodayLabel": "今日待辦",
|
||||
"homeTodayAction": "匹配可調撥庫存",
|
||||
"homeTodayHint": "選擇來源實例後,系統預設以昨天為業務日期處理可成熟收料。",
|
||||
"homeTodayHint": "選擇來源實例後,系統預設以昨天為業務日期處理可調撥異動。",
|
||||
"homeHistoryLabel": "歷史待辦",
|
||||
"homeRecoverable": "待恢復異常",
|
||||
"homeRecoverableHint": "可重查庫存或一鍵恢復處理",
|
||||
@@ -3898,21 +3895,21 @@
|
||||
"homeClosedHint": "可查看原因並恢復處理",
|
||||
"homeUnknown": "結果未知",
|
||||
"homeBack": "返回首頁",
|
||||
"retryReceipt": "重試收料 RPA",
|
||||
"retryInbound": "重試入站 RPA",
|
||||
"retrying": "重試中…",
|
||||
"fileReady": "檔案已就緒",
|
||||
"fileFetching": "抓取中",
|
||||
"fileFailed": "抓取失敗",
|
||||
"fileNoData": "無收料數據",
|
||||
"fileNoData": "無入站數據",
|
||||
"fileExpired": "檔案已過期",
|
||||
"fileParseFailed": "解析失敗",
|
||||
"sourceErrorTitle": "來源處理失敗",
|
||||
"fileNone": "待抓取",
|
||||
"needReadyFile": "所選來源存在無收料檔案/或抓取中/或失敗,請先重試收料 RPA",
|
||||
"needReadyFile": "所選來源存在無入站檔案/或抓取中/或失敗,請先重試入站 RPA",
|
||||
"selectVisible": "全選可見",
|
||||
"selectRetryable": "只選可重試",
|
||||
"batchRetry": "批次重試 RPA",
|
||||
"downloadFiles": "下載收料文件",
|
||||
"downloadFiles": "下載入站文件",
|
||||
"selectedRetryableCount": "其中 {count} 個可重試",
|
||||
"noRetryable": "所選來源均無需重試(抓取中)",
|
||||
"partialConfirmSummary": "已選 {total} 個來源 · 可匹配 {ready} 個 · 暫不可匹配 {unready} 個",
|
||||
@@ -3925,17 +3922,32 @@
|
||||
"homeExecutable": "可調撥明細",
|
||||
"homeExecutableHint": "勾選後按行產生調撥單",
|
||||
"transferPendingMatch": "待匹配",
|
||||
"transferPendingMatchHint": "已抓取尚未匹配的外部收料記錄",
|
||||
"transferPendingMatchTitle": "待匹配收料記錄",
|
||||
"transferPendingMatchEmpty": "暫無待匹配的外部收料記錄",
|
||||
"transferPendingMatchHint": "已抓取尚未匹配的外部異動記錄",
|
||||
"transferPendingMatchTitle": "待匹配出入站記錄",
|
||||
"transferPendingMatchEmpty": "暫無待匹配的外部異動記錄",
|
||||
"transferPendingMatchGoMatch": "去匹配",
|
||||
"transferPendingMatchReadOnlyHint": "記錄尚未匹配,暫不可執行;點「去匹配」按類型圈定產生可調撥明細",
|
||||
"transferPendingMatchColSource": "來源",
|
||||
"transferPendingMatchColDocNo": "單號",
|
||||
"transferPendingMatchColMaterial": "料號",
|
||||
"transferPendingMatchColName": "品名",
|
||||
"transferPendingMatchColDate": "收料日期",
|
||||
"transferPendingMatchColDate": "異動日期",
|
||||
"transferPendingMatchColQuantity": "數量",
|
||||
"reparseButton": "清空重解析",
|
||||
"reparseTitle": "清空並重新解析",
|
||||
"reparseFilesPrefix": "歸檔文件 ",
|
||||
"reparseFilesSuffix": " 份",
|
||||
"reparseProfilePrefix": "使用規則 ",
|
||||
"reparseProfileVersionPrefix": " v",
|
||||
"reparseProfileEmpty": "未綁定解析規則",
|
||||
"reparseRowsClearPrefix": "將清除 ",
|
||||
"reparseRowsClearSuffix": " 行",
|
||||
"reparseRowsKeptPrefix": ";證據缺失保留 ",
|
||||
"reparseRowsKeptSuffix": " 行",
|
||||
"reparseSuccessPrefix": "已清除 ",
|
||||
"reparseSuccessReinsertPrefix": " 行,重落 ",
|
||||
"reparseSuccessSuffix": " 行",
|
||||
"reparseFailedPrefix": "重解析中止,未刪除任何資料:",
|
||||
"executableTitle": "可調撥明細",
|
||||
"executableEmpty": "暫無可調撥明細",
|
||||
"executableSelectedCount": "已選 {count} 筆可執行明細",
|
||||
|
||||
@@ -575,11 +575,10 @@
|
||||
"VOUCHER_CHECK_OA_SALES_RELEASE_INVALID": "銷貨放行單資料無效:請提供合法的發票號和銷貨單號。",
|
||||
"VOUCHER_CHECK_OA_SALES_RELEASE_PARTIAL": "銷貨放行單拉取部分失敗。",
|
||||
"TRANSFER_PERMISSION_DENIED": "無在途調撥權限。",
|
||||
"TRANSFER_RECEIPT_NOT_MATURED": "當天收料尚未成熟,不可查詢或調撥。",
|
||||
"TRANSFER_FILE_NOT_READY": "收料檔案尚未就緒。",
|
||||
"TRANSFER_FILE_SCHEMA_INVALID": "收料檔案結構或欄位驗證失敗。",
|
||||
"TRANSFER_FILE_NOT_READY": "入站檔案尚未就緒。",
|
||||
"TRANSFER_FILE_SCHEMA_INVALID": "入站檔案結構或欄位驗證失敗。",
|
||||
"TRANSFER_INVOICE_CONFLICT": "同一 Invoice 存在衝突(多料號或多日期)。",
|
||||
"TRANSFER_QUANTITY_MISMATCH": "收料數量與 ERP 庫存不相等,已阻斷。",
|
||||
"TRANSFER_QUANTITY_MISMATCH": "異動數量與 ERP 庫存不相等,已阻斷。",
|
||||
"TRANSFER_ERP_INVENTORY_NOT_FOUND": "ERP 未找到該 Invoice 庫存。",
|
||||
"TRANSFER_MATCH_EXPIRED": "匹配已過期或快照變更,請重新匹配。",
|
||||
"TRANSFER_CONFIRMATION_REQUIRED": "匹配未就緒,無法執行。",
|
||||
@@ -597,7 +596,7 @@
|
||||
"TRANSFER.BATCH_ITEMS_REQUIRED": "請提供要操作的明細行。",
|
||||
"TRANSFER.EXECUTE_ITEMS_INVALID": "部分明細行不存在或不可執行,請重新整理後再試。",
|
||||
"TRANSFER.ITEMS_STALE": "部分明細行匹配結果已過期,請重新匹配。",
|
||||
"TRANSFER.FILE_CHANGED": "收料檔案已更新,請重新匹配後再執行。",
|
||||
"TRANSFER.FILE_CHANGED": "入站檔案已更新,請重新匹配後再執行。",
|
||||
"TRANSFER.ORG_REQUIRED": "外部組織代碼不能為空。",
|
||||
"TRANSFER.RETRIGGER_NOT_ALLOWED": "僅結果未知(result_unknown)票允許重新觸發;禁止關閉後重建。",
|
||||
"TRANSFER.RETRY_NOT_ALLOWED": "該行已隨檔案移除,無法重查;請標記無需繼續處理或等待檔案重新同步。",
|
||||
|
||||
Reference in new issue
Block a user