This commit is contained in:
2026-10-22 11:56:47 +08:00
parent 5d71af1ac9
commit de96e47d74
71 changed files with 1296 additions and 332 deletions
@@ -79,6 +79,13 @@ export function truckAppointmentPayload(context, suffix, identity, version = 0,
}
async function activeSupplier(context, category, suffix) {
if (context.options?.fixedCustomerId) {
const { loadSupplier } = await import('./finance-full-fixtures.mjs')
const supplier = await loadSupplier(context, category, category === 'BOOKING'
? { carrierCode: 'MATSON' } : { truckingScope: 'DOMESTIC' })
if (!supplier) throw new Error(`缺少现有 ${category} 供应商,禁止自动创建`)
return { supplierId: id(supplier.id), supplierName: supplier.name }
}
const carrierFilter = category === 'BOOKING' ? '&carrierCode=MATSON' : category === 'TRUCKING' ? '&truckingScope=DOMESTIC' : ''
const list = await request(context, 'GET', `/api/platform/v1/suppliers?tenantId=0&category=${category}&status=ACTIVE${carrierFilter}&page=1&size=100`)
const existing = records(data(list)).find((item) => item?.category === category && item?.status === 'ACTIVE'