优化验证逻辑

This commit is contained in:
weipengfei 2023-07-29 14:20:52 +08:00
parent 4f60150d48
commit ba20f9b800

View File

@ -149,12 +149,11 @@
// //
async addArchives() { async addArchives() {
Toast('开发中') Toast('开发中')
let flag = true; let flag1 = this.$refs.districtSelectorRef.validate();
flag = this.$refs.districtSelectorRef.validate(); let flag2 = this.$refs.residentsRef.validate();
if(flag) flag = this.$refs.residentsRef.validate(); let flag3 = this.$refs.breedingRef.validate();
if(flag) flag = this.$refs.breedingRef.validate(); this.$refs.archives.validate().then(async (e) => {
if(flag) this.$refs.archives.validate().then(async (e) => { if (e&&flag1&&flag2&&flag3) {
if (e) {
uni.showLoading() uni.showLoading()
let districtForm = { let districtForm = {
area_id:this.$refs.districtSelectorRef.formData.area, area_id:this.$refs.districtSelectorRef.formData.area,