diff --git a/src/components/VnTable/VnTable.vue b/src/components/VnTable/VnTable.vue index ea7cf1dda..41e789343 100644 --- a/src/components/VnTable/VnTable.vue +++ b/src/components/VnTable/VnTable.vue @@ -610,6 +610,7 @@ function handleSelection({ evt, added, rows: selectedRows }, rows) { $props.rowClick && $props.rowClick(row); } " + style="height: 100%" > -import { ref, onUnmounted, watch } from 'vue'; +import { ref, onUnmounted, watch, onMounted } from 'vue'; import { useI18n } from 'vue-i18n'; import { useRoute, useRouter } from 'vue-router'; import axios from 'axios'; @@ -369,6 +369,10 @@ async function clearFilter() { await applyFilter(); } +onMounted(() => { + stateStore.rightDrawer = true; +}); + onUnmounted(() => { stateStore.rightDrawer = false; }); diff --git a/src/components/ui/VnFilterPanel.vue b/src/components/ui/VnFilterPanel.vue index 8c0dbda94..8879b5c53 100644 --- a/src/components/ui/VnFilterPanel.vue +++ b/src/components/ui/VnFilterPanel.vue @@ -127,7 +127,6 @@ async function search(evt) { userParams.value = newParams; if (!$props.showAll && !Object.values(filter).length) store.data = []; - emit('search'); } finally { isLoading.value = false; } diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index ecfa2c8fe..abf2c0fd9 100644 --- a/src/i18n/locale/en.yml +++ b/src/i18n/locale/en.yml @@ -397,8 +397,8 @@ entry: buys: Buys stickers: Stickers package: Package - packing: Packing - grouping: Grouping + packing: Pack. + grouping: Group. buyingValue: Buying value import: Import pvp: PVP diff --git a/src/i18n/locale/es.yml b/src/i18n/locale/es.yml index def0b0696..9f0f10f19 100644 --- a/src/i18n/locale/es.yml +++ b/src/i18n/locale/es.yml @@ -400,8 +400,8 @@ entry: buys: Compras stickers: Etiquetas package: Embalaje - packing: Packing - grouping: Grouping + packing: Pack. + grouping: Group. buyingValue: Coste import: Importe pvp: PVP diff --git a/src/pages/Item/Card/ItemBarcode.vue b/src/pages/Item/Card/ItemBarcode.vue index 197e9142f..6db5943c7 100644 --- a/src/pages/Item/Card/ItemBarcode.vue +++ b/src/pages/Item/Card/ItemBarcode.vue @@ -2,12 +2,15 @@ import { ref, nextTick } from 'vue'; import { useRoute } from 'vue-router'; import { useI18n } from 'vue-i18n'; +import axios from 'axios'; import CrudModel from 'src/components/CrudModel.vue'; import VnInput from 'src/components/common/VnInput.vue'; +import useNotify from 'src/composables/useNotify.js'; const route = useRoute(); const { t } = useI18n(); +const { notify } = useNotify(); const itemBarcodeRef = ref(null); @@ -23,6 +26,24 @@ const focusLastInput = () => { if (lastInput) lastInput.focus(); }); }; + +const removeRow = (row) => { + itemBarcodeRef.value.remove([row]); +}; + +const submit = async (rows) => { + const params = rows[rows.length - 1]; + let { data } = await axios.get('ItemBarcodes'); + const code = params.code; + + if (data.some((codes) => codes.code === code)) { + notify(t('Codes can not be repeated'), 'negative'); + itemBarcodeRef.value.reset(); + return; + } + await axios.patch(`ItemBarcodes`, params); + notify(t('globals.dataSaved'), 'positive'); +};