提交
This commit is contained in:
1 parent
7b1d4c8729
commit
ffc89d9b57
75 files changed
+12263
-7950
No files matched your search
@@ -141,14 +141,16 @@ export function isHazardCertReady(plan: { hazardCertReady?: number } | null | un
|
||||
return Number(plan?.hazardCertReady ?? 0) === 1
|
||||
}
|
||||
|
||||
/** 含危化品且尚未人工确认证书齐备时,阻断安排运输 */
|
||||
/** 含危化品且尚未确认证书齐备(人工确认或全部所需证书已上传)时,阻断安排运输 */
|
||||
export function shouldBlockTransportForHazardCert(
|
||||
plan: { hazardCertReady?: number; products?: PlanProduct[] } | null | undefined,
|
||||
products?: PlanProduct[]
|
||||
) {
|
||||
const prods = products ?? plan?.products
|
||||
if (!planHasHazardProducts(prods)) return false
|
||||
return !isHazardCertReady(plan)
|
||||
if (isHazardCertReady(plan)) return false
|
||||
if (!findMissingHazardCerts(prods ?? []).length) return false
|
||||
return true
|
||||
}
|
||||
|
||||
export function buildMissingHazardCertReadyMessage(
|
||||
@@ -156,7 +158,10 @@ export function buildMissingHazardCertReadyMessage(
|
||||
products?: PlanProduct[]
|
||||
) {
|
||||
if (!shouldBlockTransportForHazardCert(plan, products)) return ''
|
||||
return '该计划危化品证书尚未确认齐备'
|
||||
const prods = products ?? plan?.products ?? []
|
||||
const missingCertsMsg = buildMissingHazardCertMessage(prods)
|
||||
if (missingCertsMsg) return missingCertsMsg
|
||||
return '该计划危化品证书尚未确认齐备,请点击「证书齐备」或补全所需证书'
|
||||
}
|
||||
|
||||
function formatMissingCertLabels(product: PlanProduct): string {
|
||||
|
||||
Reference in new issue
Block a user