From 6829565222b45d4b65f9a8e8bfff4530bc215227 Mon Sep 17 00:00:00 2001 From: makaba <985019473@qq.com> Date: Mon, 4 Mar 2024 09:54:37 +0800 Subject: [PATCH] =?UTF-8?q?task=20=E5=90=88=E5=90=8C=E4=BF=A1=E6=81=AF=20?= =?UTF-8?q?=E5=80=9F=E6=AC=BE=E8=AE=A1=E5=88=92=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E9=99=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sunVillage_info/informationFunPlan.vue | 50 +++++++++++++++- .../sunVillage_info/informationFunPlanAdd.vue | 59 +++++++++++++++---- 2 files changed, 96 insertions(+), 13 deletions(-) diff --git a/src/views/sunVillage_info/informationFunPlan.vue b/src/views/sunVillage_info/informationFunPlan.vue index 4462f13a..eadcc015 100644 --- a/src/views/sunVillage_info/informationFunPlan.vue +++ b/src/views/sunVillage_info/informationFunPlan.vue @@ -38,6 +38,7 @@ @@ -45,11 +46,17 @@ + +
+ 附件 + +
+
diff --git a/src/views/sunVillage_info/informationFunPlanAdd.vue b/src/views/sunVillage_info/informationFunPlanAdd.vue index 272abb18..6e8faac6 100644 --- a/src/views/sunVillage_info/informationFunPlanAdd.vue +++ b/src/views/sunVillage_info/informationFunPlanAdd.vue @@ -24,12 +24,12 @@ @cancel="showCollectionPay = false"/> - - + + - + @@ -76,6 +76,11 @@ settlementAmount:'', remark:'', }, + errorMessages: { + orderNum: '', + settlementDate: '', + settlementAmount: '', + }, queryParams:{ /* pageNum:1, pageSize:10, @@ -154,15 +159,45 @@ onSubmit(){ - this.form.contractionId = this.contractionId; - addPlan(this.form).then((response) => { - if (response.code == 200){ - this.$notify({ type: 'success', message: '新增成功' }); - setTimeout(function(){ - history.back(-1); - },2000) - } - }); + event.preventDefault(); // 阻止表单默认提交行为 + + // 清除之前的错误消息 + this.errorMessages.orderNum = ''; + this.errorMessages.settlementDate = ''; + this.errorMessages.settlementAmount = ''; + + let isValid = true; + + // 验证结款序号 + if (!this.form.orderNum) { + this.errorMessages.orderNum = '结款序号不能为空'; + isValid = false; + } + + // 验证结款日期 + if (!this.form.settlementDate) { + this.errorMessages.settlementDate = '结款日期不能为空'; + isValid = false; + } + + // 验证结款金额 + if (!this.form.settlementAmount) { + this.errorMessages.settlementAmount = '结款金额不能为空'; + isValid = false; + } + + // 如果验证通过,进行提交处理 + if (isValid) { + this.form.contractionId = this.contractionId; + addPlan(this.form).then((response) => { + if (response.code == 200) { + this.$notify({type: 'success', message: '新增成功'}); + setTimeout(function () { + history.back(-1); + }, 2000) + } + }); + } } }, }