Merge branch 'master' into feature/V2-系统多语言
This commit is contained in:
commit
3835fcf8e3
|
|
@ -35,6 +35,26 @@ class CalculateService extends BasicService {
|
|||
getRankInfo = async () => {
|
||||
return this.get(`/api/ais/tupu/getRankInfo`);
|
||||
};
|
||||
//获取社保福利台账-正常缴纳合计行数据
|
||||
siaccountDetailCommonListSum = async (data: any) => {
|
||||
return this.post(`/api/bs/hrmsalary/siaccount/detail/common/list/sum`, data);
|
||||
};
|
||||
//获取社保福利台账-正常缴纳合计行数据
|
||||
siaccountDetailSupplementaryListSum = async (data: any) => {
|
||||
return this.post(`/api/bs/hrmsalary/siaccount/detail/supplementary/list/sum`, data);
|
||||
};
|
||||
//获取社保福利台账-社保福利台账退差合计接口
|
||||
siaccountDetailRecessionListSum = async (data: any) => {
|
||||
return this.post(`/api/bs/hrmsalary/siaccount/detail/recession/list/sum`, data);
|
||||
};
|
||||
//获取社保福利台账-社保福利台账补差合计接口
|
||||
siaccountDetailBalanceListSum = async (data: any) => {
|
||||
return this.post(`/api/bs/hrmsalary/siaccount/detail/balance/list/sum`, data);
|
||||
};
|
||||
//工资单发放-查看详情页面列表合计行数据
|
||||
salaryBillSendSum = async (data: any) => {
|
||||
return this.post(`/api/bs/hrmsalary/salaryBill/send/sum`, data);
|
||||
};
|
||||
//合计行
|
||||
getAcctresultsum = async (params: any) => {
|
||||
const { departmentIds = "", positionIds = "", subcompanyIds = "", ...extraParams } = params || {};
|
||||
|
|
|
|||
|
|
@ -1,25 +1,28 @@
|
|||
module.exports = {
|
||||
name: '统一软件开发平台',
|
||||
name: "统一软件开发平台",
|
||||
layoutConfig: {
|
||||
'/home': 'blank',
|
||||
'/manage/design/.*': 'blank',
|
||||
'/manage/editor': 'blank',
|
||||
'/calculateDetail.*': 'blank',
|
||||
'/atdTable.*': 'blank',
|
||||
'/previewTable.*': 'blank',
|
||||
'/standingbookTable.*': 'blank',
|
||||
'/fileTable.*': 'blank',
|
||||
'/rankMapTable.*': 'blank',
|
||||
'/manage.*': 'manage',
|
||||
'/portal.*': 'template',
|
||||
'/passport/oauth-in': 'blank',
|
||||
'/passport/openid-in': 'blank',
|
||||
'/passport/sign-in': 'user',
|
||||
'/passport/chose-portal': 'user',
|
||||
'/passport/RegisterResult': 'user',
|
||||
'/403': 'blank',
|
||||
'/404': 'blank',
|
||||
'/500': 'blank',
|
||||
'/': 'template',
|
||||
},
|
||||
"/home": "blank",
|
||||
"/manage/design/.*": "blank",
|
||||
"/manage/editor": "blank",
|
||||
"/calculateDetail.*": "blank",
|
||||
"/atdTable.*": "blank",
|
||||
"/previewTable.*": "blank",
|
||||
"/standingbookTable.*": "blank",
|
||||
"/fileTable.*": "blank",
|
||||
"/rankMapTable.*": "blank",
|
||||
"/reportTable.*": "blank",
|
||||
"/commonTable.*": "blank",
|
||||
"/payrollFilesTable.*": "blank",
|
||||
"/manage.*": "manage",
|
||||
"/portal.*": "template",
|
||||
"/passport/oauth-in": "blank",
|
||||
"/passport/openid-in": "blank",
|
||||
"/passport/sign-in": "user",
|
||||
"/passport/chose-portal": "user",
|
||||
"/passport/RegisterResult": "user",
|
||||
"/403": "blank",
|
||||
"/404": "blank",
|
||||
"/500": "blank",
|
||||
"/": "template"
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import React, { FC, useEffect, useState } from "react";
|
||||
import { exceptStr, paginationFun } from "@/utils/common";
|
||||
import { defaultPage, ILoading, IPage } from "@/common/types/page";
|
||||
import { message, Spin, Table, Typography } from "antd";
|
||||
import { Button, message, Spin, Table, Typography } from "antd";
|
||||
import { LockOutlined, UnlockOutlined } from "@ant-design/icons";
|
||||
import API from "@/api";
|
||||
import styles from "./index.less";
|
||||
|
|
@ -66,7 +66,7 @@ const AntdTable: FC<ITableProps> = (props) => {
|
|||
const confCode: any = await API.CalculateService.getSysconfcode({ code: "OPEN_ACCT_RESULT_SUM" });
|
||||
setShowSumrow(confCode.data.status && confCode.data.data === "1");
|
||||
if (confCode.data.status && confCode.data.data === "1") {
|
||||
const sumRowlist: any = await API.CalculateService.getAcctresultsum({...extraParams["queryParams"]});
|
||||
const sumRowlist: any = await API.CalculateService.getAcctresultsum({ ...extraParams["queryParams"] });
|
||||
if (sumRowlist.data.status && !_.isEmpty(sumRowlist.data.data.sumRow)) {
|
||||
setSumRow(sumRowlist.data.data.sumRow);
|
||||
}
|
||||
|
|
@ -86,19 +86,19 @@ const AntdTable: FC<ITableProps> = (props) => {
|
|||
title: "操作",
|
||||
render: (text: string, record: any) => {
|
||||
return (
|
||||
<a
|
||||
onClick={() => {
|
||||
window.parent.postMessage(
|
||||
{
|
||||
type: "PC",
|
||||
data: { id: "DELETE", data: record }
|
||||
},
|
||||
"*"
|
||||
);
|
||||
}}
|
||||
<Button type="link" style={{ padding: "0" }}
|
||||
onClick={() => {
|
||||
window.parent.postMessage(
|
||||
{
|
||||
type: "PC",
|
||||
data: { id: "DELETE", data: record }
|
||||
},
|
||||
"*"
|
||||
);
|
||||
}}
|
||||
>
|
||||
删除
|
||||
</a>
|
||||
</Button>
|
||||
);
|
||||
}
|
||||
}];
|
||||
|
|
@ -278,7 +278,7 @@ const AntdTable: FC<ITableProps> = (props) => {
|
|||
width: "100px",
|
||||
fixed: "right",
|
||||
render: (text: string, record: any) => {
|
||||
return <a onClick={() => {
|
||||
return <Button type="link" style={{ padding: "0" }} onClick={() => {
|
||||
window.parent.postMessage(
|
||||
{
|
||||
type: "PR",
|
||||
|
|
@ -286,7 +286,7 @@ const AntdTable: FC<ITableProps> = (props) => {
|
|||
},
|
||||
"*"
|
||||
);
|
||||
}}>编辑</a>;
|
||||
}}>编辑</Button>;
|
||||
}
|
||||
});
|
||||
return tmpColumns;
|
||||
|
|
@ -361,7 +361,7 @@ const AntdTable: FC<ITableProps> = (props) => {
|
|||
_.isEmpty(sumRow) ? <Spin tip="加载中"/> :
|
||||
_.map([{}, ...totalColumns], (item, index) => {
|
||||
if (index === 0) {
|
||||
return <Table.Summary.Cell index={0}><Text type="danger">总计</Text></Table.Summary.Cell>;
|
||||
return <Table.Summary.Cell index={0} align="center"><Text type="danger">总计</Text></Table.Summary.Cell>;
|
||||
}
|
||||
return <Table.Summary.Cell index={index} key={index}>
|
||||
<Text type="danger">{sumRow[item.dataIndex] || "-"}</Text>
|
||||
|
|
|
|||
|
|
@ -56,9 +56,39 @@
|
|||
}
|
||||
}
|
||||
|
||||
.customSpan {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
justify-content: space-between;
|
||||
|
||||
span.title {
|
||||
flex: 1;
|
||||
margin-right: 4px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
:global {
|
||||
.ant-tag {
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
:global {
|
||||
.ant-btn-link {
|
||||
.ant-btn-link, .ant-dropdown-trigger {
|
||||
font-size: 12px;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.ant-btn-link:hover {
|
||||
color: #00a9ff;
|
||||
|
||||
span {
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
|
||||
.ant-table-tbody > tr.ant-table-row:hover > td {
|
||||
|
|
@ -87,6 +117,15 @@
|
|||
}
|
||||
}
|
||||
|
||||
.ant-pagination-item-active {
|
||||
background: var(--ant-primary-color);
|
||||
border: none;
|
||||
|
||||
& > a {
|
||||
color: #FFF;
|
||||
}
|
||||
}
|
||||
|
||||
.ant-pagination-options {
|
||||
.ant-select {
|
||||
font-size: 12px;
|
||||
|
|
@ -135,6 +174,19 @@
|
|||
|
||||
.moreIconWrapper {
|
||||
:global {
|
||||
.ant-btn-link {
|
||||
font-size: 12px;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.ant-btn-link:hover {
|
||||
color: #00a9ff;
|
||||
|
||||
span {
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
|
||||
.ant-popover-inner {
|
||||
min-width: 106px
|
||||
}
|
||||
|
|
@ -156,17 +208,24 @@
|
|||
}
|
||||
}
|
||||
|
||||
:global{
|
||||
.rankMapWrapper{
|
||||
.ant-table-thead>tr>th{
|
||||
:global {
|
||||
.rankMapWrapper {
|
||||
.ant-table-thead > tr > th {
|
||||
background: #ED7D31;
|
||||
}
|
||||
}
|
||||
|
||||
.bg_1_Cols {
|
||||
background: #ED7D31!important;
|
||||
background: #ED7D31 !important;
|
||||
}
|
||||
|
||||
th.bg_1_Cols {
|
||||
height: 48px;
|
||||
line-height: 48px;
|
||||
}
|
||||
|
||||
.bg_2_Cols {
|
||||
background: #DEE0E3!important;
|
||||
background: #DEE0E3 !important;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,102 @@
|
|||
import React, { FC, useEffect, useState } from "react";
|
||||
import { Table, Tag, Typography } from "antd";
|
||||
import { exceptStr, paginationFun } from "@/utils/common";
|
||||
import styles from "@/pages/atdTable/components/index.less";
|
||||
import { defaultPage, IPage } from "@/common/types";
|
||||
|
||||
const { Text } = Typography;
|
||||
const CommonTable: FC = (props) => {
|
||||
const [columns, setColumns] = useState<Array<any>>([]);
|
||||
const [sumRow, setSumRow] = useState<Partial<{}>>({});
|
||||
const [pageInfo, setPageInfo] = useState<IPage>(defaultPage);
|
||||
const [dataSource, setDataSource] = useState<Array<any>>([]);
|
||||
const [showSumrow, setShowSumrow] = useState<boolean>(false);
|
||||
|
||||
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, countResult, showSum, pageInfo } = data;
|
||||
const { current: pageNum, pageSize: size, total } = pageInfo;
|
||||
setDataSource(dataSource);
|
||||
setColumns(_.map(columns, item => {
|
||||
if (item.dataIndex === "salarySob") {
|
||||
return {
|
||||
...item,
|
||||
render: (text: string, r: { acctTimes?: number }) => {
|
||||
return <div className={styles.customSpan} title={text}>
|
||||
<span className={styles.title}>{text}</span>
|
||||
<Tag color="#4d7ad8">{`第${r?.acctTimes}次`}</Tag>
|
||||
</div>;
|
||||
}
|
||||
};
|
||||
}
|
||||
return { ...item };
|
||||
}));
|
||||
setShowSumrow(showSum);
|
||||
setSumRow(countResult);
|
||||
setPageInfo({ pageNum, size, total });
|
||||
}
|
||||
};
|
||||
const sizeChange = (pageobj: IPage) => {
|
||||
};
|
||||
const onChange = (pageobj: IPage) => {
|
||||
setPageInfo({ ...pageInfo, ...pageobj });
|
||||
window.parent.postMessage(
|
||||
{
|
||||
type: "turn",
|
||||
payload: { id: "PAGEINFO", params: { ...pageInfo, ...pageobj } }
|
||||
},
|
||||
"*"
|
||||
);
|
||||
};
|
||||
return <Table
|
||||
rowKey="id"
|
||||
className={styles.tableWrapper}
|
||||
columns={columns}
|
||||
dataSource={dataSource}
|
||||
bordered
|
||||
size="small"
|
||||
scroll={{ x: 1200, y: `calc(100vh - 109px)` }}
|
||||
pagination={{
|
||||
...paginationFun(pageInfo, sizeChange, onChange),
|
||||
size: "default"
|
||||
}}
|
||||
summary={() => {
|
||||
if (!showSumrow) return;
|
||||
let totalColumns: any[] = [];
|
||||
_.forEach(columns, it => {
|
||||
if (!it.children) {
|
||||
totalColumns.push(it);
|
||||
} else {
|
||||
totalColumns = [...totalColumns, ...it.children];
|
||||
}
|
||||
});
|
||||
return (
|
||||
<Table.Summary fixed>
|
||||
<Table.Summary.Row>
|
||||
{
|
||||
_.map([...totalColumns], (item, index) => {
|
||||
if (index === 0) {
|
||||
return <Table.Summary.Cell index={0} key={index} align="center"><Text
|
||||
type="danger">总计</Text></Table.Summary.Cell>;
|
||||
}
|
||||
return <Table.Summary.Cell index={index} key={index}>
|
||||
<Text type="danger">{!_.isNil(sumRow[item.dataIndex]) ? sumRow[item.dataIndex] : "-"}</Text>
|
||||
</Table.Summary.Cell>;
|
||||
})
|
||||
}
|
||||
</Table.Summary.Row>
|
||||
</Table.Summary>
|
||||
);
|
||||
}}
|
||||
/>;
|
||||
};
|
||||
|
||||
export default CommonTable;
|
||||
|
|
@ -0,0 +1,252 @@
|
|||
import React, { FC, useEffect, useState } from "react";
|
||||
import { Button, Dropdown, Menu, Space, Spin, Table, Typography } from "antd";
|
||||
import { DownOutlined } from "@ant-design/icons";
|
||||
import { exceptStr, paginationFun } from "@/utils/common";
|
||||
import styles from "@/pages/atdTable/components/index.less";
|
||||
import { defaultPage, IPage } from "@/common/types";
|
||||
import cs from "classnames";
|
||||
|
||||
const { Text } = Typography;
|
||||
const payrollFilesTable: FC = (props) => {
|
||||
const [columns, setColumns] = useState<Array<any>>([]);
|
||||
const [sumRow, setSumRow] = useState<any>({});
|
||||
const [pageInfo, setPageInfo] = useState<IPage>(defaultPage);
|
||||
const [dataSource, setDataSource] = useState<Array<any>>([]);
|
||||
const [showSumrow, setShowSumrow] = useState<boolean>(false);
|
||||
const [selected, setSelected] = useState<Array<string>>([]);
|
||||
|
||||
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,
|
||||
countResult,
|
||||
showSum,
|
||||
pageInfo,
|
||||
showOperateBtn,
|
||||
selectedKey,
|
||||
selectedRowKeys
|
||||
} = data;
|
||||
const { current: pageNum, pageSize: size, total } = pageInfo;
|
||||
setDataSource(dataSource);
|
||||
setColumns(_.map(columns, item => {
|
||||
if (item.dataIndex === "operate") {
|
||||
return {
|
||||
...item,
|
||||
render: (text: string, r: { id?: string }) => {
|
||||
let dom = null;
|
||||
if (!showOperateBtn) {
|
||||
dom = <Button type="link" style={{ padding: "0" }}
|
||||
onClick={() => window.parent.postMessage(
|
||||
{
|
||||
type: "turn",
|
||||
payload: { id: "EDIT", params: { record: r } }
|
||||
},
|
||||
"*"
|
||||
)}
|
||||
>
|
||||
查看
|
||||
</Button>;
|
||||
} else {
|
||||
if (selectedKey === "pending") {
|
||||
dom = <Space>
|
||||
<Button type="link" style={{ padding: "0" }}
|
||||
onClick={() => window.parent.postMessage(
|
||||
{
|
||||
type: "turn",
|
||||
payload: { id: "EDIT", params: { record: r } }
|
||||
},
|
||||
"*"
|
||||
)}
|
||||
>
|
||||
编辑
|
||||
</Button>
|
||||
<Dropdown
|
||||
overlayClassName={styles.moreIconWrapper}
|
||||
overlay={
|
||||
<Menu>
|
||||
<Menu.Item key="payroll">
|
||||
<Button type="link" style={{ padding: "0", fontSize: 12 }}
|
||||
onClick={() => handleMenuClick({ key: "payroll" }, r?.id)}
|
||||
>
|
||||
设为发薪人员
|
||||
</Button>
|
||||
</Menu.Item>
|
||||
<Menu.Item key="deletePendingTodo">
|
||||
<Button type="link" style={{ padding: "0", fontSize: 12 }}
|
||||
onClick={() => handleMenuClick({ key: "deletePendingTodo" }, r?.id)}>
|
||||
删除待办
|
||||
</Button>
|
||||
</Menu.Item>
|
||||
</Menu>
|
||||
}
|
||||
>
|
||||
<a>更多<DownOutlined/></a>
|
||||
</Dropdown>
|
||||
</Space>;
|
||||
} else if (selectedKey === "fixed") {
|
||||
dom = <Button type="link" style={{ padding: "0" }} onClick={() => window.parent.postMessage(
|
||||
{
|
||||
type: "turn",
|
||||
payload: { id: "EDIT", params: { record: r } }
|
||||
},
|
||||
"*"
|
||||
)}>
|
||||
调薪
|
||||
</Button>;
|
||||
} else if (selectedKey === "suspend") {
|
||||
dom = <Space>
|
||||
<Button type="link" style={{ padding: "0" }} onClick={() => window.parent.postMessage(
|
||||
{
|
||||
type: "turn",
|
||||
payload: { id: "EDIT", params: { record: r } }
|
||||
},
|
||||
"*"
|
||||
)}>
|
||||
编辑
|
||||
</Button>
|
||||
<Dropdown
|
||||
overlayClassName={styles.moreIconWrapper}
|
||||
overlay={
|
||||
<Menu>
|
||||
<Menu.Item key="payroll">
|
||||
<Button type="link" style={{ padding: "0", fontSize: 12 }}
|
||||
onClick={() => handleMenuClick({ key: "stopSalary" }, r?.id)}
|
||||
>
|
||||
停薪
|
||||
</Button>
|
||||
</Menu.Item>
|
||||
<Menu.Item key="deletePendingTodo">
|
||||
<Button type="link" style={{ padding: "0", fontSize: 12 }}
|
||||
onClick={() => handleMenuClick({ key: "deleteSuspendTodo" }, r?.id)}>
|
||||
删除待办
|
||||
</Button>
|
||||
</Menu.Item>
|
||||
</Menu>
|
||||
}
|
||||
>
|
||||
<a>更多<DownOutlined/></a>
|
||||
</Dropdown>
|
||||
</Space>;
|
||||
} else {
|
||||
dom = <Space>
|
||||
<Button type="link" style={{ padding: "0" }} onClick={() => window.parent.postMessage(
|
||||
{
|
||||
type: "turn",
|
||||
payload: { id: "CANCELSTOP", params: { id: r?.id } }
|
||||
},
|
||||
"*"
|
||||
)}>
|
||||
取消停薪
|
||||
</Button>
|
||||
<Button type="link" style={{ padding: "0" }}
|
||||
onClick={() => handleMenuClick({ key: "view" }, r as string)}>
|
||||
查看
|
||||
</Button>
|
||||
</Space>;
|
||||
}
|
||||
}
|
||||
return dom;
|
||||
}
|
||||
};
|
||||
}
|
||||
return { ...item };
|
||||
}));
|
||||
setShowSumrow(showSum);
|
||||
setSumRow(_.isEmpty(countResult) ? { [new Date().getTime()]: new Date().getTime() } : countResult);
|
||||
setPageInfo({ pageNum, size, total });
|
||||
setSelected(selectedRowKeys);
|
||||
}
|
||||
};
|
||||
const handleMenuClick = (event: any, id?: string) => {
|
||||
window.parent.postMessage(
|
||||
{
|
||||
type: "turn",
|
||||
payload: { id: "MOREOPT", params: { id, event } }
|
||||
},
|
||||
"*"
|
||||
);
|
||||
};
|
||||
const sizeChange = (pageobj: IPage) => {
|
||||
};
|
||||
const onChange = (pageobj: IPage) => {
|
||||
setPageInfo({ ...pageInfo, ...pageobj });
|
||||
window.parent.postMessage(
|
||||
{
|
||||
type: "turn",
|
||||
payload: { id: "PAGEINFO", params: { ...pageInfo, ...pageobj } }
|
||||
},
|
||||
"*"
|
||||
);
|
||||
};
|
||||
|
||||
const rowSelection = {
|
||||
columnWidth: 50,
|
||||
selectedRowKeys: selected,
|
||||
onChange: (selectedRowKeys: Array<any>) => {
|
||||
setSelected(selectedRowKeys);
|
||||
window.parent.postMessage(
|
||||
{
|
||||
type: "turn",
|
||||
payload: { id: "ROWSELECTION", params: { selectedRowKeys } }
|
||||
},
|
||||
"*"
|
||||
);
|
||||
}
|
||||
};
|
||||
return <Table
|
||||
rowKey="id"
|
||||
className={cs({
|
||||
[styles.tableWrapper]: true,
|
||||
[styles.tableTotalWrapper]: true
|
||||
})}
|
||||
columns={columns}
|
||||
dataSource={dataSource}
|
||||
size="small"
|
||||
rowSelection={rowSelection}
|
||||
scroll={{ x: 1200, y: !showSumrow ? `calc(100vh - 100px)` : "calc(100vh - 129px)" }}
|
||||
pagination={{
|
||||
...paginationFun(pageInfo, sizeChange, onChange),
|
||||
size: "default"
|
||||
}}
|
||||
summary={() => {
|
||||
if (!showSumrow) return;
|
||||
let totalColumns: any[] = [];
|
||||
_.forEach(columns, it => {
|
||||
if (!it.children) {
|
||||
totalColumns.push(it);
|
||||
} else {
|
||||
totalColumns = [...totalColumns, ...it.children];
|
||||
}
|
||||
});
|
||||
return (
|
||||
<Table.Summary fixed>
|
||||
<Table.Summary.Row>
|
||||
{
|
||||
sumRow.loading ? <Spin tip="加载中"/> :
|
||||
_.map([{},...totalColumns], (item, index) => {
|
||||
if (index === 0) {
|
||||
return <Table.Summary.Cell index={0} key={index} align="center"><Text
|
||||
type="danger">总计</Text></Table.Summary.Cell>;
|
||||
}
|
||||
return <Table.Summary.Cell index={index} key={index}>
|
||||
<Text type="danger">{!_.isNil(sumRow[item.dataIndex]) ? sumRow[item.dataIndex] : "-"}</Text>
|
||||
</Table.Summary.Cell>;
|
||||
})
|
||||
}
|
||||
</Table.Summary.Row>
|
||||
</Table.Summary>
|
||||
);
|
||||
}}
|
||||
/>;
|
||||
};
|
||||
|
||||
export default payrollFilesTable;
|
||||
|
|
@ -1,8 +1,9 @@
|
|||
import React, { FC, useEffect, useState } from "react";
|
||||
import { Table, Typography } from "antd";
|
||||
import { Spin, Table, Typography } from "antd";
|
||||
import styles from "@/pages/atdTable/components/index.less";
|
||||
import { exceptStr, paginationFun } from "@/utils/common";
|
||||
import { defaultPage, IPage } from "@/common/types";
|
||||
import API from "@/api";
|
||||
|
||||
const { Text } = Typography;
|
||||
const PreviewTable: FC = (props) => {
|
||||
|
|
@ -19,16 +20,30 @@ const PreviewTable: FC = (props) => {
|
|||
window.removeEventListener("message", receiveMessageFromIndex, false);
|
||||
};
|
||||
}, []);
|
||||
const receiveMessageFromIndex = (event: any) => {
|
||||
const receiveMessageFromIndex = async (event: any) => {
|
||||
const data: any = exceptStr(event.data);
|
||||
if (!_.isEmpty(data)) {
|
||||
const { columns, dataSource, pageInfo, salaryBillSendSum, showSum } = data;
|
||||
const { columns, dataSource, pageInfo, sumpayload } = data;
|
||||
const { current: pageNum, pageSize: size, total } = pageInfo;
|
||||
setDataSource(dataSource);
|
||||
setColumns(columns);
|
||||
setShowSumrow(showSum);
|
||||
setSumRow(salaryBillSendSum);
|
||||
setPageInfo({ pageNum, size, total });
|
||||
const confCode: any = await API.CalculateService.getSysconfcode({ code: "OPEN_ACCT_RESULT_SUM" });
|
||||
setShowSumrow(confCode.data.status && confCode.data.data === "1");
|
||||
if (confCode.data.status && confCode.data.data === "1") {
|
||||
const sumRowlist: any = await API.CalculateService.salaryBillSendSum(sumpayload);
|
||||
if (sumRowlist.data.status) {
|
||||
if (!_.isEmpty(sumRowlist.data.data.sumRow)) {
|
||||
const tmpVSumRow= _.reduce(_.keys(sumRowlist.data.data.sumRow), (pre, cur) => (_.assign(pre, { [`${cur}_salaryItem`]: sumRowlist.data.data.sumRow[cur] })), {})
|
||||
setSumRow(tmpVSumRow);
|
||||
} else {
|
||||
setSumRow({ [new Date().getTime()]: new Date().getTime() });
|
||||
}
|
||||
}
|
||||
if (sumRowlist.data.status && _.isNil(sumRowlist.data.data.sumRow)) {
|
||||
setSumRow({ [new Date().getTime()]: new Date().getTime() });
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
const sizeChange = (pageobj: IPage) => {
|
||||
|
|
@ -60,14 +75,16 @@ const PreviewTable: FC = (props) => {
|
|||
<Table.Summary fixed>
|
||||
<Table.Summary.Row>
|
||||
{
|
||||
_.map(columns, (item, index) => {
|
||||
if (index === 0) {
|
||||
return <Table.Summary.Cell index={0} key={index}><Text type="danger">总计</Text></Table.Summary.Cell>;
|
||||
}
|
||||
return <Table.Summary.Cell index={index} key={index}>
|
||||
<Text type="danger">{!_.isNil(sumRow[item.dataIndex]) ? sumRow[item.dataIndex] : "-"}</Text>
|
||||
</Table.Summary.Cell>;
|
||||
})
|
||||
_.isEmpty(sumRow) ? <Spin tip="加载中"/> :
|
||||
_.map(columns, (item, index) => {
|
||||
if (index === 0) {
|
||||
return <Table.Summary.Cell index={0} key={index}><Text
|
||||
type="danger">总计</Text></Table.Summary.Cell>;
|
||||
}
|
||||
return <Table.Summary.Cell index={index} key={index}>
|
||||
<Text type="danger">{!_.isNil(sumRow[item.dataIndex]) ? sumRow[item.dataIndex] : "-"}</Text>
|
||||
</Table.Summary.Cell>;
|
||||
})
|
||||
}
|
||||
</Table.Summary.Row>
|
||||
</Table.Summary>
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ const RankMapTable: React.FC = () => {
|
|||
...item,
|
||||
align: "center",
|
||||
className: colsIndex === "1" ? "bg_1_Cols" : colsIndex === "2" ? "bg_2_Cols" : "",
|
||||
width: colsIndex === "1" && "60px",
|
||||
render: (text: string, _: any) => {
|
||||
return {
|
||||
children: <span>{text}</span>,
|
||||
|
|
@ -63,6 +64,7 @@ const RankMapTable: React.FC = () => {
|
|||
_.forEach(_.reduce(columns, (pre: any, cur: any) => ([...pre, cur["dataIndex"]]), []), item => {
|
||||
tmpV = changeData(list, item);
|
||||
});
|
||||
console.log(columns);
|
||||
setCols(columns);
|
||||
setDataSource(tmpV);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,70 @@
|
|||
import React, { FC, useEffect, useState } from "react";
|
||||
import { Table, Typography } from "antd";
|
||||
import { exceptStr } from "@/utils/common";
|
||||
import styles from "@/pages/atdTable/components/index.less";
|
||||
|
||||
const { Text } = Typography;
|
||||
const ReportTable: FC = (props) => {
|
||||
const [columns, setColumns] = useState<Array<any>>([]);
|
||||
const [sumRow, setSumRow] = useState<Partial<{}>>({});
|
||||
const [dataSource, setDataSource] = useState<Array<any>>([]);
|
||||
const [showSumrow, setShowSumrow] = useState<boolean>(false);
|
||||
|
||||
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, countResult, showSum } = data;
|
||||
setDataSource(dataSource);
|
||||
setColumns(columns);
|
||||
setShowSumrow(showSum);
|
||||
setSumRow(countResult);
|
||||
}
|
||||
};
|
||||
return <Table
|
||||
rowKey="id"
|
||||
className={styles.tableWrapper}
|
||||
columns={columns}
|
||||
dataSource={dataSource}
|
||||
pagination={false}
|
||||
bordered
|
||||
size="small"
|
||||
scroll={{ x: 1200, y: `calc(100vh - 109px)` }}
|
||||
summary={() => {
|
||||
if (!showSumrow) return;
|
||||
let totalColumns: any[] = [];
|
||||
_.forEach(columns, it => {
|
||||
if (!it.children) {
|
||||
totalColumns.push(it);
|
||||
} else {
|
||||
totalColumns = [...totalColumns, ...it.children];
|
||||
}
|
||||
});
|
||||
return (
|
||||
<Table.Summary fixed>
|
||||
<Table.Summary.Row>
|
||||
{
|
||||
_.map([{}, ...totalColumns], (item, index) => {
|
||||
if (index === 0) {
|
||||
return <Table.Summary.Cell index={0} key={index} align="center"><Text
|
||||
type="danger">总计</Text></Table.Summary.Cell>;
|
||||
}
|
||||
return <Table.Summary.Cell index={index} key={index} align="center">
|
||||
<Text type="danger">{!_.isNil(sumRow[item.dataIndex]) ? sumRow[item.dataIndex] : "-"}</Text>
|
||||
</Table.Summary.Cell>;
|
||||
})
|
||||
}
|
||||
</Table.Summary.Row>
|
||||
</Table.Summary>
|
||||
);
|
||||
}}
|
||||
/>;
|
||||
};
|
||||
|
||||
export default ReportTable;
|
||||
|
|
@ -1,8 +1,9 @@
|
|||
import React, { FC, useEffect, useState } from "react";
|
||||
import { Button, Table, Typography } from "antd";
|
||||
import { Button, Spin, Table, Typography } from "antd";
|
||||
import { exceptStr, paginationFun } from "@/utils/common";
|
||||
import { defaultPage, IPage } from "@/common/types";
|
||||
import styles from "@/pages/atdTable/components/index.less";
|
||||
import API from "@/api";
|
||||
|
||||
const { Text } = Typography;
|
||||
const StandingbookTable: FC = (props) => {
|
||||
|
|
@ -20,12 +21,12 @@ const StandingbookTable: FC = (props) => {
|
|||
window.removeEventListener("message", receiveMessageFromIndex, false);
|
||||
};
|
||||
}, []);
|
||||
const receiveMessageFromIndex = (event: any) => {
|
||||
const receiveMessageFromIndex = async (event: any) => {
|
||||
const data: any = exceptStr(event.data);
|
||||
if (!_.isEmpty(data)) {
|
||||
const {
|
||||
columns, dataSource, pageInfo, showOperates, selectedRowKeys,
|
||||
showSum, siaccountSum
|
||||
sumpayload, selectedKey
|
||||
} = data;
|
||||
const { current: pageNum, pageSize: size, total } = pageInfo;
|
||||
const conventColumns = _.map(_.filter(columns, it => it.dataIndex !== "id"), item => {
|
||||
|
|
@ -61,10 +62,31 @@ const StandingbookTable: FC = (props) => {
|
|||
}
|
||||
]
|
||||
);
|
||||
setSelected(selectedRowKeys);
|
||||
setShowSumrow(showSum);
|
||||
setSumRow(siaccountSum);
|
||||
setPageInfo({ pageNum, size, total });
|
||||
setSelected(selectedRowKeys);
|
||||
const confCode: any = await API.CalculateService.getSysconfcode({ code: "OPEN_ACCT_RESULT_SUM" });
|
||||
setShowSumrow(confCode.data.status && confCode.data.data === "1");
|
||||
if (confCode.data.status && confCode.data.data === "1") {
|
||||
const sumRowlist: any = selectedKey === "1" ? await API.CalculateService.siaccountDetailCommonListSum(sumpayload) :
|
||||
selectedKey === "3" ? await API.CalculateService.siaccountDetailSupplementaryListSum(sumpayload) :
|
||||
selectedKey === "regression" ? await API.CalculateService.siaccountDetailRecessionListSum(sumpayload) :
|
||||
selectedKey === "difference" ? await API.CalculateService.siaccountDetailBalanceListSum(sumpayload) : {
|
||||
data: {
|
||||
status: false,
|
||||
data: { sumRow: {} }
|
||||
}
|
||||
};
|
||||
if (sumRowlist.data.status) {
|
||||
if (!_.isEmpty(sumRowlist.data.data.sumRow)) {
|
||||
setSumRow(sumRowlist.data.data.sumRow);
|
||||
} else {
|
||||
setSumRow({ [new Date().getTime()]: new Date().getTime() });
|
||||
}
|
||||
}
|
||||
if (sumRowlist.data.status && _.isNil(sumRowlist.data.data.sumRow)) {
|
||||
setSumRow({ [new Date().getTime()]: new Date().getTime() });
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
const handleEdit = (record: any) => {
|
||||
|
|
@ -84,6 +106,7 @@ const StandingbookTable: FC = (props) => {
|
|||
};
|
||||
const rowSelection = {
|
||||
selectedRowKeys: selected,
|
||||
columnWidth: 80,
|
||||
onChange: (selectedRowKeys: Array<any>) => {
|
||||
setSelected(selectedRowKeys);
|
||||
window.parent.postMessage(
|
||||
|
|
@ -113,15 +136,16 @@ const StandingbookTable: FC = (props) => {
|
|||
<Table.Summary fixed>
|
||||
<Table.Summary.Row>
|
||||
{
|
||||
_.map(columns, (item, index) => {
|
||||
if (index === 0) {
|
||||
return <Table.Summary.Cell colSpan={2} index={0} key={index}><Text
|
||||
type="danger">总计</Text></Table.Summary.Cell>;
|
||||
}
|
||||
return <Table.Summary.Cell index={index} key={index}>
|
||||
<Text type="danger">{!_.isNil(sumRow[item.dataIndex]) ? sumRow[item.dataIndex] : "-"}</Text>
|
||||
</Table.Summary.Cell>;
|
||||
})
|
||||
_.isEmpty(sumRow) ? <Spin tip="加载中"/> :
|
||||
_.map([{}, ...columns], (item, index) => {
|
||||
if (index === 0) {
|
||||
return <Table.Summary.Cell index={0} key={index} align="center"><Text
|
||||
type="danger">总计</Text></Table.Summary.Cell>;
|
||||
}
|
||||
return <Table.Summary.Cell index={index} key={index}>
|
||||
<Text type="danger">{!_.isNil(sumRow[item.dataIndex]) ? sumRow[item.dataIndex] : "-"}</Text>
|
||||
</Table.Summary.Cell>;
|
||||
})
|
||||
}
|
||||
</Table.Summary.Row>
|
||||
</Table.Summary>
|
||||
|
|
|
|||
Loading…
Reference in New Issue