From 97d87f614b6250829aaa0130e6c1a7393539e65c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Wed, 17 Jul 2024 11:21:19 +0800 Subject: [PATCH] =?UTF-8?q?release/2.15.1.2407.01-=E4=B8=AA=E7=A8=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/apis/calculate.js | 9 +++- .../hrmSalary/pages/calculate/doCalc/index.js | 39 +++++++++++++++- .../components/paymentFeedbackBtn.js | 4 +- .../ledgerPage/components/ledgerSlide.js | 45 +++++++++++-------- 4 files changed, 75 insertions(+), 22 deletions(-) diff --git a/pc4mobx/hrmSalary/apis/calculate.js b/pc4mobx/hrmSalary/apis/calculate.js index 752461e5..5f74cc6b 100644 --- a/pc4mobx/hrmSalary/apis/calculate.js +++ b/pc4mobx/hrmSalary/apis/calculate.js @@ -290,4 +290,11 @@ export const calcTaxFeedback = (params) => { export const listPage4NotDeclare = (params) => { return postFetch("/api/bs/hrmsalary/salaryacct/acctemployee/listPage4NotDeclare", params); }; - +// 核算结果--核算税后工资 +export const afterTaxAccounting = (params) => { + return postFetch("/api/bs/hrmsalary/salaryacct/acctresult/afterTaxAccounting", params); +}; +// 核算税后工资进度条 +export const getAfterTaxAccountingProgress = (id) => { + return WeaTools.callApi("/api/bs/hrmsalary/progress/getRate?cacheKey=AFTER_TAX_ACCT_PROGRESS_" + id, "get", {}); +}; diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js index cef79e68..2cea2f68 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js @@ -148,13 +148,50 @@ class Index extends Component { API.calcTaxFeedback({ salaryAcctRecordId }).then(({ status, errormsg }) => { this.setState({ loading: { ...this.state.loading, feedback: false } }); if (status) { - message.success(getLabel(111, "操作成功!")); this.calc.onAdSearch(false); + Modal.confirm({ + title: getLabel(131329, "信息确认"), + content: getLabel(111, "成功获取个税信息,是否继续计算税后工资?"), + onOk: () => this.afterTaxAccounting() + }); } else { message.error(errormsg); } }).catch(() => this.setState({ loading: { ...this.state.loading, feedback: false } })); }; + afterTaxAccounting = () => { + const { routeParams: { salaryAcctRecordId } } = this.props; + this.setState({ progress: 0 }); + let payload = { salaryAcctRecordId }; + API.afterTaxAccounting(payload).then(() => { + this.setState({ progressVisible: true }); + if (this.timer) clearInterval(this.timer); + this.timer = setInterval(() => { + API.getAfterTaxAccountingProgress(salaryAcctRecordId).then(({ data }) => { + let progress = data.progress; + if (progress === 1 && this.timer) { + clearInterval(this.timer); + this.timer = null; + this.setState({ + progressVisible: false, + accountExceptInfo: data.message + }); + message.success(getLabel(111, "操作完成")); + this.calc.onAdSearch(false); + } else if (!data.status) { + clearInterval(this.timer); + this.timer = null; + this.setState({ + progressVisible: false, + accountExceptInfo: data.message + }); + message.error(data.message); + } + this.setState({ progress: Number(progress) * 100 }); + }); + }, 1000); + }); + }; renderReqBtns = () => { const { selectedKey, accountExceptInfo, loading } = this.state; let reqBtns = []; diff --git a/pc4mobx/hrmSalary/pages/declareDetail/components/paymentFeedbackBtn.js b/pc4mobx/hrmSalary/pages/declareDetail/components/paymentFeedbackBtn.js index ee0bdf44..b3afe5e3 100644 --- a/pc4mobx/hrmSalary/pages/declareDetail/components/paymentFeedbackBtn.js +++ b/pc4mobx/hrmSalary/pages/declareDetail/components/paymentFeedbackBtn.js @@ -176,7 +176,9 @@ class PaymentFeedbackBtn extends Component { const { paymentDialog, paymentFeedbackDialog } = this.state; return ( - + {/*个税接口改造*/} + {/**/} + { const { editId } = this.props; - const { taxruleKeys, taxruleFields, saveSalarySobId } = this.state; + const { taxruleKeys, taxruleFields, saveSalarySobId, taxableItems } = this.state; const payload = { salarySobId: editId || saveSalarySobId, incomeCategoryParams: _.map(taxruleFields, it => { @@ -185,6 +184,7 @@ class LedgerSlide extends Component { this.setState({ loading: false }); if (status) { message.success(getLabel(22619, "保存成功!")); + !editId && (taxableItems && taxableItems.toString() !== "1" && taxableItems.toString() !== "489") && this.handleClose(); } else { message.error(errormsg || getLabel(22620, "保存失败!")); } @@ -292,6 +292,7 @@ class LedgerSlide extends Component { this.setState({ loading: false }); if (status) { message.success(getLabel(22619, "保存成功!")); + !editId && this.handleClose(); } else { message.error(errormsg || getLabel(22620, "保存失败!")); } @@ -373,11 +374,13 @@ class LedgerSlide extends Component { children: }, { - key: 7, title: getLabel(543469, "调薪计薪规则"), + key: 4, title: getLabel(543469, "调薪计薪规则"), createBtns: [ + , , - + ], editBtns: [ , , + onClick={() => this.setState({ current: current + 1 }, () => this.taxreportruleSave())}>{getLabel(111, "保存并进入下一步")} ], editBtns: [], @@ -404,14 +407,20 @@ class LedgerSlide extends Component { })}/> }, { - key: 5, title: getLabel(111, "同步个税配置"), - createBtns: [ - , - , - - ], + key: 6, title: getLabel(111, "同步个税配置"), + createBtns: + !(taxableItems && taxableItems.toString() !== "1" && taxableItems.toString() !== "489") ? + [ + , + , + + ] : [ + , + + ], editBtns: [], children: }, { - key: 4, title: getLabel(111, "累计字段对应"), + key: 7, title: getLabel(111, "累计字段对应"), createBtns: [ - , , - + ], editBtns: [], @@ -437,7 +444,7 @@ class LedgerSlide extends Component { } ]; (taxableItems && taxableItems.toString() !== "1" && taxableItems.toString() !== "489") && - (tabs = _.map(_.filter(tabs, o => o.key !== 4), (k, j) => ({ ...k, key: j }))); + (tabs = _.map(_.filter(tabs, o => o.key !== 7), (k, j) => ({ ...k, key: j }))); return (