0814 需求变更
parent
c4b03a723f
commit
c5930682ad
|
|
@ -23,3 +23,11 @@ export const evaluationTeamConfigChangeLog = declareRequest(
|
||||||
export const corpInfoList = declareRequest(
|
export const corpInfoList = declareRequest(
|
||||||
`Get > /basicInfo/corpInfo/listAll`,
|
`Get > /basicInfo/corpInfo/listAll`,
|
||||||
);
|
);
|
||||||
|
export const setEvaluationTeamConfigOpenFlag = declareRequest(
|
||||||
|
"evaluationTeamConfigLoading",
|
||||||
|
`Post > @/hiddenEvaluation/evaluationGlobalConfig/openFlag`,
|
||||||
|
);
|
||||||
|
export const getEvaluationTeamConfigOpenFlag = declareRequest(
|
||||||
|
"evaluationTeamConfigLoading",
|
||||||
|
`Get > /hiddenEvaluation/evaluationGlobalConfig/openFlag`,
|
||||||
|
);
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||||
import { Button, Descriptions, Modal } from "antd";
|
import { Button, Descriptions, Divider, Modal } from "antd";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { getLabelName } from "zy-react-library/utils";
|
import { getLabelName } from "zy-react-library/utils";
|
||||||
import { EVALUATION_IS_COMPLIANT_ENUM } from "~/enumerate/constant";
|
import { EVALUATION_IS_COMPLIANT_ENUM } from "~/enumerate/constant";
|
||||||
|
|
@ -21,6 +21,15 @@ const ViewEvaluationModal = (props) => {
|
||||||
getData();
|
getData();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
if (props.inline) {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Divider orientation="left">考评信息</Divider>
|
||||||
|
<Detail list={list} />
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Modal
|
<Modal
|
||||||
title="考评详情"
|
title="考评详情"
|
||||||
|
|
@ -34,6 +43,13 @@ const ViewEvaluationModal = (props) => {
|
||||||
</Button>,
|
</Button>,
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
|
<Detail list={list} />
|
||||||
|
</Modal>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const Detail = ({ list }) => {
|
||||||
|
return (
|
||||||
<Descriptions
|
<Descriptions
|
||||||
column={2}
|
column={2}
|
||||||
bordered
|
bordered
|
||||||
|
|
@ -49,7 +65,6 @@ const ViewEvaluationModal = (props) => {
|
||||||
])),
|
])),
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
</Modal>
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,7 @@
|
||||||
import HiddenInfo from "zy-react-library/components/HiddenInfo/gwj";
|
import HiddenViewPage from "~/pages/Container/Supervision/HiddenEvaluation/HiddenView";
|
||||||
import Page from "zy-react-library/components/Page";
|
|
||||||
|
|
||||||
function HiddenView() {
|
function HiddenView(props) {
|
||||||
return (
|
return (<HiddenViewPage {...props} />);
|
||||||
<Page headerTitle="查看" contentPadding="0 20px 20px 20px">
|
|
||||||
<HiddenInfo />
|
|
||||||
</Page>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default HiddenView;
|
export default HiddenView;
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,7 @@
|
||||||
import HiddenInfo from "zy-react-library/components/HiddenInfo/gwj";
|
import HiddenViewPage from "~/pages/Container/Supervision/PersonnelEvaluation/HiddenView";
|
||||||
import Page from "zy-react-library/components/Page";
|
|
||||||
|
|
||||||
function HiddenView() {
|
function HiddenView(props) {
|
||||||
return (
|
return (<HiddenViewPage {...props} />);
|
||||||
<Page headerTitle="查看" contentPadding="0 20px 20px 20px">
|
|
||||||
<HiddenInfo />
|
|
||||||
</Page>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default HiddenView;
|
export default HiddenView;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import { Permission } from "@cqsjjb/jjb-common-decorator/permission";
|
import { Permission } from "@cqsjjb/jjb-common-decorator/permission";
|
||||||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||||
import { Button, Descriptions, message, Modal, Space } from "antd";
|
import { Button, Descriptions, message, Modal, Space, Switch } from "antd";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import FormBuilder from "zy-react-library/components/FormBuilder";
|
import FormBuilder from "zy-react-library/components/FormBuilder";
|
||||||
import AddIcon from "zy-react-library/components/Icon/AddIcon";
|
import AddIcon from "zy-react-library/components/Icon/AddIcon";
|
||||||
|
|
@ -33,11 +33,35 @@ function List(props) {
|
||||||
const [addModalOpen, setAddModalOpen] = useState(false);
|
const [addModalOpen, setAddModalOpen] = useState(false);
|
||||||
const [viewModalOpen, setViewModalOpen] = useState(false);
|
const [viewModalOpen, setViewModalOpen] = useState(false);
|
||||||
const [changeLogModalOpen, setChangeLogModalOpen] = useState(false);
|
const [changeLogModalOpen, setChangeLogModalOpen] = useState(false);
|
||||||
|
const [isEvaluationClosed, setIsEvaluationClosed] = useState(false);
|
||||||
|
|
||||||
const { tableProps, getData } = useTable(props["evaluationTeamConfigList"], {
|
const { tableProps, getData } = useTable(props["evaluationTeamConfigList"], {
|
||||||
form,
|
form,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const getEvaluationTeamConfigOpenFlag = async () => {
|
||||||
|
const { data } = await props["getEvaluationTeamConfigOpenFlag"]();
|
||||||
|
setIsEvaluationClosed(data);
|
||||||
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
getEvaluationTeamConfigOpenFlag();
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const setEvaluationTeamConfigOpenFlag = (checked) => {
|
||||||
|
Modal.confirm({
|
||||||
|
title: "提示",
|
||||||
|
content: checked ? "是否要关闭考评?打开前考评人员不可操作" : "是否要打开考评?打开后考评人员可操作",
|
||||||
|
onOk: async () => {
|
||||||
|
const { success } = await props["setEvaluationTeamConfigOpenFlag"]({ openFlag: +checked });
|
||||||
|
if (success) {
|
||||||
|
message.success("操作成功");
|
||||||
|
getEvaluationTeamConfigOpenFlag();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Page isShowAllAction={false}>
|
<Page isShowAllAction={false}>
|
||||||
<Search
|
<Search
|
||||||
|
|
@ -51,6 +75,17 @@ function List(props) {
|
||||||
<Table
|
<Table
|
||||||
toolBarRender={() => (
|
toolBarRender={() => (
|
||||||
<Space>
|
<Space>
|
||||||
|
{props.permission("gfd-kpzpz-set") && (
|
||||||
|
<div style={{ display: "flex", alignItems: "center", gap: "8px" }}>
|
||||||
|
<span>是否关闭考评</span>
|
||||||
|
<Switch
|
||||||
|
value={isEvaluationClosed}
|
||||||
|
checkedChildren="是"
|
||||||
|
unCheckedChildren="否"
|
||||||
|
onChange={setEvaluationTeamConfigOpenFlag}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
{props.permission("gfd-kpzpz-add") && (
|
{props.permission("gfd-kpzpz-add") && (
|
||||||
<Button
|
<Button
|
||||||
type="primary"
|
type="primary"
|
||||||
|
|
|
||||||
|
|
@ -13,15 +13,15 @@ import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
|
||||||
import useGetUserInfo from "zy-react-library/hooks/useGetUserInfo";
|
import useGetUserInfo from "zy-react-library/hooks/useGetUserInfo";
|
||||||
import useTable from "zy-react-library/hooks/useTable";
|
import useTable from "zy-react-library/hooks/useTable";
|
||||||
import { getLabelName } from "zy-react-library/utils";
|
import { getLabelName } from "zy-react-library/utils";
|
||||||
import ViewEvaluationModal from "~/components/ViewEvaluationModal";
|
|
||||||
import { EVALUATION_IS_COMPLIANT_ENUM, EVALUATION_RESULT_ENUM } from "~/enumerate/constant";
|
import { EVALUATION_IS_COMPLIANT_ENUM, EVALUATION_RESULT_ENUM } from "~/enumerate/constant";
|
||||||
import { NS_HIDDEN_EVALUATION } from "~/enumerate/namespace";
|
import { NS_EVALUATION_TEAM_CONFIG, NS_HIDDEN_EVALUATION } from "~/enumerate/namespace";
|
||||||
|
|
||||||
function HiddenList(props) {
|
function HiddenList(props) {
|
||||||
const query = useGetUrlQuery();
|
const query = useGetUrlQuery();
|
||||||
const [viewEvaluationModalOpen, setViewEvaluationModalOpen] = useState(false);
|
|
||||||
const [evaluationModalOpen, setEvaluationModalOpen] = useState(false);
|
const [evaluationModalOpen, setEvaluationModalOpen] = useState(false);
|
||||||
const [currentHiddenId, setCurrentHiddenId] = useState("");
|
const [currentHiddenId, setCurrentHiddenId] = useState("");
|
||||||
|
const [isEvaluationClosed, setIsEvaluationClosed] = useState(false);
|
||||||
|
|
||||||
const [form] = Search.useForm();
|
const [form] = Search.useForm();
|
||||||
const { tableProps, getData } = useTable(props["hiddenEvaluationHiddenList"], {
|
const { tableProps, getData } = useTable(props["hiddenEvaluationHiddenList"], {
|
||||||
form,
|
form,
|
||||||
|
|
@ -37,6 +37,15 @@ function HiddenList(props) {
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const getEvaluationTeamConfigOpenFlag = async () => {
|
||||||
|
const { data } = await props["getEvaluationTeamConfigOpenFlag"]();
|
||||||
|
setIsEvaluationClosed(data);
|
||||||
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
getEvaluationTeamConfigOpenFlag();
|
||||||
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Page headerTitle="分公司考评隐患">
|
<Page headerTitle="分公司考评隐患">
|
||||||
<Search
|
<Search
|
||||||
|
|
@ -93,30 +102,21 @@ function HiddenList(props) {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "操作",
|
title: "操作",
|
||||||
width: 230,
|
width: 150,
|
||||||
fixed: "right",
|
fixed: "right",
|
||||||
render: (_, record) => (
|
render: (_, record) => (
|
||||||
<Space>
|
<Space>
|
||||||
<Button
|
<Button
|
||||||
type="link"
|
type="link"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
props.history.push(`./hiddenView?hiddenId=${record.hiddenId}&id=${record.hiddenSnowFlakeId}`);
|
props.history.push(`./hiddenView?hiddenId=${record.hiddenId}&id=${record.hiddenSnowFlakeId}&corpinfoId=${query.corpinfoId}&evaluationType=${query.evaluationType}`);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
查看隐患详情
|
查看
|
||||||
</Button>
|
|
||||||
<Button
|
|
||||||
type="link"
|
|
||||||
onClick={() => {
|
|
||||||
setViewEvaluationModalOpen(true);
|
|
||||||
setCurrentHiddenId(record.hiddenId);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
考评详情
|
|
||||||
</Button>
|
</Button>
|
||||||
{record.currentEvaluationFlag && (
|
{record.currentEvaluationFlag && (
|
||||||
<Button
|
<Button
|
||||||
disabled={record.finalResult === 2 || record.finalResult === 3}
|
disabled={record.finalResult === 2 || record.finalResult === 3 || isEvaluationClosed}
|
||||||
type="link"
|
type="link"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setEvaluationModalOpen(true);
|
setEvaluationModalOpen(true);
|
||||||
|
|
@ -132,17 +132,6 @@ function HiddenList(props) {
|
||||||
]}
|
]}
|
||||||
{...tableProps}
|
{...tableProps}
|
||||||
/>
|
/>
|
||||||
{viewEvaluationModalOpen
|
|
||||||
&& (
|
|
||||||
<ViewEvaluationModal
|
|
||||||
onCancel={() => {
|
|
||||||
setViewEvaluationModalOpen(false);
|
|
||||||
setCurrentHiddenId("");
|
|
||||||
}}
|
|
||||||
hiddenId={currentHiddenId}
|
|
||||||
query={query}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
{evaluationModalOpen
|
{evaluationModalOpen
|
||||||
&& (
|
&& (
|
||||||
<EvaluationModal
|
<EvaluationModal
|
||||||
|
|
@ -263,4 +252,4 @@ const EvaluationModalComponent = (props) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const EvaluationModal = Connect([NS_HIDDEN_EVALUATION], true)(EvaluationModalComponent);
|
const EvaluationModal = Connect([NS_HIDDEN_EVALUATION], true)(EvaluationModalComponent);
|
||||||
export default Connect([NS_HIDDEN_EVALUATION], true)(HiddenList);
|
export default Connect([NS_HIDDEN_EVALUATION, NS_EVALUATION_TEAM_CONFIG], true)(HiddenList);
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,19 @@
|
||||||
import HiddenInfo from "zy-react-library/components/HiddenInfo/gwj";
|
import HiddenInfo from "zy-react-library/components/HiddenInfo/gwj";
|
||||||
import Page from "zy-react-library/components/Page";
|
import Page from "zy-react-library/components/Page";
|
||||||
|
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
|
||||||
|
import ViewEvaluationModal from "~/components/ViewEvaluationModal";
|
||||||
|
|
||||||
function HiddenView() {
|
function HiddenView() {
|
||||||
|
const query = useGetUrlQuery();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Page headerTitle="查看" contentPadding="0 20px 20px 20px">
|
<Page headerTitle="查看" contentPadding="0 20px 20px 20px">
|
||||||
<HiddenInfo />
|
<HiddenInfo />
|
||||||
|
<ViewEvaluationModal
|
||||||
|
inline
|
||||||
|
hiddenId={query.hiddenId}
|
||||||
|
query={query}
|
||||||
|
/>
|
||||||
</Page>
|
</Page>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,7 @@
|
||||||
import HiddenInfo from "zy-react-library/components/HiddenInfo/gwj";
|
import HiddenViewPage from "../../PersonnelEvaluation/HiddenView";
|
||||||
import Page from "zy-react-library/components/Page";
|
|
||||||
|
|
||||||
function HiddenView() {
|
function HiddenView(props) {
|
||||||
return (
|
return (<HiddenViewPage {...props} />);
|
||||||
<Page headerTitle="查看" contentPadding="0 20px 20px 20px">
|
|
||||||
<HiddenInfo />
|
|
||||||
</Page>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default HiddenView;
|
export default HiddenView;
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,6 @@ import { HIDDEN_SOURCE_ENUM, HIDDEN_STATE_ENUM } from "zy-react-library/enum/hid
|
||||||
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
|
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
|
||||||
import useTable from "zy-react-library/hooks/useTable";
|
import useTable from "zy-react-library/hooks/useTable";
|
||||||
import { getLabelName } from "zy-react-library/utils";
|
import { getLabelName } from "zy-react-library/utils";
|
||||||
import ViewEvaluationModal from "~/components/ViewEvaluationModal";
|
|
||||||
import { EVALUATION_RESULT_ENUM } from "~/enumerate/constant";
|
import { EVALUATION_RESULT_ENUM } from "~/enumerate/constant";
|
||||||
import { NS_PERSONNEL_EVALUATION } from "~/enumerate/namespace";
|
import { NS_PERSONNEL_EVALUATION } from "~/enumerate/namespace";
|
||||||
|
|
||||||
|
|
@ -81,26 +80,17 @@ function HiddenExchangeList(props) {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "操作",
|
title: "操作",
|
||||||
width: 230,
|
width: 100,
|
||||||
fixed: "right",
|
fixed: "right",
|
||||||
render: (_, record) => (
|
render: (_, record) => (
|
||||||
<Space>
|
<Space>
|
||||||
<Button
|
<Button
|
||||||
type="link"
|
type="link"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
props.history.push(`./hiddenView?hiddenId=${record.hiddenId}&id=${record.hiddenSnowFlakeId}`);
|
props.history.push(`./hiddenView?hiddenId=${record.hiddenId}&id=${record.hiddenSnowFlakeId}&corpinfoId=${query.corpinfoId}&evaluationType=${query.evaluationType}`);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
查看隐患详情
|
查看
|
||||||
</Button>
|
|
||||||
<Button
|
|
||||||
type="link"
|
|
||||||
onClick={() => {
|
|
||||||
setViewEvaluationModalOpen(true);
|
|
||||||
setCurrentHiddenId(record.hiddenId);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
考评详情
|
|
||||||
</Button>
|
</Button>
|
||||||
</Space>
|
</Space>
|
||||||
),
|
),
|
||||||
|
|
@ -108,17 +98,6 @@ function HiddenExchangeList(props) {
|
||||||
]}
|
]}
|
||||||
{...tableProps}
|
{...tableProps}
|
||||||
/>
|
/>
|
||||||
{viewEvaluationModalOpen
|
|
||||||
&& (
|
|
||||||
<ViewEvaluationModal
|
|
||||||
onCancel={() => {
|
|
||||||
setViewEvaluationModalOpen(false);
|
|
||||||
setCurrentHiddenId("");
|
|
||||||
}}
|
|
||||||
hiddenId={currentHiddenId}
|
|
||||||
complete={true}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</Page>
|
</Page>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,20 @@
|
||||||
import HiddenInfo from "zy-react-library/components/HiddenInfo/gwj";
|
import HiddenInfo from "zy-react-library/components/HiddenInfo/gwj";
|
||||||
import Page from "zy-react-library/components/Page";
|
import Page from "zy-react-library/components/Page";
|
||||||
|
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
|
||||||
|
import ViewEvaluationModal from "~/components/ViewEvaluationModal";
|
||||||
|
|
||||||
function HiddenView() {
|
function HiddenView() {
|
||||||
|
const query = useGetUrlQuery();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Page headerTitle="查看" contentPadding="0 20px 20px 20px">
|
<Page headerTitle="查看" contentPadding="0 20px 20px 20px">
|
||||||
<HiddenInfo />
|
<HiddenInfo />
|
||||||
|
<ViewEvaluationModal
|
||||||
|
inline
|
||||||
|
hiddenId={query.hiddenId}
|
||||||
|
query={query}
|
||||||
|
complete
|
||||||
|
/>
|
||||||
</Page>
|
</Page>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,11 +13,28 @@ import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
|
||||||
import useTable from "zy-react-library/hooks/useTable";
|
import useTable from "zy-react-library/hooks/useTable";
|
||||||
import { NS_HIDDEN_EVALUATION, NS_PERSONNEL_EVALUATION } from "~/enumerate/namespace";
|
import { NS_HIDDEN_EVALUATION, NS_PERSONNEL_EVALUATION } from "~/enumerate/namespace";
|
||||||
|
|
||||||
|
const getRowKey = record => `${record.userId}-${record.evaluationType}`;
|
||||||
|
|
||||||
|
const getUserRowSpan = (dataSource, index) => {
|
||||||
|
if (!Number.isInteger(index) || !dataSource[index]) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
const userId = dataSource[index].userId;
|
||||||
|
if (index > 0 && dataSource[index - 1]?.userId === userId) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
let rowSpan = 1;
|
||||||
|
while (index + rowSpan < dataSource.length && dataSource[index + rowSpan].userId === userId) {
|
||||||
|
rowSpan += 1;
|
||||||
|
}
|
||||||
|
return rowSpan;
|
||||||
|
};
|
||||||
|
|
||||||
function UserExchangeList(props) {
|
function UserExchangeList(props) {
|
||||||
const query = useGetUrlQuery();
|
const query = useGetUrlQuery();
|
||||||
const corpinfoId = props.corpinfoId || query.corpinfoId;
|
const corpinfoId = props.corpinfoId || query.corpinfoId;
|
||||||
const { loading: downloadBlobLoading, downloadBlob } = useDownloadBlob();
|
const { loading: downloadBlobLoading, downloadBlob } = useDownloadBlob();
|
||||||
const [selectedRowKeys, setSelectedRowKeys] = useState([]);
|
const [selectedUserIds, setSelectedUserIds] = useState([]);
|
||||||
const [form] = Search.useForm();
|
const [form] = Search.useForm();
|
||||||
const { tableProps, getData } = useTable(props["personnelEvaluationUserExchangeList"], {
|
const { tableProps, getData } = useTable(props["personnelEvaluationUserExchangeList"], {
|
||||||
form,
|
form,
|
||||||
|
|
@ -25,9 +42,27 @@ function UserExchangeList(props) {
|
||||||
corpinfoId,
|
corpinfoId,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
const selectedRowKeys = tableProps.dataSource
|
||||||
|
.filter(item => selectedUserIds.includes(item.userId))
|
||||||
|
.map(getRowKey);
|
||||||
|
// 仅合并当前页中连续的同一人员,避免不同人员因显示字段相同而被误合并。
|
||||||
|
const getUserCellProps = (_, index) => ({
|
||||||
|
rowSpan: getUserRowSpan(tableProps.dataSource, index),
|
||||||
|
});
|
||||||
|
|
||||||
|
// 同一人员会按考评类型返回多行,选择任意一行时按 userId 同步更新该人员的全部行。
|
||||||
|
const updateSelectedUserIds = (records, selected) => {
|
||||||
|
const userIds = new Set(records.map(item => item.userId));
|
||||||
|
setSelectedUserIds((currentUserIds) => {
|
||||||
|
if (selected) {
|
||||||
|
return [...new Set([...currentUserIds, ...userIds])];
|
||||||
|
}
|
||||||
|
return currentUserIds.filter(userId => !userIds.has(userId));
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
const onBatchExchange = async () => {
|
const onBatchExchange = async () => {
|
||||||
if (!selectedRowKeys.length) {
|
if (!selectedUserIds.length) {
|
||||||
message.warning("请选择需要兑换的人员");
|
message.warning("请选择需要兑换的人员");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -35,7 +70,7 @@ function UserExchangeList(props) {
|
||||||
title: "兑换确认",
|
title: "兑换确认",
|
||||||
content: "确定要兑换吗?",
|
content: "确定要兑换吗?",
|
||||||
onOk: async () => {
|
onOk: async () => {
|
||||||
const success = await props["personnelEvaluationExchange"]({ userIdList: selectedRowKeys });
|
const success = await props["personnelEvaluationExchange"]({ userIdList: selectedUserIds });
|
||||||
if (success) {
|
if (success) {
|
||||||
message.success("兑换成功");
|
message.success("兑换成功");
|
||||||
getData();
|
getData();
|
||||||
|
|
@ -53,7 +88,7 @@ function UserExchangeList(props) {
|
||||||
onOk: async () => {
|
onOk: async () => {
|
||||||
const { data } = await props["personnelEvaluationUserExchangeList"]({ corpinfoId, ...form.getFieldsValue(), pageIndex: 1, pageSize: 9999 });
|
const { data } = await props["personnelEvaluationUserExchangeList"]({ corpinfoId, ...form.getFieldsValue(), pageIndex: 1, pageSize: 9999 });
|
||||||
const success = await props["personnelEvaluationExchange"]({
|
const success = await props["personnelEvaluationExchange"]({
|
||||||
userIdList: data.map(item => item.userId),
|
userIdList: [...new Set(data.map(item => item.userId))],
|
||||||
});
|
});
|
||||||
if (success) {
|
if (success) {
|
||||||
message.success("兑换成功");
|
message.success("兑换成功");
|
||||||
|
|
@ -66,7 +101,7 @@ function UserExchangeList(props) {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
const onExportExcel = async () => {
|
const onExportExcel = async () => {
|
||||||
if (!selectedRowKeys.length) {
|
if (!selectedUserIds.length) {
|
||||||
message.warning("请选择需要导出的人员");
|
message.warning("请选择需要导出的人员");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -74,7 +109,7 @@ function UserExchangeList(props) {
|
||||||
title: "导出确认",
|
title: "导出确认",
|
||||||
content: "确定要导出excel吗?",
|
content: "确定要导出excel吗?",
|
||||||
onOk: async () => {
|
onOk: async () => {
|
||||||
await downloadBlob("/hiddenEvaluation/hiddenEvaluationRecord/exportUserEvalStatisticsPage", { params: { corpinfoId, ids: selectedRowKeys } });
|
await downloadBlob("/hiddenEvaluation/hiddenEvaluationRecord/exportUserEvalStatisticsPage", { params: { corpinfoId, ids: selectedUserIds } });
|
||||||
message.success("导出成功");
|
message.success("导出成功");
|
||||||
},
|
},
|
||||||
onCancel: () => {
|
onCancel: () => {
|
||||||
|
|
@ -104,12 +139,15 @@ function UserExchangeList(props) {
|
||||||
!props.corpinfoId && {
|
!props.corpinfoId && {
|
||||||
preserveSelectedRowKeys: true,
|
preserveSelectedRowKeys: true,
|
||||||
selectedRowKeys,
|
selectedRowKeys,
|
||||||
onChange: (selectedRowKeys) => {
|
onSelect: (record, selected) => {
|
||||||
setSelectedRowKeys(selectedRowKeys);
|
updateSelectedUserIds([record], selected);
|
||||||
|
},
|
||||||
|
onSelectAll: (selected, _, changeRows) => {
|
||||||
|
updateSelectedUserIds(changeRows, selected);
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
rowKey="userId"
|
rowKey={getRowKey}
|
||||||
toolBarRender={() => (
|
toolBarRender={() => (
|
||||||
props.entrance !== "enterprise" && (
|
props.entrance !== "enterprise" && (
|
||||||
<Space>
|
<Space>
|
||||||
|
|
@ -141,10 +179,11 @@ function UserExchangeList(props) {
|
||||||
)
|
)
|
||||||
)}
|
)}
|
||||||
columns={[
|
columns={[
|
||||||
{ title: "用户名", dataIndex: "userName" },
|
{ title: "用户名", dataIndex: "userName", onCell: getUserCellProps },
|
||||||
{ title: "姓名", dataIndex: "name" },
|
{ title: "姓名", dataIndex: "name", onCell: getUserCellProps },
|
||||||
{ title: "部门", dataIndex: "departmentName" },
|
{ title: "部门", dataIndex: "departmentName", onCell: getUserCellProps },
|
||||||
{ title: "岗位", dataIndex: "postName" },
|
{ title: "岗位", dataIndex: "postName", onCell: getUserCellProps },
|
||||||
|
{ title: "隐患考评组类型", dataIndex: "evaluationTypeName" },
|
||||||
{ title: "奖励总得分", dataIndex: "totalScore" },
|
{ title: "奖励总得分", dataIndex: "totalScore" },
|
||||||
{ title: "已兑换分数", dataIndex: "exchangedScore" },
|
{ title: "已兑换分数", dataIndex: "exchangedScore" },
|
||||||
{ title: "未兑换奖励数", dataIndex: "notExchangedScore" },
|
{ title: "未兑换奖励数", dataIndex: "notExchangedScore" },
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue