diff --git a/src/components/LeftMenuItem.vue b/src/components/LeftMenuItem.vue index 9fe66e278..2a6de5e2e 100644 --- a/src/components/LeftMenuItem.vue +++ b/src/components/LeftMenuItem.vue @@ -36,7 +36,7 @@ const itemComputed = computed(() => { {{ t(itemComputed.title) }} - {{ 'Ctrl + Alt + ' + item.keyBinding.toUpperCase() }} + {{ 'Ctrl + Alt + ' + item?.keyBinding?.toUpperCase() }} diff --git a/src/components/VnTable/VnTable.vue b/src/components/VnTable/VnTable.vue index 4ba7d0227..964dafabe 100644 --- a/src/components/VnTable/VnTable.vue +++ b/src/components/VnTable/VnTable.vue @@ -363,7 +363,7 @@ function handleOnDataSaved(_, res) { emit('onFetch', ...args)" @@ -638,7 +638,7 @@ function handleOnDataSaved(_, res) { - + @@ -650,7 +650,7 @@ function handleOnDataSaved(_, res) { shortcut="+" /> - {{ createForm.title }} + {{ createForm?.title }} diff --git a/src/pages/Customer/Card/CustomerBillingData.vue b/src/pages/Customer/Card/CustomerBillingData.vue index 290bde909..e375846c9 100644 --- a/src/pages/Customer/Card/CustomerBillingData.vue +++ b/src/pages/Customer/Card/CustomerBillingData.vue @@ -31,8 +31,8 @@ const getBankEntities = (data, formData) => { - (payMethods = data)" auto-load url="PayMethods" /> - (payMethods = data)" auto-load url="PayMethods" /> + (bankEntitiesOptions = data)" :filter="filter" diff --git a/src/pages/Customer/Card/CustomerGreuges.vue b/src/pages/Customer/Card/CustomerGreuges.vue index 8a83d49db..1c78392e7 100644 --- a/src/pages/Customer/Card/CustomerGreuges.vue +++ b/src/pages/Customer/Card/CustomerGreuges.vue @@ -47,7 +47,6 @@ const columns = computed(() => [ }, { align: 'left', - // name: 'userFk', label: t('Created by'), component: 'userLink', attrs: ({ row }) => { diff --git a/src/pages/Customer/Card/CustomerSamples.vue b/src/pages/Customer/Card/CustomerSamples.vue index e28e290f4..49697aab7 100644 --- a/src/pages/Customer/Card/CustomerSamples.vue +++ b/src/pages/Customer/Card/CustomerSamples.vue @@ -3,18 +3,18 @@ import { ref, computed } from 'vue'; import { useI18n } from 'vue-i18n'; import { useRoute, useRouter } from 'vue-router'; -import { QBtn } from 'quasar'; +import { QBtn, useQuasar } from 'quasar'; -import FetchData from 'components/FetchData.vue'; import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue'; import { toDateTimeFormat } from 'src/filters/date'; +import VnTable from 'src/components/VnTable/VnTable.vue'; +import { dashIfEmpty } from 'src/filters'; +import CustomerSamplesCreate from '../components/CustomerSamplesCreate.vue'; const { t } = useI18n(); const route = useRoute(); const router = useRouter(); -const rows = ref([]); - const filter = { include: [ { relation: 'type', scope: { fields: ['code', 'description'] } }, @@ -26,91 +26,67 @@ const filter = { limit: 20, }; -const basicSpan = { - component: 'span', - props: () => {}, - event: () => {}, -}; -const tableColumnComponents = { - sent: basicSpan, - description: basicSpan, - worker: { - component: 'span', - props: () => ({ class: 'link' }), - event: () => {}, - }, - company: basicSpan, -}; - const columns = computed(() => [ { align: 'left', - field: 'created', + name: 'created', label: t('Sent'), - name: 'sent', - format: (value) => toDateTimeFormat(value), + format: ({ created }) => toDateTimeFormat(created), }, { align: 'left', - field: (value) => value.type.description, + format: (row) => row.type.description, label: t('Description'), name: 'description', }, { align: 'left', - field: (value) => value.user.name, label: t('Worker'), name: 'worker', }, { align: 'left', - field: (value) => value.company?.code, + format: ({ company }) => company?.code ?? dashIfEmpty(company), label: t('Company'), name: 'company', }, ]); +const quasar = useQuasar(); const toCustomerSamplesCreate = () => { - router.push({ name: 'CustomerSamplesCreate' }); + quasar + .dialog({ + component: CustomerSamplesCreate, + }) + .onOk(() => tableRef.value.reload()); }; +const tableRef = ref(); - (rows = data)" + - - - - - - - {{ props.value }} - - - - + + + {{ row.user?.name }} + + {{ dashIfEmpty(row.user) }} - + diff --git a/src/pages/Customer/components/CustomerAddressCreate.vue b/src/pages/Customer/components/CustomerAddressCreate.vue index 30e4b21d0..f93406185 100644 --- a/src/pages/Customer/components/CustomerAddressCreate.vue +++ b/src/pages/Customer/components/CustomerAddressCreate.vue @@ -57,12 +57,12 @@ function handleLocation(data, location) { - (agencyModes = data)" auto-load url="AgencyModes/isActive" /> - (incoterms = data)" auto-load url="Incoterms" /> + (incoterms = data)" auto-load url="Incoterms" /> - (agencyModes = data)" auto-load url="AgencyModes/isActive" /> - (incoterms = data)" auto-load url="Incoterms" /> - (incoterms = data)" auto-load url="Incoterms" /> + (customsAgents = data)" auto-load url="CustomsAgents" /> - + { - (client = data)" auto-load :url="`Clients/${route.params.id}/getCard`" /> - (findOne = data)" auto-load url="DmsTypes/findOne" /> - (allowedContentTypes = data)" auto-load url="DmsContainers/allowedContentTypes" /> - (optionsCompanies = data)" auto-load url="Companies" /> - (optionsWarehouses = data)" auto-load url="Warehouses" /> - (optionsDmsTypes = data)" auto-load diff --git a/src/pages/Customer/components/CustomerFileManagementEdit.vue b/src/pages/Customer/components/CustomerFileManagementEdit.vue index 80eaa44f9..107f41330 100644 --- a/src/pages/Customer/components/CustomerFileManagementEdit.vue +++ b/src/pages/Customer/components/CustomerFileManagementEdit.vue @@ -69,25 +69,25 @@ const toCustomerFileManagement = () => { - - + (allowedContentTypes = data)" auto-load url="DmsContainers/allowedContentTypes" /> - (optionsCompanies = data)" auto-load url="Companies" /> - (optionsWarehouses = data)" auto-load url="Warehouses" /> - (optionsDmsTypes = data)" auto-load diff --git a/src/pages/Customer/components/CustomerSamplesCreate.vue b/src/pages/Customer/components/CustomerSamplesCreate.vue index 79f4fe449..c7772ab4e 100644 --- a/src/pages/Customer/components/CustomerSamplesCreate.vue +++ b/src/pages/Customer/components/CustomerSamplesCreate.vue @@ -5,7 +5,7 @@ import { useRoute, useRouter } from 'vue-router'; import axios from 'axios'; import { usePrintService } from 'composables/usePrintService'; -import { useQuasar } from 'quasar'; +import { useDialogPluginComponent, useQuasar } from 'quasar'; import { useState } from 'src/composables/useState'; import { useValidator } from 'src/composables/useValidator'; @@ -18,6 +18,10 @@ import VnInput from 'src/components/common/VnInput.vue'; import VnInputDate from 'src/components/common/VnInputDate.vue'; import CustomerSamplesPreview from 'src/pages/Customer/components/CustomerSamplesPreview.vue'; import { useStateStore } from 'stores/useStateStore'; +import FormPopup from 'src/components/FormPopup.vue'; +defineEmits(['confirm', ...useDialogPluginComponent.emits]); + +const { dialogRef, onDialogOK } = useDialogPluginComponent(); const { notify } = useNotify(); const { t } = useI18n(); @@ -181,6 +185,7 @@ const onDataSaved = async () => { const samplesData = await getSamples(); const path = `${samplesData.model}/${route.params.id}/${samplesData.code}-email`; await sendEmail(path, params); + onDialogOK(params); } catch (error) { notify('errors.create', 'negative'); } @@ -197,73 +202,54 @@ const toCustomerSamples = () => { - - - (optionsCompanies = data)" auto-load url="Companies" /> - (optionsSamplesVisible = data)" auto-load url="Samples/visible" /> - - - - - - - - - - - - + + + + + { required="true" v-model="initialData.from" /> - - - - - + + + es: + New sample: Crear plantilla Sample: Plantilla Recipient: Destinatario Reply to: Responder a diff --git a/src/pages/Customer/components/CustomerSummaryTable.vue b/src/pages/Customer/components/CustomerSummaryTable.vue index e2fb61322..87e4cffa7 100644 --- a/src/pages/Customer/components/CustomerSummaryTable.vue +++ b/src/pages/Customer/components/CustomerSummaryTable.vue @@ -150,6 +150,7 @@ const setShippedColor = (date) => { order="shipped DESC, id" :disable-option="{ card: true, table: true }" limit="5" + class="full-width" > diff --git a/src/pages/Dashboard/DashboardMain.vue b/src/pages/Dashboard/DashboardMain.vue index a339120e2..56054156a 100644 --- a/src/pages/Dashboard/DashboardMain.vue +++ b/src/pages/Dashboard/DashboardMain.vue @@ -60,7 +60,7 @@ const pinnedModules = computed(() => navigation.getPinnedModules()); {{ 'Ctrl + Alt + ' + - item.keyBinding.toUpperCase() + item?.keyBinding?.toUpperCase() }} diff --git a/src/pages/Department/Card/DepartmentBasicData.vue b/src/pages/Department/Card/DepartmentBasicData.vue index 4573f7b66..98abfd6b9 100644 --- a/src/pages/Department/Card/DepartmentBasicData.vue +++ b/src/pages/Department/Card/DepartmentBasicData.vue @@ -16,12 +16,12 @@ const workersOptions = ref([]); const clientsOptions = ref([]); - (workersOptions = data)" auto-load /> - (clientsOptions = data)" auto-load /> + (clientsOptions = data)" auto-load />