diff --git a/pc4mobx/hrmSalary/apis/taxAgent.js b/pc4mobx/hrmSalary/apis/taxAgent.js index d68e965d..1c5b7670 100644 --- a/pc4mobx/hrmSalary/apis/taxAgent.js +++ b/pc4mobx/hrmSalary/apis/taxAgent.js @@ -112,3 +112,11 @@ export const hasIconInTax = (params) => { params ); }; +//获取报税信息表单 +export const taxReturnGetForm = (params) => { + return WeaTools.callApi( + "/api/bs/hrmsalary/taxReturn/getForm", + "GET", + params + ); +}; diff --git a/pc4mobx/hrmSalary/pages/salary/components/constants.js b/pc4mobx/hrmSalary/pages/salary/components/constants.js new file mode 100644 index 00000000..0d0eede3 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/salary/components/constants.js @@ -0,0 +1,78 @@ +export const fieldList = [ + { + key: "name", + label: "名称", + type: "TEXT", + viewAttr: 1 + }, + { + key: "dutyParagraph", + label: "税号", + type: "TEXT", + viewAttr: 3 + }, + { + key: "taxDeclarationRegion", + label: "报税所属区域", + type: "SELECT", + viewAttr: 3 + }, + { + key: "areaNumber", + label: "行政区划代码", + type: "TEXT", + viewAttr: 3 + }, + { + key: "passwordVerifyType", + label: "密码校验类型", + type: "RADIO", + viewAttr: 3, + options: [ + { + key: "0", + showname: "个税网报密码" + }, + { + key: "2", + showname: "实名账号密码" + } + ] + }, + { + key: "realNameAccount", + label: "实名账号", + type: "TEXT", + viewAttr: 3 + }, + { + key: "realNameAccountPassword", + label: "实名账号密码", + type: "PASSWORD", + viewAttr: 3 + }, + { + key: "taxOnlinePassword", + label: "个税网报密码", + type: "PASSWORD", + viewAttr: 3 + }, + { + key: "registrationNo", + label: "登记序号", + type: "TEXT", + viewAttr: 1 + }, + { + key: "departmentCode", + label: "部门编码", + type: "TEXT", + viewAttr: 1 + }, + { + key: "taxInforVerifiyStatus", + label: "报税信息验证状态", + type: "TEXT", + viewAttr: 1 + } +]; diff --git a/pc4mobx/hrmSalary/pages/salary/components/taxAgentSlide.js b/pc4mobx/hrmSalary/pages/salary/components/taxAgentSlide.js index 159a2a96..eac13735 100644 --- a/pc4mobx/hrmSalary/pages/salary/components/taxAgentSlide.js +++ b/pc4mobx/hrmSalary/pages/salary/components/taxAgentSlide.js @@ -12,6 +12,7 @@ import SlideModalTitle from "../../../components/slideModalTitle"; import { decentralizationConditions, editConditions } from "../../taxAgent/editConditions"; import BaseSettings from "./baseSettings"; import PersonalScope from "./personalScope"; +import TaxDeclarationInfo from "./taxDeclarationInfo"; import * as API from "../../../apis/taxAgent"; import "./index.less"; @@ -32,6 +33,7 @@ class TaxAgentSlide extends Component { loading: false, taxAgentId: "" }; + this.taxInfoRef = null; } componentWillReceiveProps(nextProps, nextContext) { @@ -53,7 +55,7 @@ class TaxAgentSlide extends Component { if (status) { const { name, description, adminUserIds } = data; salarytaxAgentForm.updateFields({ - name: { value: name, viewAttr: 1 }, + name: { value: name }, adminUserIds: { value: _.map(adminUserIds, it => it.id.toString()).join(","), valueSpan: _.map(adminUserIds, it => it.content).join(",") @@ -122,6 +124,9 @@ class TaxAgentSlide extends Component { } }); }; + handleSaveAndVerify = () => { + console.log(this.taxInfoRef); + }; renderChildren = () => { const { current } = this.state; const { decentralization } = this.props; @@ -131,6 +136,9 @@ class TaxAgentSlide extends Component { case 0: CurrentDom = ; break; + case 1: + CurrentDom = this.taxInfoRef = dom} taxAgentId={taxAgentId}/>; + break; case 2: CurrentDom = ; break; @@ -154,7 +162,7 @@ class TaxAgentSlide extends Component { ]; break; case 1: - const tmpV = []; + const tmpV = []; const tmpJ = [ , diff --git a/pc4mobx/hrmSalary/pages/salary/components/taxDeclarationInfo.js b/pc4mobx/hrmSalary/pages/salary/components/taxDeclarationInfo.js new file mode 100644 index 00000000..f4b77ad0 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/salary/components/taxDeclarationInfo.js @@ -0,0 +1,100 @@ +/* + * Author: 黎永顺 + * name: 报税信息 + * Description: + * Date: 2022/12/1 + */ +import React, { Component } from "react"; +import { WeaBrowser, WeaFormItem, WeaInput, WeaSearchGroup, WeaSelect } from "ecCom"; +import { fieldList } from "./constants"; +import { taxReturnGetForm } from "../../../apis/taxAgent"; + +class TaxDeclarationInfo extends Component { + constructor(props) { + super(props); + this.state = { + fieldForm: { + name: "", + dutyParagraph: "", + taxDeclarationRegion: "", + areaNumber: "", + passwordVerifyType: "0", + realNameAccount: "", + realNameAccountPassword: "", + taxOnlinePassword: "", + registrationNo: "", + departmentCode: "", + taxInforVerifiyStatus: "" + }, + fieldItem: [] + }; + } + + componentDidMount() { + this.setState({ + fieldItem: _.filter(fieldList, it => it.key !== "realNameAccount" && it.key !== "realNameAccountPassword") + }, () => { + this.taxReturnGetForm(); + }); + } + + taxReturnGetForm = () => { + const { taxAgentId } = this.props; + taxReturnGetForm({ taxAgentId }).then((status, data) => { + console.log(data); + }); + }; + handleChangeValue = (key, value) => { + const { fieldForm } = this.state; + this.setState({ + fieldForm: { + ...fieldForm, + [key]: value + } + }, () => { + if (key === "passwordVerifyType" && this.state.fieldForm.passwordVerifyType === "2") { + this.setState({ + fieldItem: _.filter(fieldList, it => it.key !== "taxOnlinePassword"), + fieldForm: { ...this.state.fieldForm, realNameAccount: "", realNameAccountPassword: "" } + }); + } else if (key === "passwordVerifyType" && this.state.fieldForm.passwordVerifyType === "0") { + this.setState({ + fieldItem: _.filter(fieldList, it => it.key !== "realNameAccount" && it.key !== "realNameAccountPassword"), + fieldForm: { ...this.state.fieldForm, taxOnlinePassword: "" } + }); + } + }); + }; + + render() { + const { fieldItem, fieldForm } = this.state; + return ( + + { + _.map(fieldItem, item => { + const { key, label, type, viewAttr, options = [] } = item; + return + { + (type === "TEXT" || type === "PASSWORD") && + this.handleChangeValue(key, v)}/> + } + { + type === "SELECT" && + this.handleChangeValue(key, v)}/> + } + { + type === "RADIO" && + this.handleChangeValue(key, v)}/> + } + ; + }) + } + + ); + } +} + +export default TaxDeclarationInfo;