From 0cf5b490ad7c836aae06993e880ec43dc70c2b74 Mon Sep 17 00:00:00 2001 From: shijingjing <1789544664@qq.com> Date: Wed, 18 May 2022 09:57:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=88=90=E5=8A=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mods/work/AppHelpDeclaration/add.vue | 47 ++++++++++++++++++--- src/mods/work/AppHelpDeclaration/result.vue | 2 +- 2 files changed, 41 insertions(+), 8 deletions(-) diff --git a/src/mods/work/AppHelpDeclaration/add.vue b/src/mods/work/AppHelpDeclaration/add.vue index 1af2bfe..b78853c 100644 --- a/src/mods/work/AppHelpDeclaration/add.vue +++ b/src/mods/work/AppHelpDeclaration/add.vue @@ -49,14 +49,14 @@ *申请帮扶原因(最多2项)
- {{ item }} + {{ item.dictName }}
*返贫致贫风险说明
- +
@@ -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 @@