|
@@ -1,5 +1,5 @@
|
|
|
import React from 'react';
|
|
|
-import { Icon, Button, Upload, Input, Spin, Table, message, Select, Modal, DatePicker, Cascader, Transfer, InputNumber, Switch } from 'antd';
|
|
|
+import { Icon, Button, Upload, Input, Spin, Table, message, Select, Modal, DatePicker, Cascader, Transfer, InputNumber, Switch, Form } from 'antd';
|
|
|
import { technicalSourceList } from '../../../../dataDic.js';
|
|
|
import { techFieldList } from '../../../../DicTechFieldList.js';
|
|
|
import { getTechField, getTechnicalSource, beforeUploadFile, newDownloadFile, getProportion, saveProportion } from '../../../../tools.js';
|
|
@@ -7,113 +7,88 @@ import moment from 'moment';
|
|
|
import ajax from 'jquery/src/ajax/xhr.js';
|
|
|
import $ from 'jquery/src/ajax';
|
|
|
|
|
|
-const ActivityDesc = React.createClass({
|
|
|
+const ActivityForm = Form.create()(React.createClass({
|
|
|
getInitialState() {
|
|
|
return {
|
|
|
- visible: false,
|
|
|
- loading: false,
|
|
|
targetKeys: [],
|
|
|
selectedKeys: []
|
|
|
};
|
|
|
},
|
|
|
- handleOk() {
|
|
|
- this.setState({
|
|
|
- loading: true,
|
|
|
- });
|
|
|
+ loadData(id) {
|
|
|
+ this.setState({ loading: true });
|
|
|
$.ajax({
|
|
|
- method: "POST",
|
|
|
+ method: "get",
|
|
|
dataType: "json",
|
|
|
crossDomain: false,
|
|
|
- url: globalConfig.context + "/api/admin/activity",
|
|
|
+ url: globalConfig.context + "/api/admin/activityDetail",
|
|
|
data: {
|
|
|
- id: this.props.data.id,
|
|
|
- uid: this.props.uid,
|
|
|
- activityName: this.state.activityName,
|
|
|
- activityNumber: this.state.activityNumber,
|
|
|
- startDateFormattedDate: this.state.startDateFormattedDate,
|
|
|
- endDateFormattedDate: this.state.endDateFormattedDate,
|
|
|
- technicalField1: this.state.techField[0],
|
|
|
- technicalField2: this.state.techField[1],
|
|
|
- technicalField3: this.state.techField[2],
|
|
|
- technicalSource: this.state.technicalSource,
|
|
|
- intellectualPropertyNumber: this.state.targetKeys.join(","),
|
|
|
- budget: this.state.budget,
|
|
|
- firstYearExpenditure: this.state.firstYearExpenditure,
|
|
|
- secondYearExpenditure: this.state.secondYearExpenditure,
|
|
|
- thirdYearExpenditure: this.state.thirdYearExpenditure,
|
|
|
- implement: this.state.implement,
|
|
|
- technologyInnovation: this.state.technologyInnovation,
|
|
|
- achievement: this.state.achievement,
|
|
|
- proofUrl: this.state.proofUrl
|
|
|
- },
|
|
|
- success: function (data) {
|
|
|
- if (data.data) {
|
|
|
- this.setState({
|
|
|
- id: this.props.data.id,
|
|
|
- activityName: this.state.activityName,
|
|
|
- activityNumber: this.state.activityNumber,
|
|
|
- startDateFormattedDate: this.state.startDateFormattedDate,
|
|
|
- endDateFormattedDate: this.state.endDateFormattedDate,
|
|
|
- techField: this.state.techField,
|
|
|
- technicalSource: this.state.technicalSource,
|
|
|
- intellectualPropertyNumber: this.state.targetKeys,
|
|
|
- budget: this.state.budget,
|
|
|
- firstYearExpenditure: this.state.firstYearExpenditure,
|
|
|
- secondYearExpenditure: this.state.secondYearExpenditure,
|
|
|
- thirdYearExpenditure: this.state.thirdYearExpenditure,
|
|
|
- implement: this.state.implement,
|
|
|
- technologyInnovation: this.state.technologyInnovation,
|
|
|
- achievement: this.state.achievement,
|
|
|
- projectMode: this.state.projectMode
|
|
|
- });
|
|
|
- } else if (data.error.length && data.error[0].message) {
|
|
|
- message.warning(data.error[0].message);
|
|
|
- }
|
|
|
- }.bind(this),
|
|
|
+ id: id || this.props.data.id
|
|
|
+ }
|
|
|
}).done(function (data) {
|
|
|
- if (!data.error.length) {
|
|
|
- message.success('保存成功!');
|
|
|
- this.setState({
|
|
|
- loading: false,
|
|
|
- visible: false
|
|
|
- });
|
|
|
- this.props.closeDesc(false, true);
|
|
|
- } else {
|
|
|
- message.warning(data.error[0].message);
|
|
|
- this.setState({
|
|
|
- loading: false
|
|
|
- });
|
|
|
+ if (!data.data) {
|
|
|
+ if (data.error && data.error.length) {
|
|
|
+ message.warning(data.error[0].message);
|
|
|
+ };
|
|
|
};
|
|
|
+ this.setState({
|
|
|
+ data: data.data,
|
|
|
+ targetKeys: data.data.intellectualPropertyNumber ? data.data.intellectualPropertyNumber.split(",") : [],
|
|
|
+ techField: [Number(data.data.technicalField1), data.data.technicalField2 ? Number(data.data.technicalField2) : null, data.data.technicalField3 ? Number(data.data.technicalField3) : null]
|
|
|
+ });
|
|
|
+ }.bind(this)).always(function (data) {
|
|
|
+ this.setState({ loading: false });
|
|
|
}.bind(this));
|
|
|
},
|
|
|
- handleCancel(e) {
|
|
|
- this.setState({
|
|
|
- visible: false,
|
|
|
+ handleSubmit(e) {
|
|
|
+ e.preventDefault();
|
|
|
+ this.props.form.validateFields((err, values) => {
|
|
|
+ if (!err) {
|
|
|
+ this.setState({ loading: true });
|
|
|
+ $.ajax({
|
|
|
+ method: "POST",
|
|
|
+ dataType: "json",
|
|
|
+ crossDomain: false,
|
|
|
+ url: globalConfig.context + "/api/admin/activity",
|
|
|
+ data: {
|
|
|
+ id: this.props.data.id,
|
|
|
+ uid: this.props.uid,
|
|
|
+ activityName: values.activityName,
|
|
|
+ activityNumber: values.activityNumber,
|
|
|
+ projectMode: values.projectMode,
|
|
|
+ startDateFormattedDate: values.startDate ? values.startDate.format("YYYY-MM-DD") : null,
|
|
|
+ endDateFormattedDate: values.endDate ? values.endDate.format("YYYY-MM-DD") : null,
|
|
|
+ technicalField1: values.techField[0],
|
|
|
+ technicalField2: values.techField[1],
|
|
|
+ technicalField3: values.techField[2],
|
|
|
+ technicalSource: values.technicalSource,
|
|
|
+ intellectualPropertyNumber: this.state.targetKeys.join(","),
|
|
|
+ budget: values.budget,
|
|
|
+ implement: values.implement,
|
|
|
+ technologyInnovation: values.technologyInnovation,
|
|
|
+ achievement: values.achievement,
|
|
|
+ proofUrl: this.state.proofUrl
|
|
|
+ }
|
|
|
+ }).done(function (data) {
|
|
|
+ if (!data.error.length) {
|
|
|
+ message.success('保存成功!');
|
|
|
+ this.props.closeModal(true);
|
|
|
+ } else {
|
|
|
+ message.warning(data.error[0].message);
|
|
|
+ };
|
|
|
+ this.setState({ loading: false });
|
|
|
+ }.bind(this));
|
|
|
+ }
|
|
|
});
|
|
|
- this.props.closeDesc(false);
|
|
|
+ },
|
|
|
+ componentWillMount() {
|
|
|
+ this.loadData();
|
|
|
},
|
|
|
componentWillReceiveProps(nextProps) {
|
|
|
- if (!this.state.showDesc && nextProps.showDesc) {
|
|
|
- this.state.activityName = nextProps.data.activityName;
|
|
|
- this.state.activityNumber = nextProps.data.activityNumber;
|
|
|
- this.state.startDateFormattedDate = nextProps.data.startDateFormattedDate;
|
|
|
- this.state.endDateFormattedDate = nextProps.data.endDateFormattedDate;
|
|
|
- this.state.techField = nextProps.data.techField;
|
|
|
- this.state.technicalSource = nextProps.data.technicalSource;
|
|
|
- this.state.targetKeys = nextProps.data.intellectualPropertyNumber || [];
|
|
|
- this.state.budget = nextProps.data.budget;
|
|
|
- this.state.firstYearExpenditure = nextProps.data.firstYearExpenditure;
|
|
|
- this.state.secondYearExpenditure = nextProps.data.secondYearExpenditure;
|
|
|
- this.state.thirdYearExpenditure = nextProps.data.thirdYearExpenditure;
|
|
|
- this.state.implement = nextProps.data.implement;
|
|
|
- this.state.technologyInnovation = nextProps.data.technologyInnovation;
|
|
|
- this.state.achievement = nextProps.data.achievement;
|
|
|
- this.state.projectMode = nextProps.data.projectMode ? String(nextProps.data.projectMode) : undefined;
|
|
|
- this.state.proofUrl = nextProps.data.proofUrl;
|
|
|
- this.state.proofDownloadFileName = nextProps.data.proofDownloadFileName;
|
|
|
+ if (!this.props.visible && nextProps.visible) {
|
|
|
this.state.mockData = nextProps.data.mockData;
|
|
|
+ this.loadData(nextProps.data.id);
|
|
|
+ this.props.form.resetFields();
|
|
|
};
|
|
|
- this.state.visible = nextProps.showDesc;
|
|
|
},
|
|
|
intellectualChange(nextTargetKeys, direction, moveKeys) {
|
|
|
this.setState({ targetKeys: nextTargetKeys });
|
|
@@ -122,63 +97,108 @@ const ActivityDesc = React.createClass({
|
|
|
this.setState({ selectedKeys: [...sourceSelectedKeys, ...targetSelectedKeys] });
|
|
|
},
|
|
|
render() {
|
|
|
- if (this.props.data) {
|
|
|
+ const FormItem = Form.Item;
|
|
|
+ const { getFieldDecorator } = this.props.form;
|
|
|
+ const theData = this.state.data;
|
|
|
+ const formItemLayout = {
|
|
|
+ labelCol: { span: 6 },
|
|
|
+ wrapperCol: { span: 12 },
|
|
|
+ };
|
|
|
+ if (theData) {
|
|
|
return (
|
|
|
- <div className="admin-desc">
|
|
|
- <Modal title="企业研究开发活动情况详情" visible={this.state.visible} onCancel={this.handleCancel}
|
|
|
- width='800px' footer={[
|
|
|
- <Button key="submit" type="primary" size="large" loading={this.state.loading} onClick={this.handleOk}>保存</Button>,
|
|
|
- <Button key="back" type="ghost" size="large" onClick={this.handleCancel}>取消</Button>
|
|
|
- ]}
|
|
|
- className="admin-desc-content">
|
|
|
+ <Spin spinning={this.state.loading} className='spin-box'>
|
|
|
+ <Form onSubmit={this.handleSubmit} id="admin-desc-content">
|
|
|
<div className="clearfix">
|
|
|
- <div className="half-div">
|
|
|
- <p>研发活动编号:</p>
|
|
|
- <Input value={this.state.activityNumber}
|
|
|
- onChange={(e) => { this.setState({ activityNumber: e.target.value }); }} />
|
|
|
- </div>
|
|
|
- <div className="half-div">
|
|
|
- <p>研发活动名称:</p>
|
|
|
- <Input value={this.state.activityName}
|
|
|
- onChange={(e) => { this.setState({ activityName: e.target.value }); }} />
|
|
|
- </div>
|
|
|
- <div className="half-div">
|
|
|
- <p>开始日期:</p>
|
|
|
- <DatePicker
|
|
|
- value={this.state.startDateFormattedDate ? moment(this.state.startDateFormattedDate) : null}
|
|
|
- onChange={(data, dataString) => { this.setState({ startDateFormattedDate: dataString }); }} />
|
|
|
- </div>
|
|
|
- <div className="half-div">
|
|
|
- <p>结束日期:</p>
|
|
|
- <DatePicker
|
|
|
- value={this.state.endDateFormattedDate ? moment(this.state.endDateFormattedDate) : null}
|
|
|
- onChange={(data, dataString) => { this.setState({ endDateFormattedDate: dataString }); }} />
|
|
|
- </div>
|
|
|
+ <FormItem className="half-item"
|
|
|
+ {...formItemLayout}
|
|
|
+ label="研发活动编号"
|
|
|
+ >
|
|
|
+ {getFieldDecorator('activityNumber', {
|
|
|
+ initialValue: theData.activityNumber
|
|
|
+ })(
|
|
|
+ <Input />
|
|
|
+ )}
|
|
|
+ </FormItem>
|
|
|
+ <FormItem className="half-item"
|
|
|
+ {...formItemLayout}
|
|
|
+ label="研发活动名称"
|
|
|
+ >
|
|
|
+ {getFieldDecorator('activityName', {
|
|
|
+ initialValue: theData.activityName
|
|
|
+ })(
|
|
|
+ <Input />
|
|
|
+ )}
|
|
|
+ </FormItem>
|
|
|
+ <FormItem className="half-item"
|
|
|
+ {...formItemLayout}
|
|
|
+ label="开始日期"
|
|
|
+ >
|
|
|
+ {getFieldDecorator('startDate', {
|
|
|
+ initialValue: theData.startDateFormattedDate ? moment(theData.startDateFormattedDate) : null
|
|
|
+ })(
|
|
|
+ <DatePicker />
|
|
|
+ )}
|
|
|
+ </FormItem>
|
|
|
+ <FormItem className="half-item"
|
|
|
+ {...formItemLayout}
|
|
|
+ label="结束日期"
|
|
|
+ >
|
|
|
+ {getFieldDecorator('endDate', {
|
|
|
+ initialValue: theData.endDateFormattedDate ? moment(theData.endDateFormattedDate) : null
|
|
|
+ })(
|
|
|
+ <DatePicker />
|
|
|
+ )}
|
|
|
+ </FormItem>
|
|
|
</div>
|
|
|
- <div>
|
|
|
- <p>技术领域:</p>
|
|
|
- <Cascader
|
|
|
- style={{ width: 500 }}
|
|
|
- options={techFieldList}
|
|
|
- value={this.state.techField}
|
|
|
- onChange={(value, selectedOptions) => { this.setState({ techField: value }); console.log(value) }}
|
|
|
- placeholder="选择技术领域"
|
|
|
- showSearch
|
|
|
- />,
|
|
|
+ <div className="clearfix">
|
|
|
+ <FormItem className="half-item"
|
|
|
+ {...formItemLayout}
|
|
|
+ label="技术领域"
|
|
|
+ >
|
|
|
+ {getFieldDecorator('techField', {
|
|
|
+ initialValue: this.state.techField
|
|
|
+ })(
|
|
|
+ <Cascader
|
|
|
+ style={{ width: 500 }}
|
|
|
+ options={techFieldList}
|
|
|
+ placeholder="选择技术领域"
|
|
|
+ showSearch
|
|
|
+ />
|
|
|
+ )}
|
|
|
+ </FormItem>
|
|
|
</div>
|
|
|
- <div className="half-div">
|
|
|
- <p>技术来源:</p>
|
|
|
- <Select placeholder="选择技术来源" style={{ width: 230 }}
|
|
|
- value={this.state.technicalSource}
|
|
|
- onChange={(e) => { this.setState({ technicalSource: e }) }}>
|
|
|
- {
|
|
|
- technicalSourceList.map(function (item, i) {
|
|
|
- return <Select.Option key={1000 + i} value={item.value} >{item.key}</Select.Option>
|
|
|
- })
|
|
|
- }
|
|
|
- </Select>
|
|
|
+ <div className="clearfix">
|
|
|
+ <FormItem className="half-item"
|
|
|
+ {...formItemLayout}
|
|
|
+ label="技术来源"
|
|
|
+ >
|
|
|
+ {getFieldDecorator('technicalSource', {
|
|
|
+ initialValue: theData.technicalSource ? String(theData.technicalSource) : undefined,
|
|
|
+ })(
|
|
|
+ <Select placeholder="选择技术来源" style={{ width: 230 }}>
|
|
|
+ {
|
|
|
+ technicalSourceList.map(function (item, i) {
|
|
|
+ return <Select.Option key={1000 + i} value={item.value} >{item.key}</Select.Option>
|
|
|
+ })
|
|
|
+ }
|
|
|
+ </Select>
|
|
|
+ )}
|
|
|
+ </FormItem>
|
|
|
+ <FormItem className="half-item"
|
|
|
+ {...formItemLayout}
|
|
|
+ label="立项类型"
|
|
|
+ >
|
|
|
+ {getFieldDecorator('projectMode', {
|
|
|
+ initialValue: theData.projectMode
|
|
|
+ })(
|
|
|
+ <Select style={{ width: 120 }}>
|
|
|
+ <Select.Option value='0'>内部立项</Select.Option>
|
|
|
+ <Select.Option value='1'>外部立项</Select.Option>
|
|
|
+ </Select>
|
|
|
+ )}
|
|
|
+ </FormItem>
|
|
|
</div>
|
|
|
- <div style={{ marginTop: '10px' }}>
|
|
|
+ <div style={{ marginBottom: '20px' }}>
|
|
|
<p>知识产权编号:</p>
|
|
|
<Transfer
|
|
|
dataSource={this.props.mockData}
|
|
@@ -194,77 +214,83 @@ const ActivityDesc = React.createClass({
|
|
|
render={item => `${item.name}-${item.key}`}
|
|
|
/>
|
|
|
</div>
|
|
|
- <div>
|
|
|
- <p>研发经费总预算(万元):</p>
|
|
|
- <InputNumber value={this.state.budget || 0}
|
|
|
- onChange={(e) => { this.setState({ budget: e }); }} />
|
|
|
- </div>
|
|
|
+ <FormItem className="half-div"
|
|
|
+ labelCol={{ span: 8 }}
|
|
|
+ wrapperCol={{ span: 12 }}
|
|
|
+ label="研发经费总预算"
|
|
|
+ >
|
|
|
+ {getFieldDecorator('budget', {
|
|
|
+ initialValue: theData.budget
|
|
|
+ })(
|
|
|
+ <InputNumber />
|
|
|
+ )}
|
|
|
+ <span>万元</span>
|
|
|
+ </FormItem>
|
|
|
<div className="clearfix" >
|
|
|
- <p>研发经费近三年总支出(万元):</p>
|
|
|
- <div className="half-div">
|
|
|
- <span>总计(万元):</span>
|
|
|
+ <p>研发经费近三年总支出:</p>
|
|
|
+ <FormItem className="half-item"
|
|
|
+ labelCol={{ span: 8 }}
|
|
|
+ wrapperCol={{ span: 12 }}
|
|
|
+ label="总计"
|
|
|
+ >
|
|
|
<span>{
|
|
|
- (this.state.firstYearExpenditure || 0) +
|
|
|
- (this.state.secondYearExpenditure || 0) +
|
|
|
- (this.state.thirdYearExpenditure || 0)
|
|
|
+ (theData.firstYearExpenditure || 0) +
|
|
|
+ (theData.secondYearExpenditure || 0) +
|
|
|
+ (theData.thirdYearExpenditure || 0)
|
|
|
}</span>
|
|
|
- </div>
|
|
|
- <div className="half-div">
|
|
|
- <span>其中(前一年):</span>
|
|
|
- <span>{this.state.firstYearExpenditure}
|
|
|
- </span>
|
|
|
- </div>
|
|
|
- <div className="half-div">
|
|
|
- <span>其中(前二年):</span>
|
|
|
- <span>{this.state.secondYearExpenditure}</span>
|
|
|
- </div>
|
|
|
- <div className="half-div">
|
|
|
- <span>其中(前三年):</span>
|
|
|
- <span>{this.state.thirdYearExpenditure}</span>
|
|
|
- </div>
|
|
|
+ <span>万元</span>
|
|
|
+ </FormItem>
|
|
|
+ <FormItem className="half-item"
|
|
|
+ labelCol={{ span: 8 }}
|
|
|
+ wrapperCol={{ span: 12 }}
|
|
|
+ label="其中(前一年)"
|
|
|
+ >
|
|
|
+ <span>{theData.firstYearExpenditure}</span>
|
|
|
+ <span>万元</span>
|
|
|
+ </FormItem>
|
|
|
+ <FormItem className="half-item"
|
|
|
+ labelCol={{ span: 8 }}
|
|
|
+ wrapperCol={{ span: 12 }}
|
|
|
+ label="其中(前二年)"
|
|
|
+ >
|
|
|
+ <span>{theData.secondYearExpenditure}</span>
|
|
|
+ <span>万元</span>
|
|
|
+ </FormItem>
|
|
|
+ <FormItem className="half-item"
|
|
|
+ labelCol={{ span: 8 }}
|
|
|
+ wrapperCol={{ span: 12 }}
|
|
|
+ label="其中(前三年)"
|
|
|
+ >
|
|
|
+ <span>{theData.thirdYearExpenditure}</span>
|
|
|
+ <span>万元</span>
|
|
|
+ </FormItem>
|
|
|
</div>
|
|
|
<div className="clearfix">
|
|
|
<div className="half-div">
|
|
|
<p>目的及组织实施方式(限400字):</p>
|
|
|
- <Input type="textarea" rows={6}
|
|
|
- value={this.state.implement}
|
|
|
- onChange={(e) => {
|
|
|
- if (e.target.value.length > 400) {
|
|
|
- return;
|
|
|
- }
|
|
|
- this.setState({ implement: e.target.value });
|
|
|
- }} />
|
|
|
+ {getFieldDecorator('implement', {
|
|
|
+ initialValue: theData.implement
|
|
|
+ })(
|
|
|
+ <Input type="textarea" rows={6} />
|
|
|
+ )}
|
|
|
</div>
|
|
|
<div className="half-div">
|
|
|
<p>核心技术及创新点(限400字):</p>
|
|
|
- <Input type="textarea" rows={6}
|
|
|
- value={this.state.technologyInnovation}
|
|
|
- onChange={(e) => {
|
|
|
- if (e.target.value.length > 400) {
|
|
|
- return;
|
|
|
- }
|
|
|
- this.setState({ technologyInnovation: e.target.value });
|
|
|
- }} />
|
|
|
+ {getFieldDecorator('technologyInnovation', {
|
|
|
+ initialValue: theData.technologyInnovation
|
|
|
+ })(
|
|
|
+ <Input type="textarea" rows={6} />
|
|
|
+ )}
|
|
|
</div>
|
|
|
<div className="half-div">
|
|
|
<p>取得的阶段性成果(限400字):</p>
|
|
|
- <Input type="textarea" rows={6}
|
|
|
- value={this.state.achievement}
|
|
|
- onChange={(e) => {
|
|
|
- if (e.target.value.length > 400) {
|
|
|
- return;
|
|
|
- }
|
|
|
- this.setState({ achievement: e.target.value });
|
|
|
- }} />
|
|
|
+ {getFieldDecorator('achievement', {
|
|
|
+ initialValue: theData.achievement
|
|
|
+ })(
|
|
|
+ <Input type="textarea" rows={6} />
|
|
|
+ )}
|
|
|
</div>
|
|
|
</div>
|
|
|
- <Select style={{ width: 120 }}
|
|
|
- placeholder='请选择立项类型'
|
|
|
- value={this.state.projectMode}
|
|
|
- onChange={(e) => { this.setState({ projectMode: e }); }}>
|
|
|
- <Select.Option value='1'>内部立项</Select.Option>
|
|
|
- <Select.Option value='2'>外部立项</Select.Option>
|
|
|
- </Select>
|
|
|
<div style={{ width: '50%' }}>
|
|
|
<Upload
|
|
|
name="ratepay"
|
|
@@ -291,14 +317,58 @@ const ActivityDesc = React.createClass({
|
|
|
>
|
|
|
<Button><Icon type="upload" /> 上传立项证明材料 </Button>
|
|
|
</Upload>
|
|
|
- <p>{this.state.proofUrl ? <a onClick={newDownloadFile.bind(null, this.props.data.id, 'proof', '/api/admin/downloadProof')}>{this.state.proofDownloadFileName}</a> : <span><Icon type="exclamation-circle" style={{ color: '#ffbf00', marginRight: '6px' }} />未上传!</span>}</p>
|
|
|
+ <p>{theData.proofUrl ? <a onClick={newDownloadFile.bind(null, theData.id, 'proof', '/api/admin/downloadProof')}>{theData.proofDownloadFileName}</a> : <span><Icon type="exclamation-circle" style={{ color: '#ffbf00', marginRight: '6px' }} />未上传!</span>}</p>
|
|
|
</div>
|
|
|
- </Modal>
|
|
|
- </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 >
|
|
|
+ </Spin >
|
|
|
+ )
|
|
|
} else {
|
|
|
- return <div></div>
|
|
|
- }
|
|
|
+ return (<div></div>)
|
|
|
+ };
|
|
|
+ }
|
|
|
+}));
|
|
|
+
|
|
|
+const ActivityDesc = React.createClass({
|
|
|
+ getInitialState() {
|
|
|
+ return {
|
|
|
+ visible: false,
|
|
|
+ loading: false
|
|
|
+ };
|
|
|
+ },
|
|
|
+ handleCancel(e) {
|
|
|
+ this.setState({
|
|
|
+ visible: false,
|
|
|
+ });
|
|
|
+ if (e) {
|
|
|
+ this.props.closeDesc(true);
|
|
|
+ };
|
|
|
+ },
|
|
|
+ componentWillReceiveProps(nextProps) {
|
|
|
+ this.state.visible = nextProps.showDesc;
|
|
|
+ },
|
|
|
+ render() {
|
|
|
+ return (
|
|
|
+ <div className="admin-desc">
|
|
|
+ <Modal title="企业研究开发活动情况详情"
|
|
|
+ visible={this.state.visible}
|
|
|
+ onCancel={this.handleCancel}
|
|
|
+ width='800px'
|
|
|
+ footer=''
|
|
|
+ className="admin-desc-content">
|
|
|
+ <ActivityForm
|
|
|
+ visible={this.state.visible}
|
|
|
+ data={this.props.data}
|
|
|
+ uid={this.props.uid}
|
|
|
+ mockData={this.props.mockData}
|
|
|
+ spinState={this.spinChange}
|
|
|
+ closeModal={this.handleCancel} />
|
|
|
+ </Modal>
|
|
|
+ </div>
|
|
|
+ );
|
|
|
},
|
|
|
});
|
|
|
|
|
@@ -371,6 +441,7 @@ const Activity = React.createClass({
|
|
|
technicalField3: thisdata.technicalField3,
|
|
|
technicalSource: thisdata.technicalSource ? String(thisdata.technicalSource) : undefined,
|
|
|
intellectualPropertyNumber: thisdata.intellectualPropertyNumber ? thisdata.intellectualPropertyNumber.split(",") : [],
|
|
|
+ intellectualPropertyNumberText:thisdata.intellectualPropertyNumber,
|
|
|
budget: thisdata.budget,
|
|
|
firstYearExpenditure: thisdata.firstYearExpenditure,
|
|
|
secondYearExpenditure: thisdata.secondYearExpenditure,
|
|
@@ -449,8 +520,8 @@ const Activity = React.createClass({
|
|
|
render: (text) => { return getTechnicalSource(text) }
|
|
|
}, {
|
|
|
title: '知识产权编号',
|
|
|
- dataIndex: 'intellectualPropertyNumber',
|
|
|
- key: 'intellectualPropertyNumber'
|
|
|
+ dataIndex: 'intellectualPropertyNumberText',
|
|
|
+ key: 'intellectualPropertyNumberText'
|
|
|
}, {
|
|
|
title: '开始时间',
|
|
|
dataIndex: 'startDateFormattedDate',
|
|
@@ -505,9 +576,9 @@ const Activity = React.createClass({
|
|
|
this.loadData();
|
|
|
}.bind(this));
|
|
|
},
|
|
|
- closeDesc(e, s) {
|
|
|
- this.state.showDesc = e;
|
|
|
- if (s) {
|
|
|
+ closeDesc(e) {
|
|
|
+ this.state.showDesc = false;
|
|
|
+ if (e) {
|
|
|
this.loadData();
|
|
|
};
|
|
|
},
|