🐛 修复运输对账匹配日期格式与完成对账疑似重复误判
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1278,10 +1278,13 @@ export default {
|
||||
delete snapshot._externalKey;
|
||||
delete snapshot.feeItems;
|
||||
snapshot.feeItemsJson = row.feeItemsJson || JSON.stringify(row.feeItems || {});
|
||||
snapshot.actualDepartureTime = this.normalizeExternalDateTime(row.actualDepartureTime);
|
||||
snapshot.actualCompletionTime = this.normalizeExternalDateTime(row.actualCompletionTime);
|
||||
return snapshot;
|
||||
});
|
||||
},
|
||||
serializeExternalRows() {
|
||||
const duplicateIds = new Set(this.duplicateRows.map(row => String(row.id)));
|
||||
return this.externalDetails.map(row => {
|
||||
const snapshot = { ...row };
|
||||
delete snapshot._sourceRows;
|
||||
@@ -1290,6 +1293,7 @@ export default {
|
||||
snapshot.feeItemsJson = row.feeItemsJson || JSON.stringify(row.feeItems || {});
|
||||
snapshot.actualDepartureTime = this.normalizeExternalDateTime(row.actualDepartureTime);
|
||||
snapshot.actualCompletionTime = this.normalizeExternalDateTime(row.actualCompletionTime);
|
||||
snapshot.suspectedDuplicate = duplicateIds.has(String(row.id));
|
||||
return snapshot;
|
||||
});
|
||||
},
|
||||
@@ -1336,6 +1340,11 @@ export default {
|
||||
}
|
||||
},
|
||||
async handleComplete() {
|
||||
const unmatchedInternal = this.internalDetails.filter(item => item.matchResult !== 'matched').length;
|
||||
const unmatchedExternal = this.externalDetails.filter(item => item.matchStatus !== 'matched').length;
|
||||
if (this.duplicateRows.length || unmatchedInternal || unmatchedExternal) {
|
||||
return this.$message.warning('所有内外部账单明细必须一一匹配且不存在疑似重复');
|
||||
}
|
||||
if (
|
||||
Number(this.form.differenceCount || 0) !== 0 ||
|
||||
Number(this.form.differenceQuantity || 0) !== 0 ||
|
||||
@@ -1694,8 +1703,11 @@ export default {
|
||||
},
|
||||
normalizeExternalDateTime(value) {
|
||||
if (!value) return null;
|
||||
const text = String(value);
|
||||
return text.length === 10 ? `${text}T00:00:00` : text;
|
||||
const text = String(value).trim();
|
||||
if (!text) return null;
|
||||
const date = this.$dayjs(text);
|
||||
if (date.isValid()) return date.format('YYYY-MM-DD HH:mm:ss');
|
||||
return text.length === 10 ? `${text} 00:00:00` : text.replace('T', ' ');
|
||||
},
|
||||
refreshLocalStats() {
|
||||
const internalQuantity = this.internalDetails.reduce(
|
||||
|
||||
Reference in New Issue
Block a user