YY 2 vuotta sitten
vanhempi
commit
c71a040cd5
2 muutettua tiedostoa jossa 46 lisäystä ja 0 poistoa
  1. 2 0
      src/store/index.js
  2. 44 0
      src/store/module/statistics/getBill.js

+ 2 - 0
src/store/index.js

@@ -13,6 +13,7 @@ import todo from './module/statistics/todo';
 import sellTotal from './module/statistics/sellTotal';
 import shopInBill from './module/statistics/shopInBill';
 import outBill from './module/statistics/outBill';
+import getBill from './module/statistics/getBill';
 import shopCashOut from './module/statistics/shopCashOut';
 
 import dictIndex from './module/dev/dictIndex';
@@ -117,5 +118,6 @@ export default new Vuex.Store({
     notice,
     msgList,
     shopCashOut,
+    getBill,
   },
 });

+ 44 - 0
src/store/module/statistics/getBill.js

@@ -0,0 +1,44 @@
+import Vue from 'vue';
+import Vuex from 'vuex';
+const _ = require('lodash');
+Vue.use(Vuex);
+const api = {
+  url: '/point/v1/api/statistics/bill/getBill',
+};
+
+const state = () => ({});
+const mutations = {};
+
+const actions = {
+  async query({ commit }, { skip = 0, limit, ...info } = {}) {
+    const res = await this.$axios.$get(`${api.url}`, {
+      skip,
+      limit,
+      ...info,
+    });
+    return res;
+  },
+  async create({ commit }, payload) {
+    const res = await this.$axios.$post(`${api.url}`, payload);
+    return res;
+  },
+  async fetch({ commit }, payload) {
+    const res = await this.$axios.$get(`${api.url}/${payload}`);
+    return res;
+  },
+  async update({ commit }, payload) {
+    const id = _.get(payload, 'id', _.get(payload, '_id'));
+    const res = await this.$axios.$post(`${api.url}/${id}`, payload);
+    return res;
+  },
+  async delete({ commit }, payload) {
+    const res = await this.$axios.$delete(`${api.url}/${payload}`);
+    return res;
+  },
+};
+export default {
+  namespaced: true,
+  state,
+  mutations,
+  actions,
+};