diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryDeptSummary/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryDeptSummary/index.js index 30c142ab..d63114ed 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryDeptSummary/index.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryDeptSummary/index.js @@ -19,7 +19,7 @@ class Index extends Component { constructor(props) { super(props); this.state = { - showTotalCell: false, loading: false, dataSource: [] + showTotalCell: false, loading: false, dataSource: [], sumRow: {} }; } @@ -45,15 +45,33 @@ class Index extends Component { const { columns, list: dataSource } = data; this.setState({ dataSource }, () => { this.postMessageToChild({ - dataSource, showTotalCell: false, sumRowlistUrl: "", calcDetail: true, tableScrollHeight: 120, + dataSource, showTotalCell: true, sumRowlistUrl: "", calcDetail: true, tableScrollHeight: 156, columns: _.every(traverse(columns, true), (it, idx) => !it.fixed) ? _.map(traverse(columns, true), (it, idx) => ({ ...it, fixed: idx < 2 ? "left" : false })) : traverse(columns, true) }); }); + this.getAcctresultDeptSum({ + dataSource, showTotalCell: true, sumRowlistUrl: "", calcDetail: true, tableScrollHeight: 156, + columns: _.every(traverse(columns, true), (it, idx) => !it.fixed) ? _.map(traverse(columns, true), (it, idx) => ({ + ...it, fixed: idx < 2 ? "left" : false + })) : traverse(columns, true) + }); } }).catch(() => this.setState({ loading: false })); }; + getAcctresultDeptSum = (tableData) => { + const { routeParams: { salaryAcctRecordId } } = this.props, payload = { salaryAcctRecordId }; + postFetch("/api/bs/hrmsalary/salaryacct/acctresult/department/sum", payload) + .then(({ status, data }) => { + if (status) { + const { sumRow } = data; + this.setState({ sumRow }, () => { + this.postMessageToChild({ ...tableData, sumRow }); + }); + } + }); + }; postMessageToChild = (payload = {}) => { const i18n = { "共": getLabel(18609, "共"), "条": getLabel(18256, "条"),