Browse Source

询价条数请求

yangc 6 years ago
parent
commit
031da65f07
3 changed files with 11 additions and 14 deletions
  1. 2 2
      pages/index.vue
  2. 6 2
      store/count.js
  3. 3 10
      store/index.js

+ 2 - 2
pages/index.vue

@@ -58,8 +58,8 @@
         store.dispatch('loadNewsSnapshot', { page: 1, pageSize: 10 }),
         store.dispatch('supplier/loadVendorAll', {page: 1, size: 20}),
         store.dispatch('loadAllCount', {_status: 'actived', usedFor: 'mall_home_banner'}),
-        store.dispatch('loadInquirySheet', {year: nowYear, month: nowMonth}),
-        store.dispatch('loadInquirySheetLast', {year: nowYear, month: LastMonth}),
+        store.dispatch('loadInquirySheet'),
+//        store.dispatch('loadInquirySheetLast', {year: nowYear, month: LastMonth}),
         store.dispatch('provider/findSimilarStoreList', {page: 1, count: 10, type: 'ORIGINAL_FACTORY-DISTRIBUTION-AGENCY-CONSIGNMENT', keyword: ''}),
         store.dispatch('applyPurchase/loadPurchaseManList', {pageNumber: 1, pageSize: 50, enUU: store.state.option.user.data.enterprise ? store.state.option.user.data.enterprise.uu : null}),
         store.dispatch('loadStoreStatus', { op: 'check' })

+ 6 - 2
store/count.js

@@ -32,7 +32,9 @@ export const mutations = {
   },
   GET_INQUIRYSHEET_SUCCESS (state, result) {
     state.inquirySheet.fetching = false
-    state.inquirySheet.data = result
+    state.inquirySheet.data = {
+      count: result
+    }
   },
   REQUEST_INQUIRYSHEETLAST (state) {
     state.inquirySheetLast.fetching = true
@@ -42,6 +44,8 @@ export const mutations = {
   },
   GET_INQUIRYSHEETLAST_SUCCESS (state, result) {
     state.inquirySheetLast.fetching = false
-    state.inquirySheetLast.data = result
+    state.inquirySheetLast.data = {
+      count: result
+    }
   }
 }

+ 3 - 10
store/index.js

@@ -453,19 +453,12 @@ export const actions = {
   // 获取首页悬浮计数器询价单
   loadInquirySheet ({commit}, params) {
     commit('count/REQUEST_INQUIRYSHEET')
-    return axios.get('/inquiry/public/getPurcInquiryItemCountByMonth', {params})
+    return axios.get('/inquiry/public/getCountOfLastAndThisMonth', {params})
       .then(res => {
-        commit('count/GET_INQUIRYSHEET_SUCCESS', res.data)
+        commit('count/GET_INQUIRYSHEET_SUCCESS', res.data.current || 0)
+        commit('count/GET_INQUIRYSHEETLAST_SUCCESS', res.data.last || 0)
       }, (err) => {
         commit('count/GET_INQUIRYSHEET_FAILURE', err)
-      })
-  },
-  loadInquirySheetLast ({commit}, params) {
-    commit('count/REQUEST_INQUIRYSHEETLAST')
-    return axios.get('/inquiry/public/getPurcInquiryItemCountByMonth', {params})
-      .then(res => {
-        commit('count/GET_INQUIRYSHEETLAST_SUCCESS', res.data)
-      }, (err) => {
         commit('count/GET_INQUIRYSHEETLAST_FAILURE', err)
       })
   },