Item barcode

This commit is contained in:
William Buezas 2024-04-24 12:54:38 -03:00
parent 036dcaadd2
commit a6ebe9cf19
5 changed files with 98 additions and 1 deletions

View File

@ -119,6 +119,11 @@ select:-webkit-autofill {
font-variation-settings: 'FILL' 1;
}
.fill-icon-on-hover:hover {
font-variation-settings: 'FILL' 1;
cursor: pointer;
}
.vn-table-separation-row {
height: 16px !important;
background-color: var(--vn-section-color) !important;

View File

@ -1119,6 +1119,7 @@ item:
tags: Tags
wasteBreakdown: Waste breakdown
itemCreate: New item
barcode: Barcode
descriptor:
item: Item
buyer: Buyer

View File

@ -1118,6 +1118,7 @@ item:
tags: Etiquetas
wasteBreakdown: Deglose de mermas
itemCreate: Nuevo artículo
barcode: Códigos de barras
descriptor:
item: Artículo
buyer: Comprador

View File

@ -0,0 +1,80 @@
<script setup>
import { ref, onMounted } from 'vue';
import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n';
import CrudModel from 'components/CrudModel.vue';
import VnInput from 'src/components/common/VnInput.vue';
const route = useRoute();
const { t } = useI18n();
const itemBarcodeRef = ref(null);
onMounted(() => {
if (itemBarcodeRef.value) itemBarcodeRef.value.reload();
});
</script>
<template>
<div class="full-width flex justify-center">
<QPage class="card-width q-pa-lg">
<CrudModel
:data-required="{ itemFk: route.params.id }"
:default-remove="false"
:filter="{
fields: ['id', 'itemFk', 'code'],
where: { itemFk: route.params.id },
}"
data-key="ItemBarcodes"
model="ItemBarcodes"
ref="itemBarcodeRef"
url="ItemBarcodes"
>
<template #body="{ rows }">
<QCard class="q-px-lg q-py-md">
<div
v-for="(row, index) in rows"
:key="index"
class="q-mb-md full-width row items-center no-wrap"
>
<VnInput
:label="t('Code')"
v-model="row.code"
class="full-width"
/>
<QIcon
@click="itemBarcodeRef.remove([row])"
class="cursor-pointer q-ml-md"
color="primary"
name="delete"
size="sm"
>
<QTooltip class="text-no-wrap">
{{ t('Remove barcode') }}
</QTooltip>
</QIcon>
</div>
<QIcon
@click="itemBarcodeRef.insert()"
class="cursor-pointer fill-icon-on-hover"
color="primary"
name="add_circle"
size="sm"
>
<QTooltip>
{{ t('Add barcode') }}
</QTooltip>
</QIcon>
</QCard>
</template>
</CrudModel>
</QPage>
</div>
</template>
<i18n>
es:
Code: Código
Remove barcode: Quitar código de barras
Add barcode: Añadir código de barras
</i18n>

View File

@ -6,12 +6,13 @@ export default {
meta: {
title: 'items',
icon: 'vn:item',
moduleName: 'Item',
},
component: RouterView,
redirect: { name: 'ItemMain' },
menus: {
main: ['ItemList', 'WasteBreakdown'],
card: ['ItemBasicData'],
card: ['ItemBasicData', 'ItemBarcode'],
},
children: [
{
@ -94,6 +95,15 @@ export default {
},
component: () => import('src/pages/Item/Card/ItemBasicData.vue'),
},
{
path: 'barcode',
name: 'ItemBarcode',
meta: {
title: 'barcode',
icon: 'vn:barcode',
},
component: () => import('src/pages/Item/Card/ItemBarcode.vue'),
},
],
},
],