泛微薪资核算iframe表格
This commit is contained in:
parent
ba6bb91015
commit
1f0f016a56
|
|
@ -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,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>
|
||||
|
|
|
|||
|
|
@ -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,13 @@ const StandingbookTable: FC = (props) => {
|
|||
window.removeEventListener("message", receiveMessageFromIndex, false);
|
||||
};
|
||||
}, []);
|
||||
const receiveMessageFromIndex = (event: any) => {
|
||||
const receiveMessageFromIndex = async (event: any) => {
|
||||
const data: any = exceptStr(event.data);
|
||||
console.log("antd4", 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 +63,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) => {
|
||||
|
|
@ -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 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>;
|
||||
})
|
||||
}
|
||||
</Table.Summary.Row>
|
||||
</Table.Summary>
|
||||
|
|
|
|||
Loading…
Reference in New Issue