Browse Source

bom求购发布验收问题修改

yangc 7 years ago
parent
commit
798b417c42

+ 1 - 2
components/applyPurchase/BatchPublish.vue

@@ -603,9 +603,8 @@
           }
         } else if (this.modifyObj.brand && getRealLen(this.modifyObj.brand) > 50) {
           this.modifyObj.brand = cutOutString(this.modifyObj.brand, 50)
-        } else {
-          this.getSimilarBrand()
         }
+        this.getSimilarBrand()
       },
       onAmountInput: function () {
         if (!(/^[0-9]*$/).test(this.modifyObj.amount)) {

+ 1 - 2
components/applyPurchase/PublishApply.vue

@@ -381,9 +381,8 @@
           }
         } else if (this.applyObj.brand && getRealLen(this.applyObj.brand) > 50) {
           this.applyObj.brand = cutOutString(this.applyObj.brand, 50)
-        } else {
-          this.getSimilarBrand()
         }
+        this.getSimilarBrand()
       },
       onAmountInput: function () {
         if (!(/^[0-9]*$/).test(this.applyObj.amount)) {

+ 3 - 2
store/applyPurchase.js

@@ -81,7 +81,6 @@ export const actions = {
     commit('bomMaterial/REQUEST_BOM_MATERIAL')
     return axios.get('/seek/getSeekPurchaseByBatchPageInfo', {params: params})
       .then(response => {
-        commit('bomMaterial/GET_BOM_MATERIAL_SUCCESS', response.data)
         let list = response.data.content
         if (list && list.length) {
           let promises = []
@@ -89,7 +88,9 @@ export const actions = {
             list[i].$index = i
             promises.push(getSpotGoods({commit}, list[i]))
           }
-          return Promise.all(promises)
+          return Promise.all(promises).then(() => {
+            commit('bomMaterial/GET_BOM_MATERIAL_SUCCESS', response.data)
+          })
         }
       }, err => {
         commit('bomMaterial/GET_BOM_MATERIAL_FAILURE', err)