소스 검색

Merge branch 'feat' into develop

zh 2 년 전
부모
커밋
5a40f731e2
3개의 변경된 파일16개의 추가작업 그리고 10개의 파일을 삭제
  1. 2 1
      src/store/getters.js
  2. 7 3
      src/store/modules/user.js
  3. 7 6
      src/views/supply/pickup/components/pickup_form.vue

+ 2 - 1
src/store/getters.js

@@ -15,6 +15,7 @@ const getters = {
   customerNumber: state => state.user.customerNumber,
   showMessages: state => state.user.showMessages,
   code: state => state.sales.code,
-  isCustomer: state => state.user.customerId && state.user.customerName && state.user.customerNumber
+  isCustomer: state => state.user.customerId && state.user.customerName && state.user.customerNumber,
+  userInfo :state =>state.user.userInfo
 }
 export default getters

+ 7 - 3
src/store/modules/user.js

@@ -15,7 +15,8 @@ const getDefaultState = () => {
     showMessages: null, //
     isNotice: false,
     websitNumber: '',
-    isCollapse: true
+    isCollapse: true,
+    userInfo:JSON.parse(localStorage.getItem('supply_user')) || {}
   }
 }
 
@@ -58,7 +59,10 @@ const mutations = {
   SET_WEBSIT_NUMBER: (state, websitNumber) => {
     state.websitNumber = websitNumber
   },
-  showMessage: (state, value) => {
+  SET_USETINFO(state,data){
+    state.userInfo = data
+  }
+,  showMessage: (state, value) => {
     if (value == 'yes') {
       state.showMessages = true
     } else {
@@ -144,7 +148,7 @@ const actions = {
           commit('SET_CUSTOMERNUMBER', customerNumber)
           commit('SET_NAME', nickName)
           commit('SET_PHONE', userName)
-
+          commit('SET_USETINFO',data)
           // commit("SET_MENUS", menus) // 触发vuex SET_MENUS 保存路由表到vuex
 
           localStorage.setItem('supply_user', JSON.stringify(data))

+ 7 - 6
src/views/supply/pickup/components/pickup_form.vue

@@ -418,7 +418,8 @@ import {
   getListOrderTrack
 } from '@/api/supply/pickup'
 import { getDictList } from '@/api/common'
-
+import { mapGetters } from 'vuex'
+  
 export default {
   name: 'PickupForm',
   componentName: 'PickupForm',
@@ -500,7 +501,8 @@ export default {
         hideSidebar: !this.sidebar.opened,
         openSidebar: this.sidebar.opened
       }
-    }
+    },
+    ...mapGetters(['userInfo'])
     // comDisabled() {
     //   return id => {
     //     if (this.isFront === false && id === '1574563841707114498') {
@@ -655,10 +657,9 @@ export default {
     // 获取提货方式列表
     getPickupWayList() {
       getDictList({ sysDictEnum: 'PICK' }).then(res => {
-        const localData = JSON.parse(localStorage.getItem('supply_user'))
-        this.frontPickType = localData.frontPickType
-        this.isFront = localData.isFront
-        this.isPick = localData.isPick
+        this.frontPickType = this.userInfo.frontPickType
+        this.isFront = this.userInfo.isFront
+        this.isPick = this.userInfo.isPick
           res.data.forEach(k => {
           if (this.frontPickType) {
             if (!this.isFront && k.dictCode == 1) {