|
@@ -1,58 +1,12 @@
|
|
|
import React from 'react';
|
|
|
-import { Input, InputNumber, Button, Form, Icon, Spin, message, Tabs, Upload } from 'antd';
|
|
|
+import { Input, InputNumber, Button, Form, Icon, Spin, message, Table, Modal, Upload } from 'antd';
|
|
|
import { beforeUpload } from '../../tools.js';
|
|
|
-import './person.less';
|
|
|
import './hrSituation.less'
|
|
|
import ajax from 'jquery/src/ajax/xhr.js'
|
|
|
import $ from 'jquery/src/ajax';
|
|
|
|
|
|
|
|
|
-const PersonFrom = Form.create()(React.createClass({
|
|
|
- getData() {
|
|
|
- this.props.spinState(true);
|
|
|
- $.ajax({
|
|
|
- method: "get",
|
|
|
- dataType: "json",
|
|
|
- url: globalConfig.context + "/api/user/humanResource",
|
|
|
- data: {
|
|
|
- year: this.props.year
|
|
|
- },
|
|
|
- success: function (data) {
|
|
|
- if (data.data) {
|
|
|
- this.setState({
|
|
|
- aboveFifty: data.data.aboveFifty,
|
|
|
- belowThirty: data.data.belowThirty,
|
|
|
- college: data.data.college,
|
|
|
- doctor: data.data.doctor,
|
|
|
- firmAbroad: data.data.firmAbroad,
|
|
|
- firmCore: data.data.firmCore,
|
|
|
- firmForeign: data.data.firmForeign,
|
|
|
- firmInService: data.data.firmInService,
|
|
|
- firmPartTime: data.data.firmPartTime,
|
|
|
- firmTemporary: data.data.firmTemporary,
|
|
|
- firmTotal: data.data.firmTotal,
|
|
|
- fortyoneToFifty: data.data.fortyoneToFifty,
|
|
|
- intermediateTitle: data.data.intermediateTitle,
|
|
|
- juniorTitle: data.data.juniorTitle,
|
|
|
- master: data.data.master,
|
|
|
- seniorMechanic: data.data.seniorMechanic,
|
|
|
- seniorTitle: data.data.seniorTitle,
|
|
|
- techAbroad: data.data.techAbroad,
|
|
|
- techCore: data.data.techCore,
|
|
|
- techForeign: data.data.techForeign,
|
|
|
- techInService: data.data.techInService,
|
|
|
- techPartTime: data.data.techPartTime,
|
|
|
- techTemporary: data.data.techTemporary,
|
|
|
- techTotal: data.data.techTotal,
|
|
|
- thirtyoneToThirtyfour: data.data.thirtyoneToThirtyfour,
|
|
|
- undergraduate: data.data.undergraduate
|
|
|
- });
|
|
|
- }
|
|
|
- }.bind(this),
|
|
|
- }).always(function () {
|
|
|
- this.props.spinState(false);
|
|
|
- }.bind(this));
|
|
|
- },
|
|
|
+const HrSituationDescFrom = Form.create()(React.createClass({
|
|
|
getInitialState() {
|
|
|
return {
|
|
|
loading: false
|
|
@@ -82,15 +36,20 @@ const PersonFrom = Form.create()(React.createClass({
|
|
|
message.warning("全体人员结构中年龄一栏人数总和小于等于职工人数!");
|
|
|
return;
|
|
|
};
|
|
|
+ if (values.year) {
|
|
|
+ message.warning("请输入年份!");
|
|
|
+ return;
|
|
|
+ }
|
|
|
if (!err) {
|
|
|
this.props.spinState(true);
|
|
|
$.ajax({
|
|
|
method: "POST",
|
|
|
dataType: "json",
|
|
|
crossDomain: false,
|
|
|
- url: globalConfig.context + "/api/user/SaveHumanResource",
|
|
|
+ url: globalConfig.context + "/techservice/cognizance/updateOrgHumanResource",
|
|
|
data: {
|
|
|
- year: this.props.year,
|
|
|
+ id: this.props.data.id,
|
|
|
+ year: values.data.year,
|
|
|
aboveFifty: values.aboveFifty,
|
|
|
belowThirty: values.belowThirty,
|
|
|
college: values.college,
|
|
@@ -118,23 +77,24 @@ const PersonFrom = Form.create()(React.createClass({
|
|
|
thirtyoneToThirtyfour: values.thirtyoneToThirtyfour,
|
|
|
undergraduate: values.undergraduate,
|
|
|
rosterUrl: this.state.rosterUrl,
|
|
|
- socialSecurityUrl: this.state.socialSecurityUrl
|
|
|
+ socialSecurityUrl: this.state.socialSecurityUrl,
|
|
|
+ neweEmployment: values.neweEmployment,
|
|
|
+ graduateNumber: values.graduateNumber
|
|
|
}
|
|
|
}).done(function (data) {
|
|
|
if (!data.error.length) {
|
|
|
message.success('保存成功!');
|
|
|
+ this.props.closeModal();
|
|
|
+ this.props.spinState(false);
|
|
|
+ this.props.form.resetFields();
|
|
|
} else {
|
|
|
message.warning(data.error[0].message);
|
|
|
+ this.props.spinState(false);
|
|
|
}
|
|
|
- }.bind(this)).always(function () {
|
|
|
- this.props.spinState(false);
|
|
|
}.bind(this));
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- componentWillMount() {
|
|
|
- this.getData();
|
|
|
- },
|
|
|
render() {
|
|
|
const { getFieldDecorator } = this.props.form;
|
|
|
const formItemLayout = {
|
|
@@ -144,6 +104,18 @@ const PersonFrom = Form.create()(React.createClass({
|
|
|
const FormItem = Form.Item;
|
|
|
return (
|
|
|
<Form onSubmit={this.handleSubmit} className="hrSituation-form">
|
|
|
+ <div className="clearfix">
|
|
|
+ <FormItem className="half-item"
|
|
|
+ {...formItemLayout}
|
|
|
+ label="年份"
|
|
|
+ >
|
|
|
+ {getFieldDecorator('year', {
|
|
|
+ initialValue: this.props.data.year || null
|
|
|
+ })(
|
|
|
+ <InputNumber />
|
|
|
+ )}
|
|
|
+ </FormItem>
|
|
|
+ </div>
|
|
|
<p className="hrSituation-title">总体情况</p>
|
|
|
<div className="clearfix">
|
|
|
<span className="hrSituation-span">总数(人)</span>
|
|
@@ -152,7 +124,7 @@ const PersonFrom = Form.create()(React.createClass({
|
|
|
label="企业职工"
|
|
|
>
|
|
|
{getFieldDecorator('firmTotal', {
|
|
|
- initialValue: this.state.firmTotal || null
|
|
|
+ initialValue: this.props.data.firmTotal || null
|
|
|
})(
|
|
|
<InputNumber />
|
|
|
)}
|
|
@@ -162,7 +134,7 @@ const PersonFrom = Form.create()(React.createClass({
|
|
|
label="科技人员"
|
|
|
>
|
|
|
{getFieldDecorator('techTotal', {
|
|
|
- initialValue: this.state.techTotal || null
|
|
|
+ initialValue: this.props.data.techTotal || null
|
|
|
})(
|
|
|
<InputNumber />
|
|
|
)}
|
|
@@ -183,7 +155,7 @@ const PersonFrom = Form.create()(React.createClass({
|
|
|
label="企业职工"
|
|
|
>
|
|
|
{getFieldDecorator('firmInService', {
|
|
|
- initialValue: this.state.firmInService || null
|
|
|
+ initialValue: this.props.data.firmInService || null
|
|
|
})(
|
|
|
<InputNumber />
|
|
|
)}
|
|
@@ -193,7 +165,7 @@ const PersonFrom = Form.create()(React.createClass({
|
|
|
label="科技人员"
|
|
|
>
|
|
|
{getFieldDecorator('techInService', {
|
|
|
- initialValue: this.state.techInService || null
|
|
|
+ initialValue: this.props.data.techInService || null
|
|
|
})(
|
|
|
<InputNumber />
|
|
|
)}
|
|
@@ -204,7 +176,7 @@ const PersonFrom = Form.create()(React.createClass({
|
|
|
label="企业职工"
|
|
|
>
|
|
|
{getFieldDecorator('firmPartTime', {
|
|
|
- initialValue: this.state.firmPartTime || null
|
|
|
+ initialValue: this.props.data.firmPartTime || null
|
|
|
})(
|
|
|
<InputNumber />
|
|
|
)}
|
|
@@ -214,7 +186,7 @@ const PersonFrom = Form.create()(React.createClass({
|
|
|
label="科技人员"
|
|
|
>
|
|
|
{getFieldDecorator('techPartTime', {
|
|
|
- initialValue: this.state.techPartTime || null
|
|
|
+ initialValue: this.props.data.techPartTime || null
|
|
|
})(
|
|
|
<InputNumber />
|
|
|
)}
|
|
@@ -225,7 +197,7 @@ const PersonFrom = Form.create()(React.createClass({
|
|
|
label="企业职工"
|
|
|
>
|
|
|
{getFieldDecorator('firmTemporary', {
|
|
|
- initialValue: this.state.firmTemporary || null
|
|
|
+ initialValue: this.props.data.firmTemporary || null
|
|
|
})(
|
|
|
<InputNumber />
|
|
|
)}
|
|
@@ -235,7 +207,7 @@ const PersonFrom = Form.create()(React.createClass({
|
|
|
label="科技人员"
|
|
|
>
|
|
|
{getFieldDecorator('techTemporary', {
|
|
|
- initialValue: this.state.techTemporary || null
|
|
|
+ initialValue: this.props.data.techTemporary || null
|
|
|
})(
|
|
|
<InputNumber />
|
|
|
)}
|
|
@@ -246,7 +218,7 @@ const PersonFrom = Form.create()(React.createClass({
|
|
|
label="企业职工"
|
|
|
>
|
|
|
{getFieldDecorator('firmForeign', {
|
|
|
- initialValue: this.state.firmForeign || null
|
|
|
+ initialValue: this.props.data.firmForeign || null
|
|
|
})(
|
|
|
<InputNumber />
|
|
|
)}
|
|
@@ -256,7 +228,7 @@ const PersonFrom = Form.create()(React.createClass({
|
|
|
label="科技人员"
|
|
|
>
|
|
|
{getFieldDecorator('techForeign', {
|
|
|
- initialValue: this.state.techForeign || null
|
|
|
+ initialValue: this.props.data.techForeign || null
|
|
|
})(
|
|
|
<InputNumber />
|
|
|
)}
|
|
@@ -267,7 +239,7 @@ const PersonFrom = Form.create()(React.createClass({
|
|
|
label="企业职工"
|
|
|
>
|
|
|
{getFieldDecorator('firmAbroad', {
|
|
|
- initialValue: this.state.firmAbroad || null
|
|
|
+ initialValue: this.props.data.firmAbroad || null
|
|
|
})(
|
|
|
<InputNumber />
|
|
|
)}
|
|
@@ -277,7 +249,7 @@ const PersonFrom = Form.create()(React.createClass({
|
|
|
label="科技人员"
|
|
|
>
|
|
|
{getFieldDecorator('techAbroad', {
|
|
|
- initialValue: this.state.techAbroad || null
|
|
|
+ initialValue: this.props.data.techAbroad || null
|
|
|
})(
|
|
|
<InputNumber />
|
|
|
)}
|
|
@@ -288,7 +260,7 @@ const PersonFrom = Form.create()(React.createClass({
|
|
|
label="企业职工"
|
|
|
>
|
|
|
{getFieldDecorator('firmCore', {
|
|
|
- initialValue: this.state.firmCore || null
|
|
|
+ initialValue: this.props.data.firmCore || null
|
|
|
})(
|
|
|
<InputNumber />
|
|
|
)}
|
|
@@ -298,7 +270,7 @@ const PersonFrom = Form.create()(React.createClass({
|
|
|
label="科技人员"
|
|
|
>
|
|
|
{getFieldDecorator('techCore', {
|
|
|
- initialValue: this.state.techCore || null
|
|
|
+ initialValue: this.props.data.techCore || null
|
|
|
})(
|
|
|
<InputNumber />
|
|
|
)}
|
|
@@ -312,7 +284,7 @@ const PersonFrom = Form.create()(React.createClass({
|
|
|
label="博士"
|
|
|
>
|
|
|
{getFieldDecorator('doctor', {
|
|
|
- initialValue: this.state.doctor || null
|
|
|
+ initialValue: this.props.data.doctor || null
|
|
|
})(
|
|
|
<InputNumber />
|
|
|
)}
|
|
@@ -322,7 +294,7 @@ const PersonFrom = Form.create()(React.createClass({
|
|
|
label="硕士"
|
|
|
>
|
|
|
{getFieldDecorator('master', {
|
|
|
- initialValue: this.state.master || null
|
|
|
+ initialValue: this.props.data.master || null
|
|
|
})(
|
|
|
<InputNumber />
|
|
|
)}
|
|
@@ -332,7 +304,7 @@ const PersonFrom = Form.create()(React.createClass({
|
|
|
label="本科"
|
|
|
>
|
|
|
{getFieldDecorator('undergraduate', {
|
|
|
- initialValue: this.state.undergraduate || null
|
|
|
+ initialValue: this.props.data.undergraduate || null
|
|
|
})(
|
|
|
<InputNumber />
|
|
|
)}
|
|
@@ -342,7 +314,7 @@ const PersonFrom = Form.create()(React.createClass({
|
|
|
label="大专及以下"
|
|
|
>
|
|
|
{getFieldDecorator('college', {
|
|
|
- initialValue: this.state.college || null
|
|
|
+ initialValue: this.props.data.college || null
|
|
|
})(
|
|
|
<InputNumber />
|
|
|
)}
|
|
@@ -355,7 +327,7 @@ const PersonFrom = Form.create()(React.createClass({
|
|
|
label="高级职称"
|
|
|
>
|
|
|
{getFieldDecorator('seniorTitle', {
|
|
|
- initialValue: this.state.seniorTitle || null
|
|
|
+ initialValue: this.props.data.seniorTitle || null
|
|
|
})(
|
|
|
<InputNumber />
|
|
|
)}
|
|
@@ -365,7 +337,7 @@ const PersonFrom = Form.create()(React.createClass({
|
|
|
label="中级职称"
|
|
|
>
|
|
|
{getFieldDecorator('intermediateTitle', {
|
|
|
- initialValue: this.state.intermediateTitle || null
|
|
|
+ initialValue: this.props.data.intermediateTitle || null
|
|
|
})(
|
|
|
<InputNumber />
|
|
|
)}
|
|
@@ -375,7 +347,7 @@ const PersonFrom = Form.create()(React.createClass({
|
|
|
label="初级职称"
|
|
|
>
|
|
|
{getFieldDecorator('juniorTitle', {
|
|
|
- initialValue: this.state.juniorTitle || null
|
|
|
+ initialValue: this.props.data.juniorTitle || null
|
|
|
})(
|
|
|
<InputNumber />
|
|
|
)}
|
|
@@ -385,7 +357,7 @@ const PersonFrom = Form.create()(React.createClass({
|
|
|
label="高级技工"
|
|
|
>
|
|
|
{getFieldDecorator('seniorMechanic', {
|
|
|
- initialValue: this.state.seniorMechanic || null
|
|
|
+ initialValue: this.props.data.seniorMechanic || null
|
|
|
})(
|
|
|
<InputNumber />
|
|
|
)}
|
|
@@ -398,7 +370,7 @@ const PersonFrom = Form.create()(React.createClass({
|
|
|
label="30及以下"
|
|
|
>
|
|
|
{getFieldDecorator('belowThirty', {
|
|
|
- initialValue: this.state.belowThirty || null
|
|
|
+ initialValue: this.props.data.belowThirty || null
|
|
|
})(
|
|
|
<InputNumber />
|
|
|
)}
|
|
@@ -408,7 +380,7 @@ const PersonFrom = Form.create()(React.createClass({
|
|
|
label="31-34"
|
|
|
>
|
|
|
{getFieldDecorator('thirtyoneToThirtyfour', {
|
|
|
- initialValue: this.state.thirtyoneToThirtyfour || null
|
|
|
+ initialValue: this.props.data.thirtyoneToThirtyfour || null
|
|
|
})(
|
|
|
<InputNumber />
|
|
|
)}
|
|
@@ -418,7 +390,7 @@ const PersonFrom = Form.create()(React.createClass({
|
|
|
label="41-50"
|
|
|
>
|
|
|
{getFieldDecorator('fortyoneToFifty', {
|
|
|
- initialValue: this.state.fortyoneToFifty || null
|
|
|
+ initialValue: this.props.data.fortyoneToFifty || null
|
|
|
})(
|
|
|
<InputNumber />
|
|
|
)}
|
|
@@ -428,7 +400,32 @@ const PersonFrom = Form.create()(React.createClass({
|
|
|
label="50以上"
|
|
|
>
|
|
|
{getFieldDecorator('aboveFifty', {
|
|
|
- initialValue: this.state.aboveFifty || null
|
|
|
+ initialValue: this.props.data.aboveFifty || null
|
|
|
+ })(
|
|
|
+ <InputNumber />
|
|
|
+ )}
|
|
|
+ </FormItem>
|
|
|
+ </div>
|
|
|
+ <p className="hrSituation-title">每年新增员工数</p>
|
|
|
+ <div className="clearfix">
|
|
|
+ <FormItem
|
|
|
+ labelCol={{ span: 16 }}
|
|
|
+ wrapperCol={{ span: 8 }}
|
|
|
+ label="新增就业人数"
|
|
|
+ >
|
|
|
+ {getFieldDecorator('neweEmployment', {
|
|
|
+ initialValue: this.props.data.neweEmployment || null
|
|
|
+ })(
|
|
|
+ <InputNumber />
|
|
|
+ )}
|
|
|
+ </FormItem>
|
|
|
+ <FormItem
|
|
|
+ labelCol={{ span: 16 }}
|
|
|
+ wrapperCol={{ span: 8 }}
|
|
|
+ label="高校应届毕业生人数"
|
|
|
+ >
|
|
|
+ {getFieldDecorator('graduateNumber', {
|
|
|
+ initialValue: this.props.data.graduateNumber || null
|
|
|
})(
|
|
|
<InputNumber />
|
|
|
)}
|
|
@@ -490,39 +487,267 @@ const PersonFrom = Form.create()(React.createClass({
|
|
|
},
|
|
|
}));
|
|
|
|
|
|
-const Person = React.createClass({
|
|
|
+const HrSituationDesc = React.createClass({
|
|
|
getInitialState() {
|
|
|
return {
|
|
|
+ visible: false,
|
|
|
loading: false
|
|
|
};
|
|
|
},
|
|
|
+ componentWillReceiveProps(nextProps) {
|
|
|
+ this.state.visible = nextProps.showDesc
|
|
|
+ },
|
|
|
+ showModal() {
|
|
|
+ this.setState({
|
|
|
+ visible: true,
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleOk() {
|
|
|
+ this.setState({
|
|
|
+ visible: false,
|
|
|
+ });
|
|
|
+ this.props.closeDesc(false);
|
|
|
+ },
|
|
|
+ handleCancel(e) {
|
|
|
+ this.setState({
|
|
|
+ visible: false,
|
|
|
+ });
|
|
|
+ this.props.closeDesc(false);
|
|
|
+ },
|
|
|
spinChange(e) {
|
|
|
this.setState({
|
|
|
loading: e
|
|
|
});
|
|
|
},
|
|
|
render() {
|
|
|
- const theYear = (new Date()).getFullYear() - 1;
|
|
|
return (
|
|
|
- <Spin spinning={this.state.loading} className='spin-box'>
|
|
|
- <div className="set-person">
|
|
|
- <div className="acc-detail">
|
|
|
- <Tabs defaultActiveKey={String(theYear)} >
|
|
|
- <Tabs.TabPane tab={theYear} key={theYear}>
|
|
|
- <PersonFrom year={theYear} spinState={this.spinChange} urlData={this.urlData} />
|
|
|
- </Tabs.TabPane>
|
|
|
- <Tabs.TabPane tab={theYear - 1} key={theYear - 1}>
|
|
|
- <PersonFrom year={theYear - 1} spinState={this.spinChange} urlData={this.urlData} />
|
|
|
- </Tabs.TabPane>
|
|
|
- <Tabs.TabPane tab={theYear - 2} key={theYear - 2}>
|
|
|
- <PersonFrom year={theYear - 2} spinState={this.spinChange} urlData={this.urlData} />
|
|
|
- </Tabs.TabPane>
|
|
|
- </Tabs>
|
|
|
- </div>
|
|
|
+ <div className="patent-addNew">
|
|
|
+ <Spin spinning={this.state.loading} className='spin-box'>
|
|
|
+ <Modal title="人力资源状况" visible={this.state.visible}
|
|
|
+ onOk={this.handleOk} onCancel={this.handleCancel}
|
|
|
+ width='1200px'
|
|
|
+ footer=''
|
|
|
+ >
|
|
|
+ <HrSituationDescFrom data={this.props.data}
|
|
|
+ spinState={this.spinChange} closeModal={this.handleCancel} />
|
|
|
+ </Modal>
|
|
|
+ </Spin>
|
|
|
+ </div>
|
|
|
+ );
|
|
|
+ },
|
|
|
+});
|
|
|
+
|
|
|
+const HrSituation = React.createClass({
|
|
|
+ loadData(pageNo) {
|
|
|
+ this.state.data = [];
|
|
|
+ this.setState({
|
|
|
+ loading: true
|
|
|
+ });
|
|
|
+ $.ajax({
|
|
|
+ method: "post",
|
|
|
+ dataType: "json",
|
|
|
+ crossDomain: false,
|
|
|
+ url: globalConfig.context + "/techservice/cognizance/orgHumanResource",
|
|
|
+ data: {
|
|
|
+ pageNo: pageNo || 1,
|
|
|
+ pageSize: this.state.pagination.pageSize,
|
|
|
+ uid: this.props.data.uid
|
|
|
+ }
|
|
|
+ }).done((data) => {
|
|
|
+ if (data.error.length || !data.data || !data.data.list) {
|
|
|
+ message.warning(data.error[0].message);
|
|
|
+ return;
|
|
|
+ };
|
|
|
+ for (let i = 0; i < data.data.list.length; i++) {
|
|
|
+ let thisdata = data.data.list[i];
|
|
|
+ this.state.data.push({
|
|
|
+ key: i,
|
|
|
+ id: thisdata.id,
|
|
|
+ uid: thisdata.uid,
|
|
|
+ year: thisdata.year,
|
|
|
+ aboveFifty: thisdata.aboveFifty,
|
|
|
+ belowThirty: thisdata.belowThirty,
|
|
|
+ college: thisdata.college,
|
|
|
+ doctor: thisdata.doctor,
|
|
|
+ firmAbroad: thisdata.firmAbroad,
|
|
|
+ firmCore: thisdata.firmCore,
|
|
|
+ firmForeign: thisdata.firmForeign,
|
|
|
+ firmInService: thisdata.firmInService,
|
|
|
+ firmPartTime: thisdata.firmPartTime,
|
|
|
+ firmTemporary: thisdata.firmTemporary,
|
|
|
+ firmTotal: thisdata.firmTotal,
|
|
|
+ fortyoneToFifty: thisdata.fortyoneToFifty,
|
|
|
+ intermediateTitle: thisdata.intermediateTitle,
|
|
|
+ juniorTitle: thisdata.juniorTitle,
|
|
|
+ master: thisdata.master,
|
|
|
+ seniorMechanic: thisdata.seniorMechanic,
|
|
|
+ seniorTitle: thisdata.seniorTitle,
|
|
|
+ techAbroad: thisdata.techAbroad,
|
|
|
+ techCore: thisdata.techCore,
|
|
|
+ techForeign: thisdata.techForeign,
|
|
|
+ techInService: thisdata.techInService,
|
|
|
+ techPartTime: thisdata.techPartTime,
|
|
|
+ techTemporary: thisdata.techTemporary,
|
|
|
+ techTotal: thisdata.techTotal,
|
|
|
+ thirtyoneToThirtyfour: thisdata.thirtyoneToThirtyfour,
|
|
|
+ undergraduate: thisdata.undergraduate,
|
|
|
+ attachment: [thisdata.rosterDownloadFileName, thisdata.socialSecurityDownloadFileName],
|
|
|
+ neweEmployment: thisdata.neweEmployment,
|
|
|
+ graduateNumber: this.graduateNumber
|
|
|
+ });
|
|
|
+ };
|
|
|
+ this.state.pagination.current = data.data.pageNo;
|
|
|
+ this.state.pagination.total = data.data.totalCount;
|
|
|
+ this.setState({
|
|
|
+ dataSource: this.state.data,
|
|
|
+ pagination: this.state.pagination
|
|
|
+ });
|
|
|
+ }).always(function () {
|
|
|
+ this.setState({
|
|
|
+ loading: false
|
|
|
+ });
|
|
|
+ }.bind(this));
|
|
|
+ },
|
|
|
+ getInitialState() {
|
|
|
+ return {
|
|
|
+ selectedRowKeys: [],
|
|
|
+ selectedRows: [],
|
|
|
+ loading: false,
|
|
|
+ pagination: {
|
|
|
+ defaultCurrent: 1,
|
|
|
+ defaultPageSize: 10,
|
|
|
+ showQuickJumper: true,
|
|
|
+ pageSize: 10,
|
|
|
+ onChange: function (page) {
|
|
|
+ this.loadData(page);
|
|
|
+ }.bind(this),
|
|
|
+ showTotal: function (total) {
|
|
|
+ return '共' + total + '条数据';
|
|
|
+ }
|
|
|
+ },
|
|
|
+ columns: [
|
|
|
+ {
|
|
|
+ title: '年份',
|
|
|
+ dataIndex: 'year',
|
|
|
+ key: 'year'
|
|
|
+ }, {
|
|
|
+ title: '总人数',
|
|
|
+ dataIndex: 'firmTotal',
|
|
|
+ key: 'firmTotal'
|
|
|
+ }, {
|
|
|
+ title: '科技人员',
|
|
|
+ dataIndex: 'techTotal',
|
|
|
+ key: 'techTotal'
|
|
|
+ }, {
|
|
|
+ title: '博士人数',
|
|
|
+ dataIndex: 'doctor',
|
|
|
+ key: 'doctor',
|
|
|
+ }, {
|
|
|
+ title: '高级职称人数',
|
|
|
+ dataIndex: 'seniorTitle',
|
|
|
+ key: 'seniorTitle',
|
|
|
+ }, {
|
|
|
+ title: '30岁以下人数',
|
|
|
+ dataIndex: 'belowThirty',
|
|
|
+ key: 'belowThirty',
|
|
|
+ }, {
|
|
|
+ title: '相关附件',
|
|
|
+ dataIndex: 'attachment',
|
|
|
+ key: 'attachment',
|
|
|
+ render: (text) => {
|
|
|
+ <a href="" onClick={() => {
|
|
|
+ window.open(globalConfig.context + "/techservice/patent/downloadFile?path=" + text + "&sign=" + "type")
|
|
|
+ }}></a>
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ dataSource: []
|
|
|
+ };
|
|
|
+ },
|
|
|
+ componentWillMount() {
|
|
|
+ this.loadData();
|
|
|
+ },
|
|
|
+ tableRowClick(record, index) {
|
|
|
+ this.state.RowData = record;
|
|
|
+ this.setState({
|
|
|
+ showDesc: true
|
|
|
+ });
|
|
|
+ },
|
|
|
+ delectRow() {
|
|
|
+ let deletedIds = [];
|
|
|
+ for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
|
|
|
+ let rowItem = this.state.selectedRows[idx];
|
|
|
+ if (rowItem.id) {
|
|
|
+ deletedIds.push(rowItem.id)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.setState({
|
|
|
+ selectedRowKeys: [],
|
|
|
+ loading: deletedIds.length > 0
|
|
|
+ });
|
|
|
+ $.ajax({
|
|
|
+ method: "POST",
|
|
|
+ dataType: "json",
|
|
|
+ crossDomain: false,
|
|
|
+ url: globalConfig.context + "/techservice/cognizance/deleteFinance",
|
|
|
+ data: {
|
|
|
+ ids: deletedIds
|
|
|
+ }
|
|
|
+ }).done(function (data) {
|
|
|
+ if (!data.error.length) {
|
|
|
+ message.success('保存成功!');
|
|
|
+ this.setState({
|
|
|
+ loading: false,
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ message.warning(data.error[0].message);
|
|
|
+ };
|
|
|
+ this.loadData();
|
|
|
+ }.bind(this));
|
|
|
+ },
|
|
|
+ closeDesc(e) {
|
|
|
+ this.state.showDesc = e;
|
|
|
+ this.loadData();
|
|
|
+ },
|
|
|
+ render() {
|
|
|
+ const rowSelection = {
|
|
|
+ selectedRowKeys: this.state.selectedRowKeys,
|
|
|
+ onChange: (selectedRowKeys, selectedRows) => {
|
|
|
+ this.setState({
|
|
|
+ selectedRows: selectedRows,
|
|
|
+ selectedRowKeys: selectedRowKeys
|
|
|
+ });
|
|
|
+ }
|
|
|
+ };
|
|
|
+ const hasSelected = this.state.selectedRowKeys.length > 0;
|
|
|
+ return (
|
|
|
+ <div className="user-content" >
|
|
|
+ <div className="content-title">
|
|
|
+ <span>人力资源状况</span>
|
|
|
+ </div>
|
|
|
+ <div className="user-search">
|
|
|
+ <p>
|
|
|
+ <Button style={{ background: "#ea0862", border: "none", color: "#fff" }}
|
|
|
+ onClick={this.tableRowClick}>添加<Icon type="plus" /></Button>
|
|
|
+ <Button style={{ background: "#3fcf9e", border: "none", color: "#fff" }}
|
|
|
+ disabled={!hasSelected}
|
|
|
+ onClick={this.delectRow}>删除<Icon type="minus" /></Button>
|
|
|
+ </p>
|
|
|
</div>
|
|
|
- </Spin>
|
|
|
- )
|
|
|
+ <div className="patent-table">
|
|
|
+ <Spin spinning={this.state.loading}>
|
|
|
+ <Table columns={this.state.columns}
|
|
|
+ dataSource={this.state.dataSource}
|
|
|
+ pagination={this.state.pagination}
|
|
|
+ rowSelection={rowSelection}
|
|
|
+ onRowClick={this.tableRowClick} />
|
|
|
+ </Spin>
|
|
|
+ </div>
|
|
|
+ <HrSituationDesc data={this.state.RowData}
|
|
|
+ showDesc={this.state.showDesc} closeDesc={this.closeDesc} />
|
|
|
+ </div >
|
|
|
+ );
|
|
|
}
|
|
|
});
|
|
|
|
|
|
-export default Person;
|
|
|
+export default HrSituation;
|