update
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
/**
|
||||
* 2007-2018 PrestaShop
|
||||
* Copyright since 2007 PrestaShop SA and Contributors
|
||||
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License (OSL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* that is bundled with this package in the file LICENSE.md.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/OSL-3.0
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
@@ -15,23 +16,21 @@
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2018 PrestaShop SA
|
||||
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||
* @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
import Vue from 'vue';
|
||||
import VueResource from 'vue-resource';
|
||||
import * as types from './mutation-types';
|
||||
import { showGrowl } from 'app/utils/growl';
|
||||
import { EventBus } from 'app/utils/event-bus';
|
||||
import _ from 'lodash';
|
||||
import * as types from '@app/pages/stock/store/mutation-types';
|
||||
import {showGrowl} from '@app/utils/growl';
|
||||
import {EventBus} from '@app/utils/event-bus';
|
||||
|
||||
Vue.use(VueResource);
|
||||
|
||||
export const getStock = ({ commit }, payload) => {
|
||||
export const getStock = ({commit}, payload) => {
|
||||
const url = window.data.apiStockUrl;
|
||||
Vue.http.get(url, {
|
||||
params: {
|
||||
@@ -53,7 +52,7 @@ export const getStock = ({ commit }, payload) => {
|
||||
});
|
||||
};
|
||||
|
||||
export const getSuppliers = ({ commit }) => {
|
||||
export const getSuppliers = ({commit}) => {
|
||||
const url = window.data.suppliersUrl;
|
||||
Vue.http.get(url).then((response) => {
|
||||
commit(types.SET_SUPPLIERS, response.body);
|
||||
@@ -62,7 +61,7 @@ export const getSuppliers = ({ commit }) => {
|
||||
});
|
||||
};
|
||||
|
||||
export const getCategories = ({ commit }) => {
|
||||
export const getCategories = ({commit}) => {
|
||||
const url = window.data.categoriesUrl;
|
||||
Vue.http.get(url).then((response) => {
|
||||
commit(types.SET_CATEGORIES, response.body);
|
||||
@@ -71,7 +70,7 @@ export const getCategories = ({ commit }) => {
|
||||
});
|
||||
};
|
||||
|
||||
export const getMovements = ({ commit }, payload) => {
|
||||
export const getMovements = ({commit}, payload) => {
|
||||
const url = window.data.apiMovementsUrl;
|
||||
|
||||
Vue.http.get(url, {
|
||||
@@ -95,7 +94,7 @@ export const getMovements = ({ commit }, payload) => {
|
||||
});
|
||||
};
|
||||
|
||||
export const getTranslations = ({ commit }) => {
|
||||
export const getTranslations = ({commit}) => {
|
||||
const url = window.data.translationUrl;
|
||||
Vue.http.get(url).then((response) => {
|
||||
commit(types.SET_TRANSLATIONS, response.body);
|
||||
@@ -105,7 +104,7 @@ export const getTranslations = ({ commit }) => {
|
||||
});
|
||||
};
|
||||
|
||||
export const getEmployees = ({ commit }) => {
|
||||
export const getEmployees = ({commit}) => {
|
||||
const url = window.data.employeesUrl;
|
||||
Vue.http.get(url).then((response) => {
|
||||
commit(types.SET_EMPLOYEES_LIST, response.body);
|
||||
@@ -114,7 +113,7 @@ export const getEmployees = ({ commit }) => {
|
||||
});
|
||||
};
|
||||
|
||||
export const getMovementsTypes = ({ commit }) => {
|
||||
export const getMovementsTypes = ({commit}) => {
|
||||
const url = window.data.movementsTypesUrl;
|
||||
Vue.http.get(url).then((response) => {
|
||||
commit(types.SET_MOVEMENTS_TYPES, response.body);
|
||||
@@ -123,29 +122,29 @@ export const getMovementsTypes = ({ commit }) => {
|
||||
});
|
||||
};
|
||||
|
||||
export const updateOrder = ({ commit }, order) => {
|
||||
export const updateOrder = ({commit}, order) => {
|
||||
commit(types.UPDATE_ORDER, order);
|
||||
};
|
||||
|
||||
export const updatePageIndex = ({ commit }, pageIndex) => {
|
||||
export const updatePageIndex = ({commit}, pageIndex) => {
|
||||
commit(types.SET_PAGE_INDEX, pageIndex);
|
||||
};
|
||||
|
||||
export const updateKeywords = ({ commit }, keywords) => {
|
||||
export const updateKeywords = ({commit}, keywords) => {
|
||||
commit(types.UPDATE_KEYWORDS, keywords);
|
||||
};
|
||||
|
||||
export const isLoading = ({ commit }) => {
|
||||
export const isLoading = ({commit}) => {
|
||||
commit(types.LOADING_STATE, true);
|
||||
};
|
||||
|
||||
export const updateProductQty = ({ commit }, payload) => {
|
||||
export const updateProductQty = ({commit}, payload) => {
|
||||
commit(types.UPDATE_PRODUCT_QTY, payload);
|
||||
};
|
||||
|
||||
export const updateQtyByProductId = ({ commit, state }, payload) => {
|
||||
const url = payload.url;
|
||||
const delta = payload.delta;
|
||||
export const updateQtyByProductId = ({commit}, payload) => {
|
||||
const {url} = payload;
|
||||
const {delta} = payload;
|
||||
|
||||
Vue.http.post(url, {
|
||||
delta,
|
||||
@@ -157,7 +156,7 @@ export const updateQtyByProductId = ({ commit, state }, payload) => {
|
||||
});
|
||||
};
|
||||
|
||||
export const updateQtyByProductsId = ({ commit, state }) => {
|
||||
export const updateQtyByProductsId = ({commit, state}) => {
|
||||
const url = state.editBulkUrl;
|
||||
const productsQty = state.productsToUpdate;
|
||||
|
||||
@@ -169,22 +168,22 @@ export const updateQtyByProductsId = ({ commit, state }) => {
|
||||
});
|
||||
};
|
||||
|
||||
export const updateBulkEditQty = ({ commit }, value) => {
|
||||
export const updateBulkEditQty = ({commit}, value) => {
|
||||
commit(types.UPDATE_BULK_EDIT_QTY, value);
|
||||
};
|
||||
|
||||
export const addProductToUpdate = ({ commit }, product) => {
|
||||
export const addProductToUpdate = ({commit}, product) => {
|
||||
commit(types.ADD_PRODUCT_TO_UPDATE, product);
|
||||
};
|
||||
|
||||
export const removeProductToUpdate = ({ commit }, product) => {
|
||||
export const removeProductToUpdate = ({commit}, product) => {
|
||||
commit(types.REMOVE_PRODUCT_TO_UPDATE, product);
|
||||
};
|
||||
|
||||
export const addSelectedProduct = ({ commit }, product) => {
|
||||
export const addSelectedProduct = ({commit}, product) => {
|
||||
commit(types.ADD_SELECTED_PRODUCT, product);
|
||||
};
|
||||
|
||||
export const removeSelectedProduct = ({ commit }, product) => {
|
||||
export const removeSelectedProduct = ({commit}, product) => {
|
||||
commit(types.REMOVE_SELECTED_PRODUCT, product);
|
||||
};
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
/**
|
||||
* 2007-2018 PrestaShop
|
||||
* Copyright since 2007 PrestaShop SA and Contributors
|
||||
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License (OSL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* that is bundled with this package in the file LICENSE.md.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/OSL-3.0
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
@@ -15,18 +16,17 @@
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2018 PrestaShop SA
|
||||
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||
* @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
import Vue from 'vue';
|
||||
import Vuex from 'vuex';
|
||||
import _ from 'lodash';
|
||||
import * as actions from './actions';
|
||||
import mutations from './mutations';
|
||||
import _ from 'lodash';
|
||||
|
||||
Vue.use(Vuex);
|
||||
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
/**
|
||||
* 2007-2018 PrestaShop
|
||||
* Copyright since 2007 PrestaShop SA and Contributors
|
||||
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License (OSL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* that is bundled with this package in the file LICENSE.md.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/OSL-3.0
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
@@ -15,12 +16,11 @@
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2018 PrestaShop SA
|
||||
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||
* @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
export const ADD_PRODUCTS = 'ADD_PRODUCTS';
|
||||
export const ADD_PRODUCT_TO_UPDATE = 'ADD_PRODUCT_TO_UPDATE';
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
/**
|
||||
* 2007-2018 PrestaShop
|
||||
* Copyright since 2007 PrestaShop SA and Contributors
|
||||
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License (OSL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* that is bundled with this package in the file LICENSE.md.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/OSL-3.0
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
@@ -15,13 +16,14 @@
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2018 PrestaShop SA
|
||||
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||
* @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
import _ from 'lodash';
|
||||
import * as types from './mutation-types';
|
||||
|
||||
export default {
|
||||
@@ -120,6 +122,7 @@ export default {
|
||||
product_id: updatedProduct.product_id,
|
||||
combination_id: updatedProduct.combination_id,
|
||||
});
|
||||
|
||||
if (index !== -1) {
|
||||
state.productsToUpdate.splice(index, 1, updatedProduct);
|
||||
} else {
|
||||
@@ -165,6 +168,7 @@ export default {
|
||||
product_id: product.product_id,
|
||||
combination_id: product.combination_id,
|
||||
});
|
||||
|
||||
if (index !== -1) {
|
||||
state.selectedProducts.splice(index, 1, product);
|
||||
} else {
|
||||
@@ -176,10 +180,10 @@ export default {
|
||||
product_id: product.product_id,
|
||||
combination_id: product.combination_id,
|
||||
});
|
||||
|
||||
if (index !== -1) {
|
||||
state.selectedProducts[index].qty = 0;
|
||||
}
|
||||
state.selectedProducts.splice(index, 1);
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user