diff --git a/components/newArchives/residents.vue b/components/newArchives/residents.vue index 503d463..9d4795c 100644 --- a/components/newArchives/residents.vue +++ b/components/newArchives/residents.vue @@ -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; } diff --git a/subpkg/newArchives/newArchives.vue b/subpkg/newArchives/newArchives.vue index b71144e..61b6800 100644 --- a/subpkg/newArchives/newArchives.vue +++ b/subpkg/newArchives/newArchives.vue @@ -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('请填写完整信息')