feat(shipping-notice): 收敛复核阶段同源投影与 OT 后履约推进
统一 Case/Progress 阶段 label_key、修复 Job 成功未推进 OT 的可重试失败投影与写路径,并落地 OT 后行级匹配/波次履约与版面诊断开关。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
74270adc22
commit
fd6a23f870
100 files changed
+12138
-1017
No files matched your search
@@ -357,6 +357,8 @@ export function useShippingOrderReview() {
|
||||
const loadFailed = ref(false);
|
||||
const saving = ref(false);
|
||||
const saveFailed = ref(false);
|
||||
/** 显式校验期间清空旧资格投影,避免短暂显示过期的“不可建单”。 */
|
||||
const validationInProgress = ref(false);
|
||||
/** ???????????????????????????? */
|
||||
const draftConflict = ref<DraftVersionConflict | null>(null);
|
||||
const versionsLoading = ref(false);
|
||||
@@ -730,11 +732,15 @@ export function useShippingOrderReview() {
|
||||
|
||||
/** ?? Case ???????????validate ???? */
|
||||
const buildEligibility = computed(
|
||||
() => activeCase.value?.draft?.build_eligibility ?? null,
|
||||
() => validationInProgress.value ? null : (activeCase.value?.draft?.build_eligibility ?? null),
|
||||
);
|
||||
|
||||
/** ?? build_eligibility ? can_build ? false ???????? */
|
||||
const canConfirmBuild = computed(() => !isBuildConfirmBlocked(buildEligibility.value));
|
||||
const canConfirmBuild = computed(() => (
|
||||
!validationInProgress.value
|
||||
&& Boolean(buildEligibility.value)
|
||||
&& !isBuildConfirmBlocked(buildEligibility.value)
|
||||
));
|
||||
|
||||
/** ????????????????? */
|
||||
const manualInventoryLines = computed(() =>
|
||||
@@ -956,7 +962,14 @@ export function useShippingOrderReview() {
|
||||
saveFailed.value = false;
|
||||
const localVersion = version();
|
||||
try {
|
||||
activeCase.value = await action();
|
||||
const nextCase = await action();
|
||||
// [STEP] 只接受当前 Case 且不低于本地 Draft 版本的响应;旧请求不得回写新快照。
|
||||
const currentCaseNo = String(activeCase.value?.case_no || '').trim();
|
||||
const nextCaseNo = String(nextCase?.case_no || '').trim();
|
||||
const nextVersion = Number(nextCase?.draft?.draft_version ?? 0);
|
||||
if (nextCaseNo === currentCaseNo && nextVersion >= localVersion) {
|
||||
activeCase.value = nextCase;
|
||||
}
|
||||
draftConflict.value = null;
|
||||
if (reviewRun.value && activeCase.value) {
|
||||
const item = reviewRun.value.items.find((row) => row.case_no === activeCase.value?.case_no);
|
||||
@@ -1154,7 +1167,15 @@ export function useShippingOrderReview() {
|
||||
const addLine = () => activeCase.value && save(() => addWorkspaceShippingOrderReviewLine(activeCase.value!.case_no, version()));
|
||||
const copyLine = (lineKey: string) => activeCase.value && save(() => copyWorkspaceShippingOrderReviewLine(activeCase.value!.case_no, lineKey, version()));
|
||||
const deleteLine = (lineKey: string) => activeCase.value && save(() => deleteWorkspaceShippingOrderReviewLine(activeCase.value!.case_no, lineKey, version()));
|
||||
const validate = () => activeCase.value && save(() => validateWorkspaceShippingOrderReviewDraft(activeCase.value!.case_no, version()));
|
||||
const validate = async () => {
|
||||
if (!activeCase.value) return;
|
||||
validationInProgress.value = true;
|
||||
try {
|
||||
await save(() => validateWorkspaceShippingOrderReviewDraft(activeCase.value!.case_no, version()));
|
||||
} finally {
|
||||
validationInProgress.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* ????????????????? Case?
|
||||
@@ -1533,6 +1554,7 @@ export function useShippingOrderReview() {
|
||||
caseSwitchLoading,
|
||||
caseSwitchFailed,
|
||||
saving,
|
||||
validationInProgress,
|
||||
saveFailed,
|
||||
versionsLoading,
|
||||
load,
|
||||
|
||||
Reference in new issue
Block a user