From 5c8fa0cf73f1ad3b1ac24bc78954ce4325fdc53d Mon Sep 17 00:00:00 2001 From: lys <971387674@qq.com> Date: Fri, 22 Nov 2024 18:03:53 +0800 Subject: [PATCH] =?UTF-8?q?custom/=E6=B1=87=E9=80=9A=E5=BB=BA=E8=AE=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../huitong/socialSecurityReport/index.js | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/custom-pages/huitong/socialSecurityReport/index.js b/pc4mobx/hrmSalary/pages/custom-pages/huitong/socialSecurityReport/index.js index 585ea8cf..1b33a540 100644 --- a/pc4mobx/hrmSalary/pages/custom-pages/huitong/socialSecurityReport/index.js +++ b/pc4mobx/hrmSalary/pages/custom-pages/huitong/socialSecurityReport/index.js @@ -25,7 +25,7 @@ class Index extends Component { super(props); this.state = { pageInfo: { current: 1, pageSize: 10, total: 0 }, loading: false, showSearchAd: false, - dataSource: [], columns: [], conditions: [], sumDataSource: {}, payload: {}, + dataSource: [], columns: [], conditions: [], payload: {}, sumDataSource: {}, query: { billMonth: moment(new Date()).format("YYYY-MM") } }; } @@ -71,28 +71,32 @@ class Index extends Component { const payload = { ...pageInfo, ...query, ...advanceSearch }; this.setState({ loading: true }); API.getHTCommonListReport(payload).then(({ status, data }) => { - if (updateSum) this.getHTCommonListReportSum(payload); this.setState({ loading: false }); if (status) { const { columns, pageInfo: result } = data; const { list: dataSource, pageNum: current, pageSize, total } = result; this.setState({ pageInfo: { ...pageInfo, current, pageSize, total }, dataSource, payload, - sumDataSource: updateSum ? sumRow : this.state.sumDataSource, columns: _.map(columns, o => ({ title: o.text, dataIndex: o.column, width: o.width, ellipsis: true, fixed: o.fixed || false })) - }, () => this.postMessageToChild({ - scrollHeight: 152, dataSource: this.state.dataSource, columns: this.state.columns, - pageInfo: this.state.pageInfo, unitTableType: "999", showRowSelection: false, - showTotalCell: true, sumDataSource: this.state.sumDataSource - })); + }, () => { + const result = { + scrollHeight: 152, dataSource: this.state.dataSource, columns: this.state.columns, + pageInfo: this.state.pageInfo, unitTableType: "999", showRowSelection: false, + showTotalCell: true, sumDataSource: this.state.sumDataSource + }; + this.postMessageToChild(result); + if (updateSum) this.getHTCommonListReportSum(payload, result); + }); } }).catch(() => this.setState({ loading: false })); }; - getHTCommonListReportSum = (payload) => { + getHTCommonListReportSum = (payload, result) => { API.getHTCommonListReportSum(payload).then(({ status, data }) => { - if (status) this.setState({ sumRow: data.sumRow }); + if (status) this.setState({ sumDataSource: data.sumRow }, () => this.postMessageToChild({ + ...result, sumDataSource: data.sumRow + })); }); }; handleExport = () => {