Compare commits
1 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
d0a498d51d |
|
|
@ -23,3 +23,13 @@ export const evaluationTeamConfigChangeLog = declareRequest(
|
||||||
export const corpInfoList = declareRequest(
|
export const corpInfoList = declareRequest(
|
||||||
`Get > /basicInfo/corpInfo/listAll`,
|
`Get > /basicInfo/corpInfo/listAll`,
|
||||||
);
|
);
|
||||||
|
// 获取隐患考评是否开启
|
||||||
|
export const getEvalClosedStatus = declareRequest(
|
||||||
|
"evaluationTeamConfigLoading",
|
||||||
|
`Get > /hiddenEvaluation/evaluationConfig/getEvalClosedStatus`,
|
||||||
|
);
|
||||||
|
// 隐患考评开关
|
||||||
|
export const toggleEvalClosed = declareRequest(
|
||||||
|
"evaluationTeamConfigLoading",
|
||||||
|
`Post > @/hiddenEvaluation/evaluationConfig/toggleEvalClosed`,
|
||||||
|
);
|
||||||
|
|
|
||||||
|
|
@ -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,10 +33,30 @@ 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("0");
|
||||||
|
|
||||||
const { tableProps, getData } = useTable(props["evaluationTeamConfigList"], {
|
const { tableProps, getData } = useTable(props["evaluationTeamConfigList"], {
|
||||||
form,
|
form,
|
||||||
});
|
});
|
||||||
|
const getEvalClosedStatusFun = async () => {
|
||||||
|
const { data } = await props["getEvalClosedStatus"]();
|
||||||
|
|
||||||
|
setIsEvaluationClosed(data);
|
||||||
|
};
|
||||||
|
const onChange = async (checked) => {
|
||||||
|
const status = checked ? 1 : 0;
|
||||||
|
|
||||||
|
await props["toggleEvalClosed"]({ evaluationClosed: status });
|
||||||
|
|
||||||
|
setIsEvaluationClosed(status);
|
||||||
|
getEvalClosedStatusFun();
|
||||||
|
getData();
|
||||||
|
message.success("状态更新成功");
|
||||||
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
getEvalClosedStatusFun();
|
||||||
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Page isShowAllAction={false}>
|
<Page isShowAllAction={false}>
|
||||||
|
|
@ -51,8 +71,20 @@ function List(props) {
|
||||||
<Table
|
<Table
|
||||||
toolBarRender={() => (
|
toolBarRender={() => (
|
||||||
<Space>
|
<Space>
|
||||||
|
{
|
||||||
|
props.permission("gfd-kpzpz-switch")
|
||||||
|
&& (
|
||||||
|
<div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
|
||||||
|
}
|
||||||
|
<span>考评是否结束</span>
|
||||||
|
<Switch onChange={onChange} checked={isEvaluationClosed} />
|
||||||
{props.permission("gfd-kpzpz-add") && (
|
{props.permission("gfd-kpzpz-add") && (
|
||||||
<Button
|
<Button
|
||||||
|
disabled={isEvaluationClosed}
|
||||||
type="primary"
|
type="primary"
|
||||||
icon={<AddIcon />}
|
icon={<AddIcon />}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
|
@ -79,6 +111,7 @@ function List(props) {
|
||||||
{props.permission("gfd-kpzpz-info") && (
|
{props.permission("gfd-kpzpz-info") && (
|
||||||
<Button
|
<Button
|
||||||
type="link"
|
type="link"
|
||||||
|
disabled={record.evaluationClosed}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setViewModalOpen(true);
|
setViewModalOpen(true);
|
||||||
setCurrentData(record);
|
setCurrentData(record);
|
||||||
|
|
@ -90,6 +123,7 @@ function List(props) {
|
||||||
{props.permission("gfd-kpzpz-anquan") && (
|
{props.permission("gfd-kpzpz-anquan") && (
|
||||||
<Button
|
<Button
|
||||||
type="link"
|
type="link"
|
||||||
|
disabled={record.evaluationClosed}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setConfigModalOpen(true);
|
setConfigModalOpen(true);
|
||||||
setEvaluationType(1);
|
setEvaluationType(1);
|
||||||
|
|
@ -102,6 +136,7 @@ function List(props) {
|
||||||
{props.permission("gfd-kpzpz-huanbao") && (
|
{props.permission("gfd-kpzpz-huanbao") && (
|
||||||
<Button
|
<Button
|
||||||
type="link"
|
type="link"
|
||||||
|
disabled={record.evaluationClosed}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setConfigModalOpen(true);
|
setConfigModalOpen(true);
|
||||||
setEvaluationType(2);
|
setEvaluationType(2);
|
||||||
|
|
@ -114,6 +149,7 @@ function List(props) {
|
||||||
{props.permission("gfd-kpzpz-record") && (
|
{props.permission("gfd-kpzpz-record") && (
|
||||||
<Button
|
<Button
|
||||||
type="link"
|
type="link"
|
||||||
|
disabled={record.evaluationClosed}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setChangeLogModalOpen(true);
|
setChangeLogModalOpen(true);
|
||||||
setCurrentData(record);
|
setCurrentData(record);
|
||||||
|
|
|
||||||
|
|
@ -75,6 +75,7 @@ function List(props) {
|
||||||
{props.permission(props.evaluationBtn || "gfd-fgsyhkp-eval") && (
|
{props.permission(props.evaluationBtn || "gfd-fgsyhkp-eval") && (
|
||||||
<Button
|
<Button
|
||||||
type="link"
|
type="link"
|
||||||
|
disabled={record.evaluationClosed}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
props.history.push(`./hiddenList?corpinfoId=${record.corpinfoId}&evaluationType=${record.evaluationType}`);
|
props.history.push(`./hiddenList?corpinfoId=${record.corpinfoId}&evaluationType=${record.evaluationType}`);
|
||||||
}}
|
}}
|
||||||
|
|
|
||||||
|
|
@ -46,11 +46,12 @@ function List(props) {
|
||||||
{props.permission("gfd-rykpgl-info") && (
|
{props.permission("gfd-rykpgl-info") && (
|
||||||
<Button
|
<Button
|
||||||
type="link"
|
type="link"
|
||||||
|
disabled={record.evaluationClosed}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
props.history.push(`./userExchangeList?corpinfoId=${record.corpinfoId}`);
|
props.history.push(`./userExchangeList?corpinfoId=${record.corpinfoId}`);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
查看
|
兑换
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
</Space>
|
</Space>
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,8 @@ import Table from "zy-react-library/components/Table";
|
||||||
import useDownloadBlob from "zy-react-library/hooks/useDownloadBlob";
|
import useDownloadBlob from "zy-react-library/hooks/useDownloadBlob";
|
||||||
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 { EVALUATION_TYPE_ENUM } from "~/enumerate/constant";
|
||||||
import { NS_HIDDEN_EVALUATION, NS_PERSONNEL_EVALUATION } from "~/enumerate/namespace";
|
import { NS_HIDDEN_EVALUATION, NS_PERSONNEL_EVALUATION } from "~/enumerate/namespace";
|
||||||
|
|
||||||
function UserExchangeList(props) {
|
function UserExchangeList(props) {
|
||||||
|
|
@ -82,6 +84,26 @@ function UserExchangeList(props) {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
const getRowSpan = (data, index, dataIndex) => {
|
||||||
|
if (!data || data.length === 0)
|
||||||
|
return 1;
|
||||||
|
const currentRow = data[index];
|
||||||
|
if (!currentRow)
|
||||||
|
return 1;
|
||||||
|
if (index === 0 || currentRow[dataIndex] !== data[index - 1]?.[dataIndex]) {
|
||||||
|
let rowSpan = 1;
|
||||||
|
for (let i = index + 1; i < data.length; i++) {
|
||||||
|
if (data[i]?.[dataIndex] === currentRow[dataIndex]) {
|
||||||
|
rowSpan++;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return rowSpan;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Page headerTitle="人员考评情况" isShowAllAction={props.isShowAllAction ?? true}>
|
<Page headerTitle="人员考评情况" isShowAllAction={props.isShowAllAction ?? true}>
|
||||||
|
|
@ -141,10 +163,55 @@ function UserExchangeList(props) {
|
||||||
)
|
)
|
||||||
)}
|
)}
|
||||||
columns={[
|
columns={[
|
||||||
{ title: "用户名", dataIndex: "userName" },
|
{ title: "用户名", dataIndex: "userName", render: (_, record, index) => {
|
||||||
{ title: "姓名", dataIndex: "name" },
|
const rowSpan = getRowSpan(tableProps.dataSource || [], index, "userName");
|
||||||
{ title: "部门", dataIndex: "departmentName" },
|
if (!record)
|
||||||
{ title: "岗位", dataIndex: "postName" },
|
return null;
|
||||||
|
return {
|
||||||
|
children: (
|
||||||
|
<span>{record.userName}</span>
|
||||||
|
),
|
||||||
|
props: { rowSpan },
|
||||||
|
};
|
||||||
|
} },
|
||||||
|
{ title: "姓名", dataIndex: "name", render: (_, record, index) => {
|
||||||
|
const rowSpan = getRowSpan(tableProps.dataSource || [], index, "name");
|
||||||
|
if (!record)
|
||||||
|
return null;
|
||||||
|
return {
|
||||||
|
children: (
|
||||||
|
<span>{record.name}</span>
|
||||||
|
),
|
||||||
|
props: { rowSpan },
|
||||||
|
};
|
||||||
|
} },
|
||||||
|
{ title: "部门", dataIndex: "departmentName", render: (_, record, index) => {
|
||||||
|
const rowSpan = getRowSpan(tableProps.dataSource || [], index, "departmentName");
|
||||||
|
if (!record)
|
||||||
|
return null;
|
||||||
|
return {
|
||||||
|
children: (
|
||||||
|
<span>{record.departmentName}</span>
|
||||||
|
),
|
||||||
|
props: { rowSpan },
|
||||||
|
};
|
||||||
|
} },
|
||||||
|
{ title: "岗位", dataIndex: "postName", render: (_, record, index) => {
|
||||||
|
const rowSpan = getRowSpan(tableProps.dataSource || [], index, "postName");
|
||||||
|
if (!record)
|
||||||
|
return null;
|
||||||
|
return {
|
||||||
|
children: (
|
||||||
|
<span>{record.postName}</span>
|
||||||
|
),
|
||||||
|
props: { rowSpan },
|
||||||
|
};
|
||||||
|
} },
|
||||||
|
{
|
||||||
|
title: "隐患考评组类型",
|
||||||
|
dataIndex: "evaluationType",
|
||||||
|
render: (_, record) => getLabelName({ list: EVALUATION_TYPE_ENUM, status: record.evaluationType }),
|
||||||
|
},
|
||||||
{ title: "奖励总得分", dataIndex: "totalScore" },
|
{ title: "奖励总得分", dataIndex: "totalScore" },
|
||||||
{ title: "已兑换分数", dataIndex: "exchangedScore" },
|
{ title: "已兑换分数", dataIndex: "exchangedScore" },
|
||||||
{ title: "未兑换奖励数", dataIndex: "notExchangedScore" },
|
{ title: "未兑换奖励数", dataIndex: "notExchangedScore" },
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue