dev_1.0.1
tangjie 2026-07-14 11:57:53 +08:00
parent 832266252a
commit fb650b07cc
2 changed files with 36 additions and 1 deletions

View File

@ -33,3 +33,9 @@ export const staffInfoResetPassword = declareRequest(
"staffInfoLoading", "staffInfoLoading",
safeAction(async ({ id }) => apiPost("/safetyEval/org-personnel/reset-password", { data: asId(id) })), 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 || []",
);

View File

@ -20,7 +20,6 @@ import ControlWrapper from "@cqsjjb/jjb-react-admin-component/ControlWrapper";
import TableAction from "@cqsjjb/jjb-react-admin-component/TableAction"; import TableAction from "@cqsjjb/jjb-react-admin-component/TableAction";
import { AntdTableFuncControl } from "@cqsjjb/jjb-common-decorator/antd"; import { AntdTableFuncControl } from "@cqsjjb/jjb-common-decorator/antd";
import { tools } from "@cqsjjb/jjb-common-lib"; 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 { NS_STAFF_INFO, NS_ORG_DEPARTMENT } from "~/enumerate/namespace";
import { import {
EDUCATION_LEVEL_OPTIONS, EDUCATION_LEVEL_OPTIONS,
@ -293,6 +292,8 @@ function PersonnelInfoPage(props) {
orgDepartmentTreeData={orgDepartmentTreeData} orgDepartmentTreeData={orgDepartmentTreeData}
staffInfoAdd={props.staffInfoAdd} staffInfoAdd={props.staffInfoAdd}
staffInfoEdit={props.staffInfoEdit} staffInfoEdit={props.staffInfoEdit}
queryBasicDisciplineMajor={props.queryBasicDisciplineMajor}
staffInfo={props.staffInfo}
deptOptions={deptOptions} deptOptions={deptOptions}
positionOptions={positionOptions} positionOptions={positionOptions}
onCancel={() => { onCancel={() => {
@ -322,6 +323,8 @@ function StaffFormModal({
staffInfoGet, staffInfoGet,
staffInfoAdd, staffInfoAdd,
staffInfoEdit, staffInfoEdit,
queryBasicDisciplineMajor,
staffInfo,
deptOptions, deptOptions,
orgDepartmentTreeData, orgDepartmentTreeData,
onCancel, onCancel,
@ -367,6 +370,11 @@ function StaffFormModal({
} }
}; };
const loadBasicDisciplineMajors = async (industryCode) => {
if (!industryCode) return;
await queryBasicDisciplineMajor({ industryCode, pageSize: 999 });
};
useEffect(() => { useEffect(() => {
if (open && !wasOpenRef.current) { if (open && !wasOpenRef.current) {
if (!currentId) { if (!currentId) {
@ -404,6 +412,7 @@ function StaffFormModal({
} }
form.setFieldsValue(setFields); form.setFieldsValue(setFields);
loadBasicDisciplineMajors(data.qualScope);
}) })
.finally(() => { .finally(() => {
if (!cancelled) setDetailLoading(false); if (!cancelled) setDetailLoading(false);
@ -430,6 +439,10 @@ function StaffFormModal({
form.setFieldValue("postId", undefined); form.setFieldValue("postId", undefined);
loadPositionsByDept(changed.deptId); loadPositionsByDept(changed.deptId);
} }
if ("qualScope" in changed) {
form.setFieldValue("basicDisciplineMajorId", undefined);
loadBasicDisciplineMajors(changed.qualScope);
}
}; };
const handleSubmit = async (values) => { const handleSubmit = async (values) => {
@ -607,6 +620,22 @@ function StaffFormModal({
/> />
</Form.Item> </Form.Item>
</Col> </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}> <Col span={12}>
<Form.Item name="professionalLevelCode" label="职业等级"> <Form.Item name="professionalLevelCode" label="职业等级">
<Select <Select