|
@@ -1,14 +1,14 @@
|
|
|
import React from 'react';
|
|
|
-import { Icon, Modal, message, AutoComplete,Spin, Input, Select, Button, Form,Upload,Popconfirm ,DatePicker} from 'antd';
|
|
|
-import ajax from 'jquery/src/ajax/xhr.js';
|
|
|
+import { Icon, Modal, message, AutoComplete,Spin, Input, Select, Button, Form,Popconfirm} from 'antd';
|
|
|
import $ from 'jquery/src/ajax';
|
|
|
import './userMangagement.less';
|
|
|
-import {socialAttribute,cityArr,station,post} from '../../../dataDic.js';
|
|
|
+import {cityArr,station,post} from '../../../dataDic.js';
|
|
|
import {splitUrl} from '../../../tools.js';
|
|
|
-const Option = AutoComplete.Option;
|
|
|
import moment from 'moment';
|
|
|
import ImgList from "../../../common/imgList";
|
|
|
|
|
|
+import StaffSearch from '../../../../component/common/staffSearch';
|
|
|
+
|
|
|
//图片组件
|
|
|
const PicturesWall = React.createClass({
|
|
|
getInitialState() {
|
|
@@ -72,7 +72,6 @@ const Newuser = Form.create()(React.createClass({
|
|
|
orgCodeUrl:[],
|
|
|
loading: false,
|
|
|
loaduser: {},
|
|
|
- visible:false,
|
|
|
datauser:[],
|
|
|
role:[]
|
|
|
};
|
|
@@ -102,6 +101,10 @@ const Newuser = Form.create()(React.createClass({
|
|
|
message.warning('请输入正确的上级主管');
|
|
|
return false;
|
|
|
};
|
|
|
+ if(!this.state.reviewer){
|
|
|
+ message.warning('请输入正确的公出审核人');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
if(this.state.contactMobile){
|
|
|
if(!(/^1[1-9][0-9]\d{4,8}$/.test(this.state.contactMobile))){
|
|
|
message.warning("不是完整的11位手机号或者正确的手机号前七位");
|
|
@@ -143,6 +146,7 @@ const Newuser = Form.create()(React.createClass({
|
|
|
position:this.state.position,//岗位
|
|
|
email:this.state.email,
|
|
|
superiorId:this.state.theTypes?this.state.theTypes:this.state.superiorId,
|
|
|
+ reviewer:this.state.reviewer,
|
|
|
district:this.state.district,
|
|
|
headPortraitUrl:theorgCodeUrl.length?theorgCodeUrl:'',
|
|
|
entryTime:this.state.selTime
|
|
@@ -205,7 +209,6 @@ const Newuser = Form.create()(React.createClass({
|
|
|
});
|
|
|
}
|
|
|
this.setState({
|
|
|
- theName:e,
|
|
|
theTypes:theType
|
|
|
})
|
|
|
},
|
|
@@ -247,6 +250,11 @@ const Newuser = Form.create()(React.createClass({
|
|
|
position: thisdata.position?thisdata.position:undefined,
|
|
|
superior:thisdata.superior,
|
|
|
superiorId: thisdata.superiorId,//上级Id
|
|
|
+
|
|
|
+ reviewerName:thisdata.reviewerName,
|
|
|
+ reviewer:thisdata.reviewer,
|
|
|
+
|
|
|
+ theTypes:'',
|
|
|
duty:thisdata.duty?thisdata.duty:undefined,//职务
|
|
|
status:thisdata.status?thisdata.status:undefined,
|
|
|
contactMobile:thisdata.contactMobile?thisdata.contactMobile:undefined,//手机号
|
|
@@ -254,7 +262,6 @@ const Newuser = Form.create()(React.createClass({
|
|
|
userNo:thisdata.userNo,
|
|
|
orgCodeUrl: thisdata.headPortraitUrl? splitUrl(thisdata.headPortraitUrl, ',', globalConfig.avatarHost + '/upload') : [],
|
|
|
role:this.props.role,
|
|
|
- theTypes:'',
|
|
|
entryTime:thisdata.entryTime?moment(thisdata.entryTime,'YYYY-MM-DD'):undefined,
|
|
|
selTime:thisdata.entryTime
|
|
|
});
|
|
@@ -292,15 +299,9 @@ const Newuser = Form.create()(React.createClass({
|
|
|
});
|
|
|
},
|
|
|
handleOk(e) {
|
|
|
- this.setState({
|
|
|
- visible: false,
|
|
|
- });
|
|
|
this.props.closeDesc(false, true);
|
|
|
},
|
|
|
handleCancel(e) {
|
|
|
- this.setState({
|
|
|
- visible: false,
|
|
|
- });
|
|
|
this.props.closeDesc(false);
|
|
|
},
|
|
|
//入职时间选择
|
|
@@ -322,32 +323,13 @@ const Newuser = Form.create()(React.createClass({
|
|
|
});
|
|
|
this.state.cityOption=cityArrs;
|
|
|
},
|
|
|
- componentWillReceiveProps(nextProps) {
|
|
|
- if(nextProps.userDetaile&&nextProps.datauser.id){
|
|
|
- this.loaduser(nextProps.datauser)
|
|
|
+ componentDidMount() {
|
|
|
+ if(this.props.datauser.id){
|
|
|
+ this.loaduser(this.props.datauser)
|
|
|
this.setState({
|
|
|
- rolek:nextProps.role
|
|
|
+ rolek:this.props.role
|
|
|
})
|
|
|
- }else{
|
|
|
- this.state.name='';
|
|
|
- this.state.role=[];
|
|
|
- this.state.departmentId=undefined;
|
|
|
- this.state.mobile='';
|
|
|
- this.state.duty=undefined;
|
|
|
- this.state.position=undefined;
|
|
|
- this.state.station=undefined;
|
|
|
- this.state.contactMobile='';
|
|
|
- this.state.email='';
|
|
|
- this.state.superiorId='';
|
|
|
- this.state.superior='';
|
|
|
- this.state.district=[];
|
|
|
- this.state.orgCodeUrl=[];
|
|
|
- this.state.id='';
|
|
|
- this.state.rolek=[];
|
|
|
- this.state.entryTime=undefined;
|
|
|
- }
|
|
|
- this.state.visible = nextProps.showDesc;
|
|
|
-
|
|
|
+ }
|
|
|
},
|
|
|
render() {
|
|
|
const FormItem = Form.Item
|
|
@@ -364,7 +346,7 @@ const Newuser = Form.create()(React.createClass({
|
|
|
const rolst=this.state.rolek || [];
|
|
|
return (
|
|
|
<div>
|
|
|
- <Modal maskClosable={false} visible={this.state.visible}
|
|
|
+ <Modal maskClosable={false} visible={this.props.showDesc}
|
|
|
onOk={this.handleOk} onCancel={this.handleCancel}
|
|
|
width='800px'
|
|
|
title={this.props.userDetaile?'用户详情':'新建用户'}
|
|
@@ -513,7 +495,6 @@ const Newuser = Form.create()(React.createClass({
|
|
|
className="certain-category-search"
|
|
|
dropdownClassName="certain-category-search-dropdown"
|
|
|
dropdownMatchSelectWidth={false}
|
|
|
- dropdownStyle={{ width: 200 }}
|
|
|
size="large"
|
|
|
style={{ width: '200px' }}
|
|
|
dataSource={options}
|
|
@@ -535,6 +516,21 @@ const Newuser = Form.create()(React.createClass({
|
|
|
<span>{this.state.userNo}</span>
|
|
|
</FormItem>
|
|
|
:''}
|
|
|
+ <FormItem className="half-item"
|
|
|
+ {...formItemLayout}
|
|
|
+ label="公出审核"
|
|
|
+ >
|
|
|
+ <StaffSearch
|
|
|
+ valueName={this.state.reviewerName}
|
|
|
+ placeholder="输入名称"
|
|
|
+ onBlurChange={(obj)=>{
|
|
|
+ this.setState({
|
|
|
+ reviewer:obj.value
|
|
|
+ })
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ <span className="mandatory">*</span>
|
|
|
+ </FormItem>
|
|
|
<div className='clearfix'>
|
|
|
<FormItem className="half-item"
|
|
|
{...formItemLayout}
|