Browse Source

后台管理系统前端代码修改

sunyadv 5 years ago
parent
commit
6241303878

+ 1 - 1
lib_vue/config/index.js

@@ -20,7 +20,7 @@ module.exports = {
     assetsPublicPath: '/',
     proxyTable: {
         '/api': {    
-            target: 'http://192.168.101.6:8099',  // 接口域名 开发
+            target: 'http://192.168.101.6:8091',  // 接口域名 开发
             secure: true,  // 如果是https接口,需要配置这个参数
             changeOrigin: true,  //是否跨域
             pathRewrite: { // 如果接口本身没有api的路径,那么这里将发送到后端的请求重写为没有api的路径

+ 5 - 1
lib_vue/index.html

@@ -2,13 +2,17 @@
 <html>
     <head>
         <meta charset="utf-8">
-        <title>云塑网后台管理系统</title>
+        <title>小海豚后台管理系统</title>
         <link rel="shortcut icon" type="image/x-icon" href="./cloud.ico" /> 
         <!-- 高德地图 -->
         <script type="text/javascript" src="https://webapi.amap.com/maps?v=1.4.15&key=362cff852a3a37d328f9697352eebacd"></script>
         <!-- 高德地图UI组件库 1.0 -->
         <script src="//webapi.amap.com/ui/1.0/main.js"></script>
         <style>
+            .toolbar {
+                background: #fff!important;
+            }
+
             /* 地图弹窗样式 */
             .window {
                 background: #fff;

+ 0 - 17
lib_vue/src/api/api.js

@@ -1,17 +0,0 @@
-import axios from 'axios';
-
-let base = '';
-
-export const requestLogin = params => { return axios.post(`${base}/login`, params).then(res => res.data); };
-
-export const getUserList = params => { return axios.get(`${base}/user/list`, { params: params }); };
-
-export const getUserListPage = params => { return axios.get(`${base}/user/listpage`, { params: params }); };
-
-export const removeUser = params => { return axios.get(`${base}/user/remove`, { params: params }); };
-
-export const batchRemoveUser = params => { return axios.get(`${base}/user/batchremove`, { params: params }); };
-
-export const editUser = params => { return axios.get(`${base}/user/edit`, { params: params }); };
-
-export const addUser = params => { return axios.get(`${base}/user/add`, { params: params }); };

+ 0 - 3
lib_vue/src/api/index.js

@@ -1,3 +0,0 @@
-import * as api from './api';
-
-export default api;

+ 60 - 106
lib_vue/src/assets/iconfont/demo_index.html

@@ -23,7 +23,7 @@
         <li class="dib"><span>Symbol</span></li>
       </ul>
       
-      <a href="https://www.iconfont.cn/manage/index?manage_type=myprojects&projectId=1313295" target="_blank" class="nav-more">查看项目</a>
+      <a href="https://www.iconfont.cn/manage/index?manage_type=myprojects&projectId=1458705" target="_blank" class="nav-more">查看项目</a>
       
     </div>
     <div class="tab-container">
@@ -31,33 +31,27 @@
           <ul class="icon_lists dib-box">
           
             <li class="dib">
-              <span class="icon iconfont">&#xe61f;</span>
-                <div class="name">图</div>
-                <div class="code-name">&amp;#xe61f;</div>
+              <span class="icon iconfont">&#xe715;</span>
+                <div class="name">图书馆</div>
+                <div class="code-name">&amp;#xe715;</div>
               </li>
           
             <li class="dib">
-              <span class="icon iconfont">&#xe669;</span>
-                <div class="name">编辑</div>
-                <div class="code-name">&amp;#xe669;</div>
+              <span class="icon iconfont">&#xe66a;</span>
+                <div class="name">用户</div>
+                <div class="code-name">&amp;#xe66a;</div>
               </li>
           
             <li class="dib">
-              <span class="icon iconfont">&#xe612;</span>
-                <div class="name">项目管理</div>
-                <div class="code-name">&amp;#xe612;</div>
+              <span class="icon iconfont">&#xe65f;</span>
+                <div class="name">返回</div>
+                <div class="code-name">&amp;#xe65f;</div>
               </li>
           
             <li class="dib">
-              <span class="icon iconfont">&#xe639;</span>
-                <div class="name">监测</div>
-                <div class="code-name">&amp;#xe639;</div>
-              </li>
-          
-            <li class="dib">
-              <span class="icon iconfont">&#xe76b;</span>
-                <div class="name">默认头像</div>
-                <div class="code-name">&amp;#xe76b;</div>
+              <span class="icon iconfont">&#xe61a;</span>
+                <div class="name">13培训机构</div>
+                <div class="code-name">&amp;#xe61a;</div>
               </li>
           
             <li class="dib">
@@ -67,21 +61,15 @@
               </li>
           
             <li class="dib">
-              <span class="icon iconfont">&#xe644;</span>
-                <div class="name">模型</div>
-                <div class="code-name">&amp;#xe644;</div>
+              <span class="icon iconfont">&#xe694;</span>
+                <div class="name">系统管理</div>
+                <div class="code-name">&amp;#xe694;</div>
               </li>
           
             <li class="dib">
-              <span class="icon iconfont">&#xe8ec;</span>
-                <div class="name">caret-down</div>
-                <div class="code-name">&amp;#xe8ec;</div>
-              </li>
-          
-            <li class="dib">
-              <span class="icon iconfont">&#xe868;</span>
-                <div class="name">地图</div>
-                <div class="code-name">&amp;#xe868;</div>
+              <span class="icon iconfont">&#xea8c;</span>
+                <div class="name">课程</div>
+                <div class="code-name">&amp;#xea8c;</div>
               </li>
           
           </ul>
@@ -135,83 +123,65 @@
         <ul class="icon_lists dib-box">
           
           <li class="dib">
-            <span class="icon iconfont icon-map"></span>
-            <div class="name">
-              地图
-            </div>
-            <div class="code-name">.icon-map
-            </div>
-          </li>
-          
-          <li class="dib">
-            <span class="icon iconfont icon-bianji"></span>
+            <span class="icon iconfont iconic_local_library_px"></span>
             <div class="name">
-              编辑
+              图书馆
             </div>
-            <div class="code-name">.icon-bianji
+            <div class="code-name">.iconic_local_library_px
             </div>
           </li>
           
           <li class="dib">
-            <span class="icon iconfont icon-ic_dashboard"></span>
+            <span class="icon iconfont iconyonghu"></span>
             <div class="name">
-              项目管理
+              用户
             </div>
-            <div class="code-name">.icon-ic_dashboard
+            <div class="code-name">.iconyonghu
             </div>
           </li>
           
           <li class="dib">
-            <span class="icon iconfont icon-jiance"></span>
+            <span class="icon iconfont iconfanhui1"></span>
             <div class="name">
-              监测
+              返回
             </div>
-            <div class="code-name">.icon-jiance
+            <div class="code-name">.iconfanhui1
             </div>
           </li>
           
           <li class="dib">
-            <span class="icon iconfont icon-morentouxiang"></span>
+            <span class="icon iconfont iconpeixunjigou"></span>
             <div class="name">
-              默认头像
+              13培训机构
             </div>
-            <div class="code-name">.icon-morentouxiang
+            <div class="code-name">.iconpeixunjigou
             </div>
           </li>
           
           <li class="dib">
-            <span class="icon iconfont icon-setting-fill"></span>
+            <span class="icon iconfont iconsetting-fill"></span>
             <div class="name">
               setting-fill
             </div>
-            <div class="code-name">.icon-setting-fill
-            </div>
-          </li>
-          
-          <li class="dib">
-            <span class="icon iconfont icon-moxing"></span>
-            <div class="name">
-              模型
-            </div>
-            <div class="code-name">.icon-moxing
+            <div class="code-name">.iconsetting-fill
             </div>
           </li>
           
           <li class="dib">
-            <span class="icon iconfont icon-caret-down"></span>
+            <span class="icon iconfont iconxitongguanli"></span>
             <div class="name">
-              caret-down
+              系统管理
             </div>
-            <div class="code-name">.icon-caret-down
+            <div class="code-name">.iconxitongguanli
             </div>
           </li>
           
           <li class="dib">
-            <span class="icon iconfont icon-ditu"></span>
+            <span class="icon iconfont iconkecheng"></span>
             <div class="name">
-              地图
+              课程
             </div>
-            <div class="code-name">.icon-ditu
+            <div class="code-name">.iconkecheng
             </div>
           </li>
           
@@ -233,7 +203,7 @@
 <pre><code class="language-html">&lt;link rel="stylesheet" href="./iconfont.css"&gt;
 </code></pre>
         <h3 id="-">第二步:挑选相应图标并获取类名,应用于页面:</h3>
-<pre><code class="language-html">&lt;span class="iconfont icon-xxx"&gt;&lt;/span&gt;
+<pre><code class="language-html">&lt;span class="iconfont iconxxx"&gt;&lt;/span&gt;
 </code></pre>
         <blockquote>
           <p>"
@@ -246,74 +216,58 @@
           
             <li class="dib">
                 <svg class="icon svg-icon" aria-hidden="true">
-                  <use xlink:href="#icon-map"></use>
-                </svg>
-                <div class="name">地图</div>
-                <div class="code-name">#icon-map</div>
-            </li>
-          
-            <li class="dib">
-                <svg class="icon svg-icon" aria-hidden="true">
-                  <use xlink:href="#icon-bianji"></use>
+                  <use xlink:href="#iconic_local_library_px"></use>
                 </svg>
-                <div class="name">编辑</div>
-                <div class="code-name">#icon-bianji</div>
+                <div class="name">图书馆</div>
+                <div class="code-name">#iconic_local_library_px</div>
             </li>
           
             <li class="dib">
                 <svg class="icon svg-icon" aria-hidden="true">
-                  <use xlink:href="#icon-ic_dashboard"></use>
+                  <use xlink:href="#iconyonghu"></use>
                 </svg>
-                <div class="name">项目管理</div>
-                <div class="code-name">#icon-ic_dashboard</div>
+                <div class="name">用户</div>
+                <div class="code-name">#iconyonghu</div>
             </li>
           
             <li class="dib">
                 <svg class="icon svg-icon" aria-hidden="true">
-                  <use xlink:href="#icon-jiance"></use>
+                  <use xlink:href="#iconfanhui1"></use>
                 </svg>
-                <div class="name">监测</div>
-                <div class="code-name">#icon-jiance</div>
+                <div class="name">返回</div>
+                <div class="code-name">#iconfanhui1</div>
             </li>
           
             <li class="dib">
                 <svg class="icon svg-icon" aria-hidden="true">
-                  <use xlink:href="#icon-morentouxiang"></use>
+                  <use xlink:href="#iconpeixunjigou"></use>
                 </svg>
-                <div class="name">默认头像</div>
-                <div class="code-name">#icon-morentouxiang</div>
+                <div class="name">13培训机构</div>
+                <div class="code-name">#iconpeixunjigou</div>
             </li>
           
             <li class="dib">
                 <svg class="icon svg-icon" aria-hidden="true">
-                  <use xlink:href="#icon-setting-fill"></use>
+                  <use xlink:href="#iconsetting-fill"></use>
                 </svg>
                 <div class="name">setting-fill</div>
-                <div class="code-name">#icon-setting-fill</div>
-            </li>
-          
-            <li class="dib">
-                <svg class="icon svg-icon" aria-hidden="true">
-                  <use xlink:href="#icon-moxing"></use>
-                </svg>
-                <div class="name">模型</div>
-                <div class="code-name">#icon-moxing</div>
+                <div class="code-name">#iconsetting-fill</div>
             </li>
           
             <li class="dib">
                 <svg class="icon svg-icon" aria-hidden="true">
-                  <use xlink:href="#icon-caret-down"></use>
+                  <use xlink:href="#iconxitongguanli"></use>
                 </svg>
-                <div class="name">caret-down</div>
-                <div class="code-name">#icon-caret-down</div>
+                <div class="name">系统管理</div>
+                <div class="code-name">#iconxitongguanli</div>
             </li>
           
             <li class="dib">
                 <svg class="icon svg-icon" aria-hidden="true">
-                  <use xlink:href="#icon-ditu"></use>
+                  <use xlink:href="#iconkecheng"></use>
                 </svg>
-                <div class="name">地图</div>
-                <div class="code-name">#icon-ditu</div>
+                <div class="name">课程</div>
+                <div class="code-name">#iconkecheng</div>
             </li>
           
           </ul>

File diff suppressed because it is too large
+ 19 - 27
lib_vue/src/assets/iconfont/iconfont.css


BIN
lib_vue/src/assets/iconfont/iconfont.eot


File diff suppressed because it is too large
+ 1 - 1
lib_vue/src/assets/iconfont/iconfont.js


+ 58 - 0
lib_vue/src/assets/iconfont/iconfont.json

@@ -0,0 +1,58 @@
+{
+  "id": "1458705",
+  "name": "儿童在线教育-后台",
+  "font_family": "iconfont",
+  "css_prefix_text": "icon",
+  "description": "",
+  "glyphs": [
+    {
+      "icon_id": "1698558",
+      "name": "图书馆",
+      "font_class": "ic_local_library_px",
+      "unicode": "e715",
+      "unicode_decimal": 59157
+    },
+    {
+      "icon_id": "2510581",
+      "name": "用户",
+      "font_class": "yonghu",
+      "unicode": "e66a",
+      "unicode_decimal": 58986
+    },
+    {
+      "icon_id": "2882748",
+      "name": "返回",
+      "font_class": "fanhui1",
+      "unicode": "e65f",
+      "unicode_decimal": 58975
+    },
+    {
+      "icon_id": "3211524",
+      "name": "13培训机构",
+      "font_class": "peixunjigou",
+      "unicode": "e61a",
+      "unicode_decimal": 58906
+    },
+    {
+      "icon_id": "4936694",
+      "name": "setting-fill",
+      "font_class": "setting-fill",
+      "unicode": "e871",
+      "unicode_decimal": 59505
+    },
+    {
+      "icon_id": "7255482",
+      "name": "系统管理",
+      "font_class": "xitongguanli",
+      "unicode": "e694",
+      "unicode_decimal": 59028
+    },
+    {
+      "icon_id": "8190625",
+      "name": "课程",
+      "font_class": "kecheng",
+      "unicode": "ea8c",
+      "unicode_decimal": 60044
+    }
+  ]
+}

File diff suppressed because it is too large
+ 6 - 12
lib_vue/src/assets/iconfont/iconfont.svg


BIN
lib_vue/src/assets/iconfont/iconfont.ttf


BIN
lib_vue/src/assets/iconfont/iconfont.woff


BIN
lib_vue/src/assets/iconfont/iconfont.woff2


BIN
lib_vue/src/assets/image/head_logo.png


+ 42 - 46
lib_vue/src/main.js

@@ -35,62 +35,58 @@ const router = new VueRouter({
 
 
 router.beforeEach((to, from, next) => {
-    if(to.name != '邀请') {
-        if (to.path == '/login') {
-            sessionStorage.removeItem('user');
-        }
-    
-        let user = JSON.parse(sessionStorage.getItem('user'));
-        if (!user && to.path != '/login') {
-            next({ path: '/login' })
-        } else {
-            if(user){
-                for(var i in routes){
-                    if(routes[i].name == "基础管理" && user.parentId != 0){
-                        routes[i].hidden = true
-                    } else if(routes[i].name == "基础管理"){
-                        routes[i].hidden = false
-                    }
-                    
-                    if(routes[i].name == "项目管理" && user.parentId > 1){
-                        var children = routes[i].children;
-                        for(var j in children){
-    
-                            if(children[j].name == "人员管理"){
-                                if(user.isManager == 0){
-                                    children[j].hidden = true
-                                } else {
-                                    children[j].hidden = false
-                                }
-                            }
-    
-                            if(children[j].name == "权限管理"){
-                                if(user.isManager == 0){
-                                    children[j].hidden = true
-                                } else {
-                                    children[j].hidden = false
-                                }
+    if (to.path == '/login') {
+        sessionStorage.removeItem('user');
+    }
+
+    let user = JSON.parse(sessionStorage.getItem('user'));
+    if (!user && to.path != '/login') {
+        next({ path: '/login' })
+    } else {
+        if(user){
+            for(var i in routes){
+                if(routes[i].name == "基础管理" && user.parentId != 0){
+                    routes[i].hidden = true
+                } else if(routes[i].name == "基础管理"){
+                    routes[i].hidden = false
+                }
+                
+                if(routes[i].name == "项目管理" && user.parentId > 1){
+                    var children = routes[i].children;
+                    for(var j in children){
+
+                        if(children[j].name == "人员管理"){
+                            if(user.isManager == 0){
+                                children[j].hidden = true
+                            } else {
+                                children[j].hidden = false
                             }
                         }
-                    } else if(routes[i].name == "项目管理") {
-                        var children = routes[i].children;
-                        for(var j in children){
-                            if(children[j].name != "项目详情"){
+
+                        if(children[j].name == "权限管理"){
+                            if(user.isManager == 0){
+                                children[j].hidden = true
+                            } else {
                                 children[j].hidden = false
                             }
-                            
-                            if(children[j].name == "权限管理"){
-                                if((user.parentId == 0 || user.parentId == 1) && user.isManager == 0){
-                                    children[j].hidden = true
-                                }
+                        }
+                    }
+                } else if(routes[i].name == "项目管理") {
+                    var children = routes[i].children;
+                    for(var j in children){
+                        if(children[j].name != "项目详情"){
+                            children[j].hidden = false
+                        }
+                        
+                        if(children[j].name == "权限管理"){
+                            if((user.parentId == 0 || user.parentId == 1) && user.isManager == 0){
+                                children[j].hidden = true
                             }
                         }
                     }
                 }
             }
-            next()
         }
-    } else {
         next()
     }
 })

+ 0 - 25
lib_vue/src/mock/data/user.js

@@ -1,25 +0,0 @@
-import Mock from 'mockjs';
-const LoginUsers = [
-  {
-    id: 1,
-    username: 'admin',
-    password: '123456',
-    avatar: 'https://raw.githubusercontent.com/taylorchen709/markdown-images/master/vueadmin/user.png',
-    name: '张某某'
-  }
-];
-
-const Users = [];
-
-for (let i = 0; i < 86; i++) {
-  Users.push(Mock.mock({
-    id: Mock.Random.guid(),
-    name: Mock.Random.cname(),
-    addr: Mock.mock('@county(true)'),
-    'age|18-60': 1,
-    birth: Mock.Random.date(),
-    sex: Mock.Random.integer(0, 1)
-  }));
-}
-
-export { LoginUsers, Users };

+ 0 - 3
lib_vue/src/mock/index.js

@@ -1,3 +0,0 @@
-import mock from './mock';
-
-export default mock;

+ 0 - 153
lib_vue/src/mock/mock.js

@@ -1,153 +0,0 @@
-import axios from 'axios';
-import MockAdapter from 'axios-mock-adapter';
-import { LoginUsers, Users } from './data/user';
-let _Users = Users;
-
-export default {
-  /**
-   * mock bootstrap
-   */
-    bootstrap() {
-        let mock = new MockAdapter(axios);
-
-        // mock success request
-        mock.onGet('/success').reply(200, {
-            msg: 'success'
-        });
-
-        // mock error request
-        mock.onGet('/error').reply(500, {
-            msg: 'failure'
-        });
-
-        //登录
-        mock.onPost('/login').reply(config => {
-            let {username, password} = JSON.parse(config.data);
-            return new Promise((resolve, reject) => {
-                let user = null;
-                setTimeout(() => {
-                    let hasUser = LoginUsers.some(u => {
-                        if (u.username === username && u.password === password) {
-                            user = JSON.parse(JSON.stringify(u));
-                            user.password = undefined;
-                            return true;
-                        }
-                    });
-
-                    if (hasUser) {
-                        resolve([200, { code: 200, msg: '请求成功', user }]);
-                    } else {
-                        resolve([200, { code: 500, msg: '账号或密码错误' }]);
-                    }
-                }, 1000);
-            });
-        });
-
-        //获取用户列表
-        mock.onGet('/user/list').reply(config => {
-            let {name} = config.params;
-            let mockUsers = _Users.filter(user => {
-                if (name && user.name.indexOf(name) == -1) return false;
-                return true;
-            });
-            return new Promise((resolve, reject) => {
-                setTimeout(() => {
-                    resolve([200, {
-                        users: mockUsers
-                    }]);
-                }, 1000);
-            });
-        });
-
-        //获取用户列表(分页)
-        mock.onGet('/user/listpage').reply(config => {
-            let {page, name} = config.params;
-            let mockUsers = _Users.filter(user => {
-                if (name && user.name.indexOf(name) == -1) return false;
-                return true;
-            });
-            let total = mockUsers.length;
-            mockUsers = mockUsers.filter((u, index) => index < 20 * page && index >= 20 * (page - 1));
-            return new Promise((resolve, reject) => {
-                setTimeout(() => {
-                    resolve([200, {
-                        total: total,
-                        users: mockUsers
-                    }]);
-                }, 1000);
-            });
-        });
-
-        //删除用户
-        mock.onGet('/user/remove').reply(config => {
-            let { id } = config.params;
-            _Users = _Users.filter(u => u.id !== id);
-            return new Promise((resolve, reject) => {
-                setTimeout(() => {
-                    resolve([200, {
-                        code: 200,
-                        msg: '删除成功'
-                    }]);
-                }, 500);
-            });
-        });
-
-        //批量删除用户
-        mock.onGet('/user/batchremove').reply(config => {
-            let { ids } = config.params;
-            ids = ids.split(',');
-            _Users = _Users.filter(u => !ids.includes(u.id));
-            return new Promise((resolve, reject) => {
-                setTimeout(() => {
-                    resolve([200, {
-                        code: 200,
-                        msg: '删除成功'
-                    }]);
-                }, 500);
-            });
-        });
-
-        //编辑用户
-        mock.onGet('/user/edit').reply(config => {
-            let { id, name, addr, age, birth, sex } = config.params;
-            _Users.some(u => {
-                if (u.id === id) {
-                    u.name = name;
-                    u.addr = addr;
-                    u.age = age;
-                    u.birth = birth;
-                    u.sex = sex;
-                    return true;
-                }
-            });
-            return new Promise((resolve, reject) => {
-                setTimeout(() => {
-                    resolve([200, {
-                        code: 200,
-                        msg: '编辑成功'
-                    }]);
-                }, 500);
-            });
-        });
-
-        //新增用户
-        mock.onGet('/user/add').reply(config => {
-            let { name, addr, age, birth, sex } = config.params;
-            _Users.push({
-                name: name,
-                addr: addr,
-                age: age,
-                birth: birth,
-                sex: sex
-            });
-            return new Promise((resolve, reject) => {
-                setTimeout(() => {
-                    resolve([200, {
-                        code: 200,
-                        msg: '新增成功'
-                    }]);
-                }, 500);
-            });
-        });
-    }
-};

+ 10 - 7
lib_vue/src/port.js

@@ -1,14 +1,17 @@
 export default {
     manage: {
-        login: '/user/login', // 登录
-    },
-    //消息提示相关
-    notice: {
-        list: '/vnoticeuser/list',  // 消息列表
-        read: '/vnoticeuser/read'  // 消息读取
+        login: '/system/login', // 登录
     },
     pwd: {
-        resetPwd: '/user/updatePassword' // 重置密码
+        resetPwd: '/system/updatePwd' // 重置密码
+    },
+    agency: {
+        list: '/institutional/list',
+        detail: '/institutional/detail',
+        add: '/institutional/add',
+        edit: '/institutional/update',
+        updatePic: '/institutional/updatePics',
+        deletePic: '/institutional/delete'
     },
     map: { 
         mapList: '/company/getCoutomCompanyAndMouldsByUser', // 生产方公司和公司下所属的模具

+ 70 - 0
lib_vue/src/routes.js

@@ -22,6 +22,18 @@ import comp from './views/base/comp.vue'
 import factory from './views/base/factory.vue'
 import allocation from './views/base/allocation.vue'
 
+import agency from './views/agency/agencyList.vue'
+import agencyDetail from './views/agency/agencyDetail.vue'
+
+import book from './views/book/bookList.vue'
+import bookDetail from './views/book/bookDetail.vue'
+
+import user from './views/user/user.vue'
+import reserve from './views/user/reserve.vue'
+
+import manage from './views/system/manage.vue'
+import vip from './views/system/vip.vue'
+
 let routes = [
     {
         path: '/login',
@@ -29,6 +41,64 @@ let routes = [
         name: '',
         hidden: true
     },
+    //培训机构
+    {
+        path: '/',
+        component: Home,
+        name: '',
+        iconCls: 'iconfont iconpeixunjigou',
+        leaf: true,//只有一个节点
+        children: [
+            { path: '/agency', component: agency, name: '培训机构' },
+            { path: '/agency/:id', component: agencyDetail, name: '机构详情', hidden: true }
+        ]
+    },
+    //课程管理
+    {
+        path: '/',
+        component: Home,
+        name: '',
+        iconCls: 'iconfont iconkecheng',
+        leaf: true,//只有一个节点
+        children: [
+            { path: '/book', component: book, name: '课程管理' },
+            { path: '/book/:id', component: bookDetail, name: '课程详情', hidden: true }
+        ]
+    },
+    //图书管理
+    {
+        path: '/',
+        component: Home,
+        name: '',
+        iconCls: 'iconfont iconic_local_library_px',
+        leaf: true,//只有一个节点
+        children: [
+            { path: '/book', component: book, name: '图书管理' },
+            { path: '/book/:id', component: bookDetail, name: '图书详情', hidden: true }
+        ]
+    },
+    //用户管理
+    {
+        path: '/',
+        component: Home,
+        name: '用户管理',
+        iconCls: 'iconfont iconyonghu',
+        children: [
+            { path: '/user', component: user, name: '用户列表' },
+            { path: '/reserve', component: reserve, name: '预约用户' }
+        ]
+    },
+    //系统管理
+    {
+        path: '/',
+        component: Home,
+        name: '系统管理',
+        iconCls: 'iconfont iconsetting-fill',
+        children: [
+            { path: '/manage', component: manage, name: '机构管理' },
+            { path: '/vip', component: vip, name: '会员设置' }
+        ]
+    },
     //地图概览
     {
         path: '/',

File diff suppressed because it is too large
+ 345 - 610
lib_vue/src/views/Home.vue


+ 3 - 6
lib_vue/src/views/Login.vue

@@ -4,7 +4,7 @@
             <div class="login-logo">
                 <img src="../assets/image/login_logo.png" style="width:80px;height:80px;"/>
             </div>
-            <h3 class="title">云塑网后台管理系统</h3>
+            <h3 class="title">小海豚后台管理系统</h3>
             <el-form-item class="login-input" prop="account">
                 <el-input type="text" v-model="ruleForm.account" autocomplete="off" placeholder="账号" clearable prefix-icon="el-icon-user-solid"></el-input>
             </el-form-item>
@@ -53,8 +53,8 @@
                         this.http.post(this.port.manage.login, this.ruleForm , res => {
                             this.logining = false;
                             if (res.code == "ok") {
-                                sessionStorage.setItem('user', JSON.stringify(res.data));
-                                this.$router.push({ path: '/map' });
+                                sessionStorage.setItem('user', JSON.stringify(res.data.user));
+                                this.$router.push({ path: '/agency' });
                             } else {
                                 this.$message({
                                     message: res.msg,
@@ -86,16 +86,13 @@
     }
 
     .login-container {
-        /*box-shadow: 0 0px 8px 0 rgba(0, 0, 0, 0.06), 0 1px 0px 0 rgba(0, 0, 0, 0.02);*/
         -webkit-border-radius: 5px;
         border-radius: 5px;
         -moz-border-radius: 5px;
         background-clip: padding-box;
         margin: 180px auto;
-        // width: 350px;
         width: 315px;
         height: 365px;
-        // padding: 35px 35px 15px 35px;
         padding: 25px 35px 25px 35px;
         background: #fff;
         border: 1px solid #eaeaea;

+ 841 - 0
lib_vue/src/views/agency/agencyDetail.vue

@@ -0,0 +1,841 @@
+<template>
+    <section>
+        <!-- 机构信息 -->
+        <el-col :span="24" class="agencyHead">
+            <el-container>
+                <el-container>
+                    <el-aside width="335px;">
+                        <div class="agencyHead_img">
+                            <el-image class="agencyHead_imgbox" src="../../assets/image/userHead.jpg">
+                                <img src="../../assets/image/userHead.jpg">
+                            </el-image>
+                        </div>
+                    </el-aside>
+                    <el-container>
+                        <el-header height="90px;">
+                            {{detail.name}}
+                            <el-button type="text" @click="editDetail(0)" icon="el-icon-edit" class="agencyHead_edit"></el-button>
+                            <el-button type="text" @click="backToList" class="agencyHead_back"><i class="iconfont iconfanhui1"></i></el-button>
+                        </el-header>
+                        <el-footer>{{detail.headIntroduction}}</el-footer>
+                    </el-container>
+                </el-container>
+            </el-container>
+        </el-col>
+        
+        <el-col :span="24" :style="allDetail">
+            <!-- 轮播图 -->
+            <el-col :span="24" class="agencyBody_title">轮播图</el-col>
+            <el-col :span="24" class="agencyBody_main">
+                <!-- <el-upload ref="upload" action="customize" :http-request="uploadFile" list-type="picture-card" :auto-upload="true"> -->
+                <el-upload action="/api/projectfile/uploadFile/" accept="image/*" multiple :limit="5" :data="uploadMsg" list-type="picture-card" 
+                    :on-preview="handlePictureCardPreview" 
+                    :on-remove="handleRemove">
+                    <i slot="default" class="el-icon-plus"></i>
+                    <div slot="file" slot-scope="{file}">
+                        <img class="el-upload-list__item-thumbnail" :src="file.url" alt="">
+                        <span class="el-upload-list__item-actions">
+                            <span class="el-upload-list__item-preview" @click="handlePictureCardPreview(file)">
+                                <i class="el-icon-zoom-in"></i>
+                            </span>
+                            <span v-if="!disabled" class="el-upload-list__item-delete" @click="handleDownload(file)">
+                                <i class="el-icon-download"></i>
+                            </span>
+                            <span v-if="!disabled" class="el-upload-list__item-delete" @click="handleRemove(file)">
+                                <i class="el-icon-delete"></i>
+                            </span>
+                        </span>
+                    </div>
+                </el-upload>
+                <el-dialog :visible.sync="dialogVisible">
+                    <img width="100%" :src="dialogImageUrl" alt="">
+                </el-dialog>
+            </el-col>
+
+            <!-- 基本信息 -->
+            <el-col :span="24" class="agencyBody_title">
+                基本信息
+                <el-button type="text" @click="editDetail(1)" icon="el-icon-edit" class="agencyHead_edit"></el-button>
+            </el-col>
+            <el-col :span="24" class="agencyBody_main">
+                <el-col :span="24" class="agencyBody_detail">
+                    上课时间:
+                    <span class="info" v-if="detail.amTime != null || detail.pmTime != null">{{detail.amTime}} - {{detail.pmTime}}</span>
+                    <span class="info" v-else>暂无</span>
+                </el-col>
+                <el-col :span="24" class="agencyBody_detail">
+                    收费标准:
+                    <span class="info">{{detail.projectNo==null?'暂无':detail.projectNo}}</span>
+                </el-col>
+                <el-col :span="24" class="agencyBody_detail">
+                    机构位置:
+                    <span class="info">{{detail.projectNo==null?'暂无':detail.projectNo}}</span>
+                </el-col>
+                <el-col :span="24" class="agencyBody_detail">
+                    联系电话:
+                    <span class="info">{{detail.projectNo}}</span>
+                </el-col>
+            </el-col>
+
+            <!-- 机构简介 -->
+            <el-col :span="24" class="agencyBody_title">
+                机构简介
+                <el-button type="text" @click="editDetail(2)" icon="el-icon-edit" class="agencyHead_edit"></el-button>
+            </el-col>
+            <el-col :span="24" class="agencyBody_main">
+                <el-col :span="24" class="agencyBody_detail">
+                    <span class="info">{{detail.briefIntroduction==null?'暂无':detail.briefIntroduction}}</span>
+                </el-col>
+            </el-col>
+
+            <!-- 课程特色 -->
+            <el-col :span="24" class="agencyBody_title">
+                课程特色
+                <el-button type="text" @click="editDetail(3)" icon="el-icon-edit" class="agencyHead_edit"></el-button>
+            </el-col>
+            <el-col :span="24" class="agencyBody_main">
+                <el-col :span="24" class="agencyBody_detail">
+                    <span class="info">{{detail.classAdvantages==null?'暂无':detail.classAdvantages}}</span>
+                </el-col>
+            </el-col>
+        </el-col>
+
+        <!--编辑界面-->
+		<el-dialog title="编辑培训机构" v-if="editFormVisible" :visible.sync="editFormVisible" :close-on-click-modal="false" customClass='customWidth'>
+			<el-form :model="editForm" label-width="120px" :rules="formRules" ref="editForm">
+                <el-col :span="24">
+                    <el-form-item label="机构名称" prop="projectName">
+                        <el-input v-model="editForm.projectName" autocomplete="off" placeholder="请输入项目名称" style="width:510px"></el-input>
+                    </el-form-item>
+                </el-col>
+                <el-col :span="24">
+                    <el-form-item label="机构简介">
+                        <el-input type="textarea" :rows="5" placeholder="请输入机构简介" v-model="editForm.modelIds"></el-input>
+                    </el-form-item>
+                </el-col>
+                <el-col :span="24">
+                    <el-form-item label="机构图片">
+                        <el-upload class="avatar-uploader" accept="image/*" :limit="1" action="action" :on-success="handleAvatarSuccess" :before-upload="beforeAvatarUpload">
+                            <i slot="default" class="el-icon-plus"></i>
+                        </el-upload>
+                        <el-dialog :visible.sync="dialogVisible">
+                            <img width="100%" :src="dialogImageUrl" alt="">
+                        </el-dialog>
+                    </el-form-item>
+                </el-col>
+			</el-form>
+			<div slot="footer" class="dialog-footer">
+				<el-button @click.native="editFormVisible = false">取消</el-button>
+				<el-button type="primary" @click.native="addSubmit" :loading="editLoading">提交</el-button>
+			</div>
+		</el-dialog>
+    </section>
+</template>
+
+<script>
+    import util from "../../common/js/util";
+
+    export default {
+        data() {
+            return {
+                //基础信息
+                detailId: this.$route.params.id,
+                user: JSON.parse(sessionStorage.getItem('user')),
+                detail: {},
+
+
+                dialogImageUrl: '',
+                dialogVisible: false,
+                disabled: false,
+
+                uploadMsg: {
+                    "projectId": this.$route.params.id,
+                    "token": JSON.parse(sessionStorage.getItem('user')).headImgurl
+                },
+                
+                //临时数据
+                proDetail: {},
+                files: [],
+                opers: [],
+
+                allDetail: {
+                    overflow: 'auto',
+                    padding: '0px 5px',
+                    height: 0
+                },
+
+                listLoading: false,
+                modelsLoading: false,
+                upLoading: false,
+                oplistLoading: false,
+                activePage: 0,
+
+                update: 0,
+                download: 0,
+                view: 0,
+                approve: 0,
+
+                company: [],
+
+                staffComp: [],
+                allUser: [],
+                assets: [],
+                produce: [],
+                charger: [],
+                general: [],
+
+                formRules: {
+					projectName: [
+						{ required: true, message: '请输入项目名称', trigger: 'blur' }
+                    ],
+                    customerCompany: [
+                        { required: true, message: '请选择客户公司', trigger: 'blur' }
+                    ],
+                    modelIds: [
+                        { required: true, message: '请选择项目模具', trigger: ['blur','change'] }
+                    ],
+                    managerId: [
+                        { required: true, message: '请选择项目经理', trigger: ['blur','change'] }
+                    ],
+                    ownerApproverId: [
+                        { required: true, message: '请选择资产方审批人', trigger: ['blur','change'] }
+                    ],
+                    customerApproverId: [
+                        { required: true, message: '请选择生产方审批人', trigger: ['blur','change'] }
+                    ],
+                    // 新建人员
+                    username: [
+						{ required: true, message: '请输入姓名', trigger: 'blur' }
+                    ],
+                    teamName: [
+						{ required: true, message: '请选择人员类型', trigger: ["blur",'change'] }
+					],
+                    companyId: [
+						{ required: true, message: '请选择所属公司', trigger: ["blur",'change'] }
+					],
+                },
+                
+                editFormVisible: false,//编辑界面是否显示
+				editLoading: false,
+				//编辑界面数据
+				editForm: {
+					projectName: '',
+                    customerCompany: [],
+                    managerId: '',
+                    ownerApproverId: '',
+                    customerApproverId: '',
+                    modelIds: [],
+                    users: []
+                },
+                editType: 0,
+            };
+        },
+        methods: {
+            //返回
+            backToList() {
+                this.$router.go(-1);
+            },
+
+            //获取详情
+            getDetail() {
+                this.modelsLoading = true;
+                this.http.post(this.port.agency.detail, {
+                    id: this.detailId
+                }, res => {
+                    this.modelsLoading = false;
+                    if (res.code == "ok") {
+                        this.detail = res.data;
+                    } else {
+                        this.$message({
+                            message: res.msg,
+                            type: 'error'
+                        });
+                    }
+                }, error => {
+                    this.modelsLoading = false;
+                    this.$message({
+                        message: error,
+                        type: 'error'
+                    });
+                })
+            },
+
+            getFileList() {
+                this.listLoading = true;
+                // 获取文档列表
+                this.http.post(this.port.project.fileList, {
+                    projectId: this.detailId
+                }, res => {
+                    this.listLoading = false;
+                    if (res.code == "ok") {
+                        this.files = res.data;
+                    } else {
+                        this.$message({
+                            message: res.msg,
+                            type: 'error'
+                        });
+                    }
+                }, error => {
+                    this.listLoading = false;
+                    this.$message({
+                        message: error,
+                        type: 'error'
+                    });
+                })
+            },
+
+            getOperList() {
+                this.oplistLoading = true;
+                // 获取文档列表
+                this.http.post(this.port.project.operList, {
+                    projectId: this.detailId
+                }, res => {
+                    this.oplistLoading = false;
+                    if (res.code == "ok") {
+                        this.opers = res.data;
+                    } else {
+                        this.$message({
+                            message: res.msg,
+                            type: 'error'
+                        });
+                    }
+                }, error => {
+                    this.oplistLoading = false;
+                    this.$message({
+                        message: error,
+                        type: 'error'
+                    });
+                })
+            },
+
+            //获取信息
+            getMsg() {
+                // 获取公司
+                this.http.post(this.port.base.addCompanyListToProject, {
+                    parentId: this.user.parentId,
+                    id: this.user.id
+                }, res => {
+                    if (res.code == "ok") {
+                        var list = res.data , array = [];
+                        for(var i in list){
+                            if(list[i].id != this.proDetail.ownerCompany){
+                                array.push(list[i])
+                            }
+                        }
+                        this.company = array;
+                    } else {
+                        this.$message({
+                            message: res.msg,
+                            type: 'error'
+                        });
+                    }
+                }, error => {
+                    this.$message({
+                        message: error,
+                        type: 'error'
+                    });
+                })
+
+                // 获取模具
+                this.http.post(this.port.mold.chooseModelList, {
+                    projectId: this.detailId
+                }, res => {
+                    if (res.code == "ok") {
+                        this.molds = res.data;
+                    } else {
+                        this.$message({
+                            message: res.msg,
+                            type: 'error'
+                        });
+                    }
+                }, error => {
+                    this.$message({
+                        message: error,
+                        type: 'error'
+                    });
+                })
+
+                this.http.post(this.port.base.getProduceCompany, {
+                    projectId: this.detailId
+                }, res => {
+                    if (res.code == "ok") {
+                        this.staffComp = res.data;
+                    } else {
+                        this.$message({
+                            message: res.msg,
+                            type: 'error'
+                        });
+                    }
+                }, error => {
+                    this.$message({
+                        message: error,
+                        type: 'error'
+                    });
+                })
+            },
+
+            doSomething(e){
+                e.stopPropagation();
+            },
+
+            //切换人员
+            changeStaff(i) {
+                if(i == 0){
+                    var list = this.allUser , array = [];
+                    for(var i in list){ 
+                        if(list[i].id != this.editForm.customerApproverId && list[i].id != this.editForm.managerId.id && list[i].id != this.editForm.ownerApproverId){
+                            array.push(list[i])
+                        }
+                    }
+                    
+                    this.general = array;
+                } else if(i == 1) {
+                    var list = this.allUser , str = this.editForm.users.toString() , array = [] , assets = [] , produce = [];
+                    for(var i in list) {
+                        if(str.indexOf(list[i].id) == -1) {
+                            array.push(list[i]);
+                        }
+                    }
+
+                    for(var i in list) {
+                        if(str.indexOf(list[i].id) == -1) {
+                            if(list[i].subordinateType == 0){
+                                assets.push(list[i])
+                            } else {
+                                produce.push(list[i])
+                            }
+                        }
+                    }
+
+                    this.charger = array;
+                    this.assets = assets;
+                    this.produce = produce;
+                }
+            },
+
+            //选择公司切换人员
+            companyChange() {
+                var param = {} ,
+                    str = this.proDetail.ownerCompany;
+                for(var i in this.editForm.modelIds){
+                    str += "," + this.editForm.modelIds[i].produceCompanyId;
+                }
+                param.companyIds = str;
+                param.id = this.user.id;
+                param.projectId = this.detailId;
+                this.http.post(this.port.project.getUserById, param , res => {
+                    if (res.code == "ok") {
+                        var list = res.data , assets = [] , produce = [];
+                        var allUserId = [];
+                        for(var i in list) {
+                            allUserId.push(list[i].id); 
+                            if(list[i].companyId == this.proDetail.ownerCompany){
+                                if(list[i].id != this.user.id){
+                                    if(list[i].id != this.proDetail.managerId){
+                                        assets.push(list[i])
+                                    }
+                                }
+                            } else {
+                                produce.push(list[i])
+                            }
+                        }
+
+                        var manager = allUserId.indexOf(this.editForm.managerId.id),
+                            customerApprover = allUserId.indexOf(this.editForm.customerApproverId),
+                            array = res.data , newAssets = [] , newProduce = [],newCharger = [];
+
+                        this.allUser = res.data;
+
+                        if(manager == -1) {
+                            this.editForm.managerId = "";
+                            this.charger = res.data;
+                        } else {
+                            for(var i in list) {
+                                newCharger.push(list[i]);
+                            }
+                            this.charger = newCharger;
+                        }
+
+                        if(customerApprover == -1) {
+                            this.editForm.customerApproverId = "";
+                        } else {
+                            for(var i in list) {
+                                if(str.indexOf(list[i].id) == -1) {
+                                    if(list[i].subordinateType == 0){
+                                        newAssets.push(list[i])
+                                    } else {
+                                        newProduce.push(list[i])
+                                    }
+                                }
+                            }
+                            this.assets = newAssets;
+                            this.produce = newAssets;
+                        }
+
+                        var oldUsers = [] , backUsers = this.proDetail.participateUsers;
+                        for(var i in backUsers) {
+                            oldUsers.push(backUsers[i]);
+                        }
+                        for(var i in oldUsers) {
+                            var num = allUserId.indexOf(oldUsers[i].id);
+                            if(num == -1) {
+                                oldUsers.splice(num - 1, 1);
+                            } else {
+                                for(var j in list){
+                                    if(oldUsers[i].id == list[j].id) {
+                                        if(list[j].id == this.editForm.customerApproverId || list[j].id == this.editForm.managerId.id || list[j].id == this.editForm.ownerApproverId){
+                                            array.splice(j,1)
+                                        }
+                                    }
+                                }
+                            }
+                        }
+                        var editUser = [];
+                        for(var i in oldUsers) {
+                            for(var j in this.editForm.users) {
+                                if(this.editForm.users[j] == oldUsers[i].id) {
+                                    editUser.push(oldUsers[i].id)
+                                }
+                            }
+                        }
+                        this.editForm.users = editUser;
+                        this.general = array;
+                        this.setMember();
+                    } else {
+                        this.$message({
+                            message: res.msg,
+                            type: 'error'
+                        });
+                    }
+                }, error => {
+                    this.$message({
+                        message: error,
+                        type: 'error'
+                    });
+                })
+            },
+
+            //打开编辑页面
+            edit() {
+            },
+
+            //提交
+            addSubmit() {
+                this.$refs.editForm.validate((valid) => {
+					if (valid) {
+                        var cId = "",
+                            cName = "",
+                            modelIds = "",
+                            userIds = "";
+                        for(var i in this.editForm.modelIds){
+                            if(cId.indexOf(this.editForm.modelIds[i].produceCompanyId) == -1){
+                                cId += this.editForm.modelIds[i].produceCompanyId + ",";
+                                cName += this.editForm.modelIds[i].produceCompanyName + ",";
+                            }
+                            modelIds += this.editForm.modelIds[i].id + ","
+                        }
+                        cId = cId.substring(0,cId.length-1);
+                        cName = cName.substring(0,cName.length-1);
+                        modelIds = modelIds.substring(0,modelIds.length-1);
+
+                        for(var i in this.editForm.users) {
+                            if(i == this.editForm.users.length -1){
+                                userIds += this.editForm.users[i]
+                            } else {
+                                userIds += this.editForm.users[i] + ","
+                            }
+                        }
+
+                        this.editLoading = true;
+                        this.http.post(this.port.project.addProject, {
+                            id: this.editForm.id,
+                            projectName: this.editForm.projectName,
+                            customerCompanyIds: cId,
+                            customerCompanyNames: cName,
+                            manager: this.editForm.managerId.username,
+                            managerId: this.editForm.managerId.id,
+                            ownerApproverId: this.editForm.ownerApproverId,
+                            customerApproverId: this.editForm.customerApproverId,
+                            modelIds: modelIds,
+                            userIds: userIds,
+                            flag: 1
+                        } , res => {
+                            this.editLoading = false;
+                            this.editFormVisible = false;
+                            if (res.code == "ok") {
+                                this.$message({
+                                    message: '修改成功',
+                                    type: 'success'
+                                });
+                                this.getDetail();
+                            } else {
+                                this.$message({
+                                    message: res.msg,
+                                    type: 'error'
+                                });
+                            }
+                        }, error => {
+                            this.editLoading = false;
+                            this.editFormVisible = false;
+                            this.$message({
+                                message: error,
+                                type: 'error'
+                            });
+                        })
+					}
+				});
+            },
+
+            //上传
+            uploadFile(params) {
+                this.upLoading = true;
+                var fileObj = params.file;
+                var form = new FormData();
+                form.append("projectId", this.proDetail.id);
+                form.append("file", fileObj);
+                this.http.uploadFile(this.port.project.uploadFile, form , res => {
+                    this.upLoading = false;
+                    this.$refs.upload.clearFiles();
+                    if (res.code == "ok") {
+                        this.$message({
+                            message: '上传成功',
+                            type: 'success'
+                        });
+                        this.getFileList();
+                        this.getOperList();
+                    } else {
+                        this.$message({
+                            message: res.msg,
+                            type: 'error'
+                        });
+                    }
+                }, error => {
+                    this.upLoading = false;
+                    this.$refs.upload.clearFiles();
+                    this.$message({
+                        message: error,
+                        type: 'error'
+                    });
+                })
+            },
+
+            //删除上传文件
+			fileDel(id) {
+                this.$confirm('确认删除该文档吗?', '提示', {
+					type: 'warning'
+				}).then(() => {
+                    this.http.post(this.port.project.delFile, {
+                        id: id
+                    }, res => {
+                        if (res.code == "ok") {
+                            this.$message({
+                                message: '删除成功',
+                                type: 'success'
+                            });
+                            this.getFileList();
+                            this.getOperList();
+                        } else {
+                            this.$message({
+                                message: res.msg,
+                                type: 'error'
+                            });
+                        }
+                    }, error => {
+                        this.$message({
+                            message: error,
+                            type: 'error'
+                        });
+                    })
+				});
+            },
+
+            // 在线预览
+            viewFile(row) {
+                this.http.post(this.port.file.view, {
+                    fileId: row.id,
+                    type: 1
+                }, res => {
+                    if (res.code == "ok") {
+                        this.openWin(res.data);
+                    } else {
+                        this.$message({
+                            message: res.msg,
+                            type: 'error'
+                        });
+                    }
+                }, error => {
+                    this.$message({
+                        message: error,
+                        type: 'error'
+                    });
+                })
+            },
+
+            openWin(url) {
+                var el = document.createElement("a");
+                document.body.appendChild(el);
+                el.href = encodeURI(url); 
+                el.target = '_blank'; 
+                el.click();
+                document.body.removeChild(el);
+            },
+
+            handleRemove(file) {
+                console.log(file);
+            },
+
+            handlePictureCardPreview(file) {
+                this.dialogImageUrl = file.url;
+                this.dialogVisible = true;
+            },
+
+            handleDownload(file) {
+                console.log(file);
+            },
+
+            editDetail(type) {
+                this.editType = type;
+                this.editFormVisible = true;
+            }
+        },
+
+        created() {
+            let height = window.innerHeight;
+            this.allDetail.height = height - 140 + "px";
+            const that = this;
+            window.onresize = function temp() {
+                that.allDetail.height = window.innerHeight - 160;    
+            };
+        },
+
+        mounted() {
+            this.getDetail();
+            this.getFileList();
+            this.getOperList();
+        }
+    };
+</script>
+
+<style scoped lang="scss">
+    .container .main .content-container {
+        overflow: auto!important;
+    }
+
+    a {
+        text-decoration:none;
+        color: #333;
+    }
+
+    .el-header {
+        font-size: 18px;
+        font-weight: 600;
+        color: #333;
+        line-height: 40px;
+    }
+
+    .el-footer {
+        font-size: 16px;
+        color: #333;
+        line-height: 30px;
+    }
+
+    .el-container.is-vertical {
+        overflow: hidden;
+    }
+
+    .agencyHead {
+        margin: 20px 0 0 0;
+        padding: 0 20px;
+    }
+
+    .agencyHead_img {
+        width:335px;
+        height:160px;
+        overflow:hidden;
+        .agencyHead_imgbox {
+            width:335px;
+            height:160px;
+        }
+    }
+
+    .agencyHead_edit {
+        font-size:16px;
+        margin: 0 0 0 15px;
+        padding: 0;
+    }
+    
+    .agencyHead_back {
+        float: right;
+        margin: 0;
+        position: relative;
+        .iconfont {
+            font-size: 25px;
+            position: absolute;
+            right: -10px;
+            top: 0px;
+        }
+    }
+
+    .allDetail {
+        overflow-y: auto;
+    }
+
+    .agencyBody_title {
+        padding-left: 10px;
+        padding-bottom: 0px;
+        margin: 20px 0;
+        font-size: 16px;
+        line-height: 20px;
+        border-left: 1px #20a0ff solid;
+        position: relative;
+    }
+    
+    .agencyBody_main {
+        padding-left: 40px;
+    }
+
+    .agencyBody_detail {
+        margin-bottom: 20px;
+    }
+
+    .toolbar .el-form-item {
+        font-size: 14px;
+        vertical-align: middle;
+    }
+
+    .divLine {
+        width: 2px;
+        background: #c3c3c3;
+        height: 100%;
+    }
+
+    .projectTitle {
+        font-size: 18px;
+        color: #333;
+    }
+
+    .upload-demo {
+        position: absolute;
+        right: 0;
+        top: -5px;
+    }
+
+    .editDetail {
+        margin-left: 10px;
+        color:#20a0ff;
+        cursor: pointer;
+    }
+
+    .info {
+        color: grey;
+    }
+
+    .model {
+        cursor: pointer;
+        color:#20a0ff;
+    }
+
+    .el-collapse {
+        border: none;
+    }
+</style>

+ 360 - 0
lib_vue/src/views/agency/agencyList.vue

@@ -0,0 +1,360 @@
+<template>
+	<section>
+		<!--工具条-->
+		<el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
+			<el-form :inline="true" :model="filters">
+				<el-form-item>
+					<el-input v-model="filters.keyName" size="small" clearable placeholder="请输入机构名称"></el-input>
+				</el-form-item>
+				<el-form-item>
+					<el-button type="primary" size="small" v-on:click="getList">查询</el-button>
+				</el-form-item>
+				<el-form-item style="float:right;">
+                    <!--  v-if="user.parentId == 1 && user.subordinateType == 0" -->
+					<el-button type="primary" size="small" @click="handleAdd">新增</el-button>
+				</el-form-item>
+			</el-form>
+		</el-col>
+
+		<!--列表-->
+		<el-table :data="list" highlight-current-row v-loading="listLoading" :height="tableHeight" style="width: 100%;">
+			<el-table-column type="index" width="60"></el-table-column>
+			<el-table-column prop="name" label="机构名称" width="300" sortable></el-table-column>
+            <el-table-column prop="phone" label="联系方式" width="200" sortable></el-table-column>
+            <el-table-column prop="address" label="机构位置" sortable></el-table-column>
+			<el-table-column label="操作" width="160" align="center">
+				<template slot-scope="scope">
+                    <el-button type="primary" size="small" @click="toDetail(scope.row.id)">详情</el-button>
+					<el-button type="danger" size="small" @click="toDelete(scope.row.id)">删除</el-button>
+				</template>
+			</el-table-column>
+		</el-table>
+
+		<!--工具条-->
+		<el-col :span="24" class="toolbar">
+			<el-pagination
+                @size-change="handleSizeChange"
+                @current-change="handleCurrentChange"
+                :page-sizes="[20 , 50 , 80 , 100]"
+                :page-size="20"
+                layout="total, sizes, prev, pager, next"
+                :total="total"
+                style="float:right;">
+            </el-pagination>
+		</el-col>
+
+        <!--新增界面-->
+		<el-dialog title="新增培训机构" v-if="addFormVisible" :visible.sync="addFormVisible" :close-on-click-modal="false" customClass='customWidth'>
+            <el-form :model="addForm" label-width="100px" :rules="formRules" ref="addForm">
+				<el-form-item label="机构名称" prop="name">
+					<el-input v-model="addForm.name" autocomplete="off" placeholder="请输入机构名称"></el-input>
+				</el-form-item>
+                <el-form-item label="联系方式" prop="phone">
+					<el-input v-model="addForm.phone" autocomplete="off" placeholder="请输入联系方式"></el-input>
+				</el-form-item>
+                <el-form-item label="机构地址" prop="address">
+					<el-input v-model="addForm.address" autocomplete="off" :change="changeFactoryArea('addContainer')" placeholder="请输入机构地址"></el-input>
+				</el-form-item>
+                <div id="addContainer" class="formMap"></div>
+			</el-form>
+			<div slot="footer" class="dialog-footer">
+				<el-button @click.native="addFormVisible = false">取消</el-button>
+				<el-button type="primary" @click.native="addSubmit" :loading="addLoading">提交</el-button>
+			</div>
+		</el-dialog>
+	</section>
+</template>
+
+<script>
+    import Vue from 'vue';
+    import util from '../../common/js/util'
+    
+	export default {
+		data() {
+			return {
+				filters: {
+					keyName: ''
+                },
+                user: JSON.parse(sessionStorage.getItem('user')),
+                charger: [],
+                molds: [],
+
+				list: [],
+				total: 0,
+                page: 1,
+                size: 20,
+                listLoading: false,
+                tableHeight: 0,
+
+                formRules: {
+					name: [
+						{ required: true, message: '请输入机构名称', trigger: 'blur' }
+                    ]
+                },
+
+                // 地图
+                map: '',
+                marker: '',
+                
+                // 新增界面
+                addFormVisible: false,
+				addLoading: false,
+				addForm: {
+					name: '',
+                    address: '',
+                    phone: '',
+                    yLng: 116.397511,
+                    xLat: 39.907545,
+				}
+
+			}
+		},
+		methods: {
+			//分页
+			handleCurrentChange(val) {
+				this.page = val;
+				this.getList();
+            },
+
+            handleSizeChange(val) {
+                this.size = val;
+				this.getList();
+            },
+            
+			//获取项目列表
+			getList() {
+				this.listLoading = true;
+				this.http.post(this.port.agency.list, {
+                    // keyName: this.filters.keyName,
+                    pageNum: this.page,
+                    pageSize: this.size,
+                }, res => {
+                    this.listLoading = false;
+                    if (res.code == "ok") {
+                        this.list = res.data.list;
+                        this.total = res.data.total;
+                    } else {
+                        this.$message({
+                            message: res.msg,
+                            type: 'error'
+                        });
+                    }
+                }, error => {
+                    this.listLoading = false;
+                    this.$message({
+                        message: error,
+                        type: 'error'
+                    });
+                })
+            },
+
+            //详情
+            toDetail(id) {
+                this.$router.push('/agency/' + id);
+            },
+
+            //删除
+            toDelete(id) {
+                this.$confirm('确认删除该培训机构吗?', '提示', {
+					type: 'warning'
+				}).then(() => {
+                    this.http.post(this.port.agency.delete, {
+                        id: row.id
+                    }, res => {
+                        if (res.code == "ok") {
+                            this.$message({
+                                message: '删除成功',
+                                type: 'success'
+                            });
+                            this.getList();
+                        } else {
+                            this.$message({
+                                message: res.msg,
+                                type: 'error'
+                            });
+                        }
+                    }, error => {
+                        this.$message({
+                            message: error,
+                            type: 'error'
+                        });
+                    })
+				});
+            },
+
+            //显示新增界面
+			handleAdd() {
+				this.addFormVisible = true;
+				this.addForm = {
+					name: '',
+                    address: '',
+                    phone: '',
+                    yLng: 116.397511,
+                    xLat: 39.907545,
+				};
+            },
+
+            //新增
+			addSubmit() {
+				this.$refs.addForm.validate((valid) => {
+					if (valid) {
+                        this.addLoading = true;
+                        this.http.post(this.port.agency.add, {
+                            name: this.addForm.name,
+                            address: this.addForm.address,
+                            lng: this.addForm.address==''?null:this.addForm.yLng,
+                            lat: this.addForm.address==''?null:this.addForm.xLat,
+                        } , res => {
+                            this.addLoading = false;
+                            if (res.code == "ok") {
+                                this.addFormVisible = false;
+                                this.$message({
+                                    message: '创建成功',
+                                    type: 'success'
+                                });
+                                this.getList();
+                            } else {
+                                this.$message({
+                                    message: res.msg,
+                                    type: 'error'
+                                });
+                            }
+                        }, error => {
+                            this.addLoading = false;
+                            this.addFormVisible = false;
+                            this.$message({
+                                message: error,
+                                type: 'error'
+                            });
+                        })
+					}
+				});
+            },
+
+            //地址输入切换
+            changeFactoryArea(mapId) {
+                if(mapId == "addContainer"){
+                    this.markLocation(this.addForm.address, mapId);
+                } else {
+                    this.markLocation(this.editForm.address, mapId);
+                }
+            },
+            
+            //获取地图
+            setMap(mapId) {
+                if(mapId == 'addContainer') {
+                    this.map = new AMap.Map('addContainer', {
+                        resizeEnable: true, // 允许缩放
+                        center:[ this.addForm.yLng , this.addForm.xLat ],
+                        zoom:10
+                    })
+
+                    this.marker = new AMap.Marker({
+                        map: this.map,
+                        position: new AMap.LngLat(this.addForm.yLng , this.addForm.xLat),   // 经纬度
+                    });
+                } else {
+                    this.map = new AMap.Map('editContainer', {
+                        resizeEnable: true, // 允许缩放
+                        center:[this.editForm.yLng , this.editForm.xLat],
+                        zoom:10
+                    })
+
+                    this.marker = new AMap.Marker({
+                        map: this.map,
+                        position: new AMap.LngLat(this.editForm.yLng , this.editForm.xLat),   // 经纬度
+                    });
+                }
+                
+                var _this = this;
+                this.map.on('click', function(e) {
+                    if(_this.map){
+                        _this.map.remove(_this.marker);
+                    }
+                    var Lng = e.lnglat.getLng(),
+                    Lat = e.lnglat.getLat();
+                    if(mapId == 'addContainer') {
+                        _this.addForm.yLng = Lng;
+                        _this.addForm.xLat = Lat;
+                    } else {
+                        _this.editForm.yLng = Lng;
+                        _this.editForm.xLat = Lat;
+                    }
+                    _this.marker = new AMap.Marker({
+                        map: _this.map,
+                        position: new AMap.LngLat(Lng , Lat),   // 经纬度
+                    });
+                });
+            },
+
+            // 获取经纬度
+            markLocation(address,mapId) {
+                var _this = this;
+                AMap.plugin('AMap.Geocoder', function() {
+                    var geocoder = new AMap.Geocoder();            
+                    geocoder.getLocation(address, function(status, result) {
+                        if (status === 'complete' && result.info === 'OK') {
+                            // 经纬度                      
+                            var lng = result.geocodes[0].location.lng;
+                            var lat = result.geocodes[0].location.lat;
+                            
+                            _this.noSub = false;
+                            if(mapId == "addContainer") {
+                                _this.addForm.yLng = lng;
+                                _this.addForm.xLat = lat;
+                            } else {
+                                _this.editForm.yLng = lng;
+                                _this.editForm.xLat = lat;
+                            }
+                            
+                            // 添加标记
+                            if(_this.map){
+                                _this.map.remove(_this.marker);
+                                _this.map.setZoomAndCenter(10, [lng, lat]);
+                                _this.marker = new AMap.Marker({
+                                    map: _this.map,
+                                    position: new AMap.LngLat(lng, lat),   // 经纬度
+                                });
+                            }
+
+                        } else {
+                            //console.log('定位失败!');
+                        }
+                    });
+                });
+            }
+        },
+        created() {
+            let height = window.innerHeight;
+            this.tableHeight = height - 210;
+            const that = this;
+            window.onresize = function temp() {
+                that.tableHeight = window.innerHeight - 210;    
+            };
+        },
+        watch: {
+            addFormVisible(val) {
+                if(val){
+                    var _this = this
+                    setTimeout(function(){ _this.setMap('addContainer'); }, 300);
+                }
+            },
+            editFormVisible(val) {
+                if(val){
+                    var _this = this
+                    setTimeout(function(){ _this.setMap('editContainer'); }, 300);
+                }
+            }
+        },
+		mounted() {
+			this.getList();
+		}
+	}
+
+</script>
+
+<style scoped>
+    .formMap {
+        height: 400px;
+    }
+</style>

File diff suppressed because it is too large
+ 1185 - 0
lib_vue/src/views/book/bookDetail.vue


+ 341 - 0
lib_vue/src/views/book/bookList.vue

@@ -0,0 +1,341 @@
+<template>
+	<section>
+		<!--工具条-->
+		<el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
+			<el-form :inline="true" :model="filters">
+				<el-form-item>
+					<el-input v-model="filters.keyName" size="small" placeholder="请输入机构名称"></el-input>
+				</el-form-item>
+				<el-form-item>
+					<el-button type="primary" size="small" v-on:click="getProject">查询</el-button>
+				</el-form-item>
+				<el-form-item style="float:right;">
+                    <!--  v-if="user.parentId == 1 && user.subordinateType == 0" -->
+					<el-button type="primary" size="small" @click="handleAdd">新增</el-button>
+				</el-form-item>
+			</el-form>
+		</el-col>
+
+		<!--列表-->
+		<el-table :data="list" highlight-current-row v-loading="listLoading" :height="tableHeight" style="width: 100%;">
+			<el-table-column type="index" width="60"></el-table-column>
+			<el-table-column prop="projectName" label="机构名称" width="350" sortable></el-table-column>
+            <el-table-column prop="ownerCompanyName" label="机构位置" sortable></el-table-column>
+			<el-table-column label="操作" width="160" align="center">
+				<template slot-scope="scope">
+                    <el-button type="primary" size="small" @click="toDetail(scope.row)">详情</el-button>
+					<el-button type="danger" size="small" @click="handleDel(scope.$index, scope.row)">删除</el-button>
+				</template>
+			</el-table-column>
+		</el-table>
+
+		<!--工具条-->
+		<el-col :span="24" class="toolbar">
+			<el-pagination
+                @size-change="handleSizeChange"
+                @current-change="handleCurrentChange"
+                :page-sizes="[20 , 50 , 80 , 100]"
+                :page-size="20"
+                layout="total, sizes, prev, pager, next"
+                :total="total"
+                style="float:right;">
+            </el-pagination>
+		</el-col>
+
+        <!--新增界面-->
+		<el-dialog title="新增项目" v-if="addFormVisible" :visible.sync="addFormVisible" :close-on-click-modal="false" customClass='customWidth'>
+			<el-form :model="addForm" label-width="120px" :rules="formRules" ref="addForm">
+                <el-col :span="24">
+                    <el-form-item label="项目名称" prop="projectName">
+                        <el-input v-model="addForm.projectName" autocomplete="off" placeholder="请输入项目名称" style="width:510px"></el-input>
+                    </el-form-item>
+                </el-col>
+                <el-col :span="24">
+                    <el-form-item label="项目模具" prop="mold">
+                        <el-select v-model="addForm.mold" @change="companyChange" clearable filterable multiple placeholder="请选择项目模具" value-key='id' style="width:510px">
+                            <el-option v-for="item in molds" :key="item.id" :label="item.modelName" :value="item">
+                                <span style="float: left">{{ item.modelName }}</span>
+                                <span style="float: right; color: #8492a6; font-size: 6px;margin-right:17px;">{{ item.produceCompany }}</span>
+                            </el-option>
+                        </el-select>
+                    </el-form-item>
+                </el-col>
+                <el-col :span="24">
+                    <el-form-item label="项目经理" prop="managerId">
+                        <el-select v-model="addForm.managerId" clearable filterable placeholder="请选择项目经理" value-key='id' style="width:510px">
+                            <!-- <el-option v-for="item in charger" :key="item.id" :label="item.username" :value="item">
+                            </el-option> -->
+                            <el-option v-for="item in charger" :key="item.id" :label="item.username" :value="item">
+                                <span style="float: left">{{ item.username }}</span>
+                                <span style="float: right; color: #8492a6; font-size: 13px;">{{ item.companyName }}</span>
+                            </el-option>
+                        </el-select>
+                    </el-form-item>
+                </el-col>
+			</el-form>
+			<div slot="footer" class="dialog-footer">
+				<el-button @click.native="addFormVisible = false">取消</el-button>
+				<el-button type="primary" @click.native="addSubmit" :loading="addLoading">提交</el-button>
+			</div>
+		</el-dialog>
+	</section>
+</template>
+
+<script>
+	import util from '../../common/js/util'
+	export default {
+		data() {
+			return {
+				filters: {
+					keyName: ''
+                },
+                user: JSON.parse(sessionStorage.getItem('user')),
+                charger: [],
+                molds: [],
+
+				list: [],
+				total: 0,
+                page: 1,
+                size: 20,
+                listLoading: false,
+                tableHeight: 0,
+
+                formRules: {
+					projectName: [
+						{ required: true, message: '请输入项目名称', trigger: 'blur' }
+                    ],
+                    mold: [
+                        { required: true, message: '请选择项目模具', trigger: ['blur','change'] }
+                    ],
+                    managerId: [
+                        { required: true, message: '请选择项目经理', trigger: ['blur','change'] }
+                    ]
+                },
+                
+                addFormVisible: false, //新增界面是否显示
+				addLoading: false,
+				//新增界面数据
+				addForm: {
+					projectName: '',
+                    mold: [],
+                    managerId: ''
+				}
+
+			}
+		},
+		methods: {
+            //获取基础数据
+            getMsg(){
+                this.http.post(this.port.project.getUserById, {
+                    companyIds: this.user.companyId,
+                    id: this.user.id
+                } , res => {
+                    if (res.code == "ok") {
+                        this.charger = res.data;
+                    } else {
+                        this.$message({
+                            message: res.msg,
+                            type: 'error'
+                        });
+                    }
+                }, error => {
+                    this.$message({
+                        message: error,
+                        type: 'error'
+                    });
+                })
+
+                //获取模具
+                this.getMoulds();
+            },
+
+            //获取模具
+            getMoulds(){
+                this.http.post(this.port.mold.modelList, {
+                    parentId: this.user.parentId,
+                    id: this.user.id
+                }, res => {
+                    if (res.code == "ok") {
+                        this.molds = res.data;
+                    } else {
+                        this.$message({
+                            message: res.msg,
+                            type: 'error'
+                        });
+                    }
+                }, error => {
+                    this.$message({
+                        message: error,
+                        type: 'error'
+                    });
+                })
+            },
+
+			//分页
+			handleCurrentChange(val) {
+				this.page = val;
+				this.getProject();
+            },
+
+            handleSizeChange(val) {
+                this.size = val;
+				this.getProject();
+            },
+            
+			//获取项目列表
+			getProject() {
+				this.listLoading = true;
+				this.http.post(this.port.project.projectList, {
+                    keyName: this.filters.keyName,
+                    pageNum: this.page,
+                    pageSize: this.size,
+                }, res => {
+                    this.listLoading = false;
+                    if (res.code == "ok") {
+                        var list = res.data.list;
+                        for(var i in list){
+                            var customCompaniesStr = "";
+                            for(var j in list[i].customCompanies){
+                                if(j == list[i].customCompanies.length -1){
+                                    customCompaniesStr += list[i].customCompanies[j].companyName;
+                                } else {
+                                    customCompaniesStr += list[i].customCompanies[j].companyName + "、";
+                                }
+                            }
+                            list[i].customCompaniesStr = customCompaniesStr;
+                        }
+                        this.list = list;
+                        this.total = res.data.total;
+                    } else {
+                        this.$message({
+                            message: res.msg,
+                            type: 'error'
+                        });
+                    }
+                }, error => {
+                    this.listLoading = false;
+                    this.$message({
+                        message: error,
+                        type: 'error'
+                    });
+                })
+            },
+
+            //详情
+            toDetail(row) {
+                this.$router.push('/agency/' + row.id);
+            },
+
+            //选择公司切换人员
+            companyChange() {
+                var param = {} ,
+                    str = this.user.companyId;
+                for(var i in this.addForm.mold){
+                    str += "," + this.addForm.mold[i].produceCompanyId;
+                }
+                param.companyIds = str;
+                param.id = this.user.id
+                this.http.post(this.port.project.getUserById, param , res => {
+                    if (res.code == "ok") {
+                        this.charger = res.data;
+                    } else {
+                        this.$message({
+                            message: res.msg,
+                            type: 'error'
+                        });
+                    }
+                }, error => {
+                    this.$message({
+                        message: error,
+                        type: 'error'
+                    });
+                })
+            },
+
+            //显示新增界面
+			handleAdd() {
+                //重新获取一下模具
+                this.getMoulds();
+				this.addFormVisible = true;
+				this.addForm = {
+					projectName: '',
+                    mold: [],
+                    managerId: ''
+				};
+            },
+
+            //新增
+			addSubmit() {
+				this.$refs.addForm.validate((valid) => {
+					if (valid) {
+                        var cId = "",
+                            cName = "",
+                            mId = "";
+
+                        for(var i in this.addForm.mold){
+                            if(cId.indexOf(this.addForm.mold[i].produceCompanyId) == -1){
+                                cId += this.addForm.mold[i].produceCompanyId + ",";
+                                cName += this.addForm.mold[i].produceCompanyName + ",";
+                            }
+                            mId += this.addForm.mold[i].id + ","
+                        }
+
+                        cId = cId.substring(0,cId.length-1);
+                        cName = cName.substring(0,cName.length-1);
+                        mId = mId.substring(0,mId.length-1);
+
+                        this.addLoading = true;
+                        this.http.post(this.port.project.addProject, {
+                            projectName: this.addForm.projectName,
+                            customerCompanyIds: cId,
+                            customerCompanyNames: cName,
+                            manager: this.addForm.managerId.username,
+                            managerId: this.addForm.managerId.id,
+                            modelIds: mId,
+                            flag: 0
+                        } , res => {
+                            this.addLoading = false;
+                            if (res.code == "ok") {
+                                this.addFormVisible = false;
+                                this.$message({
+                                    message: '创建成功',
+                                    type: 'success'
+                                });
+                                this.getProject();
+                            } else {
+                                this.$message({
+                                    message: res.msg,
+                                    type: 'error'
+                                });
+                            }
+                        }, error => {
+                            this.addLoading = false;
+                            this.addFormVisible = false;
+                            this.$message({
+                                message: error,
+                                type: 'error'
+                            });
+                        })
+					}
+				});
+			},
+        },
+        created() {
+            let height = window.innerHeight;
+            this.tableHeight = height - 210;
+            const that = this;
+            window.onresize = function temp() {
+                that.tableHeight = window.innerHeight - 210;    
+            };
+        },
+		mounted() {
+            this.getMsg();
+			this.getProject();
+		}
+	}
+
+</script>
+
+<style scoped>
+
+</style>

+ 639 - 0
lib_vue/src/views/system/allocation.vue

@@ -0,0 +1,639 @@
+<template>
+    <section>
+        <!--工具条-->
+        <el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
+            <el-form :inline="true" :model="filters">
+                <el-col :span="3">
+                    <el-form-item>
+                        <el-select v-model="filters.companyId" clearable filterable placeholder="请选择公司">
+                            <el-option v-for="item in companies" :key="item.id" :label="item.companyName" :value="item.id">
+                            </el-option>
+                        </el-select>
+                    </el-form-item>
+                </el-col>
+                <el-form-item>
+                    <el-input v-model="filters.keyName" placeholder="请输入关键字进行搜索"></el-input>
+                </el-form-item>
+                <el-form-item>
+                    <el-button type="primary" @click="getMoulds">查询</el-button>
+                </el-form-item>
+                <el-form-item style="float: right;">
+                    <a class="download" href="/upload/云模盒批量导入模板.xlsx" download="云模盒批量导入模板.xlsx">
+                        <el-button type="primary">
+                            下载模板
+                        </el-button>
+                    </a>
+                </el-form-item>
+                <el-form-item style="float: right;">
+                    <el-upload ref="upload" action="customize" :show-file-list="false" :http-request="uploadFile" :limit="1">
+                        <el-button type="primary" :loading="uploading">批量导入</el-button>
+                    </el-upload>
+                </el-form-item>
+                <el-form-item style="float: right;">
+                    <el-button type="primary" @click="showAllocation">新建</el-button>
+                </el-form-item>
+                <!-- <el-form-item style="float: right;">
+                    <el-button type="primary" @click="issued">下发</el-button>
+                </el-form-item> -->
+            </el-form>
+        </el-col>
+
+        <!--列表-->
+        <el-table :data="allocations" :height="tableHeight" highlight-current-row v-loading="listLoading" style="width: 100%;">
+            <!-- <el-table-column type="selection" width="50"></el-table-column> -->
+            <el-table-column type="index" width="60"></el-table-column>
+            <el-table-column prop="equipmentNo" label="云模盒编号" width="180" sortable></el-table-column>
+            <el-table-column prop="sim" label="SIM卡号" width="120" sortable></el-table-column>
+            <el-table-column prop="hillNumber" label="电量" width="80" align="center" sortable>
+                <template slot-scope="scope">{{scope.row.hillNumber}}<span v-if="scope.row.hillNumber">%</span></template>
+            </el-table-column>
+            <el-table-column prop="alarmBattery" label="报警电池电量" width="130" align="center" sortable>
+                <template slot-scope="scope">{{scope.row.alarmBattery}}<span v-if="scope.row.alarmBattery">%</span></template>
+            </el-table-column>
+            <el-table-column prop="alarmDegree" label="热报警度数" width="120" align="center" sortable>
+                <template slot-scope="scope">{{scope.row.alarmDegree}}<span v-if="scope.row.alarmDegree">℃</span></template>
+            </el-table-column>
+            <el-table-column prop="useLife" label="使用年限" width="100" align="center" sortable>
+                <template slot-scope="scope">{{scope.row.useLife}}年</template>
+            </el-table-column>
+            <el-table-column prop="diffTime" label="倒计时" width="100" align="center" sortable>
+                <template slot-scope="scope">{{scope.row.diffTime}}</template>
+            </el-table-column>
+            <el-table-column prop="modelName" label="模具名称" width="130" sortable></el-table-column>
+            <el-table-column prop="modelNo" label="模具编号" width="120" align="center" sortable></el-table-column>
+            <el-table-column prop="companyName" label="公司名称" width="180" sortable></el-table-column>
+            <el-table-column prop="agent" label="代理商" width="120" sortable></el-table-column>
+            <el-table-column label="云模盒状态" align="center" width="120" sortable>
+                <template slot-scope="scope">
+                    <span v-if="scope.row.isUse == 0">未启用</span>
+                    <span v-else>已启用</span>
+                </template>
+            </el-table-column>
+            <el-table-column label="操作" align="center" width="160">
+                <template slot-scope="scope">
+                    <el-button size="small" v-if="scope.row.modelNo != null && scope.row.isUse == 0" type="primary" @click="openEnable(scope.$index)">启用</el-button>
+                    <el-button size="small" v-if="scope.row.modelNo != null && scope.row.isUse == 1" type="danger" @click="disableEquipment(scope.$index)">停用</el-button>
+                    <!--  :disabled="scope.row.isUse == 1" -->
+                    <el-button size="small" :style="scope.row.modelNo != null?'':'float:right;margin-right:6px'" @click="showEdit(scope.$index, scope.row, scope.row.isUse == 1)">修改</el-button>
+                </template>
+            </el-table-column>
+        </el-table>
+
+        <!--工具条-->
+        <el-col :span="24" class="toolbar">
+        <el-pagination
+            @size-change="handleSizeChange"
+            @current-change="handleCurrentChange"
+            :page-sizes="[20 , 50 , 80 , 100]"
+            :page-size="20"
+            layout="total, sizes, prev, pager, next"
+            :total="total"
+            style="float:right;"
+        ></el-pagination>
+        </el-col>
+
+        <!--新增界面-->
+        <el-dialog title="新建云模盒" v-if="addFormVisible" :visible.sync="addFormVisible" :close-on-click-modal="false" customClass="customWidth">
+            <el-form :model="newAllocation" label-width="100px" :rules="formRules" ref="newAllocation" :inline="true" class="demo-form-inline">
+                <el-form-item label="云模盒编号" prop="equipmentNo">
+                    <el-input v-model="newAllocation.equipmentNo" autocomplete="off" placeholder="请输入云模盒编号"></el-input>
+                </el-form-item>
+                <el-form-item label="所属公司" prop="belongCompanyId">
+                    <el-select v-model="newAllocation.belongCompanyId" filterable clearable placeholder="请选择所属公司" style="width: 202px">
+                        <el-option v-for="item in companies" :key="item.id" :label="item.companyName" :value="item.id"></el-option>
+                    </el-select>
+                </el-form-item>
+                <el-form-item label="使用年限" prop="useLife">
+                    <el-input v-model.number="newAllocation.useLife" type="age" autocomplete="off" placeholder="请输入使用年限"></el-input>
+                </el-form-item>
+                <el-form-item label="代理商" prop="agent">
+                    <el-input v-model="newAllocation.agent" autocomplete="off" placeholder="请输入代理商" style="width: 202px"></el-input>
+                </el-form-item>
+            </el-form>
+            <div slot="footer" class="dialog-footer">
+                <el-button @click.native="addFormVisible = false">取消</el-button>
+                <el-button type="primary" @click="addMould()">提交</el-button>
+            </div>
+        </el-dialog>
+
+        <!--修改界面-->
+        <el-dialog title="修改云模盒" v-if="editFormVisible" :visible.sync="editFormVisible" :close-on-click-modal="false" customClass="customWidth">
+            <el-form :model="newAllocation" label-width="100px" :rules="formRules" ref="newAllocation" :inline="true" class="demo-form-inline">
+                <el-form-item label="云模盒编号" prop="equipmentNo">
+                    <el-input v-model="newAllocation.equipmentNo" autocomplete="off" placeholder="请输入云模盒编号"></el-input>
+                </el-form-item>
+                <el-form-item label="所属公司" prop="belongCompanyId">
+                    <el-select v-model="newAllocation.belongCompanyId" filterable clearable placeholder="请选择所属公司" style="width: 202px" :disabled="newAllocation.usage">
+                        <el-option v-for="item in companies" :key="item.id" :label="item.companyName" :value="item.id"></el-option>
+                    </el-select>
+                </el-form-item>
+                <el-form-item label="使用年限" prop="useLife">
+                    <el-input v-model.number="newAllocation.useLife" type="age" autocomplete="off" placeholder="请输入使用年限"></el-input>
+                </el-form-item>
+                <el-form-item label="代理商" prop="agent">
+                    <el-input v-model="newAllocation.agent" autocomplete="off" placeholder="请输入代理商" style="width: 202px"></el-input>
+                </el-form-item>
+            </el-form>
+            <div slot="footer" class="dialog-footer">
+                <el-button @click.native="editFormVisible = false">取消</el-button>
+                <el-button type="primary" @click="editMould(newAllocation.id)">提交</el-button>
+            </div>
+        </el-dialog>
+
+        <!-- 启用弹窗 -->
+        <el-dialog title="启用" :visible.sync="operateDialogVisible" width="450px">
+            <!-- <el-form label-width="100px" :rules="formRules" :inline="true" class="demo-form-inline">
+                <el-form-item label="某个参数">
+                    <el-input autocomplete="off" placeholder="填了也不会发生什么"></el-input>
+                </el-form-item>
+            </el-form>
+            <span slot="footer" class="dialog-footer">
+                <el-button @click="operateDialogVisible = false">取消</el-button>
+                <el-button type="primary" @click="enable">启用</el-button>
+            </span> -->
+            <el-form :model="issuedVal" label-width="130px" :rules="formRules" ref="issuedVal" :inline="true" class="demo-form-inline">
+                <el-form-item label="报警电池电量" prop="alarmBattery">
+                    <el-input v-model.number="issuedVal.alarmBattery" type="age" autocomplete="off" placeholder="请输入报警电池电量" style="width:250px;"></el-input>
+                    %
+                </el-form-item>
+                <el-form-item label="热报警度数" prop="alarmDegree">
+                    <el-input v-model.number="issuedVal.alarmDegree" type="age" autocomplete="off" placeholder="请输入热报警度数" style="width:250px;"></el-input>
+                    ℃
+                </el-form-item>
+            </el-form>
+            <span slot="footer" class="dialog-footer">
+                <el-button @click="operateDialogVisible = false">取消</el-button>
+                <el-button type="primary" @click="enable">启用</el-button>
+            </span>
+        </el-dialog>
+
+        <!-- 下发弹窗 -->
+        <el-dialog title="下发" :visible.sync="issuedVisible" width="450px">
+            <el-form :model="issuedVal" label-width="130px" :rules="formRules" ref="issuedVal" :inline="true" class="demo-form-inline">
+                <el-form-item label="报警电池电量" prop="alarmBattery">
+                    <el-input v-model.number="issuedVal.alarmBattery" type="age" autocomplete="off" placeholder="请输入报警电池电量" style="width:250px;"></el-input>
+                    %
+                </el-form-item>
+                <el-form-item label="热报警度数" prop="alarmDegree">
+                    <el-input v-model.number="issuedVal.alarmDegree" type="age" autocomplete="off" placeholder="请输入热报警度数" style="width:250px;"></el-input>
+                    ℃
+                </el-form-item>
+            </el-form>
+            <span slot="footer" class="dialog-footer">
+                <el-button @click="issuedVisible = false">取消</el-button>
+                <el-button type="primary" @click="saveIssued">下发</el-button>
+            </span>
+        </el-dialog>
+    </section>
+</template>
+
+<script>
+    import util from "../../common/js/util";
+    export default {
+        data() {
+            return {
+                allocations: [],
+                companies: {},
+                newAllocation: {
+                    equipmentNo: "", //设备编号
+                    useLife: "", //使用年限
+                    equipmentName: "", //设备名称
+                    id: "", //设备id
+                    belongCompanyId: "", //所属公司ID
+                    agent: "", //代理商
+                    usage: true //是否可以修改公司
+                },
+                filters: {
+                    keyName: "",
+                    companyId: ""
+                },
+                formRules: {
+                    equipmentNo: [
+                        { required: true, message: "请输入云模盒编号", trigger: "blur" }
+                    ],
+                    useLife: [
+                        { required: true, message: '请输入使用年限'},
+                        { type: 'number', message: '使用年限必须为数字值'}
+                    ],
+                    belongCompanyId: [
+                        { required: true, message: "请选择所属公司", trigger: ["blur", "change"] }
+                    ],
+                    agent: [
+                        { required: true, message: "请输入代理商", trigger: "blur" }
+                    ],
+                    alarmBattery: [
+                        { required: true, message: '请输入报警电池电量'},
+                        { type: 'number', message: '报警电池电量必须为数字值'}
+                    ],
+                    alarmDegree: [
+                        { required: true, message: '请输入热报警度数'},
+                        { type: 'number', message: '热报警度数必须为数字值'}
+                    ],
+                },
+
+                listLoading: false,
+                addLoading: false,
+                editLoading: false,
+                uploading: false,
+
+                total: 0,
+                page: 1,
+                size: 20,
+                tableHeight: 0,
+
+                addFormVisible: false,
+                editFormVisible: false,
+                operateDialogVisible: false,
+                activeIndex: 0,
+
+                issuedVal: {
+                    alarmBattery: 30,
+                    alarmDegree: 80,
+                },
+                issuedVisible: false,
+                multipleSelection: [],
+            };
+        },
+        methods: {
+            getMsg() {
+                //获取公司下拉列表
+                this.http.post( this.port.base.getCompanys, {},
+                res => {
+                    if (res.code == "ok") {
+                        this.companies = res.data;
+                    } else {
+                        this.$message({
+                            message: res.msg,
+                            type: "error"
+                        });
+                    }
+                },
+                error => {
+                    this.$message({
+                        message: error,
+                        type: "error"
+                    });
+                });
+            },
+
+            //分页
+            handleCurrentChange(val) {
+                this.page = val;
+                this.getMoulds();
+            },
+
+            handleSizeChange(val) {
+                this.size = val;
+                this.getMoulds();
+            },
+
+            //读取云模盒信息
+            getMoulds() {
+                this.listLoading = true;
+                this.http.post(this.port.base.mouldeList,{
+                    pageNum: this.page,
+                    pageSize: this.size,
+                    keyName: this.filters.keyName,
+                    companyId: this.filters.companyId
+                },
+                res => {
+                    this.listLoading = false;
+                    if (res.code == "ok") {
+                        var list = res.data.list
+                        for(var i in list){
+                            if(list[i].endTime == null){
+                                list[i].diffTime = "";
+                            } else {
+                                list[i].diffTime = util.formatDate.dateDiff(
+                                    //util.formatDate.format(new Date(list[i].endTime), 'yyyy-MM-dd'), 
+                                    list[i].endTime,
+                                    util.formatDate.format(new Date(new Date()), 'yyyy-MM-dd')
+                                );
+                            }
+                        }
+                        this.allocations = list;
+                        this.total = res.data.total;
+                    } else {
+                        this.$message({
+                        message: res.msg,
+                        type: "error"
+                        });
+                    }
+                },
+                error => {
+                    this.listLoading = false;
+                    this.$message({
+                        message: error,
+                        type: "error"
+                    });
+                });
+            },
+
+            //添加界面
+            showAllocation() {
+                this.addFormVisible = true;
+                this.newAllocation = {
+                    id: "",
+                    useLife: "",
+                    equipmentNo: "",
+                    belongCompanyId: "",
+                    agent: ""
+                };
+            },
+           
+            //添加模具
+            addMould() {
+                this.$refs.newAllocation.validate(valid => {
+                    if (valid) {
+                    this.addLoading = true;
+                    this.http.post(
+                        this.port.base.editMould,
+                        {
+                            equipmentNo: this.newAllocation.equipmentNo,
+                            belongCompanyId: this.newAllocation.belongCompanyId,
+                            useLife: this.newAllocation.useLife,
+                            agent: this.newAllocation.agent
+                        },
+                        res => {
+                            this.addLoading = false;
+                            if (res.code == "ok") {
+                                this.addFormVisible = false;
+                                this.$message({
+                                    message: "添加成功",
+                                    type: "success"
+                                });
+                                this.getMoulds();
+                            } else {
+                                this.$message({
+                                    message: res.msg,
+                                    type: "error"
+                                });
+                            }
+                        },
+                        error => {
+                            this.addLoading = false;
+                            this.addFormVisible = false;
+                            this.$message({
+                                message: error,
+                                type: "error"
+                            });
+                        }
+                    );
+                    }
+                });
+            },
+
+             //修改界面
+            showEdit(index, row, usageBoolean) {
+                this.editFormVisible = true;
+                this.newAllocation = {
+                    id: row.id,
+                    useLife: row.useLife,
+                    equipmentNo: row.equipmentNo,
+                    belongCompanyId: row.belongCompanyId,
+                    agent: row.agent,
+                    usage: usageBoolean
+                };
+            },
+
+            //编辑模具
+            editMould() {
+                this.$refs.newAllocation.validate(valid => {
+                    if (valid) {
+                        this.editLoading = true;
+                        this.http.post( this.port.base.editMould, {
+                            id: this.newAllocation.id,
+                            equipmentNo: this.newAllocation.equipmentNo,
+                            equipmentName: this.newAllocation.equipmentName,
+                            belongCompanyId: this.newAllocation.belongCompanyId,
+                            useLife: this.newAllocation.useLife,
+                            agent: this.newAllocation.agent
+                        },
+                        res => {
+                            this.editLoading = false;
+                            if (res.code == "ok") {
+                                this.editFormVisible = false;
+                                this.$message({
+                                    message: "修改成功",
+                                    type: "success"
+                                });
+                                this.getMoulds();
+                            } else {
+                                this.$message({
+                                    message: res.msg,
+                                    type: "error"
+                                });
+                            }
+                        },
+                        error => {
+                            this.editLoading = false;
+                            this.editFormVisible = false;
+                            this.$message({
+                                message: error,
+                                type: "error"
+                            });
+                        });
+                    }
+                });
+            },
+
+            //打开启用窗口
+            openEnable(index) {
+                this.operateDialogVisible = true;
+                this.issuedVal.alarmBattery = this.allocations[this.activeIndex].alarmBattery;
+                this.issuedVal.alarmDegree = parseInt(this.allocations[this.activeIndex].alarmDegree);
+                this.activeIndex = index;
+            },
+
+            //启用设备
+            enable() {
+                // if(this.allocations[this.activeIndex].belongCompanyId == null){
+                //     this.$message({
+                //         message: "输入所属公司后才能启用模具",
+                //         type: "error"
+                //     });
+                // }else{
+                this.allocations[this.activeIndex].isUse = 1;
+                this.operateDialogVisible = false;
+                // this.http.post( this.port.base.enableMould, {
+                //     id: this.allocations[this.activeIndex].id,
+                //     isUse: 1
+                // },
+                var str = this.allocations[this.activeIndex].equipmentNo;
+                this.http.post( this.port.base.setPacket, {
+                    lowPowerLimit: this.issuedVal.alarmBattery,//.toString(16),
+                    hotAlarmLimit: this.issuedVal.alarmDegree,//.toString(16),
+                    isUse: 1,
+                    equipmentNo: str
+                },
+                res => {
+                    if (res.code == "ok") {
+                        this.$message({
+                            message: "设备已启用",
+                            type: "success"
+                        });
+                        this.getMoulds();
+                    } else {
+                        this.$message({
+                            message: res.msg,
+                            type: "error"
+                        });
+                    }
+                },
+                error => {
+                    this.$message({
+                        message: error,
+                        type: "error"
+                    });
+                });
+            },
+
+            //停用云模盒
+            disableEquipment(index) {
+                // if(this.allocations[index].belongCompanyId == null){
+                //     this.$message({
+                //         message: "输入所属公司后才能启用模具",
+                //         type: "error"
+                //     });
+                // }else{
+                this.allocations[index].isUse = 0;
+                // this.http.post( this.port.base.enableMould, {
+                //     id: this.allocations[index].id,
+                //     isUse: 0
+                // },
+                var str = this.allocations[this.activeIndex].equipmentNo;
+                this.http.post( this.port.base.setPacket, {
+                    lowPowerLimit: this.issuedVal.alarmBattery,//.toString(16),
+                    hotAlarmLimit: this.issuedVal.alarmDegree,//.toString(16),
+                    isUse: 0,
+                    equipmentNo: str
+                },
+                res => {
+                    if (res.code == "ok") {
+                        this.$message({
+                            message: "设备已停用",
+                            type: "success"
+                        });
+                        this.getMoulds();
+                    } else {
+                        this.$message({
+                            message: res.msg,
+                            type: "error"
+                        });
+                    }
+                },
+                error => {
+                    this.$message({
+                        message: error,
+                        type: "error"
+                    });
+                });
+            },
+
+            //导入云模盒
+            uploadFile(params) {
+                var fileObj = params.file;
+                var form = new FormData();
+                form.append("file", fileObj);
+                this.uploading = true;
+                this.http.uploadFile( this.port.base.importMouldEquipmentExcel,  form,
+                res => {
+                    this.uploading = false;
+                    this.$refs.upload.clearFiles();
+                    if (res.code == "ok") {
+                        this.$message({
+                            message: "上传成功",
+                            type: "success"
+                        });
+                        this.getMoulds();
+                    } else {
+                        this.$message({
+                            message: res.msg,
+                            type: "error"
+                        });
+                    }
+                },
+                error => {
+                    this.uploading = false;
+                    this.$refs.upload.clearFiles();
+                    this.$message({
+                        message: error,
+                        type: "error"
+                    });
+                });
+            },
+
+            //列表选择
+            handleSelectionChange(val) {
+                this.multipleSelection = val;
+            },
+
+            //下发云模盒
+            issued() {
+                this.issuedVisible = true;
+            },
+
+            saveIssued() {
+                if(this.multipleSelection.length == 0) {
+                    this.$message({
+                        message: "请选择要下发的云模盒",
+                        type: "error"
+                    });
+                } else {
+                    var str = '';
+                    for(var i in this.multipleSelection) {
+                        str += this.multipleSelection[i].equipmentNo + ',';
+                    }
+                    str = str.substring(0,str.length-1)
+                    this.http.post( this.port.base.setPacket, {
+                        lowPowerLimit: this.issuedVal.alarmBattery,//.toString(16),
+                        hotAlarmLimit: this.issuedVal.alarmDegree,//.toString(16),
+                        equipmentNo: str
+                    },
+                    res => {
+                        if (res.code == "ok") {
+                            this.$message({
+                                message: "下发成功",
+                                type: "success"
+                            });
+                            this.issuedVisible = false;
+                            this.getMoulds();
+                        } else {
+                            this.$message({
+                                message: res.msg,
+                                type: "error"
+                            });
+                        }
+                    },
+                    error => {
+                        this.$message({
+                            message: error,
+                            type: "error"
+                        });
+                    });
+                }
+            }
+
+        },
+        created() {
+            let height = window.innerHeight;
+            this.tableHeight = height - 210;
+            const that = this;
+            window.onresize = function temp() {
+                that.tableHeight = window.innerHeight - 210;    
+            };
+        },
+        mounted() {
+            this.getMsg();
+            //获取模具列表
+            this.getMoulds();
+        }
+    };
+</script>
+
+<style scoped>
+    .download {
+        color: #fff;
+        text-decoration: none;
+    }
+</style>

+ 601 - 0
lib_vue/src/views/system/manage.vue

@@ -0,0 +1,601 @@
+<template>
+	<section>
+		<!--工具条-->
+		<el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
+			<el-form :inline="true" :model="filters">
+                <el-form-item>
+                    <el-input v-model="filters.keyName" placeholder="请输入生产方名称进行搜索" clearable></el-input>
+                </el-form-item>
+				<el-form-item>
+					<el-button type="primary" @click.native="getFactory">查询</el-button>
+				</el-form-item>
+				<el-form-item style="float:right;">
+					<el-button type="primary" @click.native="handleAdd">新增</el-button>
+				</el-form-item>
+			</el-form>
+		</el-col>
+
+		<!--列表-->
+		<el-table :data="list" highlight-current-row :height="tableHeight" v-loading="listLoading" style="width: 100%;">
+            <el-table-column type="index" width="60"></el-table-column>
+			<el-table-column prop="companyName" label="生产方名称" width="250" sortable></el-table-column>
+            <el-table-column prop="administrator" label="生产方管理员" width="150" sortable>
+            </el-table-column>
+            <el-table-column prop="relateCompanyList" label="关联资产方" width="400" sortable>
+                <template slot-scope="scope">
+                    <span class="info" v-for="(item, index) in scope.row.relateCompanyList">
+                        {{item.companyName}}
+                        <span v-if="index != scope.row.relateCompanyList.length-1">、</span>
+                    </span>
+                </template>
+            </el-table-column>
+            <el-table-column prop="companyAddress" label="生产方地址" sortable></el-table-column>
+			<el-table-column label="操作" width="150">
+				<template slot-scope="scope">
+					<el-button size="small" @click.native="handleEdit(scope.$index, scope.row)">编辑</el-button>
+					<el-button type="danger" size="small" @click.native.native="handleDel(scope.$index, scope.row)">删除</el-button>
+				</template>
+			</el-table-column>
+		</el-table>
+
+		<!--工具条-->
+		<el-col :span="24" class="toolbar">
+            <el-pagination
+                @size-change="handleSizeChange"
+                @current-change="handleCurrentChange"
+                :page-sizes="[20 , 50 , 80 , 100]"
+                :page-size="20"
+                layout="total, sizes, prev, pager, next"
+                :total="total"
+                style="float:right;">
+            </el-pagination>
+		</el-col>
+
+        <!--新增界面-->
+		<el-dialog :title="addTitle" v-if="addFormVisible" :visible.sync="addFormVisible" :close-on-click-modal="false" customClass='customWidth'>
+			<el-form :model="addForm" label-width="100px" :rules="formRules" ref="addForm">
+				<el-form-item label="生产方名称" prop="companyName" v-show="addState">
+					<el-input v-model="addForm.companyName" autocomplete="off" placeholder="请输入生产方名称"></el-input>
+				</el-form-item>
+                <el-form-item label="关联资产方" v-show="addState">
+                    <el-select v-model="addForm.companyIds" clearable multiple filterable placeholder="请选择资产方" style="width:533px">
+                        <el-option v-for="item in companys" :key="item.id" :label="item.companyName" :value="item.id">
+                        </el-option>
+                    </el-select>
+				</el-form-item>
+                <el-form-item label="生产方地址" prop="companyAddress" v-show="addState">
+					<el-input v-model.lazy="addForm.companyAddress" autocomplete="off" @change="changeFactoryArea('addContainer')" placeholder="请输入生产方地址"></el-input>
+				</el-form-item>
+                <div id="addContainer" class="formMap" v-show="addState"></div>
+                <el-form-item label="姓名" prop="username" v-show="!addState">
+					<el-input v-model="addForm.username" autocomplete="off" placeholder="请输入姓名"></el-input>
+				</el-form-item>
+				<el-form-item label="手机号" prop="account" v-show="!addState">
+					<el-input v-model="addForm.account" autocomplete="off" placeholder="请输入手机号"></el-input>
+				</el-form-item>
+                <el-form-item label="角色" v-show="!addState">
+                    <el-input v-model="addForm.roleName" autocomplete="off" placeholder="请输入角色名称"></el-input>
+				</el-form-item>
+			</el-form>
+			<div slot="footer" class="dialog-footer">
+                 <span v-if="!addState" style="color:#f00;float:left;margin-left:60px;">初始密码:000000</span>
+				<el-button @click.native="addFormVisible = false">取消</el-button>
+                <el-button v-if="addState" type="primary" @click.native="toNext(0)">下一步</el-button>
+                <el-button v-if="!addState" type="primary" @click.native="toPart(0)">上一步</el-button>
+				<el-button v-if="!addState" type="primary" @click.native="addSubmit" :loading="addLoading">提交</el-button>
+			</div>
+		</el-dialog>
+
+		<!--编辑界面-->
+		<el-dialog title="编辑生产方" v-if="editFormVisible" :visible.sync="editFormVisible" :close-on-click-modal="false" customClass='customWidth'>
+			<el-form :model="editForm" label-width="100px" :rules="formRules" ref="editForm">
+				<el-form-item label="生产方名称" prop="companyName">
+					<el-input v-model="editForm.companyName" autocomplete="off" placeholder="请输入生产方名称"></el-input>
+				</el-form-item>
+                <el-form-item label="关联资产方">
+                    <el-select v-model="editForm.companyIds" clearable multiple filterable placeholder="请选择资产方" style="width:533px">
+                        <el-option v-for="item in companys" :key="item.id" :label="item.companyName" :value="item.id">
+                        </el-option>
+                    </el-select>
+				</el-form-item>
+                <el-form-item label="生产方地址" prop="companyAddress">
+					<el-input v-model="editForm.companyAddress" autocomplete="off" :change="changeFactoryArea('editContainer')" placeholder="请输入生产方地址"></el-input>
+				</el-form-item>
+                <div id="editContainer" class="formMap"></div>
+			</el-form>
+			<div slot="footer" class="dialog-footer">
+				<el-button @click.native="editFormVisible = false">取消</el-button>
+				<el-button type="primary" @click.native="editSubmit" :loading="editLoading">提交</el-button>
+			</div>
+		</el-dialog>
+	</section>
+</template>
+
+<script>
+    import Vue from 'vue';
+	import util from '../../common/js/util'
+
+	export default {
+		data() {
+            var checkPhone = (rule, value, callback) => {
+                if (!value) {
+                    return callback(new Error('请输入联系方式'));
+                } else {
+                    const reg = /^1[0-9]\d{9}$/
+                    if (reg.test(value)) {
+                        callback();
+                    } else {
+                        return callback(new Error('请输入正确的联系方式'));
+                    }
+                }
+            };
+			return {
+				filters: {
+                    keyName: ''
+                },
+
+                user: JSON.parse(sessionStorage.getItem('user')),
+                companys:[],
+				list: [],
+				total: 0,
+                page: 1,
+                size: 20,
+                listLoading: false,
+                tableHeight: 0,
+                
+                formRules: {
+					companyName: [
+						{ required: true, message: '请输入生产方名称', trigger: 'blur' }
+                    ],
+                    companyAddress: [
+                        { required: true, message: '请输入生产方地址', trigger: 'blur' }
+                    ],
+                    username: [
+						{ required: true, message: '请输入姓名', trigger: 'blur' }
+                    ],
+                    account: [
+                        { required: true, validator: checkPhone, trigger: 'blur'}
+                    ]
+                },
+
+                // 地图
+                map: '',
+                marker: '',
+
+                // 新增界面
+				addFormVisible: false,
+                addLoading: false,
+                addState: true,
+                addTitle: '新增生产方',
+				addForm: {
+                    companyName: '',
+                    companyType: 1,
+                    companyAddress: '',
+                    yLng: 116.397511,
+                    xLat: 39.907545,
+                    companyIds: [],
+                    username: '',
+                    account: '',
+                    companyId: '',
+                    roleName: "系统管理员",
+                    flag: 0
+				},
+                
+                // 编辑界面
+				editFormVisible: false,
+				editLoading: false,
+				editForm: {
+					id: 0,
+					companyName: '',
+                    companyType: 1,
+                    companyAddress: '',
+                    yLng: 0,
+                    xLat: 0,
+                    companyIds: [],
+                    flag: 1
+				}
+			}
+		},
+		methods: {
+            //  分页
+			handleCurrentChange(val) {
+				this.page = val;
+				this.getFactory();
+            },
+
+            handleSizeChange(val) {
+                this.size = val;
+				this.getFactory();
+            },
+
+            //获取基础数据
+            getMsg() {
+                this.http.post(this.port.base.relationList, {
+                    companyType: 0
+                }, res => {
+                    if (res.code == "ok") {
+                        this.companys = res.data;
+                    } else {
+                        this.$message({
+                            message: res.msg,
+                            type: 'error'
+                        });
+                    }
+                }, error => {
+                    this.$message({
+                        message: error,
+                        type: 'error'
+                    });
+                })
+            },
+
+			//获取列表
+			getFactory() {
+				this.listLoading = true;
+                this.http.post(this.port.base.companyList, {
+                    keyName: this.filters.keyName,
+                    pageNum: this.page,
+                    pageSize: this.size,
+                    companyType: 1
+                }, res => {
+                    this.listLoading = false;
+                    if (res.code == "ok") {
+                        this.list = res.data.list;
+                        this.total = res.data.total;
+                    } else {
+                        this.$message({
+                            message: res.msg,
+                            type: 'error'
+                        });
+                    }
+                }, error => {
+                    this.listLoading = false;
+                    this.$message({
+                        message: error,
+                        type: 'error'
+                    });
+                })
+            },
+            
+            //地址输入切换
+            changeFactoryArea(mapId) {
+                if(mapId == "addContainer"){
+                    this.markLocation(this.addForm.companyAddress, mapId);
+                } else {
+                    this.markLocation(this.editForm.companyAddress, mapId);
+                }
+                
+            },
+
+            toNext(i) {
+                if(i == 0) {
+                    this.addState = false;
+                     this.addTitle = '新增生产方管理员';
+                }
+            },
+
+            toPart(i) {
+                if(i == 0) {
+                    this.addState = true;
+                    this.addTitle = '新增生产方';
+                }
+                var _this = this
+                setTimeout(function(){ _this.setMap('addContainer'); }, 100);
+            },
+
+            //显示新增界面
+			handleAdd() {
+                this.addFormVisible = true;
+                this.addState = true;
+                this.addTitle = '新增生产方';
+				this.addForm = {
+                    companyName: '',
+                    companyAddress: '',
+                    yLng: 116.397511,
+                    xLat: 39.907545,
+                    companyIds: [],
+                    username: '',
+                    account: '',
+                    companyId: '',
+                    roleName: "系统管理员",
+                    flag: 0
+                };
+            },
+
+            //新增
+			addSubmit() {
+				this.$refs.addForm.validate((valid) => {
+					if (valid) {
+                        this.addLoading = true;
+                        var str = "";
+                        for(var i in this.addForm.companyIds){
+                            if(i == this.addForm.companyIds.length-1){
+                                str += this.addForm.companyIds
+                            } else {
+                                str += this.addForm.companyIds + ","
+                            }
+                        }
+                        this.http.post(this.port.base.addCompany, {
+                            companyName: this.addForm.companyName,
+                            companyType: 1,
+                            companyAddress: this.addForm.companyAddress,
+                            yLng: this.addForm.yLng,
+                            xLat: this.addForm.xLat,
+                            companyIds: str,
+                            flag: 0
+                        } , res => {
+                            this.addLoading = false;
+                            if (res.code == "ok") {
+                                this.addPeo(res.data.id);
+                            } else {
+                                this.$message({
+                                    message: res.msg,
+                                    type: 'error'
+                                });
+                            }
+                        }, error => {
+                            this.addLoading = false;
+                            this.addFormVisible = false;
+                            this.$message({
+                                message: error,
+                                type: 'error'
+                            });
+                        })
+					}
+				});
+            },
+
+            //添加人员
+            addPeo(companyId) {
+                this.$refs.addForm.validate((valid) => {
+					if (valid) {
+                        this.http.post(this.port.project.addUser, {
+                            username: this.addForm.username,
+                            account: this.addForm.account,
+                            companyId: companyId,
+                            roleName: this.addForm.roleName,
+                            parentId: this.user.id,
+                            addType: 0,
+                            flag: 0
+                        } , res => {
+                            this.addLoading = false;
+                            if (res.code == "ok") {
+                                this.addFormVisible = false;
+                                this.$message({
+                                    message: '创建成功',
+                                    type: 'success'
+                                });
+                                this.getFactory();
+                            } else {
+                                this.$message({
+                                    message: res.msg,
+                                    type: 'error'
+                                });
+                            }
+                        }, error => {
+                            this.addLoading = false;
+                            this.addFormVisible = false;
+                            this.$message({
+                                message: error,
+                                type: 'error'
+                            });
+                        })
+					}
+				});
+            },
+            
+			//删除
+			handleDel(index, row) {
+				this.$confirm('确认删除该生产方吗?', '提示', {
+					type: 'warning'
+				}).then(() => {
+                    this.http.post(this.port.base.delCompany, {
+                        id: row.id
+                    }, res => {
+                        if (res.code == "ok") {
+                            this.$message({
+                                message: '删除成功',
+                                type: 'success'
+                            });
+                            this.getFactory();
+                        } else {
+                            this.$message({
+                                message: res.msg,
+                                type: 'error'
+                            });
+                        }
+                    }, error => {
+                        this.$message({
+                            message: error,
+                            type: 'error'
+                        });
+                    })
+				});
+            },
+            
+			//显示编辑界面
+			handleEdit(index, row) {
+                this.editFormVisible = true;
+                var array = [];
+                for(var i in row.relateCompanyList){
+                    array.push(row.relateCompanyList[i].id)
+                }
+                this.editForm = {
+                    id: row.id,
+                    companyName: row.companyName,
+                    companyType: 1,
+                    companyAddress: row.companyAddress,
+                    yLng: row.ylng,
+                    xLat: row.xlat,
+                    companyIds: array,
+                    flag: 1
+                };
+            },
+            
+			//编辑
+			editSubmit() {
+				this.$refs.editForm.validate((valid) => {
+					if (valid) {
+                        this.editLoading = true;
+                        var str = "";
+                        for(var i in this.editForm.companyIds){
+                            if(i == this.editForm.companyIds.length-1){
+                                str += this.editForm.companyIds[i]
+                            } else {
+                                str += this.editForm.companyIds[i] + ","
+                            }
+                        }
+                        this.http.post(this.port.base.addCompany, {
+                            id: this.editForm.id,
+                            companyName: this.editForm.companyName,
+                            companyType: 1,
+                            companyAddress: this.editForm.companyAddress,
+                            yLng: this.editForm.yLng,
+                            xLat: this.editForm.xLat,
+                            companyIds: str,
+                            flag: 1
+                        } , res => {
+                            this.editLoading = false;
+                            if (res.code == "ok") {
+                                this.editFormVisible = false;
+                                this.$message({
+                                    message: '修改成功',
+                                    type: 'success'
+                                });
+                                this.getFactory();
+                            } else {
+                                this.$message({
+                                    message: res.msg,
+                                    type: 'error'
+                                });
+                            }
+                        }, error => {
+                            this.editLoading = false;
+                            this.editFormVisible = false;
+                            this.$message({
+                                message: error,
+                                type: 'error'
+                            });
+                        })
+					}
+				});
+            },
+
+            //获取地图
+            setMap(mapId) {
+                if(mapId == 'addContainer') {
+                    this.map = new AMap.Map('addContainer', {
+                        resizeEnable: true, // 允许缩放
+                        center:[ this.addForm.yLng , this.addForm.xLat ],
+                        zoom:10
+                    })
+
+                    this.marker = new AMap.Marker({
+                        map: this.map,
+                        position: new AMap.LngLat(this.addForm.yLng , this.addForm.xLat),   // 经纬度
+                    });
+                } else {
+                    this.map = new AMap.Map('editContainer', {
+                        resizeEnable: true, // 允许缩放
+                        center:[this.editForm.yLng , this.editForm.xLat],
+                        zoom:10
+                    })
+
+                    this.marker = new AMap.Marker({
+                        map: this.map,
+                        position: new AMap.LngLat(this.editForm.yLng , this.editForm.xLat),   // 经纬度
+                    });
+                }
+                
+                var _this = this;
+                this.map.on('click', function(e) {
+                    if(_this.map){
+                        _this.map.remove(_this.marker);
+                    }
+                    var Lng = e.lnglat.getLng(),
+                    Lat = e.lnglat.getLat();
+                    if(mapId == 'addContainer') {
+                        _this.addForm.yLng = Lng;
+                        _this.addForm.xLat = Lat;
+                    } else {
+                        _this.editForm.yLng = Lng;
+                        _this.editForm.xLat = Lat;
+                    }
+                    _this.marker = new AMap.Marker({
+                        map: _this.map,
+                        position: new AMap.LngLat(Lng , Lat),   // 经纬度
+                    });
+                });
+            },
+
+            // 获取经纬度
+            markLocation(address,mapId) {
+                var _this = this;
+                AMap.plugin('AMap.Geocoder', function() {
+                    var geocoder = new AMap.Geocoder();            
+                    geocoder.getLocation(address, function(status, result) {
+                        if (status === 'complete' && result.info === 'OK') {
+                            // 经纬度                      
+                            var lng = result.geocodes[0].location.lng;
+                            var lat = result.geocodes[0].location.lat;
+                            
+                            _this.noSub = false;
+                            if(mapId == "addContainer") {
+                                _this.addForm.yLng = lng;
+                                _this.addForm.xLat = lat;
+                            } else {
+                                _this.editForm.yLng = lng;
+                                _this.editForm.xLat = lat;
+                            }
+                            
+                            // 添加标记
+                            if(_this.map){
+                                _this.map.remove(_this.marker);
+                                _this.map.setZoomAndCenter(10, [lng, lat]);
+                                _this.marker = new AMap.Marker({
+                                    map: _this.map,
+                                    position: new AMap.LngLat(lng, lat),   // 经纬度
+                                });
+                            }
+
+                        } else {
+                            //console.log('定位失败!');
+                        }
+                    });
+                });
+            }
+        },
+        created() {
+            let height = window.innerHeight;
+            this.tableHeight = height - 210;
+            const that = this;
+            window.onresize = function temp() {
+                that.tableHeight = window.innerHeight - 210;    
+            };
+        },
+        watch: {
+            addFormVisible(val) {
+                if(val){
+                    var _this = this
+                    setTimeout(function(){ _this.setMap('addContainer'); }, 300);
+                }
+            },
+            editFormVisible(val) {
+                if(val){
+                    var _this = this
+                    setTimeout(function(){ _this.setMap('editContainer'); }, 300);
+                }
+            }
+        },
+		mounted() {
+            this.getMsg();
+			this.getFactory();
+        }
+	}
+</script>
+
+<style scoped>
+    .formMap {
+        height: 400px;
+    }
+</style>

+ 476 - 0
lib_vue/src/views/system/vip.vue

@@ -0,0 +1,476 @@
+<template>
+	<section>
+		<!--工具条-->
+		<el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
+			<el-form :inline="true" :model="filters">
+                <el-form-item>
+                    <el-input v-model="filters.keyName" placeholder="请输入资产方名称进行搜索" clearable></el-input>
+                </el-form-item>
+				<el-form-item>
+					<el-button type="primary" @click.native="getComp">查询</el-button>
+				</el-form-item>
+				<el-form-item style="float:right;">
+					<el-button type="primary" @click.native="handleAdd">新增</el-button>
+				</el-form-item>
+			</el-form>
+		</el-col>
+
+		<!--列表-->
+		<el-table :data="list" highlight-current-row :height="tableHeight" v-loading="listLoading" style="width: 100%;">
+            <el-table-column type="index" width="60"></el-table-column>
+			<el-table-column prop="companyName" label="资产方名称" width="250" sortable>
+            </el-table-column>
+            <el-table-column prop="administrator" label="资产方管理员" width="150" sortable>
+                <template slot-scope="scope">
+                    <router-link to="/staff" tag="span" style="cursor: pointer; color: #409eff;">{{scope.row.administrator}}</router-link>
+                </template>
+            </el-table-column>
+            <el-table-column prop="relateCompanyList" label="关联生产方" width="400" sortable>
+                <template slot-scope="scope">
+                    <span class="info" v-for="(item, index) in scope.row.relateCompanyList">
+                        {{item.companyName}}
+                        <span v-if="index != scope.row.relateCompanyList.length-1">、</span>
+                    </span>
+                </template>
+            </el-table-column>
+            <el-table-column prop="companyAddress" label="资产方地址" sortable></el-table-column>
+			<el-table-column label="操作" width="150">
+				<template slot-scope="scope">
+					<el-button size="small" @click.native="handleEdit(scope.$index, scope.row)">编辑</el-button>
+					<el-button type="danger" size="small" @click.native.native="handleDel(scope.$index, scope.row)">删除</el-button>
+				</template>
+			</el-table-column>
+		</el-table>
+
+		<!--工具条-->
+		<el-col :span="24" class="toolbar">
+            <el-pagination
+                @size-change="handleSizeChange"
+                @current-change="handleCurrentChange"
+                :page-sizes="[20 , 50 , 80 , 100]"
+                :page-size="20"
+                layout="total, sizes, prev, pager, next"
+                :total="total"
+                style="float:right;">
+            </el-pagination>
+		</el-col>
+
+        <!--新增界面-->
+		<el-dialog :title="addTitle" v-if="addFormVisible" :visible.sync="addFormVisible" :close-on-click-modal="false" customClass='customWidth'>
+			<el-form :model="addForm" label-width="100px" :rules="formRules" ref="addForm">
+				<el-form-item label="资产方名称" prop="companyName" v-show="addState">
+					<el-input v-model="addForm.companyName" autocomplete="off" placeholder="请输入资产方地址"></el-input>
+				</el-form-item>
+                <el-form-item label="关联生产方" v-show="addState">
+                    <el-select v-model="addForm.companyIds" clearable multiple filterable placeholder="请选择生产方" style="width:533px">
+                        <el-option v-for="item in companys" :key="item.id" :label="item.companyName" :value="item.id">
+                        </el-option>
+                    </el-select>
+				</el-form-item>
+                <el-form-item label="资产方地址" prop="companyAddress" v-show="addState">
+					<el-input v-model="addForm.companyAddress" autocomplete="off" placeholder="请输入资产方地址"></el-input>
+				</el-form-item>
+                <el-form-item label="姓名" prop="username" v-show="!addState">
+					<el-input v-model="addForm.username" autocomplete="off" placeholder="请输入姓名"></el-input>
+				</el-form-item>
+				<el-form-item label="手机号" prop="account" v-show="!addState">
+					<el-input v-model="addForm.account" autocomplete="off" placeholder="请输入手机号"></el-input>
+				</el-form-item>
+                <el-form-item label="角色" v-show="!addState">
+                    <el-input v-model="addForm.roleName" autocomplete="off" placeholder="请输入角色名称"></el-input>
+				</el-form-item>
+			</el-form>
+			<div slot="footer" class="dialog-footer">
+                <span v-if="!addState" style="color:#f00;float:left;margin-left:60px;">初始密码:000000</span>
+				<el-button @click.native="addFormVisible = false">取消</el-button>
+                <el-button v-if="addState" type="primary" @click.native="toNext(0)">下一步</el-button>
+                <el-button v-if="!addState" type="primary" @click.native="toPart(0)">上一步</el-button>
+				<el-button v-if="!addState" type="primary" @click.native="addSubmit" :loading="addLoading">提交</el-button>
+			</div>
+		</el-dialog>
+
+		<!--编辑界面-->
+		<el-dialog title="编辑资产方" v-if="editFormVisible" :visible.sync="editFormVisible" :close-on-click-modal="false" customClass='customWidth'>
+			<el-form :model="editForm" label-width="100px" :rules="formRules" ref="editForm">
+				<el-form-item label="资产方名称" prop="companyName">
+					<el-input v-model="editForm.companyName" autocomplete="off" placeholder="请输入资产方地址"></el-input>
+				</el-form-item>
+                <el-form-item label="关联生产方">
+                    <el-select v-model="editForm.companyIds" clearable multiple filterable placeholder="请选择生产方" style="width:533px">
+                        <el-option v-for="item in companys" :key="item.id" :label="item.companyName" :value="item.id">
+                        </el-option>
+                    </el-select>
+				</el-form-item>
+                <el-form-item label="资产方地址" prop="companyAddress">
+					<el-input v-model="editForm.companyAddress" autocomplete="off" placeholder="请输入资产方地址"></el-input>
+				</el-form-item>
+			</el-form>
+			<div slot="footer" class="dialog-footer">
+				<el-button @click.native="editFormVisible = false">取消</el-button>
+				<el-button type="primary" @click.native="editSubmit" :loading="editLoading">提交</el-button>
+			</div>
+		</el-dialog>
+	</section>
+</template>
+
+<script>
+	import util from '../../common/js/util'
+
+	export default {
+		data() {
+            var checkPhone = (rule, value, callback) => {
+                if (!value) {
+                    return callback(new Error('请输入联系方式'));
+                } else {
+                    const reg = /^1[0-9]\d{9}$/
+                    if (reg.test(value)) {
+                        callback();
+                    } else {
+                        return callback(new Error('请输入正确的联系方式'));
+                    }
+                }
+            };
+			return {
+				filters: {
+                    keyName: ''
+                },
+
+                user: JSON.parse(sessionStorage.getItem('user')),
+                companys:[],
+				list: [],
+				total: 0,
+                page: 1,
+                size: 20,
+                listLoading: false,
+                tableHeight: 0,
+                
+                formRules: {
+					companyName: [
+						{ required: true, message: '请输入资产方名称', trigger: 'blur' }
+                    ],
+                    companyAddress: [
+                        { required: true, message: '请输入资产方地址', trigger: 'blur' }
+                    ],
+                    username: [
+						{ required: true, message: '请输入姓名', trigger: 'blur' }
+                    ],
+                    account: [
+                        { required: true, validator: checkPhone, trigger: 'blur'}
+                    ]
+                },
+
+                team: [{label:'资产方',value:0},{label:'生产方',value:1}],
+
+                // 新增界面
+				addFormVisible: false,
+                addLoading: false,
+                addState: true,
+                addTitle: '新增资产方',
+				addForm: {
+                    companyName: '',
+                    companyAddress: '',
+                    companyIds: [],
+                    username: '',
+                    account: '',
+                    companyId: '',
+                    roleName: "系统管理员",
+                    flag: 0
+				},
+                
+                // 编辑界面
+				editFormVisible: false,
+                editLoading: false,
+				editForm: {
+					id: 0,
+                    companyName: '',
+                    companyType: 0,
+                    companyAddress: '',
+                    companyIds: [],
+                    flag: 1
+				}
+			}
+		},
+		methods: {
+            //  分页
+			handleCurrentChange(val) {
+				this.page = val;
+				this.getComp();
+            },
+
+            handleSizeChange(val) {
+                this.size = val;
+				this.getComp();
+            },
+
+            //获取基础数据
+            getMsg() {
+                this.http.post(this.port.base.relationList, {
+                    companyType: 1
+                }, res => {
+                    if (res.code == "ok") {
+                        this.companys = res.data;
+                    } else {
+                        this.$message({
+                            message: res.msg,
+                            type: 'error'
+                        });
+                    }
+                }, error => {
+                    this.$message({
+                        message: error,
+                        type: 'error'
+                    });
+                })
+            },
+
+			//获取资产方列表
+			getComp() {
+				this.listLoading = true;
+                this.http.post(this.port.base.companyList, {
+                    keyName: this.filters.keyName,
+                    pageNum: this.page,
+                    pageSize: this.size,
+                    companyType: 0
+                }, res => {
+                    this.listLoading = false;
+                    if (res.code == "ok") {
+                        this.list = res.data.list;
+                        this.total = res.data.total;
+                    } else {
+                        this.$message({
+                            message: res.msg,
+                            type: 'error'
+                        });
+                    }
+                }, error => {
+                    this.listLoading = false;
+                    this.$message({
+                        message: error,
+                        type: 'error'
+                    });
+                })
+            }, 
+
+            toNext(i) {
+                if(i == 0) {
+                    this.addState = false;
+                     this.addTitle = '新增资产方管理员';
+                }
+            },
+
+            toPart(i) {
+                if(i == 0) {
+                    this.addState = true;
+                    this.addTitle = '新增资产方';
+                }
+            },
+
+            //显示新增界面
+			handleAdd() {
+                this.addFormVisible = true;
+                this.addState = true;
+                this.addTitle = '新增资产方';
+				this.addForm = {
+                    companyName: '',
+                    companyAddress: '',
+                    companyIds: [],
+                    username: '',
+                    account: '',
+                    companyId: '',
+                    roleName: "系统管理员",
+                    flag: 0
+				};
+            },
+            
+            //新增
+			addSubmit() {
+				this.$refs.addForm.validate((valid) => {
+					if (valid) {
+                        this.addLoading = true;
+                        var str = "";
+                        for(var i in this.addForm.companyIds){
+                            if(i == this.addForm.companyIds.length-1){
+                                str += this.addForm.companyIds
+                            } else {
+                                str += this.addForm.companyIds + ","
+                            }
+                        }
+                        this.http.post(this.port.base.addCompany, {
+                            companyName: this.addForm.companyName,
+                            companyType: 0,
+                            companyAddress: this.addForm.companyAddress,
+                            companyIds: str,
+                            flag: 0
+                        } , res => {
+                            if (res.code == "ok") {
+                                this.addPeo(res.data.id);
+                            } else {
+                                this.$message({
+                                    message: res.msg,
+                                    type: 'error'
+                                });
+                            }
+                        }, error => {
+                            this.addLoading = false;
+                            this.addFormVisible = false;
+                            this.$message({
+                                message: error,
+                                type: 'error'
+                            });
+                        })
+					}
+				});
+            },
+
+            //添加人员
+            addPeo(companyId) {
+                this.$refs.addForm.validate((valid) => {
+					if (valid) {
+                        this.http.post(this.port.project.addUser, {
+                            username: this.addForm.username,
+                            account: this.addForm.account,
+                            companyId: companyId,
+                            roleName: this.addForm.roleName,
+                            parentId: this.user.id,
+                            addType: 0,
+                            flag: 0
+                        } , res => {
+                            this.addLoading = false;
+                            if (res.code == "ok") {
+                                this.addFormVisible = false;
+                                this.$message({
+                                    message: '创建成功',
+                                    type: 'success'
+                                });
+                                this.getComp();
+                            } else {
+                                this.$message({
+                                    message: res.msg,
+                                    type: 'error'
+                                });
+                            }
+                        }, error => {
+                            this.addLoading = false;
+                            this.addFormVisible = false;
+                            this.$message({
+                                message: error,
+                                type: 'error'
+                            });
+                        })
+					}
+				});
+            },
+            
+			//删除
+			handleDel(index, row) {
+				this.$confirm('确认删除该资产方吗?', '提示', {
+					type: 'warning'
+				}).then(() => {
+                    this.http.post(this.port.base.delCompany, {
+                        id: row.id
+                    }, res => {
+                        if (res.code == "ok") {
+                            this.$message({
+                                message: '删除成功',
+                                type: 'success'
+                            });
+                            this.getComp();
+                        } else {
+                            this.$message({
+                                message: res.msg,
+                                type: 'error'
+                            });
+                        }
+                    }, error => {
+                        this.$message({
+                            message: error,
+                            type: 'error'
+                        });
+                    })
+				});
+            },
+            
+			//显示编辑界面
+			handleEdit(index, row) {
+                this.editFormVisible = true;
+                var array = [];
+                for(var i in row.relateCompanyList) {
+                    array.push(row.relateCompanyList[i].id)
+                }
+                this.editForm = {
+                    id: row.id,
+                    companyName: row.companyName,
+                    companyType: 0,
+                    companyAddress: row.companyAddress,
+                    companyIds: array,
+                    flag: 1
+				};
+            },
+            
+			//编辑
+			editSubmit() {
+				this.$refs.editForm.validate((valid) => {
+					if (valid) {
+                        this.editLoading = true;
+                        var str = "";
+                        for(var i in this.editForm.companyIds){
+                            if(i == this.editForm.companyIds.length-1){
+                                str += this.editForm.companyIds
+                            } else {
+                                str += this.editForm.companyIds + ","
+                            }
+                        }
+                        this.http.post(this.port.base.addCompany, {
+                            id: this.editForm.id,
+                            companyName: this.editForm.companyName,
+                            companyType: 0,
+                            companyAddress: this.editForm.companyAddress,
+                            companyIds: str,
+                            flag: 1
+                        } , res => {
+                            this.editLoading = false;
+                            if (res.code == "ok") {
+                                this.editFormVisible = false;
+                                this.$message({
+                                    message: '修改成功',
+                                    type: 'success'
+                                });
+                                this.getComp();
+                            } else {
+                                this.$message({
+                                    message: res.msg,
+                                    type: 'error'
+                                });
+                            }
+                        }, error => {
+                            this.editLoading = false;
+                            this.editFormVisible = false;
+                            this.$message({
+                                message: error,
+                                type: 'error'
+                            });
+                        })
+					}
+				});
+            }
+        },
+
+        created() {
+            let height = window.innerHeight;
+            this.tableHeight = height - 210;
+            const that = this;
+            window.onresize = function temp() {
+                that.tableHeight = window.innerHeight - 210;    
+            };
+        },
+
+		mounted() {
+            this.getMsg();
+			this.getComp();
+        }
+	}
+</script>
+
+<style scoped>
+    
+</style>

+ 547 - 0
lib_vue/src/views/user/reserve.vue

@@ -0,0 +1,547 @@
+<template>
+	<section>
+		<!--工具条-->
+		<el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
+			<el-form :inline="true" :model="filters">
+                <el-col :span="3">
+                    <el-form-item>
+                        <el-select v-model="filters.companyId" clearable filterable placeholder="请选择公司">
+                            <el-option v-for="item in allCompanies" :key="item.id" :label="item.companyName" :value="item.id">
+                            </el-option>
+                        </el-select>
+                    </el-form-item>
+                </el-col>
+                <el-col :span="3">
+                    <el-form-item>
+                        <el-select v-model="filters.flag" placeholder="请选择查询条件">
+                            <el-option label="姓名" value="0"></el-option>
+                            <el-option label="手机号" value="1"></el-option>
+                        </el-select>
+                    </el-form-item>
+                </el-col>
+                <el-form-item>
+                    <el-input v-model="filters.keyName" clearable placeholder="请输入姓名或手机号进行搜索" style="width:250px;"></el-input>
+                </el-form-item>
+				<el-form-item>
+					<el-button type="primary" @click="getUsers">查询</el-button>
+				</el-form-item>
+				<el-form-item style="float:right;" v-if="user.subordinateType == 0 || user.isManager == 1">
+					<el-button type="primary" @click="handleAdd">新增</el-button>
+				</el-form-item>
+			</el-form>
+		</el-col>
+
+		<!--列表-->
+		<el-table :data="list" highlight-current-row :height="tableHeight" v-loading="listLoading" style="width: 100%;">
+			<el-table-column type="index" width="60"></el-table-column>
+			<el-table-column prop="username" label="姓名" width="120" sortable></el-table-column>
+			<el-table-column prop="account" label="手机号" width="180" sortable></el-table-column>
+			<!-- <el-table-column prop="mobile" label="联系方式" width="150" sortable></el-table-column> -->
+            <el-table-column prop="projects" label="参与项目" sortable>
+                <template slot-scope="scope">
+                    <span class="info" v-for="(item, index) in scope.row.projects">
+                        {{item.projectName}}
+                        <span v-if="scope.row.projects != null && index != scope.row.projects.length-1">、</span>
+                    </span>
+                </template>
+			</el-table-column>
+            <el-table-column prop="roleName" label="备注" width="180" sortable></el-table-column>
+            <el-table-column prop="teamName" label="类型" width="120" align="center" sortable></el-table-column>
+			<el-table-column prop="companyName" label="所属公司" sortable></el-table-column>
+			<el-table-column label="操作" align="left" width="230">
+				<template slot-scope="scope" v-if="user.id == scope.row.parentId || user.isManager == 1 || (user.parentId == 1 && user.subordinateType == 0)">
+					<el-button size="small" @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
+					<el-button type="danger" size="small" @click="handleDel(scope.$index, scope.row)">删除</el-button>
+                    <el-button type="primary" size="small" @click="invite(scope.$index, scope.row)" v-if="user.id != 1 && scope.row.projects != null && scope.row.projects.length == 1">邀请</el-button>
+				</template>
+			</el-table-column>
+		</el-table>
+
+		<!--工具条-->
+		<el-col :span="24" class="toolbar">
+            <el-pagination
+                @size-change="handleSizeChange"
+                @current-change="handleCurrentChange"
+                :page-sizes="[20 , 50 , 80 , 100]"
+                :page-size="20"
+                layout="total, sizes, prev, pager, next"
+                :total="total"
+                style="float:right;">
+            </el-pagination>
+		</el-col>
+
+        <!--新增界面-->
+		<el-dialog title="新增人员" v-if="addFormVisible" :visible.sync="addFormVisible" :close-on-click-modal="false" customClass='customWidth'>
+			<el-form :model="addForm" label-width="100px" :rules="formRules" ref="addForm" :inline="true" class="demo-form-inline">
+				<el-form-item label="姓名" prop="username">
+					<el-input v-model="addForm.username" autocomplete="off" placeholder="请输入姓名"></el-input>
+				</el-form-item>
+				<el-form-item label="手机号" prop="account">
+					<el-input v-model="addForm.account" autocomplete="off" placeholder="请输入手机号(登录账号)"></el-input>
+				</el-form-item>
+                <el-form-item v-if="!(user.parentId == 1 && user.subordinateType == 0)" label="参与项目" prop="projectIds">
+					<el-select v-model="addForm.projectIds" @change="choseProject" clearable filterable placeholder="请选择参与项目" style="width:202px">
+                        <el-option v-for="item in projects" :key="item.id" :label="item.projectName" :value="item.id">
+                        </el-option>
+                    </el-select>
+				</el-form-item>
+                <el-form-item label="公司" prop="companyId">
+					<el-select v-model="addForm.companyId" clearable filterable placeholder="请选择所属公司" style="width:202px">
+                        <el-option v-for="item in company" :key="item.id" :label="item.companyName" :value="item.id">
+                        </el-option>
+                    </el-select>
+				</el-form-item>
+                <el-form-item label="备注">
+                    <el-input v-model="addForm.roleName" autocomplete="off" placeholder="请输入备注"></el-input>
+				</el-form-item>
+			</el-form>
+			<div slot="footer" class="dialog-footer">
+                <span style="color:#f00;float:left;margin-left:60px;">初始密码:000000</span>
+				<el-button @click.native="addFormVisible = false">取消</el-button>
+				<el-button type="primary" @click.native="addSubmit" :loading="addLoading">提交</el-button>
+			</div>
+		</el-dialog>
+
+		<!--编辑界面-->
+		<el-dialog title="编辑人员" v-if="editFormVisible" :visible.sync="editFormVisible" :close-on-click-modal="false" customClass='customWidth'>
+			<el-form :model="editForm" label-width="80px" :rules="formRules" ref="editForm" :inline="true" class="demo-form-inline">
+				<el-form-item label="姓名" prop="username">
+					<el-input v-model="editForm.username" autocomplete="off" placeholder="请输入姓名"></el-input>
+				</el-form-item>
+				<el-form-item label="手机号" prop="account">
+					<el-input v-model="editForm.account" disabled autocomplete="off" placeholder="请输入手机号(登录账号)"></el-input>
+				</el-form-item>
+                <el-form-item label="公司" prop="companyId">
+                    <el-input v-model="editForm.companyId" disabled autocomplete="off" placeholder="请选择所属公司"></el-input>
+				</el-form-item>
+                <el-form-item label="备注">
+                    <el-input v-model="editForm.roleName" autocomplete="off" placeholder="请输入备注"></el-input>
+				</el-form-item>
+			</el-form>
+			<div slot="footer" class="dialog-footer">
+                 <span style="color:#f00;float:left;margin-left:60px;">初始密码:000000</span>
+				<el-button @click.native="editFormVisible = false">取消</el-button>
+				<el-button type="primary" @click.native="editSubmit" :loading="editLoading">提交</el-button>
+			</div>
+		</el-dialog>
+
+        <!--邀请界面-->
+		<el-dialog title="邀请" v-if="inviteVisible" :visible.sync="inviteVisible" :close-on-click-modal="false" customClass='customWidth'>
+			<el-input placeholder="请复制邀请链接" v-model="inviteLink" class="input-with-select">
+                <el-button slot="append" v-clipboard:copy="inviteLink" v-clipboard:success="copyLink" v-clipboard:error="onError" type="primary" icon="el-icon-share">复制链接</el-button>
+            </el-input>
+		</el-dialog>
+	</section>
+</template>
+
+<script>
+	import util from '../../common/js/util'
+
+	export default {
+		data() {
+            var checkPhone = (rule, value, callback) => {
+                if (!value) {
+                    return callback(new Error('请输入联系方式'));
+                } else {
+                    const reg = /^1[0-9]\d{9}$/
+                    if (reg.test(value)) {
+                        callback();
+                    } else {
+                        return callback(new Error('请输入正确的联系方式'));
+                    }
+                }
+            };
+			return {
+				filters: {
+                    keyName: '',
+                    roleName: '',
+                    flag: '姓名',
+                    companyId: ''
+                },
+                
+                user: JSON.parse(sessionStorage.getItem('user')),
+                company: [],
+                projects: [],
+                //搜索用 涉及到的所有公司
+                allCompanies: [],
+
+				list: [],
+				total: 0,
+                page: 1,
+                size: 20,
+                listLoading: false,
+                tableHeight: 0,
+
+                formRules: {
+                    username: [
+						{ required: true, message: '请输入姓名', trigger: 'blur' }
+                    ],
+                    account: [
+                        { required: true, validator: checkPhone, trigger: 'blur'}
+                    ],
+                    teamName: [
+						{ required: true, message: '请选择人员类型', trigger: ["blur",'change'] }
+                    ],
+                    projectIds: [
+						{ required: true, message: '请选择参与项目', trigger: ["blur",'change'] }
+					],
+                    companyId: [
+						{ required: true, message: '请选择所属公司', trigger: ["blur",'change'] }
+					]
+                },
+
+                //新增界面是否显示
+                addFormVisible: false,
+				addLoading: false,
+				//新增界面数据
+				addForm: {
+					username: '',
+                    account: '',
+                    projectIds: '',
+                    companyId: '',
+                    roleName: '',
+                    flag: 0
+				},
+
+                //编辑界面是否显示
+				editFormVisible: false,
+				editLoading: false,
+				//编辑界面数据
+				editForm: {
+					id: 0,
+					username: '',
+                    account: '',
+                    companyId: '',
+                    roleName: '',
+                    flag: 1
+                },
+                
+                //邀请
+                inviteVisible: false,
+                inviteLink: ''
+			}
+		},
+		methods: {
+            //获取基础数据
+            getMsg(){
+                if(this.user.parentId == 1 && this.user.subordinateType == 0) {
+                    this.company = [];
+                    this.allCompanies = [];
+                    this.http.post(this.port.base.getCompanyList, {
+                        id: this.user.id,
+                        parentId: this.user.parentId
+                    }, res => {
+                        if (res.code == "ok") {
+                            this.company = res.data;
+                            this.allCompanies = res.data;
+                        } else {
+                            this.$message({
+                                message: res.msg,
+                                type: 'error'
+                            });
+                        }
+                    }, error => {
+                        this.$message({
+                            message: error,
+                            type: 'error'
+                        });
+                    })
+                } else if(this.user.parentId > 1 && this.user.isManager == 1) {
+                    this.http.post(this.port.project.projectByUser, {}, 
+                    res => {
+                        if (res.code == "ok") {
+                            this.projects = res.data;
+                            //再获取一下公司列表
+                            this.getAllCompanies();
+                        } else {
+                            this.$message({
+                                message: res.msg,
+                                type: 'error'
+                            });
+                        }
+                    }, error => {
+                        this.$message({
+                            message: error,
+                            type: 'error'
+                        });
+                    });
+                }
+            },  
+
+            //新版获取所有公司
+            getAllCompanies(){
+                this.allCompanies = [];
+                this.http.post(this.port.base.getInfo, {}, res => {
+                    if (res.code == "ok") {
+                        this.allCompanies = res.data;
+                    } else {
+                        this.$message({
+                            message: res.msg,
+                            type: 'error'
+                        });
+                    }
+                }, error => {
+                    this.$message({
+                        message: error,
+                        type: 'error'
+                    });
+                });
+            },
+
+            //分页
+			handleCurrentChange(val) {
+				this.page = val;
+				this.getUsers();
+            },
+
+            handleSizeChange(val) {
+                this.size = val;
+				this.getUsers();
+            },
+
+			//获取用户列表
+			getUsers() {
+				this.listLoading = true;
+                this.http.post(this.port.project.userList, {
+                    keyName: this.filters.keyName,
+                    currentPage: this.page,
+                    pageSize: this.size,
+                    companyId: this.filters.companyId==''?-1:this.filters.companyId,
+                    flag: this.filters.flag=='姓名'?0:this.filters.flag
+                }, res => {
+                    this.listLoading = false;
+                    if (res.code == "ok") {
+                        this.list = res.data.list;
+                        this.total = res.data.total;
+                    } else {
+                        this.$message({
+                            message: res.msg,
+                            type: 'error'
+                        });
+                    }
+                }, error => {
+                    this.listLoading = false;
+                    this.$message({
+                        message: error,
+                        type: 'error'
+                    });
+                })
+            },
+            
+            //显示新增界面
+			handleAdd() {
+                this.addFormVisible = true;
+				this.addForm = {
+                    parentId: this.user.id,
+					username: '',
+                    account: '',
+                    mobile: '',
+                    projectIds: '',
+					companyId: '',
+                    roleName: '',
+                    flag: 0
+				};
+            },
+
+            //新增
+			addSubmit() {
+				this.$refs.addForm.validate((valid) => {
+					if (valid) {
+						this.addLoading = true;
+                        this.http.post(this.port.project.addUser, this.addForm , res => {
+                            this.addLoading = false;
+                            if (res.code == "ok") {
+                                this.addFormVisible = false;
+                                this.$message({
+                                    message: '创建成功',
+                                    type: 'success'
+                                });
+                                this.getUsers();
+                            } else {
+                                this.$message({
+                                    message: res.msg,
+                                    type: 'error'
+                                });
+                            }
+                        }, error => {
+                            this.addLoading = false;
+                            this.addFormVisible = false;
+                            this.$message({
+                                message: error,
+                                type: 'error'
+                            });
+                        })
+					}
+				});
+			},
+
+			//删除
+			handleDel(index, row) {
+                this.$confirm('确认删除该人员吗?', '提示', {
+					type: 'warning'
+				}).then(() => {
+                    this.http.post(this.port.project.delUser, {
+                        id: row.id
+                    }, res => {
+                        if (res.code == "ok") {
+                            this.$message({
+                                message: '删除成功',
+                                type: 'success'
+                            });
+                            this.getUsers();
+                        } else {
+                            this.$message({
+                                message: res.msg,
+                                type: 'error'
+                            });
+                        }
+                    }, error => {
+                        this.$message({
+                            message: error,
+                            type: 'error'
+                        });
+                    })
+				});
+            },
+            
+			//显示编辑界面
+			handleEdit(index, row) {
+                this.editFormVisible = true;
+				this.editForm = {
+                    id: row.id,
+                    parentId: this.user.id,
+					username: row.username,
+                    account: row.account,
+					companyId: row.companyName,
+                    roleName: row.roleName,
+                    flag: 1
+                };
+            },
+            
+			//编辑
+			editSubmit() {
+				this.$refs.editForm.validate((valid) => {
+					if (valid) {
+                        this.editLoading = true;
+                        this.http.post(this.port.project.addUser, {
+                            id: this.editForm.id,
+                            parentId: this.editForm.parentId,
+                            username: this.editForm.username,
+                            roleName: this.editForm.roleName,
+                            flag: 1
+                        } , res => {
+                            this.editLoading = false;
+                            if (res.code == "ok") {
+                                this.editFormVisible = false;
+                                this.$message({
+                                    message: '修改成功',
+                                    type: 'success'
+                                });
+                                this.getUsers();
+                            } else {
+                                this.$message({
+                                    message: res.msg,
+                                    type: 'error'
+                                });
+                            }
+                        }, error => {
+                            this.editLoading = false;
+                            this.editFormVisible = false;
+                            this.$message({
+                                message: error,
+                                type: 'error'
+                            });
+                        })
+					}
+				});
+            },
+            
+            //修改
+            choseProject() {
+                if(this.addForm.projectIds == ""){
+                    this.company = [];
+                    this.addForm.companyId = null;
+                }else{
+                    this.http.post(this.port.base.getProduceCompany, {
+                        projectId: this.addForm.projectIds
+                    }, res => {
+                        if (res.code == "ok") {
+                            this.company = res.data;
+                        } else {
+                            this.$message({
+                                message: res.msg,
+                                type: 'error'
+                            });
+                        }
+                    }, error => {
+                        this.$message({
+                            message: error,
+                            type: 'error'
+                        });
+                    })
+                }
+            },
+
+            //邀请
+            invite(index, row) {
+                this.http.post(this.port.project.inviteUser, {
+                    inviteeId: row.id,
+                    projectId: row.projects[0].id,
+                    operatorId: this.user.id
+                } , res => {
+                    if (res.code == "ok") {
+                        this.inviteVisible = true;
+                        this.inviteLink = res.data.addressUrl;
+                    } else {
+                        this.$message({
+                            message: res.msg,
+                            type: 'error'
+                        });
+                    }
+                }, error => {
+                    this.$message({
+                        message: error,
+                        type: 'error'
+                    });
+                })
+            },
+
+            //复制链接
+            copyLink() {
+                //this.inviteVisible = false;
+                this.$message({
+                    message: "复制成功!",
+                    type: 'success'
+                });
+            },
+
+            onError(e) {
+                //this.inviteVisible = false;
+                this.$message({
+                    message: "复制失败!",
+                    type: 'error'
+                });
+            }
+        },
+        created() {
+            let height = window.innerHeight;
+            this.tableHeight = height - 210;
+            const that = this;
+            window.onresize = function temp() {
+                that.tableHeight = window.innerHeight - 210;    
+            };
+        },
+		mounted() {
+            this.getMsg();
+			this.getUsers();
+        }
+	}
+</script>
+
+<style scoped>
+    .el-input-group__append button.el-button {
+        background-color: #409EFF;
+        border-color: #409EFF;
+        color: #fff;
+    }
+</style>

+ 547 - 0
lib_vue/src/views/user/user.vue

@@ -0,0 +1,547 @@
+<template>
+	<section>
+		<!--工具条-->
+		<el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
+			<el-form :inline="true" :model="filters">
+                <el-col :span="3">
+                    <el-form-item>
+                        <el-select v-model="filters.companyId" clearable filterable placeholder="请选择公司">
+                            <el-option v-for="item in allCompanies" :key="item.id" :label="item.companyName" :value="item.id">
+                            </el-option>
+                        </el-select>
+                    </el-form-item>
+                </el-col>
+                <el-col :span="3">
+                    <el-form-item>
+                        <el-select v-model="filters.flag" placeholder="请选择查询条件">
+                            <el-option label="姓名" value="0"></el-option>
+                            <el-option label="手机号" value="1"></el-option>
+                        </el-select>
+                    </el-form-item>
+                </el-col>
+                <el-form-item>
+                    <el-input v-model="filters.keyName" clearable placeholder="请输入姓名或手机号进行搜索" style="width:250px;"></el-input>
+                </el-form-item>
+				<el-form-item>
+					<el-button type="primary" @click="getUsers">查询</el-button>
+				</el-form-item>
+				<el-form-item style="float:right;" v-if="user.subordinateType == 0 || user.isManager == 1">
+					<el-button type="primary" @click="handleAdd">新增</el-button>
+				</el-form-item>
+			</el-form>
+		</el-col>
+
+		<!--列表-->
+		<el-table :data="list" highlight-current-row :height="tableHeight" v-loading="listLoading" style="width: 100%;">
+			<el-table-column type="index" width="60"></el-table-column>
+			<el-table-column prop="username" label="姓名" width="120" sortable></el-table-column>
+			<el-table-column prop="account" label="手机号" width="180" sortable></el-table-column>
+			<!-- <el-table-column prop="mobile" label="联系方式" width="150" sortable></el-table-column> -->
+            <el-table-column prop="projects" label="参与项目" sortable>
+                <template slot-scope="scope">
+                    <span class="info" v-for="(item, index) in scope.row.projects">
+                        {{item.projectName}}
+                        <span v-if="scope.row.projects != null && index != scope.row.projects.length-1">、</span>
+                    </span>
+                </template>
+			</el-table-column>
+            <el-table-column prop="roleName" label="备注" width="180" sortable></el-table-column>
+            <el-table-column prop="teamName" label="类型" width="120" align="center" sortable></el-table-column>
+			<el-table-column prop="companyName" label="所属公司" sortable></el-table-column>
+			<el-table-column label="操作" align="left" width="230">
+				<template slot-scope="scope" v-if="user.id == scope.row.parentId || user.isManager == 1 || (user.parentId == 1 && user.subordinateType == 0)">
+					<el-button size="small" @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
+					<el-button type="danger" size="small" @click="handleDel(scope.$index, scope.row)">删除</el-button>
+                    <el-button type="primary" size="small" @click="invite(scope.$index, scope.row)" v-if="user.id != 1 && scope.row.projects != null && scope.row.projects.length == 1">邀请</el-button>
+				</template>
+			</el-table-column>
+		</el-table>
+
+		<!--工具条-->
+		<el-col :span="24" class="toolbar">
+            <el-pagination
+                @size-change="handleSizeChange"
+                @current-change="handleCurrentChange"
+                :page-sizes="[20 , 50 , 80 , 100]"
+                :page-size="20"
+                layout="total, sizes, prev, pager, next"
+                :total="total"
+                style="float:right;">
+            </el-pagination>
+		</el-col>
+
+        <!--新增界面-->
+		<el-dialog title="新增人员" v-if="addFormVisible" :visible.sync="addFormVisible" :close-on-click-modal="false" customClass='customWidth'>
+			<el-form :model="addForm" label-width="100px" :rules="formRules" ref="addForm" :inline="true" class="demo-form-inline">
+				<el-form-item label="姓名" prop="username">
+					<el-input v-model="addForm.username" autocomplete="off" placeholder="请输入姓名"></el-input>
+				</el-form-item>
+				<el-form-item label="手机号" prop="account">
+					<el-input v-model="addForm.account" autocomplete="off" placeholder="请输入手机号(登录账号)"></el-input>
+				</el-form-item>
+                <el-form-item v-if="!(user.parentId == 1 && user.subordinateType == 0)" label="参与项目" prop="projectIds">
+					<el-select v-model="addForm.projectIds" @change="choseProject" clearable filterable placeholder="请选择参与项目" style="width:202px">
+                        <el-option v-for="item in projects" :key="item.id" :label="item.projectName" :value="item.id">
+                        </el-option>
+                    </el-select>
+				</el-form-item>
+                <el-form-item label="公司" prop="companyId">
+					<el-select v-model="addForm.companyId" clearable filterable placeholder="请选择所属公司" style="width:202px">
+                        <el-option v-for="item in company" :key="item.id" :label="item.companyName" :value="item.id">
+                        </el-option>
+                    </el-select>
+				</el-form-item>
+                <el-form-item label="备注">
+                    <el-input v-model="addForm.roleName" autocomplete="off" placeholder="请输入备注"></el-input>
+				</el-form-item>
+			</el-form>
+			<div slot="footer" class="dialog-footer">
+                <span style="color:#f00;float:left;margin-left:60px;">初始密码:000000</span>
+				<el-button @click.native="addFormVisible = false">取消</el-button>
+				<el-button type="primary" @click.native="addSubmit" :loading="addLoading">提交</el-button>
+			</div>
+		</el-dialog>
+
+		<!--编辑界面-->
+		<el-dialog title="编辑人员" v-if="editFormVisible" :visible.sync="editFormVisible" :close-on-click-modal="false" customClass='customWidth'>
+			<el-form :model="editForm" label-width="80px" :rules="formRules" ref="editForm" :inline="true" class="demo-form-inline">
+				<el-form-item label="姓名" prop="username">
+					<el-input v-model="editForm.username" autocomplete="off" placeholder="请输入姓名"></el-input>
+				</el-form-item>
+				<el-form-item label="手机号" prop="account">
+					<el-input v-model="editForm.account" disabled autocomplete="off" placeholder="请输入手机号(登录账号)"></el-input>
+				</el-form-item>
+                <el-form-item label="公司" prop="companyId">
+                    <el-input v-model="editForm.companyId" disabled autocomplete="off" placeholder="请选择所属公司"></el-input>
+				</el-form-item>
+                <el-form-item label="备注">
+                    <el-input v-model="editForm.roleName" autocomplete="off" placeholder="请输入备注"></el-input>
+				</el-form-item>
+			</el-form>
+			<div slot="footer" class="dialog-footer">
+                 <span style="color:#f00;float:left;margin-left:60px;">初始密码:000000</span>
+				<el-button @click.native="editFormVisible = false">取消</el-button>
+				<el-button type="primary" @click.native="editSubmit" :loading="editLoading">提交</el-button>
+			</div>
+		</el-dialog>
+
+        <!--邀请界面-->
+		<el-dialog title="邀请" v-if="inviteVisible" :visible.sync="inviteVisible" :close-on-click-modal="false" customClass='customWidth'>
+			<el-input placeholder="请复制邀请链接" v-model="inviteLink" class="input-with-select">
+                <el-button slot="append" v-clipboard:copy="inviteLink" v-clipboard:success="copyLink" v-clipboard:error="onError" type="primary" icon="el-icon-share">复制链接</el-button>
+            </el-input>
+		</el-dialog>
+	</section>
+</template>
+
+<script>
+	import util from '../../common/js/util'
+
+	export default {
+		data() {
+            var checkPhone = (rule, value, callback) => {
+                if (!value) {
+                    return callback(new Error('请输入联系方式'));
+                } else {
+                    const reg = /^1[0-9]\d{9}$/
+                    if (reg.test(value)) {
+                        callback();
+                    } else {
+                        return callback(new Error('请输入正确的联系方式'));
+                    }
+                }
+            };
+			return {
+				filters: {
+                    keyName: '',
+                    roleName: '',
+                    flag: '姓名',
+                    companyId: ''
+                },
+                
+                user: JSON.parse(sessionStorage.getItem('user')),
+                company: [],
+                projects: [],
+                //搜索用 涉及到的所有公司
+                allCompanies: [],
+
+				list: [],
+				total: 0,
+                page: 1,
+                size: 20,
+                listLoading: false,
+                tableHeight: 0,
+
+                formRules: {
+                    username: [
+						{ required: true, message: '请输入姓名', trigger: 'blur' }
+                    ],
+                    account: [
+                        { required: true, validator: checkPhone, trigger: 'blur'}
+                    ],
+                    teamName: [
+						{ required: true, message: '请选择人员类型', trigger: ["blur",'change'] }
+                    ],
+                    projectIds: [
+						{ required: true, message: '请选择参与项目', trigger: ["blur",'change'] }
+					],
+                    companyId: [
+						{ required: true, message: '请选择所属公司', trigger: ["blur",'change'] }
+					]
+                },
+
+                //新增界面是否显示
+                addFormVisible: false,
+				addLoading: false,
+				//新增界面数据
+				addForm: {
+					username: '',
+                    account: '',
+                    projectIds: '',
+                    companyId: '',
+                    roleName: '',
+                    flag: 0
+				},
+
+                //编辑界面是否显示
+				editFormVisible: false,
+				editLoading: false,
+				//编辑界面数据
+				editForm: {
+					id: 0,
+					username: '',
+                    account: '',
+                    companyId: '',
+                    roleName: '',
+                    flag: 1
+                },
+                
+                //邀请
+                inviteVisible: false,
+                inviteLink: ''
+			}
+		},
+		methods: {
+            //获取基础数据
+            getMsg(){
+                if(this.user.parentId == 1 && this.user.subordinateType == 0) {
+                    this.company = [];
+                    this.allCompanies = [];
+                    this.http.post(this.port.base.getCompanyList, {
+                        id: this.user.id,
+                        parentId: this.user.parentId
+                    }, res => {
+                        if (res.code == "ok") {
+                            this.company = res.data;
+                            this.allCompanies = res.data;
+                        } else {
+                            this.$message({
+                                message: res.msg,
+                                type: 'error'
+                            });
+                        }
+                    }, error => {
+                        this.$message({
+                            message: error,
+                            type: 'error'
+                        });
+                    })
+                } else if(this.user.parentId > 1 && this.user.isManager == 1) {
+                    this.http.post(this.port.project.projectByUser, {}, 
+                    res => {
+                        if (res.code == "ok") {
+                            this.projects = res.data;
+                            //再获取一下公司列表
+                            this.getAllCompanies();
+                        } else {
+                            this.$message({
+                                message: res.msg,
+                                type: 'error'
+                            });
+                        }
+                    }, error => {
+                        this.$message({
+                            message: error,
+                            type: 'error'
+                        });
+                    });
+                }
+            },  
+
+            //新版获取所有公司
+            getAllCompanies(){
+                this.allCompanies = [];
+                this.http.post(this.port.base.getInfo, {}, res => {
+                    if (res.code == "ok") {
+                        this.allCompanies = res.data;
+                    } else {
+                        this.$message({
+                            message: res.msg,
+                            type: 'error'
+                        });
+                    }
+                }, error => {
+                    this.$message({
+                        message: error,
+                        type: 'error'
+                    });
+                });
+            },
+
+            //分页
+			handleCurrentChange(val) {
+				this.page = val;
+				this.getUsers();
+            },
+
+            handleSizeChange(val) {
+                this.size = val;
+				this.getUsers();
+            },
+
+			//获取用户列表
+			getUsers() {
+				this.listLoading = true;
+                this.http.post(this.port.project.userList, {
+                    keyName: this.filters.keyName,
+                    currentPage: this.page,
+                    pageSize: this.size,
+                    companyId: this.filters.companyId==''?-1:this.filters.companyId,
+                    flag: this.filters.flag=='姓名'?0:this.filters.flag
+                }, res => {
+                    this.listLoading = false;
+                    if (res.code == "ok") {
+                        this.list = res.data.list;
+                        this.total = res.data.total;
+                    } else {
+                        this.$message({
+                            message: res.msg,
+                            type: 'error'
+                        });
+                    }
+                }, error => {
+                    this.listLoading = false;
+                    this.$message({
+                        message: error,
+                        type: 'error'
+                    });
+                })
+            },
+            
+            //显示新增界面
+			handleAdd() {
+                this.addFormVisible = true;
+				this.addForm = {
+                    parentId: this.user.id,
+					username: '',
+                    account: '',
+                    mobile: '',
+                    projectIds: '',
+					companyId: '',
+                    roleName: '',
+                    flag: 0
+				};
+            },
+
+            //新增
+			addSubmit() {
+				this.$refs.addForm.validate((valid) => {
+					if (valid) {
+						this.addLoading = true;
+                        this.http.post(this.port.project.addUser, this.addForm , res => {
+                            this.addLoading = false;
+                            if (res.code == "ok") {
+                                this.addFormVisible = false;
+                                this.$message({
+                                    message: '创建成功',
+                                    type: 'success'
+                                });
+                                this.getUsers();
+                            } else {
+                                this.$message({
+                                    message: res.msg,
+                                    type: 'error'
+                                });
+                            }
+                        }, error => {
+                            this.addLoading = false;
+                            this.addFormVisible = false;
+                            this.$message({
+                                message: error,
+                                type: 'error'
+                            });
+                        })
+					}
+				});
+			},
+
+			//删除
+			handleDel(index, row) {
+                this.$confirm('确认删除该人员吗?', '提示', {
+					type: 'warning'
+				}).then(() => {
+                    this.http.post(this.port.project.delUser, {
+                        id: row.id
+                    }, res => {
+                        if (res.code == "ok") {
+                            this.$message({
+                                message: '删除成功',
+                                type: 'success'
+                            });
+                            this.getUsers();
+                        } else {
+                            this.$message({
+                                message: res.msg,
+                                type: 'error'
+                            });
+                        }
+                    }, error => {
+                        this.$message({
+                            message: error,
+                            type: 'error'
+                        });
+                    })
+				});
+            },
+            
+			//显示编辑界面
+			handleEdit(index, row) {
+                this.editFormVisible = true;
+				this.editForm = {
+                    id: row.id,
+                    parentId: this.user.id,
+					username: row.username,
+                    account: row.account,
+					companyId: row.companyName,
+                    roleName: row.roleName,
+                    flag: 1
+                };
+            },
+            
+			//编辑
+			editSubmit() {
+				this.$refs.editForm.validate((valid) => {
+					if (valid) {
+                        this.editLoading = true;
+                        this.http.post(this.port.project.addUser, {
+                            id: this.editForm.id,
+                            parentId: this.editForm.parentId,
+                            username: this.editForm.username,
+                            roleName: this.editForm.roleName,
+                            flag: 1
+                        } , res => {
+                            this.editLoading = false;
+                            if (res.code == "ok") {
+                                this.editFormVisible = false;
+                                this.$message({
+                                    message: '修改成功',
+                                    type: 'success'
+                                });
+                                this.getUsers();
+                            } else {
+                                this.$message({
+                                    message: res.msg,
+                                    type: 'error'
+                                });
+                            }
+                        }, error => {
+                            this.editLoading = false;
+                            this.editFormVisible = false;
+                            this.$message({
+                                message: error,
+                                type: 'error'
+                            });
+                        })
+					}
+				});
+            },
+            
+            //修改
+            choseProject() {
+                if(this.addForm.projectIds == ""){
+                    this.company = [];
+                    this.addForm.companyId = null;
+                }else{
+                    this.http.post(this.port.base.getProduceCompany, {
+                        projectId: this.addForm.projectIds
+                    }, res => {
+                        if (res.code == "ok") {
+                            this.company = res.data;
+                        } else {
+                            this.$message({
+                                message: res.msg,
+                                type: 'error'
+                            });
+                        }
+                    }, error => {
+                        this.$message({
+                            message: error,
+                            type: 'error'
+                        });
+                    })
+                }
+            },
+
+            //邀请
+            invite(index, row) {
+                this.http.post(this.port.project.inviteUser, {
+                    inviteeId: row.id,
+                    projectId: row.projects[0].id,
+                    operatorId: this.user.id
+                } , res => {
+                    if (res.code == "ok") {
+                        this.inviteVisible = true;
+                        this.inviteLink = res.data.addressUrl;
+                    } else {
+                        this.$message({
+                            message: res.msg,
+                            type: 'error'
+                        });
+                    }
+                }, error => {
+                    this.$message({
+                        message: error,
+                        type: 'error'
+                    });
+                })
+            },
+
+            //复制链接
+            copyLink() {
+                //this.inviteVisible = false;
+                this.$message({
+                    message: "复制成功!",
+                    type: 'success'
+                });
+            },
+
+            onError(e) {
+                //this.inviteVisible = false;
+                this.$message({
+                    message: "复制失败!",
+                    type: 'error'
+                });
+            }
+        },
+        created() {
+            let height = window.innerHeight;
+            this.tableHeight = height - 210;
+            const that = this;
+            window.onresize = function temp() {
+                that.tableHeight = window.innerHeight - 210;    
+            };
+        },
+		mounted() {
+            this.getMsg();
+			this.getUsers();
+        }
+	}
+</script>
+
+<style scoped>
+    .el-input-group__append button.el-button {
+        background-color: #409EFF;
+        border-color: #409EFF;
+        color: #fff;
+    }
+</style>