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

View File

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