fix(web-admin): allow reimburse submit with insufficient invoice balance

Replace blocking tip with a soft warning and remove client-side submit guards.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
zlwuandCursor committed 2026-08-12 20:59:13 +08:00
1 parent 99e4d4c69a
commit b53c1c4851
1 file changed
+1 -24
@@ -345,7 +345,7 @@
当前发票余额:<b>{{ formatMoneyYuan(walletBalance) }}</b>
;本次合计:<b>{{ formatMoneyYuan(detailTotalAmount) }}</b>
<span v-if="Number(walletBalance) < Number(detailTotalAmount)" class="invoice-balance-warn">
(余额不足,提交时将被拦截)
(余额不足,提交后余额将为负,请后续补发票)
</span>
</p>
<div class="invoice-select-toolbar">
@@ -1136,22 +1136,6 @@ async function handleToolbarSubmit() {
ElMessage.warning(`已跳过 ${skippedCount} 条不可提交的报销单(仅草稿或已驳回可提交),将继续提交其余 ${validTargets.length} 条`)
}
// 按申请人分别校验发票余额(代申请时用申请人额度)
const needByApplicant = new Map<string, number>()
for (const row of validTargets) {
const aid = String(row.applicantId || currentUserId())
needByApplicant.set(aid, (needByApplicant.get(aid) || 0) + Number(row.amount || 0))
}
for (const [aid, need] of needByApplicant) {
await refreshWalletBalance(aid)
if (Number(walletBalance.value) < need) {
ElMessage.warning(
`发票额度不足(余额 ${formatMoneyYuan(walletBalance.value)},本次 ${formatMoneyYuan(need)})`
)
return
}
}
loadingMap.submit = true
try {
const results = await Promise.allSettled(validTargets.map((row) => reimburseApi.submit(row.id)))
@@ -1309,13 +1293,6 @@ async function openFlowDialog(row?: any) {
}
async function handleSubmit(row: any) {
await refreshWalletBalance(String(row.applicantId || currentUserId()))
if (Number(walletBalance.value) < Number(row.amount || 0)) {
ElMessage.warning(
`发票额度不足(余额 ${formatMoneyYuan(walletBalance.value)},本次 ${formatMoneyYuan(row.amount)})`
)
return
}
loadingMap[`submit_${row.id}`] = true
try {
await reimburseApi.submit(row.id)