import http from '@/request/index.js'; // 盘点数据 export const state = { inventData: [] }; export const mutations = { setInventData(state, data) { state.inventData = data }, } export const actions = { getInventoryData({ commit, rootState }, data) { return new Promise((resolve, reject) => { http('inventory.getListData', { ...data.pam, }, '加载中').then(res => { if (res.success == true) { data.that.$refs.paging.complete(res.data.records); } else { } }).catch(e => { reject(e) }) }) }, getInvenDetailData({ commit, rootState }, data) { return new Promise((resolve, reject) => { http('inventory.getInvenListData', { ...data.pam, }, '加载中').then(res => { if (res.success == true) { data.that.$refs.paging.complete(res.data.records); } else { // commit('DetailsData', []); } }).catch(e => { reject(e) }) }) }, //查看盘点结果 getInvenResultData({ commit, rootState }, data) { return new Promise((resolve, reject) => { http('inventory.getResultData', { ...data.pam, }, '加载中').then(res => { if (res.success == true) { data.that.$refs.paging.complete(res.data.records); } else { // commit('DetailsData', []); } }).catch(e => { reject(e) }) }) }, }