Files
dvcp_v2_wechat_app/src/mods/work/AppHelpDeclaration/add.vue

284 lines
7.4 KiB
Vue
Raw Normal View History

2022-05-13 15:43:25 +08:00
<template>
<div class="add">
<div class="tips">我承认本次申请帮扶情况属实愿接受有关部门依法核实家庭资产信息如存在虚报伪造造成社会资源浪费本人资源承担相关惩戒措施</div>
<div class="user_info">
<div class="item">
<div class="left">
<span>*</span><span>申请人姓名</span>
</div>
2022-05-17 17:43:12 +08:00
<input type="text" class="right__text" v-model="form.name" placeholder="请输入" maxlength="20"/>
2022-05-13 15:43:25 +08:00
</div>
<div class="item">
<div class="left">
<span>*</span><span>申请人身份证号</span>
</div>
2022-05-18 14:12:14 +08:00
<input type="number" class="right__text" v-model="form.idNumber" placeholder="请输入" maxlength="20"/>
2022-05-13 15:43:25 +08:00
</div>
<div class="item">
<div class="left">
<span>*</span><span>联系方式</span>
</div>
2022-05-17 17:43:12 +08:00
<input type="number" class="right__text" v-model="form.phone" placeholder="请输入" maxlength="11"/>
2022-05-13 15:43:25 +08:00
</div>
</div>
<div class="family_info">
<div class="item">
<div class="left">
<span>*</span><span>家庭人口数</span>
</div>
2022-05-20 11:30:04 +08:00
<input type="number" class="right__text" v-model="form.householdNumber" placeholder="请输入" pattern="[0-9]*" maxlength="10"/>
2022-05-13 15:43:25 +08:00
</div>
<div class="item">
<div class="left">
<span>*</span><span>所在地区</span>
</div>
2022-05-20 14:07:01 +08:00
<AiAreaPicker v-model="form.areaId" :areaId="user.areaId" class="right__text" :fullName.sync="form.areaName">
2022-05-18 08:42:21 +08:00
<span :class="form.areaName == '' ? 'color-999' : 'color-333' ">{{ form.areaName || "请选择" }}</span>
2022-05-13 15:43:25 +08:00
<u-icon name="arrow-right" color="#ddd" style="display: inline-block;"/>
</AiAreaPicker>
</div>
<div class="items">
<div class="left">
<span>*</span><span>详细地址</span>
</div>
2022-05-18 16:24:10 +08:00
<input type="text" class="textarea" v-model="form.address" placeholder="请输入详细地址" maxlength="100"/>
2022-05-13 15:43:25 +08:00
</div>
<div class="items">
<div class="left">
<span>*</span><span>申请帮扶原因最多2项</span>
</div>
<div class="tags">
2022-05-18 09:57:05 +08:00
<span v-for="(item,index) in list" :key="index" :class="item.checked? 'isCheck':''" @click="helpCheck(item)">{{ item.dictName }}</span>
2022-05-13 15:43:25 +08:00
</div>
</div>
<div class="items">
<div class="left">
<span>*</span><span>返贫致贫风险说明</span>
</div>
2022-05-20 11:01:38 +08:00
<input type="text" class="text" v-model="form.riskDescription" placeholder="请简要说明返贫致贫风险" maxlength="200"/>
2022-05-13 15:43:25 +08:00
</div>
<div class="items">
<div class="left">
2022-05-18 08:42:21 +08:00
<span style="margin-right: 8px"></span><span>上传佐证材料最多9张</span>
2022-05-13 15:43:25 +08:00
</div>
<div style="margin-top: 10px;">
2022-05-18 08:42:21 +08:00
<AiUploader v-model="form.files" :limit="9" multiple></AiUploader>
2022-05-13 15:43:25 +08:00
</div>
</div>
</div>
2022-05-13 17:20:38 +08:00
<div style="height: 60px;"></div>
<div class="btn">
2022-05-18 08:42:21 +08:00
<div @click="comfirm">提交</div>
2022-05-13 17:20:38 +08:00
</div>
2022-05-13 15:43:25 +08:00
</div>
</template>
<script>
2022-05-20 14:07:01 +08:00
import {mapState} from 'vuex'
2022-05-13 15:43:25 +08:00
export default {
name: "add",
appName: "自主申报",
data() {
return {
2022-05-17 17:43:12 +08:00
form: {
name: '',
idNumber: '',
phone: '',
2022-05-18 08:42:21 +08:00
householdNumber: '',
areaId: '',
areaName: '',
address: '',
2022-05-18 09:57:05 +08:00
declareReason: [],
2022-05-18 08:42:21 +08:00
reason: '',
2022-05-18 09:57:05 +08:00
riskDescription: '',
2022-05-18 08:42:21 +08:00
files: []
2022-05-17 17:43:12 +08:00
},
2022-05-18 09:57:05 +08:00
list: [],
2022-05-18 08:42:21 +08:00
flag: false,
2022-05-18 09:57:05 +08:00
checkList: [],
2022-05-13 15:43:25 +08:00
}
},
onLoad() {
2022-05-18 09:57:05 +08:00
this.$dict.load('helpDeclarationReason').then(()=>{
this.list = this.$dict.getDict('helpDeclarationReason').map((item)=>{
return {
dictName: item.dictName,
dictValue: item.dictValue,
checked: false
}
})
})
2022-05-18 14:12:14 +08:00
// this.form.areaId = this.user.areaId
2022-05-13 15:43:25 +08:00
},
2022-05-20 14:07:01 +08:00
computed: {
...mapState(['user'])
},
2022-05-13 15:43:25 +08:00
methods: {
helpCheck(e) {
e.checked = !e.checked
2022-05-18 09:57:05 +08:00
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()
2022-05-18 08:42:21 +08:00
},
comfirm() {
if(this.flag) return
2022-05-18 09:57:05 +08:00
2022-05-18 08:42:21 +08:00
if(!this.form.name) {
return this.$u.toast('请输入姓名')
}
if(!this.form.idNumber) {
return this.$u.toast('请输入身份证号')
}
2022-05-18 14:12:14 +08:00
if(this.form.idNumber) {
if (!/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(this.form.idNumber)) {
return this.$u.toast('请输入正确的身份证号')
}
}
2022-05-18 08:42:21 +08:00
if(!this.form.phone) {
return this.$u.toast('请输入手机号')
}
if(!this.form.householdNumber) {
return this.$u.toast('请输入家庭人口数')
}
if(!this.form.areaId) {
return this.$u.toast('请选择所在地区')
}
if(!this.form.address) {
return this.$u.toast('请输入详细地址')
}
2022-05-18 09:57:05 +08:00
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('请输入帮扶原因说明')
}
2022-05-18 08:42:21 +08:00
this.flag = true
2022-05-18 09:57:05 +08:00
this.$instance.post('/app/apphelpdeclarationinfo/addByApplet',{...this.form}).then((res) => {
if(res.code ==0) {
uni.navigateTo({url: './result'})
}
2022-05-18 08:42:21 +08:00
})
2022-05-13 15:43:25 +08:00
}
},
}
</script>
<style lang="scss" scoped>
.add {
.tips {
padding: 32px;
box-sizing: border-box;
background: #FFF8F3;
color: #FF883C;
font-size: 30px;
}
2022-05-13 17:20:38 +08:00
2022-05-13 15:43:25 +08:00
.user_info,
.family_info {
background: #FFF;
.item {
display: flex;
padding: 32px;
box-sizing: border-box;
border-bottom: 1px solid #DDDDDD;
.left {
width: 240px;
span:first-child {
color: #FF4466;
}
}
.right__text {
width: calc(100% - 240px);
text-align: right;
}
.color-999 {
color: #999;
}
.color-333 {
color: #333;
}
}
.item:last-child {
border-bottom: none;
}
.items {
padding: 32px;
box-sizing: border-box;
border-bottom: 1px solid #DDDDDD;
.left {
span:first-child {
color: #FF4466;
}
}
.text {
margin-top: 20px;
}
.textarea {
margin-top: 32px;
}
.tags {
margin-top: 20px;
span {
2022-05-17 17:43:12 +08:00
display: inline-block;
width: 31%;
2022-05-13 15:43:25 +08:00
height: 80px;
line-height: 80px;
text-align: center;
box-sizing: border-box;
border-radius: 16px;
border: 1px solid #CCCCCC;
margin-right: 20px;
margin-bottom: 16px;
}
span:nth-child(3n) {
margin-right: 0;
}
2022-05-18 09:57:05 +08:00
.isCheck {
2022-05-19 13:49:17 +08:00
color: #FFF;
background: #4181FF;
2022-05-18 09:57:05 +08:00
}
2022-05-13 15:43:25 +08:00
}
}
}
.family_info {
margin-top: 16px;
}
2022-05-13 17:20:38 +08:00
.btn {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
height: 120px;
text-align: center;
background: #FFF;
padding: 16px 32px;
box-sizing: border-box;
2022-05-18 14:12:14 +08:00
z-index: 999;
2022-05-13 17:20:38 +08:00
div {
width: 100%;
height: 88px;
line-height: 88px;
background: #4181FF;
border-radius: 16px;
color: #FFF;
font-size: 34px;
}
}
2022-05-13 15:43:25 +08:00
}
</style>