From f66a0754412ef14adbc5d7ec9106a9cf398d8154 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Thu, 14 Dec 2023 09:27:34 +0800 Subject: [PATCH] =?UTF-8?q?feature/V2-dev=E5=90=88=E5=B9=B6=E5=A4=9A?= =?UTF-8?q?=E8=AF=AD=E8=A8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/salaryEditCalc/editCalcTable.js | 14 +++++++++----- .../doCalc/components/salaryEditCalc/index.js | 17 +++++++---------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js index 7231afd3..c545f9f8 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js @@ -9,6 +9,7 @@ import { WeaLocaleProvider } from "ecCom"; import { message, Modal, Spin } from "antd"; import { inject, observer } from "mobx-react"; import { acctResultList, updateLockStatus } from "../../../../../apis/calculate"; +import { sysConfCodeRule } from "../../../../../apis/ruleconfig"; import ProgressModal from "../../../../../components/progressModal"; import EditSalaryCalcSlide from "./editSalaryCalcSlide"; @@ -22,7 +23,7 @@ class EditCalcTable extends Component { this.state = { loading: false, pageInfo: { current: 1, pageSize: 10, total: 0 }, selectedRowKeys: [], progressVisible: false, progress: 0, - salaryCalcSlide: { visible: false, id: "" } + salaryCalcSlide: { visible: false, id: "" }, showTotalCell: false }; this.timerLock = null; } @@ -34,7 +35,10 @@ class EditCalcTable extends Component { handleReceive = async ({ data }) => { const { type, payload: { id, params } = {} } = data; if (type === "init") { - this.queryCalcResultList(); + const confCode = await sysConfCodeRule({ code: "OPEN_ACCT_RESULT_SUM" }); + this.setState({ showTotalCell: confCode.data === "1" }, () => { + this.queryCalcResultList(); + }); } else if (type === "turn") { switch (id) { case "PAGEINFO": @@ -158,10 +162,10 @@ class EditCalcTable extends Component { const { columns, pageInfo: list } = data; const { list: dataSource, pageNum: current, pageSize, total } = list; this.setState({ pageInfo: { ...pageInfo, current, pageSize, total } }, () => { - const { pageInfo, selectedRowKeys } = this.state; - const sumRowlistUrl = this.props.showTotalCell ? "/api/bs/hrmsalary/salaryacct/acctresult/sum" : ""; + const { pageInfo, selectedRowKeys, showTotalCell } = this.state; + const sumRowlistUrl = showTotalCell ? "/api/bs/hrmsalary/salaryacct/acctresult/sum" : ""; this.postMessageToChild({ - dataSource, pageInfo, selectedRowKeys, showTotalCell: this.props.showTotalCell, sumRowlistUrl, payload, + dataSource, pageInfo, selectedRowKeys, showTotalCell, sumRowlistUrl, payload, columns: _.every(traverse(columns), (it, idx) => !it.fixed) ? _.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 034d86f8..47cf923d 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.js @@ -7,7 +7,6 @@ import React, { Component } from "react"; import { WeaHelpfulTip, WeaLocaleProvider } from "ecCom"; 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 +20,7 @@ class Index extends Component { super(props); this.state = { salarySobCycle: {}, showSearchAd: false, - columnDesc: {}, formulaTd: "", showTotalCell: false + columnDesc: {}, formulaTd: "" }; } @@ -36,21 +35,20 @@ class Index extends Component { }; init = async () => { const { routeParams: { salaryAcctRecordId } } = this.props; - const [salarySobCycle, columnDesc, confCode] = await Promise.all([ - getSalarySobCycle({ salaryAcctRecordId }), getColumnDesc({ salaryAcctRecordId }), - sysConfCodeRule({ code: "OPEN_ACCT_RESULT_SUM" }) + const [salarySobCycle, columnDesc] = await Promise.all([ + getSalarySobCycle({ salaryAcctRecordId }), getColumnDesc({ salaryAcctRecordId }) ]); - if (salarySobCycle.status && columnDesc.status && confCode.status) { + if (salarySobCycle.status && columnDesc.status) { this.setState({ salarySobCycle: salarySobCycle.data, - columnDesc: columnDesc.data, showTotalCell: confCode.data === "1" + columnDesc: columnDesc.data }); } }; handleShowFormulaTa = (dataIndex) => this.setState({ formulaTd: dataIndex }); render() { - const { salarySobCycle, showSearchAd, formulaTd, columnDesc, showTotalCell } = this.state; + const { salarySobCycle, showSearchAd, formulaTd, columnDesc } = this.state; const { routeParams: { salaryAcctRecordId } } = this.props; const formulaObj = _.get(columnDesc, [formulaTd]) || {}; return ( @@ -82,8 +80,7 @@ class Index extends Component { /> this.calcTableRef = dom} salarySobId={salarySobCycle.salarySobId} - {...this.props} showTotalCell={showTotalCell} - onShowFormulaTd={this.handleShowFormulaTa}/> + {...this.props} onShowFormulaTd={this.handleShowFormulaTa}/> ); }