|
@@ -1,7 +1,7 @@
|
|
|
import React from 'react';
|
|
|
import { Icon, Form, Upload, Button, Input, Spin, Table, message, Select, Modal, DatePicker, InputNumber } from 'antd';
|
|
|
import './activityCostList.less';
|
|
|
-import { beforeUploadFile } from '../../../../tools.js';
|
|
|
+import { beforeUploadFile, downloadFile } from '../../../../tools.js';
|
|
|
import moment from 'moment';
|
|
|
import ajax from 'jquery/src/ajax/xhr.js';
|
|
|
import $ from 'jquery/src/ajax';
|
|
@@ -53,7 +53,7 @@ const ActivityDescFrom = Form.create()(React.createClass({
|
|
|
data: {
|
|
|
id: this.props.data.id,
|
|
|
aid: this.state.aid,
|
|
|
- uid:this.props.uid,
|
|
|
+ uid: this.props.uid,
|
|
|
activityNumber: this.state.activityNumber,
|
|
|
|
|
|
internalLaborCost: values.internalLaborCost,
|
|
@@ -69,7 +69,7 @@ const ActivityDescFrom = Form.create()(React.createClass({
|
|
|
enterpriseFiller: values.enterpriseFiller,
|
|
|
signDateFormattedDate: values.signDate.format('YYYY-MM-DD'),
|
|
|
sortNumber: values.sortNumber,
|
|
|
- accountUrl:this.state.accountUrl
|
|
|
+ accountUrl: this.state.accountUrl
|
|
|
}
|
|
|
}).done(function (data) {
|
|
|
if (!data.error.length) {
|
|
@@ -265,26 +265,33 @@ const ActivityDescFrom = Form.create()(React.createClass({
|
|
|
)}
|
|
|
</FormItem>
|
|
|
</div>
|
|
|
- <div style={{ marginTop:'20px',width: '50%' }}>
|
|
|
+ <div style={{ width: '50%', marginTop: '20px' }}>
|
|
|
<Upload
|
|
|
name="ratepay"
|
|
|
action={globalConfig.context + "/techservice/cognizance/upload"}
|
|
|
- data={{ 'sign': this.props.year + 'proof' }}
|
|
|
+ data={{ 'sign': 'activity_cost_account' }}
|
|
|
beforeUpload={beforeUploadFile}
|
|
|
+ showUploadList={false}
|
|
|
onChange={(info) => {
|
|
|
if (info.file.status !== 'uploading') {
|
|
|
console.log(info.file, info.fileList);
|
|
|
}
|
|
|
if (info.file.status === 'done') {
|
|
|
- message.success(`${info.file.name} 文件上传成功!`);
|
|
|
+ if (!info.file.response.error.length) {
|
|
|
+ message.success(`${info.file.name} 文件上传成功!`);
|
|
|
+ } else {
|
|
|
+ message.warning(info.file.response.error[0].message);
|
|
|
+ return;
|
|
|
+ };
|
|
|
this.state.accountUrl = info.file.response.data;
|
|
|
} else if (info.file.status === 'error') {
|
|
|
message.error(`${info.file.name} 文件上传失败。`);
|
|
|
}
|
|
|
}}
|
|
|
>
|
|
|
- <Button><Icon type="upload" /> 上传台账 </Button>
|
|
|
+ <Button><Icon type="upload" /> 上传研发费用台账 </Button>
|
|
|
</Upload>
|
|
|
+ <p>{theData.accountUrl ? <a onClick={downloadFile.bind(null, theData.accountUrl, theData.accountDownloadFileName)}>{theData.accountDownloadFileName}</a> : <span>未上传!</span>}</p>
|
|
|
</div>
|
|
|
<FormItem style={{ marginTop: '20px' }}>
|
|
|
<Button className="set-submit" type="primary" htmlType="submit">保存</Button>
|
|
@@ -331,15 +338,15 @@ const ActivityDesc = React.createClass({
|
|
|
return (
|
|
|
<div className="patent-addNew">
|
|
|
<Spin spinning={this.state.loading} className='spin-box'>
|
|
|
- <Modal title="企业年度研究开发费用结构明细" visible={this.state.visible}
|
|
|
+ <Modal title="企业研究开发费用结构明细" visible={this.state.visible}
|
|
|
onOk={this.handleOk} onCancel={this.handleCancel}
|
|
|
width='800px'
|
|
|
footer=''
|
|
|
>
|
|
|
- <ActivityDescFrom
|
|
|
- uid={this.props.uid}
|
|
|
- data={this.props.data}
|
|
|
- activityNumberList={this.props.activityNumberList}
|
|
|
+ <ActivityDescFrom
|
|
|
+ uid={this.props.uid}
|
|
|
+ data={this.props.data}
|
|
|
+ activityNumberList={this.props.activityNumberList}
|
|
|
spinState={this.spinChange} closeModal={this.handleCancel} />
|
|
|
</Modal>
|
|
|
</Spin>
|
|
@@ -362,7 +369,7 @@ const Activity = React.createClass({
|
|
|
data: {
|
|
|
pageNo: pageNo || 1,
|
|
|
pageSize: this.state.pagination.pageSize,
|
|
|
- uid:this.props.data.uid,
|
|
|
+ uid: this.props.data.uid,
|
|
|
activityNumber: this.state.activityNumber,
|
|
|
startDate: this.state.startDateFormattedDate,
|
|
|
endDate: this.state.endDateFormattedDate
|
|
@@ -372,8 +379,8 @@ const Activity = React.createClass({
|
|
|
dataType: "json",
|
|
|
crossDomain: false,
|
|
|
url: globalConfig.context + "/api/admin/activityNumber",
|
|
|
- data:{
|
|
|
- uid:this.props.data.uid
|
|
|
+ data: {
|
|
|
+ uid: this.props.data.uid
|
|
|
}
|
|
|
})).done((data1, data2) => {
|
|
|
let data = data1[0];
|
|
@@ -425,7 +432,9 @@ const Activity = React.createClass({
|
|
|
sortNumber: thisdata.sortNumber,
|
|
|
|
|
|
startDateFormattedDate: thisdata.startDateFormattedDate,
|
|
|
- endDateFormattedDate: thisdata.endDateFormattedDate
|
|
|
+ endDateFormattedDate: thisdata.endDateFormattedDate,
|
|
|
+ accountDownloadFileName: thisdata.accountDownloadFileName,
|
|
|
+ accountUrl: thisdata.accountUrl
|
|
|
});
|
|
|
};
|
|
|
this.state.activityNumberList = activityNumber.data;
|
|
@@ -593,7 +602,7 @@ const Activity = React.createClass({
|
|
|
return (
|
|
|
<div className="user-content" >
|
|
|
<div className="content-title">
|
|
|
- <span>企业研究开发活动费用详情表</span>
|
|
|
+ <span>企业研究开发费用结构明细</span>
|
|
|
</div>
|
|
|
<div className="user-search">
|
|
|
<Input placeholder="研发活动编号" value={this.state.activityNumber}
|
|
@@ -625,9 +634,9 @@ const Activity = React.createClass({
|
|
|
onRowClick={this.tableRowClick} />
|
|
|
</Spin>
|
|
|
</div>
|
|
|
- <ActivityDesc
|
|
|
+ <ActivityDesc
|
|
|
uid={this.props.data.uid}
|
|
|
- data={this.state.RowData}
|
|
|
+ data={this.state.RowData}
|
|
|
activityNumberList={this.state.activityNumberList}
|
|
|
showDesc={this.state.showDesc} closeDesc={this.closeDesc} />
|
|
|
</div >
|