项目负责人选择
parent
ba98f78280
commit
2664844039
|
|
@ -30,7 +30,7 @@
|
|||
"lodash-es": "^4.17.21",
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0",
|
||||
"zy-react-library": "^1.2.3"
|
||||
"zy-react-library": "^1.2.14"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@antfu/eslint-config": "^5.4.1",
|
||||
|
|
|
|||
|
|
@ -90,3 +90,11 @@ export const qualificationsTypeList = declareRequest(
|
|||
"qualificationStatisticsLoading",
|
||||
`Post > @/xgfManager/qualifications/getReviewedQualificationsTypeName`,
|
||||
);
|
||||
export const trainingUserListAll = declareRequest(
|
||||
"qualificationStatisticsLoading",
|
||||
`Post > @/edu/trainingUser/listEduUser`,
|
||||
);
|
||||
export const trainingUserListPage = declareRequest(
|
||||
"qualificationStatisticsLoading",
|
||||
`Post > @/edu/trainingUser/listEduUserPage`,
|
||||
);
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ import AddIcon from "zy-react-library/components/Icon/AddIcon";
|
|||
import DepartmentLeftTree from "zy-react-library/components/LeftTree/Department/Gwj";
|
||||
import Page from "zy-react-library/components/Page";
|
||||
import Search from "zy-react-library/components/Search";
|
||||
import DictionarySelect from "zy-react-library/components/Select/Dictionary";
|
||||
import PersonnelSelect from "zy-react-library/components/Select/Personnel/Gwj";
|
||||
import DepartmentSelectTree from "zy-react-library/components/SelectTree/Department/Gwj";
|
||||
import Table from "zy-react-library/components/Table";
|
||||
|
|
@ -135,6 +134,7 @@ function Add(props) {
|
|||
ref={stepTwoRef}
|
||||
formValues={formValues}
|
||||
query={query}
|
||||
useRz={props.useRz}
|
||||
setUsercontentAddCmdList={setUsercontentAddCmdList}
|
||||
setProjectFileAddCmdList={setProjectFileAddCmdList}
|
||||
projectFileAddCmdList={projectFileAddCmdList}
|
||||
|
|
@ -164,6 +164,7 @@ const StepOneComponent = (props) => {
|
|||
const startProjectTime = Form.useWatch("startProjectTime", form); // 项目开始时间
|
||||
const [deptList, setDeptList] = useState([]);
|
||||
const [userList, setUserList] = useState([]);
|
||||
const [projectLeaderListAll, setProjectLeaderListAll] = useState([]);
|
||||
const [qualificationsTypeList, setQualificationsTypeList] = useState([]);
|
||||
// 获取项目执行属地公司数据
|
||||
const getCorpInfoList = async () => {
|
||||
|
|
@ -193,6 +194,10 @@ const StepOneComponent = (props) => {
|
|||
);
|
||||
setUserList(uniqueUsers);
|
||||
};
|
||||
const getTrainingUserListAll = async () => {
|
||||
const { data } = await props["trainingUserListAll"]();
|
||||
setProjectLeaderListAll(data);
|
||||
};
|
||||
const handleProjectLeaderChange = (label, extraInfo) => {
|
||||
if (!extraInfo.userId)
|
||||
return;
|
||||
|
|
@ -232,6 +237,7 @@ const StepOneComponent = (props) => {
|
|||
useEffect(() => {
|
||||
getCorpInfoList();
|
||||
getQualificationsTypeList();
|
||||
getTrainingUserListAll();
|
||||
if (props.formValues.isLocalCompany === 0) {
|
||||
getDeptList(props.formValues.qualificationsTypeId);
|
||||
getUserList(props.formValues.manageDeptId);
|
||||
|
|
@ -284,7 +290,7 @@ const StepOneComponent = (props) => {
|
|||
<PersonnelSelect
|
||||
isNeedCorpInfoId={true}
|
||||
params={{ corpinfoId: props.userInfo?.corpinfoId || "" }}
|
||||
extraParams={props.useRz ? { noMain: 1, rzFlag: 1 } : { noMain: 1, flowFlag: 0 }}
|
||||
extraParams={{ noMain: 1, rzFlag: 1 }}
|
||||
isNeedDepartmentId={false}
|
||||
onGetLabel={(label) => {
|
||||
form.setFieldValue("userName", label);
|
||||
|
|
@ -313,6 +319,38 @@ const StepOneComponent = (props) => {
|
|||
}}
|
||||
/>
|
||||
),
|
||||
hidden: !props.useRz,
|
||||
},
|
||||
{
|
||||
name: "userId",
|
||||
label: "项目负责人",
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: projectLeaderListAll,
|
||||
itemsField: { labelKey: "name", valueKey: "id" },
|
||||
hidden: !!props.useRz,
|
||||
componentProps: {
|
||||
onChange: (event) => {
|
||||
const item = projectLeaderListAll.find(i => i.id === event);
|
||||
if (item) {
|
||||
form.setFieldValue("userName", item.name);
|
||||
const extraInfo = {
|
||||
name: item.name,
|
||||
phone: item.phone || "",
|
||||
postName: item.postName || "",
|
||||
departmentId: item.departmentId || "",
|
||||
departmentName: item.departmentName || "",
|
||||
userId: item.id,
|
||||
};
|
||||
handleProjectLeaderChange(item.name, extraInfo);
|
||||
}
|
||||
else {
|
||||
const newUserList = props.usercontentAddCmdList.filter(
|
||||
item => item.projectLeader !== 1,
|
||||
);
|
||||
props.setUsercontentAddCmdList(newUserList);
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
{ name: "userName", label: "项目负责人", onlyForLabel: true },
|
||||
{ name: "initiationTime", label: "立项时间", render: FORM_ITEM_RENDER_ENUM.DATE },
|
||||
|
|
@ -983,6 +1021,7 @@ const StepTwoComponent = forwardRef((props, ref) => {
|
|||
)}
|
||||
{usercontentOpen && (
|
||||
<UserSelect
|
||||
useRz={props.useRz}
|
||||
data={fetchUserList}
|
||||
onCancel={() => {
|
||||
setUsercontentOpen(false);
|
||||
|
|
@ -1081,13 +1120,17 @@ const UserSelectComponent = (props) => {
|
|||
const [selectedRowKeys, setSelectedRowKeys] = useState([]); // 存储选中的行键
|
||||
const [selectedRows, setSelectedRows] = useState([]); // 存储选中行的完整数据
|
||||
const [inDepartmentId, setInDepartmentId] = useState([]); // 存储已选择的部门id
|
||||
const { tableProps, getData } = useTable(props["userList"], {
|
||||
const { tableProps, getData } = useTable(props[props.useRz ? "trainingUserListPage" : "userList"], {
|
||||
form,
|
||||
params: {
|
||||
noMain: 1,
|
||||
inDepartmentId,
|
||||
eqEmploymentFlag: 1, // 在职
|
||||
},
|
||||
params: () => (
|
||||
props.useRz
|
||||
? {}
|
||||
: {
|
||||
noMain: 1,
|
||||
inDepartmentId,
|
||||
eqEmploymentFlag: 1, // 在职
|
||||
}
|
||||
),
|
||||
useStorageQueryCriteria: false,
|
||||
});
|
||||
const projectLeader = useMemo(() => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue