This commit is contained in:
liuye
2022-03-28 16:35:41 +08:00
parent 9e4f042723
commit 5aba44c192
2 changed files with 23 additions and 3 deletions

View File

@@ -68,7 +68,7 @@
<span>现住址</span>
</div>
<div class="right">
<AiAreaPicker ref="address" class="aiArea" :fullName.sync="form.currentAreaName" v-model="form.currentAreaId" :areaId="$areaId" all @select="onAreaChange">
<AiAreaPicker ref="address" class="aiArea" :fullName.sync="form.currentAreaName" v-model="form.currentAreaId" :areaId="user.areaId" all @select="onAreaChange">
<div class="aiArea">
<span class="label" v-if="form.currentAreaName">{{ form.currentAreaName }}</span>
<i v-else>请选择</i>
@@ -265,7 +265,7 @@
</template>
<script>
import {mapState} from 'vuex'
export default {
data() {
return {
@@ -294,6 +294,7 @@ export default {
girdId: '',
girdName: '',
healthyStatus: '',
age: '',
},
$areaId: '',
isEdit: false,
@@ -301,6 +302,9 @@ export default {
girdInfo: {}
}
},
computed: {
...mapState(['user']),
},
onLoad(query) {
this.isGirdUser()
@@ -311,7 +315,7 @@ export default {
this.id = query.id
this.getInfo(this.id)
}else {
this.currentAreaName = this.$store.state.user.areaFullName
this.form.currentAreaId = this.user.areaId
}
})
@@ -398,6 +402,14 @@ export default {
}
var info = this.$idCardNoUtil.getIdCardInfo(this.form.idNumber)
this.form.sex = info.gender
var myDate = new Date();
var month = myDate.getMonth() + 1;
var day = myDate.getDate();
var age = myDate.getFullYear() - this.form.idNumber.substring(6, 10) - 1;
if (this.form.idNumber.substring(10, 12) < month || this.form.idNumber.substring(10, 12) == month && this.form.idNumber.substring(12, 14) <= day) {
age++;
}
this.form.age = age
},
isGirdUser() {
this.$http.post('/app/appgirdmemberinfo/checkLogOnUser').then((res) => {

View File

@@ -407,6 +407,14 @@ export default {
}
var info = this.$idCardNoUtil.getIdCardInfo(this.form.idNumber)
this.form.sex = info.gender
var myDate = new Date();
var month = myDate.getMonth() + 1;
var day = myDate.getDate();
var age = myDate.getFullYear() - this.form.idNumber.substring(6, 10) - 1;
if (this.form.idNumber.substring(10, 12) < month || this.form.idNumber.substring(10, 12) == month && this.form.idNumber.substring(12, 14) <= day) {
age++;
}
this.form.age = age
},
}
}