|
@@ -132,7 +132,9 @@
|
|
|
<el-col :span="12">
|
|
|
<el-form-item :label="this.$t('customerManage.idNo')">
|
|
|
<el-input v-model="formmodel.id_no" clearable :placeholder="this.$t('customerManage.inputIdNo')"
|
|
|
- :maxlength="20"/>
|
|
|
+ :maxlength="20"
|
|
|
+ @blur="onBlurCard"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
@@ -265,6 +267,7 @@
|
|
|
prop="relative_name"
|
|
|
:label="this.$t('customerManage.relativeName')"
|
|
|
width="180"
|
|
|
+ :formatter="formatterRelativeName"
|
|
|
/>
|
|
|
<el-table-column
|
|
|
prop="mobile"
|
|
@@ -293,8 +296,11 @@
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
<el-form-item :label="this.$t('customerManage.relativeName')" prop="relative_name">
|
|
|
- <el-input v-model="relativeFormModel.relative_name" clearable
|
|
|
- :placeholder="this.$t('customerManage.inputRelativeName')" :maxlength="20"/>
|
|
|
+<!-- <el-input v-model="relativeFormModel.relative_name" clearable-->
|
|
|
+<!-- :placeholder="this.$t('customerManage.inputRelativeName')" :maxlength="20"/>-->
|
|
|
+ <el-select v-model="relativeFormModel.relative_name" :placeholder="this.$t('customerManage.choiceRelativeName')" clearable @change="relativeNameChange">
|
|
|
+ <el-option v-for="(item, index) in Object.keys(relativeNameTypeEnum)" :key="index" :label="relativeNameTypeEnum[item]" :value="item" />
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
@@ -312,6 +318,19 @@
|
|
|
:maxlength="20"/>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item v-if="isChild"
|
|
|
+ :label="this.$t('member.birthday2')" prop="birthday">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="relativeFormModel.birthday"
|
|
|
+ type="date"
|
|
|
+ :editable="false"
|
|
|
+ value-format="timestamp"
|
|
|
+ :placeholder="this.$t('member.choiceBirthday2')"
|
|
|
+ :picker-options="{ disabledDate(time) { return time.getTime() > Date.now() }}"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
</el-row>
|
|
|
<el-form-item>
|
|
|
<el-button type="primary" @click="addRelative">{{ this.$t('action.add') }}</el-button>
|
|
@@ -498,6 +517,7 @@
|
|
|
import myMap from '@/views/customer/myMap'
|
|
|
import * as API_SystemConfig from '@/api/ncs_systemconfig'
|
|
|
import { getDevicesByUuid } from '@/api/initialize'
|
|
|
+ import {RELATIVE_NAME_TYPE} from "@/utils/enum/RelativeNameTypeEnum";
|
|
|
const serverUrl = domain.serverUrl
|
|
|
export default {
|
|
|
name: 'ElderlyCareManager',
|
|
@@ -653,7 +673,9 @@
|
|
|
locationShow: false,
|
|
|
isCloud: false,
|
|
|
boolDevice: false,
|
|
|
- mapUrl: null
|
|
|
+ mapUrl: null,
|
|
|
+ relativeNameTypeEnum: RELATIVE_NAME_TYPE.getValueList(),
|
|
|
+ isChild: false,
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -1423,6 +1445,35 @@
|
|
|
return this.$t('member.unknown')
|
|
|
}
|
|
|
},
|
|
|
+ formatterRelativeName(row) {
|
|
|
+ return RELATIVE_NAME_TYPE.getDescFromValue(row.relative_name) ? RELATIVE_NAME_TYPE.getDescFromValue(row.relative_name) : row.relative_name
|
|
|
+ },
|
|
|
+ relativeNameChange(val) {
|
|
|
+ if (val === RELATIVE_NAME_TYPE.CHILDREN || val === RELATIVE_NAME_TYPE.BOY || val === RELATIVE_NAME_TYPE.GIRL) {
|
|
|
+ this.relativeRules.mobile[0].required = false
|
|
|
+ this.relativeRules.mobile[0].validator = (rule, value, callback) => { callback() }
|
|
|
+ this.isChild = true
|
|
|
+ if (val === RELATIVE_NAME_TYPE.BOY) {
|
|
|
+ this.relativeFormModel.sex = 1
|
|
|
+ } else if (val === RELATIVE_NAME_TYPE.GIRL) {
|
|
|
+ this.relativeFormModel.sex = 0
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if (val === RELATIVE_NAME_TYPE.HUSBAND || val === RELATIVE_NAME_TYPE.FATHER) {
|
|
|
+ this.relativeRules.mobile[0].required = true
|
|
|
+ this.isChild = false
|
|
|
+ this.relativeFormModel.sex = 1
|
|
|
+ }
|
|
|
+ else if (val === RELATIVE_NAME_TYPE.WIFE || val === RELATIVE_NAME_TYPE.MOTHER) {
|
|
|
+ this.relativeRules.mobile[0].required = true
|
|
|
+ this.isChild = false
|
|
|
+ this.relativeFormModel.sex = 0
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ this.relativeRules.mobile[0].required = true
|
|
|
+ this.isChild = false
|
|
|
+ }
|
|
|
+ },
|
|
|
/** 信息变化后操作,如床位状态改变,传入的空间结构变化了 **/
|
|
|
infoChanged() {
|
|
|
this.getEmptyBeds().then(() => {
|
|
@@ -1551,6 +1602,30 @@
|
|
|
API_SystemConfig.cloud().then(r => {
|
|
|
this.isCloud = r
|
|
|
})
|
|
|
+ },
|
|
|
+ onBlurCard() {
|
|
|
+ if (this.formmodel.id_type === "身份证") {
|
|
|
+ const val = this.formmodel.id_no.length
|
|
|
+ const idNo = this.formmodel.id_no
|
|
|
+ let sex = null
|
|
|
+
|
|
|
+ if (val === 18) {
|
|
|
+ this.formmodel.birthday = new Date(idNo.substring(6, 10) + '-' + idNo.substring(10, 12) + '-' + idNo.substring(12, 14)).getTime()
|
|
|
+ this.birthdayChange(this.formmodel.birthday)
|
|
|
+ sex = idNo.substring(16, 17)
|
|
|
+ }
|
|
|
+ if (val === 15) {
|
|
|
+ this.formmodel.birthday = new Date( '19' + idNo.substring(6, 8) + '-' + idNo.substring(8, 10) + '-' + idNo.substring(10, 12)).getTime()
|
|
|
+ this.birthdayChange(this.formmodel.birthday)
|
|
|
+ sex = idNo.substring(13, 14)
|
|
|
+ }
|
|
|
+
|
|
|
+ if (sex % 2 === 0) {
|
|
|
+ this.formmodel.sex = 0
|
|
|
+ } else {
|
|
|
+ this.formmodel.sex = 1
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|