| 12345678910111213141516171819202122232425262728293031 |
- import axios from '~plugins/axios'
- export const actions = {
- // 根据UUID获取某店铺信息
- findStoreInfoFromUuid ({ commit }, params = {}) {
- commit('storeInfo/REQUEST_STORE_INFO')
- return axios.get('/api/store-service/stores', { params })
- .then(response => {
- commit('storeInfo/GET_STORE_INFO_SUCCESS', response.data)
- }, err => {
- commit('storeInfo/GET_STORE_INFO_FAILURE', err)
- })
- },
- findCommodityOnBatchInfo ({ commit }, params = {}) {
- commit('storeInfo/REQUEST_COMMODITY')
- return axios.get(`/api/commodity/${params.batchCode || ''}/detail`)
- .then(response => {
- commit('storeInfo/GET_COMMODITY_SUCCESS', response.data)
- let commodity = response.data || {}
- commit('storeInfo/REQUEST_COMPONENT')
- return axios.get(`/api/commodity/component/${commodity.uuid}`)
- .then(response => {
- commit('storeInfo/GET_COMPONENT_SUCCESS', response.data)
- }, err => {
- commit('storeInfo/GET_COMPONENT_FAILURE', err)
- })
- }, err => {
- commit('storeInfo/GET_COMMODITY_FAILURE', err)
- })
- }
- }
|