调整收付款问题

This commit is contained in:
2026-09-01 11:52:22 +08:00
parent a9b4ab069b
commit f858eb2bcd
4 changed files with 97 additions and 50 deletions
@@ -1091,6 +1091,13 @@ export default {
}
}
},
validateAvailableInvoiceAmount() {
const availableAmountCents = Math.round(Number(this.availableInvoiceAmount || 0) * 100);
const invoiceAmountCents = Math.round(Number(this.invoiceAmount || 0) * 100);
if (invoiceAmountCents > availableAmountCents) {
throw new Error('本次开票金额不能超过可开票金额');
}
},
payload() {
return {
id: this.form.id,
@@ -1136,6 +1143,12 @@ export default {
return true;
},
async submitForm() {
try {
this.validateAvailableInvoiceAmount();
} catch (error) {
this.$message.warning(error.message);
return;
}
const saved = await this.saveDraft();
if (!saved) return;
await api.submit({ id: this.form.id });