From cdaa71a06ec53d2fb6e67b63d02dab165605846c Mon Sep 17 00:00:00 2001
From: yijiusmile <253281376@qq.com>
Date: 星期一, 22 三月 2021 16:04:35 +0800
Subject: [PATCH] 在职员工编辑时增加判断没有出生日期会根据身份证拆分

---
 src/views/user/inemployees.vue |   17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/src/views/user/inemployees.vue b/src/views/user/inemployees.vue
index 89cb548..cb815c1 100644
--- a/src/views/user/inemployees.vue
+++ b/src/views/user/inemployees.vue
@@ -1580,18 +1580,27 @@
       this.empBaseInfoForm.deptName = row.deptName
       this.empBaseInfoForm.empNumb = row.empNumb
       this.empBaseInfoForm.empName = row.empName
-      this.empBaseInfoForm.sex = row.sex
       this.empBaseInfoForm.JobId = row.JobId
       this.empBaseInfoForm.jobName = row.jobName
       this.empBaseInfoForm.empType = row.empType
       this.empBaseInfoForm.certificateType = row.certificateType
-      this.empBaseInfoForm.certificateNumb = row.certificateNumb
       this.empBaseInfoForm.nation = row.nation
       this.empBaseInfoForm.certificateValidity = row.certificateValidity
       this.empBaseInfoForm.marriage = row.marriage
-      this.empBaseInfoForm.age = row.age
+      this.empBaseInfoForm.certificateNumb = row.certificateNumb
+      if (!row.birthdate) {
+        var userinfo = toCardGetUserInfo(this.empBaseInfoForm.certificateNumb)
+        if (userinfo !== null) {
+          this.empBaseInfoForm.age = userinfo.age
+          this.empBaseInfoForm.birthdate = userinfo.birth
+          this.empBaseInfoForm.sex = userinfo.sex
+        }
+      } else {
+        this.empBaseInfoForm.age = row.age
+        this.empBaseInfoForm.birthdate = row.birthdate
+        this.empBaseInfoForm.sex = row.sex
+      }
       this.empBaseInfoForm.stature = row.stature
-      this.empBaseInfoForm.birthdate = row.birthdate
       this.empBaseInfoForm.politics = row.politics
       this.empBaseInfoForm.entryDate = row.entryDate
       this.empBaseInfoForm.education = row.education

--
Gitblit v1.8.0