From f7c03082f46732497e7d8dc3524250a7b038f5d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Mon, 21 Aug 2023 18:14:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=AA=E7=A8=8E=E7=94=B3=E6=8A=A5-=E5=9C=A8?= =?UTF-8?q?=E7=BA=BF=E7=94=B3=E6=8A=A5=E6=8E=A5=E5=8F=A3=E5=AF=B9=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hrmSalary/pages/declare/generateModal.js | 7 +- .../hrmSalary/pages/declareDetail/index.js | 81 ++++++++---- .../pages/employeedeclareDetail/index.js | 94 +++++++++++--- .../pages/salary/components/constants.js | 122 +++++++++++++++++- .../pages/salary/components/index.less | 32 +++++ .../pages/salary/components/taxAgentSlide.js | 54 ++++++-- .../salary/components/taxDeclarationInfo.js | 29 +++-- .../salary/components/taxFillingInfoDialog.js | 63 +++++++++ pc4mobx/hrmSalary/stores/taxAgent.js | 1 + 9 files changed, 421 insertions(+), 62 deletions(-) create mode 100644 pc4mobx/hrmSalary/pages/salary/components/taxFillingInfoDialog.js diff --git a/pc4mobx/hrmSalary/pages/declare/generateModal.js b/pc4mobx/hrmSalary/pages/declare/generateModal.js index 8157c487..bc0f5c45 100644 --- a/pc4mobx/hrmSalary/pages/declare/generateModal.js +++ b/pc4mobx/hrmSalary/pages/declare/generateModal.js @@ -58,7 +58,7 @@ export default class GenerateModal extends React.Component { this.setState({ loading: false }); this.props.onCancel(); message.destroy(); - message.loading(getLabel(22619, "正在生成中..."), 0); + message.loading(getLabel(111, "正在生成中..."), 0); this.timer = setInterval(async () => { const { status: resStatus, data: result } = await this.taxdeclarationGetRate(data); const { status: rateStatus, finish, msg } = result; @@ -70,9 +70,12 @@ export default class GenerateModal extends React.Component { this.props.onGenerate(); } } else { + clearInterval(this.timer); + message.destroy(); message.warning(msg || getLabel(111, "生成申报表失败!")); + this.props.onGenerate(); } - }, 800); + }, 1000); }).catch(() => { message.destroy(); clearInterval(this.timer); diff --git a/pc4mobx/hrmSalary/pages/declareDetail/index.js b/pc4mobx/hrmSalary/pages/declareDetail/index.js index d4b0015c..c47d1fcc 100644 --- a/pc4mobx/hrmSalary/pages/declareDetail/index.js +++ b/pc4mobx/hrmSalary/pages/declareDetail/index.js @@ -29,9 +29,9 @@ class Index extends Component { loading: { query: false, refresh: false, declare: false }, declareInfo: {}, pageInfo: { current: 0, pageSize: 10, total: 0 } }; + this.timer = null; } - componentDidMount() { const promise = this.init(); } @@ -96,44 +96,81 @@ class Index extends Component { taxdeclarationRefreshData({ taxDeclareRecordId: getQueryString("id") }).then(async ({ status, data, errormsg }) => { this.setState({ loading: { ...this.state.loading, refresh: false } }); if (status) { - const { status: resStatus, data: result } = await this.taxdeclarationGetRate(data); - if (resStatus) { - const { status: rateStatus, msg } = result; - if (rateStatus) { - message.success(getLabel(111, "刷新数据成功!")); - const promise = this.init(); + message.destroy(); + message.loading(getLabel(111, "刷新中..."), 0); + this.timer = setInterval(async () => { + const { status: resStatus, data: result } = await this.taxdeclarationGetRate(data); + const { status: rateStatus, finish, msg } = result; + if (resStatus && rateStatus) { + if (finish) { + clearInterval(this.timer); + message.destroy(); + message.success(getLabel(111, "刷新数据成功!")); + const promise = this.init(); + } } else { + clearInterval(this.timer); + message.destroy(); message.warning(msg || getLabel(111, "刷新数据失败!")); + const promise = this.init(); } - } + }, 1000); } else { + clearInterval(this.timer); + message.destroy(); message.warning(errormsg); } - }).catch(() => this.setState({ loading: { ...this.state.loading, refresh: false } })); + }).catch(() => { + message.destroy(); + clearInterval(this.timer); + this.setState({ loading: { ...this.state.loading, refresh: false } }); + }); }; taxdeclarationDeclare = () => { this.setState({ loading: { ...this.state.loading, declare: true } }); taxdeclarationDeclare({ taxDeclareRecordId: getQueryString("id") }).then(async ({ status, data, errormsg }) => { this.setState({ loading: { ...this.state.loading, declare: false } }); if (status) { - const { status: resStatus, data: result } = await this.taxdeclarationGetRate(data); - if (resStatus) { - const { status: rateStatus, msg } = result; - if (rateStatus) { - message.success(getLabel(111, "在线申报成功!")); - const promise = this.declare(); + message.destroy(); + message.loading(getLabel(111, "申报中..."), 0); + this.timer = setInterval(async () => { + const { status: resStatus, data: result } = await this.taxdeclarationGetRate(data); + const { status: rateStatus, finish, msg } = result; + if (resStatus && rateStatus) { + if (finish) { + clearInterval(this.timer); + message.destroy(); + message.success(getLabel(111, "在线申报成功!")); + const promise = this.declare(); + } } else { + clearInterval(this.timer); + message.destroy(); message.warning(msg || getLabel(111, "在线申报失败!")); + const promise = this.declare(); } - } + }, 1000); } else { + clearInterval(this.timer); + message.destroy(); message.warning(errormsg); } - }).catch(() => this.setState({ loading: { ...this.state.loading, declare: false } })); + }).catch(() => { + message.destroy(); + clearInterval(this.timer); + this.setState({ loading: { ...this.state.loading, declare: false } }); + }); }; render() { const { tabs, selectedKey, columns, pageInfo, dataSource, loading, declareInfo } = this.state; + let btns = [ + , + , + + ]; const pagination = { ...pageInfo, showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`, @@ -151,19 +188,15 @@ class Index extends Component { }, () => this.getDetailList()); } }; + declareInfo.declareStatus === "DECLARING" && (btns.splice(1, 2, )); return (