feat
parent
832266252a
commit
fb650b07cc
|
|
@ -33,3 +33,9 @@ export const staffInfoResetPassword = declareRequest(
|
|||
"staffInfoLoading",
|
||||
safeAction(async ({ id }) => apiPost("/safetyEval/org-personnel/reset-password", { data: asId(id) })),
|
||||
);
|
||||
|
||||
export const queryBasicDisciplineMajor = declareRequest(
|
||||
"staffInfoLoading",
|
||||
"Get > /safetyEval/basic-discipline-major",
|
||||
"basicDisciplineMajorList: [] | res.data || []",
|
||||
);
|
||||
|
|
@ -20,7 +20,6 @@ import ControlWrapper from "@cqsjjb/jjb-react-admin-component/ControlWrapper";
|
|||
import TableAction from "@cqsjjb/jjb-react-admin-component/TableAction";
|
||||
import { AntdTableFuncControl } from "@cqsjjb/jjb-common-decorator/antd";
|
||||
import { tools } from "@cqsjjb/jjb-common-lib";
|
||||
import { Get } from "@cqsjjb/jjb-common-lib/http";
|
||||
import { NS_STAFF_INFO, NS_ORG_DEPARTMENT } from "~/enumerate/namespace";
|
||||
import {
|
||||
EDUCATION_LEVEL_OPTIONS,
|
||||
|
|
@ -293,6 +292,8 @@ function PersonnelInfoPage(props) {
|
|||
orgDepartmentTreeData={orgDepartmentTreeData}
|
||||
staffInfoAdd={props.staffInfoAdd}
|
||||
staffInfoEdit={props.staffInfoEdit}
|
||||
queryBasicDisciplineMajor={props.queryBasicDisciplineMajor}
|
||||
staffInfo={props.staffInfo}
|
||||
deptOptions={deptOptions}
|
||||
positionOptions={positionOptions}
|
||||
onCancel={() => {
|
||||
|
|
@ -322,6 +323,8 @@ function StaffFormModal({
|
|||
staffInfoGet,
|
||||
staffInfoAdd,
|
||||
staffInfoEdit,
|
||||
queryBasicDisciplineMajor,
|
||||
staffInfo,
|
||||
deptOptions,
|
||||
orgDepartmentTreeData,
|
||||
onCancel,
|
||||
|
|
@ -367,6 +370,11 @@ function StaffFormModal({
|
|||
}
|
||||
};
|
||||
|
||||
const loadBasicDisciplineMajors = async (industryCode) => {
|
||||
if (!industryCode) return;
|
||||
await queryBasicDisciplineMajor({ industryCode, pageSize: 999 });
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (open && !wasOpenRef.current) {
|
||||
if (!currentId) {
|
||||
|
|
@ -404,6 +412,7 @@ function StaffFormModal({
|
|||
}
|
||||
|
||||
form.setFieldsValue(setFields);
|
||||
loadBasicDisciplineMajors(data.qualScope);
|
||||
})
|
||||
.finally(() => {
|
||||
if (!cancelled) setDetailLoading(false);
|
||||
|
|
@ -430,6 +439,10 @@ function StaffFormModal({
|
|||
form.setFieldValue("postId", undefined);
|
||||
loadPositionsByDept(changed.deptId);
|
||||
}
|
||||
if ("qualScope" in changed) {
|
||||
form.setFieldValue("basicDisciplineMajorId", undefined);
|
||||
loadBasicDisciplineMajors(changed.qualScope);
|
||||
}
|
||||
};
|
||||
|
||||
const handleSubmit = async (values) => {
|
||||
|
|
@ -607,6 +620,22 @@ function StaffFormModal({
|
|||
/>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Form.Item name="basicDisciplineMajorId" label="基础学科专业">
|
||||
<Select
|
||||
placeholder="请先选择资质范围"
|
||||
allowClear
|
||||
showSearch
|
||||
optionFilterProp="label"
|
||||
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
|
||||
|
|
|
|||
Loading…
Reference in New Issue