隐患考评
parent
317422ec21
commit
7a43d728f9
|
|
@ -18,20 +18,20 @@
|
||||||
"lint": "eslint --ext .js,.jsx,.tsx --fix src"
|
"lint": "eslint --ext .js,.jsx,.tsx --fix src"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@ant-design/icons": "latest",
|
"@ant-design/icons": "^6.1.0",
|
||||||
"@ant-design/pro-components": "^2.8.10",
|
"@ant-design/pro-components": "^2.8.10",
|
||||||
"@cqsjjb/jjb-common-decorator": "latest",
|
"@cqsjjb/jjb-common-decorator": "latest",
|
||||||
"@cqsjjb/jjb-common-lib": "latest",
|
"@cqsjjb/jjb-common-lib": "latest",
|
||||||
"@cqsjjb/jjb-dva-runtime": "latest",
|
"@cqsjjb/jjb-dva-runtime": "latest",
|
||||||
"@cqsjjb/jjb-react-admin-component": "latest",
|
"@cqsjjb/jjb-react-admin-component": "latest",
|
||||||
"ahooks": "^3.9.5",
|
"ahooks": "^3.9.5",
|
||||||
"antd": "latest",
|
"antd": "^5.28.0",
|
||||||
"dayjs": "^1.11.7",
|
"dayjs": "^1.11.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",
|
||||||
"react-to-print": "^3.2.0",
|
"react-to-print": "^3.2.0",
|
||||||
"zy-react-library": "^1.0.125"
|
"zy-react-library": "^1.0.130"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@antfu/eslint-config": "^5.4.1",
|
"@antfu/eslint-config": "^5.4.1",
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,25 @@
|
||||||
|
import { declareRequest } from "@cqsjjb/jjb-dva-runtime";
|
||||||
|
|
||||||
|
export const evaluationTeamConfigList = declareRequest(
|
||||||
|
"evaluationTeamConfigLoading",
|
||||||
|
"Post > @/hidden/evaluateGroupUserConfig/page",
|
||||||
|
);
|
||||||
|
export const evaluationTeamConfigAdd = declareRequest(
|
||||||
|
"evaluationTeamConfigLoading",
|
||||||
|
"Post > @/hidden/evaluateGroupUserConfig/saveT",
|
||||||
|
);
|
||||||
|
export const evaluationTeamConfigUpdate = declareRequest(
|
||||||
|
"evaluationTeamConfigLoading",
|
||||||
|
"Put > @/hidden/evaluateGroupUserConfig/editT",
|
||||||
|
);
|
||||||
|
export const evaluationTeamConfigView = declareRequest(
|
||||||
|
"evaluationTeamConfigLoading",
|
||||||
|
"Post > @/hidden/evaluateGroupUserConfig/groupDetail",
|
||||||
|
);
|
||||||
|
export const evaluationTeamConfigChangeLog = declareRequest(
|
||||||
|
"evaluationTeamConfigLoading",
|
||||||
|
`Post > @/hidden/evaluateConfigUpdateRecord/list`,
|
||||||
|
);
|
||||||
|
export const corpInfoList = declareRequest(
|
||||||
|
`Post > @/basic-info/corpInfo/list`,
|
||||||
|
);
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
import { declareRequest } from "@cqsjjb/jjb-dva-runtime";
|
||||||
|
|
||||||
|
export const hiddenEvaluationList = declareRequest(
|
||||||
|
"hiddenEvaluationLoading",
|
||||||
|
"Post > @/hidden/evaluateGroupUserConfig/hiddenEvaluatePage",
|
||||||
|
);
|
||||||
|
export const hiddenEvaluationHiddenList = declareRequest(
|
||||||
|
"hiddenEvaluationLoading",
|
||||||
|
"Post > @/hidden/viewHiddenEvaluate/list",
|
||||||
|
);
|
||||||
|
export const hiddenEvaluationHiddenEvaluationView = declareRequest(
|
||||||
|
"hiddenEvaluationLoading",
|
||||||
|
"Post > @/hidden/evaluateGroupUserConfig/viewList",
|
||||||
|
);
|
||||||
|
export const hiddenEvaluationHiddenEvaluationAdd = declareRequest(
|
||||||
|
"hiddenEvaluationLoading",
|
||||||
|
"Post > @/hidden/evaluateHiddenDetail/save",
|
||||||
|
);
|
||||||
|
export const hiddenEvaluationHiddenEvaluationUpdate = declareRequest(
|
||||||
|
"hiddenEvaluationLoading",
|
||||||
|
"Put > @T/hidden/evaluateHiddenDetail/edit",
|
||||||
|
);
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
import { declareRequest } from "@cqsjjb/jjb-dva-runtime";
|
||||||
|
|
||||||
|
export const personnelEvaluationList = declareRequest(
|
||||||
|
"personnelEvaluationLoading",
|
||||||
|
"Post > @/hidden/viewUserEvaluateCondition/list",
|
||||||
|
);
|
||||||
|
export const personnelEvaluationUserExchangeList = declareRequest(
|
||||||
|
"personnelEvaluationLoading",
|
||||||
|
"Post > @/hidden/viewUserEvaluateConditionList/list",
|
||||||
|
);
|
||||||
|
export const personnelEvaluationExchange = declareRequest(
|
||||||
|
"personnelEvaluationLoading",
|
||||||
|
"Post > @/hidden/viewUserEvaluateConditionList/exchange",
|
||||||
|
);
|
||||||
|
export const personnelEvaluationUserExchangeRecordList = declareRequest(
|
||||||
|
"personnelEvaluationLoading",
|
||||||
|
"Post > @/hidden/evaluateExchangeRecord/list",
|
||||||
|
);
|
||||||
|
|
@ -14,3 +14,6 @@ export const NS_SPECIAL_DISPOSAL = defineNamespace("specialDisposal");
|
||||||
export const NS_ACCEPTANCE = defineNamespace("acceptance");
|
export const NS_ACCEPTANCE = defineNamespace("acceptance");
|
||||||
export const NS_PART = defineNamespace("part");
|
export const NS_PART = defineNamespace("part");
|
||||||
export const NS_AVERAGE = defineNamespace("average");
|
export const NS_AVERAGE = defineNamespace("average");
|
||||||
|
export const NS_EVALUATION_TEAM_CONFIG = defineNamespace("evaluationTeamConfig");
|
||||||
|
export const NS_HIDDEN_EVALUATION = defineNamespace("hiddenEvaluation");
|
||||||
|
export const NS_PERSONNEL_EVALUATION = defineNamespace("personnelEvaluation");
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,469 @@
|
||||||
|
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||||
|
import { Button, Col, Descriptions, Form, message, Modal, Row, Space } from "antd";
|
||||||
|
import { useEffect, useState } from "react";
|
||||||
|
import FormBuilder from "zy-react-library/components/FormBuilder";
|
||||||
|
import AddIcon from "zy-react-library/components/Icon/AddIcon";
|
||||||
|
import Search from "zy-react-library/components/Search";
|
||||||
|
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";
|
||||||
|
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||||
|
import useIsExistenceDuplicateSelection from "zy-react-library/hooks/useIsExistenceDuplicateSelection";
|
||||||
|
import useTable from "zy-react-library/hooks/useTable";
|
||||||
|
import { NS_EVALUATION_TEAM_CONFIG } from "~/enumerate/namespace";
|
||||||
|
|
||||||
|
const STATE_ENUM = [
|
||||||
|
{ bianma: "1", name: "安全类已分配" },
|
||||||
|
{ bianma: "2", name: "安全类未分配" },
|
||||||
|
{ bianma: "3", name: "环保类已分配" },
|
||||||
|
{ bianma: "4", name: "环保类未分配" },
|
||||||
|
{ bianma: "5", name: "安全类和环保类已分配" },
|
||||||
|
{ bianma: "6", name: "安全类和环保类已分配" },
|
||||||
|
];
|
||||||
|
|
||||||
|
function List(props) {
|
||||||
|
const [form] = Form.useForm();
|
||||||
|
const [configModalOpen, setConfigModalOpen] = useState(false);
|
||||||
|
const [configType, setConfigType] = useState("");
|
||||||
|
const [currentData, setCurrentData] = useState({});
|
||||||
|
const [addModalOpen, setAddModalOpen] = useState(false);
|
||||||
|
const [viewModalOpen, setViewModalOpen] = useState(false);
|
||||||
|
const [changeLogModalOpen, setChangeLogModalOpen] = useState(false);
|
||||||
|
|
||||||
|
const { tableProps, getData } = useTable(props["evaluationTeamConfigList"], {
|
||||||
|
form,
|
||||||
|
});
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<div style={{ padding: 20 }}>
|
||||||
|
<Search
|
||||||
|
options={[
|
||||||
|
{ name: "likeCorpinfoName", label: "分公司名称" },
|
||||||
|
{ name: "eqState", label: "考评组状态", render: FORM_ITEM_RENDER_ENUM.SELECT, items: STATE_ENUM },
|
||||||
|
]}
|
||||||
|
form={form}
|
||||||
|
onFinish={getData}
|
||||||
|
/>
|
||||||
|
<Table
|
||||||
|
toolBarRender={() => (
|
||||||
|
<Button
|
||||||
|
type="primary"
|
||||||
|
icon={<AddIcon />}
|
||||||
|
onClick={() => {
|
||||||
|
setAddModalOpen(true);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
新增
|
||||||
|
</Button>
|
||||||
|
)}
|
||||||
|
columns={[
|
||||||
|
{ title: "分公司名称", dataIndex: "corpinfoName" },
|
||||||
|
{
|
||||||
|
title: "安全类隐患考评组分配状态",
|
||||||
|
dataIndex: "safetyFlag",
|
||||||
|
width: 220,
|
||||||
|
render: (_, record) => (record.safetyFlag === 1 ? "已分配" : "未分配"),
|
||||||
|
},
|
||||||
|
{ title: "考评组成员", dataIndex: "safetyMembers" },
|
||||||
|
{
|
||||||
|
title: "环保类隐患考评组分配状态",
|
||||||
|
dataIndex: "environmentalFlag",
|
||||||
|
width: 220,
|
||||||
|
render: (_, record) => (record.safetyFlag === 1 ? "已分配" : "未分配"),
|
||||||
|
},
|
||||||
|
{ title: "考评组成员", dataIndex: "environmentalMembers" },
|
||||||
|
{
|
||||||
|
title: "操作",
|
||||||
|
width: 330,
|
||||||
|
fixed: "right",
|
||||||
|
render: (_, record) => (
|
||||||
|
<Space>
|
||||||
|
<Button
|
||||||
|
type="link"
|
||||||
|
onClick={() => {
|
||||||
|
setViewModalOpen(true);
|
||||||
|
setCurrentData(record);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
查看
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
type="link"
|
||||||
|
onClick={() => {
|
||||||
|
setConfigModalOpen(true);
|
||||||
|
setConfigType("safety");
|
||||||
|
setCurrentData(record);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
安全类组分配
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
type="link"
|
||||||
|
onClick={() => {
|
||||||
|
setConfigModalOpen(true);
|
||||||
|
setConfigType("environmental");
|
||||||
|
setCurrentData(record);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
环保类组分配
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
type="link"
|
||||||
|
onClick={() => {
|
||||||
|
setChangeLogModalOpen(true);
|
||||||
|
setCurrentData(record);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
变更记录
|
||||||
|
</Button>
|
||||||
|
</Space>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
{...tableProps}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
{configModalOpen
|
||||||
|
&& (
|
||||||
|
<ConfigModal
|
||||||
|
configType={configType}
|
||||||
|
onCancel={() => setConfigModalOpen(false)}
|
||||||
|
getData={getData}
|
||||||
|
data={currentData}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
{addModalOpen
|
||||||
|
&& (
|
||||||
|
<AddModal
|
||||||
|
onCancel={() => setAddModalOpen(false)}
|
||||||
|
getData={getData}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
{viewModalOpen
|
||||||
|
&& (
|
||||||
|
<ViewModal
|
||||||
|
onCancel={() => setViewModalOpen(false)}
|
||||||
|
data={currentData}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
{changeLogModalOpen
|
||||||
|
&& (
|
||||||
|
<ChangeLogModal
|
||||||
|
onCancel={() => setChangeLogModalOpen(false)}
|
||||||
|
data={currentData}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const ConfigModalComponent = (props) => {
|
||||||
|
const configType = props.configType;
|
||||||
|
const configTypeName = configType === "safety" ? "安全类" : "环保类";
|
||||||
|
const corpinfoId = props.data.corpinfoId;
|
||||||
|
|
||||||
|
const [form] = Form.useForm();
|
||||||
|
const evaluateGroupUserConfigUpdateCmdList = Form.useWatch("evaluateGroupUserConfigUpdateCmdList", form);
|
||||||
|
|
||||||
|
const { isExistenceDuplicateSelection } = useIsExistenceDuplicateSelection();
|
||||||
|
|
||||||
|
const getData = async () => {
|
||||||
|
const { data } = await props["evaluationTeamConfigView"]({
|
||||||
|
eqCorpinfoId: corpinfoId,
|
||||||
|
eqType: configType === "safety" ? "aqyh" : "wshb",
|
||||||
|
});
|
||||||
|
form.setFieldValue("evaluateGroupUserConfigUpdateCmdList", data);
|
||||||
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
corpinfoId && getData();
|
||||||
|
}, []);
|
||||||
|
const onSubmit = async (values) => {
|
||||||
|
await isExistenceDuplicateSelection({ data: values.evaluateGroupUserConfigUpdateCmdList, key: "memberId" });
|
||||||
|
const { success } = await props["evaluationTeamConfigUpdate"]({
|
||||||
|
...values,
|
||||||
|
corpinfoId,
|
||||||
|
corpinfoName: props.data.corpinfoName,
|
||||||
|
});
|
||||||
|
if (success) {
|
||||||
|
message.success("操作成功");
|
||||||
|
props.onCancel();
|
||||||
|
props.getData();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Modal
|
||||||
|
title={`${configTypeName}隐患考评组分配`}
|
||||||
|
width={1000}
|
||||||
|
open
|
||||||
|
onCancel={props.onCancel}
|
||||||
|
maskClosable={false}
|
||||||
|
onOk={form.submit}
|
||||||
|
loading={props.evaluationTeamConfig.evaluationTeamConfigLoading}
|
||||||
|
>
|
||||||
|
<FormBuilder
|
||||||
|
values={{ configType: configTypeName }}
|
||||||
|
labelCol={{ span: 8 }}
|
||||||
|
showActionButtons={false}
|
||||||
|
form={form}
|
||||||
|
onFinish={onSubmit}
|
||||||
|
options={[
|
||||||
|
{ name: "configType", label: "隐患考评组类型", componentProps: { disabled: true }, span: 24 },
|
||||||
|
{
|
||||||
|
key: "evaluateGroupUserConfigUpdateCmdList",
|
||||||
|
customizeRender: true,
|
||||||
|
span: 24,
|
||||||
|
render: (
|
||||||
|
<>
|
||||||
|
<Form.List name="evaluateGroupUserConfigUpdateCmdList">
|
||||||
|
{fields => (
|
||||||
|
<>
|
||||||
|
{fields.map(field => (
|
||||||
|
<Row gutter={24} key={field.key}>
|
||||||
|
<Col span={12}>
|
||||||
|
<Form.Item
|
||||||
|
label="考评部门"
|
||||||
|
rules={[{ required: true, message: "请选择考评部门" }]}
|
||||||
|
name={[field.name, "memberDeptId"]}
|
||||||
|
>
|
||||||
|
<DepartmentSelectTree
|
||||||
|
isNeedCorpInfoId={true}
|
||||||
|
params={{ eqCorpinfoId: corpinfoId }}
|
||||||
|
onChange={() => {
|
||||||
|
form.setFieldValue(["evaluateGroupUserConfigUpdateCmdList", field.name, "memberId"], "");
|
||||||
|
form.setFieldValue(["evaluateGroupUserConfigUpdateCmdList", field.name, "memberName"], "");
|
||||||
|
}}
|
||||||
|
onGetLabel={(label) => {
|
||||||
|
form.setFieldValue(["evaluateGroupUserConfigUpdateCmdList", field.name, "memberDeptName"], label);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item label="考评部门名称" noStyle name={[field.name, "memberDeptName"]}>
|
||||||
|
<input type="hidden" />
|
||||||
|
</Form.Item>
|
||||||
|
</Col>
|
||||||
|
<Col span={12}>
|
||||||
|
<Form.Item
|
||||||
|
label="考评人员"
|
||||||
|
rules={[{ required: true, message: "请选择考评部门" }]}
|
||||||
|
name={[field.name, "memberId"]}
|
||||||
|
>
|
||||||
|
<PersonnelSelect
|
||||||
|
params={{ departmentId: evaluateGroupUserConfigUpdateCmdList?.[field.name]?.memberDeptId || "" }}
|
||||||
|
onGetLabel={label => form.setFieldValue(["evaluateGroupUserConfigUpdateCmdList", field.name, "memberName"], label)}
|
||||||
|
/>
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item label="考评人员名称" noStyle name={[field.name, "memberName"]}>
|
||||||
|
<input type="hidden" />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item label="用户类型" noStyle name={[field.name, "type"]}>
|
||||||
|
<input type="hidden" />
|
||||||
|
</Form.Item>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
))}
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
</Form.List>
|
||||||
|
</>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
</Modal>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const AddModalComponent = (props) => {
|
||||||
|
const [form] = Form.useForm();
|
||||||
|
const [corpInfoList, setCorpInfoList] = useState([]);
|
||||||
|
|
||||||
|
const getCorpInfoList = async () => {
|
||||||
|
const { data } = await props["corpInfoList"]({ pageIndex: 1, pageSize: 1000 });
|
||||||
|
setCorpInfoList(data);
|
||||||
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
getCorpInfoList();
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const onSubmit = async (values) => {
|
||||||
|
const { success } = await props["evaluationTeamConfigAdd"]({
|
||||||
|
...values,
|
||||||
|
});
|
||||||
|
if (success) {
|
||||||
|
message.success("操作成功");
|
||||||
|
props.onCancel();
|
||||||
|
props.getData();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Modal
|
||||||
|
title="新增"
|
||||||
|
width={1000}
|
||||||
|
open
|
||||||
|
onCancel={props.onCancel}
|
||||||
|
maskClosable={false}
|
||||||
|
onOk={form.submit}
|
||||||
|
loading={props.evaluationTeamConfig.evaluationTeamConfigLoading}
|
||||||
|
>
|
||||||
|
<FormBuilder
|
||||||
|
labelCol={{ span: 8 }}
|
||||||
|
showActionButtons={false}
|
||||||
|
form={form}
|
||||||
|
onFinish={onSubmit}
|
||||||
|
span={24}
|
||||||
|
options={[
|
||||||
|
{
|
||||||
|
name: "corpinfoId",
|
||||||
|
label: "分公司",
|
||||||
|
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||||
|
items: corpInfoList,
|
||||||
|
itemsField: { valueKey: "id", labelKey: "corpName" },
|
||||||
|
componentProps: {
|
||||||
|
onChange: (value) => {
|
||||||
|
form.setFieldValue("corpinfoName", corpInfoList.find(item => item.id === value)?.corpName);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{ name: "corpinfoName", label: "分公司名称", onlyForLabel: true },
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
</Modal>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const ViewModalComponent = (props) => {
|
||||||
|
const corpinfoId = props.data.corpinfoId;
|
||||||
|
|
||||||
|
const [safetyList, setSafetyList] = useState([]);
|
||||||
|
const [environmentalList, setEnvironmentalList] = useState([]);
|
||||||
|
|
||||||
|
const getData = async () => {
|
||||||
|
const { data: safetyList } = await props["evaluationTeamConfigView"]({
|
||||||
|
eqCorpinfoId: corpinfoId,
|
||||||
|
eqType: "aqyh",
|
||||||
|
});
|
||||||
|
setSafetyList(safetyList);
|
||||||
|
const { data: environmentalList } = await props["evaluationTeamConfigView"]({
|
||||||
|
eqCorpinfoId: corpinfoId,
|
||||||
|
eqType: "wshb",
|
||||||
|
});
|
||||||
|
setEnvironmentalList(environmentalList);
|
||||||
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
getData();
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Modal
|
||||||
|
title="查看"
|
||||||
|
width={1000}
|
||||||
|
open
|
||||||
|
onCancel={props.onCancel}
|
||||||
|
maskClosable={false}
|
||||||
|
loading={props.evaluationTeamConfig.evaluationTeamConfigLoading}
|
||||||
|
>
|
||||||
|
<Descriptions
|
||||||
|
column={1}
|
||||||
|
bordered
|
||||||
|
styles={{ label: { width: 200 } }}
|
||||||
|
items={[
|
||||||
|
{ label: "隐患考评组类型", children: "安全类" },
|
||||||
|
{ label: "考评组成员", children: (
|
||||||
|
<div>
|
||||||
|
{safetyList.map(item => (
|
||||||
|
item.memberDeptName && (
|
||||||
|
<div key={item.id}>
|
||||||
|
{item.memberDeptName}
|
||||||
|
{" "}
|
||||||
|
-
|
||||||
|
{" "}
|
||||||
|
{item.memberName}
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
) },
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
<Descriptions
|
||||||
|
column={1}
|
||||||
|
bordered
|
||||||
|
styles={{ label: { width: 200 } }}
|
||||||
|
items={[
|
||||||
|
{ label: "隐患考评组类型", children: "环保类" },
|
||||||
|
{ label: "考评组成员", children: (
|
||||||
|
<div>
|
||||||
|
{environmentalList.map(item => (
|
||||||
|
item.memberDeptName && (
|
||||||
|
<div key={item.id}>
|
||||||
|
{item.memberDeptName}
|
||||||
|
{" "}
|
||||||
|
-
|
||||||
|
{" "}
|
||||||
|
{item.memberName}
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
) },
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
</Modal>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const ChangeLogModalComponent = (props) => {
|
||||||
|
const corpinfoId = props.data.corpinfoId;
|
||||||
|
|
||||||
|
const [list, setList] = useState([]);
|
||||||
|
|
||||||
|
const getData = async () => {
|
||||||
|
const { data } = await props["evaluationTeamConfigChangeLog"]({
|
||||||
|
eqCorpinfoId: corpinfoId,
|
||||||
|
});
|
||||||
|
setList(data);
|
||||||
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
getData();
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Modal
|
||||||
|
title="查看"
|
||||||
|
width={1200}
|
||||||
|
open
|
||||||
|
onCancel={props.onCancel}
|
||||||
|
maskClosable={false}
|
||||||
|
loading={props.evaluationTeamConfig.evaluationTeamConfigLoading}
|
||||||
|
footer={[
|
||||||
|
<Button key="back" onClick={props.onCancel}>关闭</Button>,
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
<Descriptions
|
||||||
|
column={3}
|
||||||
|
bordered
|
||||||
|
styles={{ label: { width: 200 } }}
|
||||||
|
items={[
|
||||||
|
...list.flatMap(item => ([
|
||||||
|
{ label: "隐患考评组类型", children: item.evaluateType === 1 ? "安全类" : "环保类" },
|
||||||
|
{ label: "变更前", children: `${item.beforeDeptName}-${item.beforeMemberName}` },
|
||||||
|
{ label: "变更后", children: `${item.afterDeptName}-${item.afterMemberName}` },
|
||||||
|
])),
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
</Modal>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const ConfigModal = Connect([NS_EVALUATION_TEAM_CONFIG], true)(ConfigModalComponent);
|
||||||
|
const AddModal = Connect([NS_EVALUATION_TEAM_CONFIG], true)(AddModalComponent);
|
||||||
|
const ViewModal = Connect([NS_EVALUATION_TEAM_CONFIG], true)(ViewModalComponent);
|
||||||
|
const ChangeLogModal = Connect([NS_EVALUATION_TEAM_CONFIG], true)(ChangeLogModalComponent);
|
||||||
|
export default Connect([NS_EVALUATION_TEAM_CONFIG], true)(List);
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
function EvaluationTeamConfig(props) {
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
{props.children}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default EvaluationTeamConfig;
|
||||||
|
|
@ -0,0 +1,251 @@
|
||||||
|
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||||
|
import { Button, Descriptions, Form, message, Modal, Space } from "antd";
|
||||||
|
import { useEffect, useRef, useState } from "react";
|
||||||
|
import FormBuilder from "zy-react-library/components/FormBuilder";
|
||||||
|
import HeaderBack from "zy-react-library/components/HeaderBack";
|
||||||
|
import Search from "zy-react-library/components/Search";
|
||||||
|
import DepartmentSelectTree from "zy-react-library/components/SelectTree/Department/Gwj";
|
||||||
|
import DictionarySelectTree from "zy-react-library/components/SelectTree/Dictionary";
|
||||||
|
import Table from "zy-react-library/components/Table";
|
||||||
|
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||||
|
import { HIDDEN_SOURCE_ENUM, HIDDEN_STATE_ENUM } from "zy-react-library/enum/hidden/gwj";
|
||||||
|
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
|
||||||
|
import useGetUserInfo from "zy-react-library/hooks/useGetUserInfo";
|
||||||
|
import useTable from "zy-react-library/hooks/useTable";
|
||||||
|
import { getLabelName } from "zy-react-library/utils";
|
||||||
|
import { NS_HIDDEN_EVALUATION } from "~/enumerate/namespace";
|
||||||
|
import ViewEvaluationModal from "../../components/ViewEvaluationModal";
|
||||||
|
|
||||||
|
function List(props) {
|
||||||
|
const query = useGetUrlQuery();
|
||||||
|
const [viewEvaluationModalOpen, setViewEvaluationModalOpen] = useState(false);
|
||||||
|
const [evaluationModalOpen, setEvaluationModalOpen] = useState(false);
|
||||||
|
const [currentHiddenId, setCurrentHiddenId] = useState("");
|
||||||
|
const [form] = Form.useForm();
|
||||||
|
const { tableProps, getData } = useTable(props["hiddenEvaluationHiddenList"], {
|
||||||
|
form,
|
||||||
|
params: {
|
||||||
|
eqCorpId: query.corpinfoId,
|
||||||
|
eqHiddenType: query.hiddenType,
|
||||||
|
},
|
||||||
|
transform: formData => ({
|
||||||
|
geHiddenFindTime: formData.hiddenFindTime?.[0],
|
||||||
|
leHiddenFindTime: formData.hiddenFindTime?.[1],
|
||||||
|
geFinalDoneTime: formData.finalDoneTime?.[0],
|
||||||
|
leFinalDoneTime: formData.finalDoneTime?.[1],
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<HeaderBack title="分公司考评隐患" />
|
||||||
|
<div style={{ padding: 20 }}>
|
||||||
|
<Search
|
||||||
|
options={[
|
||||||
|
{ name: "likeHiddenDesc", label: "隐患描述" },
|
||||||
|
{ name: "eqSource", label: "隐患来源", render: FORM_ITEM_RENDER_ENUM.SELECT, items: HIDDEN_SOURCE_ENUM },
|
||||||
|
{ name: "eqHiddenFindDept", label: "发现部门", render: (<DepartmentSelectTree />) },
|
||||||
|
{ name: "likeFindUserName", label: "隐患发现人" },
|
||||||
|
{ name: "hiddenFindTime", label: "隐患发现时间", render: FORM_ITEM_RENDER_ENUM.DATE_RANGE },
|
||||||
|
{
|
||||||
|
name: "eqHiddenTypeC",
|
||||||
|
label: "隐患类型",
|
||||||
|
render: <DictionarySelectTree dictValue="hiddenType" onlyLastLevel />,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "eqEvaState",
|
||||||
|
label: "考评结果",
|
||||||
|
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||||
|
items: [
|
||||||
|
{ bianma: "1", name: "是" },
|
||||||
|
{ bianma: "2", name: "否" },
|
||||||
|
{ bianma: "3", name: "考评合格" },
|
||||||
|
{ bianma: "4", name: "考评不合格" },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "eqSelf",
|
||||||
|
label: "本人是否考评",
|
||||||
|
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||||
|
items: [{ bianma: "1", name: "是" }, { bianma: "0", name: "否" }],
|
||||||
|
},
|
||||||
|
{ name: "finalDoneTime", label: "考评完成时间", render: FORM_ITEM_RENDER_ENUM.DATE_RANGE },
|
||||||
|
]}
|
||||||
|
form={form}
|
||||||
|
onFinish={getData}
|
||||||
|
/>
|
||||||
|
<Table
|
||||||
|
columns={[
|
||||||
|
{
|
||||||
|
title: "隐患来源",
|
||||||
|
dataIndex: "source",
|
||||||
|
render: (_, record) => getLabelName({ list: HIDDEN_SOURCE_ENUM, status: record.source }),
|
||||||
|
},
|
||||||
|
{ title: "隐患描述", dataIndex: "hiddenDesc" },
|
||||||
|
{ title: "隐患发现时间", dataIndex: "hiddenFindTime" },
|
||||||
|
{ title: "隐患发现人", dataIndex: "findUserName" },
|
||||||
|
{
|
||||||
|
title: "隐患状态",
|
||||||
|
dataIndex: "state",
|
||||||
|
render: (_, record) => getLabelName({ list: HIDDEN_STATE_ENUM, status: record.state }),
|
||||||
|
},
|
||||||
|
{ title: "已考评组成员", dataIndex: "alreadyEvaluate" },
|
||||||
|
{ title: "待考评组成员", dataIndex: "notEvaluate" },
|
||||||
|
{
|
||||||
|
title: "考评结果",
|
||||||
|
dataIndex: "finalResult",
|
||||||
|
render: (_, record) => {
|
||||||
|
switch (record.finalResult) {
|
||||||
|
case 1:
|
||||||
|
return "考评合格";
|
||||||
|
case 0:
|
||||||
|
return "考评不合格";
|
||||||
|
default:
|
||||||
|
return "考核未完成";
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "操作",
|
||||||
|
width: 230,
|
||||||
|
fixed: "right",
|
||||||
|
render: (_, record) => (
|
||||||
|
<Space>
|
||||||
|
<Button
|
||||||
|
type="link"
|
||||||
|
onClick={() => {
|
||||||
|
props.history.push(`../hiddenView?hiddenId=${record.hiddenId}&id=${record.id}`);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
查看隐患详情
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
type="link"
|
||||||
|
onClick={() => {
|
||||||
|
setViewEvaluationModalOpen(true);
|
||||||
|
setCurrentHiddenId(record.id);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
考评详情
|
||||||
|
</Button>
|
||||||
|
{
|
||||||
|
record.isPermission === 1 && (
|
||||||
|
<Button
|
||||||
|
disabled={record.finalResult === 1 || record.finalResult === 0}
|
||||||
|
type="link"
|
||||||
|
onClick={() => {
|
||||||
|
setEvaluationModalOpen(true);
|
||||||
|
setCurrentHiddenId(record.id);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
考评
|
||||||
|
</Button>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
</Space>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
{...tableProps}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
{viewEvaluationModalOpen
|
||||||
|
&& <ViewEvaluationModal onCancel={() => setViewEvaluationModalOpen(false)} hiddenId={currentHiddenId} />}
|
||||||
|
{evaluationModalOpen
|
||||||
|
&& <EvaluationModal onCancel={() => setEvaluationModalOpen(false)} hiddenId={currentHiddenId} getData={getData} />}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const EvaluationModalComponent = (props) => {
|
||||||
|
const { getUserInfo } = useGetUserInfo();
|
||||||
|
const [form] = Form.useForm();
|
||||||
|
const [list, setList] = useState([]);
|
||||||
|
const isEdit = useRef(false);
|
||||||
|
const getData = async () => {
|
||||||
|
const { data } = await props["hiddenEvaluationHiddenEvaluationView"]({ eqHiddenId: props.hiddenId });
|
||||||
|
setList(data);
|
||||||
|
isEdit.current = (!!data?.[0]?.id);
|
||||||
|
const userInfo = await getUserInfo();
|
||||||
|
form.setFieldValue("user", `${userInfo.departmentName}-${userInfo.name}`);
|
||||||
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
getData();
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const onSubmit = async (values) => {
|
||||||
|
const { success } = await props[isEdit ? "hiddenEvaluationHiddenEvaluationUpdate" : "hiddenEvaluationHiddenEvaluationAdd"]({
|
||||||
|
...values,
|
||||||
|
hiddenId: props.hiddenId,
|
||||||
|
});
|
||||||
|
if (success) {
|
||||||
|
message.success("考评成功");
|
||||||
|
props.onCancel();
|
||||||
|
props.getData();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Modal
|
||||||
|
title="考评"
|
||||||
|
width={800}
|
||||||
|
open
|
||||||
|
maskClosable={false}
|
||||||
|
onCancel={props.onCancel}
|
||||||
|
onOk={form.submit}
|
||||||
|
loading={props.hiddenEvaluation.hiddenEvaluationLoading}
|
||||||
|
>
|
||||||
|
<Descriptions
|
||||||
|
column={2}
|
||||||
|
bordered
|
||||||
|
styles={{ label: { width: 200 } }}
|
||||||
|
items={[
|
||||||
|
...list.flatMap(item => ([
|
||||||
|
{ label: "考评人员", children: item.evaluateMemberName },
|
||||||
|
{
|
||||||
|
label: "是否符合",
|
||||||
|
children: (() => {
|
||||||
|
switch (item.evaluateResult) {
|
||||||
|
case 1:
|
||||||
|
return "考评合格";
|
||||||
|
case 0:
|
||||||
|
return "考评不合格";
|
||||||
|
default:
|
||||||
|
return "考核未完成";
|
||||||
|
}
|
||||||
|
})(),
|
||||||
|
},
|
||||||
|
...(item.evaluateResult === 0 ? [{ label: "不符合原因", children: `111`, span: 2 }] : []),
|
||||||
|
])),
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
<FormBuilder
|
||||||
|
style={{ marginTop: 20 }}
|
||||||
|
form={form}
|
||||||
|
showActionButtons={false}
|
||||||
|
span={24}
|
||||||
|
onFinish={onSubmit}
|
||||||
|
labelCol={{ span: 8 }}
|
||||||
|
options={[
|
||||||
|
{ name: "user", label: "考评人员", required: false, componentProps: { disabled: true } },
|
||||||
|
{
|
||||||
|
name: "result",
|
||||||
|
label: "是否符合",
|
||||||
|
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||||
|
items: [{ bianma: 1, name: "符合" }, { bianma: 0, name: "不符合" }],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "resultCase",
|
||||||
|
label: "不符合原因",
|
||||||
|
render: FORM_ITEM_RENDER_ENUM.TEXTAREA,
|
||||||
|
dependencies: ["result"],
|
||||||
|
hidden: formValues => !(formValues.result === 0),
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
</Modal>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const EvaluationModal = Connect([NS_HIDDEN_EVALUATION], true)(EvaluationModalComponent);
|
||||||
|
export default Connect([NS_HIDDEN_EVALUATION], true)(List);
|
||||||
|
|
@ -0,0 +1,73 @@
|
||||||
|
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||||
|
import { Button, Form, Space } from "antd";
|
||||||
|
import Search from "zy-react-library/components/Search";
|
||||||
|
import Table from "zy-react-library/components/Table";
|
||||||
|
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||||
|
import useTable from "zy-react-library/hooks/useTable";
|
||||||
|
import { NS_HIDDEN_EVALUATION } from "~/enumerate/namespace";
|
||||||
|
|
||||||
|
const STATE_ENUM = [
|
||||||
|
{ bianma: "1", name: "安全类已分配" },
|
||||||
|
{ bianma: "2", name: "安全类未分配" },
|
||||||
|
{ bianma: "3", name: "环保类已分配" },
|
||||||
|
{ bianma: "4", name: "环保类未分配" },
|
||||||
|
];
|
||||||
|
function List(props) {
|
||||||
|
const [form] = Form.useForm();
|
||||||
|
const { tableProps, getData } = useTable(props["hiddenEvaluationList"], {
|
||||||
|
form,
|
||||||
|
});
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<div style={{ padding: 20 }}>
|
||||||
|
<Search
|
||||||
|
options={[
|
||||||
|
{ name: "likeCorpinfoName", label: "分公司名称" },
|
||||||
|
{ name: "eqState", label: "隐患考评组类型", render: FORM_ITEM_RENDER_ENUM.SELECT, items: STATE_ENUM },
|
||||||
|
{ name: "likeMembers", label: "考评组成员" },
|
||||||
|
]}
|
||||||
|
form={form}
|
||||||
|
onFinish={getData}
|
||||||
|
/>
|
||||||
|
<Table
|
||||||
|
columns={[
|
||||||
|
{ title: "分公司名称", dataIndex: "corpinfoName" },
|
||||||
|
{ title: "隐患考评组类型", dataIndex: "hiddenType", render: (_, record) => (
|
||||||
|
<>
|
||||||
|
{record.hiddenType === "aqyh" && "安全类"}
|
||||||
|
{record.hiddenType === "wshb" && "环保类"}
|
||||||
|
</>
|
||||||
|
) },
|
||||||
|
{ title: "安全环保奖惩监管端", dataIndex: "superviseTotal", render: (_, record) => (`${record.superviseDone}/${record.superviseTotal}`) },
|
||||||
|
{ title: "安全环保奖惩企业端", dataIndex: "enterpriseTotal", render: (_, record) => (`${record.enterpriseDone}/${record.enterpriseTotal}`) },
|
||||||
|
{ title: "隐患排查", dataIndex: "troubleshootTotal", render: (_, record) => (`${record.troubleshootDone}/${record.troubleshootTotal}`) },
|
||||||
|
{ title: "隐患快报", dataIndex: "bulletinTotal", render: (_, record) => (`${record.bulletinDone}/${record.bulletinTotal}`) },
|
||||||
|
{ title: "消防检查", dataIndex: "fireControlTotal", render: (_, record) => (`${record.fireControlDone}/${record.fireControlTotal}`) },
|
||||||
|
{ title: "考评组成员", dataIndex: "members" },
|
||||||
|
{
|
||||||
|
title: "操作",
|
||||||
|
width: 100,
|
||||||
|
fixed: "right",
|
||||||
|
render: (_, record) => (
|
||||||
|
<Space>
|
||||||
|
<Button
|
||||||
|
type="link"
|
||||||
|
onClick={() => {
|
||||||
|
props.history.push(`./hiddenList?hiddenType=${record.hiddenType}&corpinfoId=${record.corpinfoId}`);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
考评
|
||||||
|
</Button>
|
||||||
|
</Space>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
{...tableProps}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Connect([NS_HIDDEN_EVALUATION], true)(List);
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
function HiddenEvaluation(props) {
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
{props.children}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default HiddenEvaluation;
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
import HiddenInfo from "zy-react-library/components/HiddenInfo/gwj";
|
||||||
|
|
||||||
|
function HiddenView() {
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<HiddenInfo />
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default HiddenView;
|
||||||
|
|
@ -0,0 +1,64 @@
|
||||||
|
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||||
|
import { Button, Form, Space } from "antd";
|
||||||
|
import Search from "zy-react-library/components/Search";
|
||||||
|
import DepartmentSelectTree from "zy-react-library/components/SelectTree/Department/Gwj";
|
||||||
|
import Table from "zy-react-library/components/Table";
|
||||||
|
import useTable from "zy-react-library/hooks/useTable";
|
||||||
|
import { NS_PERSONNEL_EVALUATION } from "~/enumerate/namespace";
|
||||||
|
|
||||||
|
function List(props) {
|
||||||
|
const [form] = Form.useForm();
|
||||||
|
const { tableProps, getData } = useTable(props["personnelEvaluationList"], {
|
||||||
|
form,
|
||||||
|
});
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<div style={{ padding: 20 }}>
|
||||||
|
<Search
|
||||||
|
options={[
|
||||||
|
{ name: "eqDeptId", label: "考评组部门", render: (<DepartmentSelectTree searchType="all" />) },
|
||||||
|
{ name: "likeSafetyMembers", label: "考评组人员" },
|
||||||
|
]}
|
||||||
|
form={form}
|
||||||
|
onFinish={getData}
|
||||||
|
/>
|
||||||
|
<Table
|
||||||
|
columns={[
|
||||||
|
{ title: "单位名称", dataIndex: "corpinfoName" },
|
||||||
|
{ title: "完成考评隐患数", dataIndex: "evaDoneTotal" },
|
||||||
|
{ title: "待考评隐患数", dataIndex: "checkTotal" },
|
||||||
|
{ title: "涉及奖励人数", dataIndex: "peopleTotal" },
|
||||||
|
{
|
||||||
|
title: "奖励兑换情况",
|
||||||
|
dataIndex: "alreadyExchange",
|
||||||
|
render: (_, record) => (`${record.alreadyExchange}/${record.alreadyExchange + record.notExchange}`),
|
||||||
|
},
|
||||||
|
{ title: "安全类隐患考评组成员", dataIndex: "safetyMembers" },
|
||||||
|
{ title: "环保类隐患考评组成员", dataIndex: "environmentalMembers" },
|
||||||
|
{
|
||||||
|
title: "操作",
|
||||||
|
width: 100,
|
||||||
|
fixed: "right",
|
||||||
|
render: (_, record) => (
|
||||||
|
<Space>
|
||||||
|
<Button
|
||||||
|
type="link"
|
||||||
|
onClick={() => {
|
||||||
|
props.history.push(`./userExchangeList?corpinfoId=${record.corpinfoId}`);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
查看
|
||||||
|
</Button>
|
||||||
|
</Space>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
{...tableProps}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Connect([NS_PERSONNEL_EVALUATION], true)(List);
|
||||||
|
|
@ -0,0 +1,157 @@
|
||||||
|
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||||
|
import { Button, Form, message, Modal, Space, Spin } from "antd";
|
||||||
|
import { useState } from "react";
|
||||||
|
import HeaderBack from "zy-react-library/components/HeaderBack";
|
||||||
|
import EditIcon from "zy-react-library/components/Icon/EditIcon";
|
||||||
|
import ExportIcon from "zy-react-library/components/Icon/ExportIcon";
|
||||||
|
import Search from "zy-react-library/components/Search";
|
||||||
|
import DepartmentSelectTree from "zy-react-library/components/SelectTree/Department/Gwj";
|
||||||
|
import Table from "zy-react-library/components/Table";
|
||||||
|
import useDownloadBlob from "zy-react-library/hooks/useDownloadBlob";
|
||||||
|
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
|
||||||
|
import useTable from "zy-react-library/hooks/useTable";
|
||||||
|
import { NS_PERSONNEL_EVALUATION } from "~/enumerate/namespace";
|
||||||
|
|
||||||
|
function List(props) {
|
||||||
|
const query = useGetUrlQuery();
|
||||||
|
const { loading: downloadBlobLoading, downloadBlob } = useDownloadBlob();
|
||||||
|
|
||||||
|
const [selectedRowKeys, setSelectedRowKeys] = useState([]);
|
||||||
|
const [form] = Form.useForm();
|
||||||
|
const { tableProps, getData } = useTable(props["personnelEvaluationUserExchangeList"], {
|
||||||
|
form,
|
||||||
|
params: {
|
||||||
|
eqCorpId: query.corpinfoId,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const onBatchExchange = async () => {
|
||||||
|
if (!selectedRowKeys.length) {
|
||||||
|
message.warning("请选择需要兑换的人员");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Modal.confirm({
|
||||||
|
title: "兑换确认",
|
||||||
|
content: "确定要兑换吗?", // 确定要兑换所有人得分吗
|
||||||
|
onOk: async () => {
|
||||||
|
const success = await props["personnelEvaluationExchange"]({ userIds: selectedRowKeys });
|
||||||
|
if (success) {
|
||||||
|
message.success("兑换成功");
|
||||||
|
getData();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onCancel: () => {
|
||||||
|
message.warning("已取消兑换");
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const onExportExcel = async () => {
|
||||||
|
if (!selectedRowKeys.length) {
|
||||||
|
message.warning("请选择需要导出的人员");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Modal.confirm({
|
||||||
|
title: "导出确认",
|
||||||
|
content: "确定要导出excel吗?",
|
||||||
|
onOk: async () => {
|
||||||
|
await downloadBlob("/hidden/viewUserEvaluateConditionList/exportEvaluate", { params: { findUserIds: selectedRowKeys.join(",") } });
|
||||||
|
message.success("导出成功");
|
||||||
|
},
|
||||||
|
onCancel: () => {
|
||||||
|
message.warning("已取消导出");
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<HeaderBack title="人员考评情况" />
|
||||||
|
<div style={{ padding: 20 }}>
|
||||||
|
<Spin spinning={downloadBlobLoading}>
|
||||||
|
<Search
|
||||||
|
options={[
|
||||||
|
{ name: "eqFindUserDeptId", label: "部门", render: (<DepartmentSelectTree isNeedCorpInfoId params={{ eqCorpinfoId: query.corpinfoId }} />) },
|
||||||
|
{ name: "likeFindUserRealName", label: "姓名" },
|
||||||
|
]}
|
||||||
|
form={form}
|
||||||
|
onFinish={getData}
|
||||||
|
/>
|
||||||
|
<Table
|
||||||
|
rowSelection={{
|
||||||
|
preserveSelectedRowKeys: true,
|
||||||
|
selectedRowKeys,
|
||||||
|
onChange: (selectedRowKeys) => {
|
||||||
|
setSelectedRowKeys(selectedRowKeys);
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
rowKey="findUserId"
|
||||||
|
toolBarRender={() => (
|
||||||
|
<Space>
|
||||||
|
<Button
|
||||||
|
type="primary"
|
||||||
|
icon={<EditIcon />}
|
||||||
|
onClick={onBatchExchange}
|
||||||
|
>
|
||||||
|
批量兑换
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
type="primary"
|
||||||
|
icon={<EditIcon />}
|
||||||
|
onClick={() => {
|
||||||
|
// TODO
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
全选兑换
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
type="primary"
|
||||||
|
icon={<ExportIcon />}
|
||||||
|
onClick={onExportExcel}
|
||||||
|
>
|
||||||
|
导出数据
|
||||||
|
</Button>
|
||||||
|
</Space>
|
||||||
|
)}
|
||||||
|
columns={[
|
||||||
|
{ title: "用户名", dataIndex: "findUserName" },
|
||||||
|
{ title: "姓名", dataIndex: "findUserRealName" },
|
||||||
|
{ title: "部门", dataIndex: "findUserDeptName" },
|
||||||
|
{ title: "岗位", dataIndex: "findUserPositionsName" },
|
||||||
|
{ title: "奖励总得分", dataIndex: "totalScore" },
|
||||||
|
{ title: "已兑换分数", dataIndex: "alreadyExchange" },
|
||||||
|
{ title: "未兑换奖励数", dataIndex: "notExchanged", render: (_, record) => record.totalScore - record.alreadyExchange },
|
||||||
|
{
|
||||||
|
title: "操作",
|
||||||
|
width: 200,
|
||||||
|
fixed: "right",
|
||||||
|
render: (_, record) => (
|
||||||
|
<Space>
|
||||||
|
<Button
|
||||||
|
type="link"
|
||||||
|
onClick={() => {
|
||||||
|
props.history.push(`./userExchangeRecordList?findUserId=${record.findUserId}`);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
兑换记录
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
type="link"
|
||||||
|
onClick={() => {
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
考评详情
|
||||||
|
</Button>
|
||||||
|
</Space>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
{...tableProps}
|
||||||
|
/>
|
||||||
|
</Spin>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Connect([NS_PERSONNEL_EVALUATION], true)(List);
|
||||||
|
|
@ -0,0 +1,78 @@
|
||||||
|
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||||
|
import { Button, Form, Space } from "antd";
|
||||||
|
import { useState } from "react";
|
||||||
|
import HeaderBack from "zy-react-library/components/HeaderBack";
|
||||||
|
import Search from "zy-react-library/components/Search";
|
||||||
|
import Table from "zy-react-library/components/Table";
|
||||||
|
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||||
|
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
|
||||||
|
import useTable from "zy-react-library/hooks/useTable";
|
||||||
|
import { NS_PERSONNEL_EVALUATION } from "~/enumerate/namespace";
|
||||||
|
|
||||||
|
function List(props) {
|
||||||
|
const query = useGetUrlQuery();
|
||||||
|
|
||||||
|
const [selectedRowKeys, setSelectedRowKeys] = useState([]);
|
||||||
|
const [form] = Form.useForm();
|
||||||
|
const { tableProps, getData } = useTable(props["personnelEvaluationUserExchangeRecordList"], {
|
||||||
|
form,
|
||||||
|
params: {
|
||||||
|
eqBelongerId: query.findUserId,
|
||||||
|
},
|
||||||
|
transform: formData => ({
|
||||||
|
geExchangeTime: formData.dates?.[0],
|
||||||
|
leExchangeTime: formData.dates?.[1],
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<HeaderBack title="兑换记录" />
|
||||||
|
<div style={{ padding: 20 }}>
|
||||||
|
<Search
|
||||||
|
options={[
|
||||||
|
{ name: "dates", label: "兑换时间", render: FORM_ITEM_RENDER_ENUM.DATE_RANGE },
|
||||||
|
]}
|
||||||
|
form={form}
|
||||||
|
onFinish={getData}
|
||||||
|
/>
|
||||||
|
<Table
|
||||||
|
rowSelection={{
|
||||||
|
preserveSelectedRowKeys: true,
|
||||||
|
selectedRowKeys,
|
||||||
|
onChange: (selectedRowKeys) => {
|
||||||
|
setSelectedRowKeys(selectedRowKeys);
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
rowKey="findUserId"
|
||||||
|
columns={[
|
||||||
|
{ title: "兑换时间", dataIndex: "exchangeTime" },
|
||||||
|
{ title: "兑换操作人员", dataIndex: "exchangeUserName" },
|
||||||
|
{ title: "兑换隐患数", dataIndex: "exchangeTotal" },
|
||||||
|
{ title: "兑换积分", dataIndex: "exchangeScore" },
|
||||||
|
{ title: "剩余积分数", dataIndex: "surplusScoreTotal" },
|
||||||
|
{
|
||||||
|
title: "操作",
|
||||||
|
width: 100,
|
||||||
|
fixed: "right",
|
||||||
|
render: (_, record) => (
|
||||||
|
<Space>
|
||||||
|
<Button
|
||||||
|
type="link"
|
||||||
|
onClick={() => {
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
隐患详情
|
||||||
|
</Button>
|
||||||
|
</Space>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
{...tableProps}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Connect([NS_PERSONNEL_EVALUATION], true)(List);
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
function PersonnelEvaluation(props) {
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
{props.children}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default PersonnelEvaluation;
|
||||||
|
|
@ -0,0 +1,59 @@
|
||||||
|
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||||
|
import { Button, Descriptions, Modal } from "antd";
|
||||||
|
import { useEffect, useState } from "react";
|
||||||
|
import { NS_HIDDEN_EVALUATION } from "~/enumerate/namespace";
|
||||||
|
|
||||||
|
const ViewEvaluationModal = (props) => {
|
||||||
|
const [list, setList] = useState([]);
|
||||||
|
const getData = async () => {
|
||||||
|
const { data } = await props["hiddenEvaluationHiddenEvaluationView"]({ eqHiddenId: props.hiddenId });
|
||||||
|
setList(data);
|
||||||
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
getData();
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Modal
|
||||||
|
title="考评详情"
|
||||||
|
width={800}
|
||||||
|
open
|
||||||
|
maskClosable={false}
|
||||||
|
onCancel={props.onCancel}
|
||||||
|
loading={props.hiddenEvaluation.hiddenEvaluationLoading}
|
||||||
|
footer={[
|
||||||
|
<Button key="cancel" onClick={props.onCancel}>
|
||||||
|
取消
|
||||||
|
</Button>,
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
<Descriptions
|
||||||
|
column={2}
|
||||||
|
bordered
|
||||||
|
styles={{ label: { width: 200 } }}
|
||||||
|
items={[
|
||||||
|
...list.flatMap(item => ([
|
||||||
|
{ label: "考评人员", children: item.evaluateMemberName },
|
||||||
|
{
|
||||||
|
label: "是否符合",
|
||||||
|
children: (() => {
|
||||||
|
switch (item.evaluateResult) {
|
||||||
|
case 1:
|
||||||
|
return "考评合格";
|
||||||
|
case 0:
|
||||||
|
return "考评不合格";
|
||||||
|
default:
|
||||||
|
return "考核未完成";
|
||||||
|
}
|
||||||
|
})(),
|
||||||
|
},
|
||||||
|
...(item.evaluateResult === 0 ? [{ label: "不符合原因", children: "todo", span: 2 }] : []),
|
||||||
|
])),
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
</Modal>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default Connect([NS_HIDDEN_EVALUATION], true)(ViewEvaluationModal);
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
function Evaluation(props) {
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
{props.children}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Evaluation;
|
||||||
Loading…
Reference in New Issue