diff --git a/pc4mobx/hrmSalary/apis/taxAgent.js b/pc4mobx/hrmSalary/apis/taxAgent.js index 8c58759d..e190b812 100644 --- a/pc4mobx/hrmSalary/apis/taxAgent.js +++ b/pc4mobx/hrmSalary/apis/taxAgent.js @@ -137,3 +137,7 @@ export const taxReturnGetForm = (params) => { export const saveAndCheck = (params) => { return postFetch("/api/bs/hrmsalary/taxAgent/taxReturn/saveAndCheck", 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 b051e072..c86eb1ac 100644 --- a/pc4mobx/hrmSalary/pages/salary/components/constants.js +++ b/pc4mobx/hrmSalary/pages/salary/components/constants.js @@ -82,7 +82,7 @@ export const fieldList = [ viewAttr: 1 }, { - key: "taxInforVerifiyStatus", + key: "checkStatus", label: "报税信息验证状态", lanId: 111, type: "TEXT", @@ -110,7 +110,7 @@ export const taxFillCondition = [ domkey: ["taxRegistrationNumber"], fieldcol: 14, label: "登记序号", - lanId: 111, + lanId: 545138, labelcol: 6, value: "", viewAttr: 1 @@ -121,7 +121,7 @@ export const taxFillCondition = [ domkey: ["taxpayerStatus"], fieldcol: 14, label: "纳税人状态", - lanId: 111, + lanId: 545139, labelcol: 6, value: "", viewAttr: 1 @@ -132,7 +132,7 @@ export const taxFillCondition = [ domkey: ["legalPersonName"], fieldcol: 14, label: "法人姓名", - lanId: 111, + lanId: 545140, labelcol: 6, value: "", viewAttr: 1 @@ -143,7 +143,7 @@ export const taxFillCondition = [ domkey: ["mobile"], fieldcol: 14, label: "联系电话", - lanId: 111, + lanId: 545141, labelcol: 6, value: "", viewAttr: 1 @@ -154,7 +154,7 @@ export const taxFillCondition = [ domkey: ["businessAddress"], fieldcol: 14, label: "生产经营地址", - lanId: 111, + lanId: 545142, labelcol: 6, value: "", viewAttr: 1 @@ -165,7 +165,7 @@ export const taxFillCondition = [ domkey: ["industryName"], fieldcol: 14, label: "行业名称", - lanId: 111, + lanId: 545143, labelcol: 6, value: "", viewAttr: 1 @@ -176,7 +176,7 @@ export const taxFillCondition = [ domkey: ["taxAuthorities"], fieldcol: 14, label: "主管税务机关", - lanId: 111, + lanId: 545144, labelcol: 6, value: "", viewAttr: 1 @@ -187,7 +187,7 @@ export const taxFillCondition = [ domkey: ["taxBranch"], fieldcol: 14, label: "主管税务科所", - lanId: 111, + lanId: 545145, labelcol: 6, value: "", viewAttr: 1 @@ -207,3 +207,57 @@ export const taxFillCondition = [ defaultshow: true } ]; + +export const taxFillColumns = [ + { + dataIndex: "taxCode", + title: "税号", + titleId: "", + fixed: "left" + }, + { + dataIndex: "taxAgentName", + title: "个税扣缴义务人", + titleId: "537996" + }, + { + dataIndex: "taxRegistrationNumber", + title: "登记序号", + titleId: "545138" + }, + { + dataIndex: "taxpayerStatus", + title: "纳税人状态", + titleId: "545139" + }, + { + dataIndex: "taxAuthorities", + title: "主管税务机关", + titleId: "545144" + }, + { + dataIndex: "taxBranch", + title: "主管税务科所", + titleId: "545145" + }, + { + dataIndex: "businessAddress", + title: "生产经营地址", + titleId: "545142" + }, + { + dataIndex: "industryName", + title: "行业名称", + titleId: "545143" + }, + { + dataIndex: "legalPersonName", + title: "法人姓名", + titleId: "545140" + }, + { + dataIndex: "mobile", + title: "联系电话", + titleId: "545141" + } +]; diff --git a/pc4mobx/hrmSalary/pages/salary/components/index.less b/pc4mobx/hrmSalary/pages/salary/components/index.less index d06ff96c..be539899 100644 --- a/pc4mobx/hrmSalary/pages/salary/components/index.less +++ b/pc4mobx/hrmSalary/pages/salary/components/index.less @@ -126,5 +126,10 @@ border-bottom: 1px solid #e5e5e5; } } + + .wea-new-table { + background: #FFF; + } + } } diff --git a/pc4mobx/hrmSalary/pages/salary/components/taxAgentSlide.js b/pc4mobx/hrmSalary/pages/salary/components/taxAgentSlide.js index ca7d134f..2e7bba21 100644 --- a/pc4mobx/hrmSalary/pages/salary/components/taxAgentSlide.js +++ b/pc4mobx/hrmSalary/pages/salary/components/taxAgentSlide.js @@ -15,6 +15,7 @@ import PersonalScope from "./personalScope"; import TaxDeclarationInfo from "./taxDeclarationInfo"; import TaxFilingInfoDialofg from "./taxFillingInfoDialog"; import * as API from "../../../apis/taxAgent"; +import { registrationCheck } from "../../../apis/taxAgent"; import "./index.less"; const { getLabel } = WeaLocaleProvider; @@ -32,8 +33,8 @@ class TaxAgentSlide extends Component { taxAgentId: "", taxFilingInfoDialofg: { visible: false, title: "", - isEdit: false, jumpAll: false, - taxAgentTaxReturnCheckFormDTO: {} + isEdit: false, jumpAll: false, loading: false, + taxAgentTaxReturnCheckFormDTO: null } }; this.taxInfoRef = null; @@ -164,7 +165,7 @@ class TaxAgentSlide extends Component { taxFilingInfoDialofg: { ...taxFilingInfoDialofg, visible: true, isEdit, jumpAll, title: fieldForm.name, - taxAgentTaxReturnCheckFormDTO: data.TaxAgentTaxReturnCheckFormDTO + taxAgentTaxReturnCheckFormDTO: data.TaxAgentTaxReturnCheckFormDTO || data.table.list } }); } else { @@ -232,6 +233,42 @@ class TaxAgentSlide extends Component { this.setState({ current: Number(current) }); }; + handleSubmit = (selectKey) => { + const { taxFilingInfoDialofg, taxAgentId } = this.state; + const { fieldForm } = this.taxInfoRef.state; + const { city: cityStr, cityVal = [], netPassword, realNamePassword, ...extra } = fieldForm; + const [nation, province, city] = cityStr ? cityStr.split("-") : []; + const { taxAgentTaxReturnCheckFormDTO } = taxFilingInfoDialofg; + this.setState({ + taxFilingInfoDialofg: { ...taxFilingInfoDialofg, loading: true } + }); + registrationCheck({ + ...extra, nation, province, city, + taxAgentId, password: netPassword || realNamePassword, + cityname: !_.isEmpty(cityVal) ? _.head(cityVal).name : "", + ..._.find(taxAgentTaxReturnCheckFormDTO, it => it.index === selectKey) + }).then(({ status, data, errormsg }) => { + this.setState({ + taxFilingInfoDialofg: { ...taxFilingInfoDialofg, loading: false } + }); + if (status) { + message.success(getLabel(22619, "保存成功!")); + this.setState({ + taxFilingInfoDialofg: { + ...taxFilingInfoDialofg, + taxAgentTaxReturnCheckFormDTO: data.TaxAgentTaxReturnCheckFormDTO + } + }); + } else { + message.error(errormsg || getLabel(22620, "保存失败!")); + } + }).catch(() => { + this.setState({ + taxFilingInfoDialofg: { ...taxFilingInfoDialofg, loading: false } + }); + }); + }; + render() { const tabs = [ { key: 0, title: getLabel(82751, "基础设置") }, @@ -282,13 +319,14 @@ class TaxAgentSlide extends Component { } { const { jumpAll } = taxFilingInfoDialofg; this.setState({ current: jumpAll ? this.state.current + 1 : this.state.current, taxFilingInfoDialofg: { ...taxFilingInfoDialofg, visible: false, - taxAgentTaxReturnCheckFormDTO: {} + taxAgentTaxReturnCheckFormDTO: null } }, () => jumpAll && this.props.onCancel(true)); }} diff --git a/pc4mobx/hrmSalary/pages/salary/components/taxDeclarationInfo.js b/pc4mobx/hrmSalary/pages/salary/components/taxDeclarationInfo.js index 597405bb..11f5e4d3 100644 --- a/pc4mobx/hrmSalary/pages/salary/components/taxDeclarationInfo.js +++ b/pc4mobx/hrmSalary/pages/salary/components/taxDeclarationInfo.js @@ -27,7 +27,7 @@ class TaxDeclarationInfo extends Component { netPassword: null, taxRegistrationNumber: "", departmentCode: "", - taxInforVerifiyStatus: "" + checkStatus: "" }, fieldItem: [] }; @@ -55,6 +55,14 @@ class TaxDeclarationInfo extends Component { ...fieldForm, ..._.reduce(_.keys(fieldForm), (pre, cur) => { if (cur !== "city") { + if (cur === "checkStatus") { + const checkStatusMap = { + "NOT_COMMIT": getLabel(111, "未验证"), + "SUCCESS": getLabel(111, "成功"), + "FAIL": getLabel(111, "失败") + }; + return { ...pre, [cur]: checkStatusMap[data[cur]] }; + } return { ...pre, [cur]: data[cur] }; } return { diff --git a/pc4mobx/hrmSalary/pages/salary/components/taxFillingInfoDialog.js b/pc4mobx/hrmSalary/pages/salary/components/taxFillingInfoDialog.js index 36592033..3871b977 100644 --- a/pc4mobx/hrmSalary/pages/salary/components/taxFillingInfoDialog.js +++ b/pc4mobx/hrmSalary/pages/salary/components/taxFillingInfoDialog.js @@ -6,9 +6,9 @@ */ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; -import { WeaDialog, WeaLocaleProvider } from "ecCom"; +import { WeaDialog, WeaLocaleProvider, WeaTable } from "ecCom"; import { Button } from "antd"; -import { taxFillCondition } from "./constants"; +import { taxFillColumns, taxFillCondition } from "./constants"; import { getSearchs } from "../../../util"; const { getLabel } = WeaLocaleProvider; @@ -16,9 +16,17 @@ const { getLabel } = WeaLocaleProvider; @inject("taxAgentStore") @observer class TaxFilingInfoDialofg extends Component { + constructor(props) { + super(props); + this.state = { + selectedRowKeys: [] + }; + } componentWillReceiveProps(nextProps, nextContext) { - if (nextProps.visible !== this.props.visible && nextProps.visible && !_.isEmpty(nextProps.taxAgentTaxReturnCheckFormDTO)) { + if (!_.isEmpty(nextProps.taxAgentTaxReturnCheckFormDTO) && + Object.prototype.toString.call(nextProps.taxAgentTaxReturnCheckFormDTO) === "[object Object]" + ) { const { taxAgentTaxReturnCheckFormDTO, taxAgentStore: { taxfillInfoForm } } = nextProps; taxfillInfoForm.initFormFields(taxFillCondition); const fields = _.map(taxFillCondition[0].items, it => { @@ -30,20 +38,36 @@ class TaxFilingInfoDialofg extends Component { }); }); } + if (nextProps.visible !== this.props.visible && !nextProps.visible) { + const { taxAgentStore: { setTaxfillInfoForm } } = nextProps; + setTaxfillInfoForm(); + } } render() { - const { taxAgentStore: { taxfillInfoForm } } = this.props; + const { selectedRowKeys } = this.state; + const { taxAgentStore: { taxfillInfoForm }, taxAgentTaxReturnCheckFormDTO, loading } = this.props; + const rowSelection = { + type: "radio", + selectedRowKeys, + onChange: selectedRowKeys => this.setState({ selectedRowKeys }) + }; return ( {getLabel(111, "知道了")} - ]} + buttons={ + Object.prototype.toString.call(taxAgentTaxReturnCheckFormDTO) === "[object Object]" ? + [ + + ] : [ + + ] + } style={{ width: 850, - height: 606.6, + height: 480, minHeight: 200, minWidth: 380, maxHeight: "50%", @@ -53,7 +77,19 @@ class TaxFilingInfoDialofg extends Component { }} >
- {getSearchs(taxfillInfoForm, taxFillCondition, 1)} + { + Object.prototype.toString.call(taxAgentTaxReturnCheckFormDTO) === "[object Object]" ? + getSearchs(taxfillInfoForm, taxFillCondition, 1) : + ({ + dataIndex: o.dataIndex, + width: 200, + title: getLabel(o.titleId, o.title) + }))} + scroll={{ x: 1200 }} rowSelection={rowSelection} + /> + }
); diff --git a/pc4mobx/hrmSalary/stores/taxAgent.js b/pc4mobx/hrmSalary/stores/taxAgent.js index a6057341..44271c02 100644 --- a/pc4mobx/hrmSalary/stores/taxAgent.js +++ b/pc4mobx/hrmSalary/stores/taxAgent.js @@ -10,7 +10,7 @@ const { TableStore } = WeaTableNew; export class TaxAgentStore { @observable salarytaxAgentForm = new WeaForm(); //新版个税扣缴义务人表单实体 @observable taxfillInfoForm = new WeaForm(); //报税信息查看form - + @action setTaxfillInfoForm = () => this.taxfillInfoForm = new WeaForm(); //报税信息form初始化 @observable tableStore = new TableStore(); // new table