🐛 修复运输对账匹配日期格式与完成对账疑似重复误判

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-10-17 08:31:27 +08:00
parent 96b675b3be
commit acfbb4c54e
@@ -1278,10 +1278,13 @@ export default {
delete snapshot._externalKey; delete snapshot._externalKey;
delete snapshot.feeItems; delete snapshot.feeItems;
snapshot.feeItemsJson = row.feeItemsJson || JSON.stringify(row.feeItems || {}); snapshot.feeItemsJson = row.feeItemsJson || JSON.stringify(row.feeItems || {});
snapshot.actualDepartureTime = this.normalizeExternalDateTime(row.actualDepartureTime);
snapshot.actualCompletionTime = this.normalizeExternalDateTime(row.actualCompletionTime);
return snapshot; return snapshot;
}); });
}, },
serializeExternalRows() { serializeExternalRows() {
const duplicateIds = new Set(this.duplicateRows.map(row => String(row.id)));
return this.externalDetails.map(row => { return this.externalDetails.map(row => {
const snapshot = { ...row }; const snapshot = { ...row };
delete snapshot._sourceRows; delete snapshot._sourceRows;
@@ -1290,6 +1293,7 @@ export default {
snapshot.feeItemsJson = row.feeItemsJson || JSON.stringify(row.feeItems || {}); snapshot.feeItemsJson = row.feeItemsJson || JSON.stringify(row.feeItems || {});
snapshot.actualDepartureTime = this.normalizeExternalDateTime(row.actualDepartureTime); snapshot.actualDepartureTime = this.normalizeExternalDateTime(row.actualDepartureTime);
snapshot.actualCompletionTime = this.normalizeExternalDateTime(row.actualCompletionTime); snapshot.actualCompletionTime = this.normalizeExternalDateTime(row.actualCompletionTime);
snapshot.suspectedDuplicate = duplicateIds.has(String(row.id));
return snapshot; return snapshot;
}); });
}, },
@@ -1336,6 +1340,11 @@ export default {
} }
}, },
async handleComplete() { 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 ( if (
Number(this.form.differenceCount || 0) !== 0 || Number(this.form.differenceCount || 0) !== 0 ||
Number(this.form.differenceQuantity || 0) !== 0 || Number(this.form.differenceQuantity || 0) !== 0 ||
@@ -1694,8 +1703,11 @@ export default {
}, },
normalizeExternalDateTime(value) { normalizeExternalDateTime(value) {
if (!value) return null; if (!value) return null;
const text = String(value); const text = String(value).trim();
return text.length === 10 ? `${text}T00:00:00` : text; 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() { refreshLocalStats() {
const internalQuantity = this.internalDetails.reduce( const internalQuantity = this.internalDetails.reduce(