1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087 |
- import React from 'react';
- import { Icon, Modal, message, AutoComplete, Spin, Input, Select, Button, Form, Popconfirm, TreeSelect } from 'antd';
- import $ from 'jquery/src/ajax';
- import './userMangagement.less';
- import { cityArr, station, post } from '../../../dataDic.js';
- import { splitUrl, getNewArray } from '../../../tools.js';
- import moment from 'moment';
- import ImgList from "../../../common/imgList";
- import StaffSearch from '../../../../component/common/staffSearch';
- //图片组件
- const PicturesWall = React.createClass({
- getInitialState() {
- return {
- previewVisible: false,
- previewImage: '',
- fileList: [],
- role: [],
- district: [],
- cityOption: [],
- }
- },
- handleCancel() {
- this.setState({ previewVisible: false })
- },
- handlePreview(file) {
- this.setState({
- previewImage: file.url || file.thumbUrl,
- previewVisible: true,
- });
- },
- handleChange(info) {
- let fileList = info.fileList;
- this.setState({ fileList });
- this.props.fileList(fileList);
- },
- componentWillReceiveProps(nextProps) {
- this.state.fileList = nextProps.pictureUrl;
- },
- render() {
- const { previewVisible, previewImage, fileList } = this.state;
- const uploadButton = (
- <div>
- <Icon type="plus" />
- <div className="ant-upload-text">点击上传</div>
- </div>
- );
- return (
- <div style={{ display: "inline-block" }}>
- <ImgList
- domId={this.props.domId}
- uploadConfig={{
- action: globalConfig.context + "/api/admin/superviser/uploadAdminImg",
- data: { 'sign': this.props.pictureSign },
- multiple: true,
- listType: "picture-card",
- }}
- onChange={(infor) => {
- this.handleChange(infor)
- }}
- fileList={fileList}
- />
- </div>
- );
- }
- });
- const Newuser = Form.create()(React.createClass({
- getInitialState() {
- return {
- orgCodeUrl: [],
- loading: false,
- loaduser: {},
- datauser: [],
- role: [],
- Business: [{ reviewerName: "", reviewerId: "" }], // 公出审核
- Coorder: [{ reviewerName: "", reviewerId: "" }], // 协单审核
- superiorList: [{ superior: '', superiorId: '' }], // 上级主管
- publicCarbonCopyList: [{ publicCarbonCopy: "", publicCarbonCopyName: "" }], // 公出抄送
- };
- },
- getDefaultProps() {
- return {
- userDetaile: false
- }
- },
- handleSubmit(e) {
- e.preventDefault();
- if (!this.state.role || this.state.role.length === 0) {
- message.warning('请选择角色');
- return false;
- };
- // if (!this.state.status && this.props.userDetaile) {
- // message.warning('请选择角色状态');
- // return false;
- // };
- if (window.adminData.isSuperAdmin) {
- if (!this.state.departmentId) {
- message.warning('请选择组织部门');
- return false;
- };
- }
- // if (!this.state.theTypes && !this.state.superiorId) {
- // message.warning('请输入正确的上级主管');
- // return false;
- // };
- if (!this.state.superiorList.length) {
- message.warning('请输入正确的上级主管');
- return false;
- } else {
- let flag = true;
- let text = '';
- for (let i=0; i<this.state.superiorList.length; i++) {
- let superiorItem = this.state.superiorList[i];
- if (superiorItem.superior && !superiorItem.superiorId) {
- text = `第${i + 1}行请输入正确的上级主管`;
- flag = false;
- continue;
- }
- // else if (this.state.Business.some(item => item.reviewerId == superiorItem.superiorId)) {
- // text = `上级主管【${superiorItem.superior}】在公出审核人员中存在`;
- // flag = false;
- // continue;
- // } else if (this.state.Coorder.some(item => item.reviewerId == superiorItem.superiorId)) {
- // text = `上级主管【${superiorItem.superior}】在协单审核人员中存在`;
- // flag = false;
- // continue;
- // } else if (this.state.managerId == superiorItem.superiorId) {
- // text = `上级主管【${superiorItem.superior}】在经理审核人员中存在`;
- // flag = false;
- // continue;
- // } else if (this.state.publicCarbonCopyList.some(item => item.publicCarbonCopy == superiorItem.superiorId)) {
- // text = `上级主管【${superiorItem.superior}】在公出抄送人员中存在`;
- // flag = false;
- // continue;
- // }
- }
- if (!flag) {
- message.warning(text);
- return false;
- }
- }
- if (!getNewArray(this.state.Business, "reviewerId").toString()) {
- message.warning('请输入正确的公出审核人');
- return false;
- }
- if (this.state.publicCarbonCopyList.length) {
- let flag = true;
- let text = '';
- for (let i=0; i<this.state.publicCarbonCopyList.length; i++) {
- let item = this.state.publicCarbonCopyList[i];
- if (item.publicCarbonCopyName && !item.publicCarbonCopy) {
- text = `第${i + 1}行请输入正确的公出抄送人员`;
- flag = false;
- continue;
- }
- }
- if (!flag) {
- message.warning(text);
- return false;
- }
- }
- if (this.state.contactMobile) {
- if (!(/^1[1-9][0-9]\d{4,8}$/.test(this.state.contactMobile))) {
- message.warning("不是完整的11位手机号或者正确的手机号前七位");
- this.setState({
- loading: false
- });
- return false;
- }
- }
- // if (this.state.ambId == null || this.state.ambId == undefined) {
- // message.warning('请选择所属巴');
- // return false;
- // }
- let theorgCodeUrl = [];
- if (this.state.orgCodeUrl.length) {
- let picArr = [];
- this.state.orgCodeUrl.map(function (item) {
- if (item.response && item.response.data && item.response.data.length) {
- picArr.push(item.response.data);
- }
- });
- theorgCodeUrl = picArr.join(",");
- };
- let api = this.props.userDetaile ? "/api/admin/superviser/updateAdmin" : '/api/admin/superviser/insertAdmin'
- this.setState({
- loading: true
- });
- let superReviewerArr = this.state.superiorList;
- let uniqueSuperArr = [...new Set(superReviewerArr.map(JSON.stringify))].map(JSON.parse);
- let carbonCopyReviewerArr = this.state.publicCarbonCopyList;
- let uniqueCarbonCopyReviewerArr = [...new Set(carbonCopyReviewerArr.map(JSON.stringify))].map(JSON.parse);
- $.ajax({
- method: "POST",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + api,
- data: {
- roles: this.state.role,
- data: JSON.stringify({
- id: this.state.id ? this.state.id : this.props.addId,
- mobile: this.state.mobile,
- seniorStaff: this.state.seniorStaff,
- publicPurview: this.state.publicPurview,
- status: this.state.status,
- contactMobile: this.state.contactMobile,
- name: this.state.name,
- departmentId: window.adminData.isSuperAdmin ? this.state.departmentId : window.adminData.departmentId,
- duty: this.state.duty,
- position: this.state.position,//岗位
- email: this.state.email,
- // superiorId: this.state.theTypes ? this.state.theTypes : this.state.superiorId,
- // superior: this.state.superiorList.map(item => item.superiorId).join(','),
- // reviewer: this.state.reviewer,
- district: this.state.district,
- headPortraitUrl: theorgCodeUrl.length ? theorgCodeUrl : '',
- entryTime: this.state.selTime,
- ambId: !!this.state.ambId ? this.state.ambId : null,
- managerId: this.state.managerId,
- expenseSuperExamine: this.state.expenseSuperExamine, // 报销是否需要上级审核
- publicCarbonCopy: this.state.publicCarbonCopy,// 公出抄送
- callNo: this.state.callNo, // 外呼编号
- teamId: this.state.teamId, // 团队
- }),
- publicReviewerIds: getNewArray(this.state.Business, "reviewerId").toString(),// 公出审核
- assistReviewerIds: getNewArray(this.state.Coorder, "reviewerId").toString(),// 协单审核
- superReviewerIds: uniqueSuperArr.map(item => item.superiorId).join(','), // 上级主管
- carbonCopyReviewerIds: uniqueCarbonCopyReviewerArr.map(item => item.publicCarbonCopy).join(',') // 公出推送
- }
- }).done(function (data) {
- this.setState({
- loading: false
- });
- if (!data.error.length) {
- message.success('保存成功!');
- this.handleOk();
- } else {
- message.warning(data.error[0].message);
- }
- }.bind(this));
- },
- //主管初始加载(自动补全)
- supervisor(e) {
- $.ajax({
- method: "post",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + "/api/admin/organization/selectName",
- data: {
- name: e
- },
- success: function (data) {
- let thedata = data.data;
- if (!thedata) {
- if (data.error && data.error.length) {
- message.warning(data.error[0].message);
- };
- thedata = {};
- };
- this.setState({
- customerArr: thedata,
- });
- }.bind(this),
- }).always(function () {
- this.setState({
- loading: false
- });
- }.bind(this));
- },
- //上级主管输入框失去焦点是判断客户是否存在
- selectAuto(value, idx) {
- let theType = '';
- let contactLists = this.state.customerArr || [];
- if (value) {
- contactLists.map(function (item) {
- if (item.name === value.toString()) {
- theType = item.id;
- }
- });
- }
- const { superiorList } = this.state;
- superiorList[idx].superiorId = theType;
- superiorList[idx].superior = value;
- this.setState({
- // theTypes: theType,
- // superior: value
- superiorList
- })
- if (!this.state.reviewerName || !this.state.reviewer) {
- this.setState({
- reviewerName: value,
- reviewer: theType
- })
- }
- },
- //值改变时请求客户名称
- httpChange(e, idx) {
- if (e.length >= 1) {
- this.supervisor(e);
- }
- const { superiorList } = this.state;
- superiorList[idx].superior = e;
- this.setState({
- superiorList
- })
- },
- //查看基本详情基本信息
- loaduser(record) {
- if (record) {
- $.ajax({
- method: "post",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + '/api/admin/superviser/selectAllByid',
- data: {
- id: record.id
- },
- success: function (data) {
- let thisdata = data.data;
- if (!thisdata) {
- if (data.error && data.error.length) {
- message.warning(data.error[0].message);
- };
- thisdata = {};
- };
- // let superiorList = [];
- // let superiorIdArr = thisdata.superiorId ? thisdata.superiorId.toString().split(',') : [];
- // let superiorArr = thisdata.superior ? thisdata.superior.toString().split(',') : [];
- // superiorIdArr.map((id, idx) => {
- // superiorList.push({ superiorId: id, superior: superiorArr[idx] });
- // })
- this.setState({
- id: thisdata.id,
- mobile: thisdata.mobile,
- name: thisdata.name,
- email: thisdata.email,
- createTime: thisdata.createTime,
- district: thisdata.district != ' ' ? JSON.parse(thisdata.district) : undefined,
- position: thisdata.position ? thisdata.position : undefined,
- superior: thisdata.superior,
- superiorId: thisdata.superiorId,//上级Id
- // superiorList, // 上级list
- reviewerName: thisdata.reviewerName,
- reviewer: thisdata.reviewer, // 公出审核人
- managerName: thisdata.managerName,
- managerId: thisdata.managerId, // 经理审核
- theTypes: '',
- duty: thisdata.duty ? thisdata.duty : undefined,//职务
- publicPurview: thisdata.publicPurview,
- seniorStaff: thisdata.seniorStaff,
- status: Number(thisdata.status),
- contactMobile: thisdata.contactMobile ? thisdata.contactMobile : undefined,//手机号
- departmentId: thisdata.departmentId ? thisdata.departmentId : undefined,//部门id
- userNo: thisdata.userNo,
- orgCodeUrl: thisdata.headPortraitUrl ? splitUrl(thisdata.headPortraitUrl, ',', globalConfig.avatarHost + '/upload') : [],
- role: this.props.role,
- entryTime: thisdata.entryTime ? moment(thisdata.entryTime, 'YYYY-MM-DD') : undefined,
- selTime: thisdata.entryTime,
- ambId: !!thisdata.ambId && Number(thisdata.ambId), // 分巴id
- expenseSuperExamine: thisdata.expenseSuperExamine, // 报销是否需要上级主管审核
- publicCarbonCopy: thisdata.publicCarbonCopy, // 公出抄送
- publicCarbonCopyName: thisdata.publicCarbonCopyName,
- callNo: thisdata.callNo, // 外呼编号
- teamId: thisdata.teamId, // 团队
- });
- }.bind(this),
- }).always(function () {
- this.setState({
- loading: false
- });
- }.bind(this));
- }
- },
- getReviewer(record) {
- if (record) {
- $.ajax({
- method: "get",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + '/api/admin/superviser/publicReviewer',
- data: {
- id: record.id
- },
- success: function (data) {
- let thisdata = data.data;
- if (!thisdata) {
- if (data.error && data.error.length) {
- message.warning(data.error[0].message);
- };
- thisdata = {};
- };
- let superiorList = [{ superior: '', superiorId: '' }];
- if (thisdata.superReviewer.length) {
- superiorList = thisdata.superReviewer.map(item => {
- return { superior: item.reviewerName, superiorId: item.reviewerId };
- })
- }
- let publicCarbonCopyList = [{ publicCarbonCopyName: '', publicCarbonCopy: '' }];
- if (thisdata.carbonCopyReviewer.length) {
- publicCarbonCopyList = thisdata.carbonCopyReviewer.map(item => {
- return { publicCarbonCopyName: item.reviewerName, publicCarbonCopy: item.reviewerId }
- });
- }
- this.setState({
- Business: thisdata.publicReviewer.length > 0 ? thisdata.publicReviewer : [{ reviewerName: "", reviewerId: "" }],
- Coorder: thisdata.assistReviewer.length > 0 ? thisdata.assistReviewer : [{ reviewerName: "", reviewerId: "" }],
- superiorList,
- publicCarbonCopyList,
- });
- }.bind(this),
- }).always(function () {
- this.setState({
- loading: false
- });
- }.bind(this));
- }
- },
- //重置密码
- resetPwd() {
- this.setState({
- loading: true
- })
- $.ajax({
- type: 'post',
- url: globalConfig.context + "/api/admin/superviser/resetPwd",
- dataType: "json",
- data: {
- id: this.props.datauser.id
- },
- }).done((res) => {
- if (res.error && res.error.length) {
- message.error(res.error[0].message);
- } else {
- message.success("密码重置成功");
- }
- }).always(() => {
- this.setState({
- loading: false
- })
- });
- },
- handleOk(e) {
- this.props.closeDesc(false, true);
- },
- handleCancel(e) {
- this.props.closeDesc(false);
- },
- //入职时间选择
- selTime(e, index) {
- this.setState({
- entryTime: e,
- selTime: index
- })
- },
- getOrgCodeUrl(e) {
- this.setState({ orgCodeUrl: e });
- },
- componentWillMount(e) {
- const cityArrs = [];
- cityArr.map(function (item) {
- cityArrs.push(
- <Select.Option key={item.value}>{item.key}</Select.Option>
- )
- });
- this.state.cityOption = cityArrs;
- },
- componentDidMount() {
- if (this.props.datauser.id) {
- this.loaduser(this.props.datauser)
- this.getReviewer(this.props.datauser)
- this.setState({
- rolek: this.props.role
- })
- }
- },
- add() {
- const { Coorder } = this.state;
- let arr = Coorder
- let obj = { title: "", value: "" }
- arr.push(obj)
- this.setState({
- Coorder: arr
- })
- },
- remove(i) {
- const { Coorder } = this.state;
- let arr = Coorder
- arr.splice(i, 1)
- this.setState({
- Coorder: arr
- })
- },
- add1() {
- const { Business } = this.state;
- let arr = Business
- let obj = { title: "", value: "" }
- arr.push(obj)
- this.setState({
- Business: arr
- })
- },
- remove1(i) {
- const { Business } = this.state;
- let arr = Business
- arr.splice(i, 1)
- this.setState({
- Business: arr
- })
- },
- addSupersor() {
- const { superiorList } = this.state;
- superiorList.push({ superiorId: '', superior: '' });
- this.setState({ superiorList });
- },
- removeSupersor(idx) {
- this.state.superiorList.splice(idx, 1)
- this.setState({
- superiorList: this.state.superiorList
- });
- },
- addPublicCarbonCopy() {
- const { publicCarbonCopyList } = this.state;
- publicCarbonCopyList.push({ publicCarbonCopy: '', publicCarbonCopyName: '' });
- this.setState({ publicCarbonCopyList });
- },
- removePublicCarbonCopy(idx) {
- this.state.publicCarbonCopyList.splice(idx, 1)
- this.setState({
- publicCarbonCopyList: this.state.publicCarbonCopyList
- });
- },
- render() {
- const { Coorder, Business } = this.state
- const FormItem = Form.Item
- const formItemLayout = {
- labelCol: { span: 8 },
- wrapperCol: { span: 14 },
- };
- const dataSources = this.state.customerArr || [];
- const options = dataSources.map((group, index) =>
- <Select.Option key={index} value={group.name}>{group.name}</Select.Option>
- )
- const departmentArr = this.props.departmentArr || [];
- const roleArrS = this.props.roleArr || [];
- const rolst = this.state.rolek || [];
- return (
- <div>
- <Modal maskClosable={false} visible={this.props.showDesc}
- onOk={this.handleOk} onCancel={this.handleCancel}
- width='1000px'
- title={this.props.userDetaile ? '用户详情' : '新建用户'}
- footer=''
- className="admin-desc-content">
- <Form layout="horizontal" onSubmit={this.handleSubmit} id="demand-form">
- <Spin spinning={this.state.loading}>
- <div className="clearfix">
- <div className="clearfix">
- <FormItem className="half-item"
- {...formItemLayout}
- label="用户名" >
- <Input placeholder="输入登录用户名" value={this.state.mobile}
- onChange={(e) => { this.setState({ mobile: e.target.value }) }} required="required" style={{ width: '200px' }} />
- <span className="mandatory">*</span>
- </FormItem>
- {this.props.userDetaile ?
- <Popconfirm
- title={"用户 [ " + this.props.datauser.name + " ] 的密码将会重置为123456,确认操作?"}
- onConfirm={this.resetPwd}
- okText="确认"
- cancelText="取消"
- placement="topLeft">
- <Button>重置密码</Button>
- </Popconfirm> : ''}
- </div>
- <FormItem className="half-item"
- {...formItemLayout}
- label="用户角色"
- >
- {roleArrS.length > 0 ?
- <Select
- mode="multiple"
- optionFilterProp={'title'}
- tokenSeparators={[',']}
- placeholder="选择用户角色"
- value={this.state.role}
- style={{ width: '200px', minHeight: '59px' }}
- onChange={(e) => {
- this.setState({
- role: e
- })
- }}>
- {
- roleArrS.map(function (item, _) {
- return <Select.Option title={item.roleName} value={item.id}>{item.roleName}</Select.Option>
- })
- }
- </Select> : null
- }
- <span className="mandatory">*</span>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label=""
- >
- <span style={{ display: rolst.length > 1 ? 'block' : 'none', color: 'red' }}>存在多个角色</span>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="员工" >
- <Select
- placeholder="请选择"
- value={this.state.seniorStaff}
- style={{ width: '200px' }}
- onChange={(e) => { this.setState({ seniorStaff: e }) }}
- >
- <Select.Option value={0} >新员工</Select.Option>
- <Select.Option value={1} >老员工</Select.Option>
- </Select>
- <span className="mandatory">*</span>
- </FormItem>
- {this.props.userDetaile ? <FormItem className="half-item"
- {...formItemLayout}
- label="用户状态" >
- <Select
- placeholder="用户状态"
- value={this.state.status}
- style={{ width: '200px' }}
- onChange={(e) => { this.setState({ status: e }) }}
- >
- <Select.Option value={0} >正常</Select.Option>
- <Select.Option value={1} >锁定</Select.Option>
- </Select>
- <span className="mandatory">*</span>
- </FormItem> : ''}
- <FormItem className="half-item"
- {...formItemLayout}
- label="用户姓名" >
- <Input placeholder="请输入用户姓名" style={{ width: '200px' }} value={this.state.name}
- onChange={(e) => { this.setState({ name: e.target.value }) }} required="required" />
- <span className="mandatory">*</span>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="联系方式" >
- <Input placeholder="请输入手机号" style={{ width: '200px' }} value={this.state.contactMobile}
- onChange={(e) => { this.setState({ contactMobile: e.target.value }) }} />
- </FormItem>
- {/*<FormItem className="half-item"
- {...formItemLayout}
- label="入职时间" >
- <DatePicker
- style={{marginTop:'0',width:'200px',height:'27px'}}
- showTime
- format="YYYY-MM-DD"
- placeholder="选择入职时间"
- value={this.state.entryTime}
- onChange={(e,time)=>{this.selTime(e,time)}}
- />
- </FormItem>*/}
- {window.adminData.isSuperAdmin ? <FormItem className="half-item"
- {...formItemLayout}
- label="组织部门" >
- <Select placeholder="选择组织部门"
- style={{ width: 200 }}
- value={this.state.departmentId}
- onChange={(e) => { this.setState({ departmentId: e }) }}>
- {
- departmentArr.map(function (item) {
- return <Select.Option key={item.id} >{item.name}</Select.Option>
- })
- }
- </Select>
- <span className="mandatory">*</span>
- </FormItem> : ''}
- <FormItem className="half-item"
- {...formItemLayout}
- label="职务"
- >
- <Select placeholder="选择职务" style={{ width: '200px' }} value={this.state.duty} onChange={(e) => { this.setState({ duty: e }) }}>
- {
- post.map(function (item) {
- return <Select.Option key={item.value} >{item.key}</Select.Option>
- })
- }
- </Select>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="岗位"
- >
- <Select placeholder="选择岗位" style={{ width: '200px' }} value={this.state.position} onChange={(e) => { this.setState({ position: e }) }}>
- {
- station.map(function (item) {
- return <Select.Option key={item.value} >{item.key}</Select.Option>
- })
- }
- </Select>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="电子邮箱" >
- <Input placeholder="请输入邮箱" style={{ width: '200px' }} value={this.state.email}
- onChange={(e) => { this.setState({ email: e.target.value }) }} />
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="上级主管"
- >
-
- {this.state.superiorList.map((item, idx) => (
- <div style={{ display: 'flex', alignItems: 'center', padding: '5px 0' }}>
- <AutoComplete
- className="certain-category-search"
- dropdownClassName="certain-category-search-dropdown"
- dropdownMatchSelectWidth={false}
- size="large"
- style={{ width: '200px' }}
- dataSource={options}
- placeholder="输入名称"
- value={item.superior}
- onChange={e=> {this.httpChange(e, idx)}}
- filterOption={true}
- onSelect={value => {this.selectAuto(value, idx)}}
- >
- <Input />
- </AutoComplete>
- <span className="mandatory">*</span>
- <div style={{ width: 25, display: "inline-block" }}>
- {this.state.superiorList.length > 1 ? (
- <Icon
- className="dynamic-delete-button"
- type="minus-circle-o"
- disabled={this.state.superiorList.length === 1}
- onClick={() => this.removeSupersor(idx)}
- />
- ) : null}
- </div>
- { idx === 0 && <Button style={{ marginLeft: 10 }} size="small" type="primary" onClick={this.addSupersor}>新增</Button> }
- </div>
- ))}
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="报销是否需上级主管审核"
- >
- <Select
- placeholder="请选择"
- value={this.state.expenseSuperExamine}
- style={{ width: '200px' }}
- onChange={(e) => { this.setState({ expenseSuperExamine: e }) }}
- >
- <Select.Option value={0} >否</Select.Option>
- <Select.Option value={1} >是</Select.Option>
- </Select>
- </FormItem>
- {this.props.userDetaile ?
- <FormItem className="half-item"
- {...formItemLayout}
- label="用户编号" >
- <span>{this.state.userNo}</span>
- </FormItem>
- : ''}
- <div className='clearfix'>
- <FormItem className="half-item"
- {...formItemLayout}
- label='公出审核'
- >
- {
- Business.map((k, index) =>
- <div key={index}>
- <StaffSearch
- valueName={k.reviewerName}
- placeholder="输入名称"
- width={200}
- onBlurText={e => {
- let newBusiness = Business
- for (var i = 0; i < newBusiness.length; i++) {
- if (index == i) {
- newBusiness[i].reviewerName = e.title
- }
- }
- this.setState({
- Business: newBusiness
- })
- }}
- onBlurChange={(e) => {
- let newBusiness = Business
- for (var i = 0; i < newBusiness.length; i++) {
- if (index == i) {
- newBusiness[i].reviewerId = e.value
- }
- }
- this.setState({
- Business: newBusiness
- })
- }}
- />
- <div style={{ width: 25, display: "inline-block" }}>
- {Business.length > 1 ? (
- <Icon
- className="dynamic-delete-button"
- type="minus-circle-o"
- disabled={Business.length === 1}
- onClick={() => this.remove1(index)}
- />
- ) : null}
- </div>
- {index === 0 && <Button style={{ marginLeft: 10 }} size="small" type="primary" onClick={this.add1}>新增</Button>}
- </div>
- )
- }
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="经理审核"
- >
- <StaffSearch
- valueName={this.state.managerName}
- placeholder="输入名称"
- onBlurText={e => {
- this.setState({
- managerName: e.title
- })
- }}
- onBlurChange={(obj) => {
- this.setState({
- managerId: obj.value,
- })
- }}
- />
- <Icon
- className="dynamic-delete-button"
- type="minus-circle-o"
- onClick={() => {
- this.setState({
- managerName: '',
- managerId: ''
- });
- }}
- />
- </FormItem>
- </div>
- <div className='clearfix'>
- <FormItem className="half-item"
- {...formItemLayout}
- label='协单审核'
- >
- {
- Coorder.map((k, index) =>
- <div key={index}>
- <StaffSearch
- valueName={k.reviewerName}
- placeholder="输入名称"
- width={200}
- onBlurText={e => {
- let newCoorder = Coorder
- for (var i = 0; i < newCoorder.length; i++) {
- if (index == i) {
- newCoorder[i].reviewerName = e.title
- }
- }
- this.setState({
- Coorder: newCoorder
- })
- }}
- onBlurChange={(e) => {
- let newCoorder = Coorder
- for (var i = 0; i < newCoorder.length; i++) {
- if (index == i) {
- newCoorder[i].reviewerId = e.value
- }
- }
- this.setState({
- Coorder: newCoorder
- })
- }}
- />
- <div style={{ width: 25, display: "inline-block" }} >
- {Coorder.length > 1 ? (
- <Icon
- className="dynamic-delete-button"
- type="minus-circle-o"
- disabled={Coorder.length === 1}
- onClick={() => this.remove(index)}
- />
- ) : null}
- </div>
- {index === 0 && <Button style={{ marginLeft: 10 }} size="small" type="primary" onClick={this.add}>新增</Button>}
- </div>
- )
- }
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="公出抄送"
- >
- { this.state.publicCarbonCopyList.map((item, idx) => (
- <div style={{ display: 'flex', alignItems: 'center', padding: '5px 0' }}>
- <StaffSearch
- valueName={item.publicCarbonCopyName}
- placeholder="输入名称"
- onBlurText={e => {
- const { publicCarbonCopyList } = this.state;
- publicCarbonCopyList[idx].publicCarbonCopyName = e.title;
- this.setState({
- // publicCarbonCopyName: e.title
- publicCarbonCopyList
- })
- }}
- onBlurChange={(obj) => {
- const { publicCarbonCopyList } = this.state;
- publicCarbonCopyList[idx].publicCarbonCopy = obj.value;
- this.setState({
- // publicCarbonCopy: obj.value,
- publicCarbonCopyList
- })
- }}
- />
- <div style={{ width: 25, display: "inline-block" }}>
- {this.state.publicCarbonCopyList.length > 1 ? (
- <Icon
- className="dynamic-delete-button"
- type="minus-circle-o"
- disabled={this.state.publicCarbonCopyList.length === 1}
- onClick={() => this.removePublicCarbonCopy(idx)}
- />
- ) : null}
- </div>
- { idx === 0 && <Button style={{ marginLeft: 10 }} size="small" type="primary" onClick={this.addPublicCarbonCopy}>新增</Button> }
- </div>
- )) }
-
- </FormItem>
- </div>
- <div className='clearfix'>
- <FormItem className="half-item"
- {...formItemLayout}
- label="业务员"
- >
- <Select
- placeholder="请选择"
- value={this.state.publicPurview}
- style={{ width: '200px' }}
- onChange={(e) => { this.setState({ publicPurview: e }) }}
- >
- <Select.Option value={0} >否</Select.Option>
- <Select.Option value={1} >是</Select.Option>
- </Select>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="外呼编号" >
- <Input placeholder="请输入外呼编号" style={{ width: '200px' }} value={this.state.callNo}
- onChange={(e) => { this.setState({ callNo: e.target.value }) }} />
- </FormItem>
- </div>
- <div className='clearfix'>
- <FormItem className="half-item"
- {...formItemLayout}
- label="地区" >
- <Select
- multiple
- style={{ width: '685px' }}
- placeholder="选择地区"
- filterOption={(input, option) => { return option.props.children.indexOf(input) >= 0 }}
- value={this.state.district}
- onChange={(pids) => {
- this.state.district = pids;
- this.setState({
- district: this.state.district
- })
- }}
- >
- {this.state.cityOption}
- </Select>
- </FormItem>
- </div>
- <div className="clearfix">
- <FormItem
- className="half-item"
- {...formItemLayout}
- label="分巴"
- >
- <TreeSelect
- style={{ width: 200 }}
- value={this.state.ambId}
- dropdownStyle={{ maxHeight: 300, overflow: 'auto' }}
- treeData={this.props.level1Data}
- placeholder="请选择"
- showSearch
- treeNodeFilterProp="title"
- onChange={(e) => {
- this.setState({
- ambId: e,
- });
- }}
- />
- </FormItem>
- <FormItem
- className="half-item"
- {...formItemLayout}
- label="团队"
- >
- <TreeSelect
- style={{ width: 200 }}
- value={this.state.teamId}
- dropdownStyle={{ maxHeight: 300, overflow: 'auto' }}
- treeData={this.props.teamList}
- placeholder="请选择团队"
- showSearch
- treeNodeFilterProp="title"
- onChange={(e) => {
- this.setState({
- teamId: e,
- });
- }}
- />
- {/* <Select
- placeholder="上级团队"
- style={{ width: 200 }}
- value={this.state.teamId}
- onChange={e => {
- this.setState({
- teamId: e,
- });
- }}
- >
- {this.props.teamList.map(function (item) {
- return (
- <Select.Option key={item.id} value={item.id}>{item.name}</Select.Option>
- );
- })}
- </Select> */}
- </FormItem>
- </div>
- <div className="clearfix">
- <FormItem
- className="half-item"
- {...formItemLayout}
- label="用户头像"
- >
- <PicturesWall
- domId={'newUser1'}
- pictureSign="customer_sys_file"
- fileList={this.getOrgCodeUrl}
- pictureUrl={this.state.orgCodeUrl} />
- <p>图片建议:要清晰。</p>
- </FormItem>
- </div>
- </div>
- <FormItem wrapperCol={{ span: 12, offset: 4 }}>
- <Button className="set-submit" type="primary" htmlType="submit">保存</Button>
- <Button className="set-submit" type="ghost" onClick={this.handleCancel}>取消</Button>
- </FormItem>
- </Spin>
- </Form >
- </Modal>
- </div>
- )
- }
- }));
- export default Newuser;
|