优化验证逻辑

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() {
Toast('开发中')
let flag = true;
flag = this.$refs.districtSelectorRef.validate();
if(flag) flag = this.$refs.residentsRef.validate();
if(flag) flag = this.$refs.breedingRef.validate();
if(flag) this.$refs.archives.validate().then(async (e) => {
if (e) {
let flag1 = this.$refs.districtSelectorRef.validate();
let flag2 = this.$refs.residentsRef.validate();
let flag3 = this.$refs.breedingRef.validate();
this.$refs.archives.validate().then(async (e) => {
if (e&&flag1&&flag2&&flag3) {
uni.showLoading()
let districtForm = {
area_id:this.$refs.districtSelectorRef.formData.area,