/** * @author Xyz * 分公司管理-分公司详情 */ import PDrawer from '../../../components/Pro/PDrawer'; import PSelect from '../../../components/Pro/PSelect'; import React from 'react'; import { Form, Input, Button, DatePicker, Popover, Icon, Radio, Select } from 'antd'; import {formItemLayout1} from './constants'; import {DrawHeader, Empty, DrawBottomBtns} from './styles'; import {OrganName} from './components'; import PCascader from '../../../components/Pro/PCascader'; import {enterpriseComManagerGetComBaseInfoById, publicCommonDictGetDictByCodeTypes} from '../../../services/api'; import bcx_utils from '../../../common/bcx_utils'; const RadioGroup = Radio.Group; const Option = Select.Option; const FormItem = Form.Item; PSelect.allSelcet("nation,idCardType_bak,education,skillLevel"); @Form.create() export default class DrawBranchCompanyDetail extends React.Component { constructor(props, context) { super(props, context); this.state = { dataSource: { "comId": "", "sessionId": "", "comManagerId": "", "idCardType": "",//身份证件类型 "idCardNo": "",//证件号码 "name": "",//姓名 "sex": "0", "nation": "",//民族 "residentProvince": 0,//户口所在省 "residentCity": 0,//户口所在城市 "residentArea": 0,//户口所在区 "residenceAddress": "", "telephone": "",//联系方式 "education": "",//学历 "positionName": "",//职务 "domicileProvince": 0,//居住地所在省 "domicileCity": 0,//居住地所在市 "domicileArea": 0,//居住地所在区 "domicileAddress": "",//居住具体地址 "jobSkillLevel": "",//职业技能等级 "sexName": "", "idCardTypeName": "" }, codeTypes: { education: [],//学历 idCardType_bak: [],//身份证 nation: [],//民族 skillLevel: [],//职业技能等级 }//所有类型 } } /******************************生命周期******************************/ componentDidMount = () => { // this.publicCommonDictGetDictByCodeTypes(); } componentWillReceiveProps = (nextProps, newState) => { if (nextProps.visible && !this.props.visible && nextProps.comManagerId) { this.ajaxDetail(nextProps.comManagerId); } } /******************************ajax请求******************************/ ajaxDetail = (comManagerId) => { enterpriseComManagerGetComBaseInfoById({comManagerId}) .then( (data) => { console.log("管理层详情", data); const dataSource = {...this.state.dataSource} this.setState({dataSource: {...dataSource, ...data.data,}}); } ) .catch( (err) => { console.log(err); } ); } //类型查询 publicCommonDictGetDictByCodeTypes = () => { publicCommonDictGetDictByCodeTypes({codeTypes: "nation,idCardType_bak,education,skillLevel"}).then((data) => { console.log("类型查询", data); this.setState({codeTypes: data.data}); }, (err) => { console.log(err); }); } /******************************相关事件******************************/ closeDrawer = () => { this.props.closeDrawer(); } /******************************render******************************/ renderOption = (options) => { if (options.length === 0) { return; } return options.map( (val, key) => ( )) } render() { const {visible} = this.props; const {getFieldDecorator} = this.props.form; const { name, positionName, nation, sex, residentProvince, residentCity, residentArea, idCardType, idCardNo, telephone, education, domicileProvince, domicileCity, domicileArea, domicileAddress, jobSkillLevel } = this.state.dataSource; const {codeTypes} = this.state; return (