diff --git a/web/client/src/sections/humanAffairs/containers/departmentTrain/departmentTrainRecord.jsx b/web/client/src/sections/humanAffairs/containers/departmentTrain/departmentTrainRecord.jsx index 9790ff7..65a0cd1 100644 --- a/web/client/src/sections/humanAffairs/containers/departmentTrain/departmentTrainRecord.jsx +++ b/web/client/src/sections/humanAffairs/containers/departmentTrain/departmentTrainRecord.jsx @@ -6,7 +6,9 @@ import EditModal from './editModal' import ImportModal from './importModal' import { SkeletonScreen } from "$components"; import '../../style.less' - +const DepartmentTrainType = ["部门内部培训", "跨部门培训", "外部培训", "公司内训"]; +const DepartmentTrainMethod = ["线上", "线下"]; +const DepartmentTrainAppraisalMethod = ["笔试", "线上考试", "培训总结", "口试", "实操", "无"]; const DepartmentTrainRecord = (props) => { const { dispatch, actions } = props; const { humanAffairs } = actions; @@ -220,11 +222,17 @@ const DepartmentTrainRecord = (props) => { { modalV ? closeAndFetch()} onCancel={() => setModalV(false)} /> : '' } { importModalV ? { setImportModalV(false); getDepartmentTrainRecordList(); diff --git a/web/client/src/sections/humanAffairs/containers/departmentTrain/editModal.js b/web/client/src/sections/humanAffairs/containers/departmentTrain/editModal.js index 8589533..7a2d842 100644 --- a/web/client/src/sections/humanAffairs/containers/departmentTrain/editModal.js +++ b/web/client/src/sections/humanAffairs/containers/departmentTrain/editModal.js @@ -3,7 +3,8 @@ import { connect } from "react-redux"; import { Select, Modal, Form, Button, Toast } from "@douyinfe/semi-ui"; import { IconUpload } from '@douyinfe/semi-icons'; const EditModal = (props) => { - const { dispatch, actions, user, onCancel, dataToEdit, apiRoot, close } = props; + const { dispatch, actions, user, onCancel, dataToEdit, apiRoot, close, + DepartmentTrainType, DepartmentTrainMethod, DepartmentTrainAppraisalMethod } = props; const { humanAffairs } = actions; const form = useRef();//表单 const [options, setOptions] = useState([]); @@ -121,16 +122,20 @@ const EditModal = (props) => { > {options} - + placeholder='请选择培训类型' + filter + rules={[{ required: true, message: '请选择培训类型' }]} + > + {DepartmentTrainType.map((d, i) => + {d} + )} + { rules={[{ required: true, message: "培训时间不可空" }]} disabled={dataToEdit?.id ? true : false} /> - { placeholder="请输入培训讲师" showClear /> - - + {DepartmentTrainMethod.map((d, i) => + {d} + )} + + + placeholder='请选择考核形式' + filter + rules={[{ required: true, message: '请选择考核形式' }]} + > + {DepartmentTrainAppraisalMethod.map((d, i) => + {d} + )} + + { - const { dispatch, actions, user, onCancel } = props + const { dispatch, actions, user, onCancel, + DepartmentTrainType, DepartmentTrainMethod, DepartmentTrainAppraisalMethod } = props; const { humanAffairs } = actions; const [msg, setMsg] = useState('') const [loading, setLoading] = useState('') @@ -161,6 +162,12 @@ const ImportModal = props => { if (!trainingType) { error(`第${i + 2}行【实际培训类型】为空,请填写`) return + } else { + let item = DepartmentTrainType.find(d => d === trainingType); + if (!item) { + error(`第${i + 2}行【实际培训类型】数据有误,请确认后重新填写`) + return + } } if (!trainDate) { error(`第${i + 2}行【培训时间】为空,请填写`) @@ -181,18 +188,36 @@ const ImportModal = props => { if (!trainContent) { error(`第${i + 2}行【培训内容】为空,请填写`) return + } else if (trainContent.length > 200) { + error(`第${i + 2}行【培训内容】超出200字符,请调整`) + return } if (!trainMethod) { error(`第${i + 2}行【培训方式】为空,请填写`) return + } else { + let item = DepartmentTrainMethod.find(d => d === trainMethod); + if (!item) { + error(`第${i + 2}行【培训方式】数据有误,请确认后重新填写`) + return + } } if (!appraisalMethod) { error(`第${i + 2}行【考核形式】为空,请填写`) return + } else { + let item = DepartmentTrainAppraisalMethod.find(d => d === appraisalMethod); + if (!item) { + error(`第${i + 2}行【考核形式】数据有误,请确认后重新填写`) + return + } } if (!trainTime) { error(`第${i + 2}行【培训时长】为空,请填写`) return + } else if (trainTime.length > 20) { + error(`第${i + 2}行【培训时长】超出20字符,请调整`) + return } postData.push({ departmentName, trainingType, trainDate, trainContent,