import PDrawer from '../../../components/Pro/PDrawer';
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 {enterpriseCompanyComBaseInfoGetComBaseInfoById, publicCommonDictGetDictByCodeTypes} from '../../../services/api';
const FormItem = Form.Item;
const RadioGroup = Radio.Group;
const { TextArea } = Input;
@Form.create()
export default class DrawChildCompanyBasic extends React.Component {
constructor(props, context) {
super(props, context);
this.state = {
dataSource: {
comName: "",//公司名称
telePhone: "",//联系电话
fax: "",//传真
regProvince: 0,//注册所在省
regCity: 0,//注册所在市
regArea: 0,//注册所在区
regAddress: "",//注册所在详细地址
comType: "",//公司性质
economicType: "",//经济类型
industryType: "",//行业类型
institutionType: "",//机构类型
isBranchCom: "",//是否分公司
parentComCerNo: "",//总公司证件扫描件
parentComName: "",//总公司名称
parentComRep: "",//总公司法人
parentComTel: "",//总公司联系电话
},
codeTypes: {
economicType: [],//经济类型
industryType: [],//行业类型
institutionType: [],//机构类型
comType: [],//公司性质
},
}
}
/******************************生命周期******************************/
componentDidMount = () => {
this.publicCommonDictGetDictByCodeTypes();
}
componentWillReceiveProps = (nextProps, newState) => {
if (nextProps.visible && !this.props.visible && !!nextProps.comId) {
this.ajaxDetail(nextProps.comId);
}
}
/******************************ajax请求******************************/
ajaxDetail = (comBranchId) => {
enterpriseCompanyComBaseInfoGetComBaseInfoById({comBranchId})
.then(
(data) => {
console.log("子公司基础信息", data);
const dataSource = this.state.dataSource;
this.setState({dataSource: {...dataSource, ...data.data}});
}
)
.catch(
(err) => {
console.log(err);
}
);
}
//类型查询
publicCommonDictGetDictByCodeTypes = () => {
publicCommonDictGetDictByCodeTypes({codeTypes: "economicType,industryType,institutionType,comType"}).then(({data = {}}) => {
this.setState({codeTypes: data});
});
}
/******************************相关事件******************************/
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 {
comName,
telePhone,
fax,
regProvince,
regCity,
regArea,
regAddress,
economicType,
industryType,
institutionType,
comType,
isBranchCom,
parentComCerNo,
parentComName,
parentComRep,
parentComTel
} = this.state.dataSource;
const {codeTypes} = this.state;
return (
);
}
}