Browse Source

处理验证信息和币种问题

wangcz 6 years ago
parent
commit
60273ba8d5

+ 1 - 1
components/mobile/center/outOfStorage/otherStorage.vue

@@ -191,7 +191,7 @@
           }
           this.allObj[index].qty = this.baseUtils.cutOutString(item.qty, chineseIndex)
         } else if (item.qty.length > 9) {
-          this.onRemind ('数量不能高于1亿')
+          this.onRemind ('数量不能高于10亿')
           this.allObj[index].qty = this.baseUtils.cutOutString(item.qty, 9)
         }
       },

+ 1 - 2
pages/mobile/center/vendor/outOfStorage/_id.vue

@@ -40,8 +40,7 @@
     layout: 'mobile',
     fetch({route, store}) {
       return Promise.all([
-        store.dispatch('product/getLoadStorageId', {id:route.params.id}),
-        store.dispatch('loadCurrencyData')
+        store.dispatch('product/getLoadStorageId', {id:route.params.id})
       ])
     },
     data () {

+ 2 - 3
pages/mobile/center/vendor/outOfStorage/purchase/_storeid.vue

@@ -87,11 +87,9 @@
     fetch({route, store}) {
       return route.query.type === 'INBOUND' ? Promise.all([
         store.dispatch('product/getLoadEnterpriseId', {id:route.params.storeid}),
-        store.dispatch('loadCurrencyData')
       ]) : Promise.all([
         store.dispatch('product/getLoadPurchaseId', {id:route.params.storeid}),
-        store.dispatch('product/getLoadLogistics', {count:30, page: 1}),
-        store.dispatch('loadCurrencyData')
+        store.dispatch('product/getLoadLogistics', {count:30, page: 1})
       ])
     },
     data () {
@@ -175,6 +173,7 @@
             if(arr.length <= 0) {
               this.onRemind('最少填写一个发货数量')
             } else {
+              this.allObj.sendType = type.sendType
               this.allObj.map = arr
               this.allObj.jsonSdAddress = this.storageList.jsonAddress
               this.$http.post(`/trade/invoice/inFpu/save?id=${this.storageList.id}`, this.allObj)

+ 12 - 1
store/index.js

@@ -23,6 +23,14 @@ function loadBrandComponent({ commit }, params = {}) {
     })
 }
 
+// 获取币别信息
+function loadCurrencyData ({commit}) {
+  return axios.get('/basic/enterprise/currency')
+    .then(res => {
+      commit('option/SET_CURRENCY', res.data)
+    })
+}
+
 export const actions = {
   // 全局服务初始化
   nuxtServerInit(store, { params, route, isDev, req }) {
@@ -78,6 +86,9 @@ export const actions = {
           }
         }
         commit('option/REQUEST_USER_INFO_SUCCESS', response.data)
+        return Promise.all([
+          loadCurrencyData({commit})
+        ])
       }, err => {
         commit('option/REQUEST_USER_INFO_FAILURE', err)
       })
@@ -110,7 +121,7 @@ export const actions = {
   },
   // 获取币别信息
   loadCurrencyData ({commit}) {
-    return axios.get('basic/enterprise/currency')
+    return axios.get('/basic/enterprise/currency')
       .then(res => {
         commit('option/SET_CURRENCY', res.data)
       })

+ 1 - 1
store/option.js

@@ -137,7 +137,7 @@ export const mutations = {
     state.wechatInfo.fetching = false
   },
   SET_CURRENCY (state, result) {
-    state.currency = result.data ? result.data.data : 'RMB'
+    state.currency = result.data || 'RMB'
   },
   GET_MESSAGETYPE (state, result) {
     state.messageType = result || ''