/** * 详细信息 */ import React, { Component } from 'react'; import { systemPerBaseInfoGetPerBaseInfo, publicCommonDictGetDictByCodeTypes } from '../../../../services/api'; import { Form, Input, Radio, DatePicker, Cascader, Select, Button, Tooltip, InputNumber } from 'antd'; import moment from 'moment'; const FormItem = Form.Item; const { Option } = Select; const RadioGroup = Radio.Group; const { TextArea } = Input; const formItemLayout = { labelCol: { xs: { span: 12 }, sm: { span: 6 } }, wrapperCol: { xs: { span: 12 }, sm: { span: 8 } } }; @Form.create() export default class DetailInfo extends Component { constructor(props) { super(props); this.state = { perId: props.perId, detailInfo: {},//详细信息数据 nationList: [], //国籍下拉选择 educationList: [], //学历下拉选择 bloodList: [], //血型下拉选择 nationMoreList: [], //民族下拉选择 politicalList: [], //政治面貌下拉选择 maritalList: [], //婚姻下拉选择 drivingList: [] //驾照下拉选择 }; } componentDidMount() { this._getDetailInfo(this.state.perId); this._getAllDictInformation(); } componentWillReceiveProps(nextProps) { console.log(nextProps); if (nextProps.perId !== this.state.perId) { this.setState({ perId: nextProps.perId }); this._getDetailInfo(nextProps.perId); } } //获取详细信息数据 _getDetailInfo(perId) { systemPerBaseInfoGetPerBaseInfo({ perId }).then(res => { console.log(res); if (res.retType === '0') { this.setState({ detailInfo: res.data }); } }); } //一次性获取所有字典数据 _getAllDictInformation = () => { publicCommonDictGetDictByCodeTypes({ codeTypes: 'nationality,education,bloodType,nation,politicalStatus,maritalStatus,drivingLicenseLevel' }).then( data => { console.log(data); //判断获取数据是否为空 if (data.data) { this.setState({ nationList: data.data.nationality, //国籍下拉选择 educationList: data.data.education, //学历下拉选择 bloodList: data.data.bloodType, //血型下拉选择 nationMoreList: data.data.nation, //民族下拉选择 politicalList: data.data.politicalStatus, //政治面貌下拉选择 maritalList: data.data.maritalStatus, //婚姻下拉选择 drivingList: data.data.drivingLicenseLevel //驾照下拉选择 }); } }, err => { console.log(err); } ); }; render() { const { getFieldDecorator } = this.props.form; return (