周沫沫历险记 2 years ago
parent
commit
c84e533e7a
  1. 17
      web/client/src/sections/humanAffairs/containers/importPersonalTrainRecord.jsx

17
web/client/src/sections/humanAffairs/containers/importPersonalTrainRecord.jsx

@ -7,7 +7,7 @@ import { IconUpload } from '@douyinfe/semi-icons';
import XLSX from 'xlsx'
//
const ImportPerformanceSummaryModal = props => {
const { dispatch, actions, onCancel,query } = props;
const { dispatch, actions, onCancel, query, user } = props;
const { businessManagement } = actions
const [msg, setMsg] = useState('');
const [loading, setLoading] = useState('');
@ -149,6 +149,21 @@ const ImportPerformanceSummaryModal = props => {
Toast.error(`${i + 2}行,部门为空,请填写`)
return
}
if (user.allDepartment && user.allDepartment.departments) {
let dept = user.allDepartment.departments.find(d => !d.delete && d.name === obj.departmentName);
let personal = dept && dept.departmentUsers.find(e => e.user.name === obj.personalName);
if (dept) {
obj.departmentName = dept.name;
} else if (!dept) {
Toast.error(`${i + 2}行【部门】数据有误,请确认后重新填写`)
return
} else if (personal) {
obj.personalName = personal.user.name;
} else if (!personal) {
Toast.error(`${i + 2}行【姓名】数据有误,请确认后重新填写`)
return
}
}
if (!obj.trainingType) {
Toast.error(`${i + 2}行,培训类型为空,请填写`)
return

Loading…
Cancel
Save