Compare commits

...

50 Commits

Author SHA1 Message Date
Carlos Satorres 95291d4d4e Merge branch 'dev' into 7310-warningTravelTermographs
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-11-15 11:06:03 +00:00
Alex Moreno e8f0bc9965 Merge pull request 'feat(VnSelect): refs #7136 add scroll' (!890) from 7136-vnSelect_paginate_simplify_2 into dev
gitea/salix-front/pipeline/head This commit looks good Details
Reviewed-on: #890
Reviewed-by: Javier Segarra <jsegarra@verdnatura.es>
2024-11-15 10:24:46 +00:00
Alex Moreno 0e93766670 Merge branch 'dev' into 7136-vnSelect_paginate_simplify_2
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-11-15 10:23:55 +00:00
Guillermo Bonet 3c77076718 Merge pull request 'refactor: refs #7950 Created cmr model' (!911) from 7950-cmrModelUnify into dev
gitea/salix-front/pipeline/head This commit looks good Details
Reviewed-on: #911
Reviewed-by: Javi Gallego <jgallego@verdnatura.es>
2024-11-15 06:04:51 +00:00
Guillermo Bonet c607fc5f61 Merge branch 'dev' into 7950-cmrModelUnify
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-11-15 06:03:30 +00:00
Jorge Penadés 7626c777ed Merge pull request 'feat: refs #7874 improve vn-notes ui' (!938) from 7874-improveVnNotesUi into dev
gitea/salix-front/pipeline/head This commit looks good Details
Reviewed-on: #938
Reviewed-by: Javi Gallego <jgallego@verdnatura.es>
2024-11-14 15:21:24 +00:00
Javier Segarra 39e8f73d1b Merge branch 'dev' of https: refs #7136//gitea.verdnatura.es/verdnatura/salix-front into 7136-vnSelect_paginate_simplify_2
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-11-14 16:05:08 +01:00
Jorge Penadés 8e0b098756 fix: refs #7874 add title
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-11-14 16:01:09 +01:00
Jorge Penadés 59b40fed45 feat: refs #7874 improve vn-notes ui
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-11-14 15:57:01 +01:00
Jorge Penadés 8d070edf8d Merge pull request 'feat: refs #6839 normalize search' (!936) from 6839-normalizeSearch into dev
gitea/salix-front/pipeline/head This commit looks good Details
Reviewed-on: #936
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
2024-11-14 14:06:03 +00:00
Jorge Penadés 7224860c5c feat: refs #6839 normalize search
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-11-14 13:51:39 +01:00
Javier Segarra 68994db6ff Merge pull request 'Change layout CustomerDescriptor Actions' (!931) from warmFix_customerDescriptorActions into dev
gitea/salix-front/pipeline/head This commit looks good Details
Reviewed-on: #931
Reviewed-by: Jorge Penadés <jorgep@verdnatura.es>
2024-11-14 12:23:33 +00:00
Javier Segarra 61cd8c49c6 Merge branch 'dev' into warmFix_customerDescriptorActions
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-11-14 12:22:33 +00:00
Javier Segarra 291e97e540 feat: #6943 use openURL quasar
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-11-14 12:48:33 +01:00
Alex Moreno 73c6dcfdd1 Merge branch 'test' of https://gitea.verdnatura.es/verdnatura/salix-front into dev
gitea/salix-front/pipeline/head This commit looks good Details
2024-11-14 12:20:17 +01:00
Alex Moreno c65f15d0f0 fix(Zone): if route is null
gitea/salix-front/pipeline/head This commit looks good Details
2024-11-14 12:18:39 +01:00
Carlos Satorres 27accd0e8b Merge pull request 'fix: refs #7306 clean warning' (!839) from 7306-warningCustomerUnpaid into dev
gitea/salix-front/pipeline/head This commit looks good Details
Reviewed-on: #839
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
2024-11-14 11:09:25 +00:00
Carlos Satorres 857136a866 Merge branch 'dev' into 7306-warningCustomerUnpaid
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-11-14 11:08:37 +00:00
Javier Segarra ecf131ba78 feat: move buttons to DescriptorMenu
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-11-14 12:06:12 +01:00
Jorge Penadés 84802cf267 Merge pull request 'refactor: refs #6818 change channel source' (!932) from 6818-useDefaultChannel into dev
gitea/salix-front/pipeline/head This commit looks good Details
Reviewed-on: #932
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
2024-11-14 10:31:15 +00:00
Jorge Penadés 877497e8ae Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 6818-useDefaultChannel
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-11-14 11:29:58 +01:00
Alex Moreno e0e03526af Merge pull request 'warmFix: Revert previous commit e57a253c6f649382da187d1129449d265fb26d3b' (!930) from revert_warning_inject into dev
gitea/salix-front/pipeline/head This commit looks good Details
Reviewed-on: #930
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
2024-11-14 10:28:37 +00:00
Jorge Penadés c4a4f7fcd6 refactor: refs #6818 change channel source
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-11-14 11:20:16 +01:00
Carlos Satorres 5b444ef0f5 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 7306-warningCustomerUnpaid
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-11-14 10:54:22 +01:00
Javier Segarra 2bcd7061cb revert e57a253c6f
gitea/salix-front/pipeline/pr-dev This commit looks good Details
revert Merge pull request '#7308 Remove console warnings' (!928) from 7308-warning_inject into dev

Reviewed-on: #928
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
2024-11-14 09:50:00 +00:00
Javier Segarra e57a253c6f Merge pull request '#7308 Remove console warnings' (!928) from 7308-warning_inject into dev
gitea/salix-front/pipeline/head This commit looks good Details
gitea/salix-front/pipeline/pr-dev This commit looks good Details
Reviewed-on: #928
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
2024-11-14 08:09:09 +00:00
Javier Segarra b0bb09e9a6 perf: refs #7308 #7308 remove comments
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-11-14 09:03:18 +01:00
Javier Segarra 0fe5f6d54d Merge branch 'dev' into 7308-warning_inject
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-11-14 07:20:28 +00:00
Javier Segarra 590d495dbd test: refs #7308 #7308 axios.spec.js
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-11-14 08:19:41 +01:00
Javier Segarra ef415d080a feat: refs #7308 #7308 remove warnings related to useSession 2024-11-14 08:19:19 +01:00
Jon Elias eecf8beb7a Merge pull request 'Hotfix: allow decimal numbers when creating a purchase request' (!927) from Hotfix-CreateRequest into master
gitea/salix-front/pipeline/head This commit looks good Details
Reviewed-on: #927
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
2024-11-13 13:18:48 +00:00
Jon Elias bcb777d4bc Merge branch 'master' into Hotfix-CreateRequest
gitea/salix-front/pipeline/pr-master This commit looks good Details
2024-11-13 13:18:00 +00:00
Javier Segarra 9afbcd5cea Merge pull request 'fix: customer last tickets' (!926) from fixCustomerSumarryLastTickets into master
gitea/salix-front/pipeline/head This commit looks good Details
Reviewed-on: #926
Reviewed-by: Javier Segarra <jsegarra@verdnatura.es>
2024-11-13 12:56:24 +00:00
Pablo Natek ddfea42c62 fix: add click stop on descriptorProxis
gitea/salix-front/pipeline/pr-master This commit looks good Details
2024-11-13 13:51:37 +01:00
Jon Elias 75c33dabf1 Merge branch 'master' into Hotfix-CreateRequest
gitea/salix-front/pipeline/pr-master This commit looks good Details
2024-11-13 12:41:40 +00:00
Jon Elias 244c23be1d fix: allow decimal numbers when creating a purchase request
gitea/salix-front/pipeline/pr-master This commit looks good Details
2024-11-13 13:40:19 +01:00
Pablo Natek 1c5a02fe52 fix: customer last tickets
gitea/salix-front/pipeline/pr-master This commit looks good Details
2024-11-13 13:17:15 +01:00
Pablo Natek 8d296daf1e Merge pull request 'fix: refs #7404 some filter issues' (!921) from 7404-fixFilterIsssues into master
gitea/salix-front/pipeline/head This commit looks good Details
Reviewed-on: #921
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
2024-11-13 11:25:31 +00:00
Pablo Natek bccfb161e6 Merge branch 'master' into 7404-fixFilterIsssues
gitea/salix-front/pipeline/pr-master This commit looks good Details
2024-11-13 11:24:25 +00:00
Jorge Penadés 76187f00a1 Merge pull request 'feat: add city name' (!925) from 7354-hotfix-showCity into master
gitea/salix-front/pipeline/head This commit looks good Details
Reviewed-on: #925
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
2024-11-13 11:23:17 +00:00
Jorge Penadés b68868e103 feat: add city name
gitea/salix-front/pipeline/pr-master This commit looks good Details
2024-11-13 12:11:15 +01:00
Pablo Natek f93532d5b7 Merge pull request 'hotfixZoneFilter' (!922) from hotfixZoneFilter into master
gitea/salix-front/pipeline/head This commit looks good Details
Reviewed-on: #922
Reviewed-by: Javier Segarra <jsegarra@verdnatura.es>
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
2024-11-13 09:22:15 +00:00
Pablo Natek 178753ddcc fix: add scope fields on filter
gitea/salix-front/pipeline/pr-master This commit looks good Details
2024-11-13 10:11:14 +01:00
Pablo Natek 8eb76cd0fc fix: url name
gitea/salix-front/pipeline/pr-master This commit looks good Details
2024-11-13 10:00:04 +01:00
Pablo Natek 81927c5af5 fix: zoneFilter 2024-11-13 09:58:41 +01:00
Pablo Natek 5c59ae8217 fix: refs #7404 some filter issues
gitea/salix-front/pipeline/pr-master This commit looks good Details
2024-11-13 09:12:51 +01:00
Guillermo Bonet 8db3ab4d47 Merge branch 'dev' into 7950-cmrModelUnify
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-11-13 06:13:23 +00:00
Guillermo Bonet 40ecd6e358 refactor: refs #7950 Created cmr model
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-11-12 08:28:02 +01:00
Alex Moreno bf4bee0f95 feat(VnSelect): refs #7136 add scroll
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-10-29 14:07:34 +01:00
Carlos Satorres 16ef5d3722 fix: refs #7306 clean warning
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-10-17 08:30:45 +02:00
20 changed files with 146 additions and 100 deletions

View File

@ -34,18 +34,26 @@ const search = ref(null);
const filteredItems = computed(() => {
if (!search.value) return items.value;
const normalizedSearch = normalize(search.value);
return items.value.filter((item) => {
const locale = t(item.title).toLowerCase();
return locale.includes(search.value.toLowerCase());
const locale = normalize(t(item.title));
return locale.includes(normalizedSearch);
});
});
const filteredPinnedModules = computed(() => {
if (!search.value) return pinnedModules.value;
const normalizedSearch = search.value
.normalize('NFD')
.replace(/[\u0300-\u036f]/g, '')
.toLowerCase();
const map = new Map();
for (const [key, pinnedModule] of pinnedModules.value) {
const locale = t(pinnedModule.title).toLowerCase();
if (locale.includes(search.value.toLowerCase())) map.set(key, pinnedModule);
const locale = t(pinnedModule.title)
.normalize('NFD')
.replace(/[\u0300-\u036f]/g, '')
.toLowerCase();
if (locale.includes(normalizedSearch)) map.set(key, pinnedModule);
}
return map;
});
@ -147,6 +155,13 @@ async function togglePinned(item, event) {
const handleItemExpansion = (itemName) => {
expansionItemElements[itemName].scrollToLastElement();
};
function normalize(text) {
return text
.normalize('NFD')
.replace(/[\u0300-\u036f]/g, '')
.toLowerCase();
}
</script>
<template>

View File

@ -1,7 +1,7 @@
<script setup>
import { ref, toRefs, computed, watch, onMounted, useAttrs } from 'vue';
import { useI18n } from 'vue-i18n';
import FetchData from 'src/components/FetchData.vue';
import { useArrayData } from 'src/composables/useArrayData';
import { useRequired } from 'src/composables/useRequired';
import dataByOrder from 'src/utils/dataByOrder';
@ -90,6 +90,10 @@ const $props = defineProps({
type: Boolean,
default: false,
},
dataKey: {
type: String,
default: null,
},
});
const mixinRules = [requiredFieldRule, ...($attrs.rules ?? [])];
@ -98,14 +102,14 @@ const { optionLabel, optionValue, optionFilter, optionFilterValue, options, mode
const myOptions = ref([]);
const myOptionsOriginal = ref([]);
const vnSelectRef = ref();
const dataRef = ref();
const lastVal = ref();
const noOneText = t('globals.noOne');
const noOneOpt = ref({
[optionValue.value]: false,
[optionLabel.value]: noOneText,
});
const isLoading = ref(false);
const useURL = computed(() => $props.url);
const value = computed({
get() {
return $props.modelValue;
@ -129,11 +133,18 @@ watch(modelValue, async (newValue) => {
onMounted(() => {
setOptions(options.value);
if ($props.url && $props.modelValue && !findKeyInOptions())
if (useURL.value && $props.modelValue && !findKeyInOptions())
fetchFilter($props.modelValue);
if ($props.focusOnMount) setTimeout(() => vnSelectRef.value.showPopup(), 300);
});
defineExpose({ opts: myOptions });
const arrayDataKey =
$props.dataKey ?? ($props.url?.length > 0 ? $props.url : $attrs.name ?? $attrs.label);
const arrayData = useArrayData(arrayDataKey, { url: $props.url, searchUrl: false });
function findKeyInOptions() {
if (!$props.options) return;
return filter($props.modelValue, $props.options)?.length;
@ -168,7 +179,7 @@ function filter(val, options) {
}
async function fetchFilter(val) {
if (!$props.url || !dataRef.value) return;
if (!$props.url) return;
const { fields, include, sortBy, limit } = $props;
const key =
@ -190,8 +201,8 @@ async function fetchFilter(val) {
const fetchOptions = { where, include, limit };
if (fields) fetchOptions.fields = fields;
if (sortBy) fetchOptions.order = sortBy;
return dataRef.value.fetch(fetchOptions);
arrayData.reset(['skip', 'filter.skip', 'page']);
return (await arrayData.applyFilter({ filter: fetchOptions }))?.data;
}
async function filterHandler(val, update) {
@ -231,20 +242,23 @@ function nullishToTrue(value) {
const getVal = (val) => ($props.useLike ? { like: `%${val}%` } : val);
defineExpose({ opts: myOptions });
async function onScroll({ to, direction, from, index }) {
const lastIndex = myOptions.value.length - 1;
if (from === 0 && index === 0) return;
if (!useURL.value && !$props.fetchRef) return;
if (direction === 'decrease') return;
if (to === lastIndex && arrayData.store.hasMoreData && !isLoading.value) {
isLoading.value = true;
await arrayData.loadMore();
setOptions(arrayData.store.data);
vnSelectRef.value.scrollTo(lastIndex);
isLoading.value = false;
}
}
</script>
<template>
<FetchData
ref="dataRef"
:url="$props.url"
@on-fetch="(data) => setOptions(data)"
:where="where || { [optionValue]: value }"
:limit="limit"
:sort-by="sortBy"
:fields="fields"
:params="params"
/>
<QSelect
v-model="value"
:options="myOptions"
@ -263,6 +277,9 @@ defineExpose({ opts: myOptions });
:rules="mixinRules"
virtual-scroll-slice-size="options.length"
hide-bottom-space
:input-debounce="useURL ? '300' : '0'"
:loading="isLoading"
@virtual-scroll="onScroll"
>
<template v-if="isClearable" #append>
<QIcon

View File

@ -17,19 +17,12 @@ const config = reactive({
const type = Object.keys(config).find((key) => key in useAttrs()) || 'sip';
onBeforeMount(async () => {
let url;
let { channel } = config[type];
if (type === 'say-simple') {
url = (await axios.get('SaySimpleConfigs/findOne')).data.url;
if (!channel)
channel = (
await axios.get('SaySimpleCountries/findOne', {
params: {
filter: { fields: ['channel'], where: { countryFk: 0 } },
},
})
).data?.channel;
const { url, defaultChannel } = (await axios.get('SaySimpleConfigs/findOne'))
.data;
if (!channel) channel = defaultChannel;
config[
type

View File

@ -65,13 +65,9 @@ onBeforeRouteLeave((to, from, next) => {
auto-load
@on-fetch="(data) => (observationTypes = data)"
/>
<QCard class="q-pa-xs q-mb-xl full-width" v-if="$props.addNote">
<QCard class="q-pa-xs q-mb-lg full-width" v-if="$props.addNote">
<QCardSection horizontal>
<VnAvatar :worker-id="currentUser.id" size="md" />
<div class="full-width row justify-between q-pa-xs">
<VnUserLink :name="t('New note')" :worker-id="currentUser.id" />
{{ t('globals.now') }}
</div>
{{ t('New note') }}
</QCardSection>
<QCardSection class="q-px-xs q-my-none q-py-none">
<VnRow class="full-width">
@ -144,7 +140,7 @@ onBeforeRouteLeave((to, from, next) => {
<div class="full-width row justify-between q-pa-xs">
<div>
<VnUserLink
:name="`${note.worker.user.nickname}`"
:name="`${note.worker.user.name}`"
:worker-id="note.worker.id"
/>
<QBadge

View File

@ -247,6 +247,7 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
}
function updateStateParams() {
if (!route?.path) return;
const newUrl = { path: route.path, query: { ...(route.query ?? {}) } };
if (store?.searchUrl)
newUrl.query[store.searchUrl] = JSON.stringify(store.currentFilter);

View File

@ -0,0 +1,8 @@
import { openURL } from 'quasar';
const defaultWindowFeatures = {
noopener: true,
noreferrer: true,
};
export default function (url, windowFeatures = defaultWindowFeatures, fn = undefined) {
openURL(url, fn, windowFeatures);
}

View File

@ -174,23 +174,6 @@ const setData = (entity) => (data.value = useCardDescription(entity?.name, entit
>
<QTooltip>{{ t('Customer ticket list') }}</QTooltip>
</QBtn>
<QBtn
:to="{
name: 'TicketList',
query: {
table: JSON.stringify({
clientFk: entity.id,
}),
createForm: JSON.stringify({ clientId: entity.id }),
},
}"
size="md"
color="primary"
target="_blank"
icon="vn:ticketAdd"
>
<QTooltip>{{ t('New ticket') }}</QTooltip>
</QBtn>
<QBtn
:to="{
name: 'InvoiceOutList',
@ -202,23 +185,6 @@ const setData = (entity) => (data.value = useCardDescription(entity?.name, entit
>
<QTooltip>{{ t('Customer invoice out list') }}</QTooltip>
</QBtn>
<QBtn
:to="{
name: 'OrderList',
query: {
table: JSON.stringify({
clientFk: entity.id,
}),
createForm: JSON.stringify({ clientFk: entity.id }),
},
}"
size="md"
target="_blank"
icon="vn:basketadd"
color="primary"
>
<QTooltip>{{ t('New order') }}</QTooltip>
</QBtn>
<QBtn
:to="{
name: 'AccountSummary',

View File

@ -6,8 +6,8 @@ import axios from 'axios';
import { useQuasar } from 'quasar';
import useNotify from 'src/composables/useNotify';
import VnSmsDialog from 'src/components/common/VnSmsDialog.vue';
import useOpenURL from 'src/composables/useOpenURL';
const $props = defineProps({
customer: {
@ -15,7 +15,6 @@ const $props = defineProps({
required: true,
},
});
const { notify } = useNotify();
const { t } = useI18n();
const quasar = useQuasar();
@ -40,9 +39,42 @@ const sendSms = async (payload) => {
notify(error.message, 'positive');
}
};
const openCreateForm = (type) => {
const query = {
table: {
clientFk: $props.customer.id,
},
createForm: {
addressId: $props.customer.defaultAddressFk,
},
};
const clientFk = {
ticket: 'clientId',
order: 'clientFk',
};
const key = clientFk[type];
if (!key) return;
query.createForm[key] = $props.customer.id;
const params = Object.entries(query)
.map(([key, value]) => `${key}=${JSON.stringify(value)}`)
.join('&');
useOpenURL(`/#/${type}/list?${params}`);
};
</script>
<template>
<QItem v-ripple clickable @click="openCreateForm('ticket')">
<QItemSection>
{{ t('globals.pageTitles.createTicket') }}
</QItemSection>
</QItem>
<QItem v-ripple clickable @click="openCreateForm('order')">
<QItemSection>
{{ t('globals.pageTitles.createOrder') }}
</QItemSection>
</QItem>
<QItem v-ripple clickable>
<QItemSection @click="showSmsDialog()">{{ t('Send SMS') }}</QItemSection>
</QItem>

View File

@ -2,10 +2,9 @@
import { computed, onBeforeMount, ref, watch, nextTick } from 'vue';
import { useI18n } from 'vue-i18n';
import { useRoute } from 'vue-router';
import VnInputDate from 'components/common/VnInputDate.vue';
import VnInput from 'src/components/common/VnInput.vue';
import VnRow from 'components/ui/VnRow.vue';
import axios from 'axios';
import useNotify from 'src/composables/useNotify';
import { useStateStore } from 'stores/useStateStore';

View File

@ -53,7 +53,7 @@ defineProps({
<QItemSection>
<VnSelect
url="Workers/activeWithInheritedRole"
:filter="{ where: { role: 'salesPerson' } }"
:where="{ role: 'salesPerson' }"
auto-load
:label="t('Salesperson')"
v-model="params.salesPersonFk"
@ -67,7 +67,6 @@ defineProps({
dense
outlined
rounded
:input-debounce="0"
/>
</QItemSection>
</QItem>

View File

@ -194,14 +194,14 @@ const getItemPackagingType = (ticketSales) => {
redirect="ticket"
>
<template #column-nickname="{ row }">
<span class="link">
<span class="link" @click.stop>
{{ row.nickname }}
<CustomerDescriptorProxy :id="row.clientFk" />
</span>
</template>
<template #column-routeFk="{ row }">
<span class="link">
<span class="link" @click.stop>
{{ row.routeFk }}
<RouteDescriptorProxy :id="row.routeFk" />
</span>
@ -218,7 +218,7 @@ const getItemPackagingType = (ticketSales) => {
<span v-else> {{ toCurrency(row.totalWithVat) }}</span>
</template>
<template #column-state="{ row }">
<span v-if="row.invoiceOut">
<span v-if="row.invoiceOut" @click.stop>
<span :class="{ link: row.invoiceOut.ref }">
{{ row.invoiceOut.ref }}
<InvoiceOutDescriptorProxy :id="row.invoiceOut.id" />

View File

@ -99,7 +99,7 @@ const travelDialogRef = ref(false);
const tableRef = ref();
const travel = ref(null);
const userParams = ref({
dated: Date.vnNew(),
dated: Date.vnNew().toJSON(),
});
const filter = ref({
@ -219,6 +219,7 @@ function round(value) {
data-key="StockBoughts"
url="StockBoughts/getStockBought"
save-url="StockBoughts/crud"
search-url="StockBoughts"
order="reserve DESC"
:right-search="false"
:is-editable="true"

View File

@ -18,7 +18,7 @@ const $props = defineProps({
required: true,
},
});
const customUrl = `StockBoughts/getStockBoughtDetail?workerFk=${$props.workerFk}&date=${$props.dated}`;
const customUrl = `StockBoughts/getStockBoughtDetail?workerFk=${$props.workerFk}&dated=${$props.dated}`;
const columns = [
{
align: 'left',

View File

@ -27,7 +27,7 @@ onMounted(async () => {
<VnFilterPanel
:data-key="props.dataKey"
:search-button="true"
search-url="table"
search-url="StockBoughts"
@set-user-params="setUserParams"
>
<template #tags="{ tag, formatFn }">
@ -36,12 +36,19 @@ onMounted(async () => {
<span>{{ formatFn(tag.value) }}</span>
</div>
</template>
<template #body="{ params }">
<template #body="{ params, searchFn }">
<QItem class="q-my-sm">
<QItemSection>
<VnInputDate
id="date"
v-model="params.dated"
@update:model-value="
(value) => {
params.dated = value;
setUserParams(params);
searchFn();
}
"
:label="t('Date')"
is-outlined
/>

View File

@ -116,7 +116,7 @@ function getApiUrl() {
return new URL(window.location).origin;
}
function getCmrUrl(value) {
return `${getApiUrl()}/api/Routes/${value}/cmr?access_token=${token}`;
return `${getApiUrl()}/api/Cmrs/${value}/print?access_token=${token}`;
}
function downloadPdfs() {
if (!selectedRows.value.length) {
@ -129,7 +129,7 @@ function downloadPdfs() {
let cmrs = [];
for (let value of selectedRows.value) cmrs.push(value.cmrFk);
// prettier-ignore
return window.open(`${getApiUrl()}/api/Routes/downloadCmrsZip?ids=${cmrs.join(',')}&access_token=${token}`);
return window.open(`${getApiUrl()}/api/Cmrs/downloadZip?ids=${cmrs.join(',')}&access_token=${token}`);
}
</script>
<template>
@ -149,7 +149,7 @@ function downloadPdfs() {
<VnTable
ref="tableRef"
data-key="CmrList"
url="Routes/cmrs"
url="Cmrs/filter"
:columns="columns"
:right-search="true"
default-mode="table"

View File

@ -268,6 +268,7 @@ onMounted(() => (stateStore.rightDrawer = false));
:label="t('basicData.price')"
type="number"
min="0"
step="any"
/>
</template>
</VnTable>

View File

@ -45,6 +45,13 @@ const userParams = {
from: null,
to: null,
};
onMounted(() => {
initializeFromQuery();
stateStore.rightDrawer = true;
if (!route.query.createForm) return;
onClientSelected(JSON.parse(route.query.createForm));
});
// Método para inicializar las variables desde la query string
const initializeFromQuery = () => {
const query = route.query.table ? JSON.parse(route.query.table) : {};
@ -301,11 +308,6 @@ const getDateColor = (date) => {
if (comparation < 0) return 'bg-success';
};
onMounted(() => {
initializeFromQuery();
stateStore.rightDrawer = true;
});
async function makeInvoice(ticket) {
const ticketsIds = ticket.map((item) => item.id);
const { data } = await axios.post(`Tickets/invoiceTicketsAndPdf`, { ticketsIds });

View File

@ -105,11 +105,14 @@ watch(
<template #option="{ itemProps, opt }">
<QItem v-bind="itemProps">
<QItemSection v-if="opt.code">
<QItemLabel>{{ opt.code }}</QItemLabel>
<QItemLabel caption
>{{ opt.town?.province?.name }},
{{ opt.town?.province?.country?.name }}</QItemLabel
>
<QItemLabel>
{{ `${opt.code}, ${opt.town?.name}` }}
</QItemLabel>
<QItemLabel caption>
{{
`${opt.town?.province?.name}, ${opt.town?.province?.country?.name}`
}}
</QItemLabel>
</QItemSection>
</QItem>
</template>

View File

@ -22,7 +22,12 @@ const agencies = ref([]);
</script>
<template>
<FetchData url="agencies" @on-fetch="(data) => (agencies = data)" auto-load />
<FetchData
url="AgencyModes"
:filter="{ fields: ['id', 'name'] }"
@on-fetch="(data) => (agencies = data)"
auto-load
/>
<VnFilterPanel
:data-key="props.dataKey"
:search-button="true"

View File

@ -73,6 +73,7 @@ const columns = computed(() => [
inWhere: true,
attrs: {
url: 'AgencyModes',
fields: ['id', 'name'],
},
},
columnField: {