调整收付款问题
This commit is contained in:
@@ -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 });
|
||||
|
||||
Reference in New Issue
Block a user