Inventory.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. import http from '@/request/index.js';
  2. // 盘点数据
  3. export const state = {
  4. inventData: []
  5. };
  6. export const mutations = {
  7. setInventData(state, data) {
  8. state.inventData = data
  9. },
  10. }
  11. export const actions = {
  12. getInventoryData({
  13. commit,
  14. rootState
  15. }, data) {
  16. return new Promise((resolve, reject) => {
  17. http('inventory.getListData', {
  18. ...data.pam,
  19. }, '加载中').then(res => {
  20. if (res.success == true) {
  21. data.that.$refs.paging.complete(res.data.records);
  22. } else {
  23. }
  24. }).catch(e => {
  25. reject(e)
  26. })
  27. })
  28. },
  29. getInvenDetailData({
  30. commit,
  31. rootState
  32. }, data) {
  33. return new Promise((resolve, reject) => {
  34. http('inventory.getInvenListData', {
  35. ...data.pam,
  36. }, '加载中').then(res => {
  37. if (res.success == true) {
  38. data.that.$refs.paging.complete(res.data.records);
  39. } else {
  40. // commit('DetailsData', []);
  41. }
  42. }).catch(e => {
  43. reject(e)
  44. })
  45. })
  46. },
  47. //查看盘点结果
  48. getInvenResultData({
  49. commit,
  50. rootState
  51. }, data) {
  52. return new Promise((resolve, reject) => {
  53. http('inventory.getResultData', {
  54. ...data.pam,
  55. }, '加载中').then(res => {
  56. if (res.success == true) {
  57. data.that.$refs.paging.complete(res.data.records);
  58. } else {
  59. // commit('DetailsData', []);
  60. }
  61. }).catch(e => {
  62. reject(e)
  63. })
  64. })
  65. },
  66. }