🐛 修复导入运单明细重载后实际/预计时间列为空
明细接口返回运单实体字段 startDate/endDate/estimatedStartTime/estimatedEndTime, 明细表与编辑回填按导入列字段名 actualStartDate 等读取,重载后统一在 normalizeDetailRow 对齐。
This commit is contained in:
@@ -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 => ({
|
||||
|
||||
Reference in New Issue
Block a user