Merge branch 'dev' of http://git.sinoecare.com/sinoecare/digital_village_v2/dvcp_v2_wxcp_app into dev
This commit is contained in:
355
src/apps/AppPeopleList/Add.vue
Normal file
355
src/apps/AppPeopleList/Add.vue
Normal file
@@ -0,0 +1,355 @@
|
|||||||
|
<template>
|
||||||
|
<div class="add">
|
||||||
|
<div class="item">
|
||||||
|
<span class="tips">*</span>
|
||||||
|
<div class="border">
|
||||||
|
<span class="label">是否户主</span>
|
||||||
|
<span class="value" @click="clickSelect('yesOrNo', 'householdName')">
|
||||||
|
<span v-if="form.householdName === ''" class="color-999">请选择</span>
|
||||||
|
<span v-else>{{$dict.getLabel('yesOrNo', form.householdName)}}</span>
|
||||||
|
<img src="./components/img/right-icon.png" alt="">
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="item" v-if="form.householdName != 1">
|
||||||
|
<span class="tips">*</span>
|
||||||
|
<div class="border">
|
||||||
|
<span class="label">户主身份证</span>
|
||||||
|
<span class="value">
|
||||||
|
<input type="idcard" placeholder="请输入" v-model="form.householdIdNumber" maxlength="18">
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="item" v-if="form.householdName != 1">
|
||||||
|
<span class="tips">*</span>
|
||||||
|
<div class="border">
|
||||||
|
<span class="label">与户主关系</span>
|
||||||
|
<span class="value" @click="clickSelect('householdRelation', 'householdRelation')">
|
||||||
|
<span v-if="form.householdRelation === ''" class="color-999">请选择</span>
|
||||||
|
<span v-else>{{$dict.getLabel('householdRelation', form.householdRelation)}}</span>
|
||||||
|
<img src="./components/img/right-icon.png" alt="">
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="item">
|
||||||
|
<span class="tips">*</span>
|
||||||
|
<div class="border">
|
||||||
|
<span class="label">姓名</span>
|
||||||
|
<span class="value">
|
||||||
|
<input type="text" placeholder="请输入" v-model="form.name" maxlength="10" :disabled="this.form.id ? true : false">
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="item">
|
||||||
|
<span class="tips">*</span>
|
||||||
|
<div class="border">
|
||||||
|
<span class="label">身份证号</span>
|
||||||
|
<span class="value">
|
||||||
|
<input type="idcard" placeholder="请输入" v-model="form.idNumber" maxlength="18" @input="changeIdNumber" :disabled="this.form.id ? true : false">
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="item">
|
||||||
|
<span class="tips">*</span>
|
||||||
|
<div class="border">
|
||||||
|
<span class="label">性别</span>
|
||||||
|
<span class="value">
|
||||||
|
<span v-if="form.sex === ''" class="color-999">请选择</span>
|
||||||
|
<span v-else>{{$dict.getLabel('sex', form.sex)}}</span>
|
||||||
|
<img src="./components/img/right-icon.png" alt="">
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="item">
|
||||||
|
<span class="tips">*</span>
|
||||||
|
<div class="border">
|
||||||
|
<span class="label">出生日期</span>
|
||||||
|
<span class="value">
|
||||||
|
<span :class="form.birthDate == '' ? 'color-999' : ''">{{form.birthDate || '请选择'}}</span>
|
||||||
|
<img src="./components/img/right-icon.png" alt="">
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="item">
|
||||||
|
<span class="tips"></span>
|
||||||
|
<div class="border">
|
||||||
|
<span class="label">联系电话</span>
|
||||||
|
<span class="value">
|
||||||
|
<input type="text" placeholder="请输入" @input="changePhone" v-model="form.phone" maxlength="11">
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="item">
|
||||||
|
<span class="tips">*</span>
|
||||||
|
<div class="border">
|
||||||
|
<span class="label">现住址</span>
|
||||||
|
<span class="value">
|
||||||
|
<AiAreaPicker ref="address" class="aiArea" :fullName.sync="form.currentAreaName" :value="form.currentAreaId" mode="custom" all @select="onCurrentAreaChange">
|
||||||
|
<div class="aiArea">
|
||||||
|
<span class="label" v-if="form.currentAreaName">{{ form.currentAreaName }}</span>
|
||||||
|
<span v-else class="color-999">请选择</span>
|
||||||
|
<img src="./components/img/right-icon.png" alt="">
|
||||||
|
</div>
|
||||||
|
</AiAreaPicker>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="item mar-b0">
|
||||||
|
<span class="tips"></span>
|
||||||
|
<div class="border not-border">
|
||||||
|
<span class="label">详细地址</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="text-area">
|
||||||
|
<textarea placeholder="请输入" maxlength="30" v-model="form.currentAddress"></textarea>
|
||||||
|
</div>
|
||||||
|
<div class="item">
|
||||||
|
<span class="tips"></span>
|
||||||
|
<div class="border">
|
||||||
|
<span class="label">户籍地址</span>
|
||||||
|
<span class="value">
|
||||||
|
<AiAreaPicker ref="address" class="aiArea" :fullName.sync="form.householdAreaName" :value="form.householdAreaId" mode="custom" all @select="onHouseAreaChange">
|
||||||
|
<div class="aiArea">
|
||||||
|
<span class="label" v-if="form.householdAreaName">{{ form.householdAreaName }}</span>
|
||||||
|
<span v-else class="color-999">请选择</span>
|
||||||
|
<img src="./components/img/right-icon.png" alt="">
|
||||||
|
</div>
|
||||||
|
</AiAreaPicker>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="item mar-b0">
|
||||||
|
<span class="tips"></span>
|
||||||
|
<div class="border not-border">
|
||||||
|
<span class="label">详细地址</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="text-area">
|
||||||
|
<textarea placeholder="请输入" maxlength="30" v-model="form.householdAddress"></textarea>
|
||||||
|
</div>
|
||||||
|
<div class="pad-b152"></div>
|
||||||
|
<div class="add-btn" @click="submit">
|
||||||
|
<div>保存</div>
|
||||||
|
</div>
|
||||||
|
<u-select v-model="showSelect" :list="selectList" label-name="dictName" value-name="dictValue" @confirm="confirmSelect"/>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { mapState } from 'vuex'
|
||||||
|
export default {
|
||||||
|
name: 'add',
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
form: {
|
||||||
|
id: '',
|
||||||
|
householdName: '',
|
||||||
|
householdIdNumber: '',
|
||||||
|
householdRelation: '',
|
||||||
|
name: '',
|
||||||
|
idNumber: '',
|
||||||
|
sex: '',
|
||||||
|
birthDate: '',
|
||||||
|
phone: '',
|
||||||
|
currentAreaId: '',
|
||||||
|
currentAreaName: '',
|
||||||
|
currentAddress: '',
|
||||||
|
householdAreaId: '',
|
||||||
|
householdAreaName: '',
|
||||||
|
householdAddress: '',
|
||||||
|
residentType: '',
|
||||||
|
age: ''
|
||||||
|
},
|
||||||
|
showSelect: false,
|
||||||
|
formName: '',
|
||||||
|
selectList: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad(options) {
|
||||||
|
if(options.id) {
|
||||||
|
document.title = '编辑居民'
|
||||||
|
this.form.id = options.id
|
||||||
|
this.getDetail()
|
||||||
|
}else {
|
||||||
|
document.title = '新增居民'
|
||||||
|
this.form.residentType = options.type
|
||||||
|
}
|
||||||
|
this.$dict.load('yesOrNo', 'sex', 'householdRelation', 'nation', 'education', 'maritalStatus', 'politicsStatus', 'militaryStatus', 'faithType')
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState(['user']),
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
submit() {
|
||||||
|
if(this.form.householdName === '') {
|
||||||
|
return this.$u.toast('请选择是否户主')
|
||||||
|
}
|
||||||
|
if(this.form.householdName != 1 && !this.form.householdIdNumber) {
|
||||||
|
return this.$u.toast('请输入户主身份证')
|
||||||
|
}
|
||||||
|
if(this.form.householdName != 1 && this.form.householdRelation === '') {
|
||||||
|
return this.$u.toast('请选择与户主关系')
|
||||||
|
}
|
||||||
|
if(!this.form.name) {
|
||||||
|
return this.$u.toast('请输入姓名')
|
||||||
|
}
|
||||||
|
if(!this.form.idNumber) {
|
||||||
|
return this.$u.toast('请输入身份证号')
|
||||||
|
}
|
||||||
|
if(!this.form.sex) {
|
||||||
|
return this.$u.toast('请选择性别')
|
||||||
|
}
|
||||||
|
if(!this.form.birthDate) {
|
||||||
|
return this.$u.toast('请选择出生日期')
|
||||||
|
}
|
||||||
|
if(!this.form.currentAreaId) {
|
||||||
|
return this.$u.toast('请选择现住址')
|
||||||
|
}
|
||||||
|
this.form.age = this.$calcAge(this.form.idNumber)
|
||||||
|
this.$http.post('/app/appresident/addOrUpdate', this.form).then(res => {
|
||||||
|
if (res.code === 0) {
|
||||||
|
this.$u.toast('新增成功')
|
||||||
|
uni.$emit('reload')
|
||||||
|
uni.navigateBack({
|
||||||
|
delta: 1
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
},
|
||||||
|
confirmSelect(e) {
|
||||||
|
this.form[this.formName] = e[0].value
|
||||||
|
},
|
||||||
|
clickSelect(dictName, formName) {
|
||||||
|
this.selectList = this.$dict.getDict(dictName)
|
||||||
|
this.formName = formName
|
||||||
|
this.showSelect = true
|
||||||
|
},
|
||||||
|
changeIdNumber() {
|
||||||
|
let reg = /^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/;
|
||||||
|
if (this.form.idNumber.length == 18 && !reg.test(this.form.idNumber)) {
|
||||||
|
return this.$u.toast('请输入正确的身份证号码')
|
||||||
|
}
|
||||||
|
var info = this.$idCardNoUtil.getIdCardInfo(this.form.idNumber)
|
||||||
|
this.form.birthDate = info.birthday
|
||||||
|
this.form.sex = info.gender
|
||||||
|
this.$forceUpdate()
|
||||||
|
},
|
||||||
|
|
||||||
|
changePhone() {
|
||||||
|
let regTel = /^1(3\d|4[5-9]|5[0-35-9]|6[567]|7[0-8]|8\d|9[0-35-9])\d{8}$/
|
||||||
|
if (this.form.phone.length == 11 && !regTel.test(this.form.phone)) {
|
||||||
|
return this.$u.toast('请输入正确的手机号')
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
onCurrentAreaChange(e) {
|
||||||
|
this.form.currentAreaId = e
|
||||||
|
},
|
||||||
|
|
||||||
|
onHouseAreaChange(e) {
|
||||||
|
this.form.householdAreaId = e
|
||||||
|
},
|
||||||
|
|
||||||
|
getDetail() {
|
||||||
|
this.$http.post(`/app/appresident/detail?id=${this.form.id}`).then(res => {
|
||||||
|
if (res.code === 0) {
|
||||||
|
this.form = {...res.data.resident}
|
||||||
|
var info = this.$idCardNoUtil.getIdCardInfo(this.form.idNumber)
|
||||||
|
this.form.birthDate = info.birthday
|
||||||
|
this.form.sex = info.gender
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.add {
|
||||||
|
.item{
|
||||||
|
width: 100%;
|
||||||
|
padding-left: 14px;
|
||||||
|
background: #FFF;
|
||||||
|
box-sizing: border-box;
|
||||||
|
display: flex;
|
||||||
|
margin-bottom: 16px;
|
||||||
|
.tips{
|
||||||
|
width: 18px;
|
||||||
|
font-size: 32px;
|
||||||
|
font-family: PingFangSC-Regular, PingFang SC;
|
||||||
|
color: #FF4466;
|
||||||
|
line-height: 44px;
|
||||||
|
padding: 34px 0 34px 0;
|
||||||
|
}
|
||||||
|
.border{
|
||||||
|
width: calc(100% - 18px);
|
||||||
|
padding: 34px 32px 34px 0;
|
||||||
|
line-height: 44px;
|
||||||
|
border-bottom: 1px solid #D8DDE6;
|
||||||
|
line-height: 44px;
|
||||||
|
font-size: 32px;
|
||||||
|
font-family: PingFangSC-Regular, PingFang SC;
|
||||||
|
color: #333;
|
||||||
|
display: flex;
|
||||||
|
box-sizing: border-box;
|
||||||
|
.label{
|
||||||
|
width: 170px;
|
||||||
|
}
|
||||||
|
.value{
|
||||||
|
width: calc(100% - 170px);
|
||||||
|
text-align: right;
|
||||||
|
img{
|
||||||
|
width: 32px;
|
||||||
|
height: 32px;
|
||||||
|
margin-left: 8px;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.color-999{
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.not-border{
|
||||||
|
border-bottom: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.mar-b0{
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
.text-area{
|
||||||
|
width: 100%;
|
||||||
|
background-color: #fff;
|
||||||
|
padding: 0 32px;
|
||||||
|
margin-bottom: 16px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
textarea{
|
||||||
|
width: 100%;
|
||||||
|
height: 88px;
|
||||||
|
padding-bottom: 32px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.pad-b152{
|
||||||
|
width: 100%;
|
||||||
|
padding-bottom: 152px;
|
||||||
|
background-color: #f5f5f5;
|
||||||
|
}
|
||||||
|
.add-btn{
|
||||||
|
position: fixed;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
z-index: 999;
|
||||||
|
width: 100%;
|
||||||
|
height: 112px;
|
||||||
|
line-height: 112px;
|
||||||
|
background: #3975C6;
|
||||||
|
font-size: 32px;
|
||||||
|
font-family: PingFangSC-Medium, PingFang SC;
|
||||||
|
font-weight: 500;
|
||||||
|
color: #FFF;
|
||||||
|
div{
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -32,10 +32,9 @@
|
|||||||
<img src="./components/img/tsrq备份@2x.png" alt="" v-if="tabIndex==index && index != 0">
|
<img src="./components/img/tsrq备份@2x.png" alt="" v-if="tabIndex==index && index != 0">
|
||||||
<img src="./components/img/tsrq@2x.png" alt="" v-if="tabIndex!=index && index != 0">
|
<img src="./components/img/tsrq@2x.png" alt="" v-if="tabIndex!=index && index != 0">
|
||||||
</div>
|
</div>
|
||||||
<!-- <img :src="tabIndex == index ? './components/img/tsrq@2x.png' : './components/img/tsrq备份@2x.png'" alt="" v-else> -->
|
|
||||||
|
|
||||||
<p v-if="index==0">{{item.name}}</p>
|
<p v-if="index==0">{{item.name}}</p>
|
||||||
<p v-else>{{item.applicationName}}</p>
|
<p v-else class="type">{{item.applicationName}}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- 基本信息 -->
|
<!-- 基本信息 -->
|
||||||
@@ -307,6 +306,12 @@ export default {
|
|||||||
margin-top: 8px;
|
margin-top: 8px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.type {
|
||||||
|
padding: 0 10px;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space:nowrap;
|
||||||
|
}
|
||||||
.active{
|
.active{
|
||||||
background-color: #357CE3;
|
background-color: #357CE3;
|
||||||
p{
|
p{
|
||||||
|
|||||||
@@ -39,6 +39,8 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<AiEmpty class="emptyWrap" v-else></AiEmpty>
|
<AiEmpty class="emptyWrap" v-else></AiEmpty>
|
||||||
|
<div style="height: 60px"></div>
|
||||||
|
<div class="addBtn" @click="toAdd">新增居民</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -78,6 +80,9 @@ export default {
|
|||||||
onLoad() {
|
onLoad() {
|
||||||
this.areaId = this.user.areaId
|
this.areaId = this.user.areaId
|
||||||
this.areaName = this.user.areaName
|
this.areaName = this.user.areaName
|
||||||
|
uni.$on('reload',()=>{
|
||||||
|
this.getList()
|
||||||
|
})
|
||||||
this.getList()
|
this.getList()
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
@@ -86,7 +91,6 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
getList() {
|
getList() {
|
||||||
var residentType = ['', 0, 1][this.currentTabs]
|
var residentType = ['', 0, 1][this.currentTabs]
|
||||||
console.log(residentType)
|
|
||||||
this.$http
|
this.$http
|
||||||
.post('/app/appresident/list', null, {
|
.post('/app/appresident/list', null, {
|
||||||
params: {
|
params: {
|
||||||
@@ -135,6 +139,9 @@ export default {
|
|||||||
this.current = 1
|
this.current = 1
|
||||||
this.getList()
|
this.getList()
|
||||||
},
|
},
|
||||||
|
toAdd() {
|
||||||
|
uni.navigateTo({url:'./Add'})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
onReachBottom() {
|
onReachBottom() {
|
||||||
this.current = this.current + 1
|
this.current = this.current + 1
|
||||||
@@ -231,5 +238,16 @@ uni-page-body {
|
|||||||
background: #f5f5f5;
|
background: #f5f5f5;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
.addBtn {
|
||||||
|
width: 100%;
|
||||||
|
height: 112px;
|
||||||
|
line-height: 112px;
|
||||||
|
background: #1365DD;
|
||||||
|
text-align: center;
|
||||||
|
color: #FFF;
|
||||||
|
font-size: 32px;
|
||||||
|
position: fixed;
|
||||||
|
bottom: 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
BIN
src/apps/AppPeopleList/components/img/right-icon.png
Normal file
BIN
src/apps/AppPeopleList/components/img/right-icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 258 B |
Reference in New Issue
Block a user