diff --git a/src/views/person/PersonDetail.vue b/src/views/person/PersonDetail.vue index a0ab67e..cde7ccd 100644 --- a/src/views/person/PersonDetail.vue +++ b/src/views/person/PersonDetail.vue @@ -323,12 +323,14 @@ const data = res.data // 默认选中的多选框 - const type = data.type.split(',') - const typeIntArr = []// 保存转换后的整型字符串 - type.forEach(item => { - typeIntArr.push(+item) - }) - this.form.getFieldDecorator('type', { valuePropName: 'checked', initialValue: typeIntArr }) + if (data.type) { + const type = data.type.split(',') + const typeIntArr = []// 保存转换后的整型字符串 + type.forEach(item => { + typeIntArr.push(+item) + }) + this.form.getFieldDecorator('type', { valuePropName: 'checked', initialValue: typeIntArr }) + } this.idPhotoFace = this.getImgPath(data.idPhotoFace) this.idPhotoBack = this.getImgPath(data.idPhotoBack) @@ -344,8 +346,8 @@ // age: data.age, // sex: data.sex, phone: data.phone, - jobs: parseInt(data.jobs), - workType: parseInt(data.workType), + jobs: data.jobs ? parseInt(data.jobs) : null, + workType: data.workType ? parseInt(data.workType) : null, degreeId: data.degreeId, orgId: data.orgId, orgName: data.orgName, @@ -423,7 +425,6 @@ if (monthNow < monthBirth || (monthNow === monthBirth && dayNow < dayBirth)) { age-- } - console.log(age) // 得到年龄 this.form.setFieldsValue({ age }) }, diff --git a/src/views/person/PersonRegister.vue b/src/views/person/PersonRegister.vue index 9483b9c..08cd2a2 100644 --- a/src/views/person/PersonRegister.vue +++ b/src/views/person/PersonRegister.vue @@ -7,7 +7,6 @@

单位邀请码:{{ invitationCode }}

-

邀请链接: www.anquanpeixun.com

@@ -27,11 +26,14 @@ - 编辑 + + + 详情 - + + @@ -39,12 +41,12 @@