1.2
parent
7faefe27eb
commit
373fe6d612
|
|
@ -99,6 +99,54 @@ export default function StaffViewModal({
|
|||
? JSON.parse(info.proofMaterialUrl)
|
||||
: [];
|
||||
|
||||
const titleCodeArr = Array.isArray(info.titleCodeArr)
|
||||
? info.titleCodeArr.map((item) => {
|
||||
let proveUrlList = [];
|
||||
if (item.proveUrl) {
|
||||
try {
|
||||
proveUrlList =
|
||||
typeof item.proveUrl === "string"
|
||||
? JSON.parse(item.proveUrl)
|
||||
: item.proveUrl;
|
||||
} catch {
|
||||
proveUrlList = [];
|
||||
}
|
||||
}
|
||||
return {
|
||||
industryName:
|
||||
QUALIFICATION_INDUSTRY_OPTIONS_MAP[item.industryCode] ||
|
||||
item.industryCode ||
|
||||
"-",
|
||||
titleName: TITLE_LEVEL_MAP[item.titleCode] || item.titleCode || "-",
|
||||
proveUrlList,
|
||||
};
|
||||
})
|
||||
: [];
|
||||
|
||||
const renderFileList = (files) => {
|
||||
if (!files?.length) return "-";
|
||||
return files.map((item) => {
|
||||
const isImage = /\.(jpg|jpeg|png|gif|webp|bmp|svg)(\?.*)?$/i.test(
|
||||
item.url,
|
||||
);
|
||||
return (
|
||||
<div key={item.uid || item.url}>
|
||||
{isImage ? (
|
||||
<Image
|
||||
src={item.url}
|
||||
style={{ maxWidth: 150, cursor: "pointer" }}
|
||||
preview={{ mask: item.fileName || item.name || "预览" }}
|
||||
/>
|
||||
) : (
|
||||
<Button type="link" onClick={() => window.open(item.url)}>
|
||||
{item.fileName || item.name || item.url}
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
});
|
||||
};
|
||||
|
||||
const certPreviewFiles = certPreviewInfo?.certImgs?.length
|
||||
? certPreviewInfo.certImgs
|
||||
: certPreviewInfo?.certImgFiles || [];
|
||||
|
|
@ -134,26 +182,36 @@ export default function StaffViewModal({
|
|||
<Descriptions.Item label="账号">{info.account}</Descriptions.Item>
|
||||
<Descriptions.Item label="部门">{info.deptName}</Descriptions.Item>
|
||||
<Descriptions.Item label="岗位">{info.postName}</Descriptions.Item>
|
||||
<Descriptions.Item label="人员类型">
|
||||
{info.personTypeName || "基础人员"}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="资质范围">
|
||||
{QUALIFICATION_INDUSTRY_OPTIONS_MAP[info.qualScope] || info.qualScope || "-"}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="职业等级">
|
||||
{info.professionalLevelName || "-"}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="证书编号">
|
||||
{info.evaluatorCertNo || "-"}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="学历类型">
|
||||
{info.educationTypeName || "-"}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="学历层次">
|
||||
{info.educationLevelName || "-"}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="职称">
|
||||
{TITLE_LEVEL_MAP[info.titleCode] ?? (info.titleCode || "-")}
|
||||
<Descriptions.Item label="职称信息" span={2}>
|
||||
{titleCodeArr.length ? (
|
||||
<Table
|
||||
size="small"
|
||||
bordered
|
||||
pagination={false}
|
||||
rowKey={(_, idx) => idx}
|
||||
dataSource={titleCodeArr}
|
||||
columns={[
|
||||
{ title: "行业", dataIndex: "industryName", width: 150 },
|
||||
{ title: "职称", dataIndex: "titleName", width: 100 },
|
||||
{
|
||||
title: "证明材料",
|
||||
dataIndex: "proveUrlList",
|
||||
render: renderFileList,
|
||||
},
|
||||
]}
|
||||
/>
|
||||
) : (
|
||||
"-"
|
||||
)}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="是否注册安全工程师">
|
||||
{REGISTER_ENGINEER_MAP[info.registerEngineerFlag] ?? "-"}
|
||||
|
|
@ -177,7 +235,7 @@ export default function StaffViewModal({
|
|||
<Descriptions.Item label="毕业院校">
|
||||
{info.graduateSchool}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="专业">{info.major}</Descriptions.Item>
|
||||
|
||||
<Descriptions.Item
|
||||
label="出版学术专著、专利、获奖、发表学术论文等"
|
||||
span={2}
|
||||
|
|
@ -190,7 +248,7 @@ export default function StaffViewModal({
|
|||
<Descriptions.Item label="主要学习工作经历" span={2}>
|
||||
{info.workExperience || "-"}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="申报专业能力证明材料" span={2}>
|
||||
<Descriptions.Item label="学历证明材料" span={2}>
|
||||
{proofMaterialUrl.length
|
||||
? proofMaterialUrl.map((item) => {
|
||||
const isImage =
|
||||
|
|
|
|||
|
|
@ -138,27 +138,7 @@ export const PERSON_TYPE_OPTIONS = [
|
|||
{ label: "专职评价师", value: "专职评价师" },
|
||||
];
|
||||
|
||||
/** 职业等级 */
|
||||
export const PROFESSIONAL_LEVEL_OPTIONS = [
|
||||
{
|
||||
label: "三级安全评价师(对应职业技能等级三级 / 高级工,入门级)",
|
||||
value: "三级安全评价师(对应职业技能等级三级 / 高级工,入门级)",
|
||||
},
|
||||
{
|
||||
label: "二级安全评价师(对应职业技能等级二级 / 技师,中级)",
|
||||
value: "二级安全评价师(对应职业技能等级二级 / 技师,中级)",
|
||||
},
|
||||
{
|
||||
label: "一级安全评价师(对应职业技能等级一级 / 高级技师,最高级)",
|
||||
value: "一级安全评价师(对应职业技能等级一级 / 高级技师,最高级)",
|
||||
},
|
||||
];
|
||||
|
||||
export const PROFESSIONAL_LEVEL_OPTIONS_MAP =
|
||||
PROFESSIONAL_LEVEL_OPTIONS.reduce(
|
||||
(acc, cur) => ({ ...acc, [cur.value]: cur.label }),
|
||||
{},
|
||||
);
|
||||
|
||||
/** 学历类型 */
|
||||
export const EDUCATION_TYPE_OPTIONS = [
|
||||
|
|
|
|||
|
|
@ -25,8 +25,6 @@ import { NS_STAFF_INFO, NS_ORG_DEPARTMENT } from "~/enumerate/namespace";
|
|||
import {
|
||||
EDUCATION_LEVEL_OPTIONS,
|
||||
EDUCATION_TYPE_OPTIONS,
|
||||
PERSON_TYPE_OPTIONS,
|
||||
PROFESSIONAL_LEVEL_OPTIONS,
|
||||
QUALIFICATION_INDUSTRY_OPTIONS,
|
||||
REGISTER_ENGINEER_OPTIONS,
|
||||
TITLE_LEVEL_OPTIONS,
|
||||
|
|
@ -407,12 +405,26 @@ function StaffFormModal({
|
|||
...data,
|
||||
};
|
||||
if (data.birthDate) setFields.birthDate = dayjs(data.birthDate);
|
||||
if (data.joinWorkDate) setFields.joinWorkDate = dayjs(data.joinWorkDate);
|
||||
if (data.joinWorkDate)
|
||||
setFields.joinWorkDate = dayjs(data.joinWorkDate);
|
||||
|
||||
if (setFields.proofMaterialUrl) {
|
||||
setFields.proofMaterialUrl = JSON.parse(setFields.proofMaterialUrl);
|
||||
}
|
||||
|
||||
if (Array.isArray(setFields.titleCodeArr)) {
|
||||
setFields.titleCodeArr = setFields.titleCodeArr.map((item) => {
|
||||
if (item.proveUrl && typeof item.proveUrl === "string") {
|
||||
try {
|
||||
return { ...item, proveUrl: JSON.parse(item.proveUrl) };
|
||||
} catch {
|
||||
return item;
|
||||
}
|
||||
}
|
||||
return item;
|
||||
});
|
||||
}
|
||||
|
||||
form.setFieldsValue(setFields);
|
||||
loadBasicDisciplineMajors(data.qualScope);
|
||||
})
|
||||
|
|
@ -461,6 +473,14 @@ function StaffFormModal({
|
|||
proofMaterialUrl: Array.isArray(values.proofMaterialUrl)
|
||||
? JSON.stringify(values.proofMaterialUrl)
|
||||
: undefined,
|
||||
titleCodeArr: Array.isArray(values.titleCodeArr)
|
||||
? values.titleCodeArr.map((item) => ({
|
||||
...item,
|
||||
proveUrl: Array.isArray(item.proveUrl)
|
||||
? JSON.stringify(item.proveUrl)
|
||||
: item.proveUrl,
|
||||
}))
|
||||
: undefined,
|
||||
};
|
||||
if (payload.birthDate && typeof payload.birthDate !== "string") {
|
||||
payload.birthDate = payload.birthDate.format("YYYY-MM-DD");
|
||||
|
|
@ -478,7 +498,6 @@ function StaffFormModal({
|
|||
handleCancel();
|
||||
onSuccess();
|
||||
} else {
|
||||
|
||||
}
|
||||
} finally {
|
||||
setSubmitting(false);
|
||||
|
|
@ -536,7 +555,11 @@ function StaffFormModal({
|
|||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Form.Item name="joinWorkDate" label="参加工作时间" rules={[{ required: true, message: "请选择参加工作时间" }]}>
|
||||
<Form.Item
|
||||
name="joinWorkDate"
|
||||
label="参加工作时间"
|
||||
rules={[{ required: true, message: "请选择参加工作时间" }]}
|
||||
>
|
||||
<DatePicker style={{ width: "100%" }} />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
|
|
@ -544,10 +567,7 @@ function StaffFormModal({
|
|||
<Form.Item
|
||||
name="account"
|
||||
label="账号"
|
||||
rules={[
|
||||
mobileRule("账号", true),
|
||||
|
||||
]}
|
||||
rules={[mobileRule("账号", true)]}
|
||||
>
|
||||
<Input placeholder="请输入账号" />
|
||||
</Form.Item>
|
||||
|
|
@ -601,18 +621,6 @@ function StaffFormModal({
|
|||
<Input placeholder="请输入身份证号" maxLength={18} />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Form.Item name="personTypeCode" label="人员类型">
|
||||
<Select
|
||||
placeholder="请选择人员类型"
|
||||
options={PERSON_TYPE_OPTIONS}
|
||||
onChange={(_val, option) => {
|
||||
form.setFieldValue("personTypeName", option?.label || undefined);
|
||||
}}
|
||||
/>
|
||||
</Form.Item>
|
||||
<Form.Item name="personTypeName" noStyle />
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Form.Item name="qualScope" label="资质范围">
|
||||
<Select
|
||||
|
|
@ -629,37 +637,18 @@ function StaffFormModal({
|
|||
allowClear
|
||||
showSearch
|
||||
optionFilterProp="label"
|
||||
options={(staffInfo?.basicDisciplineMajorList || []).map((item) => ({
|
||||
options={(staffInfo?.basicDisciplineMajorList || []).map(
|
||||
(item) => ({
|
||||
label: item.professionalName,
|
||||
value: item.id,
|
||||
}))}
|
||||
}),
|
||||
)}
|
||||
loading={staffInfo?.staffInfoLoading}
|
||||
disabled={!staffInfo?.basicDisciplineMajorList?.length}
|
||||
/>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Form.Item name="professionalLevelCode" label="职业等级">
|
||||
<Select
|
||||
placeholder="请选择职业等级"
|
||||
allowClear
|
||||
options={PROFESSIONAL_LEVEL_OPTIONS}
|
||||
onChange={(_val, option) => {
|
||||
form.setFieldValue("professionalLevelName", option?.label || undefined);
|
||||
}}
|
||||
/>
|
||||
</Form.Item>
|
||||
<Form.Item name="professionalLevelName" noStyle />
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Form.Item
|
||||
name="evaluatorCertNo"
|
||||
label="证书编号"
|
||||
rules={[{ max: 50, message: "证书编号不能超过100个字符" }]}
|
||||
>
|
||||
<Input placeholder="请输入安全评价师证书编号" maxLength={50} showCount />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
|
||||
<Col span={12}>
|
||||
<Form.Item name="educationTypeCode" label="学历类型">
|
||||
<Select
|
||||
|
|
@ -667,7 +656,10 @@ function StaffFormModal({
|
|||
allowClear
|
||||
options={EDUCATION_TYPE_OPTIONS}
|
||||
onChange={(_val, option) => {
|
||||
form.setFieldValue("educationTypeName", option?.label || undefined);
|
||||
form.setFieldValue(
|
||||
"educationTypeName",
|
||||
option?.label || undefined,
|
||||
);
|
||||
}}
|
||||
/>
|
||||
</Form.Item>
|
||||
|
|
@ -690,14 +682,15 @@ function StaffFormModal({
|
|||
<Form.Item name="educationLevelName" noStyle />
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Form.Item
|
||||
name="titleCode"
|
||||
label="职称"
|
||||
rules={[{ required: false, message: "请选择职称" }]}
|
||||
>
|
||||
<Select placeholder="请选择职称" allowClear options={TITLE_LEVEL_OPTIONS} />
|
||||
</Form.Item>
|
||||
<AttachmentUpload
|
||||
name="proofMaterialUrl"
|
||||
label="学历证明材料"
|
||||
extra={"最多上传5个pdf,doc,docx,图片格式文件"}
|
||||
accept={".pdf,.doc,.docx,.png,.jpg,.jpeg,.bmp,.webp"}
|
||||
maxCount={5}
|
||||
/>
|
||||
</Col>
|
||||
|
||||
<Col span={12}>
|
||||
<Form.Item
|
||||
name="registerEngineerFlag"
|
||||
|
|
@ -712,12 +705,128 @@ function StaffFormModal({
|
|||
</Col>
|
||||
<Col span={12}>
|
||||
<Form.Item name="technicalDirectorFlag" label="是否技术负责人">
|
||||
<Select placeholder="请选择" allowClear options={[{ label: "是", value: true }, { label: "否", value: false }]} />
|
||||
<Select
|
||||
placeholder="请选择"
|
||||
allowClear
|
||||
options={[
|
||||
{ label: "是", value: true },
|
||||
{ label: "否", value: false },
|
||||
]}
|
||||
/>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Form.Item name="processControlLeaderFlag" label="是否过程控制负责人">
|
||||
<Select placeholder="请选择" allowClear options={[{ label: "是", value: true }, { label: "否", value: false }]} />
|
||||
<Form.Item
|
||||
name="processControlLeaderFlag"
|
||||
label="是否过程控制负责人"
|
||||
>
|
||||
<Select
|
||||
placeholder="请选择"
|
||||
allowClear
|
||||
options={[
|
||||
{ label: "是", value: true },
|
||||
{ label: "否", value: false },
|
||||
]}
|
||||
/>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={24}>
|
||||
<Form.Item label="职称信息" required>
|
||||
<Form.List
|
||||
name="titleCodeArr"
|
||||
initialValue={[{}]}
|
||||
rules={[{ required: true, message: "请添加职称信息" }]}
|
||||
>
|
||||
{(fields, { add, remove }) => (
|
||||
<>
|
||||
<Table
|
||||
dataSource={fields}
|
||||
rowKey={(field) => field.key}
|
||||
pagination={false}
|
||||
size="small"
|
||||
bordered
|
||||
locale={{ emptyText: "暂无职称信息,点击下方按钮添加" }}
|
||||
columns={[
|
||||
{
|
||||
title: "行业",
|
||||
width: 200,
|
||||
render: (_, field) => (
|
||||
<Form.Item
|
||||
name={[field.name, "industryCode"]}
|
||||
style={{ marginBottom: 0 }}
|
||||
rules={[
|
||||
{ required: true, message: "请选择行业" },
|
||||
]}
|
||||
>
|
||||
<Select
|
||||
placeholder="请选择行业"
|
||||
allowClear
|
||||
options={QUALIFICATION_INDUSTRY_OPTIONS}
|
||||
/>
|
||||
</Form.Item>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: "职称",
|
||||
width: 120,
|
||||
render: (_, field) => (
|
||||
<Form.Item
|
||||
name={[field.name, "titleCode"]}
|
||||
style={{ marginBottom: 0 }}
|
||||
rules={[
|
||||
{ required: true, message: "请选择职称" },
|
||||
]}
|
||||
>
|
||||
<Select
|
||||
placeholder="请选择职称"
|
||||
allowClear
|
||||
options={TITLE_LEVEL_OPTIONS}
|
||||
/>
|
||||
</Form.Item>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: "证明材料",
|
||||
render: (_, field) => (
|
||||
<AttachmentUpload
|
||||
name={[field.name, "proveUrl"]}
|
||||
rules={[
|
||||
{ required: true, message: "请上传证明材料" },
|
||||
]}
|
||||
accept=".pdf,.doc,.docx,.png,.jpg,.jpeg,.bmp,.webp"
|
||||
maxCount={1}
|
||||
style={{ marginBottom: 0 }}
|
||||
/>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
width: 80,
|
||||
render: (_, field) => (
|
||||
<Button
|
||||
type="link"
|
||||
danger
|
||||
size="small"
|
||||
disabled={fields.length <= 1}
|
||||
onClick={() => remove(field.name)}
|
||||
>
|
||||
删除
|
||||
</Button>
|
||||
),
|
||||
},
|
||||
]}
|
||||
/>
|
||||
<Button
|
||||
type="dashed"
|
||||
onClick={() => add()}
|
||||
block
|
||||
style={{ marginTop: 12 }}
|
||||
>
|
||||
添加职称信息
|
||||
</Button>
|
||||
</>
|
||||
)}
|
||||
</Form.List>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={24}>
|
||||
|
|
@ -726,7 +835,12 @@ function StaffFormModal({
|
|||
label="出版学术专著、专利、获奖、发表学术论文等"
|
||||
rules={[{ max: 500, message: "不能超过1000个字符" }]}
|
||||
>
|
||||
<Input.TextArea rows={2} placeholder="请输入" maxLength={500} showCount />
|
||||
<Input.TextArea
|
||||
rows={2}
|
||||
placeholder="请输入"
|
||||
maxLength={500}
|
||||
showCount
|
||||
/>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={24}>
|
||||
|
|
@ -735,27 +849,25 @@ function StaffFormModal({
|
|||
label="自我申报的专业能力及认定方式"
|
||||
rules={[{ max: 500, message: "不能超过1000个字符" }]}
|
||||
>
|
||||
<Input.TextArea rows={2} placeholder="请输入" maxLength={500} showCount />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={24}>
|
||||
<Form.Item
|
||||
name="workExperience"
|
||||
label="主要学习工作经历"
|
||||
|
||||
>
|
||||
<Input.TextArea rows={3} placeholder="请输入" maxLength={500} showCount />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={24}>
|
||||
<AttachmentUpload
|
||||
name="proofMaterialUrl"
|
||||
label="申报专业能力证明材料"
|
||||
extra={'最多上传5个pdf,doc,docx,图片格式文件'}
|
||||
accept={'.pdf,.doc,.docx,.png,.jpg,.jpeg,.bmp,.webp'}
|
||||
maxCount={5}
|
||||
<Input.TextArea
|
||||
rows={2}
|
||||
placeholder="请输入"
|
||||
maxLength={500}
|
||||
showCount
|
||||
/>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={24}>
|
||||
<Form.Item name="workExperience" label="主要学习工作经历">
|
||||
<Input.TextArea
|
||||
rows={3}
|
||||
placeholder="请输入"
|
||||
maxLength={500}
|
||||
showCount
|
||||
/>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
|
||||
<Col span={12}>
|
||||
<Form.Item
|
||||
name="currentAddress"
|
||||
|
|
@ -783,15 +895,6 @@ function StaffFormModal({
|
|||
<Input placeholder="请输入毕业院校" maxLength={200} showCount />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Form.Item
|
||||
name="major"
|
||||
label="专业"
|
||||
rules={[{ max: 100, message: "专业不能超过100个字符" }]}
|
||||
>
|
||||
<Input placeholder="请输入专业" maxLength={100} showCount />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
</Row>
|
||||
</Form>
|
||||
</Modal>
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import {
|
|||
import { CloseOutlined } from "@ant-design/icons";
|
||||
import { NS_STAFF_INFO, NS_ORG_DEPARTMENT } from "~/enumerate/namespace";
|
||||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { QUALIFICATION_INDUSTRY_OPTIONS_MAP, PROFESSIONAL_LEVEL_OPTIONS_MAP, TITLE_LEVEL_MAP } from "~/enumerate/enterpriseOptions";
|
||||
import { QUALIFICATION_INDUSTRY_OPTIONS_MAP, TITLE_LEVEL_MAP } from "~/enumerate/enterpriseOptions";
|
||||
|
||||
|
||||
|
||||
|
|
@ -129,15 +129,7 @@ const StaffPickerModal = (props) => {
|
|||
return status || "-";
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "职业等级",
|
||||
dataIndex: "professionalLevelCode",
|
||||
ellipsis: true,
|
||||
render: (code) => {
|
||||
const status = PROFESSIONAL_LEVEL_OPTIONS_MAP[code];
|
||||
return status || "-";
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
title: "职称",
|
||||
dataIndex: "titleCode",
|
||||
|
|
|
|||
Loading…
Reference in New Issue