Merge branch 'dev' into 8254-CreateAutofillComponent
gitea/salix-front/pipeline/pr-dev This commit is unstable
Details
gitea/salix-front/pipeline/pr-dev This commit is unstable
Details
This commit is contained in:
commit
e96da2fa59
|
@ -125,7 +125,7 @@ pipeline {
|
||||||
sh "docker-compose ${env.COMPOSE_PARAMS} pull db"
|
sh "docker-compose ${env.COMPOSE_PARAMS} pull db"
|
||||||
sh "docker-compose ${env.COMPOSE_PARAMS} up -d"
|
sh "docker-compose ${env.COMPOSE_PARAMS} up -d"
|
||||||
|
|
||||||
def modules = sh(script: 'node test/cypress/docker/find/find.js', returnStdout: true).trim()
|
def modules = sh(script: "node test/cypress/docker/find/find.js ${env.COMPOSE_TAG}", returnStdout: true).trim()
|
||||||
echo "E2E MODULES: ${modules}"
|
echo "E2E MODULES: ${modules}"
|
||||||
image.inside("--network ${env.COMPOSE_PROJECT}_default -e CI -e TZ --init") {
|
image.inside("--network ${env.COMPOSE_PROJECT}_default -e CI -e TZ --init") {
|
||||||
sh "sh test/cypress/docker/cypressParallel.sh 1 '${modules}'"
|
sh "sh test/cypress/docker/cypressParallel.sh 1 '${modules}'"
|
||||||
|
|
|
@ -0,0 +1,152 @@
|
||||||
|
<script setup>
|
||||||
|
import { ref, computed } from 'vue';
|
||||||
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import { date } from 'quasar';
|
||||||
|
import QCalendarMonthWrapper from 'src/components/ui/QCalendarMonthWrapper.vue';
|
||||||
|
import { QCalendarMonth } from '@quasar/quasar-ui-qcalendar/src/index.js';
|
||||||
|
import '@quasar/quasar-ui-qcalendar/src/QCalendarVariables.scss';
|
||||||
|
import { useWeekdayStore } from 'src/stores/useWeekdayStore';
|
||||||
|
import useWeekdaysOrder from 'src/composables/getWeekdays';
|
||||||
|
|
||||||
|
const formatDate = (dateToFormat, format = 'YYYY-MM-DD') => (
|
||||||
|
date.formatDate(dateToFormat, format)
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
year: {
|
||||||
|
type: Number,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
month: {
|
||||||
|
type: Number,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
monthDate: {
|
||||||
|
type: Object,
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
|
daysMap: {
|
||||||
|
type: Object,
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const emit = defineEmits(['onDateSelected']);
|
||||||
|
|
||||||
|
const { locale } = useI18n();
|
||||||
|
const weekdayStore = useWeekdayStore();
|
||||||
|
const weekDays = useWeekdaysOrder();
|
||||||
|
const calendarRef = ref(null);
|
||||||
|
const today = ref(formatDate(Date.vnNew()));
|
||||||
|
const todayTimestamp = computed(() => {
|
||||||
|
const date = Date.vnNew();
|
||||||
|
date.setHours(0, 0, 0, 0);
|
||||||
|
return date.getTime();
|
||||||
|
});
|
||||||
|
const _monthDate = computed(() => formatDate(props.monthDate));
|
||||||
|
|
||||||
|
const calendarHeaderTitle = computed(() => {
|
||||||
|
return `${weekdayStore.getLocaleMonths[props.month - 1].locale} ${props.year}`;
|
||||||
|
});
|
||||||
|
|
||||||
|
const isToday = (timestamp) => {
|
||||||
|
const { year, month, day } = timestamp;
|
||||||
|
return todayTimestamp.value === new Date(year, month - 1, day).getTime();
|
||||||
|
};
|
||||||
|
|
||||||
|
const getEventByTimestamp = ({ year, month, day }) => {
|
||||||
|
const stamp = new Date(year, month - 1, day).getTime();
|
||||||
|
return props.daysMap?.[stamp] || null;
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleDateClick = (timestamp) => {
|
||||||
|
const event = getEventByTimestamp(timestamp);
|
||||||
|
const { year, month, day } = timestamp;
|
||||||
|
const date = new Date(year, month - 1, day);
|
||||||
|
emit('onDateSelected', {
|
||||||
|
date,
|
||||||
|
isNewMode: !event,
|
||||||
|
event: event?.[0] || null
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const getEventAttrs = (timestamp) => {
|
||||||
|
return {
|
||||||
|
class: '--event',
|
||||||
|
label: timestamp.day,
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
defineExpose({ getEventByTimestamp, handleDateClick });
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<QCalendarMonthWrapper
|
||||||
|
style="height: 290px; width: 290px"
|
||||||
|
transparent-background
|
||||||
|
view-customization="workerCalendar"
|
||||||
|
>
|
||||||
|
<template #header>
|
||||||
|
<span class="full-width text-center text-body1 q-py-sm">{{
|
||||||
|
calendarHeaderTitle
|
||||||
|
}}</span>
|
||||||
|
</template>
|
||||||
|
<template #calendar>
|
||||||
|
<QCalendarMonth
|
||||||
|
ref="calendarRef"
|
||||||
|
:model-value="_monthDate"
|
||||||
|
show-work-weeks
|
||||||
|
no-outside-days
|
||||||
|
no-active-date
|
||||||
|
:weekdays="weekDays"
|
||||||
|
short-weekday-label
|
||||||
|
:locale="locale"
|
||||||
|
:now="today"
|
||||||
|
@click-date="handleDateClick($event.scope.timestamp)"
|
||||||
|
mini-mode
|
||||||
|
>
|
||||||
|
<template #day="{ scope: { timestamp } }">
|
||||||
|
<slot name="day" :timestamp="timestamp" :getEventAttrs="getEventAttrs">
|
||||||
|
<QBtn
|
||||||
|
v-if="getEventByTimestamp(timestamp)"
|
||||||
|
v-bind="{ ...getEventAttrs(timestamp) }"
|
||||||
|
@click="handleDateClick(timestamp)"
|
||||||
|
rounded
|
||||||
|
dense
|
||||||
|
flat
|
||||||
|
class="calendar-event"
|
||||||
|
:class="{ '--today': isToday(timestamp) }"
|
||||||
|
/>
|
||||||
|
</slot>
|
||||||
|
</template>
|
||||||
|
</QCalendarMonth>
|
||||||
|
</template>
|
||||||
|
</QCalendarMonthWrapper>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
.calendar-event {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
width: 32px;
|
||||||
|
height: 32px;
|
||||||
|
font-size: 13px;
|
||||||
|
line-height: 1.715em;
|
||||||
|
cursor: pointer;
|
||||||
|
color: white;
|
||||||
|
|
||||||
|
&.--today {
|
||||||
|
border: 2px solid $info;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.--event {
|
||||||
|
background-color: $positive;
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
opacity: 0.8;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -0,0 +1,126 @@
|
||||||
|
<script setup>
|
||||||
|
import { computed, onMounted, ref, onUnmounted, nextTick } from 'vue';
|
||||||
|
import { useStateStore } from 'stores/useStateStore';
|
||||||
|
import { useWeekdayStore } from 'src/stores/useWeekdayStore';
|
||||||
|
import { useArrayData } from 'src/composables/useArrayData';
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
dataKey: {
|
||||||
|
type: String,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
calendarComponent: {
|
||||||
|
type: Object,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
additionalProps: {
|
||||||
|
type: Object,
|
||||||
|
default: () => ({}),
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const stateStore = useStateStore();
|
||||||
|
const weekdayStore = useWeekdayStore();
|
||||||
|
const nMonths = ref(4);
|
||||||
|
const _date = ref(Date.vnNew());
|
||||||
|
const firstDay = ref(Date.vnNew());
|
||||||
|
const lastDay = ref(Date.vnNew());
|
||||||
|
const months = ref([]);
|
||||||
|
const arrayData = useArrayData(props.dataKey);
|
||||||
|
onMounted(async () => {
|
||||||
|
const initialDate = Date.vnNew();
|
||||||
|
initialDate.setDate(1);
|
||||||
|
initialDate.setHours(0, 0, 0, 0);
|
||||||
|
date.value = initialDate;
|
||||||
|
await nextTick();
|
||||||
|
stateStore.rightDrawer = true;
|
||||||
|
});
|
||||||
|
|
||||||
|
onUnmounted(() => arrayData.destroy());
|
||||||
|
|
||||||
|
const emit = defineEmits([
|
||||||
|
'update:firstDay',
|
||||||
|
'update:lastDay',
|
||||||
|
'update:events',
|
||||||
|
'onDateSelected',
|
||||||
|
]);
|
||||||
|
|
||||||
|
const date = computed({
|
||||||
|
get: () => _date.value,
|
||||||
|
set: (value) => {
|
||||||
|
if (!(value instanceof Date)) return;
|
||||||
|
_date.value = value;
|
||||||
|
const stamp = value.getTime();
|
||||||
|
|
||||||
|
firstDay.value = new Date(stamp);
|
||||||
|
firstDay.value.setDate(1);
|
||||||
|
|
||||||
|
lastDay.value = new Date(stamp);
|
||||||
|
lastDay.value.setMonth(lastDay.value.getMonth() + nMonths.value);
|
||||||
|
lastDay.value.setDate(0);
|
||||||
|
|
||||||
|
months.value = [];
|
||||||
|
for (let i = 0; i < nMonths.value; i++) {
|
||||||
|
const monthDate = new Date(stamp);
|
||||||
|
monthDate.setMonth(value.getMonth() + i);
|
||||||
|
months.value.push(monthDate);
|
||||||
|
}
|
||||||
|
|
||||||
|
emit('update:firstDay', firstDay.value);
|
||||||
|
emit('update:lastDay', lastDay.value);
|
||||||
|
emit('refresh-events');
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const headerTitle = computed(() => {
|
||||||
|
if (!months.value?.length) return '';
|
||||||
|
const getMonthName = date =>
|
||||||
|
`${weekdayStore.getLocaleMonths[date.getMonth()].locale} ${date.getFullYear()}`;
|
||||||
|
return `${getMonthName(months.value[0])} - ${getMonthName(months.value[months.value.length - 1])}`;
|
||||||
|
});
|
||||||
|
|
||||||
|
const step = (direction) => {
|
||||||
|
const newDate = new Date(date.value);
|
||||||
|
newDate.setMonth(newDate.getMonth() + nMonths.value * direction);
|
||||||
|
date.value = newDate;
|
||||||
|
};
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
firstDay,
|
||||||
|
lastDay
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<QCard style="height: max-content">
|
||||||
|
<div class="calendars-header">
|
||||||
|
<QBtn
|
||||||
|
icon="arrow_left"
|
||||||
|
size="sm"
|
||||||
|
flat
|
||||||
|
class="full-height"
|
||||||
|
@click="step(-1)"
|
||||||
|
/>
|
||||||
|
<span>{{ headerTitle }}</span>
|
||||||
|
<QBtn
|
||||||
|
icon="arrow_right"
|
||||||
|
size="sm"
|
||||||
|
flat
|
||||||
|
class="full-height"
|
||||||
|
@click="step(1)"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div class="calendars-container">
|
||||||
|
<component
|
||||||
|
:is="calendarComponent"
|
||||||
|
v-for="(month, index) in months"
|
||||||
|
:key="index"
|
||||||
|
:month="month.getMonth() + 1"
|
||||||
|
:year="month.getFullYear()"
|
||||||
|
:month-date="month"
|
||||||
|
v-bind="additionalProps"
|
||||||
|
@on-date-selected="data => emit('onDateSelected', data)"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</QCard>
|
||||||
|
</template>
|
|
@ -156,6 +156,9 @@ const selectTravel = ({ id }) => {
|
||||||
option-label="name"
|
option-label="name"
|
||||||
option-value="id"
|
option-value="id"
|
||||||
v-model="travelFilterParams.warehouseOutFk"
|
v-model="travelFilterParams.warehouseOutFk"
|
||||||
|
:where="{
|
||||||
|
isOrigin: true,
|
||||||
|
}"
|
||||||
/>
|
/>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('globals.warehouseIn')"
|
:label="t('globals.warehouseIn')"
|
||||||
|
@ -164,6 +167,9 @@ const selectTravel = ({ id }) => {
|
||||||
option-label="name"
|
option-label="name"
|
||||||
option-value="id"
|
option-value="id"
|
||||||
v-model="travelFilterParams.warehouseInFk"
|
v-model="travelFilterParams.warehouseInFk"
|
||||||
|
:where="{
|
||||||
|
isDestiny: true,
|
||||||
|
}"
|
||||||
/>
|
/>
|
||||||
<VnInputDate
|
<VnInputDate
|
||||||
:label="t('globals.shipped')"
|
:label="t('globals.shipped')"
|
||||||
|
|
|
@ -40,6 +40,9 @@ const onDataSaved = (data) => {
|
||||||
url="Warehouses"
|
url="Warehouses"
|
||||||
@on-fetch="(data) => (warehousesOptions = data)"
|
@on-fetch="(data) => (warehousesOptions = data)"
|
||||||
auto-load
|
auto-load
|
||||||
|
:where="{
|
||||||
|
isInventory: true,
|
||||||
|
}"
|
||||||
/>
|
/>
|
||||||
<FormModelPopup
|
<FormModelPopup
|
||||||
url-create="Items/regularize"
|
url-create="Items/regularize"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { markRaw, computed } from 'vue';
|
import { markRaw, computed, onBeforeMount } from 'vue';
|
||||||
import { QCheckbox, QToggle } from 'quasar';
|
import { QToggle } from 'quasar';
|
||||||
import { useArrayData } from 'composables/useArrayData';
|
import { useArrayData } from 'composables/useArrayData';
|
||||||
import VnSelect from 'components/common/VnSelect.vue';
|
import VnSelect from 'components/common/VnSelect.vue';
|
||||||
import VnInput from 'components/common/VnInput.vue';
|
import VnInput from 'components/common/VnInput.vue';
|
||||||
|
@ -150,6 +150,16 @@ const showFilter = computed(
|
||||||
const onTabPressed = async () => {
|
const onTabPressed = async () => {
|
||||||
if (model.value) enterEvent['keyup.enter']();
|
if (model.value) enterEvent['keyup.enter']();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
onBeforeMount(() => {
|
||||||
|
const columnFilter = $props.column?.columnFilter;
|
||||||
|
const component = columnFilter?.component;
|
||||||
|
const defaultComponent = components[component];
|
||||||
|
const events = { update: updateEvent, enter: enterEvent };
|
||||||
|
|
||||||
|
if (!columnFilter || defaultComponent) return;
|
||||||
|
$props.column.columnFilter.event = events[columnFilter.event];
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<div v-if="showFilter" class="full-width" style="overflow: hidden">
|
<div v-if="showFilter" class="full-width" style="overflow: hidden">
|
||||||
|
|
|
@ -33,7 +33,8 @@ import VnTableOrder from 'src/components/VnTable/VnOrder.vue';
|
||||||
import VnTableFilter from './VnTableFilter.vue';
|
import VnTableFilter from './VnTableFilter.vue';
|
||||||
import { getColAlign } from 'src/composables/getColAlign';
|
import { getColAlign } from 'src/composables/getColAlign';
|
||||||
import RightMenu from '../common/RightMenu.vue';
|
import RightMenu from '../common/RightMenu.vue';
|
||||||
import VnScroll from '../common/VnScroll.vue'
|
import VnScroll from '../common/VnScroll.vue';
|
||||||
|
import VnMultiCheck from '../common/VnMultiCheck.vue';
|
||||||
|
|
||||||
const arrayData = useArrayData(useAttrs()['data-key']);
|
const arrayData = useArrayData(useAttrs()['data-key']);
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
|
@ -113,6 +114,10 @@ const $props = defineProps({
|
||||||
type: Object,
|
type: Object,
|
||||||
default: () => ({}),
|
default: () => ({}),
|
||||||
},
|
},
|
||||||
|
multiCheck: {
|
||||||
|
type: Object,
|
||||||
|
default: () => ({}),
|
||||||
|
},
|
||||||
crudModel: {
|
crudModel: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: () => ({}),
|
default: () => ({}),
|
||||||
|
@ -157,6 +162,7 @@ const CARD_MODE = 'card';
|
||||||
const TABLE_MODE = 'table';
|
const TABLE_MODE = 'table';
|
||||||
const mode = ref(CARD_MODE);
|
const mode = ref(CARD_MODE);
|
||||||
const selected = ref([]);
|
const selected = ref([]);
|
||||||
|
const selectAll = ref(false);
|
||||||
const hasParams = ref(false);
|
const hasParams = ref(false);
|
||||||
const CrudModelRef = ref({});
|
const CrudModelRef = ref({});
|
||||||
const showForm = ref(false);
|
const showForm = ref(false);
|
||||||
|
@ -195,10 +201,10 @@ const onVirtualScroll = ({ to }) => {
|
||||||
handleScroll();
|
handleScroll();
|
||||||
const virtualScrollContainer = tableRef.value?.$el?.querySelector('.q-table__middle');
|
const virtualScrollContainer = tableRef.value?.$el?.querySelector('.q-table__middle');
|
||||||
if (virtualScrollContainer) {
|
if (virtualScrollContainer) {
|
||||||
virtualScrollContainer.dispatchEvent(new CustomEvent('scroll'));
|
virtualScrollContainer.dispatchEvent(new CustomEvent('scroll'));
|
||||||
if (vnScrollRef.value) {
|
if (vnScrollRef.value) {
|
||||||
vnScrollRef.value.updateScrollContainer(virtualScrollContainer);
|
vnScrollRef.value.updateScrollContainer(virtualScrollContainer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -638,6 +644,23 @@ const rowCtrlClickFunction = computed(() => {
|
||||||
};
|
};
|
||||||
return () => {};
|
return () => {};
|
||||||
});
|
});
|
||||||
|
const handleMultiCheck = (value) => {
|
||||||
|
if (value) {
|
||||||
|
selected.value = tableRef.value.rows;
|
||||||
|
} else {
|
||||||
|
selected.value = [];
|
||||||
|
}
|
||||||
|
emit('update:selected', selected.value);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleSelectedAll = (data) => {
|
||||||
|
if (data) {
|
||||||
|
selected.value = data;
|
||||||
|
} else {
|
||||||
|
selected.value = [];
|
||||||
|
}
|
||||||
|
emit('update:selected', selected.value);
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<RightMenu v-if="$props.rightSearch" :overlay="overlay">
|
<RightMenu v-if="$props.rightSearch" :overlay="overlay">
|
||||||
|
@ -679,9 +702,9 @@ const rowCtrlClickFunction = computed(() => {
|
||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
v-bind="table"
|
v-bind="table"
|
||||||
:class="[
|
:class="[
|
||||||
'vnTable',
|
'vnTable',
|
||||||
table ? 'selection-cell' : '',
|
table ? 'selection-cell' : '',
|
||||||
$props.footer ? 'last-row-sticky' : '',
|
$props.footer ? 'last-row-sticky' : '',
|
||||||
]"
|
]"
|
||||||
wrap-cells
|
wrap-cells
|
||||||
:columns="splittedColumns.columns"
|
:columns="splittedColumns.columns"
|
||||||
|
@ -700,6 +723,17 @@ const rowCtrlClickFunction = computed(() => {
|
||||||
:hide-selected-banner="true"
|
:hide-selected-banner="true"
|
||||||
:data-cy
|
:data-cy
|
||||||
>
|
>
|
||||||
|
<template #header-selection>
|
||||||
|
<VnMultiCheck
|
||||||
|
:searchUrl="searchUrl"
|
||||||
|
:expand="$props.multiCheck.expand"
|
||||||
|
v-model="selectAll"
|
||||||
|
:url="$attrs['url']"
|
||||||
|
@update:selected="handleMultiCheck"
|
||||||
|
@select:all="handleSelectedAll"
|
||||||
|
></VnMultiCheck>
|
||||||
|
</template>
|
||||||
|
|
||||||
<template #top-left v-if="!$props.withoutHeader">
|
<template #top-left v-if="!$props.withoutHeader">
|
||||||
<slot name="top-left"> </slot>
|
<slot name="top-left"> </slot>
|
||||||
</template>
|
</template>
|
||||||
|
@ -1099,9 +1133,9 @@ const rowCtrlClickFunction = computed(() => {
|
||||||
</FormModelPopup>
|
</FormModelPopup>
|
||||||
</QDialog>
|
</QDialog>
|
||||||
<VnScroll
|
<VnScroll
|
||||||
ref="vnScrollRef"
|
ref="vnScrollRef"
|
||||||
v-if="isTableMode"
|
v-if="isTableMode"
|
||||||
:scroll-target="tableRef?.$el?.querySelector('.q-table__middle')"
|
:scroll-target="tableRef?.$el?.querySelector('.q-table__middle')"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<i18n>
|
<i18n>
|
||||||
|
|
|
@ -0,0 +1,80 @@
|
||||||
|
<script setup>
|
||||||
|
import { ref } from 'vue';
|
||||||
|
import VnCheckbox from './VnCheckbox.vue';
|
||||||
|
import axios from 'axios';
|
||||||
|
import { toRaw } from 'vue';
|
||||||
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import { useRoute } from 'vue-router';
|
||||||
|
const route = useRoute();
|
||||||
|
const { t } = useI18n();
|
||||||
|
const model = defineModel({ type: [Boolean] });
|
||||||
|
const props = defineProps({
|
||||||
|
expand: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
url: {
|
||||||
|
type: String,
|
||||||
|
default: null,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
searchUrl: {
|
||||||
|
type: [String, Boolean],
|
||||||
|
default: 'table',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
const value = ref(false);
|
||||||
|
const rows = ref(0);
|
||||||
|
const onClick = () => {
|
||||||
|
if (value.value) {
|
||||||
|
const { filter } = JSON.parse(route.query[props.searchUrl]);
|
||||||
|
filter.limit = 0;
|
||||||
|
const params = {
|
||||||
|
params: { filter: JSON.stringify(filter) },
|
||||||
|
};
|
||||||
|
axios
|
||||||
|
.get(props.url, params)
|
||||||
|
.then(({ data }) => {
|
||||||
|
rows.value = data;
|
||||||
|
})
|
||||||
|
.catch(console.error);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
defineEmits(['update:selected', 'select:all']);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div style="display: flex">
|
||||||
|
<VnCheckbox v-model="value" @click="$emit('update:selected', value)" />
|
||||||
|
<QBtn
|
||||||
|
v-if="value && $props.expand"
|
||||||
|
flat
|
||||||
|
dense
|
||||||
|
icon="expand_more"
|
||||||
|
@click="onClick"
|
||||||
|
>
|
||||||
|
<QMenu anchor="bottom right" self="top right">
|
||||||
|
<QList>
|
||||||
|
<QItem v-ripple clickable @click="$emit('select:all', toRaw(rows))">
|
||||||
|
{{ t('Select all', { rows: rows.length }) }}
|
||||||
|
</QItem>
|
||||||
|
<slot name="more-options"></slot>
|
||||||
|
</QList>
|
||||||
|
</QMenu>
|
||||||
|
</QBtn>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<i18n lang="yml">
|
||||||
|
en:
|
||||||
|
Select all: 'Select all ({rows})'
|
||||||
|
fr:
|
||||||
|
Select all: 'Sélectionner tout ({rows})'
|
||||||
|
es:
|
||||||
|
Select all: 'Seleccionar todo ({rows})'
|
||||||
|
de:
|
||||||
|
Select all: 'Alle auswählen ({rows})'
|
||||||
|
it:
|
||||||
|
Select all: 'Seleziona tutto ({rows})'
|
||||||
|
pt:
|
||||||
|
Select all: 'Selecionar tudo ({rows})'
|
||||||
|
</i18n>
|
|
@ -368,7 +368,6 @@ function getCaption(opt) {
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
:input-debounce="useURL ? '300' : '0'"
|
:input-debounce="useURL ? '300' : '0'"
|
||||||
:loading="someIsLoading"
|
:loading="someIsLoading"
|
||||||
:disable="someIsLoading"
|
|
||||||
@virtual-scroll="onScroll"
|
@virtual-scroll="onScroll"
|
||||||
@keydown="handleKeyDown"
|
@keydown="handleKeyDown"
|
||||||
:data-cy="$attrs.dataCy ?? $attrs.label + '_select'"
|
:data-cy="$attrs.dataCy ?? $attrs.label + '_select'"
|
||||||
|
|
|
@ -222,7 +222,7 @@ defineExpose({
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="full-width" v-bind="attrs">
|
<div class="full-width">
|
||||||
<div
|
<div
|
||||||
v-if="!store.data && !store.data?.length && !isLoading"
|
v-if="!store.data && !store.data?.length && !isLoading"
|
||||||
class="info-row q-pa-md text-center"
|
class="info-row q-pa-md text-center"
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
import { ref } from 'vue';
|
||||||
|
import moment from 'moment';
|
||||||
|
|
||||||
|
export default function useWeekdaysOrder() {
|
||||||
|
|
||||||
|
const firstDay = moment().weekday(1).day();
|
||||||
|
const weekdays = [...Array(7).keys()].map(i => (i + firstDay) % 7);
|
||||||
|
|
||||||
|
return ref(weekdays);
|
||||||
|
}
|
|
@ -343,3 +343,20 @@ input::-webkit-inner-spin-button {
|
||||||
.q-item__section--main ~ .q-item__section--side {
|
.q-item__section--main ~ .q-item__section--side {
|
||||||
padding-inline: 0;
|
padding-inline: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.calendars-header {
|
||||||
|
height: 45px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
background-color: $primary;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.calendars-container {
|
||||||
|
max-width: 800px;
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: space-evenly;
|
||||||
|
}
|
|
@ -77,10 +77,10 @@ const isDefaultAddress = (address) => {
|
||||||
return client?.value?.defaultAddressFk === address.id ? 1 : 0;
|
return client?.value?.defaultAddressFk === address.id ? 1 : 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
const setDefault = (address) => {
|
const setDefault = async (address) => {
|
||||||
const url = `Clients/${route.params.id}`;
|
const url = `Clients/${route.params.id}`;
|
||||||
const payload = { defaultAddressFk: address.id };
|
const payload = { defaultAddressFk: address.id };
|
||||||
axios.patch(url, payload).then((res) => {
|
await axios.patch(url, payload).then((res) => {
|
||||||
if (res.data) {
|
if (res.data) {
|
||||||
client.value.defaultAddressFk = res.data.defaultAddressFk;
|
client.value.defaultAddressFk = res.data.defaultAddressFk;
|
||||||
sortAddresses();
|
sortAddresses();
|
||||||
|
|
|
@ -100,6 +100,9 @@ const columns = computed(() => [
|
||||||
'row-key': 'id',
|
'row-key': 'id',
|
||||||
selection: 'multiple',
|
selection: 'multiple',
|
||||||
}"
|
}"
|
||||||
|
:multi-check="{
|
||||||
|
expand: true,
|
||||||
|
}"
|
||||||
v-model:selected="selected"
|
v-model:selected="selected"
|
||||||
:right-search="true"
|
:right-search="true"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
|
|
|
@ -98,7 +98,9 @@ onMounted(async () => {
|
||||||
<QBtn color="primary" icon="show_chart" :disable="!selectedRows">
|
<QBtn color="primary" icon="show_chart" :disable="!selectedRows">
|
||||||
<QPopupProxy ref="popupProxyRef">
|
<QPopupProxy ref="popupProxyRef">
|
||||||
<QCard class="column q-pa-md">
|
<QCard class="column q-pa-md">
|
||||||
<span class="text-body1 q-mb-sm">{{ t('Campaign consumption') }}</span>
|
<span class="text-body1 q-mb-sm">{{
|
||||||
|
t('Campaign consumption', { rows: $props.clients.length })
|
||||||
|
}}</span>
|
||||||
<VnRow>
|
<VnRow>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:options="moreFields"
|
:options="moreFields"
|
||||||
|
@ -140,12 +142,13 @@ onMounted(async () => {
|
||||||
valentinesDay: Valentine's Day
|
valentinesDay: Valentine's Day
|
||||||
mothersDay: Mother's Day
|
mothersDay: Mother's Day
|
||||||
allSaints: All Saints' Day
|
allSaints: All Saints' Day
|
||||||
|
Campaign consumption: Campaign consumption ({rows})
|
||||||
es:
|
es:
|
||||||
params:
|
params:
|
||||||
valentinesDay: Día de San Valentín
|
valentinesDay: Día de San Valentín
|
||||||
mothersDay: Día de la Madre
|
mothersDay: Día de la Madre
|
||||||
allSaints: Día de Todos los Santos
|
allSaints: Día de Todos los Santos
|
||||||
Campaign consumption: Consumo campaña
|
Campaign consumption: Consumo campaña ({rows})
|
||||||
Campaign: Campaña
|
Campaign: Campaña
|
||||||
From: Desde
|
From: Desde
|
||||||
To: Hasta
|
To: Hasta
|
||||||
|
|
|
@ -162,6 +162,9 @@ const entryFilterPanel = ref();
|
||||||
v-model="params.warehouseOutFk"
|
v-model="params.warehouseOutFk"
|
||||||
@update:model-value="searchFn()"
|
@update:model-value="searchFn()"
|
||||||
url="Warehouses"
|
url="Warehouses"
|
||||||
|
:where="{
|
||||||
|
isOrigin: true,
|
||||||
|
}"
|
||||||
:fields="['id', 'name']"
|
:fields="['id', 'name']"
|
||||||
sort-by="name ASC"
|
sort-by="name ASC"
|
||||||
hide-selected
|
hide-selected
|
||||||
|
@ -177,6 +180,9 @@ const entryFilterPanel = ref();
|
||||||
v-model="params.warehouseInFk"
|
v-model="params.warehouseInFk"
|
||||||
@update:model-value="searchFn()"
|
@update:model-value="searchFn()"
|
||||||
url="Warehouses"
|
url="Warehouses"
|
||||||
|
:where="{
|
||||||
|
isDestiny: true,
|
||||||
|
}"
|
||||||
:fields="['id', 'name']"
|
:fields="['id', 'name']"
|
||||||
sort-by="name ASC"
|
sort-by="name ASC"
|
||||||
hide-selected
|
hide-selected
|
||||||
|
|
|
@ -133,6 +133,7 @@ const columns = computed(() => [
|
||||||
label: null,
|
label: null,
|
||||||
name: 'supplierFk',
|
name: 'supplierFk',
|
||||||
class: 'fit',
|
class: 'fit',
|
||||||
|
event: 'update',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -472,6 +473,6 @@ en:
|
||||||
es:
|
es:
|
||||||
IntraCommunity: Intracomunitaria
|
IntraCommunity: Intracomunitaria
|
||||||
NonCommunity: Extracomunitaria
|
NonCommunity: Extracomunitaria
|
||||||
CanaryIsland: Islas Canarias
|
CanaryIslands: Islas Canarias
|
||||||
National: Nacional
|
National: Nacional
|
||||||
</i18n>
|
</i18n>
|
||||||
|
|
|
@ -6,13 +6,18 @@ import { useRoute } from 'vue-router';
|
||||||
import { useSession } from 'src/composables/useSession';
|
import { useSession } from 'src/composables/useSession';
|
||||||
import { toDateHourMin } from 'filters/index';
|
import { toDateHourMin } from 'filters/index';
|
||||||
import { useStateStore } from 'src/stores/useStateStore';
|
import { useStateStore } from 'src/stores/useStateStore';
|
||||||
|
import { dashIfEmpty } from 'src/filters';
|
||||||
|
|
||||||
|
import AgencyDescriptorProxy from '../Agency/Card/AgencyDescriptorProxy.vue';
|
||||||
|
import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorProxy.vue';
|
||||||
|
import RouteDescriptorProxy from '../Card/RouteDescriptorProxy.vue';
|
||||||
|
import SupplierDescriptorProxy from 'src/pages/Supplier/Card/SupplierDescriptorProxy.vue';
|
||||||
import TicketDescriptorProxy from 'pages/Ticket/Card/TicketDescriptorProxy.vue';
|
import TicketDescriptorProxy from 'pages/Ticket/Card/TicketDescriptorProxy.vue';
|
||||||
import CustomerDescriptorProxy from 'pages/Customer/Card/CustomerDescriptorProxy.vue';
|
|
||||||
|
|
||||||
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
|
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
|
||||||
import VnTable from 'components/VnTable/VnTable.vue';
|
import VnTable from 'components/VnTable/VnTable.vue';
|
||||||
import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
|
import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
|
||||||
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
@ -30,39 +35,117 @@ const userParams = {
|
||||||
|
|
||||||
const columns = computed(() => [
|
const columns = computed(() => [
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'right',
|
||||||
name: 'cmrFk',
|
name: 'cmrFk',
|
||||||
label: t('route.cmr.params.cmrFk'),
|
label: t('cmr.params.cmrFk'),
|
||||||
chip: {
|
chip: {
|
||||||
condition: () => true,
|
condition: () => true,
|
||||||
},
|
},
|
||||||
isId: true,
|
isId: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'center',
|
align: 'right',
|
||||||
name: 'hasCmrDms',
|
label: t('cmr.params.ticketFk'),
|
||||||
label: t('route.cmr.params.hasCmrDms'),
|
|
||||||
component: 'checkbox',
|
|
||||||
cardVisible: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
align: 'left',
|
|
||||||
label: t('route.cmr.params.ticketFk'),
|
|
||||||
name: 'ticketFk',
|
name: 'ticketFk',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'right',
|
||||||
label: t('route.cmr.params.routeFk'),
|
label: t('cmr.params.routeFk'),
|
||||||
name: 'routeFk',
|
name: 'routeFk',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
label: t('cmr.params.client'),
|
||||||
label: t('route.cmr.params.clientFk'),
|
|
||||||
name: 'clientFk',
|
name: 'clientFk',
|
||||||
|
component: 'select',
|
||||||
|
attrs: {
|
||||||
|
url: 'Clients',
|
||||||
|
fields: ['id', 'name'],
|
||||||
|
},
|
||||||
|
columnFilter: {
|
||||||
|
name: 'clientFk',
|
||||||
|
attrs: {
|
||||||
|
url: 'Clients',
|
||||||
|
fields: ['id', 'name'],
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'right',
|
label: t('cmr.params.agency'),
|
||||||
label: t('route.cmr.params.countryFk'),
|
name: 'agencyModeFk',
|
||||||
|
component: 'select',
|
||||||
|
attrs: {
|
||||||
|
url: 'Agencies',
|
||||||
|
fields: ['id', 'name'],
|
||||||
|
},
|
||||||
|
columnFilter: {
|
||||||
|
name: 'agencyModeFk',
|
||||||
|
attrs: {
|
||||||
|
url: 'Agencies',
|
||||||
|
fields: ['id', 'name'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
format: ({ agencyName }) => agencyName,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: t('cmr.params.supplier'),
|
||||||
|
name: 'supplierFk',
|
||||||
|
component: 'select',
|
||||||
|
attrs: {
|
||||||
|
url: 'suppliers',
|
||||||
|
fields: ['id', 'name'],
|
||||||
|
},
|
||||||
|
columnFilter: {
|
||||||
|
name: 'supplierFk',
|
||||||
|
attrs: {
|
||||||
|
url: 'suppliers',
|
||||||
|
fields: ['id', 'name'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: t('cmr.params.sender'),
|
||||||
|
name: 'addressFromFk',
|
||||||
|
component: 'select',
|
||||||
|
attrs: {
|
||||||
|
url: 'Addresses',
|
||||||
|
fields: ['id', 'nickname'],
|
||||||
|
optionValue: 'id',
|
||||||
|
optionLabel: 'nickname',
|
||||||
|
},
|
||||||
|
columnFilter: {
|
||||||
|
name: 'addressFromFk',
|
||||||
|
attrs: {
|
||||||
|
url: 'Addresses',
|
||||||
|
fields: ['id', 'nickname'],
|
||||||
|
optionValue: 'id',
|
||||||
|
optionLabel: 'nickname',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
format: ({ origin }) => origin,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: t('cmr.params.destination'),
|
||||||
|
name: 'addressToFk',
|
||||||
|
component: 'select',
|
||||||
|
attrs: {
|
||||||
|
url: 'addresses',
|
||||||
|
fields: ['id', 'nickname'],
|
||||||
|
optionValue: 'id',
|
||||||
|
optionLabel: 'nickname',
|
||||||
|
},
|
||||||
|
columnFilter: {
|
||||||
|
name: 'addressToFk',
|
||||||
|
attrs: {
|
||||||
|
url: 'addresses',
|
||||||
|
fields: ['id', 'nickname'],
|
||||||
|
optionValue: 'id',
|
||||||
|
optionLabel: 'nickname',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
format: ({ destination }) => destination,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: t('cmr.params.country'),
|
||||||
name: 'countryFk',
|
name: 'countryFk',
|
||||||
component: 'select',
|
component: 'select',
|
||||||
attrs: {
|
attrs: {
|
||||||
|
@ -79,16 +162,61 @@ const columns = computed(() => [
|
||||||
format: ({ countryName }) => countryName,
|
format: ({ countryName }) => countryName,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'right',
|
label: t('cmr.params.created'),
|
||||||
label: t('route.cmr.params.shipped'),
|
name: 'created',
|
||||||
name: 'shipped',
|
|
||||||
cardVisible: true,
|
|
||||||
component: 'date',
|
component: 'date',
|
||||||
format: ({ shipped }) => toDateHourMin(shipped),
|
format: ({ created }) => dashIfEmpty(toDateHourMin(created)),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'right',
|
label: t('cmr.params.shipped'),
|
||||||
label: t('route.cmr.params.warehouseFk'),
|
name: 'shipped',
|
||||||
|
component: 'date',
|
||||||
|
format: ({ shipped }) => dashIfEmpty(toDateHourMin(shipped)),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: t('cmr.params.etd'),
|
||||||
|
name: 'ead',
|
||||||
|
component: 'date',
|
||||||
|
format: ({ ead }) => dashIfEmpty(toDateHourMin(ead)),
|
||||||
|
toolTip: t('cmr.params.etdTooltip'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: t('globals.landed'),
|
||||||
|
name: 'landed',
|
||||||
|
component: 'date',
|
||||||
|
format: ({ landed }) => dashIfEmpty(toDateHourMin(landed)),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
label: t('cmr.params.packageList'),
|
||||||
|
name: 'packagesList',
|
||||||
|
columnFilter: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
label: t('cmr.params.observation'),
|
||||||
|
name: 'observation',
|
||||||
|
columnFilter: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
label: t('cmr.params.senderInstructions'),
|
||||||
|
name: 'senderInstruccions',
|
||||||
|
columnFilter: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
label: t('cmr.params.paymentInstructions'),
|
||||||
|
name: 'paymentInstruccions',
|
||||||
|
columnFilter: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
label: t('cmr.params.vehiclePlate'),
|
||||||
|
name: 'truckPlate',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: t('cmr.params.warehouse'),
|
||||||
name: 'warehouseFk',
|
name: 'warehouseFk',
|
||||||
component: 'select',
|
component: 'select',
|
||||||
attrs: {
|
attrs: {
|
||||||
|
@ -96,7 +224,6 @@ const columns = computed(() => [
|
||||||
fields: ['id', 'name'],
|
fields: ['id', 'name'],
|
||||||
},
|
},
|
||||||
columnFilter: {
|
columnFilter: {
|
||||||
inWhere: true,
|
|
||||||
name: 'warehouseFk',
|
name: 'warehouseFk',
|
||||||
attrs: {
|
attrs: {
|
||||||
url: 'warehouses',
|
url: 'warehouses',
|
||||||
|
@ -105,12 +232,23 @@ const columns = computed(() => [
|
||||||
},
|
},
|
||||||
format: ({ warehouseName }) => warehouseName,
|
format: ({ warehouseName }) => warehouseName,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
name: 'specialAgreements',
|
||||||
|
label: t('cmr.params.specialAgreements'),
|
||||||
|
columnFilter: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'hasCmrDms',
|
||||||
|
label: t('cmr.params.hasCmrDms'),
|
||||||
|
component: 'checkbox',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
align: 'center',
|
align: 'center',
|
||||||
name: 'tableActions',
|
name: 'tableActions',
|
||||||
actions: [
|
actions: [
|
||||||
{
|
{
|
||||||
title: t('route.cmr.params.viewCmr'),
|
title: t('cmr.params.viewCmr'),
|
||||||
icon: 'visibility',
|
icon: 'visibility',
|
||||||
isPrimary: true,
|
isPrimary: true,
|
||||||
action: (row) => window.open(getCmrUrl(row?.cmrFk), '_blank'),
|
action: (row) => window.open(getCmrUrl(row?.cmrFk), '_blank'),
|
||||||
|
@ -151,11 +289,7 @@ function downloadPdfs() {
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<VnSearchbar
|
<VnSearchbar :data-key :label="t('cmr.search')" :info="t('cmr.searchInfo')" />
|
||||||
:data-key
|
|
||||||
:label="t('route.cmr.search')"
|
|
||||||
:info="t('route.cmr.searchInfo')"
|
|
||||||
/>
|
|
||||||
<VnSubToolbar>
|
<VnSubToolbar>
|
||||||
<template #st-actions>
|
<template #st-actions>
|
||||||
<QBtn
|
<QBtn
|
||||||
|
@ -165,7 +299,7 @@ function downloadPdfs() {
|
||||||
:disable="!selectedRows?.length"
|
:disable="!selectedRows?.length"
|
||||||
@click="downloadPdfs"
|
@click="downloadPdfs"
|
||||||
>
|
>
|
||||||
<QTooltip>{{ t('route.cmr.params.downloadCmrs') }}</QTooltip>
|
<QTooltip>{{ t('cmr.params.downloadCmrs') }}</QTooltip>
|
||||||
</QBtn>
|
</QBtn>
|
||||||
</template>
|
</template>
|
||||||
</VnSubToolbar>
|
</VnSubToolbar>
|
||||||
|
@ -191,11 +325,72 @@ function downloadPdfs() {
|
||||||
<TicketDescriptorProxy :id="row.ticketFk" />
|
<TicketDescriptorProxy :id="row.ticketFk" />
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
|
<template #column-routeFk="{ row }">
|
||||||
|
<span class="link" @click.stop>
|
||||||
|
{{ row.routeFk }}
|
||||||
|
<RouteDescriptorProxy :id="row.routeFk" />
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
<template #column-clientFk="{ row }">
|
<template #column-clientFk="{ row }">
|
||||||
<span class="link" @click.stop>
|
<span class="link" @click.stop>
|
||||||
{{ row.clientFk }}
|
{{ row.clientName }}
|
||||||
<CustomerDescriptorProxy :id="row.clientFk" />
|
<CustomerDescriptorProxy :id="row.clientFk" />
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
|
<template #column-agencyModeFk="{ row }">
|
||||||
|
<span class="link" @click.stop>
|
||||||
|
{{ row.agencyName }}
|
||||||
|
<AgencyDescriptorProxy :id="row.agencyModeFk" />
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
<template #column-supplierFk="{ row }">
|
||||||
|
<span class="link" @click.stop>
|
||||||
|
{{ row.carrierName }}
|
||||||
|
<SupplierDescriptorProxy :id="row.supplierFk" />
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
<template #column-observation="{ row }">
|
||||||
|
<VnInput
|
||||||
|
v-if="row.observation"
|
||||||
|
type="textarea"
|
||||||
|
v-model="row.observation"
|
||||||
|
readonly
|
||||||
|
dense
|
||||||
|
rows="2"
|
||||||
|
style="overflow: hidden; text-overflow: ellipsis; white-space: nowrap"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
<template #column-packagesList="{ row }">
|
||||||
|
<span>
|
||||||
|
{{ row.packagesList }}
|
||||||
|
<QTooltip v-if="row.packagesList" :label="row.packagesList">
|
||||||
|
{{ row.packagesList }}
|
||||||
|
</QTooltip>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
<template #column-senderInstruccions="{ row }">
|
||||||
|
<span>
|
||||||
|
{{ row.senderInstruccions }}
|
||||||
|
<QTooltip v-if="row.packagesList" :label="row.packagesList">
|
||||||
|
{{ row.senderInstruccions }}
|
||||||
|
</QTooltip>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
<template #column-paymentInstruccions="{ row }">
|
||||||
|
<span>
|
||||||
|
{{ row.paymentInstruccions }}
|
||||||
|
<QTooltip v-if="row.packagesList" :label="row.packagesList">
|
||||||
|
{{ row.paymentInstruccions }}
|
||||||
|
</QTooltip>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
<template #column-specialAgreements="{ row }">
|
||||||
|
<span>
|
||||||
|
{{ row.specialAgreements }}
|
||||||
|
<QTooltip v-if="row.packagesList" :label="row.packagesList">
|
||||||
|
{{ row.specialAgreements }}
|
||||||
|
</QTooltip>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
</VnTable>
|
</VnTable>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -0,0 +1,31 @@
|
||||||
|
cmr:
|
||||||
|
search: Search Cmr
|
||||||
|
searchInfo: You can search Cmr by Id
|
||||||
|
params:
|
||||||
|
agency: Agency
|
||||||
|
client: Client
|
||||||
|
cmrFk: CMR id
|
||||||
|
country: Country
|
||||||
|
created: Created
|
||||||
|
destination: Destination
|
||||||
|
downloadCmrs: Download CMRs
|
||||||
|
etd: ETD
|
||||||
|
etdTooltip: Estimated Time Delivery
|
||||||
|
hasCmrDms: Attached in gestdoc
|
||||||
|
observation: Observation
|
||||||
|
packageList: Package List
|
||||||
|
paymentInstructions: Payment instructions
|
||||||
|
routeFk: Route id
|
||||||
|
results: results
|
||||||
|
search: General search
|
||||||
|
sender: Sender
|
||||||
|
senderInstructions: Sender instructions
|
||||||
|
shipped: Shipped
|
||||||
|
specialAgreements: Special agreements
|
||||||
|
supplier: Carrier
|
||||||
|
ticketFk: Ticket id
|
||||||
|
vehiclePlate: Vehicle plate
|
||||||
|
viewCmr: View CMR
|
||||||
|
warehouse: Warehouse
|
||||||
|
'true': 'Yes'
|
||||||
|
'false': 'No'
|
|
@ -0,0 +1,31 @@
|
||||||
|
cmr:
|
||||||
|
search: Buscar Cmr
|
||||||
|
searchInfo: Puedes buscar cmr por id
|
||||||
|
params:
|
||||||
|
agency: Agencia
|
||||||
|
client: Cliente
|
||||||
|
cmrFk: Id cmr
|
||||||
|
country: País
|
||||||
|
created: Creado
|
||||||
|
destination: Destinatario
|
||||||
|
downloadCmrs: Descargar CMRs
|
||||||
|
etd: ETD
|
||||||
|
etdTooltip: Fecha estimada de entrega
|
||||||
|
hasCmrDms: Adjunto en gestdoc
|
||||||
|
observation: Observaciones
|
||||||
|
packageList: Listado embalajes
|
||||||
|
paymentInstructions: Instrucciones de pago
|
||||||
|
routeFk: Id ruta
|
||||||
|
results: Resultados
|
||||||
|
search: Busqueda general
|
||||||
|
sender: Remitente
|
||||||
|
senderInstructions: Instrucciones de envío
|
||||||
|
shipped: F. envío
|
||||||
|
specialAgreements: Acuerdos especiales
|
||||||
|
supplier: Transportista
|
||||||
|
ticketFk: Id ticket
|
||||||
|
vehiclePlate: Matrícula
|
||||||
|
viewCmr: Ver CMR
|
||||||
|
warehouse: Almacén
|
||||||
|
'true': 'Si'
|
||||||
|
'false': 'No'
|
|
@ -0,0 +1,183 @@
|
||||||
|
<script setup>
|
||||||
|
import { ref, computed, onMounted } from 'vue';
|
||||||
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import { useRoute } from 'vue-router';
|
||||||
|
|
||||||
|
import VnRow from 'components/ui/VnRow.vue';
|
||||||
|
import FormPopup from 'components/FormPopup.vue';
|
||||||
|
import VnInputDate from 'src/components/common/VnInputDate.vue';
|
||||||
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
|
|
||||||
|
import { useArrayData } from 'src/composables/useArrayData';
|
||||||
|
import { useVnConfirm } from 'composables/useVnConfirm';
|
||||||
|
import { useState } from 'src/composables/useState';
|
||||||
|
import axios from 'axios';
|
||||||
|
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
|
import useNotify from 'src/composables/useNotify.js';
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
event: {
|
||||||
|
type: Object,
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
|
isNewMode: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true,
|
||||||
|
},
|
||||||
|
eventType: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true,
|
||||||
|
},
|
||||||
|
firstDay: {
|
||||||
|
type: Date,
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
|
lastDay: {
|
||||||
|
type: Date,
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const emit = defineEmits(['onSubmit', 'closeForm', 'refresh-events']);
|
||||||
|
|
||||||
|
const route = useRoute();
|
||||||
|
const { t } = useI18n();
|
||||||
|
const { notify } = useNotify();
|
||||||
|
const { openConfirmationModal } = useVnConfirm();
|
||||||
|
const state = useState();
|
||||||
|
const user = state.getUser();
|
||||||
|
|
||||||
|
const isNew = computed(() => props.isNewMode);
|
||||||
|
const vehicleFormData = ref({
|
||||||
|
started: null,
|
||||||
|
finished: null,
|
||||||
|
vehicleStateFk: null,
|
||||||
|
description: '',
|
||||||
|
vehicleFk: null,
|
||||||
|
userFk: null,
|
||||||
|
});
|
||||||
|
|
||||||
|
const arrayData = useArrayData('VehicleEvents');
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
if (props.event) {
|
||||||
|
vehicleFormData.value = props.event;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const createVehicleEvent = async () => {
|
||||||
|
vehicleFormData.value.vehicleFk = route.params.id;
|
||||||
|
vehicleFormData.value.userFk = user.value.id;
|
||||||
|
|
||||||
|
if (isNew.value) {
|
||||||
|
await axios.post(`VehicleEvents`, vehicleFormData.value);
|
||||||
|
} else {
|
||||||
|
await axios.patch(
|
||||||
|
`VehicleEvents/${props.event?.id}`,
|
||||||
|
vehicleFormData.value,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
await refetchEvents();
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
const deleteVehicleEvent = async () => {
|
||||||
|
if (!props.event) return;
|
||||||
|
await axios.delete(`VehicleEvents/${props.event?.id}`);
|
||||||
|
await refetchEvents();
|
||||||
|
};
|
||||||
|
|
||||||
|
const refetchEvents = async () => {
|
||||||
|
await arrayData.refresh({
|
||||||
|
append: false,
|
||||||
|
params: {
|
||||||
|
filter: {
|
||||||
|
where: {
|
||||||
|
vehicleFk: route.params.id,
|
||||||
|
and: [
|
||||||
|
{
|
||||||
|
or: [
|
||||||
|
{ started: { lte: props.lastDay?.toISOString() } },
|
||||||
|
{ started: null }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
or: [
|
||||||
|
{ finished: { gte: props.firstDay?.toISOString() } },
|
||||||
|
{ finished: null }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
emit('refresh-events');
|
||||||
|
notify(t('globals.dataSaved'), 'positive');
|
||||||
|
emit('closeForm');
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<FormPopup
|
||||||
|
:title="isNew ? t('Add vehicle event') : t('Edit vehicle event')"
|
||||||
|
:default-cancel-button="false"
|
||||||
|
:default-submit-button="false"
|
||||||
|
>
|
||||||
|
<template #form-inputs>
|
||||||
|
<VnRow class="row q-gutter-md q-mb-md">
|
||||||
|
<VnInputDate :label="t('Started')" v-model="vehicleFormData.started" />
|
||||||
|
<VnInputDate :label="t('Finished')" v-model="vehicleFormData.finished" />
|
||||||
|
<VnSelect
|
||||||
|
url="VehicleStates"
|
||||||
|
v-model="vehicleFormData.vehicleStateFk"
|
||||||
|
:label="t('globals.state')"
|
||||||
|
option-label="state"
|
||||||
|
data-cy="State_input"
|
||||||
|
/>
|
||||||
|
</VnRow>
|
||||||
|
<VnInput
|
||||||
|
v-model="vehicleFormData.description"
|
||||||
|
:label="t('globals.description')"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
<template #custom-buttons>
|
||||||
|
<QBtn
|
||||||
|
:label="t('globals.cancel')"
|
||||||
|
color="primary"
|
||||||
|
flat
|
||||||
|
class="q-mr-sm"
|
||||||
|
v-close-popup
|
||||||
|
/>
|
||||||
|
<QBtn
|
||||||
|
v-if="!isNew"
|
||||||
|
:label="t('globals.delete')"
|
||||||
|
color="primary"
|
||||||
|
flat
|
||||||
|
class="q-mr-sm"
|
||||||
|
@click="
|
||||||
|
openConfirmationModal(
|
||||||
|
t('vehicle.deleteTitle'),
|
||||||
|
t('vehicle.deleteSubtitle'),
|
||||||
|
() => deleteVehicleEvent(),
|
||||||
|
)
|
||||||
|
"
|
||||||
|
/>
|
||||||
|
<QBtn
|
||||||
|
:label="isNew ? t('globals.save') : t('globals.add')"
|
||||||
|
@click="createVehicleEvent"
|
||||||
|
color="primary"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</FormPopup>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<i18n>
|
||||||
|
es:
|
||||||
|
Started: Inicio
|
||||||
|
Finished: Fin
|
||||||
|
Add vehicle event: Agregar evento
|
||||||
|
Edit vehicle event: Editar evento
|
||||||
|
</i18n>
|
|
@ -0,0 +1,86 @@
|
||||||
|
<script setup>
|
||||||
|
import { ref, reactive, onMounted } from 'vue';
|
||||||
|
import { useI18n } from 'vue-i18n';
|
||||||
|
|
||||||
|
import VehicleEventsPanel from './VehicleEventsPanel.vue';
|
||||||
|
import VehicleCalendarGrid from '../VehicleCalendarGrid.vue';
|
||||||
|
import VehicleEventInclusionForm from './VehicleEventInclusionForm.vue';
|
||||||
|
|
||||||
|
import { useStateStore } from 'stores/useStateStore';
|
||||||
|
import RightMenu from 'src/components/common/RightMenu.vue';
|
||||||
|
|
||||||
|
const { t } = useI18n();
|
||||||
|
const stateStore = useStateStore();
|
||||||
|
|
||||||
|
const firstDay = ref();
|
||||||
|
const lastDay = ref();
|
||||||
|
const events = ref([]);
|
||||||
|
const vehicleEventsPanelRef = ref(null);
|
||||||
|
const showVehicleEventForm = ref(false);
|
||||||
|
const vehicleEventsFormProps = reactive({
|
||||||
|
isNewMode: true,
|
||||||
|
date: null,
|
||||||
|
event: null,
|
||||||
|
});
|
||||||
|
|
||||||
|
const refreshEvents = async () => {
|
||||||
|
await vehicleEventsPanelRef.value.fetchData();
|
||||||
|
};
|
||||||
|
|
||||||
|
const openForm = (data) => {
|
||||||
|
const { date = null, isNewMode, event } = data;
|
||||||
|
Object.assign(vehicleEventsFormProps, { date, isNewMode, event });
|
||||||
|
|
||||||
|
showVehicleEventForm.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
const onVehicleEventFormClose = () => {
|
||||||
|
showVehicleEventForm.value = false;
|
||||||
|
vehicleEventsFormProps.value = {};
|
||||||
|
};
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<RightMenu>
|
||||||
|
<template #right-panel v-if="stateStore.isHeaderMounted()">
|
||||||
|
<VehicleEventsPanel
|
||||||
|
ref="vehicleEventsPanelRef"
|
||||||
|
:first-day="firstDay"
|
||||||
|
:last-day="lastDay"
|
||||||
|
:events="events"
|
||||||
|
@update:events="events = $event"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</RightMenu>
|
||||||
|
<QPage class="q-pa-md flex justify-center">
|
||||||
|
<VehicleCalendarGrid
|
||||||
|
v-model:events="events"
|
||||||
|
v-model:firstDay="firstDay"
|
||||||
|
v-model:lastDay="lastDay"
|
||||||
|
data-key="VehicleEvents"
|
||||||
|
@on-date-selected="openForm"
|
||||||
|
/>
|
||||||
|
<QDialog v-model="showVehicleEventForm" @hide="onVehicleEventFormClose()">
|
||||||
|
<VehicleEventInclusionForm
|
||||||
|
v-bind="vehicleEventsFormProps"
|
||||||
|
:first-day="firstDay"
|
||||||
|
:last-day="lastDay"
|
||||||
|
@close-form="onVehicleEventFormClose()"
|
||||||
|
@refresh-events="refreshEvents()"
|
||||||
|
/>
|
||||||
|
</QDialog>
|
||||||
|
<QPageSticky :offset="[20, 20]">
|
||||||
|
<QBtn
|
||||||
|
@click="openForm({ isNewMode: true }, true)"
|
||||||
|
color="primary"
|
||||||
|
fab
|
||||||
|
icon="add"
|
||||||
|
v-shortcut="'+'"
|
||||||
|
/>
|
||||||
|
<QTooltip class="text-no-wrap">
|
||||||
|
{{ t('eventsInclusionForm.addEvent') }}
|
||||||
|
</QTooltip>
|
||||||
|
</QPageSticky>
|
||||||
|
</QPage>
|
||||||
|
</template>
|
|
@ -0,0 +1,196 @@
|
||||||
|
<script setup>
|
||||||
|
import { onMounted, watch, computed, ref } from 'vue';
|
||||||
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import { useRoute } from 'vue-router';
|
||||||
|
|
||||||
|
import { useArrayData } from 'src/composables/useArrayData';
|
||||||
|
import axios from 'axios';
|
||||||
|
import { toDateFormat } from 'src/filters/date.js';
|
||||||
|
import { dashIfEmpty } from 'src/filters';
|
||||||
|
import { useWeekdayStore } from 'src/stores/useWeekdayStore';
|
||||||
|
import { useVnConfirm } from 'composables/useVnConfirm';
|
||||||
|
import useNotify from 'src/composables/useNotify.js';
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
firstDay: {
|
||||||
|
type: Date,
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
|
lastDay: {
|
||||||
|
type: Date,
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
|
events: {
|
||||||
|
type: Array,
|
||||||
|
default: () => [],
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const emit = defineEmits(['openVehicleForm']);
|
||||||
|
const { t } = useI18n();
|
||||||
|
const route = useRoute();
|
||||||
|
const { notify } = useNotify();
|
||||||
|
const weekdayStore = useWeekdayStore();
|
||||||
|
const { openConfirmationModal } = useVnConfirm();
|
||||||
|
const vehicleStates = ref({});
|
||||||
|
const fetchVehicleState = async () => {
|
||||||
|
const vehicles = await axios.get('VehicleStates');
|
||||||
|
vehicleStates.value = vehicles.data;
|
||||||
|
};
|
||||||
|
|
||||||
|
const getVehicleStateName = (id) => {
|
||||||
|
return vehicleStates.value[id - 1] ?? dashIfEmpty(id - 1);
|
||||||
|
};
|
||||||
|
|
||||||
|
const params = computed(() => ({
|
||||||
|
vehicleFk: route.params.id,
|
||||||
|
started: props.firstDay,
|
||||||
|
finished: props.lastDay,
|
||||||
|
}));
|
||||||
|
|
||||||
|
const arrayData = useArrayData('VehicleEvents', {
|
||||||
|
params: params,
|
||||||
|
url: `VehicleEvents`,
|
||||||
|
});
|
||||||
|
|
||||||
|
const fetchData = async () => {
|
||||||
|
if (!params.value.vehicleFk || !props.firstDay || !props.lastDay) return;
|
||||||
|
|
||||||
|
try {
|
||||||
|
await arrayData.applyFilter({
|
||||||
|
params: {
|
||||||
|
filter: {
|
||||||
|
where: {
|
||||||
|
vehicleFk: route.params.id,
|
||||||
|
and: [
|
||||||
|
{ or: [
|
||||||
|
{ started: { lte: props.lastDay } },
|
||||||
|
{ started: null }
|
||||||
|
]},
|
||||||
|
{ or: [
|
||||||
|
{ finished: { gte: props.firstDay } },
|
||||||
|
{ finished: null }
|
||||||
|
]}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
emit('update:events', arrayData.store.data || []);
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Error fetching events:', error);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
watch(
|
||||||
|
params,
|
||||||
|
async () => {
|
||||||
|
await fetchData();
|
||||||
|
},
|
||||||
|
{ immediate: true, deep: true },
|
||||||
|
);
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.events,
|
||||||
|
(newEvents) => {
|
||||||
|
emit('update:events', newEvents);
|
||||||
|
},
|
||||||
|
{ deep: true }
|
||||||
|
);
|
||||||
|
|
||||||
|
const deleteEvent = async (id) => {
|
||||||
|
if (!id) return;
|
||||||
|
await axios.delete(`VehicleEvents/${id}`);
|
||||||
|
notify(t('globals.dataSaved'), 'positive');
|
||||||
|
await fetchData();
|
||||||
|
};
|
||||||
|
|
||||||
|
const openInclusionForm = (event) => {
|
||||||
|
emit('openVehicleForm', {
|
||||||
|
date: event.dated,
|
||||||
|
event,
|
||||||
|
isNewMode: false,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
|
weekdayStore.initStore();
|
||||||
|
await fetchVehicleState();
|
||||||
|
});
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
fetchData
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<QForm @submit="onSubmit()">
|
||||||
|
<div class="column q-pa-md q-gutter-y-sm"></div>
|
||||||
|
<span class="color-vn-label text-subtitle1 q-px-md">{{
|
||||||
|
t('eventsPanel.events')
|
||||||
|
}}</span>
|
||||||
|
<QList>
|
||||||
|
<QItem v-for="(event, index) in events" :key="index" class="event-card">
|
||||||
|
<QItemSection left @click="openInclusionForm(event)">
|
||||||
|
<div class="q-mb-xs">
|
||||||
|
<span
|
||||||
|
>({{ toDateFormat(event.started) }} -
|
||||||
|
{{ toDateFormat(event.finished) }})</span
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
<span class="color-vn-label"
|
||||||
|
>{{ t('globals.description') }}:
|
||||||
|
<span class="color-vn-text q-ml-xs">{{
|
||||||
|
dashIfEmpty(event.description)
|
||||||
|
}}</span>
|
||||||
|
</span>
|
||||||
|
<span class="color-vn-label"
|
||||||
|
>{{ t('globals.state') }}:
|
||||||
|
<span class="color-vn-text">{{
|
||||||
|
getVehicleStateName(event.vehicleStateFk).state
|
||||||
|
}}</span>
|
||||||
|
</span>
|
||||||
|
</QItemSection>
|
||||||
|
<QItemSection side @click="openInclusionForm(event)">
|
||||||
|
<QBtn
|
||||||
|
icon="delete"
|
||||||
|
data-cy="delete_event"
|
||||||
|
flat
|
||||||
|
dense
|
||||||
|
size="md"
|
||||||
|
color="primary"
|
||||||
|
@click.stop="
|
||||||
|
openConfirmationModal(
|
||||||
|
t('vehicle.deleteTitle'),
|
||||||
|
t('vehicle.deleteSubtitle'),
|
||||||
|
() => deleteEvent(event.id),
|
||||||
|
)
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<QTooltip>{{ t('eventsPanel.delete') }}</QTooltip>
|
||||||
|
</QBtn>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
<span
|
||||||
|
v-if="!events.length"
|
||||||
|
class="flex justify-center text-h5 color-vn-label"
|
||||||
|
>
|
||||||
|
{{ t('globals.noResults') }}
|
||||||
|
</span>
|
||||||
|
</QList>
|
||||||
|
</QForm>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.event-card {
|
||||||
|
display: flex;
|
||||||
|
border-bottom: $border-thin-light;
|
||||||
|
margin: 0;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background-color: var(--vn-accent-color);
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -0,0 +1,13 @@
|
||||||
|
<script setup>
|
||||||
|
import EntityCalendar from 'src/components/EntityCalendar.vue';
|
||||||
|
|
||||||
|
const emit = defineEmits(['onDateSelected']);
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<EntityCalendar
|
||||||
|
v-bind="$props"
|
||||||
|
@onDateSelected="(e) => emit('onDateSelected', e)"
|
||||||
|
/>
|
||||||
|
</template>
|
|
@ -0,0 +1,97 @@
|
||||||
|
<script setup>
|
||||||
|
import { ref, watch } from 'vue';
|
||||||
|
import EntityCalendarGrid from 'src/components/EntityCalendarGrid.vue';
|
||||||
|
import VehicleCalendar from './VehicleCalendar.vue';
|
||||||
|
import { useArrayData } from 'src/composables/useArrayData';
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
dataKey: {
|
||||||
|
type: String,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const firstDay = ref(new Date());
|
||||||
|
const lastDay = ref(new Date());
|
||||||
|
const entityCalendarRef = ref(null);
|
||||||
|
|
||||||
|
const arrayData = useArrayData(props.dataKey);
|
||||||
|
const { store } = arrayData;
|
||||||
|
const _data = ref(null);
|
||||||
|
const days = ref({});
|
||||||
|
const events = ref([]);
|
||||||
|
|
||||||
|
const refreshEvents = () => {
|
||||||
|
days.value = {};
|
||||||
|
if (!events.value?.length || !firstDay.value || !lastDay.value) return;
|
||||||
|
|
||||||
|
let day = new Date(firstDay.value.getTime());
|
||||||
|
let endDate = new Date(lastDay.value.getTime());
|
||||||
|
|
||||||
|
while (day <= endDate) {
|
||||||
|
let stamp = day.getTime();
|
||||||
|
let dayEvents = [];
|
||||||
|
|
||||||
|
for (let event of events.value) {
|
||||||
|
const eventStart = event.started ? new Date(event.started).getTime() : null;
|
||||||
|
const eventEnd = event.finished ? new Date(event.finished).getTime() : null;
|
||||||
|
|
||||||
|
let match = (!eventStart || stamp >= eventStart) &&
|
||||||
|
(!eventEnd || stamp <= eventEnd);
|
||||||
|
|
||||||
|
if (match) {
|
||||||
|
dayEvents.push(event);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dayEvents.length) {
|
||||||
|
days.value[stamp] = dayEvents;
|
||||||
|
}
|
||||||
|
|
||||||
|
day.setDate(day.getDate() + 1);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => store.data,
|
||||||
|
(value) => {
|
||||||
|
_data.value = value;
|
||||||
|
events.value = Array.isArray(value) ? value : [];
|
||||||
|
|
||||||
|
function toStamp(date) {
|
||||||
|
return date && new Date(date).setHours(0, 0, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (events.value) {
|
||||||
|
for (let event of events.value) {
|
||||||
|
event.dated = toStamp(event.dated);
|
||||||
|
event.finished = toStamp(event.finished);
|
||||||
|
event.started = toStamp(event.started);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
refreshEvents();
|
||||||
|
},
|
||||||
|
{ immediate: true },
|
||||||
|
);
|
||||||
|
|
||||||
|
watch(() => entityCalendarRef.value?.firstDay, (newVal) => {
|
||||||
|
if (newVal) firstDay.value = new Date(newVal);
|
||||||
|
});
|
||||||
|
|
||||||
|
watch(() => entityCalendarRef.value?.lastDay, (newVal) => {
|
||||||
|
if (newVal) lastDay.value = new Date(newVal);
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<EntityCalendarGrid
|
||||||
|
ref="entityCalendarRef"
|
||||||
|
:data-key="dataKey"
|
||||||
|
:calendar-component="VehicleCalendar"
|
||||||
|
:additional-props="{ daysMap: days }"
|
||||||
|
@refresh-events="refreshEvents"
|
||||||
|
v-bind="$attrs"
|
||||||
|
/>
|
||||||
|
</template>
|
|
@ -15,6 +15,8 @@ vehicle:
|
||||||
remove: Vehicle removed
|
remove: Vehicle removed
|
||||||
search: Search Vehicle
|
search: Search Vehicle
|
||||||
searchInfo: Search by id or number plate
|
searchInfo: Search by id or number plate
|
||||||
|
deleteTitle: This item will be deleted
|
||||||
|
deleteSubtitle: Are you sure you want to continue?
|
||||||
params:
|
params:
|
||||||
vehicleTypeFk: Type
|
vehicleTypeFk: Type
|
||||||
vehicleStateFk: State
|
vehicleStateFk: State
|
||||||
|
|
|
@ -15,6 +15,8 @@ vehicle:
|
||||||
remove: Vehículo eliminado
|
remove: Vehículo eliminado
|
||||||
search: Buscar Vehículo
|
search: Buscar Vehículo
|
||||||
searchInfo: Buscar por id o matrícula
|
searchInfo: Buscar por id o matrícula
|
||||||
|
deleteTitle: Este elemento será eliminado
|
||||||
|
deleteSubtitle: ¿Seguro que quieres continuar?
|
||||||
params:
|
params:
|
||||||
vehicleTypeFk: Tipo
|
vehicleTypeFk: Tipo
|
||||||
vehicleStateFk: Estado
|
vehicleStateFk: Estado
|
||||||
|
|
|
@ -51,6 +51,11 @@ route:
|
||||||
agencyModeName: Agency route
|
agencyModeName: Agency route
|
||||||
isOwn: Own
|
isOwn: Own
|
||||||
isAnyVolumeAllowed: Any volume allowed
|
isAnyVolumeAllowed: Any volume allowed
|
||||||
|
created: Created
|
||||||
|
addressFromFk: Sender
|
||||||
|
addressToFk: Destination
|
||||||
|
landed: Landed
|
||||||
|
ead: EAD
|
||||||
Worker: Worker
|
Worker: Worker
|
||||||
Agency: Agency
|
Agency: Agency
|
||||||
Vehicle: Vehicle
|
Vehicle: Vehicle
|
||||||
|
@ -70,21 +75,3 @@ route:
|
||||||
searchInfo: You can search by route reference
|
searchInfo: You can search by route reference
|
||||||
dated: Dated
|
dated: Dated
|
||||||
preview: Preview
|
preview: Preview
|
||||||
cmr:
|
|
||||||
search: Search Cmr
|
|
||||||
searchInfo: You can search Cmr by Id
|
|
||||||
params:
|
|
||||||
results: results
|
|
||||||
cmrFk: CMR id
|
|
||||||
hasCmrDms: Attached in gestdoc
|
|
||||||
'true': 'Yes'
|
|
||||||
'false': 'No'
|
|
||||||
ticketFk: Ticketd id
|
|
||||||
routeFk: Route id
|
|
||||||
countryFk: Country
|
|
||||||
clientFk: Client id
|
|
||||||
warehouseFk: Warehouse
|
|
||||||
shipped: Preparation date
|
|
||||||
viewCmr: View CMR
|
|
||||||
downloadCmrs: Download CMRs
|
|
||||||
search: General search
|
|
||||||
|
|
|
@ -47,11 +47,16 @@ route:
|
||||||
routeFk: Id ruta
|
routeFk: Id ruta
|
||||||
clientFk: Id cliente
|
clientFk: Id cliente
|
||||||
countryFk: Pais
|
countryFk: Pais
|
||||||
shipped: Fecha preparación
|
shipped: F. envío
|
||||||
agencyModeName: Agencia Ruta
|
agencyModeName: Agencia Ruta
|
||||||
agencyAgreement: Agencia Acuerdo
|
agencyAgreement: Agencia Acuerdo
|
||||||
isOwn: Propio
|
isOwn: Propio
|
||||||
isAnyVolumeAllowed: Cualquier volumen
|
isAnyVolumeAllowed: Cualquier volumen
|
||||||
|
created: Creado
|
||||||
|
addressFromFk: Remitente
|
||||||
|
addressToFk: Destinatario
|
||||||
|
landed: F. entrega
|
||||||
|
ead: ETD
|
||||||
Worker: Trabajador
|
Worker: Trabajador
|
||||||
Agency: Agencia
|
Agency: Agencia
|
||||||
Vehicle: Vehículo
|
Vehicle: Vehículo
|
||||||
|
|
|
@ -239,6 +239,9 @@ async function getZone(options) {
|
||||||
<FetchData
|
<FetchData
|
||||||
url="Warehouses"
|
url="Warehouses"
|
||||||
@on-fetch="(data) => (warehousesOptions = data)"
|
@on-fetch="(data) => (warehousesOptions = data)"
|
||||||
|
:where="{
|
||||||
|
isForTicket: true,
|
||||||
|
}"
|
||||||
auto-load
|
auto-load
|
||||||
/>
|
/>
|
||||||
<FetchData
|
<FetchData
|
||||||
|
@ -414,13 +417,6 @@ async function getZone(options) {
|
||||||
:rules="validate('ticketList.shipped')"
|
:rules="validate('ticketList.shipped')"
|
||||||
@update:model-value="setShipped"
|
@update:model-value="setShipped"
|
||||||
/>
|
/>
|
||||||
<VnInputTime
|
|
||||||
:label="t('basicData.shippedHour')"
|
|
||||||
v-model="formData.shipped"
|
|
||||||
:required="true"
|
|
||||||
:rules="validate('basicData.shippedHour')"
|
|
||||||
@update:model-value="setShipped"
|
|
||||||
/>
|
|
||||||
<VnInputDate
|
<VnInputDate
|
||||||
:label="t('basicData.landed')"
|
:label="t('basicData.landed')"
|
||||||
v-model="formData.landed"
|
v-model="formData.landed"
|
||||||
|
|
|
@ -55,73 +55,75 @@ async function handleSave(e) {
|
||||||
auto-load
|
auto-load
|
||||||
url="ObservationTypes"
|
url="ObservationTypes"
|
||||||
/>
|
/>
|
||||||
<div class="flex justify-center">
|
<div class="full-width flex justify-center">
|
||||||
<CrudModel
|
<QPage class="card-width q-pa-lg">
|
||||||
ref="ticketNotesCrudRef"
|
<CrudModel
|
||||||
data-key="TicketNotes"
|
class="fit"
|
||||||
url="TicketObservations"
|
ref="ticketNotesCrudRef"
|
||||||
model="TicketNotes"
|
data-key="TicketNotes"
|
||||||
:filter="crudModelFilter"
|
url="TicketObservations"
|
||||||
:data-required="crudModelRequiredData"
|
model="TicketNotes"
|
||||||
:default-remove="false"
|
:filter="crudModelFilter"
|
||||||
auto-load
|
:data-required="crudModelRequiredData"
|
||||||
style="max-width: 800px"
|
:default-remove="false"
|
||||||
>
|
auto-load
|
||||||
<template #body="{ rows }">
|
>
|
||||||
<QCard class="q-px-lg q-py-md">
|
<template #body="{ rows }">
|
||||||
<div
|
<QCard class="q-px-lg q-py-md">
|
||||||
v-for="(row, index) in rows"
|
<div
|
||||||
:key="index"
|
v-for="(row, index) in rows"
|
||||||
class="q-mb-md row q-gutter-x-md"
|
:key="index"
|
||||||
>
|
class="q-mb-md row items-center q-gutter-x-md"
|
||||||
<VnSelect
|
|
||||||
:label="t('ticketNotes.observationType')"
|
|
||||||
:options="observationTypes"
|
|
||||||
hide-selected
|
|
||||||
option-label="description"
|
|
||||||
option-value="id"
|
|
||||||
v-model="row.observationTypeFk"
|
|
||||||
:disable="!!row.id"
|
|
||||||
data-cy="ticketNotesObservationType"
|
|
||||||
/>
|
|
||||||
<VnInput
|
|
||||||
:label="t('basicData.description')"
|
|
||||||
v-model="row.description"
|
|
||||||
class="col"
|
|
||||||
@keydown.enter.stop="handleSave"
|
|
||||||
autogrow
|
|
||||||
data-cy="ticketNotesDescription"
|
|
||||||
/>
|
|
||||||
<QIcon
|
|
||||||
name="delete"
|
|
||||||
size="sm"
|
|
||||||
class="cursor-pointer"
|
|
||||||
color="primary"
|
|
||||||
@click="handleDelete(row)"
|
|
||||||
data-cy="ticketNotesRemoveNoteBtn"
|
|
||||||
>
|
>
|
||||||
<QTooltip>
|
<VnSelect
|
||||||
{{ t('ticketNotes.removeNote') }}
|
:label="t('ticketNotes.observationType')"
|
||||||
</QTooltip>
|
:options="observationTypes"
|
||||||
</QIcon>
|
hide-selected
|
||||||
</div>
|
option-label="description"
|
||||||
<VnRow v-if="observationTypes.length > rows.length">
|
option-value="id"
|
||||||
<QBtn
|
v-model="row.observationTypeFk"
|
||||||
icon="add_circle"
|
:disable="!!row.id"
|
||||||
v-shortcut="'+'"
|
data-cy="ticketNotesObservationType"
|
||||||
flat
|
/>
|
||||||
class="fill-icon-on-hover q-ml-md"
|
<VnInput
|
||||||
color="primary"
|
:label="t('basicData.description')"
|
||||||
@click="ticketNotesCrudRef.insert()"
|
v-model="row.description"
|
||||||
data-cy="ticketNotesAddNoteBtn"
|
class="col"
|
||||||
>
|
@keydown.enter.stop="handleSave"
|
||||||
<QTooltip>
|
autogrow
|
||||||
{{ t('ticketNotes.addNote') }}
|
data-cy="ticketNotesDescription"
|
||||||
</QTooltip>
|
/>
|
||||||
</QBtn>
|
<QIcon
|
||||||
</VnRow>
|
name="delete"
|
||||||
</QCard>
|
size="sm"
|
||||||
</template>
|
class="cursor-pointer"
|
||||||
</CrudModel>
|
color="primary"
|
||||||
|
@click="handleDelete(row)"
|
||||||
|
data-cy="ticketNotesRemoveNoteBtn"
|
||||||
|
>
|
||||||
|
<QTooltip>
|
||||||
|
{{ t('ticketNotes.removeNote') }}
|
||||||
|
</QTooltip>
|
||||||
|
</QIcon>
|
||||||
|
</div>
|
||||||
|
<VnRow v-if="observationTypes.length > rows.length">
|
||||||
|
<QBtn
|
||||||
|
icon="add_circle"
|
||||||
|
v-shortcut="'+'"
|
||||||
|
flat
|
||||||
|
class="fill-icon-on-hover q-ml-md"
|
||||||
|
color="primary"
|
||||||
|
@click="ticketNotesCrudRef.insert()"
|
||||||
|
data-cy="ticketNotesAddNoteBtn"
|
||||||
|
>
|
||||||
|
<QTooltip>
|
||||||
|
{{ t('ticketNotes.addNote') }}
|
||||||
|
</QTooltip>
|
||||||
|
</QBtn>
|
||||||
|
</VnRow>
|
||||||
|
</QCard>
|
||||||
|
</template>
|
||||||
|
</CrudModel>
|
||||||
|
</QPage>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -49,88 +49,95 @@ watch(
|
||||||
<FetchData
|
<FetchData
|
||||||
@on-fetch="(data) => (listPackagingsOptions = data)"
|
@on-fetch="(data) => (listPackagingsOptions = data)"
|
||||||
auto-load
|
auto-load
|
||||||
:filter="{ fields: ['packagingFk', 'name'], order: 'name ASC' }"
|
|
||||||
url="Packagings/listPackaging"
|
url="Packagings/listPackaging"
|
||||||
|
:filter="{
|
||||||
|
fields: ['packagingFk', 'name'],
|
||||||
|
order: ['name ASC'],
|
||||||
|
}"
|
||||||
/>
|
/>
|
||||||
<div class="flex justify-center">
|
<div class="full-width flex justify-center">
|
||||||
<CrudModel
|
<QPage class="card-width q-pa-lg">
|
||||||
ref="ticketPackagingsCrudRef"
|
<CrudModel
|
||||||
data-key="TicketPackagings"
|
ref="ticketPackagingsCrudRef"
|
||||||
url="TicketPackagings"
|
data-key="TicketPackagings"
|
||||||
model="TicketPackagings"
|
url="TicketPackagings"
|
||||||
:filter="crudModelFilter"
|
model="TicketPackagings"
|
||||||
:data-required="crudModelRequiredData"
|
:filter="crudModelFilter"
|
||||||
:default-remove="false"
|
:data-required="crudModelRequiredData"
|
||||||
auto-load
|
:default-remove="false"
|
||||||
style="max-width: 800px"
|
auto-load
|
||||||
>
|
>
|
||||||
<template #body="{ rows, validate }">
|
<template #body="{ rows, validate }">
|
||||||
<QCard class="q-px-lg q-py-md">
|
<QCard class="q-px-lg q-py-md">
|
||||||
<div
|
<div
|
||||||
v-for="(row, index) in rows"
|
v-for="(row, index) in rows"
|
||||||
:key="index"
|
:key="index"
|
||||||
class="q-mb-md row items-center q-gutter-x-md"
|
class="q-mb-md row items-center q-gutter-x-md"
|
||||||
>
|
|
||||||
<VnSelect
|
|
||||||
:label="t('package.package')"
|
|
||||||
:options="listPackagingsOptions"
|
|
||||||
hide-selected
|
|
||||||
option-label="name"
|
|
||||||
option-value="packagingFk"
|
|
||||||
v-model="row.packagingFk"
|
|
||||||
>
|
>
|
||||||
<template #option="scope">
|
<VnSelect
|
||||||
<QItem v-bind="scope.itemProps">
|
:label="t('package.package')"
|
||||||
<QItemSection>
|
:options="listPackagingsOptions"
|
||||||
<QItemLabel>
|
hide-selected
|
||||||
{{ scope.opt?.name }}
|
option-label="name"
|
||||||
</QItemLabel>
|
option-value="packagingFk"
|
||||||
<QItemLabel caption>
|
v-model="row.packagingFk"
|
||||||
#{{ scope.opt?.itemFk }}
|
>
|
||||||
</QItemLabel>
|
<template #option="scope">
|
||||||
</QItemSection>
|
<QItem v-bind="scope.itemProps">
|
||||||
</QItem>
|
<QItemSection>
|
||||||
</template>
|
<QItemLabel>
|
||||||
</VnSelect>
|
{{ scope.opt?.name }}
|
||||||
<VnInput
|
</QItemLabel>
|
||||||
:label="t('basicData.quantity')"
|
<QItemLabel caption>
|
||||||
v-model.number="row.quantity"
|
#{{ scope.opt?.itemFk }}
|
||||||
class="col"
|
</QItemLabel>
|
||||||
type="number"
|
</QItemSection>
|
||||||
min="1"
|
</QItem>
|
||||||
:required="true"
|
</template>
|
||||||
@update:model-value="handleInputQuantityClear(row)"
|
</VnSelect>
|
||||||
:rules="validate('TicketPackaging.quantity')"
|
<VnInput
|
||||||
/>
|
:label="t('basicData.quantity')"
|
||||||
<VnInputDate :label="t('package.added')" v-model="row.created" />
|
v-model.number="row.quantity"
|
||||||
<QIcon
|
class="col"
|
||||||
name="delete"
|
type="number"
|
||||||
size="sm"
|
min="1"
|
||||||
class="cursor-pointer"
|
:required="true"
|
||||||
color="primary"
|
@update:model-value="handleInputQuantityClear(row)"
|
||||||
@click="ticketPackagingsCrudRef.remove([row])"
|
:rules="validate('TicketPackaging.quantity')"
|
||||||
>
|
/>
|
||||||
<QTooltip>
|
<VnInputDate
|
||||||
{{ t('package.removePackage') }}
|
:label="t('package.added')"
|
||||||
</QTooltip>
|
v-model="row.created"
|
||||||
</QIcon>
|
/>
|
||||||
</div>
|
<QIcon
|
||||||
<VnRow>
|
name="delete"
|
||||||
<QBtn
|
size="sm"
|
||||||
icon="add_circle"
|
class="cursor-pointer"
|
||||||
v-shortcut="'+'"
|
color="primary"
|
||||||
flat
|
@click="ticketPackagingsCrudRef.remove([row])"
|
||||||
class="fill-icon-on-hover q-ml-md"
|
>
|
||||||
color="primary"
|
<QTooltip>
|
||||||
@click="ticketPackagingsCrudRef.insert()"
|
{{ t('package.removePackage') }}
|
||||||
>
|
</QTooltip>
|
||||||
<QTooltip>
|
</QIcon>
|
||||||
{{ t('package.addPackage') }}
|
</div>
|
||||||
</QTooltip>
|
<VnRow>
|
||||||
</QBtn>
|
<QBtn
|
||||||
</VnRow>
|
icon="add_circle"
|
||||||
</QCard>
|
v-shortcut="'+'"
|
||||||
</template>
|
flat
|
||||||
</CrudModel>
|
class="fill-icon-on-hover q-ml-md"
|
||||||
|
color="primary"
|
||||||
|
@click="ticketPackagingsCrudRef.insert()"
|
||||||
|
>
|
||||||
|
<QTooltip>
|
||||||
|
{{ t('package.addPackage') }}
|
||||||
|
</QTooltip>
|
||||||
|
</QBtn>
|
||||||
|
</VnRow>
|
||||||
|
</QCard>
|
||||||
|
</template>
|
||||||
|
</CrudModel>
|
||||||
|
</QPage>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -47,7 +47,14 @@ const setUserParams = (params) => {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<FetchData url="Warehouses" @on-fetch="(data) => (warehouses = data)" auto-load />
|
<FetchData
|
||||||
|
url="Warehouses"
|
||||||
|
@on-fetch="(data) => (warehouses = data)"
|
||||||
|
:where="{
|
||||||
|
isForTicket: true,
|
||||||
|
}"
|
||||||
|
auto-load
|
||||||
|
/>
|
||||||
<FetchData
|
<FetchData
|
||||||
url="ItemCategories"
|
url="ItemCategories"
|
||||||
:filter="{ fields: ['id', 'name'], order: 'name ASC' }"
|
:filter="{ fields: ['id', 'name'], order: 'name ASC' }"
|
||||||
|
|
|
@ -385,7 +385,12 @@ watch(
|
||||||
if (!$el) return;
|
if (!$el) return;
|
||||||
const head = $el.querySelector('thead');
|
const head = $el.querySelector('thead');
|
||||||
const firstRow = $el.querySelector('thead > tr');
|
const firstRow = $el.querySelector('thead > tr');
|
||||||
|
const headSelectionCol = $el.querySelector(
|
||||||
|
'thead tr.bg-header th.q-table--col-auto-width',
|
||||||
|
);
|
||||||
|
if (headSelectionCol) {
|
||||||
|
headSelectionCol.classList.add('horizontal-separator');
|
||||||
|
}
|
||||||
const newRow = document.createElement('tr');
|
const newRow = document.createElement('tr');
|
||||||
destinationElRef.value = document.createElement('th');
|
destinationElRef.value = document.createElement('th');
|
||||||
originElRef.value = document.createElement('th');
|
originElRef.value = document.createElement('th');
|
||||||
|
@ -394,8 +399,8 @@ watch(
|
||||||
destinationElRef.value.classList.add('text-uppercase', 'color-vn-label');
|
destinationElRef.value.classList.add('text-uppercase', 'color-vn-label');
|
||||||
originElRef.value.classList.add('text-uppercase', 'color-vn-label');
|
originElRef.value.classList.add('text-uppercase', 'color-vn-label');
|
||||||
|
|
||||||
destinationElRef.value.setAttribute('colspan', '7');
|
destinationElRef.value.setAttribute('colspan', '10');
|
||||||
originElRef.value.setAttribute('colspan', '9');
|
originElRef.value.setAttribute('colspan', '10');
|
||||||
|
|
||||||
destinationElRef.value.textContent = `${t(
|
destinationElRef.value.textContent = `${t(
|
||||||
'advanceTickets.destination',
|
'advanceTickets.destination',
|
||||||
|
@ -490,8 +495,6 @@ watch(
|
||||||
selection: 'multiple',
|
selection: 'multiple',
|
||||||
}"
|
}"
|
||||||
v-model:selected="selectedTickets"
|
v-model:selected="selectedTickets"
|
||||||
:pagination="{ rowsPerPage: 0 }"
|
|
||||||
:no-data-label="$t('globals.noResults')"
|
|
||||||
:right-search="false"
|
:right-search="false"
|
||||||
:order="['futureTotalWithVat ASC']"
|
:order="['futureTotalWithVat ASC']"
|
||||||
auto-load
|
auto-load
|
||||||
|
|
|
@ -51,6 +51,9 @@ onMounted(async () => await getItemPackingTypes());
|
||||||
<FetchData
|
<FetchData
|
||||||
url="Warehouses"
|
url="Warehouses"
|
||||||
@on-fetch="(data) => (warehousesOptions = data)"
|
@on-fetch="(data) => (warehousesOptions = data)"
|
||||||
|
:where="{
|
||||||
|
isForTicket: true,
|
||||||
|
}"
|
||||||
auto-load
|
auto-load
|
||||||
/>
|
/>
|
||||||
<VnFilterPanel
|
<VnFilterPanel
|
||||||
|
|
|
@ -67,14 +67,12 @@ const onClientSelected = async (formData) => {
|
||||||
|
|
||||||
const fetchAvailableAgencies = async (formData) => {
|
const fetchAvailableAgencies = async (formData) => {
|
||||||
resetAgenciesSelector(formData);
|
resetAgenciesSelector(formData);
|
||||||
const response= await getAgencies(formData, selectedClient.value);
|
const response = await getAgencies(formData, selectedClient.value);
|
||||||
if (!response) return;
|
if (!response) return;
|
||||||
|
|
||||||
const { options, agency } = response
|
const { options, agency } = response;
|
||||||
if(options)
|
if (options) agenciesOptions.value = options;
|
||||||
agenciesOptions.value = options;
|
if (agency) formData.agencyModeId = agency;
|
||||||
if(agency)
|
|
||||||
formData.agencyModeId = agency;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const redirectToTicketList = (_, { id }) => {
|
const redirectToTicketList = (_, { id }) => {
|
||||||
|
@ -92,6 +90,9 @@ const redirectToTicketList = (_, { id }) => {
|
||||||
<FetchData
|
<FetchData
|
||||||
url="Warehouses"
|
url="Warehouses"
|
||||||
@on-fetch="(data) => (warehousesOptions = data)"
|
@on-fetch="(data) => (warehousesOptions = data)"
|
||||||
|
:where="{
|
||||||
|
isForTicket: true,
|
||||||
|
}"
|
||||||
order="name"
|
order="name"
|
||||||
auto-load
|
auto-load
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -40,7 +40,7 @@ onBeforeMount(async () => {
|
||||||
|
|
||||||
function resetAgenciesSelector(formData) {
|
function resetAgenciesSelector(formData) {
|
||||||
agenciesOptions.value = [];
|
agenciesOptions.value = [];
|
||||||
if(formData) formData.agencyModeId = null;
|
if (formData) formData.agencyModeId = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const fetchClient = async (formData) => {
|
const fetchClient = async (formData) => {
|
||||||
|
@ -67,14 +67,12 @@ const onClientSelected = async (formData) => {
|
||||||
|
|
||||||
const fetchAvailableAgencies = async (formData) => {
|
const fetchAvailableAgencies = async (formData) => {
|
||||||
resetAgenciesSelector(formData);
|
resetAgenciesSelector(formData);
|
||||||
const response= await getAgencies(formData, selectedClient.value);
|
const response = await getAgencies(formData, selectedClient.value);
|
||||||
if (!response) return;
|
if (!response) return;
|
||||||
|
|
||||||
const { options, agency } = response
|
const { options, agency } = response;
|
||||||
if(options)
|
if (options) agenciesOptions.value = options;
|
||||||
agenciesOptions.value = options;
|
if (agency) formData.agencyModeId = agency;
|
||||||
if(agency)
|
|
||||||
formData.agencyModeId = agency;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const redirectToTicketList = (_, { id }) => {
|
const redirectToTicketList = (_, { id }) => {
|
||||||
|
@ -86,6 +84,9 @@ const redirectToTicketList = (_, { id }) => {
|
||||||
<FetchData
|
<FetchData
|
||||||
url="Warehouses"
|
url="Warehouses"
|
||||||
@on-fetch="(data) => (warehousesOptions = data)"
|
@on-fetch="(data) => (warehousesOptions = data)"
|
||||||
|
:where="{
|
||||||
|
isForTicket: true,
|
||||||
|
}"
|
||||||
order="name"
|
order="name"
|
||||||
auto-load
|
auto-load
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -41,8 +41,19 @@ const groupedStates = ref([]);
|
||||||
@on-fetch="(data) => (agencies = data)"
|
@on-fetch="(data) => (agencies = data)"
|
||||||
auto-load
|
auto-load
|
||||||
/>
|
/>
|
||||||
<FetchData url="Warehouses" @on-fetch="(data) => (warehouses = data)" auto-load />
|
<FetchData
|
||||||
<VnFilterPanel :data-key="props.dataKey" :search-button="true">
|
url="Warehouses"
|
||||||
|
@on-fetch="(data) => (warehouses = data)"
|
||||||
|
auto-load
|
||||||
|
:where="{
|
||||||
|
isForTicket: true,
|
||||||
|
}"
|
||||||
|
/>
|
||||||
|
<VnFilterPanel
|
||||||
|
:data-key="props.dataKey"
|
||||||
|
:search-button="true"
|
||||||
|
:unremovableParams="['from', 'to']"
|
||||||
|
>
|
||||||
<template #tags="{ tag, formatFn }">
|
<template #tags="{ tag, formatFn }">
|
||||||
<div class="q-gutter-x-xs">
|
<div class="q-gutter-x-xs">
|
||||||
<strong>{{ t(`params.${tag.label}`) }}: </strong>
|
<strong>{{ t(`params.${tag.label}`) }}: </strong>
|
||||||
|
|
|
@ -89,7 +89,7 @@ const ticketColumns = computed(() => [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('advanceTickets.import'),
|
label: t('advanceTickets.import'),
|
||||||
name: 'import',
|
name: 'totalWithVat',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
headerClass: 'horizontal-separator',
|
headerClass: 'horizontal-separator',
|
||||||
columnFilter: false,
|
columnFilter: false,
|
||||||
|
@ -317,7 +317,7 @@ watch(
|
||||||
</QBadge>
|
</QBadge>
|
||||||
<span v-else> {{ dashIfEmpty(row.state) }}</span>
|
<span v-else> {{ dashIfEmpty(row.state) }}</span>
|
||||||
</template>
|
</template>
|
||||||
<template #column-import="{ row }">
|
<template #column-totalWithVat="{ row }">
|
||||||
<QBadge
|
<QBadge
|
||||||
:text-color="
|
:text-color="
|
||||||
totalPriceColor(row.totalWithVat) === 'warning'
|
totalPriceColor(row.totalWithVat) === 'warning'
|
||||||
|
|
|
@ -55,6 +55,9 @@ onMounted(async () => {
|
||||||
<FetchData
|
<FetchData
|
||||||
url="Warehouses"
|
url="Warehouses"
|
||||||
@on-fetch="(data) => (warehousesOptions = data)"
|
@on-fetch="(data) => (warehousesOptions = data)"
|
||||||
|
:where="{
|
||||||
|
isForTicket: true,
|
||||||
|
}"
|
||||||
auto-load
|
auto-load
|
||||||
/>
|
/>
|
||||||
<VnFilterPanel
|
<VnFilterPanel
|
||||||
|
|
|
@ -204,6 +204,9 @@ const columns = computed(() => [
|
||||||
attrs: {
|
attrs: {
|
||||||
url: 'warehouses',
|
url: 'warehouses',
|
||||||
fields: ['id', 'name'],
|
fields: ['id', 'name'],
|
||||||
|
where: {
|
||||||
|
isForTicket: true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
format: (row) => row.warehouse,
|
format: (row) => row.warehouse,
|
||||||
columnField: {
|
columnField: {
|
||||||
|
@ -670,9 +673,11 @@ function setReference(data) {
|
||||||
:sort-by="['name']"
|
:sort-by="['name']"
|
||||||
:label="t('globals.warehouse')"
|
:label="t('globals.warehouse')"
|
||||||
v-model="data.warehouseId"
|
v-model="data.warehouseId"
|
||||||
:options="warehousesOptions"
|
|
||||||
hide-selected
|
hide-selected
|
||||||
required
|
required
|
||||||
|
:where="{
|
||||||
|
isForTicket: true,
|
||||||
|
}"
|
||||||
@update:model-value="() => fetchAvailableAgencies(data)"
|
@update:model-value="() => fetchAvailableAgencies(data)"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -102,6 +102,9 @@ const columns = computed(() => [
|
||||||
attrs: {
|
attrs: {
|
||||||
url: 'Warehouses',
|
url: 'Warehouses',
|
||||||
fields: ['id', 'name'],
|
fields: ['id', 'name'],
|
||||||
|
where: {
|
||||||
|
isForTicket: true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
inWhere: true,
|
inWhere: true,
|
||||||
},
|
},
|
||||||
|
|
|
@ -208,6 +208,7 @@ ticketList:
|
||||||
hour: Hour
|
hour: Hour
|
||||||
rounding: Rounding
|
rounding: Rounding
|
||||||
noVerifiedData: No verified data
|
noVerifiedData: No verified data
|
||||||
|
warehouse: Warehouse
|
||||||
purchaseRequest: Purchase request
|
purchaseRequest: Purchase request
|
||||||
notVisible: Not visible
|
notVisible: Not visible
|
||||||
clientFrozen: Client frozen
|
clientFrozen: Client frozen
|
||||||
|
|
|
@ -28,13 +28,17 @@ const warehousesOptionsIn = ref([]);
|
||||||
url="Warehouses"
|
url="Warehouses"
|
||||||
@on-fetch="(data) => (warehousesOptionsOut = data)"
|
@on-fetch="(data) => (warehousesOptionsOut = data)"
|
||||||
auto-load
|
auto-load
|
||||||
:filter="{ where: { isOrigin: TRUE } }"
|
:where="{
|
||||||
|
isOrigin: true,
|
||||||
|
}"
|
||||||
/>
|
/>
|
||||||
<FetchData
|
<FetchData
|
||||||
url="Warehouses"
|
url="Warehouses"
|
||||||
@on-fetch="(data) => (warehousesOptionsIn = data)"
|
@on-fetch="(data) => (warehousesOptionsIn = data)"
|
||||||
auto-load
|
auto-load
|
||||||
:filter="{ where: { isDestiny: TRUE } }"
|
:where="{
|
||||||
|
isDestiny: true,
|
||||||
|
}"
|
||||||
/>
|
/>
|
||||||
<FormModel :url-update="`Travels/${route.params.id}`" model="Travel">
|
<FormModel :url-update="`Travels/${route.params.id}`" model="Travel">
|
||||||
<template #form="{ data }">
|
<template #form="{ data }">
|
||||||
|
|
|
@ -183,7 +183,9 @@ warehouses();
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('extraCommunity.filter.warehouseOutFk')"
|
:label="t('extraCommunity.filter.warehouseOutFk')"
|
||||||
v-model="params.warehouseOutFk"
|
v-model="params.warehouseOutFk"
|
||||||
:options="warehousesOptions"
|
:options="
|
||||||
|
warehousesOptions.filter((option) => option.isOrigin === true)
|
||||||
|
"
|
||||||
option-value="id"
|
option-value="id"
|
||||||
option-label="name"
|
option-label="name"
|
||||||
hide-selected
|
hide-selected
|
||||||
|
@ -197,7 +199,11 @@ warehouses();
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('extraCommunity.filter.warehouseInFk')"
|
:label="t('extraCommunity.filter.warehouseInFk')"
|
||||||
v-model="params.warehouseInFk"
|
v-model="params.warehouseInFk"
|
||||||
:options="warehousesOptions"
|
:options="
|
||||||
|
warehousesOptions.filter(
|
||||||
|
(option) => option.isDestiny === true,
|
||||||
|
)
|
||||||
|
"
|
||||||
option-value="id"
|
option-value="id"
|
||||||
option-label="name"
|
option-label="name"
|
||||||
hide-selected
|
hide-selected
|
||||||
|
|
|
@ -81,6 +81,9 @@ const redirectToTravelBasicData = (_, { id }) => {
|
||||||
option-value="id"
|
option-value="id"
|
||||||
option-label="name"
|
option-label="name"
|
||||||
hide-selected
|
hide-selected
|
||||||
|
:where="{
|
||||||
|
isOrigin: true,
|
||||||
|
}"
|
||||||
/>
|
/>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('globals.warehouseIn')"
|
:label="t('globals.warehouseIn')"
|
||||||
|
@ -89,6 +92,9 @@ const redirectToTravelBasicData = (_, { id }) => {
|
||||||
option-value="id"
|
option-value="id"
|
||||||
option-label="name"
|
option-label="name"
|
||||||
hide-selected
|
hide-selected
|
||||||
|
:where="{
|
||||||
|
isDestiny: true,
|
||||||
|
}"
|
||||||
/>
|
/>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -64,6 +64,9 @@ defineExpose({ states });
|
||||||
option-filter="name"
|
option-filter="name"
|
||||||
dense
|
dense
|
||||||
filled
|
filled
|
||||||
|
:where="{
|
||||||
|
isDestiny: true,
|
||||||
|
}"
|
||||||
/>
|
/>
|
||||||
<VnInputDate
|
<VnInputDate
|
||||||
:label="t('travel.shipped')"
|
:label="t('travel.shipped')"
|
||||||
|
@ -89,6 +92,9 @@ defineExpose({ states });
|
||||||
option-filter="name"
|
option-filter="name"
|
||||||
dense
|
dense
|
||||||
filled
|
filled
|
||||||
|
:where="{
|
||||||
|
isOrigin: true,
|
||||||
|
}"
|
||||||
/>
|
/>
|
||||||
<VnInputDate
|
<VnInputDate
|
||||||
:label="t('travel.landed')"
|
:label="t('travel.landed')"
|
||||||
|
|
|
@ -99,6 +99,7 @@ const columns = computed(() => [
|
||||||
fields: ['id', 'name'],
|
fields: ['id', 'name'],
|
||||||
optionLabel: 'name',
|
optionLabel: 'name',
|
||||||
optionValue: 'id',
|
optionValue: 'id',
|
||||||
|
where: { isDestiny: true },
|
||||||
},
|
},
|
||||||
format: (row) => row.warehouseInName,
|
format: (row) => row.warehouseInName,
|
||||||
columnField: {
|
columnField: {
|
||||||
|
@ -133,6 +134,7 @@ const columns = computed(() => [
|
||||||
attrs: {
|
attrs: {
|
||||||
url: 'warehouses',
|
url: 'warehouses',
|
||||||
fields: ['id', 'name'],
|
fields: ['id', 'name'],
|
||||||
|
where: { isOrigin: true },
|
||||||
},
|
},
|
||||||
format: (row) => row.warehouseOutName,
|
format: (row) => row.warehouseOutName,
|
||||||
columnField: {
|
columnField: {
|
||||||
|
|
|
@ -11,6 +11,7 @@ import '@quasar/quasar-ui-qcalendar/src/QCalendarVariables.scss';
|
||||||
import { useWeekdayStore } from 'src/stores/useWeekdayStore';
|
import { useWeekdayStore } from 'src/stores/useWeekdayStore';
|
||||||
import useNotify from 'src/composables/useNotify.js';
|
import useNotify from 'src/composables/useNotify.js';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
import useWeekdaysOrder from 'src/composables/getWeekdays';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
year: {
|
year: {
|
||||||
|
@ -44,6 +45,7 @@ const { locale } = useI18n();
|
||||||
|
|
||||||
const calendarRef = ref(null);
|
const calendarRef = ref(null);
|
||||||
const weekdayStore = useWeekdayStore();
|
const weekdayStore = useWeekdayStore();
|
||||||
|
const weekDays = useWeekdaysOrder();
|
||||||
const selectedDate = ref();
|
const selectedDate = ref();
|
||||||
const calendarEventDates = [];
|
const calendarEventDates = [];
|
||||||
const today = ref(date.formatDate(Date.vnNew(), 'YYYY-MM-DD'));
|
const today = ref(date.formatDate(Date.vnNew(), 'YYYY-MM-DD'));
|
||||||
|
@ -182,7 +184,7 @@ watch(_year, (newValue) => {
|
||||||
no-outside-days
|
no-outside-days
|
||||||
:selected-dates="calendarEventDates"
|
:selected-dates="calendarEventDates"
|
||||||
no-active-date
|
no-active-date
|
||||||
:weekdays="[1, 2, 3, 4, 5, 6, 0]"
|
:weekdays="weekDays"
|
||||||
short-weekday-label
|
short-weekday-label
|
||||||
:locale="locale"
|
:locale="locale"
|
||||||
:now="today"
|
:now="today"
|
||||||
|
|
|
@ -4,6 +4,8 @@ import { useI18n } from 'vue-i18n';
|
||||||
|
|
||||||
import { QCalendarMonth } from '@quasar/quasar-ui-qcalendar/src/index.js';
|
import { QCalendarMonth } from '@quasar/quasar-ui-qcalendar/src/index.js';
|
||||||
import QCalendarMonthWrapper from 'src/components/ui/QCalendarMonthWrapper.vue';
|
import QCalendarMonthWrapper from 'src/components/ui/QCalendarMonthWrapper.vue';
|
||||||
|
import useWeekdaysOrder from 'src/composables/getWeekdays';
|
||||||
|
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
modelValue: {
|
modelValue: {
|
||||||
type: String,
|
type: String,
|
||||||
|
@ -32,6 +34,7 @@ const emit = defineEmits(['update:modelValue', 'clickDate', 'onMoved']);
|
||||||
const { locale } = useI18n();
|
const { locale } = useI18n();
|
||||||
|
|
||||||
const calendarRef = ref(null);
|
const calendarRef = ref(null);
|
||||||
|
const weekDays = useWeekdaysOrder();
|
||||||
|
|
||||||
const stateClasses = {
|
const stateClasses = {
|
||||||
CONFIRMED: {
|
CONFIRMED: {
|
||||||
|
@ -135,7 +138,7 @@ const paintWorkWeeks = async () => {
|
||||||
ref="calendarRef"
|
ref="calendarRef"
|
||||||
v-model="value"
|
v-model="value"
|
||||||
show-work-weeks
|
show-work-weeks
|
||||||
:weekdays="[1, 2, 3, 4, 5, 6, 0]"
|
:weekdays="weekDays"
|
||||||
:selected-dates="selectedDates"
|
:selected-dates="selectedDates"
|
||||||
:min-weekday-label="1"
|
:min-weekday-label="1"
|
||||||
:locale="locale"
|
:locale="locale"
|
||||||
|
|
|
@ -10,6 +10,7 @@ import { QCalendarMonth } from '@quasar/quasar-ui-qcalendar/src/index.js';
|
||||||
import '@quasar/quasar-ui-qcalendar/src/QCalendarVariables.scss';
|
import '@quasar/quasar-ui-qcalendar/src/QCalendarVariables.scss';
|
||||||
|
|
||||||
import { useWeekdayStore } from 'src/stores/useWeekdayStore';
|
import { useWeekdayStore } from 'src/stores/useWeekdayStore';
|
||||||
|
import useWeekdaysOrder from 'src/composables/getWeekdays';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
@ -46,6 +47,7 @@ const route = useRoute();
|
||||||
|
|
||||||
const calendarRef = ref(null);
|
const calendarRef = ref(null);
|
||||||
const weekdayStore = useWeekdayStore();
|
const weekdayStore = useWeekdayStore();
|
||||||
|
const weekDays = useWeekdaysOrder();
|
||||||
const showZoneClosingTable = ref(false);
|
const showZoneClosingTable = ref(false);
|
||||||
const zoneClosingData = ref(null);
|
const zoneClosingData = ref(null);
|
||||||
const today = ref(date.formatDate(Date.vnNew(), 'YYYY-MM-DD'));
|
const today = ref(date.formatDate(Date.vnNew(), 'YYYY-MM-DD'));
|
||||||
|
@ -161,7 +163,7 @@ const handleDateClick = (timestamp) => {
|
||||||
show-work-weeks
|
show-work-weeks
|
||||||
no-outside-days
|
no-outside-days
|
||||||
no-active-date
|
no-active-date
|
||||||
:weekdays="[1, 2, 3, 4, 5, 6, 0]"
|
:weekdays="weekDays"
|
||||||
short-weekday-label
|
short-weekday-label
|
||||||
:locale="locale"
|
:locale="locale"
|
||||||
:now="today"
|
:now="today"
|
||||||
|
|
|
@ -229,22 +229,3 @@ onUnmounted(() => arrayData.destroy());
|
||||||
</div>
|
</div>
|
||||||
</QCard>
|
</QCard>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.calendars-header {
|
|
||||||
height: 45px;
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
background-color: $primary;
|
|
||||||
font-weight: bold;
|
|
||||||
font-size: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.calendars-container {
|
|
||||||
max-width: 800px;
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
justify-content: space-evenly;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
|
@ -170,6 +170,7 @@ const vehicleCard = {
|
||||||
'VehicleBasicData',
|
'VehicleBasicData',
|
||||||
'VehicleNotes',
|
'VehicleNotes',
|
||||||
'VehicleDms',
|
'VehicleDms',
|
||||||
|
'VehicleEvents'
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
|
@ -209,6 +210,15 @@ const vehicleCard = {
|
||||||
},
|
},
|
||||||
component: () => import('src/pages/Route/Vehicle/VehicleDms.vue'),
|
component: () => import('src/pages/Route/Vehicle/VehicleDms.vue'),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: 'VehicleEvents',
|
||||||
|
path: 'events',
|
||||||
|
meta: {
|
||||||
|
title: 'calendar',
|
||||||
|
icon: 'vn:calendar',
|
||||||
|
},
|
||||||
|
component: () => import('src/pages/Route/Vehicle/Card/VehicleEvents.vue'),
|
||||||
|
},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,9 @@ const FINDED_PATHS = ['src', E2E_PATH];
|
||||||
|
|
||||||
function getGitDiff(options) {
|
function getGitDiff(options) {
|
||||||
const TARGET_BRANCH = options[2] || 'dev';
|
const TARGET_BRANCH = options[2] || 'dev';
|
||||||
|
execSync(`git fetch origin ${TARGET_BRANCH}`, {
|
||||||
|
encoding: 'utf-8',
|
||||||
|
});
|
||||||
const diff = execSync(`git diff --name-only origin/${TARGET_BRANCH}`, {
|
const diff = execSync(`git diff --name-only origin/${TARGET_BRANCH}`, {
|
||||||
encoding: 'utf-8',
|
encoding: 'utf-8',
|
||||||
});
|
});
|
||||||
|
|
|
@ -54,7 +54,7 @@ describe('Handle Items FixedPrice', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should edit all items', () => {
|
it('should edit all items', () => {
|
||||||
cy.get('.bg-header > :nth-child(1) > .q-checkbox > .q-checkbox__inner').click();
|
cy.get('.bg-header > :nth-child(1) [data-cy="vnCheckbox"]').click();
|
||||||
cy.dataCy('FixedPriceToolbarEditBtn').should('not.be.disabled');
|
cy.dataCy('FixedPriceToolbarEditBtn').should('not.be.disabled');
|
||||||
cy.dataCy('FixedPriceToolbarEditBtn').click();
|
cy.dataCy('FixedPriceToolbarEditBtn').click();
|
||||||
cy.dataCy('EditFixedPriceSelectOption').type(grouping);
|
cy.dataCy('EditFixedPriceSelectOption').type(grouping);
|
||||||
|
@ -65,7 +65,7 @@ describe('Handle Items FixedPrice', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should remove all items', () => {
|
it('should remove all items', () => {
|
||||||
cy.get('.bg-header > :nth-child(1) > .q-checkbox > .q-checkbox__inner').click();
|
cy.get('.bg-header > :nth-child(1) [data-cy="vnCheckbox"]').click();
|
||||||
cy.dataCy('crudModelDefaultRemoveBtn').should('not.be.disabled');
|
cy.dataCy('crudModelDefaultRemoveBtn').should('not.be.disabled');
|
||||||
cy.dataCy('crudModelDefaultRemoveBtn').click();
|
cy.dataCy('crudModelDefaultRemoveBtn').click();
|
||||||
cy.dataCy('VnConfirm_confirm').click();
|
cy.dataCy('VnConfirm_confirm').click();
|
||||||
|
|
|
@ -5,6 +5,9 @@ describe('Cmr list', () => {
|
||||||
const selectors = {
|
const selectors = {
|
||||||
ticket: getLinkSelector('ticketFk'),
|
ticket: getLinkSelector('ticketFk'),
|
||||||
client: getLinkSelector('clientFk'),
|
client: getLinkSelector('clientFk'),
|
||||||
|
route: getLinkSelector('routeFk'),
|
||||||
|
agency: getLinkSelector('agencyModeFk'),
|
||||||
|
carrier: getLinkSelector('supplierFk'),
|
||||||
lastRowSelectCheckBox:
|
lastRowSelectCheckBox:
|
||||||
'.q-virtual-scroll__content > tr:last-child > :nth-child(1) > .q-checkbox',
|
'.q-virtual-scroll__content > tr:last-child > :nth-child(1) > .q-checkbox',
|
||||||
downloadBtn: '#subToolbar > .q-btn',
|
downloadBtn: '#subToolbar > .q-btn',
|
||||||
|
@ -21,6 +24,10 @@ describe('Cmr list', () => {
|
||||||
const data = {
|
const data = {
|
||||||
ticket: '1',
|
ticket: '1',
|
||||||
client: 'Bruce Wayne',
|
client: 'Bruce Wayne',
|
||||||
|
route: 'first route',
|
||||||
|
routeId: '1',
|
||||||
|
agency: 'inhouse pickup',
|
||||||
|
carrier: 'PLANTS SL',
|
||||||
};
|
};
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
@ -68,6 +75,26 @@ describe('Cmr list', () => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('Route pop-ups', () => {
|
||||||
|
it('Should redirect to the route summary from the route descriptor pop-up', () => {
|
||||||
|
cy.get(selectors.route).should('be.visible').click();
|
||||||
|
cy.containContent(selectors.descriptorId, data.routeId);
|
||||||
|
cy.get(selectors.descriptorGoToSummaryBtn).should('be.visible').click();
|
||||||
|
cy.url().should('include', '/route/1/summary');
|
||||||
|
cy.containContent(selectors.summaryTitle, data.route);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Should redirect to the route summary from summary pop-up from the route descriptor pop-up', () => {
|
||||||
|
cy.get(selectors.route).should('be.visible').click();
|
||||||
|
cy.containContent(selectors.descriptorId, data.routeId);
|
||||||
|
cy.get(selectors.descriptorOpenSummaryBtn).should('be.visible').click();
|
||||||
|
cy.containContent(selectors.summaryTitle, data.route);
|
||||||
|
cy.get(selectors.summaryGoToSummaryBtn).should('be.visible').click();
|
||||||
|
cy.url().should('include', '/route/1/summary');
|
||||||
|
cy.containContent(selectors.summaryTitle, data.route);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
describe('Client pop-ups', () => {
|
describe('Client pop-ups', () => {
|
||||||
it('Should redirect to the client summary from the client descriptor pop-up', () => {
|
it('Should redirect to the client summary from the client descriptor pop-up', () => {
|
||||||
cy.get(selectors.client).should('be.visible').click();
|
cy.get(selectors.client).should('be.visible').click();
|
||||||
|
@ -87,4 +114,44 @@ describe('Cmr list', () => {
|
||||||
cy.containContent(selectors.summaryTitle, data.client);
|
cy.containContent(selectors.summaryTitle, data.client);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('Agency pop-ups', () => {
|
||||||
|
it('Should redirect to the agency summary from the agency descriptor pop-up', () => {
|
||||||
|
cy.get(selectors.agency).should('be.visible').click();
|
||||||
|
cy.containContent(selectors.descriptorTitle, data.agency);
|
||||||
|
cy.get(selectors.descriptorGoToSummaryBtn).should('be.visible').click();
|
||||||
|
cy.url().should('include', '/agency/1/summary');
|
||||||
|
cy.containContent(selectors.summaryTitle, data.agency);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Should redirect to the agency summary from summary pop-up from the agency descriptor pop-up', () => {
|
||||||
|
cy.get(selectors.agency).should('be.visible').click();
|
||||||
|
cy.containContent(selectors.descriptorTitle, data.agency);
|
||||||
|
cy.get(selectors.descriptorOpenSummaryBtn).should('be.visible').click();
|
||||||
|
cy.containContent(selectors.summaryTitle, data.agency);
|
||||||
|
cy.get(selectors.summaryGoToSummaryBtn).should('be.visible').click();
|
||||||
|
cy.url().should('include', '/agency/1/summary');
|
||||||
|
cy.containContent(selectors.summaryTitle, data.agency);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('Carrier pop-ups', () => {
|
||||||
|
it('Should redirect to the supplier summary from the supplier descriptor pop-up', () => {
|
||||||
|
cy.get(selectors.carrier).should('be.visible').click();
|
||||||
|
cy.containContent(selectors.descriptorTitle, data.carrier);
|
||||||
|
cy.get(selectors.descriptorGoToSummaryBtn).should('be.visible').click();
|
||||||
|
cy.url().should('include', '/supplier/1/summary');
|
||||||
|
cy.containContent(selectors.summaryTitle, data.carrier);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Should redirect to the supplier summary from summary pop-up from the supplier descriptor pop-up', () => {
|
||||||
|
cy.get(selectors.carrier).should('be.visible').click();
|
||||||
|
cy.containContent(selectors.descriptorTitle, data.carrier);
|
||||||
|
cy.get(selectors.descriptorOpenSummaryBtn).should('be.visible').click();
|
||||||
|
cy.containContent(selectors.summaryTitle, data.carrier);
|
||||||
|
cy.get(selectors.summaryGoToSummaryBtn).should('be.visible').click();
|
||||||
|
cy.url().should('include', '/supplier/1/summary');
|
||||||
|
cy.containContent(selectors.summaryTitle, data.carrier);
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
describe('Vehicle', () => {
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.viewport(1920, 1080);
|
||||||
|
cy.login('deliveryAssistant');
|
||||||
|
cy.visit(`/#/route/vehicle/3/events`);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should add, edit and delete a vehicle event', () => {
|
||||||
|
cy.get('.q-page-sticky > div > .q-btn').click();
|
||||||
|
cy.dataCy('Started_inputDate').type('01/01/2001');
|
||||||
|
cy.dataCy('Finished_inputDate').type('08/02/2001');
|
||||||
|
cy.get(':nth-child(5)').find('[data-cy="Description_input"]').clear().type('Test');
|
||||||
|
cy.selectOption('[data-cy="State_input"]', 3);
|
||||||
|
cy.get('.q-mt-lg > .q-btn--standard').click();
|
||||||
|
|
||||||
|
cy.get('.q-current-day > .q-calendar-month__day--content > .q-btn').click();
|
||||||
|
cy.dataCy('Started_inputDate').clear().type('03/02/2001');
|
||||||
|
cy.dataCy('Finished_inputDate').clear().type('15/03/2001');
|
||||||
|
cy.get(':nth-child(5)').find('[data-cy="Description_input"]').clear().type('Test2');
|
||||||
|
cy.selectOption('[data-cy="State_input"]', 5);
|
||||||
|
cy.get('.q-mt-lg > .q-btn--standard').click();
|
||||||
|
|
||||||
|
cy.dataCy('delete_event').eq(0).click();
|
||||||
|
cy.dataCy('VnConfirm_confirm').click();
|
||||||
|
});
|
||||||
|
});
|
|
@ -76,16 +76,13 @@ describe('TicketList', () => {
|
||||||
});
|
});
|
||||||
}).as('ticket');
|
}).as('ticket');
|
||||||
|
|
||||||
cy.get('[data-cy="Warehouse_select"]').type('Warehouse Five');
|
cy.get('[data-cy="Warehouse_select"]').type('Warehouse One');
|
||||||
cy.get('.q-menu .q-item').contains('Warehouse Five').click();
|
cy.get('.q-menu .q-item').contains('Warehouse One').click();
|
||||||
cy.wait('@ticket').then((interception) => {
|
cy.wait('@ticket').then((interception) => {
|
||||||
const data = interception.response.body[1];
|
const data = interception.response.body[0];
|
||||||
expect(data.hasComponentLack).to.equal(1);
|
expect(data.hasComponentLack).to.equal(1);
|
||||||
expect(data.isTooLittle).to.equal(1);
|
|
||||||
expect(data.hasItemShortage).to.equal(1);
|
|
||||||
});
|
});
|
||||||
cy.get('.icon-components').should('exist');
|
cy.get('.icon-components').should('exist');
|
||||||
cy.get('.icon-unavailable').should('exist');
|
cy.get('.icon-unavailable').should('exist');
|
||||||
cy.get('.icon-isTooLittle').should('exist');
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue