|
|
|
@ -11,6 +11,8 @@ import {
|
|
|
|
|
Modal,
|
|
|
|
|
Popconfirm,
|
|
|
|
|
message,
|
|
|
|
|
Image,
|
|
|
|
|
InputNumber,
|
|
|
|
|
} from 'antd';
|
|
|
|
|
import { TableListItem } from '../data';
|
|
|
|
|
import {
|
|
|
|
@ -18,6 +20,7 @@ import {
|
|
|
|
|
delFamilyMembers,
|
|
|
|
|
delHonor,
|
|
|
|
|
delWorkExperience,
|
|
|
|
|
exportEmployeeDetail,
|
|
|
|
|
getAllEducationResume,
|
|
|
|
|
getAllFamilyMembers,
|
|
|
|
|
getAllHonor,
|
|
|
|
@ -36,6 +39,7 @@ import UpdateHonorForm from './UpdateHonorForm';
|
|
|
|
|
import { useReactToPrint } from 'react-to-print';
|
|
|
|
|
//@ts-ignore
|
|
|
|
|
import Html2Pdf from 'js-html2pdf';
|
|
|
|
|
import EmptyImage from '@/assets/empty.png'
|
|
|
|
|
const { Option } = Select;
|
|
|
|
|
|
|
|
|
|
export interface FormValueType extends Partial<TableListItem> {}
|
|
|
|
@ -47,6 +51,23 @@ export interface UpdateFormProps {
|
|
|
|
|
values: Partial<TableListItem>;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 批量导出
|
|
|
|
|
* @param selectedRows
|
|
|
|
|
*/
|
|
|
|
|
const handleExportEmployeeDetail = async ({ ...params }: any) => {
|
|
|
|
|
const hide = message.loading('正在导出');
|
|
|
|
|
try {
|
|
|
|
|
await exportEmployeeDetail(params);
|
|
|
|
|
hide();
|
|
|
|
|
return true;
|
|
|
|
|
} catch (error) {
|
|
|
|
|
hide();
|
|
|
|
|
message.error('处理失败,请重试');
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 更新节点
|
|
|
|
|
* @param fields
|
|
|
|
@ -175,6 +196,10 @@ const UpdateForm: React.FC<UpdateFormProps> = (props) => {
|
|
|
|
|
employeeName: props.values.employeeName,
|
|
|
|
|
employeeNo: props.values.employeeNo,
|
|
|
|
|
unitId: props.values.unitId,
|
|
|
|
|
age: props.values.age,
|
|
|
|
|
departmentId: props.values.departmentId,
|
|
|
|
|
sex: props.values.sex,
|
|
|
|
|
photo: props.values.photo,
|
|
|
|
|
postId: props.values.postId,
|
|
|
|
|
groupsId: props.values.groupsId,
|
|
|
|
|
ptqId: props.values.ptqId,
|
|
|
|
@ -192,6 +217,7 @@ const UpdateForm: React.FC<UpdateFormProps> = (props) => {
|
|
|
|
|
const [ptqList, setPtqList] = useState<any[]>([]);
|
|
|
|
|
const [skillLevelList, setSkillLevelList] = useState<any[]>([]);
|
|
|
|
|
const [highestEducationList, setHighestEducationList] = useState<any[]>([]);
|
|
|
|
|
const [departmentList, setDepartmentList] = useState<any[]>([]);
|
|
|
|
|
|
|
|
|
|
const [educationResumeList, setEducationResumeList] = useState<any[]>([]);
|
|
|
|
|
const [familyMembersList, setFamilyMembersList] = useState<any[]>([]);
|
|
|
|
@ -207,17 +233,29 @@ const UpdateForm: React.FC<UpdateFormProps> = (props) => {
|
|
|
|
|
|
|
|
|
|
const educationResumeColumns: ColumnsType<any> = [
|
|
|
|
|
{
|
|
|
|
|
title: '学历',
|
|
|
|
|
dataIndex: 'education',
|
|
|
|
|
title: '最高学历',
|
|
|
|
|
dataIndex: 'highestEducation',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '学校',
|
|
|
|
|
title: '最高学历学校',
|
|
|
|
|
dataIndex: 'school',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '专业',
|
|
|
|
|
dataIndex: 'speciality',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '就业学历',
|
|
|
|
|
dataIndex: 'education',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '本科学历学校',
|
|
|
|
|
dataIndex: 'undergraduateSchools',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '本科学历专业',
|
|
|
|
|
dataIndex: 'undergraduateMajor',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '时间',
|
|
|
|
|
dataIndex: 'intake',
|
|
|
|
@ -228,17 +266,29 @@ const UpdateForm: React.FC<UpdateFormProps> = (props) => {
|
|
|
|
|
];
|
|
|
|
|
const educationResumeColumns1: ColumnsType<any> = [
|
|
|
|
|
{
|
|
|
|
|
title: '学历',
|
|
|
|
|
dataIndex: 'education',
|
|
|
|
|
title: '最高学历',
|
|
|
|
|
dataIndex: 'highestEducation',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '学校',
|
|
|
|
|
title: '最高学历学校',
|
|
|
|
|
dataIndex: 'school',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '专业',
|
|
|
|
|
dataIndex: 'speciality',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '就业学历',
|
|
|
|
|
dataIndex: 'education',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '本科学历学校',
|
|
|
|
|
dataIndex: 'undergraduateSchools',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '本科学历专业',
|
|
|
|
|
dataIndex: 'undergraduateMajor',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '入学时间',
|
|
|
|
|
dataIndex: 'intake',
|
|
|
|
@ -457,10 +507,14 @@ const UpdateForm: React.FC<UpdateFormProps> = (props) => {
|
|
|
|
|
let ptq;
|
|
|
|
|
let skillLevel;
|
|
|
|
|
let highestEducation;
|
|
|
|
|
let department;
|
|
|
|
|
|
|
|
|
|
if (fieldsValue.unitId) {
|
|
|
|
|
unit = unitList.find((e) => e.id === fieldsValue.unitId).settingValue;
|
|
|
|
|
}
|
|
|
|
|
if (fieldsValue.departmentId) {
|
|
|
|
|
department = departmentList.find((e) => e.id === fieldsValue.departmentId).settingValue;
|
|
|
|
|
}
|
|
|
|
|
if (fieldsValue.postId) {
|
|
|
|
|
post = postList.find((e) => e.id === fieldsValue.postId).settingValue;
|
|
|
|
|
}
|
|
|
|
@ -490,6 +544,7 @@ const UpdateForm: React.FC<UpdateFormProps> = (props) => {
|
|
|
|
|
ptq,
|
|
|
|
|
skillLevel,
|
|
|
|
|
highestEducation,
|
|
|
|
|
department
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -524,6 +579,11 @@ const UpdateForm: React.FC<UpdateFormProps> = (props) => {
|
|
|
|
|
setUnitList(res.data);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
getAllInfoSettingValueBySettingName({ settingName: '部门' }).then((res) => {
|
|
|
|
|
if (res.retcode && res.data) {
|
|
|
|
|
setDepartmentList(res.data);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}, []);
|
|
|
|
|
|
|
|
|
|
const getData = (employeeNo: string, type: number) => {
|
|
|
|
@ -652,6 +712,11 @@ const UpdateForm: React.FC<UpdateFormProps> = (props) => {
|
|
|
|
|
导出PDF
|
|
|
|
|
</Button>
|
|
|
|
|
) : null}
|
|
|
|
|
{values.id ? (
|
|
|
|
|
<Button style={{ marginRight: 8 }} onClick={() => handleExportEmployeeDetail({employeeNo: values.employeeNo})} type="primary">
|
|
|
|
|
导出Excel
|
|
|
|
|
</Button>
|
|
|
|
|
) : null}
|
|
|
|
|
<Button onClick={handleSubmit} type="primary">
|
|
|
|
|
保存
|
|
|
|
|
</Button>
|
|
|
|
@ -660,6 +725,13 @@ const UpdateForm: React.FC<UpdateFormProps> = (props) => {
|
|
|
|
|
>
|
|
|
|
|
<div id="print" style={{padding: 20}} ref={componentRef}>
|
|
|
|
|
<div style={{ fontSize: 16, marginBottom: 10, fontWeight: 'bold' }}>员工基本信息</div>
|
|
|
|
|
<div style={{marginBottom: 10 }}>
|
|
|
|
|
<Image
|
|
|
|
|
width={200}
|
|
|
|
|
src="12"
|
|
|
|
|
fallback={EmptyImage}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
<Form form={form} labelAlign="left" labelCol={{ span: 7 }} initialValues={formVals}>
|
|
|
|
|
<Row gutter={16}>
|
|
|
|
|
<Col span={12}>
|
|
|
|
@ -697,9 +769,24 @@ const UpdateForm: React.FC<UpdateFormProps> = (props) => {
|
|
|
|
|
</Row>
|
|
|
|
|
<Row gutter={16}>
|
|
|
|
|
<Col span={12}>
|
|
|
|
|
<Form.Item name="unitId" label="单位">
|
|
|
|
|
<Select bordered={!isPrint} showArrow={!isPrint} placeholder="请选择单位" allowClear>
|
|
|
|
|
{unitList.map((item) => (
|
|
|
|
|
<Form.Item name="sex" label="性别">
|
|
|
|
|
<Select bordered={!isPrint} showArrow={!isPrint} placeholder="请选择性别" allowClear>
|
|
|
|
|
<Option value={1} key={1}>男</Option>
|
|
|
|
|
<Option value={2} key={2}>女</Option>
|
|
|
|
|
</Select>
|
|
|
|
|
</Form.Item>
|
|
|
|
|
</Col>
|
|
|
|
|
<Col span={12}>
|
|
|
|
|
<Form.Item name="age" label="年龄">
|
|
|
|
|
<InputNumber bordered={!isPrint} placeholder="请输入年龄" />
|
|
|
|
|
</Form.Item>
|
|
|
|
|
</Col>
|
|
|
|
|
</Row>
|
|
|
|
|
<Row gutter={16}>
|
|
|
|
|
<Col span={12}>
|
|
|
|
|
<Form.Item name="departmentId" label="部门">
|
|
|
|
|
<Select bordered={!isPrint} showArrow={!isPrint} placeholder="请选择部门" allowClear>
|
|
|
|
|
{departmentList.map((item) => (
|
|
|
|
|
<Option value={item.id} key={item.id}>
|
|
|
|
|
{item.settingValue}
|
|
|
|
|
</Option>
|
|
|
|
@ -721,9 +808,9 @@ const UpdateForm: React.FC<UpdateFormProps> = (props) => {
|
|
|
|
|
</Row>
|
|
|
|
|
<Row gutter={16}>
|
|
|
|
|
<Col span={12}>
|
|
|
|
|
<Form.Item name="groupsId" label="班组">
|
|
|
|
|
<Select bordered={!isPrint} showArrow={!isPrint} placeholder="请选择班组" allowClear>
|
|
|
|
|
{groupsList.map((item) => (
|
|
|
|
|
<Form.Item name="unitId" label="单位">
|
|
|
|
|
<Select bordered={!isPrint} showArrow={!isPrint} placeholder="请选择单位" allowClear>
|
|
|
|
|
{unitList.map((item) => (
|
|
|
|
|
<Option value={item.id} key={item.id}>
|
|
|
|
|
{item.settingValue}
|
|
|
|
|
</Option>
|
|
|
|
@ -745,9 +832,9 @@ const UpdateForm: React.FC<UpdateFormProps> = (props) => {
|
|
|
|
|
</Row>
|
|
|
|
|
<Row gutter={16}>
|
|
|
|
|
<Col span={12}>
|
|
|
|
|
<Form.Item name="ptqId" label="专业技术资格">
|
|
|
|
|
<Select bordered={!isPrint} showArrow={!isPrint} placeholder="请选择专业技术资格" allowClear>
|
|
|
|
|
{ptqList.map((item) => (
|
|
|
|
|
<Form.Item name="groupsId" label="班组">
|
|
|
|
|
<Select bordered={!isPrint} showArrow={!isPrint} placeholder="请选择班组" allowClear>
|
|
|
|
|
{groupsList.map((item) => (
|
|
|
|
|
<Option value={item.id} key={item.id}>
|
|
|
|
|
{item.settingValue}
|
|
|
|
|
</Option>
|
|
|
|
@ -767,6 +854,19 @@ const UpdateForm: React.FC<UpdateFormProps> = (props) => {
|
|
|
|
|
</Form.Item>
|
|
|
|
|
</Col>
|
|
|
|
|
</Row>
|
|
|
|
|
<Row gutter={16}>
|
|
|
|
|
<Col span={12}>
|
|
|
|
|
<Form.Item name="ptqId" label="专业技术资格">
|
|
|
|
|
<Select bordered={!isPrint} showArrow={!isPrint} placeholder="请选择专业技术资格" allowClear>
|
|
|
|
|
{ptqList.map((item) => (
|
|
|
|
|
<Option value={item.id} key={item.id}>
|
|
|
|
|
{item.settingValue}
|
|
|
|
|
</Option>
|
|
|
|
|
))}
|
|
|
|
|
</Select>
|
|
|
|
|
</Form.Item>
|
|
|
|
|
</Col>
|
|
|
|
|
</Row>
|
|
|
|
|
</Form>
|
|
|
|
|
{values.id ? (
|
|
|
|
|
<>
|
|
|
|
@ -787,6 +887,9 @@ const UpdateForm: React.FC<UpdateFormProps> = (props) => {
|
|
|
|
|
<Table
|
|
|
|
|
bordered
|
|
|
|
|
size="middle"
|
|
|
|
|
scroll={{
|
|
|
|
|
x: 'max-content'
|
|
|
|
|
}}
|
|
|
|
|
columns={educationResumeColumns}
|
|
|
|
|
rowKey="id"
|
|
|
|
|
dataSource={educationResumeList}
|
|
|
|
|