232 lines
6.6 KiB
Vue
232 lines
6.6 KiB
Vue
<template>
|
|
<div class="formConfirm">
|
|
<div class="list-content">
|
|
<div class="item">
|
|
<span class="tips">*</span>
|
|
<div class="item-border">
|
|
<div class="label">户主姓名</div>
|
|
<div class="value">
|
|
<u-input type="text" class="right" placeholder="请输入" height="44" input-align="right" v-model="info.name"></u-input>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="item">
|
|
<span class="tips">*</span>
|
|
<div class="item-border">
|
|
<div class="label">性别</div>
|
|
<div class="value" @click="showSex=true">
|
|
<span :class="info.sex == null ? 'color-999' : ''">{{ $dict.getLabel('sex', info.sex) || '请选择'}}</span>
|
|
<img src="./img/arrow-right.png" alt="">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="item">
|
|
<span class="tips">*</span>
|
|
<div class="item-border">
|
|
<div class="label">联系电话</div>
|
|
<div class="value">
|
|
<u-input type="text" class="right" placeholder="请输入" height="44" input-align="right" v-model="info.phone"></u-input>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="item">
|
|
<span class="tips">*</span>
|
|
<div class="item-border">
|
|
<div class="label">出生日期</div>
|
|
<div class="value" @click="showDate=true">
|
|
<span :class="info.birthday == null ? 'color-999' : ''">{{ info.birthday || '请选择'}}</span>
|
|
<img src="./img/arrow-right.png" alt="">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="item">
|
|
<span class="tips">*</span>
|
|
<div class="item-border">
|
|
<div class="label">民族</div>
|
|
<div class="value" @click="showNation=true">
|
|
<span :class="info.nation == null ? 'color-999' : ''">{{ $dict.getLabel('nation', info.nation) || '请选择'}}</span>
|
|
<img src="./img/arrow-right.png" alt="">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="item">
|
|
<span class="tips">*</span>
|
|
<div class="item-border">
|
|
<div class="label">家庭人口数</div>
|
|
<div class="value">
|
|
<u-input type="text" class="right" placeholder="请输入" height="44" input-align="right" v-model="info.householdNumber"></u-input>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="bottom-btn">
|
|
<div class="confirm" @click="confirm('保存成功')">保存内容</div>
|
|
<div class="confirm" @click="confirm('提交成功')">提交</div>
|
|
<div class="cancel">取消</div>
|
|
</div>
|
|
<u-picker mode="time" v-model="showDate" :params="deteParams" start-year="1930" @confirm="dateConfirm">请选择</u-picker>
|
|
<u-select v-model="showSex" :list="$dict.getDict('sex')" label-name="dictName" value-name="dictValue" @confirm="confirmSex"/>
|
|
<u-select v-model="showNation" :list="$dict.getDict('nation')" label-name="dictName" value-name="dictValue" @confirm="confirmNation"/>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import {mapState} from "vuex";
|
|
|
|
export default {
|
|
name: 'formConfirm',
|
|
data() {
|
|
return {
|
|
word: '',
|
|
info: {},
|
|
showSex: false,
|
|
showNation: false,
|
|
showDate: false,
|
|
deteParams: {year: true, month: true, day: true, hour: false, minute: false, second: false},
|
|
}
|
|
},
|
|
computed: {
|
|
...mapState(['user']),
|
|
},
|
|
onLoad(option) {
|
|
uni.showLoading({title: '加载中'})
|
|
this.word = option.word
|
|
this.$dict.load('sex', 'nation').then(() => {
|
|
this.getInfo()
|
|
})
|
|
},
|
|
onShow() {
|
|
document.title = '婚姻家庭纠纷入户登记表'
|
|
},
|
|
methods: {
|
|
getInfo() {
|
|
this.$http.post(`/app/appbaiduai/queryByInfo?word=${this.word}`).then((res) => {
|
|
if (res.code === 0) {
|
|
this.info = {...res.data}
|
|
uni.hideLoading()
|
|
}
|
|
}).catch(res => {
|
|
this.$u.toast(res)
|
|
uni.hideLoading()
|
|
})
|
|
},
|
|
confirmSex(e) {
|
|
this.info.sex = e[0].value
|
|
},
|
|
confirmNation(e) {
|
|
this.info.nation = e[0].value
|
|
},
|
|
dateConfirm(e) {
|
|
this.info.birthday = `${e.year}-${e.month}-${e.day}`
|
|
},
|
|
confirm(successText) {
|
|
if(this.info.name == null || !this.info.name) {
|
|
return this.$u.toast('请输入户主姓名')
|
|
}
|
|
if(this.info.sex == null) {
|
|
return this.$u.toast('请选择性别')
|
|
}
|
|
if(this.info.phone == null || !this.info.phone) {
|
|
return this.$u.toast('请输入联系电话')
|
|
}
|
|
if(this.info.birthday == null) {
|
|
return this.$u.toast('请选择出生日期')
|
|
}
|
|
if(this.info.nation == null) {
|
|
return this.$u.toast('请选择民族')
|
|
}
|
|
if(this.info.householdNumber == null || !this.info.householdNumber) {
|
|
return this.$u.toast('请输入家庭人口数')
|
|
}
|
|
this.$u.toast(successText)
|
|
}
|
|
},
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
uni-page-body {
|
|
min-height: 100%;
|
|
// height: 100vh;
|
|
background: #F5F5F5;
|
|
}
|
|
.formConfirm {
|
|
.list-content {
|
|
padding-bottom: 328px;
|
|
.item {
|
|
padding-left: 32px;
|
|
position: relative;
|
|
margin-bottom: 16px;
|
|
background-color: #fff;
|
|
.tips {
|
|
position: absolute;
|
|
top: 34px;
|
|
left: 8px;
|
|
font-family: PingFangSC-Regular;
|
|
font-size: 32px;
|
|
color: #F46;
|
|
}
|
|
.item-border {
|
|
padding: 34px 32px 34px 0;
|
|
width: 100%;
|
|
box-sizing: border-box;
|
|
border-bottom: 1px solid #D8DDE6;
|
|
display: flex;
|
|
.label {
|
|
font-family: PingFangSC-Regular;
|
|
font-size: 32px;
|
|
color: #333;
|
|
line-height: 44px;
|
|
width: 200px;
|
|
}
|
|
.value {
|
|
width: calc(100% - 200px);
|
|
text-align: right;
|
|
.u-input {
|
|
display: inline-block;
|
|
width: calc(100% - 40px);
|
|
vertical-align: sub;
|
|
}
|
|
img {
|
|
display: inline-block;
|
|
width: 32px;
|
|
height: 32px;
|
|
margin-left: 8px;
|
|
vertical-align: middle;
|
|
}
|
|
.color-999 {
|
|
color: rgb(192, 196, 204);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
.bottom-btn {
|
|
position: fixed;
|
|
bottom: 0;
|
|
left: 0;
|
|
background-color: #F5F5F5;
|
|
div {
|
|
margin-left: 32px;
|
|
width: 686px;
|
|
height: 88px;
|
|
border-radius: 44px;
|
|
font-family: PingFangSC-Medium;
|
|
font-weight: 500;
|
|
font-size: 34px;
|
|
text-align: center;
|
|
line-height: 86px;
|
|
margin-bottom: 32px;
|
|
}
|
|
.confirm {
|
|
background: #3975C6;
|
|
color: #fff;
|
|
}
|
|
.cancel {
|
|
color: #666;
|
|
border: 1px solid #CCC;
|
|
}
|
|
}
|
|
}
|
|
</style>
|