12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211 |
- import React from 'react';
- import ReactDom from 'react-dom';
- import ajax from 'jquery/src/ajax/xhr.js';
- import $ from 'jquery/src/ajax';
- import {
- Form, Icon, Button, Input, Select, AutoComplete, Spin, Table,
- message, DatePicker, Modal, TreeSelect, Popconfirm, Tabs
- } from 'antd';
- import Newuser from "./newUser.jsx"
- import './userMangagement.less'
- import { techAuditStatusList, station, post } from '../../../dataDic.js';
- import { getPost, getStation, getRole } from '../../../tools.js';
- import { ChooseList } from "../../order/orderNew/chooseList";
- const { TabPane } = Tabs
- const User = Form.create()(React.createClass({
- loadData(pageNo) {
- this.state.data = [];
- this.setState({
- userDetaile: false,
- loading: true,
- page: pageNo
- });
- var admin = window.adminData.isSuperAdmin || '';
- var departmentId = window.adminData.departmentId || '';
- $.ajax({
- method: "get",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + '/api/admin/superviser/adminList',
- data: {
- pageNo: pageNo || 1,
- pageSize: this.state.pagination.pageSize,
- name: this.state.userNameSearch,
- departmentId: admin ? this.state.organizationSearch : departmentId,
- rid: this.state.rolesSearch,
- duty: this.state.postSearch,
- position: this.state.stationSearch,
- status: this.state.statusSeach,
- mobile: this.state.signNameSearch,
- superiorId: this.state.theTypes,
- ambManage: this.state.ambManage,
- ambId: this.state.amb == 1 ? this.state.ambId : undefined,
- ancestors: this.state.amb == 2 ? this.state.ambId : undefined,
- seniorStaff: this.state.seniorStaff,
- publicPurview: this.state.publicPurview,
- },
- success: function (data) {
- let theArr = [];
- if (!data.data || !data.data.list) {
- if (data.error && data.error.length) {
- message.warning(data.error[0].message);
- };
- } else {
- for (let i = 0; i < data.data.list.length; i++) {
- let thisdata = data.data.list[i];
- theArr.push({
- key: i,
- id: thisdata.id,
- mobile: thisdata.mobile,
- name: thisdata.name,
- email: thisdata.email,
- createTime: thisdata.createTime,
- province: thisdata.province,
- position: thisdata.position,
- seniorStaff: thisdata.seniorStaff,
- publicPurview: thisdata.publicPurview,
- superior: thisdata.superior, //上级名称
- superiorId: thisdata.superiorId, //上级Id
- duty: thisdata.duty, //职务
- status: thisdata.status,
- userNo: thisdata.userNo,
- departmentName: thisdata.departmentName, //部门名称
- departmentId: thisdata.departmentId, //部门id
- roles: thisdata.roles,
- rolesId: thisdata.rolesId,
- lastLoginTime: thisdata.lastLoginTime,
- rolesName: thisdata.rolesName,
- ancestorsNames: thisdata.ancestorsNames, //分巴
- ambName: thisdata.ambName,
- ambRole: thisdata.ambRole,
- });
- };
- this.state.pagination.current = data.data.pageNo ? data.data.pageNo : '0';
- this.state.pagination.total = data.data.totalCount ? data.data.totalCount : '0';
- };
- if (!data.data.list.length) {
- this.state.pagination.current = 0
- this.state.pagination.total = 0
- }
- this.setState({
- dataSource: theArr,
- pagination: this.state.pagination,
- selectedRowKeys: []
- });
- }.bind(this),
- }).always(function () {
- this.setState({
- loading: false
- });
- }.bind(this));
- },
- loadDatas(pageNo) {
- this.state.data = [];
- this.setState({
- userDetaile: false,
- loading: true,
- });
- var admin = window.adminData.isSuperAdmin || '';
- var departmentId = window.adminData.departmentId || '';
- $.ajax({
- method: "get",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + '/api/admin/superviser/adminList',
- data: {
- pageNo: pageNo || 1,
- pageSize: this.state.paginations.pageSize,
- name: this.state.userNameSearchs,
- status: 0
- // departmentId: admin?this.state.organizationSearch:departmentId,
- // rid: this.state.rolesSearch,
- // duty: this.state.postSearch,
- // position: this.state.stationSearch,
- // status: this.state.statusSeach,
- // mobile: this.state.signNameSearch,
- // superiorId: this.state.theTypes
- },
- success: function (data) {
- let theArr = [];
- if (!data.data || !data.data.list) {
- if (data.error && data.error.length) {
- message.warning(data.error[0].message);
- };
- } else {
- for (let i = 0; i < data.data.list.length; i++) {
- let thisdata = data.data.list[i];
- theArr.push({
- key: i,
- id: thisdata.id,
- mobile: thisdata.mobile,
- name: thisdata.name,
- email: thisdata.email,
- createTime: thisdata.createTime,
- province: thisdata.province,
- position: thisdata.position,
- superior: thisdata.superior, //上级名称
- superiorId: thisdata.superiorId, //上级Id
- duty: thisdata.duty, //职务
- status: thisdata.status,
- userNo: thisdata.userNo,
- departmentName: thisdata.departmentName, //部门名称
- departmentId: thisdata.departmentId, //部门id
- roles: thisdata.roles,
- rolesId: thisdata.rolesId,
- lastLoginTime: thisdata.lastLoginTime,
- rolesName: thisdata.rolesName,
- ancestorsNames: thisdata.ancestorsNames, //分巴
- ambName: thisdata.ambName,
- ambRole: thisdata.ambRole,
- });
- };
- this.state.paginations.current = data.data.pageNo ? data.data.pageNo : '0';
- this.state.paginations.total = data.data.totalCount ? data.data.totalCount : '0';
- };
- if (!data.data.list.length) {
- this.state.paginations.current = 0
- this.state.paginations.total = 0
- }
- this.setState({
- dataSourceData: theArr,
- paginations: this.state.paginations,
- });
- }.bind(this),
- }).always(function () {
- this.setState({
- loading: false
- });
- }.bind(this));
- },
- getInitialState() {
- return {
- amb: 1,
- datauser: {},
- searchMore: true,
- selectedRowKeys: [],
- selectedRows: [],
- userDetaile: false,
- departmentArr: [],
- loading: false,
- roleArr: [],
- pagination: {
- defaultCurrent: 1,
- defaultPageSize: 10,
- showQuickJumper: true,
- pageSize: 10,
- onChange: function (page) {
- this.loadData(page);
- }.bind(this),
- showTotal: function (total) {
- return '共' + total + '条数据';
- }
- },
- paginations: {
- defaultCurrent: 1,
- defaultPageSize: 10,
- showQuickJumper: true,
- pageSize: 10,
- onChange: function (page) {
- this.loadDatas(page);
- }.bind(this),
- showTotal: function (total) {
- return '共' + total + '条数据';
- }
- },
- columns: [{
- title: '用户编号',
- dataIndex: 'userNo',
- key: 'userNo',
- isNoD: true,
- }, {
- title: '登录用户名',
- dataIndex: 'mobile',
- key: 'mobile',
- width: "140px",
- }, {
- title: '角色',
- dataIndex: 'rolesName',
- key: 'rolesName',
- render: (text, record) =>
- <span>
- {text + (getRole(record.ambRole) ? ("(" + getRole(record.ambRole) + ")") : "")}
- </span>
- }, {
- title: '用户姓名',
- dataIndex: 'name',
- key: 'name',
- width: "140px",
- }, {
- title: '部门',
- dataIndex: 'departmentName',
- key: 'departmentName',
- }, {
- title: '分巴',
- dataIndex: 'ancestorsNames',
- key: 'ancestorsNames',
- render: (text, record) =>
- <span>
- {!!text && text.replace(/,/g, "-")}
- {!!record.ambName && "-" + record.ambName}
- </span>
- }, {
- title: '职务',
- dataIndex: 'duty',
- key: 'duty',
- isNoD: true,
- render: text => { return getPost(text) }
- },
- {
- title: '岗位',
- dataIndex: 'position',
- key: 'position',
- isNoD: true,
- render: text => { return getStation(text) }
- },
- {
- title: '员工',
- dataIndex: 'seniorStaff',
- key: 'seniorStaff',
- render: text => <span style={{ fontWeight: text == 1 && "bold" }}>{["新员工", "老员工"][text]}</span>
- },
- {
- title: '上级主管姓名',
- dataIndex: 'superior',
- key: 'superior',
- width: "140px",
- },
- {
- title: '状态',
- dataIndex: 'status',
- key: 'status',
- render: (text) =>
- <span style={{ color: ["green", "red"][text] }}>
- {text == 0
- ? "正常" : text == 1
- ? "停用" : "-"}
- </span>
- },
- {
- title: '最后登录时间',
- dataIndex: 'lastLoginTime',
- key: 'lastLoginTime',
- }
- ],
- column: [{
- title: '用户编号',
- dataIndex: 'userNo',
- key: 'userNo',
- }, {
- title: '登录用户名',
- dataIndex: 'mobile',
- key: 'mobile',
- }, {
- title: '角色',
- dataIndex: 'rolesName',
- key: 'rolesName',
- render: (text, record) =>
- <span>
- {text + (getRole(record.ambRole) ? ("(" + getRole(record.ambRole) + ")") : "")}
- </span>
- }, {
- title: '用户姓名',
- dataIndex: 'name',
- key: 'name',
- }, {
- title: '转交',
- dataIndex: 'ee',
- key: 'ee',
- render: (text, record, index) => {
- return <div>
- <Popconfirm title={'请确认转交【' + record.name + '】'} onConfirm={(e) => { this.examineOK(record) }} okText="确认" cancelText="取消">
- <Button style={{ marginRight: '5px' }} onClick={(e) => { e.stopPropagation() }} type="primary">转交</Button>
- </Popconfirm>
- </div>
- }
- },
- ],
- dataSourceData: [],
- };
- },
- //点击离职一键转交
- resources() {
- this.loadDatas();
- let deletedIds;
- let rowItem;
- for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
- rowItem = this.state.selectedRows[idx];
- // console.log(rowItem.id);
- if (rowItem.id) {
- deletedIds = rowItem.id;
- };
- };
- this.setState({
- visible: true,
- aid: deletedIds
- });
- },
- //关闭离职一键转交
- handleCancel() {
- this.setState({
- visible: false,
- selectedRowKeys: []
- }, () => {
- this.loadData(this.state.page);
- });
- },
- //一键离职
- examineOK(record) {
- // console.log(record);
- this.setState({
- loading: true
- });
- $.ajax({
- method: "POST",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + "/api/admin/role/dimission",
- data: {
- aid: this.state.aid,
- transferId: record.id,
- }
- }).done(function (data) {
- if (!data.error.length) {
- message.success('转交成功!');
- this.handleCancel()
- } else {
- message.warning(data.error[0].message);
- };
- this.setState({
- loading: false,
- visible2: false
- });
- }.bind(this));
- },
- // 设置默认table(用来默认不显示某列数据 isNoD:true)
- defaultcolumns() {
- const newArr = [];
- this.state.columns.forEach((item) => {
- if (item.isNoD) {
- return
- } else {
- newArr.push(item);
- }
- });
- this.setState({
- changeList: newArr,
- }, () => {
- this.loadData();
- });
- },
- componentWillMount() {
- this.defaultcolumns();
- this.loadData();
- this.departmentList();
- this.rolesList();
- this.getList();
- },
- tableRowClick(record, index) {
- this.rolesArrS(record)
- },
- //新建获取id
- addIdS() {
- $.ajax({
- method: "get",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + '/api/admin/superviser/newId',
- data: {},
- success: function (data) {
- this.setState({
- addId: data.data
- });
- }.bind(this),
- }).always(function () {
- this.setState({
- loading: false
- });
- }.bind(this));
- },
- //部门
- departmentList() {
- this.setState({
- loading: true
- });
- $.ajax({
- method: "get",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + "/api/admin/organization/selectSuperId",
- data: {
- },
- success: function (data) {
- let thedata = data.data;
- let theArr = [];
- if (!thedata) {
- if (data.error && data.error.length) {
- message.warning(data.error[0].message);
- };
- thedata = {};
- } else {
- thedata.map(function (item, index) {
- theArr.push({
- key: index,
- name: item.name,
- id: item.id,
- depNo: item.depNo
- })
- })
- }
- this.setState({
- departmentArr: theArr,
- })
- }.bind(this),
- }).always(function () {
- this.setState({
- loading: false
- });
- }.bind(this));
- },
- //修改时获取角色数组
- rolesArrS(e) {
- $.ajax({
- method: "get",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + "/api/admin/role",
- data: {
- uid: e.id
- },
- success: function (data) {
- let thedata = data.data;
- let theArr = [];
- let theId = []
- if (!thedata) {
- if (data.error && data.error.length) {
- message.warning(data.error[0].message);
- };
- thedata = {};
- } else {
- }
- this.setState({
- role: thedata,
- userDetaile: true,
- showDesc: true,
- datauser: e
- })
- }.bind(this),
- }).always(function () {
- }.bind(this));
- },
- //角色
- rolesList() {
- this.setState({
- loading: true
- });
- $.ajax({
- method: "get",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + "/api/roles",
- data: {
- },
- success: function (data) {
- let thedata = data.data;
- let theArr = [];
- if (!thedata) {
- if (data.error && data.error.length) {
- message.warning(data.error[0].message);
- };
- thedata = {};
- } else {
- thedata.map(function (item, index) {
- theArr.push({
- key: index,
- roleName: item.roleName,
- id: item.id,
- })
- })
- }
- this.setState({
- roleArr: theArr,
- })
- }.bind(this),
- }).always(function () {
- this.setState({
- loading: false
- });
- }.bind(this));
- },
- //锁定
- locking() {
- let deletedIds;
- let statust;
- let mobiles;
- let names;
- let rolesId = [];
- for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
- let rowItem = this.state.selectedRows[idx];
- if (rowItem.id) {
- deletedIds = rowItem.id;
- statust = rowItem.status;
- names = rowItem.name;
- mobiles = rowItem.mobile;
- rolesId = rowItem.rolesId
- };
- };
- this.setState({
- selectedRowKeys: [],
- loading: true
- });
- $.ajax({
- method: "POST",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + "/api/admin/superviser/updateAdmin",
- data: {
- roles: rolesId,
- data: JSON.stringify({
- id: deletedIds,
- status: '锁定',
- name: names,
- mobile: mobiles,
- }),
- }
- }).done(function (data) {
- if (!data.error.length) {
- message.success('锁定成功!');
- this.setState({
- loading: false,
- });
- } else {
- message.warning(data.error[0].message);
- };
- this.loadData();
- }.bind(this));
- },
- //激活
- activation() {
- let deletedIds;
- let statust;
- let mobiles;
- let names;
- let rolesId = []
- for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
- let rowItem = this.state.selectedRows[idx];
- if (rowItem.id) {
- deletedIds = rowItem.id;
- statust = rowItem.status;
- names = rowItem.name;
- mobiles = rowItem.mobile;
- rolesId = rowItem.rolesId
- };
- };
- this.setState({
- selectedRowKeys: [],
- loading: true
- });
- $.ajax({
- method: "POST",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + "/api/admin/superviser/updateAdmin",
- data: {
- roles: rolesId,
- data: JSON.stringify({
- id: deletedIds,
- status: 0,
- name: names,
- mobile: mobiles,
- })
- }
- }).done(function (data) {
- if (!data.error.length) {
- message.success('激活成功!');
- this.setState({
- loading: false,
- });
- } else {
- message.warning(data.error[0].message);
- };
- this.loadData();
- }.bind(this));
- },
- //删除
- delectRow() {
- let deletedIds;
- for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
- let rowItem = this.state.selectedRows[idx];
- if (rowItem.id) {
- deletedIds = rowItem.id;
- };
- };
- this.setState({
- selectedRowKeys: [],
- loading: true
- });
- $.ajax({
- method: "POST",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + "/api/admin/superviser/deleteById",
- data: {
- id: deletedIds,
- }
- }).done(function (data) {
- if (!data.error.length) {
- message.success('删除成功!');
- this.setState({
- loading: false,
- });
- } else {
- message.warning(data.error[0].message);
- };
- this.loadData(this.state.page);
- }.bind(this));
- },
- addClick() {
- this.addIdS()
- this.setState({
- datauser: {},
- showDesc: true,
- userDetaile: false,
- });
- },
- closeDesc(e, s) {
- this.setState({
- userDetaile: false,
- showDesc: e
- })
- if (s) {
- this.loadData(this.state.page);
- };
- },
- search() {
- this.state.userDetaile = false
- this.loadData();
- },
- searchs() {
- this.state.userDetaile = false
- this.loadDatas();
- },
- reset() {
- this.state.ambManage = undefined
- this.state.ambId = undefined;
- this.state.amb = 1;
- this.state.userNameSearch = undefined;
- this.state.organizationSearch = undefined;
- this.state.rolesSearch = undefined;
- this.state.postSearch = undefined;
- this.state.stationSearch = undefined;
- this.state.statusSeach = undefined;
- this.state.signNameSearch = undefined;
- this.state.mobileSearch = undefined;
- this.state.auto = undefined;
- this.state.theTypes = undefined;
- this.state.seniorStaff = undefined;
- this.state.publicPurview = undefined;
- this.loadData();
- },
- resets() {
- this.state.userNameSearchs = '';
- this.state.organizationSearch = undefined;
- this.state.rolesSearch = undefined;
- this.state.postSearch = undefined;
- this.state.stationSearch = undefined;
- this.state.statusSeach = undefined;
- this.state.signNameSearch = '';
- this.state.mobileSearch = '';
- this.state.auto = '';
- this.state.theTypes = '';
- this.loadDatas();
- },
- searchSwitch() {
- this.setState({
- searchMore: !this.state.searchMore
- });
- },
- //主管初始加载(自动补全)
- 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, options) {
- this.setState({
- auto: value
- })
- },
- blurChange(e) {
- let theType = '';
- let contactLists = this.state.customerArr || [];
- if (e) {
- contactLists.map(function (item) {
- if (item.name == e.toString()) {
- theType = item.id;
- }
- });
- }
- this.setState({
- theTypes: theType
- })
- },
- //值改变时请求客户名称
- httpChange(e) {
- if (e.length >= 1) {
- this.supervisor(e);
- }
- this.setState({
- auto: e
- })
- },
- changeList(arr) {
- const newArr = [];
- this.state.columns.forEach(item => {
- arr.forEach(val => {
- if (val === item.title) {
- newArr.push(item);
- }
- });
- });
- this.setState({
- changeList: newArr
- });
- },
- // 筛选数据
- getList() {
- this.setState({
- loading: true,
- });
- $.ajax({
- method: "get",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + "/api/admin/amb/selectAll",
- success: function (data) {
- this.setState({
- loading: false,
- });
- if (data.error && data.error.length === 0) {
- let menuList = data.data
- this.setState({
- level1Data: menuList ? this.handleTreeData(menuList) : []
- });
- } else {
- message.warning(data.error[0].message);
- }
- }.bind(this),
- }).always(
- function () {
- this.setState({
- loading: false,
- });
- }.bind(this)
- );
- },
- // 树状默认数据处理
- handleTreeData(treeData) {
- let nodeDta = [];
- treeData.map(item => {
- let treeObj = {};
- treeObj.key = item.id
- treeObj.id = item.id
- treeObj.value = item.id
- treeObj.label = item.name
- treeObj.title = item.name
- treeObj.lvl = item.lvl
- treeObj.parentId = item.parentId
- item.list ? treeObj.children = this.handleTreeData(item.list) : null;
- nodeDta.push(treeObj)
- })
- return nodeDta
- },
- render() {
- const rowSelection = {
- selectedRowKeys: this.state.selectedRowKeys,
- onChange: (selectedRowKeys, selectedRows) => {
- this.setState({
- selectedRows: selectedRows.slice(-1),
- selectedRowKeys: selectedRowKeys.slice(-1)
- });
- },
- onSelectAll: (selected, selectedRows, changeRows) => {
- this.setState({
- selectedRowKeys: []
- })
- },
- };
- const dataSources = this.state.customerArr || [];
- const options = dataSources.map((group, index) =>
- <Select.Option key={index} value={group.name}>{group.name}</Select.Option>
- )
- const hasSelected = this.state.selectedRowKeys.length > 0;
- const { RangePicker } = DatePicker;
- let departmentArr = this.state.departmentArr || [];
- let roleArr = this.state.roleArr || [];
- return (
- <div className="user-content">
- <div className="content-title">
- <Tabs defaultActiveKey="1" onChange={this.callback} className="test">
- <TabPane tab="搜索" key="1">
- <div className="user-search" style={{ paddingBottom: 10 }}>
- <Input
- placeholder="用户姓名"
- style={{ width: "180px" }}
- value={this.state.userNameSearch}
- onChange={e => {
- this.setState({ userNameSearch: e.target.value });
- }}
- />
- {window.adminData.isSuperAdmin ? (
- <Select
- placeholder="部门"
- style={{ width: 180 }}
- value={this.state.organizationSearch}
- onChange={e => {
- this.setState({ organizationSearch: e });
- }}
- >
- {departmentArr.map(function (item) {
- return (
- <Select.Option key={item.id}>{item.name}</Select.Option>
- );
- })}
- </Select>
- ) : (
- ""
- )}
- <Select
- placeholder="角色"
- style={{ width: 180 }}
- value={this.state.rolesSearch}
- onChange={e => {
- this.setState({ rolesSearch: e });
- }}
- >
- {roleArr.map(function (item) {
- return (
- <Select.Option key={item.id}>
- {item.roleName}
- </Select.Option>
- );
- })}
- </Select>
- <Select
- placeholder="职务"
- style={{ width: 100 }}
- value={this.state.postSearch}
- onChange={e => {
- this.setState({ postSearch: e });
- }}
- >
- {post.map(function (item) {
- return (
- <Select.Option key={item.value}>
- {item.key}
- </Select.Option>
- );
- })}
- </Select>
- <Select
- placeholder="员工"
- style={{ width: 100 }}
- value={this.state.seniorStaff}
- onChange={e => {
- this.setState({ seniorStaff: e });
- }}
- >
- <Select.Option value={0}>新员工</Select.Option>
- <Select.Option value={1}>老员工</Select.Option>
- </Select>
- <Select
- placeholder="业务员"
- style={{ width: 100 }}
- value={this.state.publicPurview}
- onChange={e => {
- this.setState({ publicPurview: e });
- }}
- >
- <Select.Option value={0}>否</Select.Option>
- <Select.Option value={1}>是</Select.Option>
- </Select>
- <Select
- placeholder="岗位"
- style={{ width: 100 }}
- value={this.state.stationSearch}
- onChange={e => {
- this.setState({ stationSearch: e });
- }}
- >
- {station.map(function (item) {
- return (
- <Select.Option key={item.value}>
- {item.key}
- </Select.Option>
- );
- })}
- </Select>
- <Select
- placeholder="状态"
- style={{ width: 100 }}
- value={this.state.statusSeach}
- onChange={e => {
- this.setState({ statusSeach: e });
- }}
- >
- <Select.Option value={0}>正常</Select.Option>
- <Select.Option value={1}>锁定</Select.Option>
- </Select>
- <Input
- placeholder="登录用户名"
- style={{ width: "180px" }}
- value={this.state.signNameSearch}
- onChange={e => {
- this.setState({ signNameSearch: e.target.value });
- }}
- />
- <AutoComplete
- className="certain-category-search"
- dropdownClassName="certain-category-search-dropdown"
- dropdownMatchSelectWidth={false}
- style={{ width: 180 }}
- dataSource={options}
- placeholder="输入上级主管名字"
- value={this.state.auto}
- onChange={this.httpChange}
- filterOption={true}
- onBlur={this.blurChange}
- onSelect={this.selectAuto}
- >
- <Input />
- </AutoComplete>
- <div style={{ marginTop: 10 }}>
- <Select
- placeholder="巴主"
- style={{ width: 180 }}
- value={this.state.ambManage}
- onChange={e => {
- this.setState({ ambManage: e });
- }}
- >
- <Select.Option value={0}>非巴主</Select.Option>
- <Select.Option value={1}>巴主</Select.Option>
- </Select>
- <TreeSelect
- style={{ width: 300 }}
- value={this.state.ambId}
- dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
- treeData={this.state.level1Data}
- placeholder="请选择分巴"
- showSearch
- treeNodeFilterProp="title"
- onChange={(e) => {
- this.setState({
- ambId: e,
- });
- }}
- />
- {
- !!this.state.ambId &&
- <Select
- placeholder=""
- style={{ width: 180 }}
- value={this.state.amb}
- onChange={e => {
- this.setState({ amb: e });
- }}
- >
- <Select.Option value={1}>本巴</Select.Option>
- <Select.Option value={2}>全部</Select.Option>
- </Select>
- }
- <Button style={{ marginRight: 10 }} type="primary" onClick={this.search}>搜索</Button>
- <Button style={{ marginRight: 10 }} onClick={this.reset}>重置</Button>
- <Button
- style={{ background: "red", border: "none", color: "#fff", display: "none" }}
- disabled={!hasSelected}
- onClick={this.delectRow}
- >
- 删除
- <Icon type="minus" />
- </Button>
- </div>
- {/* <span>更多搜索<Switch defaultChecked={false} onChange={this.searchSwitch} /></span> */}
- </div>
- </TabPane>
- <TabPane tab="操作" key="2">
- <Button
- style={{
- background: "#333333",
- border: "none",
- color: "#fff",
- marginBottom: 10,
- marginTop: 12,
- marginRight: 10
- }}
- disabled={!hasSelected}
- onClick={this.locking}
- >
- 锁定
- <Icon type="lock" />
- </Button>
- <Button
- style={{ background: "green", border: "none", color: "#fff", marginTop: 12 }}
- disabled={!hasSelected}
- onClick={this.activation}
- >
- 激活
- <Icon type="unlock" />
- </Button>
- {/* </TabPane>
- <TabPane tab="新增" key="3"> */}
- <Button
- type="primary"
- className="addButton"
- style={{ float: "left", marginBottom: 10, marginTop: 12 }}
- onClick={this.addClick}
- >
- 新增用户
- <Icon type="user" />
- </Button>
- {/* </TabPane>
- <TabPane tab="离职转交" key="4"> */}
- <Button
- type="primary"
- className="addButton"
- style={{ float: "left", marginBottom: 10, marginTop: 12 }}
- onClick={this.resources}
- disabled={!hasSelected}
- >
- 离职一键转交
- <Icon type="user" />
- </Button>
- </TabPane>
- <TabPane tab="更改表格显示数据" key="3">
- <div style={{ marginLeft: 10 }}>
- <ChooseList
- columns={this.state.columns}
- changeFn={this.changeList}
- changeList={this.state.changeList}
- top={55}
- margin={11}
- />
- </div>
- </TabPane>
- </Tabs>
- <div className="patent-table">
- <Spin spinning={this.state.loading}>
- <Table
- bordered
- columns={
- this.state.changeList
- ? this.state.changeList
- : this.state.columns
- }
- style={{
- cursor: 'pointer',
- }}
- dataSource={this.state.dataSource}
- rowSelection={rowSelection}
- pagination={this.state.pagination}
- onRowClick={this.tableRowClick}
- />
- </Spin>
- </div>
- {this.state.showDesc &&
- <Newuser
- role={this.state.role}
- addId={this.state.addId}
- roleArr={this.state.roleArr}
- departmentArr={this.state.departmentArr}
- userDetaile={this.state.userDetaile}
- datauser={this.state.datauser}
- showDesc={this.state.showDesc}
- closeDesc={this.closeDesc}
- level1Data={this.state.level1Data}
- />}
- <div className="patent-desc">
- <Modal
- maskClosable={false}
- visible={this.state.visible}
- onOk={this.checkResources}
- onCancel={this.handleCancel}
- width="800px"
- title="离职一键转交"
- footer=""
- className="admin-desc-content"
- >
- <Input
- placeholder="用户姓名"
- style={{
- width: "180px",
- marginRight: "10px",
- marginBottom: "10px"
- }}
- value={this.state.userNameSearchs}
- onChange={e => {
- this.setState({ userNameSearchs: e.target.value });
- }}
- />
- <Button type="primary" onClick={this.searchs}>
- 搜索
- </Button>
- <Button onClick={this.resets}>重置</Button>
- <div className="patent-table">
- <Spin spinning={this.state.loading}>
- <Table
- columns={this.state.column}
- dataSource={this.state.dataSourceData}
- pagination={this.state.paginations}
- style={{
- cursor: 'pointer',
- }}
- // onRowClick={this.tableRowClick}
- />
- </Spin>
- </div>
- </Modal>
- </div>
- </div>
- </div>
- );
- }
- }));
- export default User;
|