Explorar el Código

后台获取orgId

chris hace 3 años
padre
commit
191eac5dd1
Se han modificado 3 ficheros con 11 adiciones y 1 borrados
  1. 5 1
      src/store/modules/user.js
  2. 5 0
      src/views/main.vue
  3. 1 0
      src/views/modules/warehouse/stock-order.vue

+ 5 - 1
src/store/modules/user.js

@@ -2,7 +2,8 @@ export default {
   namespaced: true,
   state: {
     id: 0,
-    name: ''
+    name: '',
+    orgId: ''
   },
   mutations: {
     updateId (state, id) {
@@ -10,6 +11,9 @@ export default {
     },
     updateName (state, name) {
       state.name = name
+    },
+    updateOrgId (state, orgId) {
+      state.orgId = orgId
     }
   }
 }

+ 5 - 0
src/views/main.vue

@@ -55,6 +55,10 @@
       userName: {
         get () { return this.$store.state.user.name },
         set (val) { this.$store.commit('user/updateName', val) }
+      },
+      orgId: {
+        get () { return this.$store.state.user.orgId },
+        set (val) { this.$store.commit('user/updateOrgId', val) }
       }
     },
     created () {
@@ -81,6 +85,7 @@
             this.loading = false
             this.userId = data.data.userId
             this.userName = data.data.username
+            this.orgId = data.data.orgId
           }
         })
       }

+ 1 - 0
src/views/modules/warehouse/stock-order.vue

@@ -66,6 +66,7 @@
     methods: {
       // 获取数据列表
       getDataList () {
+        console.log('orgId = ' + this.$store.state.user.orgId)
         console.log('参数0:' + this.dataForm.userId)
         console.log('参数1:' + this.dataForm.dateFrom[0])
         console.log('参数2:' + this.dataForm.dateFrom[1])