From 335baa2c78103508b2519cc14bd60bb60562d543 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Thu, 28 Dec 2023 11:12:30 +0800 Subject: [PATCH] =?UTF-8?q?master-=E4=B8=AA=E7=A8=8E=E7=94=B3=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layouts/config.js | 1 + src/pages/taxDeclareTable/index.tsx | 76 +++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+) create mode 100644 src/pages/taxDeclareTable/index.tsx diff --git a/src/layouts/config.js b/src/layouts/config.js index 37ef1b4..873e8fe 100644 --- a/src/layouts/config.js +++ b/src/layouts/config.js @@ -16,6 +16,7 @@ module.exports = { "/welfareLedgerTable.*": "blank", "/payrollFilesTable.*": "blank", "/employeeDeclareTable.*": "blank", + "/taxDeclareTable.*": "blank", "/welfareArchiveTable.*": "blank", "/OCTable.*": "blank", "/manage.*": "manage", diff --git a/src/pages/taxDeclareTable/index.tsx b/src/pages/taxDeclareTable/index.tsx new file mode 100644 index 0000000..2223e9e --- /dev/null +++ b/src/pages/taxDeclareTable/index.tsx @@ -0,0 +1,76 @@ +/* + * Author: 黎永顺 + * name: 个税申报表-详情表格 + * Description: + * Date: 2023/12/27 + */ +import React, { FC, useEffect, useState } from "react"; +import { Button, Space, Table } from "antd"; +import { exceptStr, paginationAction } from "@/utils/common"; +import styles from "@/pages/atdTable/components/index.less"; +import { PaginationData } from "rc-pagination"; + +const TaxDeclareTable: FC = (props) => { + const [pageInfo, setPageInfo] = useState>({}); + const [columns, setColumns] = useState>([]); + const [dataSource, setDataSource] = useState>([]); + const [i18n, setI18n] = useState>({}); + + useEffect(() => { + window.parent.postMessage({ type: "init" }, "*"); + window.addEventListener("message", receiveMessageFromIndex, false); + return () => { + window.removeEventListener("message", receiveMessageFromIndex, false); + }; + }, []); + const receiveMessageFromIndex = (event: any) => { + const data: any = exceptStr(event.data); + if (!_.isEmpty(data)) { + const { columns, dataSource, pageInfo, i18n, declareStatus } = data; + setDataSource(dataSource); + setI18n(i18n); + setPageInfo(pageInfo); + setColumns(["NOT_DECLARE", "DECLARE_FAIL"].includes(declareStatus) ? [ + ...columns, + { + title: i18n["操作"], + dataIndex: "operate", + fixed: "right", + width: 120, + render: (_: any, record: any) => ( + + + + ) + } + ] : columns); + } + }; + const handleEdit = (record: any) => { + window.parent.postMessage({ type: "turn", payload: { id: "EDIT", params: { ...record } } }, "*"); + }; + const onChange = (current: number, pageSize: number) => { + setPageInfo((prevState) => { + const { pageSize: size } = prevState; + window.parent.postMessage( + { + type: "turn", + payload: { id: "PAGEINFO", params: { ...pageInfo, current: size === pageSize ? current : 1, pageSize } } + }, + "*" + ); + return { ...pageInfo, current: size === pageSize ? current : 1, pageSize }; + }); + }; + return ; +}; + +export default TaxDeclareTable;