From eeea664a8a76d3a0f4afab032c7920d21fb20cd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Tue, 7 May 2024 14:09:08 +0800 Subject: [PATCH] =?UTF-8?q?feature/2.12.1.2404.02-=E8=96=AA=E8=B5=84?= =?UTF-8?q?=E6=A0=B8=E7=AE=97=E5=88=A4=E6=96=AD=E8=B4=A6=E5=A5=97=E6=98=AF?= =?UTF-8?q?=E5=90=A6=E4=BF=AE=E6=94=B9=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../doCalc/components/salaryEditCalc/index.js | 6 +---- .../components/salaryEditCalc/index.less | 9 +++++++ .../salaryEditCalc/salaryCalcLayout.js | 27 ++++++++++++------- .../hrmSalary/pages/calculate/doCalc/index.js | 26 +++++++----------- 4 files changed, 38 insertions(+), 30 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.js index 1f803fed..54081da1 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.js @@ -26,10 +26,6 @@ class Index extends Component { }; } - componentDidMount() { - const promise = this.init(); - } - openAdvanceSearch = () => this.setState({ showSearchAd: !this.state.showSearchAd }); onAdSearch = (bool = true) => { this.calcTableRef.wrappedInstance.queryCalcResultList(); @@ -57,7 +53,7 @@ class Index extends Component { const { salarySobCycle, showSearchAd, formulaTd, columnDesc, showTotalCell } = this.state; const { routeParams: { salaryAcctRecordId } } = this.props; const formulaObj = _.get(columnDesc, [formulaTd]) || {}; - return ( this.onAdSearch(false)}> + return ( this.onAdSearch(false)}>
diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.less b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.less index 19d48e65..3d23810b 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.less +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.less @@ -234,3 +234,12 @@ } } } + +.loadingLayout { + width: 100%; + height: 100%; + text-align: center; + border-radius: 4px; + padding: 30px 50px; + margin: 20px 0; +} diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/salaryCalcLayout.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/salaryCalcLayout.js index d30a722f..0ece4702 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/salaryCalcLayout.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/salaryCalcLayout.js @@ -6,7 +6,7 @@ */ import React, { Component } from "react"; import { WeaCheckbox, WeaDialog, WeaLocaleProvider } from "ecCom"; -import { Button, message } from "antd"; +import { Button, message, Spin } from "antd"; import * as API from "../../../../../apis/calculate"; import "./index.less"; @@ -16,7 +16,7 @@ class SalaryCalcLayout extends Component { constructor(props) { super(props); this.state = { - fieldInformationConfirm: { visible: false, data: {} }, userConfirmed: "0" + fieldInformationConfirm: { visible: false, data: {} }, userConfirmed: "0", show: false }; } @@ -28,12 +28,14 @@ class SalaryCalcLayout extends Component { const { fieldInformationConfirm } = this.state; const { routeParams: { salaryAcctRecordId: id } } = this.props; API.getCompareSobConfig({ id }).then(({ status, data }) => { - if (status) { + if (status && data) { this.setState({ fieldInformationConfirm: { ...fieldInformationConfirm, visible: data } }); + } else { + this.setState({ show: true }, () => this.props.init()); } - }); + }).catch(() => this.setState({ show: true }, () => this.props.init())); }; onOk = () => { const { fieldInformationConfirm } = this.state; @@ -42,8 +44,12 @@ class SalaryCalcLayout extends Component { if (status) { message.success(getLabel(30700, "操作成功!")); this.setState({ + show: true, fieldInformationConfirm: { ...fieldInformationConfirm, visible: false } - }, () => this.props.onConfirm()); + }, () => { + this.props.init(); + this.props.onConfirm(); + }); } else { message.error(errormsg); } @@ -51,23 +57,26 @@ class SalaryCalcLayout extends Component { }; render() { - const { fieldInformationConfirm, userConfirmed } = this.state; + const { fieldInformationConfirm, userConfirmed, show } = this.state; const buttons = [ , + }, () => this.props.init())}>{getLabel(111, "否,忽略该提示")} ]; return ( - {this.props.children} + { + show ? this.props.children :
+ } this.setState({ fieldInformationConfirm: { ...fieldInformationConfirm, visible: false } - })}> + }, () => this.props.init())}>
{getLabel("111", "账套发生变更,是否需要更新账套设置?更新后核算将按照最新的账套进行核算,请谨慎操作。")} diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js index d8a8d78e..0d1c87fc 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js @@ -216,23 +216,17 @@ class Index extends Component { /> } {/* 薪资核算-自定义导出*/} - { - this.setState({ - customExpDialog: { ...customExpDialog, visible: false } - }); - }} - /> + { + this.setState({ + customExpDialog: { ...customExpDialog, visible: false } + }); + }}/> {/* 薪资核算-导入*/} - { - this.setState({ - salaryImpDialog: { ...salaryImpDialog, visible: false } - }, () => isFresh && this.calc.onAdSearch(false)); - }} - /> + { + this.setState({ + salaryImpDialog: { ...salaryImpDialog, visible: false } + }, () => isFresh && this.calc.onAdSearch(false)); + }}/>