修复bug
This commit is contained in:
parent
f1ed72008c
commit
83dd177a42
@ -143,7 +143,7 @@
|
||||
const item = value[i];
|
||||
for (const key in item) {
|
||||
// 检查每个属性值是否为空
|
||||
if (!item[key]) {
|
||||
if (!item[key]&&item[key]!==0) {
|
||||
callback(new Error('以上四项基本信息必填'));
|
||||
return;
|
||||
}
|
||||
|
@ -243,49 +243,46 @@
|
||||
// let flag3 = await this.$refs.breedingRef.validate();
|
||||
// let flag4 = await this.$refs.plantRef.validate();
|
||||
// return console.log(flag1);
|
||||
this.$refs.archives.validate().then(async (e) => {
|
||||
if (e == true && flag2 == true) {
|
||||
uni.showLoading({
|
||||
title: '登记中',
|
||||
mask: true
|
||||
})
|
||||
// let districtForm = {
|
||||
// area_id: this.$refs.districtSelectorRef.formData.area,
|
||||
// street_id: this.$refs.districtSelectorRef.formData.street,
|
||||
// village_id: this.$refs.districtSelectorRef.formData.village,
|
||||
// brigade_id: this.$refs.districtSelectorRef.formData.brigade,
|
||||
// }
|
||||
let res = await informationAdd({
|
||||
...this.formData,
|
||||
// ...districtForm,
|
||||
...this.$refs.residentsRef.residents,
|
||||
datas: [{
|
||||
card_id: 32,
|
||||
datas: {
|
||||
...this.$refs.breedingRef.formData
|
||||
}
|
||||
},
|
||||
{
|
||||
card_id: 7,
|
||||
datas: {
|
||||
...this.$refs.plantRef.formData
|
||||
}
|
||||
},
|
||||
...refsDatas
|
||||
]
|
||||
});
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
icon: "none",
|
||||
title: "添加成功",
|
||||
success: () => {
|
||||
setTimeout(() => {
|
||||
uni.navigateBack()
|
||||
}, 1000)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
await this.$refs.archives.validate();
|
||||
uni.showLoading({
|
||||
title: '登记中',
|
||||
mask: true
|
||||
})
|
||||
// let districtForm = {
|
||||
// area_id: this.$refs.districtSelectorRef.formData.area,
|
||||
// street_id: this.$refs.districtSelectorRef.formData.street,
|
||||
// village_id: this.$refs.districtSelectorRef.formData.village,
|
||||
// brigade_id: this.$refs.districtSelectorRef.formData.brigade,
|
||||
// }
|
||||
let res = await informationAdd({
|
||||
...this.formData,
|
||||
// ...districtForm,
|
||||
...this.$refs.residentsRef.residents,
|
||||
// datas: [{
|
||||
// card_id: 32,
|
||||
// datas: {
|
||||
// ...this.$refs.breedingRef.formData
|
||||
// }
|
||||
// },
|
||||
// {
|
||||
// card_id: 7,
|
||||
// datas: {
|
||||
// ...this.$refs.plantRef.formData
|
||||
// }
|
||||
// },
|
||||
// ...refsDatas
|
||||
// ]
|
||||
});
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
icon: "none",
|
||||
title: "添加成功",
|
||||
success: () => {
|
||||
setTimeout(() => {
|
||||
uni.navigateBack()
|
||||
}, 1000)
|
||||
}
|
||||
})
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
Toast('请填写完整信息')
|
||||
|
Loading…
x
Reference in New Issue
Block a user