forked from verdnatura/salix-front
updates
This commit is contained in:
parent
0dfdb1edb0
commit
eeab4ed915
|
@ -1,5 +1,5 @@
|
|||
<script setup>
|
||||
import { onMounted } from 'vue';
|
||||
import { computed, onMounted } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useRouter } from 'vue-router';
|
||||
import VnPaginate from 'src/components/ui/VnPaginate.vue';
|
||||
|
@ -21,18 +21,57 @@ const { t } = useI18n();
|
|||
const { viewSummary } = useSummaryDialog();
|
||||
const quasar = useQuasar();
|
||||
|
||||
function navigate(id) {
|
||||
router.push({ path: `/entry/${id}` });
|
||||
}
|
||||
|
||||
const redirectToCreateView = () => {
|
||||
router.push({ name: 'EntryCreate' });
|
||||
};
|
||||
|
||||
onMounted(async () => {
|
||||
stateStore.rightDrawer = true;
|
||||
});
|
||||
|
||||
const columns = computed(() => [
|
||||
{
|
||||
align: 'left',
|
||||
name: 'id',
|
||||
label: t('customer.extendedList.tableVisibleColumns.id'),
|
||||
chip: {
|
||||
condition: () => true,
|
||||
},
|
||||
isId: true,
|
||||
columnFilter: {
|
||||
component: 'select',
|
||||
name: 'search',
|
||||
attrs: {
|
||||
url: 'Clients',
|
||||
fields: ['id', 'name'],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
label: t('customer.extendedList.tableVisibleColumns.name'),
|
||||
name: 'name',
|
||||
isTitle: true,
|
||||
create: true,
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
name: 'socialName',
|
||||
label: t('customer.extendedList.tableVisibleColumns.socialName'),
|
||||
isTitle: true,
|
||||
create: true,
|
||||
},
|
||||
{
|
||||
align: 'right',
|
||||
label: '',
|
||||
name: 'tableActions',
|
||||
computed,
|
||||
actions: [
|
||||
{
|
||||
title: t('Print buys'),
|
||||
icon: 'print',
|
||||
action: (row) => printBuys(row.id),
|
||||
},
|
||||
],
|
||||
},
|
||||
]);
|
||||
|
||||
const printBuys = (rowId) => {
|
||||
quasar.dialog({
|
||||
component: EntryBuysTableDialog,
|
||||
|
@ -41,6 +80,7 @@ const printBuys = (rowId) => {
|
|||
},
|
||||
});
|
||||
};
|
||||
import VnTable from 'components/VnTable/VnTable.vue';
|
||||
</script>
|
||||
<template>
|
||||
<VnSearchbar
|
||||
|
@ -56,79 +96,18 @@ const printBuys = (rowId) => {
|
|||
</RightMenu>
|
||||
<QPage class="column items-center q-pa-md">
|
||||
<div class="vn-card-list">
|
||||
<VnPaginate
|
||||
data-key="EntryList"
|
||||
<VnTable
|
||||
ref="myEntriesRef"
|
||||
data-key="myentriesList"
|
||||
url="Entries/filter"
|
||||
:order="['landed DESC', 'id DESC']"
|
||||
:columns="columns"
|
||||
default-mode="table"
|
||||
redirect="customer"
|
||||
auto-load
|
||||
:create="null"
|
||||
>
|
||||
<template #body="{ rows }">
|
||||
<CardList
|
||||
v-for="row of rows"
|
||||
:key="row.id"
|
||||
:title="row.reference"
|
||||
@click="navigate(row.id)"
|
||||
:id="row.id"
|
||||
:has-info-icons="!!row.isExcludedFromAvailable || !!row.isRaid"
|
||||
>
|
||||
<template #info-icons>
|
||||
<QIcon
|
||||
v-if="row.isExcludedFromAvailable"
|
||||
name="vn:inventory"
|
||||
color="primary"
|
||||
size="xs"
|
||||
>
|
||||
<QTooltip>{{ t('Inventory entry') }}</QTooltip>
|
||||
</QIcon>
|
||||
<QIcon
|
||||
v-if="row.isRaid"
|
||||
name="vn:net"
|
||||
color="primary"
|
||||
size="xs"
|
||||
>
|
||||
<QTooltip>{{ t('Virtual entry') }}</QTooltip>
|
||||
</QIcon>
|
||||
</template>
|
||||
<template #list-items>
|
||||
<VnLv :label="t('landed')" :value="toDate(row.landed)" />
|
||||
<VnLv
|
||||
:label="t('entry.list.booked')"
|
||||
:value="!!row.isBooked"
|
||||
/>
|
||||
<VnLv
|
||||
:label="t('entry.list.invoiceNumber')"
|
||||
:value="row.invoiceNumber"
|
||||
/>
|
||||
<VnLv
|
||||
:label="t('entry.list.confirmed')"
|
||||
:value="!!row.isConfirmed"
|
||||
/>
|
||||
<VnLv
|
||||
:label="t('entry.list.supplier')"
|
||||
:value="row.supplierName"
|
||||
/>
|
||||
<VnLv
|
||||
:label="t('entry.list.ordered')"
|
||||
:value="!!row.isOrdered"
|
||||
/>
|
||||
</template>
|
||||
<template #actions>
|
||||
<QBtn
|
||||
:label="t('components.smartCard.openSummary')"
|
||||
@click.stop="viewSummary(row.id, EntrySummary)"
|
||||
color="primary"
|
||||
type="submit"
|
||||
/>
|
||||
<QBtn
|
||||
:label="t('Print buys')"
|
||||
@click.stop="printBuys(row.id)"
|
||||
color="primary"
|
||||
type="submit"
|
||||
/>
|
||||
</template>
|
||||
</CardList>
|
||||
</template>
|
||||
</VnPaginate>
|
||||
</VnTable>
|
||||
</div>
|
||||
</QPage>
|
||||
<QPageSticky :offset="[20, 20]">
|
||||
|
|
|
@ -31,7 +31,7 @@ export default {
|
|||
component: () => import('src/pages/Entry/EntryList.vue'),
|
||||
},
|
||||
{
|
||||
path: 'list',
|
||||
path: 'my',
|
||||
name: 'MyEntries',
|
||||
meta: {
|
||||
title: 'eti',
|
||||
|
|
Loading…
Reference in New Issue