diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js index 5a637906..deb70763 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js @@ -140,7 +140,7 @@ class EditCalcTable extends Component { this.setState({ pageInfo: { ...pageInfo, current, pageSize, total } }, () => { const { pageInfo, selectedRowKeys } = this.state; this.postMessageToChild({ - dataSource, pageInfo, selectedRowKeys, + dataSource, pageInfo, selectedRowKeys, showTotalCell: this.props.showTotalCell, columns: _.map(traverse(columns), (it, idx) => ({ ...it, fixed: idx < 2 ? "left" : false })) }); }); diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.js index dffbd55d..42b19d5d 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.js @@ -8,6 +8,7 @@ import React, { Component } from "react"; import { WeaHelpfulTip, WeaLocaleProvider } from "ecCom"; import { Alert } from "antd"; import { getColumnDesc, getSalarySobCycle } from "../../../../../apis/calculate"; +import { sysConfCodeRule } from "../../../../../apis/ruleconfig"; import EditCalcAdvanceSearchPannel from "./editCalcAdvanceSearchPannel"; import EditCalcTable from "./editCalcTable"; import SalaryMonthTip from "../salaryMonthTip"; @@ -21,7 +22,7 @@ class Index extends Component { super(props); this.state = { salarySobCycle: {}, showSearchAd: false, - columnDesc: {}, formulaTd: "" + columnDesc: {}, formulaTd: "", showTotalCell: false }; } @@ -36,18 +37,21 @@ class Index extends Component { }; init = async () => { const { routeParams: { salaryAcctRecordId } } = this.props; - const [salarySobCycle, columnDesc] = await Promise.all([getSalarySobCycle({ salaryAcctRecordId }), getColumnDesc({ salaryAcctRecordId })]); - if (salarySobCycle.status && columnDesc.status) { + const [salarySobCycle, columnDesc, confCode] = await Promise.all([ + getSalarySobCycle({ salaryAcctRecordId }), getColumnDesc({ salaryAcctRecordId }), + sysConfCodeRule({ code: "OPEN_ACCT_RESULT_SUM" }) + ]); + if (salarySobCycle.status && columnDesc.status && confCode.status) { this.setState({ salarySobCycle: salarySobCycle.data, - columnDesc: columnDesc.data + columnDesc: columnDesc.data, showTotalCell: confCode.data === "1" }); } }; handleShowFormulaTa = (dataIndex) => this.setState({ formulaTd: dataIndex }); render() { - const { salarySobCycle, showSearchAd, formulaTd, columnDesc } = this.state; + const { salarySobCycle, showSearchAd, formulaTd, columnDesc, showTotalCell } = this.state; const { accountExceptInfo } = this.props; const formulaObj = _.get(columnDesc, [formulaTd]) || {}; return ( @@ -81,7 +85,9 @@ class Index extends Component { onAdSearch={this.onAdSearch} /> - this.calcTableRef = dom} {...this.props} onShowFormulaTd={this.handleShowFormulaTa}/> + this.calcTableRef = dom} + {...this.props} showTotalCell={showTotalCell} + onShowFormulaTd={this.handleShowFormulaTa}/> ); }