补全强制关闭和监管端统计

master
LiuJiaNan 2026-03-31 16:44:04 +08:00
parent a8537e42d1
commit 51c34d80b6
5 changed files with 69 additions and 21 deletions

View File

@ -24,7 +24,15 @@ export const eightworkType = declareRequest(
"eightworkLoading",
`Post > @/eightwork/eightworkTask/listByWorkType`,
);
export const eightworkRecordsList = declareRequest(
export const forceTerminate = declareRequest(
"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",
);

View File

@ -7,10 +7,13 @@ import { NS_EIGHTWORK } from "~/enumerate/namespace";
const ForceTerminationModal = (props) => {
const [form] = FormBuilder.useForm();
const onSubmit = async () => {
const onSubmit = async (values) => {
const { success } = await props["forceTerminate"]({ ...values, id: props.id });
if (success) {
message.success("强制关闭成功");
props.getData();
props.onCancel();
}
};
return (
@ -30,7 +33,7 @@ const ForceTerminationModal = (props) => {
span={24}
labelCol={{ span: 10 }}
options={[
{ name: "todo", label: "强制关闭原因", render: FORM_ITEM_RENDER_ENUM.TEXTAREA },
{ name: "closeReason", label: "强制关闭原因", render: FORM_ITEM_RENDER_ENUM.TEXTAREA },
]}
form={form}
showActionButtons={false}

View File

@ -89,7 +89,7 @@ function List(props) {
dataIndex: "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: "操作",
fixed: "right",

View File

@ -109,7 +109,7 @@ function List(props) {
dataIndex: "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: "操作",
fixed: "right",

View File

@ -1,5 +1,6 @@
import { Connect } from "@cqsjjb/jjb-dva-runtime";
import { Button } from "antd";
import { useState } from "react";
import Page from "zy-react-library/components/Page";
import Search from "zy-react-library/components/Search";
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";
function List(props) {
const [list, setList] = useState([]);
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,
params: { eqWorkType: props.eqWorkType || "hot_work" },
params: { inType: [0, 1, 6, 3, 4, 5] },
onSuccess: (data) => {
getStatistics(data.list);
},
});
return (
<Page isShowAllAction={false}>
<Search
options={[
{ name: "todo", label: "公司名称" },
{ name: "likecorpName", label: "公司名称" },
]}
form={form}
onFinish={getData}
/>
<Table
columns={[
{ title: "公司名称", dataIndex: "todo" },
{ title: "公司名称", dataIndex: "corpName" },
{
title: "申请总数",
dataIndex: "todo",
dataIndex: "totalCount",
render: (_, record) => (
<Button
type="link"
@ -36,13 +57,13 @@ function List(props) {
props.history.push(`./recordsList?corpinfoId=${record.id}`);
}}
>
{record.todo || 0}
{(record.doneCount + record.rejectedCount + record.doingCount + record.forceTerminateCount) || 0}
</Button>
),
},
{
title: "完成数",
dataIndex: "todo",
dataIndex: "doneCount",
render: (_, record) => (
<Button
type="link"
@ -50,13 +71,13 @@ function List(props) {
props.history.push(`./recordsList?corpinfoId=${record.id}&status=999`);
}}
>
{record.todo || 0}
{record.doneCount || 0}
</Button>
),
},
{
title: "进行数",
dataIndex: "todo",
dataIndex: "doingCount",
render: (_, record) => (
<Button
type="link"
@ -64,13 +85,27 @@ function List(props) {
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>
),
},
{
title: "废除数",
dataIndex: "todo",
dataIndex: "forceTerminateCount",
render: (_, record) => (
<Button
type="link"
@ -78,12 +113,14 @@ function List(props) {
props.history.push(`./recordsList?corpinfoId=${record.id}&status=998`);
}}
>
{record.todo || 0}
{record.forceTerminateCount || 0}
</Button>
),
},
]}
{...tableProps}
dataSource={list}
loading={props.eightwork.eightworkLoading || tableProps.loading}
/>
</Page>
);