diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/columns.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/columns.js index 1c9d27d0..c2c2a844 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/columns.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/columns.js @@ -550,6 +550,17 @@ export const cumTaxPeriodCondition = [ value: "", rules: "required", viewAttr: 3 + },{ + colSpan: 1, + conditionType: "SELECT", + domkey: ["taxAgentIds"], + multiple: true, + fieldcol: 18, + label: "个税扣缴义务人", + lanId: 537996, + labelcol: 6, + value: "", + viewAttr: 2 }], title: "", defaultshow: true diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/components/salaryCumDeductChooseTaxPeriodDialog.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/components/salaryCumDeductChooseTaxPeriodDialog.js index 7e0c76f4..5947b8da 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/components/salaryCumDeductChooseTaxPeriodDialog.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/components/salaryCumDeductChooseTaxPeriodDialog.js @@ -6,7 +6,8 @@ */ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; -import { WeaDialog, WeaLocaleProvider } from "ecCom"; +import { toJS } from "mobx"; +import { WeaDialog, WeaLocaleProvider, WeaTools } from "ecCom"; import { Button, message } from "antd"; import { getSearchs } from "../../../../util"; import { cumTaxPeriodCondition } from "../columns"; @@ -14,6 +15,7 @@ import { onlineRequest } from "../../../../apis/cumDeduct"; import { onlineActualAddUpAdvanceTax } from "../../../../apis/cumSituation"; const getLabel = WeaLocaleProvider.getLabel; +const getKey = WeaTools.getKey; const APIFox = { online: onlineRequest, advance: onlineActualAddUpAdvanceTax @@ -25,13 +27,23 @@ class SalaryCumDeductChooseTaxPeriodDialog extends Component { constructor(props) { super(props); this.state = { - loading: false + loading: false, conditions: [] }; } componentWillReceiveProps(nextProps, nextContext) { const { cumDeductStore: { cumTaxPeriodForm, changeCumTaxPeriodForm } } = nextProps; if (nextProps.visible !== this.props.visible && nextProps.visible) { + 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) }; + }) + })) + }); cumTaxPeriodForm.initFormFields(cumTaxPeriodCondition); } if (nextProps.visible !== this.props.visible && !nextProps.visible) { @@ -43,18 +55,19 @@ class SalaryCumDeductChooseTaxPeriodDialog extends Component { save = () => { const { cumDeductStore: { cumTaxPeriodForm }, type } = this.props; cumTaxPeriodForm.validateForm().then(f => { - const { declareMonth } = cumTaxPeriodForm.getFormParams(); + const { declareMonth, taxAgentIds } = cumTaxPeriodForm.getFormParams(); if (f.isValid) { this.setState({ loading: true }); - APIFox[type]({ declareMonth: declareMonth + "-01" }).then(({ status, errormsg }) => { - this.setState({ loading: false }); - if (status) { - message.success(getLabel(111, "获取成功!")); - this.props.onCancel(); - } else { - message.error(errormsg); - } - }).catch(() => this.setState({ loading: false })); + APIFox[type]({ declareMonth: declareMonth + "-01", taxAgentIds: taxAgentIds ? taxAgentIds.split(",") : [] }) + .then(({ status, errormsg }) => { + this.setState({ loading: false }); + if (status) { + message.success(getLabel(111, "获取成功!")); + this.props.onCancel(); + } else { + message.error(errormsg); + } + }).catch(() => this.setState({ loading: false })); } else { f.showErrors(); } @@ -62,17 +75,17 @@ class SalaryCumDeductChooseTaxPeriodDialog extends Component { }; render() { - const { loading } = this.state; + const { loading, conditions } = this.state; const { cumDeductStore: { cumTaxPeriodForm } } = this.props; return ( {getLabel(33703, "确认")}]} bottomLeft={getLabel(111, "点击保存后,稍后请点击【获取结果下载】下载获取结果。获取的数据将覆盖列表原本数据(有则覆盖无则新增)。")} >
- {getSearchs(cumTaxPeriodForm, cumTaxPeriodCondition, 1, false)} + {getSearchs(cumTaxPeriodForm, conditions, 1, false)}
); diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js index 980ee789..4e903cc6 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js @@ -69,7 +69,7 @@ class Index extends Component { exportPayloadType: false, advanceCondition: null, cumTaxPeriodDialog: { - visible: false, title: "", type: "" + visible: false, title: "", type: "", taxAgentOption: [] }, feedbackLoading: false, incomeTaxStatus: false, @@ -401,6 +401,7 @@ class Index extends Component { */ getTopBtns = () => { const { addAllLoading, cumTaxPeriodDialog, feedbackLoading, incomeTaxStatus } = this.state; + const { taxAgentStore: { taxAgentOption } } = this.props; const commonBtns = [ , , @@ -421,7 +422,7 @@ class Index extends Component { const incomeTaxBtns = [