|
@@ -0,0 +1,604 @@
|
|
|
+import React from 'react';
|
|
|
+import { Icon, Form, Button, Input, Spin, Table, message, Select, Modal, DatePicker, InputNumber } from 'antd';
|
|
|
+import './activityCostList.less';
|
|
|
+import moment from 'moment';
|
|
|
+import ajax from 'jquery/src/ajax/xhr.js';
|
|
|
+import $ from 'jquery/src/ajax';
|
|
|
+
|
|
|
+const ActivityDescFrom = Form.create()(React.createClass({
|
|
|
+ getInitialState() {
|
|
|
+ return {
|
|
|
+ loading: false,
|
|
|
+ activityNumberOption: [],
|
|
|
+ };
|
|
|
+ },
|
|
|
+ componentWillMount() {
|
|
|
+ let _me = this;
|
|
|
+ this.props.activityNumberList.map(function (item) {
|
|
|
+ _me.state.activityNumberOption.push(
|
|
|
+ <Select.Option value={item.aid} key={item.uid}>{item.activityNumber}</Select.Option>
|
|
|
+ )
|
|
|
+ });
|
|
|
+ },
|
|
|
+ allCostCount() {
|
|
|
+ this.state.internalAllCost = this.props.form.getFieldValue('internalLaborCost') + this.props.form.getFieldValue('internalDirectCost') +
|
|
|
+ this.props.form.getFieldValue('internalDepreciationCost') + this.props.form.getFieldValue('internalAmortizationCost') +
|
|
|
+ this.props.form.getFieldValue('internalDesignCost') + this.props.form.getFieldValue('internalEquipmentCost') +
|
|
|
+ this.props.form.getFieldValue('internalOtherCost');
|
|
|
+ this.state.allCost = this.props.form.getFieldValue('internalLaborCost') + this.props.form.getFieldValue('internalDirectCost') +
|
|
|
+ this.props.form.getFieldValue('internalDepreciationCost') + this.props.form.getFieldValue('internalAmortizationCost') +
|
|
|
+ this.props.form.getFieldValue('internalDesignCost') + this.props.form.getFieldValue('internalEquipmentCost') +
|
|
|
+ this.props.form.getFieldValue('internalOtherCost') + this.props.form.getFieldValue('externalTotalCost');
|
|
|
+ },
|
|
|
+ componentDidMount(){
|
|
|
+ this.allCostCount();
|
|
|
+ this.setState({
|
|
|
+ loading:false
|
|
|
+ });
|
|
|
+ },
|
|
|
+ componentWillReceiveProps() {
|
|
|
+ this.allCostCount();
|
|
|
+ },
|
|
|
+ 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 + "/techservice/cognizance/activityCost",
|
|
|
+ data: {
|
|
|
+ id: this.props.data.id,
|
|
|
+ aid: this.state.aid,
|
|
|
+ activityNumber: this.state.activityNumber,
|
|
|
+
|
|
|
+ internalLaborCost: values.internalLaborCost,
|
|
|
+ internalDirectCost: values.internalDirectCost,
|
|
|
+ internalDepreciationCost: values.internalDepreciationCost,
|
|
|
+ internalAmortizationCost: values.internalAmortizationCost,
|
|
|
+ internalDesignCost: values.internalDesignCost,
|
|
|
+ internalEquipmentCost: values.internalEquipmentCost,
|
|
|
+ internalOtherCost: values.internalOtherCost,
|
|
|
+
|
|
|
+ externalTotalCost: values.externalTotalCost,
|
|
|
+ externalAbroadCost: values.externalAbroadCost,
|
|
|
+ enterpriseFiller: values.enterpriseFiller,
|
|
|
+ signDateFormattedDate: values.signDate.format('YYYY-MM-DD'),
|
|
|
+ sortNumber: values.sortNumber
|
|
|
+ }
|
|
|
+ }).done(function (data) {
|
|
|
+ if (!data.error.length) {
|
|
|
+ message.success('保存成功!');
|
|
|
+ } else {
|
|
|
+ message.warning(data.error[0].message);
|
|
|
+ }
|
|
|
+ }.bind(this)).always(function () {
|
|
|
+ this.props.spinState(false);
|
|
|
+ this.props.closeModal();
|
|
|
+ this.props.form.resetFields();
|
|
|
+ }.bind(this));
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ render() {
|
|
|
+ const FormItem = Form.Item;
|
|
|
+ const { getFieldDecorator } = this.props.form;
|
|
|
+ const theData = this.props.data;
|
|
|
+ const formItemLayout = {
|
|
|
+ labelCol: { span: 14 },
|
|
|
+ wrapperCol: { span: 8 },
|
|
|
+ };
|
|
|
+ const _me = this;
|
|
|
+ return (
|
|
|
+ <Form onSubmit={this.handleSubmit} className="activityCost-form">
|
|
|
+ <p className="activityCost-title">项目编号</p>
|
|
|
+ {
|
|
|
+ theData.activityNumber ? <span>{theData.activityNumber}</span> :
|
|
|
+ <Select placeholder="请选择项目编号" style={{ width: 200 }}
|
|
|
+ onSelect={(e, n) => { this.state.aid = e; this.state.activityNumber = n.props.children }}>
|
|
|
+ {this.state.activityNumberOption}
|
|
|
+ </Select>
|
|
|
+ }
|
|
|
+ <p className="activityCost-title">内部研究开发费用(万元)</p>
|
|
|
+ <div className="clearfix activityCost-box">
|
|
|
+ <FormItem className="half-item"
|
|
|
+ {...formItemLayout}
|
|
|
+ label="共计(万元)"
|
|
|
+ >
|
|
|
+ {getFieldDecorator('internalAllCost')(
|
|
|
+ <span className="number-box">
|
|
|
+ {this.state.internalAllCost}
|
|
|
+ </span>
|
|
|
+ )}
|
|
|
+ </FormItem>
|
|
|
+ <FormItem className="half-item"
|
|
|
+ {...formItemLayout}
|
|
|
+ label="人员人工费用(万元)"
|
|
|
+ >
|
|
|
+ {getFieldDecorator('internalLaborCost', {
|
|
|
+ rules: [{ type: "number", required: true, message: '此项为必填项!' }],
|
|
|
+ initialValue: theData.internalLaborCost
|
|
|
+ })(
|
|
|
+ <InputNumber />
|
|
|
+ )}
|
|
|
+ </FormItem>
|
|
|
+ <FormItem className="half-item"
|
|
|
+ {...formItemLayout}
|
|
|
+ label="直接投入费用(万元)"
|
|
|
+ >
|
|
|
+ {getFieldDecorator('internalDirectCost', {
|
|
|
+ rules: [{ type: "number", required: true, message: '此项为必填项!' }],
|
|
|
+ initialValue: theData.internalDirectCost
|
|
|
+ })(
|
|
|
+ <InputNumber />
|
|
|
+ )}
|
|
|
+ </FormItem>
|
|
|
+ <FormItem className="half-item"
|
|
|
+ {...formItemLayout}
|
|
|
+ label="折旧费用与长期待摊费用(万元)"
|
|
|
+ >
|
|
|
+ {getFieldDecorator('internalDepreciationCost', {
|
|
|
+ rules: [{ type: "number", required: true, message: '此项为必填项!' }],
|
|
|
+ initialValue: theData.internalDepreciationCost
|
|
|
+ })(
|
|
|
+ <InputNumber />
|
|
|
+ )}
|
|
|
+ </FormItem>
|
|
|
+ <FormItem className="half-item"
|
|
|
+ {...formItemLayout}
|
|
|
+ label="无形资产摊销费用(万元)"
|
|
|
+ >
|
|
|
+ {getFieldDecorator('internalAmortizationCost', {
|
|
|
+ rules: [{ type: "number", required: true, message: '此项为必填项!' }],
|
|
|
+ initialValue: theData.internalAmortizationCost
|
|
|
+ })(
|
|
|
+ <InputNumber />
|
|
|
+ )}
|
|
|
+ </FormItem>
|
|
|
+ <FormItem className="half-item"
|
|
|
+ {...formItemLayout}
|
|
|
+ label="设计费用(万元)"
|
|
|
+ >
|
|
|
+ {getFieldDecorator('internalDesignCost', {
|
|
|
+ rules: [{ type: "number", required: true, message: '此项为必填项!' }],
|
|
|
+ initialValue: theData.internalDesignCost
|
|
|
+ })(
|
|
|
+ <InputNumber />
|
|
|
+ )}
|
|
|
+ </FormItem>
|
|
|
+ <FormItem className="half-item"
|
|
|
+ {...formItemLayout}
|
|
|
+ label="装备调试费用与实验费用(万元)"
|
|
|
+ >
|
|
|
+ {getFieldDecorator('internalEquipmentCost', {
|
|
|
+ rules: [{ type: "number", required: true, message: '此项为必填项!' }],
|
|
|
+ initialValue: theData.internalEquipmentCost
|
|
|
+ })(
|
|
|
+ <InputNumber />
|
|
|
+ )}
|
|
|
+ </FormItem>
|
|
|
+ <FormItem className="half-item"
|
|
|
+ {...formItemLayout}
|
|
|
+ label="其他费用(万元)"
|
|
|
+ >
|
|
|
+ {getFieldDecorator('internalOtherCost', {
|
|
|
+ rules: [{ type: "number", required: true, message: '此项为必填项!' }],
|
|
|
+ initialValue: theData.internalOtherCost
|
|
|
+ })(
|
|
|
+ <InputNumber />
|
|
|
+ )}
|
|
|
+ </FormItem>
|
|
|
+ </div>
|
|
|
+ <p className="activityCost-title">委托外部研究开发费用(万元)</p>
|
|
|
+ <div className="clearfix activityCost-box">
|
|
|
+ <FormItem className="half-item"
|
|
|
+ {...formItemLayout}
|
|
|
+ label="共计(万元)"
|
|
|
+ >
|
|
|
+ {getFieldDecorator('externalTotalCost', {
|
|
|
+ rules: [{ type: "number", required: true, message: '此项为必填项!' }],
|
|
|
+ initialValue: theData.externalTotalCost
|
|
|
+ })(
|
|
|
+ <InputNumber />
|
|
|
+ )}
|
|
|
+ </FormItem>
|
|
|
+ <FormItem className="half-item"
|
|
|
+ {...formItemLayout}
|
|
|
+ label="境内的外部研发费用"
|
|
|
+ >
|
|
|
+ {getFieldDecorator('externalAbroadCost', {
|
|
|
+ rules: [{ type: "number", required: true, message: '此项为必填项!' }],
|
|
|
+ initialValue: theData.externalAbroadCost
|
|
|
+ })(
|
|
|
+ <InputNumber />
|
|
|
+ )}
|
|
|
+ </FormItem>
|
|
|
+ </div>
|
|
|
+ <p className="activityCost-title">研发开发费用(内、外部)小计(万元)</p>
|
|
|
+ <div className="clearfix activityCost-box">
|
|
|
+ <FormItem className="half-item"
|
|
|
+ {...formItemLayout}
|
|
|
+ label="共计(万元)"
|
|
|
+ >
|
|
|
+ {getFieldDecorator('allCost')(
|
|
|
+ <span className="number-box">
|
|
|
+ {this.state.allCost}
|
|
|
+ </span>
|
|
|
+ )}
|
|
|
+ </FormItem>
|
|
|
+ <FormItem className="half-item"
|
|
|
+ {...formItemLayout}
|
|
|
+ label="企业填报人"
|
|
|
+ >
|
|
|
+ {getFieldDecorator('enterpriseFiller', {
|
|
|
+ rules: [{ required: true, message: '此项为必填项!' }],
|
|
|
+ initialValue: theData.enterpriseFiller
|
|
|
+ })(
|
|
|
+ <Input />
|
|
|
+ )}
|
|
|
+ </FormItem>
|
|
|
+ <FormItem className="half-item"
|
|
|
+ {...formItemLayout}
|
|
|
+ label="企业填报人签字日期"
|
|
|
+ >
|
|
|
+ {getFieldDecorator('signDate', {
|
|
|
+ rules: [{ type: "object", required: true, message: '此项为必填项!' }],
|
|
|
+ initialValue: theData.signDate ? moment(theData.signDate) : null
|
|
|
+ })(
|
|
|
+ <DatePicker onChange={(date, dateString) => { this.state.signDateFormattedDate = dateString }} />
|
|
|
+ )}
|
|
|
+ </FormItem>
|
|
|
+ <FormItem className="half-item"
|
|
|
+ {...formItemLayout}
|
|
|
+ label="排序号"
|
|
|
+ >
|
|
|
+ {getFieldDecorator('sortNumber', {
|
|
|
+ rules: [{ required: true, message: '此项为必填项!' }],
|
|
|
+ initialValue: theData.sortNumber
|
|
|
+ })(
|
|
|
+ <Input />
|
|
|
+ )}
|
|
|
+ </FormItem>
|
|
|
+ </div>
|
|
|
+ <FormItem style={{ marginTop: '20px' }}>
|
|
|
+ <Button className="set-submit" type="primary" htmlType="submit">保存</Button>
|
|
|
+ <Button type="ghost" style={{ marginLeft: '20px' }} onClick={this.props.closeModal}>取消</Button>
|
|
|
+ </FormItem>
|
|
|
+ </Form >
|
|
|
+ );
|
|
|
+ },
|
|
|
+}));
|
|
|
+
|
|
|
+const ActivityDesc = 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);
|
|
|
+ },
|
|
|
+ handleCancel(e) {
|
|
|
+ this.setState({
|
|
|
+ visible: false,
|
|
|
+ });
|
|
|
+ this.props.closeDesc(false);
|
|
|
+ },
|
|
|
+ spinChange(e) {
|
|
|
+ this.setState({
|
|
|
+ loading: e
|
|
|
+ });
|
|
|
+ },
|
|
|
+ render() {
|
|
|
+ return (
|
|
|
+ <div className="patent-addNew">
|
|
|
+ <Spin spinning={this.state.loading} className='spin-box'>
|
|
|
+ <Modal title="企业年度研究开发费用结构明细" visible={this.state.visible}
|
|
|
+ onOk={this.handleOk} onCancel={this.handleCancel}
|
|
|
+ width='800px'
|
|
|
+ footer=''
|
|
|
+ >
|
|
|
+ <ActivityDescFrom data={this.props.data} activityNumberList={this.props.activityNumberList}
|
|
|
+ spinState={this.spinChange} closeModal={this.handleCancel} />
|
|
|
+ </Modal>
|
|
|
+ </Spin>
|
|
|
+ </div>
|
|
|
+ );
|
|
|
+ },
|
|
|
+});
|
|
|
+
|
|
|
+const Activity = React.createClass({
|
|
|
+ loadData(pageNo) {
|
|
|
+ this.state.data = [];
|
|
|
+ this.setState({
|
|
|
+ loading: true
|
|
|
+ });
|
|
|
+ $.when($.ajax({
|
|
|
+ method: "post",
|
|
|
+ dataType: "json",
|
|
|
+ crossDomain: false,
|
|
|
+ url: globalConfig.context + "/techservice/cognizance/activityCostList",
|
|
|
+ data: {
|
|
|
+ pageNo: pageNo || 1,
|
|
|
+ pageSize: this.state.pagination.pageSize,
|
|
|
+ activityNumber: this.state.activityNumber,
|
|
|
+ startDate: this.state.startDate,
|
|
|
+ endDate: this.state.endDate
|
|
|
+ }
|
|
|
+ }), $.ajax({
|
|
|
+ method: "get",
|
|
|
+ dataType: "json",
|
|
|
+ crossDomain: false,
|
|
|
+ url: globalConfig.context + "/techservice/cognizance/activityNumber",
|
|
|
+ })).done((data1, data2) => {
|
|
|
+ let data = data1[0];
|
|
|
+ let activityNumber = data2[0];
|
|
|
+ if (data.error.length || !data.data || !data.data.list) {
|
|
|
+ message.warning(data.error[0].message);
|
|
|
+ return;
|
|
|
+ };
|
|
|
+ if (activityNumber.error.length || !activityNumber.data) {
|
|
|
+ message.warning(activityNumber.error[0].message);
|
|
|
+ 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,
|
|
|
+ aid: thisdata.aid,
|
|
|
+ activityNumber: thisdata.activityNumber,
|
|
|
+ startDate: thisdata.startDate,
|
|
|
+ endDate: thisdata.endDate,
|
|
|
+
|
|
|
+ internalAllCost:
|
|
|
+ thisdata.internalLaborCost + thisdata.internalDirectCost + thisdata.internalDepreciationCost +
|
|
|
+ thisdata.internalAmortizationCost + thisdata.internalAmortizationCost + thisdata.internalDesignCost +
|
|
|
+ thisdata.internalEquipmentCost + thisdata.internalOtherCost,
|
|
|
+
|
|
|
+ internalLaborCost: thisdata.internalLaborCost,
|
|
|
+ internalDirectCost: thisdata.internalDirectCost,
|
|
|
+ internalDepreciationCost: thisdata.internalDepreciationCost,
|
|
|
+ internalAmortizationCost: thisdata.internalAmortizationCost,
|
|
|
+ internalDesignCost: thisdata.internalDesignCost,
|
|
|
+ internalEquipmentCost: thisdata.internalEquipmentCost,
|
|
|
+ internalOtherCost: thisdata.internalOtherCost,
|
|
|
+
|
|
|
+ externalTotalCost: thisdata.externalTotalCost,
|
|
|
+ externalAbroadCost: thisdata.externalAbroadCost,
|
|
|
+
|
|
|
+ allCost:
|
|
|
+ thisdata.internalLaborCost + thisdata.internalDirectCost + thisdata.internalDepreciationCost +
|
|
|
+ thisdata.internalAmortizationCost + thisdata.internalAmortizationCost + thisdata.internalDesignCost +
|
|
|
+ thisdata.internalEquipmentCost + thisdata.internalOtherCost + thisdata.externalTotalCost,
|
|
|
+
|
|
|
+ enterpriseFiller: thisdata.enterpriseFiller,
|
|
|
+ signDate: thisdata.signDate,
|
|
|
+ signDateFormattedDate: thisdata.signDateFormattedDate,
|
|
|
+
|
|
|
+ sortNumber: thisdata.sortNumber,
|
|
|
+
|
|
|
+ startDateFormattedDate: thisdata.startDateFormattedDate,
|
|
|
+ endDateFormattedDate: thisdata.endDateFormattedDate
|
|
|
+ });
|
|
|
+ };
|
|
|
+ this.state.activityNumberList = activityNumber.data;
|
|
|
+ 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: [],
|
|
|
+ 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: 'activityNumber',
|
|
|
+ key: 'activityNumber'
|
|
|
+ }, {
|
|
|
+ title: '内部研究开发费用',
|
|
|
+ dataIndex: 'internalAllCost',
|
|
|
+ key: 'internalAllCost'
|
|
|
+ }, {
|
|
|
+ title: '人员人工费用',
|
|
|
+ dataIndex: 'internalLaborCost',
|
|
|
+ key: 'internalLaborCost'
|
|
|
+ }, {
|
|
|
+ title: '直接投入费用',
|
|
|
+ dataIndex: 'internalDirectCost',
|
|
|
+ key: 'internalDirectCost'
|
|
|
+ }, {
|
|
|
+ title: '折旧费用与长期待摊费用',
|
|
|
+ dataIndex: 'internalDepreciationCost',
|
|
|
+ key: 'internalDepreciationCost'
|
|
|
+ }, {
|
|
|
+ title: '设计费用',
|
|
|
+ dataIndex: 'internalDesignCost',
|
|
|
+ key: 'internalDesignCost'
|
|
|
+ }, {
|
|
|
+ title: '装备调试费用与试验费用',
|
|
|
+ dataIndex: 'internalEquipmentCost',
|
|
|
+ key: 'internalEquipmentCost'
|
|
|
+ }, {
|
|
|
+ title: '无形资产摊销费用',
|
|
|
+ dataIndex: 'internalAmortizationCost',
|
|
|
+ key: 'internalAmortizationCost'
|
|
|
+ }, {
|
|
|
+ title: '其他费用',
|
|
|
+ dataIndex: 'internalOtherCost',
|
|
|
+ key: 'internalOtherCost'
|
|
|
+ }, {
|
|
|
+ title: '委托外部研究开发费用',
|
|
|
+ dataIndex: 'externalTotalCost',
|
|
|
+ key: 'externalTotalCost'
|
|
|
+ }, {
|
|
|
+ title: '境内外部研发费用',
|
|
|
+ dataIndex: 'externalAbroadCost',
|
|
|
+ key: 'externalAbroadCost'
|
|
|
+ }, {
|
|
|
+ title: '研发费用合计',
|
|
|
+ dataIndex: 'allCost',
|
|
|
+ key: 'allCost'
|
|
|
+ }, {
|
|
|
+ title: '企业填报人',
|
|
|
+ dataIndex: 'enterpriseFiller',
|
|
|
+ key: 'enterpriseFiller'
|
|
|
+ }, {
|
|
|
+ title: '企业填报人签字日期',
|
|
|
+ dataIndex: 'signDateFormattedDate',
|
|
|
+ key: 'signDateFormattedDate'
|
|
|
+ }, {
|
|
|
+ title: '排序号',
|
|
|
+ dataIndex: 'sortNumber',
|
|
|
+ key: 'sortNumber'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ 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 + "/techservice/cognizance/deleteActivityCost",
|
|
|
+ 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) {
|
|
|
+ this.state.showDesc = e;
|
|
|
+ this.loadData();
|
|
|
+ },
|
|
|
+ search() {
|
|
|
+ this.loadData();
|
|
|
+ },
|
|
|
+ reset() {
|
|
|
+ this.state.startDateFormattedDate = undefined;
|
|
|
+ this.state.endDateFormattedDate = undefined;
|
|
|
+ this.state.activityNumber = undefined;
|
|
|
+ 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 (
|
|
|
+ <div className="user-content" >
|
|
|
+ <div className="content-title">
|
|
|
+ <span>企业研究开发活动情况表</span>
|
|
|
+ </div>
|
|
|
+ <div className="user-search">
|
|
|
+ <Input placeholder="研发活动编号" value={this.state.activityNumber}
|
|
|
+ onChange={(e) => { this.setState({ activityNumber: e.target.value }); }} />
|
|
|
+ <span>开始日期:</span>
|
|
|
+ <DatePicker
|
|
|
+ value={this.state.startDateFormattedDate ? moment(this.state.startDateFormattedDate) : null}
|
|
|
+ onChange={(data, dataString) => { this.setState({ startDateFormattedDate: dataString }); }} />
|
|
|
+ <span>结束日期:</span>
|
|
|
+ <DatePicker
|
|
|
+ value={this.state.endDateFormattedDate ? moment(this.state.endDateFormattedDate) : null}
|
|
|
+ onChange={(data, dataString) => { this.setState({ endDateFormattedDate: dataString }); }} />
|
|
|
+ <Button type="primary" onClick={this.search}>搜索</Button>
|
|
|
+ <Button onClick={this.reset}>重置</Button>
|
|
|
+ <p>
|
|
|
+ <Button style={{ background: "#ea0862", border: "none", color: "#fff" }}
|
|
|
+ onClick={this.tableRowClick}>添加<Icon type="plus" /></Button>
|
|
|
+ <Button style={{ background: "#3fcf9e", border: "none", color: "#fff" }}
|
|
|
+ disabled={!hasSelected}
|
|
|
+ onClick={this.delectRow}>删除<Icon type="minus" /></Button>
|
|
|
+ </p>
|
|
|
+ </div>
|
|
|
+ <div className="patent-table">
|
|
|
+ <Spin spinning={this.state.loading}>
|
|
|
+ <Table columns={this.state.columns}
|
|
|
+ dataSource={this.state.dataSource}
|
|
|
+ pagination={this.state.pagination}
|
|
|
+ rowSelection={rowSelection}
|
|
|
+ onRowClick={this.tableRowClick} />
|
|
|
+ </Spin>
|
|
|
+ </div>
|
|
|
+ <ActivityDesc data={this.state.RowData}
|
|
|
+ activityNumberList={this.state.activityNumberList}
|
|
|
+ showDesc={this.state.showDesc} closeDesc={this.closeDesc} />
|
|
|
+ </div >
|
|
|
+ );
|
|
|
+ }
|
|
|
+});
|
|
|
+
|
|
|
+export default Activity;
|