修复bug

This commit is contained in:
wpf 2023-08-06 18:15:50 +08:00
parent f1ed72008c
commit 83dd177a42
2 changed files with 41 additions and 44 deletions

View File

@ -143,7 +143,7 @@
const item = value[i]; const item = value[i];
for (const key in item) { for (const key in item) {
// //
if (!item[key]) { if (!item[key]&&item[key]!==0) {
callback(new Error('以上四项基本信息必填')); callback(new Error('以上四项基本信息必填'));
return; return;
} }

View File

@ -243,8 +243,7 @@
// let flag3 = await this.$refs.breedingRef.validate(); // let flag3 = await this.$refs.breedingRef.validate();
// let flag4 = await this.$refs.plantRef.validate(); // let flag4 = await this.$refs.plantRef.validate();
// return console.log(flag1); // return console.log(flag1);
this.$refs.archives.validate().then(async (e) => { await this.$refs.archives.validate();
if (e == true && flag2 == true) {
uni.showLoading({ uni.showLoading({
title: '登记中', title: '登记中',
mask: true mask: true
@ -259,20 +258,20 @@
...this.formData, ...this.formData,
// ...districtForm, // ...districtForm,
...this.$refs.residentsRef.residents, ...this.$refs.residentsRef.residents,
datas: [{ // datas: [{
card_id: 32, // card_id: 32,
datas: { // datas: {
...this.$refs.breedingRef.formData // ...this.$refs.breedingRef.formData
} // }
}, // },
{ // {
card_id: 7, // card_id: 7,
datas: { // datas: {
...this.$refs.plantRef.formData // ...this.$refs.plantRef.formData
} // }
}, // },
...refsDatas // ...refsDatas
] // ]
}); });
uni.hideLoading() uni.hideLoading()
uni.showToast({ uni.showToast({
@ -284,8 +283,6 @@
}, 1000) }, 1000)
} }
}) })
}
})
} catch (e) { } catch (e) {
console.log(e); console.log(e);
Toast('请填写完整信息') Toast('请填写完整信息')