产品-对接e10个税扣缴义务人设置
This commit is contained in:
parent
d2e4ea6190
commit
a3231c252d
|
|
@ -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 = [
|
||||
<Button type="primary" onClick={this.handleSave}
|
||||
loading={loading}>{isEdit ? "保存" : "保存并进入下一步"}</Button>
|
||||
loading={loading}>{isEdit ? getLabel(537558, "保存") : getLabel(33199, "保存并进入下一步")}</Button>
|
||||
];
|
||||
break;
|
||||
case 1:
|
||||
const tmpV = [<Button type="primary" onClick={this.handleSaveAndVerify}>保存并验证</Button>];
|
||||
const tmpV = [<Button type="primary"
|
||||
onClick={this.handleSaveAndVerify}>{getLabel(111, "保存并验证")}</Button>];
|
||||
const tmpJ = [
|
||||
<Button type="ghost">完成,跳过所有步骤</Button>,
|
||||
<Button type="ghost" onClick={() => this.setState({ current: current + 1 })}>下一步</Button>
|
||||
<Button type="ghost">{getLabel(543470, "完成,跳过所有步骤")}</Button>,
|
||||
<Button type="ghost"
|
||||
onClick={() => this.setState({ current: current + 1 })}>{getLabel(1402, "下一步")}</Button>
|
||||
];
|
||||
CurrentDom = isEdit ? tmpV : [...tmpV, ...tmpJ];
|
||||
break;
|
||||
case 2:
|
||||
CurrentDom = !isEdit ?
|
||||
[<Button type="ghost" onClick={() => this.setState({ current: current - 1 })}>上一步</Button>]
|
||||
CurrentDom = (!isEdit && false) ?
|
||||
[<Button type="ghost"
|
||||
onClick={() => this.setState({ current: current - 1 })}>{getLabel(1876, "上一步")}</Button>]
|
||||
: [];
|
||||
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 (
|
||||
<WeaSlideModal
|
||||
className="slideOuterWrapper"
|
||||
|
|
@ -199,7 +204,7 @@ class TaxAgentSlide extends Component {
|
|||
title={
|
||||
<SlideModalTitle
|
||||
subtitle={title}
|
||||
tabs={taxAgentId ? tabs : []}
|
||||
tabs={isEdit ? tabData : []}
|
||||
loading={false}
|
||||
showOperateBtn={showOperateBtn}
|
||||
editable={false}
|
||||
|
|
@ -213,10 +218,10 @@ class TaxAgentSlide extends Component {
|
|||
content={
|
||||
<div className="taxAgentSlideContent">
|
||||
{
|
||||
!taxAgentId &&
|
||||
!isEdit &&
|
||||
<WeaSteps current={current} style={{ margin: "20px 0" }}>
|
||||
{
|
||||
_.map(tabs, item => {
|
||||
_.map(tabData, item => {
|
||||
const { key, title } = item;
|
||||
return <Step description={title} key={key}/>;
|
||||
})
|
||||
|
|
|
|||
|
|
@ -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) =>
|
||||
<div className="operationWapper">
|
||||
<a href="javaScript:void(0);" onClick={() => onOperate("edit", record.id)}> 编辑 </a>
|
||||
<a href="javaScript:void(0);"
|
||||
onClick={() => onOperate("edit", record.id)}>{getLabel(501169, "编辑")}</a>
|
||||
{
|
||||
isChief &&
|
||||
<a href="javaScript:void(0);" style={{ marginLeft: 10 }}
|
||||
onClick={() => onOperate("delete", record.id)}> 删除 </a>
|
||||
onClick={() => onOperate("delete", record.id)}>{getLabel(535052, "删除")}</a>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 = [
|
||||
<Button type="primary" onClick={this.taxAgentRangeSync} loading={syncLoading}>同步人员范围</Button>,
|
||||
<Button type="primary" onClick={this.taxAgentRangeSync}
|
||||
loading={syncLoading}>{getLabel(543633, "同步人员范围")}</Button>,
|
||||
<WeaInputSearch
|
||||
style={{ width: 220 }}
|
||||
value={searchValue}
|
||||
onChange={searchValue => this.setState({ searchValue })}
|
||||
placeholder="请输入个税扣缴义务人名称"
|
||||
placeholder={getLabel(543634, "请输入个税扣缴义务人名称")}
|
||||
onSearch={() => this.taxAgentTableRef.getTaxAgentList()}
|
||||
/>
|
||||
];
|
||||
const customTitle = <div className="customTitleWrapper">
|
||||
<span>个税扣缴义务人</span>
|
||||
<span>{getLabel(537996, "个税扣缴义务人")}</span>
|
||||
{
|
||||
permission.isChief &&
|
||||
<Button type="primary" size="small" onClick={this.handleAddTaxAgent}>
|
||||
<span className="icon-coms-Add-to-hot" title="添加"></span>
|
||||
<span className="icon-coms-Add-to-hot" title={getLabel(384113, "添加")}></span>
|
||||
</Button>
|
||||
}
|
||||
</div>;
|
||||
return (
|
||||
<div className="salaryAgentWrapper">
|
||||
<WeaTop
|
||||
title="个税扣缴义务人"
|
||||
title={getLabel(537996, "个税扣缴义务人")}
|
||||
icon={<i className="icon-coms-fa"/>}
|
||||
iconBgcolor="#F14A2D"
|
||||
buttons={btns}
|
||||
|
|
@ -200,8 +201,8 @@ class TaxAgent extends Component {
|
|||
<div className="comContent">
|
||||
{
|
||||
permission.isChief &&
|
||||
<WeaSearchGroup title="基础信息" showGroup>
|
||||
<WeaFormItem label="启用分权" labelCol={{ span: 6 }} wrapperCol={{ span: 18 }}>
|
||||
<WeaSearchGroup title={getLabel(82743, "基础信息")} showGroup>
|
||||
<WeaFormItem label={getLabel(543639, "启用分权")} labelCol={{ span: 6 }} wrapperCol={{ span: 18 }}>
|
||||
<WeaCheckbox value={decentralization} display="switch" onChange={this.taxAgentBaseSave}/>
|
||||
</WeaFormItem>
|
||||
</WeaSearchGroup>
|
||||
|
|
|
|||
Loading…
Reference in New Issue