/** 运输计划:内置山峡/云栋客户(该侧合同可免) */ export const PL_INTERNAL_CUSTOMER_NAMES = [ '安庆市山峡化工有限公司', '安徽云栋化工有限公司' ] as const /** * 地磅单「可选」车辆主牌:内部客户时默认不勾且允许手动勾选。 * 匹配主牌精确值(不含挂车拼接)。 */ export const PL_DIBANG_OPTIONAL_VEHICLE_PLATES = ['皖H21522'] as const export function isPlInternalCustomerName(name?: string | null): boolean { const n = (name || '').trim() return (PL_INTERNAL_CUSTOMER_NAMES as readonly string[]).includes(n) } export function isPlDibangOptionalVehiclePlate(plate?: string | null): boolean { const p = (plate || '').trim() return (PL_DIBANG_OPTIONAL_VEHICLE_PLATES as readonly string[]).includes(p) } /** 装货或送货段任一段客户为山峡/云栋时,需要现场链接。 */ export function planRequiresSiteLink( plan?: { load?: { customerName?: string | null } | null deliveries?: { customerName?: string | null }[] | null supplierName?: string | null customerName?: string | null destinationName?: string | null } | null ): boolean { if (!plan) return false if (plan.load) { if (isPlInternalCustomerName(plan.load.customerName)) return true } else if (isPlInternalCustomerName(plan.supplierName)) { return true } const deliveries = plan.deliveries || [] if (deliveries.length) { return deliveries.some(item => isPlInternalCustomerName(item.customerName)) } return ( isPlInternalCustomerName(plan.customerName) || isPlInternalCustomerName(plan.destinationName) ) }