fix(pl): 新规则安排不再被本地合同绑证缺口误拦。
H5 运输计划验收发现 customer_category 在服务端自动选证已通过时,前端仍用合同绑证空缺拦截安排;同步用证面板从占用回填证号并补专项单测。
This commit is contained in:
1 parent
c5ae2d957c
commit
d5f3a79ea5
5 files changed
+157
-5
No files matched your search
@@ -757,13 +757,33 @@
|
||||
return !label || label === '—' ? '' : label
|
||||
}
|
||||
function boundCerts(row: QuotaSourceOption) {
|
||||
return (
|
||||
const fromStop =
|
||||
plan.value?.stopProducts?.find(
|
||||
(item) =>
|
||||
item.sourceStopType === row.sourceStopType &&
|
||||
item.sourceStopProductId === row.sourceStopProductId
|
||||
)?.certificates || []
|
||||
)
|
||||
if (fromStop.length) return fromStop
|
||||
const sourceId = `${row.sourceStopType}:${row.sourceStopProductId}`
|
||||
const fromUsage: { certType: CertType; certId: string; certNo: string; quantityUnit: string }[] =
|
||||
[]
|
||||
for (const usage of plan.value?.usages || []) {
|
||||
const kind = String(usage.certType || '') as CertType
|
||||
if (kind !== 'purchase' && kind !== 'transport') continue
|
||||
const items = Array.isArray(usage.items) ? usage.items : []
|
||||
const hit = items.some((item: Record<string, unknown>) => {
|
||||
const typed = `${String(item.sourceStopType || '')}:${String(item.sourceStopProductId || '')}`
|
||||
return String(item.sourceId || '') === sourceId || typed === sourceId
|
||||
})
|
||||
if (!hit) continue
|
||||
fromUsage.push({
|
||||
certType: kind,
|
||||
certId: String(usage.certId || ''),
|
||||
certNo: String(usage.certNoSnapshot || ''),
|
||||
quantityUnit: String(usage.quantityUnit || '')
|
||||
})
|
||||
}
|
||||
return fromUsage
|
||||
}
|
||||
function certsOf(row: QuotaSourceOption, kind: CertType) {
|
||||
return boundCerts(row).filter((cert) => cert.certType === kind)
|
||||
|
||||
Reference in new issue
Block a user