diff --git a/src/pages/Container/BranchCompany/Inspection/Records/List/index.js b/src/pages/Container/BranchCompany/Inspection/Records/List/index.js index 5354f51..d0a1eed 100644 --- a/src/pages/Container/BranchCompany/Inspection/Records/List/index.js +++ b/src/pages/Container/BranchCompany/Inspection/Records/List/index.js @@ -2,7 +2,7 @@ import { Permission } from "@cqsjjb/jjb-common-decorator/permission"; import { Connect } from "@cqsjjb/jjb-dva-runtime"; import { Button, Form, message, Modal, Space, Spin } from "antd"; -import { useEffect, useState } from "react"; +import { useState } from "react"; import ExportIcon from "zy-react-library/components/Icon/ExportIcon"; import Page from "zy-react-library/components/Page"; import Search from "zy-react-library/components/Search"; @@ -35,6 +35,20 @@ function List(props) { }); const [form] = Form.useForm(); + + const getCount = async () => { + const { data } = await props["inspectionCount"]({ + menuPath: window.location.pathname, + status: "", + entrance: "0", + corpId: query.corpId, + checkStartTime: query.checkStartTime || form.getFieldValue("checkTime")?.[0], + checkEndTime: query.checkEndTime || form.getFieldValue("checkTime")?.[1], + planType: query.planType, + ...form.getFieldsValue(), + }); + setCount(data); + }; const { tableProps, getData } = useTable(props["inspectionList"], { form, transform: formData => ({ @@ -45,26 +59,13 @@ function List(props) { entrance: "0", corpId: query.corpId, }, + onBefore: () => { + setCount({}); + }, onSuccess: () => { getCount(); }, }); - const getCount = async () => { - const { data } = await props["inspectionCount"]({ - menuPath: window.location.pathname, - status: "", - entrance: "0", - corpId: query.corpId, - checkStartTime: query.checkStartTime || form.getFieldValue("checkTime")?.[0], - checkEndTime: query.checkEndTime || form.getFieldValue("checkTime").checkTime?.[1], - planType: query.planType, - ...form.getFieldsValue(), - }); - setCount(data); - }; - useEffect(() => { - getCount(); - }, []); const onDelete = (id) => { Modal.confirm({