fix: 创建员工时从身份证解析性别和出生日期

- contract.service.ts createEmployee: gender 为空时从身份证第17位解析,birthDate 从第7-14位提取
- portal.routes.ts GET /profile: gender/birthDate 为空时从身份证 fallback 解析
- gender 统一使用中文 男/女(与数据库和其他服务一致)
- 前端 MyProfile.tsx 性别显示适配中文
This commit is contained in:
freedakgmail
2026-08-17 19:04:22 +08:00
parent a6189d209d
commit 4eb882b1e2
3 changed files with 23 additions and 4 deletions
+1 -1
View File
@@ -75,7 +75,7 @@ export default function MyProfile() {
const readOnlyFields = [
{ label: '姓名', value: profile.name, icon: User },
{ label: '性别', value: profile.gender === 'M' ? '男' : profile.gender === 'F' ? '女' : '未填写', icon: User },
{ label: '性别', value: profile.gender === '' ? '男' : profile.gender === '' ? '女' : '未填写', icon: User },
{ label: '手机号', value: profile.phone || '未填写', icon: Phone },
{ label: '证件号码', value: profile.idCardNo || '未填写', icon: IdCard },
{ label: '部门', value: profile.department || '未填写', icon: User },