diff --git a/pc4mobx/hrmSalary/apis/taxAgent.js b/pc4mobx/hrmSalary/apis/taxAgent.js index 38852581..f22de23d 100644 --- a/pc4mobx/hrmSalary/apis/taxAgent.js +++ b/pc4mobx/hrmSalary/apis/taxAgent.js @@ -122,5 +122,10 @@ export const hasIconInTax = (params) => { }; //获取报税信息表单 export const taxReturnGetForm = (params) => { - return WeaTools.callApi("/api/bs/hrmsalary/taxReturn/getForm", "GET", params); + return WeaTools.callApi("/api/bs/hrmsalary/taxAgent/taxReturn/getForm", "GET", params); +}; + +//个税信息-保存并验证报税信息 +export const saveAndCheck = (params) => { + return postFetch("/api/bs/hrmsalary/taxAgent/taxReturn/saveAndCheck", params); }; diff --git a/pc4mobx/hrmSalary/pages/salary/components/taxAgentSlide.js b/pc4mobx/hrmSalary/pages/salary/components/taxAgentSlide.js index f760a72d..9f49ca38 100644 --- a/pc4mobx/hrmSalary/pages/salary/components/taxAgentSlide.js +++ b/pc4mobx/hrmSalary/pages/salary/components/taxAgentSlide.js @@ -6,7 +6,7 @@ */ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; -import { Button, message } from "antd"; +import { Button, message, Modal } from "antd"; import { WeaLocaleProvider, WeaSlideModal, WeaSteps } from "ecCom"; import SlideModalTitle from "../../../components/slideModalTitle"; import { decentralizationConditions, editConditions } from "../../taxAgent/editConditions"; @@ -122,7 +122,24 @@ class TaxAgentSlide extends Component { }); }; handleSaveAndVerify = () => { - console.log(this.taxInfoRef); + const { taxAgentId } = this.state; + const { fieldForm, fieldItem } = this.taxInfoRef.state; + const { city: cityVal, ...extra } = fieldForm; + const boolean = _.every(_.filter(fieldItem, item => item.viewAttr === 3), it => fieldForm[it.key]); + if (!boolean) { + Modal.warning({ + title: getLabel(131329, "信息确认"), + content: getLabel(518702, "必要信息不完整,红色*为必填项!") + }); + return; + } + const [nation, province, city] = cityVal ? cityVal.split("-") : []; + // requestType: 1:保存并验证 2:保存 + const payload = { + ...extra, nation, province, city, + taxAgentId, requestType: 1 + }; + console.log(_.omitBy(payload, val => _.isNil(val))); }; renderChildren = () => { const { current, taxAgentId } = this.state; diff --git a/pc4mobx/hrmSalary/pages/salary/components/taxDeclarationInfo.js b/pc4mobx/hrmSalary/pages/salary/components/taxDeclarationInfo.js index 5849e51b..cef52e95 100644 --- a/pc4mobx/hrmSalary/pages/salary/components/taxDeclarationInfo.js +++ b/pc4mobx/hrmSalary/pages/salary/components/taxDeclarationInfo.js @@ -45,8 +45,18 @@ class TaxDeclarationInfo extends Component { taxReturnGetForm = () => { const { taxAgentId } = this.props; - taxReturnGetForm({ taxAgentId }).then((status, data) => { - console.log(data); + taxReturnGetForm({ taxAgentId }).then(({ status, data }) => { + if (status) { + const { fieldForm } = this.state; + this.setState({ + fieldForm: { + ...fieldForm, + ..._.reduce(_.keys(fieldForm), (pre, cur) => { + return { ...pre, [cur]: data[cur] }; + }, {}) + } + }); + } }); }; handleChangeValue = (key, value) => { @@ -88,7 +98,14 @@ class TaxDeclarationInfo extends Component { { type === "SELECT" && this.handleChangeValue(key, v)}/> + onChange={(__, ___, datas) => { + if (!_.isEmpty(datas)) { + this.handleChangeValue(key, `1-${datas[0].pid}-${datas[0].id}`); + } else { + this.handleChangeValue(key, ""); + } + }} + /> } { type === "RADIO" &&