Browse Source

人员组织架构

钞小赢 5 years ago
parent
commit
6f3a586254
34 changed files with 1787 additions and 873 deletions
  1. 1 1
      shanXiPlatform/.env.development
  2. 14 14
      shanXiPlatform/mock/user.js
  3. 3 1
      shanXiPlatform/package.json
  4. 2 1
      shanXiPlatform/src/App.vue
  5. 0 0
      shanXiPlatform/src/api/system/organizationalStructure/granary.js
  6. 49 0
      shanXiPlatform/src/api/system/organizationalStructure/personnel.js
  7. 0 0
      shanXiPlatform/src/api/system/organizationalStructure/warehouse.js
  8. 48 0
      shanXiPlatform/src/api/system/userManagement/role.js
  9. 17 12
      shanXiPlatform/src/layout/components/AppMain.vue
  10. 24 0
      shanXiPlatform/src/layout/components/Foot/index.vue
  11. 30 34
      shanXiPlatform/src/layout/components/Navbar.vue
  12. 9 0
      shanXiPlatform/src/layout/components/Sidebar/index.vue
  13. 10 4
      shanXiPlatform/src/layout/index.vue
  14. 2 1
      shanXiPlatform/src/permission.js
  15. 108 154
      shanXiPlatform/src/router/index.js
  16. 70 44
      shanXiPlatform/src/store/modules/user.js
  17. 2 2
      shanXiPlatform/src/styles/global.scss
  18. 1 1
      shanXiPlatform/src/utils/auth.js
  19. 14 3
      shanXiPlatform/src/utils/request.js
  20. 1 0
      shanXiPlatform/src/views/basicInformation/admin/components/TodoList/index.vue
  21. 33 38
      shanXiPlatform/src/views/basicInformation/index.vue
  22. 48 17
      shanXiPlatform/src/views/login/index.vue
  23. 25 26
      shanXiPlatform/src/views/systemManagement/organizationalStructureManagement/granaryOrganizationalStructureManagement/subWarehouse/addSub.vue
  24. 26 27
      shanXiPlatform/src/views/systemManagement/organizationalStructureManagement/granaryOrganizationalStructureManagement/subWarehouse/addWarehouse.vue
  25. 19 22
      shanXiPlatform/src/views/systemManagement/organizationalStructureManagement/organizationalStructureTabs.vue
  26. 411 153
      shanXiPlatform/src/views/systemManagement/organizationalStructureManagement/personnelOrganizationalStructureManagement/addPersonnel.vue
  27. 152 66
      shanXiPlatform/src/views/systemManagement/organizationalStructureManagement/personnelOrganizationalStructureManagement/index.vue
  28. 50 0
      shanXiPlatform/src/views/systemManagement/userManagement/departmentManagement/addDepartment.vue
  29. 97 99
      shanXiPlatform/src/views/systemManagement/userManagement/departmentManagement/index.vue
  30. 193 0
      shanXiPlatform/src/views/systemManagement/userManagement/roleManagement/addRole.vue
  31. 117 105
      shanXiPlatform/src/views/systemManagement/userManagement/roleManagement/index.vue
  32. 178 39
      shanXiPlatform/src/views/systemManagement/userManagement/userManagement/addUser.vue
  33. 9 8
      shanXiPlatform/src/views/systemManagement/userManagement/userManagement/index.vue
  34. 24 1
      shanXiPlatform/vue.config.js

+ 1 - 1
shanXiPlatform/.env.development

@@ -2,4 +2,4 @@
2 2
 ENV = 'development'
3 3
 
4 4
 # base api
5
-VUE_APP_BASE_API = '/dev-api'
5
+VUE_APP_BASE_API = 'http://10.10.1.25:9099/'

+ 14 - 14
shanXiPlatform/mock/user.js

@@ -1,10 +1,10 @@
1 1
 
2 2
 const tokens = {
3 3
   admin: {
4
-    token: 'admin-token'
4
+    token: 'Token'
5 5
   },
6 6
   editor: {
7
-    token: 'editor-token'
7
+    token: 'Token'
8 8
   }
9 9
 }
10 10
 
@@ -33,12 +33,12 @@ module.exports = [
33 33
       const token = tokens[username]
34 34
 
35 35
       // mock error
36
-      if (!token) {
37
-        return {
38
-          code: 60204,
39
-          message: 'Account and password are incorrect.'
40
-        }
41
-      }
36
+      // if (!token) {
37
+      //   return {
38
+      //     code: 60204,
39
+      //     message: 'Account and password are incorrect.'
40
+      //   }
41
+      // }
42 42
 
43 43
       return {
44 44
         code: 20000,
@@ -56,12 +56,12 @@ module.exports = [
56 56
       const info = users[token]
57 57
 
58 58
       // mock error
59
-      if (!info) {
60
-        return {
61
-          code: 50008,
62
-          message: 'Login failed, unable to get user details.'
63
-        }
64
-      }
59
+      // if (!info) {
60
+      //   return {
61
+      //     code: 50008,
62
+      //     message: 'Login failed, unable to get user details.'
63
+      //   }
64
+      // }
65 65
 
66 66
       return {
67 67
         code: 20000,

+ 3 - 1
shanXiPlatform/package.json

@@ -12,7 +12,9 @@
12 12
     "new": "plop",
13 13
     "svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml",
14 14
     "test:unit": "jest --clearCache && vue-cli-service test:unit",
15
-    "test:ci": "npm run lint && npm run test:unit"
15
+    "test:ci": "npm run lint && npm run test:unit",
16
+    "start": "node index.js",
17
+    "server": "nodemon index.js --ignore client"
16 18
   },
17 19
   "dependencies": {
18 20
     "axios": "0.18.1",

+ 2 - 1
shanXiPlatform/src/App.vue

@@ -5,10 +5,11 @@
5 5
 </template>
6 6
 
7 7
 <script>
8
+
8 9
 export default {
9 10
   name: 'App'
10 11
 }
11 12
 </script>
12 13
 <style>
13 14
 
14
-</style>
15
+</style>

+ 0 - 0
shanXiPlatform/src/api/system/organizationalStructure/granary.js


+ 49 - 0
shanXiPlatform/src/api/system/organizationalStructure/personnel.js

@@ -0,0 +1,49 @@
1
+
2
+import request from '@/utils/request'
3
+// 人员组织架构接口
4
+
5
+// 列表接口及条件查询
6
+export function getPersonnelInfo(data) {
7
+  return request({
8
+    url: `/sysPersonnel/authority/getPage`,
9
+    method: 'post',
10
+    data
11
+  })
12
+}
13
+
14
+// 新增接口
15
+export function addPersonnelInfo(data) {
16
+  return request({
17
+    url: `/sysPersonnel/authority_button/add`,
18
+    method: 'post',
19
+    data
20
+  })
21
+}
22
+
23
+// 删除接口
24
+
25
+export function deletePersonnelInfo(params) {
26
+  return request({
27
+    url: `/sysPersonnel/authority_button/deleteById`,
28
+    method: 'delete',
29
+    params
30
+  })
31
+}
32
+
33
+// 修改接口
34
+export function updatePersonnelInfo(data) {
35
+  return request({
36
+    url: `/sysPersonnel/authority_button/update`,
37
+    method: 'post',
38
+    data
39
+  })
40
+}
41
+
42
+// 查看接口
43
+export function checkPersonnelInfo(id) {
44
+  return request({
45
+    url: `/sysPersonnel/authority/getById/${id}`,
46
+    method: 'get'
47
+
48
+  })
49
+}

+ 0 - 0
shanXiPlatform/src/api/system/organizationalStructure/warehouse.js


+ 48 - 0
shanXiPlatform/src/api/system/userManagement/role.js

@@ -0,0 +1,48 @@
1
+import request from '@/utils/request'
2
+
3
+// 获取资源树
4
+
5
+export function resourcesTree() {
6
+  return request({
7
+    url: `/resource/authority/getAll`,
8
+    method: 'post'
9
+
10
+  })
11
+}
12
+
13
+// 获取列表
14
+export function getUserInfo(data) {
15
+  return request({
16
+    url: `/role/authority/getPage`,
17
+    method: 'post',
18
+    data
19
+  })
20
+}
21
+
22
+// 新增用户
23
+export function addUserInfo(data) {
24
+  return request({
25
+    url: `/role/authority_button/add`,
26
+    method: 'post',
27
+    data
28
+  })
29
+}
30
+
31
+// 修改用户
32
+
33
+export function updateUserInfo(data) {
34
+  return request({
35
+    url: `/role/authority_button/update`,
36
+    method: 'post',
37
+    data
38
+  })
39
+}
40
+
41
+// 查看角色是否存在
42
+export function roleIsExit(params) {
43
+  return request({
44
+    url: `/role/authority_button/getByRoleName`,
45
+    method: 'get',
46
+    params
47
+  })
48
+}

+ 17 - 12
shanXiPlatform/src/layout/components/AppMain.vue

@@ -1,27 +1,26 @@
1 1
 <template>
2 2
   <section class="app-main">
3 3
     <!-- <transition name="fade-transform" mode="out-in"> -->
4
-      <keep-alive :include="cachedViews">
5
-        <router-view :key="key" />
6
-      </keep-alive>
4
+    <keep-alive :include="cachedViews">
5
+      <router-view :key="key" />
6
+    </keep-alive>
7 7
     <!-- </transition> -->
8
+
9
+    <foot />
10
+
8 11
   </section>
9 12
 </template>
10 13
 
11 14
 <script>
15
+import Foot from '@/layout/components/Foot/index'
12 16
 export default {
13 17
   name: 'AppMain',
14
-  data(){
15
-    return{
16
-      activeIndex: '1',
18
+  components: { Foot },
19
+  data() {
20
+    return {
21
+      activeIndex: '1'
17 22
     }
18 23
   },
19
-  methods:{
20
-    handleSelect(key, keyPath) {
21
-        console.log(key, keyPath);
22
-      }
23
-
24
-  },
25 24
   computed: {
26 25
     cachedViews() {
27 26
       return this.$store.state.tagsView.cachedViews
@@ -29,6 +28,12 @@ export default {
29 28
     key() {
30 29
       return this.$route.path
31 30
     }
31
+  },
32
+  methods: {
33
+    handleSelect(key, keyPath) {
34
+      console.log(key, keyPath)
35
+    }
36
+
32 37
   }
33 38
 }
34 39
 </script>

+ 24 - 0
shanXiPlatform/src/layout/components/Foot/index.vue

@@ -0,0 +1,24 @@
1
+<template>
2
+  <div>
3
+    <div class="foot">
4
+      2020 中储粮-标准化管理云平台 版权所有
5
+    </div>
6
+  </div>
7
+</template>
8
+<script>
9
+export default {
10
+  name: 'Foot'
11
+}
12
+</script>
13
+<style lang="scss" scoped>
14
+    .foot{
15
+        width:100%;
16
+        height:30px;
17
+        background:seagreen;
18
+        color:white;
19
+        line-height:30px;
20
+        text-align:center;
21
+        position: absolute;
22
+        bottom:0px;
23
+    }
24
+</style>

+ 30 - 34
shanXiPlatform/src/layout/components/Navbar.vue

@@ -1,67 +1,63 @@
1 1
 <template>
2 2
   <div class="navbar">
3 3
     <hamburger id="hamburger-container" :is-active="sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" />
4
- <div class="homeIcon" @click="goHome()">
4
+    <div class="homeIcon" @click="goHome()">
5 5
       <img src="../../assets/images/home.png"></img>
6 6
       <!-- <i class="el-icon-s-home" font-size:30px></i> -->
7
- </div>
8
- 
9
- 
10
-     
11
-   
7
+    </div>
8
+
9
+    <!-- <tags-view/> -->
10
+
12 11
     <breadcrumb id="breadcrumb-container" class="breadcrumb-container" />
13 12
 
14
-    <div  class="navbar_right">
15
-        
16
-        <div class="div_left"> 欢迎登录<span style="color:green">admin</span></div>
17
-        <div  class="div_right">
18
-            <div style="float:left;position:relative">
19
-               <img src="../../assets/images/newsNotice.png">
20
-               <div class="news_div">3</div>
21
-            </div>
22
-           <img src="../../assets/images/user.png">
23
-           <img src="../../assets/images/signOut.png" @click="loginOut()">
24
-        
25
-         
26
-         
27
-          
28
-          
29
-         
13
+    <div class="navbar_right">
14
+
15
+      <div class="div_left"> 欢迎登录<span style="color:green">admin</span></div>
16
+      <div class="div_right">
17
+        <div style="float:left;position:relative">
18
+          <img src="../../assets/images/newsNotice.png">
19
+          <div class="news_div">3</div>
30 20
         </div>
21
+        <img src="../../assets/images/user.png">
22
+        <img src="../../assets/images/signOut.png" @click="loginOut()">
23
+
31 24
       </div>
25
+    </div>
32 26
 
33 27
   </div>
34 28
 </template>
35 29
 
36 30
 <script>
37
-import { mapGetters } from "vuex"
38
-import Breadcrumb from "@/components/Breadcrumb"
39
-import Hamburger from "@/components/Hamburger"
31
+import { mapGetters } from 'vuex'
32
+import Breadcrumb from '@/components/Breadcrumb'
33
+import Hamburger from '@/components/Hamburger'
34
+// import TagsView from './TagsView'
40 35
 
41 36
 export default {
42 37
   components: {
43 38
     Breadcrumb,
44
-    Hamburger,
39
+    Hamburger
40
+
45 41
   },
46 42
   computed: {
47
-    ...mapGetters(["sidebar", "avatar", "device"]),
43
+    ...mapGetters(['sidebar', 'avatar', 'device'])
48 44
   },
49 45
   methods: {
50
-    //点击home图标时
46
+    // 点击home图标时
51 47
     goHome() {
52
-      this.$router.push({ path: "/home" })
48
+      this.$router.push({ path: '/home' })
53 49
     },
54 50
 
55
-    //退出
51
+    // 退出
56 52
     async loginOut() {
57
-      await this.$store.dispatch("user/logout")
53
+      await this.$store.dispatch('user/logout')
58 54
       this.$router.push(`/login?redirect=${this.$route.fullPath}`)
59 55
     },
60 56
 
61 57
     toggleSideBar() {
62
-      this.$store.dispatch("app/toggleSideBar")
63
-    },
64
-  },
58
+      this.$store.dispatch('app/toggleSideBar')
59
+    }
60
+  }
65 61
 }
66 62
 </script>
67 63
 

+ 9 - 0
shanXiPlatform/src/layout/components/Sidebar/index.vue

@@ -26,6 +26,15 @@ import variables from '@/styles/variables.scss'
26 26
 
27 27
 export default {
28 28
   components: { SidebarItem, Logo },
29
+  data() {
30
+    return {
31
+      routes: []
32
+    }
33
+  },
34
+  created() {
35
+    // this.routes = this.$route;
36
+    // console.log(this.routes,'lllllll');
37
+  },
29 38
   computed: {
30 39
     ...mapGetters([
31 40
       'permission_routes',

+ 10 - 4
shanXiPlatform/src/layout/index.vue

@@ -1,23 +1,28 @@
1 1
 <template>
2 2
   <div :class="classObj" class="app-wrapper">
3
-   
3
+
4 4
     <div v-if="device==='mobile'&&sidebar.opened" class="drawer-bg" @click="handleClickOutside" />
5 5
     <sidebar class="sidebar-container" />
6 6
     <div :class="{hasTagsView:needTagsView}" class="main-container">
7
-       
7
+
8 8
       <div :class="{'fixed-header':fixedHeader}">
9 9
         <navbar />
10 10
         <tags-view v-if="needTagsView" />
11 11
       </div>
12
-      <app-main />
12
+      <app-main>
13
+        <foot />
14
+      </app-main>
13 15
       <right-panel v-if="showSettings">
14 16
         <settings />
15 17
       </right-panel>
18
+
16 19
     </div>
20
+
17 21
   </div>
18 22
 </template>
19 23
 
20 24
 <script>
25
+import Foot from './components/Foot/index'
21 26
 import RightPanel from '@/components/RightPanel'
22 27
 import { AppMain, Navbar, Settings, Sidebar, TagsView } from './components'
23 28
 import ResizeMixin from './mixin/ResizeHandler'
@@ -31,7 +36,8 @@ export default {
31 36
     RightPanel,
32 37
     Settings,
33 38
     Sidebar,
34
-    TagsView
39
+    TagsView,
40
+    Foot
35 41
   },
36 42
   mixins: [ResizeMixin],
37 43
   computed: {

+ 2 - 1
shanXiPlatform/src/permission.js

@@ -8,7 +8,7 @@ import getPageTitle from '@/utils/get-page-title'
8 8
 
9 9
 NProgress.configure({ showSpinner: false }) // NProgress Configuration
10 10
 
11
-const whiteList = ['/login', '/auth-redirect'] // no redirect whitelist
11
+const whiteList = ['/login', 'auth-redirect'] // no redirect whitelist
12 12
 
13 13
 router.beforeEach(async(to, from, next) => {
14 14
   // start progress bar
@@ -27,6 +27,7 @@ router.beforeEach(async(to, from, next) => {
27 27
       NProgress.done() // hack: https://github.com/PanJiaChen/vue-element-admin/pull/2939
28 28
     } else {
29 29
       // determine whether the user has obtained his permission roles through getInfo
30
+
30 31
       const hasRoles = store.getters.roles && store.getters.roles.length > 0
31 32
       if (hasRoles) {
32 33
         next()

+ 108 - 154
shanXiPlatform/src/router/index.js

@@ -6,7 +6,6 @@ Vue.use(Router)
6 6
 /* Layout */
7 7
 import Layout from '@/layout'
8 8
 
9
-
10 9
 /* Router Modules */
11 10
 // import componentsRouter from './modules/components'
12 11
 
@@ -14,12 +13,9 @@ import Layout from '@/layout'
14 13
 
15 14
 // import warehouseBasicInformation from '@/views/systemManagement/organizationalStructureManagement/warehouseBasicInformation';
16 15
 
17
-import organizationalStructureTabs from '@/views/systemManagement/organizationalStructureManagement/organizationalStructureTabs';
18
-
19
-
20
-
21
-import userTabs from '@/views/systemManagement/userManagement/userTabs';
16
+import organizationalStructureTabs from '@/views/systemManagement/organizationalStructureManagement/organizationalStructureTabs'
22 17
 
18
+import userTabs from '@/views/systemManagement/userManagement/userTabs'
23 19
 
24 20
 /**
25 21
  * Note: sub-menu only appear when route children.length >= 1
@@ -48,28 +44,27 @@ import userTabs from '@/views/systemManagement/userManagement/userTabs';
48 44
  * all roles can be accessed
49 45
  */
50 46
 export const constantRoutes = [
51
-  {
52
-    path: '/redirect',
53
-    component: Layout,
54
-    hidden: true,
55
-    children: [
56
-      {
57
-        path: '/redirect/:path(.*)',
58
-        component: () => import('@/views/redirect/index')
59
-      }
60
-    ]
61
-  },
47
+  // {
48
+  //   path: '/redirect',
49
+  //   component: Layout,
50
+  //   hidden: true,
51
+  // children: [
52
+  //     {
53
+  //       path: '/redirect/:path(.*)',
54
+  //       component: () => import('@/views/redirect/index')
55
+  //     }
56
+  //   ]
57
+  // },
62 58
   {
63 59
     path: '/login',
64 60
     component: () => import('@/views/login/index'),
65 61
     hidden: true
66 62
   },
67
-  {
68
-    path: '/auth-redirect',
69
-    component: () => import('@/views/login/auth-redirect'),
70
-    hidden: true
71
-  },
72
-
63
+  // {
64
+  //   path: '/auth-redirect',
65
+  //   component: () => import('@/views/login/auth-redirect'),
66
+  //   hidden: true
67
+  // },
73 68
 
74 69
   // {
75 70
   //   path: '/',
@@ -85,7 +80,7 @@ export const constantRoutes = [
85 80
   //   ]
86 81
   // },
87 82
 
88
-  //首页
83
+  // 首页
89 84
   {
90 85
     path: '/',
91 86
     component: Layout,
@@ -101,8 +96,7 @@ export const constantRoutes = [
101 96
     ]
102 97
   },
103 98
 
104
-
105
-  //基本信息
99
+  // 基本信息
106 100
   {
107 101
 
108 102
     path: '/basicInformation',
@@ -110,41 +104,32 @@ export const constantRoutes = [
110 104
     // redirect: '/basicMatter',
111 105
     name: 'BasicInformation',
112 106
 
107
+    meta: { title: '基本信息', icon: 'dashboard', affix: false },
108
+
113 109
     children: [
110
+      // 基本信息/人员结构
114 111
       {
115
-        path: '/basicInformation',
116
-        component: () => import('@/views/basicInformation/index'),
117
-        name: 'BasicInformation',
112
+        path: 'personnelStructure',
113
+        component: () => import('@/views/basicInformation/personnelStructure'),
114
+        name: 'PersonnelStructure',
115
+        hiddren: true,
116
+        meta: { title: '人员结构', icon: 'dashboard', affix: false }
117
+
118
+      },
119
+      // 基本信息/政策制度
120
+      {
121
+        path: 'policySystem',
122
+        component: () => import('@/views/basicInformation/policySystem'),
123
+        name: 'PolicySystem',
124
+        hiddren: true,
125
+        meta: { title: '政策制度', icon: 'dashboard', affix: false }
118 126
 
119
-        meta: { title: '基本信息', icon: 'dashboard', affix: false },
120 127
       }
121 128
     ]
122
-    // children: [
123
-    //   // 基本信息/人员结构
124
-    //   {
125
-    //     path: '/basicInformation/personnelStructure',
126
-    //     component: () => import('@/views/basicInformation/personnelStructure'),
127
-    //     name: 'PersonnelStructure',
128
-    //     meta: { title: '人员结构', icon: 'dashboard', affix: false}
129
-
130
-    //   },
131
-    //      // 基本信息/政策制度
132
-    //   {
133
-    //     path: '/basicInformation/policySystem',
134
-    //     component: () => import('@/views/basicInformation/policySystem'),
135
-    //     name: 'PolicySystem',
136
-    //     meta: { title: '政策制度', icon: 'dashboard', affix: false}
137
-
138
-    //   },
139
-    // ]
140 129
 
141 130
   },
142 131
 
143
-
144
-
145
-
146
-
147
-  //数量质量
132
+  // 数量质量
148 133
   {
149 134
     path: '/countQuality',
150 135
     component: Layout,
@@ -152,7 +137,7 @@ export const constantRoutes = [
152 137
     meta: { title: '数量质量', icon: 'dashboard' },
153 138
     children: [
154 139
       {
155
-        //数量质量/仓房信息
140
+        // 数量质量/仓房信息
156 141
         path: 'warehouseInformation',
157 142
         component: () => import('@/views/countQuality/warehouseInformation'),
158 143
         name: 'WarehouseInformation',
@@ -181,18 +166,12 @@ export const constantRoutes = [
181 166
         component: () => import('@/views/countQuality/deliveryQuality'),
182 167
         name: 'DeliveryQuality',
183 168
         meta: { title: '出库质量管理', icon: 'documentation', affix: false }
184
-      },
169
+      }
185 170
     ]
186 171
 
187
-
188 172
   },
189 173
 
190
-
191
-
192
-
193
-
194
-
195
-  //储量管理
174
+  // 储量管理
196 175
   {
197 176
     path: '/reservesManagement',
198 177
     component: Layout,
@@ -225,9 +204,9 @@ export const constantRoutes = [
225 204
     ]
226 205
   },
227 206
 
228
-  //药剂管理
207
+  // 药剂管理
229 208
   {
230
-    path: "/medicamentManagement",
209
+    path: '/medicamentManagement',
231 210
     component: Layout,
232 211
     name: 'MedicamentManagement',
233 212
     meta: { title: '药剂管理', icon: 'dashboard', affix: false },
@@ -258,8 +237,7 @@ export const constantRoutes = [
258 237
     ]
259 238
   },
260 239
 
261
-
262
-  //设施设备
240
+  // 设施设备
263 241
   {
264 242
     path: '/facilitiesEquipment',
265 243
     component: Layout,
@@ -288,12 +266,11 @@ export const constantRoutes = [
288 266
         component: () => import('@/views/facilitiesEquipment/equipmentProcurementCollection'),
289 267
         name: 'EquipmentProcurementCollection',
290 268
         meta: { title: '设备采购领用', icon: 'dashboard', affix: false }
291
-      },
269
+      }
292 270
     ]
293 271
   },
294 272
 
295
-
296
-  //安全生产
273
+  // 安全生产
297 274
   {
298 275
     path: '/safeProduction',
299 276
     component: Layout,
@@ -314,13 +291,11 @@ export const constantRoutes = [
314 291
         component: () => import('@/views/safeProduction/safetyManagement'),
315 292
         name: 'SafetyManagement',
316 293
         meta: { title: '安全员管理', icon: 'dashboard', affix: false }
317
-      },
294
+      }
318 295
     ]
319 296
   },
320 297
 
321
-
322
-
323
-  //监督检查
298
+  // 监督检查
324 299
   {
325 300
     path: '/supervisionInspection',
326 301
     component: Layout,
@@ -336,12 +311,12 @@ export const constantRoutes = [
336 311
         name: 'Library',
337 312
         meta: { title: '本库检查', icon: 'dashboard', affix: false }
338 313
       },
339
- // 监督检查/本库详情
314
+      // 监督检查/本库详情
340 315
       {
341 316
         path: 'libraryDetail',
342 317
         component: () => import('@/views/supervisionInspection/library/libraryDetail'),
343 318
         name: 'LibraryDetail',
344
-        hidden:true,
319
+        hidden: true,
345 320
         meta: { title: '本库检查详情', icon: 'dashboard', affix: false }
346 321
       },
347 322
 
@@ -353,19 +328,17 @@ export const constantRoutes = [
353 328
         meta: { title: '分库检查', icon: 'dashboard', affix: false }
354 329
       },
355 330
 
356
-        
357
-
358 331
       // 监督检查/租仓、委托库点
359 332
       {
360 333
         path: 'entrustedRepository',
361 334
         component: () => import('@/views/supervisionInspection/entrustedRepository'),
362 335
         name: 'EntrustedRepository',
363 336
         meta: { title: '租仓、委托库点检查', icon: 'dashboard', affix: false }
364
-      },
337
+      }
365 338
     ]
366 339
   },
367 340
 
368
-  //库外管理
341
+  // 库外管理
369 342
   {
370 343
     path: '/warehouseOutsideManagement',
371 344
     component: Layout,
@@ -386,12 +359,11 @@ export const constantRoutes = [
386 359
         component: () => import('@/views/WarehouseOutsideManagement/entrusted'),
387 360
         name: 'Entrusted',
388 361
         meta: { title: '委托管理', icon: 'dashboard', affix: false }
389
-      },
362
+      }
390 363
     ]
391 364
   },
392 365
 
393
-
394
-  //专家指导
366
+  // 专家指导
395 367
   {
396 368
     path: '/guidanceExperts',
397 369
     component: Layout,
@@ -421,12 +393,11 @@ export const constantRoutes = [
421 393
         component: () => import('@/views/guidanceExperts/questionCenter'),
422 394
         name: 'QuestionCenter',
423 395
         meta: { title: '问题中心', icon: 'dashboard', affix: false }
424
-      },
396
+      }
425 397
     ]
426 398
   },
427 399
 
428
-
429
-  //系统管理
400
+  // 系统管理
430 401
   {
431 402
     path: '/systemManagement',
432 403
     component: Layout,
@@ -445,7 +416,7 @@ export const constantRoutes = [
445 416
       //   系统管理/组织架构管理
446 417
       {
447 418
         path: 'organizationalStructureManagement',
448
-        component:organizationalStructureTabs,
419
+        component: organizationalStructureTabs,
449 420
         name: 'OrganizationalStructureManagement',
450 421
         redirect: 'organizationalStructureManagement/granaryOrganizationalStructureManagement',
451 422
         meta: { title: '组织架构管理', icon: 'dashboard', affix: false },
@@ -455,12 +426,11 @@ export const constantRoutes = [
455 426
             path: 'granaryOrganizationalStructureManagement',
456 427
             component: () => import('@/views/systemManagement/organizationalStructureManagement/granaryOrganizationalStructureManagement/index'),
457 428
             name: 'GranaryOrganizationalStructureManagement',
458
-           
429
+
459 430
             hidden: true,
460 431
             meta: { title: '粮仓组织架构管理', icon: 'dashboard', affix: false }
461 432
           },
462 433
 
463
-          
464 434
           //   系统管理/组织架构管理/人员组织架构管理
465 435
           {
466 436
             path: 'personnelOrganizationalStructureManagement',
@@ -469,65 +439,59 @@ export const constantRoutes = [
469 439
             hidden: true,
470 440
             meta: { title: '人员组织架构管理', icon: 'dashboard', affix: false }
471 441
           },
472
-           // 系统管理/组织架构管理/仓房基本信息
473
-           {
474
-            path: 'warehouseBasicInformation', 
442
+          // 系统管理/组织架构管理/仓房基本信息
443
+          {
444
+            path: 'warehouseBasicInformation',
475 445
             component: () => import('@/views/systemManagement/organizationalStructureManagement/warehouseBasicInformation/index'),
476 446
             name: 'WarehouseBasicInformation',
477 447
             hidden: true,
478
-            meta: { title: '仓房基本信息', icon: 'dashboard',affix: false  }
479
-           },
480
-          
448
+            meta: { title: '粮库基本信息', icon: 'dashboard', affix: false }
449
+          }
481 450
 
482 451
         ]
483 452
       },
484 453
 
485
-
486
-       //   系统管理/组织架构管理/粮仓组织架构管理/新增直属库
487
-       {
454
+      //   系统管理/组织架构管理/粮仓组织架构管理/新增直属库
455
+      {
488 456
         path: '/granaryOrganizationalStructureManagement/directlyLibrary',
489 457
         component: () => import('@/views/systemManagement/organizationalStructureManagement/granaryOrganizationalStructureManagement/addDirectlyLibrary'),
490 458
         name: 'AddDirectlyLibrary',
491 459
         hidden: true,
492
-        meta: { title: '新增直属库', icon: 'dashboard', affix: false }
460
+        meta: { title: '新增直属库', icon: 'dashboard', affix: false, noCache: true }
493 461
       },
494 462
 
495
-
496
-
497
-       //   系统管理/组织架构管理/粮仓组织架构管理/新增分库
498
-       {
463
+      //   系统管理/组织架构管理/粮仓组织架构管理/新增分库
464
+      {
499 465
         path: '/granaryOrganizationalStructureManagement/sub',
500 466
         component: () => import('@/views/systemManagement/organizationalStructureManagement/granaryOrganizationalStructureManagement/subWarehouse/addSub'),
501 467
         name: 'AddSub',
502 468
         hidden: true,
503
-        meta: { title: '新增分库', icon: 'dashboard', affix: false }
469
+        meta: { title: '新增分库', icon: 'dashboard', affix: false, noCache: true }
504 470
       },
505 471
 
506
-
507 472
       //   系统管理/组织架构管理/粮仓组织架构管理/新增仓房
508 473
       {
509 474
         path: '/granaryOrganizationalStructureManagement/warehouse',
510 475
         component: () => import('@/views/systemManagement/organizationalStructureManagement/granaryOrganizationalStructureManagement/subWarehouse/addWarehouse'),
511 476
         name: 'AddWarehouse',
512 477
         hidden: true,
513
-        meta: { title: '新增仓房', icon: 'dashboard', affix: false }
478
+        meta: { title: '新增仓房', icon: 'dashboard', affix: false, noCache: true }
514 479
       },
515 480
 
481
+      //   系统管理/组织架构管理/人员组织架构/新增工作人员
482
+      {
483
+        path: '/personnelOrganizationalStructureManagement/personnel',
484
+        component: () => import('@/views/systemManagement/organizationalStructureManagement/personnelOrganizationalStructureManagement/addPersonnel'),
516 485
 
517
-        //   系统管理/组织架构管理/人员组织架构/新增工作人员
518
-        {
519
-          path: '/personnelOrganizationalStructureManagement/personnel',
520
-          component: () => import('@/views/systemManagement/organizationalStructureManagement/personnelOrganizationalStructureManagement/addPersonnel'),
521
-         
522
-          name: 'AddPersonnel',
523
-          hidden: true,
524
-          meta: { title: '新增工作人员', icon: 'dashboard', affix: false }
525
-        },
486
+        name: 'AddPersonnel',
487
+        hidden: true,
488
+        meta: { title: '新增工作人员', icon: 'dashboard', affix: false, noCache: true }
489
+      },
526 490
 
527 491
       //   系统管理/用户管理
528 492
       {
529 493
         path: 'user',
530
-        component:userTabs,
494
+        component: userTabs,
531 495
         name: 'user',
532 496
         redirect: 'user/userManagement',
533 497
         meta: { title: '用户管理', icon: 'dashboard', affix: false },
@@ -542,7 +506,6 @@ export const constantRoutes = [
542 506
             meta: { title: '用户管理', icon: 'dashboard', affix: false }
543 507
           },
544 508
 
545
-          
546 509
           //   系统管理/用户管理/部门管理
547 510
           {
548 511
             path: 'departmentManagement',
@@ -551,29 +514,27 @@ export const constantRoutes = [
551 514
             hidden: true,
552 515
             meta: { title: '部门管理', icon: 'dashboard', affix: false }
553 516
           },
554
-           // 系统管理/用户管理/角色管理
555
-           {
556
-            path: 'roleManagement', 
517
+          // 系统管理/用户管理/角色管理
518
+          {
519
+            path: 'roleManagement',
557 520
             component: () => import('@/views/systemManagement/userManagement/roleManagement/index'),
558 521
             name: 'RoleManagement',
559 522
             hidden: true,
560
-            meta: { title: '角色管理', icon: 'dashboard',affix: false  }
561
-           },
562
-             // 系统管理/用户管理/审批人管理
523
+            meta: { title: '角色管理', icon: 'dashboard', affix: false }
524
+          },
525
+          // 系统管理/用户管理/审批人管理
563 526
 
564
-           {
565
-            path: 'approverManagement', 
527
+          {
528
+            path: 'approverManagement',
566 529
             component: () => import('@/views/systemManagement/userManagement/approverManagement/index'),
567 530
             name: 'ApproverManagement',
568 531
             hidden: true,
569
-            meta: { title: '审批人管理', icon: 'dashboard',affix: false  }
570
-           },
571
-          
532
+            meta: { title: '审批人管理', icon: 'dashboard', affix: false }
533
+          }
572 534
 
573 535
         ]
574 536
       },
575 537
 
576
-
577 538
       //   系统管理/用户管理/新增用户
578 539
       {
579 540
         path: '/userManagement/addUser',
@@ -583,6 +544,23 @@ export const constantRoutes = [
583 544
         meta: { title: '新增用户', icon: 'dashboard', affix: false }
584 545
       },
585 546
 
547
+      //   系统管理/角色管理/新增角色
548
+      {
549
+        path: '/roleManagement/addRole',
550
+        component: () => import('@/views/systemManagement/userManagement/roleManagement/addRole'),
551
+        name: 'AddRole',
552
+        hidden: true,
553
+        meta: { title: '新增角色', icon: 'dashboard', affix: false }
554
+      },
555
+
556
+      //   系统管理/部门管理/新增部门
557
+      {
558
+        path: '/departmentManagement/addDepartment',
559
+        component: () => import('@/views/systemManagement/userManagement/departmentManagement/addDepartment'),
560
+        name: 'AddDepartment',
561
+        hidden: true,
562
+        meta: { title: '新增部门', icon: 'dashboard', affix: false }
563
+      },
586 564
 
587 565
       //   系统管理/预警管理
588 566
       {
@@ -592,7 +570,6 @@ export const constantRoutes = [
592 570
         meta: { title: '预警管理', icon: 'dashboard', affix: false }
593 571
       },
594 572
 
595
-
596 573
       //   系统管理/器材库
597 574
       {
598 575
         path: 'equipmentWarehouse',
@@ -608,7 +585,6 @@ export const constantRoutes = [
608 585
         name: 'PolicySystem',
609 586
         meta: { title: '政策制度', icon: 'dashboard', affix: false }
610 587
       },
611
-      
612 588
 
613 589
       //   系统管理/操作日志
614 590
       {
@@ -616,9 +592,9 @@ export const constantRoutes = [
616 592
         component: () => import('@/views/systemManagement/operationLog/index'),
617 593
         name: 'OperationLog',
618 594
         meta: { title: '操作日志', icon: 'dashboard', affix: false }
619
-      },
595
+      }
620 596
     ]
621
-  },
597
+  }
622 598
 
623 599
 ]
624 600
 
@@ -628,30 +604,8 @@ export const constantRoutes = [
628 604
  */
629 605
 export const asyncRoutes = [
630 606
 
631
-
632
-
633
-
634
-
635
-
636
-
637 607
   /** when your routing map is too long, you can split it into small modules **/
638 608
 
639
-
640
-
641
-
642
-
643
-
644
-
645
-
646
-
647
-
648
-
649
-
650
-
651
-
652
-
653
-
654
-
655 609
   // {
656 610
   //   path: 'external-link',
657 611
   //   component: Layout,

+ 70 - 44
shanXiPlatform/src/store/modules/user.js

@@ -30,65 +30,91 @@ const mutations = {
30 30
 
31 31
 const actions = {
32 32
   // user login
33
+
33 34
   login({ commit }, userInfo) {
34 35
     const { username, password } = userInfo
35 36
     return new Promise((resolve, reject) => {
36
-      login({ username: username.trim(), password: password }).then(response => {
37
-        const { data } = response
38
-        commit('SET_TOKEN', data.token)
39
-        setToken(data.token)
40
-        resolve()
41
-      }).catch(error => {
42
-        reject(error)
43
-      })
37
+      var data = {
38
+        token: '132efegrthy'
39
+      }
40
+      console.log(data.token)
41
+      commit('SET_TOKEN', data.token)
42
+      setToken(data.token)
43
+      resolve()
44
+      // login({ username: username.trim(), password: password }).then(response => {
45
+      //   const { data } = response
46
+      //   // commit('SET_TOKEN', data.token)
47
+      //   // setToken(data.token)
48
+      //   // resolve()
49
+      // }).catch(error => {
50
+      //   reject(error)
51
+      // })
44 52
     })
45 53
   },
46 54
 
47 55
   // get user info
48 56
   getInfo({ commit, state }) {
49 57
     return new Promise((resolve, reject) => {
50
-      getInfo(state.token).then(response => {
51
-        const { data } = response
52
-
53
-        if (!data) {
54
-          reject('Verification failed, please Login again.')
55
-        }
56
-
57
-        const { roles, name, avatar, introduction } = data
58
-
59
-        // roles must be a non-empty array
60
-        if (!roles || roles.length <= 0) {
61
-          reject('getInfo: roles must be a non-null array!')
62
-        }
63
-
64
-        commit('SET_ROLES', roles)
65
-        commit('SET_NAME', name)
66
-        commit('SET_AVATAR', avatar)
67
-        commit('SET_INTRODUCTION', introduction)
68
-        resolve(data)
69
-      }).catch(error => {
70
-        reject(error)
71
-      })
58
+      var data = { roles: ['admin', 'editor'], name: 'admin', avatar: '', introduction: '' }
59
+      commit('SET_ROLES', data.roles)
60
+      commit('SET_NAME', data.name)
61
+      commit('SET_AVATAR', data.avatar)
62
+      commit('SET_INTRODUCTION', data.introduction)
63
+      resolve(data)
64
+      //   getInfo(state.token).then(response => {
65
+      //     const { data } = response
66
+
67
+      //     if (!data) {
68
+      //       reject('Verification failed, please Login again.')
69
+      //     }
70
+
71
+      //     const { roles, name, avatar, introduction } = data
72
+
73
+      //     // roles must be a non-empty array
74
+      //     if (!roles || roles.length <= 0) {
75
+      //       reject('getInfo: roles must be a non-null array!')
76
+      //     }
77
+
78
+    //     commit('SET_ROLES', roles)
79
+    //     commit('SET_NAME', name)
80
+    //     commit('SET_AVATAR', avatar)
81
+    //     commit('SET_INTRODUCTION', introduction)
82
+    //     resolve(data)
83
+    //   }).catch(error => {
84
+    //     reject(error)
85
+    //   })
72 86
     })
73 87
   },
74 88
 
75 89
   // user logout
90
+
76 91
   logout({ commit, state, dispatch }) {
77 92
     return new Promise((resolve, reject) => {
78
-      logout(state.token).then(() => {
79
-        commit('SET_TOKEN', '')
80
-        commit('SET_ROLES', [])
81
-        removeToken()
82
-        resetRouter()
83
-
84
-        // reset visited views and cached views
85
-        // to fixed https://github.com/PanJiaChen/vue-element-admin/issues/2485
86
-        dispatch('tagsView/delAllViews', null, { root: true })
87
-
88
-        resolve()
89
-      }).catch(error => {
90
-        reject(error)
91
-      })
93
+      commit('SET_TOKEN', '')
94
+      commit('SET_ROLES', [])
95
+      removeToken()
96
+      resetRouter()
97
+
98
+      // reset visited views and cached views
99
+      // to fixed https://github.com/PanJiaChen/vue-element-admin/issues/2485
100
+      dispatch('tagsView/delAllViews', null, { root: true })
101
+
102
+      resolve()
103
+
104
+      // logout(state.token).then(() => {
105
+      //   commit('SET_TOKEN', '')
106
+      //   commit('SET_ROLES', [])
107
+      //   removeToken()
108
+      //   resetRouter()
109
+
110
+      //   // reset visited views and cached views
111
+      //   // to fixed https://github.com/PanJiaChen/vue-element-admin/issues/2485
112
+      //   dispatch('tagsView/delAllViews', null, { root: true })
113
+
114
+      //   resolve()
115
+      // }).catch(error => {
116
+      //   reject(error)
117
+      // })
92 118
     })
93 119
   },
94 120
 

+ 2 - 2
shanXiPlatform/src/styles/global.scss

@@ -1,12 +1,12 @@
1 1
 .global{
2
-    height:calc(100vh - 60px);
2
+    height:calc(100vh - 60px - 30px);
3 3
     background-color: #ececec;
4 4
     padding: 15px;  
5 5
     overflow: hidden;
6 6
 
7 7
     .mainContainer
8 8
     {
9
-        height:calc(100vh - 115px);
9
+        height:calc(100vh - 145px);
10 10
         padding: 15px;
11 11
         background-color: #ffffff;
12 12
         overflow: auto;

+ 1 - 1
shanXiPlatform/src/utils/auth.js

@@ -1,6 +1,6 @@
1 1
 import Cookies from 'js-cookie'
2 2
 
3
-const TokenKey = 'Admin-Token'
3
+const TokenKey = 'Token'
4 4
 
5 5
 export function getToken() {
6 6
   return Cookies.get(TokenKey)

+ 14 - 3
shanXiPlatform/src/utils/request.js

@@ -5,7 +5,10 @@ import { getToken } from '@/utils/auth'
5 5
 
6 6
 // create an axios instance
7 7
 const service = axios.create({
8
-  baseURL: process.env.VUE_APP_BASE_API, // url = base url + request url
8
+  // baseURL: process.env.VUE_APP_BASE_API,
9
+  baseURL: '/api',
10
+
11
+  // url = base url + request url
9 12
   // withCredentials: true, // send cookies when cross-domain requests
10 13
   timeout: 5000 // request timeout
11 14
 })
@@ -19,7 +22,7 @@ service.interceptors.request.use(
19 22
       // let each request carry token
20 23
       // ['X-Token'] is a custom headers key
21 24
       // please modify it according to the actual situation
22
-      config.headers['X-Token'] = getToken()
25
+      config.headers['Token'] = getToken()
23 26
     }
24 27
     return config
25 28
   },
@@ -43,7 +46,15 @@ service.interceptors.response.use(
43 46
    * You can also judge the status by HTTP Status Code
44 47
    */
45 48
   response => {
46
-    const res = response.data
49
+    const res = response.data //
50
+
51
+    // 走框架接口,会先在这里拿到服务器返回的数据,如果出现请求超时,或者token获取,或者一些公共错误,可以在这里判断拦截,然后在返回
52
+
53
+    if (true) {
54
+      return res
55
+    } else {
56
+      return Promise.reject(new Error(res.message || 'Error')) // 返回错误,可以如下面所示,给一个弹框提示错误之后,在返回
57
+    }
47 58
 
48 59
     // if the custom code is not 20000, it is judged as an error.
49 60
     if (res.code !== 20000) {

+ 1 - 0
shanXiPlatform/src/views/basicInformation/admin/components/TodoList/index.vue

@@ -38,6 +38,7 @@
38 38
 </template>
39 39
 
40 40
 <script>
41
+
41 42
 import Todo from './Todo.vue'
42 43
 
43 44
 const STORAGE_KEY = 'todos'

+ 33 - 38
shanXiPlatform/src/views/basicInformation/index.vue

@@ -1,26 +1,21 @@
1 1
 <template>
2 2
   <div style="padding:10px">
3 3
     <el-tabs v-model="activeName" @tab-click="handleClick">
4
-      <el-tab-pane label="机构人员" name="1"> 机构人员 </el-tab-pane>
4
+      <el-tab-pane label="人员结构" name="1">人员结构</el-tab-pane>
5 5
 
6 6
       <el-tab-pane label="政策制度" name="2">
7 7
         <el-table :data="policeSystemData" stripe style="width: 100%" border>
8
-          <el-table-column label="序号" type="index" align="center">
9
-          </el-table-column>
10
-          <el-table-column prop="issueDate" label="发布日期" align="center">
11
-          </el-table-column>
12
-          <el-table-column prop="issuer" label="发布者" align="center">
13
-          </el-table-column>
14
-          <el-table-column prop="title" label="标题" align="center">
15
-          </el-table-column>
8
+          <el-table-column label="序号" type="index" align="center" />
9
+          <el-table-column prop="issueDate" label="发布日期" align="center" />
10
+          <el-table-column prop="issuer" label="发布者" align="center" />
11
+          <el-table-column prop="title" label="标题" align="center" />
16 12
           <el-table-column label="操作" align="center">
17 13
             <template slot-scope="scope">
18 14
               <el-button
19
-                @click="checkPoliceSystem(scope.row)"
20 15
                 type="text"
21 16
                 size="small"
22
-                >查看</el-button
23
-              >
17
+                @click="checkPoliceSystem(scope.row)"
18
+              >查看</el-button>
24 19
             </template>
25 20
           </el-table-column>
26 21
         </el-table>
@@ -36,8 +31,8 @@
36 31
   </div>
37 32
 </template>
38 33
 <script>
39
-//引入分页
40
-import Pagination from "@/components/Pagination"
34
+// 引入分页
35
+import Pagination from '@/components/Pagination'
41 36
 export default {
42 37
   components: { Pagination },
43 38
   data() {
@@ -50,36 +45,36 @@ export default {
50 45
         importance: undefined,
51 46
         title: undefined,
52 47
         type: undefined,
53
-        sort: "+id",
48
+        sort: '+id'
54 49
       },
55
-      activeName: "1",
56
-      //表格数据
50
+      activeName: '1',
51
+      // 表格数据
57 52
       policeSystemData: [
58 53
         {
59
-          //发布日期
60
-          issueDate: "2020-1-1",
54
+          // 发布日期
55
+          issueDate: '2020-1-1',
61 56
           //   发布者
62
-          issuer: "中储粮山西分公司",
63
-          //标题
64
-          title: "关于2021年小麦收购的相关事项",
57
+          issuer: '中储粮山西分公司',
58
+          // 标题
59
+          title: '关于2021年小麦收购的相关事项'
65 60
         },
66 61
         {
67
-          //发布日期
68
-          issueDate: "2020-1-1",
62
+          // 发布日期
63
+          issueDate: '2020-1-1',
69 64
           //   发布者
70
-          issuer: "中储粮山西分公司",
71
-          //标题
72
-          title: "关于2021年小麦收购的相关事项",
65
+          issuer: '中储粮山西分公司',
66
+          // 标题
67
+          title: '关于2021年小麦收购的相关事项'
73 68
         },
74 69
         {
75
-          //发布日期
76
-          issueDate: "2020-1-1",
70
+          // 发布日期
71
+          issueDate: '2020-1-1',
77 72
           //   发布者
78
-          issuer: "中储粮山西分公司",
79
-          //标题
80
-          title: "关于2021年小麦收购的相关事项",
81
-        },
82
-      ],
73
+          issuer: '中储粮山西分公司',
74
+          // 标题
75
+          title: '关于2021年小麦收购的相关事项'
76
+        }
77
+      ]
83 78
     }
84 79
   },
85 80
 
@@ -87,11 +82,11 @@ export default {
87 82
     handleClick(tab, event) {
88 83
       console.log(tab, event)
89 84
     },
90
-    //机构人员查看
85
+    // 机构人员查看
91 86
     checkPoliceSystem(row) {
92 87
       console.log(row)
93 88
     },
94
-    getList() {},
95
-  },
89
+    getList() {}
90
+  }
96 91
 }
97
-</script>
92
+</script>

+ 48 - 17
shanXiPlatform/src/views/login/index.vue

@@ -1,7 +1,13 @@
1 1
 <template>
2 2
   <div class="login-container">
3
-    <el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form" autocomplete="on" label-position="left">
4
-
3
+    <el-form
4
+      ref="loginForm"
5
+      :model="loginForm"
6
+      :rules="loginRules"
7
+      class="login-form"
8
+      autocomplete="on"
9
+      label-position="left"
10
+    >
5 11
       <div class="title-container">
6 12
         <h3 class="title">Login Form</h3>
7 13
       </div>
@@ -21,7 +27,12 @@
21 27
         />
22 28
       </el-form-item>
23 29
 
24
-      <el-tooltip v-model="capsTooltip" content="Caps lock is On" placement="right" manual>
30
+      <el-tooltip
31
+        v-model="capsTooltip"
32
+        content="Caps lock is On"
33
+        placement="right"
34
+        manual
35
+      >
25 36
         <el-form-item prop="password">
26 37
           <span class="svg-container">
27 38
             <svg-icon icon-class="password" />
@@ -40,31 +51,45 @@
40 51
             @keyup.enter.native="handleLogin"
41 52
           />
42 53
           <span class="show-pwd" @click="showPwd">
43
-            <svg-icon :icon-class="passwordType === 'password' ? 'eye' : 'eye-open'" />
54
+            <svg-icon
55
+              :icon-class="passwordType === 'password' ? 'eye' : 'eye-open'"
56
+            />
44 57
           </span>
45 58
         </el-form-item>
46 59
       </el-tooltip>
47 60
 
48
-      <el-button :loading="loading" type="primary" style="width:100%;margin-bottom:30px;" @click.native.prevent="handleLogin">Login</el-button>
61
+      <!-- <el-button :loading="loading" type="primary" style="width:100%;margin-bottom:30px;" @click.native.prevent="handleLogin">Login</el-button> -->
62
+
63
+      <el-button
64
+        :loading="loading"
65
+        type="primary"
66
+        style="width: 100%; margin-bottom: 30px"
67
+        @click="handleLogin()"
68
+      >Login</el-button>
49 69
 
50
-      <div style="position:relative">
70
+      <div style="position: relative">
51 71
         <div class="tips">
52 72
           <span>Username : admin</span>
53 73
           <span>Password : any</span>
54 74
         </div>
55 75
         <div class="tips">
56
-          <span style="margin-right:18px;">Username : editor</span>
76
+          <span style="margin-right: 18px">Username : editor</span>
57 77
           <span>Password : any</span>
58 78
         </div>
59 79
 
60
-        <el-button class="thirdparty-button" type="primary" @click="showDialog=true">
80
+        <el-button
81
+          class="thirdparty-button"
82
+          type="primary"
83
+          @click="showDialog = true"
84
+        >
61 85
           Or connect with
62 86
         </el-button>
63 87
       </div>
64 88
     </el-form>
65 89
 
66 90
     <el-dialog title="Or connect with" :visible.sync="showDialog">
67
-      Can not be simulated on local, so please combine you own business simulation! ! !
91
+      Can not be simulated on local, so please combine you own business
92
+      simulation! ! !
68 93
       <br>
69 94
       <br>
70 95
       <br>
@@ -101,8 +126,12 @@ export default {
101 126
         password: '111111'
102 127
       },
103 128
       loginRules: {
104
-        username: [{ required: true, trigger: 'blur', validator: validateUsername }],
105
-        password: [{ required: true, trigger: 'blur', validator: validatePassword }]
129
+        username: [
130
+          { required: true, trigger: 'blur', validator: validateUsername }
131
+        ],
132
+        password: [
133
+          { required: true, trigger: 'blur', validator: validatePassword }
134
+        ]
106 135
       },
107 136
       passwordType: 'password',
108 137
       capsTooltip: false,
@@ -140,7 +169,7 @@ export default {
140 169
   methods: {
141 170
     checkCapslock(e) {
142 171
       const { key } = e
143
-      this.capsTooltip = key && key.length === 1 && (key >= 'A' && key <= 'Z')
172
+      this.capsTooltip = key && key.length === 1 && key >= 'A' && key <= 'Z'
144 173
     },
145 174
     showPwd() {
146 175
       if (this.passwordType === 'password') {
@@ -158,6 +187,8 @@ export default {
158 187
           this.loading = true
159 188
           this.$store.dispatch('user/login', this.loginForm)
160 189
             .then(() => {
190
+              console.log('判断登录结果')
191
+
161 192
               this.$router.push({ path: this.redirect || '/', query: this.otherQuery })
162 193
               this.loading = false
163 194
             })
@@ -204,8 +235,8 @@ export default {
204 235
 /* 修复input 背景不协调 和光标变色 */
205 236
 /* Detail see https://github.com/PanJiaChen/vue-element-admin/pull/927 */
206 237
 
207
-$bg:#283443;
208
-$light_gray:#fff;
238
+$bg: #283443;
239
+$light_gray: #fff;
209 240
 $cursor: #fff;
210 241
 
211 242
 @supports (-webkit-mask: none) and (not (cater-color: $cursor)) {
@@ -248,9 +279,9 @@ $cursor: #fff;
248 279
 </style>
249 280
 
250 281
 <style lang="scss" scoped>
251
-$bg:#2d3a4b;
252
-$dark_gray:#889aa4;
253
-$light_gray:#eee;
282
+$bg: #2d3a4b;
283
+$dark_gray: #889aa4;
284
+$light_gray: #eee;
254 285
 
255 286
 .login-container {
256 287
   min-height: 100%;

+ 25 - 26
shanXiPlatform/src/views/systemManagement/organizationalStructureManagement/granaryOrganizationalStructureManagement/subWarehouse/addSub.vue

@@ -1,43 +1,42 @@
1 1
 <template>
2
-  <div id="directlyLibrary">
3
-    <div class="title">新增分库</div>
4 2
 
5
-    <div class="main">
6
-      <div class="main_top">
7
-        <div>仓库名称:</div>
8
-        <div class="">
9
-          <el-input v-model="input" placeholder="请输入内容"></el-input>
3
+  <div class="global">
4
+    <div class="mainContainer">
5
+      <div class="title">新增分库</div>
6
+
7
+      <div class="main">
8
+        <div class="main_top">
9
+          <div>仓库名称:</div>
10
+          <div class="">
11
+            <el-input v-model="subName" placeholder="请输入内容" />
12
+          </div>
13
+        </div>
14
+        <div class="main_bottom">
15
+          <div>所属:</div>
16
+          <div>山西分公司</div>
10 17
         </div>
11
-      </div>
12
-      <div class="main_bottom">
13
-        <div>所属:</div>
14
-        <div>山西分公司</div>
15
-      </div>
16 18
         <div class="btns">
17
-      <el-button>取消</el-button>
18
-      <el-button>保存</el-button>
19
-    </div>
20
-    </div>
19
+          <el-button>取消</el-button>
20
+          <el-button>保存</el-button>
21
+        </div>
22
+      </div>
21 23
 
22
-  
24
+    </div>
23 25
   </div>
24 26
 </template>
25 27
 <script>
26 28
 export default {
27
-  name: "AddSub",
29
+  name: 'AddSub',
28 30
   data() {
29 31
     return {
30
-      formLabelWidth: "100px",
31
-      directlyLibrary: {
32
-        name: "",
33
-        company: "山西分公司",
34
-      },
32
+      formLabelWidth: '100px',
33
+      subName: ''
35 34
     }
36
-  },
35
+  }
37 36
 }
38 37
 </script>
39 38
 <style lang="scss" scoped>
40
-#directlyLibrary {
39
+.mainContainer {
41 40
   padding: 20px;
42 41
   .title {
43 42
     margin-bottom: 20px;
@@ -67,4 +66,4 @@ export default {
67 66
  .el-input__inner {
68 67
   width:100%;
69 68
 }
70
-</style>
69
+</style>

+ 26 - 27
shanXiPlatform/src/views/systemManagement/organizationalStructureManagement/granaryOrganizationalStructureManagement/subWarehouse/addWarehouse.vue

@@ -1,44 +1,43 @@
1 1
 <template>
2
-  <div id="directlyLibrary">
3
-    <div class="title">新增仓房</div>
2
+  <!-- <div id="directlyLibrary"> -->
3
+  <div class="global">
4
+    <div class="mainContainer">
5
+      <div class="title">新增仓房</div>
4 6
 
5
-    <div class="main">
6
-      <div class="main_top">
7
-        <div>仓房名称:</div>
8
-        <div class="">
9
-          <el-input v-model="input" placeholder="请输入内容"></el-input>
7
+      <div class="main">
8
+        <div class="main_top">
9
+          <div>仓房名称:</div>
10
+          <div class="">
11
+            <el-input v-model="warehouseName" placeholder="请输入内容" />
12
+          </div>
13
+        </div>
14
+        <div class="main_bottom">
15
+          <div>所属:</div>
16
+          <div>山西分公司></div>
17
+          <div>中央储备粮太原直属库有限公司</div>
18
+        </div>
19
+        <div class="btns">
20
+          <el-button>取消</el-button>
21
+          <el-button>保存</el-button>
10 22
         </div>
11 23
       </div>
12
-      <div class="main_bottom">
13
-        <div>所属:</div>
14
-        <div>山西分公司></div>
15
-        <div>中央储备粮太原直属库有限公司></div>
16
-      </div>
17
-      <div class="btns">
18
-      <el-button>取消</el-button>
19
-      <el-button>保存</el-button>
20
-    </div>
21
-    </div>
22 24
 
23
-    
25
+    </div>
24 26
   </div>
25 27
 </template>
26 28
 <script>
27 29
 export default {
28
-  name: "AddWarehouse",
30
+  name: 'AddWarehouse',
29 31
   data() {
30 32
     return {
31
-      formLabelWidth: "100px",
32
-      directlyLibrary: {
33
-        name: "",
34
-        company: "山西分公司",
35
-      },
33
+      formLabelWidth: '100px',
34
+      warehouseName: ''
36 35
     }
37
-  },
36
+  }
38 37
 }
39 38
 </script>
40 39
 <style lang="scss" scoped>
41
-#directlyLibrary {
40
+.mainContainer {
42 41
   padding: 20px;
43 42
   .title {
44 43
     margin-bottom: 20px;
@@ -68,4 +67,4 @@ export default {
68 67
  .el-input__inner {
69 68
   width:100%;
70 69
 }
71
-</style>
70
+</style>

+ 19 - 22
shanXiPlatform/src/views/systemManagement/organizationalStructureManagement/organizationalStructureTabs.vue

@@ -5,50 +5,47 @@
5 5
         <el-tab-pane
6 6
           label="粮仓组织架构管理"
7 7
           name="GranaryOrganizationalStructureManagement"
8
-        ></el-tab-pane>
8
+        />
9 9
         <el-tab-pane
10 10
           label="人员组织架构管理"
11 11
           name="PersonnelOrganizationalStructureManagement"
12
-        ></el-tab-pane>
12
+        />
13 13
         <el-tab-pane
14
-          label="仓房基本信息"
14
+          label="粮库基本信息"
15 15
           name="WarehouseBasicInformation"
16
-        ></el-tab-pane>
16
+        />
17 17
       </el-tabs>
18 18
       <div id="main">
19
-        
20
-        <router-view></router-view>
19
+
20
+        <router-view />
21 21
       </div>
22 22
     </div>
23 23
   </div>
24 24
 </template>
25 25
 <script>
26 26
 
27
-
28 27
 export default {
29
-  name: "OrganizationalStructureTabs",
30
-  
28
+  name: 'OrganizationalStructureTabs',
29
+
31 30
   data() {
32 31
     return {
33
-     
34
-      activeName: "GranaryOrganizationalStructureManagement",
32
+
33
+      activeName: 'GranaryOrganizationalStructureManagement'
35 34
     }
36 35
   },
37 36
   mounted() {
38
-    this.activeName = this.$route.name;
37
+    this.activeName = this.$route.name
39 38
   },
40 39
   methods: {
41
-    handleClick(tab, event){
42
-        this.$router.push({
43
-          name: tab.name
44
-        });
45
-    },
46
- 
47
-  },
40
+    handleClick(tab, event) {
41
+      this.$router.push({
42
+        name: tab.name
43
+      })
44
+    }
45
+
46
+  }
48 47
 }
49 48
 </script>
50 49
 <style lang="scss" scoped>
51 50
 
52
-
53
-
54
-</style>
51
+</style>

+ 411 - 153
shanXiPlatform/src/views/systemManagement/organizationalStructureManagement/personnelOrganizationalStructureManagement/addPersonnel.vue

@@ -1,153 +1,404 @@
1 1
 <template>
2
-  <div id="personel">
3
-    <div class="title">新增人员信息</div>
2
+  <div class="global">
3
+    <div class="mainContainer">
4
+      <div class="title">{{ title }}人员信息</div>
4 5
 
5
-    <div class="company">
6
-      <span>所属公司:</span>
7
-      <span></span>
8
-    </div>
9
-    <div>
10
-      <div class="basicInfo">
11
-        <div>基本信息</div>
12
-        <div>
13
-          <el-form :inline="true" class="demo-form-inline" label-width="100px">
14
-            <el-form-item label="人员姓名:">
15
-              <el-input></el-input>
16
-            </el-form-item>
17
-
18
-            <el-form-item label="性别:">
19
-              <el-input></el-input>
20
-            </el-form-item>
21
-            <el-form-item label="联系方式:">
22
-              <el-input></el-input>
23
-            </el-form-item>
24
-
25
-            <el-form-item label="出生年月:">
26
-              <el-input></el-input>
27
-            </el-form-item>
28
-
29
-            <el-form-item label="邮箱:">
30
-              <el-input></el-input>
31
-            </el-form-item>
32
-            <el-form-item label="工作年限:">
33
-              <el-input></el-input>
34
-            </el-form-item>
35
-
36
-            <el-form-item label="岗位(职位):">
37
-              <el-input></el-input>
38
-            </el-form-item>
39
-
40
-            <el-form-item label="政治面貌:">
41
-              <el-input></el-input>
42
-            </el-form-item>
43
-            <el-form-item label="入党事件:">
44
-              <el-input></el-input>
45
-            </el-form-item>
46
-
47
-            <div>
48
-              <span>
49
-                上传头像
50
-              </span>
51
-             
52
-                 <el-upload
53
-                class="avatar-uploader"
54
-                action="https://jsonplaceholder.typicode.com/posts/"
55
-                :show-file-list="false"
56
-                :on-success="handleAvatarSuccess"
57
-                :before-upload="beforeAvatarUpload"
58
-              >
59
-                <img v-if="imageUrl" :src="imageUrl" class="avatar" />
60
-                <i v-else class="el-icon-plus avatar-uploader-icon"></i>
61
-              </el-upload>
62
-          
63
-             
64
-            </div>
65
-           
66
-
67
-           <div class="educational">
68
-            <div>教育学历</div>
69
-              <el-form-item label="第一学历:">
70
-              <el-input></el-input>
71
-            </el-form-item>
72
-
73
-            <el-form-item label="毕业院校:">
74
-              <el-input></el-input>
75
-            </el-form-item>
76
-            <el-form-item label="专业:">
77
-              <el-input></el-input>
78
-            </el-form-item>
79
-
80
-
81
-               <el-form-item label="教育形式:">
82
-              <el-input></el-input>
83
-            </el-form-item>
84
-
85
-            <el-form-item label="学位:">
86
-              <el-input></el-input>
87
-            </el-form-item>
88
-
89
-            </div>
90
-
91
-            <div class="major">
92
-            
93
-            <div>专业证书</div>
94
-
95
-             <el-form-item label="专业:">
96
-              <el-input></el-input>
97
-            </el-form-item>
98
-
99
-            <el-form-item label="等级:">
100
-              <el-input></el-input>
101
-            </el-form-item>
102
-            <el-form-item label="颁证机构:">
103
-              <el-input></el-input>
104
-            </el-form-item>
105
-
106
-             <el-form-item label="颁证年月:">
107
-              <el-input></el-input>
108
-            </el-form-item>
109
-
110
-           </div>
111
-          </el-form>
6
+      <div class="company">
7
+        <span>所属公司:</span>
8
+        <span />
9
+      </div>
10
+      <div>
11
+        <div class="basicInfo">
12
+          <div>基本信息</div>
13
+          <div>
14
+            <el-form
15
+              ref="ruleForm"
16
+              :inline="true"
17
+              :model="personnel"
18
+              class="demo-form-inline"
19
+              label-width="100px"
20
+              :rules="rules"
21
+            >
22
+              <el-form-item label="人员姓名:" prop="uname">
23
+                <el-input v-model="personnel.uname" />
24
+              </el-form-item>
25
+
26
+              <el-form-item label="性别:">
27
+                <el-select v-model="personnel.usex" placeholder="请选择">
28
+                  <el-option label="男" value="0" />
29
+                  <el-option label="女" value="1" />
30
+                </el-select>
31
+              </el-form-item>
32
+              <el-form-item label="联系方式:" prop="uphone">
33
+                <el-input v-model="personnel.uphone" />
34
+              </el-form-item>
35
+
36
+              <el-form-item label="出生日期:">
37
+                <!-- <el-input v-model="personnel.ubirthday"></el-input> -->
38
+                <el-date-picker
39
+                  v-model="personnel.ubirthday"
40
+                  type="date"
41
+                  placeholder="选择日期"
42
+                />
43
+              </el-form-item>
44
+
45
+              <el-form-item label="邮箱:">
46
+                <el-input v-model="personnel.umail" />
47
+              </el-form-item>
48
+              <el-form-item label="工作年限:">
49
+                <el-input v-model="personnel.pworkYears" />
50
+              </el-form-item>
51
+
52
+              <el-form-item label="岗位(职位):" prop="ppost">
53
+                <el-select v-model="personnel.ppost">
54
+                  <el-option label="科长" value="0" />
55
+                  <el-option label="保管员" value="1" />
56
+                </el-select>
57
+              </el-form-item>
58
+
59
+              <el-form-item label="政治面貌:">
60
+                <el-select v-model="personnel.ppoliticalOutlook">
61
+                  <el-option label="党员" value="0" />
62
+                  <el-option label="群众" value="1" />
63
+                </el-select>
64
+              </el-form-item>
65
+              <el-form-item label="入党时间:">
66
+                <!-- <el-input v-model="personnel.ppartyTime"></el-input> -->
67
+                <el-date-picker
68
+                  v-model="personnel.ppartyTime"
69
+                  type="date"
70
+                  placeholder="选择日期"
71
+                />
72
+              </el-form-item>
73
+              <el-form-item label="所属科室:" prop="pdepartment">
74
+                <el-select v-model="personnel.pdepartment">
75
+                  <el-option label="仓储科" value="0" />
76
+                  <el-option label="财务科" value="1" />
77
+                </el-select>
78
+              </el-form-item>
79
+
80
+              <div>
81
+                <span> 上传头像 </span>
82
+
83
+                <el-upload
84
+                  class="avatar-uploader"
85
+                  action="https://jsonplaceholder.typicode.com/posts/"
86
+                  :show-file-list="false"
87
+                  :on-success="handleAvatarSuccess"
88
+                  :before-upload="beforeAvatarUpload"
89
+                >
90
+                  <img v-if="imageUrl" :src="imageUrl" class="avatar">
91
+                  <i v-else class="el-icon-plus avatar-uploader-icon" />
92
+                </el-upload>
93
+              </div>
94
+
95
+              <div class="educational">
96
+                <div>教育学历</div>
97
+                <el-form-item label="第一学历:">
98
+                  <el-select v-model="personnel.pfirstDegree">
99
+                    <el-option label="男" value="0" />
100
+                    <el-option label="女" value="1" />
101
+                  </el-select>
102
+                </el-form-item>
103
+
104
+                <el-form-item label="毕业院校:">
105
+                  <el-input v-model="personnel.puniversityGraduated" />
106
+                </el-form-item>
107
+                <el-form-item label="专业:">
108
+                  <el-input v-model="personnel.pmajor" />
109
+                </el-form-item>
110
+
111
+                <el-form-item label="教育形式:">
112
+                  <el-select v-model="personnel.pformEducationTwo">
113
+                    <el-option label="男" value="0" />
114
+                    <el-option label="女" value="1" />
115
+                  </el-select>
116
+                </el-form-item>
117
+
118
+                <el-form-item label="学位:">
119
+                  <el-input v-model="personnel.pAcademicDegree" />
120
+                </el-form-item>
121
+                <div class="education2">
122
+                  <el-form-item label="最高学历:">
123
+                    <el-select v-model="personnel.pHighestEducation">
124
+                      <el-option label="男" value="0" />
125
+                      <el-option label="女" value="1" />
126
+                    </el-select>
127
+                  </el-form-item>
128
+
129
+                  <el-form-item label="毕业院校:">
130
+                    <el-input
131
+                      v-model="personnel.puniversityGraduatedTwo"
132
+                    />
133
+                  </el-form-item>
134
+                  <el-form-item label="专业:">
135
+                    <el-input v-model="personnel.pmajorTwo" />
136
+                  </el-form-item>
137
+
138
+                  <el-form-item label="教育形式:">
139
+                    <el-select v-model="personnel.pformEducationTwo">
140
+                      <el-option label="男" value="0" />
141
+                      <el-option label="女" value="1" />
142
+                    </el-select>
143
+                  </el-form-item>
144
+
145
+                  <el-form-item label="学位:">
146
+                    <el-input v-model="personnel.pacademicDegreeTwo" />
147
+                  </el-form-item>
148
+                </div>
149
+              </div>
150
+
151
+              <!-- <div class="major">
152
+                <div>专业证书</div>
153
+
154
+                <el-form-item label="专业:">
155
+                  <el-input v-model="personnel.pmajorThree"></el-input>
156
+                </el-form-item>
157
+
158
+                <el-form-item label="等级:">
159
+                  <el-input v-model="personnel.pGrade"></el-input>
160
+                </el-form-item>
161
+                <el-form-item label="颁证机构:">
162
+                  <el-input v-model="personnel.pLicensingAgency"></el-input>
163
+                </el-form-item>
164
+
165
+                <el-form-item label="颁证年月:">
166
+                  <el-input v-model="personnel.pLicensingTime"></el-input>
167
+                </el-form-item>
168
+              </div> -->
169
+            </el-form>
170
+          </div>
171
+        </div>
172
+
173
+        <div class="btns">
174
+          <el-button type="success" plain @click="cancel()">取消</el-button>
175
+          <el-button
176
+            v-show="this.type == 2 || this.type == 3"
177
+            type="success"
178
+            @click="btnSave('ruleForm')"
179
+          >保存</el-button>
112 180
         </div>
113 181
       </div>
114 182
     </div>
115 183
   </div>
116 184
 </template>
117 185
 <script>
186
+// 中转站
187
+import bus from '@/utils/bus'
188
+import {
189
+  getPersonnelInfo,
190
+  checkPersonnelInfo,
191
+  updatePersonnelInfo,
192
+  deletePersonnelInfo,
193
+  addPersonnelInfo
194
+} from '@/api/system/organizationalStructure/personnel'
118 195
 export default {
119
-  name: "AddPersonnel",
196
+  name: 'AddPersonnel',
197
+
120 198
   data() {
199
+    // 手机号校验
200
+    const checkPhone = (rule, value, callback) => {
201
+      const reg = /^1[3|4|5|7|8][0-9]\d{8}$/
202
+      if (reg.test(value)) {
203
+        callback()
204
+      } else {
205
+        return callback(new Error('请输入正确的手机号'))
206
+      }
207
+    }
121 208
     return {
122
-              imageUrl: ''
209
+      // 按钮标识(1:查看;2:新增;3:修改)
210
+      type: '',
211
+      // 图片路径
212
+      imageUrl: '',
213
+      title: '',
214
+      id: '',
215
+      // 必填项规则
216
+      rules: {
217
+        // 姓名
218
+        uname: [{ required: true, message: '请输入姓名', trigger: 'blur' }],
219
+        // 联系方式
220
+        uphone: [{ required: true, validator: checkPhone, trigger: 'blur' }],
221
+        // 岗位(职务)
222
+        ppost: [
223
+          { required: true, message: '请输入职位名称', trigger: 'change' }
224
+        ],
225
+        // 所属科室
226
+        pdepartment: [
227
+          { required: true, message: '请选择所属科室', trigger: 'change' }
228
+        ]
229
+      },
230
+      // 初始化数据
231
+      personnel: {
232
+        // 人员姓名
233
+        uname: '',
234
+        // 性别
235
+        usex: '',
236
+        // 联系方式
237
+        uphone: '',
238
+        // 出生年月
239
+        ubirthday: '',
240
+        // 邮箱
241
+        umail: '',
242
+        // 工作年限
243
+        pworkYears: '',
244
+        // 岗位(职位)
245
+        ppost: '',
246
+        // 政治面貌
247
+        ppoliticalOutlook: '',
248
+        // 入党时间
249
+        ppartyTime: '',
250
+        // 所属科室
251
+        pdepartment: '',
252
+        // 第一学历(教育学历)
253
+        pfirstDegree: '',
254
+        // 毕业院校
255
+        puniversityGraduated: '',
256
+        // 专业
257
+        pmajor: '',
258
+        // 教育形式
259
+        pformEducationTwo: '',
260
+        // 学位
261
+        pAcademicDegree: '',
262
+        // 最高学历(教育学历)
263
+        pHighestEducation: '',
264
+        // 毕业院校
265
+        puniversityGraduatedTwo: '',
266
+        // 专业
267
+        pmajorTwo: '',
268
+        // 教育形式
269
+        pformEducationTwoTwo: '',
270
+        // 学位
271
+        pacademicDegreeTwo: ''
272
+      }
273
+    }
274
+  },
275
+  mounted() {
276
+    var routeParams = this.$route.query
277
+    console.log(routeParams, 'routeParams')
278
+    this.id = routeParams.pid
279
+    this.type = routeParams.type
280
+    console.log(this.id)
281
+
282
+    // 对表单数据进行重置
283
+    this.$nextTick(() => {
284
+      this.$refs['ruleForm'].resetFields()
285
+    })
123 286
 
287
+    if (routeParams.type == 1) {
288
+      this.title = '查看'
289
+      this.checkList()
290
+    } else if (routeParams.type == 2) {
291
+      this.title = '新增'
292
+    } else if (routeParams.type == 3) {
293
+      this.title = '修改'
294
+      this.checkList()
124 295
     }
125 296
   },
126
-  methods:{
127
-     handleAvatarSuccess(res, file) {
128
-        this.imageUrl = URL.createObjectURL(file.raw);
129
-      },
130
-      beforeAvatarUpload(file) {
131
-        const isJPG = file.type === 'image/jpeg';
132
-        const isLt2M = file.size / 1024 / 1024 < 2;
297
+  methods: {
298
+    handleAvatarSuccess(res, file) {
299
+      this.imageUrl = URL.createObjectURL(file.raw)
300
+    },
301
+    beforeAvatarUpload(file) {
302
+      const isJPG = file.type === 'image/jpeg'
303
+      const isLt2M = file.size / 1024 / 1024 < 2
304
+
305
+      if (!isJPG) {
306
+        this.$message.error('上传头像图片只能是 JPG 格式!')
307
+      }
308
+      if (!isLt2M) {
309
+        this.$message.error('上传头像图片大小不能超过 2MB!')
310
+      }
311
+      return isJPG && isLt2M
312
+    },
313
+
314
+    // 查看列表
315
+    checkList() {
316
+      var id = this.id
317
+      checkPersonnelInfo(id)
318
+        .then((res) => {
319
+          console.log(id, 'data')
320
+          console.log(res.data, 'res.data')
321
+
322
+          if (res.code == 200) {
323
+            this.personnel = res.data
324
+          }
325
+        })
326
+        .catch((err) => {
327
+          console.log(err)
328
+        })
329
+    },
330
+
331
+    // 新增接口
332
+    addList() {
333
+      var data = this.personnel
334
+      addPersonnelInfo(data).then((res) => {
335
+        //  var data = this.personnel
336
+        this.$message.success('新增成功')
337
+        // 对表单数据进行重置
338
+
339
+        this.$router.push({
340
+          path:
341
+            '/systemManagement/organizationalStructureManagement/personnelOrganizationalStructureManagement'
342
+        })
343
+        bus.$emit('getList')
344
+      })
345
+    },
133 346
 
134
-        if (!isJPG) {
135
-          this.$message.error('上传头像图片只能是 JPG 格式!');
347
+    // 修改接口
348
+    editList() {
349
+      var data = this.personnel
350
+      updatePersonnelInfo(data).then((res) => {
351
+        if (res.code == 200) {
352
+          this.$message.success('修改成功')
353
+
354
+          this.$router.push({
355
+            path:
356
+              '/systemManagement/organizationalStructureManagement/personnelOrganizationalStructureManagement'
357
+          })
358
+          bus.$emit('getList')
136 359
         }
137
-        if (!isLt2M) {
138
-          this.$message.error('上传头像图片大小不能超过 2MB!');
360
+      })
361
+    },
362
+
363
+    // 保存按钮
364
+    btnSave(formName) {
365
+      this.$refs[formName].validate((valid) => {
366
+        if (valid) {
367
+          // this.addList();
368
+          console.log(this.type, 'this.type..')
369
+          if (this.type == 2) {
370
+            this.addList()
371
+          } else if (this.type == 3) {
372
+            this.editList()
373
+          }
374
+        } else {
375
+          console.log('error submit!!')
376
+          return false
139 377
         }
140
-        return isJPG && isLt2M;
141
-      }
142
-    
378
+      })
379
+    },
380
+
381
+    // 取消按钮
382
+    cancel() {
383
+      this.$router.push({
384
+        path:
385
+          '/systemManagement/organizationalStructureManagement/personnelOrganizationalStructureManagement'
386
+      })
387
+    }
143 388
   }
144 389
 }
145 390
 </script>
146 391
 <style lang="scss" scoped>
147
-#personel {
392
+.mainContainer {
148 393
   padding: 20px;
149 394
   .title {
150
-    margin-bottom: 20px;
395
+    margin-bottom: 10px;
396
+  }
397
+  .educational {
398
+    margin-top: 20px;
399
+    .education2 {
400
+      margin-top: 20px;
401
+    }
151 402
   }
152 403
   .company {
153 404
     margin-bottom: 20px;
@@ -155,32 +406,39 @@ export default {
155 406
   .el-form--inline .el-form-item {
156 407
     width: 30%;
157 408
   }
158
-
159
-  
409
+  .btns {
410
+    text-align: right;
411
+  }
160 412
 }
161 413
 </style>
162 414
 <style>
163
- .avatar-uploader .el-upload {
164
-    border: 1px dashed #d9d9d9;
165
-    border-radius: 6px;
166
-    cursor: pointer;
167
-    position: relative;
168
-    overflow: hidden;
169
-  }
170
-  .avatar-uploader .el-upload:hover {
171
-    border-color: #409EFF;
172
-  }
173
-  .avatar-uploader-icon {
174
-    font-size: 28px;
175
-    color: #8c939d;
176
-    width: 178px;
177
-    height: 178px;
178
-    line-height: 178px;
179
-    text-align: center;
180
-  }
181
-  .avatar {
182
-    width: 178px;
183
-    height: 178px;
184
-    display: block;
185
-  }
186
-</style>
415
+.el-input--medium {
416
+  width: 220px;
417
+}
418
+.el-select > .el-input {
419
+  width: 220px;
420
+}
421
+.avatar-uploader .el-upload {
422
+  border: 1px dashed #d9d9d9;
423
+  border-radius: 6px;
424
+  cursor: pointer;
425
+  position: relative;
426
+  overflow: hidden;
427
+}
428
+.avatar-uploader .el-upload:hover {
429
+  border-color: #409eff;
430
+}
431
+.avatar-uploader-icon {
432
+  font-size: 28px;
433
+  color: #8c939d;
434
+  width: 178px;
435
+  height: 178px;
436
+  line-height: 178px;
437
+  text-align: center;
438
+}
439
+.avatar {
440
+  width: 178px;
441
+  height: 178px;
442
+  display: block;
443
+}
444
+</style>

+ 152 - 66
shanXiPlatform/src/views/systemManagement/organizationalStructureManagement/personnelOrganizationalStructureManagement/index.vue

@@ -1,60 +1,79 @@
1 1
 <template>
2 2
   <div>
3
-        <div class="button">
4
-      <el-button type="success" @click="addPersonel()">新增工作人员</el-button>
3
+    <div class="button">
4
+      <el-button type="success" @click="addPersonel(2)">新增工作人员</el-button>
5 5
     </div>
6 6
     <el-table
7 7
       border
8 8
       stripe
9 9
       :data="personnelData"
10 10
       highlight-current-row
11
-      @current-change="handleCurrentChange"
12 11
       style="width: 100%"
12
+      @current-change="handleCurrentChange"
13 13
     >
14
-      <el-table-column type="index" align="center" label="序号" width="50"> </el-table-column>
15
-      <el-table-column property="name" label="姓名" align="center">
16
-      </el-table-column>
17
-      <el-table-column property="company" label="所属公司" align="center">
18
-      </el-table-column>
19
-      <el-table-column property="positionName" label="职位名称" align="center">
20
-      </el-table-column>
21
-      <el-table-column property="telephone" label="手机号" align="center">
22
-      </el-table-column>
23
-      <el-table-column property="operation" label="操作" align="center" width='300'>
14
+      <el-table-column type="index" align="center" label="序号" width="50" />
15
+      <el-table-column property="uname" label="姓名" align="center" />
16
+      <el-table-column property="company" label="所属公司" align="center" />
17
+      <el-table-column property="ppost" label="职位名称" align="center" />
18
+      <el-table-column property="uphone" label="手机号" align="center" />
19
+      <el-table-column
20
+        property="operation"
21
+        label="操作"
22
+        align="center"
23
+        width="300"
24
+      >
24 25
         <template slot-scope="scope">
25
-
26
-              <el-button size="mini" @click="handleCheck(scope.$index, scope.row)"
27
-            >查看</el-button
28
-          >
29
-          <el-button size="mini" @click="handleEdit(scope.$index, scope.row)"
30
-            >编辑</el-button
31
-          >
26
+          <el-button
27
+            size="mini"
28
+            @click="handleCheck(1, scope.$index, scope.row)"
29
+          >查看</el-button>
30
+          <el-button
31
+            size="mini"
32
+            @click="handleEdit(3, scope.$index, scope.row)"
33
+          >编辑</el-button>
32 34
           <el-button
33 35
             size="mini"
34 36
             type="danger"
35 37
             @click="handleDelete(scope.$index, scope.row)"
36
-            >删除</el-button
37
-          >
38
+          >删除</el-button>
38 39
         </template>
39 40
       </el-table-column>
40 41
     </el-table>
41
-        <pagination
42
-          v-show="total > 0"
43
-          :total="total"
44
-          :page.sync="listQuery.page"
45
-          :limit.sync="listQuery.limit"
46
-          @pagination="getList"
47
-        />
42
+    <pagination
43
+      v-show="total > 0"
44
+      :total="total"
45
+      :page.sync="listQuery.page"
46
+      :limit.sync="listQuery.limit"
47
+      @pagination="getPageList"
48
+    />
48 49
   </div>
49 50
 </template>
50 51
 <script>
51
-import Pagination from "@/components/Pagination"
52
+// 中转站
53
+import bus from '@/utils/bus'
54
+// 分页
55
+import Pagination from '@/components/Pagination'
56
+import {
57
+  getPersonnelInfo,
58
+  checkPersonnelInfo,
59
+  updatePersonnelInfo,
60
+  deletePersonnelInfo,
61
+  addPersonnelInfo
62
+} from '@/api/system/organizationalStructure/personnel'
52 63
 export default {
53
-    components: { Pagination },
64
+  components: { Pagination },
54 65
   data() {
55 66
     return {
56
-        //分页
57
-          total: 30,
67
+
68
+      // 按钮类型
69
+      type: '',
70
+      // 索引
71
+      index: '',
72
+      // 每行数据
73
+      row: '',
74
+      id: '',
75
+      // 分页
76
+      total: 30,
58 77
       listLoading: true,
59 78
       listQuery: {
60 79
         page: 1,
@@ -62,48 +81,115 @@ export default {
62 81
         importance: undefined,
63 82
         title: undefined,
64 83
         type: undefined,
65
-        sort: "+id",
84
+        sort: '+id'
66 85
       },
67
-        //人员组织架构数据
68
-      personnelData: [
69
-        {
70
-          name: "王建国",
71
-          company: "山西分公司",
72
-          positionName: "操作员",
73
-          telephone: "13245678542",
74
-        },
75
-      ],
86
+      // 人员组织架构数据
87
+      personnelData: []
76 88
     }
77 89
   },
90
+  mounted() {
91
+    this.getList()
92
+    bus.$on('getList', function() {
93
+      this.getList()
94
+    })
95
+  },
78 96
 
79
-   methods:{
80
-     //新增跳转
81
-     addPersonel(){
82
-       this.$router.push({name:"AddPersonnel"});
83
-     },
84
-        getList() {},
97
+  methods: {
98
+    // 新增跳转
99
+    addPersonel(type) {
100
+      this.$router.push({
101
+        path: '/personnelOrganizationalStructureManagement/personnel',
102
+        query: { type: type }
103
+      })
104
+    },
105
+    getPageList() {},
85 106
     // 当表格的当前行发生变化的时候会触发该事件
86
-    handleCurrentChange(){},
87
-    //查看
107
+    handleCurrentChange() {},
108
+    // 查看
88 109
 
89
-     handleCheck(index, row) {
90
-        console.log(index, row);
91
-      },
92
-    //编辑
93
-       handleEdit(index, row) {
94
-        console.log(index, row);
95
-      },
96
-      //删除
97
-      handleDelete(index, row) {
98
-        console.log(index, row);
110
+    handleCheck(type, index, row) {
111
+      this.$router.push({
112
+        path: '/personnelOrganizationalStructureManagement/personnel',
113
+        query: { type: type, pid: row.pid }
114
+      })
115
+    },
116
+    // 编辑
117
+    handleEdit(type, index, row) {
118
+      console.log(row, 'row')
119
+      this.$router.push({
120
+        path: '/personnelOrganizationalStructureManagement/personnel',
121
+
122
+        query: { type: type, pid: row.pid }
123
+      })
124
+    },
125
+    // 删除功能
126
+    deleteList() {
127
+      console.log('shancuu')
128
+      this.$confirm('确定删除该项记录?', '提示', {
129
+        confirmButtonText: '确定',
130
+        cancelButtonText: '取消',
131
+        type: 'warning'
132
+      })
133
+        .then(() => {
134
+          console.log(11111)
135
+          var params = {
136
+            id: this.id
137
+          }
138
+          console.log(params, '删除id')
139
+          deletePersonnelInfo(params)
140
+            .then((res) => {
141
+              if (res.code == 200) {
142
+                this.getList()
143
+                this.$message({
144
+                  type: 'success',
145
+                  message: '删除成功!'
146
+                })
147
+              }
148
+            })
149
+            .catch(() => {
150
+              this.$message({
151
+                type: 'info',
152
+                message: '已取消删除'
153
+              })
154
+            })
155
+        })
156
+    },
157
+    handleDelete(index, row) {
158
+      // console.log(index, row)
159
+      this.id = row.pid
160
+      this.deleteList()
161
+    },
162
+
163
+    // 获取列表
164
+    getList() {
165
+      var data = {
166
+        pageIndex: this.listQuery.page,
167
+        pageSize: this.listQuery.limit
99 168
       }
169
+      getPersonnelInfo(data)
170
+        .then((res) => {
171
+          console.log(data, 'data')
172
+          console.log(res.data, ',,,,,,')
173
+
174
+          if (res.code == 200) {
175
+            console.log(res.data.records, 'res.data.records')
176
+            this.personnelData = res.data.records
177
+
178
+            this.listQuery.limit = res.data.size
179
+            this.total = res.data.total
180
+          }
181
+        })
182
+        .catch((err) => {
183
+          console.log(err)
184
+        })
185
+    }
100 186
   }
101 187
 }
102 188
 </script>
103 189
 <style lang="scss" scoped>
104
-    .button{
105
-  text-align:right;
106
-  margin-right:20px;
107
-  padding-bottom:20px;
190
+.button {
191
+  text-align: right;
192
+  margin-right: 20px;
193
+  padding-bottom: 20px;
108 194
 }
109
-</style>
195
+</style>

+ 50 - 0
shanXiPlatform/src/views/systemManagement/userManagement/departmentManagement/addDepartment.vue

@@ -0,0 +1,50 @@
1
+<template>
2
+  <div class="global">
3
+    <div class="mainContainer">
4
+      <div class="title">新增部门</div>
5
+      <el-form label-width="120px" :model="addDepartment">
6
+        <el-form-item label="新增部门:">
7
+          <el-input v-model="addDepartment.name" />
8
+        </el-form-item>
9
+        <el-form-item label="备注:">
10
+          <el-input v-model="addDepartment.remak" />
11
+        </el-form-item>
12
+      </el-form>
13
+      <div class="btns">
14
+        <el-button type="success" plain>取消</el-button>
15
+        <el-button type="success">保存</el-button>
16
+      </div>
17
+    </div>
18
+  </div>
19
+</template>
20
+<script>
21
+export default {
22
+  name: 'AddPartment',
23
+  data() {
24
+    return {
25
+      addDepartment: {
26
+        name: '',
27
+        remark: ''
28
+      }
29
+    }
30
+  },
31
+  methods: {
32
+
33
+  }
34
+}
35
+</script>
36
+<style lang="scss" scoped>
37
+    .mainContainer{
38
+        .title{
39
+            margin-bottom:20px;
40
+        }
41
+        .btns{
42
+            text-align:right;
43
+        }
44
+    }
45
+</style>
46
+<style>
47
+    .el-input{
48
+        width:30%;
49
+    }
50
+</style>

+ 97 - 99
shanXiPlatform/src/views/systemManagement/userManagement/departmentManagement/index.vue

@@ -1,90 +1,84 @@
1 1
 <template>
2
-    <div class="container">
3
-        <div class="top">
4
-            <el-button>新增部门</el-button>
5
-        </div>
6
-      
7
-             <el-table
8
-          border
9
-          stripe
10
-          :data="departmentData"
11
-          highlight-current-row
12
-          @current-change="handleCurrentChange"
13
-          style="width:100%"
14
-        >
15
-          <el-table-column
16
-            type="index"
17
-            align="center"
18
-            label="序号"
19
-            width="50px"
20
-          >
21
-          </el-table-column>
22
-          <el-table-column prop="departmentName" label="部门名称" align="center">
23
-          </el-table-column>
24
-          <el-table-column prop="creatTime" label="创建时间" align="center">
25
-          </el-table-column>
26
-          <el-table-column prop="remark" label="备注" align="center">
27
-          </el-table-column>
28
-          
29
-          <el-table-column
30
-            prop="operation"
31
-            label="操作"
32
-            align="center"
33
-            width="200px"
34
-             fixed="right"
35
-          >
36
-            <template slot-scope="scope">
37
-              
38
-              <el-button
39
-                size="mini"
40
-                @click="handleEdit(scope.$index, scope.row)"
41
-                >修改</el-button
42
-              >
43
-              <el-button
44
-                size="mini"
45
-                @click="handleDeleat(scope.$index, scope.row)"
46
-                >删除</el-button
47
-              >
48
-            </template>
49
-          </el-table-column>
50
-        </el-table>
51
-          <pagination
52
-          v-show="total > 0"
53
-          :total="total"
54
-          :page.sync="listQuery.page"
55
-          :limit.sync="listQuery.limit"
56
-          @pagination="getList"
57
-        />
2
+  <div class="container">
3
+    <div class="top">
4
+      <el-button type="success" @click="addDepaartment()">新增部门</el-button>
58 5
     </div>
6
+
7
+    <el-table
8
+      border
9
+      stripe
10
+      :data="departmentData"
11
+      highlight-current-row
12
+      style="width:100%"
13
+      @current-change="handleCurrentChange"
14
+    >
15
+      <el-table-column
16
+        type="index"
17
+        align="center"
18
+        label="序号"
19
+        width="50px"
20
+      />
21
+      <el-table-column prop="departmentName" label="部门名称" align="center" />
22
+      <el-table-column prop="creatTime" label="创建时间" align="center" />
23
+      <el-table-column prop="remark" label="备注" align="center" />
24
+
25
+      <el-table-column
26
+        prop="operation"
27
+        label="操作"
28
+        align="center"
29
+        width="200px"
30
+        fixed="right"
31
+      >
32
+        <template slot-scope="scope">
33
+
34
+          <el-button
35
+            size="mini"
36
+            @click="handleEdit(scope.$index, scope.row)"
37
+          >修改</el-button>
38
+          <el-button
39
+            size="mini"
40
+            @click="handleDeleat(scope.$index, scope.row)"
41
+          >删除</el-button>
42
+        </template>
43
+      </el-table-column>
44
+    </el-table>
45
+    <pagination
46
+      v-show="total > 0"
47
+      :total="total"
48
+      :page.sync="listQuery.page"
49
+      :limit.sync="listQuery.limit"
50
+      @pagination="getList"
51
+    />
52
+  </div>
59 53
 </template>
60 54
 <script>
61
-//引入分页
62
-import Pagination from "@/components/Pagination"
55
+// 引入分页
56
+import Pagination from '@/components/Pagination'
63 57
 export default {
64
-    name:"DepartManagement",
65
-    components:{Pagination},
66
-    data(){
67
-      return{
68
-          //列表数据
69
-          departmentData:[
70
-              {
71
-                departmentName:"1qewdffg" ,
72
-                creatTime:"2020-2-2",
73
-                remark:"dehfuvcnigvvn hvvn vhvnavhaegieg"
74
-              },
75
-              {
76
-                departmentName:"1qewdffg" ,
77
-                creatTime:"2020-2-2",
78
-                remark:"dehfuvcnigvvn hvvn vhvnavhaegieg"
79
-              },
80
-              {
81
-                departmentName:"1qewdffg" ,
82
-                creatTime:"2020-2-2",
83
-                remark:"dehfuvcnigvvn hvvn vhvnavhaegieg"
84
-              },
85
-          ],
58
+  name: 'DepartManagement',
59
+  components: { Pagination },
60
+  data() {
61
+    return {
62
+      // 列表数据
63
+      departmentData: [
64
+        {
65
+          departmentName: '1qewdffg',
66
+          creatTime: '2020-2-2',
67
+          remark: 'dehfuvcnigvvn hvvn vhvnavhaegieg'
68
+        },
69
+        {
70
+          departmentName: '1qewdffg',
71
+          creatTime: '2020-2-2',
72
+          remark: 'dehfuvcnigvvn hvvn vhvnavhaegieg'
73
+        },
74
+        {
75
+          departmentName: '1qewdffg',
76
+          creatTime: '2020-2-2',
77
+          remark: 'dehfuvcnigvvn hvvn vhvnavhaegieg'
78
+        }
79
+      ],
86 80
 
87
-            //分页
81
+      // 分页
88 82
       total: 30,
89 83
       listLoading: true,
90 84
       listQuery: {
@@ -93,36 +87,40 @@ export default {
93 87
         importance: undefined,
94 88
         title: undefined,
95 89
         type: undefined,
96
-        sort: "+id",
97
-      },
90
+        sort: '+id'
98 91
       }
99
-    },
100
-    methods:{
101
-         getList() {},
102
-         // 当表格的当前行发生变化的时候会触发该事件
92
+    }
93
+  },
94
+  methods: {
95
+    getList() {},
96
+    // 当表格的当前行发生变化的时候会触发该事件
103 97
     handleCurrentChange() {},
104
-            //编辑
105
-       handleEdit(index, row) {
106
-        console.log(index, row);
107
-      },
108
-      //删除
109
-      handleDelete(index, row) {
110
-        console.log(index, row);
111
-      },
112
-
98
+    // 新增部门
99
+    addDepaartment() {
100
+      this.$router.push({ name: 'AddDepartment' })
101
+    },
102
+    // 编辑
103
+    handleEdit(index, row) {
104
+      console.log(index, row)
105
+    },
106
+    // 删除
107
+    handleDelete(index, row) {
108
+      console.log(index, row)
113 109
     }
110
+
111
+  }
114 112
 }
115 113
 </script>
116 114
 <style lang="scss" scoped>
117 115
 .container{
118 116
     width:100%;
119 117
       .top{
120
-        
118
+
121 119
         height:50px;
122 120
         line-height:50px;
123 121
         text-align: right;
124 122
         margin-bottom:20px;
125 123
     }
126 124
 }
127
-  
128
-</style>
125
+
126
+</style>

+ 193 - 0
shanXiPlatform/src/views/systemManagement/userManagement/roleManagement/addRole.vue

@@ -0,0 +1,193 @@
1
+<template>
2
+  <div class="global">
3
+    <div class="mainContainer">
4
+      <el-form
5
+        ref="ruleForm"
6
+
7
+        :model="roleGroup"
8
+        :rules="rules"
9
+        label-width="120px"
10
+        class="demo-ruleForm"
11
+      >
12
+        <el-form-item label="新增角色组名:" prop="rname">
13
+          <el-input v-model="roleGroup.rname" />
14
+        </el-form-item>
15
+        <el-form-item label="备注:">
16
+          <el-input v-model="roleGroup.rremark" />
17
+        </el-form-item>
18
+      </el-form>
19
+      <div class="tree">
20
+        <div class="treeLabel">功能:</div>
21
+        <div class="treeShow">
22
+          <el-tree
23
+            ref="resourseTree"
24
+            :data="data"
25
+            show-checkbox
26
+            node-key="resourceCode"
27
+            :props="defaultProps"
28
+          />
29
+        </div>
30
+      </div>
31
+      <div>
32
+        <el-button type="success" plain @click="cancel()">取消</el-button>
33
+        <el-button
34
+          v-show="this.type == 2 || this.type == 3"
35
+          type="success"
36
+          @click="btnSave('ruleForm')"
37
+        >保存</el-button>
38
+      </div>
39
+    </div>
40
+  </div>
41
+</template>
42
+<script>
43
+// 中转站
44
+import bus from '@/utils/bus'
45
+// 引入接口
46
+import {
47
+  resourcesTree,
48
+  getUserInfo,
49
+  addUserInfo,
50
+  updateUserInfo,
51
+  roleIsExit
52
+} from '@/api/system/userManagement/role'
53
+export default {
54
+  name: 'AddRole',
55
+  data() {
56
+    return {
57
+      // 按钮类型
58
+      type: '',
59
+      // 校验规则
60
+      rules: {
61
+        rname: [{ required: true, message: '请输入角色组', trigger: 'blur' }]
62
+      },
63
+
64
+      // 初始化数据
65
+      roleGroup: {
66
+        rname: '',
67
+        rremark: ''
68
+
69
+      },
70
+      defaultProps: {
71
+        children: 'children',
72
+        label: 'resourceName'
73
+        // id:'resourceCode'
74
+      },
75
+      data: []
76
+    }
77
+  },
78
+
79
+  // 新增
80
+
81
+  mounted() {
82
+    var routeParams = this.$route.query
83
+    console.log(routeParams, 'routeParams')
84
+    // this.id = routeParams.pid
85
+    this.type = routeParams.type
86
+    console.log(this.id)
87
+
88
+    this.getTreeInfo()
89
+    this.rGroupExit()
90
+  },
91
+
92
+  methods: {
93
+    // 判断角色组是否存在
94
+    rGroupExit() {
95
+      var params = this.roleGroup.rname
96
+      roleIsExit(params)
97
+        .then(res => {
98
+          if (res.code == 200) {
99
+            console.log(res.data, 'juesezu')
100
+          }
101
+        })
102
+    },
103
+    // 获取资源树接口
104
+    getTreeInfo() {
105
+      resourcesTree()
106
+        .then((res) => {
107
+          if (res.code == 200) {
108
+            this.data = res.data
109
+          }
110
+        })
111
+        .catch(err => {
112
+          console.log(err)
113
+        })
114
+    },
115
+
116
+    // 新增接口
117
+    addList() {
118
+      var data = this.roleGroup
119
+      addUserInfo(data)
120
+        .then(res => {
121
+          console.log(data, '新增data')
122
+          if (res.code == 200) {
123
+            this.$message.success('新增成功')
124
+            this.$router.push({
125
+              path:
126
+            '/systemManagement/user/roleManagement'
127
+            })
128
+            bus.$emit('getList')
129
+          }
130
+        })
131
+    },
132
+    // 点保存按钮
133
+    btnSave(formName) {
134
+      this.$refs[formName].validate((valid) => {
135
+        if (valid) {
136
+          // this.addList();
137
+          console.log(this.type, 'this.type..')
138
+          if (this.type == 2) {
139
+            console.log(this.$refs.resourseTree.getCheckedNodes(), '资源树')
140
+            var checkedNodes = this.$refs.resourseTree.getCheckedNodes()
141
+            var resourceCodes = []
142
+            for (
143
+              let index = 0;
144
+              index < checkedNodes.length;
145
+              index++
146
+            ) {
147
+              const ele = checkedNodes[index]
148
+              resourceCodes.push(ele.resourceCode, ele.parentCode)
149
+            }
150
+            console.log(resourceCodes, '......')
151
+            resourceCodes = resourceCodes.join(',')
152
+            console.log(resourceCodes, '数组')
153
+            this.roleGroup.resourceCodes = resourceCodes
154
+            console.log(this.roleGroup.resourceCodes, 'this. roleGroup.resourceCodes')
155
+            this.addList()
156
+          } else if (this.type == 3) {
157
+            this.editList()
158
+          }
159
+        } else {
160
+          console.log('error submit!!')
161
+          return false
162
+        }
163
+      })
164
+    }
165
+  }
166
+}
167
+</script>
168
+<style lang="scss" scoped>
169
+.tree {
170
+  display: flex;
171
+  .treeLabel {
172
+    width: 120px;
173
+    text-align: right;
174
+  }
175
+  .treeShow {
176
+    width: 600px;
177
+
178
+    height: 400px;
179
+    // max-height: 100px;
180
+    // overflow-y:scroll ;
181
+    margin-left:20px;
182
+    // background:rgb(244, 240, 240);
183
+  }
184
+}
185
+</style>
186
+<style>
187
+.el-input {
188
+  width: 20%;
189
+}
190
+.el-tree{
191
+  background:rgb(245, 243, 243);
192
+}
193
+</style>

+ 117 - 105
shanXiPlatform/src/views/systemManagement/userManagement/roleManagement/index.vue

@@ -1,89 +1,69 @@
1 1
 <template>
2
-    <div class="container">
3
-        <div class="top">
4
-            <el-button>新增角色</el-button>
5
-        </div>
6
-      
7
-             <el-table
8
-          border
9
-          stripe
10
-          :data="departmentData"
11
-          highlight-current-row
12
-          @current-change="handleCurrentChange"
13
-          style="width:100%"
14
-        >
15
-          <el-table-column
16
-            type="index"
17
-            align="center"
18
-            label="序号"
19
-            width="50px"
20
-          >
21
-          </el-table-column>
22
-          <el-table-column prop="roleName" label="角色名称" align="center">
23
-          </el-table-column>
24
-          <el-table-column prop="creatTime" label="创建时间" align="center">
25
-          </el-table-column>
26
-          <el-table-column prop="remark" label="备注" align="center">
27
-          </el-table-column>
28
-          
29
-          <el-table-column
30
-            prop="operation"
31
-            label="操作"
32
-            align="center"
33
-            width="200px"
34
-            fixed="right"
35
-          >
36
-            <template slot-scope="scope">
37
-              
38
-              <el-button
39
-                size="mini"
40
-                @click="handleEdit(scope.$index, scope.row)"
41
-                >修改</el-button
42
-              >
43
-              <el-button
44
-                size="mini"
45
-                @click="handleDeleat(scope.$index, scope.row)"
46
-                >删除</el-button
47
-              >
48
-            </template>
49
-          </el-table-column>
50
-        </el-table>
51
-          <pagination
52
-          v-show="total > 0"
53
-          :total="total"
54
-          :page.sync="listQuery.page"
55
-          :limit.sync="listQuery.limit"
56
-          @pagination="getList"
57
-        />
2
+  <div class="container">
3
+    <div class="top">
4
+      <el-button type="success" @click="addRole(2)">新增角色组</el-button>
58 5
     </div>
6
+
7
+    <el-table
8
+      border
9
+      stripe
10
+      :data="departmentData"
11
+      highlight-current-row
12
+      style="width: 100%"
13
+    >
14
+      <el-table-column type="index" align="center" label="序号" width="50px" />
15
+      <el-table-column prop="rname" label="角色名称" align="center" />
16
+      <el-table-column prop="rCreateTime" label="创建时间" align="center" />
17
+      <el-table-column prop="rremark" label="备注" align="center" />
18
+
19
+      <el-table-column
20
+        prop="operation"
21
+        label="操作"
22
+        align="center"
23
+        width="200px"
24
+        fixed="right"
25
+      >
26
+        <template slot-scope="scope">
27
+          <el-button
28
+            size="mini"
29
+            @click="handleEdit(3, scope.$index, scope.row)"
30
+          >修改</el-button>
31
+          <el-button
32
+            size="mini"
33
+            @click="handleDeleat(scope.$index, scope.row)"
34
+          >删除</el-button>
35
+        </template>
36
+      </el-table-column>
37
+    </el-table>
38
+    <pagination
39
+      v-show="total > 0"
40
+      :total="total"
41
+      :page.sync="listQuery.page"
42
+      :limit.sync="listQuery.limit"
43
+      @pagination="getPageList"
44
+    />
45
+  </div>
59 46
 </template>
60 47
 <script>
61
-import Pagination from "@/components/Pagination"
48
+// 中转站
49
+import bus from '@/utils/bus'
50
+import Pagination from '@/components/Pagination'
51
+// 引入接口
52
+import {
53
+  getUserInfo,
54
+  addUserInfo,
55
+  updateUserInfo,
56
+  userIsExit
57
+} from '@/api/system/userManagement/role'
62 58
 export default {
63
-    name:"DepartManagement",
64
-    components:{Pagination},
65
-    data(){
66
-      return{
67
-          //列表数据
68
-          departmentData:[
69
-              {
70
-                roleName:"1qewdffg" ,
71
-                creatTime:"2020-2-2",
72
-                remark:"dehfuvcnigvvn hvvn vhvnavhaegieg"
73
-              },
74
-              {
75
-                roleName:"1qewdffg" ,
76
-                creatTime:"2020-2-2",
77
-                remark:"dehfuvcnigvvn hvvn vhvnavhaegieg"
78
-              },
79
-              {
80
-                roleName:"1qewdffg" ,
81
-                creatTime:"2020-2-2",
82
-                remark:"dehfuvcnigvvn hvvn vhvnavhaegieg"
83
-              },
84
-          ],
59
+  name: 'DepartManagement',
60
+  components: { Pagination },
61
+  data() {
62
+    return {
63
+      // 列表数据
64
+      departmentData: [],
85 65
 
86
-            //分页
66
+      // 分页
87 67
       total: 30,
88 68
       listLoading: true,
89 69
       listQuery: {
@@ -92,36 +72,68 @@ export default {
92 72
         importance: undefined,
93 73
         title: undefined,
94 74
         type: undefined,
95
-        sort: "+id",
96
-      },
75
+        sort: '+id'
76
+      }
77
+    }
78
+  },
79
+
80
+  mounted() {
81
+    this.getList()
82
+    bus.$on('getList', function() {
83
+      this.getList()
84
+    })
85
+  },
86
+  methods: {
87
+    getPageList() {},
88
+
89
+    // 获取用户列表
90
+
91
+    getList() {
92
+      var data = {
93
+        pageIndex: this.listQuery.page,
94
+        pageSize: this.listQuery.limit
97 95
       }
96
+      getUserInfo(data)
97
+        .then((res) => {
98
+          console.log(data, 'data')
99
+          console.log(res.data, ',,,,,,')
100
+
101
+          if (res.code == 200) {
102
+            console.log(res.data.records, 'res.data.records')
103
+            this.departmentData = res.data.records
104
+
105
+            this.listQuery.limit = res.data.size
106
+            this.total = res.data.total
107
+          }
108
+        })
109
+        .catch((err) => {
110
+          console.log(err)
111
+        })
98 112
     },
99
-    methods:{
100
-         getList() {},
101
-         // 当表格的当前行发生变化的时候会触发该事件
102
-    handleCurrentChange() {},
103
-            //编辑
104
-       handleEdit(index, row) {
105
-        console.log(index, row);
106
-      },
107
-      //删除
108
-      handleDelete(index, row) {
109
-        console.log(index, row);
110
-      },
111 113
 
114
+    // 新增角色
115
+    addRole(type) {
116
+      this.$router.push({ path: '/roleManagement/addRole', query: { type: type }})
117
+    },
118
+    // 编辑
119
+    handleEdit(index, row) {
120
+      console.log(index, row)
121
+    },
122
+    // 删除
123
+    handleDelete(index, row) {
124
+      console.log(index, row)
112 125
     }
126
+  }
113 127
 }
114 128
 </script>
115 129
 <style lang="scss" scoped>
116
-.container{
117
-    width:100%;
118
-      .top{
119
-        
120
-        height:50px;
121
-        line-height:50px;
122
-        text-align: right;
123
-        margin-bottom:20px;
124
-    }
130
+.container {
131
+  width: 100%;
132
+  .top {
133
+    height: 50px;
134
+    line-height: 50px;
135
+    text-align: right;
136
+    margin-bottom: 20px;
137
+  }
125 138
 }
126
-  
127
-</style>
139
+</style>

+ 178 - 39
shanXiPlatform/src/views/systemManagement/userManagement/userManagement/addUser.vue

@@ -10,8 +10,9 @@
10 10
               :model="user"
11 11
               class="demo-form-inline"
12 12
               label-width="100px"
13
+              :rules="rules"
13 14
             >
14
-              <el-form-item label="用户名:">
15
+              <el-form-item label="用户名:" prop="name">
15 16
                 <el-input v-model="user.name" />
16 17
               </el-form-item>
17 18
               <el-form-item label="生日:">
@@ -19,6 +20,7 @@
19 20
                   v-model="user.birthday"
20 21
                   type="date"
21 22
                   placeholder="选择日期"
23
+                  width="180px"
22 24
                 />
23 25
               </el-form-item>
24 26
               <el-form-item label="邮箱:">
@@ -27,10 +29,10 @@
27 29
               <el-form-item label="联系电话:">
28 30
                 <el-input v-model="user.phone" />
29 31
               </el-form-item>
30
-              <el-form-item label="密码:">
32
+              <el-form-item label="密码:" prop="password">
31 33
                 <el-input v-model="user.password" />
32 34
               </el-form-item>
33
-              <el-form-item label="确认密码:">
35
+              <el-form-item label="确认密码:" prop="confirmPassword">
34 36
                 <el-input v-model="user.confirmPassword" />
35 37
               </el-form-item>
36 38
             </el-form>
@@ -63,6 +65,91 @@
63 65
             </el-checkbox-group>
64 66
           </div>
65 67
         </div>
68
+
69
+        <div class="bottoms">
70
+          <el-form
71
+            :inline="true"
72
+            :rules="rules"
73
+            :model="user"
74
+            class="demo-form-inline"
75
+            label-width="100px"
76
+          >
77
+            <el-form-item label="所属粮库:" prop="grainDepot">
78
+              <el-select v-model="user.grainDepot">
79
+                <el-option label="区域一" value="shanghai" />
80
+                <el-option label="区域二" value="beijing" />
81
+              </el-select>
82
+            </el-form-item>
83
+            <el-form-item label="人员名称:">
84
+              <el-select v-model="user.personnelName">
85
+                <el-option label="区域一" value="shanghai" />
86
+                <el-option label="区域二" value="beijing" />
87
+              </el-select>
88
+            </el-form-item>
89
+
90
+            <el-form-item label="职位:">
91
+              <el-select v-model="user.position">
92
+                <el-option label="区域一" value="shanghai" />
93
+                <el-option label="区域二" value="beijing" />
94
+              </el-select>
95
+            </el-form-item>
96
+          </el-form>
97
+
98
+          <div class="bottom_warehouse">
99
+            <div class="warehouse">仓房:</div>
100
+            <div class="check_div warehouse_div">
101
+              <el-checkbox-group v-model="checkList">
102
+                <div>
103
+                  <el-checkbox label="全选" />
104
+                </div>
105
+
106
+                <div class="checkGroup">
107
+                  <el-checkbox label="1号仓" />
108
+                  <el-checkbox label="2号仓" />
109
+                  <el-checkbox label="3号仓" />
110
+                  <el-checkbox label="4号仓" />
111
+                  <el-checkbox label="5号仓" />
112
+                  <el-checkbox label="6号仓" />
113
+                  <el-checkbox label="1号仓" />
114
+                  <el-checkbox label="2号仓" />
115
+                  <el-checkbox label="3号仓" />
116
+                  <el-checkbox label="4号仓" />
117
+                  <el-checkbox label="5号仓" />
118
+                  <el-checkbox label="6号仓" />
119
+                  <el-checkbox label="1号仓" />
120
+                  <el-checkbox label="2号仓" />
121
+                  <el-checkbox label="3号仓" />
122
+                  <el-checkbox label="4号仓" />
123
+                  <el-checkbox label="5号仓" />
124
+                  <el-checkbox label="6号仓" />
125
+                  <el-checkbox label="1号仓" />
126
+                  <el-checkbox label="2号仓" />
127
+                  <el-checkbox label="3号仓" />
128
+                  <el-checkbox label="4号仓" />
129
+                  <el-checkbox label="5号仓" />
130
+                  <el-checkbox label="6号仓" />
131
+                  <el-checkbox label="1号仓" />
132
+                  <el-checkbox label="2号仓" />
133
+                  <el-checkbox label="3号仓" />
134
+                  <el-checkbox label="4号仓" />
135
+                  <el-checkbox label="5号仓" />
136
+                  <el-checkbox label="6号仓" />
137
+                  <el-checkbox label="1号仓" />
138
+                  <el-checkbox label="2号仓" />
139
+                  <el-checkbox label="3号仓" />
140
+                  <el-checkbox label="4号仓" />
141
+                  <el-checkbox label="5号仓" />
142
+                  <el-checkbox label="6号仓" />
143
+                </div>
144
+              </el-checkbox-group>
145
+            </div>
146
+          </div>
147
+        </div>
148
+
149
+        <div class="btns">
150
+          <el-button type="success" plain>取消</el-button>
151
+          <el-button type="success">保存</el-button>
152
+        </div>
66 153
       </div>
67 154
     </div>
68 155
   </div>
@@ -82,7 +169,36 @@ export default {
82 169
         email: '',
83 170
         phone: '',
84 171
         password: '',
85
-        confirmPassword: ''
172
+        confirmPassword: '',
173
+        grainDepot: '',
174
+        personnelName: ''
175
+      },
176
+      // 验证规则
177
+      rules: {
178
+        name: [
179
+          {
180
+            required: true,
181
+            message: '用户名已经存在,请重新输入',
182
+            trigger: 'blur'
183
+          }
184
+        ],
185
+        password: [
186
+          {
187
+            required: true,
188
+            message: '密码长度6-14位,必须有数字和字母',
189
+            trigger: 'blur'
190
+          }
191
+        ],
192
+        confirmPassword: [
193
+          {
194
+            required: true,
195
+            message: '两次输入密码不一致',
196
+            trigger: 'blur'
197
+          }
198
+        ],
199
+        grainDepot: [
200
+          { required: true, message: '请选择所属粮库', trigger: 'blur' }
201
+        ]
86 202
       }
87 203
     }
88 204
   },
@@ -107,52 +223,75 @@ export default {
107 223
 }
108 224
 </script>
109 225
 <style lang="scss" scoped>
110
-.title {
111
-  margin-bottom: 20px;
112
-}
113
-.main{
114
-   padding: 20px 30px;
115
-}
116
-.top {
226
+.mainContainer {
227
+  position: relative;
228
+  .title {
229
+    margin-bottom: 20px;
230
+  }
231
+  .main {
232
+    padding: 20px 30px;
233
+  }
234
+  .top {
235
+    display: flex;
236
+    .top_left {
237
+      width: 60%;
238
+      .el-form--inline .el-form-item {
239
+        width: 45%;
240
+        margin-bottom: 40px;
241
+      }
242
+    }
243
+    .top_right {
244
+      width: 40%;
245
+      text-align: center;
117 246
 
118
-  display: flex;
119
-  .top_left {
120
-    width: 60%;
121
-    .el-form--inline .el-form-item {
122
-      width: 45%;
123
-      margin-bottom: 40px;
247
+      .imageBtn {
248
+        margin-top: 10px;
249
+      }
124 250
     }
125 251
   }
126
-  .top_right {
127
-    width: 40%;
128
-    text-align: center;
252
+  .middle,
253
+  .bottom_warehouse {
254
+    margin: 20px 0;
255
+    display: flex;
256
+    align-items: center;
129 257
 
130
-    .imageBtn {
131
-      margin-top: 10px;
258
+    .check_div {
259
+      width: 1200px;
260
+      height: 100px;
261
+      display: flex;
262
+      padding-left: 20px;
263
+      align-items: center;
264
+      border: 1px solid #ccc;
132 265
     }
133 266
   }
267
+  .bottom_warehouse {
268
+    .warehouse_div {
269
+      width: 1200px;
270
+
271
+      .checkGroup
272
+      {
273
+        max-height: 70px;
274
+        overflow-y: scroll;
275
+      }
134 276
 
135
-}
136
-  .middle{
137
-    margin-top:20px;
138
-    display:flex;
139
-    align-items: center;
140
-    .roleGroup{
141
-      width:100px;
142
-      text-align:right;
143
-      margin-right:20px;
144
-    }
145
-    .check_div{
146
-      width:1200px;
147
-      height:100px;
148
-      display:flex;
149
-      padding-left:20px;
150
-      align-items: center;
151
-      border:1px solid #ccc;
152 277
     }
153 278
   }
279
+  .warehouse,
280
+  .roleGroup {
281
+    width: 100px;
282
+    text-align: right;
283
+    margin-right: 20px;
284
+    white-space: nowrap;
285
+  }
286
+  .btns {
287
+    text-align: right;
288
+  }
289
+}
154 290
 </style>
155 291
 <style>
292
+.el-date-editor {
293
+  width: 180px !important;
294
+}
156 295
 .avatar-uploader .el-upload {
157 296
   border: 1px dashed #d9d9d9;
158 297
   border-radius: 6px;

+ 9 - 8
shanXiPlatform/src/views/systemManagement/userManagement/userManagement/index.vue

@@ -24,15 +24,15 @@
24 24
           </el-form-item>
25 25
 
26 26
           <el-form-item>
27
-            <el-button type="primary" @click="clear()">清空</el-button>
27
+            <el-button type="success" plain @click="clear()">清空</el-button>
28 28
           </el-form-item>
29 29
 
30 30
           <el-form-item>
31
-            <el-button type="primary" @click="search()">查询</el-button>
31
+            <el-button type="success" plain @click="search()">查询</el-button>
32 32
           </el-form-item>
33 33
         </el-form>
34 34
         <div>
35
-          <el-button @click="addUser">新增用户</el-button>
35
+          <el-button type="success" @click="addUser">新增用户</el-button>
36 36
         </div>
37 37
       </div>
38 38
     </div>
@@ -54,12 +54,13 @@
54 54
             label="序号"
55 55
             width="50px"
56 56
           />
57
-          <el-table-column prop="name" label="名称" align="center" />
58
-          <el-table-column prop="realName" label="真实姓名" align="center" />
59
-          <el-table-column prop="role" label="角色" align="center" />
60
-          <el-table-column prop="warehouse" label="仓库" align="center" />
61
-          <el-table-column prop="telephone" label="电话" align="center" />
57
+          <el-table-column prop="name" label="用户名" align="center" />
58
+          <el-table-column prop="realName" label="人员名称" align="center" />
59
+          <el-table-column prop="role" label="公司" align="center" />
62 60
           <el-table-column prop="position" label="职位" align="center" />
61
+          <el-table-column prop="telephone" label="电话" align="center" />
62
+          <el-table-column prop="warehouse" label="角色" align="center" />
63
+
63 64
           <el-table-column prop="btnStatus" label="禁用" align="center">
64 65
             <template slot-scope="scope">
65 66
               <el-switch

+ 24 - 1
shanXiPlatform/vue.config.js

@@ -35,13 +35,36 @@ module.exports = {
35 35
   lintOnSave:false,
36 36
   productionSourceMap: false,
37 37
   devServer: {
38
+
39
+
40
+    proxy: {  //配置跨域
41
+      '/api': {
42
+        target: 'http://10.10.1.25:9099',  //这里后台的地址模拟的;应该填写你们真实的后台接口
43
+        changOrigin: true,  //允许跨域
44
+       
45
+        pathRewrite: {
46
+          /* 重写路径,当我们在浏览器中看到请求的地址为:http://localhost:8080/api/core/getData/userInfo 时
47
+            实际上访问的地址是:http://121.121.67.254:8185/core/getData/userInfo,因为重写了 /api
48
+           */
49
+          '^/api': '' 
50
+        }
51
+      },
52
+    },
53
+
54
+
55
+
56
+
57
+   
58
+
59
+
60
+   
38 61
     port: port,
39 62
     open: true,
40 63
     overlay: {
41 64
       warnings: false,
42 65
       errors: true
43 66
     },
44
-    before: require('./mock/mock-server.js')
67
+    //before: require('./mock/mock-server.js')  //注释,不然会先走mock,然后再走本地服务不,被mock拦截了
45 68
   },
46 69
   configureWebpack: {
47 70
     // provide the app's title in webpack's name field, so that