166
CHANGELOG.md
166
CHANGELOG.md
|
@ -1,3 +1,169 @@
|
||||||
|
# Version 24.28 - 2024-07-09
|
||||||
|
|
||||||
|
### Added 🆕
|
||||||
|
|
||||||
|
- Change header titles style by:wbuezas
|
||||||
|
- chore: refs #7436 fix e2e (origin/7436-showQCheckbox) by:jorgep
|
||||||
|
- feat: #7196 eslint (origin/7196-cjsToEsm) by:jgallego
|
||||||
|
- feat: adapt tu VnTable → CrudModel by:alexm
|
||||||
|
- feat(CustomerFIlter): use correct table by:alexm
|
||||||
|
- feat(customerList): add searchbar by:alexm
|
||||||
|
- feat: customerList is customerExtendedList by:alexm
|
||||||
|
- feat: fixes #7196 by:jgallego
|
||||||
|
- feat: refs #6739 transferInvoice new checkbox and functionality by:Jon
|
||||||
|
- feat: refs #6825 create vnTable and add in CustomerExtendedList by:alexm
|
||||||
|
- feat: refs #6825 create vnTableColumn, cardActions by:alexm
|
||||||
|
- feat: refs #6825 fix modes by:alexm
|
||||||
|
- feat: refs #6825 qchip color by:alexm
|
||||||
|
- feat: refs #6825 right filter panel (6825-vnTable) by:alexm
|
||||||
|
- feat: refs #6825 scroll for table mode by:alexm
|
||||||
|
- feat: refs #6825 share filters, create popup by:alexm
|
||||||
|
- feat: refs #6825 VnComponent mix component and attrs Form to create new row by:alexm
|
||||||
|
- feat: refs #6825 VnTableFilter and VnPanelFilter init by:alexm
|
||||||
|
- feat: refs #6826 added rol summary link by:Jon
|
||||||
|
- feat: refs #6896 created VnImg and added to order module by:Jon
|
||||||
|
- feat: refs #6896 new filters by:Jon
|
||||||
|
- feat: refs #7129 fix some code and add order by:pablone
|
||||||
|
- feat: refs #7436 show checkbox by:jorgep
|
||||||
|
- feat: refs #7545 Deleted hasIncoterms client column (origin/7545-hasIncoterms) by:guillermo
|
||||||
|
- feat(TicketService): use correct format by:alexm
|
||||||
|
- feat(url): sepate filters by:alexm
|
||||||
|
- feat(VnFilter): merge objects by:alexm
|
||||||
|
- feat(VnTable): is-editable and use-model. fix: checkbox by:alexm
|
||||||
|
- feat(VnTable): refs #6825 actions sticky by:alexm
|
||||||
|
- feat(VnTable): refs #6825 addInWhere by:alexm
|
||||||
|
- feat(VnTable): refs #6825 dinamic columns by:alexm
|
||||||
|
- feat(VnTable): refs #6825 execute function when create by:alexm
|
||||||
|
- feat(VnTable): refs #6825 fix ellipsis and add titles by:alexm
|
||||||
|
- feat(VnTable): refs #6825 merge where's by:alexm
|
||||||
|
- feat(VnTable): refs #6825 move to folder. fix checkboxs by:alexm
|
||||||
|
- feat(VnTable): refs #6825 remove field prop. Add actions in table by:alexm
|
||||||
|
- feat(VnTable): refs #6825 use checkbox if startsWith 'is' or 'has' by:alexm
|
||||||
|
- feat(VnTable): refs #6825 VnTableChip component by:alexm
|
||||||
|
- feat(vnTable): reload data when change url by:alexm
|
||||||
|
- feat(WorkerFormation): add columnFilter by:alexm
|
||||||
|
- feat(WorkerFormation): is-editable and use-model by:alexm
|
||||||
|
- fix: notify icon style by:Javier Segarra
|
||||||
|
- refactor: refs #6896 fixed styles by:Jon
|
||||||
|
- Revert "feat: fixes #7196" by:alexm
|
||||||
|
- style: refs #6464 changed checkbox and qbtn styles by:Jon
|
||||||
|
|
||||||
|
### Changed 📦
|
||||||
|
|
||||||
|
- perf: Remove div.col by:Javier Segarra
|
||||||
|
- perf: remove ItemPicture by:Javier Segarra
|
||||||
|
- perf: replace ItemPicture in favour of VnImg by:Javier Segarra
|
||||||
|
- refactor by:wbuezas
|
||||||
|
- refactor: refs #5447 changed warehouse filter by:Jon
|
||||||
|
- refactor: refs #5447 changed warehouse out filter behavior by:Jon
|
||||||
|
- refactor: refs #5447 fixed filter if continent not selected by:Jon
|
||||||
|
- refactor: refs #5447 fix request by:Jon
|
||||||
|
- refactor: refs #5447 refactor filters by:Jon
|
||||||
|
- refactor: refs #6739 changed invoice functions' name by:Jon
|
||||||
|
- refactor: refs #6739 changed router.push by:Jon
|
||||||
|
- refactor: refs #6739 deleted useless const by:Jon
|
||||||
|
- refactor: refs #6739 fix redirect transferInvoice by:Jon
|
||||||
|
- refactor: refs #6739 new confirmation window by:Jon
|
||||||
|
- refactor: refs #6739 requested changes by:Jon
|
||||||
|
- refactor: refs #6739 updated transferInvoice function by:Jon
|
||||||
|
- refactor: refs #6896 changes requested in PR by:Jon
|
||||||
|
- refactor: refs #6896 end migration orders by:Jon
|
||||||
|
- refactor: refs #6896 fixed styles by:Jon
|
||||||
|
- refactor: refs #6896 fix qdrawer by:Jon
|
||||||
|
- refactor: refs #6896 refactor VnImg by:Jon
|
||||||
|
- refactor: refs #6896 requested changes by:Jon
|
||||||
|
- refactor: refs #6977 fix VnImg props (origin/6977-ClonedURL) by:Jon
|
||||||
|
- refactor: refs #6977 refactor VnImg by:Jon
|
||||||
|
- refactor: refs #6977 use VnImg by:Jon
|
||||||
|
- refactors by:alexm
|
||||||
|
|
||||||
|
### Fixed 🛠️
|
||||||
|
|
||||||
|
- chore: refs #7436 fix e2e (origin/7436-showQCheckbox) by:jorgep
|
||||||
|
- feat: fixes #7196 by:jgallego
|
||||||
|
- feat: refs #6825 fix modes by:alexm
|
||||||
|
- feat: refs #7129 fix some code and add order by:pablone
|
||||||
|
- feat(VnTable): is-editable and use-model. fix: checkbox by:alexm
|
||||||
|
- feat(VnTable): refs #6825 fix ellipsis and add titles by:alexm
|
||||||
|
- feat(VnTable): refs #6825 move to folder. fix checkboxs by:alexm
|
||||||
|
- fix(ArrayData): refs #6825 router.replace and use filter.where by:alexm
|
||||||
|
- fix: bug replace by:alexm
|
||||||
|
- fix: column hidden v-if by:Javier Segarra
|
||||||
|
- fix: comment 4 by:Javier Segarra
|
||||||
|
- fix: comments by:Javier Segarra
|
||||||
|
- fix: cypress.config to mjs by:alexm
|
||||||
|
- fix(EntryBuys): fix VnSubtoolbar by:alexm
|
||||||
|
- fixes: fix vnFilter params and redirect by:alexm
|
||||||
|
- fix: fix warnings by:alexm
|
||||||
|
- fix: invoiceDueDay test by:alexm
|
||||||
|
- fix log view not refreshing when changing id param by:wbuezas
|
||||||
|
- fix: map selected by:Javier Segarra
|
||||||
|
- fix: merge dev by:Javier Segarra
|
||||||
|
- fix: notify icon style by:Javier Segarra
|
||||||
|
- fix: point 1 by:Javier Segarra
|
||||||
|
- fix: point 3 by:Javier Segarra
|
||||||
|
- fix: refs #5447 deleted console.log by:Jon
|
||||||
|
- fix: refs 6464 deleted useless class in checkbox by:Jon
|
||||||
|
- fix: refs #6464 fix error isLoading by:Jon
|
||||||
|
- fix: refs #6739 changed checkbox field by:Jon
|
||||||
|
- fix: refs #6825 css by:carlossa
|
||||||
|
- fix: refs #6826 fix redirect by:Jon
|
||||||
|
- fix: refs #6826 fix roleDescriptor by:Jon
|
||||||
|
- fix: refs #7129 fix e2e by:pablone
|
||||||
|
- fix: refs #7129 fix module routes by:pablone
|
||||||
|
- fix: refs #7129 fix some issues on load and tools by:pablone
|
||||||
|
- fix: refs #7129 remove consoleLog by:pablone
|
||||||
|
- fix: refs #7129 remove fix from claim lines by:pablone
|
||||||
|
- fix: refs #7274 fix duplicate rows by:jorgep
|
||||||
|
- fix: refs #7433 skeleton by:jorgep
|
||||||
|
- fix: refs #7623 bugs & tests by:jorgep
|
||||||
|
- fix: refs #7623 disable router update by:jorgep
|
||||||
|
- fix: refs #7623 redirect by:jorgep
|
||||||
|
- fix: refs #7623 test by:jorgep
|
||||||
|
- fix: refs #7623 update add updateRoute prop in VnPaginate by:jorgep
|
||||||
|
- fix: refs #7623 updating skip param by:jorgep
|
||||||
|
- fix: revert cypress mjs by:alexm
|
||||||
|
- fix: SkeletonTable by:alexm
|
||||||
|
- fix: state translations by:Javier Segarra
|
||||||
|
- fix: ticket order by:Javier Segarra
|
||||||
|
- fix(ticket router): typo by:alexm
|
||||||
|
- fix(TicketService): pay use selected by:alexm
|
||||||
|
- fix: TravelLog by:Javier Segarra
|
||||||
|
- fix(url): filter by:alexm
|
||||||
|
- fix(url): redirect by:alexm
|
||||||
|
- fix(VnFilter): filter with params by:alexm
|
||||||
|
- fix(VnFilterPanel): remove key by:alexm
|
||||||
|
- fix(VnTable): create scss by:alexm
|
||||||
|
- fix(VnTable): duplicate fetch by:alexm
|
||||||
|
- fix(VnTable): Qtable v-bind by:alexm
|
||||||
|
- fix(VnTable): refs #6825 checkbox align and color by:alexm
|
||||||
|
- fix(VnTable): refs #6825 fix click sticky column by:alexm
|
||||||
|
- fix(VnTable): refs #6825 fix events and css by:alexm
|
||||||
|
- fix(VnTable): refs #6825 VnInputDate by:alexm
|
||||||
|
- fix(VnTable): showLabel by:alexm
|
||||||
|
- fix(VnTable): warns by:alexm
|
||||||
|
- fix: WorkerNotificationsManager test by:alexm
|
||||||
|
- fix: WorkerSelect option format by:Javier Segarra
|
||||||
|
- refactor: refs #5447 fixed filter if continent not selected by:Jon
|
||||||
|
- refactor: refs #5447 fix request by:Jon
|
||||||
|
- refactor: refs #6739 fix redirect transferInvoice by:Jon
|
||||||
|
- refactor: refs #6896 fixed styles by:Jon
|
||||||
|
- refactor: refs #6896 fix qdrawer by:Jon
|
||||||
|
- refactor: refs #6977 fix VnImg props (origin/6977-ClonedURL) by:Jon
|
||||||
|
- refs #6504 fix formModel claimFilter claimCard (origin/6504-fixCardClaim) by:carlossa
|
||||||
|
- refs #7406 fix components by:carlossa
|
||||||
|
- refs #7406 fix pr by:carlossa
|
||||||
|
- refs #7406 fix props by:carlossa
|
||||||
|
- refs #7406 fix Tb components create by:carlossa
|
||||||
|
- refs #7406 fix trad by:carlossa
|
||||||
|
- refs #7406 fix url by:carlossa
|
||||||
|
- refs #7406 fix VnTable columns by:carlossa
|
||||||
|
- refs #7409 fix balance and formation by:carlossa
|
||||||
|
- refs #7409 fix trad by:carlossa
|
||||||
|
- Revert "feat: fixes #7196" by:alexm
|
||||||
|
- test: fix intermitent e2e by:alexm
|
||||||
|
- test: fix vnSearchbar adapt to vnTable (origin/7648_dev_customerEntries) by:alexm
|
||||||
|
|
||||||
# Version 24.24 - 2024-06-11
|
# Version 24.24 - 2024-06-11
|
||||||
|
|
||||||
### Added 🆕
|
### Added 🆕
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "salix-front",
|
"name": "salix-front",
|
||||||
"version": "24.30.1",
|
"version": "24.32.0",
|
||||||
"description": "Salix frontend",
|
"description": "Salix frontend",
|
||||||
"productName": "Salix",
|
"productName": "Salix",
|
||||||
"author": "Verdnatura",
|
"author": "Verdnatura",
|
||||||
|
|
|
@ -78,7 +78,7 @@ const defaultComponents = {
|
||||||
date: {
|
date: {
|
||||||
component: markRaw(VnInputDate),
|
component: markRaw(VnInputDate),
|
||||||
attrs: {
|
attrs: {
|
||||||
readonly: true,
|
readonly: !$props.isEditable,
|
||||||
disable: !$props.isEditable,
|
disable: !$props.isEditable,
|
||||||
style: 'min-width: 125px',
|
style: 'min-width: 125px',
|
||||||
class: 'fit',
|
class: 'fit',
|
||||||
|
|
|
@ -48,6 +48,17 @@ const forceAttrs = {
|
||||||
label: $props.showTitle ? '' : $props.column.label,
|
label: $props.showTitle ? '' : $props.column.label,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const selectComponent = {
|
||||||
|
component: markRaw(VnSelect),
|
||||||
|
event: updateEvent,
|
||||||
|
attrs: {
|
||||||
|
class: 'q-px-sm q-pb-xs q-pt-none fit',
|
||||||
|
dense: true,
|
||||||
|
filled: !$props.showTitle,
|
||||||
|
},
|
||||||
|
forceAttrs,
|
||||||
|
};
|
||||||
|
|
||||||
const components = {
|
const components = {
|
||||||
input: {
|
input: {
|
||||||
component: markRaw(VnInput),
|
component: markRaw(VnInput),
|
||||||
|
@ -97,16 +108,8 @@ const components = {
|
||||||
},
|
},
|
||||||
forceAttrs,
|
forceAttrs,
|
||||||
},
|
},
|
||||||
select: {
|
select: selectComponent,
|
||||||
component: markRaw(VnSelect),
|
rawSelect: selectComponent,
|
||||||
event: updateEvent,
|
|
||||||
attrs: {
|
|
||||||
class: 'q-px-sm q-pb-xs q-pt-none fit',
|
|
||||||
dense: true,
|
|
||||||
filled: !$props.showTitle,
|
|
||||||
},
|
|
||||||
forceAttrs,
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
async function addFilter(value) {
|
async function addFilter(value) {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, onMounted, computed, watch } from 'vue';
|
import { ref, onBeforeMount, onMounted, computed, watch } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useRoute, useRouter } from 'vue-router';
|
import { useRoute, useRouter } from 'vue-router';
|
||||||
import { useQuasar } from 'quasar';
|
import { useQuasar } from 'quasar';
|
||||||
|
@ -96,6 +96,7 @@ const DEFAULT_MODE = 'card';
|
||||||
const TABLE_MODE = 'table';
|
const TABLE_MODE = 'table';
|
||||||
const mode = ref(DEFAULT_MODE);
|
const mode = ref(DEFAULT_MODE);
|
||||||
const selected = ref([]);
|
const selected = ref([]);
|
||||||
|
const hasParams = ref(false);
|
||||||
const routeQuery = JSON.parse(route?.query[$props.searchUrl] ?? '{}');
|
const routeQuery = JSON.parse(route?.query[$props.searchUrl] ?? '{}');
|
||||||
const params = ref({ ...routeQuery, ...routeQuery.filter?.where });
|
const params = ref({ ...routeQuery, ...routeQuery.filter?.where });
|
||||||
const orders = ref(parseOrder(routeQuery.filter?.order));
|
const orders = ref(parseOrder(routeQuery.filter?.order));
|
||||||
|
@ -117,11 +118,14 @@ const tableModes = [
|
||||||
disable: $props.disableOption?.card,
|
disable: $props.disableOption?.card,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
onBeforeMount(() => {
|
||||||
|
setUserParams(route.query[$props.searchUrl]);
|
||||||
|
hasParams.value = Object.keys(params.value).length !== 0;
|
||||||
|
});
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
mode.value = quasar.platform.is.mobile ? DEFAULT_MODE : $props.defaultMode;
|
mode.value = quasar.platform.is.mobile ? DEFAULT_MODE : $props.defaultMode;
|
||||||
stateStore.rightDrawer = true;
|
stateStore.rightDrawer = true;
|
||||||
setUserParams(route.query[$props.searchUrl]);
|
|
||||||
columnsVisibilitySkiped.value = [
|
columnsVisibilitySkiped.value = [
|
||||||
...splittedColumns.value.columns
|
...splittedColumns.value.columns
|
||||||
.filter((c) => c.visible == false)
|
.filter((c) => c.visible == false)
|
||||||
|
@ -281,6 +285,11 @@ defineExpose({
|
||||||
:params="params"
|
:params="params"
|
||||||
:columns="splittedColumns.columns"
|
:columns="splittedColumns.columns"
|
||||||
/>
|
/>
|
||||||
|
<slot
|
||||||
|
name="moreFilterPanel"
|
||||||
|
:params="params"
|
||||||
|
:columns="splittedColumns.columns"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
</VnFilterPanel>
|
</VnFilterPanel>
|
||||||
</QScrollArea>
|
</QScrollArea>
|
||||||
|
@ -295,6 +304,7 @@ defineExpose({
|
||||||
:disable-infinite-scroll="isTableMode"
|
:disable-infinite-scroll="isTableMode"
|
||||||
@save-changes="reload"
|
@save-changes="reload"
|
||||||
:has-sub-toolbar="$attrs['hasSubToolbar'] ?? isEditable"
|
:has-sub-toolbar="$attrs['hasSubToolbar'] ?? isEditable"
|
||||||
|
:auto-load="hasParams || $attrs['auto-load']"
|
||||||
>
|
>
|
||||||
<template
|
<template
|
||||||
v-for="(_, slotName) in $slots"
|
v-for="(_, slotName) in $slots"
|
||||||
|
@ -407,7 +417,7 @@ defineExpose({
|
||||||
<VnTableColumn
|
<VnTableColumn
|
||||||
:column="col"
|
:column="col"
|
||||||
:row="row"
|
:row="row"
|
||||||
:is-editable="false"
|
:is-editable="col.isEditable ?? isEditable"
|
||||||
v-model="row[col.name]"
|
v-model="row[col.name]"
|
||||||
component-prop="columnField"
|
component-prop="columnField"
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -44,15 +44,18 @@ const formattedDate = computed({
|
||||||
let newDate;
|
let newDate;
|
||||||
if (value) {
|
if (value) {
|
||||||
// parse input
|
// parse input
|
||||||
if (value.includes('/') && value.length >= 10) {
|
if (value.includes('/')) {
|
||||||
|
if (value.length == 6) value = value + new Date().getFullYear();
|
||||||
|
if (value.length >= 10) {
|
||||||
if (value.at(2) == '/') value = value.split('/').reverse().join('/');
|
if (value.at(2) == '/') value = value.split('/').reverse().join('/');
|
||||||
value = date.formatDate(
|
value = date.formatDate(
|
||||||
new Date(value).toISOString(),
|
new Date(value).toISOString(),
|
||||||
'YYYY-MM-DDTHH:mm:ss.SSSZ'
|
'YYYY-MM-DDTHH:mm:ss.SSSZ'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
let ymd = value.split('-').map((e) => parseInt(e));
|
}
|
||||||
newDate = new Date(ymd[0], ymd[1] - 1, ymd[2]);
|
const [year, month, day] = value.split('-').map((e) => parseInt(e));
|
||||||
|
newDate = new Date(year, month - 1, day);
|
||||||
if (model.value) {
|
if (model.value) {
|
||||||
const orgDate =
|
const orgDate =
|
||||||
model.value instanceof Date ? model.value : new Date(model.value);
|
model.value instanceof Date ? model.value : new Date(model.value);
|
||||||
|
@ -107,7 +110,12 @@ watch(
|
||||||
isPopupOpen = false;
|
isPopupOpen = false;
|
||||||
"
|
"
|
||||||
/>
|
/>
|
||||||
<QIcon name="event" class="cursor-pointer" />
|
<QIcon
|
||||||
|
name="event"
|
||||||
|
class="cursor-pointer"
|
||||||
|
@click="isPopupOpen = !isPopupOpen"
|
||||||
|
:title="t('Open date')"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
<QMenu
|
<QMenu
|
||||||
transition-show="scale"
|
transition-show="scale"
|
||||||
|
@ -116,6 +124,7 @@ watch(
|
||||||
anchor="bottom left"
|
anchor="bottom left"
|
||||||
self="top start"
|
self="top start"
|
||||||
:no-focus="true"
|
:no-focus="true"
|
||||||
|
:no-parent-event="true"
|
||||||
>
|
>
|
||||||
<QDate
|
<QDate
|
||||||
v-model="popupDate"
|
v-model="popupDate"
|
||||||
|
@ -132,7 +141,6 @@ watch(
|
||||||
</QInput>
|
</QInput>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.vn-input-date.q-field--standard.q-field--readonly .q-field__control:before {
|
.vn-input-date.q-field--standard.q-field--readonly .q-field__control:before {
|
||||||
border-bottom-style: solid;
|
border-bottom-style: solid;
|
||||||
|
@ -142,3 +150,7 @@ watch(
|
||||||
border-style: solid;
|
border-style: solid;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
<i18n>
|
||||||
|
es:
|
||||||
|
Open date: Abrir fecha
|
||||||
|
</i18n>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { watch, computed, ref } from 'vue';
|
import { watch, computed, ref, nextTick } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { date } from 'quasar';
|
import { date } from 'quasar';
|
||||||
|
|
||||||
|
@ -20,6 +20,7 @@ const requiredFieldRule = (val) => !!val || t('globals.fieldRequired');
|
||||||
const dateFormat = 'HH:mm';
|
const dateFormat = 'HH:mm';
|
||||||
const isPopupOpen = ref();
|
const isPopupOpen = ref();
|
||||||
const hover = ref();
|
const hover = ref();
|
||||||
|
const inputRef = ref();
|
||||||
|
|
||||||
const styleAttrs = computed(() => {
|
const styleAttrs = computed(() => {
|
||||||
return props.isOutlined
|
return props.isOutlined
|
||||||
|
@ -41,11 +42,17 @@ const formattedTime = computed({
|
||||||
let time = value;
|
let time = value;
|
||||||
if (time) {
|
if (time) {
|
||||||
if (time?.length > 5) time = dateToTime(time);
|
if (time?.length > 5) time = dateToTime(time);
|
||||||
|
else {
|
||||||
|
if (time.length == 1 && parseInt(time) > 2) time = time.padStart(2, '0');
|
||||||
|
time = time.padEnd(5, '0');
|
||||||
|
if (!time.includes(':'))
|
||||||
|
time = time.substring(0, 2) + ':' + time.substring(3, 5);
|
||||||
|
}
|
||||||
if (!props.timeOnly) {
|
if (!props.timeOnly) {
|
||||||
const hours = time.split(':');
|
const [hh, mm] = time.split(':');
|
||||||
const date = new Date(model.value);
|
const date = model.value ?? Date.vnNew();
|
||||||
date.setHours(hours[0], hours[1], 0);
|
date.setHours(hh, mm, 0);
|
||||||
time = date.toISOString();
|
time = date?.toISOString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
model.value = time;
|
model.value = time;
|
||||||
|
@ -55,17 +62,37 @@ const formattedTime = computed({
|
||||||
function dateToTime(newDate) {
|
function dateToTime(newDate) {
|
||||||
return date.formatDate(new Date(newDate), dateFormat);
|
return date.formatDate(new Date(newDate), dateFormat);
|
||||||
}
|
}
|
||||||
|
const timeField = ref();
|
||||||
watch(
|
watch(
|
||||||
() => model.value,
|
() => model.value,
|
||||||
(val) => (formattedTime.value = val),
|
(val) => (formattedTime.value = val),
|
||||||
{ immediate: true }
|
{ immediate: true }
|
||||||
);
|
);
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => formattedTime.value,
|
||||||
|
async (val) => {
|
||||||
|
let position = 3;
|
||||||
|
const input = inputRef.value?.getNativeElement();
|
||||||
|
if (!val || !input) return;
|
||||||
|
|
||||||
|
let [hh, mm] = val.split(':');
|
||||||
|
hh = parseInt(hh);
|
||||||
|
if (hh >= 10 || mm != '00') return;
|
||||||
|
|
||||||
|
await nextTick();
|
||||||
|
await nextTick();
|
||||||
|
if (!hh) position = 0;
|
||||||
|
input.setSelectionRange(position, position);
|
||||||
|
},
|
||||||
|
{ immediate: true }
|
||||||
|
);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div @mouseover="hover = true" @mouseleave="hover = false">
|
<div @mouseover="hover = true" @mouseleave="hover = false">
|
||||||
<QInput
|
<QInput
|
||||||
|
ref="inputRef"
|
||||||
class="vn-input-time"
|
class="vn-input-time"
|
||||||
mask="##:##"
|
mask="##:##"
|
||||||
placeholder="--:--"
|
placeholder="--:--"
|
||||||
|
@ -74,6 +101,8 @@ watch(
|
||||||
:class="{ required: $attrs.required }"
|
:class="{ required: $attrs.required }"
|
||||||
style="min-width: 100px"
|
style="min-width: 100px"
|
||||||
:rules="$attrs.required ? [requiredFieldRule] : null"
|
:rules="$attrs.required ? [requiredFieldRule] : null"
|
||||||
|
@click="isPopupOpen = false"
|
||||||
|
@focus="inputRef.getNativeElement().setSelectionRange(0, 0)"
|
||||||
>
|
>
|
||||||
<template #append>
|
<template #append>
|
||||||
<QIcon
|
<QIcon
|
||||||
|
@ -90,7 +119,12 @@ watch(
|
||||||
isPopupOpen = false;
|
isPopupOpen = false;
|
||||||
"
|
"
|
||||||
/>
|
/>
|
||||||
<QIcon name="Schedule" class="cursor-pointer" />
|
<QIcon
|
||||||
|
name="Schedule"
|
||||||
|
class="cursor-pointer"
|
||||||
|
@click="isPopupOpen = !isPopupOpen"
|
||||||
|
:title="t('Open time')"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
<QMenu
|
<QMenu
|
||||||
transition-show="scale"
|
transition-show="scale"
|
||||||
|
@ -99,6 +133,7 @@ watch(
|
||||||
anchor="bottom left"
|
anchor="bottom left"
|
||||||
self="top start"
|
self="top start"
|
||||||
:no-focus="true"
|
:no-focus="true"
|
||||||
|
:no-parent-event="true"
|
||||||
>
|
>
|
||||||
<QTime v-model="formattedTime" mask="HH:mm" landscape now-btn />
|
<QTime v-model="formattedTime" mask="HH:mm" landscape now-btn />
|
||||||
</QMenu>
|
</QMenu>
|
||||||
|
@ -114,3 +149,8 @@ watch(
|
||||||
border-style: solid;
|
border-style: solid;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
<i18n>
|
||||||
|
es:
|
||||||
|
Open time: Abrir tiempo
|
||||||
|
</i18n>
|
||||||
|
, nextTick
|
||||||
|
|
|
@ -125,7 +125,8 @@ function filter(val, options) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const id = row.id;
|
if (!row) return;
|
||||||
|
const id = row[$props.optionValue];
|
||||||
const optionLabel = String(row[$props.optionLabel]).toLowerCase();
|
const optionLabel = String(row[$props.optionLabel]).toLowerCase();
|
||||||
|
|
||||||
return id == search || optionLabel.includes(search);
|
return id == search || optionLabel.includes(search);
|
||||||
|
|
|
@ -8,18 +8,32 @@ const $props = defineProps({
|
||||||
default: null,
|
default: null,
|
||||||
},
|
},
|
||||||
find: {
|
find: {
|
||||||
type: String,
|
type: [String, Object],
|
||||||
default: null,
|
default: null,
|
||||||
|
description: 'search in row to add default options',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
const options = ref([]);
|
const options = ref([]);
|
||||||
|
|
||||||
onBeforeMount(async () => {
|
onBeforeMount(async () => {
|
||||||
const { url } = useAttrs();
|
const { url, optionValue, optionLabel } = useAttrs();
|
||||||
const findBy = $props.find ?? url?.charAt(0)?.toLocaleLowerCase() + url?.slice(1, -1);
|
const findBy = $props.find ?? url?.charAt(0)?.toLocaleLowerCase() + url?.slice(1, -1);
|
||||||
if (findBy) options.value = [$props.row[findBy]];
|
if (!findBy || !$props.row) return;
|
||||||
|
// is object
|
||||||
|
if (typeof findBy == 'object') {
|
||||||
|
const { value, label } = findBy;
|
||||||
|
if (!$props.row[value] || !$props.row[label]) return;
|
||||||
|
return (options.value = [
|
||||||
|
{
|
||||||
|
[optionValue ?? 'id']: $props.row[value],
|
||||||
|
[optionLabel ?? 'name']: $props.row[label],
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
// is string
|
||||||
|
if ($props.row[findBy]) options.value = [$props.row[findBy]];
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<VnSelect v-bind="$attrs" :options="$attrs.options ?? options" />
|
<VnSelect v-bind="$attrs" :options="$attrs.options ?? options" />
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -120,7 +120,7 @@ const toModule = computed(() =>
|
||||||
:icon="iconModule"
|
:icon="iconModule"
|
||||||
color="white"
|
color="white"
|
||||||
class="link"
|
class="link"
|
||||||
:to="toModule"
|
:to="$attrs['to-module'] ?? toModule"
|
||||||
>
|
>
|
||||||
<QTooltip>
|
<QTooltip>
|
||||||
{{ t('globals.goToModuleIndex') }}
|
{{ t('globals.goToModuleIndex') }}
|
||||||
|
|
|
@ -52,8 +52,8 @@ const containerClasses = computed(() => {
|
||||||
--calendar-border-current: #84d0e2 2px solid;
|
--calendar-border-current: #84d0e2 2px solid;
|
||||||
--calendar-current-color-dark: #84d0e2;
|
--calendar-current-color-dark: #84d0e2;
|
||||||
// Colores de fondo del calendario en dark mode
|
// Colores de fondo del calendario en dark mode
|
||||||
--calendar-outside-background-dark: #222;
|
--calendar-outside-background-dark: var(--vn-section-color);
|
||||||
--calendar-background-dark: #222;
|
--calendar-background-dark: var(--vn-section-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clases para modificar el color de fecha seleccionada en componente QCalendarMonth
|
// Clases para modificar el color de fecha seleccionada en componente QCalendarMonth
|
||||||
|
@ -70,8 +70,27 @@ const containerClasses = computed(() => {
|
||||||
text-transform: capitalize;
|
text-transform: capitalize;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.q-calendar-month__head--workweek,
|
||||||
|
.q-calendar-month__head--weekday,
|
||||||
|
// .q-calendar-month__workweek.q-past-day,
|
||||||
|
.q-calendar-month__week :nth-child(6),
|
||||||
|
:nth-child(7) {
|
||||||
|
color: var(--vn-label-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
.q-calendar-month__head--weekdays > div[aria-label='miércoles'] > span {
|
||||||
|
/* color: transparent; */
|
||||||
|
visibility: hidden;
|
||||||
|
// position: absolute;
|
||||||
|
}
|
||||||
|
.q-calendar-month__head--weekdays > div[aria-label='miércoles'] > span:after {
|
||||||
|
content: 'X';
|
||||||
|
visibility: visible;
|
||||||
|
left: 33%;
|
||||||
|
position: absolute;
|
||||||
|
}
|
||||||
.transparent-background {
|
.transparent-background {
|
||||||
--calendar-background-dark: transparent;
|
// --calendar-background-dark: transparent;
|
||||||
--calendar-background: transparent;
|
--calendar-background: transparent;
|
||||||
--calendar-outside-background-dark: transparent;
|
--calendar-outside-background-dark: transparent;
|
||||||
}
|
}
|
||||||
|
@ -110,11 +129,6 @@ const containerClasses = computed(() => {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.q-calendar-month__week--days > div:nth-child(6),
|
|
||||||
.q-calendar-month__week--days > div:nth-child(7) {
|
|
||||||
// Cambia el color de los días sábado y domingo
|
|
||||||
color: #777777;
|
|
||||||
}
|
|
||||||
|
|
||||||
.q-calendar-month__week--wrapper {
|
.q-calendar-month__week--wrapper {
|
||||||
margin-bottom: 4px;
|
margin-bottom: 4px;
|
||||||
|
@ -124,6 +138,7 @@ const containerClasses = computed(() => {
|
||||||
height: 32px;
|
height: 32px;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
color: var(--vn-label-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
.q-calendar__button--bordered {
|
.q-calendar__button--bordered {
|
||||||
|
@ -147,7 +162,7 @@ const containerClasses = computed(() => {
|
||||||
.q-calendar-month__head--workweek,
|
.q-calendar-month__head--workweek,
|
||||||
.q-calendar-month__head--weekday.q-calendar__center.q-calendar__ellipsis {
|
.q-calendar-month__head--weekday.q-calendar__center.q-calendar__ellipsis {
|
||||||
text-transform: capitalize;
|
text-transform: capitalize;
|
||||||
color: $color-font-secondary;
|
color: var(--vn-label-color);
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
font-size: 0.8rem;
|
font-size: 0.8rem;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|
|
@ -110,9 +110,11 @@ async function search(evt) {
|
||||||
|
|
||||||
store.filter.where = {};
|
store.filter.where = {};
|
||||||
isLoading.value = true;
|
isLoading.value = true;
|
||||||
const filter = { ...userParams.value };
|
const filter = { ...userParams.value, ...$props.modelValue };
|
||||||
store.userParamsChanged = true;
|
store.userParamsChanged = true;
|
||||||
const { params: newParams } = await arrayData.addFilter({ params: userParams.value });
|
const { params: newParams } = await arrayData.addFilter({
|
||||||
|
params: filter,
|
||||||
|
});
|
||||||
userParams.value = newParams;
|
userParams.value = newParams;
|
||||||
|
|
||||||
if (!$props.showAll && !Object.values(filter).length) store.data = [];
|
if (!$props.showAll && !Object.values(filter).length) store.data = [];
|
||||||
|
|
|
@ -18,7 +18,7 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
setOptions();
|
setOptions();
|
||||||
arrayDataStore.reset(['skip']);
|
reset(['skip']);
|
||||||
|
|
||||||
const query = route.query;
|
const query = route.query;
|
||||||
const searchUrl = store.searchUrl;
|
const searchUrl = store.searchUrl;
|
||||||
|
@ -74,9 +74,7 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
|
||||||
};
|
};
|
||||||
|
|
||||||
let exprFilter;
|
let exprFilter;
|
||||||
|
|
||||||
let userParams = { ...store.userParams };
|
let userParams = { ...store.userParams };
|
||||||
|
|
||||||
if (store?.exprBuilder) {
|
if (store?.exprBuilder) {
|
||||||
const where = buildFilter(userParams, (param, value) => {
|
const where = buildFilter(userParams, (param, value) => {
|
||||||
const res = store.exprBuilder(param, value);
|
const res = store.exprBuilder(param, value);
|
||||||
|
@ -159,11 +157,10 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
|
||||||
if (filter) store.filter = filter;
|
if (filter) store.filter = filter;
|
||||||
|
|
||||||
let userParams = { ...store.userParams, ...params };
|
let userParams = { ...store.userParams, ...params };
|
||||||
|
|
||||||
userParams = sanitizerParams(userParams, store?.exprBuilder);
|
userParams = sanitizerParams(userParams, store?.exprBuilder);
|
||||||
|
|
||||||
store.userParams = userParams;
|
store.userParams = userParams;
|
||||||
arrayDataStore.reset(['skip', 'filter.skip', 'page']);
|
reset(['skip', 'filter.skip', 'page']);
|
||||||
|
|
||||||
await fetch({});
|
await fetch({});
|
||||||
return { filter, params };
|
return { filter, params };
|
||||||
|
@ -190,6 +187,7 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
|
||||||
}
|
}
|
||||||
|
|
||||||
store.order = order;
|
store.order = order;
|
||||||
|
reset(['skip', 'filter.skip', 'page']);
|
||||||
fetch({});
|
fetch({});
|
||||||
index++;
|
index++;
|
||||||
|
|
||||||
|
|
|
@ -246,6 +246,7 @@ globals:
|
||||||
mailForwarding: Mail forwarding
|
mailForwarding: Mail forwarding
|
||||||
mailAlias: Mail alias
|
mailAlias: Mail alias
|
||||||
privileges: Privileges
|
privileges: Privileges
|
||||||
|
labeler: Labeler
|
||||||
created: Created
|
created: Created
|
||||||
worker: Worker
|
worker: Worker
|
||||||
now: Now
|
now: Now
|
||||||
|
|
|
@ -248,6 +248,7 @@ globals:
|
||||||
components: Componentes
|
components: Componentes
|
||||||
pictures: Fotos
|
pictures: Fotos
|
||||||
packages: Bultos
|
packages: Bultos
|
||||||
|
labeler: Etiquetas
|
||||||
created: Fecha creación
|
created: Fecha creación
|
||||||
worker: Trabajador
|
worker: Trabajador
|
||||||
now: Ahora
|
now: Ahora
|
||||||
|
|
|
@ -24,7 +24,7 @@ const $props = defineProps({
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
const DepartmentDescriptorRef = ref();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const { notify } = useNotify();
|
const { notify } = useNotify();
|
||||||
|
|
||||||
|
@ -55,18 +55,20 @@ const { openConfirmationModal } = useVnConfirm();
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<CardDescriptor
|
<CardDescriptor
|
||||||
|
ref="DepartmentDescriptorRef"
|
||||||
module="Department"
|
module="Department"
|
||||||
data-key="departmentData"
|
|
||||||
:url="`Departments/${entityId}`"
|
:url="`Departments/${entityId}`"
|
||||||
:title="data.title"
|
:title="data.title"
|
||||||
:subtitle="data.subtitle"
|
:subtitle="data.subtitle"
|
||||||
:summary="$props.summary"
|
:summary="$props.summary"
|
||||||
|
:to-module="{ name: 'WorkerDepartment' }"
|
||||||
@on-fetch="
|
@on-fetch="
|
||||||
(data) => {
|
(data) => {
|
||||||
department = data;
|
department = data;
|
||||||
setData(data);
|
setData(data);
|
||||||
}
|
}
|
||||||
"
|
"
|
||||||
|
data-key="department"
|
||||||
>
|
>
|
||||||
<template #menu="{}">
|
<template #menu="{}">
|
||||||
<QItem
|
<QItem
|
||||||
|
|
|
@ -115,7 +115,6 @@ watch;
|
||||||
:subtitle="data.subtitle"
|
:subtitle="data.subtitle"
|
||||||
@on-fetch="setData"
|
@on-fetch="setData"
|
||||||
data-key="entry"
|
data-key="entry"
|
||||||
:summary="$attrs"
|
|
||||||
>
|
>
|
||||||
<template #menu="{ entity }">
|
<template #menu="{ entity }">
|
||||||
<QItem v-ripple clickable @click="showEntryReport(entity)">
|
<QItem v-ripple clickable @click="showEntryReport(entity)">
|
||||||
|
|
|
@ -183,15 +183,10 @@ const fetchEntryBuys = async () => {
|
||||||
{{ t('globals.summary.basicData') }}
|
{{ t('globals.summary.basicData') }}
|
||||||
<QIcon name="open_in_new" />
|
<QIcon name="open_in_new" />
|
||||||
</router-link>
|
</router-link>
|
||||||
|
|
||||||
<VnLv :label="t('entry.summary.commission')" :value="entry.commission" />
|
<VnLv :label="t('entry.summary.commission')" :value="entry.commission" />
|
||||||
|
|
||||||
<VnLv :label="t('entry.summary.currency')" :value="entry.currency.name" />
|
<VnLv :label="t('entry.summary.currency')" :value="entry.currency.name" />
|
||||||
|
|
||||||
<VnLv :label="t('entry.summary.company')" :value="entry.company.code" />
|
<VnLv :label="t('entry.summary.company')" :value="entry.company.code" />
|
||||||
|
|
||||||
<VnLv :label="t('entry.summary.reference')" :value="entry.reference" />
|
<VnLv :label="t('entry.summary.reference')" :value="entry.reference" />
|
||||||
|
|
||||||
<VnLv
|
<VnLv
|
||||||
:label="t('entry.summary.invoiceNumber')"
|
:label="t('entry.summary.invoiceNumber')"
|
||||||
:value="entry.invoiceNumber"
|
:value="entry.invoiceNumber"
|
||||||
|
@ -205,7 +200,6 @@ const fetchEntryBuys = async () => {
|
||||||
{{ t('globals.summary.basicData') }}
|
{{ t('globals.summary.basicData') }}
|
||||||
<QIcon name="open_in_new" />
|
<QIcon name="open_in_new" />
|
||||||
</router-link>
|
</router-link>
|
||||||
|
|
||||||
<VnLv :label="t('entry.summary.travelReference')">
|
<VnLv :label="t('entry.summary.travelReference')">
|
||||||
<template #value>
|
<template #value>
|
||||||
<span class="link">
|
<span class="link">
|
||||||
|
@ -214,31 +208,25 @@ const fetchEntryBuys = async () => {
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</VnLv>
|
</VnLv>
|
||||||
|
|
||||||
<VnLv
|
<VnLv
|
||||||
:label="t('entry.summary.travelAgency')"
|
:label="t('entry.summary.travelAgency')"
|
||||||
:value="entry.travel.agency.name"
|
:value="entry.travel.agency.name"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<VnLv :label="t('shipped')" :value="toDate(entry.travel.shipped)" />
|
<VnLv :label="t('shipped')" :value="toDate(entry.travel.shipped)" />
|
||||||
|
|
||||||
<VnLv
|
<VnLv
|
||||||
:label="t('entry.summary.travelWarehouseOut')"
|
:label="t('entry.summary.travelWarehouseOut')"
|
||||||
:value="entry.travel.warehouseOut.name"
|
:value="entry.travel.warehouseOut.name"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<QCheckbox
|
<QCheckbox
|
||||||
:label="t('entry.summary.travelDelivered')"
|
:label="t('entry.summary.travelDelivered')"
|
||||||
v-model="entry.travel.isDelivered"
|
v-model="entry.travel.isDelivered"
|
||||||
:disable="true"
|
:disable="true"
|
||||||
/>
|
/>
|
||||||
<VnLv :label="t('landed')" :value="toDate(entry.travel.landed)" />
|
<VnLv :label="t('landed')" :value="toDate(entry.travel.landed)" />
|
||||||
|
|
||||||
<VnLv
|
<VnLv
|
||||||
:label="t('entry.summary.travelWarehouseIn')"
|
:label="t('entry.summary.travelWarehouseIn')"
|
||||||
:value="entry.travel.warehouseIn.name"
|
:value="entry.travel.warehouseIn.name"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<QCheckbox
|
<QCheckbox
|
||||||
:label="t('entry.summary.travelReceived')"
|
:label="t('entry.summary.travelReceived')"
|
||||||
v-model="entry.travel.isReceived"
|
v-model="entry.travel.isReceived"
|
||||||
|
|
|
@ -63,7 +63,7 @@ const redirectToEntryBasicData = (_, { id }) => {
|
||||||
<VnSearchbar
|
<VnSearchbar
|
||||||
url="Entries/filter"
|
url="Entries/filter"
|
||||||
custom-route-redirect-name="EntrySummary"
|
custom-route-redirect-name="EntrySummary"
|
||||||
data-key="EntrySummary"
|
data-key="Entry"
|
||||||
:label="t('Search entries')"
|
:label="t('Search entries')"
|
||||||
:info="t('You can search by entry reference')"
|
:info="t('You can search by entry reference')"
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -98,7 +98,6 @@ const printBuys = (rowId) => {
|
||||||
ref="myEntriesRef"
|
ref="myEntriesRef"
|
||||||
data-key="myEntriesList"
|
data-key="myEntriesList"
|
||||||
url="Entries/filter"
|
url="Entries/filter"
|
||||||
:order="['landed DESC', 'id DESC']"
|
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
default-mode="card"
|
default-mode="card"
|
||||||
auto-load
|
auto-load
|
||||||
|
|
|
@ -84,7 +84,7 @@ const setData = (entity) => (data.value = useCardDescription(entity.ref, entity.
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<template #actions="{ entity }">
|
<template #actions="{ entity }">
|
||||||
<QCardActions>
|
<QCardActions class="flex justify-center">
|
||||||
<QBtn
|
<QBtn
|
||||||
v-if="entity.client"
|
v-if="entity.client"
|
||||||
size="md"
|
size="md"
|
||||||
|
|
|
@ -14,10 +14,10 @@ const stateStore = useStateStore();
|
||||||
const expanded = ref(true);
|
const expanded = ref(true);
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
stateStore.rightDrawer = true;
|
stateStore.leftDrawer = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
onUnmounted(() => (stateStore.rightDrawer = false));
|
onUnmounted(() => (stateStore.leftDrawer = true));
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -63,13 +63,15 @@ onUnmounted(() => (stateStore.rightDrawer = false));
|
||||||
</template>
|
</template>
|
||||||
</QExpansionItem>
|
</QExpansionItem>
|
||||||
</QCard>
|
</QCard>
|
||||||
<QCard class="full-width q-mb-lg">
|
<QCard class="full-width">
|
||||||
<QItem class="justify-between">
|
<QItem class="justify-between">
|
||||||
<QItemLabel class="slider-container">
|
<QItemLabel class="col slider-container">
|
||||||
<span class="text-body1"
|
<span class="text-body1"
|
||||||
>{{ t('salesMonitor.ticketsMonitor') }}
|
>{{ t('salesMonitor.ticketsMonitor') }}
|
||||||
</span>
|
</span>
|
||||||
<QCardSection class="col"><SalesTicketsTable /> </QCardSection>
|
<QCardSection class="col" style="padding-inline: 0"
|
||||||
|
><SalesTicketsTable />
|
||||||
|
</QCardSection>
|
||||||
</QItemLabel>
|
</QItemLabel>
|
||||||
</QItem>
|
</QItem>
|
||||||
</QCard>
|
</QCard>
|
||||||
|
|
|
@ -3,14 +3,11 @@ import { ref, computed, reactive, watch } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
|
||||||
import FetchData from 'components/FetchData.vue';
|
import FetchData from 'components/FetchData.vue';
|
||||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
|
||||||
import VnInputDate from 'src/components/common/VnInputDate.vue';
|
|
||||||
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
|
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
|
||||||
import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorProxy.vue';
|
import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorProxy.vue';
|
||||||
import VnPaginate from 'components/ui/VnPaginate.vue';
|
|
||||||
|
|
||||||
import { toDateFormat } from 'src/filters/date.js';
|
import { toDateFormat } from 'src/filters/date.js';
|
||||||
import { dashIfEmpty } from 'src/filters';
|
import VnTable from 'src/components/VnTable/VnTable.vue';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
|
||||||
|
@ -37,9 +34,11 @@ const filter = reactive({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const refetch = async () => await paginateRef.value.fetch();
|
||||||
|
|
||||||
watch(dateRange, (val) => {
|
watch(dateRange, (val) => {
|
||||||
filter.where['v.stamp'].between = val;
|
filter.where['v.stamp'].between = val;
|
||||||
paginateRef.value.fetch();
|
refetch();
|
||||||
});
|
});
|
||||||
|
|
||||||
function exprBuilder(param, value) {
|
function exprBuilder(param, value) {
|
||||||
|
@ -53,25 +52,15 @@ function exprBuilder(param, value) {
|
||||||
|
|
||||||
const params = reactive({});
|
const params = reactive({});
|
||||||
|
|
||||||
const applyColumnFilter = async (col) => {
|
|
||||||
try {
|
|
||||||
const paramKey = col.columnFilter?.filterParamKey || col.field;
|
|
||||||
params[paramKey] = col.columnFilter.filterValue;
|
|
||||||
await paginateRef.value.addFilter(null, params);
|
|
||||||
} catch (err) {
|
|
||||||
console.error('Error applying column filter', err);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const columns = computed(() => [
|
const columns = computed(() => [
|
||||||
{
|
{
|
||||||
label: t('salesClientsTable.date'),
|
label: t('salesClientsTable.date'),
|
||||||
name: 'date',
|
name: 'dated',
|
||||||
field: 'dated',
|
field: 'dated',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
columnFilter: null,
|
columnFilter: null,
|
||||||
sortable: true,
|
sortable: true,
|
||||||
format: (val) => toDateFormat(val),
|
format: (row) => toDateFormat(row.dated),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('salesClientsTable.hour'),
|
label: t('salesClientsTable.hour'),
|
||||||
|
@ -86,40 +75,20 @@ const columns = computed(() => [
|
||||||
field: 'salesPerson',
|
field: 'salesPerson',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
sortable: true,
|
sortable: true,
|
||||||
columnFilter: {
|
columnField: {
|
||||||
component: VnSelect,
|
component: null,
|
||||||
filterParamKey: 'salesPersonFk',
|
|
||||||
type: 'select',
|
|
||||||
filterValue: null,
|
|
||||||
attrs: {
|
|
||||||
options: workersActiveOptions.value,
|
|
||||||
'option-value': 'id',
|
|
||||||
'option-label': 'name',
|
|
||||||
dense: true,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
format: (val) => dashIfEmpty(val),
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
label: t('salesClientsTable.client'),
|
label: t('salesClientsTable.client'),
|
||||||
field: 'clientName',
|
field: 'clientName',
|
||||||
name: 'client',
|
name: 'client',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
sortable: true,
|
sortable: true,
|
||||||
columnFilter: {
|
columnField: {
|
||||||
component: VnSelect,
|
component: null,
|
||||||
filterParamKey: 'clientFk',
|
|
||||||
type: 'select',
|
|
||||||
filterValue: null,
|
|
||||||
attrs: {
|
|
||||||
options: clientsOptions.value,
|
|
||||||
'option-value': 'id',
|
|
||||||
'option-label': 'name',
|
|
||||||
dense: true,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
format: (val) => dashIfEmpty(val),
|
|
||||||
},
|
|
||||||
]);
|
]);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -144,7 +113,7 @@ const columns = computed(() => [
|
||||||
@on-fetch="(data) => (clientsOptions = data)"
|
@on-fetch="(data) => (clientsOptions = data)"
|
||||||
/>
|
/>
|
||||||
<QCard style="max-height: 380px; overflow-y: scroll">
|
<QCard style="max-height: 380px; overflow-y: scroll">
|
||||||
<VnPaginate
|
<VnTable
|
||||||
ref="paginateRef"
|
ref="paginateRef"
|
||||||
data-key="SalesMonitorClients"
|
data-key="SalesMonitorClients"
|
||||||
url="SalesMonitors/clientsFilter"
|
url="SalesMonitors/clientsFilter"
|
||||||
|
@ -155,63 +124,24 @@ const columns = computed(() => [
|
||||||
:filter="filter"
|
:filter="filter"
|
||||||
:offset="50"
|
:offset="50"
|
||||||
auto-load
|
auto-load
|
||||||
>
|
|
||||||
<template #body="{ rows }">
|
|
||||||
<QTable
|
|
||||||
:rows="rows"
|
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
row-key="id"
|
:right-search="false"
|
||||||
:pagination="{ rowsPerPage: 0 }"
|
default-mode="table"
|
||||||
class="full-width"
|
dense
|
||||||
:no-data-label="t('globals.noResults')"
|
:without-header="true"
|
||||||
>
|
>
|
||||||
<template #top>
|
<template #column-salesPerson="{ row }">
|
||||||
<VnInputDate
|
|
||||||
:label="t('salesClientsTable.from')"
|
|
||||||
dense
|
|
||||||
v-model="from"
|
|
||||||
class="q-mr-lg"
|
|
||||||
style="width: 150px"
|
|
||||||
/>
|
|
||||||
<VnInputDate
|
|
||||||
:label="t('salesClientsTable.to')"
|
|
||||||
dense
|
|
||||||
v-model="to"
|
|
||||||
style="width: 150px"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
<template #top-row="{ cols }">
|
|
||||||
<QTr>
|
|
||||||
<QTd
|
|
||||||
v-for="(col, index) in cols"
|
|
||||||
:key="index"
|
|
||||||
style="max-width: 100px"
|
|
||||||
>
|
|
||||||
<VnSelect
|
|
||||||
:is="col.columnFilter.component"
|
|
||||||
v-if="col.columnFilter"
|
|
||||||
v-model="col.columnFilter.filterValue"
|
|
||||||
v-bind="col.columnFilter.attrs"
|
|
||||||
@update:model-value="applyColumnFilter(col)"
|
|
||||||
dense
|
|
||||||
/>
|
|
||||||
</QTd>
|
|
||||||
</QTr>
|
|
||||||
</template>
|
|
||||||
<template #body-cell-salesPerson="{ row }">
|
|
||||||
<QTd>
|
<QTd>
|
||||||
<span class="link">{{ row.salesPerson }}</span>
|
<span class="link">{{ row.salesPerson }}</span>
|
||||||
<WorkerDescriptorProxy :id="row.salesPersonFk" dense />
|
<WorkerDescriptorProxy :id="row.salesPersonFk" dense />
|
||||||
</QTd>
|
</QTd>
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-client="{ row }">
|
<template #column-client="{ row }">
|
||||||
<QTd>
|
<QTd>
|
||||||
<span class="link">{{ row.clientName }}</span>
|
<span class="link">{{ row.clientName }}</span>
|
||||||
<CustomerDescriptorProxy :id="row.clientFk" />
|
<CustomerDescriptorProxy :id="row.clientFk" />
|
||||||
</QTd>
|
</QTd>
|
||||||
</template>
|
</template>
|
||||||
</QTable>
|
</VnTable>
|
||||||
</template>
|
|
||||||
</VnPaginate>
|
|
||||||
</QCard>
|
</QCard>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -5,7 +5,8 @@ import { useI18n } from 'vue-i18n';
|
||||||
import FetchData from 'components/FetchData.vue';
|
import FetchData from 'components/FetchData.vue';
|
||||||
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
|
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
|
||||||
import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorProxy.vue';
|
import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorProxy.vue';
|
||||||
import VnPaginate from 'components/ui/VnPaginate.vue';
|
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
|
||||||
|
import VnTable from 'components/VnTable/VnTable.vue';
|
||||||
|
|
||||||
import { toDateFormat, toDateTimeFormat } from 'src/filters/date.js';
|
import { toDateFormat, toDateTimeFormat } from 'src/filters/date.js';
|
||||||
import { toCurrency } from 'src/filters';
|
import { toCurrency } from 'src/filters';
|
||||||
|
@ -50,19 +51,22 @@ const columns = computed(() => [
|
||||||
name: 'date',
|
name: 'date',
|
||||||
field: 'dated',
|
field: 'dated',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
columnFilter: null,
|
sortable: true,
|
||||||
|
cardVisible: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('salesOrdersTable.client'),
|
label: t('salesOrdersTable.client'),
|
||||||
name: 'client',
|
name: 'client',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
sortable: true,
|
sortable: true,
|
||||||
|
cardVisible: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('salesOrdersTable.salesPerson'),
|
label: t('salesOrdersTable.salesPerson'),
|
||||||
name: 'salesPerson',
|
name: 'salesPerson',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
sortable: true,
|
sortable: true,
|
||||||
|
cardVisible: true,
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
@ -119,28 +123,29 @@ const redirectToOrderSummary = (orderId) => {
|
||||||
@on-fetch="(data) => (clientsOptions = data)"
|
@on-fetch="(data) => (clientsOptions = data)"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<VnSubToolbar />
|
||||||
<QCard style="max-height: 380px; overflow-y: scroll">
|
<QCard style="max-height: 380px; overflow-y: scroll">
|
||||||
<VnPaginate
|
<VnTable
|
||||||
ref="paginateRef"
|
ref="paginateRef"
|
||||||
data-key="SalesMonitorOrders"
|
data-key="SalesMonitorOrders"
|
||||||
url="SalesMonitors/ordersFilter"
|
url="SalesMonitors/ordersFilter"
|
||||||
order="date_make DESC"
|
order="date_make DESC"
|
||||||
:limit="6"
|
:limit="6"
|
||||||
|
:right-search="false"
|
||||||
:expr-builder="exprBuilder"
|
:expr-builder="exprBuilder"
|
||||||
auto-load
|
auto-load
|
||||||
>
|
|
||||||
<template #body="{ rows }">
|
|
||||||
<QTable
|
|
||||||
:rows="rows"
|
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
row-key="id"
|
:table="{
|
||||||
selection="multiple"
|
'row-key': 'id',
|
||||||
v-model:selected="selectedRows"
|
selection: 'multiple',
|
||||||
:pagination="{ rowsPerPage: 0 }"
|
'hide-bottom': true,
|
||||||
:no-data-label="t('globals.noResults')"
|
}"
|
||||||
|
default-mode="table"
|
||||||
|
:without-header="false"
|
||||||
@row-click="(_, row) => redirectToOrderSummary(row.id)"
|
@row-click="(_, row) => redirectToOrderSummary(row.id)"
|
||||||
|
v-model:selected="selectedRows"
|
||||||
>
|
>
|
||||||
<template #top>
|
<template #top-left>
|
||||||
<QBtn
|
<QBtn
|
||||||
v-if="selectedRows.length > 0"
|
v-if="selectedRows.length > 0"
|
||||||
icon="delete"
|
icon="delete"
|
||||||
|
@ -157,13 +162,12 @@ const redirectToOrderSummary = (orderId) => {
|
||||||
<QTooltip>{{ t('salesOrdersTable.delete') }}</QTooltip>
|
<QTooltip>{{ t('salesOrdersTable.delete') }}</QTooltip>
|
||||||
</QBtn>
|
</QBtn>
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-date="{ row }">
|
<template #column-date="{ row }">
|
||||||
<QTd>
|
<QTd>
|
||||||
<QBadge
|
<QBadge
|
||||||
:color="getBadgeColor(row.date_send)"
|
:color="getBadgeColor(row.date_send)"
|
||||||
text-color="black"
|
text-color="black"
|
||||||
class="q-ma-none q-mb-md"
|
class="q-pa-sm q-mb-md"
|
||||||
dense
|
|
||||||
style="font-size: 14px"
|
style="font-size: 14px"
|
||||||
>
|
>
|
||||||
{{ toDateFormat(row.date_send) }}
|
{{ toDateFormat(row.date_send) }}
|
||||||
|
@ -171,7 +175,7 @@ const redirectToOrderSummary = (orderId) => {
|
||||||
<div>{{ toDateTimeFormat(row.date_make) }}</div>
|
<div>{{ toDateTimeFormat(row.date_make) }}</div>
|
||||||
</QTd>
|
</QTd>
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-client="{ row }">
|
<template #column-client="{ row }">
|
||||||
<QTd>
|
<QTd>
|
||||||
<div class="q-mb-md">
|
<div class="q-mb-md">
|
||||||
<span class="link">{{ row.clientName }}</span>
|
<span class="link">{{ row.clientName }}</span>
|
||||||
|
@ -180,7 +184,8 @@ const redirectToOrderSummary = (orderId) => {
|
||||||
<span> {{ row.agencyName }}</span>
|
<span> {{ row.agencyName }}</span>
|
||||||
</QTd>
|
</QTd>
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-salesPerson="{ row }">
|
|
||||||
|
<template #column-salesPerson="{ row }">
|
||||||
<QTd>
|
<QTd>
|
||||||
<div class="q-mb-md">
|
<div class="q-mb-md">
|
||||||
<span class="link">{{ row.salesPerson }}</span>
|
<span class="link">{{ row.salesPerson }}</span>
|
||||||
|
@ -189,9 +194,7 @@ const redirectToOrderSummary = (orderId) => {
|
||||||
<span>{{ toCurrency(row.import) }}</span>
|
<span>{{ toCurrency(row.import) }}</span>
|
||||||
</QTd>
|
</QTd>
|
||||||
</template>
|
</template>
|
||||||
</QTable>
|
</VnTable>
|
||||||
</template>
|
|
||||||
</VnPaginate>
|
|
||||||
</QCard>
|
</QCard>
|
||||||
</template>
|
</template>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
|
@ -6,7 +6,6 @@ import { useRouter } from 'vue-router';
|
||||||
import FetchData from 'components/FetchData.vue';
|
import FetchData from 'components/FetchData.vue';
|
||||||
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
|
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
|
||||||
import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorProxy.vue';
|
import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorProxy.vue';
|
||||||
import VnPaginate from 'components/ui/VnPaginate.vue';
|
|
||||||
import TableVisibleColumns from 'src/components/common/TableVisibleColumns.vue';
|
import TableVisibleColumns from 'src/components/common/TableVisibleColumns.vue';
|
||||||
import TicketDescriptorProxy from 'src/pages/Ticket/Card/TicketDescriptorProxy.vue';
|
import TicketDescriptorProxy from 'src/pages/Ticket/Card/TicketDescriptorProxy.vue';
|
||||||
import InvoiceOutDescriptorProxy from 'src/pages/InvoiceOut/Card/InvoiceOutDescriptorProxy.vue';
|
import InvoiceOutDescriptorProxy from 'src/pages/InvoiceOut/Card/InvoiceOutDescriptorProxy.vue';
|
||||||
|
@ -15,6 +14,7 @@ import TicketSummary from 'src/pages/Ticket/Card/TicketSummary.vue';
|
||||||
import VnInput from 'src/components/common/VnInput.vue';
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
import VnInputDate from 'src/components/common/VnInputDate.vue';
|
import VnInputDate from 'src/components/common/VnInputDate.vue';
|
||||||
|
import VnTable from 'components/VnTable/VnTable.vue';
|
||||||
|
|
||||||
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
||||||
import { toDateFormat, toTimeFormat } from 'src/filters/date.js';
|
import { toDateFormat, toTimeFormat } from 'src/filters/date.js';
|
||||||
|
@ -103,7 +103,10 @@ const columns = computed(() => [
|
||||||
name: 'problems',
|
name: 'problems',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
sortable: true,
|
sortable: true,
|
||||||
columnFilter: null,
|
columnFilter: false,
|
||||||
|
attrs: {
|
||||||
|
dense: true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('salesTicketsTable.identifier'),
|
label: t('salesTicketsTable.identifier'),
|
||||||
|
@ -111,11 +114,10 @@ const columns = computed(() => [
|
||||||
field: 'id',
|
field: 'id',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
sortable: true,
|
sortable: true,
|
||||||
|
|
||||||
columnFilter: {
|
columnFilter: {
|
||||||
component: VnInput,
|
component: 'input',
|
||||||
type: 'text',
|
name: 'id',
|
||||||
filterValue: null,
|
|
||||||
event: getInputEvents,
|
|
||||||
attrs: {
|
attrs: {
|
||||||
dense: true,
|
dense: true,
|
||||||
},
|
},
|
||||||
|
@ -128,10 +130,8 @@ const columns = computed(() => [
|
||||||
field: 'nickname',
|
field: 'nickname',
|
||||||
sortable: true,
|
sortable: true,
|
||||||
columnFilter: {
|
columnFilter: {
|
||||||
component: VnInput,
|
component: 'input',
|
||||||
type: 'text',
|
name: 'nickname',
|
||||||
filterValue: null,
|
|
||||||
event: getInputEvents,
|
|
||||||
attrs: {
|
attrs: {
|
||||||
dense: true,
|
dense: true,
|
||||||
},
|
},
|
||||||
|
@ -144,11 +144,8 @@ const columns = computed(() => [
|
||||||
align: 'left',
|
align: 'left',
|
||||||
sortable: true,
|
sortable: true,
|
||||||
columnFilter: {
|
columnFilter: {
|
||||||
component: VnSelect,
|
component: 'select',
|
||||||
filterParamKey: 'salesPersonFk',
|
name: 'salesPersonFk',
|
||||||
type: 'select',
|
|
||||||
filterValue: null,
|
|
||||||
event: getInputEvents,
|
|
||||||
attrs: {
|
attrs: {
|
||||||
options: workersActiveOptions.value,
|
options: workersActiveOptions.value,
|
||||||
'option-value': 'id',
|
'option-value': 'id',
|
||||||
|
@ -160,14 +157,12 @@ const columns = computed(() => [
|
||||||
{
|
{
|
||||||
label: t('salesTicketsTable.date'),
|
label: t('salesTicketsTable.date'),
|
||||||
name: 'date',
|
name: 'date',
|
||||||
|
style: { 'max-width': '100px' },
|
||||||
align: 'left',
|
align: 'left',
|
||||||
sortable: true,
|
sortable: true,
|
||||||
columnFilter: {
|
columnFilter: {
|
||||||
component: VnInputDate,
|
component: 'date',
|
||||||
filterParamKey: 'shippedDate',
|
name: 'shippedDate',
|
||||||
type: 'date',
|
|
||||||
filterValue: null,
|
|
||||||
event: getInputEvents,
|
|
||||||
attrs: {
|
attrs: {
|
||||||
dense: true,
|
dense: true,
|
||||||
},
|
},
|
||||||
|
@ -180,6 +175,13 @@ const columns = computed(() => [
|
||||||
align: 'left',
|
align: 'left',
|
||||||
sortable: true,
|
sortable: true,
|
||||||
format: (val) => toTimeFormat(val),
|
format: (val) => toTimeFormat(val),
|
||||||
|
columnFilter: {
|
||||||
|
component: 'input',
|
||||||
|
name: 'theoreticalHour',
|
||||||
|
attrs: {
|
||||||
|
dense: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('salesTicketsTable.practical'),
|
label: t('salesTicketsTable.practical'),
|
||||||
|
@ -188,10 +190,8 @@ const columns = computed(() => [
|
||||||
align: 'left',
|
align: 'left',
|
||||||
sortable: true,
|
sortable: true,
|
||||||
columnFilter: {
|
columnFilter: {
|
||||||
component: VnInput,
|
component: 'input',
|
||||||
type: 'text',
|
name: 'practicalHour',
|
||||||
filterValue: null,
|
|
||||||
event: getInputEvents,
|
|
||||||
attrs: {
|
attrs: {
|
||||||
dense: true,
|
dense: true,
|
||||||
},
|
},
|
||||||
|
@ -204,6 +204,13 @@ const columns = computed(() => [
|
||||||
align: 'left',
|
align: 'left',
|
||||||
sortable: true,
|
sortable: true,
|
||||||
format: (val) => toTimeFormat(val),
|
format: (val) => toTimeFormat(val),
|
||||||
|
columnFilter: {
|
||||||
|
component: 'input',
|
||||||
|
name: 'shippedDate',
|
||||||
|
attrs: {
|
||||||
|
dense: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -211,13 +218,11 @@ const columns = computed(() => [
|
||||||
name: 'province',
|
name: 'province',
|
||||||
field: 'province',
|
field: 'province',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
style: { 'max-width': '100px' },
|
||||||
sortable: true,
|
sortable: true,
|
||||||
columnFilter: {
|
columnFilter: {
|
||||||
component: VnSelect,
|
component: 'select',
|
||||||
filterParamKey: 'provinceFk',
|
name: 'provinceFk',
|
||||||
type: 'select',
|
|
||||||
filterValue: null,
|
|
||||||
event: getInputEvents,
|
|
||||||
attrs: {
|
attrs: {
|
||||||
options: provincesOptions.value,
|
options: provincesOptions.value,
|
||||||
'option-value': 'id',
|
'option-value': 'id',
|
||||||
|
@ -230,13 +235,11 @@ const columns = computed(() => [
|
||||||
label: t('salesTicketsTable.state'),
|
label: t('salesTicketsTable.state'),
|
||||||
name: 'state',
|
name: 'state',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
style: { 'max-width': '100px' },
|
||||||
sortable: true,
|
sortable: true,
|
||||||
columnFilter: {
|
columnFilter: {
|
||||||
component: VnSelect,
|
component: 'select',
|
||||||
filterParamKey: 'stateFk',
|
name: 'stateFk',
|
||||||
type: 'select',
|
|
||||||
filterValue: null,
|
|
||||||
event: getInputEvents,
|
|
||||||
attrs: {
|
attrs: {
|
||||||
options: statesOptions.value,
|
options: statesOptions.value,
|
||||||
'option-value': 'id',
|
'option-value': 'id',
|
||||||
|
@ -252,13 +255,13 @@ const columns = computed(() => [
|
||||||
align: 'left',
|
align: 'left',
|
||||||
sortable: true,
|
sortable: true,
|
||||||
columnFilter: {
|
columnFilter: {
|
||||||
component: VnInput,
|
inWhere: true,
|
||||||
type: 'text',
|
|
||||||
filterValue: null,
|
|
||||||
event: getInputEvents,
|
|
||||||
attrs: {
|
|
||||||
dense: true,
|
|
||||||
},
|
},
|
||||||
|
attrs: {
|
||||||
|
'checked-icon': 'local_bar',
|
||||||
|
'unchecked-icon': 'local_bar',
|
||||||
|
'false-value': 0,
|
||||||
|
'true-value': 1,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -267,11 +270,8 @@ const columns = computed(() => [
|
||||||
align: 'left',
|
align: 'left',
|
||||||
sortable: true,
|
sortable: true,
|
||||||
columnFilter: {
|
columnFilter: {
|
||||||
component: VnSelect,
|
component: 'select',
|
||||||
filterParamKey: 'zoneFk',
|
name: 'zoneFk',
|
||||||
type: 'select',
|
|
||||||
filterValue: null,
|
|
||||||
event: getInputEvents,
|
|
||||||
attrs: {
|
attrs: {
|
||||||
options: zonesOptions.value,
|
options: zonesOptions.value,
|
||||||
'option-value': 'id',
|
'option-value': 'id',
|
||||||
|
@ -285,21 +285,44 @@ const columns = computed(() => [
|
||||||
name: 'total',
|
name: 'total',
|
||||||
field: 'totalWithVat',
|
field: 'totalWithVat',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
style: { 'max-width': '75px' },
|
||||||
sortable: true,
|
sortable: true,
|
||||||
columnFilter: {
|
columnFilter: {
|
||||||
component: VnInput,
|
component: 'input',
|
||||||
type: 'text',
|
name: 'totalWithVat',
|
||||||
filterValue: null,
|
|
||||||
event: getInputEvents,
|
|
||||||
attrs: {
|
attrs: {
|
||||||
dense: true,
|
dense: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'rowActions',
|
align: 'right',
|
||||||
align: 'left',
|
name: 'tableActions',
|
||||||
sortable: true,
|
label: '',
|
||||||
|
actions: [
|
||||||
|
{
|
||||||
|
title: t('salesTicketsTable.goToLines'),
|
||||||
|
icon: 'vn:lines',
|
||||||
|
color: 'priamry',
|
||||||
|
action: (row) => redirectToSales(row.id),
|
||||||
|
isPrimary: true,
|
||||||
|
attrs: {
|
||||||
|
flat: true,
|
||||||
|
dense: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t('salesTicketsTable.preview'),
|
||||||
|
icon: 'preview',
|
||||||
|
color: 'priamry',
|
||||||
|
action: (row) => viewSummary(row.id, TicketSummary),
|
||||||
|
isPrimary: true,
|
||||||
|
attrs: {
|
||||||
|
flat: true,
|
||||||
|
dense: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
@ -315,7 +338,9 @@ const getBadgeAttrs = (date) => {
|
||||||
if (comparation < 0) return { color: 'success', 'text-color': 'black' };
|
if (comparation < 0) return { color: 'success', 'text-color': 'black' };
|
||||||
return { color: 'transparent', 'text-color': 'white' };
|
return { color: 'transparent', 'text-color': 'white' };
|
||||||
};
|
};
|
||||||
|
|
||||||
let refreshTimer = null;
|
let refreshTimer = null;
|
||||||
|
|
||||||
const autoRefreshHandler = (value) => {
|
const autoRefreshHandler = (value) => {
|
||||||
if (value)
|
if (value)
|
||||||
refreshTimer = setInterval(() => paginateRef.value.fetch(), DEFAULT_AUTO_REFRESH);
|
refreshTimer = setInterval(() => paginateRef.value.fetch(), DEFAULT_AUTO_REFRESH);
|
||||||
|
@ -324,8 +349,10 @@ const autoRefreshHandler = (value) => {
|
||||||
refreshTimer = null;
|
refreshTimer = null;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const redirectToTicketSummary = (id) => {
|
const redirectToTicketSummary = (id) => {
|
||||||
router.push({ name: 'TicketSummary', params: { id } });
|
const url = `#/ticket/${id}/summary`;
|
||||||
|
window.open(url, '_blank');
|
||||||
};
|
};
|
||||||
|
|
||||||
const stateColors = {
|
const stateColors = {
|
||||||
|
@ -348,12 +375,17 @@ const formatShippedDate = (date) => {
|
||||||
return toDateFormat(_date);
|
return toDateFormat(_date);
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted(async () => {
|
const redirectToSales = (id) => {
|
||||||
const filteredColumns = columns.value.filter((col) => col.name !== 'rowActions');
|
const url = `#/ticket/${id}/sale`;
|
||||||
allColumnNames.value = filteredColumns.map((col) => col.name);
|
window.open(url, '_blank');
|
||||||
params = fetchParams();
|
};
|
||||||
await paginateRef.value.addFilter(null, params);
|
|
||||||
});
|
// onMounted(async () => {
|
||||||
|
// const filteredColumns = columns.value.filter((col) => col.name !== 'rowActions');
|
||||||
|
// allColumnNames.value = filteredColumns.map((col) => col.name);
|
||||||
|
// params = fetchParams();
|
||||||
|
// await paginateRef.value.addFilter(null, params);
|
||||||
|
// });
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -394,7 +426,7 @@ onMounted(async () => {
|
||||||
auto-load
|
auto-load
|
||||||
@on-fetch="(data) => (zonesOptions = data)"
|
@on-fetch="(data) => (zonesOptions = data)"
|
||||||
/>
|
/>
|
||||||
<VnPaginate
|
<VnTable
|
||||||
ref="paginateRef"
|
ref="paginateRef"
|
||||||
data-key="SalesMonitorTickets"
|
data-key="SalesMonitorTickets"
|
||||||
url="SalesMonitors/salesFilter"
|
url="SalesMonitors/salesFilter"
|
||||||
|
@ -403,18 +435,14 @@ onMounted(async () => {
|
||||||
:expr-builder="exprBuilder"
|
:expr-builder="exprBuilder"
|
||||||
:user-params="params"
|
:user-params="params"
|
||||||
:offset="50"
|
:offset="50"
|
||||||
>
|
|
||||||
<template #body="{ rows }">
|
|
||||||
<QTable
|
|
||||||
:rows="rows"
|
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
row-key="id"
|
|
||||||
:pagination="{ rowsPerPage: 0 }"
|
|
||||||
:visible-columns="visibleColumns"
|
:visible-columns="visibleColumns"
|
||||||
:no-data-label="t('globals.noResults')"
|
:right-search="false"
|
||||||
|
default-mode="table"
|
||||||
|
auto-load
|
||||||
@row-click="(_, row) => redirectToTicketSummary(row.id)"
|
@row-click="(_, row) => redirectToTicketSummary(row.id)"
|
||||||
>
|
>
|
||||||
<template #top>
|
<template #top-left>
|
||||||
<TableVisibleColumns
|
<TableVisibleColumns
|
||||||
:all-columns="allColumnNames"
|
:all-columns="allColumnNames"
|
||||||
table-code="ticketsMonitor"
|
table-code="ticketsMonitor"
|
||||||
|
@ -427,36 +455,15 @@ onMounted(async () => {
|
||||||
@update:model-value="autoRefreshHandler"
|
@update:model-value="autoRefreshHandler"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<template #top-row="{ cols }">
|
<template #column-problems="{ row }">
|
||||||
<QTr>
|
<QTd class="no-padding" style="max-width: 50px">
|
||||||
<QTd
|
|
||||||
v-for="(col, index) in cols"
|
|
||||||
:key="index"
|
|
||||||
style="max-width: 100px"
|
|
||||||
>
|
|
||||||
<component
|
|
||||||
:is="col.columnFilter.component"
|
|
||||||
v-if="col.columnFilter"
|
|
||||||
v-model="col.columnFilter.filterValue"
|
|
||||||
v-bind="col.columnFilter.attrs"
|
|
||||||
v-on="col.columnFilter.event(col)"
|
|
||||||
dense
|
|
||||||
style="padding-bottom: 0"
|
|
||||||
/>
|
|
||||||
</QTd>
|
|
||||||
</QTr>
|
|
||||||
</template>
|
|
||||||
<template #body-cell-problems="{ row }">
|
|
||||||
<QTd class="q-gutter-x-sm">
|
|
||||||
<QIcon
|
<QIcon
|
||||||
v-if="row.isTaxDataChecked === 0"
|
v-if="row.isTaxDataChecked === 0"
|
||||||
name="vn:no036"
|
name="vn:no036"
|
||||||
color="primary"
|
color="primary"
|
||||||
size="xs"
|
size="xs"
|
||||||
>
|
>
|
||||||
<QTooltip>{{
|
<QTooltip>{{ t('salesTicketsTable.noVerifiedData') }}</QTooltip>
|
||||||
t('salesTicketsTable.noVerifiedData')
|
|
||||||
}}</QTooltip>
|
|
||||||
</QIcon>
|
</QIcon>
|
||||||
<QIcon
|
<QIcon
|
||||||
v-if="row.hasTicketRequest"
|
v-if="row.hasTicketRequest"
|
||||||
|
@ -464,9 +471,7 @@ onMounted(async () => {
|
||||||
color="primary"
|
color="primary"
|
||||||
size="xs"
|
size="xs"
|
||||||
>
|
>
|
||||||
<QTooltip>{{
|
<QTooltip>{{ t('salesTicketsTable.purchaseRequest') }}</QTooltip>
|
||||||
t('salesTicketsTable.purchaseRequest')
|
|
||||||
}}</QTooltip>
|
|
||||||
</QIcon>
|
</QIcon>
|
||||||
<QIcon
|
<QIcon
|
||||||
v-if="row.itemShortage"
|
v-if="row.itemShortage"
|
||||||
|
@ -476,12 +481,7 @@ onMounted(async () => {
|
||||||
>
|
>
|
||||||
<QTooltip>{{ t('salesTicketsTable.notVisible') }}</QTooltip>
|
<QTooltip>{{ t('salesTicketsTable.notVisible') }}</QTooltip>
|
||||||
</QIcon>
|
</QIcon>
|
||||||
<QIcon
|
<QIcon v-if="row.isFreezed" name="vn:frozen" color="primary" size="xs">
|
||||||
v-if="row.isFreezed"
|
|
||||||
name="vn:frozen"
|
|
||||||
color="primary"
|
|
||||||
size="xs"
|
|
||||||
>
|
|
||||||
<QTooltip>{{ t('salesTicketsTable.clientFrozen') }}</QTooltip>
|
<QTooltip>{{ t('salesTicketsTable.clientFrozen') }}</QTooltip>
|
||||||
</QIcon>
|
</QIcon>
|
||||||
<QIcon
|
<QIcon
|
||||||
|
@ -490,10 +490,7 @@ onMounted(async () => {
|
||||||
:color="row.hasHighRisk ? 'negative' : 'primary'"
|
:color="row.hasHighRisk ? 'negative' : 'primary'"
|
||||||
size="xs"
|
size="xs"
|
||||||
>
|
>
|
||||||
<QTooltip
|
<QTooltip>{{ t('salesTicketsTable.risk') }}: {{ row.risk }}</QTooltip>
|
||||||
>{{ t('salesTicketsTable.risk') }}:
|
|
||||||
{{ row.risk }}</QTooltip
|
|
||||||
>
|
|
||||||
</QIcon>
|
</QIcon>
|
||||||
<QIcon
|
<QIcon
|
||||||
v-if="row.hasComponentLack"
|
v-if="row.hasComponentLack"
|
||||||
|
@ -501,9 +498,7 @@ onMounted(async () => {
|
||||||
color="primary"
|
color="primary"
|
||||||
size="xs"
|
size="xs"
|
||||||
>
|
>
|
||||||
<QTooltip>{{
|
<QTooltip>{{ t('salesTicketsTable.componentLack') }}</QTooltip>
|
||||||
t('salesTicketsTable.componentLack')
|
|
||||||
}}</QTooltip>
|
|
||||||
</QIcon>
|
</QIcon>
|
||||||
<QIcon
|
<QIcon
|
||||||
v-if="row.isTooLittle"
|
v-if="row.isTooLittle"
|
||||||
|
@ -515,38 +510,39 @@ onMounted(async () => {
|
||||||
</QIcon>
|
</QIcon>
|
||||||
</QTd>
|
</QTd>
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-identifier="{ row }">
|
<template #column-identifier="{ row }">
|
||||||
<QTd>
|
<QTd class="no-padding">
|
||||||
<span class="link" @click.stop.prevent>{{ row.id }}</span>
|
<span class="link" @click.stop.prevent>
|
||||||
|
{{ row.id }}
|
||||||
<TicketDescriptorProxy :id="row.id" />
|
<TicketDescriptorProxy :id="row.id" />
|
||||||
|
</span>
|
||||||
</QTd>
|
</QTd>
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-client="{ row }">
|
<template #column-client="{ row }">
|
||||||
<QTd @click.stop.prevent>
|
<QTd class="no-padding" @click.stop.prevent>
|
||||||
<span class="link">{{ row.nickname }}</span>
|
<span class="link">{{ row.nickname }}</span>
|
||||||
<CustomerDescriptorProxy :id="row.clientFk" />
|
<CustomerDescriptorProxy :id="row.clientFk" />
|
||||||
</QTd>
|
</QTd>
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-salesPerson="{ row }">
|
<template #column-salesPerson="{ row }">
|
||||||
<QTd @click.stop.prevent>
|
<QTd class="no-padding" @click.stop.prevent>
|
||||||
<span class="link">{{ row.userName }}</span>
|
<span class="link">{{ row.userName }}</span>
|
||||||
<WorkerDescriptorProxy :id="row.salesPersonFk" />
|
<WorkerDescriptorProxy :id="row.salesPersonFk" />
|
||||||
</QTd>
|
</QTd>
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-date="{ row }">
|
<template #column-date="{ row }">
|
||||||
<QTd>
|
<QTd class="no-padding">
|
||||||
<QBadge
|
<QBadge
|
||||||
v-bind="getBadgeAttrs(row.shippedDate)"
|
v-bind="getBadgeAttrs(row.shippedDate)"
|
||||||
class="q-ma-none"
|
class="q-pa-sm"
|
||||||
dense
|
|
||||||
style="font-size: 14px"
|
style="font-size: 14px"
|
||||||
>
|
>
|
||||||
{{ formatShippedDate(row.shippedDate) }}
|
{{ formatShippedDate(row.shippedDate) }}
|
||||||
</QBadge>
|
</QBadge>
|
||||||
</QTd>
|
</QTd>
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-state="{ row }">
|
<template #column-state="{ row }">
|
||||||
<QTd @click.stop.prevent>
|
<QTd class="no-padding" @click.stop.prevent>
|
||||||
<div v-if="row.refFk">
|
<div v-if="row.refFk">
|
||||||
<span class="link">{{ row.refFk }}</span>
|
<span class="link">{{ row.refFk }}</span>
|
||||||
<InvoiceOutDescriptorProxy :id="row.invoiceOutId" />
|
<InvoiceOutDescriptorProxy :id="row.invoiceOutId" />
|
||||||
|
@ -555,69 +551,37 @@ onMounted(async () => {
|
||||||
v-else
|
v-else
|
||||||
:color="stateColors[row.classColor] || 'transparent'"
|
:color="stateColors[row.classColor] || 'transparent'"
|
||||||
:text-color="stateColors[row.classColor] ? 'black' : 'white'"
|
:text-color="stateColors[row.classColor] ? 'black' : 'white'"
|
||||||
dense
|
class="q-pa-sm"
|
||||||
style="font-size: 14px"
|
style="font-size: 14px"
|
||||||
>
|
>
|
||||||
{{ row.state }}
|
{{ row.state }}
|
||||||
</QBadge>
|
</QBadge>
|
||||||
</QTd>
|
</QTd>
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-isFragile="{ row }">
|
<template #column-isFragile="{ row }">
|
||||||
<QTd>
|
<QTd class="no-padding">
|
||||||
<QIcon
|
<QIcon v-if="row.isFragile" name="local_bar" color="primary" size="sm">
|
||||||
v-if="row.isFragile"
|
|
||||||
name="local_bar"
|
|
||||||
color="primary"
|
|
||||||
size="sm"
|
|
||||||
>
|
|
||||||
<QTooltip>{{ t('salesTicketsTable.isFragile') }}</QTooltip>
|
<QTooltip>{{ t('salesTicketsTable.isFragile') }}</QTooltip>
|
||||||
</QIcon>
|
</QIcon>
|
||||||
</QTd>
|
</QTd>
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-zone="{ row }">
|
<template #column-zone="{ row }">
|
||||||
<QTd @click.stop.prevent>
|
<QTd class="no-padding" @click.stop.prevent>
|
||||||
<span class="link">{{ row.zoneName }}</span>
|
<span class="link">{{ row.zoneName }}</span>
|
||||||
<ZoneDescriptorProxy :id="row.zoneFk" />
|
<ZoneDescriptorProxy :id="row.zoneFk" />
|
||||||
</QTd>
|
</QTd>
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-total="{ row }">
|
<template #column-total="{ row }">
|
||||||
<QTd>
|
<QTd class="no-padding">
|
||||||
<QBadge
|
<QBadge
|
||||||
:color="totalPriceColor(row) || 'transparent'"
|
:color="totalPriceColor(row) || 'transparent'"
|
||||||
:text-color="totalPriceColor(row) ? 'black' : 'white'"
|
:text-color="totalPriceColor(row) ? 'black' : 'white'"
|
||||||
dense
|
class="q-pa-sm"
|
||||||
style="font-size: 14px"
|
style="font-size: 14px"
|
||||||
>
|
>
|
||||||
{{ toCurrency(row.totalWithVat) }}
|
{{ toCurrency(row.totalWithVat) }}
|
||||||
</QBadge>
|
</QBadge>
|
||||||
</QTd>
|
</QTd>
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-rowActions="{ row }">
|
</VnTable>
|
||||||
<QTd @click.stop.prevent>
|
|
||||||
<QBtn
|
|
||||||
icon="vn:lines"
|
|
||||||
color="primary"
|
|
||||||
size="md"
|
|
||||||
class="q-mr-sm"
|
|
||||||
flat
|
|
||||||
dense
|
|
||||||
:to="{ name: 'TicketSale', params: { id: row.id } }"
|
|
||||||
>
|
|
||||||
<QTooltip>{{ t('salesTicketsTable.goToLines') }}</QTooltip>
|
|
||||||
</QBtn>
|
|
||||||
<QBtn
|
|
||||||
icon="preview"
|
|
||||||
color="primary"
|
|
||||||
size="md"
|
|
||||||
dense
|
|
||||||
flat
|
|
||||||
@click="viewSummary(row.id, TicketSummary)"
|
|
||||||
>
|
|
||||||
<QTooltip>{{ t('salesTicketsTable.preview') }}</QTooltip>
|
|
||||||
</QBtn>
|
|
||||||
</QTd>
|
|
||||||
</template>
|
|
||||||
</QTable>
|
|
||||||
</template>
|
|
||||||
</VnPaginate>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -176,8 +176,6 @@ function confirmRemove(item) {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function remove(item) {
|
async function remove(item) {
|
||||||
console.log('item: ', item);
|
|
||||||
console.log('id: ', route.params.id);
|
|
||||||
await axios.post('OrderRows/removes', {
|
await axios.post('OrderRows/removes', {
|
||||||
actualOrderId: route.params.id,
|
actualOrderId: route.params.id,
|
||||||
rows: [item.id],
|
rows: [item.id],
|
||||||
|
|
|
@ -126,7 +126,6 @@ const columns = computed(() => [
|
||||||
]);
|
]);
|
||||||
|
|
||||||
async function fetchClientAddress(id, data) {
|
async function fetchClientAddress(id, data) {
|
||||||
console.log('data: ', data);
|
|
||||||
const clientData = await axios.get(`Clients/${id}`);
|
const clientData = await axios.get(`Clients/${id}`);
|
||||||
selectedAddress.value = clientData.data.defaultAddressFk;
|
selectedAddress.value = clientData.data.defaultAddressFk;
|
||||||
data.addressId = selectedAddress.value;
|
data.addressId = selectedAddress.value;
|
||||||
|
|
|
@ -76,7 +76,6 @@ const setData = (entity) => (data.value = useCardDescription(entity.code, entity
|
||||||
:subtitle="data.subtitle"
|
:subtitle="data.subtitle"
|
||||||
data-key="routeData"
|
data-key="routeData"
|
||||||
@on-fetch="setData"
|
@on-fetch="setData"
|
||||||
:summary="$attrs"
|
|
||||||
>
|
>
|
||||||
<template #body="{ entity }">
|
<template #body="{ entity }">
|
||||||
<VnLv :label="t('Date')" :value="toDate(entity?.created)" />
|
<VnLv :label="t('Date')" :value="toDate(entity?.created)" />
|
||||||
|
|
|
@ -72,10 +72,7 @@ const columns = computed(() => [
|
||||||
label: t('globals.warehouse'),
|
label: t('globals.warehouse'),
|
||||||
component: 'select',
|
component: 'select',
|
||||||
attrs: {
|
attrs: {
|
||||||
url: 'warehouses',
|
options: warehouses.value,
|
||||||
fields: ['id', 'name'],
|
|
||||||
optionLabel: 'name',
|
|
||||||
optionValue: 'id',
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -57,9 +57,13 @@ const columns = computed(() => [
|
||||||
component: 'select',
|
component: 'select',
|
||||||
attrs: {
|
attrs: {
|
||||||
url: 'Workers/activeWithInheritedRole',
|
url: 'Workers/activeWithInheritedRole',
|
||||||
fields: ['id', 'nickname'],
|
fields: ['id', 'name'],
|
||||||
optionValue: 'id',
|
useLike: false,
|
||||||
optionLabel: 'nickname',
|
optionFilter: 'firstName',
|
||||||
|
find: {
|
||||||
|
value: 'workerFk',
|
||||||
|
label: 'workerUserName',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
useLike: false,
|
useLike: false,
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
|
@ -76,8 +80,10 @@ const columns = computed(() => [
|
||||||
attrs: {
|
attrs: {
|
||||||
url: 'agencyModes',
|
url: 'agencyModes',
|
||||||
fields: ['id', 'name'],
|
fields: ['id', 'name'],
|
||||||
optionLabel: 'name',
|
find: {
|
||||||
optionValue: 'id',
|
value: 'agencyModeFk',
|
||||||
|
label: 'agencyName',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -91,7 +97,10 @@ const columns = computed(() => [
|
||||||
url: 'vehicles',
|
url: 'vehicles',
|
||||||
fields: ['id', 'numberPlate'],
|
fields: ['id', 'numberPlate'],
|
||||||
optionLabel: 'numberPlate',
|
optionLabel: 'numberPlate',
|
||||||
optionValue: 'id',
|
find: {
|
||||||
|
value: 'vehicleFk',
|
||||||
|
label: 'vehiclePlateNumber',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -248,6 +257,7 @@ const openTicketsDialog = (id) => {
|
||||||
:is-editable="true"
|
:is-editable="true"
|
||||||
:filter="routeFilter"
|
:filter="routeFilter"
|
||||||
redirect="route"
|
redirect="route"
|
||||||
|
:row-click="false"
|
||||||
:create="{
|
:create="{
|
||||||
urlCreate: 'Routes',
|
urlCreate: 'Routes',
|
||||||
title: t('Create route'),
|
title: t('Create route'),
|
||||||
|
|
|
@ -51,7 +51,6 @@ const setData = (entity) => (data.value = useCardDescription(entity.code, entity
|
||||||
:subtitle="data.subtitle"
|
:subtitle="data.subtitle"
|
||||||
data-key="Shelvings"
|
data-key="Shelvings"
|
||||||
@on-fetch="setData"
|
@on-fetch="setData"
|
||||||
:summary="$attrs"
|
|
||||||
>
|
>
|
||||||
<template #body="{ entity }">
|
<template #body="{ entity }">
|
||||||
<VnLv :label="t('shelving.summary.code')" :value="entity.code" />
|
<VnLv :label="t('shelving.summary.code')" :value="entity.code" />
|
||||||
|
|
|
@ -11,18 +11,14 @@ const { t } = useI18n();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
|
||||||
const routeName = computed(() => route.name);
|
const routeName = computed(() => route.name);
|
||||||
const searchBarDataKeys = {
|
|
||||||
TicketSummary: 'TicketSummary',
|
|
||||||
TicketSale: 'TicketSale',
|
|
||||||
TicketPurchaseRequest: 'TicketPurchaseRequest',
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<VnCard
|
<VnCard
|
||||||
data-key="Ticket"
|
data-key="Ticket"
|
||||||
|
base-url="Tickets"
|
||||||
:filter-panel="TicketFilter"
|
:filter-panel="TicketFilter"
|
||||||
:descriptor="TicketDescriptor"
|
:descriptor="TicketDescriptor"
|
||||||
:search-data-key="searchBarDataKeys[routeName]"
|
search-data-key="TicketList"
|
||||||
:search-custom-route-redirect="routeName"
|
:search-custom-route-redirect="routeName"
|
||||||
:searchbar-label="t('card.search')"
|
:searchbar-label="t('card.search')"
|
||||||
:searchbar-info="t('card.searchInfo')"
|
:searchbar-info="t('card.searchInfo')"
|
||||||
|
|
|
@ -626,7 +626,7 @@ onMounted(async () => {
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-ticketId="{ row }">
|
<template #body-cell-ticketId="{ row }">
|
||||||
<QTd>
|
<QTd>
|
||||||
<QBtn flat color="primary">
|
<QBtn flat class="link">
|
||||||
{{ row.id }}
|
{{ row.id }}
|
||||||
<TicketDescriptorProxy :id="row.id" />
|
<TicketDescriptorProxy :id="row.id" />
|
||||||
</QBtn>
|
</QBtn>
|
||||||
|
@ -658,7 +658,7 @@ onMounted(async () => {
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-futureId="{ row }">
|
<template #body-cell-futureId="{ row }">
|
||||||
<QTd class="vertical-separator">
|
<QTd class="vertical-separator">
|
||||||
<QBtn flat color="primary" dense>
|
<QBtn flat class="link" dense>
|
||||||
{{ row.futureId }}
|
{{ row.futureId }}
|
||||||
<TicketDescriptorProxy :id="row.futureId" />
|
<TicketDescriptorProxy :id="row.futureId" />
|
||||||
</QBtn>
|
</QBtn>
|
||||||
|
|
|
@ -15,11 +15,11 @@ const props = defineProps({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const workers = ref();
|
const workers = ref([]);
|
||||||
const provinces = ref();
|
const provinces = ref([]);
|
||||||
const states = ref();
|
const states = ref([]);
|
||||||
const agencies = ref();
|
const agencies = ref([]);
|
||||||
const warehouses = ref();
|
const warehouses = ref([]);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -33,7 +33,7 @@ const warehouses = ref();
|
||||||
@on-fetch="(data) => (workers = data)"
|
@on-fetch="(data) => (workers = data)"
|
||||||
auto-load
|
auto-load
|
||||||
/>
|
/>
|
||||||
<VnFilterPanel :data-key="props.dataKey" :search-button="true">
|
<VnFilterPanel :data-key="props.dataKey" :search-button="true" search-url="table">
|
||||||
<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>
|
||||||
|
|
|
@ -442,7 +442,7 @@ onMounted(async () => {
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-ticketId="{ row }">
|
<template #body-cell-ticketId="{ row }">
|
||||||
<QTd>
|
<QTd>
|
||||||
<QBtn flat color="primary">
|
<QBtn flat class="link">
|
||||||
{{ row.id }}
|
{{ row.id }}
|
||||||
<TicketDescriptorProxy :id="row.id" />
|
<TicketDescriptorProxy :id="row.id" />
|
||||||
</QBtn>
|
</QBtn>
|
||||||
|
@ -489,7 +489,7 @@ onMounted(async () => {
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-futureId="{ row }">
|
<template #body-cell-futureId="{ row }">
|
||||||
<QTd class="vertical-separator">
|
<QTd class="vertical-separator">
|
||||||
<QBtn flat color="primary" dense>
|
<QBtn flat class="link" dense>
|
||||||
{{ row.futureId }}
|
{{ row.futureId }}
|
||||||
<TicketDescriptorProxy :id="row.futureId" />
|
<TicketDescriptorProxy :id="row.futureId" />
|
||||||
</QBtn>
|
</QBtn>
|
||||||
|
|
|
@ -1,118 +1,311 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onMounted, onUnmounted } from 'vue';
|
import axios from 'axios';
|
||||||
|
import { computed, ref } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useRouter } from 'vue-router';
|
|
||||||
import { useStateStore } from 'stores/useStateStore';
|
|
||||||
import { toDate, toCurrency } from 'src/filters/index';
|
import { toDate, toCurrency } from 'src/filters/index';
|
||||||
import VnPaginate from 'src/components/ui/VnPaginate.vue';
|
|
||||||
import TicketSummary from './Card/TicketSummary.vue';
|
import TicketSummary from './Card/TicketSummary.vue';
|
||||||
import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
|
import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
|
||||||
import TicketFilter from './TicketFilter.vue';
|
|
||||||
import VnLv from 'src/components/ui/VnLv.vue';
|
|
||||||
import CardList from 'src/components/ui/CardList.vue';
|
|
||||||
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
||||||
import RightMenu from 'src/components/common/RightMenu.vue';
|
import VnTable from 'src/components/VnTable/VnTable.vue';
|
||||||
|
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
|
import VnInputDate from 'src/components/common/VnInputDate.vue';
|
||||||
|
import VnRow from 'src/components/ui/VnRow.vue';
|
||||||
|
|
||||||
const router = useRouter();
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const stateStore = useStateStore();
|
|
||||||
const { viewSummary } = useSummaryDialog();
|
const { viewSummary } = useSummaryDialog();
|
||||||
|
const tableRef = ref();
|
||||||
|
const clientsOptions = ref([]);
|
||||||
|
const addressesOptions = ref([]);
|
||||||
|
const agenciesOptions = ref([]);
|
||||||
|
const selectedClient = ref();
|
||||||
|
|
||||||
onMounted(() => (stateStore.rightDrawer = true));
|
const columns = computed(() => [
|
||||||
onUnmounted(() => (stateStore.rightDrawer = false));
|
{
|
||||||
|
align: 'left',
|
||||||
|
name: 'stateFk',
|
||||||
|
label: t('ticketList.state'),
|
||||||
|
columnFilter: {
|
||||||
|
name: 'stateFk',
|
||||||
|
component: 'select',
|
||||||
|
attrs: {
|
||||||
|
url: 'States',
|
||||||
|
fields: ['id', 'name'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
name: 'id',
|
||||||
|
label: t('ticketList.id'),
|
||||||
|
chip: {
|
||||||
|
condition: () => true,
|
||||||
|
},
|
||||||
|
isId: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
name: 'nickname',
|
||||||
|
label: t('ticketList.nickname'),
|
||||||
|
isTitle: true,
|
||||||
|
},
|
||||||
|
|
||||||
const from = Date.vnNew();
|
{
|
||||||
const to = Date.vnNew();
|
align: 'left',
|
||||||
to.setDate(to.getDate() + 1);
|
name: 'shipped',
|
||||||
|
cardVisible: true,
|
||||||
|
label: t('ticketList.shipped'),
|
||||||
|
columnFilter: {
|
||||||
|
component: 'date',
|
||||||
|
alias: 't',
|
||||||
|
inWhere: true,
|
||||||
|
},
|
||||||
|
format: ({ shipped }) => toDate(shipped),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
name: 'zoneFk',
|
||||||
|
label: t('ticketList.zone'),
|
||||||
|
columnFilter: {
|
||||||
|
component: 'select',
|
||||||
|
attrs: {
|
||||||
|
url: 'Zones',
|
||||||
|
fields: ['id', 'name'],
|
||||||
|
},
|
||||||
|
alias: 't',
|
||||||
|
inWhere: true,
|
||||||
|
},
|
||||||
|
format: (row, dashIfEmpty) => dashIfEmpty(row.zoneName),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
label: t('ticketList.salesPerson'),
|
||||||
|
name: 'salesPersonFk',
|
||||||
|
component: 'select',
|
||||||
|
attrs: {
|
||||||
|
url: 'Workers/activeWithInheritedRole',
|
||||||
|
fields: ['id', 'name'],
|
||||||
|
where: { role: 'salesPerson' },
|
||||||
|
optionFilter: 'firstName',
|
||||||
|
useLike: false,
|
||||||
|
},
|
||||||
|
columnField: {
|
||||||
|
component: null,
|
||||||
|
},
|
||||||
|
format: (row, dashIfEmpty) => dashIfEmpty(row.salesPerson),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
name: 'totalWithVat',
|
||||||
|
label: t('ticketList.totalWithVat'),
|
||||||
|
cardVisible: true,
|
||||||
|
columnFilter: {
|
||||||
|
component: 'number',
|
||||||
|
inWhere: true,
|
||||||
|
},
|
||||||
|
format: (row) => toCurrency(row.totalWithVat),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'right',
|
||||||
|
name: 'tableActions',
|
||||||
|
actions: [
|
||||||
|
{
|
||||||
|
title: t('ticketList.summary'),
|
||||||
|
icon: 'preview',
|
||||||
|
action: (row) => viewSummary(row.id, TicketSummary),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
|
||||||
const userParams = {
|
const onClientSelected = async (formData) => {
|
||||||
from: from.toISOString(),
|
await fetchClient(formData);
|
||||||
to: to.toISOString(),
|
await fetchAddresses(formData);
|
||||||
};
|
};
|
||||||
|
|
||||||
function navigate(id) {
|
const fetchAvailableAgencies = async (formData) => {
|
||||||
router.push({ path: `/ticket/${id}` });
|
if (!formData.warehouseId || !formData.addressId || !formData.landed) return;
|
||||||
}
|
let params = {
|
||||||
|
warehouseFk: formData.warehouseId,
|
||||||
|
addressFk: formData.addressId,
|
||||||
|
landed: formData.landed,
|
||||||
|
};
|
||||||
|
|
||||||
|
const { data } = await axios.get('Agencies/getAgenciesWithWarehouse', { params });
|
||||||
|
|
||||||
|
agenciesOptions.value = data;
|
||||||
|
|
||||||
|
const defaultAgency = agenciesOptions.value.find(
|
||||||
|
(agency) =>
|
||||||
|
agency.agencyModeFk === selectedClient.value.defaultAddress.agencyModeFk
|
||||||
|
);
|
||||||
|
|
||||||
|
if (defaultAgency) formData.agencyModeId = defaultAgency.agencyModeFk;
|
||||||
|
};
|
||||||
|
|
||||||
|
const fetchClient = async (formData) => {
|
||||||
|
try {
|
||||||
|
const filter = {
|
||||||
|
include: {
|
||||||
|
relation: 'defaultAddress',
|
||||||
|
scope: {
|
||||||
|
fields: ['id', 'agencyModeFk'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
where: { id: formData.clientId },
|
||||||
|
};
|
||||||
|
const params = { filter: JSON.stringify(filter) };
|
||||||
|
const { data } = await axios.get('Clients', { params });
|
||||||
|
const [client] = data;
|
||||||
|
selectedClient.value = client;
|
||||||
|
} catch (err) {
|
||||||
|
console.error('Error fetching client');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const fetchAddresses = async (formData) => {
|
||||||
|
try {
|
||||||
|
if (!formData.clientId) return;
|
||||||
|
|
||||||
|
const filter = {
|
||||||
|
fields: ['nickname', 'street', 'city', 'id'],
|
||||||
|
where: { isActive: true },
|
||||||
|
order: 'nickname ASC',
|
||||||
|
};
|
||||||
|
const params = { filter: JSON.stringify(filter) };
|
||||||
|
const { data } = await axios.get(`Clients/${formData.clientId}/addresses`, {
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
addressesOptions.value = data;
|
||||||
|
|
||||||
|
const { defaultAddress } = selectedClient.value;
|
||||||
|
formData.addressId = defaultAddress.id;
|
||||||
|
} catch (err) {
|
||||||
|
console.error(`Error fetching addresses`, err);
|
||||||
|
return err.response;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const getColor = (row) => {
|
||||||
|
return row?.classColor ? `bg-${row.classColor}` : 'bg-orange';
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<VnSearchbar
|
<VnSearchbar
|
||||||
data-key="TicketList"
|
data-key="Tickets"
|
||||||
:label="t('Search ticket')"
|
:label="t('Search ticket')"
|
||||||
:info="t('You can search by ticket id or alias')"
|
:info="t('You can search by ticket id or alias')"
|
||||||
/>
|
/>
|
||||||
<RightMenu>
|
<VnTable
|
||||||
<template #right-panel>
|
ref="tableRef"
|
||||||
<TicketFilter data-key="TicketList" />
|
data-key="Tickets"
|
||||||
</template>
|
|
||||||
</RightMenu>
|
|
||||||
<QPage class="column items-center q-pa-md">
|
|
||||||
<div class="vn-card-list">
|
|
||||||
<VnPaginate
|
|
||||||
data-key="TicketList"
|
|
||||||
url="Tickets/filter"
|
url="Tickets/filter"
|
||||||
:user-params="userParams"
|
:create="{
|
||||||
order="id DESC"
|
urlCreate: 'Tickets/new',
|
||||||
|
title: t('ticketList.createTicket'),
|
||||||
|
onDataSaved: ({ id }) => tableRef.redirect(id),
|
||||||
|
formInitialData: {},
|
||||||
|
}"
|
||||||
|
default-mode="table"
|
||||||
|
:columns="columns"
|
||||||
|
redirect="ticket"
|
||||||
auto-load
|
auto-load
|
||||||
>
|
>
|
||||||
<template #body="{ rows }">
|
<template #more-create-dialog="{ data }">
|
||||||
<CardList
|
<VnRow>
|
||||||
v-for="row of rows"
|
<VnSelect
|
||||||
:key="row.id"
|
url="Clients"
|
||||||
:id="row.id"
|
:label="t('ticketList.client')"
|
||||||
:title="`${row.nickname}`"
|
v-model="data.clientId"
|
||||||
@click="navigate(row.id)"
|
:options="clientsOptions"
|
||||||
|
option-value="id"
|
||||||
|
option-label="name"
|
||||||
|
hide-selected
|
||||||
|
@update:model-value="(client) => onClientSelected(data)"
|
||||||
>
|
>
|
||||||
<template #list-items>
|
<template #option="scope">
|
||||||
<VnLv
|
<QItem v-bind="scope.itemProps">
|
||||||
:label="t('ticket.list.nickname')"
|
<QItemSection>
|
||||||
:value="row.nickname"
|
<QItemLabel>
|
||||||
/>
|
{{ scope.opt.name }}
|
||||||
<VnLv :label="t('ticket.list.state')">
|
</QItemLabel>
|
||||||
<template #value>
|
<QItemLabel caption>
|
||||||
<QBadge
|
{{ `#${scope.opt.id}` }}
|
||||||
text-color="black"
|
</QItemLabel>
|
||||||
:color="row.classColor ?? 'orange'"
|
</QItemSection>
|
||||||
class="q-ma-none"
|
</QItem>
|
||||||
dense
|
</template>
|
||||||
|
</VnSelect>
|
||||||
|
</VnRow>
|
||||||
|
<VnRow>
|
||||||
|
<VnSelect
|
||||||
|
url="Addresses"
|
||||||
|
:label="t('ticket.create.address')"
|
||||||
|
v-model="data.addressId"
|
||||||
|
:options="addressesOptions"
|
||||||
|
option-value="id"
|
||||||
|
option-label="nickname"
|
||||||
|
hide-selected
|
||||||
|
:disable="!data.clientId"
|
||||||
|
@update:model-value="() => fetchAvailableAgencies(data)"
|
||||||
>
|
>
|
||||||
{{ row.state }}
|
<template #option="scope">
|
||||||
</QBadge>
|
<QItem v-bind="scope.itemProps">
|
||||||
|
<QItemSection>
|
||||||
|
<QItemLabel>
|
||||||
|
{{ scope.opt.nickname }}
|
||||||
|
</QItemLabel>
|
||||||
|
<QItemLabel caption>
|
||||||
|
{{ `${scope.opt.street}, ${scope.opt.city}` }}
|
||||||
|
</QItemLabel>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
</template>
|
</template>
|
||||||
</VnLv>
|
</VnSelect>
|
||||||
<VnLv
|
</VnRow>
|
||||||
:label="t('ticket.list.shipped')"
|
<VnRow class="row q-gutter-md q-mb-md">
|
||||||
:value="toDate(row.shipped)"
|
<div class="col">
|
||||||
|
<VnInputDate
|
||||||
|
placeholder="dd-mm-aaa"
|
||||||
|
:label="t('ticket.create.landed')"
|
||||||
|
v-model="data.landed"
|
||||||
|
@update:model-value="() => fetchAvailableAgencies(data)"
|
||||||
/>
|
/>
|
||||||
<VnLv :label="t('Zone')" :value="row.zoneName" />
|
|
||||||
<VnLv
|
|
||||||
:label="t('ticket.list.salesPerson')"
|
|
||||||
:value="row.salesPerson"
|
|
||||||
/>
|
|
||||||
<VnLv
|
|
||||||
:label="t('ticket.list.total')"
|
|
||||||
:value="toCurrency(row.totalWithVat)"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
<template #actions>
|
|
||||||
<QBtn
|
|
||||||
:label="t('components.smartCard.openSummary')"
|
|
||||||
@click.stop="viewSummary(row.id, TicketSummary)"
|
|
||||||
color="primary"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
</CardList>
|
|
||||||
</template>
|
|
||||||
</VnPaginate>
|
|
||||||
</div>
|
</div>
|
||||||
<QPageSticky :offset="[20, 20]">
|
</VnRow>
|
||||||
<QBtn :to="{ name: 'TicketCreate' }" fab icon="add" color="primary">
|
<VnRow class="row q-gutter-md q-mb-md">
|
||||||
<QTooltip>
|
<div class="col">
|
||||||
{{ t('New ticket') }}
|
<VnSelect
|
||||||
</QTooltip>
|
url="Warehouses"
|
||||||
</QBtn>
|
:label="t('ticket.create.warehouse')"
|
||||||
</QPageSticky>
|
v-model="data.warehouseId"
|
||||||
</QPage>
|
:options="warehousesOptions"
|
||||||
|
option-value="id"
|
||||||
|
option-label="name"
|
||||||
|
hide-selected
|
||||||
|
@update:model-value="() => fetchAvailableAgencies(data)"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</VnRow>
|
||||||
|
<VnRow class="row q-gutter-md q-mb-md">
|
||||||
|
<div class="col">
|
||||||
|
<VnSelect
|
||||||
|
:label="t('ticket.create.agency')"
|
||||||
|
v-model="data.agencyModeId"
|
||||||
|
:options="agenciesOptions"
|
||||||
|
option-value="agencyModeFk"
|
||||||
|
option-label="agencyMode"
|
||||||
|
hide-selected
|
||||||
|
:disable="!data.clientId || !data.landed || !data.warehouseId"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</VnRow>
|
||||||
|
</template>
|
||||||
|
<template #column-stateFk="{ row }">
|
||||||
|
<QChip :class="getColor(row)" dense square>
|
||||||
|
{{ row.state }}
|
||||||
|
</QChip>
|
||||||
|
</template>
|
||||||
|
</VnTable>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<i18n>
|
<i18n>
|
||||||
|
|
|
@ -1,40 +1,28 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onMounted, ref, computed, reactive, onUnmounted } from 'vue';
|
import { onMounted, ref, computed, onUnmounted } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useRouter } from 'vue-router';
|
|
||||||
|
|
||||||
import FetchData from 'components/FetchData.vue';
|
|
||||||
import TableVisibleColumns from 'src/components/common/TableVisibleColumns.vue';
|
|
||||||
import VnInput from 'src/components/common/VnInput.vue';
|
|
||||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
|
import VnSelectCache from 'src/components/common/VnSelectCache.vue';
|
||||||
import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorProxy.vue';
|
import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorProxy.vue';
|
||||||
import TicketDescriptorProxy from 'src/pages/Ticket/Card/TicketDescriptorProxy.vue';
|
import TicketDescriptorProxy from 'src/pages/Ticket/Card/TicketDescriptorProxy.vue';
|
||||||
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
|
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
|
||||||
import VnPaginate from 'components/ui/VnPaginate.vue';
|
|
||||||
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
|
|
||||||
import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
|
import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
|
||||||
|
|
||||||
import { useStateStore } from 'stores/useStateStore';
|
import { useStateStore } from 'stores/useStateStore';
|
||||||
import { dashIfEmpty } from 'src/filters';
|
|
||||||
import { useVnConfirm } from 'composables/useVnConfirm';
|
import { useVnConfirm } from 'composables/useVnConfirm';
|
||||||
import { useArrayData } from 'composables/useArrayData';
|
import { useArrayData } from 'composables/useArrayData';
|
||||||
import useNotify from 'src/composables/useNotify.js';
|
import useNotify from 'src/composables/useNotify.js';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
import VnTable from 'src/components/VnTable/VnTable.vue';
|
||||||
|
|
||||||
const router = useRouter();
|
|
||||||
const stateStore = useStateStore();
|
const stateStore = useStateStore();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const { openConfirmationModal } = useVnConfirm();
|
|
||||||
const { notify } = useNotify();
|
const { notify } = useNotify();
|
||||||
|
const { openConfirmationModal } = useVnConfirm();
|
||||||
const paginateRef = ref(null);
|
|
||||||
const agencyModesOptions = ref([]);
|
|
||||||
const visibleColumns = ref([]);
|
|
||||||
const allColumnNames = ref([]);
|
const allColumnNames = ref([]);
|
||||||
|
|
||||||
const arrayData = useArrayData('WeeklyTickets');
|
const arrayData = useArrayData('WeeklyTickets');
|
||||||
const { store } = arrayData;
|
const { store } = arrayData;
|
||||||
|
const tableRef = ref();
|
||||||
const weekdays = [
|
const weekdays = [
|
||||||
{ id: 0, name: t('weekdays.mon') },
|
{ id: 0, name: t('weekdays.mon') },
|
||||||
{ id: 1, name: t('weekdays.tue') },
|
{ id: 1, name: t('weekdays.tue') },
|
||||||
|
@ -45,113 +33,132 @@ const weekdays = [
|
||||||
{ id: 6, name: t('weekdays.sun') },
|
{ id: 6, name: t('weekdays.sun') },
|
||||||
];
|
];
|
||||||
|
|
||||||
const exprBuilder = (param, value) => {
|
|
||||||
switch (param) {
|
|
||||||
case 'clientName':
|
|
||||||
return { 'c.name': value };
|
|
||||||
case 'nickName':
|
|
||||||
return { 'u.name': value };
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const params = reactive({});
|
|
||||||
|
|
||||||
const applyColumnFilter = async (col) => {
|
|
||||||
try {
|
|
||||||
const paramKey = col.columnFilter?.filterParamKey || col.field;
|
|
||||||
params[paramKey] = col.columnFilter.filterValue;
|
|
||||||
await paginateRef.value.addFilter(null, params);
|
|
||||||
} catch (err) {
|
|
||||||
console.error('Error applying column filter', err);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const getInputEvents = (col) => ({ 'keyup.enter': () => applyColumnFilter(col) });
|
|
||||||
|
|
||||||
const columns = computed(() => [
|
const columns = computed(() => [
|
||||||
{
|
{
|
||||||
|
align: 'left',
|
||||||
|
name: 'ticketFk',
|
||||||
label: t('weeklyTickets.id'),
|
label: t('weeklyTickets.id'),
|
||||||
name: 'id',
|
chip: {
|
||||||
field: 'ticketFk',
|
condition: () => true,
|
||||||
align: 'left',
|
},
|
||||||
sortable: true,
|
isId: true,
|
||||||
columnFilter: null,
|
cardVisible: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
align: 'left',
|
||||||
|
name: 'clientFk',
|
||||||
label: t('weeklyTickets.client'),
|
label: t('weeklyTickets.client'),
|
||||||
name: 'client',
|
isTitle: true,
|
||||||
field: 'clientName',
|
cardVisible: true,
|
||||||
align: 'left',
|
component: 'select',
|
||||||
sortable: true,
|
|
||||||
columnFilter: {
|
|
||||||
component: VnInput,
|
|
||||||
type: 'text',
|
|
||||||
filterValue: null,
|
|
||||||
event: getInputEvents,
|
|
||||||
attrs: {
|
attrs: {
|
||||||
dense: true,
|
url: 'Clients',
|
||||||
|
optionLabel: 'name',
|
||||||
|
optionValue: 'id',
|
||||||
|
isWhere: true,
|
||||||
},
|
},
|
||||||
|
columnField: {
|
||||||
|
component: null,
|
||||||
},
|
},
|
||||||
format: (val) => dashIfEmpty(val),
|
format: (row) => row.clientName,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
align: 'left',
|
||||||
|
name: 'weekDay',
|
||||||
label: t('weeklyTickets.shipment'),
|
label: t('weeklyTickets.shipment'),
|
||||||
name: 'shipment',
|
cardVisible: true,
|
||||||
field: 'weekDay',
|
|
||||||
align: 'left',
|
|
||||||
sortable: true,
|
|
||||||
columnFilter: null,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: t('weeklyTickets.agency'),
|
|
||||||
name: 'agency',
|
|
||||||
field: 'agencyModeFk',
|
|
||||||
align: 'left',
|
|
||||||
sortable: true,
|
|
||||||
columnFilter: null,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: t('weeklyTickets.warehouse'),
|
|
||||||
name: 'warehouse',
|
|
||||||
field: 'warehouseName',
|
|
||||||
align: 'left',
|
|
||||||
sortable: true,
|
|
||||||
columnFilter: null,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: t('weeklyTickets.salesperson'),
|
|
||||||
field: 'salesperson',
|
|
||||||
name: 'salesperson',
|
|
||||||
align: 'left',
|
|
||||||
sortable: true,
|
|
||||||
columnFilter: {
|
columnFilter: {
|
||||||
component: VnInput,
|
component: 'select',
|
||||||
type: 'text',
|
|
||||||
filterValue: null,
|
|
||||||
event: getInputEvents,
|
|
||||||
filterParamKey: 'nickName',
|
|
||||||
attrs: {
|
attrs: {
|
||||||
dense: true,
|
options: weekdays,
|
||||||
|
optionLabel: weekdays.name,
|
||||||
|
optionValue: weekdays.id,
|
||||||
},
|
},
|
||||||
|
inWhere: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '',
|
|
||||||
name: 'actions',
|
|
||||||
align: 'left',
|
align: 'left',
|
||||||
columnFilter: null,
|
label: t('weeklyTickets.agency'),
|
||||||
|
name: 'agencyModeFk',
|
||||||
|
cardVisible: true,
|
||||||
|
columnFilter: {
|
||||||
|
component: 'select',
|
||||||
|
alias: 'tw',
|
||||||
|
attrs: {
|
||||||
|
url: 'AgencyModes',
|
||||||
|
fields: ['id', 'name'],
|
||||||
|
},
|
||||||
|
inWhere: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
name: 'warehouseFk',
|
||||||
|
label: t('weeklyTickets.warehouse'),
|
||||||
|
cardVisible: true,
|
||||||
|
columnFilter: {
|
||||||
|
component: 'select',
|
||||||
|
attrs: {
|
||||||
|
url: 'Warehouses',
|
||||||
|
fields: ['id', 'name'],
|
||||||
|
},
|
||||||
|
inWhere: true,
|
||||||
|
},
|
||||||
|
columnField: {
|
||||||
|
component: null,
|
||||||
|
},
|
||||||
|
format: (row, dashIfEmpty) => dashIfEmpty(row.warehouseName),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
name: 'id',
|
||||||
|
label: t('weeklyTickets.salesperson'),
|
||||||
|
columnFilter: {
|
||||||
|
component: 'select',
|
||||||
|
alias: 'u',
|
||||||
|
attrs: {
|
||||||
|
url: 'Workers/activeWithInheritedRole',
|
||||||
|
fields: ['id', 'name'],
|
||||||
|
where: { role: 'salesperson' },
|
||||||
|
},
|
||||||
|
inWhere: true,
|
||||||
|
},
|
||||||
|
columnField: {
|
||||||
|
component: null,
|
||||||
|
},
|
||||||
|
cardVisible: true,
|
||||||
|
format: (row) => row.userName,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'right',
|
||||||
|
label: '',
|
||||||
|
name: 'tableActions',
|
||||||
|
actions: [
|
||||||
|
{
|
||||||
|
title: t('ticketWeekly.delete'),
|
||||||
|
icon: 'delete',
|
||||||
|
action: (row) =>
|
||||||
|
openConfirmationModal(
|
||||||
|
t('You are going to delete this weekly ticket'),
|
||||||
|
t(
|
||||||
|
'This ticket will be removed from weekly tickets! Continue anyway?'
|
||||||
|
),
|
||||||
|
() => deleteWeekly(row.ticketFk)
|
||||||
|
),
|
||||||
|
isPrimary: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const redirectToTicketSummary = (ticketFk) =>
|
|
||||||
router.push({ name: 'TicketSummary', params: { id: ticketFk } });
|
|
||||||
|
|
||||||
const deleteWeekly = async (ticketFk) => {
|
const deleteWeekly = async (ticketFk) => {
|
||||||
try {
|
try {
|
||||||
await axios.delete(`TicketWeeklies/${ticketFk}`);
|
await axios.delete(`TicketWeeklies/${ticketFk}`);
|
||||||
notify(t('globals.dataSaved'), 'positive');
|
notify(t('globals.dataSaved'), 'positive');
|
||||||
const ticketIndex = store.data.findIndex((e) => e.ticketFk == ticketFk);
|
const ticketIndex = store.data.findIndex((e) => e.ticketFk == ticketFk);
|
||||||
store.data.splice(ticketIndex, 1);
|
store.data.splice(ticketIndex, 1);
|
||||||
|
location.reload();
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('Error deleting weekly', err);
|
console.error('Error deleting weekly', err);
|
||||||
}
|
}
|
||||||
|
@ -176,147 +183,61 @@ onUnmounted(() => (stateStore.rightDrawer = false));
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<FetchData
|
|
||||||
url="AgencyModes/isActive"
|
|
||||||
:filter="{ fields: ['id', 'name'], order: 'name' }"
|
|
||||||
auto-load
|
|
||||||
@on-fetch="(data) => (agencyModesOptions = data)"
|
|
||||||
/>
|
|
||||||
<VnSearchbar
|
<VnSearchbar
|
||||||
data-key="WeeklyTickets"
|
data-key="WeeklyTickets"
|
||||||
:label="t('weeklyTickets.search')"
|
:label="t('weeklyTickets.search')"
|
||||||
:info="t('weeklyTickets.searchInfo')"
|
:info="t('weeklyTickets.searchInfo')"
|
||||||
/>
|
/>
|
||||||
<VnSubToolbar>
|
<VnTable
|
||||||
<template #st-data>
|
ref="tableRef"
|
||||||
<TableVisibleColumns
|
|
||||||
:all-columns="allColumnNames"
|
|
||||||
table-code="itemsIndex"
|
|
||||||
labels-traductions-path="weeklyTickets"
|
|
||||||
@on-config-saved="visibleColumns = [...$event, 'actions']"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
</VnSubToolbar>
|
|
||||||
<QPage class="column items-center q-pa-md">
|
|
||||||
<VnPaginate
|
|
||||||
ref="paginateRef"
|
|
||||||
data-key="WeeklyTickets"
|
data-key="WeeklyTickets"
|
||||||
url="TicketWeeklies/filter"
|
url="TicketWeeklies/filter"
|
||||||
:order="['weekDay', 'ticketFk']"
|
:columns="columns"
|
||||||
:limit="20"
|
default-mode="table"
|
||||||
:expr-builder="exprBuilder"
|
:use-model="true"
|
||||||
:user-params="params"
|
:disable-option="{ card: true }"
|
||||||
:offset="50"
|
|
||||||
auto-load
|
auto-load
|
||||||
>
|
>
|
||||||
<template #body="{ rows }">
|
<template #column-ticketFk="{ row }">
|
||||||
<QTable
|
<span class="link" @click.stop>
|
||||||
:rows="rows"
|
|
||||||
:columns="columns"
|
|
||||||
row-key="id"
|
|
||||||
:pagination="{ rowsPerPage: 0 }"
|
|
||||||
class="full-width q-mt-md"
|
|
||||||
:visible-columns="visibleColumns"
|
|
||||||
:no-data-label="t('globals.noResults')"
|
|
||||||
@row-click="(_, row) => redirectToTicketSummary(row.ticketFk)"
|
|
||||||
>
|
|
||||||
<template #top-row="{ cols }">
|
|
||||||
<QTr>
|
|
||||||
<QTd
|
|
||||||
v-for="(col, index) in cols"
|
|
||||||
:key="index"
|
|
||||||
style="max-width: 100px"
|
|
||||||
>
|
|
||||||
<component
|
|
||||||
:is="col.columnFilter.component"
|
|
||||||
v-if="col.columnFilter"
|
|
||||||
v-model="col.columnFilter.filterValue"
|
|
||||||
v-bind="col.columnFilter.attrs"
|
|
||||||
v-on="col.columnFilter.event(col)"
|
|
||||||
dense
|
|
||||||
/>
|
|
||||||
</QTd>
|
|
||||||
</QTr>
|
|
||||||
</template>
|
|
||||||
<template #body-cell-id="{ row }">
|
|
||||||
<QTd @click.stop>
|
|
||||||
<QBtn flat color="primary">
|
|
||||||
{{ row.ticketFk }}
|
{{ row.ticketFk }}
|
||||||
<TicketDescriptorProxy :id="row.ticketFk" />
|
<TicketDescriptorProxy :id="row.ticketFk" />
|
||||||
</QBtn>
|
</span>
|
||||||
</QTd>
|
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-salesperson="{ row }">
|
<template #column-weekDay="{ row }">
|
||||||
<QTd @click.stop>
|
|
||||||
<QBtn flat color="primary">
|
|
||||||
{{ row.userName }}
|
|
||||||
<WorkerDescriptorProxy :id="row.workerFk" />
|
|
||||||
</QBtn>
|
|
||||||
</QTd>
|
|
||||||
</template>
|
|
||||||
<template #body-cell-client="{ row }">
|
|
||||||
<QTd @click.stop>
|
|
||||||
<QBtn flat color="primary" dense>
|
|
||||||
{{ row.clientName }}
|
|
||||||
<CustomerDescriptorProxy :id="row.clientFk" />
|
|
||||||
</QBtn>
|
|
||||||
</QTd>
|
|
||||||
</template>
|
|
||||||
<template #body-cell-shipment="{ row }">
|
|
||||||
<QTd @click.stop>
|
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:options="weekdays"
|
:options="weekdays"
|
||||||
hide-selected
|
hide-selected
|
||||||
option-label="name"
|
option-label="name"
|
||||||
option-value="id"
|
option-value="id"
|
||||||
v-model="row.weekDay"
|
v-model="row.weekDay"
|
||||||
@update:model-value="
|
@update:model-value="onUpdate(row.ticketFk, 'weekDay', $event)"
|
||||||
onUpdate(row.ticketFk, 'weekDay', $event)
|
|
||||||
"
|
|
||||||
/>
|
/>
|
||||||
</QTd>
|
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-agency="{ row }">
|
<template #column-agencyModeFk="{ row }">
|
||||||
<QTd @click.stop>
|
<VnSelectCache
|
||||||
<VnSelect
|
url="AgencyModes/isActive"
|
||||||
:options="agencyModesOptions"
|
:row="row"
|
||||||
hide-selected
|
:find="['agencyModeFk', 'agencyModeName']"
|
||||||
option-label="name"
|
|
||||||
option-value="id"
|
|
||||||
v-model="row.agencyModeFk"
|
v-model="row.agencyModeFk"
|
||||||
@update:model-value="
|
@update:model-value="onUpdate(row.ticketFk, 'agencyModeFk', $event)"
|
||||||
onUpdate(row.ticketFk, 'agencyModeFk', $event)
|
|
||||||
"
|
|
||||||
/>
|
|
||||||
</QTd>
|
|
||||||
</template>
|
|
||||||
<template #body-cell-actions="{ row }">
|
|
||||||
<QTd>
|
|
||||||
<QIcon
|
|
||||||
@click.stop="
|
|
||||||
openConfirmationModal(
|
|
||||||
t('You are going to delete this weekly ticket'),
|
|
||||||
t(
|
|
||||||
'This ticket will be removed from weekly tickets! Continue anyway?'
|
|
||||||
),
|
|
||||||
() => deleteWeekly(row.ticketFk)
|
|
||||||
)
|
|
||||||
"
|
|
||||||
class="q-ml-sm cursor-pointer"
|
|
||||||
color="primary"
|
|
||||||
name="delete"
|
|
||||||
size="sm"
|
|
||||||
>
|
>
|
||||||
<QTooltip>
|
{{ console.log('row: ', row) }}
|
||||||
{{ t('globals.delete') }}
|
</VnSelectCache>
|
||||||
</QTooltip>
|
|
||||||
</QIcon>
|
|
||||||
</QTd>
|
|
||||||
</template>
|
</template>
|
||||||
</QTable>
|
<template #column-clientFk="{ row }">
|
||||||
|
<span class="link" @click.stop>
|
||||||
|
{{ row.clientName }}
|
||||||
|
<CustomerDescriptorProxy :id="row.clientFk" />
|
||||||
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</VnPaginate>
|
<template #column-id="{ row }">
|
||||||
</QPage>
|
<span class="link" @click.stop>
|
||||||
|
{{ row.userName }}
|
||||||
|
<WorkerDescriptorProxy :id="row.workerFk" />
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</VnTable>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<i18n>
|
<i18n>
|
||||||
|
|
|
@ -225,3 +225,14 @@ package:
|
||||||
added: Added
|
added: Added
|
||||||
addPackage: Add package
|
addPackage: Add package
|
||||||
removePackage: Remove package
|
removePackage: Remove package
|
||||||
|
ticketList:
|
||||||
|
id: Id
|
||||||
|
nickname: Nickname
|
||||||
|
state: State
|
||||||
|
shipped: Shipped
|
||||||
|
zone: Zone
|
||||||
|
salesPerson: Sales person
|
||||||
|
totalWithVat: Total with VAT
|
||||||
|
summary: Summary
|
||||||
|
client: Customer
|
||||||
|
createTicket: Create ticket
|
||||||
|
|
|
@ -228,3 +228,14 @@ ticketSaleTracking:
|
||||||
Search ticket: Buscar tickets
|
Search ticket: Buscar tickets
|
||||||
You can search by ticket id or alias: Puedes buscar por id o alias del ticket
|
You can search by ticket id or alias: Puedes buscar por id o alias del ticket
|
||||||
Select lines to see the options: Selecciona líneas para ver las opciones
|
Select lines to see the options: Selecciona líneas para ver las opciones
|
||||||
|
ticketList:
|
||||||
|
id: Id
|
||||||
|
nickname: Alias
|
||||||
|
state: Estado
|
||||||
|
shipped: F. Envío
|
||||||
|
zone: Zona
|
||||||
|
salesPerson: Comercial
|
||||||
|
totalWithVat: Total con IVA
|
||||||
|
summary: Resumen
|
||||||
|
client: Cliente
|
||||||
|
createTicket: Crear ticket
|
||||||
|
|
|
@ -5,7 +5,7 @@ import WorkerFilter from '../WorkerFilter.vue';
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<VnCard
|
<VnCard
|
||||||
data-key="Worker"
|
data-key="Workers"
|
||||||
base-url="Workers"
|
base-url="Workers"
|
||||||
:descriptor="WorkerDescriptor"
|
:descriptor="WorkerDescriptor"
|
||||||
:filter-panel="WorkerFilter"
|
:filter-panel="WorkerFilter"
|
||||||
|
|
|
@ -111,7 +111,6 @@ const refetch = async () => await cardDescriptorRef.value.getData();
|
||||||
:filter="filter"
|
:filter="filter"
|
||||||
:title="data.title"
|
:title="data.title"
|
||||||
:subtitle="data.subtitle"
|
:subtitle="data.subtitle"
|
||||||
:summary="$attrs"
|
|
||||||
@on-fetch="
|
@on-fetch="
|
||||||
(data) => {
|
(data) => {
|
||||||
worker = data;
|
worker = data;
|
||||||
|
@ -145,7 +144,12 @@ const refetch = async () => await cardDescriptorRef.value.getData();
|
||||||
</QItem>
|
</QItem>
|
||||||
</template>
|
</template>
|
||||||
<template #before>
|
<template #before>
|
||||||
<VnImg :id="entityId" collection="user" size="160x160" class="photo">
|
<VnImg
|
||||||
|
:id="parseInt(entityId)"
|
||||||
|
collection="user"
|
||||||
|
size="160x160"
|
||||||
|
class="photo"
|
||||||
|
>
|
||||||
<template #error>
|
<template #error>
|
||||||
<div
|
<div
|
||||||
class="absolute-full picture text-center q-pa-md flex flex-center"
|
class="absolute-full picture text-center q-pa-md flex flex-center"
|
||||||
|
@ -182,6 +186,32 @@ const refetch = async () => await cardDescriptorRef.value.getData();
|
||||||
</template>
|
</template>
|
||||||
</VnLv>
|
</VnLv>
|
||||||
</template>
|
</template>
|
||||||
|
<template #actions="{ entity }">
|
||||||
|
<QCardActions class="flex justify-center">
|
||||||
|
<QBtn
|
||||||
|
:to="{
|
||||||
|
name: 'CustomerCard',
|
||||||
|
params: { id: entity.id },
|
||||||
|
}"
|
||||||
|
size="md"
|
||||||
|
icon="vn:Person"
|
||||||
|
color="primary"
|
||||||
|
>
|
||||||
|
<QTooltip>{{ t('Go to client') }}</QTooltip>
|
||||||
|
</QBtn>
|
||||||
|
<QBtn
|
||||||
|
:to="{
|
||||||
|
name: 'AccountCard',
|
||||||
|
params: { id: entity.user.id },
|
||||||
|
}"
|
||||||
|
size="md"
|
||||||
|
icon="face"
|
||||||
|
color="primary"
|
||||||
|
>
|
||||||
|
<QTooltip>{{ t('Go to user') }}</QTooltip>
|
||||||
|
</QBtn>
|
||||||
|
</QCardActions>
|
||||||
|
</template>
|
||||||
</CardDescriptor>
|
</CardDescriptor>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
|
@ -372,15 +372,15 @@ const showReasonForm = () => {
|
||||||
const updateWorkerTimeControlMail = async (state, reason) => {
|
const updateWorkerTimeControlMail = async (state, reason) => {
|
||||||
try {
|
try {
|
||||||
const params = {
|
const params = {
|
||||||
workerId: Number(route.params.id),
|
|
||||||
year: selectedDate.value.getFullYear(),
|
year: selectedDate.value.getFullYear(),
|
||||||
week: selectedWeekNumber.value,
|
week: selectedWeekNumber.value,
|
||||||
state,
|
state,
|
||||||
};
|
};
|
||||||
|
const workerId = Number(route.params.id);
|
||||||
|
|
||||||
if (reason) params.reason = reason;
|
if (reason) params.reason = reason;
|
||||||
|
|
||||||
await axios.post('WorkerTimeControls/updateWorkerTimeControlMail', params);
|
await axios.post(`WorkerTimeControls/${workerId}/updateMailState`, params);
|
||||||
await getMailStates(selectedDate.value);
|
await getMailStates(selectedDate.value);
|
||||||
await fetchWeekData();
|
await fetchWeekData();
|
||||||
notify(t('globals.dataSaved'), 'positive');
|
notify(t('globals.dataSaved'), 'positive');
|
||||||
|
@ -410,7 +410,7 @@ const resendEmail = async () => {
|
||||||
workerId: Number(route.params.id),
|
workerId: Number(route.params.id),
|
||||||
state: 'SENDED',
|
state: 'SENDED',
|
||||||
};
|
};
|
||||||
await axios.post('WorkerTimeControls/weekly-hour-hecord-email', params);
|
await axios.post('WorkerTimeControls/weekly-hour-record-email', params);
|
||||||
await getMailStates(selectedDate.value);
|
await getMailStates(selectedDate.value);
|
||||||
notify(t('Email sended'), 'positive');
|
notify(t('Email sended'), 'positive');
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|
|
@ -4,7 +4,6 @@ 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';
|
||||||
|
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
modelValue: {
|
modelValue: {
|
||||||
type: String,
|
type: String,
|
||||||
|
@ -139,7 +138,9 @@ const paintWorkWeeks = async () => {
|
||||||
show-work-weeks
|
show-work-weeks
|
||||||
:weekdays="[1, 2, 3, 4, 5, 6, 0]"
|
:weekdays="[1, 2, 3, 4, 5, 6, 0]"
|
||||||
:selected-dates="selectedDates"
|
:selected-dates="selectedDates"
|
||||||
|
:min-weekday-label="1"
|
||||||
:locale="locale"
|
:locale="locale"
|
||||||
|
animated
|
||||||
mini-mode
|
mini-mode
|
||||||
enable-outside-days
|
enable-outside-days
|
||||||
class="q-py-sm"
|
class="q-py-sm"
|
||||||
|
|
|
@ -5,7 +5,7 @@ import { useRoute } from 'vue-router';
|
||||||
|
|
||||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
import FormModelPopup from 'components/FormModelPopup.vue';
|
import FormModelPopup from 'components/FormModelPopup.vue';
|
||||||
import VnInputTime from 'components/common/VnInputTime.vue';
|
import VnInputTime from 'src/components/common/VnInputTime.vue';
|
||||||
|
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
entryId: {
|
entryId: {
|
||||||
|
@ -37,8 +37,8 @@ const entryDirections = [
|
||||||
|
|
||||||
const closeButton = ref(null);
|
const closeButton = ref(null);
|
||||||
|
|
||||||
const onDataSaved = () => {
|
const onDataSaved = (dataSaved) => {
|
||||||
emit('onDataSaved');
|
emit('onDataSaved', dataSaved);
|
||||||
closeForm();
|
closeForm();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -73,7 +73,7 @@ onBeforeMount(() => {
|
||||||
:default-actions="false"
|
:default-actions="false"
|
||||||
:title="title"
|
:title="title"
|
||||||
:url-create="urlCreate"
|
:url-create="urlCreate"
|
||||||
@on-data-saved="onDataSaved()"
|
@on-data-saved="onDataSaved"
|
||||||
>
|
>
|
||||||
<template #form-inputs="{ data }">
|
<template #form-inputs="{ data }">
|
||||||
<VnInputTime
|
<VnInputTime
|
||||||
|
@ -91,7 +91,6 @@ onBeforeMount(() => {
|
||||||
option-value="code"
|
option-value="code"
|
||||||
option-label="description"
|
option-label="description"
|
||||||
hide-selected
|
hide-selected
|
||||||
:required="true"
|
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</FormModelPopup>
|
</FormModelPopup>
|
||||||
|
|
|
@ -1,86 +1,297 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
|
import { computed, ref } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useRouter } from 'vue-router';
|
|
||||||
import VnPaginate from 'src/components/ui/VnPaginate.vue';
|
|
||||||
import WorkerSummary from './Card/WorkerSummary.vue';
|
|
||||||
import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
|
|
||||||
import WorkerFilter from './WorkerFilter.vue';
|
|
||||||
import VnLv from 'src/components/ui/VnLv.vue';
|
|
||||||
import CardList from 'src/components/ui/CardList.vue';
|
|
||||||
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
||||||
import RightMenu from 'src/components/common/RightMenu.vue';
|
import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
|
||||||
|
import VnTable from 'src/components/VnTable/VnTable.vue';
|
||||||
|
import WorkerSummary from './Card/WorkerSummary.vue';
|
||||||
|
import VnRow from 'src/components/ui/VnRow.vue';
|
||||||
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
|
import VnRadio from 'src/components/common/VnRadio.vue';
|
||||||
|
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
|
import VnInputDate from 'src/components/common/VnInputDate.vue';
|
||||||
|
import VnLocation from 'src/components/common/VnLocation.vue';
|
||||||
|
import VnSelectDialog from 'src/components/common/VnSelectDialog.vue';
|
||||||
|
import CreateBankEntityForm from 'src/components/CreateBankEntityForm.vue';
|
||||||
|
import FetchData from 'src/components/FetchData.vue';
|
||||||
|
|
||||||
const router = useRouter();
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
const tableRef = ref();
|
||||||
const { viewSummary } = useSummaryDialog();
|
const { viewSummary } = useSummaryDialog();
|
||||||
|
const companiesOptions = ref([]);
|
||||||
|
const workersOptions = ref([]);
|
||||||
|
const payMethodsOptions = ref([]);
|
||||||
|
const bankEntitiesOptions = ref([]);
|
||||||
|
const postcodesOptions = ref([]);
|
||||||
|
|
||||||
function navigate(id) {
|
const columns = computed(() => [
|
||||||
router.push({ path: `/worker/${id}` });
|
{
|
||||||
|
align: 'left',
|
||||||
|
name: 'id',
|
||||||
|
label: t('tableColumns.id'),
|
||||||
|
columnFilter: {
|
||||||
|
alias: 'w',
|
||||||
|
inWhere: true,
|
||||||
|
},
|
||||||
|
chip: {
|
||||||
|
condition: () => true,
|
||||||
|
},
|
||||||
|
isId: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
name: 'nickname',
|
||||||
|
label: t('tableColumns.name'),
|
||||||
|
isTitle: true,
|
||||||
|
columnFilter: {
|
||||||
|
name: 'search',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
name: 'departmentFk',
|
||||||
|
label: t('tableColumns.department'),
|
||||||
|
cardVisible: true,
|
||||||
|
columnFilter: {
|
||||||
|
component: 'select',
|
||||||
|
inWhere: true,
|
||||||
|
alias: 'wd',
|
||||||
|
attrs: {
|
||||||
|
url: 'Departments',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
format: (row, dashIfEmpty) => dashIfEmpty(row.department),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
name: 'email',
|
||||||
|
label: t('tableColumns.email'),
|
||||||
|
cardVisible: true,
|
||||||
|
columnFilter: {
|
||||||
|
alias: 'mu',
|
||||||
|
inWhere: true,
|
||||||
|
},
|
||||||
|
hidden: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'right',
|
||||||
|
label: '',
|
||||||
|
name: 'tableActions',
|
||||||
|
actions: [
|
||||||
|
{
|
||||||
|
title: t('InvoiceOutSummary'),
|
||||||
|
icon: 'preview',
|
||||||
|
action: (row) => viewSummary(row.id, WorkerSummary),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
|
||||||
|
function handleLocation(data, location) {
|
||||||
|
const { town, code, provinceFk, countryFk } = location ?? {};
|
||||||
|
data.postcode = code;
|
||||||
|
data.city = town;
|
||||||
|
data.provinceFk = provinceFk;
|
||||||
|
data.countryFk = countryFk;
|
||||||
}
|
}
|
||||||
|
|
||||||
const redirectToCreateView = () => {
|
function uppercaseStreetModel(data) {
|
||||||
router.push({ name: 'WorkerCreate' });
|
return {
|
||||||
};
|
get: () => (data.street ? data.street.toUpperCase() : ''),
|
||||||
|
set: (value) => {
|
||||||
|
data.street = value.toUpperCase();
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<VnSearchbar
|
<VnSearchbar
|
||||||
data-key="WorkerList"
|
data-key="Worker"
|
||||||
:label="t('Search worker')"
|
:label="t('Search worker')"
|
||||||
:info="t('You can search by worker id or name')"
|
:info="t('You can search by worker id or name')"
|
||||||
/>
|
/>
|
||||||
<RightMenu>
|
<FetchData
|
||||||
<template #right-panel>
|
url="Companies"
|
||||||
<WorkerFilter data-key="WorkerList" />
|
@on-fetch="(data) => (companiesOptions = data)"
|
||||||
</template>
|
auto-load
|
||||||
</RightMenu>
|
/>
|
||||||
<QPage class="column items-center q-pa-md">
|
<FetchData
|
||||||
<div class="vn-card-list">
|
url="Workers/search"
|
||||||
<VnPaginate
|
@on-fetch="(data) => (workersOptions = data)"
|
||||||
data-key="WorkerList"
|
auto-load
|
||||||
|
/>
|
||||||
|
<FetchData
|
||||||
|
url="Paymethods"
|
||||||
|
@on-fetch="(data) => (payMethodsOptions = data)"
|
||||||
|
auto-load
|
||||||
|
/>
|
||||||
|
<FetchData
|
||||||
|
url="BankEntities"
|
||||||
|
@on-fetch="(data) => (bankEntitiesOptions = data)"
|
||||||
|
auto-load
|
||||||
|
/>
|
||||||
|
<VnTable
|
||||||
|
ref="tableRef"
|
||||||
|
data-key="Worker"
|
||||||
url="Workers/filter"
|
url="Workers/filter"
|
||||||
order="id DESC"
|
:create="{
|
||||||
|
urlCreate: 'Workers/new',
|
||||||
|
title: t('Create worker'),
|
||||||
|
onDataSaved: ({ id }) => tableRef.redirect(id),
|
||||||
|
formInitialData: {
|
||||||
|
isFreelance: false,
|
||||||
|
},
|
||||||
|
}"
|
||||||
|
:columns="columns"
|
||||||
|
default-mode="table"
|
||||||
|
redirect="worker"
|
||||||
auto-load
|
auto-load
|
||||||
>
|
>
|
||||||
<template #body="{ rows }">
|
<template #more-create-dialog="{ data }">
|
||||||
<CardList
|
<div class="q-pa-lg full-width" style="max-width: 1200px">
|
||||||
v-for="row of rows"
|
<VnRadio
|
||||||
:key="row.id"
|
v-model="data.isFreelance"
|
||||||
:id="row.id"
|
:val="false"
|
||||||
:title="row.nickname"
|
:label="`${t('Internal')}`"
|
||||||
@click="navigate(row.id)"
|
@update:model-value="data.payMethodFk = defaultPayMethod"
|
||||||
|
/>
|
||||||
|
<VnRadio
|
||||||
|
v-model="data.isFreelance"
|
||||||
|
:val="true"
|
||||||
|
:label="`${t('External')}`"
|
||||||
|
@update:model-value="delete data.payMethodFk"
|
||||||
|
/>
|
||||||
|
<VnRow>
|
||||||
|
<VnInput v-model="data.firstName" :label="t('worker.create.name')" />
|
||||||
|
<VnInput
|
||||||
|
v-model="data.lastNames"
|
||||||
|
:label="t('worker.create.lastName')"
|
||||||
|
/>
|
||||||
|
<VnInput v-model="data.code" :label="t('worker.create.code')" />
|
||||||
|
</VnRow>
|
||||||
|
<VnRow>
|
||||||
|
<VnInput v-model="data.name" :label="t('worker.create.webUser')" />
|
||||||
|
<VnInput
|
||||||
|
v-model="data.email"
|
||||||
|
:label="t('worker.create.personalEmail')"
|
||||||
|
/>
|
||||||
|
</VnRow>
|
||||||
|
<VnRow>
|
||||||
|
<VnSelect
|
||||||
|
:label="t('worker.create.company')"
|
||||||
|
v-model="data.companyFk"
|
||||||
|
:options="companiesOptions"
|
||||||
|
option-value="id"
|
||||||
|
option-label="code"
|
||||||
|
hide-selected
|
||||||
|
/>
|
||||||
|
<VnSelect
|
||||||
|
:label="t('worker.create.boss')"
|
||||||
|
v-model="data.bossFk"
|
||||||
|
:options="workersOptions"
|
||||||
|
option-value="id"
|
||||||
|
option-label="name"
|
||||||
|
hide-selected
|
||||||
>
|
>
|
||||||
<template #list-items>
|
<template #option="scope">
|
||||||
<VnLv :label="t('worker.list.name')" :value="row.userName" />
|
<QItem v-bind="scope.itemProps">
|
||||||
<VnLv :label="t('worker.list.email')" :value="row.email" />
|
<QItemSection>
|
||||||
<VnLv
|
<QItemLabel>{{ scope.opt.name }}</QItemLabel>
|
||||||
:label="t('worker.list.department')"
|
<QItemLabel caption
|
||||||
:value="row.department"
|
>{{ scope.opt.nickname }},
|
||||||
|
{{ scope.opt.code }}
|
||||||
|
</QItemLabel>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
</template>
|
||||||
|
</VnSelect>
|
||||||
|
</VnRow>
|
||||||
|
<VnRow>
|
||||||
|
<VnInput v-model="data.fi" :label="t('worker.create.fi')" />
|
||||||
|
<VnInputDate
|
||||||
|
v-model="data.birth"
|
||||||
|
:label="t('worker.create.birth')"
|
||||||
|
:disable="data.isFreelance"
|
||||||
|
/>
|
||||||
|
<VnInput
|
||||||
|
v-model="data.phone"
|
||||||
|
:label="t('worker.create.phone')"
|
||||||
|
:disable="data.isFreelance"
|
||||||
|
/>
|
||||||
|
</VnRow>
|
||||||
|
<VnRow>
|
||||||
|
<VnLocation
|
||||||
|
:roles-allowed-to-create="['deliveryAssistant']"
|
||||||
|
:options="postcodesOptions"
|
||||||
|
v-model="data.location"
|
||||||
|
@update:model-value="(location) => handleLocation(data, location)"
|
||||||
|
:disable="data.isFreelance"
|
||||||
|
>
|
||||||
|
</VnLocation>
|
||||||
|
</VnRow>
|
||||||
|
<VnRow>
|
||||||
|
<VnInput
|
||||||
|
:label="t('worker.create.street')"
|
||||||
|
:model-value="uppercaseStreetModel(data).get()"
|
||||||
|
@update:model-value="uppercaseStreetModel(data).set"
|
||||||
|
:disable="data.isFreelance"
|
||||||
|
/>
|
||||||
|
</VnRow>
|
||||||
|
<VnRow>
|
||||||
|
<VnSelect
|
||||||
|
:label="t('worker.create.payMethods')"
|
||||||
|
v-model="data.payMethodFk"
|
||||||
|
:options="payMethodsOptions"
|
||||||
|
option-value="id"
|
||||||
|
option-label="name"
|
||||||
|
map-options
|
||||||
|
hide-selected
|
||||||
|
:disable="data.isFreelance"
|
||||||
|
@update:model-value="(val) => !val && delete data.payMethodFk"
|
||||||
|
/>
|
||||||
|
<VnInput
|
||||||
|
v-model="data.iban"
|
||||||
|
:label="t('worker.create.iban')"
|
||||||
|
:disable="data.isFreelance"
|
||||||
|
>
|
||||||
|
<template #append>
|
||||||
|
<QIcon name="info" class="cursor-info">
|
||||||
|
<QTooltip>{{ t('components.iban_tooltip') }}</QTooltip>
|
||||||
|
</QIcon>
|
||||||
|
</template>
|
||||||
|
</VnInput>
|
||||||
|
</VnRow>
|
||||||
|
<VnRow>
|
||||||
|
<VnSelectDialog
|
||||||
|
:label="t('worker.create.bankEntity')"
|
||||||
|
v-model="data.bankEntityFk"
|
||||||
|
:options="bankEntitiesOptions"
|
||||||
|
option-label="name"
|
||||||
|
option-value="id"
|
||||||
|
hide-selected
|
||||||
|
:roles-allowed-to-create="['salesAssistant', 'hr']"
|
||||||
|
:disable="data.isFreelance"
|
||||||
|
>
|
||||||
|
<template #form>
|
||||||
|
<CreateBankEntityForm
|
||||||
|
@on-data-saved="(data) => bankEntitiesOptions.push(data)"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<template #actions>
|
<template #option="scope">
|
||||||
<QBtn
|
<QItem v-bind="scope.itemProps">
|
||||||
:label="t('components.smartCard.openCard')"
|
<QItemSection v-if="scope.opt">
|
||||||
@click.stop="navigate(row.id)"
|
<QItemLabel
|
||||||
outline
|
>{{ scope.opt.bic }}
|
||||||
/>
|
{{ scope.opt.name }}</QItemLabel
|
||||||
<QBtn
|
>
|
||||||
:label="t('components.smartCard.openSummary')"
|
</QItemSection>
|
||||||
@click.stop="viewSummary(row.id, WorkerSummary)"
|
</QItem>
|
||||||
color="primary"
|
|
||||||
style="margin-top: 15px"
|
|
||||||
/>
|
|
||||||
</template>
|
</template>
|
||||||
</CardList>
|
</VnSelectDialog>
|
||||||
</template>
|
</VnRow>
|
||||||
</VnPaginate>
|
|
||||||
</div>
|
</div>
|
||||||
<QPageSticky :offset="[20, 20]">
|
</template>
|
||||||
<QBtn fab icon="add" color="primary" @click="redirectToCreateView()" />
|
</VnTable>
|
||||||
<QTooltip>
|
|
||||||
{{ t('worker.list.newWorker') }}
|
|
||||||
</QTooltip>
|
|
||||||
</QPageSticky>
|
|
||||||
</QPage>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<i18n>
|
<i18n>
|
||||||
|
|
|
@ -1 +1,6 @@
|
||||||
passwordRequirements: 'The password must have at least { length } length characters, {nAlpha} alphabetic characters, {nUpper} capital letters, {nDigits} digits and {nPunct} symbols (Ex: $%&.)\n'
|
passwordRequirements: 'The password must have at least { length } length characters, {nAlpha} alphabetic characters, {nUpper} capital letters, {nDigits} digits and {nPunct} symbols (Ex: $%&.)\n'
|
||||||
|
tableColumns:
|
||||||
|
id: ID
|
||||||
|
name: Name
|
||||||
|
department: Department
|
||||||
|
email: Email
|
||||||
|
|
|
@ -4,3 +4,8 @@ Locker: Taquilla
|
||||||
Internal: Interno
|
Internal: Interno
|
||||||
External: Externo
|
External: Externo
|
||||||
passwordRequirements: 'La contraseña debe tener al menos { length } caracteres de longitud, {nAlpha} caracteres alfabéticos, {nUpper} letras mayúsculas, {nDigits} dígitos y {nPunct} símbolos (Ej: $%&.)'
|
passwordRequirements: 'La contraseña debe tener al menos { length } caracteres de longitud, {nAlpha} caracteres alfabéticos, {nUpper} letras mayúsculas, {nDigits} dígitos y {nPunct} símbolos (Ej: $%&.)'
|
||||||
|
tableColumns:
|
||||||
|
id: ID
|
||||||
|
name: Nombre
|
||||||
|
department: Departamento
|
||||||
|
email: Email
|
||||||
|
|
|
@ -52,7 +52,6 @@ const setData = (entity) => {
|
||||||
:filter="filter"
|
:filter="filter"
|
||||||
@on-fetch="setData"
|
@on-fetch="setData"
|
||||||
data-key="zoneData"
|
data-key="zoneData"
|
||||||
:summary="$attrs"
|
|
||||||
>
|
>
|
||||||
<template #menu="{ entity }">
|
<template #menu="{ entity }">
|
||||||
<ZoneDescriptorMenuItems :zone="entity" />
|
<ZoneDescriptorMenuItems :zone="entity" />
|
||||||
|
|
|
@ -104,6 +104,25 @@ export default {
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: 'WorkerTimeControl',
|
||||||
|
path: 'time-control',
|
||||||
|
meta: {
|
||||||
|
title: 'timeControl',
|
||||||
|
icon: 'access_time',
|
||||||
|
},
|
||||||
|
component: () =>
|
||||||
|
import('src/pages/Worker/Card/WorkerTimeControl.vue'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'WorkerCalendar',
|
||||||
|
path: 'calendar',
|
||||||
|
meta: {
|
||||||
|
title: 'calendar',
|
||||||
|
icon: 'calendar_today',
|
||||||
|
},
|
||||||
|
component: () => import('src/pages/Worker/Card/WorkerCalendar.vue'),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: 'WorkerPda',
|
name: 'WorkerPda',
|
||||||
path: 'pda',
|
path: 'pda',
|
||||||
|
@ -150,25 +169,6 @@ export default {
|
||||||
},
|
},
|
||||||
component: () => import('src/pages/Worker/Card/WorkerLog.vue'),
|
component: () => import('src/pages/Worker/Card/WorkerLog.vue'),
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: 'WorkerCalendar',
|
|
||||||
path: 'calendar',
|
|
||||||
meta: {
|
|
||||||
title: 'calendar',
|
|
||||||
icon: 'calendar_today',
|
|
||||||
},
|
|
||||||
component: () => import('src/pages/Worker/Card/WorkerCalendar.vue'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'WorkerTimeControl',
|
|
||||||
path: 'time-control',
|
|
||||||
meta: {
|
|
||||||
title: 'timeControl',
|
|
||||||
icon: 'access_time',
|
|
||||||
},
|
|
||||||
component: () =>
|
|
||||||
import('src/pages/Worker/Card/WorkerTimeControl.vue'),
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
name: 'WorkerLocker',
|
name: 'WorkerLocker',
|
||||||
path: 'locker',
|
path: 'locker',
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
describe('WorkerCreate', () => {
|
describe('WorkerCreate', () => {
|
||||||
const externalRadio = '.q-toolbar .q-radio:nth-child(2)';
|
const externalRadio = '.q-radio:nth-child(2)';
|
||||||
const notification = '.q-notification__message';
|
const notification = '.q-notification__message';
|
||||||
const developerBossId = 120;
|
const developerBossId = 120;
|
||||||
|
|
||||||
|
@ -9,12 +9,13 @@ describe('WorkerCreate', () => {
|
||||||
Name: { val: 'Manolo' },
|
Name: { val: 'Manolo' },
|
||||||
'Last name': { val: 'Hurtado' },
|
'Last name': { val: 'Hurtado' },
|
||||||
'Personal email': { val: 'manolo@mydomain.com' },
|
'Personal email': { val: 'manolo@mydomain.com' },
|
||||||
|
Company: { val: 'VNL', type: 'select' },
|
||||||
Street: { val: 'S/ DEFAULTWORKERSTREET' },
|
Street: { val: 'S/ DEFAULTWORKERSTREET' },
|
||||||
Location: { val: 1, type: 'select' },
|
Location: { val: 1, type: 'select' },
|
||||||
Phone: { val: '123456789' },
|
Phone: { val: '123456789' },
|
||||||
'Worker code': { val: 'DWW' },
|
'Worker code': { val: 'DWW' },
|
||||||
Boss: { val: developerBossId, type: 'select' },
|
Boss: { val: developerBossId, type: 'select' },
|
||||||
Birth: { val: '2022-12-11T23:00:00.000Z', type: 'date', day: 11 },
|
Birth: { val: '11-12-2022', type: 'date' },
|
||||||
};
|
};
|
||||||
const external = {
|
const external = {
|
||||||
Fi: { val: 'Z4531219V' },
|
Fi: { val: 'Z4531219V' },
|
||||||
|
@ -29,16 +30,14 @@ describe('WorkerCreate', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.viewport(1280, 720);
|
cy.viewport(1280, 720);
|
||||||
cy.login('hr');
|
cy.login('hr');
|
||||||
cy.visit('/#/worker/create');
|
cy.visit('/#/worker/list');
|
||||||
|
cy.get('.q-page-sticky > div > .q-btn').click();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should throw an error if a pay method has not been selected', () => {
|
it('should throw an error if a pay method has not been selected', () => {
|
||||||
cy.fillInForm(internal);
|
cy.fillInForm(internal);
|
||||||
cy.saveCard();
|
cy.get('.q-mt-lg > .q-btn--standard').click();
|
||||||
cy.get(notification).should(
|
cy.get(notification).should('contains.text', 'Payment method is required');
|
||||||
'contains.text',
|
|
||||||
'That payment method requires an IBAN'
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should create an internal', () => {
|
it('should create an internal', () => {
|
||||||
|
@ -46,14 +45,14 @@ describe('WorkerCreate', () => {
|
||||||
...internal,
|
...internal,
|
||||||
'Pay method': { val: 'PayMethod one', type: 'select' },
|
'Pay method': { val: 'PayMethod one', type: 'select' },
|
||||||
});
|
});
|
||||||
cy.saveCard();
|
cy.get('.q-mt-lg > .q-btn--standard').click();
|
||||||
cy.get(notification).should('contains.text', 'Data created');
|
cy.get(notification).should('contains.text', 'Data created');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should create an external', () => {
|
it('should create an external', () => {
|
||||||
cy.get(externalRadio).click();
|
cy.get(externalRadio).click();
|
||||||
cy.fillInForm(external);
|
cy.fillInForm(external);
|
||||||
cy.saveCard();
|
cy.get('.q-mt-lg > .q-btn--standard').click();
|
||||||
cy.get(notification).should('contains.text', 'Data created');
|
cy.get(notification).should('contains.text', 'Data created');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,25 +1,13 @@
|
||||||
describe('WorkerList', () => {
|
describe('WorkerList', () => {
|
||||||
const workerFieldNames =
|
|
||||||
'.card-list-body > .list-items > :nth-child(1) > .value > span';
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.viewport(1280, 720);
|
cy.viewport(1280, 720);
|
||||||
cy.login('developer');
|
cy.login('developer');
|
||||||
cy.visit('/#/worker/list');
|
cy.visit('/#/worker/list');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should load workers', () => {
|
|
||||||
cy.get(workerFieldNames).eq(2).should('have.text', 'jessicajones');
|
|
||||||
cy.get(workerFieldNames).eq(3).should('have.text', 'brucebanner');
|
|
||||||
cy.get(workerFieldNames).eq(4).should('have.text', 'charlesxavier');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should open the worker summary', () => {
|
it('should open the worker summary', () => {
|
||||||
cy.openListSummary(2);
|
cy.get('.bg-header > :nth-child(2) > .full-width > :nth-child(1) >').type(
|
||||||
cy.get('.summaryHeader div').should('have.text', '1110 - Jessica Jones');
|
'jessica jones{enter}'
|
||||||
cy.get('.summary .header-link')
|
);
|
||||||
.eq(0)
|
|
||||||
.invoke('text')
|
|
||||||
.should('include', 'Basic data');
|
|
||||||
cy.get('.summary .header-link').eq(2).should('have.text', 'User data ');
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -87,7 +87,6 @@ Cypress.Commands.add('selectOption', (selector, option) => {
|
||||||
});
|
});
|
||||||
|
|
||||||
Cypress.Commands.add('fillInForm', (obj, form = '.q-form > .q-card') => {
|
Cypress.Commands.add('fillInForm', (obj, form = '.q-form > .q-card') => {
|
||||||
const days = '.q-date__calendar-days .q-date__calendar-item--in';
|
|
||||||
cy.waitForElement('.q-form > .q-card');
|
cy.waitForElement('.q-form > .q-card');
|
||||||
cy.get(`${form} input`).each(([el]) => {
|
cy.get(`${form} input`).each(([el]) => {
|
||||||
cy.wrap(el)
|
cy.wrap(el)
|
||||||
|
@ -96,17 +95,14 @@ Cypress.Commands.add('fillInForm', (obj, form = '.q-form > .q-card') => {
|
||||||
const field = obj[ariaLabel];
|
const field = obj[ariaLabel];
|
||||||
if (!field) return;
|
if (!field) return;
|
||||||
|
|
||||||
const { type, val, day } = field;
|
const { type, val } = field;
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'select':
|
case 'select':
|
||||||
cy.wrap(el).type(val);
|
cy.wrap(el).type(val);
|
||||||
cy.get('.q-menu .q-item').contains(val).click();
|
cy.get('.q-menu .q-item').contains(val).click();
|
||||||
break;
|
break;
|
||||||
case 'date':
|
case 'date':
|
||||||
cy.wrap(el).click();
|
cy.wrap(el).type(val.split('-').join(''));
|
||||||
cy.get(days)
|
|
||||||
.eq(day ? day - 1 : 0)
|
|
||||||
.click();
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
cy.wrap(el).type(val);
|
cy.wrap(el).type(val);
|
||||||
|
|
Loading…
Reference in New Issue