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

This commit is contained in:
黎永顺 2024-04-01 17:47:08 +08:00
parent 10a0a4d3c3
commit 31fb82eb31
3 changed files with 119 additions and 40 deletions

View File

@ -16,9 +16,13 @@ export const saveDeclare = params => {
return postFetch("/api/bs/hrmsalary/taxdeclaration/save", params);
};
//个税申报表-获取分类
export const getTaxReports = params => {
return WeaTools.callApi("/api/bs/hrmsalary/taxdeclaration/getTaxReports", "get", params);
};
//个税申报表-个税申报表相关信息
export const getDeclareInfo = params => {
return WeaTools.callApi("/api/bs/hrmsalary/taxdeclaration/getTaxDeclarationInfo", "get", params);
return postFetch("/api/bs/hrmsalary/taxdeclaration/getTaxDeclarationInfo", params);
};
// 个税申报表详情列表
@ -106,7 +110,7 @@ export const employeedeclareDeclare = (params) => {
//个税在线对接-获取个税申报记录下的个税申报表TAB
export const getTaxDeclarationTab = params => {
return WeaTools.callApi("/api/bs/hrmsalary/taxdeclaration/getTaxDeclarationTab", "GET", params);
return postFetch("/api/bs/hrmsalary/taxdeclaration/getTaxDeclarationTab", params);
};
//个税在线对接-个税申报表是否已经生成

View File

@ -0,0 +1,64 @@
/*
* Author: 黎永顺
* name: 报表查看-左侧tab标题
* Description:
* Date: 2023/4/20
*/
import React, { Component } from "react";
import { WeaLocaleProvider } from "ecCom";
import { Menu } from "antd";
import * as API from "../../../apis/declare";
import { getQueryString } from "../../../util/url";
const { getLabel } = WeaLocaleProvider;
class LeftTab extends Component {
constructor(props) {
super(props);
this.state = {
reportName: "",
selectedKeys: "",
dataSource: []
};
}
componentDidMount() {
this.getTaxReports();
}
getTaxReports = () => {
const { onChangeTab } = this.props;
API.getTaxReports({ id: getQueryString("id") }).then(({ status, data: dataSource }) => {
if (status) this.setState({
dataSource, selectedKeys: !_.isEmpty(dataSource) ? _.head(dataSource).id + "" : ""
}, () => {
!_.isEmpty(this.state.dataSource) && onChangeTab(_.head(this.state.dataSource).reportType);
});
});
};
render() {
const { selectedKeys, dataSource } = this.state;
const { onChangeTab } = this.props;
return (
<div className="leftTabWrapper">
<Menu mode="inline" selectedKeys={selectedKeys}
onClick={({ key }) => {
this.setState({ selectedKeys: key }, () => {
onChangeTab(_.find(dataSource, o => String(o.id) === key).reportType, true);
});
}}
>
{
_.map(dataSource, item => {
const { reportType, id } = item;
return <Menu.Item key={id + ""}>{reportType}</Menu.Item>;
})
}
</Menu>
</div>
);
}
}
export default LeftTab;

View File

@ -5,7 +5,7 @@
* Date: 2023/8/18
*/
import React, { Component } from "react";
import { WeaLocaleProvider, WeaTab } from "ecCom";
import { WeaLeftRightLayout, WeaLocaleProvider, WeaTab } from "ecCom";
import { Button, message, Modal, Spin } from "antd";
import TaxDeclarationInfo from "./components/taxDeclarationInfo";
import { apiflowBillingConfigStatus } from "../../apis/intelligentCalculateSalarySettings";
@ -32,6 +32,7 @@ import { convertToUrlString, getQueryString } from "../../util/url";
import IncomeTaxDeclarationPersonnelSlide from "./components/incomeTaxDeclarationPersonnelSlide";
import TaxDeclareDetailImportDialog from "./components/taxDeclareDetailImportDialog";
import TabEditDialog from "./components/tabEditDialog";
import LeftTab from "./components/leftTab";
import { confirmDialog } from "./confirm";
import "./index.less";
@ -60,7 +61,8 @@ class Index extends Component {
visible: false, title: getLabel(1421, "新增"), taxDeclarationId: "", id: ""
},
intelCalcSalaryStatus: false, //智能算薪 总开关是否开启
declareInfo: {}, pageInfo: { current: 0, pageSize: 10, total: 0 }
declareInfo: {}, pageInfo: { current: 0, pageSize: 10, total: 0 },
reportType: ""
};
this.timer = null;
this.taxDeclareRef = null;
@ -75,7 +77,8 @@ class Index extends Component {
}
init = async (isInit = true) => {
const [tabsResult, infoResult, calcResult] = await Promise.all([this.getTaxDeclarationTab(), this.getDeclareInfo(), this.apiflowBillingConfigStatus()]);
const [tabsResult, infoResult, calcResult] = await Promise.all([
this.getTaxDeclarationTab(), this.getDeclareInfo(), this.apiflowBillingConfigStatus()]);
const { data: tabDataSource, status: tabStatus } = tabsResult;
const { data: infoDataSource, status: infoStatus } = infoResult;
const { data: calcSalaryStatus, status: calcStatus } = calcResult;
@ -101,10 +104,12 @@ class Index extends Component {
this.getDetailList();
};
getTaxDeclarationTab = () => {
return getTaxDeclarationTab({ id: getQueryString("id") });
const { reportType } = this.state;
return getTaxDeclarationTab({ id: getQueryString("id"), reportType });
};
getDeclareInfo = () => {
return getDeclareInfo({ id: getQueryString("id") });
const { reportType } = this.state;
return getDeclareInfo({ id: getQueryString("id"), reportType });
};
apiflowBillingConfigStatus = () => {
return apiflowBillingConfigStatus();
@ -413,41 +418,47 @@ class Index extends Component {
onClick={this.getEnterprisePayCertificate}>{getLabel(111, "开具企业完税证明")}</Button>);
}
return (
<div className="declareDetail-layout">
<TaxDeclarationInfo declareInfo={declareInfo} onOperate={fun => this[fun]()}/>
<div className="declareDetail-layout-content">
<WeaTab
datas={tabs} keyParam="viewcondition" selectedKey={selectedKey} showAddBtn buttons={btns}
type="editable-inline" onEdit={this.handleTabEdit} leftStyle={{ width: "calc(100% - 450px)" }}
onChange={(v) => this.setState({ selectedKey: v }, () => this.getDetailList())}
searchType={["base"]} searchsBasePlaceHolder={getLabel(26919, "请输入姓名")}
onSearchChange={keyword => this.setState({ keyword })}
onSearch={this.getDetailList}
/>
{/*个税申报表-新增编辑框*/}
<IncomeTaxDeclarationPersonnelSlide
{...taxDecPersonSlide}
onClose={(callback) => this.handleTaxDescPerSlide({ visible: false, id: "", callback })}
/>
{/*个税申报表导入*/}
<TaxDeclareDetailImportDialog ref={dom => this.taxDeclareRef = dom}
onSuccess={this.declare}
/>
{/*个税申报表-新增tab弹框*/}
<TabEditDialog visible={editTabVisible}
onCancel={(isRefresh) => this.setState({ editTabVisible: false }, () => isRefresh && this.init(false))}/>
</div>
<div className="declareDetail-layout-table-content">
<Spin spinning={loading.query}>
<iframe
style={{ border: 0, width: "100%", height: "100%" }}
// src="http://localhost:7607/#/taxDeclareTable"
src="/spa/hrmSalary/hrmSalaryCalculateDetail/index.html#/taxDeclareTable"
id="atdTable"
<WeaLeftRightLayout
leftWidth={210}
leftCom={<LeftTab
onChangeTab={(reportType, isInit = false) => this.setState({ reportType }, () => isInit && this.init())}/>}
>
<div className="declareDetail-layout">
<TaxDeclarationInfo declareInfo={declareInfo} onOperate={fun => this[fun]()}/>
<div className="declareDetail-layout-content">
<WeaTab
datas={tabs} keyParam="viewcondition" selectedKey={selectedKey} showAddBtn buttons={btns}
type="editable-inline" onEdit={this.handleTabEdit} leftStyle={{ width: "calc(100% - 450px)" }}
onChange={(v) => this.setState({ selectedKey: v }, () => this.getDetailList())}
searchType={["base"]} searchsBasePlaceHolder={getLabel(26919, "请输入姓名")}
onSearchChange={keyword => this.setState({ keyword })}
onSearch={this.getDetailList}
/>
</Spin>
{/*个税申报表-新增编辑框*/}
<IncomeTaxDeclarationPersonnelSlide
{...taxDecPersonSlide}
onClose={(callback) => this.handleTaxDescPerSlide({ visible: false, id: "", callback })}
/>
{/*个税申报表导入*/}
<TaxDeclareDetailImportDialog ref={dom => this.taxDeclareRef = dom}
onSuccess={this.declare}
/>
{/*个税申报表-新增tab弹框*/}
<TabEditDialog visible={editTabVisible}
onCancel={(isRefresh) => this.setState({ editTabVisible: false }, () => isRefresh && this.init(false))}/>
</div>
<div className="declareDetail-layout-table-content">
<Spin spinning={loading.query}>
<iframe
style={{ border: 0, width: "100%", height: "100%" }}
// src="http://localhost:7607/#/taxDeclareTable"
src="/spa/hrmSalary/hrmSalaryCalculateDetail/index.html#/taxDeclareTable"
id="atdTable"
/>
</Spin>
</div>
</div>
</div>
</WeaLeftRightLayout>
);
}
}