diff --git a/pc4mobx/hrmSalary/apis/declare.js b/pc4mobx/hrmSalary/apis/declare.js index 8c9a2a11..a780105b 100644 --- a/pc4mobx/hrmSalary/apis/declare.js +++ b/pc4mobx/hrmSalary/apis/declare.js @@ -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); }; //个税在线对接-个税申报表是否已经生成 diff --git a/pc4mobx/hrmSalary/pages/declareDetail/components/leftTab.js b/pc4mobx/hrmSalary/pages/declareDetail/components/leftTab.js new file mode 100644 index 00000000..1370d4e1 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/declareDetail/components/leftTab.js @@ -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 ( +
+ { + this.setState({ selectedKeys: key }, () => { + onChangeTab(_.find(dataSource, o => String(o.id) === key).reportType, true); + }); + }} + > + { + _.map(dataSource, item => { + const { reportType, id } = item; + return {reportType}; + }) + } + +
+ ); + } +} + +export default LeftTab; diff --git a/pc4mobx/hrmSalary/pages/declareDetail/index.js b/pc4mobx/hrmSalary/pages/declareDetail/index.js index 280bfc5b..505a2c16 100644 --- a/pc4mobx/hrmSalary/pages/declareDetail/index.js +++ b/pc4mobx/hrmSalary/pages/declareDetail/index.js @@ -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, "开具企业完税证明")}); } return ( -
- this[fun]()}/> -
- this.setState({ selectedKey: v }, () => this.getDetailList())} - searchType={["base"]} searchsBasePlaceHolder={getLabel(26919, "请输入姓名")} - onSearchChange={keyword => this.setState({ keyword })} - onSearch={this.getDetailList} - /> - {/*个税申报表-新增编辑框*/} - this.handleTaxDescPerSlide({ visible: false, id: "", callback })} - /> - {/*个税申报表导入*/} - this.taxDeclareRef = dom} - onSuccess={this.declare} - /> - {/*个税申报表-新增tab弹框*/} - this.setState({ editTabVisible: false }, () => isRefresh && this.init(false))}/> -
-
- -