| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983 | import React from 'react';import { Icon, Form, Button, Input, Spin, message, InputNumber, DatePicker, Select, Checkbox, Cascader, Table, Radio } from 'antd';import './techProduct.less';import { areaSelect } from '../../../../NewDicProvinceList';import { industryList, scaleList, companyType } from '../../../../dataDic';import { techFieldList } from '../../../../DicTechFieldList';import moment from 'moment';import ajax from 'jquery/src/ajax/xhr.js';import $ from 'jquery/src/ajax';const CompanyDetail = Form.create()(React.createClass({    loadInfoData(uid) {        this.setState({            loading: true        });        $.ajax({            method: "get",            dataType: "json",            crossDomain: false,            url: globalConfig.context + "/api/admin/basic/info",            data: {                uid: uid || this.props.data.uid            }        }).done(function (data) {            let thisdata = data.data;            if (!data.data) {                if (data.error && data.error.length) {                    message.warning(data.error[0].message);                };                return;            };            this.setState({                data: thisdata,                id: thisdata.id,                uid: thisdata.uid,                hid: thisdata.hid,                unitName: thisdata.unitName,                postalAddress: thisdata.postalAddress,                postcode: thisdata.postcode,                firstContacts: thisdata.firstContacts,                firstMobile: thisdata.firstMobile,                contactsFixedTel: thisdata.contactsFixedTel,                contactsFax: thisdata.contactsFax,                legalPersonTel: thisdata.legalPersonTel,                legalPersonFax: thisdata.legalPersonFax,                legalPersonEmail: thisdata.legalPersonEmail,                registeredCapital: thisdata.registeredCapital,                registrationTime: thisdata.registrationTime,                legalPerson: thisdata.legalPerson,                legalPersonIdCard: thisdata.legalPersonIdCard,                orgCode: thisdata.orgCode,                ratepayCode: thisdata.ratepayCode,                industry: thisdata.industry,                enterpriseScale: thisdata.enterpriseScale,                foreignInvestment: thisdata.foreignInvestment,                taxAuthority: thisdata.taxAuthority,                ratepayMethod: thisdata.ratepayMethod,                listed: thisdata.listed,                listedDate: thisdata.listedDate,                listedType: thisdata.listedType,                stockCode: thisdata.stockCode,                highTechZone: thisdata.highTechZone,                highTechName: thisdata.highTechName,                riskInvestment: thisdata.riskInvestment,                businessScope: thisdata.businessScope,                firmTotal: thisdata.firmTotal,                techTotal: thisdata.techTotal,                listedDateFormattedDate: thisdata.listedDateFormattedDate,                registrationTimeFormattedDate: thisdata.registrationTimeFormattedDate,                address: [thisdata.licenceProvince, thisdata.licenceCity, thisdata.licenceArea],                field: thisdata.field ? thisdata.field.split(',') : [],                registerType: thisdata.registerType ? thisdata.registerType.split(',') : []            });        }.bind(this)).always(function () {            this.setState({                loading: false            });        }.bind(this));    },    loadHumanData(uid) {        this.setState({            loading: true        });        $.ajax({            method: "get",            dataType: "json",            crossDomain: false,            url: globalConfig.context + "/api/admin/basic/listNature",            data: {                uid: uid || this.props.data.uid            }        }).done(function (data) {            let theTableData = [];            if (!data.data) {                if (data.error && data.error.length) {                    message.warning(data.error[0].message);                };                return;            };            data.data.map(function (item) {                theTableData.push({                    id: item.id,                    uid: item.uid,                    type: item.type,                    name: item.name,                    idNumber: item.idNumber,                    investment: item.investment                });            });            this.setState({                humanTableData: theTableData            });        }.bind(this)).always(function () {            this.setState({                loading: false            });        }.bind(this));    },    loadLegalData(uid) {        this.setState({            loading: true        });        $.ajax({            method: "get",            dataType: "json",            crossDomain: false,            url: globalConfig.context + "/api/admin/basic/listLegalPerson",            data: {                uid: uid || this.props.data.uid            }        }).done(function (data) {            let theTableData = [];            if (!data.data) {                if (data.error && data.error.length) {                    message.warning(data.error[0].message);                };                return;            };            data.data.map(function (item) {                theTableData.push({                    id: item.id,                    uid: item.uid,                    type: item.type,                    name: item.name,                    orgCode: item.idNumber,                    investment: item.investment                });            });            this.setState({                legalTableData: theTableData            });        }.bind(this)).always(function () {            this.setState({                loading: false            });        }.bind(this));    },    getInitialState() {        return {            loading: false,            industryOption: [],            scaleOption: [],            humanTableData: [],            legalTableData: [],            humanColumns: [                {                    title: '公民类型',                    dataIndex: 'type',                    key: 'type',                    width: '130px',                    render: (text, record, index) => {                        return <Select value={record.type} onChange={(e) => { record.type = e; this.setState({ humanTableData: this.state.humanTableData }); }}>                            <Select.Option value="0">中国公民</Select.Option>                            <Select.Option value="1">外籍公民</Select.Option>                        </Select>                    }                }, {                    title: '姓名',                    dataIndex: 'name',                    key: 'name',                    render: (text, record, index) => {                        return <Input value={record.name} onChange={(e) => { record.name = e.target.value; this.setState({ humanTableData: this.state.humanTableData }); }} />                    }                }, {                    title: '身份证(护照)号',                    dataIndex: 'idNumber',                    key: 'idNumber',                    render: (text, record, index) => {                        return <Input value={record.idNumber} onChange={(e) => { record.idNumber = e.target.value; this.setState({ humanTableData: this.state.humanTableData }); }} />                    }                }, {                    title: '投资额(万元)',                    dataIndex: 'investment',                    key: 'investment',                    render: (text, record, index) => {                        return <InputNumber value={record.investment} onChange={(e) => { record.investment = e; this.setState({ humanTableData: this.state.humanTableData }); }} />                    }                }            ],            legalColumns: [                {                    title: '法人类型',                    dataIndex: 'type',                    key: 'type',                    width: '130px',                    render: (text, record, index) => {                        return <Select value={record.type} onChange={(e) => { record.type = e; this.setState({ legalTableData: this.state.legalTableData }); }}>                            <Select.Option value="0">中国企业法人</Select.Option>                            <Select.Option value="1">外籍企业法人</Select.Option>                        </Select>                    }                }, {                    title: '名称',                    dataIndex: 'name',                    key: 'name',                    render: (text, record, index) => {                        return <Input value={record.name} onChange={(e) => { record.name = e.target.value; this.setState({ legalTableData: this.state.legalTableData }); }} />                    }                }, {                    title: '组织机构代码或统一社会信用代码',                    dataIndex: 'orgCode',                    key: 'orgCode',                    render: (text, record, index) => {                        return <Input value={record.orgCode} onChange={(e) => { record.orgCode = e.target.value; this.setState({ legalTableData: this.state.legalTableData }); }} />                    }                }, {                    title: '投资额(万元)',                    dataIndex: 'investment',                    key: 'investment',                    render: (text, record, index) => {                        return <InputNumber value={record.investment} onChange={(e) => { record.investment = e; this.setState({ legalTableData: this.state.legalTableData }); }} />                    }                }            ],            humanSelectedRowKeys: [],            humanSelectedRows: [],            legalSelectedRowKeys: [],            legalSelectedRows: []        };    },    handleSubmit(e) {        this.setState({            loading: true        });        e.preventDefault();        this.props.form.validateFields((err, values) => {            if (!err) {                $.ajax({                    method: "POST",                    dataType: "json",                    crossDomain: false,                    url: globalConfig.context + "/api/admin/basic/disposeInfo",                    data: {                        id: this.state.data.id,                        uid: this.props.data.uid || this.state.data.uid,                        hid: this.state.data.hid,                        unitName: values.unitName,                        licenceProvince: values.address[0],                        licenceCity: values.address[1],                        licenceArea: values.address[2],                        postalAddress: values.postalAddress,                        postcode: values.postcode,                        firstContacts: values.firstContacts,                        firstMobile: values.firstMobile,                        contactsFixedTel: values.contactsFixedTel,                        contactsFax: values.contactsFax,                        legalPersonTel: values.legalPersonTel,                        legalPersonFax: values.legalPersonFax,                        legalPersonEmail: values.legalPersonEmail,                        registeredCapital: values.registeredCapital,                        legalPerson: values.legalPerson,                        legalPersonIdCard: values.legalPersonIdCard,                        orgCode: values.orgCode,                        ratepayCode: values.ratepayCode,                        industry: values.industry,                        enterpriseScale: values.enterpriseScale,                        registerType: values.registerType ? values.registerType.join(',') : '',                        foreignInvestment: values.foreignInvestment,                        field: values.field ? values.field.join(',') : '',                        taxAuthority: values.taxAuthority,                        ratepayMethod: values.ratepayMethod,                        listed: values.listed,                        listedType: values.listedType ? Number(values.listedType) : null,                        stockCode: values.stockCode,                        highTechZone: values.highTechZone,                        highTechName: values.highTechName,                        riskInvestment: values.riskInvestment,                        businessScope: values.businessScope,                        firmTotal: values.firmTotal,                        techTotal: values.techTotal,                        listedDateFormattedDate: values.listedDate ? values.listedDate.format("YYYY-MM-DD") : '',                        registrationTimeFormattedDate: values.registrationTime ? values.registrationTime.format("YYYY-MM-DD") : ''                    }                }).done(function (data) {                    if (!data.error.length) {                        message.success('保存成功!');                        this.loadInfoData();                    } else {                        message.warning(data.error[0].message);                    };                    this.setState({                        loading: false                    });                }.bind(this));            }        });    },    componentWillMount() {        let _me = this;        industryList.map(function (item) {            _me.state.industryOption.push(                <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>            )        });        scaleList.map(function (item) {            _me.state.scaleOption.push(                <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>            )        });        this.loadHumanData();        this.loadLegalData();        this.loadInfoData();    },    componentWillReceiveProps(nextProps) {        if (this.props.data.uid !== nextProps.data.uid) {            this.loadHumanData(nextProps.data.uid);            this.loadLegalData(nextProps.data.uid);            this.loadInfoData(nextProps.data.uid);        };    },    humanRemove() {        let deletedIds = [];        for (let idx = 0; idx < this.state.humanSelectedRows.length; idx++) {            let rowItem = this.state.humanSelectedRows[idx];            if (rowItem.id) {                deletedIds.push(rowItem.id)            }        };        this.setState({            loading: deletedIds.length > 0        });        if (deletedIds.length) {            $.ajax({                url: globalConfig.context + '/api/admin/basic/deleteNature',                method: 'post',                data: {                    ids: deletedIds                }            }).done((res) => {                if (!res.error.length) {                    message.success("删除成功");                    this.state.humanSelectedRowKeys.sort((a, b) => { return b - a });                    for (let idx = 0; idx < this.state.humanSelectedRowKeys.length; idx++) {                        let dataIndex = this.state.humanSelectedRowKeys[idx];                        this.state.humanTableData.splice(dataIndex, 1);                    };                    this.setState({                        humanTableData: this.state.humanTableData,                        humanSelectedRowKeys: []                    });                } else {                    message.error(res.error[0].message);                }            }).always(() => {                this.setState({                    loading: false                });            })        }    },    humanAdd() {        this.state.humanTableData.push({            id: null,            type: null,            uid: this.state.uid,            name: '',            idNumber: '',            investment: 0        });        this.setState({            humanTableData: this.state.humanTableData        })    },    humanSave() {        this.setState({            loading: true        });        $.ajax({            url: globalConfig.context + '/api/admin/basic/nature',            method: 'post',            data: {                data: JSON.stringify(this.state.humanTableData)            }        }).done((res) => {            if (!res.error.length) {                message.success("保存成功");            } else {                message.error(res.error[0].message);            }        }).always(() => {            this.setState({                loading: false            });        })    },    legalRemove() {        let deletedIds = [];        for (let idx = 0; idx < this.state.legalSelectedRows.length; idx++) {            let rowItem = this.state.legalSelectedRows[idx];            if (rowItem.id) {                deletedIds.push(rowItem.id)            }        };        this.setState({            loading: deletedIds.length > 0        });        if (deletedIds.length) {            $.ajax({                url: globalConfig.context + '/api/admin/basic/deleteLegalPerson',                method: 'post',                data: {                    ids: deletedIds                }            }).done((res) => {                if (!res.error.length) {                    message.success("删除成功");                    this.state.legalSelectedRowKeys.sort((a, b) => { return b - a });                    for (let idx = 0; idx < this.state.legalSelectedRowKeys.length; idx++) {                        let dataIndex = this.state.legalSelectedRowKeys[idx];                        this.state.legalTableData.splice(dataIndex, 1);                    };                    this.setState({                        legalTableData: this.state.legalTableData,                        legalSelectedRowKeys: []                    });                } else {                    message.error(res.error[0].message);                }            }).always(() => {                this.setState({                    loading: false                });            })        }    },    legalAdd() {        this.state.legalTableData.push({            id: null,            type: null,            uid: this.state.uid,            name: '',            idNumber: '',            investment: 0        });        this.setState({            legalTableData: this.state.legalTableData        })    },    legalSave() {        this.setState({            loading: true        });        $.ajax({            url: globalConfig.context + '/api/admin/basic/legalPerson',            method: 'post',            data: {                data: JSON.stringify(this.state.legalTableData)            }        }).done((res) => {            if (!res.error.length) {                message.success("保存成功");            } else {                message.error(res.error[0].message);            }        }).always(() => {            this.setState({                loading: false            });        })    },    render() {        const FormItem = Form.Item;        const { getFieldDecorator } = this.props.form;        const theData = this.state;        const formItemLayout = {            labelCol: { span: 8 },            wrapperCol: { span: 16 },        };        const humanRowSelection = {            type: 'checkbox',            selectedRowKeys: this.state.humanSelectedRowKeys,            onChange: (selectedRowKeys, selectedRows) => {                this.setState({                    humanSelectedRows: selectedRows,                    humanSelectedRowKeys: selectedRowKeys                });            }        };        const humanHasSelected = this.state.humanSelectedRowKeys.length > 0;        const legalRowSelection = {            type: 'checkbox',            selectedRowKeys: this.state.legalSelectedRowKeys,            onChange: (selectedRowKeys, selectedRows) => {                this.setState({                    legalSelectedRows: selectedRows,                    legalSelectedRowKeys: selectedRowKeys                });            }        };        const legalHasSelected = this.state.legalSelectedRowKeys.length > 0;        if (this.state.data) {            return (                <Form onSubmit={this.handleSubmit} className="company-detail-form">                    <div className="content-title">                        <span>企业基本信息</span>                    </div>                    <div className="clearfix">                        <FormItem className="half-item"                            {...formItemLayout}                            label="企业名称"                        >                            {getFieldDecorator('unitName', {                                rules: [{ required: true, message: '此项为必填项!' }],                                initialValue: theData.unitName                            })(                                <Input />                                )}                        </FormItem>                        <FormItem className="half-item"                            {...formItemLayout}                            label="行政区域"                        >                            {getFieldDecorator('address', {                                rules: [{ type: 'array', required: true, message: '此项为必填项!' }],                                initialValue: theData.address                            })(                                <Cascader options={areaSelect()} />                                )}                        </FormItem>                        <FormItem className="half-item"                            {...formItemLayout}                            label="通信地址"                        >                            {getFieldDecorator('postalAddress', {                                rules: [{ required: true, message: '此项为必填项!' }],                                initialValue: theData.postalAddress                            })(                                <Input />                                )}                        </FormItem>                        <FormItem className="half-item"                            {...formItemLayout}                            label="邮编"                        >                            {getFieldDecorator('postcode', {                                rules: [{ required: true, message: '此项为必填项!' }],                                initialValue: theData.postcode                            })(                                <Input />                                )}                        </FormItem>                    </div>                    <div className="clearfix">                        <p className="content-title">联系人信息</p>                        <FormItem className="half-item"                            {...formItemLayout}                            label="姓名"                        >                            {getFieldDecorator('firstContacts', {                                rules: [{ required: true, message: '此项为必填项!' }],                                initialValue: theData.firstContacts                            })(                                <Input />                                )}                        </FormItem>                        <FormItem className="half-item"                            {...formItemLayout}                            label="手机"                        >                            {getFieldDecorator('firstMobile', {                                rules: [{ required: true, message: '此项为必填项!' }],                                initialValue: theData.firstMobile                            })(                                <Input />                                )}                        </FormItem>                        <FormItem className="half-item"                            {...formItemLayout}                            label="电话"                        >                            {getFieldDecorator('contactsFixedTel', {                                rules: [{ required: true, message: '此项为必填项!' }],                                initialValue: theData.contactsFixedTel                            })(                                <Input />                                )}                        </FormItem>                        <FormItem className="half-item"                            {...formItemLayout}                            label="传真"                        >                            {getFieldDecorator('contactsFax', {                                rules: [{ required: true, message: '此项为必填项!' }],                                initialValue: theData.contactsFax                            })(                                <Input />                                )}                        </FormItem>                    </div>                    <div className="clearfix">                        <p className="content-title">企业法人信息</p>                        <FormItem className="half-item"                            {...formItemLayout}                            label="电话"                        >                            {getFieldDecorator('legalPersonTel', {                                rules: [{ required: true, message: '此项为必填项!' }],                                initialValue: theData.legalPersonTel                            })(                                <Input />                                )}                        </FormItem>                        <FormItem className="half-item"                            {...formItemLayout}                            label="传真"                        >                            {getFieldDecorator('legalPersonFax', {                                rules: [{ required: true, message: '此项为必填项!' }],                                initialValue: theData.legalPersonFax                            })(                                <Input />                                )}                        </FormItem>                        <FormItem className="half-item"                            {...formItemLayout}                            label="E-mail"                        >                            {getFieldDecorator('legalPersonEmail', {                                rules: [{ required: true, message: '此项为必填项!' }],                                initialValue: theData.legalPersonEmail                            })(                                <Input />                                )}                        </FormItem>                    </div>                    <div className="content-title">                        <span>企业重要信息</span>                    </div>                    <div className="clearfix">                        <FormItem className="half-item"                            {...formItemLayout}                            label="注册资金"                        >                            {getFieldDecorator('registeredCapital', {                                rules: [{ type: 'number', required: true, message: '此项为必填项!' }],                                initialValue: theData.registeredCapital                            })(                                <InputNumber min={0} max={9999} step={0.01} />                                )}                            <span>万元</span>                        </FormItem>                        <FormItem className="half-item"                            {...formItemLayout}                            label="注册时间"                        >                            {getFieldDecorator('registrationTime', {                                rules: [{ type: 'object', required: true, message: '此项为必填项!' }],                                initialValue: theData.registrationTime ? moment(theData.registrationTime) : null                            })(                                <DatePicker />                                )}                        </FormItem>                        <FormItem className="half-item"                            {...formItemLayout}                            label="法人代表姓名"                        >                            {getFieldDecorator('legalPerson', {                                rules: [{ required: true, message: '此项为必填项!' }],                                initialValue: theData.legalPerson                            })(                                <Input />                                )}                        </FormItem>                        <FormItem className="half-item"                            {...formItemLayout}                            label="身份证号"                        >                            {getFieldDecorator('legalPersonIdCard', {                                rules: [{ required: true, message: '此项为必填项!' }],                                initialValue: theData.legalPersonIdCard                            })(                                <Input />                                )}                        </FormItem>                        <FormItem className="half-item"                            {...formItemLayout}                            label="组织机构代码/统一社会信用代码"                        >                            {getFieldDecorator('orgCode', {                                rules: [{ required: true, message: '此项为必填项!' }],                                initialValue: theData.orgCode                            })(                                <Input />                                )}                        </FormItem>                        <FormItem className="half-item"                            {...formItemLayout}                            label="税务登记号/统一社会信用代码"                        >                            {getFieldDecorator('ratepayCode', {                                rules: [{ required: true, message: '此项为必填项!' }],                                initialValue: theData.ratepayCode                            })(                                <Input />                                )}                        </FormItem>                        <FormItem className="half-item"                            {...formItemLayout}                            label="所属行业"                        >                            {getFieldDecorator('industry', {                                rules: [{ required: true, message: '此项为必填项!' }],                                initialValue: theData.industry                            })(                                <Select>{this.state.industryOption}</Select>                                )}                        </FormItem>                        <FormItem className="half-item"                            {...formItemLayout}                            label="企业规模(注册资金)"                        >                            {getFieldDecorator('enterpriseScale', {                                rules: [{ required: true, message: '此项为必填项!' }],                                initialValue: theData.enterpriseScale                            })(                                <Select>{this.state.scaleOption}</Select>                                )}                        </FormItem>                        <FormItem className="half-item"                            {...formItemLayout}                            label="注册类型"                        >                            {getFieldDecorator('registerType', {                                rules: [{ type: 'array', required: true, message: '此项为必填项!' }],                                initialValue: theData.registerType                            })(                                <Cascader options={companyType} />                                )}                        </FormItem>                        <FormItem className="half-item"                            {...formItemLayout}                            label="外资来源地"                        >                            {getFieldDecorator('foreignInvestment', {                                //rules: [{ required: true, message: '此项为必填项!' }],                                initialValue: theData.foreignInvestment                            })(                                <Input />                                )}                        </FormItem>                    </div>                    <div className="clearfix">                        <FormItem className="half-item"                            {...formItemLayout}                            label="领域"                        >                            {getFieldDecorator('field', {                                rules: [{ type: 'array', required: true, message: '此项为必填项!' }],                                initialValue: theData.field                            })(                                <Cascader options={techFieldList} />                                )}                        </FormItem>                    </div>                    <div className="clearfix">                        <FormItem className="half-item"                            {...formItemLayout}                            label="企业所得税主管税务机关"                        >                            {getFieldDecorator('taxAuthority', {                                rules: [{ required: true, message: '此项为必填项!' }],                                initialValue: theData.taxAuthority                            })(                                <Radio.Group>                                    <Radio value="0">国税</Radio>                                    <Radio value="1">地税</Radio>                                </Radio.Group>                                )}                        </FormItem>                        <FormItem className="half-item"                            {...formItemLayout}                            label="企业所得税征收方式"                        >                            {getFieldDecorator('ratepayMethod', {                                rules: [{ required: true, message: '此项为必填项!' }],                                initialValue: theData.ratepayMethod                            })(                                <Radio.Group>                                    <Radio value="0">查账征收</Radio>                                    <Radio value="1">核定征收</Radio>                                </Radio.Group>                                )}                        </FormItem>                    </div>                    <div className="clearfix">                        <FormItem className="half-item"                            {...formItemLayout}                            label="是否上市"                        >   {getFieldDecorator('listed', {                            rules: [{ required: true, message: '此项为必填项!' }],                            initialValue: theData.listed                        })(                            <Radio.Group>                                <Radio value="0">否</Radio>                                <Radio value="1">是</Radio>                            </Radio.Group>                            )}                        </FormItem>                    </div>                    <div className="clearfix" style={{ display: this.props.form.getFieldValue('listed') == 1 ? 'block' : 'none' }}>                        <FormItem className="half-item"                            {...formItemLayout}                            label="上市时间"                        >                            {getFieldDecorator('listedDate', {                                initialValue: theData.listedDate ? moment(theData.listedDate) : null                            })(                                <DatePicker />                                )}                        </FormItem>                        <FormItem className="half-item"                            {...formItemLayout}                            label="上市类型"                        >   {getFieldDecorator('listedType', {                            initialValue: theData.listedType                        })(                            <Select placeholder="请选择上市类型">                                <Select.Option value='0'>股票型上市公司</Select.Option>                                <Select.Option value='1'>债券型上市公司</Select.Option>                            </Select>                            )}                        </FormItem>                        <FormItem className="half-item"                            {...formItemLayout}                            label="股票代码"                        >   {getFieldDecorator('stockCode', {                            initialValue: theData.stockCode                        })(                            <Input />                            )}                        </FormItem>                    </div>                    <div className="clearfix">                        <FormItem className="half-item"                            {...formItemLayout}                            label="是否属于国家级高新区内企业"                        >   {getFieldDecorator('highTechZone', {                            rules: [{ required: true, message: '此项为必填项!' }],                            initialValue: theData.highTechZone                        })(                            <Radio.Group>                                <Radio value="0">否</Radio>                                <Radio value="1">是</Radio>                            </Radio.Group>                            )}                        </FormItem>                    </div>                    <div className="clearfix" style={{ display: this.props.form.getFieldValue('highTechZone') == 1 ? 'block' : 'none' }}>                        <FormItem className="half-item"                            {...formItemLayout}                            label="国家级高新区名称"                        >   {getFieldDecorator('highTechName', {                            initialValue: theData.highTechName                        })(                            <Input />                            )}                        </FormItem>                    </div>                    <div className="content-title">                        <span>股权结构</span>                    </div>                    <div>                        <div className="table-title">                            <span>自然人股权</span>                            <Button style={{ background: "#ea0862", border: "none", color: "#fff" }}                                onClick={this.humanAdd}>添加<Icon type="plus" /></Button>                            <Button style={{ background: "#3fcf9e", border: "none", color: "#fff" }}                                disabled={!humanHasSelected}                                onClick={this.humanRemove}>删除<Icon type="minus" /></Button>                            <Button type="primary" onClick={this.humanSave}>保存修改</Button>                        </div>                        <Table className="company-table" style={{ padding: '10px 20px' }}                            columns={this.state.humanColumns}                            dataSource={this.state.humanTableData}                            pagination={false}                            rowSelection={humanRowSelection} />                    </div>                    <div>                        <div className="table-title">                            <span>法人股权</span>                            <Button style={{ background: "#ea0862", border: "none", color: "#fff" }}                                onClick={this.legalAdd}>添加<Icon type="plus" /></Button>                            <Button style={{ background: "#3fcf9e", border: "none", color: "#fff" }}                                disabled={!legalHasSelected}                                onClick={this.legalRemove}>删除<Icon type="minus" /></Button>                            <Button type="primary" onClick={this.legalSave}>保存修改</Button>                        </div>                        <Table className="company-table" style={{ padding: '10px 20px' }}                            columns={this.state.legalColumns}                            dataSource={this.state.legalTableData}                            pagination={false}                            rowSelection={legalRowSelection} />                    </div>                    <FormItem style={{ width: '50%' }}                        {...formItemLayout}                        label="是否引入风险投资"                    >                        {getFieldDecorator('riskInvestment', {                            rules: [{ required: true, message: '此项为必填项!' }],                            initialValue: theData.riskInvestment                        })(                            <Radio.Group>                                <Radio value="0">否</Radio>                                <Radio value="1">是</Radio>                            </Radio.Group>                            )}                    </FormItem>                    <FormItem style={{ width: '50%' }}                        {...formItemLayout}                        label="经营范围(限400字)"                    >                        {getFieldDecorator('businessScope', {                            rules: [{ required: true, message: '此项为必填项!' }],                            initialValue: theData.businessScope                        })(                            <Input type='textarea' rows={6} />                            )}                    </FormItem>                    <div className="content-title">                        <span>员工情况</span>                    </div>                    <div className="clearfix">                        <FormItem className="half-item" style={{ width: '25%' }}                            {...formItemLayout}                            label="企业职工"                        >                            {getFieldDecorator('firmTotal', {                                initialValue: theData.firmTotal || 0                            })(                                <InputNumber min={0} max={9999} step={0.01} />                                )}                        </FormItem>                        <FormItem className="half-item"                            {...formItemLayout}                            label="科技人员"                        >                            {getFieldDecorator('techTotal', {                                initialValue: theData.techTotal || 0                            })(                                <InputNumber min={0} max={9999} step={0.01} />                                )}                            <span>其中科技人员占比                        {(() => {                                    if (!this.props.form.getFieldValue('techTotal') || !this.props.form.getFieldValue('firmTotal')) {                                        return 0                                    }                                    return (this.props.form.getFieldValue('techTotal') / this.props.form.getFieldValue('firmTotal') * 100).toFixed(2)                                })()}                                %</span>                        </FormItem>                    </div>                    <FormItem style={{ marginTop: '20px' }}>                        <Button className="set-submit" type="primary" htmlType="submit">保存</Button>                    </FormItem>                </Form >            );        } else {            return (<div></div>)        };    }}));export default CompanyDetail;
 |