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