linyanfei 5 anni fa
parent
commit
42f8145dee
53 ha cambiato i file con 4664 aggiunte e 2007 eliminazioni
  1. 1 1
      shanXiPlatform/.env.development
  2. 1 0
      shanXiPlatform/.eslintignore
  3. 14 14
      shanXiPlatform/mock/user.js
  4. 5 2
      shanXiPlatform/package.json
  5. 2 1
      shanXiPlatform/src/App.vue
  6. 11 0
      shanXiPlatform/src/api/branchoff/index.js
  7. 0 0
      shanXiPlatform/src/api/system/organizationalStructure/granary.js
  8. 49 0
      shanXiPlatform/src/api/system/organizationalStructure/personnel.js
  9. 0 0
      shanXiPlatform/src/api/system/organizationalStructure/warehouse.js
  10. 75 0
      shanXiPlatform/src/api/system/userManagement/role.js
  11. BIN
      shanXiPlatform/src/assets/images/messageBox.png
  12. 5 0
      shanXiPlatform/src/components/public/tableSelect.vue
  13. 17 12
      shanXiPlatform/src/layout/components/AppMain.vue
  14. 25 0
      shanXiPlatform/src/layout/components/Foot/index.vue
  15. 30 34
      shanXiPlatform/src/layout/components/Navbar.vue
  16. 9 0
      shanXiPlatform/src/layout/components/Sidebar/index.vue
  17. 10 4
      shanXiPlatform/src/layout/index.vue
  18. 2 1
      shanXiPlatform/src/permission.js
  19. 185 172
      shanXiPlatform/src/router/index.js
  20. 70 44
      shanXiPlatform/src/store/modules/user.js
  21. 2 2
      shanXiPlatform/src/styles/global.scss
  22. 1 1
      shanXiPlatform/src/utils/auth.js
  23. 13 3
      shanXiPlatform/src/utils/request.js
  24. 1 0
      shanXiPlatform/src/views/basicInformation/admin/components/TodoList/index.vue
  25. 33 38
      shanXiPlatform/src/views/basicInformation/index.vue
  26. 807 0
      shanXiPlatform/src/views/home/branchOffice.vue
  27. 16 1097
      shanXiPlatform/src/views/home/index.vue
  28. BIN
      shanXiPlatform/src/views/home/map.jpg
  29. 461 0
      shanXiPlatform/src/views/home/staff.vue
  30. 48 17
      shanXiPlatform/src/views/login/index.vue
  31. 0 5
      shanXiPlatform/src/views/reservesManagement/grainCheck.vue
  32. 15 0
      shanXiPlatform/src/views/reservesManagement/grainCheck/allGrain/index.vue
  33. 191 0
      shanXiPlatform/src/views/reservesManagement/grainCheck/newGrain/addNewGrain.vue
  34. 95 0
      shanXiPlatform/src/views/reservesManagement/grainCheck/newGrain/index.vue
  35. 36 0
      shanXiPlatform/src/views/reservesManagement/grainCheck/reservesTabs.vue
  36. 18 0
      shanXiPlatform/src/views/safeProduction/allSafe/index.vue
  37. 16 0
      shanXiPlatform/src/views/safeProduction/newSafe/index.vue
  38. 36 0
      shanXiPlatform/src/views/safeProduction/safeTabs.vue
  39. 0 5
      shanXiPlatform/src/views/safeProduction/safetyManagement.vue
  40. 0 5
      shanXiPlatform/src/views/safeProduction/safetyResponsibility.vue
  41. 25 26
      shanXiPlatform/src/views/systemManagement/organizationalStructureManagement/granaryOrganizationalStructureManagement/subWarehouse/addSub.vue
  42. 26 27
      shanXiPlatform/src/views/systemManagement/organizationalStructureManagement/granaryOrganizationalStructureManagement/subWarehouse/addWarehouse.vue
  43. 19 22
      shanXiPlatform/src/views/systemManagement/organizationalStructureManagement/organizationalStructureTabs.vue
  44. 411 153
      shanXiPlatform/src/views/systemManagement/organizationalStructureManagement/personnelOrganizationalStructureManagement/addPersonnel.vue
  45. 152 66
      shanXiPlatform/src/views/systemManagement/organizationalStructureManagement/personnelOrganizationalStructureManagement/index.vue
  46. 892 4
      shanXiPlatform/src/views/systemManagement/userManagement/approverManagement/index.vue
  47. 50 0
      shanXiPlatform/src/views/systemManagement/userManagement/departmentManagement/addDepartment.vue
  48. 97 99
      shanXiPlatform/src/views/systemManagement/userManagement/departmentManagement/index.vue
  49. 291 0
      shanXiPlatform/src/views/systemManagement/userManagement/roleManagement/addRole.vue
  50. 174 104
      shanXiPlatform/src/views/systemManagement/userManagement/roleManagement/index.vue
  51. 178 39
      shanXiPlatform/src/views/systemManagement/userManagement/userManagement/addUser.vue
  52. 9 8
      shanXiPlatform/src/views/systemManagement/userManagement/userManagement/index.vue
  53. 40 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/'

+ 1 - 0
shanXiPlatform/.eslintignore

@@ -2,3 +2,4 @@ build/*.js
2 2
 src/assets
3 3
 public
4 4
 dist
5
+src

+ 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,

+ 5 - 2
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",
@@ -28,6 +30,7 @@
28 30
     "js-cookie": "2.2.0",
29 31
     "jsonlint": "1.6.3",
30 32
     "jszip": "3.2.1",
33
+    "lint-staged": "^8.1.5",
31 34
     "normalize.css": "7.0.0",
32 35
     "nprogress": "0.2.0",
33 36
     "path-to-regexp": "2.4.0",
@@ -60,7 +63,7 @@
60 63
     "eslint-plugin-vue": "6.2.2",
61 64
     "html-webpack-plugin": "3.2.0",
62 65
     "husky": "1.3.1",
63
-    "lint-staged": "8.1.5",
66
+    "lint-staged": "^8.1.5",
64 67
     "mockjs": "1.0.1-beta3",
65 68
     "plop": "2.3.0",
66 69
     "runjs": "4.3.2",

+ 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>

+ 11 - 0
shanXiPlatform/src/api/branchoff/index.js

@@ -0,0 +1,11 @@
1
+import request from '@/utils/request'
2
+
3
+// 获取资源树
4
+
5
+export function  findbypage( data ) {
6
+  return request({
7
+    url: `/basicsWarehouse/authority/getPage`,
8
+    method: 'post',
9
+    data: data
10
+  })
11
+}

+ 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


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

@@ -0,0 +1,75 @@
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 editResourcesTree(params) {
15
+  return request({
16
+    url: `/role/authority/getByColeId`,
17
+    method: 'get',
18
+    params
19
+  })
20
+}
21
+
22
+// 获取列表
23
+export function getUserInfo(data) {
24
+  return request({
25
+    url: `/role/authority/getPage`,
26
+    method: 'post',
27
+    data
28
+  })
29
+}
30
+
31
+// 新增用户
32
+export function addUserInfo(data) {
33
+  return request({
34
+    url: `/role/authority_button/add`,
35
+    method: 'post',
36
+    data
37
+  })
38
+}
39
+
40
+// 删除用户
41
+export function deleteUserInfo(params) {
42
+  return request({
43
+    url: `/role/authority_button/deleteById`,
44
+    method: 'delete',
45
+    params
46
+  })
47
+}
48
+
49
+// 修改用户
50
+
51
+export function updateUserInfo(data) {
52
+  return request({
53
+    url: `/role/authority_button/update`,
54
+    method: 'post',
55
+    data
56
+  })
57
+}
58
+
59
+// 查看用户
60
+export function checkUserInfo(id) {
61
+  return request({
62
+    url: `/role/authority/getById/${id}`,
63
+    method: 'get'
64
+
65
+  })
66
+}
67
+
68
+// 查看角色是否存在
69
+export function roleIsExit(params) {
70
+  return request({
71
+    url: `/role/authority_button/getByRoleName`,
72
+    method: 'get',
73
+    params
74
+  })
75
+}

BIN
shanXiPlatform/src/assets/images/messageBox.png


+ 5 - 0
shanXiPlatform/src/components/public/tableSelect.vue

@@ -0,0 +1,5 @@
1
+<template>
2
+    <div>
3
+        <el-table></el-table>
4
+    </div>
5
+</template>

+ 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>

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

@@ -0,0 +1,25 @@
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
+        z-index: 9999;
24
+    }
25
+</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()

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

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

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

+ 807 - 0
shanXiPlatform/src/views/home/branchOffice.vue

@@ -0,0 +1,807 @@
1
+
2
+<template style="height:100%">
3
+  <div class="chart-containerr">
4
+    <div class="leftboxs">
5
+      <div id="myCharttwo" class="one" />
6
+      <div id="myChartone" class="two" />
7
+      <div id="myChartthi" class="thi" />
8
+    </div>
9
+    <div class="rightbox">
10
+      <div class="rtop">
11
+        <div id="myChartdt" class="rtopl" />
12
+        <div class="rtopr">
13
+          <div id="myChartrt" class="rtoprt" />
14
+          <div id="myChartrb" class="rtoprb" />
15
+        </div>
16
+      </div>
17
+      <div id="myChartfor" class="rbot" />
18
+    </div>
19
+  </div>
20
+</template>
21
+<script>
22
+import axios from "axios"
23
+// import { findbypage } from '@/api/branchoff'
24
+import "../../../node_modules/echarts/map/js/province/shanxi.js"
25
+export default {
26
+  name: "Home",
27
+  // components: { Chart, BarChart, LineMarker },
28
+  data() {
29
+    return {
30
+      provinceJson: null, // 省地图json
31
+      obj: {}
32
+    }
33
+  },
34
+  created() {
35
+    // findbypage( this.obj ).then({
36
+    // })
37
+  },
38
+  mounted() {
39
+    this.drawone()
40
+    this.drawtwo()
41
+    this.drawthi()
42
+    this.drawfor()
43
+    this.drawtdt()
44
+    this.drawtrt()
45
+    this.drawtrb()
46
+  },
47
+  methods: {
48
+    drawone() {
49
+      var color = ["#4A9BDA", "#FC7703", "#A5A5A5"]
50
+      var data = [
51
+        {
52
+          name: "半仓",
53
+          value: 320
54
+        },
55
+        {
56
+          name: "满仓",
57
+          value: 586
58
+        },
59
+        {
60
+          name: "空仓",
61
+          value: 874
62
+        }
63
+      ]
64
+
65
+      const myCharttwo = this.$echarts.init(
66
+        document.getElementById("myCharttwo")
67
+      )
68
+      // 绘制图表
69
+      myCharttwo.setOption({
70
+        title: [
71
+          {
72
+            text: "储存状态",
73
+            // top:'5%',
74
+            // right:'3%',
75
+            show: true,
76
+            textStyle: {
77
+              color: "#000",
78
+              fontSize: 12
79
+            }
80
+          }
81
+        ],
82
+        // toolbox: {
83
+        //   show: true,
84
+        //   orient: "horizontal",
85
+        //   feature: {
86
+        //     saveAsImage: {
87
+        //       show: true,
88
+        //       title: "导出",
89
+        //       excludeComponents: ["toolbox"],
90
+        //       pixelRatio: 2
91
+        //     }
92
+        //   },
93
+        //   left: "right",
94
+        //   top: 0
95
+        // },
96
+
97
+        legend: [
98
+          {
99
+            selectedMode: true, // 图例选择的模式,控制是否可以通过点击图例改变系列的显示状态。默认开启图例选择,可以设成 false 关闭。
100
+            bottom: "1%",
101
+            left: "center",
102
+            textStyle: {
103
+              // 图例的公用文本样式。
104
+              fontSize: 8,
105
+              color: "#333"
106
+            },
107
+            data: ["半仓", "满仓", "空仓"]
108
+          }
109
+        ],
110
+
111
+        tooltip: {
112
+          show: true, // 是否显示提示框
113
+          formatter: "{b} </br> 重量{c} </br> 占比{d}%" // 提示框显示内容,此处{b}表示各数据项名称,此项配置为默认显示项,{c}表示数据项的值,默认不显示,({d}%)表示数据项项占比,默认不显示。
114
+        },
115
+
116
+        // graphic 是原生图形元素组件。可以支持的图形元素包括:image, text, circle, sector, ring, polygon, polyline, rect, line, bezierCurve, arc, group,
117
+        // graphic: {
118
+        //     type: 'text',               // [ default: image ]用 setOption 首次设定图形元素时必须指定。image, text, circle, sector, ring, polygon, polyline, rect, line, bezierCurve, arc, group,
119
+        //     top: 'center',              // 描述怎么根据父元素进行定位。top 和 bottom 只有一个可以生效。如果指定 top 或 bottom,则 shape 里的 y、cy 等定位属性不再生效。『父元素』是指:如果是顶层元素,父元素是 echarts 图表容器。如果是 group 的子元素,父元素就是 group 元素。
120
+        //     left: 'center',             // 同上
121
+        //     style: {
122
+        //         text: '各服装销量对比',       // 文本块文字。可以使用 \n 来换行。[ default: '' ]
123
+        //         fill: '#fff',           // 填充色。
124
+        //         fontSize: 16,           // 字体大小
125
+        //         fontWeight: 'bold'		// 文字字体的粗细,可选'normal','bold','bolder','lighter'
126
+        //     }
127
+        // },
128
+
129
+        // 系列列表
130
+        series: [
131
+          {
132
+            name: "圆环图系列名称", // 系列名称
133
+            type: "pie", // 系列类型
134
+            center: ["50%", "50%"], // 饼图的中心(圆心)坐标,数组的第一项是横坐标,第二项是纵坐标。[ default: ['50%', '50%'] ]
135
+            radius: ["30%", "45%"], // 饼图的半径,数组的第一项是内半径,第二项是外半径。[ default: [0, '75%'] ]
136
+            hoverAnimation: true, // 是否开启 hover 在扇区上的放大动画效果。[ default: true ]
137
+            color: color, // 圆环图的颜色
138
+            label: {
139
+              // 饼图图形上的文本标签,可用于说明图形的一些数据信息,比如值,名称等.
140
+              normal: {
141
+                show: false, // 是否显示标签[ default: false ]
142
+                position: "outside", // 标签的位置。'outside'饼图扇区外侧,通过视觉引导线连到相应的扇区。'inside','inner' 同 'inside',饼图扇区内部。'center'在饼图中心位置。
143
+                formatter: "{b} : {c}件" // 标签内容
144
+              }
145
+            },
146
+            labelLine: {
147
+              // 标签的视觉引导线样式,在 label 位置 设置为'outside'的时候会显示视觉引导线。
148
+              normal: {
149
+                show: true, // 是否显示视觉引导线。
150
+                length: 15, // 在 label 位置 设置为'outside'的时候会显示视觉引导线。
151
+                length2: 10, // 视觉引导项第二段的长度。
152
+                lineStyle: {
153
+                  // 视觉引导线的样式
154
+                  // color: '#000',
155
+                  // width: 1
156
+                }
157
+              }
158
+            },
159
+            data: data // 系列中的数据内容数组。
160
+          }
161
+        ]
162
+      })
163
+    },
164
+    drawtwo() {
165
+      const myChartone = this.$echarts.init(
166
+        document.getElementById("myChartone")
167
+      )
168
+      // 绘制图表
169
+      myChartone.setOption({
170
+        title: {
171
+          text: "粮食种类",
172
+          show: true,
173
+          textStyle: {
174
+            color: "#333333",
175
+            fontSize: 12
176
+          }
177
+        },
178
+        // toolbox: {
179
+        //   show: true,
180
+        //   orient: "horizontal",
181
+        //   feature: {
182
+        //     saveAsImage: {
183
+        //       show: true,
184
+        //       title: "导出",
185
+        //       excludeComponents: ["toolbox"],
186
+        //       pixelRatio: 2
187
+        //     }
188
+        //   },
189
+        //   left: "right",
190
+        //   top: 0
191
+        // },
192
+        color: "rgb(89, 176, 50)",
193
+        xAxis: {
194
+          type: "category",
195
+          data: [1, 1, 1],
196
+          name: "",
197
+          axisLabel: {
198
+            interval: 0
199
+            // rotate: 45 //代表x轴逆时针度数
200
+          }
201
+        },
202
+        grid: {
203
+          bottom: "7%",
204
+          right: "15%",
205
+          containLabel: true
206
+        },
207
+        tooltip: {
208
+          trigger: "axis",
209
+          axisPointer: {
210
+            type: "shadow" // 默认为直线,可选为:'line' | 'shadow'
211
+          }
212
+        },
213
+        yAxis: {
214
+          type: "value",
215
+          name: ""
216
+        },
217
+        series: [
218
+          {
219
+            data: [1, 1, 1],
220
+            type: "bar",
221
+            itemStyle: {
222
+              normal: {
223
+                label: {
224
+                  show: true, // 开启显示
225
+                  position: "top", // 在上方显示
226
+                  textStyle: {
227
+                    // 数值样式
228
+                    color: "black",
229
+                    fontSize: 12
230
+                  }
231
+                }
232
+              }
233
+            }
234
+          }
235
+        ]
236
+      })
237
+    },
238
+    drawthi() {
239
+      const myChartthi = this.$echarts.init(
240
+        document.getElementById("myChartthi")
241
+      )
242
+      // 绘制图表
243
+      myChartthi.setOption({
244
+        title: {
245
+          text: "仓房状态",
246
+          show: true,
247
+          textStyle: {
248
+            color: "#000",
249
+            fontSize: 12
250
+          }
251
+        },
252
+        legend: [
253
+          {
254
+            selectedMode: true, // 图例选择的模式,控制是否可以通过点击图例改变系列的显示状态。默认开启图例选择,可以设成 false 关闭。
255
+            bottom: "13%",
256
+            left: "center",
257
+            textStyle: {
258
+              // 图例的公用文本样式。
259
+              fontSize: 8,
260
+              color: "#333"
261
+            },
262
+            data: ["通风", "熏蒸", "出库", "入库"]
263
+          }
264
+        ],
265
+        tooltip: {
266
+          trigger: "item",
267
+          formatter: "{a} <br/>{b} : {c} ({d}%)"
268
+        },
269
+        series: [
270
+          {
271
+            name: "仓房状况",
272
+            type: "pie", // 设置图表类型为饼图
273
+            radius: "55%", // 饼图的半径,外半径为可视区尺寸(容器高宽中较小一项)的 55% 长度。
274
+            data: [
275
+              // 数据数组,name 为数据项名称,value 为数据项值
276
+              { value: 235, name: "通风" },
277
+              { value: 274, name: "熏蒸" },
278
+              { value: 310, name: "出库" },
279
+              { value: 335, name: "入库" }
280
+            ],
281
+            emphasis: {
282
+              itemStyle: {
283
+                shadowBlur: 10,
284
+                shadowOffsetX: 0,
285
+                shadowColor: "rgba(0, 0, 0, 0.5)"
286
+              }
287
+            },
288
+            label: {
289
+              // 去除饼图的指示折线label
290
+              normal: {
291
+                show: false,
292
+                position: "inner"
293
+                // formatter: "{b}:{d}%"
294
+              }
295
+            }
296
+          }
297
+        ]
298
+      })
299
+    },
300
+    drawfor() {
301
+      const myChartfor = this.$echarts.init(
302
+        document.getElementById("myChartfor")
303
+      )
304
+      // 绘制图表
305
+      myChartfor.setOption({
306
+        title: {
307
+          text: "粮情检测(虫害)",
308
+          show: true,
309
+          textStyle: {
310
+            color: "#000",
311
+            fontSize: 12
312
+          }
313
+        },
314
+        xAxis: {
315
+          type: "category",
316
+          axisLine: {
317
+            lineStyle: {
318
+              type: "solid",
319
+              color: "01fffd",
320
+              width: "2"
321
+            }
322
+          },
323
+          //  splitLine:{
324
+          //  show: true, // X轴线 颜色类型的修改
325
+          //  lineStyle: {
326
+          //  type: 'dashed',
327
+          //  color: '#04cdf4'
328
+          //  }
329
+          //  },
330
+          axisLabel: {
331
+            interval: 0,
332
+            textStyle: {
333
+              fontSize: 10,
334
+              color: "#333"
335
+            },
336
+            rotate: -0
337
+          },
338
+          data: [
339
+            "01",
340
+            "02",
341
+            "03",
342
+            "04",
343
+            "05",
344
+            "06",
345
+            "07",
346
+            "08",
347
+            "09",
348
+            "10",
349
+            "11",
350
+            "12"
351
+          ]
352
+        },
353
+        grid: {
354
+          left: "3%",
355
+          right: "4%",
356
+          bottom: "3%",
357
+          top: "26%",
358
+          containLabel: true
359
+        },
360
+        yAxis: {
361
+          axisLine: {
362
+            lineStyle: {
363
+              type: "solid",
364
+              color: "#f2f2f2",
365
+              width: "2"
366
+            }
367
+          },
368
+          splitLine: {
369
+            show: true, // X轴线 颜色类型的修改
370
+            lineStyle: {
371
+              type: "solid",
372
+              color: "#f2f2f2"
373
+            }
374
+          },
375
+          axisLabel: {
376
+            interval: 0,
377
+            textStyle: {
378
+              fontSize: 10,
379
+              color: "#333"
380
+            },
381
+            rotate: -0
382
+          },
383
+          type: "value"
384
+        },
385
+        series: [
386
+          {
387
+            itemStyle: {
388
+              normal: {
389
+                color: "#A7CDEC", // 改变折线点的颜色
390
+                lineStyle: {
391
+                  color: "#A7CDEC" // 改变折线颜色
392
+                }
393
+              }
394
+            },
395
+            data: [0, 0.3, 0, 0.6, 0, 0.7, 0, 0, 0.9, 0, 1, 0],
396
+            type: "line"
397
+          }
398
+        ]
399
+      })
400
+    },
401
+    drawtdt() {
402
+      // axios.get("/mock/100000.json", {}).then(res => {
403
+        // console.log(res.data, " resres")
404
+        const myChartdt = this.$echarts.init(
405
+          document.getElementById("myChartdt")
406
+        )
407
+        var option = {
408
+          title: {
409
+            text: "山西省",
410
+            show: true,
411
+            subtext: "",
412
+            x: "left"
413
+          },
414
+          //   toolbox: {
415
+          //     show: true,
416
+          //     orient: "horizontal",
417
+          //     feature: {
418
+          //       saveAsImage: {
419
+          //         show: true,
420
+          //         title: "导出",
421
+          //         excludeComponents: ["toolbox"],
422
+          //         pixelRatio: 2
423
+          //       }
424
+          //     },
425
+          //     top: 0,
426
+          //     right: "15"
427
+          //   },
428
+          tooltip: {
429
+            trigger: "item",
430
+            formatter: "{b}",
431
+            itemSize: "14px"
432
+          },
433
+          legend: {
434
+            orient: "vertical",
435
+            x: "center",
436
+            data: ["山西省"]
437
+          },
438
+          dataRange: {
439
+            x: "right",
440
+            y: "center",
441
+            splitList: [
442
+              { start: 5000 },
443
+              { start: 3000, end: 4999 },
444
+              { start: 2000, end: 2999 },
445
+              { start: 0, end: 1999 }
446
+            ],
447
+            color: ["#F1F6E2", "#FFE7FF", "#E1EDFC", "#C4F7F6"]
448
+          },
449
+          series: [
450
+            {
451
+              name: "山西",
452
+              type: "map",
453
+              mapType: "山西",
454
+              roam: true,
455
+              itemStyle: {
456
+                normal: {
457
+                  label: {
458
+                    show: false,
459
+                    textStyle: {
460
+                      color: "#000"
461
+                    }
462
+                  }
463
+                },
464
+                emphasis: { label: { show: true } }
465
+              },
466
+              data: [
467
+                { name: "大同市", selected: false, value: 1 },
468
+                { name: "朔州市", selected: false, value: 3000 },
469
+                { name: "忻州市", selected: false, value: 6000 },
470
+                { name: "太原市", selected: false, value: 4 },
471
+                { name: "阳泉市", selected: false, value: 3800 },
472
+                { name: "吕梁市", selected: false, value: 3000 },
473
+                { name: "晋中市", selected: false, value: 7 },
474
+                { name: "临汾市", selected: false, value: 6000 },
475
+                { name: "长治市", selected: false, value: 999 },
476
+                { name: "运城市", selected: false, value: 10 },
477
+                { name: "晋城市", selected: false, value: 3000 }
478
+              ]
479
+            }
480
+          ]
481
+        }
482
+        myChartdt.on("click", params => {
483
+          console.log(params)
484
+        })
485
+
486
+        // myChartdt.on("mouseover", params => {
487
+        //   let cityName = params.name
488
+        //   this.zhzbname = cityName
489
+        //   this.tableDatadt.find(item => {
490
+        //     if (item.name == cityName.slice(0, 2)) {
491
+        //       this.cityVal = true
492
+        //       this.zhzb = item.percentage
493
+        //       this.xtdl = item.dlpercentage
494
+        //       this.gnfw = item.fwpercentage
495
+        //       this.gncz = item.czpercentage
496
+        //     }
497
+        //   })
498
+        //   if (this.cityVal === true) {
499
+        //     this.isDisplay = "inline-block"
500
+        //   } else {
501
+        //     this.isDisplay = "none"
502
+        //   }
503
+        // })
504
+        // myChartdt.on("mouseout", params => {
505
+        //   this.zhzb = ""
506
+        //   this.isDisplay = "none"
507
+        // })
508
+        myChartdt.setOption(option, true)
509
+      // })
510
+    },
511
+
512
+    drawtrt() {
513
+      var chartData = [100, 100, 100, 100, 100, 100, 100, 100, 100, 100] // 数据
514
+      var yMax = "" // 最大值
515
+      for (var i = 0; i < chartData.length; i++) {
516
+        yMax = chartData[i]
517
+      }
518
+      yMax += yMax / 10
519
+      var yMaxArr = [] // 全部都是最大值, 做图形的底部灰色打底
520
+      for (var o = 0; o < chartData.length; o++) {
521
+        yMaxArr.push(yMax)
522
+      }
523
+      var chartName = [
524
+        "中央储备大同直属库有限公司",
525
+        "中央储备太原直属库有限公司",
526
+        "中央储备太原直属库有限公司",
527
+        "中央储备太原直属库有限公司",
528
+        "中央储备太原直属库有限公司",
529
+        "中央储备太原直属库有限公司",
530
+        "中央储备太原直属库有限公司",
531
+        "中央储备太原直属库有限公司",
532
+        "中央储备太原直属库有限公司",
533
+        "中央储备长治直属库有限公司"
534
+      ]
535
+      const myChartrt = this.$echarts.init(document.getElementById("myChartrt"))
536
+      // 绘制图表
537
+      myChartrt.setOption({
538
+        title: {
539
+          text: "上月在线活跃度排名",
540
+          show: true,
541
+          textStyle: {
542
+            color: "#333333",
543
+            fontSize: 12
544
+          }
545
+        },
546
+
547
+        grid: {
548
+          top: "center",
549
+          height: 120,
550
+          left: 120,
551
+          right: 30
552
+        },
553
+
554
+        xAxis: {
555
+          type: "value",
556
+          axisLine: {
557
+            lineStyle: {
558
+              color: "#ccc"
559
+            }
560
+          },
561
+          show: false,
562
+          splitLine: {
563
+            show: false
564
+          }
565
+        },
566
+        yAxis: [
567
+          {
568
+            type: "category",
569
+            data: chartName,
570
+            splitLine: {
571
+              show: false
572
+            },
573
+            show: false,
574
+            axisLine: {
575
+              lineStyle: {
576
+                color: "#ccc"
577
+              }
578
+            }
579
+          },
580
+          {
581
+            // 第二个y轴 为了让数据在右侧末尾显示
582
+            show: true,
583
+            inverse: true,
584
+            data: chartData,
585
+            nameTextStyle: {}, // 坐标轴名称的文字样式。 官网上是这样的解释, 但是 我试了这个并不能改变坐标轴的文字样式
586
+            axisLabel: {
587
+              textStyle: {
588
+                fontSize: 8, // 坐标轴名称的大小
589
+                color: "#333", // 坐标轴名称的颜色
590
+                fontWeight: 700
591
+              }
592
+            },
593
+            axisLine: {
594
+              show: false
595
+            },
596
+            splitLine: {
597
+              show: false
598
+            },
599
+            axisTick: {
600
+              show: false
601
+            }
602
+          }
603
+        ],
604
+        series: [
605
+          {
606
+            name: "我是打底",
607
+            type: "pictorialBar",
608
+            symbol: "rect", // 类型
609
+            yAxisIndex: 0,
610
+            barWidth: 10,
611
+            itemStyle: {
612
+              normal: {
613
+                // barBorderRadius: 5,
614
+                color: "#ccc"
615
+              }
616
+            },
617
+            label: {
618
+              normal: {
619
+                position: "right"
620
+              }
621
+            },
622
+            symbolRepeat: true,
623
+            // symbolRotate: '45',
624
+            symbolSize: [8, 8],
625
+            // symbolMargin: 2,
626
+            data: yMaxArr
627
+          },
628
+          {
629
+            name: "我是上层方块",
630
+            type: "pictorialBar",
631
+            symbol: "rect",
632
+            itemStyle: {
633
+              normal: {
634
+                color: "green"
635
+              }
636
+            },
637
+            label: {
638
+              normal: {
639
+                // show: true, // 数据大小的显示, 100 200 300
640
+                textStyle: {
641
+                  color: "#000000" // 颜色
642
+                },
643
+                position: "right"
644
+              }
645
+            },
646
+            barWidth: 10,
647
+            symbolRepeat: true,
648
+            // symbolRotate: '45',
649
+            symbolSize: [8, 8],
650
+            // symbolMargin: 2,
651
+            data: [100, 100, 100, 100, 100, 100, 100, 100, 100, 100]
652
+          },
653
+          // 数据条--------------------我是分割线君------------------------------//
654
+          {
655
+            show: true,
656
+            type: "bar",
657
+            // xAxisIndex: 1, //代表使用第二个X轴刻度
658
+            barGap: "-100%",
659
+            barWidth: "25%",
660
+            itemStyle: {
661
+              normal: {
662
+                barBorderRadius: 50,
663
+                // color: 'yellow',
664
+                color: "transparent" // rgba(22,203,115,0.05) 数据条柱状图的填充颜色,, 一开始我的有一点点背景颜色
665
+              }
666
+            },
667
+            label: {
668
+              normal: {
669
+                show: true,
670
+                position: [-110, 0],
671
+                textStyle: {
672
+                  fontSize: 8,
673
+                  color: "#333",
674
+                  fontWeight: 700
675
+                },
676
+                formatter: function(data) {
677
+                  return chartName[data.dataIndex]
678
+                }
679
+              }
680
+            },
681
+            data: chartData
682
+          }
683
+        ]
684
+      })
685
+    },
686
+    drawtrb() {
687
+      const myChartrb = this.$echarts.init(document.getElementById("myChartrb"))
688
+      // 绘制图表
689
+      myChartrb.setOption({
690
+        title: {
691
+          text: "上月工作积分情况",
692
+          show: true,
693
+          textStyle: {
694
+            color: "#333333",
695
+            fontSize: 12
696
+          }
697
+        },
698
+
699
+        color: "#0033FF",
700
+        xAxis: {
701
+          type: "value",
702
+          data: [1, 1, 1],
703
+          name: "",
704
+          axisLabel: {
705
+            interval: 0
706
+            // rotate: 45 //代表x轴逆时针度数
707
+          }
708
+        },
709
+        grid: {
710
+          bottom: "7%",
711
+          right: "15%",
712
+          containLabel: true
713
+        },
714
+        tooltip: {
715
+          trigger: "axis",
716
+          axisPointer: {
717
+            type: "shadow" // 默认为直线,可选为:'line' | 'shadow'
718
+          }
719
+        },
720
+        yAxis: {
721
+          type: "category",
722
+          name: ""
723
+        },
724
+        series: [
725
+          {
726
+            data: [1, 1, 1],
727
+            type: "bar",
728
+            itemStyle: {
729
+              normal: {
730
+                label: {
731
+                  show: true, // 开启显示
732
+                  position: "right", // 在上方显示
733
+                  textStyle: {
734
+                    // 数值样式
735
+                    color: "black",
736
+                    fontSize: 12
737
+                  }
738
+                }
739
+              }
740
+            }
741
+          }
742
+        ]
743
+      })
744
+    }
745
+  }
746
+}
747
+</script>
748
+<style scoped lang="scss">
749
+.chart-containerr {
750
+  position: relative;
751
+  width: 100%;
752
+  height: calc(100vh - 84px);
753
+  .leftboxs {
754
+    width: 20%;
755
+    height: calc(100vh - 84px);
756
+    display: inline-block;
757
+    .one {
758
+      width: 100%;
759
+      height: calc(100vh * 0.3);
760
+    }
761
+    .two {
762
+      width: 100%;
763
+      height: calc(100vh * 0.3);
764
+    }
765
+    .thi {
766
+      width: 100%;
767
+      height: calc(100vh * 0.3);
768
+    }
769
+  }
770
+  .rightbox {
771
+    width: 80%;
772
+    height: calc(100vh - 84px);
773
+    display: inline-block;
774
+    .rtop {
775
+      width: 100%;
776
+      height: calc(100vh * 0.65);
777
+      .rtopl {
778
+        width: 70%;
779
+        height: 100%;
780
+        border: 1px solid #ccc;
781
+        border-radius: 5px;
782
+        margin: 3px 0;
783
+        float: left;
784
+      }
785
+      .rtopr {
786
+        width: 30%;
787
+        height: 100%;
788
+        float: right;
789
+        .rtoprt {
790
+          // 右边下面的
791
+          width: 100%;
792
+          height: 50%;
793
+        }
794
+        .rtoprb {
795
+          // 右边上面的
796
+          width: 100%;
797
+          height: 50%;
798
+        }
799
+      }
800
+    }
801
+    .rbot {
802
+      width: 100%;
803
+      height: calc(100vh * 0.2);
804
+    }
805
+  }
806
+}
807
+</style>

File diff suppressed because it is too large
+ 16 - 1097
shanXiPlatform/src/views/home/index.vue


BIN
shanXiPlatform/src/views/home/map.jpg


File diff suppressed because it is too large
+ 461 - 0
shanXiPlatform/src/views/home/staff.vue


+ 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%;

+ 0 - 5
shanXiPlatform/src/views/reservesManagement/grainCheck.vue

@@ -1,5 +0,0 @@
1
-<template>
2
-    <div>
3
-        粮情监测
4
-    </div>
5
-</template>

+ 15 - 0
shanXiPlatform/src/views/reservesManagement/grainCheck/allGrain/index.vue

@@ -0,0 +1,15 @@
1
+<template>
2
+  <div>
3
+    全部粮情检查记录
4
+  </div>
5
+</template>
6
+<script>
7
+export default {
8
+  name: 'AllGrain',
9
+  data() {
10
+    return {
11
+
12
+    }
13
+  }
14
+}
15
+</script>

+ 191 - 0
shanXiPlatform/src/views/reservesManagement/grainCheck/newGrain/addNewGrain.vue

@@ -0,0 +1,191 @@
1
+<template>
2
+  <div class="global">
3
+    <div class="mainContainer">
4
+      <div class="header">
5
+        <span>粮情检测类型:</span>
6
+        <span>保管员每周检查粮情</span>
7
+      </div>
8
+
9
+      <div class="table">
10
+        <el-table border stripe highlight-current-row :data="weekData" height="550">
11
+          <el-table-column
12
+            type="index"
13
+            align="center"
14
+            label="序号"
15
+            width="50px"
16
+          />
17
+          <el-table-column prop="checkTime" label="检查时间" align="center" />
18
+          <el-table-column prop="checkItem" label="检查项" align="center" />
19
+          <el-table-column prop="option" label="选项" align="center">
20
+            <template slot-scope="scope">
21
+              <el-radio-group v-model="scope.row.option.radio">
22
+                <el-radio label="1">{{ scope.row.option.status1 }}</el-radio>
23
+                <el-radio label="0">{{ scope.row.option.status2 }}</el-radio>
24
+              </el-radio-group>
25
+            </template>
26
+          </el-table-column>
27
+        </el-table>
28
+      </div>
29
+
30
+      <div class="btns">
31
+        <el-button type="success" plain>取消</el-button>
32
+        <el-button type="success">保存</el-button>
33
+      </div>
34
+    </div>
35
+  </div>
36
+</template>
37
+<script>
38
+export default {
39
+  name: 'AddNewGrain',
40
+  data() {
41
+    return {
42
+      // 每周数据
43
+      weekData: [
44
+        {
45
+          checkTime: '',
46
+          checkItem: ' 打印粮温检测结果',
47
+          option: {
48
+            status1: '是',
49
+            status1: '否',
50
+            radio: ''
51
+          }
52
+        },
53
+        {
54
+          checkTime: '',
55
+          checkItem: '开灯',
56
+          option: {
57
+            status1: '是',
58
+            status1: '否',
59
+            radio: ''
60
+          }
61
+        },
62
+
63
+        {
64
+          checkTime: '',
65
+          checkItem: '双人进仓',
66
+          option: {
67
+            status1: '是',
68
+            status1: '否',
69
+            radio: ''
70
+          }
71
+        },
72
+
73
+        {
74
+          checkTime: '',
75
+          checkItem: '气体浓度是否达标(氧气、磷化氢)',
76
+          option: {
77
+            status1: '是',
78
+            status1: '否',
79
+            radio: ''
80
+          }
81
+        },
82
+        {
83
+          checkTime: '',
84
+          checkItem: '照明灯是否正常',
85
+          option: {
86
+            status1: '是',
87
+            status1: '否',
88
+            radio: ''
89
+          }
90
+        },
91
+        {
92
+          checkTime: '',
93
+          checkItem: '色泽、气味是否正常',
94
+          option: {
95
+            status1: '是',
96
+            status1: '否',
97
+            radio: ''
98
+          }
99
+        },
100
+        {
101
+          checkTime: '',
102
+          checkItem: ' 虫害异常',
103
+          option: {
104
+            status1: '是',
105
+            status1: '否',
106
+            radio: ''
107
+          }
108
+        },
109
+        {
110
+          checkTime: '',
111
+          checkItem: '水分检测异常',
112
+          option: {
113
+            status1: '是',
114
+            status1: '否',
115
+            radio: ''
116
+          }
117
+        },
118
+
119
+        {
120
+          checkTime: '',
121
+          checkItem: '异常粮情',
122
+          option: {
123
+            status1: '是',
124
+            status1: '否',
125
+            radio: ''
126
+          }
127
+        },
128
+
129
+        {
130
+          checkTime: '',
131
+          checkItem: '锁门',
132
+          option: {
133
+            status1: '是',
134
+            status1: '否',
135
+            radio: ''
136
+          }
137
+        },
138
+
139
+        {
140
+          checkTime: '',
141
+          checkItem: '关灯',
142
+          option: {
143
+            status1: '是',
144
+            status1: '否',
145
+            radio: ''
146
+          }
147
+        },
148
+
149
+        {
150
+          checkTime: '',
151
+          checkItem: '粮情作业簿填写',
152
+          option: {
153
+            status1: '是',
154
+            status1: '否',
155
+            radio: ''
156
+          }
157
+        },
158
+
159
+        {
160
+          checkTime: '',
161
+          checkItem: '保管日志填写',
162
+          option: {
163
+            status1: '是',
164
+            status1: '否',
165
+            radio: ''
166
+          }
167
+        },
168
+
169
+        {
170
+          checkTime: '',
171
+          checkItem: ' 粮情分析会',
172
+          option: {
173
+            status1: '是',
174
+            status1: '否',
175
+            radio: ''
176
+          }
177
+        }
178
+      ]
179
+    }
180
+  }
181
+}
182
+</script>
183
+<style lang="scss" scoped>
184
+.header {
185
+  margin-bottom: 20px;
186
+}
187
+.btns{
188
+    text-align:right;
189
+    margin-top:20px;
190
+}
191
+</style>

+ 95 - 0
shanXiPlatform/src/views/reservesManagement/grainCheck/newGrain/index.vue

@@ -0,0 +1,95 @@
1
+<template>
2
+  <div>
3
+    <div class="table">
4
+      <el-table
5
+        border
6
+        stripe
7
+        :data="newGrainData"
8
+        highlight-current-row
9
+      >
10
+        <el-table-column
11
+          type="index"
12
+          align="center"
13
+          label="序号"
14
+          width="50px"
15
+        />
16
+        <el-table-column prop="name" label="检查类型" align="center" />
17
+        <el-table-column prop="realName" label="最后记录时间" align="center" />
18
+        <el-table-column prop="role" label="状态" align="center" />
19
+        <el-table-column prop="position" label="有无异常" align="center" />
20
+        <el-table-column prop="telephone" label="异常项" align="center" />
21
+
22
+        <el-table-column
23
+          prop="operation"
24
+          label="操作"
25
+          align="center"
26
+          width="200px"
27
+          fixed="right"
28
+        >
29
+          <template slot-scope="scope">
30
+            <el-button
31
+              size="mini"
32
+              @click="add(scope.$index, scope.row)"
33
+            >新增</el-button>
34
+            <el-button
35
+              size="mini"
36
+              @click="moreRecords(scope.$index, scope.row)"
37
+            >更多记录</el-button>
38
+          </template>
39
+        </el-table-column>
40
+      </el-table>
41
+
42
+    </div>
43
+  </div>
44
+</template>
45
+<script>
46
+export default {
47
+  name: 'NewGrain',
48
+  data() {
49
+    return {
50
+      // 用户列表
51
+      newGrainData: [
52
+        {
53
+          name: 'aa',
54
+          realName: 'AA',
55
+          role: 'a',
56
+          warehouse: 'a',
57
+          telephone: 'a',
58
+          position: 'a',
59
+          btnStatus: true
60
+        },
61
+        {
62
+          name: 'aa',
63
+          realName: 'AA',
64
+          role: 'a',
65
+          warehouse: 'a',
66
+          telephone: 'a',
67
+          position: 'a',
68
+          btnStatus: false
69
+        },
70
+        {
71
+          name: 'aa',
72
+          realName: 'AA',
73
+          role: 'a',
74
+          warehouse: 'a',
75
+          telephone: 'a',
76
+          position: 'a',
77
+          btnStatus: true
78
+        }
79
+      ]
80
+    }
81
+  },
82
+
83
+  methods: {
84
+    // 新增按钮
85
+    add(index, row) {
86
+      this.$router.push({ path: '/grainCheck/addNewGrain' })
87
+    },
88
+
89
+    // 更多记录
90
+    moreRecords() {
91
+
92
+    }
93
+  }
94
+}
95
+</script>

+ 36 - 0
shanXiPlatform/src/views/reservesManagement/grainCheck/reservesTabs.vue

@@ -0,0 +1,36 @@
1
+<template>
2
+  <div class="global">
3
+    <div class="mainContainer">
4
+      <div class="tab">
5
+        <el-tabs v-model="activeName" @tab-click="handleClick">
6
+          <el-tab-pane label="最新粮情检查记录" name="NewGrain" />
7
+          <el-tab-pane label="全部粮情检查记录" name="AllGrain" />
8
+
9
+        </el-tabs>
10
+      </div>
11
+      <div id="main">
12
+
13
+        <router-view id="mainRight" />
14
+      </div>
15
+    </div>
16
+  </div>
17
+</template>
18
+<script>
19
+export default {
20
+  name: 'NewGrain',
21
+  data() {
22
+    return {
23
+      activeName: 'NewGrain'
24
+    }
25
+  },
26
+  mounted() {
27
+    this.activeName = this.$route.name
28
+  },
29
+  methods: {
30
+    handleClick(tab, event) {
31
+      console.log(tab, event)
32
+      this.$router.push(tab.name)
33
+    }
34
+  }
35
+}
36
+</script>

+ 18 - 0
shanXiPlatform/src/views/safeProduction/allSafe/index.vue

@@ -0,0 +1,18 @@
1
+<template>
2
+  <div>
3
+    全部安全
4
+  </div>
5
+</template>
6
+<script>
7
+export default {
8
+  name: 'AllSafe',
9
+  data() {
10
+    return {
11
+
12
+    }
13
+  }
14
+}
15
+</script>
16
+<style lang="scss" scoped>
17
+
18
+</style>

+ 16 - 0
shanXiPlatform/src/views/safeProduction/newSafe/index.vue

@@ -0,0 +1,16 @@
1
+<template>
2
+  <div>
3
+    最新安全
4
+  </div>
5
+</template>
6
+<script>
7
+export default {
8
+  name: 'NewSafe',
9
+  data() {
10
+    return {}
11
+  }
12
+}
13
+</script>
14
+<style lang="scss" scoped>
15
+
16
+</style>

+ 36 - 0
shanXiPlatform/src/views/safeProduction/safeTabs.vue

@@ -0,0 +1,36 @@
1
+<template>
2
+  <div class="global">
3
+    <div class="mainContainer">
4
+      <div class="tab">
5
+        <el-tabs v-model="activeName" @tab-click="handleClick">
6
+          <el-tab-pane label="最新安全巡查记录" name="NewSafe" />
7
+          <el-tab-pane label="全部安全巡查记录" name="AllSafe" />
8
+
9
+        </el-tabs>
10
+      </div>
11
+      <div id="main">
12
+
13
+        <router-view id="mainRight" />
14
+      </div>
15
+    </div>
16
+  </div>
17
+</template>
18
+<script>
19
+export default {
20
+  name: 'SafeTabs',
21
+  data() {
22
+    return {
23
+      activeName: 'NewSafe'
24
+    }
25
+  },
26
+  mounted() {
27
+    this.activeName = this.$route.name
28
+  },
29
+  methods: {
30
+    handleClick(tab, event) {
31
+      console.log(tab, event)
32
+      this.$router.push(tab.name)
33
+    }
34
+  }
35
+}
36
+</script>

+ 0 - 5
shanXiPlatform/src/views/safeProduction/safetyManagement.vue

@@ -1,5 +0,0 @@
1
-<template>
2
-    <div>
3
-        安全员管理
4
-    </div>
5
-</template>

+ 0 - 5
shanXiPlatform/src/views/safeProduction/safetyResponsibility.vue

@@ -1,5 +0,0 @@
1
-<template>
2
-    <div>
3
-       全员安全责任制
4
-    </div>
5
-</template>

+ 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
+// 引入接口
189
+import {
190
+  getPersonnelInfo,
191
+  checkPersonnelInfo,
192
+  updatePersonnelInfo,
193
+  deletePersonnelInfo,
194
+  addPersonnelInfo
195
+} from '@/api/system/organizationalStructure/personnel'
118 196
 export default {
119
-  name: "AddPersonnel",
197
+  name: 'AddPersonnel',
198
+
120 199
   data() {
200
+    // 手机号校验
201
+    const checkPhone = (rule, value, callback) => {
202
+      const reg = /^1[3|4|5|7|8][0-9]\d{8}$/
203
+      if (reg.test(value)) {
204
+        callback()
205
+      } else {
206
+        return callback(new Error('请输入正确的手机号'))
207
+      }
208
+    }
121 209
     return {
122
-              imageUrl: ''
210
+      // 按钮标识(1:查看;2:新增;3:修改)
211
+      type: '',
212
+      // 图片路径
213
+      imageUrl: '',
214
+      title: '',
215
+      id: '',
216
+      // 必填项规则
217
+      rules: {
218
+        // 姓名
219
+        uname: [{ required: true, message: '请输入姓名', trigger: 'blur' }],
220
+        // 联系方式
221
+        uphone: [{ required: true, validator: checkPhone, trigger: 'blur' }],
222
+        // 岗位(职务)
223
+        ppost: [
224
+          { required: true, message: '请输入职位名称', trigger: 'change' }
225
+        ],
226
+        // 所属科室
227
+        pdepartment: [
228
+          { required: true, message: '请选择所属科室', trigger: 'change' }
229
+        ]
230
+      },
231
+      // 初始化数据
232
+      personnel: {
233
+        // 人员姓名
234
+        uname: '',
235
+        // 性别
236
+        usex: '',
237
+        // 联系方式
238
+        uphone: '',
239
+        // 出生年月
240
+        ubirthday: '',
241
+        // 邮箱
242
+        umail: '',
243
+        // 工作年限
244
+        pworkYears: '',
245
+        // 岗位(职位)
246
+        ppost: '',
247
+        // 政治面貌
248
+        ppoliticalOutlook: '',
249
+        // 入党时间
250
+        ppartyTime: '',
251
+        // 所属科室
252
+        pdepartment: '',
253
+        // 第一学历(教育学历)
254
+        pfirstDegree: '',
255
+        // 毕业院校
256
+        puniversityGraduated: '',
257
+        // 专业
258
+        pmajor: '',
259
+        // 教育形式
260
+        pformEducationTwo: '',
261
+        // 学位
262
+        pAcademicDegree: '',
263
+        // 最高学历(教育学历)
264
+        pHighestEducation: '',
265
+        // 毕业院校
266
+        puniversityGraduatedTwo: '',
267
+        // 专业
268
+        pmajorTwo: '',
269
+        // 教育形式
270
+        pformEducationTwoTwo: '',
271
+        // 学位
272
+        pacademicDegreeTwo: ''
273
+      }
274
+    }
275
+  },
276
+  mounted() {
277
+    var routeParams = this.$route.query
278
+    console.log(routeParams, 'routeParams')
279
+    this.id = routeParams.pid
280
+    this.type = routeParams.type
281
+    console.log(this.id)
282
+
283
+    // 对表单进行重置
284
+    this.$nextTick(() => {
285
+      this.$refs['ruleForm'].resetFields()
286
+    })
123 287
 
288
+    if (routeParams.type == 1) {
289
+      this.title = '查看'
290
+      this.checkList()
291
+    } else if (routeParams.type == 2) {
292
+      this.title = '新增'
293
+    } else if (routeParams.type == 3) {
294
+      this.title = '修改'
295
+      this.checkList()
124 296
     }
125 297
   },
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;
298
+  methods: {
299
+    handleAvatarSuccess(res, file) {
300
+      this.imageUrl = URL.createObjectURL(file.raw)
301
+    },
302
+    beforeAvatarUpload(file) {
303
+      const isJPG = file.type === 'image/jpeg'
304
+      const isLt2M = file.size / 1024 / 1024 < 2
305
+
306
+      if (!isJPG) {
307
+        this.$message.error('上传头像图片只能是 JPG 格式!')
308
+      }
309
+      if (!isLt2M) {
310
+        this.$message.error('上传头像图片大小不能超过 2MB!')
311
+      }
312
+      return isJPG && isLt2M
313
+    },
314
+
315
+    // 查看列表
316
+    checkList() {
317
+      var id = this.id
318
+      checkPersonnelInfo(id)
319
+        .then((res) => {
320
+          console.log(id, 'data')
321
+          console.log(res.data, 'res.data')
322
+
323
+          if (res.code == 200) {
324
+            this.personnel = res.data
325
+          }
326
+        })
327
+        .catch((err) => {
328
+          console.log(err)
329
+        })
330
+    },
331
+
332
+    // 新增接口
333
+    addList() {
334
+      var data = this.personnel
335
+      addPersonnelInfo(data).then((res) => {
336
+        //  var data = this.personnel
337
+        this.$message.success('新增成功')
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>

+ 892 - 4
shanXiPlatform/src/views/systemManagement/userManagement/approverManagement/index.vue

@@ -1,10 +1,898 @@
1 1
 <template>
2
-    <div>
3
-        审批人管理
2
+  <div class="container">
3
+    <div class="select">
4
+      <el-form>
5
+        <el-form-item label="选择具体的审批流程">
6
+          <el-select v-model="value" @change="headChange()">
7
+            <el-option
8
+              v-for="item in process"
9
+              :key="item.value"
10
+              :label="item.label"
11
+              :value="item.value"
12
+            />
13
+          </el-select>
14
+        </el-form-item>
15
+      </el-form>
4 16
     </div>
17
+    <div class="table">
18
+      <el-table :data="tableData" style="width: 70%" border>
19
+        <el-table-column label="工作项" prop="work" align="center" />
20
+        <el-table-column label="处理角色" align="center">
21
+          <template slot-scope="scope">
22
+            <!-- <div>{{scope.row}}</div> -->
23
+            <div v-if="scope.row.type == 'container'">{{ scope.row.processRoles }}</div>
24
+            <el-select v-if="scope.row.type == 'select'" v-model="value1" placeholder="选择审批人">
25
+              <el-option
26
+                v-for="item in scope.row.processRoles"
27
+                :key="item.value1"
28
+                :label="item.label"
29
+                :value="item.value"
30
+              />
31
+            </el-select>
32
+          </template>
33
+        </el-table-column>
34
+      </el-table>
35
+    </div>
36
+    <div class="btns">
37
+      <el-button type="success" plain @click="cancel()">取消</el-button>
38
+      <el-button
39
+
40
+        type="success"
41
+        @click="btnSave('ruleForm')"
42
+      >保存</el-button>
43
+    </div>
44
+  </div>
5 45
 </template>
6 46
 <script>
7 47
 export default {
8
-    name:"ApproverManagement"
48
+  name: 'ApproverManagement',
49
+  data() {
50
+    return {
51
+      // 表格数据初始化
52
+      tableData: this.meVentilation,
53
+      // 头部下拉选的值
54
+      value: 1,
55
+      // 表格下拉选的值
56
+      value1: '',
57
+      // 流程下拉选
58
+      process: [
59
+        {
60
+          label: '机械通风',
61
+          value: 1
62
+        },
63
+        {
64
+          label: '熏蒸',
65
+          value: 2
66
+        },
67
+        {
68
+          label: '药剂采购',
69
+          value: 3
70
+        },
71
+        {
72
+          label: '药剂领用',
73
+          value: 4
74
+        },
75
+        {
76
+          label: '设备采购',
77
+          value: 5
78
+        },
79
+        {
80
+          label: '设备领用归还',
81
+          value: 6
82
+        },
83
+        {
84
+          label: '设备维修',
85
+          value: 7
86
+        },
87
+        {
88
+          label: '设备报废',
89
+          value: 8
90
+        },
91
+        {
92
+          label: '设施维修改造',
93
+          value: 9
94
+        }
95
+      ],
96
+
97
+      // 机械通风数据
98
+      meVentilation: [
99
+        {
100
+          index: 1,
101
+          type: 'container',
102
+          work: '制定通风方案',
103
+          processRoles: '保管员'
104
+        },
105
+        {
106
+          index: 2,
107
+          type: 'select',
108
+          work: '主管科长审批',
109
+          processRoles: [
110
+            {
111
+              label: '处理角色1',
112
+              value1: '1'
113
+            },
114
+            {
115
+              label: '处理角色2',
116
+              value1: '2'
117
+            },
118
+            {
119
+              label: '处理角色3',
120
+              value1: '3'
121
+            }
122
+          ]
123
+        },
124
+        {
125
+          index: 3,
126
+          type: 'select',
127
+          work: '分管副总经理审批',
128
+          processRoles: [
129
+            {
130
+              label: '处理角色1',
131
+              value1: '1'
132
+            },
133
+            {
134
+              label: '处理角色2',
135
+              value1: '2'
136
+            },
137
+            {
138
+              label: '处理角色3',
139
+              value1: '3'
140
+            }
141
+          ]
142
+        },
143
+        {
144
+          index: 4,
145
+          type: 'container',
146
+          work: '通风方案实施',
147
+          processRoles: '保管员'
148
+        }
149
+      ],
150
+      // 熏蒸数据
151
+
152
+      fumigation: [
153
+        {
154
+          index: 1,
155
+          type: 'container',
156
+          work: '制定熏蒸计划',
157
+          processRoles: '保管员'
158
+        },
159
+        {
160
+          index: 2,
161
+          type: 'select',
162
+          work: '熏蒸计划主管科长审批',
163
+          processRoles: [
164
+            {
165
+              label: '处理角色1',
166
+              value1: '1'
167
+            },
168
+            {
169
+              label: '处理角色2',
170
+              value1: '2'
171
+            },
172
+            {
173
+              label: '处理角色3',
174
+              value1: '3'
175
+            }
176
+          ]
177
+        },
178
+        {
179
+          index: 3,
180
+          type: 'select',
181
+          work: '熏蒸计划分管副总经理审批',
182
+          processRoles: [
183
+            {
184
+              label: '处理角色1',
185
+              value1: '1'
186
+            },
187
+            {
188
+              label: '处理角色2',
189
+              value1: '2'
190
+            },
191
+            {
192
+              label: '处理角色3',
193
+              value1: '3'
194
+            }
195
+          ]
196
+        },
197
+        {
198
+          index: 4,
199
+          type: 'container',
200
+          work: '熏蒸计划总经理审批',
201
+          processRoles: '总经理(刘亮)'
202
+        },
203
+        {
204
+          index: 5,
205
+          type: 'select',
206
+          work: '熏蒸计划分公司主管处室审批',
207
+          processRoles: [
208
+            {
209
+              label: '处理角色1',
210
+              value1: '1'
211
+            },
212
+            {
213
+              label: '处理角色2',
214
+              value1: '2'
215
+            },
216
+            {
217
+              label: '处理角色3',
218
+              value1: '3'
219
+            }
220
+          ]
221
+        },
222
+
223
+        {
224
+          index: 6,
225
+          type: 'container',
226
+          work: '熏蒸计划报备与实施',
227
+          processRoles: '保管员'
228
+        },
229
+
230
+        {
231
+          index: 7,
232
+          type: 'container',
233
+          work: '提交散气作业申请',
234
+          processRoles: '保管员'
235
+        },
236
+        {
237
+          index: 8,
238
+          type: 'select',
239
+          work: '散气作业主管科长审批',
240
+          processRoles: [
241
+            {
242
+              label: '处理角色1',
243
+              value1: '1'
244
+            },
245
+            {
246
+              label: '处理角色2',
247
+              value1: '2'
248
+            },
249
+            {
250
+              label: '处理角色3',
251
+              value1: '3'
252
+            }
253
+          ]
254
+        },
255
+        {
256
+          index: 9,
257
+          type: 'select',
258
+          work: '散气作业分管副总经理',
259
+          processRoles: [
260
+            {
261
+              label: '处理角色1',
262
+              value1: '1'
263
+            },
264
+            {
265
+              label: '处理角色2',
266
+              value1: '2'
267
+            },
268
+            {
269
+              label: '处理角色3',
270
+              value1: '3'
271
+            }
272
+          ]
273
+        }
274
+      ],
275
+
276
+      //  药剂采购
277
+      drugPurchase: [
278
+        {
279
+          index: 1,
280
+          type: 'container',
281
+          work: '采购申请提交',
282
+          processRoles: '药剂保管员'
283
+        },
284
+        {
285
+          index: 2,
286
+          type: 'select',
287
+          work: '主管科长审批',
288
+          processRoles: [
289
+            {
290
+              label: '处理角色1',
291
+              value1: '1'
292
+            },
293
+            {
294
+              label: '处理角色2',
295
+              value1: '2'
296
+            },
297
+            {
298
+              label: '处理角色3',
299
+              value1: '3'
300
+            }
301
+          ]
302
+        },
303
+        {
304
+          index: 3,
305
+          type: 'select',
306
+          work: '分管副总经理审批',
307
+          processRoles: [
308
+            {
309
+              label: '处理角色1',
310
+              value1: '1'
311
+            },
312
+            {
313
+              label: '处理角色2',
314
+              value1: '2'
315
+            },
316
+            {
317
+              label: '处理角色3',
318
+              value1: '3'
319
+            }
320
+          ]
321
+        },
322
+        {
323
+          index: 4,
324
+          type: 'container',
325
+          work: '总经理审批',
326
+          processRoles: '总经理(刘亮)'
327
+        },
328
+        {
329
+          index: 5,
330
+          type: 'select',
331
+          work: ' 分公司主管处室审批',
332
+          processRoles: [
333
+            {
334
+              label: '处理角色1',
335
+              value1: '1'
336
+            },
337
+            {
338
+              label: '处理角色2',
339
+              value1: '2'
340
+            },
341
+            {
342
+              label: '处理角色3',
343
+              value1: '3'
344
+            }
345
+          ]
346
+        }
347
+
348
+      ],
349
+
350
+      // 药剂领用
351
+
352
+      drugCollect: [
353
+        {
354
+          index: 1,
355
+          type: 'container',
356
+          work: '填写药品领用单',
357
+          processRoles: '保管员'
358
+        },
359
+        {
360
+          index: 2,
361
+          type: 'select',
362
+          work: '主管科长审批',
363
+          processRoles: [
364
+            {
365
+              label: '处理角色1',
366
+              value1: '1'
367
+            },
368
+            {
369
+              label: '处理角色2',
370
+              value1: '2'
371
+            },
372
+            {
373
+              label: '处理角色3',
374
+              value1: '3'
375
+            }
376
+          ]
377
+        },
378
+        {
379
+          index: 3,
380
+          type: 'select',
381
+          work: '分管副总经理审批',
382
+          processRoles: [
383
+            {
384
+              label: '处理角色1',
385
+              value1: '1'
386
+            },
387
+            {
388
+              label: '处理角色2',
389
+              value1: '2'
390
+            },
391
+            {
392
+              label: '处理角色3',
393
+              value1: '3'
394
+            }
395
+          ]
396
+        },
397
+        {
398
+          index: 4,
399
+          type: 'container',
400
+          work: '药剂领用',
401
+          processRoles: '保管员'
402
+        }
403
+
404
+      ],
405
+
406
+      // 设备采购
407
+      devicePurchase: [
408
+        {
409
+          index: 1,
410
+          type: 'container',
411
+          work: '制定采购计划',
412
+          processRoles: '设备设施保管员'
413
+        },
414
+        {
415
+          index: 2,
416
+          type: 'select',
417
+          work: '主管科长审批',
418
+          processRoles: [
419
+            {
420
+              label: '处理角色1',
421
+              value1: '1'
422
+            },
423
+            {
424
+              label: '处理角色2',
425
+              value1: '2'
426
+            },
427
+            {
428
+              label: '处理角色3',
429
+              value1: '3'
430
+            }
431
+          ]
432
+        },
433
+        {
434
+          index: 3,
435
+          type: 'select',
436
+          work: '分管副总经理审批',
437
+          processRoles: [
438
+            {
439
+              label: '处理角色1',
440
+              value1: '1'
441
+            },
442
+            {
443
+              label: '处理角色2',
444
+              value1: '2'
445
+            },
446
+            {
447
+              label: '处理角色3',
448
+              value1: '3'
449
+            }
450
+          ]
451
+        },
452
+        {
453
+          index: 4,
454
+          type: 'container',
455
+          work: '总经理审批',
456
+          processRoles: '总经理(张立)'
457
+        },
458
+
459
+        {
460
+          index: 5,
461
+          type: 'select',
462
+          work: '分公司审批',
463
+          processRoles: [
464
+            {
465
+              label: '处理角色1',
466
+              value1: '1'
467
+            },
468
+            {
469
+              label: '处理角色2',
470
+              value1: '2'
471
+            },
472
+            {
473
+              label: '处理角色3',
474
+              value1: '3'
475
+            }
476
+          ]
477
+        },
478
+
479
+        {
480
+          index: 6,
481
+          type: 'container',
482
+          work: '采购计划执行',
483
+          processRoles: '设备设施保管员'
484
+        }
485
+
486
+      ],
487
+
488
+      // 设备领用归还
489
+      deviceCollectReturn: [
490
+
491
+        {
492
+          index: 1,
493
+          type: 'select',
494
+          work: '主管科长审批',
495
+          processRoles: [
496
+            {
497
+              label: '处理角色1',
498
+              value1: '1'
499
+            },
500
+            {
501
+              label: '处理角色2',
502
+              value1: '2'
503
+            },
504
+            {
505
+              label: '处理角色3',
506
+              value1: '3'
507
+            }
508
+          ]
509
+        },
510
+        {
511
+          index: 2,
512
+          type: 'select',
513
+          work: '分管副总经理审批',
514
+          processRoles: [
515
+            {
516
+              label: '处理角色1',
517
+              value1: '1'
518
+            },
519
+            {
520
+              label: '处理角色2',
521
+              value1: '2'
522
+            },
523
+            {
524
+              label: '处理角色3',
525
+              value1: '3'
526
+            }
527
+          ]
528
+        }
529
+
530
+      ],
531
+
532
+      // 设备维修
533
+      deviceRepair: [
534
+        {
535
+          index: 1,
536
+          type: 'container',
537
+          work: '制定维修计划',
538
+          processRoles: '设备设施保管员'
539
+        },
540
+        {
541
+          index: 2,
542
+          type: 'select',
543
+          work: '主管科长审核',
544
+          processRoles: [
545
+            {
546
+              label: '处理角色1',
547
+              value1: '1'
548
+            },
549
+            {
550
+              label: '处理角色2',
551
+              value1: '2'
552
+            },
553
+            {
554
+              label: '处理角色3',
555
+              value1: '3'
556
+            }
557
+          ]
558
+        },
559
+        {
560
+          index: 3,
561
+          type: 'select',
562
+          work: '分管副总经理审核',
563
+          processRoles: [
564
+            {
565
+              label: '处理角色1',
566
+              value1: '1'
567
+            },
568
+            {
569
+              label: '处理角色2',
570
+              value1: '2'
571
+            },
572
+            {
573
+              label: '处理角色3',
574
+              value1: '3'
575
+            }
576
+          ]
577
+        },
578
+        {
579
+          index: 4,
580
+          type: 'container',
581
+          work: '总经理审批',
582
+          processRoles: '总经理(张立)'
583
+        },
584
+
585
+        {
586
+          index: 5,
587
+          type: 'select',
588
+          work: '分公司审批',
589
+          processRoles: [
590
+            {
591
+              label: '处理角色1',
592
+              value1: '1'
593
+            },
594
+            {
595
+              label: '处理角色2',
596
+              value1: '2'
597
+            },
598
+            {
599
+              label: '处理角色3',
600
+              value1: '3'
601
+            }
602
+          ]
603
+        },
604
+
605
+        {
606
+          index: 6,
607
+          type: 'container',
608
+          work: '维修计划执行',
609
+          processRoles: '设备设施保管员'
610
+        }
611
+
612
+      ],
613
+
614
+      // 设备报废
615
+      deviceScrap: [
616
+        {
617
+          index: 1,
618
+          type: 'container',
619
+          work: '制定报废计划',
620
+          processRoles: '设备设施保管员'
621
+        },
622
+        {
623
+          index: 2,
624
+          type: 'select',
625
+          work: '主管科长审核',
626
+          processRoles: [
627
+            {
628
+              label: '处理角色1',
629
+              value1: '1'
630
+            },
631
+            {
632
+              label: '处理角色2',
633
+              value1: '2'
634
+            },
635
+            {
636
+              label: '处理角色3',
637
+              value1: '3'
638
+            }
639
+          ]
640
+        },
641
+        {
642
+          index: 3,
643
+          type: 'select',
644
+          work: '分管副总经理审核',
645
+          processRoles: [
646
+            {
647
+              label: '处理角色1',
648
+              value1: '1'
649
+            },
650
+            {
651
+              label: '处理角色2',
652
+              value1: '2'
653
+            },
654
+            {
655
+              label: '处理角色3',
656
+              value1: '3'
657
+            }
658
+          ]
659
+        },
660
+        {
661
+          index: 4,
662
+          type: 'container',
663
+          work: '总经理审批',
664
+          processRoles: '总经理(张立)'
665
+        },
666
+
667
+        {
668
+          index: 5,
669
+          type: 'select',
670
+          work: '分公司审批',
671
+          processRoles: [
672
+            {
673
+              label: '处理角色1',
674
+              value1: '1'
675
+            },
676
+            {
677
+              label: '处理角色2',
678
+              value1: '2'
679
+            },
680
+            {
681
+              label: '处理角色3',
682
+              value1: '3'
683
+            }
684
+          ]
685
+        },
686
+
687
+        {
688
+          index: 6,
689
+          type: 'container',
690
+          work: '报废计划执行',
691
+          processRoles: '设备设施保管员'
692
+        }
693
+
694
+      ],
695
+
696
+      // 设备维修改造
697
+      deviceRepairReform: [
698
+        {
699
+          index: 1,
700
+          type: 'container',
701
+          work: '制定维修计划',
702
+          processRoles: '设备设施保管员'
703
+        },
704
+        {
705
+          index: 2,
706
+          type: 'select',
707
+          work: '维修计划主管科长审核',
708
+          processRoles: [
709
+            {
710
+              label: '处理角色1',
711
+              value1: '1'
712
+            },
713
+            {
714
+              label: '处理角色2',
715
+              value1: '2'
716
+            },
717
+            {
718
+              label: '处理角色3',
719
+              value1: '3'
720
+            }
721
+          ]
722
+        },
723
+        {
724
+          index: 3,
725
+          type: 'select',
726
+          work: ' 维修计划分管副总经理审核',
727
+          processRoles: [
728
+            {
729
+              label: '处理角色1',
730
+              value1: '1'
731
+            },
732
+            {
733
+              label: '处理角色2',
734
+              value1: '2'
735
+            },
736
+            {
737
+              label: '处理角色3',
738
+              value1: '3'
739
+            }
740
+          ]
741
+        },
742
+        {
743
+          index: 4,
744
+          type: 'container',
745
+          work: '维修计划总经理审批',
746
+          processRoles: '总经理(张立)'
747
+        },
748
+
749
+        {
750
+          index: 5,
751
+          type: 'select',
752
+          work: '维修计划分公司审批',
753
+          processRoles: [
754
+            {
755
+              label: '处理角色1',
756
+              value1: '1'
757
+            },
758
+            {
759
+              label: '处理角色2',
760
+              value1: '2'
761
+            },
762
+            {
763
+              label: '处理角色3',
764
+              value1: '3'
765
+            }
766
+          ]
767
+        },
768
+
769
+        {
770
+          index: 6,
771
+          type: 'container',
772
+          work: '制定维修预算',
773
+          processRoles: '设备设施保管员'
774
+        },
775
+
776
+        {
777
+          index: 7,
778
+          type: 'select',
779
+          work: '维修预算主管科长审核',
780
+          processRoles: [
781
+            {
782
+              label: '处理角色1',
783
+              value1: '1'
784
+            },
785
+            {
786
+              label: '处理角色2',
787
+              value1: '2'
788
+            },
789
+            {
790
+              label: '处理角色3',
791
+              value1: '3'
792
+            }
793
+          ]
794
+        },
795
+
796
+        {
797
+          index: 8,
798
+          type: 'select',
799
+          work: '维修预算分管副总经理审核',
800
+          processRoles: [
801
+            {
802
+              label: '处理角色1',
803
+              value1: '1'
804
+            },
805
+            {
806
+              label: '处理角色2',
807
+              value1: '2'
808
+            },
809
+            {
810
+              label: '处理角色3',
811
+              value1: '3'
812
+            }
813
+          ]
814
+        },
815
+
816
+        {
817
+          index: 9,
818
+          type: 'container',
819
+          work: '维修预算总经理审批',
820
+          processRoles: '总经理(张立)'
821
+        },
822
+
823
+        {
824
+          index: 10,
825
+          type: 'select',
826
+          work: '维修预算分公司审批',
827
+          processRoles: [
828
+            {
829
+              label: '处理角色1',
830
+              value1: '1'
831
+            },
832
+            {
833
+              label: '处理角色2',
834
+              value1: '2'
835
+            },
836
+            {
837
+              label: '处理角色3',
838
+              value1: '3'
839
+            }
840
+          ]
841
+        },
842
+
843
+        {
844
+          index: 11,
845
+          type: 'container',
846
+          work: '维修计划实施',
847
+          processRoles: '设备设施保管员'
848
+        }
849
+      ]
850
+    }
851
+  },
852
+
853
+  mounted() {
854
+    this.tableData = this.meVentilation
855
+  },
856
+  methods: {
857
+    // 头部下拉选的值发生改变时
858
+    headChange() {
859
+      if (this.value == 1) {
860
+        this.tableData = this.meVentilation
861
+      } else if (this.value == 2) {
862
+        this.tableData = this.fumigation
863
+      } else if (this.value == 3) {
864
+        this.tableData = this.drugPurchase
865
+      } else if (this.value == 4) {
866
+        this.tableData = this.drugCollect
867
+      } else if (this.value == 5) {
868
+        this.tableData = this.devicePurchase
869
+      } else if (this.value == 6) {
870
+        this.tableData = this.deviceCollectReturn
871
+      } else if (this.value == 7) {
872
+        this.tableData = this.deviceRepair
873
+      } else if (this.value == 8) {
874
+        // 设备报废
875
+        this.tableData = this.deviceScrap
876
+      } else if (this.value == 9) {
877
+        // 设备维修改造
878
+        this.tableData = this.deviceRepairReform
879
+      }
880
+    }
881
+  }
882
+}
883
+</script>
884
+<style lang="scss" scoped>
885
+.container {
886
+  width: 100%;
887
+}
888
+
889
+.table{
890
+    width:100%;
891
+    text-align:center;
892
+     margin: 20px 0 50px;
893
+}
894
+.btn{
895
+    text-align: right;
9 896
 }
10
-</script>
897
+
898
+</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>

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

@@ -0,0 +1,291 @@
1
+<template>
2
+  <div class="global">
3
+    <div class="mainContainer">
4
+      <div class="title">{{ title }}角色</div>
5
+      <el-form
6
+        ref="ruleForm"
7
+        :model="roleGroup"
8
+        :rules="rules"
9
+        label-width="100px"
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
+            :default-checked-keys="checkedKeysResourceCodes"
29
+          />
30
+        </div>
31
+      </div>
32
+      <div>
33
+        <el-button type="success" plain @click="cancel()">取消</el-button>
34
+        <el-button type="success" @click="btnSave('ruleForm')">保存</el-button>
35
+      </div>
36
+    </div>
37
+  </div>
38
+</template>
39
+<script>
40
+// 中转站
41
+import bus from '@/utils/bus'
42
+// 引入接口
43
+import {
44
+  resourcesTree,
45
+  getUserInfo,
46
+  addUserInfo,
47
+  updateUserInfo,
48
+  roleIsExit,
49
+  checkUserInfo,
50
+  editResourcesTree
51
+} from '@/api/system/userManagement/role'
52
+export default {
53
+  name: 'AddRole',
54
+  data() {
55
+    var checkRname = (rule, value, callback) => {
56
+      if (!value) {
57
+        callback(new Error('请输入角色组'))
58
+      } else {
59
+        this.rGroupExit((isExit) => {
60
+          if (isExit) {
61
+            callback(new Error('该角色组已存在'))
62
+          } else {
63
+            callback()
64
+          }
65
+        })
66
+      }
67
+    }
68
+    return {
69
+      checkedKeysResourceCodes: [],
70
+      // 标题
71
+      title: '',
72
+      // 参数id
73
+      id: '',
74
+      // 按钮类型
75
+      type: '',
76
+      // 校验规则
77
+      rules: {
78
+        rname: [{ required: true, trigger: 'blur', validator: 'checkRname' }]
79
+      },
80
+
81
+      // 初始化数据
82
+      roleGroup: {
83
+        rname: '',
84
+        rremark: ''
85
+      },
86
+      defaultProps: {
87
+        children: 'children',
88
+        label: 'resourceName'
89
+        // id:'resourceCode'
90
+      },
91
+      data: []
92
+    }
93
+  },
94
+
95
+  mounted() {
96
+    var routeParams = this.$route.query
97
+    console.log(routeParams, 'routeParams')
98
+    this.id = routeParams.id
99
+
100
+    this.type = routeParams.type
101
+    console.log(this.id)
102
+    // 对表单进行重置
103
+    this.$nextTick(() => {
104
+      this.$refs['ruleForm'].resetFields()
105
+    })
106
+    if (this.type == 2) {
107
+      this.title = '新增'
108
+    } else if (this.type == 3) {
109
+      this.title = '修改'
110
+
111
+      this.checkList()
112
+      this.editTreeInfo()
113
+      console.log('//////')
114
+    }
115
+
116
+    this.getTreeInfo()
117
+  },
118
+  methods: {
119
+    // 判断角色组是否存在
120
+    rGroupExit(callback) {
121
+      var params = {
122
+        rNams: this.roleGroup.rname
123
+      }
124
+      roleIsExit(params).then((res) => {
125
+        if (res.code == 200) {
126
+          if (res.data > 0) {
127
+            callback(true)
128
+            this.roleGroup.rname = ''
129
+          } else {
130
+            callback(false)
131
+          }
132
+        } else {
133
+          callback(false)
134
+        }
135
+      })
136
+    },
137
+    // 获取资源树接口
138
+    getTreeInfo() {
139
+      resourcesTree()
140
+        .then((res) => {
141
+          if (res.code == 200) {
142
+            this.data = res.data
143
+          }
144
+        })
145
+        .catch((err) => {
146
+          console.log(err)
147
+        })
148
+    },
149
+
150
+    // 修改资源数
151
+    editTreeInfo() {
152
+      var params = {
153
+        id: this.id
154
+      }
155
+
156
+      editResourcesTree(params).then((res) => {
157
+        if (res.code == 200) {
158
+          if (res.data != null) {
159
+            for (let index = 0; index < res.data.length; index++) {
160
+              const ele = res.data[index]
161
+              console.log(ele, 'ele.....')
162
+              this.checkedKeysResourceCodes.push(ele)
163
+            }
164
+            //  this.roleGroup.resourceCodes=this.checkedKeysResourceCodes;
165
+            console.log(this.checkedKeysResourceCodes, 'this.checkedKeysResourceCodes')
166
+            this.getTreeInfo()
167
+          }
168
+        }
169
+      })
170
+    },
171
+
172
+    // 新增接口
173
+    addList() {
174
+      var data = this.roleGroup
175
+      addUserInfo(data).then((res) => {
176
+        console.log(data, '新增data')
177
+        if (res.code == 200) {
178
+          this.$message.success('新增成功')
179
+          this.$router.push({
180
+            path: '/systemManagement/user/roleManagement'
181
+          })
182
+          bus.$emit('getList')
183
+        }
184
+      })
185
+    },
186
+
187
+    // 修改接口
188
+    updateList() {
189
+      var data = this.roleGroup
190
+      updateUserInfo(data)
191
+        .then((res) => {
192
+          if (res.code == 200) {
193
+            this.$message.success('修改成功')
194
+            this.$router.push({
195
+              path: '/systemManagement/user/roleManagement'
196
+            })
197
+            bus.$emit('getList')
198
+          }
199
+        })
200
+        .catch((err) => {
201
+          console.log(err)
202
+        })
203
+    },
204
+
205
+    // 查看接口
206
+    checkList() {
207
+      var id = this.id
208
+      checkUserInfo(id)
209
+        .then((res) => {
210
+          if (res.code == 200) {
211
+            this.roleGroup = res.data
212
+          }
213
+        })
214
+        .catch((err) => {
215
+          console.log(err)
216
+        })
217
+    },
218
+
219
+    // // 取消按钮
220
+    cancel() {
221
+      this.$router.push({
222
+        path: '/systemManagement/user/roleManagement'
223
+      })
224
+    },
225
+
226
+    // 点保存按钮
227
+    btnSave(formName) {
228
+      this.$refs[formName].validate((valid) => {
229
+        if (valid) {
230
+          // this.addList();
231
+          console.log(this.type, 'this.type..')
232
+
233
+          console.log(this.$refs.resourseTree.getCheckedNodes(), '资源树')
234
+          var checkedNodes = this.$refs.resourseTree.getCheckedNodes()
235
+          var resourceCodes = []
236
+          for (let index = 0; index < checkedNodes.length; index++) {
237
+            const ele = checkedNodes[index]
238
+            resourceCodes.push(ele.resourceCode)
239
+          }
240
+          console.log(resourceCodes, '......')
241
+          resourceCodes = resourceCodes.join(',')
242
+          console.log(resourceCodes, '数组')
243
+          this.roleGroup.resourceCodes = resourceCodes
244
+          console.log(
245
+            this.roleGroup.resourceCodes,
246
+            'this. roleGroup.resourceCodes'
247
+          )
248
+
249
+          if (this.type == 2) {
250
+            this.addList()
251
+          } else if (this.type == 3) {
252
+            this.updateList()
253
+          }
254
+        } else {
255
+          console.log('error submit!!')
256
+          return false
257
+        }
258
+      })
259
+    }
260
+  }
261
+}
262
+</script>
263
+<style lang="scss" scoped>
264
+.title {
265
+  margin-bottom: 20px;
266
+}
267
+.tree {
268
+  display: flex;
269
+  .treeLabel {
270
+    width: 120px;
271
+    text-align: right;
272
+  }
273
+  .treeShow {
274
+    width: 600px;
275
+
276
+    height: 400px;
277
+    // max-height: 100px;
278
+    // overflow-y:scroll ;
279
+    margin-left: 20px;
280
+    // background:rgb(244, 240, 240);
281
+  }
282
+}
283
+</style>
284
+<style>
285
+.el-input {
286
+  width: 20%;
287
+}
288
+.el-tree {
289
+  background: rgb(245, 243, 243);
290
+}
291
+</style>

+ 174 - 104
shanXiPlatform/src/views/systemManagement/userManagement/roleManagement/index.vue

@@ -1,89 +1,80 @@
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"
2
+  <div class="container">
3
+    <div class="top">
4
+      <el-button type="success" @click="addRole(2)">新增角色</el-button>
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
16
+         width="50px"
17 17
             align="center"
18
+            prop="dId"
18 19
             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
-        />
58
-    </div>
20
+            type="index"
21
+            :index="indexMethod"
22
+            show-overflow-tooltip
23
+          ></el-table-column> -->
24
+      <el-table-column prop="rname" label="角色名称" align="center" />
25
+      <el-table-column prop="rCreateTime" label="创建时间" align="center" />
26
+      <el-table-column prop="rremark" label="备注" align="center" />
27
+
28
+      <el-table-column
29
+        prop="operation"
30
+        label="操作"
31
+        align="center"
32
+        width="200px"
33
+        fixed="right"
34
+        auto-expand-parent="false"
35
+      >
36
+        <template slot-scope="scope">
37
+          <el-button
38
+            size="mini"
39
+            @click="handleEdit(3, scope.$index, scope.row)"
40
+          >修改</el-button>
41
+          <el-button
42
+            size="mini"
43
+            @click="handleDelete(scope.$index, scope.row)"
44
+          >删除</el-button>
45
+        </template>
46
+      </el-table-column>
47
+    </el-table>
48
+    <pagination
49
+      v-show="total > 0"
50
+      :total="total"
51
+      :page.sync="listQuery.page"
52
+      :limit.sync="listQuery.limit"
53
+      @pagination="getPageList"
54
+    />
55
+  </div>
59 56
 </template>
60 57
 <script>
61
-import Pagination from "@/components/Pagination"
58
+// 中转站
59
+import bus from '@/utils/bus'
60
+import Pagination from '@/components/Pagination'
61
+// 引入接口
62
+import {
63
+  getUserInfo,
64
+  addUserInfo,
65
+  updateUserInfo,
66
+  userIsExit,
67
+  deleteUserInfo
68
+} from '@/api/system/userManagement/role'
62 69
 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
-          ],
70
+  name: 'DepartManagement',
71
+  components: { Pagination },
72
+  data() {
73
+    return {
74
+      // 列表数据
75
+      departmentData: [],
85 76
 
86
-            //分页
77
+      // 分页
87 78
       total: 30,
88 79
       listLoading: true,
89 80
       listQuery: {
@@ -92,36 +83,115 @@ export default {
92 83
         importance: undefined,
93 84
         title: undefined,
94 85
         type: undefined,
95
-        sort: "+id",
96
-      },
86
+        sort: '+id'
87
+      }
88
+    }
89
+  },
90
+
91
+  mounted() {
92
+    this.getList()
93
+    bus.$on('getList', function() {
94
+      this.getList()
95
+    })
96
+  },
97
+
98
+  methods: {
99
+    getPageList() {
100
+
101
+    },
102
+
103
+    // 获取用户列表
104
+
105
+    getList() {
106
+      var data = {
107
+        pageIndex: this.listQuery.page,
108
+        pageSize: this.listQuery.limit
97 109
       }
110
+      getUserInfo(data)
111
+        .then((res) => {
112
+          console.log(data, 'data')
113
+          console.log(res.data, ',,,,,,')
114
+
115
+          if (res.code == 200) {
116
+            console.log(res.data.records, 'res.data.records')
117
+            this.departmentData = res.data.records
118
+
119
+            this.listQuery.limit = res.data.size
120
+            this.total = res.data.total
121
+          }
122
+        })
123
+        .catch((err) => {
124
+          console.log(err)
125
+        })
126
+    },
127
+
128
+    // 删除用户
129
+
130
+    deleteList() {
131
+      console.log('shancuu')
132
+      this.$confirm('确定删除该项记录?', '提示', {
133
+        confirmButtonText: '确定',
134
+        cancelButtonText: '取消',
135
+        type: 'warning'
136
+      })
137
+        .then(() => {
138
+          console.log(11111)
139
+          var params = {
140
+            id: this.id
141
+          }
142
+          console.log(params, '删除id')
143
+          deleteUserInfo(params)
144
+            .then((res) => {
145
+              if (res.code == 200) {
146
+                this.getList()
147
+                this.$message({
148
+                  type: 'success',
149
+                  message: '删除成功!'
150
+                })
151
+              }
152
+            })
153
+            .catch(() => {
154
+              this.$message({
155
+                type: 'info',
156
+                message: '已取消删除'
157
+              })
158
+            })
159
+        })
98 160
     },
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 161
 
162
+    // 新增角色
163
+    addRole(type) {
164
+      this.$router.push({ path: '/roleManagement/addRole', query: { type: type }})
165
+    },
166
+    // 编辑
167
+    handleEdit(type, index, row) {
168
+      console.log(row)
169
+      this.$router.push({ path: '/roleManagement/addRole', query: { type: type, id: row.rid }})
170
+    },
171
+    // 删除
172
+    handleDelete(index, row) {
173
+      this.id = row.rid
174
+      this.deleteList()
112 175
     }
176
+
177
+    /* ----- 格式化表格序号 -----*/
178
+    // indexMethod(index) {
179
+    //   console.log(index,"index..")
180
+    //   return (
181
+    //     (this.listQuery.page - 1) * this.listQuery.limit + index + 1
182
+    //   );
183
+    // },
184
+  }
113 185
 }
114 186
 </script>
115 187
 <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
-    }
188
+.container {
189
+  width: 100%;
190
+  .top {
191
+    height: 50px;
192
+    line-height: 50px;
193
+    text-align: right;
194
+    margin-bottom: 20px;
195
+  }
125 196
 }
126
-  
127
-</style>
197
+</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

+ 40 - 1
shanXiPlatform/vue.config.js

@@ -35,13 +35,52 @@ 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
+      '/webs': {
53
+        target: 'http://139.159.183.224:19999',  //这里后台的地址模拟的;应该填写你们真实的后台接口
54
+        
55
+        changOrigin: true,  //允许跨域
56
+       
57
+        pathRewrite: {
58
+          /* 重写路径,当我们在浏览器中看到请求的地址为:http://localhost:8080/api/core/getData/userInfo 时
59
+            实际上访问的地址是:http://121.121.67.254:8185/core/getData/userInfo,因为重写了 /api
60
+           */
61
+          '^/webs': '' 
62
+        }
63
+      },
64
+
65
+
66
+
67
+
68
+    },
69
+
70
+
71
+
72
+
73
+   
74
+
75
+
76
+   
38 77
     port: port,
39 78
     open: true,
40 79
     overlay: {
41 80
       warnings: false,
42 81
       errors: true
43 82
     },
44
-    before: require('./mock/mock-server.js')
83
+    //before: require('./mock/mock-server.js')  //注释,不然会先走mock,然后再走本地服务不,被mock拦截了
45 84
   },
46 85
   configureWebpack: {
47 86
     // provide the app's title in webpack's name field, so that