fix: 协议子资源单事务保存,并补齐样本编码/OA/质检等近期能力
锁定缴费校验失败时整单回滚,避免样本半成功落库;前端禁止删除锁定缴费样本,改码走更正编码。同步落地样本更正、采集微信通知、OA提及未读、细胞产品套餐与相关迁移文档。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
19bc66ba45
commit
5dad1bb0e3
142 files changed
+95584
-65717
No files matched your search
@@ -213,6 +213,7 @@
|
||||
:unit-options="unitOptions"
|
||||
:unit-options-loading="unitLoading"
|
||||
:show-price="true"
|
||||
:sample-payments="formData.samplePayments"
|
||||
@price-change="onSamplePriceChange"
|
||||
@search-sample-code="remoteSearchSampleCodes"
|
||||
@search-sample-type="remoteSearchSampleTypes"
|
||||
|
||||
@@ -372,6 +372,7 @@
|
||||
parsePreferentialPrice,
|
||||
resolvePerSamplePaymentDefaults,
|
||||
samplePaymentHasConfirmedTransfer,
|
||||
samplePaymentHasLockedTransfer,
|
||||
schedulePaidArrears,
|
||||
shouldAutoFillLastPeriodDue,
|
||||
shouldReplaceContractWithPreferentialPrice
|
||||
@@ -569,19 +570,13 @@
|
||||
}
|
||||
}
|
||||
|
||||
function paymentHasLockedTransfer(pay: Record<string, any>) {
|
||||
return (pay.schedules || []).some((s: Record<string, any>) =>
|
||||
(s.transfers || []).some((t: Record<string, any>) => t.payStatus === 'yjf')
|
||||
)
|
||||
}
|
||||
|
||||
/** 优惠价变更时同步合同;打开编辑不覆盖库内金额(仅合同为空时补齐) */
|
||||
function applyPreferentialPriceToPayment(
|
||||
pay: Record<string, any>,
|
||||
sample: Record<string, any>,
|
||||
force = false
|
||||
): Record<string, any> {
|
||||
if (paymentHasLockedTransfer(pay)) return pay
|
||||
if (samplePaymentHasLockedTransfer(pay)) return pay
|
||||
const price = parsePreferentialPrice(sample)
|
||||
if (price == null) return pay
|
||||
if (!force && !shouldReplaceContractWithPreferentialPrice(pay.contractAmount, price)) {
|
||||
@@ -1114,6 +1109,26 @@
|
||||
next.push(emptyDjPayment(sample))
|
||||
}
|
||||
}
|
||||
// 锁定缴费不可因样本删改/换码从提交列表中消失(对齐后端「不能省略或删除」)
|
||||
const keptCodes = new Set(next.map((p) => String(p.sampleCode || '')))
|
||||
const keptIds = new Set(
|
||||
next.map((p) => String(p.id || p.samplePaymentId || '')).filter(Boolean)
|
||||
)
|
||||
let restoredLocked = false
|
||||
for (const pay of existing) {
|
||||
if (!samplePaymentHasLockedTransfer(pay)) continue
|
||||
const id = String(pay.id || pay.samplePaymentId || '')
|
||||
const code = String(pay.sampleCode || '')
|
||||
if ((id && keptIds.has(id)) || (code && keptCodes.has(code))) continue
|
||||
next.push(pay)
|
||||
restoredLocked = true
|
||||
}
|
||||
if (restoredLocked) {
|
||||
ElMessage.warning(
|
||||
'存在锁定缴费方案的样本不可删除或改码,请使用客户服务「更正编码」'
|
||||
)
|
||||
}
|
||||
|
||||
lastPreferentialByCode.value = nextPriceMap
|
||||
const same =
|
||||
next.length === existing.length &&
|
||||
|
||||
Reference in new issue
Block a user