diff --git a/pc4mobx/hrmSalary/pages/declareDetail/components/leftTab.js b/pc4mobx/hrmSalary/pages/declareDetail/components/leftTab.js index 55c936cf..0703aa07 100644 --- a/pc4mobx/hrmSalary/pages/declareDetail/components/leftTab.js +++ b/pc4mobx/hrmSalary/pages/declareDetail/components/leftTab.js @@ -27,12 +27,13 @@ class LeftTab extends Component { } getTaxReports = () => { - const { onChangeTab } = this.props; + const { onChangeTab, onCollapse } = 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); + onCollapse(!_.isEmpty(this.state.dataSource) && this.state.dataSource.length > 1); }); }); }; diff --git a/pc4mobx/hrmSalary/pages/declareDetail/index.js b/pc4mobx/hrmSalary/pages/declareDetail/index.js index cc3d071d..bb9e83bb 100644 --- a/pc4mobx/hrmSalary/pages/declareDetail/index.js +++ b/pc4mobx/hrmSalary/pages/declareDetail/index.js @@ -25,8 +25,7 @@ import { taxdeclarationRefreshData, taxdeclaratioUpdateCancel, taxdeclaratioUpdateDeclare, - taxPaymentVoucherStatusSync, - taxPaymentWithheldVoucherGet + taxPaymentVoucherStatusSync } from "../../apis/declare"; import { convertToUrlString, getQueryString } from "../../util/url"; import IncomeTaxDeclarationPersonnelSlide from "./components/incomeTaxDeclarationPersonnelSlide"; @@ -62,7 +61,7 @@ class Index extends Component { }, intelCalcSalaryStatus: false, //智能算薪 总开关是否开启 declareInfo: {}, pageInfo: { current: 0, pageSize: 10, total: 0 }, - reportType: "" + reportType: "", showLeft: false }; this.timer = null; this.taxDeclareRef = null; @@ -347,7 +346,7 @@ class Index extends Component { render() { const { tabs, selectedKey, loading, declareInfo, intelCalcSalaryStatus, taxDecPersonSlide, - editTabVisible, reportType + editTabVisible, reportType, showLeft } = this.state; const [__, taxDeclarationId] = selectedKey.split("%%"); let btns = [ @@ -424,10 +423,12 @@ class Index extends Component { } return ( this.setState({ reportType }, () => isInit && this.init())}/>} - > + onChangeTab={(reportType, isInit = false) => this.setState({ reportType }, () => isInit && this.init())} + onCollapse={showLeft => this.setState({ showLeft })}/>} + onCollapse={showLeft => this.setState({ showLeft })}>
this[fun]()}/>