diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js index 654d9d26..f1028811 100644 --- a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js +++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js @@ -32,7 +32,7 @@ class SalaryDetails extends Component { this.state = { loading: false, dataSource: [], columns: [], selectedRowKeys: [], tempPageList: [], sumRow: {}, pageInfo: { current: 1, pageSize: 10, total: 0 }, payload: {}, templateId: "", - showTotalCell: false, updateSum: true, tempDialog: { visible: false, setting: [], id: "", template: {} }, + showTotalCell: false, updateSum: false, tempDialog: { visible: false, setting: [], id: "", template: {} }, transferDialog: { visible: false, searchParamsKey: "name", saveLoading: false, dataParams: { page: "salary_details_report", defaultSetting: "0" }, @@ -49,11 +49,8 @@ class SalaryDetails extends Component { async componentDidMount() { const [{ data: confCode }] = await Promise.all([sysConfCodeRule({ code: "OPEN_ACCT_RESULT_SUM" })]); - this.setState({ - showTotalCell: confCode === "1" - }, () => { - // this.getSalaryList(this.props); - this.getPageListTemplatelist(); + this.setState({ showTotalCell: confCode === "1" }, () => { + this.props.salaryDetailShowType === "1" && this.getPageListTemplatelist(); }); window.addEventListener("message", this.handleReceive, false); window.addEventListener("resize", () => this.forceUpdate(), false); @@ -84,16 +81,16 @@ class SalaryDetails extends Component { }; handleReceive = ({ data }) => { const { type, payload: { id, params } = {} } = data; - const { pageInfo } = this.state; + const { pageInfo, showTotalCell } = this.state; if (type === "init") { // this.getColumns(); this.getSalaryList(this.props); + showTotalCell && this.getSalaryListSum(); } else if (type === "turn") { if (id === "PAGEINFO") { const { pageNum: current, size: pageSize } = params; this.setState({ - pageInfo: { ...pageInfo, current, pageSize }, - updateSum: false + pageInfo: { ...pageInfo, current, pageSize }, updateSum: false }, () => this.getSalaryList(this.props)); } else if (id === "CHECKBOX") { const { selectedRowKeys: checkBox } = params;