From a3231c252d60f71b9ae54ec1c4a23bb9582592c6 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, 27 Jul 2023 16:07:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=A7=E5=93=81-=E5=AF=B9=E6=8E=A5e10?= =?UTF-8?q?=E4=B8=AA=E7=A8=8E=E6=89=A3=E7=BC=B4=E4=B9=89=E5=8A=A1=E4=BA=BA?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/salary/components/taxAgentSlide.js | 43 +++++++++++-------- .../pages/salary/components/taxAgentTable.js | 13 +++--- pc4mobx/hrmSalary/pages/salary/taxAgent.js | 43 ++++++++++--------- 3 files changed, 54 insertions(+), 45 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/salary/components/taxAgentSlide.js b/pc4mobx/hrmSalary/pages/salary/components/taxAgentSlide.js index e55ddf30..e80e33e4 100644 --- a/pc4mobx/hrmSalary/pages/salary/components/taxAgentSlide.js +++ b/pc4mobx/hrmSalary/pages/salary/components/taxAgentSlide.js @@ -7,7 +7,7 @@ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; import { Button, message } from "antd"; -import { WeaSlideModal, WeaSteps } from "ecCom"; +import { WeaLocaleProvider, WeaSlideModal, WeaSteps } from "ecCom"; import SlideModalTitle from "../../../components/slideModalTitle"; import { decentralizationConditions, editConditions } from "../../taxAgent/editConditions"; import BaseSettings, { convertConditon } from "./baseSettings"; @@ -16,11 +16,12 @@ import TaxDeclarationInfo from "./taxDeclarationInfo"; import * as API from "../../../apis/taxAgent"; import "./index.less"; +const { getLabel } = WeaLocaleProvider; const Step = WeaSteps.Step; const tabs = [ - { key: 0, title: "基础设置" }, - { key: 1, title: "报税信息" }, - { key: 2, title: "人员范围" } + { key: 0, title: getLabel(82751, "基础设置") }, + { key: 1, title: getLabel(111, "报税信息") }, + { key: 2, title: getLabel(124810, "人员范围") } ]; @inject("taxAgentStore") @@ -79,13 +80,13 @@ class TaxAgentSlide extends Component { API.saveTaxAgent(payload).then(({ status, data, errormsg }) => { this.setState({ loading: false }); if (status) { - message.success("保存成功"); + message.success(getLabel(22619, "保存成功")); this.setState({ - current: current + 1, + current: true ? current + 2 : current + 1, taxAgentId: data }, () => onOk()); } else { - message.error(errormsg || "保存失败"); + message.error(errormsg || getLabel(22620, "保存失败")); } }).catch(() => this.setState({ loading: false })); }; @@ -101,10 +102,10 @@ class TaxAgentSlide extends Component { API.updateTaxAgent(payload).then(({ status, data, errormsg }) => { this.setState({ loading: false }); if (status) { - message.success("更新成功"); + message.success(getLabel(31439, "更新成功")); onCancel(true); } else { - message.error(errormsg || "更新失败"); + message.error(errormsg || getLabel(31825, "更新失败")); } }).catch(() => this.setState({ loading: false })); }; @@ -158,20 +159,23 @@ class TaxAgentSlide extends Component { case 0: CurrentDom = [ {isEdit ? "保存" : "保存并进入下一步"} + loading={loading}>{isEdit ? getLabel(537558, "保存") : getLabel(33199, "保存并进入下一步")} ]; break; case 1: - const tmpV = [保存并验证]; + const tmpV = [{getLabel(111, "保存并验证")}]; const tmpJ = [ - 完成,跳过所有步骤, - this.setState({ current: current + 1 })}>下一步 + {getLabel(543470, "完成,跳过所有步骤")}, + this.setState({ current: current + 1 })}>{getLabel(1402, "下一步")} ]; CurrentDom = isEdit ? tmpV : [...tmpV, ...tmpJ]; break; case 2: - CurrentDom = !isEdit ? - [ this.setState({ current: current - 1 })}>上一步] + CurrentDom = (!isEdit && false) ? + [ this.setState({ current: current - 1 })}>{getLabel(1876, "上一步")}] : []; break; default: @@ -185,8 +189,9 @@ class TaxAgentSlide extends Component { }; render() { - const { title, visible, onCancel, taxAgentStore: { showOperateBtn } } = this.props; + const { isEdit, title, visible, onCancel, taxAgentStore: { showOperateBtn } } = this.props; const { current, taxAgentId } = this.state; + const tabData = true && _.filter(tabs, it => it.key !== 1); return ( { - !taxAgentId && + !isEdit && { - _.map(tabs, item => { + _.map(tabData, item => { const { key, title } = item; return ; }) diff --git a/pc4mobx/hrmSalary/pages/salary/components/taxAgentTable.js b/pc4mobx/hrmSalary/pages/salary/components/taxAgentTable.js index bf34dbfd..8783090b 100644 --- a/pc4mobx/hrmSalary/pages/salary/components/taxAgentTable.js +++ b/pc4mobx/hrmSalary/pages/salary/components/taxAgentTable.js @@ -5,10 +5,12 @@ * Date: 2022/11/29 */ import React, { Component } from "react"; -import { WeaTable } from "ecCom"; +import { WeaLocaleProvider, WeaTable } from "ecCom"; import * as API from "../../../apis/taxAgent"; import "./index.less"; +const { getLabel } = WeaLocaleProvider; + class TaxAgentTable extends Component { constructor(props) { super(props); @@ -73,7 +75,7 @@ class TaxAgentTable extends Component { const { onOperate, isChief } = this.props; const pagination = { ...pageInfo, - showTotal: total => `共 ${total} 条`, + showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`, showSizeChanger: true, showQuickJumper: true, pageSizeOptions: ["10", "20", "50", "100"], @@ -100,16 +102,17 @@ class TaxAgentTable extends Component { columns={[ ...columns, { - title: "操作", + title: getLabel(30585, "操作"), key: "operation", width: 120, render: (text, record) => - onOperate("edit", record.id)}> 编辑 + onOperate("edit", record.id)}>{getLabel(501169, "编辑")} { isChief && onOperate("delete", record.id)}> 删除 + onClick={() => onOperate("delete", record.id)}>{getLabel(535052, "删除")} } } diff --git a/pc4mobx/hrmSalary/pages/salary/taxAgent.js b/pc4mobx/hrmSalary/pages/salary/taxAgent.js index 07042e64..3c611e6f 100644 --- a/pc4mobx/hrmSalary/pages/salary/taxAgent.js +++ b/pc4mobx/hrmSalary/pages/salary/taxAgent.js @@ -1,13 +1,15 @@ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; import { Button, message, Modal } from "antd"; -import { WeaCheckbox, WeaFormItem, WeaInputSearch, WeaSearchGroup, WeaTop } from "ecCom"; +import { WeaCheckbox, WeaFormItem, WeaInputSearch, WeaLocaleProvider, WeaSearchGroup, WeaTop } from "ecCom"; import ComHint from "./components/comHint"; import TaxAgentTable from "./components/taxAgentTable"; import TaxAgentSlide from "./components/taxAgentSlide"; import * as API from "../../apis/taxAgent"; import "./index.less"; +const { getLabel } = WeaLocaleProvider; + @inject("taxAgentStore") @observer class TaxAgent extends Component { @@ -21,7 +23,7 @@ class TaxAgent extends Component { taxAgentSlideProps: { isEdit: false, visible: false, - title: "新增个税扣缴义务人", + title: getLabel(543629, "新增个税扣缴义务人"), taxAgentId: "", current: 0 } @@ -59,8 +61,8 @@ class TaxAgent extends Component { taxAgentBaseSave = devolutionStatus => { this.setState({ decentralization: this.state.decentralization }, () => { Modal.confirm({ - title: "信息确认", - content: `确认${devolutionStatus === "0" ? "停用" : "启用"}分权?`, + title: getLabel(131329, "信息确认"), + content: `${getLabel(33703, "确认")}${devolutionStatus === "0" ? getLabel(26471, "停用") : getLabel(26472, "启用")}${getLabel(524044, "分权")}?`, onOk: () => { const paylaod = { devolutionStatus }; const { taxAgentStore } = this.props; @@ -76,8 +78,6 @@ class TaxAgent extends Component { message.error(errormsg || `${devolutionStatus === "0" ? "停用" : "启用"}分权失败`); } }); - }, - onCancel() { } }); }); @@ -109,10 +109,10 @@ class TaxAgent extends Component { taxAgentRangeSync({}).then(({ status, data, errormsg }) => { this.setState({ syncLoading: false }); if (status) { - message.success(data || "操作成功"); + message.success(data || getLabel(30700, "操作成功")); this.taxAgentTableRef.getTaxAgentList(); } else { - message.error(data || errormsg || "操作失败"); + message.error(data || errormsg || getLabel(30651, "操作失败")); } }); }; @@ -124,7 +124,7 @@ class TaxAgent extends Component { ...this.state.taxAgentSlideProps, isEdit: false, visible: false, - title: "新增个税扣缴义务人", + title: getLabel(543629, "新增个税扣缴义务人"), taxAgentId: "", current: 0 } @@ -139,22 +139,22 @@ class TaxAgent extends Component { this.setState({ taxAgentSlideProps: { ...this.state.taxAgentSlideProps, - visible: true, title: "编辑个税扣缴义务人", + visible: true, title: getLabel(543632, "编辑个税扣缴义务人"), taxAgentId: itemId, current, isEdit: true } }); break; case "delete": Modal.confirm({ - title: "信息确认", - content: `确认要删除吗?`, + title: getLabel(131329, "信息确认"), + content: getLabel(388758, "确认要删除吗?"), onOk: () => { API.deleteTaxAgent([itemId]).then(({ status, errormsg }) => { if (status) { - message.success("删除成功"); + message.success(getLabel(502230, "删除成功")); this.taxAgentTableRef.getTaxAgentList(); } else { - message.error(errormsg || "删除失败"); + message.error(errormsg || getLabel(20462, "删除失败")); } }); } @@ -171,28 +171,29 @@ class TaxAgent extends Component { permission, syncLoading } = this.state; const btns = [ - 同步人员范围, + {getLabel(543633, "同步人员范围")}, this.setState({ searchValue })} - placeholder="请输入个税扣缴义务人名称" + placeholder={getLabel(543634, "请输入个税扣缴义务人名称")} onSearch={() => this.taxAgentTableRef.getTaxAgentList()} /> ]; const customTitle = - 个税扣缴义务人 + {getLabel(537996, "个税扣缴义务人")} { permission.isChief && - + } ; return ( } iconBgcolor="#F14A2D" buttons={btns} @@ -200,8 +201,8 @@ class TaxAgent extends Component { { permission.isChief && - - + +