dengzhiguo 7 years ago
parent
commit
bb1bb9900c

+ 99 - 1
js/component/dataDic.js

@@ -1255,6 +1255,17 @@ module.exports = {
             key: "邮件"
         },
     ],
+    
+    //品类状态
+        categoryState:[
+        {
+            value: "0",
+            key: "正常"
+        }, {
+            value: "1",
+            key: "停用"
+        }
+    ],
     //行业
     industry:[
         {
@@ -1341,5 +1352,92 @@ module.exports = {
             key: "传媒"
         }
         
-    ],   
+    ],  
+    //岗位
+    station:[
+        {
+            value: "0",
+            key: "咨询师"
+        }, {
+            value: "1",
+            key: "营销"
+        },
+        {
+            value: "2",
+            key: "外联"
+        },
+        {
+            value: "3",
+            key: "财务"
+        }, {
+            value: "4",
+            key: "助理"
+        },
+        {
+            value: "5",
+            key: "管理"
+        },
+        {
+            value: "6",
+            key: "工程师"
+        }, {
+            value: "7",
+            key: "人事"
+        },{
+            value: "8",
+            key: "行政"
+        }, {
+            value: "9",
+            key: "内勤"
+        },
+    ],
+    //职务
+    post:[
+        {
+            value: "0",
+            key: "董事长"
+        }, {
+            value: "1",
+            key: "总经理"
+        },
+        {
+            value: "2",
+            key: "副总经理"
+        },
+        {
+            value: "3",
+            key: "部门经理"
+        }, {
+            value: "4",
+            key: "经理"
+        },
+        {
+            value: "5",
+            key: "主管"
+        },
+        {
+            value: "6",
+            key: "员工"
+        }
+    ],
+    //组织类型
+    patternOrganization:[
+        {
+            value: "0",
+            key: "公司"
+        }, {
+            value: "1",
+            key: "部门"
+        }
+    ],
+    //组织状态
+    conditionOrganization:[
+        {
+            value: "0",
+            key: "正常"
+        }, {
+            value: "1",
+            key: "解散"
+        }
+    ],
 };

+ 439 - 6
js/component/manageCenter/set/business/businessCategory.jsx

@@ -2,14 +2,447 @@ import React from 'react';
 import ReactDom from 'react-dom';
 import ajax from 'jquery/src/ajax/xhr.js';
 import $ from 'jquery/src/ajax';
-import {Form} from 'antd';
+import moment from 'moment';
+import { Form,Radio, Icon, Button, Input, Select, Spin, Table, Switch, message, DatePicker, Modal, Upload,Popconfirm,TimePicker } from 'antd';
+import {categoryState} from '../../../dataDic.js';
 
 const BusinessCategory=Form.create()(React.createClass({
-	render(){
-		return (
-			<div>业务品类管理</div>
-		)
-	}
+	loadData(pageNo, apiUrl) {
+        this.state.data = [];
+        this.setState({
+            loading: true
+        });
+        $.ajax({
+            method: "get",
+            dataType: "json",
+            crossDomain: false,
+            url: globalConfig.context + (apiUrl || this.props['data-listApiUrl']),
+            data: {
+                pageNo: pageNo || 1,
+                pageSize: this.state.pagination.pageSize,
+            },
+            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,
+                            serialNumber: thisdata.serialNumber,
+                        });
+                    };
+                    this.state.pagination.current = data.data.pageNo;
+                    this.state.pagination.total = data.data.totalCount;
+                };
+                this.setState({
+                    dataSource: theArr,
+                    pagination: this.state.pagination
+                });
+            }.bind(this),
+        }).always(function () {
+            this.setState({
+                loading: false
+            });
+        }.bind(this));
+    },
+    getInitialState() {
+        return {
+            searchMore: true,
+            selectedRowKeys: [],
+            selectedRows: [],
+            loading: false,
+            pagination: {
+                defaultCurrent: 1,
+                defaultPageSize: 10,
+                showQuickJumper: true,
+                pageSize: 10,
+                onChange: function (page) {
+                    this.loadData(page);
+                }.bind(this),
+                showTotal: function (total) {
+                    return '共' + total + '条数据';
+                }
+            },
+            columns: [
+                {
+                    title: '品类编号',
+                    dataIndex: 'serialNumber',
+                    key: 'serialNumber',
+                }, {
+                    title: '品类名称',
+                    dataIndex: 'name',
+                    key: 'name',
+                },  {
+                    title: '品类层级',
+                    dataIndex: 'category',
+                    key: 'category',
+                    render: text => { return getAchievementCategory(text); }
+                }, {
+                    title: '上级品类',
+                    dataIndex: 'keyword',
+                    key: 'keyword',
+                },{
+                    title: '品类状态',
+                    dataIndex: 'auditStatus',
+                    key: 'auditStatus',
+                    render: text => { return getTechAuditStatus(text) }
+                }
+            ],
+            dataSource: [],
+        };
+    },
+    componentWillMount() {
+       
+        this.loadData();
+    },
+    
+    tableRowClick(record, index) {
+        this.state.RowData = record;
+        this.setState({
+            showDesc: true
+        });
+    },
+    delectRow() {
+        let deletedIds = [];
+        for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
+            let rowItem = this.state.selectedRows[idx];
+            if (rowItem.id) {
+                deletedIds.push(rowItem.id)
+            };
+        };
+        this.setState({
+            selectedRowKeys: [],
+            loading: deletedIds.length > 0
+        });
+        $.ajax({
+            method: "POST",
+            dataType: "json",
+            crossDomain: false,
+            url: globalConfig.context + "/api/admin/achievement/delete",
+            data: {
+                ids: deletedIds
+            }
+        }).done(function (data) {
+            if (!data.error.length) {
+                message.success('删除成功!');
+                this.setState({
+                    loading: false,
+                });
+            } else {
+                message.warning(data.error[0].message);
+            };
+            this.loadData();
+        }.bind(this));
+    },
+    addClick() {
+        this.state.RowData = {};
+        this.setState({
+            visible: true
+        });
+    },
+    editClick() {
+        this.state.RowData = {};
+        this.setState({
+            editvisible: true
+        });
+    },
+   	handleCancel() {
+        this.setState({ visible: false })
+    },
+    edithandleCancel() {
+        this.setState({ editvisible: false })
+    },
+    search() {
+        this.loadData();
+    },
+    reset() {
+        this.state.serialNumber = undefined;
+        this.state.name = undefined;
+        this.state.keyword = undefined;
+        this.state.category = undefined;
+        this.state.ownerType = undefined;
+        this.state.releaseStatus = undefined;
+        this.state.auditStatus = undefined;
+        this.state.searchName = undefined;
+        this.state.releaseDate = [];
+        this.state.boutique = '';
+        this.state.hot='' ;
+        this.loadData();       
+    },
+    searchSwitch() {
+        this.setState({
+            searchMore: !this.state.searchMore
+        });
+    },
+    render() {
+    	const FormItem = Form.Item
+        const rowSelection = {
+            selectedRowKeys: this.state.selectedRowKeys,
+            onChange: (selectedRowKeys, selectedRows) => {
+                this.setState({
+                    selectedRows: selectedRows.slice(-1),
+                    selectedRowKeys: selectedRowKeys.slice(-1)
+                });
+            }
+        };
+         const formItemLayout = {
+            labelCol: { span: 8 },
+            wrapperCol: { span: 14 },
+       };
+       	const { getFieldDecorator } = this.props.form;
+        const hasSelected = this.state.selectedRowKeys.length > 0;
+        const { RangePicker } = DatePicker;
+        
+        return (
+            <div className="user-content" >
+                <div className="content-title">
+	                <div className="user-search">
+	                    <Input placeholder="业务品类名称" style={{width:'150px',marginRight:'10px',marginBottom:'10px'}}
+	                        value={this.state.serialNumber}
+	                        onChange={(e) => { this.setState({ serialNumber: e.target.value }); }} />
+	                    <Input placeholder="上级业务品类" style={{width:'150px',marginRight:'10px',marginBottom:'10px'}}
+	                        value={this.state.serialNumber}
+	                        onChange={(e) => { this.setState({ serialNumber: e.target.value }); }} />
+	                    
+	                    <Button type="primary" onClick={this.search} style={{marginRight:'10px'}}>搜索</Button>
+	                    <Button onClick={this.reset} style={{marginRight:'10px'}}>重置</Button>
+	                    <Button style={{ background: "#3fcf9e", border: "none", color: "#fff" }}
+                       		    disabled={!hasSelected}
+                        		onClick={this.delectRow}>删除<Icon type="minus" />
+                        </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>
+						<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 className="search-more" style={this.state.searchMore ? { display: 'none' } : {display: 'inline-block'}}>
+	                    	<Select placeholder="品类层级"
+	                            style={{ width:'150px',marginRight:'10px' }}
+	                            value={this.state.shareTypeSearch}
+	                            onChange={(e) => { this.setState({ shareTypeSearch: e }) }}>
+	                            <Select.Option value="0" >一级</Select.Option>
+	                            <Select.Option value="1" >二级</Select.Option>
+	                            <Select.Option value="2" >三级</Select.Option>
+	                            <Select.Option value="3" >四级</Select.Option>
+	                            <Select.Option value="4" >五级</Select.Option>
+	                            <Select.Option value="5" >六级</Select.Option>
+		                	</Select>
+		                    <Select placeholder="品类状态"
+		                            style={{width:'150px',marginRight:'50px'}}
+		                            value={this.state.shareTypeSearch}
+		                            onChange={(e) => { this.setState({ shareTypeSearch: e }) }}>
+		                            <Select.Option value="0" >正常</Select.Option>
+		                            <Select.Option value="1" >停用</Select.Option>
+		                    </Select>
+	                    </div>
+	                    <Button type="primary" className="addButton" onClick={this.addClick} style={{float:'right',marginRight:'200px'}}>新增客户<Icon type="plus" /></Button>
+	                	<Button type="primary" className="addButton" onClick={this.editClick}>编辑客户<Icon type="plus" /></Button>
+	                </div>
+	                <div className="patent-table">
+	                    <Spin spinning={this.state.loading}>
+	                        <Table columns={this.state.columns}
+	                            dataSource={this.state.dataSource}
+	                            rowSelection={rowSelection}
+	                            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='400px'
+	                        title='新增品类'                       
+	                        footer=''
+	                        className="admin-desc-content">
+	                         <Form horizontal onSubmit={this.handleSubmit} id="demand-form">
+				                <Spin spinning={this.state.loading}>
+				                    <div className="clearfix">
+				                    	<FormItem className="half-item"
+					                            labelCol={{ span: 7 }}
+					                        	wrapperCol={{ span: 12 }}
+					                            label="品类名称" >
+				                    	     {getFieldDecorator('name', {
+				                                rules: [{ required: true, message: '此项为必填项!' }],
+				                                initialValue: this.state.name
+				                            })(
+				                                <Input placeholder="品类名称" />
+				                                )}
+					                    </FormItem>
+				                    </div>
+				                    <div className="clearfix">
+				                    	<FormItem className="half-item"
+					                            labelCol={{ span: 7 }}
+					                        	wrapperCol={{ span: 12}}
+					                            label="上级品类" >
+					                            {getFieldDecorator('content', {
+//					                                rules: [{ required: true, message: '此项为必填项!' }],
+					                                initialValue: this.state.content
+				                                })(
+				                                    <Input placeholder="上级品类" />
+				                                )}     
+					                    </FormItem>
+				                    </div>
+				                    <div className="clearfix">
+					                    <FormItem  
+					                    	labelCol={{ span: 7 }}
+					                        wrapperCol={{ span: 12 }}
+				                           label="上级品类"
+			                               > 
+			                               {getFieldDecorator('societyTagt', {
+					                                rules: [{ required: true, message: '此项为必填项!' }],
+					                                initialValue: this.state.societyTagt
+				                                })(
+						                        <Select placeholder="上级品类"  
+								                        value={this.state.lastName}
+								                        onChange={this.hundleName}>
+								                        {this.state.orderStatusOption}
+						                    	</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.handleCancel} style={{marginLeft:'50px'}}>取消</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.handleSubmit} id="demand-form">
+				                <Spin spinning={this.state.loading}>
+				                    <div className="clearfix">
+				                    	<FormItem className="half-item"
+					                            labelCol={{ span: 7 }}
+					                        	wrapperCol={{ span: 12 }}
+					                            label="品类名称" >
+				                    	     {getFieldDecorator('name', {
+				                                rules: [{ required: true, message: '此项为必填项!' }],
+				                                initialValue: this.state.name
+				                            })(
+				                                <Input placeholder="品类名称" />
+				                                )}
+					                    </FormItem>
+				                    </div> 
+				                    <div className="clearfix">
+				                    	<FormItem className="half-item" 
+				                         	labelCol={{ span: 7 }}
+					                        wrapperCol={{ span: 12 }}
+				                           	label="品类状态"
+				                         > 
+				                         {getFieldDecorator('societyTagt', {
+					                                rules: [{ required: true, message: '此项为必填项!' }],
+					                                initialValue: this.state.societyTagt
+				                                })(
+											  <Select placeholder="品类状态"> 
+				                                {
+				                                    categoryState.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="上级品类"
+			                               > 
+			                               {getFieldDecorator('societyTagt', {
+					                                rules: [{ required: true, message: '此项为必填项!' }],
+					                                initialValue: this.state.societyTagt
+				                                })(
+						                        <Select placeholder="上级品类"  
+								                        value={this.state.lastName}
+								                        onChange={this.hundleName}>
+								                        {this.state.orderStatusOption}
+						                    	</Select>
+					                    	 )}
+			                   		    </FormItem>
+		                   		    </div>
+		                   		    <div className="clearfix">
+				                    	<FormItem className="half-item"
+						                    labelCol={{ span: 7 }}
+						                    wrapperCol={{ span: 12 }}
+						                    label="品类层级"
+					                        >
+					                        <span>{}</span>
+					                    </FormItem>
+					                </div>
+		                   		    <div className="clearfix">
+				                    	<FormItem className="half-item"
+						                    labelCol={{ span: 7 }}
+						                    wrapperCol={{ span: 12 }}
+						                    label="品类编号"
+					                        >
+					                        <span>{}</span>
+					                    </FormItem>
+					                </div>
+					                <div className="clearfix" >
+				                    	<FormItem className="half-item"
+						                    labelCol={{ span: 7 }}
+						                    wrapperCol={{ span: 12 }}
+						                    label="创建人"
+					                        >
+					                        <span>{}</span>
+					                    </FormItem>
+					                </div>
+					                <div className="clearfix">
+				                    	<FormItem className="half-item"
+						                    labelCol={{ span: 7 }}
+						                    wrapperCol={{ span: 12 }}
+						                    label="创建时间"
+					                        >
+					                        <span>{}</span>
+					                    </FormItem>
+					                </div>
+		                   		    <div className="clearfix">
+			                   		   <FormItem className="half-item"
+				                            labelCol={{ span: 7 }}
+					                    	wrapperCol={{ span: 12 }}
+				                            label="更新时间" >	
+			                               <DatePicker placeholder="更新日期" value={moment(this.state.createYear,'YYYY-MM-DD')} onChange={(time) => {this.setState({createYear: time});}}/>					                               			                               		                           
+					                       <TimePicker placeholder="更新时间" value={moment(this.state.creatMent, 'HH:mm:ss')} onChange={(time) => { this.setState({creatMent: time}); }}/>	
+			            				</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 BusinessCategory;

+ 17 - 9
js/component/manageCenter/set/content.jsx

@@ -22,30 +22,38 @@ class Content extends Component {
         switch (key) {          	
             case 'user':
                 require.ensure([], () => {
-                    const User = require('./userManagement/user').default;
+                    const Member = require('./userManagement/member').default;
                     this.setState({
-                        component: <User />                      
+                        component: <Member />                      
                     });
                 });
                 break;           
            
-            case 'role':
+            case 'permission':
                 require.ensure([], () => {
-	                const Role = require('./userManagement/role').default;
+	                const Permission = require('./userManagement/permission').default;
 	                this.setState({
-	                    component:<Role />,	                    	                  
+	                    component:<Permission />,	                    	                  
 	                });
           	    });
           	    break;
-          	case 'jurisdiction':
+          	case 'role':
                 require.ensure([], () => {
-                    const Jurisdiction = require('./userManagement/jurisdiction').default;
+                    const Role = require('./userManagement/role').default;
                     this.setState({
-                        component: <Jurisdiction />                      
+                        component: <Role />                      
                       
                     });
                 });
-                break;          
+                break;  
+            case 'site':
+	            require.ensure([], () => {
+	                const Site = require('./userManagement/site').default;
+	                this.setState({
+	                    component: <Site />,
+	                });
+	            });
+            break;
       	    case 'organization':
             require.ensure([], () => {
                 const Organization = require('./organization/organization').default;

+ 55 - 0
js/component/manageCenter/set/content.less

@@ -0,0 +1,55 @@
+.set-content {
+    background: #fff;
+    padding: 20px;
+    .set-title {
+        >span {
+            font-size: 16px;
+            color: #333;
+        }
+        >button {
+            float: right;
+            margin-right: 20px;
+        }
+    }
+    .member-table {
+        margin-top: 20px;
+    }
+    .set-search {
+        >input {
+            width: 120px;
+        }
+        >* {
+            margin-right: 10px;
+            margin-top: 10px;
+        }
+    }
+}
+
+.ant-modal-body {
+    .modal-content {
+        >.list {
+            margin-bottom: 20px;
+            float: left;
+            width: 50%;
+            >span {
+                margin-right: 20px;
+                display: inline-block;
+                width: 60px;
+                text-align: right;
+            }
+            >input {
+                width: 200px;
+            }
+            .modal-det {
+                width: 200px;
+                text-align: left;
+            }
+        }
+    }
+    .modal-text {
+        margin-right: 20px;
+        display: inline-block;
+        width: 60px;
+        text-align: right;
+    }
+}

+ 15 - 10
js/component/manageCenter/set/leftTab.jsx

@@ -1,6 +1,8 @@
 import React from 'react';
 import { Menu, Icon } from 'antd';
 import '../leftTab.less';
+import './content.less';
+import '../content.less';
 const SubMenu = Menu.SubMenu;
 const MenuItemGroup = Menu.ItemGroup;
 
@@ -8,10 +10,10 @@ const MenuItemGroup = Menu.ItemGroup;
 const LeftTab = React.createClass({
     getInitialState() {
         return {
-            current: 'user', 
+            current: 'member', 
             subKey: 'sub1', 
             keyList: [
-                { key: 'sub1', value: ['user','role','jurisdiction'] },
+                { key: 'sub1', value: ['member','permission','role','site'] },
                 { key: 'sub2', value: ['organization'] },
                 { key: 'sub3', value: ['businessCategory', 'businessProject'] },
             ]
@@ -46,15 +48,18 @@ const LeftTab = React.createClass({
                 className="account-left"
                 mode="inline" >
 	            <SubMenu key="sub1" title={<span>用户管理</span>}>	
-	            		<Menu.Item key="user">
-		                    用户信息
-		                </Menu.Item> 
+	            		<Menu.Item key="member">
+		                    管理员列表
+		                </Menu.Item>
+		                <Menu.Item key="permission">
+		                    权限控制
+		                </Menu.Item>
 		                <Menu.Item key="role">
-		                    角色信息
-		                </Menu.Item>                              
-		                <Menu.Item key="jurisdiction">
-		                    权限信息
-		                </Menu.Item>		           
+		                    角色控制
+		                </Menu.Item>
+		                 <Menu.Item key="site" style={{display:'none'}}>
+                		    站点设置
+                		</Menu.Item>
 		        </SubMenu> 
 		        <SubMenu key="sub2" title={<span>组织机构管理</span>}>	            	
 		                <Menu.Item key="organization">

+ 749 - 6
js/component/manageCenter/set/organization/organization.jsx

@@ -2,14 +2,757 @@ import React from 'react';
 import ReactDom from 'react-dom';
 import ajax from 'jquery/src/ajax/xhr.js';
 import $ from 'jquery/src/ajax';
-import {Form} from 'antd';
+import { Form,Radio, Icon, Button, Input, Select, Spin, Table, Switch, message, DatePicker, Modal, Upload,Popconfirm,AutoComplete } from 'antd';
+import {patternOrganization,conditionOrganization} from '../../../dataDic.js';
+import {getPattern,getCondition} from '../../../tools.js';
 
 const Organization=Form.create()(React.createClass({
-	render(){
-		return (
-			<div>组织机构管理</div>
-		)
-	}
+	loadData(pageNo) {
+        this.state.data = [];
+        this.setState({
+            loading: true
+        });
+        let nameText=this.state.SuperArr;
+		let superText=(this.state.superId)?nameText[parseInt(this.state.superId)].name:"";
+       
+        $.ajax({
+            method: "post",
+            dataType: "json",
+            crossDomain: false,
+            url: globalConfig.context + '/open/api/admin/organization/listOrganizationManagement',
+            data: {
+                pageNo: pageNo || 1,
+                pageSize: this.state.pagination.pageSize,
+                name: this.state.name, //组织名称
+                superId:superText,//上级组织
+                type:this.state.type,//组织类型
+                depNo:this.state.depNo,//组织编号
+            },
+            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.managerId,//负责人
+                            superId:thisdata.superId,//上级组织
+                            status:thisdata.status,//组织状态
+                        });
+                    };
+                    this.state.pagination.current = data.data.pageNo;
+                    this.state.pagination.total = data.data.totalCount;
+                };
+                this.setState({
+                    dataSource: theArr,
+                    pagination: this.state.pagination
+                });
+            }.bind(this),
+        }).always(function () {
+            this.setState({
+                loading: false
+            });
+        }.bind(this));
+       
+    },
+    getInitialState() {
+        return {
+            searchMore: true,
+            selectedRowKeys: [],
+            selectedRows: [],
+            loading: false,
+            pagination: {
+                defaultCurrent: 1,
+                defaultPageSize: 10,
+                showQuickJumper: true,
+                pageSize: 10,
+                onChange: function (page) {
+                    this.loadData(page);
+                }.bind(this),
+                showTotal: function (total) {
+                    return '共' + total + '条数据';
+                }
+            },
+            columns: [
+                {
+                    title: '组织编号',
+                    dataIndex: '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) }
+                  
+                }
+            ],
+            dataSource: [],
+        };
+    },
+    componentWillMount() {
+    	this.selectSuperId();
+    },
+    //获取上级组织
+    selectSuperId() {  
+    	this.state.data = []
+         $.ajax({
+                method: "post",
+                dataType: "json",
+                crossDomain: false,
+                url: globalConfig.context + "/open/api/admin/organization/selectSuperId",
+                data:{
+                  
+                },
+                success: function (data) {                	  
+                		let theArr = [];
+					    let thedata=data.data;
+					    if (!thedata) {
+		                    if (data.error && data.error.length) {
+		                        message.warning(data.error[0].message);
+		                    };	
+		                    thedata = {}; 
+		              };   
+					    var contactIds=[];
+				        //for (let item in data.data) {
+				        	for(var i=0;i<data.data.length;i++){
+		                    let theData = data.data[i];
+		                    theArr.push(
+		                        <Select.Option value={i.toString()} key={theData.name}>{theData.name}</Select.Option>
+		                    );
+		                };
+						this.setState({	
+							SuperArr:thedata,
+		                    contactsOption: theArr, 
+		                    orderStatusOptions:data.data,
+	                    });
+	                    
+					}.bind(this),
+				}).always(function () {
+				this.loadData();
+	            this.setState({
+	                loading: false
+	            });
+	        }.bind(this));
+	},
+	//编辑部门,保存
+    edithandleSubmit(e){
+    	e.preventDefault();	
+    	//上级组织字典
+        let nameText=this.state.SuperArr
+        let superText=this.state.editSuperId;
+        //let superText=(this.state.editSuperId).length<=1?nameText[parseInt(this.state.editSuperId)].name:''
+    	let superOne=this.state.editDataSource[0].editSuperId;
+    	console.log(superOne);
+    	console.log(superText);
+    	if(!(superOne==superText)){
+    		let changeSuper=nameText[parseInt(this.state.editSuperId)].name;
+    		if(confirm('上级组织已修改,是否保存?')){
+	        $.ajax({
+	            method: "post",
+	            dataType: "json",
+	            crossDomain: false,
+	            url:globalConfig.context + '/open/api/admin/organization/updateOrganization',
+	            data:{
+	            	name:this.state.editName,//组织名称
+	            	type:this.state.editType, //组织类型
+	            	managerId:this.state.editManagerId,//负责人ID
+	                superId:changeSuper,//上级组织
+	                status:this.state.editStatus,//组织状态
+	                remarks:this.state.editRemarks,//组织职能说明
+	                id:this.state.editId,//组织ID
+	            }
+	        }).done(function (data) { 
+	            this.setState({
+	                loading: false
+	            });
+	            if (!data.error.length) {
+	                message.success('保存成功!'); 
+	                this.edithandleCancel();
+	                this.loadData(); 
+	            } else {
+	                message.warning(data.error[0].message);
+	            }
+	        }.bind(this));
+	        return false
+        	}
+    	}else {
+        	$.ajax({
+	            method: "post",
+	            dataType: "json",
+	            crossDomain: false,
+	            url:globalConfig.context + '/open/api/admin/organization/updateOrganization',
+	            data:{
+	            	name:this.state.editName,//组织名称
+	            	type:this.state.editType, //组织类型
+	            	managerId:this.state.editManagerId,//负责人ID
+	                superId:superText,//上级组织
+	                status:this.state.editStatus,//组织状态
+	                remarks:this.state.editRemarks,//组织职能说明
+	                id:this.state.editId,//组织ID
+	            }
+	        }).done(function (data) { 
+	            this.setState({
+	                loading: false
+	            });
+	            if (!data.error.length) {
+	                message.success('保存成功!'); 
+	                this.edithandleCancel();
+	                this.loadData(); 
+	            } 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 +"/open/api/admin/organization/selectAllById" ,
+            data: {
+               id: record.id
+            },
+            success: function (data) {
+                let theArr = [];
+                let thisdata = data;
+                if (!data) {
+                    if (data.error && data.error.length) {
+                        message.warning(data.error[0].message);
+                    };
+                } else {
+                    theArr.push({
+                         editId: thisdata.id,//每一条记录的ID
+                         editName:thisdata.name,//组织名称
+                         editManagerId:thisdata.managerId,//负责人
+                         editType:thisdata.type,//组织类型
+                         editStatus:thisdata.status,//组织状态 
+                         editSuperId:thisdata.superId,//上级组织
+                         editDepNo: thisdata.depNo,//组织编号
+                         editCreateId:thisdata.createId,//创建人
+                         editTime:thisdata.createTime,//创建时间
+                         editRemarks:thisdata.remarks,//组织职能说明
+                    });
+                   
+                };
+                this.setState({
+                	 editId: thisdata.id,//每一条记录的ID
+                	 editName:thisdata.name,//组织名称
+                     editManagerId:thisdata.managerId,//负责人
+                     editType:thisdata.type,//组织类型
+                     editStatus:thisdata.status,//组织状态 
+                     editSuperId:thisdata.superId,//上级组织
+                     editDepNo: thisdata.depNo,//组织编号
+                     editCreateId:thisdata.createId,//创建人
+                     editTime:thisdata.createTime,//创建时间
+                     editRemarks: thisdata.remarks,//组织职能说明
+                     editDataSource: theArr,
+                });
+            }.bind(this),
+        }).always(function () {
+            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 + "/open/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.loadData();
+        }.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;
+    	}
+		this.props.form.validateFields((err, values) => {                                 
+            if (!err) {
+                this.setState({
+                    loading: true
+                }); 
+                //上级组织字典
+                let nameText=this.state.SuperArr
+                let superText=nameText[parseInt(this.state.upOrganization)].name
+                $.ajax({
+                    method: "post",
+                    dataType: "json",
+                    crossDomain: false,
+                    url:globalConfig.context + '/open/api/admin/organization/addOrganization',
+                    data:{
+                    	name:this.state.nameOrganization,//组织名称
+                    	managerId:this.state.theTypes,//负责人ID
+                        type:this.state.typeOrganization, //组织类型
+                        superId:superText,//上级组织
+                        remarks:this.state.remarksOrganization,//组织职能说明
+                    	}
+                }).done(function (data) { 
+                    this.setState({
+                        loading: false
+                    });
+                    if (!data.error.length) {
+                        message.success('保存成功!'); 
+                        this.handleCancel();
+                        this.loadData(); 
+                    } else {
+                        message.warning(data.error[0].message);
+                    }
+                }.bind(this));
+            }
+        });
+    },
+    
+    //主管初始加载(自动补全)
+	supervisor(e){ 
+		$.ajax({
+            method: "post",
+            dataType: "json",
+            crossDomain: false,
+            url: globalConfig.context + "/open/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
+		})
+	},
+	//失去焦点时
+	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:e
+		})
+	},
+	//值改变时请求客户名称
+	httpChange(e){
+		if(e.length>=2){
+			this.supervisor(e); 
+		}	
+		this.setState({
+			managerIdOrganization:e
+		})
+	},
+    addClick() {
+    	this.state.nameOrganization='';//组织名称清零
+    	this.state.managerIdOrganization= '';//负责人ID清零
+        this.state.typeOrganization= undefined; //组织类型清零
+        this.state.upOrganization= undefined;//上级组织清零
+        this.state.remarksOrganization= '';//组织职能说明清零
+        this.state.RowData = {};
+        this.setState({
+            visible: true
+        });
+        this.selectSuperId();
+        
+    },
+    editClick() {
+        this.state.RowData = {};
+        this.setState({
+            editvisible: true
+        });
+    },
+   	handleCancel() {
+        this.setState({ visible: false })
+    },
+    edithandleCancel() {
+        this.setState({ editvisible: false })
+    },
+    search() {
+        this.loadData();
+    },
+    //把搜索的部分置零
+    reset() {
+        this.state.superId = undefined;//上级组织清零
+        this.state.name = '';//组织名称清零
+        this.state.type = undefined;//组织类型清零
+        this.state.depNo = '';//组织编号清零
+        this.loadData();       
+    },
+    searchSwitch() {
+        this.setState({
+            searchMore: !this.state.searchMore
+        });
+    },
+    render() {
+    	const FormItem = Form.Item
+        const rowSelection = {
+            selectedRowKeys: this.state.selectedRowKeys,
+            onChange: (selectedRowKeys, selectedRows) => {
+                this.setState({
+                    selectedRows: selectedRows.slice(-1),
+                    selectedRowKeys: selectedRowKeys.slice(-1)
+                });
+            }
+        };
+        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>
+				     )
+        return (
+            <div className="user-content" >
+                <div className="content-title">
+	                <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.depNo}
+		                        onChange={(e) => { this.setState({ depNo: 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>
+	                    </div>
+	                    <Button type="primary" className="addButton" onClick={this.addClick} style={{float:'right',marginRight:'200px'}}>新增组织<Icon type="plus" /></Button>
+	                </div>
+	                <div className="patent-table">
+	                    <Spin spinning={this.state.loading}>
+	                        <Table columns={this.state.columns}
+	                            dataSource={this.state.dataSource}
+	                            rowSelection={rowSelection}
+	                            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="组织职能说明" >					                        
+					                        <Input type="textarea" rows={4} placeholder="组织职能说明" value={this.state.remarksOrganization}
+	                           				 	onChange={(e) => { this.setState({ remarksOrganization: e.target.value }) }} style={{width:'95%'}}/>					                           
+					                    </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="负责人" >
+					                             <Input placeholder="负责人" value={this.state.editManagerId} 
+				                                onChange={(e)=>{this.setState({editManagerId:e.target.value})}}/>
+					                    </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={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="组织编号"
+					                        >
+					                        <span>{this.state.editDepNo}</span>
+					                    </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>    
+				                    <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;

+ 0 - 15
js/component/manageCenter/set/userManagement/jurisdiction.jsx

@@ -1,15 +0,0 @@
-import React from 'react';
-import ReactDom from 'react-dom';
-import ajax from 'jquery/src/ajax/xhr.js';
-import $ from 'jquery/src/ajax';
-import {Form} from 'antd';
-
-const Jurisdiction=Form.create()(React.createClass({
-	render(){
-		return (
-			<div>权限管理</div>
-		)
-	}
-}));
-
-export default Jurisdiction;

+ 252 - 0
js/component/manageCenter/set/userManagement/member.jsx

@@ -0,0 +1,252 @@
+import React from 'react';
+import { Table, Button, Spin, message, Icon, Select, Input } from 'antd';
+import { provinceSelect, provinceList, getProvince } from '../../../NewDicProvinceList.js';
+import { companySearch } from '../../../tools';
+import ajax from 'jquery/src/ajax/xhr.js';
+import $ from 'jquery/src/ajax';
+import TheModal from './modal.jsx';
+
+const Member = React.createClass({
+    loadData(pageNo) {
+        this.setState({
+            loading: true
+        });
+        $.ajax({
+            type: 'get',
+            cache: false,
+            url: globalConfig.context + "/api/admin/supervise/adminList",
+            dataType: "json",
+            data: {
+                pageNo: pageNo || 1,
+                pageSize: this.state.pagination.pageSize,
+                province: this.state.searchProvince,
+                mobile: this.state.searchMobile,
+                name: this.state.searchName
+            },
+            success: function (data) {
+                let theArr = [];
+                if (!data.data) {
+                    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];
+                        this.state.onlyProvince = thisdata.province;
+                        theArr.push({
+                            key: i,
+                            id: thisdata.id,
+                            mobile: thisdata.mobile,
+                            name: thisdata.name,
+                            email: thisdata.email,
+                            createTime: thisdata.createTime,
+                            number: thisdata.number,
+                            province: thisdata.province,
+                            position: thisdata.position,
+                            superior: thisdata.superior,
+                            superiorId: thisdata.superiorId,
+                            createTimeFormattedDate: thisdata.createTimeFormattedDate
+                        });
+                    };
+                    this.state.pagination.current = data.data.pageNo;
+                    this.state.pagination.total = data.data.totalCount;
+                };
+                this.setState({
+                    data: theArr,
+                    pagination: this.state.pagination
+                });
+            }.bind(this),
+        }).always(function () {
+            this.setState({
+                loading: false
+            });
+        }.bind(this));
+    },
+    loadInitialData() {
+        this.setState({
+            loading: true
+        });
+        $.ajax({
+            url: globalConfig.context + '/api/roles',
+            cache: false
+        }).done((rolesres) => {
+            let theAdminRole = [], rolesObj = {};
+            if (rolesres.data && window.adminData) {
+                rolesres.data.map((item) => {
+                    theAdminRole.push(item.id);
+                    rolesObj[item.id] = item.roleName;
+                })
+            }
+            this.setState({
+                roles: rolesres.data,
+                theAdminRole: theAdminRole,
+                rolesObj:rolesObj,
+                loading: false
+            });
+        })
+    },
+    loadBindRoles(uid) {
+        this.setState({
+            loading: true
+        });
+        $.ajax({
+            url: globalConfig.context + '/api/admin/role',
+            cache: false,
+            data: {
+                "uid": window.adminData.uid
+            }
+        }).done((data) => {
+            this.setState({
+                currentRoles: data.data || [],
+                loading: false
+            });
+        })
+    },
+    getInitialState() {
+        return {
+            data: [],
+            roles: [],
+            currentRoles:[],
+            rolesObj: {},
+            theAdminRole: [],
+            provinceList: [],
+            dataSource: [],
+            selectedRowKeys: [],
+            selectedRows: [],
+            loading: false,
+            modalData: {},
+            modalShow: false,
+            pagination: {
+                defaultCurrent: 1,
+                defaultPageSize: 10,
+                showQuickJumper: true,
+                pageSize: 10,
+                onChange: function (page) {
+                    this.loadData(page);
+                }.bind(this),
+                showTotal: function (total) {
+                    return '共' + total + '条数据';
+                }
+            },
+            columns: [
+                {
+                    title: '编号',
+                    dataIndex: 'number',
+                    key: 'number'
+                }, {
+                    title: '登录账号',
+                    dataIndex: 'mobile',
+                    key: 'mobile'
+                }, {
+                    title: '名字',
+                    dataIndex: 'name',
+                    key: 'name'
+                }, {
+                    title: '职位',
+                    dataIndex: 'position',
+                    key: 'position'
+                }, {
+                    title: '上级管理员',
+                    dataIndex: 'superior',
+                    key: 'superior'
+                }, {
+                    title: '省份',
+                    dataIndex: 'province',
+                    key: 'province',
+                    render: text => {
+                        return text ? text.split(',').map((item) => {
+                            return getProvince(item) + ' '
+                        }) : []
+                    }
+                }, {
+                    title: '邮箱',
+                    dataIndex: 'email',
+                    key: 'email'
+                }, {
+                    title: '创建时间',
+                    dataIndex: 'createTimeFormattedDate',
+                    key: 'createTimeFormattedDate'
+                }
+            ]
+        }
+    },
+    componentWillMount() {
+        this.state.provinceList = provinceSelect();
+        this.loadData();
+        this.loadInitialData();
+        this.loadBindRoles();
+    },
+    addNew() {
+        let e = {}
+        this.setState({
+            modalData: e,
+            modalShow: true
+        })
+    },
+    edit(e) {
+        this.setState({
+            modalData: e,
+            modalShow: true
+        })
+    },
+    reset() {
+        this.state.searchMobile = undefined;
+        this.state.searchName = undefined;
+        this.state.searchProvince = undefined;
+        this.loadData();
+    },
+    handleReturn(show, render) {
+        this.state.modalShow = show;
+        if (render) {
+            this.loadData();
+        }
+    },
+    render() {
+        return (
+            <Spin spinning={this.state.loading}>
+                <div className="set-content">
+                    <div className="set-title">
+                        <span>管理员设置</span>
+                        <Button style={{ background: "#ea0862", border: "none", color: "#fff" }}
+                            onClick={this.addNew}>添加<Icon type="plus" /></Button>
+                    </div>
+                    <div className="set-search">
+                        <Input placeholder="登录号"
+                            value={this.state.searchMobile}
+                            onChange={(e) => { this.setState({ searchMobile: e.target.value }); }} />
+                        <Input placeholder="管理员名字"
+                            value={this.state.searchName}
+                            onChange={(e) => { this.setState({ searchName: e.target.value }); }} />
+                        <Select style={{ width: 120 }}
+                            placeholder="选择一个省份"
+                            showSearch
+                            filterOption={companySearch}
+                            value={this.state.searchProvince}
+                            onChange={(e) => { this.setState({ searchProvince: e }) }} >
+                            {this.state.provinceList.map((item) => {
+                                return <Select.Option key={String(item.value)}>{item.label}</Select.Option>
+                            })}
+                        </Select>
+                        <Button type="primary" onClick={() => { this.loadData() }}>搜索</Button>
+                        <Button onClick={this.reset}>重置</Button>
+                    </div>
+                    <TheModal
+                        theAdminRole={this.state.theAdminRole}
+                        currentRoles={this.state.currentRoles}
+                        roles={this.state.roles}
+                        rolesObj={this.state.rolesObj}
+                        data={this.state.modalData}
+                        onlyProvince={this.state.onlyProvince}
+                        show={this.state.modalShow}
+                        handleReturn={this.handleReturn} />
+                    <Table className='member-table'
+                        columns={this.state.columns}
+                        onRowClick={this.edit}
+                        dataSource={this.state.data}
+                        pagination={this.state.pagination} />
+                </div>
+            </Spin>
+        );
+    }
+});
+export default Member;

+ 533 - 0
js/component/manageCenter/set/userManagement/modal.jsx

@@ -0,0 +1,533 @@
+import React from 'react';
+import { Tag, Modal, Input, Spin, Switch, Select, message, Popconfirm, Button, Cascader, Icon } from 'antd';
+import { provinceSelect, provinceList, getProvince } from '../../../NewDicProvinceList.js';
+import { companySearch } from '../../../tools.js';
+import ajax from 'jquery/src/ajax/xhr.js';
+import $ from 'jquery/src/ajax';
+
+const ProvinceAdd = React.createClass({
+    getInitialState() {
+        return {
+            cityOption: [],
+            theProvince: [],
+            citys: []
+        };
+    },
+    componentWillMount() {
+        let theArr = [];
+        this.state.theProvince = [this.props.locations[this.props.index].province];
+        this.state.citys = this.props.locations[this.props.index].city || [];
+        this.props.provinceList.map((item) => {
+            if (item.id == this.props.locations[this.props.index].province) {
+                item.cityList.map((city) => {
+                    theArr.push({
+                        value: city.id,
+                        label: city.name
+                    })
+                });
+            };
+        });
+        this.state.cityOption = theArr;
+    },
+    componentWillReceiveProps(nextProps) {
+        let theArr = [];
+        this.state.theProvince = [nextProps.locations[nextProps.index].province];
+        this.state.citys = nextProps.locations[nextProps.index].city || [];
+        this.props.provinceList.map((item) => {
+            if (item.id == nextProps.locations[nextProps.index].province) {
+                item.cityList.map((city) => {
+                    theArr.push({
+                        value: city.id,
+                        label: city.name
+                    })
+                });
+            };
+        });
+        this.state.cityOption = theArr;
+    },
+    render() {
+        return (
+            <div style={{ display: 'inline-block', marginRight: '20px', marginBottom: '10px' }}>
+                <Cascader placeholder="选择省份"
+                    style={{ width: 80, marginRight: '20px', verticalAlign: 'middle' }}
+                    options={this.props.provinceOption}
+                    value={this.state.theProvince}
+                    showSearch
+                    filterOption={companySearch}
+                    onChange={(e) => {
+                        let bool = true, theArr = [], _me = this;;
+                        this.props.locations.map((item, i) => {
+                            if (item.province == e[0] && this.props.index != i) {
+                                bool = false;
+                            };
+                        });
+                        if (!bool) {
+                            message.warning('请选择一个其他省份');
+                            this.setState({
+                                theProvince: undefined,
+                                citys: undefined,
+                                cityOption: []
+                            });
+                            return;
+                        };
+                        this.props.provinceList.map((item) => {
+                            if (item.id == e) {
+                                item.cityList.map((city) => {
+                                    theArr.push({
+                                        value: city.id,
+                                        label: city.name
+                                    })
+                                });
+                            };
+                        });
+                        this.props.getLocations(this.props.index, e[0])
+                        this.setState({
+                            theProvince: e,
+                            citys: undefined,
+                            cityOption: theArr,
+                        })
+                    }} />
+                <Select style={{ verticalAlign: 'middle', width: 584 }}
+                    placeholder="选择城市" notFoundContent="请先选择一个省份" multiple={true}
+                    showSearch
+                    filterOption={companySearch}
+                    value={this.state.citys}
+                    onChange={(e) => { this.setState({ citys: e }) }}
+                    onBlur={() => {
+                        this.props.getLocations(this.props.index, this.state.theProvince ? this.state.theProvince[0] : null, this.state.citys)
+                    }}>
+                    {this.state.cityOption.map((item) => {
+                        return <Select.Option key={String(item.value)}>{item.label}</Select.Option>
+                    })}
+                </Select>
+                <Button style={{ verticalAlign: 'middle', marginLeft: '20px' }} type="dashed" size="small"
+                    onClick={() => { this.props.delLocations(this.props.index) }}>
+                    <Icon type="minus" />
+                </Button>
+            </div>
+        );
+    },
+})
+
+const TheModal = React.createClass({
+    postData() {
+        this.setState({
+            loading: true
+        });
+        let theArr = [];
+        let theLocations = this.state.locations.concat();
+        theLocations.map((item, i) => {
+            if (item.province) {
+                theArr.push(item);
+            };
+        });
+        theArr.map((item) => {
+            if (item.city && item.city.length) {
+                item.city = item.city.join(',');
+            } else {
+                item.city = null;
+            };
+        });
+        $.ajax({
+            type: "POST",
+            url: this.state.id ? globalConfig.context + "/api/admin/supervise/updateAdmin" : globalConfig.context + "/api/admin/supervise/insertAdmin",
+            data: {
+                data: JSON.stringify({
+                    'id': this.state.id,
+                    'name': this.state.name,
+                    'email': this.state.email,
+                    'mobile': this.state.mobile,
+                    'position': this.state.position,
+                    'locations': theArr,
+                    'superiorId': this.state.superiorId
+                }),
+                'roles': this.state.bindroles
+            }
+        }).done((res) => {
+            if (res.error.length) {
+                message.error(res.error[0].message);
+            } else {
+                message.success("保存成功");
+                this.setState({
+                    visible: false,
+                });
+                this.props.handleReturn(false, true);
+                //第二个参数表示保存
+            }
+        }).always(() => {
+            this.setState({
+                loading: false
+            })
+        })
+        this.props.postData;
+    },
+    getInitialState() {
+        return {
+            name: '',
+            email: '',
+            mobile: '',
+            roles: [],
+            visible: false,
+            loading: false,
+            theSwitch: true,
+            bindroles: [],
+            locations: [],
+            cityOption: [],
+            locationsObj: {},
+            adminSelectObj: {}
+        }
+    },
+    handleCancel() {
+        this.setState({
+            visible: false,
+            locations:[]
+        });
+        this.props.handleReturn(false, false);
+    },
+    loadAdminSelectList() {
+        this.setState({
+            loading: true
+        });
+        $.ajax({
+            url: globalConfig.context + '/api/admin/supervise/adminSelectList',
+            cache: false
+        }).done((data) => {
+            if (!data.data) {
+                if (data.error && data.error.length) {
+                    message.warning(data.error[0].message);
+                    return;
+                };
+            };
+            let theArr = [], i;
+            for (i in data.data) {
+                theArr.push(
+                    <Select.Option key={i}>{data.data[i]}</Select.Option>
+                )
+            };
+            this.setState({
+                adminSelectOption: theArr,
+                adminSelectObj: data.data,
+                loading: false
+            });
+        })
+    },
+    loadAdminOwnLocation() {
+        this.setState({
+            loading: true
+        });
+        $.ajax({
+            url: globalConfig.context + '/api/admin/supervise/adminOwnLocation',
+            cache: false
+        }).done((data) => {
+            if (!data.data) {
+                if (data.error && data.error.length) {
+                    message.warning(data.error[0].message);
+                    return;
+                };
+            };
+            let theArr = [], theList = [];
+            if ((typeof (data.data)).indexOf('string') == -1) {
+                data.data.map((item) => {
+                    theArr.push({
+                        value: item.province,
+                        label: getProvince(item.province)
+                    });
+                    let cityList = [];
+                    if (item.city) {
+                        item.city.split(',').map((c) => {
+                            cityList.push({
+                                id: Number(c),
+                                name: getProvince(c)
+                            });
+                        });
+                    };
+                    theList.push({
+                        id: item.province,
+                        name: getProvince(item.province),
+                        cityList: cityList.length ? cityList : null
+                    });
+                });
+            } else {
+                theArr = provinceSelect();
+                theList = provinceList;
+            }
+            this.setState({
+                provinceOption: theArr,
+                provinceList: theList,
+                loading: false
+            });
+        })
+    },
+    loadBindRoles(uid) {
+        this.setState({
+            loading: true
+        });
+        $.ajax({
+            url: globalConfig.context + '/api/admin/role',
+            cache: false,
+            data: {
+                "uid": uid
+            }
+        }).done((data) => {
+            if (!data.data) {
+                if (data.error && data.error.length) {
+                    message.warning(data.error[0].message);
+                };
+                return;
+            } else if (data.data) {
+                this.state.theSwitch = true;
+                for (let i = 0; i < data.data.length; i++) {
+                    for (let n = 0; n < this.props.currentRoles.length; n++) {
+                        if (data.data[i] === this.props.currentRoles[n] && uid != 1) {
+                            this.state.theSwitch = false;
+                        }
+                    }
+                };
+            };
+            this.setState({
+                bindroles: data.data || [],
+                theSwitch: this.state.theSwitch,
+                loading: false
+            });
+        })
+    },
+    loadLocations(id) {
+        this.setState({
+            loading: true
+        });
+        $.ajax({
+            url: globalConfig.context + '/api/admin/supervise/adminDetailLocation',
+            cache: false,
+            data: {
+                "id": id
+            }
+        }).done((data) => {
+            if (!data.data) {
+                if (data.error && data.error.length) {
+                    message.warning(data.error[0].message);
+                    return;
+                };
+            };
+            data.data.map((item) => {
+                if (item.city) {
+                    item.city = item.city.split(',');
+                }
+            });
+            this.setState({
+                locations: data.data,
+                loading: false
+            });
+        })
+    },
+    componentWillMount() {
+        this.loadAdminSelectList();
+        this.loadAdminOwnLocation();
+    },
+    componentWillReceiveProps(nextProps) {
+        if (!this.state.visible && nextProps.show) {
+            if (nextProps.data.id) {
+                this.loadBindRoles(nextProps.data.id);
+                this.loadLocations(nextProps.data.id);
+            }
+        };
+        let nextState = {
+            visible: nextProps.show,
+            id: nextProps.data ? nextProps.data.id : '',
+            name: nextProps.data ? nextProps.data.name : '',
+            email: nextProps.data ? nextProps.data.email : '',
+            mobile: nextProps.data ? nextProps.data.mobile : '',
+            position: nextProps.data ? nextProps.data.position : '',
+            superiorId: nextProps.data ? nextProps.data.superiorId : '',    
+        };
+        this.setState(nextState)
+    },
+    resetPwd(e) {
+        this.setState({
+            loading: true
+        })
+        $.ajax({
+            type: 'post',
+            url: globalConfig.context + "/api/admin/supervise/resetPwd",
+            dataType: "json",
+            data: {
+                id: this.state.id
+            }
+        }).done((res) => {
+            if (res.error && res.error.length) {
+                message.error(res.error[0].message);
+            } else {
+                message.success("密码重置成功");
+            }
+        }).always(() => {
+            this.setState({
+                loading: false
+            })
+        });
+    },
+    getRolesSelection() {
+        if (!this.state.id) {
+            return <li></li>
+        } else if (this.state.id != '1') {
+            return <li className="list">
+                <span className='modal-text'>角色</span>
+                <Select
+                    multiple
+                    style={{ width: '60%' }}
+                    placeholder="选择用户关联角色"
+                    value={this.state.bindroles}
+                    onChange={this.bindRoles} >
+                    {this.getRolesOptions()}
+                </Select>
+            </li>
+        } else if (this.state.id == "1") {
+            return <li><span className='modal-text'>角色</span><span>系统管理员</span></li>
+        }
+    },
+    bindRoles(val) {
+        this.setState({
+            bindroles: val
+        });
+    },
+    getRolesOptions() {
+        let options = [];
+        for (let i = 0; i < this.props.roles.length; i++) {
+            options.push(<Select.Option key={String(this.props.roles[i].id)}>{this.props.roles[i].roleName}</Select.Option>);
+        }
+        return options;
+    },
+    getLocations(index, p, c) {
+        this.state.locations.map((item, i) => {
+            if (index == i) {
+                item.province = p;
+                item.city = c || [];
+            };
+        });
+    },
+    delLocations(index) {
+        this.state.locations.splice(index, 1);
+        this.setState({ locations: this.state.locations });
+    },
+    provinceAdd() {
+        this.state.locations.push({
+            province: null,
+            city: null
+        });
+        this.setState({ locations: this.state.locations });
+    },
+    render() {
+        return (
+            <div className="modal" >
+                <Modal maskClosable={false} title="管理员详情"
+                    closable={false} width={1000}
+                    visible={this.state.visible}
+                    onOk={this.postData}
+                    onCancel={this.handleCancel} >
+                    <Spin spinning={this.state.loading} >
+                        {this.state.theSwitch ? <div className="modal-box">
+                            <ul className="modal-content clearfix">
+                                <li className="list">
+                                    <span className='modal-text'>名字</span>
+                                    <Input value={this.state.name} onChange={(e) => { this.state.name = e.target.value; this.setState({ name: this.state.name }); }} />
+                                </li>
+                                <li className="list">
+                                    <span className='modal-text'>职位</span>
+                                    <Input value={this.state.position} onChange={(e) => { this.state.position = e.target.value; this.setState({ position: this.state.position }); }} />
+                                </li>
+                                <li className="list">
+                                    <span className='modal-text'>上级</span>
+                                    <Select style={{ verticalAlign: 'middle', width: 200 }}
+                                        placeholder="选择一个上级" notFoundContent="没有获取到管理员列表"
+                                        showSearch
+                                        filterOption={companySearch}
+                                        value={this.state.superiorId}
+                                        onChange={(e) => { this.setState({ superiorId: e }) }} >
+                                        {this.state.adminSelectOption}
+                                    </Select>
+                                </li>
+                                <li className="list">
+                                    <span className='modal-text'>登录账号</span>
+                                    <Input value={this.state.mobile} onChange={(e) => { this.state.mobile = e.target.value; this.setState({ mobile: this.state.mobile }); }} />
+                                </li>
+                                <li className="list">
+                                    <span className='modal-text'>邮箱</span>
+                                    <Input value={this.state.email} onChange={(e) => { this.state.email = e.target.value; this.setState({ email: this.state.email }); }} />
+                                </li>
+                                {this.getRolesSelection()}
+                                {this.state.id ? <li className="list">
+                                    <span></span>
+                                    <Popconfirm
+                                        title={"用户 [ " + this.state.name + " ] 的密码将会重置为123456,确认操作?"}
+                                        onConfirm={this.resetPwd}
+                                        okText="确认"
+                                        cancelText="取消"
+                                        placement="topLeft">
+                                        <Button>重置密码</Button>
+                                    </Popconfirm>
+                                </li> : <li></li>}
+                            </ul>
+                            <div>
+                                <span className='modal-text' style={{ verticalAlign: 'top' }}>地区</span>
+                                {window.showPermissionList && window.showRoleList ? <div style={{ display: 'inline-block', width: '88%' }}>
+                                    {this.state.locations.map((item, i) => {
+                                        return <ProvinceAdd
+                                            provinceList={this.state.provinceList}
+                                            provinceOption={this.state.provinceOption}
+                                            getLocations={this.getLocations}
+                                            delLocations={this.delLocations}
+                                            locations={this.state.locations}
+                                            index={i} key={i} />
+                                    })}
+                                    <Button style={{ verticalAlign: 'middle' }} type="dashed" size="small"
+                                        onClick={this.provinceAdd}>
+                                        <Icon type="plus" />
+                                    </Button>
+                                </div> : <div style={{ display: 'inline-block', width: '88%' }}>
+                                        {this.state.locations.map((item, i) => {
+                                            return <Tag key={i}>{getProvince(item.province) + ' ' + (item.city ? item.city.map((c) => {
+                                                return getProvince(c) + ' '
+                                            }) : '')}</Tag>
+                                        })}
+                                    </div>}
+                            </div>
+                        </div> : <div className="modal-box">
+                                <ul className="modal-content clearfix">
+                                    <li className="list">
+                                        <span className='modal-text'>名字</span>
+                                        <span className="modal-det">{this.state.name}</span>
+                                    </li>
+                                    <li className="list">
+                                        <span className='modal-text'>职位</span>
+                                        <span className="modal-det">{this.state.position}</span>
+                                    </li>
+                                    <li className="list">
+                                        <span className='modal-text'>上级</span>
+                                        <span className="modal-det">{this.state.adminSelectObj[this.state.superiorId]}</span>
+                                    </li>
+                                    <li className="list">
+                                        <span className='modal-text'>登录账号</span>
+                                        <span className="modal-det">{this.state.mobile}</span>
+                                    </li>
+                                    <li className="list">
+                                        <span className='modal-text'>邮箱</span>
+                                        <span className="modal-det">{this.state.email}</span>
+                                    </li>
+                                </ul>
+                                <div>
+                                    <span className='modal-text' style={{ verticalAlign: 'top' }}>地区</span>
+                                    <div style={{ display: 'inline-block', width: '88%' }}>
+                                        {this.state.locations.map((item, i) => {
+                                            return <Tag key={i}>{getProvince(item.province) + ' ' + (item.city ? item.city.map((c) => {
+                                                return getProvince(c) + ' '
+                                            }) : '')}</Tag>
+                                        })}
+                                    </div>
+                                </div>
+                            </div>}
+                    </Spin>
+                </Modal>
+            </div >
+        );
+    }
+})
+
+export default TheModal;

+ 0 - 15
js/component/manageCenter/set/userManagement/newUser.jsx

@@ -1,15 +0,0 @@
-import React from 'react';
-import ReactDom from 'react-dom';
-import ajax from 'jquery/src/ajax/xhr.js';
-import $ from 'jquery/src/ajax';
-import {Form} from 'antd';
-
-const Newuser=Form.create()(React.createClass({
-	render(){
-		return (
-			<div>新建用户</div>
-		)
-	}
-}));
-
-export default Newuser;

+ 166 - 0
js/component/manageCenter/set/userManagement/permission.jsx

@@ -0,0 +1,166 @@
+import React from 'react';
+import { Table, Button, Input, Spin, Message, Icon } from 'antd';
+import ajax from 'jquery/src/ajax/xhr.js';
+import $ from 'jquery/src/ajax';
+
+const Permission = React.createClass({
+    getInitialState() {
+        return {
+            data: [],
+            selectedRowKeys: [],
+            selectedRows: [],
+            loading: false
+        }
+    },
+
+    componentDidMount() {
+        this.loadData();
+    },
+
+    loadData() {
+        this.setState({
+            loading: true
+        });
+        $.ajax({
+            url: globalConfig.context + '/api/permissions',
+            method: 'get',
+            cache: false
+        }).done((res) => {
+            if (!res.error.length) {
+                this.setState({
+                    data: res.data
+                })
+            }
+        }).always(() => {
+            this.setState({
+                loading: false
+            });
+        });
+    },
+
+    save() {
+        this.setState({
+            loading: true
+        });
+        $.ajax({
+            url: globalConfig.context + '/api/permission',
+            method: 'post',
+            data: {
+                data: JSON.stringify(this.state.data)
+            }
+        }).done((res) => {
+            if (!res.error.length) {
+                Message.success("保存成功");
+                this.loadData();
+            } else {
+                Message.error(res.error[0].message);
+            }
+        }).always(() => {
+            this.setState({
+                loading: false
+            });
+        })
+    },
+
+    remove() {
+        let deletedIds = [];
+        for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
+            let rowItem = this.state.selectedRows[idx];
+            if (rowItem.id) {
+                deletedIds.push(rowItem.id)
+            }
+        };
+        this.setState({
+            loading: deletedIds.length > 0
+        });
+        if (deletedIds.length) {
+            $.ajax({
+                url: globalConfig.context + '/api/permission/delete',
+                method: 'post',
+                data: {
+                    data: JSON.stringify(deletedIds)
+                }
+            }).done((res) => {
+                if (!res.error.length) {
+                    Message.success("删除成功");
+                    this.state.selectedRowKeys.sort((a, b) => { return b - a });
+                    for (let idx = 0; idx < this.state.selectedRowKeys.length; idx++) {
+                        let dataIndex = this.state.selectedRowKeys[idx];
+                        this.state.data.splice(dataIndex, 1);
+                    };
+                    this.setState({
+                        data: this.state.data,
+                        selectedRowKeys: []
+                    });
+                } else {
+                    Message.error(res.error[0].message);
+                }
+            }).always(() => {
+                this.setState({
+                    loading: false
+                });
+            })
+        }
+    },
+
+    addNew() {
+        this.state.data.push({
+            id: null,
+            name: '',
+            url: ''
+        });
+        this.setState({
+            data: this.state.data
+        })
+    },
+
+    render() {
+        const columns = [{
+            title: '权限名字',
+            dataIndex: 'name',
+            key: 'name',
+            render: (text, record, index) => {
+                return <Input value={record.name} onChange={(e) => { record.name = e.target.value; this.setState({ data: this.state.data }); }} />
+            }
+        }, {
+            title: '接口路径',
+            dataIndex: 'url',
+            key: 'url',
+            render: (text, record, index) => {
+                return <Input value={record.url} onChange={(e) => { record.url = e.target.value; this.setState({ data: this.state.data }); }} />
+            }
+        }];
+        const rowSelection = {
+            type: 'checkbox',
+            selectedRowKeys: this.state.selectedRowKeys,
+            onChange: (selectedRowKeys, selectedRows) => {
+                this.setState({
+                    selectedRows: selectedRows,
+                    selectedRowKeys: selectedRowKeys
+                });
+            }
+        };
+        const hasSelected = this.state.selectedRowKeys.length > 0;
+        return (
+            <Spin spinning={this.state.loading}>
+                <div className="set-content">
+                    <div className="set-title">
+                        <span>权限控制</span>
+                        <Button style={{ background: "#ea0862", border: "none", color: "#fff" }}
+                            onClick={this.addNew}>添加<Icon type="plus" /></Button>
+                        <Button style={{ background: "#3fcf9e", border: "none", color: "#fff" }}
+                            disabled={!hasSelected}
+                            onClick={this.remove}>删除<Icon type="minus" /></Button>
+                        <Button type="primary" onClick={this.save}>保存修改</Button>
+                    </div>
+                    <Table className="member-table"
+                        columns={columns}
+                        dataSource={this.state.data}
+                        pagination={false}
+                        rowSelection={rowSelection} />
+                </div>
+            </Spin>
+        );
+    }
+});
+export default Permission;

+ 269 - 11
js/component/manageCenter/set/userManagement/role.jsx

@@ -1,15 +1,273 @@
 import React from 'react';
-import ReactDom from 'react-dom';
-import ajax from 'jquery/src/ajax/xhr.js';
+import { Table, Button, Input, Spin, Message, Select, Modal, Tag, Icon } from 'antd';
+import ajax from 'jquery/src/ajax/xhr.js'
 import $ from 'jquery/src/ajax';
-import {Form} from 'antd';
 
-const Role=Form.create()(React.createClass({
-	render(){
-		return (
-			<div>角色管理</div>
-		)
-	}
-}));
+const Role = React.createClass({
+    getInitialState() {
+        return {
+            visible: false,
+            disabled: false,
+            name: '',
+            selectOption: [],
+            data: [],
+            selectedRowKeys: [],
+            selectedRows: [],
+            loading: false,
+            permissions: {
 
-export default Role;
+            },
+            modelRecord: {
+                id: '',
+                name: '',
+                permissions: []
+            }
+        }
+    },
+
+    componentWillMount() {
+        this.loadData();
+    },
+
+    loadData() {
+        let _me = this;
+        this.setState({
+            loading: true
+        });
+        $.when($.ajax({
+            url: globalConfig.context + '/api/roles',
+            method: 'get',
+            cache: false
+        }), $.ajax({
+            url: globalConfig.context + '/api/permissions',
+            method: 'get',
+            cache: false
+        })).done((roles, permissions) => {
+            if (!roles[0].error.length && roles[0].data) {
+                this.state.data = [];
+                for (let i = 0; i < roles[0].data.length; i++) {
+                    let thisdata = roles[0].data[i];
+                    this.state.data.push({
+                        key: i,
+                        id: thisdata.id,
+                        roleName: thisdata.roleName,
+                        permissions: thisdata.permissions.map((p) => { return String(p.id) }) || []
+                    });
+                };
+            }
+            if (!permissions[0].error.length && permissions[0].data) {
+                _me.state.selectOption = [];
+                permissions[0].data.map(function (item) {
+                    _me.state.selectOption.push(
+                        <Select.Option key={item.id}>{item.name}</Select.Option>
+                    )
+                    _me.state.permissions[String(item.id)] = item.name;
+                });
+            }
+        }).always(() => {
+            this.setState({
+                loading: false
+            });
+        });
+    },
+
+    save() {
+        this.setState({
+            loading: true
+        });
+        $.ajax({
+            url: globalConfig.context + '/api/role',
+            method: 'post',
+            data: { data: JSON.stringify(this.state.modelRecord) },
+        }).done((res) => {
+            if (!res.error.length) {
+                Message.success("保存成功");
+                this.loadData();
+            } else {
+                Message.error(res.error[0].message);
+            }
+        }).always(() => {
+            this.setState({
+                loading: false,
+                visible: false,
+                disabled: false
+            });
+        })
+    },
+
+    remove() {
+        let deletedIds = [];
+        for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
+            let rowItem = this.state.selectedRows[idx];
+            if (rowItem.id) {
+                deletedIds.push(rowItem.id)
+            }
+        };
+        this.setState({
+            loading: deletedIds.length > 0
+        });
+        if (deletedIds.length) {
+            $.ajax({
+                url: globalConfig.context + '/api/role/delete',
+                method: 'post',
+                data: {
+                    data: JSON.stringify(deletedIds)
+                }
+            }).done((res) => {
+                if (!res.error.length) {
+                    Message.success("删除成功");
+                    this.state.selectedRowKeys.sort((a, b) => { return b - a });
+                    for (let idx = 0; idx < this.state.selectedRowKeys.length; idx++) {
+                        let dataIndex = this.state.selectedRowKeys[idx];
+                        this.state.data.splice(dataIndex, 1);
+                    };
+                    this.setState({
+                        data: this.state.data,
+                        selectedRowKeys: []
+                    });
+                } else {
+                    Message.error(res.error[0].message);
+                }
+            }).always(() => {
+                this.setState({
+                    loading: false
+                });
+            })
+        }
+    },
+
+    addNew() {
+        this.setState({
+            visible: true,
+            modelRecord: {
+                id: null,
+                roleName: '',
+                permissions: []
+            }
+        })
+    },
+
+    edit(e) {
+        this.setState({
+            modelRecord: {
+                id: e.id,
+                roleName: e.roleName,
+                permissions: e.permissions
+            },
+            visible: true,
+            disabled: false
+        })
+    },
+
+    handleCancel() {
+        this.setState({
+            visible: false,
+            disabled: false
+        })
+    },
+
+    render() {
+        const columns = [{
+            title: '名字',
+            dataIndex: 'roleName',
+            key: 'roleName'
+        }, {
+            title: '绑定权限',
+            dataIndex: 'permissions',
+            key: 'permissions',
+            render: (text, record, index) => {
+                let _me = this;
+                if (record.permissions) {
+                    return <div>
+                        {record.permissions.map((tag, i) => {
+                            if (i < 3) {
+                                return <Tag key={tag} closable={false}>
+                                    {_me.state.permissions[tag]}
+                                </Tag>
+                            } else if (i == 3) {
+                                return <Tag key={tag} closable={false}>
+                                    ...
+                                </Tag>
+                            } else {
+                                return false;
+                            }
+                        }
+                        )}
+                    </div>
+                } else {
+                    return <div></div>;
+                }
+            },
+        }];
+        const rowSelection = {
+            type: 'checkbox',
+            selectedRowKeys: this.state.selectedRowKeys,
+            onChange: (selectedRowKeys, selectedRows) => {
+                this.setState({
+                    selectedRows: selectedRows,
+                    selectedRowKeys: selectedRowKeys
+                });
+            }
+        };
+        const hasSelected = this.state.selectedRowKeys.length > 0;
+        return (
+            <Spin spinning={this.state.loading}>
+                <Modal maskClosable={false} title="角色编辑"
+                    closable={false}
+                    visible={this.state.visible}
+                    onOk={this.save}
+                    width={1000}
+                    onCancel={this.handleCancel}>
+                    <ul className="modal-content">
+                        <li>
+                            <span className='modal-text'>名字</span>
+                            <Input value={this.state.modelRecord.roleName} onChange={(e) => {
+                                this.state.modelRecord.roleName = e.target.value;
+                                this.setState({
+                                    modelRecord: this.state.modelRecord
+                                })
+                            }} />
+                        </li>
+                        <li>
+                            <span className='modal-text'>权限</span>
+                            <Select
+                                multiple
+                                style={{ width: '80%' }}
+                                placeholder="选择绑定权限"
+                                disabled={!this.state.modelRecord.id}
+                                filterOption={(input, option) => { return option.props.children.indexOf(input) >= 0 }}
+                                value={this.state.modelRecord.permissions}
+                                onChange={(pids) => {
+                                    this.state.modelRecord.permissions = pids;
+                                    this.setState({
+                                        modelRecord: this.state.modelRecord
+                                    })
+                                }}
+                            >
+                                {this.state.selectOption}
+                            </Select>
+                        </li>
+                    </ul>
+                </Modal>
+                <div className="set-content">
+                    <div className="set-title">
+                        <span>角色控制</span>
+                        <Button style={{ background: "#ea0862", border: "none", color: "#fff" }}
+                            onClick={this.addNew}>添加<Icon type="plus" /></Button>
+                        <Button style={{ background: "#3fcf9e", border: "none", color: "#fff" }}
+                            disabled={!hasSelected}
+                            onClick={this.remove}>删除<Icon type="minus" /></Button>
+                    </div>
+                    <Table className='member-table'
+                        columns={columns}
+                        dataSource={this.state.data}
+                        onRowClick={this.edit}
+                        pagination={false}
+                        rowSelection={rowSelection} />
+                </div>
+            </Spin>
+        );
+    }
+});
+
+export default Role;

+ 24 - 0
js/component/manageCenter/set/userManagement/site.jsx

@@ -0,0 +1,24 @@
+import React from 'react';
+import theme from 'react-quill/dist/quill.snow.css'
+import ReactQuill from 'react-quill'
+
+class Site extends React.Component {
+  constructor(props) {
+    super(props)
+    this.state = { text: '' }
+    this.handleChange = this.handleChange.bind(this)
+  }
+
+  handleChange(value) {
+    this.setState({ text: value })
+  }
+
+  render() {
+    return (
+      <ReactQuill value={this.state.text}
+                  onChange={this.handleChange} />
+    )
+  }
+}
+
+export default Site;

+ 0 - 133
js/component/manageCenter/set/userManagement/techAchievement.less

@@ -1,133 +0,0 @@
-.user-content {
-    background: #fff;
-    padding: 20px;
-    .content-title {
-        color: #333;
-        font-size: 16px;
-        overflow: hidden;
-    }
-    .user-search {
-        margin-bottom: 10px;
-        >input {
-            width: 140px;
-        }
-        >input,
-        >button,
-        .ant-select {
-            margin-right: 10px;
-            margin-top: 10px;
-        }
-        .ant-switch {
-            margin-left: 10px;
-        }
-        .search-more {
-            margin: 10px 0;
-            >span {
-                margin-right: 10px
-            }
-        }
-    }
-}
-.avatar-uploader,
-.avatar-uploader-trigger,
-.avatar {
-    width: 150px;
-    height: 150px;
-}
-.modal-box-title{float: left;}
-.modal-box-detail{margin-left: 10px;vertical-align: top;float: left;margin-top: 0px;width: 160px!important;}
-.avatar-uploader-trigger {
-    display: table-cell;
-    vertical-align: middle;
-    font-size: 28px;
-    color: #999;
-}
-.avatar-uploader {
-    display: block;
-    padding: 1px;
-    border: 1px dashed #d9d9d9;
-    border-radius: 6px;
-    cursor: pointer;
-    position: relative;
-    img {
-        position: absolute;
-        top: -1px;
-        left: -1px;
-        height: 150px;
-    } //
-    float: left;
-    margin-right: 20px;
-}
-.patent-addNew {
-    float: right;
-    margin-left: 20px;
-    >* {
-        float: left;
-        margin-right: 20px;
-    }
-    .addButton {
-        background: #ea0862;
-        color: #fff;
-        border: none;
-        border-radius: 4px;
-        padding: 4px 10px;
-    }
-    .addButton:hover {
-        background: #ea0862;
-    }
-}
-
-#demand-form {
-    .half-item {
-        float: left;
-        width: 50%;
-        margin-bottom: 10px;
-    }
-    .item-title {
-        line-height: 30px;
-        font-size: 14px;
-        color: #666;
-    }
-    .form-title {
-        font-size: 16px;
-        color: #333;
-    }
-    .keyWord-tips {
-        >button {
-            vertical-align: middle;
-        }
-    }
-    .set-submit {
-        margin-right: 20px;
-    }
-    .demandDetailShow-upload {
-        .anticon-eye-o {
-            margin-left: -8px;
-        }
-        .anticon-delete {
-            display: none
-        }
-    }
-}
-
-.ant-modal-content {
-    .modal-submit {
-        margin-left: 20px;
-    }
-}
-
-.demand-order-content {
-    .ant-row {
-        margin-bottom: 20px;
-    }
-    .ant-input-number-handler-wrap {
-        display: none
-    }
-}
-.ant-table-thead {
-    .ant-table-selection-column {
-        .ant-checkbox-wrapper {
-            display: none;
-        }
-    }
-}

+ 0 - 250
js/component/manageCenter/set/userManagement/user.jsx

@@ -1,250 +0,0 @@
-import React from 'react';
-import ReactDom from 'react-dom';
-import ajax from 'jquery/src/ajax/xhr.js';
-import $ from 'jquery/src/ajax';
-import { Form,Radio, Icon, Button, Input, Select, Spin, Table, Switch, message, DatePicker, Modal, Upload } from 'antd';
-import Newuser from "./newUser.jsx"
-
-
-const User=Form.create()(React.createClass({
-	loadData(pageNo, apiUrl) {
-        this.state.data = [];
-        this.setState({
-            loading: true
-        });
-        $.ajax({
-            method: "get",
-            dataType: "json",
-            crossDomain: false,
-            url: globalConfig.context + (apiUrl || this.props['data-listApiUrl']),
-            data: {
-                pageNo: pageNo || 1,
-                pageSize: this.state.pagination.pageSize,
-            },
-            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,
-                            serialNumber: thisdata.serialNumber,
-                        });
-                    };
-                    this.state.pagination.current = data.data.pageNo;
-                    this.state.pagination.total = data.data.totalCount;
-                };
-                this.setState({
-                    dataSource: theArr,
-                    pagination: this.state.pagination
-                });
-            }.bind(this),
-        }).always(function () {
-            this.setState({
-                loading: false
-            });
-        }.bind(this));
-    },
-    getInitialState() {
-        return {
-            searchMore: true,
-            selectedRowKeys: [],
-            selectedRows: [],
-            loading: false,
-            pagination: {
-                defaultCurrent: 1,
-                defaultPageSize: 10,
-                showQuickJumper: true,
-                pageSize: 10,
-                onChange: function (page) {
-                    this.loadData(page);
-                }.bind(this),
-                showTotal: function (total) {
-                    return '共' + total + '条数据';
-                }
-            },
-            columns: [
-                {
-                    title: '编号',
-                    dataIndex: 'serialNumber',
-                    key: 'serialNumber',
-                }, {
-                    title: '名称',
-                    dataIndex: 'name',
-                    key: 'name',
-                }, {
-                    title: '关键字',
-                    dataIndex: 'keyword',
-                    key: 'keyword',
-                }, {
-                    title: '类型',
-                    dataIndex: 'category',
-                    key: 'category',
-                    render: text => { return getAchievementCategory(text); }
-                }, {
-                    title: '所有人名称',
-                    dataIndex: 'theName',
-                    key: 'theName',
-                }, {
-                    title: '审核状态',
-                    dataIndex: 'auditStatus',
-                    key: 'auditStatus',
-                    render: text => { return getTechAuditStatus(text) }
-                }, 
-                {
-                    title: '是否精品',
-                    dataIndex: 'boutique',
-                    key: 'boutique',
-                    render: text => { return getboutique(text) }
-                },
-                 {
-                    title: '首页展示',
-                    dataIndex: 'hot',
-                    key: 'hot',
-                    render: text => { return gethot(text) }
-                },
-                {
-                    title: '发布时间',
-                    dataIndex: 'releaseDateFormattedDate',
-                    key: 'releaseDateFormattedDate',
-                }
-            ],
-            dataSource: [],
-        };
-    },
-    componentWillMount() {
-       
-        this.loadData();
-    },
-    
-    tableRowClick(record, index) {
-        this.state.RowData = record;
-        this.setState({
-            showDesc: true
-        });
-    },
-    delectRow() {
-        let deletedIds = [];
-        for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
-            let rowItem = this.state.selectedRows[idx];
-            if (rowItem.id) {
-                deletedIds.push(rowItem.id)
-            };
-        };
-        this.setState({
-            selectedRowKeys: [],
-            loading: deletedIds.length > 0
-        });
-        $.ajax({
-            method: "POST",
-            dataType: "json",
-            crossDomain: false,
-            url: globalConfig.context + "/api/admin/achievement/delete",
-            data: {
-                ids: deletedIds
-            }
-        }).done(function (data) {
-            if (!data.error.length) {
-                message.success('删除成功!');
-                this.setState({
-                    loading: false,
-                });
-            } else {
-                message.warning(data.error[0].message);
-            };
-            this.loadData();
-        }.bind(this));
-    },
-    addClick() {
-        this.state.RowData = {};
-        this.setState({
-            showDesc: true
-        });
-    },
-    closeDesc(e, s) {
-        this.state.showDesc = e;
-        if (s) {
-            this.loadData();
-        };
-    },
-    search() {
-        this.loadData();
-    },
-    reset() {
-        this.state.serialNumber = undefined;
-        this.state.name = undefined;
-        this.state.keyword = undefined;
-        this.state.category = undefined;
-        this.state.ownerType = undefined;
-        this.state.releaseStatus = undefined;
-        this.state.auditStatus = undefined;
-        this.state.searchName = undefined;
-        this.state.releaseDate = [];
-        this.state.boutique = '';
-        this.state.hot='' ;
-        this.loadData();       
-    },
-    searchSwitch() {
-        this.setState({
-            searchMore: !this.state.searchMore
-        });
-    },
-    render() {
-        const rowSelection = {
-            selectedRowKeys: this.state.selectedRowKeys,
-            onChange: (selectedRowKeys, selectedRows) => {
-                this.setState({
-                    selectedRows: selectedRows.slice(-1),
-                    selectedRowKeys: selectedRowKeys.slice(-1)
-                });
-            }
-        };
-        const hasSelected = this.state.selectedRowKeys.length > 0;
-        const { RangePicker } = DatePicker;
-        return (
-            <div className="user-content" >
-                <div className="content-title">
-                <div className="user-search">
-                    <Input placeholder="编号" style={{width:'150px'}}
-                        value={this.state.serialNumber}
-                        onChange={(e) => { this.setState({ serialNumber: e.target.value }); }} />
-                    <Button type="primary" onClick={this.search}>搜索</Button>
-                    <Button onClick={this.reset}>重置</Button>
-                    <Button style={{ background: "#3fcf9e", border: "none", color: "#fff" }}
-                        disabled={!hasSelected}
-                        onClick={this.delectRow}>删除<Icon type="minus" /></Button>
-                    <span>更多搜索<Switch defaultChecked={false} onChange={this.searchSwitch} /></span>
-                    <div className="search-more" style={this.state.searchMore ? { display: 'none' } : {}}>
-                    	<Radio.Group value={this.state.boutique} onChange={(e) => {
-		                    this.setState({ boutique: e.target.value })
-		                    }}>
-		                        <Radio value={1}>精品</Radio>
-		                        <Radio value={0}>非精品</Radio>
-		                </Radio.Group>
-                    </div>
-                </div>
-                <div className="patent-table">
-                    <Spin spinning={this.state.loading}>
-                        <Table columns={this.state.columns}
-                            dataSource={this.state.dataSource}
-                            rowSelection={rowSelection}
-                            pagination={this.state.pagination}
-                            onRowClick={this.tableRowClick} />
-                    </Spin>
-                </div>
-                <Newuser
-                    data={this.state.RowData}
-                    showDesc={this.state.showDesc}
-                    closeDesc={this.closeDesc} />
-            </div >
-            </div>
-        );
-    }
-}));
-
-export default User;

+ 53 - 0
js/component/tools.js

@@ -50,6 +50,10 @@ import {
     lvl,
     industry,
     socialAttribute,
+    station,
+    post,
+    patternOrganization,
+    conditionOrganization
 } from './dataDic.js';
 
 import { provinceList} from './NewDicProvinceList.js';
@@ -915,5 +919,54 @@ module.exports = {
             return theType;
         }
     
+	},
+	//岗位
+	getStation:function(e){
+   		 if (e) {
+            let theType = '';
+            station.map(function (item) {
+                if (item.value == e) {
+                    theType = item.key;
+                };
+            });
+            return theType;
+        }
+    
+	},
+	//职务
+	getPost:function(e){
+   		 if (e) {
+            let theType = '';
+            post.map(function (item) {
+                if (item.value == e) {
+                    theType = item.key;
+                };
+            });
+            return theType;
+       }
+	},
+	//组织类型
+	getPattern:function(e){
+   		 if (e) {
+            let theType = '';
+            patternOrganization.map(function (item) {
+                if (item.value == e) {
+                    theType = item.key;
+                };
+            });
+            return theType;
+       }
+	},
+	//组织状态
+	getCondition:function(e){
+   		 if (e) {
+            let theType = '';
+            conditionOrganization.map(function (item) {
+                if (item.value == e) {
+                    theType = item.key;
+                };
+            });
+            return theType;
+       }
 	}
 }