import React from 'react'; import { Icon, Form, Button, Input, Spin, message, InputNumber, DatePicker, Select, Checkbox, Cascader, Table, Radio } from 'antd'; import './techProduct.less'; import { provinceSelect } from '../../../../tools'; import { industryList, scaleList, companyType } from '../../../../dataDic'; import { techFieldList } from '../../../../DicTechFieldList'; import ajax from 'jquery/src/ajax/xhr.js'; import $ from 'jquery/src/ajax'; const CompanyDetail = Form.create()(React.createClass({ loadData() { this.setState({ loading: true }); $.ajax({ method: "post", dataType: "json", crossDomain: false, url: globalConfig.context + "/api/user/cognizance/cognizanceDetail", data: { } }).done(function (data) { if (!data.data) { if (data.error && data.error.length) { message.warning(data.error[0].message); }; return; }; }.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 { record.type = e; this.setState({ humanTableData: this.state.humanTableData }); }}> 中国公民 外籍公民 } }, { title: '姓名', dataIndex: 'name', key: 'name', render: (text, record, index) => { return { record.name = e.target.value; this.setState({ humanTableData: this.state.humanTableData }); }} /> } }, { title: '身份证(护照)号', dataIndex: 'IdNumber', key: 'IdNumber', render: (text, record, index) => { return { record.IdNumber = e.target.value; this.setState({ humanTableData: this.state.humanTableData }); }} /> } }, { title: '投资额(万元)', dataIndex: 'money', key: 'money', render: (text, record, index) => { return { record.money = e.target.value; this.setState({ humanTableData: this.state.humanTableData }); }} /> } } ], legalColumns: [ { title: '法人类型', dataIndex: 'type', key: 'type', width: '130px', render: (text, record, index) => { return { record.type = e; this.setState({ legalTableData: this.state.legalTableData }); }}> 中国企业法人 外观企业法人 } }, { title: '名称', dataIndex: 'name', key: 'name', render: (text, record, index) => { return { record.name = e.target.value; this.setState({ legalTableData: this.state.legalTableData }); }} /> } }, { title: '组织机构代码或统一社会信用代码', dataIndex: 'IdNumber', key: 'IdNumber', render: (text, record, index) => { return { record.IdNumber = e.target.value; this.setState({ legalTableData: this.state.legalTableData }); }} /> } }, { title: '投资额(万元)', dataIndex: 'money', key: 'money', render: (text, record, index) => { return { record.money = e.target.value; this.setState({ legalTableData: this.state.legalTableData }); }} /> } } ], humanSelectedRowKeys: [], humanSelectedRows: [], legalSelectedRowKeys: [], legalSelectedRows: [] }; }, handleSubmit(e) { e.preventDefault(); this.props.form.validateFields((err, values) => { if (!err) { this.props.spinState(true); $.ajax({ method: "POST", dataType: "json", crossDomain: false, url: globalConfig.context + "/api/admin/disposeRatepay", data: { } }).done(function (data) { if (!data.error.length) { message.success('保存成功!'); } else { message.warning(data.error[0].message); } }.bind(this)); } }); }, componentWillMount() { let _me = this; industryList.map(function (item) { _me.state.industryOption.push( {item.key} ) }); scaleList.map(function (item) { _me.state.scaleOption.push( {item.key} ) }); this.loadData(); }, componentWillReceiveProps(nextProps) { }, 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/permission/delete', method: 'post', data: { data: JSON.stringify(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, name: '', IdNumber: '', money: 0 }); this.setState({ humanTableData: this.state.humanTableData }) }, humanSave() { this.setState({ loading: true }); $.ajax({ url: globalConfig.context + '/api/permission', method: 'post', data: { data: JSON.stringify(this.state.data) } }).done((res) => { if (!res.error.length) { Message.success("保存成功"); this.loadData(); } 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/permission/delete', method: 'post', data: { data: JSON.stringify(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, name: '', IdNumber: '', money: 0 }); this.setState({ legalTableData: this.state.legalTableData }) }, legalSave() { this.setState({ loading: true }); $.ajax({ url: globalConfig.context + '/api/permission', method: 'post', data: { data: JSON.stringify(this.state.data) } }).done((res) => { if (!res.error.length) { Message.success("保存成功"); this.loadData(); } 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.props.data; const theData = {}; const formItemLayout = { labelCol: { span: 8 }, wrapperCol: { span: 16 }, }; const humanRowSelection = { type: 'checkbox', selectedRowKeys: this.state.humanSelectedRowKeys, onChange: (selectedRowKeys, selectedRows) => { this.setState({ humanSelectedRows: humanSelectedRows, humanSelectedRowKeys: humanSelectedRowKeys }); } }; const humanHasSelected = this.state.humanSelectedRowKeys.length > 0; const legalRowSelection = { type: 'checkbox', selectedRowKeys: this.state.legalSelectedRowKeys, onChange: (selectedRowKeys, selectedRows) => { this.setState({ legalSelectedRows: legalSelectedRows, legalSelectedRowKeys: legalSelectedRowKeys }); } }; const legalHasSelected = this.state.legalSelectedRowKeys.length > 0; return ( 企业基本信息 {getFieldDecorator('operatingProfit', { rules: [{ required: true, message: '此项为必填项!' }], initialValue: theData.operatingProfit })( )} {getFieldDecorator('operatingProfit', { rules: [{ type: 'array', required: true, message: '此项为必填项!' }], initialValue: theData.operatingProfit })( )} {getFieldDecorator('operatingProfit', { rules: [{ required: true, message: '此项为必填项!' }], initialValue: theData.operatingProfit })( )} {getFieldDecorator('operatingProfit', { rules: [{ required: true, message: '此项为必填项!' }], initialValue: theData.operatingProfit })( )} 联系人信息 {getFieldDecorator('operatingIncome', { rules: [{ required: true, message: '此项为必填项!' }], initialValue: theData.operatingIncome })( )} {getFieldDecorator('managementCost', { rules: [{ required: true, message: '此项为必填项!' }], initialValue: theData.managementCost })( )} {getFieldDecorator('operatingProfit', { rules: [{ required: true, message: '此项为必填项!' }], initialValue: theData.operatingProfit })( )} {getFieldDecorator('operatingProfit', { rules: [{ required: true, message: '此项为必填项!' }], initialValue: theData.operatingProfit })( )} 企业法人信息 {getFieldDecorator('operatingProfit', { rules: [{ required: true, message: '此项为必填项!' }], initialValue: theData.operatingProfit })( )} {getFieldDecorator('operatingProfit', { rules: [{ required: true, message: '此项为必填项!' }], initialValue: theData.operatingProfit })( )} {getFieldDecorator('operatingProfit', { rules: [{ required: true, message: '此项为必填项!' }], initialValue: theData.operatingProfit })( )} 企业重要信息 {getFieldDecorator('operatingIncome', { rules: [{ required: true, message: '此项为必填项!' }], initialValue: theData.operatingIncome })( )} 万元 {getFieldDecorator('managementCost', { rules: [{ type: 'object', required: true, message: '此项为必填项!' }], initialValue: theData.managementCost })( )} {getFieldDecorator('operatingProfit', { rules: [{ required: true, message: '此项为必填项!' }], initialValue: theData.operatingProfit })( )} {getFieldDecorator('operatingProfit', { rules: [{ required: true, message: '此项为必填项!' }], initialValue: theData.operatingProfit })( )} {getFieldDecorator('operatingProfit', { rules: [{ required: true, message: '此项为必填项!' }], initialValue: theData.operatingProfit })( )} {getFieldDecorator('operatingProfit', { rules: [{ required: true, message: '此项为必填项!' }], initialValue: theData.operatingProfit })( )} {getFieldDecorator('operatingProfit', { rules: [{ required: true, message: '此项为必填项!' }], initialValue: theData.operatingProfit })( {this.state.industryOption} )} {getFieldDecorator('operatingProfit', { rules: [{ required: true, message: '此项为必填项!' }], initialValue: theData.operatingProfit })( {this.state.scaleOption} )} {getFieldDecorator('operatingProfit', { rules: [{ type: 'array', required: true, message: '此项为必填项!' }], initialValue: theData.operatingProfit })( )} {getFieldDecorator('operatingProfit', { rules: [{ required: true, message: '此项为必填项!' }], initialValue: theData.operatingProfit })( )} {getFieldDecorator('operatingProfit', { rules: [{ required: true, message: '此项为必填项!' }], initialValue: theData.operatingProfit })( )} {getFieldDecorator('operatingProfit', { rules: [{ required: true, message: '此项为必填项!' }], initialValue: theData.operatingProfit })( 国税 地税 )} {getFieldDecorator('operatingProfit', { rules: [{ required: true, message: '此项为必填项!' }], initialValue: theData.operatingProfit })( 查账征收 核定征收 )} {getFieldDecorator('listed', { initialValue: this.state.listed || "0" })( 否 是 )} {getFieldDecorator('listedDate', { initialValue: this.state.listedDate ? moment(this.state.listedDate) : null })( )} {getFieldDecorator('listedType', { initialValue: this.state.listedType })( 股票型上市公司 债券型上市公司 )} {getFieldDecorator('stockCode', { initialValue: this.state.stockCode })( )} {getFieldDecorator('highTechZone', { initialValue: this.state.highTechZone || "0" })( 否 是 )} {getFieldDecorator('zoneName', { initialValue: this.state.listed || "0" })( )} 股权结构 自然人股权 添加 删除 保存修改 法人股权 添加 删除 保存修改 {getFieldDecorator('operatingProfit', { rules: [{ required: true, message: '此项为必填项!' }], initialValue: theData.operatingProfit })( 是 否 )} {getFieldDecorator('operatingProfit', { rules: [{ required: true, message: '此项为必填项!' }], initialValue: theData.operatingProfit })( )} 员工情况 {getFieldDecorator('firmTotal', { initialValue: theData.firmTotal || 0 })( )} {getFieldDecorator('techTotal', { initialValue: theData.techTotal || 0 })( )} 其中科技人员占比 {(() => { 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) })()} % 保存 取消 ); }, })); export default CompanyDetail;
联系人信息
企业法人信息