/* * *@params personApplyId *@params onClose */ import React, { Component } from 'react'; import { connect } from 'dva'; import axios from 'axios'; import moment from 'moment'; import { Button, Drawer, Form, Input, Row, Col, Select, notification } from 'antd'; import PSelect from '../../../../components/Pro/PSelect'; import { trainGradeApplyInfo } from '../../../../services/bkt/apis'; import { // enterpriseComContractGetComContractById, systemPerCerBaseInfoFind, publicCommonFileFilePreview } from '../../../../services/api'; import PFromUpload from '../../../../components/Pro/PFromUpload'; import InternshipRecord from './InternshipRecord'; import { $getFormItems } from '../AddCertificate/ImageFormItem'; const { TextArea } = Input; const { Option } = Select; const formItemLayout = { labelCol: { xs: { span: 24 }, sm: { span: 7 } }, wrapperCol: { xs: { span: 24 }, sm: { span: 20 }, md: { span: 16 } } }; const formItemLayout1 = { labelCol: { span: 24 }, wrapperCol: { span: 24 } }; @connect(state => ({ companyInfo: state.global.companyInfo })) @Form.create() export default class SubDrawer extends Component { constructor(props) { super(props); this.state = { comName: this.props.companyInfo.comName, info: null, //申报详情 // contracInfo: {}, //合同详情 certInfo: {}, //证书详情 imgs: [], recordShow: false //实习记录的显示 }; } componentWillMount() { // this.__getDistrict(); } componentDidMount() { } componentWillReceiveProps(nextProps) { if (!!nextProps.personApplyId) { this.__getDetailInfo(nextProps.personApplyId); } } __getDetailInfo = (personApplyId) => { trainGradeApplyInfo({ data: { personApplyId } }).then(res => { this.setState({ info: res.data }); if (res.data) { const { comContractId, perCerId, personType } = res.data; // 获取合同信息 // if (!!comContractId) { // enterpriseComContractGetComContractById({ comContractId }).then(result => { // if (result.data) { // if(typeof result.data.effectStartDate == 'string') { // result.data.effectStartDate = result.data.effectStartDate.split(' ')[0]; // }else { // result.data.effectStartDate = ''; // } // if(typeof result.data.effectEndDate == 'string') { // result.data.effectEndDate = result.data.effectEndDate.split(' ')[0]; // }else { // result.data.effectEndDate = ''; // } // this.setState({ // contracInfo: result.data // }); // } // }); // } // 获取证书信息 if (!!perCerId) { systemPerCerBaseInfoFind({ perCerId }).then(certRes => { if (certRes.data) { this.setState({ certInfo: certRes.data }); } }); } // 重组图像文件(传入人员类型得到对应的图片数组) // const imgArr = $getFormItems(personType); // const avatar = { // label: '两寸蓝底彩照', // fieldsName: 'avatar', // rules: [{ // required: true, // message: `两寸蓝底彩照` // }] // }; // imgArr.unshift(avatar); const imgArr =[ { label: '两寸蓝底彩照', fieldsName: 'avatar', rules: [{ required: true, message: `两寸蓝底彩照` }] }, { label: '身份证人像面', fieldsName: 'idCardNoFrontUrl', rules: [{ required: true, message: `请上传身份证人像面` }] },{ label: '身份证国徽面', fieldsName: 'idCardNoBackUrl', rules: [{ required: true, message: `请上传身份证国徽面` }] } ] const rows = []; const length = Math.ceil(imgArr.length / 3); for (let i = 0; i < length; i++) { rows.push([ imgArr[i * 3], imgArr[i * 3 + 1], imgArr[i * 3 + 2] //有可能是undefined ]); } this.setState({ imgs: rows }); } }); } render() { const { getFieldDecorator } = this.props.form; const { info, certInfo } = this.state; return ( {info &&
{ info.materialApproveStatus == '2' &&

材料核对不通过原因: {info.materialApproveFailReason}

} { info.approveStatus == '2' &&

审核不通过原因: {info.approveFailReason}

}
} {/* form表单 */} { info &&
{getFieldDecorator('applyStatus', { initialValue: info.applyStatus })()} {getFieldDecorator('isMakeUp', { initialValue: info.isMakeUp||'0' })()} {getFieldDecorator('fullname', { initialValue: info.fullname })()} {getFieldDecorator('identitynumber', { initialValue: info.identitynumber })()} {getFieldDecorator('residentType', { initialValue: info.residentType })()} {getFieldDecorator('residentPlaceType', { initialValue: info.residentPlaceType })()} {getFieldDecorator('householdAddress', { initialValue: info.householdAddress })(