feat(shipping-notice): 落地 XFA 统一视觉拆分确认门禁与处理投影收敛
闭合拆分预览令牌单次消费、样本 checksum 绑定与确认审计;正式提取改为 bindings-only。 同步统一标注工作台交互,并补齐进度投影/任务中心与迁移文档。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
d2b3d74def
commit
84a881b554
195 files changed
+20269
-3463
No files matched your search
@@ -13,23 +13,15 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import { BusinessError } from '@/shared/api/client';
|
||||
|
||||
import {
|
||||
|
||||
isBuildConfirmBlocked,
|
||||
|
||||
isDraftVersionMismatchError,
|
||||
|
||||
isReviewCaseHistorical,
|
||||
|
||||
isReviewReadOnly,
|
||||
|
||||
isReviewWorkItemClosed,
|
||||
|
||||
lineNeedsManualInventorySelection,
|
||||
|
||||
lineHasPendingRoutingSuggestion,
|
||||
|
||||
lineNeedsInventoryRoutingRecovery,
|
||||
|
||||
mapReviewContextLifecycleStatus,
|
||||
REVIEW_BUILD_ELIGIBILITY_BLOCKED,
|
||||
|
||||
REVIEW_DRAFT_VERSION_MISMATCH,
|
||||
@@ -231,6 +223,14 @@ describe('useShippingOrderReview historical readonly', () => {
|
||||
)).toBe(true);
|
||||
});
|
||||
|
||||
it('maps confirmed case to non-closed lifecycle for post-confirm automation', () => {
|
||||
// 关键断言:confirmed 不得映射 closed,否则统一进度轨道会被误判为终态。
|
||||
expect(mapReviewContextLifecycleStatus('confirmed', null)).toBe('building_order');
|
||||
expect(mapReviewContextLifecycleStatus('confirmed', 'inventory_matching')).toBe('inventory_matching');
|
||||
expect(mapReviewContextLifecycleStatus('closed', null)).toBe('closed');
|
||||
expect(mapReviewContextLifecycleStatus('quality_issue', null)).toBe('closed');
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
@@ -1,16 +1,11 @@
|
||||
/**
|
||||
* features/chat/shipping-review/useShippingOrderReview.ts
|
||||
* ?????????? Run??? PDF Case ?????????ShippingReviewProgressContext??
|
||||
* ???shipping API review / extraction-run?useShippingProcessingWorkItem?Vue ????BusinessError?
|
||||
* ????????? runNo ????????????????? Workflow ????
|
||||
* Case.order_task_no / Candidate ??? OT ?????????? Run ? OT ? Notice ???
|
||||
* ?? REVIEW_DRAFT_VERSION_MISMATCH ???????????????
|
||||
* build_eligibility ???????????????????????reroute / adopt / keep??
|
||||
* ????? ShippingProcessing ???????? OT ??? extraction-run ???
|
||||
* ???? extraction-run ??????????? Review Run/Case?
|
||||
* ???????? Workflow ?????????????????????
|
||||
* ?????????/?/?/evidence_id?????? evidence ??????????????
|
||||
* PDF Blob ?? ensurePreviewLoaded ??????load/selectCase ??????
|
||||
* ????????? composable??Run/Case/PDF ??????????
|
||||
* ???shipping API review/extraction-run?useShippingProcessingWorkItem?Vue ref/computed?BusinessError?
|
||||
* ???? runNo ?? Review Run/Case??? ShippingReviewProgressContext?
|
||||
* ?? OT ?? Case.order_task_no / Candidate ????? ShippingProcessing ???
|
||||
* 409 REVIEW_DRAFT_VERSION_MISMATCH ???????build_eligibility ???? reroute/adopt/keep?
|
||||
* ???? extraction-run?draft_ready ? reload?PDF Blob ? ensurePreviewLoaded ????
|
||||
*/
|
||||
import { computed, getCurrentInstance, onBeforeUnmount, ref } from 'vue';
|
||||
import { BusinessError } from '@/shared/api/client';
|
||||
@@ -69,13 +64,13 @@ export type ReviewStatusMessage =
|
||||
| 'draft_version_conflict'
|
||||
| null;
|
||||
|
||||
/** ???????????????? ConflictError.code ???? */
|
||||
/** ????????? ConflictError.code???????? */
|
||||
export const REVIEW_DRAFT_VERSION_MISMATCH = 'SHIPPING.REVIEW_DRAFT_VERSION_MISMATCH';
|
||||
|
||||
/** ???????? confirm ?????? */
|
||||
/** ?????????? confirm ????? */
|
||||
export const REVIEW_BUILD_ELIGIBILITY_BLOCKED = 'SHIPPING.REVIEW_BUILD_ELIGIBILITY_BLOCKED';
|
||||
|
||||
/** ???????????????????????? */
|
||||
/** ????????????????????????? */
|
||||
const INVENTORY_BLOCK_REASONS = new Set([
|
||||
'require_manual_review',
|
||||
'no_inventory_source_candidates',
|
||||
@@ -84,7 +79,7 @@ const INVENTORY_BLOCK_REASONS = new Set([
|
||||
'inventory_source_unresolved',
|
||||
]);
|
||||
|
||||
/** ???????????????????????????? Case??????? */
|
||||
/** ????????????/??????????? Case ??? */
|
||||
export type DraftVersionConflict = {
|
||||
localVersion: number;
|
||||
serverVersion: number | null;
|
||||
@@ -93,7 +88,7 @@ export type DraftVersionConflict = {
|
||||
};
|
||||
|
||||
/**
|
||||
* ??????????????????
|
||||
* ??????????????409 REVIEW_DRAFT_VERSION_MISMATCH??
|
||||
* @param error - ???????
|
||||
*/
|
||||
export function isDraftVersionMismatchError(error: unknown): boolean {
|
||||
@@ -143,7 +138,7 @@ type WorkItemRef = {
|
||||
} | null | undefined;
|
||||
|
||||
/**
|
||||
* ???? Case ?????/????????????
|
||||
* ???? Case ????????superseded ?? WorkItem ?? Case ?????
|
||||
*/
|
||||
export function isReviewCaseHistorical(activeCase: ReviewCaseRef, workItem: WorkItemRef): boolean {
|
||||
const caseNo = String(activeCase?.case_no || '');
|
||||
@@ -154,8 +149,8 @@ export function isReviewCaseHistorical(activeCase: ReviewCaseRef, workItem: Work
|
||||
}
|
||||
|
||||
/**
|
||||
* ???????????????/??????
|
||||
* ?????manual_upload_pending / upload_rpa_* ???????????????
|
||||
* ?? WorkItem ??????? closed/cancelled??
|
||||
* ?????confirmed / building_order ???? lifecycle ???????
|
||||
*/
|
||||
export function isReviewWorkItemClosed(workItem: WorkItemRef): boolean {
|
||||
const status = String(workItem?.lifecycle_status || '').trim();
|
||||
@@ -163,7 +158,7 @@ export function isReviewWorkItemClosed(workItem: WorkItemRef): boolean {
|
||||
}
|
||||
|
||||
/**
|
||||
* ???????????????????????
|
||||
* ?????????? Case ? WorkItem ????
|
||||
*/
|
||||
export function isReviewReadOnly(activeCase: ReviewCaseRef, workItem: WorkItemRef): boolean {
|
||||
return isReviewCaseHistorical(activeCase, workItem) || isReviewWorkItemClosed(workItem);
|
||||
@@ -214,14 +209,16 @@ export function lineNeedsInventoryRoutingRecovery(
|
||||
}
|
||||
|
||||
/**
|
||||
* ? Case / Extraction Run ??????? WorkflowItem ? lifecycle_status?
|
||||
* ?????draft/ready ? pending_review?non_order ? cancelled???? Run ??????? lifecycle?
|
||||
* ? Case / Extraction Run ????? WorkflowItem lifecycle_status?
|
||||
* ?????draft/ready ? pending_review?non_order ? cancelled?
|
||||
* confirmed ???? closed?????? building_order ???
|
||||
* ??? closed / quality_issue ? closed?Extraction Run ????? Case ????
|
||||
*
|
||||
* @param caseStatus - Review Case ??
|
||||
* @param runStatus - Extraction Run ??????
|
||||
* @returns ?? WorkflowItem ?????????
|
||||
* @returns ??????? lifecycle ???
|
||||
*/
|
||||
function mapReviewContextLifecycleStatus(
|
||||
export function mapReviewContextLifecycleStatus(
|
||||
caseStatus?: string | null,
|
||||
runStatus?: string | null,
|
||||
): ShippingWorkflowItemLifecycleStatus {
|
||||
@@ -230,7 +227,13 @@ function mapReviewContextLifecycleStatus(
|
||||
|
||||
if (cs === 'non_order') return 'cancelled';
|
||||
if (cs === 'quality_issue') return 'closed';
|
||||
if (['confirmed', 'closed'].includes(cs)) return 'closed';
|
||||
if (cs === 'closed') return 'closed';
|
||||
// [UI-05] confirmed ? closed????????????????????
|
||||
if (cs === 'confirmed') {
|
||||
if (['building_order', 'inventory_matching', 'generating_excel'].includes(rs)) return rs;
|
||||
if (['manual_upload_pending', 'upload_rpa_pending', 'upload_rpa_running'].includes(rs)) return rs;
|
||||
return 'building_order';
|
||||
}
|
||||
if (cs === 'reparse_pending') return 'extracting';
|
||||
if (['failed', 'cancelled'].includes(rs)) return rs;
|
||||
if (rs === 'reparse_failed') return 'reparse_failed';
|
||||
|
||||
Reference in new issue
Block a user