变更问题修复
This commit is contained in:
1 parent
6de4422733
commit
9625110f44
62 files changed
+18116
-95
No files matched your search
@@ -100,7 +100,7 @@ const persistedExtensionResultVersions = new Map();
|
||||
let taskCreateInProgress = false;
|
||||
const AUTO_HANDOFF_RETRY_MS = 30_000;
|
||||
|
||||
const REQUIRED_EXTENSION_VERSION = '0.5.180';
|
||||
const REQUIRED_EXTENSION_VERSION = '0.5.182';
|
||||
const MANUAL_HANDOFF_LABEL = '确认并提交到 ERP 插件';
|
||||
const RETRY_HANDOFF_LABEL = '继续提交到 ERP 插件';
|
||||
const RECONCILE_LABEL = '只读回查 ERP 现有结果';
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
import { createHash, randomBytes } from 'node:crypto';
|
||||
import operationPlans from '../chrome-extension/ltjt-order-assistant/operation-plans.js';
|
||||
|
||||
const { isOriginalArrangementDate, isOriginalArrangementRange } = operationPlans;
|
||||
|
||||
const DEFAULT_BASE_URL = 'https://superagent.nianxx.cn';
|
||||
const DEFAULT_TIMEOUT_MS = 120_000;
|
||||
@@ -2136,9 +2139,9 @@ function validateOriginalArrangementUpdate(value, action, errors) {
|
||||
const dateKeys = vehicle ? ['start_date', 'end_date'] : ['date', ...(other ? ['filing_date'] : [])];
|
||||
if (!isPlainObject(selection) || Object.keys(selection).some((key) => !dateKeys.includes(key))) errors.push('安排变更需要原安排日期。');
|
||||
if (vehicle) {
|
||||
if (!isValidDateString(selection?.start_date) || !isValidDateString(selection?.end_date) || selection.end_date < selection.start_date) errors.push('原用车日期范围无效。');
|
||||
} else if (!isValidDateString(selection?.date)) errors.push('原业务日期无效。');
|
||||
if (selection?.filing_date !== undefined && !isValidDateString(selection.filing_date)) errors.push('原备案日期无效。');
|
||||
if (!isOriginalArrangementRange(selection?.start_date, selection?.end_date, true)) errors.push('原用车日期范围无效。');
|
||||
} else if (!isOriginalArrangementDate(selection?.date)) errors.push('原业务日期无效。');
|
||||
if (selection?.filing_date !== undefined && !isOriginalArrangementDate(selection.filing_date)) errors.push('原备案日期无效。');
|
||||
}
|
||||
if (changes.filing !== undefined) {
|
||||
if (!other || !isPlainObject(changes.filing) || !Object.keys(changes.filing).length
|
||||
@@ -2185,8 +2188,7 @@ function validateAgentArrangement(value, action, errors) {
|
||||
if (!isPlainObject(value.selection)) errors.push(`${path}.selection 必须是原酒店安排的日期对象。`);
|
||||
else {
|
||||
pushUnknownKeyError(`${path}.selection`, value.selection, new Set(['start_date', 'end_date']), errors);
|
||||
if (!isValidDateString(value.selection.start_date) || !isValidDateString(value.selection.end_date)
|
||||
|| value.selection.end_date <= value.selection.start_date) errors.push(`${path}.selection 必须包含有效且离店晚于入住的原安排日期。`);
|
||||
if (!isOriginalArrangementRange(value.selection.start_date, value.selection.end_date)) errors.push(`${path}.selection 必须包含有效且离店晚于入住的原安排日期。`);
|
||||
}
|
||||
}
|
||||
if (value.changes.resource !== undefined) {
|
||||
|
||||
Reference in new issue
Block a user