import React from 'react'; import { Icon, Form, Button, Input, Spin, Table, message, Select, Modal, InputNumber } from 'antd'; import './annualReport.less'; import { annualReportStateList } from '../../dataDic.js'; import { beforeUploadFile, getAnnualReportState } from '../../tools.js'; import { getProvince } from '../../NewDicProvinceList' import moment from 'moment'; import ajax from 'jquery/src/ajax/xhr.js'; import $ from 'jquery/src/ajax'; const AnnualReportDescFrom = Form.create()(React.createClass({ getInitialState() { return { loading: false, data: {}, contactsOption: [], contactsObj: {}, yearOption: [] }; }, loadData(theYear) { this.setState({ loading: true }) $.ajax({ method: "post", dataType: "json", crossDomain: false, url: globalConfig.context + "/api/user/cognizance/annualReportDetail", data: { year: theYear || this.props.data.year } }).done((data) => { let thisdata = data.data; if (!thisdata) { if (data.error && data.error.length) { message.warning(data.error[0].message); }; thisdata = {}; } else { thisdata.location = getProvince(thisdata.locationProvince, thisdata.locationCity, thisdata.locationArea); }; this.setState({ data: thisdata }); }).always(function () { this.setState({ loading: false }) }.bind(this)); }, getContactsOption() { let theOption = [], theObj = {}; $.ajax({ method: "get", dataType: "json", crossDomain: false, url: globalConfig.context + '/api/user/getContacts', success: function (data) { if (!data.data) { if (data.error && data.error.length) { message.warning(data.error[0].message); }; } else { for (let item in data.data) { let theData = data.data[item]; theOption.push( {theData} ); }; theObj = data.data || {}; }; this.setState({ contactsOption: theOption, contactsObj: theObj }); }.bind(this) }); }, componentWillMount() { let d = new Date(); let _me = this; d = d.getFullYear(); for (let i = d; i > d - 20; i--) { _me.state.yearOption.push( {i} ) }; this.getContactsOption(); if (this.props.data) { this.loadData(); }; }, componentWillReceiveProps(nextProps) { if (!this.props.visible && nextProps.visible) { if (nextProps.data) { this.loadData(nextProps.data.year) }; }; }, 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/user/cognizance/disposeAnnualReport", data: { id: this.props.data.id, year: this.props.data.year, totalTax: values.totalTax, incomeTaxRelief: values.incomeTaxRelief, totalExportVolume: values.totalExportVolume, basicResearchCost: values.basicResearchCost, state: 0, } }).done(function (data) { if (!data.error.length) { message.success('保存成功!'); this.props.clickOk(); this.props.spinState(false); this.props.form.resetFields(); } else { message.warning(data.error[0].message); this.props.spinState(false); } }.bind(this)); } }); }, render() { const FormItem = Form.Item; const { getFieldDecorator } = this.props.form; const theData = this.state.data; const formItemLayout = { labelCol: { span: 0 }, wrapperCol: { span: 20 }, }; const _me = this; return (
年份: {this.props.data.year}

企业名称:

{theData.unitName}

组织机构代码或统一社会信用代码:

{theData.orgCode}

所属地区:

{theData.location}

高新技术企业认定证书编号:

{theData.certificateNumber}

高新技术企业认定时间:

{theData.issuingDate}

企业是否上市:

{theData.listed == 1 ? "是" : "否"}

上市时间:

{theData.listedDate}

上市类型:

{(() => { switch (theData.listedType) { case '0': return "股票型上市公司"; case '1': return "债券型上市公司"; default: return ""; } })()}

股票代码:

{theData.stockCode}

企业联系人:

{this.state.contactsObj[theData.contacts]}

本年度获得的知识产权数:

发明专利数:

{theData.inventionPatent}

国防专利数:

{theData.defensePatent}

国家级农作物品种数:

{theData.nationalCrop}

植物新品种数:

{theData.newPlantCariety}

国家新药数:

{theData.nationalDrug}

国家一级中药保护品种数:

{theData.chineseMedicine}

实用新型专利数:

{theData.utilityPatent}

集成电路布图设计专有权数:

{theData.circuitDesign}

外观设计专利数:

{theData.exteriorPatent}

软件著作权数:

{theData.softwareWorks}

本年度人员情况(人):

职工总人数:

{theData.firmTotal}

科技人员数:

{theData.techTotal}

新增就业人数:

{theData.newEmployment}

高校应届毕业生人数:

{theData.graduateNumber}

企业本年度财务状况(万元):

企业总收入:

{theData.totalRevenue}

销售收入:

{theData.salesRevenue}

所有者权益(净资产)合计:

{theData.netAsset}

高新技术产品(服务)收入:

{theData.lastYearRevenue} {(() => { let s = (theData.lastYearRevenue / theData.totalRevenue * 100).toFixed(2); if (!isNaN(s)) { if (s < 50) { return 占比总收入的{s}%,小于60% } else { return 占比总收入的{s}% }; } else { return 占比总收入的0% } })()}

利润总额:

{theData.grossProfit}

研发费用总额:

{theData.researchCost} {(() => { let s = (theData.researchCost / theData.salesRevenue * 100).toFixed(2); if (!isNaN(s)) { if (theData.salesRevenue < 5000) { if (s < 5) { return 占比总收入的{s}%,小于60% } else { return 占比总收入的{s}% }; } else if (5000 < theData.salesRevenue < 20000) { if (s < 4) { return 占比总收入的{s}%,小于60% } else { return 占比总收入的{s}% }; } else if (theData.salesRevenue >= 20000) { if (s < 3) { return 占比总收入的{s}%,小于60% } else { return 占比总收入的{s}% }; } } else { return 占比总收入的0% } })()}

其中:在中国境内研发费用:

{theData.researchCost}

纳税总额:

{getFieldDecorator('totalTax', { rules: [{ type: 'number', required: true, message: '此项为必填项!' }], initialValue: this.props.data.totalTax })( )} 万元

高企所得税减免额:

{getFieldDecorator('incomeTaxRelief', { rules: [{ type: 'number', required: true, message: '此项为必填项!' }], initialValue: this.props.data.incomeTaxRelief })( )} 万元

出口创汇总额(人民币):

{getFieldDecorator('totalExportVolume', { rules: [{ type: 'number', required: true, message: '此项为必填项!' }], initialValue: this.props.data.totalExportVolume })( )} 万元

基础研究投入费用:

{getFieldDecorator('basicResearchCost', { rules: [{ type: 'number', required: true, message: '此项为必填项!' }], initialValue: this.props.data.basicResearchCost })( )} 万元
); }, })); const AnnualReportDesc = React.createClass({ getInitialState() { return { visible: false, loading: false }; }, componentWillReceiveProps(nextProps) { this.state.visible = nextProps.showDesc; }, showModal() { this.setState({ visible: true, }); }, handleOk() { this.setState({ visible: false, }); this.props.closeDesc(false, true); }, handleCancel(e) { this.setState({ visible: false, }); this.props.closeDesc(false); }, render() { return (
); }, }); const AnnualReportAdd = React.createClass({ getInitialState() { return { visible: false, loading: false, yearOption: [] }; }, componentWillReceiveProps(nextProps) { this.state.visible = nextProps.showAdd }, componentWillMount() { let d = new Date(); let _me = this; d = d.getFullYear(); for (let i = d; i > d - 20; i--) { _me.state.yearOption.push( {i} ) }; }, showModal() { this.setState({ visible: true, }); }, handleOk() { this.setState({ loading: true }); if (!this.state.year) { message.warning('请选择年份!'); this.setState({ loading: false }); return; }; $.ajax({ method: "POST", dataType: "json", crossDomain: false, url: globalConfig.context + "/api/user/cognizance/disposeAnnualReport", data: { year: this.state.year, totalTax: this.state.totalTax, incomeTaxRelief: this.state.incomeTaxRelief, totalExportVolume: this.state.totalExportVolume, basicResearchCost: this.state.basicResearchCost, state: 0 } }).done(function (data) { this.setState({ loading: false }); if (!data.error.length) { message.success('保存成功!'); this.setState({ visible: false }); this.props.closeAdd(false, true); } else { message.warning(data.error[0].message); } }.bind(this)); }, handleCancel(e) { this.setState({ visible: false, }); this.props.closeAdd(false); }, spinChange(e) { this.setState({ loading: e }); }, render() { return (
提交 , , ]} >
选择申请年份:
纳税总额: { this.state.totalTax = e; }} /> (万元)
高企所得税减免额: { this.state.incomeTaxRelief = e; }} /> (万元)
出口创汇总额(人民币): { this.state.totalExportVolume = e; }} /> (万元)
基础研究投入费用: { this.state.basicResearchCost = e; }} /> (万元)
); } }); const AnnualReport = React.createClass({ loadData(pageNo) { this.state.data = []; this.setState({ loading: true }); $.ajax({ method: "post", dataType: "json", crossDomain: false, url: globalConfig.context + "/api/user/cognizance/annualReport", data: { pageNo: pageNo || 1, pageSize: this.state.pagination.pageSize, } }).done((data) => { if (!data.data || !data.data.list) { if (data.error.length) { message.warning(data.error[0].message); this.state.ButtonDisabled = true; }; return; }; for (let i = 0; i < data.data.list.length; i++) { let thisdata = data.data.list[i]; this.state.data.push({ key: i, id: thisdata.id, uid: thisdata.uid, createTime: thisdata.createTime, lastUpdateTime: thisdata.lastUpdateTime, totalTax: thisdata.totalTax, incomeTaxRelief: thisdata.incomeTaxRelief, totalExportVolume: thisdata.totalExportVolume, year: thisdata.year, state: thisdata.state, createTimeFormattedDate: thisdata.createTimeFormattedDate, lastUpdateTimeFormattedDate: thisdata.lastUpdateTimeFormattedDate, basicResearchCost: thisdata.basicResearchCost }); }; this.state.pagination.current = data.data.pageNo; this.state.pagination.total = data.data.totalCount; this.setState({ dataSource: this.state.data, pagination: this.state.pagination }); }).always(function () { this.setState({ loading: false }); }.bind(this)); }, getInitialState() { return { selectedRowKeys: [], selectedRows: [], RowData: {}, loading: false, pagination: { defaultCurrent: 1, defaultPageSize: 10, showQuickJumper: true, pageSize: 10, onChange: function (page) { this.loadData(page); }.bind(this), showTotal: function (total) { return '共' + total + '条数据'; } }, columns: [ { title: '年份', dataIndex: 'year', key: 'year' }, { title: '创建时间', dataIndex: 'createTimeFormattedDate', key: 'createTimeFormattedDate' }, { title: '最近更新时间', dataIndex: 'lastUpdateTimeFormattedDate', key: 'lastUpdateTimeFormattedDate' }, { title: '年报状态', dataIndex: 'state', key: 'state', render: (text) => { return getAnnualReportState(text) } } ], dataSource: [] }; }, componentWillMount() { this.loadData(); }, tableRowClick(record, index) { this.state.RowData = record; this.setState({ showDesc: true }); }, // delectRow() { // let deletedIds = []; // for (let idx = 0; idx < this.state.selectedRows.length; idx++) { // let rowItem = this.state.selectedRows[idx]; // if (rowItem.id) { // deletedIds.push(rowItem.id) // } // } // this.setState({ // selectedRowKeys: [], // loading: deletedIds.length > 0 // }); // $.ajax({ // method: "POST", // dataType: "json", // crossDomain: false, // url: globalConfig.context + "/api/user/cognizance/deleteAnnualReport", // data: { // ids: deletedIds // } // }).done(function (data) { // if (!data.error.length) { // message.success('保存成功!'); // this.setState({ // loading: false, // }); // } else { // message.warning(data.error[0].message); // }; // this.loadData(); // }.bind(this)); // }, closeDesc(e, s) { this.state.showDesc = e; if (s) { this.loadData(); }; }, addClick() { this.setState({ showAdd: true }); }, closeAdd(e, s) { this.state.showAdd = e; if (s) { this.loadData(); }; }, // search() { // this.loadData(); // }, // reset() { // this.loadData(); // }, render() { const rowSelection = { selectedRowKeys: this.state.selectedRowKeys, onChange: (selectedRowKeys, selectedRows) => { this.setState({ selectedRows: selectedRows, selectedRowKeys: selectedRowKeys }); } }; const hasSelected = this.state.selectedRowKeys.length > 0; return (
企业年报

); } }); export default AnnualReport;