🐛 修复导入运单明细重载后实际/预计时间列为空

明细接口返回运单实体字段 startDate/endDate/estimatedStartTime/estimatedEndTime,
明细表与编辑回填按导入列字段名 actualStartDate 等读取,重载后统一在 normalizeDetailRow 对齐。
This commit is contained in:
2026-10-16 12:10:47 +08:00
parent 6b0cb37699
commit b2a6d73bac
@@ -1348,11 +1348,23 @@ const formatOptionalNumber = value => {
const normalized = normalizeOptionalImportNumber(value);
return normalized === null || normalized === undefined ? '' : normalized;
};
// 明细接口返回运单实体字段 startDate/endDate/estimatedStartTime/estimatedEndTime,
// 而明细表与编辑回填按导入列字段名 actualStartDate 等读取,重载后在此对齐,否则实际/预计时间列为空。
const detailDateAliases = {
actualStartDate: 'startDate',
actualEndDate: 'endDate',
planStartDate: 'estimatedStartTime',
planEndDate: 'estimatedEndTime',
};
const normalizeDetailRow = row => {
const next = { ...(row || {}) };
OPTIONAL_NUMBER_PROPS.forEach(prop => {
next[prop] = formatOptionalNumber(next[prop]);
});
Object.entries(detailDateAliases).forEach(([prop, source]) => {
if (String(next[prop] ?? '').trim()) return;
if (String(next[source] ?? '').trim()) next[prop] = next[source];
});
return next;
};
const normalizeImportRow = row => ({