|
@@ -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';
|
|
@@ -85,7 +85,7 @@ const HrSituationDescFrom = Form.create()(React.createClass({
|
|
|
}).done(function (data) {
|
|
|
if (!data.error.length) {
|
|
|
message.success('保存成功!');
|
|
|
- this.props.closeModal();
|
|
|
+ this.props.clickOk();
|
|
|
this.props.spinState(false);
|
|
|
this.props.form.resetFields();
|
|
|
} else {
|
|
@@ -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">
|
|
@@ -134,7 +140,7 @@ const HrSituationDescFrom = Form.create()(React.createClass({
|
|
|
label="企业职工"
|
|
|
>
|
|
|
{getFieldDecorator('firmTotal', {
|
|
|
- initialValue: this.props.data.firmTotal || null
|
|
|
+ initialValue: this.props.data.firmTotal || 0
|
|
|
})(
|
|
|
<InputNumber />
|
|
|
)}
|
|
@@ -144,7 +150,7 @@ const HrSituationDescFrom = Form.create()(React.createClass({
|
|
|
label="科技人员"
|
|
|
>
|
|
|
{getFieldDecorator('techTotal', {
|
|
|
- initialValue: this.props.data.techTotal || null
|
|
|
+ initialValue: this.props.data.techTotal || 0
|
|
|
})(
|
|
|
<InputNumber />
|
|
|
)}
|
|
@@ -165,7 +171,7 @@ const HrSituationDescFrom = Form.create()(React.createClass({
|
|
|
label="企业职工"
|
|
|
>
|
|
|
{getFieldDecorator('firmInService', {
|
|
|
- initialValue: this.props.data.firmInService || null
|
|
|
+ initialValue: this.props.data.firmInService || 0
|
|
|
})(
|
|
|
<InputNumber />
|
|
|
)}
|
|
@@ -175,7 +181,7 @@ const HrSituationDescFrom = Form.create()(React.createClass({
|
|
|
label="科技人员"
|
|
|
>
|
|
|
{getFieldDecorator('techInService', {
|
|
|
- initialValue: this.props.data.techInService || null
|
|
|
+ initialValue: this.props.data.techInService || 0
|
|
|
})(
|
|
|
<InputNumber />
|
|
|
)}
|
|
@@ -186,7 +192,7 @@ const HrSituationDescFrom = Form.create()(React.createClass({
|
|
|
label="企业职工"
|
|
|
>
|
|
|
{getFieldDecorator('firmPartTime', {
|
|
|
- initialValue: this.props.data.firmPartTime || null
|
|
|
+ initialValue: this.props.data.firmPartTime || 0
|
|
|
})(
|
|
|
<InputNumber />
|
|
|
)}
|
|
@@ -196,7 +202,7 @@ const HrSituationDescFrom = Form.create()(React.createClass({
|
|
|
label="科技人员"
|
|
|
>
|
|
|
{getFieldDecorator('techPartTime', {
|
|
|
- initialValue: this.props.data.techPartTime || null
|
|
|
+ initialValue: this.props.data.techPartTime || 0
|
|
|
})(
|
|
|
<InputNumber />
|
|
|
)}
|
|
@@ -207,7 +213,7 @@ const HrSituationDescFrom = Form.create()(React.createClass({
|
|
|
label="企业职工"
|
|
|
>
|
|
|
{getFieldDecorator('firmTemporary', {
|
|
|
- initialValue: this.props.data.firmTemporary || null
|
|
|
+ initialValue: this.props.data.firmTemporary || 0
|
|
|
})(
|
|
|
<InputNumber />
|
|
|
)}
|
|
@@ -217,7 +223,7 @@ const HrSituationDescFrom = Form.create()(React.createClass({
|
|
|
label="科技人员"
|
|
|
>
|
|
|
{getFieldDecorator('techTemporary', {
|
|
|
- initialValue: this.props.data.techTemporary || null
|
|
|
+ initialValue: this.props.data.techTemporary || 0
|
|
|
})(
|
|
|
<InputNumber />
|
|
|
)}
|
|
@@ -228,7 +234,7 @@ const HrSituationDescFrom = Form.create()(React.createClass({
|
|
|
label="企业职工"
|
|
|
>
|
|
|
{getFieldDecorator('firmForeign', {
|
|
|
- initialValue: this.props.data.firmForeign || null
|
|
|
+ initialValue: this.props.data.firmForeign || 0
|
|
|
})(
|
|
|
<InputNumber />
|
|
|
)}
|
|
@@ -238,7 +244,7 @@ const HrSituationDescFrom = Form.create()(React.createClass({
|
|
|
label="科技人员"
|
|
|
>
|
|
|
{getFieldDecorator('techForeign', {
|
|
|
- initialValue: this.props.data.techForeign || null
|
|
|
+ initialValue: this.props.data.techForeign || 0
|
|
|
})(
|
|
|
<InputNumber />
|
|
|
)}
|
|
@@ -249,7 +255,7 @@ const HrSituationDescFrom = Form.create()(React.createClass({
|
|
|
label="企业职工"
|
|
|
>
|
|
|
{getFieldDecorator('firmAbroad', {
|
|
|
- initialValue: this.props.data.firmAbroad || null
|
|
|
+ initialValue: this.props.data.firmAbroad || 0
|
|
|
})(
|
|
|
<InputNumber />
|
|
|
)}
|
|
@@ -259,7 +265,7 @@ const HrSituationDescFrom = Form.create()(React.createClass({
|
|
|
label="科技人员"
|
|
|
>
|
|
|
{getFieldDecorator('techAbroad', {
|
|
|
- initialValue: this.props.data.techAbroad || null
|
|
|
+ initialValue: this.props.data.techAbroad || 0
|
|
|
})(
|
|
|
<InputNumber />
|
|
|
)}
|
|
@@ -270,7 +276,7 @@ const HrSituationDescFrom = Form.create()(React.createClass({
|
|
|
label="企业职工"
|
|
|
>
|
|
|
{getFieldDecorator('firmCore', {
|
|
|
- initialValue: this.props.data.firmCore || null
|
|
|
+ initialValue: this.props.data.firmCore || 0
|
|
|
})(
|
|
|
<InputNumber />
|
|
|
)}
|
|
@@ -280,7 +286,7 @@ const HrSituationDescFrom = Form.create()(React.createClass({
|
|
|
label="科技人员"
|
|
|
>
|
|
|
{getFieldDecorator('techCore', {
|
|
|
- initialValue: this.props.data.techCore || null
|
|
|
+ initialValue: this.props.data.techCore || 0
|
|
|
})(
|
|
|
<InputNumber />
|
|
|
)}
|
|
@@ -294,7 +300,7 @@ const HrSituationDescFrom = Form.create()(React.createClass({
|
|
|
label="博士"
|
|
|
>
|
|
|
{getFieldDecorator('doctor', {
|
|
|
- initialValue: this.props.data.doctor || null
|
|
|
+ initialValue: this.props.data.doctor || 0
|
|
|
})(
|
|
|
<InputNumber />
|
|
|
)}
|
|
@@ -304,7 +310,7 @@ const HrSituationDescFrom = Form.create()(React.createClass({
|
|
|
label="硕士"
|
|
|
>
|
|
|
{getFieldDecorator('master', {
|
|
|
- initialValue: this.props.data.master || null
|
|
|
+ initialValue: this.props.data.master || 0
|
|
|
})(
|
|
|
<InputNumber />
|
|
|
)}
|
|
@@ -314,7 +320,7 @@ const HrSituationDescFrom = Form.create()(React.createClass({
|
|
|
label="本科"
|
|
|
>
|
|
|
{getFieldDecorator('undergraduate', {
|
|
|
- initialValue: this.props.data.undergraduate || null
|
|
|
+ initialValue: this.props.data.undergraduate || 0
|
|
|
})(
|
|
|
<InputNumber />
|
|
|
)}
|
|
@@ -324,7 +330,7 @@ const HrSituationDescFrom = Form.create()(React.createClass({
|
|
|
label="大专及以下"
|
|
|
>
|
|
|
{getFieldDecorator('college', {
|
|
|
- initialValue: this.props.data.college || null
|
|
|
+ initialValue: this.props.data.college || 0
|
|
|
})(
|
|
|
<InputNumber />
|
|
|
)}
|
|
@@ -337,7 +343,7 @@ const HrSituationDescFrom = Form.create()(React.createClass({
|
|
|
label="高级职称"
|
|
|
>
|
|
|
{getFieldDecorator('seniorTitle', {
|
|
|
- initialValue: this.props.data.seniorTitle || null
|
|
|
+ initialValue: this.props.data.seniorTitle || 0
|
|
|
})(
|
|
|
<InputNumber />
|
|
|
)}
|
|
@@ -347,7 +353,7 @@ const HrSituationDescFrom = Form.create()(React.createClass({
|
|
|
label="中级职称"
|
|
|
>
|
|
|
{getFieldDecorator('intermediateTitle', {
|
|
|
- initialValue: this.props.data.intermediateTitle || null
|
|
|
+ initialValue: this.props.data.intermediateTitle || 0
|
|
|
})(
|
|
|
<InputNumber />
|
|
|
)}
|
|
@@ -357,7 +363,7 @@ const HrSituationDescFrom = Form.create()(React.createClass({
|
|
|
label="初级职称"
|
|
|
>
|
|
|
{getFieldDecorator('juniorTitle', {
|
|
|
- initialValue: this.props.data.juniorTitle || null
|
|
|
+ initialValue: this.props.data.juniorTitle || 0
|
|
|
})(
|
|
|
<InputNumber />
|
|
|
)}
|
|
@@ -367,7 +373,7 @@ const HrSituationDescFrom = Form.create()(React.createClass({
|
|
|
label="高级技工"
|
|
|
>
|
|
|
{getFieldDecorator('seniorMechanic', {
|
|
|
- initialValue: this.props.data.seniorMechanic || null
|
|
|
+ initialValue: this.props.data.seniorMechanic || 0
|
|
|
})(
|
|
|
<InputNumber />
|
|
|
)}
|
|
@@ -380,7 +386,7 @@ const HrSituationDescFrom = Form.create()(React.createClass({
|
|
|
label="30及以下"
|
|
|
>
|
|
|
{getFieldDecorator('belowThirty', {
|
|
|
- initialValue: this.props.data.belowThirty || null
|
|
|
+ initialValue: this.props.data.belowThirty || 0
|
|
|
})(
|
|
|
<InputNumber />
|
|
|
)}
|
|
@@ -390,7 +396,7 @@ const HrSituationDescFrom = Form.create()(React.createClass({
|
|
|
label="31-34"
|
|
|
>
|
|
|
{getFieldDecorator('thirtyoneToThirtyfour', {
|
|
|
- initialValue: this.props.data.thirtyoneToThirtyfour || null
|
|
|
+ initialValue: this.props.data.thirtyoneToThirtyfour || 0
|
|
|
})(
|
|
|
<InputNumber />
|
|
|
)}
|
|
@@ -400,7 +406,7 @@ const HrSituationDescFrom = Form.create()(React.createClass({
|
|
|
label="41-50"
|
|
|
>
|
|
|
{getFieldDecorator('fortyoneToFifty', {
|
|
|
- initialValue: this.props.data.fortyoneToFifty || null
|
|
|
+ initialValue: this.props.data.fortyoneToFifty || 0
|
|
|
})(
|
|
|
<InputNumber />
|
|
|
)}
|
|
@@ -410,7 +416,7 @@ const HrSituationDescFrom = Form.create()(React.createClass({
|
|
|
label="50以上"
|
|
|
>
|
|
|
{getFieldDecorator('aboveFifty', {
|
|
|
- initialValue: this.props.data.aboveFifty || null
|
|
|
+ initialValue: this.props.data.aboveFifty || 0
|
|
|
})(
|
|
|
<InputNumber />
|
|
|
)}
|
|
@@ -424,7 +430,7 @@ const HrSituationDescFrom = Form.create()(React.createClass({
|
|
|
label="新增就业人数"
|
|
|
>
|
|
|
{getFieldDecorator('newEmployment', {
|
|
|
- initialValue: this.props.data.newEmployment || null
|
|
|
+ initialValue: this.props.data.newEmployment || 0
|
|
|
})(
|
|
|
<InputNumber />
|
|
|
)}
|
|
@@ -435,7 +441,7 @@ const HrSituationDescFrom = Form.create()(React.createClass({
|
|
|
label="高校应届毕业生人数"
|
|
|
>
|
|
|
{getFieldDecorator('graduateNumber', {
|
|
|
- initialValue: this.props.data.graduateNumber || null
|
|
|
+ initialValue: this.props.data.graduateNumber || 0
|
|
|
})(
|
|
|
<InputNumber />
|
|
|
)}
|
|
@@ -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><Icon type="exclamation-circle" style={{ color: '#ffbf00', marginRight: '6px' }} />未上传!</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><Icon type="exclamation-circle" style={{ color: '#ffbf00', marginRight: '6px' }} />未上传!</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);
|
|
|
+ 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} />
|
|
|
+ visible={this.state.visible}
|
|
|
+ spinState={this.spinChange}
|
|
|
+ closeModal={this.handleCancel}
|
|
|
+ clickOk={this.handleOk} />
|
|
|
</Modal>
|
|
|
</Spin>
|
|
|
</div>
|
|
@@ -573,8 +586,11 @@ const HrSituation = React.createClass({
|
|
|
pageSize: this.state.pagination.pageSize
|
|
|
}
|
|
|
}).done((data) => {
|
|
|
- if (data.error.length || !data.data || !data.data.list) {
|
|
|
- message.warning(data.error[0].message);
|
|
|
+ if (!data.data) {
|
|
|
+ if (data.error && data.error.length) {
|
|
|
+ message.warning(data.error[0].message);
|
|
|
+ this.state.ButtonDisabled = true;
|
|
|
+ }
|
|
|
return;
|
|
|
};
|
|
|
for (let i = 0; i < data.data.list.length; i++) {
|
|
@@ -610,7 +626,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 +696,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>
|
|
|
}
|
|
|
}
|
|
|
],
|
|
@@ -724,9 +747,11 @@ const HrSituation = React.createClass({
|
|
|
this.loadData();
|
|
|
}.bind(this));
|
|
|
},
|
|
|
- closeDesc(e) {
|
|
|
+ closeDesc(e, s) {
|
|
|
this.state.showDesc = e;
|
|
|
- this.loadData();
|
|
|
+ if (s) {
|
|
|
+ this.loadData();
|
|
|
+ };
|
|
|
},
|
|
|
render() {
|
|
|
const rowSelection = {
|
|
@@ -747,6 +772,7 @@ const HrSituation = React.createClass({
|
|
|
<div className="user-search">
|
|
|
<p>
|
|
|
<Button style={{ background: "#ea0862", border: "none", color: "#fff" }}
|
|
|
+ disabled={this.state.ButtonDisabled}
|
|
|
onClick={this.tableRowClick}>添加<Icon type="plus" /></Button>
|
|
|
<Button style={{ background: "#3fcf9e", border: "none", color: "#fff" }}
|
|
|
disabled={!hasSelected}
|