From f1670a038033dffca2cbd1876f7f149fff00db06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Fri, 26 Apr 2024 14:57:06 +0800 Subject: [PATCH] =?UTF-8?q?hotfix/2.12.1.2404.02=20=E6=A1=A3=E6=A1=88tab?= =?UTF-8?q?=E6=80=BB=E6=95=B0=E6=98=BE=E7=A4=BA=E7=9A=84=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/salaryFileList/index.js | 6 ++--- .../pages/payrollFiles/salaryFiles.js | 24 ++++++++++++------- .../components/welfareTableList/index.js | 6 ++--- .../welfareArchive/index.js | 24 ++++++++++++------- 4 files changed, 36 insertions(+), 24 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/payrollFiles/components/salaryFileList/index.js b/pc4mobx/hrmSalary/pages/payrollFiles/components/salaryFileList/index.js index 90c6938c..efe2605b 100644 --- a/pc4mobx/hrmSalary/pages/payrollFiles/components/salaryFileList/index.js +++ b/pc4mobx/hrmSalary/pages/payrollFiles/components/salaryFileList/index.js @@ -45,7 +45,7 @@ class Index extends Component { } componentDidMount() { - this.getSalaryFileList(this.props); + this.getSalaryFileList(this.props, true); window.addEventListener("message", this.handleReceive, false); window.addEventListener("resize", this.handleResize, false); } @@ -152,7 +152,7 @@ class Index extends Component { const childFrameObj = document.getElementById("atdTable"); childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n }), "*"); }; - getSalaryFileList = (props) => { + getSalaryFileList = (props, init = false) => { const { pageInfo } = this.state; const { payrollFilesStore: { salaryFileQueryForm, queryList }, selectedKey, onChangeTopTabCount @@ -166,7 +166,7 @@ class Index extends Component { this.setState({ pageInfo: { ...pageInfo, current, pageSize, total }, dataSource }, () => { - onChangeTopTabCount(selectedKey, total); + onChangeTopTabCount(selectedKey, total, init); }); } }).catch(() => this.setState({ loading: false })); diff --git a/pc4mobx/hrmSalary/pages/payrollFiles/salaryFiles.js b/pc4mobx/hrmSalary/pages/payrollFiles/salaryFiles.js index 59fed35e..344a3284 100644 --- a/pc4mobx/hrmSalary/pages/payrollFiles/salaryFiles.js +++ b/pc4mobx/hrmSalary/pages/payrollFiles/salaryFiles.js @@ -85,15 +85,21 @@ class SalaryFiles extends Component { break; } }; - queryInsuranceTabTotal = (active, total) => { - API.queryTabTotal().then(({ status, data }) => { - if (status) { - const key = _.find(tabList, o => o.viewcondition === active).groupid; - this.setState({ - topTabCount: { ...this.state.topTabCount, ...data, [key]: total } - }); - } - }); + queryInsuranceTabTotal = (active, total, init) => { + const key = _.find(tabList, o => o.viewcondition === active).groupid; + if (init) { + API.queryTabTotal().then(({ status, data }) => { + if (status) { + this.setState({ + topTabCount: { ...this.state.topTabCount, ...data, [key]: total } + }); + } + }); + } else { + this.setState({ + topTabCount: { ...this.state.topTabCount, [key]: total } + }); + } }; handleReqBtnsCLick = (type, importType) => { const { state, handleSalaryOpts } = this.salaryFileListRef.wrappedInstance || {}; diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareTableList/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareTableList/index.js index 6d5e4468..a9029a86 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareTableList/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareTableList/index.js @@ -68,7 +68,7 @@ class Index extends Component { handleReceive = async ({ data }) => { const { type, payload: { id, params } = {} } = data; if (type === "init") { - this.getWelfareList(this.props); + this.getWelfareList(this.props, true); } else if (type === "turn") { const { record: { baseInfo, employeeId, paymentOrganization } = {}, interfaceParams = {} } = params; const { runStatuses, showOperateBtn } = this.props; @@ -154,7 +154,7 @@ class Index extends Component { getPaymentForm = async (props) => { return API.getPaymentForm({ ...props }); }; - getWelfareList = (props) => { + getWelfareList = (props, init = false) => { const { pageInfo } = this.state; const { archivesStore: { welfareForm }, runStatuses, onChangeTopTabCount, showOperateBtn } = props; const params = { ...pageInfo, ...welfareForm.getFormParams() }; @@ -182,7 +182,7 @@ class Index extends Component { }) }, () => { const { pageInfo, selectedRowKeys, columns, dataSource } = this.state; - onChangeTopTabCount(runStatuses, total); + onChangeTopTabCount(runStatuses, total, init); this.postMessageToChild({ dataSource, pageInfo, selectedRowKeys, runStatuses, columns, showOperateBtn diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/index.js index 76d00398..4da87e27 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/index.js @@ -46,15 +46,21 @@ class Index extends Component { this.setState({ showExtEmpsWitch: extEmpsWitch === "1" }); } - queryInsuranceTabTotal = (active, total) => { - API.queryInsuranceTabTotal().then(({ status, data }) => { - if (status) { - const key = _.find(tabList, o => o.viewcondition === active).groupid; - this.setState({ - topTabCount: { ...this.state.topTabCount, ...data, [key]: total } - }); - } - }); + queryInsuranceTabTotal = (active, total, init) => { + const key = _.find(tabList, o => o.viewcondition === active).groupid; + if (init) { + API.queryInsuranceTabTotal().then(({ status, data }) => { + if (status) { + this.setState({ + topTabCount: { ...this.state.topTabCount, ...data, [key]: total } + }); + } + }); + } else { + this.setState({ + topTabCount: { ...this.state.topTabCount, [key]: total } + }); + } }; handleOpenAdvanceSearch = () => this.setState({ showSearchAd: true }); handleAdvanceSearch = () => this.setState({ isQuery: !this.state.isQuery });