@@ -91,16 +91,28 @@ export default {
areaId: '',
areaName: '',
address: '',
+ declareReason: [],
reason: '',
+ riskDescription: '',
files: []
},
+ list: [],
flag: false,
- list: ['张是','订单','电动蝶阀','斤斤计较','坎坎坷坷']
+ checkList: [],
}
},
onLoad() {
- this.$dict.load('')
- this.areaId = this.user.areaId
+ this.$dict.load('helpDeclarationReason').then(()=>{
+ this.list = this.$dict.getDict('helpDeclarationReason').map((item)=>{
+ return {
+ dictName: item.dictName,
+ dictValue: item.dictValue,
+ checked: false
+ }
+ })
+ })
+
+ this.form.areaId = this.user.areaId
},
computed: {
...mapState(['user'])
@@ -108,9 +120,13 @@ export default {
methods: {
helpCheck(e) {
e.checked = !e.checked
+ this.checkList = this.list.filter(e=>e.checked)
+ this.form.declareReason = this.checkList.map(v=> v.dictValue).toString()
+ this.form.reason = this.checkList.map(o=>o.dictName).toString()
},
comfirm() {
if(this.flag) return
+
if(!this.form.name) {
return this.$u.toast('请输入姓名')
}
@@ -129,10 +145,24 @@ export default {
if(!this.form.address) {
return this.$u.toast('请输入详细地址')
}
+ if(!this.form.declareReason) {
+ return this.$u.toast('请选择帮扶原因')
+ }
+ if(this.form.declareReason) {
+ if(this.checkList.length > 2) {
+ return this.$u.toast('帮扶原因最多选2项')
+ }
+ }
+ if(!this.form.riskDescription) {
+ return this.$u.toast('请输入帮扶原因说明')
+ }
this.flag = true
- this.$instance.post('/app/apphelpdeclarationinfo/addByApplet').then((res) => {
- console.log(res);
+
+ this.$instance.post('/app/apphelpdeclarationinfo/addByApplet',{...this.form}).then((res) => {
+ if(res.code ==0) {
+ uni.navigateTo({url: './result'})
+ }
})
}
},
@@ -214,6 +244,9 @@ export default {
span:nth-child(3n) {
margin-right: 0;
}
+ .isCheck {
+ color: #4181FF;
+ }
}
}
}
diff --git a/src/mods/work/AppHelpDeclaration/result.vue b/src/mods/work/AppHelpDeclaration/result.vue
index a3447c7..38d9296 100644
--- a/src/mods/work/AppHelpDeclaration/result.vue
+++ b/src/mods/work/AppHelpDeclaration/result.vue
@@ -1,7 +1,7 @@
-
+
申请成功!
查看我的申报