|
@@ -1,7 +1,7 @@
|
|
|
import React from 'react';
|
|
|
import { Icon, Form, Button, Input, Spin, Table, message, Select, Modal, InputNumber, Upload } from 'antd';
|
|
|
import './techProduct.less';
|
|
|
-import { beforeUpload } from '../../tools.js';
|
|
|
+import { beforeUploadFile, downloadFile } from '../../tools.js';
|
|
|
import ajax from 'jquery/src/ajax/xhr.js';
|
|
|
import $ from 'jquery/src/ajax';
|
|
|
|
|
@@ -46,7 +46,7 @@ const RatepayDescFrom = Form.create()(React.createClass({
|
|
|
taxExemptIncome: values.taxExemptIncome,
|
|
|
subsidyIncome: values.subsidyIncome,
|
|
|
year: this.state.year || this.props.data.year,
|
|
|
- taxReturnUrl: this.state.ratepayUrl,
|
|
|
+ taxReturnUrl: this.state.taxReturnUrl,
|
|
|
grossProfit: values.grossProfit,
|
|
|
researchCost: values.researchCost
|
|
|
}
|
|
@@ -64,6 +64,11 @@ const RatepayDescFrom = Form.create()(React.createClass({
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ componentWillReceiveProps(nextProps) {
|
|
|
+ if (!this.props.visible && nextProps.visible) {
|
|
|
+ this.props.form.resetFields();
|
|
|
+ };
|
|
|
+ },
|
|
|
render() {
|
|
|
const FormItem = Form.Item;
|
|
|
const { getFieldDecorator } = this.props.form;
|
|
@@ -189,8 +194,9 @@ const RatepayDescFrom = Form.create()(React.createClass({
|
|
|
<Upload
|
|
|
name="ratepay"
|
|
|
action={globalConfig.context + "/techservice/cognizance/upload"}
|
|
|
- data={{ 'sign': this.props.year + 'ratepay' }}
|
|
|
- beforeUpload={beforeUpload}
|
|
|
+ data={{ 'sign': 'ratepay_' + this.state.year || theData.year }}
|
|
|
+ beforeUpload={beforeUploadFile}
|
|
|
+ showUploadList={false}
|
|
|
onChange={(info) => {
|
|
|
if (info.file.status !== 'uploading') {
|
|
|
console.log(info.file, info.fileList);
|
|
@@ -202,14 +208,15 @@ const RatepayDescFrom = Form.create()(React.createClass({
|
|
|
message.warning(info.file.response.error[0].message);
|
|
|
return;
|
|
|
};
|
|
|
- this.state.ratepayUrl = info.file.response.data;
|
|
|
+ this.state.taxReturnUrl = 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 style={{ marginTop: '10px' }}>{theData.taxReturnUrl ? <a onClick={downloadFile.bind(null, theData.taxReturnUrl, theData.taxReturnDownloadFileName)}>{theData.taxReturnDownloadFileName}</a> : <span>未上传!</span>}</p>
|
|
|
</div>
|
|
|
<FormItem style={{ marginTop: '20px' }}>
|
|
|
<Button className="set-submit" type="primary" htmlType="submit">保存</Button>
|
|
@@ -261,8 +268,10 @@ const RatepayDesc = React.createClass({
|
|
|
width='800px'
|
|
|
footer=''
|
|
|
>
|
|
|
- <RatepayDescFrom data={this.props.data}
|
|
|
- spinState={this.spinChange} closeModal={this.handleCancel} clickOk={this.handleOk} />
|
|
|
+ <RatepayDescFrom
|
|
|
+ visible={this.state.visible}
|
|
|
+ data={this.props.data}
|
|
|
+ spinState={this.spinChange} closeModal={this.handleCancel} clickOk={this.handleOk} />
|
|
|
</Modal>
|
|
|
</Spin>
|
|
|
</div>
|
|
@@ -306,7 +315,8 @@ const Ratepay = React.createClass({
|
|
|
grossProfit: thisdata.grossProfit,
|
|
|
researchCost: thisdata.researchCost,
|
|
|
year: thisdata.year,
|
|
|
- taxReturnUrl: thisdata.taxReturnUrl
|
|
|
+ taxReturnUrl: thisdata.taxReturnUrl,
|
|
|
+ taxReturnDownloadFileName: thisdata.taxReturnDownloadFileName
|
|
|
});
|
|
|
};
|
|
|
this.state.pagination.current = data.data.pageNo;
|