|
@@ -1,6 +1,6 @@
|
|
|
import React from 'react';
|
|
|
import { Input, InputNumber, Button, Form, Icon, Spin, message, Table, Modal, Upload, Select } from 'antd';
|
|
|
-import { beforeUpload } from '../../tools.js';
|
|
|
+import { beforeUploadFile, downloadFile } from '../../tools.js';
|
|
|
import './hrSituation.less'
|
|
|
import ajax from 'jquery/src/ajax/xhr.js'
|
|
|
import $ from 'jquery/src/ajax';
|
|
@@ -106,6 +106,11 @@ const HrSituationDescFrom = Form.create()(React.createClass({
|
|
|
)
|
|
|
};
|
|
|
},
|
|
|
+ componentWillReceiveProps(nextProps) {
|
|
|
+ if (!this.props.visible && nextProps.visible) {
|
|
|
+ this.props.form.resetFields();
|
|
|
+ };
|
|
|
+ },
|
|
|
render() {
|
|
|
const { getFieldDecorator } = this.props.form;
|
|
|
const formItemLayout = {
|
|
@@ -113,6 +118,7 @@ const HrSituationDescFrom = Form.create()(React.createClass({
|
|
|
wrapperCol: { span: 16 },
|
|
|
};
|
|
|
const FormItem = Form.Item;
|
|
|
+ const theData = this.props.data;
|
|
|
return (
|
|
|
<Form onSubmit={this.handleSubmit} className="hrSituation-form">
|
|
|
<div className="clearfix">
|
|
@@ -443,10 +449,11 @@ const HrSituationDescFrom = Form.create()(React.createClass({
|
|
|
</div>
|
|
|
<div className="hrSituation-roster">
|
|
|
<Upload
|
|
|
- name="socialSecurity"
|
|
|
+ name="ratepay"
|
|
|
action={globalConfig.context + "/techservice/cognizance/upload"}
|
|
|
- data={{ 'sign': this.props.year + 'socialSecurity' }}
|
|
|
- beforeUpload={beforeUpload}
|
|
|
+ data={{ 'sign': 'roster_' + ( this.state.year || theData.year ) }}
|
|
|
+ beforeUpload={beforeUploadFile}
|
|
|
+ showUploadList={false}
|
|
|
onChange={(info) => {
|
|
|
if (info.file.status !== 'uploading') {
|
|
|
console.log(info.file, info.fileList);
|
|
@@ -458,21 +465,23 @@ const HrSituationDescFrom = Form.create()(React.createClass({
|
|
|
message.warning(info.file.response.error[0].message);
|
|
|
return;
|
|
|
};
|
|
|
- this.state.socialSecurityUrl = info.file.response.data;
|
|
|
+ this.state.rosterUrl = 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.rosterUrl ? <a onClick={downloadFile.bind(null, theData.rosterUrl, theData.rosterDownloadFileName)}>{theData.rosterDownloadFileName}</a> : <span>未上传!</span>}</p>
|
|
|
</div>
|
|
|
<div className="hrSituation-roster">
|
|
|
<Upload
|
|
|
- name="roster"
|
|
|
+ name="ratepay"
|
|
|
action={globalConfig.context + "/techservice/cognizance/upload"}
|
|
|
- data={{ 'sign': this.props.year + 'roster' }}
|
|
|
- beforeUpload={beforeUpload}
|
|
|
+ data={{ 'sign': 'social_security_' + ( this.state.year || theData.year ) }}
|
|
|
+ beforeUpload={beforeUploadFile}
|
|
|
+ showUploadList={false}
|
|
|
onChange={(info) => {
|
|
|
if (info.file.status !== 'uploading') {
|
|
|
console.log(info.file, info.fileList);
|
|
@@ -484,14 +493,15 @@ const HrSituationDescFrom = Form.create()(React.createClass({
|
|
|
message.warning(info.file.response.error[0].message);
|
|
|
return;
|
|
|
};
|
|
|
- this.state.rosterUrl = info.file.response.data;
|
|
|
+ this.state.socialSecurityUrl = 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.socialSecurityUrl ? <a onClick={downloadFile.bind(null, theData.socialSecurityUrl, theData.socialSecurityDownloadFileName)}>{theData.socialSecurityDownloadFileName}</a> : <span>未上传!</span>}</p>
|
|
|
</div>
|
|
|
<div>
|
|
|
<span style={{ color: "red" }}>提示</span>
|
|
@@ -526,7 +536,7 @@ const HrSituationDesc = React.createClass({
|
|
|
this.setState({
|
|
|
visible: false,
|
|
|
});
|
|
|
- this.props.closeDesc(false,true);
|
|
|
+ this.props.closeDesc(false, true);
|
|
|
},
|
|
|
handleCancel(e) {
|
|
|
this.setState({
|
|
@@ -549,7 +559,10 @@ const HrSituationDesc = React.createClass({
|
|
|
footer=''
|
|
|
>
|
|
|
<HrSituationDescFrom data={this.props.data}
|
|
|
- spinState={this.spinChange} closeModal={this.handleCancel} clickOk={this.handleOk} />
|
|
|
+ visible={this.state.visible}
|
|
|
+ spinState={this.spinChange}
|
|
|
+ closeModal={this.handleCancel}
|
|
|
+ clickOk={this.handleOk} />
|
|
|
</Modal>
|
|
|
</Spin>
|
|
|
</div>
|
|
@@ -610,7 +623,13 @@ const HrSituation = React.createClass({
|
|
|
techTotal: thisdata.techTotal,
|
|
|
thirtyoneToThirtyfour: thisdata.thirtyoneToThirtyfour,
|
|
|
undergraduate: thisdata.undergraduate,
|
|
|
- attachment: [thisdata.rosterDownloadFileName, thisdata.socialSecurityDownloadFileName],
|
|
|
+
|
|
|
+ rosterUrl: thisdata.rosterUrl,
|
|
|
+ rosterDownloadFileName: thisdata.rosterDownloadFileName,
|
|
|
+ socialSecurityUrl: thisdata.socialSecurityUrl,
|
|
|
+ socialSecurityDownloadFileName: thisdata.socialSecurityDownloadFileName,
|
|
|
+
|
|
|
+ attachment: [thisdata.rosterUrl, thisdata.rosterDownloadFileName, thisdata.socialSecurityUrl, thisdata.socialSecurityDownloadFileName],
|
|
|
newEmployment: thisdata.newEmployment,
|
|
|
graduateNumber: thisdata.graduateNumber
|
|
|
});
|
|
@@ -674,9 +693,10 @@ const HrSituation = React.createClass({
|
|
|
dataIndex: 'attachment',
|
|
|
key: 'attachment',
|
|
|
render: (text) => {
|
|
|
- <a href="" onClick={() => {
|
|
|
- window.open(globalConfig.context + "/techservice/patent/downloadFile?path=" + text + "&sign=" + "type")
|
|
|
- }}></a>
|
|
|
+ return <div>
|
|
|
+ <a style={{marginRight:'10px'}} onClick={downloadFile.bind(null, text[0], text[1])}> {text[1]} </a>
|
|
|
+ <a onClick={downloadFile.bind(null, text[2], text[3])}> {text[3]} </a>
|
|
|
+ </div>
|
|
|
}
|
|
|
}
|
|
|
],
|