fix
parent
149bdcd512
commit
913074010c
|
|
@ -1,6 +1,7 @@
|
||||||
import { Button, Descriptions, Image, Modal, Table } from "antd";
|
import { Button, Descriptions, Image, Modal, Table } from "antd";
|
||||||
import { useEffect, useRef, useState } from "react";
|
import { useEffect, useRef, useState } from "react";
|
||||||
import { fetchOrgPersonnelDetail } from "~/utils/qualFiling/personnelHelper";
|
import { fetchOrgPersonnelDetail } from "~/utils/qualFiling/personnelHelper";
|
||||||
|
import { getAgeByIdCard } from "~/utils";
|
||||||
import {
|
import {
|
||||||
REGISTER_ENGINEER_CATEGORY_MAP,
|
REGISTER_ENGINEER_CATEGORY_MAP,
|
||||||
ABILITY_SOURCE_MAP,
|
ABILITY_SOURCE_MAP,
|
||||||
|
|
@ -143,15 +144,18 @@ export default function StaffViewModal({
|
||||||
<Descriptions.Item label="性别">
|
<Descriptions.Item label="性别">
|
||||||
{GENDER_MAP[info.genderCode]}
|
{GENDER_MAP[info.genderCode]}
|
||||||
</Descriptions.Item>
|
</Descriptions.Item>
|
||||||
|
<Descriptions.Item label="身份证号">
|
||||||
|
{info.idCardNo}
|
||||||
|
</Descriptions.Item>
|
||||||
|
<Descriptions.Item label="年龄">
|
||||||
|
{getAgeByIdCard(info.idCardNo) ?? "-"}
|
||||||
|
</Descriptions.Item>
|
||||||
<Descriptions.Item label="本行业工作年限">
|
<Descriptions.Item label="本行业工作年限">
|
||||||
{info.workDateAge}
|
{info.workDateAge}
|
||||||
</Descriptions.Item>
|
</Descriptions.Item>
|
||||||
<Descriptions.Item label="账号">{info.account}</Descriptions.Item>
|
<Descriptions.Item label="账号">{info.account}</Descriptions.Item>
|
||||||
<Descriptions.Item label="部门">{info.deptName}</Descriptions.Item>
|
<Descriptions.Item label="部门">{info.deptName}</Descriptions.Item>
|
||||||
<Descriptions.Item label="岗位">{info.postName}</Descriptions.Item>
|
<Descriptions.Item label="岗位">{info.postName}</Descriptions.Item>
|
||||||
<Descriptions.Item label="身份证号">
|
|
||||||
{info.idCardNo}
|
|
||||||
</Descriptions.Item>
|
|
||||||
<Descriptions.Item label="现住地址">
|
<Descriptions.Item label="现住地址">
|
||||||
{info.currentAddress}
|
{info.currentAddress}
|
||||||
</Descriptions.Item>
|
</Descriptions.Item>
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ import {
|
||||||
CAPABILITY_OPTIONS,
|
CAPABILITY_OPTIONS,
|
||||||
CERT_LEVEL_LABEL_BY_TYPE
|
CERT_LEVEL_LABEL_BY_TYPE
|
||||||
} from "~/enumerate/constant";
|
} from "~/enumerate/constant";
|
||||||
import { renderCapabilityList } from "~/utils";
|
import { getAgeByIdCard, renderCapabilityList } from "~/utils";
|
||||||
import { idCardRule, mobileRule } from "~/utils/validators";
|
import { idCardRule, mobileRule } from "~/utils/validators";
|
||||||
import AttachmentUpload from "~/components/AttachmentUpload";
|
import AttachmentUpload from "~/components/AttachmentUpload";
|
||||||
import StaffViewModal from "~/components/StaffViewModal";
|
import StaffViewModal from "~/components/StaffViewModal";
|
||||||
|
|
@ -496,6 +496,8 @@ function StaffFormModal({
|
||||||
const [deptPositionOptions, setDeptPositionOptions] = useState([]);
|
const [deptPositionOptions, setDeptPositionOptions] = useState([]);
|
||||||
const [positionLoading, setPositionLoading] = useState(false);
|
const [positionLoading, setPositionLoading] = useState(false);
|
||||||
const watchedDeptId = Form.useWatch("deptId", form);
|
const watchedDeptId = Form.useWatch("deptId", form);
|
||||||
|
const watchedIdCardNo = Form.useWatch("idCardNo", form);
|
||||||
|
const ageFromIdCard = getAgeByIdCard(watchedIdCardNo);
|
||||||
const watchedRegisterEngineerFlag = Form.useWatch(
|
const watchedRegisterEngineerFlag = Form.useWatch(
|
||||||
"registerEngineerFlag",
|
"registerEngineerFlag",
|
||||||
form,
|
form,
|
||||||
|
|
@ -795,6 +797,29 @@ function StaffFormModal({
|
||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</Col>
|
</Col>
|
||||||
|
<Col span={12}>
|
||||||
|
<Form.Item
|
||||||
|
name="idCardNo"
|
||||||
|
label="身份证号"
|
||||||
|
rules={[
|
||||||
|
idCardRule(true),
|
||||||
|
{ max: 18, message: "身份证号不能超过18个字符" },
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
<Input placeholder="请输入身份证号" maxLength={18} />
|
||||||
|
</Form.Item>
|
||||||
|
</Col>
|
||||||
|
<Col span={12}>
|
||||||
|
<Form.Item label="年龄">
|
||||||
|
<Input
|
||||||
|
disabled
|
||||||
|
value={
|
||||||
|
ageFromIdCard != null ? String(ageFromIdCard) : undefined
|
||||||
|
}
|
||||||
|
placeholder="输入身份证号后自动计算"
|
||||||
|
/>
|
||||||
|
</Form.Item>
|
||||||
|
</Col>
|
||||||
<Col span={12}>
|
<Col span={12}>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
name="workDateAge"
|
name="workDateAge"
|
||||||
|
|
@ -858,18 +883,6 @@ function StaffFormModal({
|
||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={12}>
|
|
||||||
<Form.Item
|
|
||||||
name="idCardNo"
|
|
||||||
label="身份证号"
|
|
||||||
rules={[
|
|
||||||
idCardRule(true),
|
|
||||||
{ max: 18, message: "身份证号不能超过18个字符" },
|
|
||||||
]}
|
|
||||||
>
|
|
||||||
<Input placeholder="请输入身份证号" maxLength={18} />
|
|
||||||
</Form.Item>
|
|
||||||
</Col>
|
|
||||||
<Col span={12}>
|
<Col span={12}>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
name="currentAddress"
|
name="currentAddress"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue