refactor: refs #8316 used VnSection and VnCardBeta #1146
|
@ -1,19 +1,11 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import InvoiceOutDescriptor from './InvoiceOutDescriptor.vue';
|
import InvoiceOutDescriptor from './InvoiceOutDescriptor.vue';
|
||||||
import VnCard from 'components/common/VnCard.vue';
|
import VnCardBeta from 'components/common/VnCardBeta.vue';
|
||||||
import InvoiceOutFilter from '../InvoiceOutFilter.vue';
|
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<VnCard
|
<VnCardBeta
|
||||||
data-key="InvoiceOut"
|
data-key="InvoiceOut"
|
||||||
base-url="InvoiceOuts"
|
base-url="InvoiceOuts"
|
||||||
:descriptor="InvoiceOutDescriptor"
|
:descriptor="InvoiceOutDescriptor"
|
||||||
:filter-panel="InvoiceOutFilter"
|
|
||||||
search-data-key="InvoiceOutList"
|
|
||||||
:searchbar-props="{
|
|
||||||
url: 'InvoiceOuts/filter',
|
|
||||||
label: 'Search invoice',
|
|
||||||
info: 'You can search by invoice reference',
|
|
||||||
}"
|
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -3,7 +3,6 @@ import { ref, computed, watchEffect } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
import VnInputDate from 'src/components/common/VnInputDate.vue';
|
import VnInputDate from 'src/components/common/VnInputDate.vue';
|
||||||
import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
|
|
||||||
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
|
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
|
||||||
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
||||||
import { usePrintService } from 'src/composables/usePrintService';
|
import { usePrintService } from 'src/composables/usePrintService';
|
||||||
|
@ -12,12 +11,12 @@ import InvoiceOutSummary from './Card/InvoiceOutSummary.vue';
|
||||||
import { toCurrency, toDate } from 'src/filters/index';
|
import { toCurrency, toDate } from 'src/filters/index';
|
||||||
import { QBtn } from 'quasar';
|
import { QBtn } from 'quasar';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import RightMenu from 'src/components/common/RightMenu.vue';
|
|
||||||
import InvoiceOutFilter from './InvoiceOutFilter.vue';
|
import InvoiceOutFilter from './InvoiceOutFilter.vue';
|
||||||
import VnRow from 'src/components/ui/VnRow.vue';
|
import VnRow from 'src/components/ui/VnRow.vue';
|
||||||
import VnRadio from 'src/components/common/VnRadio.vue';
|
import VnRadio from 'src/components/common/VnRadio.vue';
|
||||||
import VnInput from 'src/components/common/VnInput.vue';
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
import CustomerDescriptorProxy from '../Customer/Card/CustomerDescriptorProxy.vue';
|
import CustomerDescriptorProxy from '../Customer/Card/CustomerDescriptorProxy.vue';
|
||||||
|
import VnSection from 'src/components/common/VnSection.vue';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const { viewSummary } = useSummaryDialog();
|
const { viewSummary } = useSummaryDialog();
|
||||||
|
@ -30,6 +29,8 @@ const MODEL = 'InvoiceOuts';
|
||||||
const { openReport } = usePrintService();
|
const { openReport } = usePrintService();
|
||||||
const addressOptions = ref([]);
|
const addressOptions = ref([]);
|
||||||
const selectedOption = ref('ticket');
|
const selectedOption = ref('ticket');
|
||||||
|
const dataKey = 'InvoiceOutList';
|
||||||
|
|
||||||
async function fetchClientAddress(id) {
|
async function fetchClientAddress(id) {
|
||||||
const { data } = await axios.get(
|
const { data } = await axios.get(
|
||||||
`Clients/${id}/addresses?filter[order]=isActive DESC`
|
`Clients/${id}/addresses?filter[order]=isActive DESC`
|
||||||
|
@ -37,11 +38,7 @@ async function fetchClientAddress(id) {
|
||||||
addressOptions.value = data;
|
addressOptions.value = data;
|
||||||
}
|
}
|
||||||
|
|
||||||
const exprBuilder = (_, value) => {
|
|
||||||
jtubau marked this conversation as resolved
Outdated
|
|||||||
return {
|
|
||||||
or: [{ code: value }, { description: { like: `%${value}%` } }],
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
const columns = computed(() => [
|
const columns = computed(() => [
|
||||||
{
|
{
|
||||||
|
@ -173,16 +170,20 @@ watchEffect(selectedRows);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<VnSearchbar
|
<VnSection
|
||||||
:info="t('youCanSearchByInvoiceReference')"
|
:data-key="dataKey"
|
||||||
:label="t('Search invoice')"
|
:columns="columns"
|
||||||
data-key="invoiceOutList"
|
prefix="invoiceOut"
|
||||||
/>
|
:array-data-props="{
|
||||||
<RightMenu>
|
url: 'InvoiceOuts/filter',
|
||||||
<template #right-panel>
|
order: ['id DESC'],
|
||||||
<InvoiceOutFilter data-key="invoiceOutList" />
|
exprBuilder,
|
||||||
jtubau marked this conversation as resolved
Outdated
alexm
commented
El exprBuilder en este cas no va aci, es de un VnSelect El exprBuilder en este cas no va aci, es de un VnSelect
|
|||||||
|
}"
|
||||||
|
>
|
||||||
|
<template #rightMenu>
|
||||||
|
<InvoiceOutFilter data-key="InvoiceOutList" />
|
||||||
</template>
|
</template>
|
||||||
</RightMenu>
|
<template #body>
|
||||||
<VnSubToolbar>
|
<VnSubToolbar>
|
||||||
<template #st-actions>
|
<template #st-actions>
|
||||||
<QBtn
|
<QBtn
|
||||||
|
@ -197,8 +198,7 @@ watchEffect(selectedRows);
|
||||||
</VnSubToolbar>
|
</VnSubToolbar>
|
||||||
<VnTable
|
<VnTable
|
||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
data-key="invoiceOutList"
|
:data-key="dataKey"
|
||||||
:url="`${MODEL}/filter`"
|
|
||||||
:create="{
|
:create="{
|
||||||
urlCreate: 'InvoiceOuts/createManualInvoice',
|
urlCreate: 'InvoiceOuts/createManualInvoice',
|
||||||
title: t('createManualInvoice'),
|
title: t('createManualInvoice'),
|
||||||
|
@ -207,7 +207,6 @@ watchEffect(selectedRows);
|
||||||
}"
|
}"
|
||||||
:right-search="false"
|
:right-search="false"
|
||||||
v-model:selected="selectedRows"
|
v-model:selected="selectedRows"
|
||||||
order="id DESC"
|
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
redirect="invoice-out"
|
redirect="invoice-out"
|
||||||
:table="{
|
:table="{
|
||||||
|
@ -387,6 +386,8 @@ watchEffect(selectedRows);
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</VnTable>
|
</VnTable>
|
||||||
|
</template>
|
||||||
|
</VnSection>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
invoiceOut:
|
||||||
|
search: Search invoice
|
||||||
|
searchInfo: You can search by invoice reference
|
||||||
invoiceOutModule:
|
invoiceOutModule:
|
||||||
customer: Client
|
customer: Client
|
||||||
amount: Amount
|
amount: Amount
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
Search invoice: Buscar factura emitida
|
invoiceOut:
|
||||||
You can search by invoice reference: Puedes buscar por referencia de la factura
|
search: Buscar factura emitida
|
||||||
|
searchInfo: Puedes buscar por referencia de la factura
|
||||||
invoiceOutModule:
|
invoiceOutModule:
|
||||||
customer: Cliente
|
customer: Cliente
|
||||||
amount: Importe
|
amount: Importe
|
||||||
|
|
|
@ -1,34 +1,60 @@
|
||||||
import { RouterView } from 'vue-router';
|
import { RouterView } from 'vue-router';
|
||||||
|
|
||||||
|
const invoiceOutCard = {
|
||||||
|
name: 'InvoiceOutCard',
|
||||||
|
path: ':id',
|
||||||
|
component: () => import('src/pages/InvoiceOut/Card/InvoiceOutCard.vue'),
|
||||||
|
redirect: { name: 'InvoiceOutSummary' },
|
||||||
|
meta: {
|
||||||
|
menu: [],
|
||||||
|
},
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: 'summary',
|
||||||
|
name: 'InvoiceOutSummary',
|
||||||
|
meta: {
|
||||||
|
title: 'summary',
|
||||||
|
icon: 'launch',
|
||||||
|
},
|
||||||
|
component: () => import('src/pages/InvoiceOut/Card/InvoiceOutSummary.vue'),
|
||||||
|
}
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
path: '/invoice-out',
|
|
||||||
name: 'InvoiceOut',
|
name: 'InvoiceOut',
|
||||||
|
path: '/invoice-out',
|
||||||
meta: {
|
meta: {
|
||||||
title: 'invoiceOuts',
|
title: 'invoiceOuts',
|
||||||
icon: 'vn:invoice-out',
|
icon: 'vn:invoice-out',
|
||||||
moduleName: 'InvoiceOut',
|
moduleName: 'InvoiceOut',
|
||||||
|
menu: ['InvoiceOutList', 'InvoiceOutGlobal', 'InvoiceOutNegativeBases'],
|
||||||
},
|
},
|
||||||
component: RouterView,
|
component: RouterView,
|
||||||
redirect: { name: 'InvoiceOutMain' },
|
redirect: { name: 'InvoiceOutMain' },
|
||||||
menus: {
|
children: [
|
||||||
main: ['InvoiceOutList', 'InvoiceOutGlobal', 'InvoiceOutNegativeBases'],
|
{
|
||||||
card: [],
|
name: 'InvoiceOutMain',
|
||||||
},
|
path: '',
|
||||||
|
component: () => import('src/components/common/VnModule.vue'),
|
||||||
|
redirect: { name: 'InvoiceOutIndexMain' },
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: '',
|
path: '',
|
||||||
name: 'InvoiceOutMain',
|
name: 'InvoiceOutIndexMain',
|
||||||
component: () => import('src/components/common/VnModule.vue'),
|
|
||||||
redirect: { name: 'InvoiceOutList' },
|
redirect: { name: 'InvoiceOutList' },
|
||||||
|
component: () => import('src/pages/InvoiceOut/InvoiceOutList.vue'),
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: 'list',
|
|
||||||
name: 'InvoiceOutList',
|
name: 'InvoiceOutList',
|
||||||
|
path: 'list',
|
||||||
meta: {
|
meta: {
|
||||||
title: 'list',
|
title: 'list',
|
||||||
icon: 'view_list',
|
icon: 'view_list',
|
||||||
},
|
},
|
||||||
component: () => import('src/pages/InvoiceOut/InvoiceOutList.vue'),
|
},
|
||||||
|
invoiceOutCard,
|
||||||
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'global-invoicing',
|
path: 'global-invoicing',
|
||||||
|
@ -51,22 +77,5 @@ export default {
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: 'InvoiceOutCard',
|
|
||||||
path: ':id',
|
|
||||||
component: () => import('src/pages/InvoiceOut/Card/InvoiceOutCard.vue'),
|
|
||||||
redirect: { name: 'InvoiceOutSummary' },
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
name: 'InvoiceOutSummary',
|
|
||||||
path: 'summary',
|
|
||||||
meta: {
|
|
||||||
title: 'summary',
|
|
||||||
},
|
|
||||||
component: () =>
|
|
||||||
import('src/pages/InvoiceOut/Card/InvoiceOutSummary.vue'),
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
};
|
};
|
Loading…
Reference in New Issue
No borrar, se gasta en un VnSelect