diff --git a/src/components/FormModel.vue b/src/components/FormModel.vue index 115145f37..a0f6bf479 100644 --- a/src/components/FormModel.vue +++ b/src/components/FormModel.vue @@ -100,7 +100,6 @@ const isResetting = ref(false); const hasChanges = ref(!$props.observeFormChanges); const originalData = ref({}); const formData = computed(() => state.get(modelValue)); -const formUrl = computed(() => $props.url); const defaultButtons = computed(() => ({ save: { color: 'primary', @@ -148,11 +147,14 @@ if (!$props.url) (val) => updateAndEmit('onFetch', val) ); -watch(formUrl, async () => { - originalData.value = null; - reset(); - await fetch(); -}); +watch( + () => [$props.url, $props.filter], + async () => { + originalData.value = null; + reset(); + await fetch(); + } +); onBeforeRouteLeave((to, from, next) => { if (hasChanges.value && $props.observeFormChanges) diff --git a/src/components/common/VnInputTime.vue b/src/components/common/VnInputTime.vue index a59f0e9e8..7ee93de19 100644 --- a/src/components/common/VnInputTime.vue +++ b/src/components/common/VnInputTime.vue @@ -50,7 +50,7 @@ const formattedTime = computed({ } if (!props.timeOnly) { const [hh, mm] = time.split(':'); - const date = model.value ?? Date.vnNew(); + const date = new Date(model.value ? model.value : null); date.setHours(hh, mm, 0); time = date?.toISOString(); } @@ -62,7 +62,7 @@ const formattedTime = computed({ function dateToTime(newDate) { return date.formatDate(new Date(newDate), dateFormat); } -const timeField = ref(); + watch( () => model.value, (val) => (formattedTime.value = val), @@ -153,4 +153,3 @@ watch( es: Open time: Abrir tiempo -, nextTick diff --git a/src/components/ui/VnSms.vue b/src/components/ui/VnSms.vue index ceb24b2bb..81058a6cb 100644 --- a/src/components/ui/VnSms.vue +++ b/src/components/ui/VnSms.vue @@ -1,5 +1,5 @@ diff --git a/src/pages/Customer/Card/CustomerLog.vue b/src/pages/Customer/Card/CustomerLog.vue index 4f0ee2de7..cdf1394b1 100644 --- a/src/pages/Customer/Card/CustomerLog.vue +++ b/src/pages/Customer/Card/CustomerLog.vue @@ -1,262 +1,6 @@ - - (clientLogsOptions = data)" - auto-load - url="ClientLogs" - ref="clientLogs" - /> - (clientLogsEditorsOptions = data)" - auto-load - :url="urlClientLogsEditors" - /> - (clientLogsModelsOptions = data)" - auto-load - :url="urlClientLogsModels" - /> - - - {{ t('globals.noResults') }} - - - - - - - - - {{ t('Search by id or concept') }} - - - - - - - - - - - - - - - - - - - - - - {{ t('Search by changes') }} - - - - - - - - - - - - - - - - - - - - - - - - - - - {{ t('Quit filter') }} - - + - - -es: - Search: Buscar - Search by id or concept: xxx - Entity: Entidad - All: Todo - User: Usuario - System: Sistema - Changes: Cambios - Search by changes: xxx - Creates: Crea - Edits: Modifica - Deletes: Elimina - Accesses: Accede - Date: Fecha - To: Hasta - Quit filter: Quitar filtro - diff --git a/src/pages/Customer/Card/CustomerNotes.vue b/src/pages/Customer/Card/CustomerNotes.vue index f7462d67a..a9121f7f5 100644 --- a/src/pages/Customer/Card/CustomerNotes.vue +++ b/src/pages/Customer/Card/CustomerNotes.vue @@ -1,15 +1,18 @@ diff --git a/src/pages/Customer/Card/CustomerRecoveries.vue b/src/pages/Customer/Card/CustomerRecoveries.vue index 289b4bc0e..8d3d05702 100644 --- a/src/pages/Customer/Card/CustomerRecoveries.vue +++ b/src/pages/Customer/Card/CustomerRecoveries.vue @@ -1,146 +1,107 @@ - (rows = data)" - auto-load + - - - - - - - - - {{ props.value }} - - - - - - - - - - - - {{ t('New recoverie') }} - - - - es: - Since: Desde - To: Hasta - Amount: Importe Period: Periodo - New recoverie: Nuevo recobro + New recovery: Nuevo recobro + Finish that recovery period: Terminar recobro diff --git a/src/pages/Customer/Card/CustomerSms.vue b/src/pages/Customer/Card/CustomerSms.vue index a567f6b47..0ad1f8168 100644 --- a/src/pages/Customer/Card/CustomerSms.vue +++ b/src/pages/Customer/Card/CustomerSms.vue @@ -1,17 +1,16 @@ - - - + diff --git a/src/pages/Customer/Card/CustomerWebAccess.vue b/src/pages/Customer/Card/CustomerWebAccess.vue index 33659dd77..8d025a365 100644 --- a/src/pages/Customer/Card/CustomerWebAccess.vue +++ b/src/pages/Customer/Card/CustomerWebAccess.vue @@ -2,164 +2,81 @@ import { computed, ref } from 'vue'; import { useI18n } from 'vue-i18n'; import { useRoute } from 'vue-router'; - import axios from 'axios'; import { useQuasar } from 'quasar'; -import { useValidator } from 'src/composables/useValidator'; -import useNotify from 'src/composables/useNotify'; -import { useStateStore } from 'stores/useStateStore'; - -import FetchData from 'components/FetchData.vue'; import VnInput from 'src/components/common/VnInput.vue'; import CustomerChangePassword from 'src/pages/Customer/components/CustomerChangePassword.vue'; +import FormModel from 'components/FormModel.vue'; -const { notify } = useNotify(); const { t } = useI18n(); -const { validate } = useValidator(); const quasar = useQuasar(); const route = useRoute(); -const stateStore = useStateStore(); - -const active = ref(false); const canChangePassword = ref(0); -const email = ref(null); -const isLoading = ref(false); -const name = ref(null); -const usersPreviewRef = ref(null); -const user = ref([]); -const dataChanges = computed(() => { - return ( - user.value.active !== active.value || - user.value.email !== email.value || - user.value.name !== name.value - ); +const filter = computed(() => { + return { + fields: ['active', 'email', 'name'], + where: { id: route.params.id }, + }; }); -const filter = { where: { id: `${route.params.id}` } }; - const showChangePasswordDialog = () => { quasar.dialog({ component: CustomerChangePassword, componentProps: { id: route.params.id, - promise: usersPreviewRef.value.fetch(), }, }); }; -const setInitialData = () => { - if (user.value.length) { - active.value = user.value[0].active; - email.value = user.value[0].email; - name.value = user.value[0].name; - } -}; - -const onSubmit = async () => { - isLoading.value = true; - - const payload = { - active: active.value, - email: email.value, - name: name.value, - }; - try { - await axios.patch(`Clients/${route.params.id}/updateUser`, payload); - notify('globals.dataSaved', 'positive'); - if (usersPreviewRef.value) usersPreviewRef.value.fetch(); - } catch (error) { - notify('errors.create', 'negative'); - } finally { - isLoading.value = false; - } -}; +async function hasCustomerRole() { + const { data } = await axios(`Clients/${route.params.id}/hasCustomerRole`); + canChangePassword.value = data; +} - { - user = data; - setInitialData(); + model="webAccess" + :mapper=" + ({ active, name, email }) => { + return { + active, + name, + email, + }; } " + @on-fetch="hasCustomerRole()" auto-load - ref="usersPreviewRef" - url="VnUsers/preview" - /> - (canChangePassword = data)" - auto-load - /> - - - - + + + + + + - - - - - - - - - - - - - - - - {{ - t( - 'This email is used for user to regain access their account' - ) - }} - - - - - - - - + + diff --git a/src/pages/InvoiceOut/Card/InvoiceOutDescriptor.vue b/src/pages/InvoiceOut/Card/InvoiceOutDescriptor.vue index bd52e5b02..5e4be407e 100644 --- a/src/pages/InvoiceOut/Card/InvoiceOutDescriptor.vue +++ b/src/pages/InvoiceOut/Card/InvoiceOutDescriptor.vue @@ -100,7 +100,7 @@ const setData = (entity) => (data.value = useCardDescription(entity.ref, entity. color="primary" :to="{ name: 'TicketList', - query: { q: ticketFilter(entity) }, + query: { table: ticketFilter(entity) }, }" > {{ t('invoiceOut.card.ticketList') }} diff --git a/src/pages/InvoiceOut/InvoiceOutList.vue b/src/pages/InvoiceOut/InvoiceOutList.vue index 5a611d388..7e4622560 100644 --- a/src/pages/InvoiceOut/InvoiceOutList.vue +++ b/src/pages/InvoiceOut/InvoiceOutList.vue @@ -13,6 +13,7 @@ import { toCurrency, toDate } from 'src/filters/index'; import { useStateStore } from 'stores/useStateStore'; import { QBtn } from 'quasar'; import { watchEffect } from 'vue'; +import CustomerDescriptorProxy from '../Customer/Card/CustomerDescriptorProxy.vue'; const { t } = useI18n(); const stateStore = useStateStore(); @@ -214,6 +215,12 @@ watchEffect(selectedRows); selection: 'multiple', }" > + + + {{ row.clientSocialName }} + + + { :is-editable="false" :use-model="true" > + + + {{ row.clientId }} + + + + + + {{ row.ticketFk }} + + + + + + {{ row.workerName }} + + + diff --git a/src/pages/Route/Card/RouteFilter.vue b/src/pages/Route/Card/RouteFilter.vue index f0215370f..24b155389 100644 --- a/src/pages/Route/Card/RouteFilter.vue +++ b/src/pages/Route/Card/RouteFilter.vue @@ -1,7 +1,5 @@ - (workerList = data)" - auto-load - /> - (agencyList = data)" - auto-load - /> - (vehicleList = data)" - auto-load - /> - (warehouseList = data)" auto-load /> - + @@ -91,19 +57,17 @@ const warehouseList = ref([]); - + @@ -147,19 +111,17 @@ const warehouseList = ref([]); - + @@ -170,19 +132,16 @@ const warehouseList = ref([]); - + diff --git a/src/pages/Route/Card/RouteSearchbar.vue b/src/pages/Route/Card/RouteSearchbar.vue index 0e5c1643d..48ad09151 100644 --- a/src/pages/Route/Card/RouteSearchbar.vue +++ b/src/pages/Route/Card/RouteSearchbar.vue @@ -9,10 +9,9 @@ const { t } = useI18n(); data-key="RouteList" :label="t('Search route')" :info="t('You can search by route reference')" + url="Routes/filter" /> - - es: Search route: Buscar rutas diff --git a/src/pages/Route/RouteList.vue b/src/pages/Route/RouteList.vue index cb54b360d..a978d8fda 100644 --- a/src/pages/Route/RouteList.vue +++ b/src/pages/Route/RouteList.vue @@ -11,6 +11,8 @@ import axios from 'axios'; import RouteSearchbar from 'pages/Route/Card/RouteSearchbar.vue'; import RouteListTicketsDialog from 'pages/Route/Card/RouteListTicketsDialog.vue'; import RouteSummary from 'pages/Route/Card/RouteSummary.vue'; +import RightMenu from 'src/components/common/RightMenu.vue'; +import RouteFilter from 'pages/Route/Card/RouteFilter.vue'; import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue'; import VnInputDate from 'components/common/VnInputDate.vue'; @@ -271,13 +273,18 @@ const openTicketsDialog = (id) => { + + + + + {{ dashIfEmpty(ticket.refFk) }} diff --git a/src/router/modules/customer.js b/src/router/modules/customer.js index 6d697967b..684b83b0f 100644 --- a/src/router/modules/customer.js +++ b/src/router/modules/customer.js @@ -226,31 +226,13 @@ export default { }, { path: 'recoveries', - name: 'RecoveriesCard', - redirect: { name: 'CustomerRecoveries' }, - children: [ - { - path: '', - name: 'CustomerRecoveries', - meta: { - title: 'recoveries', - icon: 'vn:recovery', - }, - component: () => - import('src/pages/Customer/Card/CustomerRecoveries.vue'), - }, - { - path: 'create', - name: 'CustomerRecoverieCreate', - meta: { - title: 'recoverie-create', - }, - component: () => - import( - 'src/pages/Customer/components/CustomerRecoverieCreate.vue' - ), - }, - ], + name: 'CustomerRecoveries', + meta: { + title: 'recoveries', + icon: 'vn:recovery', + }, + component: () => + import('src/pages/Customer/Card/CustomerRecoveries.vue'), }, { path: 'web-access',