1、调整导入运单

2、调整对账
This commit is contained in:
2026-09-10 22:50:18 +08:00
parent 38e53e01af
commit 1a9cd55d66
17 changed files with 374 additions and 149 deletions
@@ -655,23 +655,10 @@ const extractRecords = res => {
if (Array.isArray(data?.data?.records)) return data.data.records;
return [];
};
// 批次号规则:PC + 导入日期 + 当日批次流水号(4 位),如 PC202606010001
const batchNoPrefix = 'PC';
const batchNoSequenceLength = 4;
// 批次号由后端按 PC + 导入日期 + 当日流水生成,已删除数据也计入流水,避免唯一索引冲突
const generateBatchNo = async () => {
const prefix = `${batchNoPrefix}${dayjs().format('YYYYMMDD')}`;
let maxSequence = 0;
try {
const res = await api.getImportBatches({ current: 1, size: 9999 });
extractRecords(res).forEach(item => {
const no = String(item.batchNo || '').trim();
if (!no.startsWith(prefix)) return;
maxSequence = Math.max(maxSequence, Number(no.slice(prefix.length)) || 0);
});
} catch (error) {
maxSequence = 0;
}
return `${prefix}${String(maxSequence + 1).padStart(batchNoSequenceLength, '0')}`;
const res = await api.getImportBatchNextCode();
return res?.data?.data || '';
};
// 承运商合同的承运商固定取合同乙方,与运单管理(waybill-manage-page)保持一致。
const getCarrierContractPartyName = (contract = {}) =>