feature/2.12.1.2403.02-个税申报表页面分类改造

This commit is contained in:
黎永顺 2024-04-02 10:21:26 +08:00
parent 31fb82eb31
commit 9480bc7adf
2 changed files with 20 additions and 13 deletions

View File

@ -40,6 +40,12 @@ class LeftTab extends Component {
render() { render() {
const { selectedKeys, dataSource } = this.state; const { selectedKeys, dataSource } = this.state;
const { onChangeTab } = this.props; const { onChangeTab } = this.props;
const reportTypeNameMap = {
1: getLabel(111, "综合所得"),
2: getLabel(111, "分类所得"),
3: getLabel(111, "非居民所得"),
4: getLabel(111, "限售股所得")
};
return ( return (
<div className="leftTabWrapper"> <div className="leftTabWrapper">
<Menu mode="inline" selectedKeys={selectedKeys} <Menu mode="inline" selectedKeys={selectedKeys}
@ -52,7 +58,7 @@ class LeftTab extends Component {
{ {
_.map(dataSource, item => { _.map(dataSource, item => {
const { reportType, id } = item; const { reportType, id } = item;
return <Menu.Item key={id + ""}>{reportType}</Menu.Item>; return <Menu.Item key={id + ""}>{reportTypeNameMap[reportType]}</Menu.Item>;
}) })
} }
</Menu> </Menu>

View File

@ -105,11 +105,11 @@ class Index extends Component {
}; };
getTaxDeclarationTab = () => { getTaxDeclarationTab = () => {
const { reportType } = this.state; const { reportType } = this.state;
return getTaxDeclarationTab({ id: getQueryString("id"), reportType }); return getTaxDeclarationTab({ taxDeclareRecordId: getQueryString("id"), reportType });
}; };
getDeclareInfo = () => { getDeclareInfo = () => {
const { reportType } = this.state; const { reportType } = this.state;
return getDeclareInfo({ id: getQueryString("id"), reportType }); return getDeclareInfo({ taxDeclareRecordId: getQueryString("id"), reportType });
}; };
apiflowBillingConfigStatus = () => { apiflowBillingConfigStatus = () => {
return apiflowBillingConfigStatus(); return apiflowBillingConfigStatus();
@ -188,7 +188,7 @@ class Index extends Component {
} }
}).catch(() => this.setState({ loading: { ...loading, query: false } })); }).catch(() => this.setState({ loading: { ...loading, query: false } }));
}; };
handleOperateDeclare = (type) => { handleOperateDeclare = (type, params = {}) => {
const loadingTxt = { const loadingTxt = {
refresh: getLabel(111, "刷新中..."), //刷新数据 refresh: getLabel(111, "刷新中..."), //刷新数据
declare: getLabel(111, "申报中..."), //在线申报 declare: getLabel(111, "申报中..."), //在线申报
@ -212,7 +212,7 @@ class Index extends Component {
cancelFeedback: getLabel(111, "作废反馈失败!")//作废反馈 cancelFeedback: getLabel(111, "作废反馈失败!")//作废反馈
}; };
this.setState({ loading: { ...this.state.loading, [type]: true } }); this.setState({ loading: { ...this.state.loading, [type]: true } });
APIFox[type]({ taxDeclareRecordId: getQueryString("id") }) APIFox[type]({ taxDeclareRecordId: getQueryString("id"), ...params })
.then(async ({ status, data, errormsg }) => { .then(async ({ status, data, errormsg }) => {
if (status) { if (status) {
message.destroy(); message.destroy();
@ -343,12 +343,13 @@ class Index extends Component {
render() { render() {
const { const {
tabs, selectedKey, loading, declareInfo, intelCalcSalaryStatus, taxDecPersonSlide, tabs, selectedKey, loading, declareInfo, intelCalcSalaryStatus, taxDecPersonSlide,
editTabVisible editTabVisible, reportType
} = this.state; } = this.state;
const [__, taxDeclarationId] = selectedKey.split("%%"); const [__, taxDeclarationId] = selectedKey.split("%%");
let btns = [ let btns = [
<Button type="primary" onClick={this.export}>{getLabel(17416, "导出")}</Button>, <Button type="primary" onClick={this.export}>{getLabel(17416, "导出")}</Button>,
<Button type="ghost" onClick={() => confirmDialog("declare", () => this.handleOperateDeclare("declare"))} <Button type="ghost"
onClick={() => confirmDialog("declare", () => this.handleOperateDeclare("declare", { reportType }))}
loading={loading.declare}>{getLabel(111, "在线申报")}</Button>, loading={loading.declare}>{getLabel(111, "在线申报")}</Button>,
<Button type="ghost" onClick={() => confirmDialog("refresh", () => this.handleOperateDeclare("refresh"))} <Button type="ghost" onClick={() => confirmDialog("refresh", () => this.handleOperateDeclare("refresh"))}
loading={loading.refresh}>{getLabel(111, "刷新数据")}</Button> loading={loading.refresh}>{getLabel(111, "刷新数据")}</Button>
@ -360,30 +361,30 @@ class Index extends Component {
//申报状态:申报中 //申报状态:申报中
declareInfo.declareStatus === "DECLARING" && (btns.splice(1, 2, <Button declareInfo.declareStatus === "DECLARING" && (btns.splice(1, 2, <Button
type="ghost" loading={loading.feedback} type="ghost" loading={loading.feedback}
onClick={() => this.handleOperateDeclare("feedback")}>{getLabel(111, "申报反馈")}</Button>)); onClick={() => this.handleOperateDeclare("feedback", { reportType })}>{getLabel(111, "申报反馈")}</Button>));
//申报状态:缴款中 //申报状态:缴款中
declareInfo.declareStatus === "DECLARE_SUCCESS_PAYING" && (btns.splice(1, 2)); declareInfo.declareStatus === "DECLARE_SUCCESS_PAYING" && (btns.splice(1, 2));
//申报状态:已缴款 //申报状态:已缴款
declareInfo.declareStatus === "DECLARE_SUCCESS_PAID" && (btns.splice(1, 2, declareInfo.declareStatus === "DECLARE_SUCCESS_PAID" && (btns.splice(1, 2,
<Button type="ghost" loading={loading.correct} <Button type="ghost" loading={loading.correct}
onClick={() => confirmDialog("correct", () => this.handleOperateDeclare("correct"))}>{getLabel(111, "更正申报")}</Button>)); onClick={() => confirmDialog("correct", () => this.handleOperateDeclare("correct", { reportType }))}>{getLabel(111, "更正申报")}</Button>));
//申报状态:申报成功,无需缴款 //申报状态:申报成功,无需缴款
declareInfo.declareStatus === "DECLARE_SUCCESS_NO_PAY" && declareInfo.declareStatus === "DECLARE_SUCCESS_NO_PAY" &&
(btns.splice(1, 2, (btns.splice(1, 2,
<Button type="ghost" loading={loading.correct} <Button type="ghost" loading={loading.correct}
onClick={() => confirmDialog("correct", () => this.handleOperateDeclare("correct"))}>{getLabel(111, "更正申报")}</Button>, onClick={() => confirmDialog("correct", () => this.handleOperateDeclare("correct", { reportType }))}>{getLabel(111, "更正申报")}</Button>,
<Button type="ghost" <Button type="ghost"
loading={loading.cancel} loading={loading.cancel}
onClick={() => confirmDialog("cancel", () => this.handleOperateDeclare("cancel"))}>{getLabel(111, "作废申报")}</Button> onClick={() => confirmDialog("cancel", () => this.handleOperateDeclare("cancel", { reportType }))}>{getLabel(111, "作废申报")}</Button>
)); ));
//申报状态:申报成功,未缴款 //申报状态:申报成功,未缴款
declareInfo.declareStatus === "DECLARE_SUCCESS_UNPAID" && declareInfo.declareStatus === "DECLARE_SUCCESS_UNPAID" &&
(btns.splice(1, 2, (btns.splice(1, 2,
<Button type="ghost" loading={loading.correct} <Button type="ghost" loading={loading.correct}
onClick={() => confirmDialog("correct", () => this.handleOperateDeclare("correct"))}>{getLabel(111, "更正申报")}</Button>, onClick={() => confirmDialog("correct", () => this.handleOperateDeclare("correct", { reportType }))}>{getLabel(111, "更正申报")}</Button>,
<Button type="ghost" <Button type="ghost"
loading={loading.cancel} loading={loading.cancel}
onClick={() => confirmDialog("cancel", () => this.handleOperateDeclare("cancel"))}>{getLabel(111, "作废申报")}</Button>, onClick={() => confirmDialog("cancel", () => this.handleOperateDeclare("cancel", { reportType }))}>{getLabel(111, "作废申报")}</Button>,
<Button type="ghost" <Button type="ghost"
loading={loading.refreshingPay} loading={loading.refreshingPay}
onClick={this.taxPaymentVoucherStatusSync}>{getLabel(111, "刷新缴款状态")}</Button> onClick={this.taxPaymentVoucherStatusSync}>{getLabel(111, "刷新缴款状态")}</Button>