7729-devToTest_2430 #554
|
@ -70,7 +70,7 @@ function getRoutes() {
|
|||
(route) => toLowerCamel(route.name) === item.module
|
||||
);
|
||||
if (!moduleDef) continue;
|
||||
if (!role.isEmployee()) continue;
|
||||
// if (!role.isEmployee()) continue;
|
||||
item.children = [];
|
||||
|
||||
addChildren(item.module, moduleDef, item.children);
|
||||
|
|
|
@ -28,7 +28,7 @@ export function useRole() {
|
|||
return false;
|
||||
}
|
||||
function isEmployee() {
|
||||
return !hasAny(['employee']);
|
||||
return hasAny(['employee']);
|
||||
}
|
||||
|
||||
return {
|
||||
|
|
|
@ -17,6 +17,8 @@ import { useQuasar } from 'quasar';
|
|||
import { toCurrency } from 'src/filters';
|
||||
import axios from 'axios';
|
||||
import useNotify from 'src/composables/useNotify.js';
|
||||
import { usePrintService } from 'composables/usePrintService';
|
||||
const { openReport } = usePrintService();
|
||||
|
||||
const quasar = useQuasar();
|
||||
const route = useRoute();
|
||||
|
@ -31,18 +33,14 @@ const $props = defineProps({
|
|||
},
|
||||
});
|
||||
const rowsSelected = ref([]);
|
||||
const entityId = computed(() => $props.id || route.params.id);
|
||||
|
||||
const entriesTableColumns = computed(() => [
|
||||
{
|
||||
align: 'left',
|
||||
name: 'item',
|
||||
label: t('entry.summary.item'),
|
||||
field: 'itemFk',
|
||||
format: (row) => row.item.name,
|
||||
// component: 'fetchedTags',
|
||||
// attrs: {
|
||||
// item: (row) => row.item,
|
||||
// },
|
||||
field: (row) => row.item.name,
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
|
@ -90,8 +88,7 @@ const entriesTableColumns = computed(() => [
|
|||
align: 'left',
|
||||
name: 'buyingValue',
|
||||
label: t('entry.summary.buyingValue'),
|
||||
field: 'buyingValue',
|
||||
format: ({ buyingValue }) => toCurrency(buyingValue),
|
||||
field: ({ buyingValue }) => toCurrency(buyingValue),
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
|
@ -109,20 +106,9 @@ const entriesTableColumns = computed(() => [
|
|||
align: 'left',
|
||||
name: 'import',
|
||||
label: t('entry.summary.import'),
|
||||
format: (row) => toCurrency(row.buyingValue * row.quantity),
|
||||
field: (row) => toCurrency(row.buyingValue * row.quantity),
|
||||
},
|
||||
]);
|
||||
|
||||
import { useArrayData } from 'src/composables/useArrayData';
|
||||
import VnTable from 'src/components/VnTable/VnTable.vue';
|
||||
|
||||
const arrayData = useArrayData('EntryBuys');
|
||||
const { store } = arrayData;
|
||||
|
||||
const entityId = computed(() => $props.id || route.params.id);
|
||||
// import EntryBuysTable from './EntryBuysTable.vue';
|
||||
store.userParams = {};
|
||||
onBeforeMount(() => {});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
@ -142,28 +128,49 @@ onBeforeMount(() => {});
|
|||
</QCardSection>
|
||||
<QCardActions align="right">
|
||||
<QBtn
|
||||
:label="t('globals.print')"
|
||||
:label="t('Print buys')"
|
||||
color="primary"
|
||||
icon="print"
|
||||
:loading="isLoading"
|
||||
@click="confirm()"
|
||||
@click="openReport(`Entries/${entityId}/buy-label`)"
|
||||
unelevated
|
||||
autofocus
|
||||
/>
|
||||
</QCardActions>
|
||||
<QCardSection class="row items-center">
|
||||
<VnTable
|
||||
<VnPaginate
|
||||
ref="entryBuysPaginateRef"
|
||||
data-key="EntryBuys"
|
||||
:url="`Entries/${entityId}/getBuys`"
|
||||
auto-load
|
||||
:columns="entriesTableColumns"
|
||||
default-mode="table"
|
||||
:right-search="false"
|
||||
:is-editable="false"
|
||||
:use-model="false"
|
||||
>
|
||||
</VnTable> </QCardSection
|
||||
<template #body="{ rows }">
|
||||
<QTable
|
||||
:rows="rows"
|
||||
:columns="entriesTableColumns"
|
||||
selection="multiple"
|
||||
row-key="id"
|
||||
class="full-width q-mt-md"
|
||||
:grid="$q.screen.lt.md"
|
||||
v-model:selected="rowsSelected"
|
||||
:no-data-label="t('globals.noResults')"
|
||||
>
|
||||
<template #body="props">
|
||||
<QTr>
|
||||
<QTd>
|
||||
<QCheckbox v-model="props.selected" />
|
||||
</QTd>
|
||||
<QTd v-for="col in props.cols" :key="col.name">
|
||||
{{ col.value }}
|
||||
<FetchedTags
|
||||
v-if="col.name === 'item'"
|
||||
:item="props.row['item']"
|
||||
></FetchedTags>
|
||||
</QTd>
|
||||
</QTr>
|
||||
</template>
|
||||
</QTable> </template
|
||||
></VnPaginate> </QCardSection
|
||||
></QCard>
|
||||
</QDialog>
|
||||
</template>
|
||||
|
@ -181,4 +188,5 @@ onBeforeMount(() => {});
|
|||
|
||||
<i18n>
|
||||
es:
|
||||
Print buys: Imprimir compras
|
||||
</i18n>
|
||||
|
|
|
@ -125,7 +125,7 @@ const printBuys = (rowId) => {
|
|||
type="submit"
|
||||
/>
|
||||
<QBtn
|
||||
:label="t('globals.print')"
|
||||
:label="t('Print buys')"
|
||||
@click.stop="printBuys(row.id)"
|
||||
color="primary"
|
||||
type="submit"
|
||||
|
@ -146,6 +146,7 @@ const printBuys = (rowId) => {
|
|||
|
||||
<i18n>
|
||||
es:
|
||||
Print buys: Imprimir compras
|
||||
Inventory entry: Es inventario
|
||||
Virtual entry: Es una redada
|
||||
Search entries: Buscar entradas
|
||||
|
|
Loading…
Reference in New Issue