补全强制关闭和监管端统计
parent
a8537e42d1
commit
51c34d80b6
|
|
@ -24,7 +24,15 @@ export const eightworkType = declareRequest(
|
||||||
"eightworkLoading",
|
"eightworkLoading",
|
||||||
`Post > @/eightwork/eightworkTask/listByWorkType`,
|
`Post > @/eightwork/eightworkTask/listByWorkType`,
|
||||||
);
|
);
|
||||||
export const eightworkRecordsList = declareRequest(
|
export const forceTerminate = declareRequest(
|
||||||
"eightworkLoading",
|
"eightworkLoading",
|
||||||
`Post > @/eightwork/eightworkInfo/list`,
|
`Post > @/eightwork/eightworkInfo/forceTerminate`,
|
||||||
|
);
|
||||||
|
export const statisticsByWorkType = declareRequest(
|
||||||
|
"eightworkLoading",
|
||||||
|
`Post > @/eightwork/eightworkInfo/statisticsByWorkType`,
|
||||||
|
);
|
||||||
|
export const corpInfoList = declareRequest(
|
||||||
|
"eightworkLoading",
|
||||||
|
"Post > @/basicInfo/corpInfo/list",
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -7,10 +7,13 @@ import { NS_EIGHTWORK } from "~/enumerate/namespace";
|
||||||
const ForceTerminationModal = (props) => {
|
const ForceTerminationModal = (props) => {
|
||||||
const [form] = FormBuilder.useForm();
|
const [form] = FormBuilder.useForm();
|
||||||
|
|
||||||
const onSubmit = async () => {
|
const onSubmit = async (values) => {
|
||||||
message.success("强制关闭成功");
|
const { success } = await props["forceTerminate"]({ ...values, id: props.id });
|
||||||
props.getData();
|
if (success) {
|
||||||
props.onCancel();
|
message.success("强制关闭成功");
|
||||||
|
props.getData();
|
||||||
|
props.onCancel();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
@ -30,7 +33,7 @@ const ForceTerminationModal = (props) => {
|
||||||
span={24}
|
span={24}
|
||||||
labelCol={{ span: 10 }}
|
labelCol={{ span: 10 }}
|
||||||
options={[
|
options={[
|
||||||
{ name: "todo", label: "强制关闭原因", render: FORM_ITEM_RENDER_ENUM.TEXTAREA },
|
{ name: "closeReason", label: "强制关闭原因", render: FORM_ITEM_RENDER_ENUM.TEXTAREA },
|
||||||
]}
|
]}
|
||||||
form={form}
|
form={form}
|
||||||
showActionButtons={false}
|
showActionButtons={false}
|
||||||
|
|
|
||||||
|
|
@ -89,7 +89,7 @@ function List(props) {
|
||||||
dataIndex: "status",
|
dataIndex: "status",
|
||||||
render: (_, record) => getLabelName({ list: STATUS_ENUM, status: record.status }),
|
render: (_, record) => getLabelName({ list: STATUS_ENUM, status: record.status }),
|
||||||
},
|
},
|
||||||
{ title: "强制关闭原因", dataIndex: "todo", hidden: !(props.status === 998) },
|
{ title: "强制关闭原因", dataIndex: ["info", "closeReason"], hidden: !(props.status === "998") },
|
||||||
{
|
{
|
||||||
title: "操作",
|
title: "操作",
|
||||||
fixed: "right",
|
fixed: "right",
|
||||||
|
|
|
||||||
|
|
@ -109,7 +109,7 @@ function List(props) {
|
||||||
dataIndex: "status",
|
dataIndex: "status",
|
||||||
render: (_, record) => getLabelName({ list: STATUS_ENUM, status: record.status }),
|
render: (_, record) => getLabelName({ list: STATUS_ENUM, status: record.status }),
|
||||||
},
|
},
|
||||||
{ title: "强制关闭原因", dataIndex: "todo", hidden: !(props.status === 998) },
|
{ title: "强制关闭原因", dataIndex: ["info", "closeReason"], hidden: !(props.status === "998") },
|
||||||
{
|
{
|
||||||
title: "操作",
|
title: "操作",
|
||||||
fixed: "right",
|
fixed: "right",
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||||
import { Button } from "antd";
|
import { Button } from "antd";
|
||||||
|
import { useState } from "react";
|
||||||
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 Table from "zy-react-library/components/Table";
|
import Table from "zy-react-library/components/Table";
|
||||||
|
|
@ -7,28 +8,48 @@ import useTable from "zy-react-library/hooks/useTable";
|
||||||
import { NS_EIGHTWORK } from "~/enumerate/namespace";
|
import { NS_EIGHTWORK } from "~/enumerate/namespace";
|
||||||
|
|
||||||
function List(props) {
|
function List(props) {
|
||||||
|
const [list, setList] = useState([]);
|
||||||
|
|
||||||
const [form] = Search.useForm();
|
const [form] = Search.useForm();
|
||||||
|
|
||||||
const { tableProps, getData } = useTable(props["eightworkRecordsList"], {
|
const getStatistics = async (list) => {
|
||||||
|
const { data } = await props["statisticsByWorkType"]({
|
||||||
|
eqWorkType: props.eqWorkType || "hot_work",
|
||||||
|
inCorpInfoId: list.map(item => item.id),
|
||||||
|
});
|
||||||
|
const mergedList = list.map((item) => {
|
||||||
|
const statistics = data.find(stat => stat.corpinfoId === item.id);
|
||||||
|
return {
|
||||||
|
...item,
|
||||||
|
...statistics,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
setList(mergedList);
|
||||||
|
};
|
||||||
|
|
||||||
|
const { tableProps, getData } = useTable(props["corpInfoList"], {
|
||||||
form,
|
form,
|
||||||
params: { eqWorkType: props.eqWorkType || "hot_work" },
|
params: { inType: [0, 1, 6, 3, 4, 5] },
|
||||||
|
onSuccess: (data) => {
|
||||||
|
getStatistics(data.list);
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Page isShowAllAction={false}>
|
<Page isShowAllAction={false}>
|
||||||
<Search
|
<Search
|
||||||
options={[
|
options={[
|
||||||
{ name: "todo", label: "公司名称" },
|
{ name: "likecorpName", label: "公司名称" },
|
||||||
]}
|
]}
|
||||||
form={form}
|
form={form}
|
||||||
onFinish={getData}
|
onFinish={getData}
|
||||||
/>
|
/>
|
||||||
<Table
|
<Table
|
||||||
columns={[
|
columns={[
|
||||||
{ title: "公司名称", dataIndex: "todo" },
|
{ title: "公司名称", dataIndex: "corpName" },
|
||||||
{
|
{
|
||||||
title: "申请总数",
|
title: "申请总数",
|
||||||
dataIndex: "todo",
|
dataIndex: "totalCount",
|
||||||
render: (_, record) => (
|
render: (_, record) => (
|
||||||
<Button
|
<Button
|
||||||
type="link"
|
type="link"
|
||||||
|
|
@ -36,13 +57,13 @@ function List(props) {
|
||||||
props.history.push(`./recordsList?corpinfoId=${record.id}`);
|
props.history.push(`./recordsList?corpinfoId=${record.id}`);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{record.todo || 0}
|
{(record.doneCount + record.rejectedCount + record.doingCount + record.forceTerminateCount) || 0}
|
||||||
</Button>
|
</Button>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "完成数",
|
title: "完成数",
|
||||||
dataIndex: "todo",
|
dataIndex: "doneCount",
|
||||||
render: (_, record) => (
|
render: (_, record) => (
|
||||||
<Button
|
<Button
|
||||||
type="link"
|
type="link"
|
||||||
|
|
@ -50,13 +71,13 @@ function List(props) {
|
||||||
props.history.push(`./recordsList?corpinfoId=${record.id}&status=999`);
|
props.history.push(`./recordsList?corpinfoId=${record.id}&status=999`);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{record.todo || 0}
|
{record.doneCount || 0}
|
||||||
</Button>
|
</Button>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "进行数",
|
title: "进行数",
|
||||||
dataIndex: "todo",
|
dataIndex: "doingCount",
|
||||||
render: (_, record) => (
|
render: (_, record) => (
|
||||||
<Button
|
<Button
|
||||||
type="link"
|
type="link"
|
||||||
|
|
@ -64,13 +85,27 @@ function List(props) {
|
||||||
props.history.push(`./recordsList?corpinfoId=${record.id}&status=1`);
|
props.history.push(`./recordsList?corpinfoId=${record.id}&status=1`);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{record.todo || 0}
|
{(record.doingCount) || 0}
|
||||||
|
</Button>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "打回数",
|
||||||
|
dataIndex: "rejectedCount",
|
||||||
|
render: (_, record) => (
|
||||||
|
<Button
|
||||||
|
type="link"
|
||||||
|
onClick={() => {
|
||||||
|
props.history.push(`./recordsList?corpinfoId=${record.id}&status=2`);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{(record.rejectedCount) || 0}
|
||||||
</Button>
|
</Button>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "废除数",
|
title: "废除数",
|
||||||
dataIndex: "todo",
|
dataIndex: "forceTerminateCount",
|
||||||
render: (_, record) => (
|
render: (_, record) => (
|
||||||
<Button
|
<Button
|
||||||
type="link"
|
type="link"
|
||||||
|
|
@ -78,12 +113,14 @@ function List(props) {
|
||||||
props.history.push(`./recordsList?corpinfoId=${record.id}&status=998`);
|
props.history.push(`./recordsList?corpinfoId=${record.id}&status=998`);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{record.todo || 0}
|
{record.forceTerminateCount || 0}
|
||||||
</Button>
|
</Button>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
{...tableProps}
|
{...tableProps}
|
||||||
|
dataSource={list}
|
||||||
|
loading={props.eightwork.eightworkLoading || tableProps.loading}
|
||||||
/>
|
/>
|
||||||
</Page>
|
</Page>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue