家庭收支

This commit is contained in:
shijingjing
2022-04-29 09:57:50 +08:00
parent 543f31d60c
commit 26c37b0c03
5 changed files with 84 additions and 40 deletions

View File

@@ -19,7 +19,7 @@
<span>脱贫年度</span>
</div>
<div class="right">
<AiSelect dict="fpYera" v-model="form.povertyYear"></AiSelect>
<AiSelect dict="fpYear" v-model="form.povertyYear"></AiSelect>
</div>
</div>
</div>
@@ -88,7 +88,7 @@
</div>
</div>
<div class="btn">保存</div>
<div class="btn" @click="submit">保存</div>
</div>
</template>
@@ -102,21 +102,60 @@ export default {
povertyYear: '',
riskType: '',
naturalDisasterType: '',
militaryMartyrs: '',
dropOutOfSchool: '',
militaryMartyrs: '02',
dropOutOfSchool: '02',
dropOutOfSchoolReason: '',
},
value: '',
}
},
onLoad() {
this.$dict.load('fpYera','fpType','fpRiskType','fpNaturalDisaster')
onLoad(query) {
this.$dict.load('fpYear','fpType','fpRiskType','fpNaturalDisaster').then(()=>{
this.getInfo(query.id)
})
this.id = query.id
this.girdId = query.girdId
this.girdName = query.girdName
},
onShow() {
document.title = '家庭风险情况'
},
methods: {
getInfo(id) {
this.$http.post(`/app/apppreventionreturntopoverty/queryDetailById?id=${id}`).then(res => {
if (res.code === 0) {
this.form = {
...this.form,
...res.data
}
}
uni.hideLoading()
})
},
submit() {
if (!this.form.objectType) {
return this.$u.toast('请选择监测对象类型')
}
if (!this.form.riskType) {
return this.$u.toast('请选择风险因素')
}
this.form.girdId = this.girdId
this.form.girdName = this.girdName
this.$http.post('/app/apppreventionreturntopoverty/addByEwechat', {
...this.form,
id: this.id
}).then(res => {
if (res.code === 0) {
this.$u.toast('保存成功')
uni.$emit('reload')
uni.navigateBack({
delta: 1
})
}
})
},
}
}
</script>