diff --git a/pc4mobx/hrmSalary/apis/taxAgent.js b/pc4mobx/hrmSalary/apis/taxAgent.js index e190b812..d29e9fe5 100644 --- a/pc4mobx/hrmSalary/apis/taxAgent.js +++ b/pc4mobx/hrmSalary/apis/taxAgent.js @@ -137,6 +137,10 @@ export const taxReturnGetForm = (params) => { export const saveAndCheck = (params) => { return postFetch("/api/bs/hrmsalary/taxAgent/taxReturn/saveAndCheck", params); }; +//个税信息-部门备案报税信息保存 +export const saveDepartmentCodeAndCheck = (params) => { + return postFetch("/api/bs/hrmsalary/taxAgent/taxReturn/departmentCode/check", params); +}; //个税信息-提交报税信息 export const registrationCheck = (params) => { return postFetch("/api/bs/hrmsalary/taxAgent/taxReturn/registration/check", params); diff --git a/pc4mobx/hrmSalary/pages/salary/components/constants.js b/pc4mobx/hrmSalary/pages/salary/components/constants.js index c86eb1ac..8682937c 100644 --- a/pc4mobx/hrmSalary/pages/salary/components/constants.js +++ b/pc4mobx/hrmSalary/pages/salary/components/constants.js @@ -207,6 +207,37 @@ export const taxFillCondition = [ defaultshow: true } ]; +export const deptFillCondition = [ + { + items: [ + { + colSpan: 1, + conditionType: "INPUT", + domkey: ["departmentName"], + fieldcol: 14, + label: "部门名称", + lanId: 536641, + labelcol: 6, + value: "", + rules: "required|string", + viewAttr: 3 + }, + { + colSpan: 1, + conditionType: "INPUT", + domkey: ["departmentCode"], + fieldcol: 14, + label: "部门编码", + lanId: 111, + labelcol: 6, + value: "", + rules: "required|string", + viewAttr: 3 + } + ], + defaultshow: true + } +]; export const taxFillColumns = [ { diff --git a/pc4mobx/hrmSalary/pages/salary/components/taxAgentSlide.js b/pc4mobx/hrmSalary/pages/salary/components/taxAgentSlide.js index 2e7bba21..97ebff1e 100644 --- a/pc4mobx/hrmSalary/pages/salary/components/taxAgentSlide.js +++ b/pc4mobx/hrmSalary/pages/salary/components/taxAgentSlide.js @@ -27,12 +27,9 @@ class TaxAgentSlide extends Component { constructor(props) { super(props); this.state = { - current: 0, - loading: false, - verifyLoading: false, - taxAgentId: "", + current: 0, loading: false, verifyLoading: false, taxAgentId: "", taxFilingInfoDialofg: { - visible: false, title: "", + visible: false, title: "", checkPayload: {}, isEdit: false, jumpAll: false, loading: false, taxAgentTaxReturnCheckFormDTO: null } @@ -164,7 +161,7 @@ class TaxAgentSlide extends Component { this.setState({ taxFilingInfoDialofg: { ...taxFilingInfoDialofg, visible: true, - isEdit, jumpAll, title: fieldForm.name, + isEdit, jumpAll, title: fieldForm.name, checkPayload: payload, taxAgentTaxReturnCheckFormDTO: data.TaxAgentTaxReturnCheckFormDTO || data.table.list } }); @@ -320,7 +317,7 @@ class TaxAgentSlide extends Component { { + onCancel={(isRefresh) => { const { jumpAll } = taxFilingInfoDialofg; this.setState({ current: jumpAll ? this.state.current + 1 : this.state.current, @@ -328,7 +325,10 @@ class TaxAgentSlide extends Component { ...taxFilingInfoDialofg, visible: false, taxAgentTaxReturnCheckFormDTO: null } - }, () => jumpAll && this.props.onCancel(true)); + }, () => { + isRefresh && this.taxInfoRef.taxReturnGetForm(); + jumpAll && this.props.onCancel(true); + }); }} /> diff --git a/pc4mobx/hrmSalary/pages/salary/components/taxFillingInfoDialog.js b/pc4mobx/hrmSalary/pages/salary/components/taxFillingInfoDialog.js index 3871b977..3a02b4b7 100644 --- a/pc4mobx/hrmSalary/pages/salary/components/taxFillingInfoDialog.js +++ b/pc4mobx/hrmSalary/pages/salary/components/taxFillingInfoDialog.js @@ -7,9 +7,10 @@ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; import { WeaDialog, WeaLocaleProvider, WeaTable } from "ecCom"; -import { Button } from "antd"; -import { taxFillColumns, taxFillCondition } from "./constants"; +import { Button, message } from "antd"; +import { deptFillCondition, taxFillColumns, taxFillCondition } from "./constants"; import { getSearchs } from "../../../util"; +import { saveDepartmentCodeAndCheck } from "../../../apis/taxAgent"; const { getLabel } = WeaLocaleProvider; @@ -19,7 +20,7 @@ class TaxFilingInfoDialofg extends Component { constructor(props) { super(props); this.state = { - selectedRowKeys: [] + selectedRowKeys: [], checkLoading: false }; } @@ -27,26 +28,53 @@ class TaxFilingInfoDialofg extends Component { if (!_.isEmpty(nextProps.taxAgentTaxReturnCheckFormDTO) && Object.prototype.toString.call(nextProps.taxAgentTaxReturnCheckFormDTO) === "[object Object]" ) { - const { taxAgentTaxReturnCheckFormDTO, taxAgentStore: { taxfillInfoForm } } = nextProps; + const { taxAgentTaxReturnCheckFormDTO, taxAgentStore: { taxfillInfoForm, deptfillInfoForm } } = nextProps; taxfillInfoForm.initFormFields(taxFillCondition); + deptfillInfoForm.initFormFields(deptFillCondition); const fields = _.map(taxFillCondition[0].items, it => { return it.domkey[0]; }); fields.map(item => { taxfillInfoForm.updateFields({ - [item]: taxAgentTaxReturnCheckFormDTO[item] || "" + [item]: item !== "divideFiling" ? (taxAgentTaxReturnCheckFormDTO[item] || "") : (taxAgentTaxReturnCheckFormDTO[item] === "ON" ? getLabel(538048, "是") : getLabel(30587, "否")) }); }); } if (nextProps.visible !== this.props.visible && !nextProps.visible) { - const { taxAgentStore: { setTaxfillInfoForm } } = nextProps; + const { taxAgentStore: { setTaxfillInfoForm, initDeptfillInfoForm } } = nextProps; setTaxfillInfoForm(); + initDeptfillInfoForm(); } } + handleSaveOrKnow = () => { + const { taxAgentStore: { taxfillInfoForm, deptfillInfoForm }, checkPayload } = this.props; + if (taxfillInfoForm.getFormParams().divideFiling === getLabel(538048, "是")) { + deptfillInfoForm.validateForm().then(f => { + if (f.isValid) { + this.setState({ checkLoading: true }); + saveDepartmentCodeAndCheck(_.omitBy({ ...checkPayload, ...deptfillInfoForm.getFormParams() }, val => _.isNil(val))) + .then(({ status, errormsg }) => { + this.setState({ checkLoading: false }); + if (status) { + message.success(getLabel(30700, "操作成功!")); + this.props.onCancel(true); + } else { + message.error(errormsg); + } + }).catch(() => this.setState({ checkLoading: false })); + } else { + f.showErrors(); + } + }); + } else { + this.props.onCancel(); + } + }; + render() { - const { selectedRowKeys } = this.state; - const { taxAgentStore: { taxfillInfoForm }, taxAgentTaxReturnCheckFormDTO, loading } = this.props; + const { selectedRowKeys, checkLoading } = this.state; + const { taxAgentStore: { taxfillInfoForm, deptfillInfoForm }, taxAgentTaxReturnCheckFormDTO, loading } = this.props; const rowSelection = { type: "radio", selectedRowKeys, @@ -59,7 +87,9 @@ class TaxFilingInfoDialofg extends Component { buttons={ Object.prototype.toString.call(taxAgentTaxReturnCheckFormDTO) === "[object Object]" ? [ - + ] : [ @@ -79,7 +109,10 @@ class TaxFilingInfoDialofg extends Component {
{ Object.prototype.toString.call(taxAgentTaxReturnCheckFormDTO) === "[object Object]" ? - getSearchs(taxfillInfoForm, taxFillCondition, 1) : + + {getSearchs(taxfillInfoForm, taxFillCondition, 1)} + {taxfillInfoForm.getFormParams().divideFiling === getLabel(538048, "是") && getSearchs(deptfillInfoForm, deptFillCondition, 1)} + : ({ diff --git a/pc4mobx/hrmSalary/stores/taxAgent.js b/pc4mobx/hrmSalary/stores/taxAgent.js index 44271c02..9f888df6 100644 --- a/pc4mobx/hrmSalary/stores/taxAgent.js +++ b/pc4mobx/hrmSalary/stores/taxAgent.js @@ -11,6 +11,8 @@ export class TaxAgentStore { @observable salarytaxAgentForm = new WeaForm(); //新版个税扣缴义务人表单实体 @observable taxfillInfoForm = new WeaForm(); //报税信息查看form @action setTaxfillInfoForm = () => this.taxfillInfoForm = new WeaForm(); //报税信息form初始化 + @observable deptfillInfoForm = new WeaForm(); //报税信息部门备案form + @action initDeptfillInfoForm = () => this.deptfillInfoForm = new WeaForm(); //报税信息部门备案form初始化 @observable tableStore = new TableStore(); // new table