fix(pl): 证书齐备待完善归档不再误出齐备按钮。
归档结转无用量行时保留待完善错误文案,前端按计划齐备状态只提醒完善证件。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
95ecb7236e
commit
02d576abfe
7 files changed
+146
-9
No files matched your search
@@ -624,6 +624,13 @@ export interface Plan {
|
||||
hazardCertReady?: number
|
||||
hazardCertReadyBy?: string
|
||||
hazardCertReadyTime?: string
|
||||
/** 证书齐备:新规则仅放行安排 */
|
||||
quotaCertWaived?: number
|
||||
quotaCertWaivedBy?: string
|
||||
quotaCertWaivedByName?: string
|
||||
quotaCertWaivedTime?: string
|
||||
/** 新规则证书齐备待完善 */
|
||||
quotaCertPendingFulfill?: number
|
||||
erpEntered?: number
|
||||
remark?: string
|
||||
createBy?: string
|
||||
|
||||
@@ -299,6 +299,7 @@
|
||||
extractArchiveLineOverageDetail,
|
||||
showArchiveLineOverageConfirm
|
||||
} from '@/utils/pl-contract-qty-reminder'
|
||||
import { resolveArchiveQuotaBlockMode } from '@/utils/pl-archive-quota-block'
|
||||
|
||||
const props = defineProps<{
|
||||
visible: boolean
|
||||
@@ -1602,12 +1603,12 @@
|
||||
|
||||
async function showArchiveQuotaBlockDialog(message: string, title = '不能归档') {
|
||||
const html = `<p class="pl-arrange-block-text">${escapeArchiveBlockText(message)}</p>`
|
||||
const pendingFulfill =
|
||||
message.includes('待完善') || message.includes('完善并关闭') || message.includes('证书齐备待完善')
|
||||
if (title !== '用证没有完成' || pendingFulfill) {
|
||||
const guide = pendingFulfill
|
||||
? `${html}<p class="pl-arrange-block-text">新规则下证书齐备只放行安排,不能绕过归档挂证。请到「证书齐备 → 已标记待完善证书」上传证件并执行完善并关闭后再归档。</p>`
|
||||
: html
|
||||
const mode = resolveArchiveQuotaBlockMode(message, title, plan.value)
|
||||
if (mode !== 'confirm-ready') {
|
||||
const guide =
|
||||
mode === 'alert-pending'
|
||||
? `${html}<p class="pl-arrange-block-text">该运输计划已走证书齐备,归档前须完善证件。请到「证书齐备 → 已标记待完善证书」上传购买证/运输证并执行完善并关闭后再归档。</p>`
|
||||
: html
|
||||
await ElMessageBox.alert(guide, title, {
|
||||
type: 'warning',
|
||||
confirmButtonText: '知道了',
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
/** 归档用证拦截弹窗:已齐备/待完善只提醒,未齐备旧规则才可再点证书齐备。 */
|
||||
|
||||
export type ArchiveQuotaBlockMode = 'alert-pending' | 'alert-plain' | 'confirm-ready'
|
||||
|
||||
export type ArchiveQuotaBlockPlanFlags = {
|
||||
quotaCertPendingFulfill?: number | boolean | null
|
||||
quotaCertWaived?: number | boolean | null
|
||||
}
|
||||
|
||||
function flagOn(value: number | boolean | null | undefined) {
|
||||
return value === true || Number(value || 0) === 1
|
||||
}
|
||||
|
||||
export function resolveArchiveQuotaBlockMode(
|
||||
message: string,
|
||||
title: string,
|
||||
plan?: ArchiveQuotaBlockPlanFlags | null
|
||||
): ArchiveQuotaBlockMode {
|
||||
const pendingByMessage =
|
||||
message.includes('待完善') ||
|
||||
message.includes('完善并关闭') ||
|
||||
message.includes('证书齐备待完善')
|
||||
const pendingByPlan = flagOn(plan?.quotaCertPendingFulfill) || flagOn(plan?.quotaCertWaived)
|
||||
if (title !== '用证没有完成') return 'alert-plain'
|
||||
if (pendingByPlan || pendingByMessage) return 'alert-pending'
|
||||
return 'confirm-ready'
|
||||
}
|
||||
Reference in new issue
Block a user