diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/components/salaryCumDeductChooseTaxPeriodDialog.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/components/salaryCumDeductChooseTaxPeriodDialog.js index 5947b8da..ddf7a5eb 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/components/salaryCumDeductChooseTaxPeriodDialog.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/components/salaryCumDeductChooseTaxPeriodDialog.js @@ -6,13 +6,13 @@ */ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; -import { toJS } from "mobx"; import { WeaDialog, WeaLocaleProvider, WeaTools } from "ecCom"; import { Button, message } from "antd"; import { getSearchs } from "../../../../util"; import { cumTaxPeriodCondition } from "../columns"; import { onlineRequest } from "../../../../apis/cumDeduct"; import { onlineActualAddUpAdvanceTax } from "../../../../apis/cumSituation"; +import { postFetch } from "../../../../util/request"; const getLabel = WeaLocaleProvider.getLabel; const getKey = WeaTools.getKey; @@ -31,14 +31,18 @@ class SalaryCumDeductChooseTaxPeriodDialog extends Component { }; } - componentWillReceiveProps(nextProps, nextContext) { + async componentWillReceiveProps(nextProps, nextContext) { const { cumDeductStore: { cumTaxPeriodForm, changeCumTaxPeriodForm } } = nextProps; if (nextProps.visible !== this.props.visible && nextProps.visible) { + const { data } = await postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "ADMIN_DATA" }); this.setState({ conditions: _.map(cumTaxPeriodCondition, item => ({ ...item, items: _.map(item.items, o => { if (getKey(o) === "taxAgentIds") { - return { ...o, lable: getLabel(o.lanId, o.label), options: toJS(nextProps.taxAgentOption) }; + return { + ...o, lable: getLabel(o.lanId, o.label), + options: _.map(data, g => ({ key: String(g.id), showname: g.name })) + }; } return { ...o, lable: getLabel(o.lanId, o.label) }; }) diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js index b180d5b2..171944e7 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js @@ -39,7 +39,7 @@ import SalaryCumDeductChooseTaxPeriodDialog from "./components/salaryCumDeductCh const getLabel = WeaLocaleProvider.getLabel; const getKey = WeaTools.getKey; -@inject("taxAgentStore", "cumDeductStore") +@inject("cumDeductStore") @observer class Index extends Component { constructor(props) { @@ -73,7 +73,7 @@ class Index extends Component { targetid: "", taxAgentOption: [], cumTaxPeriodDialog: { - visible: false, title: "", type: "", taxAgentOption: [] + visible: false, title: "", type: "" }, feedbackLoading: false, incomeTaxStatus: false @@ -410,7 +410,6 @@ class Index extends Component { */ getTopBtns = () => { const { addAllLoading, cumTaxPeriodDialog, feedbackLoading, incomeTaxStatus } = this.state; - const { taxAgentStore: { taxAgentOption } } = this.props; const commonBtns = [ , , @@ -431,7 +430,7 @@ class Index extends Component { const incomeTaxBtns = [