1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210 |
- import React from 'react';
- import ReactDom from 'react-dom';
- import ajax from 'jquery/src/ajax/xhr.js';
- import $ from 'jquery/src/ajax';
- import '../content.less';
- import { citySelect } from '../../../NewDicProvinceList';
- import {
- getNewDiccityArr,
- } from "@/tools.js";
- import { Form, Radio, Icon, Button, Input, Select, Spin, Table, Switch, message, DatePicker, Modal, Upload, Popconfirm, AutoComplete, Tabs } from 'antd';
- import { patternOrganization, conditionOrganization } from '../../../dataDic.js';
- import { getPattern, getCondition } from '../../../tools.js';
- import { ChooseList } from "../../order/orderNew/chooseList";
- const confirm = Modal.confirm;
- const { TabPane } = Tabs
- const Organization = Form.create()(React.createClass({
- loadData(pageNo) {
- this.state.data = [];
- this.setState({
- loading: true,
- });
- $.ajax({
- method: "post",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + '/api/admin/organization/listOrganizationManagement',
- data: {
- pageNo: pageNo || 1,
- pageSize: this.state.pagination.pageSize,
- name: this.state.name, //组织名称
- superId: this.state.superId,//上级组织
- type: this.state.type,//组织类型
- depNo: this.state.depNo1,//组织编号
- },
- 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,//每一条记录的ID
- depNo: thisdata.depNo,//组织编号
- name: thisdata.name,//组织名称
- type: thisdata.type,//组织类型
- managerId: thisdata.managerName,//负责人
- superId: thisdata.superName,//上级组织
- status: thisdata.status,//组织状态
- workingHoursName: thisdata.workingHoursName,
- hideSign: thisdata.hideSign,//显示标识
- });
- };
- this.state.pagination.current = data.data.pageNo;
- this.state.pagination.total = data.data.totalCount;
- this.setState({
- dataSource: theArr,
- page: data.data.pageNo,
- pagination: this.state.pagination
- });
- };
- }.bind(this),
- }).always(function () {
- this.setState({
- loading: false
- });
- }.bind(this));
- },
- getInitialState() {
- return {
- editvisible: false,
- workingHoursType: 0,
- searchMore: true,
- selectedRowKeys: [],
- selectedRows: [],
- loading: false,
- workTimeList: [],
- 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: 'depNo',
- key: 'depNo',
- }, {
- title: '组织名称',
- dataIndex: 'name',
- key: 'name',
- }, {
- title: '负责人',
- dataIndex: 'managerId',
- key: 'managerId',
- }, {
- title: '组织类型',
- dataIndex: 'type',
- key: 'type',
- render: text => { return getPattern(text) }
- }, {
- title: '上级组织',
- dataIndex: 'superId',
- key: 'superId',
- }, {
- title: '组织状态',
- dataIndex: 'status',
- key: 'status',
- render: text => { return getCondition(text) }
- }, {
- title: '作息时间类型',
- dataIndex: 'workingHoursName',
- key: 'workingHoursName',
- }, {
- title: '显示标识',
- dataIndex: 'hideSign',
- key: 'hideSign',
- render: text => { return ["不显示", "显示"][text] }
- },
- ],
- dataSource: [],
- searchTime: [,],
- };
- },
- componentWillMount() {
- this.selectSuperId();
- this.getWorkTimeList();
- },
- //获取上级组织
- selectSuperId() {
- this.state.data = []
- $.ajax({
- method: "get",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + "/api/admin/organization/selectSuperId",
- data: {
- hideSign: 2,//查询所有(0不显示 1显示 2所有)
- },
- success: function (data) {
- let theArr = [];
- let theId = [];//用于保存上级组织的ID和名称
- let thedata = data.data;
- if (!thedata) {
- if (data.error && data.error.length) {
- message.warning(data.error[0].message);
- };
- thedata = {};
- };
- var contactIds = [];
- for (var i = 0; i < data.data.length; i++) {
- let theData = data.data[i];
- theArr.push(
- <Select.Option value={theData.id} key={theData.id}>{theData.name}</Select.Option>
- );
- theId.push(
- [theData.id, theData.name]
- );
- };
- this.setState({
- SuperArr: thedata,
- contactsOption: theArr,
- theId: theId,
- orderStatusOptions: data.data,
- });
- }.bind(this),
- }).always(function () {
- this.loadData(this.state.page);
- this.setState({
- loading: false
- });
- }.bind(this));
- },
- //获取作息时间
- getWorkTimeList() {
- $.ajax({
- method: "get",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + "/api/admin/department/workingHours/list",
- data: {},
- success: function (data) {
- if (data.error.length === 0) {
- this.setState({
- workTimeList: data.data,
- });
- } else {
- message.warning(data.error[0].message);
- }
- }.bind(this),
- }).always(function () {
- this.setState({
- loading: false
- });
- }.bind(this));
- },
- //编辑部门,保存
- edithandleSubmit(e) {
- e.preventDefault();
- if (!this.state.depNo) {
- message.warning('请填写组织编号');
- return
- }
- //上级组织字典
- let nameText = this.state.SuperArr
- let superText = this.state.editSuperId;
- let upId = this.state.theId;
- let oldId = '';
- let superOne = this.state.editDataSource[0].editSuperId;
- if (superOne == superText) {
- for (let j = 0; j < upId.length; j++) {
- if (superText == upId[j][1]) {
- oldId = upId[j][0]
- }
- }
- };
- let remarksText = (this.state.editRemarks) ? this.state.editRemarks : '该组织没有职能说明,请完善!';
- let isStatus = this.state.editStatus;
- let _this = this;
- if (isStatus == 1) {
- confirm({
- title: '是否要解散该部门?',
- onOk() {
- if (!(superOne == superText)) {
- confirm({
- title: '上级组织已修改,是否保存?',
- onOk() {
- $.ajax({
- method: "post",
- dataType: "json",
- crossDomain: false,
- url:
- globalConfig.context +
- "/api/admin/organization/updateOrganization",
- data: {
- name: _this.state.editName, //组织名称
- type: _this.state.editType, //组织类型
- managerId: _this.state.theTypes
- ? _this.state.theTypes
- : _this.state.managerIdOrganizationId, //负责人ID
- financeId: _this.state.theTypes2
- ? _this.state.theTypes2
- : _this.state.financeId, //负责人ID
- superId: _this.state.editSuperId, //上级组织
- status: _this.state.editStatus, //组织状态
- remarks: remarksText, //组织职能说明
- id: _this.state.editId, //组织ID
- updateOrganization: _this.state.updateOrganization,
- abbreviation: _this.state.abbreviation,
- workingHoursType: _this.state.workingHoursType,
- hideSign: _this.state.hideSign,//显示标识
- depNo: _this.state.depNo,//组织编号
- }
- }).done(
- function (data) {
- _this.setState({
- loading: false
- });
- if (!data.error.length) {
- message.success("保存成功!");
- _this.edithandleCancel();
- _this.selectSuperId();
- } else {
- message.warning(data.error[0].message);
- }
- }.bind(_this)
- );
- return false
- }
- })
- } else {
- $.ajax({
- method: "post",
- dataType: "json",
- crossDomain: false,
- url:
- globalConfig.context +
- "/api/admin/organization/updateOrganization",
- data: {
- name: _this.state.editName, //组织名称
- type: _this.state.editType, //组织类型
- managerId: _this.state.theTypes
- ? _this.state.theTypes
- : _this.state.managerIdOrganizationId, //负责人ID
- financeId: _this.state.theTypes2
- ? _this.state.theTypes2
- : _this.state.financeId, //负责人ID
- superId: oldId, //上级组织
- status: _this.state.editStatus, //组织状态
- remarks: remarksText, //组织职能说明
- id: _this.state.editId, //组织ID
- abbreviation: _this.state.abbreviation,
- workingHoursType: _this.state.workingHoursType,
- hideSign: _this.state.hideSign,//显示标识
- depNo: _this.state.depNo,//组织编号
- }
- }).done(
- function (data) {
- _this.setState({
- loading: false
- });
- if (!data.error.length) {
- message.success("保存成功!");
- _this.edithandleCancel();
- _this.selectSuperId();
- } else {
- message.warning(data.error[0].message);
- }
- }.bind(_this)
- );
- }
- }
- })
- } else {
- if (!(superOne == superText)) {
- confirm({
- title: '上级组织已修改,是否保存?',
- onOk() {
- $.ajax({
- method: "post",
- dataType: "json",
- crossDomain: false,
- url:
- globalConfig.context +
- "/api/admin/organization/updateOrganization",
- data: {
- name: _this.state.editName, //组织名称
- type: _this.state.editType, //组织类型
- managerId: _this.state.theTypes
- ? _this.state.theTypes
- : _this.state.managerIdOrganizationId, //负责人ID
- financeId: _this.state.theTypes2
- ? _this.state.theTypes2
- : _this.state.financeId, //负责人ID
- superId: _this.state.editSuperId, //上级组织
- status: _this.state.editStatus, //组织状态
- province: _this.state.province,//省份
- remarks: remarksText, //组织职能说明
- id: _this.state.editId, //组织ID
- abbreviation: _this.state.abbreviation,
- workingHoursType: _this.state.workingHoursType,
- hideSign: _this.state.hideSign,//显示标识
- depNo: _this.state.depNo,//组织编号
- }
- }).done(
- function (data) {
- _this.setState({
- loading: false
- });
- if (!data.error.length) {
- message.success("保存成功!");
- _this.edithandleCancel();
- _this.selectSuperId();
- } else {
- message.warning(data.error[0].message);
- }
- }.bind(_this)
- );
- return false
- }
- })
- } else {
- $.ajax({
- method: "post",
- dataType: "json",
- crossDomain: false,
- url:
- globalConfig.context +
- "/api/admin/organization/updateOrganization",
- data: {
- name: _this.state.editName, //组织名称
- type: _this.state.editType, //组织类型
- managerId: _this.state.theTypes
- ? _this.state.theTypes
- : _this.state.managerIdOrganizationId, //负责人ID
- financeId: _this.state.theTypes2
- ? _this.state.theTypes2
- : _this.state.financeId, //负责人ID
- superId: oldId, //上级组织
- status: _this.state.editStatus, //组织状态
- remarks: remarksText, //组织职能说明
- id: _this.state.editId, //组织ID
- abbreviation: _this.state.abbreviation,
- province: _this.state.province,
- workingHoursType: _this.state.workingHoursType,
- hideSign: _this.state.hideSign,//显示标识
- depNo: _this.state.depNo,//组织编号
- }
- }).done(
- function (data) {
- _this.setState({
- loading: false
- });
- if (!data.error.length) {
- message.success("保存成功!");
- _this.edithandleCancel();
- _this.selectSuperId();
- } else {
- message.warning(data.error[0].message);
- }
- }.bind(_this)
- );
- }
- }
- },
- //整行点击
- tableRowClick(record, index) {
- this.selectSuperId();
- this.state.RowData = record;
- this.setState({
- editvisible: true,
- selectedRowKeys: [],
- rowId: record.businessId,
- })
- $.ajax({
- method: "post",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + "/api/admin/organization/selectAllById",
- data: {
- id: record.id
- },
- success: function (data) {
- let theArr = [];
- let thisdata = data.data;
- if (data.error.length === 0) {
- theArr.push({
- editId: thisdata.id, //每一条记录的ID
- editName: thisdata.name, //组织名称
- editManagerId: thisdata.managerId, //负责人
- editType: thisdata.type, //组织类型
- editStatus: thisdata.status, //组织状态
- province: thisdata.province,//省份
- editSuperId: thisdata.superId, //上级组织
- depNo: thisdata.depNo, //组织编号
- editCreateId: thisdata.createId, //创建人
- editTime: thisdata.createTime, //创建时间
- editRemarks: thisdata.remarks, //组织职能说明
- workingHoursType: thisdata.workingHoursType,//作息时间类型
- financeId: thisdata.financeId,
- hideSign: thisdata.hideSign,//显示标识
- });
- this.setState({
- editId: thisdata.id, //每一条记录的ID
- financeId: thisdata.financeId,
- financeName: thisdata.financeName,
- editName: thisdata.name, //组织名称
- managerIdOrganization: thisdata.managerName, //负责人名字
- managerIdOrganizationId: thisdata.managerId, //负责人idmanagerName
- editType: thisdata.type, //组织类型
- editStatus: thisdata.status, //组织状态
- province: thisdata.province, //省份
- editSuperId: thisdata.superId, //上级组织
- depNo: thisdata.depNo, //组织编号
- editCreateId: thisdata.createId, //创建人
- editTime: thisdata.createTime, //创建时间
- editRemarks: thisdata.remarks, //组织职能说明
- workingHoursType: thisdata.workingHoursType,//作息时间类型
- editDataSource: theArr,
- abbreviation: thisdata.abbreviation,
- hideSign: thisdata.hideSign,//显示标识
- });
- } else {
- message.warning(data.error[0].message);
- }
- }.bind(this),
- }).always(function (data) {
- this.setState({
- loading: false
- });
- }.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: deletedIds.length > 0
- });
- $.ajax({
- method: "POST",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + "/api/admin/organization/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.selectSuperId();
- }.bind(this));
- },
- //新增一个部门,保存
- addhandleSubmit(e) {
- e.preventDefault();
- // if(!this.state.theTypes){
- // message.warning('请输入负责人姓名');
- // return false;
- // }
- if (!this.state.typeOrganization) {
- message.warning('请选择组织类型');
- return false;
- }
- if (!this.state.upOrganization) {
- message.warning('请选择上级组织');
- return false;
- }
- if (!this.state.depNo) {
- message.warning('请填写组织编号');
- return false;
- }
- this.props.form.validateFields((err, values) => {
- if (!err) {
- this.setState({
- loading: true
- });
- $.ajax({
- method: "post",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + '/api/admin/organization/addOrganization',
- data: {
- name: this.state.nameOrganization,//组织名称
- managerId: this.state.theTypes,//负责人ID
- type: this.state.typeOrganization, //组织类型
- superId: this.state.upOrganization,//上级组织
- remarks: this.state.remarksOrganization,//组织职能说明
- workingHoursType: this.state.workingHoursType,//作息时间
- hideSign: this.state.hideSign,//显示标识
- depNo: this.state.depNo,//组织编号
- }
- }).done(function (data) {
- this.setState({
- loading: false
- });
- if (!data.error.length) {
- message.success('保存成功!');
- this.handleCancel();
- this.selectSuperId();
- } 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, options) {
- this.setState({
- managerIdOrganization: value
- })
- let theType = '';
- let contactLists = this.state.customerArr || [];
- if (value) {
- contactLists.map(function (item) {
- if (item.name == value.toString()) {
- theType = item.id;
- }
- });
- }
- this.setState({
- theTypes: theType
- })
- },
- selectAuto2(value, options) {
- this.setState({
- financeId: value
- })
- let theType = '';
- let contactLists = this.state.customerArr || [];
- if (value) {
- contactLists.map(function (item) {
- if (item.name == value.toString()) {
- theType = item.id;
- }
- });
- }
- this.setState({
- theTypes2: theType
- })
- },
- //失去焦点时
- blurChange(e) {
- },
- //值改变时请求客户名称
- httpChange(e) {
- if (e.length >= 1) {
- this.supervisor(e);
- }
- this.setState({
- managerIdOrganization: e
- })
- },
- httpChange2(e) {
- if (e.length >= 1) {
- this.supervisor(e);
- }
- this.setState({
- financeName: e
- })
- },
- addClick() {
- this.state.DepN = '';//组织编号
- this.state.theTypes = '';
- this.state.nameOrganization = '';//组织名称清零
- this.state.managerIdOrganization = '';//负责人ID清零
- this.state.financeId = "";//负责人ID清零
- this.state.financeName = "";//负责人ID清零
- this.state.typeOrganization = undefined; //组织类型清零
- this.state.upOrganization = undefined;//上级组织清零
- this.state.remarksOrganization = '';//组织职能说明清零
- this.state.hideSign = 1;//显示标识默认为1(显示)
- this.state.RowData = {};
- this.setState({
- workingHoursType: 0,
- visible: true
- });
- this.selectSuperId();
- },
- editClick() {
- this.state.RowData = {};
- this.setState({
- editvisible: true
- });
- },
- handleCancel() {
- this.setState({ visible: false })
- },
- edithandleCancel() {
- this.loadData(this.state.page);
- this.setState({ editvisible: false })
- },
- search() {
- this.loadData();
- },
- //把搜索的部分置零
- reset() {
- this.state.superId = undefined;//上级组织清零
- this.state.name = '';//组织名称清零
- this.state.type = undefined;//组织类型清零
- this.state.depNo1 = '';//组织编号清零
- this.loadData();
- },
- searchSwitch() {
- this.setState({
- searchMore: !this.state.searchMore
- });
- },
- changeList(arr) {
- const newArr = [];
- this.state.columns.forEach(item => {
- arr.forEach(val => {
- if (val === item.title) {
- newArr.push(item);
- }
- });
- });
- this.setState({
- changeList: newArr
- });
- },
- render() {
- const FormItem = Form.Item
- const rowSelection = {
- selectedRowKeys: this.state.selectedRowKeys,
- onChange: (selectedRowKeys, selectedRows) => {
- this.setState({
- selectedRows: selectedRows.slice(-1),
- selectedRowKeys: selectedRowKeys.slice(-1)
- });
- },
- onSelect: (recordt, selected, selectedRows) => {
- this.setState({
- recordt: recordt.id
- })
- },
- };
- const formItemLayout = {
- labelCol: { span: 8 },
- wrapperCol: { span: 14 },
- };
- const { getFieldDecorator } = this.props.form;
- const hasSelected = this.state.selectedRowKeys.length > 0;
- const { RangePicker } = DatePicker;
- const dataSources = this.state.customerArr || [];
- const options = dataSources.map((group, index) =>
- <Option key={index} value={group.name}>{group.name}</Option>
- )
- const options2 = dataSources.map((group, index) =>
- <Option key={index} value={group.name}>{group.name}</Option>
- )
- 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">
- <Input placeholder="组织名称" style={{ width: '150px', marginRight: '10px', marginBottom: '10px' }}
- value={this.state.name}
- onChange={(e) => { this.setState({ name: e.target.value }); }} />
- <Select placeholder="上级组织"
- style={{ width: '200px', marginRight: '10px' }}
- value={this.state.superId}
- onChange={(e) => { this.setState({ superId: e }) }} notFoundContent="未获取到上级组织列表">
- {this.state.contactsOption}
- </Select>
- <Button type="primary" onClick={this.search} style={{ marginRight: '10px' }}>搜索</Button>
- <Button onClick={this.reset} style={{ marginRight: '10px' }}>重置</Button>
- <Popconfirm title="是否删除?" onConfirm={this.delectRow} okText="是" cancelText="否">
- <Button style={{ background: "#ea0862", border: "none", color: "#fff", marginRight: '10px', marginLeft: '10px' }}
- disabled={!hasSelected}
- >删除<Icon type="minus" />
- </Button>
- </Popconfirm>
- <span style={{ marginRight: '20px' }}>更多搜索 <Switch defaultChecked={false} onChange={this.searchSwitch} /></span>
- <div style={this.state.searchMore ? { display: 'none' } : { display: 'inline-block' }}>
- <Input placeholder="组织编号" style={{ width: '150px', marginRight: '10px' }}
- value={this.state.depNo1}
- onChange={(e) => { this.setState({ depNo1: e.target.value }); }} />
- <Select placeholder="组织类型"
- style={{ width: '150px', marginRight: '50px' }}
- value={this.state.type}
- onChange={(e) => { this.setState({ type: e }) }}>
- <Select.Option value="0" >公司</Select.Option>
- <Select.Option value="1" >部门</Select.Option>
- <Select.Option value="2" >团队</Select.Option>
- </Select>
- </div>
- </div>
- </TabPane>
- <TabPane tab="新增组织" key="2" >
- <Button
- type="primary"
- className="addButton"
- onClick={this.addClick}
- style={{ marginBottom: '10px', float: 'left' }}
- >新增组织<Icon type="plus" /></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 size="middle" columns={
- this.state.changeList
- ? this.state.changeList
- : this.state.columns
- }
- dataSource={this.state.dataSource}
- rowSelection={rowSelection}
- style={{
- cursor: 'pointer',
- }}
- pagination={this.state.pagination}
- onRowClick={this.tableRowClick} />
- </Spin>
- </div>
- <div className="patent-desc">
- <Modal maskClosable={false} visible={this.state.visible}
- onOk={this.checkPatentProcess} onCancel={this.handleCancel}
- width='600px'
- title='新增组织'
- footer=''
- className="admin-desc-content">
- <Form horizontal onSubmit={this.addhandleSubmit} id="add-form">
- <Spin spinning={this.state.loading}>
- <div className="clearfix">
- <FormItem
- labelCol={{ span: 7 }}
- wrapperCol={{ span: 12 }}
- label="组织名称" >
- <Input placeholder="组织名称" value={this.state.nameOrganization} style={{ width: '95%' }}
- onChange={(e) => { this.setState({ nameOrganization: e.target.value }) }} required="required" />
- <span className="mandatory" style={{ color: 'red', marginLeft: '5px' }}>*</span>
- </FormItem>
- </div>
- <div className="clearfix">
- <FormItem
- labelCol={{ span: 7 }}
- wrapperCol={{ span: 12 }}
- label="负责人"
- >
- <AutoComplete
- className="certain-category-search"
- dropdownClassName="certain-category-search-dropdown"
- dropdownMatchSelectWidth={false}
- dataSource={options}
- placeholder="输入名称"
- value={this.state.managerIdOrganization}
- onChange={this.httpChange}
- filterOption={true}
- onBlur={this.blurChange}
- onSelect={this.selectAuto}
- style={{ width: '95%' }}
- >
- <Input />
- </AutoComplete>
- {/*<span className="mandatory" style={{color:'red',marginLeft:'5px'}}>*</span>*/}
- </FormItem>
- </div>
- <div className="clearfix">
- <FormItem
- labelCol={{ span: 7 }}
- wrapperCol={{ span: 12 }}
- label="组织类型"
- >
- <Select placeholder="组织类型" value={this.state.typeOrganization}
- onChange={(e) => { this.setState({ typeOrganization: e }) }} style={{ width: '95%' }} required="required">
- {
- patternOrganization.map(function (item) {
- return <Select.Option key={item.value} >{item.key}</Select.Option>
- })
- }
- </Select>
- <span className="mandatory" style={{ color: 'red', marginLeft: '5px' }}>*</span>
- </FormItem>
- </div>
- <div className="clearfix">
- <FormItem
- labelCol={{ span: 7 }}
- wrapperCol={{ span: 12 }}
- label="上级组织"
- >
- <Select placeholder="请选择上级组织"
- value={this.state.upOrganization}
- onChange={(e) => { this.setState({ upOrganization: e }) }}
- notFoundContent="未获取到上级组织列表"
- style={{ width: '95%' }} required="required">
- {this.state.contactsOption}
- </Select>
- <span className="mandatory" style={{ color: 'red', marginLeft: '5px' }}>*</span>
- </FormItem>
- </div>
- <div className="clearfix">
- <FormItem
- labelCol={{ span: 7 }}
- wrapperCol={{ span: 12 }}
- label="选择作息时间类型"
- >
- <Select placeholder="请选择作息时间类型"
- style={{ width: '95%' }}
- value={this.state.workingHoursType}
- onChange={(e) => { this.setState({ workingHoursType: e }) }}
- notFoundContent="未获取到作息时间类型">
- {this.state.workTimeList.map((v, k) => (
- <Select.Option value={v.type} key={k}>{v.name}</Select.Option>
- ))}
- </Select>
- </FormItem>
- </div>
- <div className="clearfix">
- <FormItem
- labelCol={{ span: 7 }}
- wrapperCol={{ span: 12 }}
- label="组织编号"
- >
- <Input
- placeholder='组织编号'
- value={this.state.depNo}
- onChange={(e) => {
- this.setState({
- depNo: e.target.value
- })
- }}
- />
- </FormItem>
- </div>
- <div className="clearfix">
- <FormItem
- labelCol={{ span: 7 }}
- wrapperCol={{ span: 12 }}
- label="组织职能说明" >
- <Input type="textarea" rows={4} placeholder="组织职能说明" value={this.state.remarksOrganization}
- onChange={(e) => { this.setState({ remarksOrganization: e.target.value }) }} style={{ width: '95%' }} />
- </FormItem>
- </div>
- <div className="clearfix">
- <FormItem
- labelCol={{ span: 7 }}
- wrapperCol={{ span: 12 }}
- label="显示标识"
- >
- <Select placeholder="显示标识"
- value={this.state.hideSign}
- onChange={(e) => { this.setState({ hideSign: e }) }}
- style={{ width: '95%' }}
- required="required"
- >
- <Option value={0}>不显示</Option>
- <Option value={1}>显示</Option>
- </Select>
- <span className="mandatory" style={{ color: 'red', marginLeft: '5px' }}>*</span>
- </FormItem>
- </div>
- <FormItem wrapperCol={{ span: 12, offset: 7 }}>
- <Button className="set-submit" type="primary" htmlType="submit">保存</Button>
- <Button className="set-submit" type="ghost" onClick={this.handleCancel} style={{ marginLeft: '100px' }}>取消</Button>
- </FormItem>
- </Spin>
- </Form >
- </Modal>
- </div>
- <div className="patent-desc">
- <Modal maskClosable={false} visible={this.state.editvisible}
- onOk={this.checkPatentProcess} onCancel={this.edithandleCancel}
- width='600px'
- title='编辑组织'
- footer=''
- className="admin-desc-content">
- <Form horizontal onSubmit={this.edithandleSubmit} id="edit-form">
- <Spin spinning={this.state.loading}>
- <div className="clearfix">
- <FormItem
- labelCol={{ span: 7 }}
- wrapperCol={{ span: 12 }}
- label="组织名称" >
- <Input placeholder="组织名称" value={this.state.editName}
- onChange={(e) => { this.setState({ editName: e.target.value }) }} />
- </FormItem>
- </div>
- <div className="clearfix">
- <FormItem
- labelCol={{ span: 7 }}
- wrapperCol={{ span: 12 }}
- label="负责人"
- >
- <AutoComplete
- className="certain-category-search"
- dropdownClassName="certain-category-search-dropdown"
- dropdownMatchSelectWidth={false}
- dataSource={options}
- placeholder="输入名称"
- value={this.state.managerIdOrganization}
- onChange={this.httpChange}
- filterOption={true}
- onBlur={this.blurChange}
- onSelect={this.selectAuto}
- style={{ width: '95%' }}
- >
- <Input />
- </AutoComplete>
- {/* <span className="mandatory" style={{color:'red',marginLeft:'5px'}}>*</span> */}
- </FormItem>
- </div>
- <div className="clearfix">
- <FormItem
- labelCol={{ span: 7 }}
- wrapperCol={{ span: 12 }}
- label="组织类型"
- >
- <Select placeholder="组织类型" value={this.state.editType}
- onChange={(e) => { this.setState({ editType: e }) }}>
- {
- patternOrganization.map(function (item) {
- return <Select.Option key={item.value} >{item.key}</Select.Option>
- })
- }
- </Select>
- </FormItem>
- </div>
- <div className="clearfix">
- <FormItem
- labelCol={{ span: 7 }}
- wrapperCol={{ span: 12 }}
- label="组织状态"
- >
- <Select placeholder="组织状态" value={this.state.editStatus}
- onChange={(e) => { this.setState({ editStatus: e }) }}>
- {
- conditionOrganization.map(function (item) {
- return <Select.Option key={item.value} >{item.key}</Select.Option>
- })
- }
- </Select>
- </FormItem>
- </div>
- <div className="clearfix">
- <FormItem
- labelCol={{ span: 7 }}
- wrapperCol={{ span: 12 }}
- label="省份"
- >
- <Select
- placeholder="请选择省份"
- value={getNewDiccityArr(this.state.province)}
- onChange={e => {
- this.setState({ province: e });
- }}
- >
- {citySelect().map(function (item) {
- return (
- <Select.Option key={item.value} value={item.value}>{item.label}</Select.Option>
- );
- })}
- </Select>
- </FormItem>
- </div>
- <div className="clearfix">
- <FormItem
- labelCol={{ span: 7 }}
- wrapperCol={{ span: 12 }}
- label="上级组织"
- >
- <Select placeholder="请选择上级组织"
- value={this.state.editSuperId}
- onChange={(e) => { this.setState({ editSuperId: e }) }}
- notFoundContent="未获取到上级组织列表">
- {this.state.contactsOption}
- </Select>
- </FormItem>
- </div>
- <div className="clearfix">
- <FormItem
- labelCol={{ span: 7 }}
- wrapperCol={{ span: 12 }}
- label="缩写" >
- <Input placeholder="缩写" value={this.state.abbreviation}
- onChange={(e) => { this.setState({ abbreviation: e.target.value }) }} />
- </FormItem>
- </div>
- <div className="clearfix">
- <FormItem
- labelCol={{ span: 7 }}
- wrapperCol={{ span: 12 }}
- label="财务负责人"
- >
- <AutoComplete
- className="certain-category-search"
- dropdownClassName="certain-category-search-dropdown"
- dropdownMatchSelectWidth={false}
- dataSource={options2}
- placeholder="输入名称"
- value={this.state.financeName}
- onChange={this.httpChange2}
- filterOption={true}
- onBlur={this.blurChange}
- onSelect={this.selectAuto2}
- style={{ width: '95%' }}
- >
- <Input />
- </AutoComplete>
- {/* <span className="mandatory" style={{color:'red',marginLeft:'5px'}}>*</span> */}
- </FormItem>
- </div>
- <div className="clearfix">
- <FormItem
- labelCol={{ span: 7 }}
- wrapperCol={{ span: 12 }}
- label="选择作息时间类型"
- >
- <Select placeholder="请选择作息时间类型"
- value={this.state.workingHoursType}
- onChange={(e) => { this.setState({ workingHoursType: e }) }}
- notFoundContent="未获取到作息时间类型">
- {this.state.workTimeList.map((v, k) => (
- <Select.Option value={v.type} key={k}>{v.name}</Select.Option>
- ))}
- </Select>
- </FormItem>
- </div>
- <div className="clearfix">
- <FormItem
- labelCol={{ span: 7 }}
- wrapperCol={{ span: 12 }}
- label="组织编号"
- >
- <Input
- placeholder='组织编号'
- value={this.state.depNo}
- onChange={(e) => {
- this.setState({
- depNo: e.target.value
- })
- }}
- />
- </FormItem>
- </div>
- <div className="clearfix" >
- <FormItem
- labelCol={{ span: 7 }}
- wrapperCol={{ span: 12 }}
- label="创建人"
- >
- <span>{this.state.editCreateId}</span>
- </FormItem>
- </div>
- <div className="clearfix">
- <FormItem
- labelCol={{ span: 7 }}
- wrapperCol={{ span: 12 }}
- label="创建时间"
- >
- <span>{this.state.editTime}</span>
- </FormItem>
- </div>
- <div className="clearfix">
- <FormItem
- labelCol={{ span: 7 }}
- wrapperCol={{ span: 12 }}
- label="组织职能说明" >
- <Input type="textarea" rows={4} placeholder="组织职能说明" value={this.state.editRemarks}
- onChange={(e) => { this.setState({ editRemarks: e.target.value }) }} />
- </FormItem>
- </div>
- <div className="clearfix">
- <FormItem
- labelCol={{ span: 7 }}
- wrapperCol={{ span: 12 }}
- label="显示标识"
- >
- <Select placeholder="显示标识"
- value={this.state.hideSign}
- onChange={(e) => { this.setState({ hideSign: e }) }}
- style={{ width: '95%' }}
- required="required"
- >
- <Option value={0}>不显示</Option>
- <Option value={1}>显示</Option>
- </Select>
- </FormItem>
- </div>
- <FormItem wrapperCol={{ span: 12, offset: 7 }}>
- <Button className="set-submit" type="primary" htmlType="submit">保存</Button>
- <Button className="set-submit" type="ghost" onClick={this.edithandleCancel} style={{ marginLeft: '100px' }}>取消</Button>
- </FormItem>
- </Spin>
- </Form >
- </Modal>
- </div>
- </div>
- </div>
- );
- }
- }));
- export default Organization;
|