custom/西部信托0401

This commit is contained in:
lys 2025-11-18 15:30:54 +08:00
parent 62ec9094af
commit 4838542492
1 changed files with 23 additions and 5 deletions

View File

@ -22,7 +22,7 @@ class PersonalSalaryReport extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
loading: false, dataSource: [], columns: [], pageInfo: { current: 1, pageSize: 10, total: 0 }, loading: false, dataSource: [], columns: [], pageInfo: { current: 1, pageSize: 10, total: 0 }, sumRow: {},
dateRange: [ dateRange: [
moment(new Date()).subtract(12, "months").format("YYYY-MM"), moment(new Date()).subtract(12, "months").format("YYYY-MM"),
moment(new Date()).format("YYYY-MM") moment(new Date()).format("YYYY-MM")
@ -65,7 +65,7 @@ class PersonalSalaryReport extends Component {
childFrameObj && childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n }), "*"); childFrameObj && childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n }), "*");
}; };
getSalaryReport = (props) => { getSalaryReport = (props) => {
const { pageInfo, dateRange: pageDateRange } = this.state, { dateRange } = props || this.props; const { pageInfo, dateRange: pageDateRange } = this.state, { dateRange, isCom } = props || this.props;
const [startDateStr, endDateStr] = dateRange || pageDateRange; const [startDateStr, endDateStr] = dateRange || pageDateRange;
if (!startDateStr || !endDateStr) { if (!startDateStr || !endDateStr) {
message.warning(getLabel(111, "请选择薪资所属月!")); message.warning(getLabel(111, "请选择薪资所属月!"));
@ -81,9 +81,9 @@ class PersonalSalaryReport extends Component {
this.setState({ this.setState({
columns, dataSource, pageInfo: { ...pageInfo, current, total, pageSize } columns, dataSource, pageInfo: { ...pageInfo, current, total, pageSize }
}, () => { }, () => {
const { columns, dataSource, pageInfo } = this.state; const { columns, dataSource, pageInfo, sumRow } = this.state;
this.postMessageToChild({ this.postMessageToChild({
dataSource, pageInfo, showTotalCell: false, calcDetail: true, tableScrollHeight: 107, dataSource, pageInfo, showTotalCell: isCom, calcDetail: true, tableScrollHeight: 107, sumRow,
columns: _.map(columns, (it, idx) => ({ columns: _.map(columns, (it, idx) => ({
dataIndex: it.column, title: it.text, calcDetail: true, showSee: false, dataIndex: it.column, title: it.text, calcDetail: true, showSee: false,
width: (it.dataIndex === "taxAgent" || it.dataIndex === "salarySob") ? 176 : it.width, width: (it.dataIndex === "taxAgent" || it.dataIndex === "salarySob") ? 176 : it.width,
@ -92,9 +92,27 @@ class PersonalSalaryReport extends Component {
})) }))
}); });
}); });
isCom && this.getSalaryReportSum(payload, {
dataSource, pageInfo: { ...pageInfo, current, total, pageSize },
showTotalCell: true, calcDetail: true, tableScrollHeight: 107,
columns: _.map(columns, (it, idx) => ({
dataIndex: it.column, title: it.text, calcDetail: true, showSee: false,
width: (it.dataIndex === "taxAgent" || it.dataIndex === "salarySob") ? 176 : it.width,
fixed: (idx === 1 || idx === 0 || idx === 2) ? "left" : "",
ellipsis: true
}))
});
} }
}).catch(() => this.setState({ loading: false })); }).catch(() => this.setState({ loading: false }));
}; };
getSalaryReportSum = (payload, tableData) => {
postFetch("/api/bs/hrmsalary/report/statistics/employee/salaryReportSum", payload).then(({ status, data }) => {
if (status) this.setState({ sumRow: data.sumRow }, () => {
const { sumRow } = this.state;
this.postMessageToChild({ ...tableData, sumRow });
});
});
};
render() { render() {
@ -106,7 +124,7 @@ class PersonalSalaryReport extends Component {
height = dom.offsetHeight > tableHeight ? tableHeight : dom.offsetHeight; height = dom.offsetHeight > tableHeight ? tableHeight : dom.offsetHeight;
} }
if (isCom) return ( if (isCom) return (
<div style={{ height: height + "px" }}> <div style={{ height: (height + 35.84) + "px" }}>
<Spin spinning={loading}> <Spin spinning={loading}>
<iframe <iframe
style={{ border: 0, width: "100%", height: "100%" }} style={{ border: 0, width: "100%", height: "100%" }}