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> <span>现住址</span>
</div> </div>
<div class="right"> <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"> <div class="aiArea">
<span class="label" v-if="form.currentAreaName">{{ form.currentAreaName }}</span> <span class="label" v-if="form.currentAreaName">{{ form.currentAreaName }}</span>
<i v-else>请选择</i> <i v-else>请选择</i>
@@ -265,7 +265,7 @@
</template> </template>
<script> <script>
import {mapState} from 'vuex'
export default { export default {
data() { data() {
return { return {
@@ -294,6 +294,7 @@ export default {
girdId: '', girdId: '',
girdName: '', girdName: '',
healthyStatus: '', healthyStatus: '',
age: '',
}, },
$areaId: '', $areaId: '',
isEdit: false, isEdit: false,
@@ -301,6 +302,9 @@ export default {
girdInfo: {} girdInfo: {}
} }
}, },
computed: {
...mapState(['user']),
},
onLoad(query) { onLoad(query) {
this.isGirdUser() this.isGirdUser()
@@ -311,7 +315,7 @@ export default {
this.id = query.id this.id = query.id
this.getInfo(this.id) this.getInfo(this.id)
}else { }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) var info = this.$idCardNoUtil.getIdCardInfo(this.form.idNumber)
this.form.sex = info.gender 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() { isGirdUser() {
this.$http.post('/app/appgirdmemberinfo/checkLogOnUser').then((res) => { this.$http.post('/app/appgirdmemberinfo/checkLogOnUser').then((res) => {

View File

@@ -407,6 +407,14 @@ export default {
} }
var info = this.$idCardNoUtil.getIdCardInfo(this.form.idNumber) var info = this.$idCardNoUtil.getIdCardInfo(this.form.idNumber)
this.form.sex = info.gender 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
}, },
} }
} }