Merge branch 'dev' into 7414-ticketHistoryChanges
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
This commit is contained in:
commit
04044f2b08
|
@ -9,19 +9,19 @@ export default {
|
||||||
if (!form) return;
|
if (!form) return;
|
||||||
try {
|
try {
|
||||||
const inputsFormCard = form.querySelectorAll(
|
const inputsFormCard = form.querySelectorAll(
|
||||||
`input:not([disabled]):not([type="checkbox"])`
|
`input:not([disabled]):not([type="checkbox"])`,
|
||||||
);
|
);
|
||||||
if (inputsFormCard.length) {
|
if (inputsFormCard.length) {
|
||||||
focusFirstInput(inputsFormCard[0]);
|
focusFirstInput(inputsFormCard[0]);
|
||||||
}
|
}
|
||||||
const textareas = document.querySelectorAll(
|
const textareas = document.querySelectorAll(
|
||||||
'textarea:not([disabled]), [contenteditable]:not([disabled])'
|
'textarea:not([disabled]), [contenteditable]:not([disabled])',
|
||||||
);
|
);
|
||||||
if (textareas.length) {
|
if (textareas.length) {
|
||||||
focusFirstInput(textareas[textareas.length - 1]);
|
focusFirstInput(textareas[textareas.length - 1]);
|
||||||
}
|
}
|
||||||
const inputs = document.querySelectorAll(
|
const inputs = document.querySelectorAll(
|
||||||
'form#formModel input:not([disabled]):not([type="checkbox"])'
|
'form#formModel input:not([disabled]):not([type="checkbox"])',
|
||||||
);
|
);
|
||||||
const input = inputs[0];
|
const input = inputs[0];
|
||||||
if (!input) return;
|
if (!input) return;
|
||||||
|
|
|
@ -113,7 +113,7 @@ const defaultButtons = computed(() => ({
|
||||||
color: 'primary',
|
color: 'primary',
|
||||||
icon: 'save',
|
icon: 'save',
|
||||||
label: 'globals.save',
|
label: 'globals.save',
|
||||||
click: () => myForm.value.submit(),
|
click: () => myForm.value.onSubmit(false),
|
||||||
type: 'submit',
|
type: 'submit',
|
||||||
},
|
},
|
||||||
reset: {
|
reset: {
|
||||||
|
@ -207,7 +207,8 @@ async function fetch() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function save() {
|
async function save(prevent = false) {
|
||||||
|
if (prevent) return;
|
||||||
if ($props.observeFormChanges && !hasChanges.value)
|
if ($props.observeFormChanges && !hasChanges.value)
|
||||||
return notify('globals.noChanges', 'negative');
|
return notify('globals.noChanges', 'negative');
|
||||||
|
|
||||||
|
@ -293,7 +294,7 @@ defineExpose({
|
||||||
<QForm
|
<QForm
|
||||||
ref="myForm"
|
ref="myForm"
|
||||||
v-if="formData"
|
v-if="formData"
|
||||||
@submit="save"
|
@submit="save(!!$event)"
|
||||||
@reset="reset"
|
@reset="reset"
|
||||||
class="q-pa-md"
|
class="q-pa-md"
|
||||||
:style="maxWidth ? 'max-width: ' + maxWidth : ''"
|
:style="maxWidth ? 'max-width: ' + maxWidth : ''"
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed, onMounted } from 'vue';
|
import { ref, computed } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
|
||||||
import FormModel from 'components/FormModel.vue';
|
import FormModel from 'components/FormModel.vue';
|
||||||
|
@ -58,19 +58,6 @@ defineExpose({
|
||||||
<p>{{ subtitle }}</p>
|
<p>{{ subtitle }}</p>
|
||||||
<slot name="form-inputs" :data="data" :validate="validate" />
|
<slot name="form-inputs" :data="data" :validate="validate" />
|
||||||
<div class="q-mt-lg row justify-end">
|
<div class="q-mt-lg row justify-end">
|
||||||
<QBtn
|
|
||||||
v-if="showSaveAndContinueBtn"
|
|
||||||
:label="t('globals.isSaveAndContinue')"
|
|
||||||
:title="t('globals.isSaveAndContinue')"
|
|
||||||
type="submit"
|
|
||||||
color="primary"
|
|
||||||
class="q-ml-sm"
|
|
||||||
:disabled="isLoading"
|
|
||||||
:loading="isLoading"
|
|
||||||
data-cy="FormModelPopup_isSaveAndContinue"
|
|
||||||
z-max
|
|
||||||
@click="() => (isSaveAndContinue = true)"
|
|
||||||
/>
|
|
||||||
<QBtn
|
<QBtn
|
||||||
:label="t('globals.cancel')"
|
:label="t('globals.cancel')"
|
||||||
:title="t('globals.cancel')"
|
:title="t('globals.cancel')"
|
||||||
|
@ -83,23 +70,39 @@ defineExpose({
|
||||||
v-close-popup
|
v-close-popup
|
||||||
z-max
|
z-max
|
||||||
@click="
|
@click="
|
||||||
() => {
|
isSaveAndContinue = false;
|
||||||
isSaveAndContinue = false;
|
emit('onDataCanceled');
|
||||||
emit('onDataCanceled');
|
|
||||||
}
|
|
||||||
"
|
"
|
||||||
/>
|
/>
|
||||||
<QBtn
|
<QBtn
|
||||||
|
:flat="showSaveAndContinueBtn"
|
||||||
:label="t('globals.save')"
|
:label="t('globals.save')"
|
||||||
:title="t('globals.save')"
|
:title="t('globals.save')"
|
||||||
type="submit"
|
@click="
|
||||||
|
formModelRef.save();
|
||||||
|
isSaveAndContinue = false;
|
||||||
|
"
|
||||||
color="primary"
|
color="primary"
|
||||||
class="q-ml-sm"
|
class="q-ml-sm"
|
||||||
:disabled="isLoading"
|
:disabled="isLoading"
|
||||||
:loading="isLoading"
|
:loading="isLoading"
|
||||||
data-cy="FormModelPopup_save"
|
data-cy="FormModelPopup_save"
|
||||||
z-max
|
z-max
|
||||||
@click="() => (isSaveAndContinue = false)"
|
/>
|
||||||
|
<QBtn
|
||||||
|
v-if="showSaveAndContinueBtn"
|
||||||
|
:label="t('globals.isSaveAndContinue')"
|
||||||
|
:title="t('globals.isSaveAndContinue')"
|
||||||
|
color="primary"
|
||||||
|
class="q-ml-sm"
|
||||||
|
:disabled="isLoading"
|
||||||
|
:loading="isLoading"
|
||||||
|
data-cy="FormModelPopup_isSaveAndContinue"
|
||||||
|
z-max
|
||||||
|
@click="
|
||||||
|
isSaveAndContinue = true;
|
||||||
|
formModelRef.save();
|
||||||
|
"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -340,8 +340,9 @@ const clickHandler = async (event) => {
|
||||||
|
|
||||||
const isDateElement = event.target.closest('.q-date');
|
const isDateElement = event.target.closest('.q-date');
|
||||||
const isTimeElement = event.target.closest('.q-time');
|
const isTimeElement = event.target.closest('.q-time');
|
||||||
|
const isQselectDropDown = event.target.closest('.q-select__dropdown-icon');
|
||||||
|
|
||||||
if (isDateElement || isTimeElement) return;
|
if (isDateElement || isTimeElement || isQselectDropDown) return;
|
||||||
|
|
||||||
if (clickedElement === null) {
|
if (clickedElement === null) {
|
||||||
destroyInput(editingRow.value, editingField.value);
|
destroyInput(editingRow.value, editingField.value);
|
||||||
|
@ -411,7 +412,7 @@ async function renderInput(rowId, field, clickedElement) {
|
||||||
focusOnMount: true,
|
focusOnMount: true,
|
||||||
eventHandlers: {
|
eventHandlers: {
|
||||||
'update:modelValue': async (value) => {
|
'update:modelValue': async (value) => {
|
||||||
if (isSelect) {
|
if (isSelect && value) {
|
||||||
row[column.name] = value[column.attrs?.optionValue ?? 'id'];
|
row[column.name] = value[column.attrs?.optionValue ?? 'id'];
|
||||||
row[column?.name + 'TextValue'] =
|
row[column?.name + 'TextValue'] =
|
||||||
value[column.attrs?.optionLabel ?? 'name'];
|
value[column.attrs?.optionLabel ?? 'name'];
|
||||||
|
@ -448,8 +449,11 @@ async function renderInput(rowId, field, clickedElement) {
|
||||||
node.appContext = app._context;
|
node.appContext = app._context;
|
||||||
render(node, clickedElement);
|
render(node, clickedElement);
|
||||||
|
|
||||||
if (['checkbox', 'toggle', undefined].includes(column?.component))
|
if (['toggle'].includes(column?.component))
|
||||||
node.el?.querySelector('span > div').focus();
|
node.el?.querySelector('span > div').focus();
|
||||||
|
|
||||||
|
if (['checkbox', undefined].includes(column?.component))
|
||||||
|
node.el?.querySelector('span > div > div').focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
function destroyInput(rowIndex, field, clickedElement) {
|
function destroyInput(rowIndex, field, clickedElement) {
|
||||||
|
@ -530,6 +534,9 @@ function formatColumnValue(col, row, dashIfEmpty) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const checkbox = ref(null);
|
const checkbox = ref(null);
|
||||||
|
function cardClick(_, row) {
|
||||||
|
if ($props.redirect) router.push({ path: `/${$props.redirect}/${row.id}` });
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<QDrawer
|
<QDrawer
|
||||||
|
@ -593,6 +600,7 @@ const checkbox = ref(null);
|
||||||
@row-click="(_, row) => rowClickFunction && rowClickFunction(row)"
|
@row-click="(_, row) => rowClickFunction && rowClickFunction(row)"
|
||||||
@update:selected="emit('update:selected', $event)"
|
@update:selected="emit('update:selected', $event)"
|
||||||
@selection="(details) => handleSelection(details, rows)"
|
@selection="(details) => handleSelection(details, rows)"
|
||||||
|
:hide-selected-banner="true"
|
||||||
>
|
>
|
||||||
<template #top-left v-if="!$props.withoutHeader">
|
<template #top-left v-if="!$props.withoutHeader">
|
||||||
<slot name="top-left"> </slot>
|
<slot name="top-left"> </slot>
|
||||||
|
@ -624,6 +632,7 @@ const checkbox = ref(null);
|
||||||
<template #header-cell="{ col }">
|
<template #header-cell="{ col }">
|
||||||
<QTh
|
<QTh
|
||||||
v-if="col.visible ?? true"
|
v-if="col.visible ?? true"
|
||||||
|
v-bind:class="col.headerClass"
|
||||||
class="body-cell"
|
class="body-cell"
|
||||||
:style="col?.width ? `max-width: ${col?.width}` : ''"
|
:style="col?.width ? `max-width: ${col?.width}` : ''"
|
||||||
style="padding: inherit"
|
style="padding: inherit"
|
||||||
|
@ -763,18 +772,13 @@ const checkbox = ref(null);
|
||||||
</template>
|
</template>
|
||||||
<template #item="{ row, colsMap }">
|
<template #item="{ row, colsMap }">
|
||||||
<component
|
<component
|
||||||
:is="$props.redirect ? 'router-link' : 'span'"
|
v-bind:is="'div'"
|
||||||
:to="`/${$props.redirect}/` + row.id"
|
@click="(event) => cardClick(event, row)"
|
||||||
>
|
>
|
||||||
<QCard
|
<QCard
|
||||||
bordered
|
bordered
|
||||||
flat
|
flat
|
||||||
class="row no-wrap justify-between cursor-pointer q-pa-sm"
|
class="row no-wrap justify-between cursor-pointer q-pa-sm"
|
||||||
@click="
|
|
||||||
(_, row) => {
|
|
||||||
$props.rowClick && $props.rowClick(row);
|
|
||||||
}
|
|
||||||
"
|
|
||||||
style="height: 100%"
|
style="height: 100%"
|
||||||
>
|
>
|
||||||
<QCardSection
|
<QCardSection
|
||||||
|
@ -1042,8 +1046,8 @@ es:
|
||||||
|
|
||||||
.grid-three {
|
.grid-three {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(auto-fit, minmax(150px, max-content));
|
grid-template-columns: repeat(auto-fit, minmax(300px, max-content));
|
||||||
max-width: 100%;
|
width: 100%;
|
||||||
grid-gap: 20px;
|
grid-gap: 20px;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
colors: {
|
colors: {
|
||||||
type: String,
|
type: String,
|
||||||
default: '{"value":[]}',
|
default: '{"value": []}',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ const maxHeight = 30;
|
||||||
const colorHeight = maxHeight / colorArray?.length;
|
const colorHeight = maxHeight / colorArray?.length;
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<div class="color-div" :style="{ height: `${maxHeight}px` }">
|
<div v-if="colors" class="color-div" :style="{ height: `${maxHeight}px` }">
|
||||||
<div
|
<div
|
||||||
v-for="(color, index) in colorArray"
|
v-for="(color, index) in colorArray"
|
||||||
:key="index"
|
:key="index"
|
||||||
|
|
|
@ -6,6 +6,7 @@ import { useArrayData } from 'composables/useArrayData';
|
||||||
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
||||||
import { useState } from 'src/composables/useState';
|
import { useState } from 'src/composables/useState';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
|
import { useClipboard } from 'src/composables/useClipboard';
|
||||||
import VnMoreOptions from './VnMoreOptions.vue';
|
import VnMoreOptions from './VnMoreOptions.vue';
|
||||||
|
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
|
@ -29,10 +30,6 @@ const $props = defineProps({
|
||||||
type: String,
|
type: String,
|
||||||
default: null,
|
default: null,
|
||||||
},
|
},
|
||||||
module: {
|
|
||||||
type: String,
|
|
||||||
default: null,
|
|
||||||
},
|
|
||||||
summary: {
|
summary: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: null,
|
default: null,
|
||||||
|
@ -46,6 +43,7 @@ const $props = defineProps({
|
||||||
const state = useState();
|
const state = useState();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
const { copyText } = useClipboard();
|
||||||
const { viewSummary } = useSummaryDialog();
|
const { viewSummary } = useSummaryDialog();
|
||||||
let arrayData;
|
let arrayData;
|
||||||
let store;
|
let store;
|
||||||
|
@ -103,6 +101,14 @@ function getValueFromPath(path) {
|
||||||
return current;
|
return current;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function copyIdText(id) {
|
||||||
|
copyText(id, {
|
||||||
|
component: {
|
||||||
|
copyValue: id,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
const emit = defineEmits(['onFetch']);
|
const emit = defineEmits(['onFetch']);
|
||||||
|
|
||||||
const iconModule = computed(() => route.matched[1].meta.icon);
|
const iconModule = computed(() => route.matched[1].meta.icon);
|
||||||
|
@ -148,7 +154,9 @@ const toModule = computed(() =>
|
||||||
{{ t('components.smartCard.openSummary') }}
|
{{ t('components.smartCard.openSummary') }}
|
||||||
</QTooltip>
|
</QTooltip>
|
||||||
</QBtn>
|
</QBtn>
|
||||||
<RouterLink :to="{ name: `${module}Summary`, params: { id: entity.id } }">
|
<RouterLink
|
||||||
|
:to="{ name: `${dataKey}Summary`, params: { id: entity.id } }"
|
||||||
|
>
|
||||||
<QBtn
|
<QBtn
|
||||||
class="link"
|
class="link"
|
||||||
color="white"
|
color="white"
|
||||||
|
@ -184,9 +192,22 @@ const toModule = computed(() =>
|
||||||
</slot>
|
</slot>
|
||||||
</div>
|
</div>
|
||||||
</QItemLabel>
|
</QItemLabel>
|
||||||
<QItem dense>
|
<QItem>
|
||||||
<QItemLabel class="subtitle" caption>
|
<QItemLabel class="subtitle" caption>
|
||||||
#{{ getValueFromPath(subtitle) ?? entity.id }}
|
#{{ getValueFromPath(subtitle) ?? entity.id }}
|
||||||
|
<QBtn
|
||||||
|
round
|
||||||
|
flat
|
||||||
|
dense
|
||||||
|
size="sm"
|
||||||
|
icon="content_copy"
|
||||||
|
color="primary"
|
||||||
|
@click.stop="copyIdText(entity.id)"
|
||||||
|
>
|
||||||
|
<QTooltip>
|
||||||
|
{{ t('globals.copyId') }}
|
||||||
|
</QTooltip>
|
||||||
|
</QBtn>
|
||||||
</QItemLabel>
|
</QItemLabel>
|
||||||
</QItem>
|
</QItem>
|
||||||
</QList>
|
</QList>
|
||||||
|
@ -294,3 +315,11 @@ const toModule = computed(() =>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
<i18n>
|
||||||
|
en:
|
||||||
|
globals:
|
||||||
|
copyId: Copy ID
|
||||||
|
es:
|
||||||
|
globals:
|
||||||
|
copyId: Copiar ID
|
||||||
|
</i18n>
|
||||||
|
|
|
@ -11,6 +11,7 @@ export async function useCau(res, message) {
|
||||||
const { config, headers, request, status, statusText, data } = res || {};
|
const { config, headers, request, status, statusText, data } = res || {};
|
||||||
const { params, url, method, signal, headers: confHeaders } = config || {};
|
const { params, url, method, signal, headers: confHeaders } = config || {};
|
||||||
const { message: resMessage, code, name } = data?.error || {};
|
const { message: resMessage, code, name } = data?.error || {};
|
||||||
|
delete confHeaders.Authorization;
|
||||||
|
|
||||||
const additionalData = {
|
const additionalData = {
|
||||||
path: location.hash,
|
path: location.hash,
|
||||||
|
@ -40,7 +41,7 @@ export async function useCau(res, message) {
|
||||||
handler: async () => {
|
handler: async () => {
|
||||||
const locale = i18n.global.t;
|
const locale = i18n.global.t;
|
||||||
const reason = ref(
|
const reason = ref(
|
||||||
code == 'ACCESS_DENIED' ? locale('cau.askPrivileges') : ''
|
code == 'ACCESS_DENIED' ? locale('cau.askPrivileges') : '',
|
||||||
);
|
);
|
||||||
openConfirmationModal(
|
openConfirmationModal(
|
||||||
locale('cau.title'),
|
locale('cau.title'),
|
||||||
|
@ -59,10 +60,9 @@ export async function useCau(res, message) {
|
||||||
'onUpdate:modelValue': (val) => (reason.value = val),
|
'onUpdate:modelValue': (val) => (reason.value = val),
|
||||||
label: locale('cau.inputLabel'),
|
label: locale('cau.inputLabel'),
|
||||||
class: 'full-width',
|
class: 'full-width',
|
||||||
required: true,
|
|
||||||
autofocus: true,
|
autofocus: true,
|
||||||
},
|
},
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -156,6 +156,7 @@ globals:
|
||||||
changeState: Change state
|
changeState: Change state
|
||||||
raid: 'Raid {daysInForward} days'
|
raid: 'Raid {daysInForward} days'
|
||||||
isVies: Vies
|
isVies: Vies
|
||||||
|
noData: No data available
|
||||||
pageTitles:
|
pageTitles:
|
||||||
logIn: Login
|
logIn: Login
|
||||||
addressEdit: Update address
|
addressEdit: Update address
|
||||||
|
|
|
@ -160,6 +160,7 @@ globals:
|
||||||
changeState: Cambiar estado
|
changeState: Cambiar estado
|
||||||
raid: 'Redada {daysInForward} días'
|
raid: 'Redada {daysInForward} días'
|
||||||
isVies: Vies
|
isVies: Vies
|
||||||
|
noData: Datos no disponibles
|
||||||
pageTitles:
|
pageTitles:
|
||||||
logIn: Inicio de sesión
|
logIn: Inicio de sesión
|
||||||
addressEdit: Modificar consignatario
|
addressEdit: Modificar consignatario
|
||||||
|
|
|
@ -51,7 +51,6 @@ const removeAlias = () => {
|
||||||
<CardDescriptor
|
<CardDescriptor
|
||||||
ref="descriptor"
|
ref="descriptor"
|
||||||
:url="`MailAliases/${entityId}`"
|
:url="`MailAliases/${entityId}`"
|
||||||
module="Alias"
|
|
||||||
data-key="Alias"
|
data-key="Alias"
|
||||||
title="alias"
|
title="alias"
|
||||||
>
|
>
|
||||||
|
|
|
@ -24,7 +24,6 @@ onMounted(async () => {
|
||||||
ref="descriptor"
|
ref="descriptor"
|
||||||
:url="`VnUsers/preview`"
|
:url="`VnUsers/preview`"
|
||||||
:filter="{ ...filter, where: { id: entityId } }"
|
:filter="{ ...filter, where: { id: entityId } }"
|
||||||
module="Account"
|
|
||||||
data-key="Account"
|
data-key="Account"
|
||||||
title="nickname"
|
title="nickname"
|
||||||
>
|
>
|
||||||
|
|
|
@ -35,6 +35,12 @@ account.value.hasAccount = hasAccount.value;
|
||||||
const entityId = computed(() => +route.params.id);
|
const entityId = computed(() => +route.params.id);
|
||||||
const hasitManagementAccess = ref();
|
const hasitManagementAccess = ref();
|
||||||
const hasSysadminAccess = ref();
|
const hasSysadminAccess = ref();
|
||||||
|
const isHimself = computed(() => user.value.id === account.value.id);
|
||||||
|
const url = computed(() =>
|
||||||
|
isHimself.value
|
||||||
|
? 'Accounts/change-password'
|
||||||
|
: `Accounts/${entityId.value}/setPassword`
|
||||||
|
);
|
||||||
|
|
||||||
async function updateStatusAccount(active) {
|
async function updateStatusAccount(active) {
|
||||||
if (active) {
|
if (active) {
|
||||||
|
@ -107,11 +113,8 @@ onMounted(() => {
|
||||||
:ask-old-pass="askOldPass"
|
:ask-old-pass="askOldPass"
|
||||||
:submit-fn="
|
:submit-fn="
|
||||||
async (newPassword, oldPassword) => {
|
async (newPassword, oldPassword) => {
|
||||||
await axios.patch(`Accounts/change-password`, {
|
const body = isHimself ? { userId: entityId, oldPassword } : {};
|
||||||
userId: entityId,
|
await axios.patch(url, { ...body, newPassword });
|
||||||
newPassword,
|
|
||||||
oldPassword,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
"
|
"
|
||||||
/>
|
/>
|
||||||
|
@ -155,16 +158,10 @@ onMounted(() => {
|
||||||
>
|
>
|
||||||
<QItemSection>{{ t('globals.delete') }}</QItemSection>
|
<QItemSection>{{ t('globals.delete') }}</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem
|
<QItem v-if="hasSysadminAccess" v-ripple clickable>
|
||||||
v-if="hasSysadminAccess"
|
<QItemSection @click="onChangePass(isHimself)">
|
||||||
v-ripple
|
{{ isHimself ? t('globals.changePass') : t('globals.setPass') }}
|
||||||
clickable
|
|
||||||
@click="user.id === account.id ? onChangePass(true) : onChangePass(false)"
|
|
||||||
>
|
|
||||||
<QItemSection v-if="user.id === account.id">
|
|
||||||
{{ t('globals.changePass') }}
|
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
<QItemSection v-else>{{ t('globals.setPass') }}</QItemSection>
|
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem
|
<QItem
|
||||||
v-if="!account.hasAccount && hasSysadminAccess"
|
v-if="!account.hasAccount && hasSysadminAccess"
|
||||||
|
|
|
@ -35,7 +35,6 @@ const removeRole = async () => {
|
||||||
<CardDescriptor
|
<CardDescriptor
|
||||||
url="VnRoles"
|
url="VnRoles"
|
||||||
:filter="{ where: { id: entityId } }"
|
:filter="{ where: { id: entityId } }"
|
||||||
module="Role"
|
|
||||||
data-key="Role"
|
data-key="Role"
|
||||||
:summary="$props.summary"
|
:summary="$props.summary"
|
||||||
>
|
>
|
||||||
|
|
|
@ -46,7 +46,6 @@ onMounted(async () => {
|
||||||
<CardDescriptor
|
<CardDescriptor
|
||||||
:url="`Claims/${entityId}`"
|
:url="`Claims/${entityId}`"
|
||||||
:filter="filter"
|
:filter="filter"
|
||||||
module="Claim"
|
|
||||||
title="client.name"
|
title="client.name"
|
||||||
data-key="Claim"
|
data-key="Claim"
|
||||||
>
|
>
|
||||||
|
|
|
@ -190,7 +190,7 @@ async function saveWhenHasChanges() {
|
||||||
ref="claimLinesForm"
|
ref="claimLinesForm"
|
||||||
:url="`Claims/${route.params.id}/lines`"
|
:url="`Claims/${route.params.id}/lines`"
|
||||||
save-url="ClaimBeginnings/crud"
|
save-url="ClaimBeginnings/crud"
|
||||||
:filter="linesFilter"
|
:user-filter="linesFilter"
|
||||||
@on-fetch="onFetch"
|
@on-fetch="onFetch"
|
||||||
v-model:selected="selected"
|
v-model:selected="selected"
|
||||||
:default-save="false"
|
:default-save="false"
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue';
|
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
|
||||||
import FetchData from 'components/FetchData.vue';
|
|
||||||
import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
|
import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
|
||||||
import VnSelect from 'components/common/VnSelect.vue';
|
import VnSelect from 'components/common/VnSelect.vue';
|
||||||
import VnInput from 'src/components/common/VnInput.vue';
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
|
@ -14,15 +12,14 @@ const props = defineProps({
|
||||||
type: String,
|
type: String,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
states: {
|
||||||
|
type: Array,
|
||||||
|
default: () => [],
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const states = ref([]);
|
|
||||||
|
|
||||||
defineExpose({ states });
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<FetchData url="ClaimStates" @on-fetch="(data) => (states = data)" auto-load />
|
|
||||||
<VnFilterPanel :data-key="props.dataKey" :search-button="true">
|
<VnFilterPanel :data-key="props.dataKey" :search-button="true">
|
||||||
<template #tags="{ tag, formatFn }">
|
<template #tags="{ tag, formatFn }">
|
||||||
<div class="q-gutter-x-xs">
|
<div class="q-gutter-x-xs">
|
||||||
|
|
|
@ -10,12 +10,13 @@ import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
||||||
import VnTable from 'src/components/VnTable/VnTable.vue';
|
import VnTable from 'src/components/VnTable/VnTable.vue';
|
||||||
import ZoneDescriptorProxy from '../Zone/Card/ZoneDescriptorProxy.vue';
|
import ZoneDescriptorProxy from '../Zone/Card/ZoneDescriptorProxy.vue';
|
||||||
import VnSection from 'src/components/common/VnSection.vue';
|
import VnSection from 'src/components/common/VnSection.vue';
|
||||||
|
import FetchData from 'src/components/FetchData.vue';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const { viewSummary } = useSummaryDialog();
|
const { viewSummary } = useSummaryDialog();
|
||||||
const dataKey = 'ClaimList';
|
const dataKey = 'ClaimList';
|
||||||
|
|
||||||
const claimFilterRef = ref();
|
const states = ref([]);
|
||||||
const columns = computed(() => [
|
const columns = computed(() => [
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
@ -81,8 +82,7 @@ const columns = computed(() => [
|
||||||
align: 'left',
|
align: 'left',
|
||||||
label: t('claim.state'),
|
label: t('claim.state'),
|
||||||
format: ({ stateCode }) =>
|
format: ({ stateCode }) =>
|
||||||
claimFilterRef.value?.states.find(({ code }) => code === stateCode)
|
states.value?.find(({ code }) => code === stateCode)?.description,
|
||||||
?.description,
|
|
||||||
name: 'stateCode',
|
name: 'stateCode',
|
||||||
chip: {
|
chip: {
|
||||||
condition: () => true,
|
condition: () => true,
|
||||||
|
@ -92,7 +92,7 @@ const columns = computed(() => [
|
||||||
name: 'claimStateFk',
|
name: 'claimStateFk',
|
||||||
component: 'select',
|
component: 'select',
|
||||||
attrs: {
|
attrs: {
|
||||||
options: claimFilterRef.value?.states,
|
options: states.value,
|
||||||
optionLabel: 'description',
|
optionLabel: 'description',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -125,6 +125,7 @@ const STATE_COLOR = {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
<FetchData url="ClaimStates" @on-fetch="(data) => (states = data)" auto-load />
|
||||||
<VnSection
|
<VnSection
|
||||||
:data-key="dataKey"
|
:data-key="dataKey"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
|
@ -135,7 +136,7 @@ const STATE_COLOR = {
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<template #advanced-menu>
|
<template #advanced-menu>
|
||||||
<ClaimFilter data-key="ClaimList" ref="claimFilterRef" />
|
<ClaimFilter :data-key ref="claimFilterRef" :states />
|
||||||
</template>
|
</template>
|
||||||
<template #body>
|
<template #body>
|
||||||
<VnTable
|
<VnTable
|
||||||
|
|
|
@ -55,7 +55,6 @@ const debtWarning = computed(() => {
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<CardDescriptor
|
<CardDescriptor
|
||||||
module="Customer"
|
|
||||||
:url="`Clients/${entityId}/getCard`"
|
:url="`Clients/${entityId}/getCard`"
|
||||||
:summary="$props.summary"
|
:summary="$props.summary"
|
||||||
data-key="Customer"
|
data-key="Customer"
|
||||||
|
|
|
@ -10,6 +10,7 @@ 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 VnLocation from 'src/components/common/VnLocation.vue';
|
import VnLocation from 'src/components/common/VnLocation.vue';
|
||||||
import VnCheckbox from 'src/components/common/VnCheckbox.vue';
|
import VnCheckbox from 'src/components/common/VnCheckbox.vue';
|
||||||
|
import { getDifferences, getUpdatedValues } from 'src/filters';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
@ -24,6 +25,12 @@ function handleLocation(data, location) {
|
||||||
data.provinceFk = provinceFk;
|
data.provinceFk = provinceFk;
|
||||||
data.countryFk = countryFk;
|
data.countryFk = countryFk;
|
||||||
}
|
}
|
||||||
|
function onBeforeSave(formData, originalData) {
|
||||||
|
return getUpdatedValues(
|
||||||
|
Object.keys(getDifferences(formData, originalData)),
|
||||||
|
formData,
|
||||||
|
);
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -37,6 +44,7 @@ function handleLocation(data, location) {
|
||||||
:url-update="`Clients/${route.params.id}/updateFiscalData`"
|
:url-update="`Clients/${route.params.id}/updateFiscalData`"
|
||||||
auto-load
|
auto-load
|
||||||
model="Customer"
|
model="Customer"
|
||||||
|
:mapper="onBeforeSave"
|
||||||
>
|
>
|
||||||
<template #form="{ data, validate }">
|
<template #form="{ data, validate }">
|
||||||
<VnRow>
|
<VnRow>
|
||||||
|
@ -114,7 +122,7 @@ function handleLocation(data, location) {
|
||||||
<VnCheckbox
|
<VnCheckbox
|
||||||
v-model="data.isVies"
|
v-model="data.isVies"
|
||||||
:label="t('globals.isVies')"
|
:label="t('globals.isVies')"
|
||||||
:info="t('whenActivatingIt')"
|
:info="t('whenActivatingIt')"
|
||||||
/>
|
/>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
|
|
||||||
|
@ -127,7 +135,7 @@ function handleLocation(data, location) {
|
||||||
</VnRow>
|
</VnRow>
|
||||||
|
|
||||||
<VnRow>
|
<VnRow>
|
||||||
<VnCheckbox
|
<VnCheckbox
|
||||||
v-model="data.isEqualizated"
|
v-model="data.isEqualizated"
|
||||||
:label="t('Is equalizated')"
|
:label="t('Is equalizated')"
|
||||||
:info="t('inOrderToInvoice')"
|
:info="t('inOrderToInvoice')"
|
||||||
|
|
|
@ -84,7 +84,7 @@ function setPaymentType(accounting) {
|
||||||
viewReceipt.value = isCash.value;
|
viewReceipt.value = isCash.value;
|
||||||
if (accountingType.value.daysInFuture)
|
if (accountingType.value.daysInFuture)
|
||||||
initialData.payed.setDate(
|
initialData.payed.setDate(
|
||||||
initialData.payed.getDate() + accountingType.value.daysInFuture
|
initialData.payed.getDate() + accountingType.value.daysInFuture,
|
||||||
);
|
);
|
||||||
maxAmount.value = accountingType.value && accountingType.value.maxAmount;
|
maxAmount.value = accountingType.value && accountingType.value.maxAmount;
|
||||||
|
|
||||||
|
|
|
@ -156,10 +156,10 @@ const columns = [
|
||||||
{
|
{
|
||||||
align: 'center',
|
align: 'center',
|
||||||
labelAbbreviation: t('Sti.'),
|
labelAbbreviation: t('Sti.'),
|
||||||
label: t('Printed Stickers/Stickers'),
|
label: t('Stickers'),
|
||||||
toolTip: t('Printed Stickers/Stickers'),
|
toolTip: t('Printed Stickers/Stickers'),
|
||||||
name: 'stickers',
|
name: 'stickers',
|
||||||
component: 'number',
|
component: 'input',
|
||||||
create: true,
|
create: true,
|
||||||
attrs: {
|
attrs: {
|
||||||
positive: false,
|
positive: false,
|
||||||
|
@ -179,7 +179,7 @@ const columns = [
|
||||||
component: 'select',
|
component: 'select',
|
||||||
attrs: {
|
attrs: {
|
||||||
url: 'packagings',
|
url: 'packagings',
|
||||||
fields: ['id', 'volume'],
|
fields: ['id'],
|
||||||
optionLabel: 'id',
|
optionLabel: 'id',
|
||||||
},
|
},
|
||||||
create: true,
|
create: true,
|
||||||
|
@ -192,10 +192,10 @@ const columns = [
|
||||||
component: 'number',
|
component: 'number',
|
||||||
create: true,
|
create: true,
|
||||||
width: '35px',
|
width: '35px',
|
||||||
|
format: (row, dashIfEmpty) => parseFloat(row['weight']).toFixed(1),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'center',
|
labelAbbreviation: 'P',
|
||||||
labelAbbreviation: 'Pack',
|
|
||||||
label: 'Packing',
|
label: 'Packing',
|
||||||
toolTip: 'Packing',
|
toolTip: 'Packing',
|
||||||
name: 'packing',
|
name: 'packing',
|
||||||
|
@ -209,14 +209,13 @@ const columns = [
|
||||||
row['amount'] = row['quantity'] * row['buyingValue'];
|
row['amount'] = row['quantity'] * row['buyingValue'];
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
width: '35px',
|
width: '20px',
|
||||||
style: (row) => {
|
style: (row) => {
|
||||||
if (row.groupingMode === 'grouping')
|
if (row.groupingMode === 'grouping')
|
||||||
return { color: 'var(--vn-label-color)' };
|
return { color: 'var(--vn-label-color)' };
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'center',
|
|
||||||
labelAbbreviation: 'GM',
|
labelAbbreviation: 'GM',
|
||||||
label: t('Grouping selector'),
|
label: t('Grouping selector'),
|
||||||
toolTip: t('Grouping selector'),
|
toolTip: t('Grouping selector'),
|
||||||
|
@ -229,7 +228,7 @@ const columns = [
|
||||||
indeterminateValue: null,
|
indeterminateValue: null,
|
||||||
},
|
},
|
||||||
size: 'xs',
|
size: 'xs',
|
||||||
width: '30px',
|
width: '25px',
|
||||||
create: true,
|
create: true,
|
||||||
rightFilter: false,
|
rightFilter: false,
|
||||||
getIcon: (value) => {
|
getIcon: (value) => {
|
||||||
|
@ -245,12 +244,12 @@ const columns = [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'center',
|
align: 'center',
|
||||||
labelAbbreviation: 'Group',
|
labelAbbreviation: 'G',
|
||||||
label: 'Grouping',
|
label: 'Grouping',
|
||||||
toolTip: 'Grouping',
|
toolTip: 'Grouping',
|
||||||
name: 'grouping',
|
name: 'grouping',
|
||||||
component: 'number',
|
component: 'number',
|
||||||
width: '35px',
|
width: '20px',
|
||||||
create: true,
|
create: true,
|
||||||
style: (row) => {
|
style: (row) => {
|
||||||
if (row.groupingMode === 'packing') return { color: 'var(--vn-label-color)' };
|
if (row.groupingMode === 'packing') return { color: 'var(--vn-label-color)' };
|
||||||
|
@ -290,6 +289,7 @@ const columns = [
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
width: '45px',
|
width: '45px',
|
||||||
|
format: (row) => parseFloat(row['buyingValue']).toFixed(3),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'center',
|
align: 'center',
|
||||||
|
@ -301,6 +301,7 @@ const columns = [
|
||||||
positive: false,
|
positive: false,
|
||||||
},
|
},
|
||||||
isEditable: false,
|
isEditable: false,
|
||||||
|
format: (row) => parseFloat(row['amount']).toFixed(2),
|
||||||
style: getAmountStyle,
|
style: getAmountStyle,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -312,6 +313,7 @@ const columns = [
|
||||||
component: 'number',
|
component: 'number',
|
||||||
width: '35px',
|
width: '35px',
|
||||||
create: true,
|
create: true,
|
||||||
|
format: (row) => parseFloat(row['price2']).toFixed(2),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'center',
|
align: 'center',
|
||||||
|
@ -325,6 +327,7 @@ const columns = [
|
||||||
},
|
},
|
||||||
width: '35px',
|
width: '35px',
|
||||||
create: true,
|
create: true,
|
||||||
|
format: (row) => parseFloat(row['price3']).toFixed(2),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'center',
|
align: 'center',
|
||||||
|
@ -344,6 +347,7 @@ const columns = [
|
||||||
style: (row) => {
|
style: (row) => {
|
||||||
if (!row?.hasMinPrice) return { color: 'var(--vn-label-color)' };
|
if (!row?.hasMinPrice) return { color: 'var(--vn-label-color)' };
|
||||||
},
|
},
|
||||||
|
format: (row) => parseFloat(row['minPrice']).toFixed(2),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'center',
|
align: 'center',
|
||||||
|
@ -518,7 +522,7 @@ onMounted(() => {
|
||||||
<Teleport to="#st-data" v-if="stateStore?.isSubToolbarShown() && editableMode">
|
<Teleport to="#st-data" v-if="stateStore?.isSubToolbarShown() && editableMode">
|
||||||
<QBtnGroup push style="column-gap: 1px">
|
<QBtnGroup push style="column-gap: 1px">
|
||||||
<QBtnDropdown
|
<QBtnDropdown
|
||||||
icon="exposure_neg_1"
|
label="+/-"
|
||||||
color="primary"
|
color="primary"
|
||||||
flat
|
flat
|
||||||
:title="t('Invert quantity value')"
|
:title="t('Invert quantity value')"
|
||||||
|
@ -533,7 +537,7 @@ onMounted(() => {
|
||||||
@click="invertQuantitySign(selectedRows, -1)"
|
@click="invertQuantitySign(selectedRows, -1)"
|
||||||
data-cy="set-negative-quantity"
|
data-cy="set-negative-quantity"
|
||||||
>
|
>
|
||||||
<span style="font-size: medium">-1</span>
|
<span style="font-size: large">-</span>
|
||||||
</QBtn>
|
</QBtn>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
|
@ -544,7 +548,7 @@ onMounted(() => {
|
||||||
@click="invertQuantitySign(selectedRows, 1)"
|
@click="invertQuantitySign(selectedRows, 1)"
|
||||||
data-cy="set-positive-quantity"
|
data-cy="set-positive-quantity"
|
||||||
>
|
>
|
||||||
<span style="font-size: medium">1</span>
|
<span style="font-size: large">+</span>
|
||||||
</QBtn>
|
</QBtn>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
|
@ -558,11 +562,11 @@ onMounted(() => {
|
||||||
:disable="!selectedRows.length"
|
:disable="!selectedRows.length"
|
||||||
data-cy="check-buy-amount"
|
data-cy="check-buy-amount"
|
||||||
>
|
>
|
||||||
<QTooltip>{{}}</QTooltip>
|
|
||||||
<QList>
|
<QList>
|
||||||
<QItem>
|
<QItem>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<QBtn
|
<QBtn
|
||||||
|
size="sm"
|
||||||
icon="check"
|
icon="check"
|
||||||
flat
|
flat
|
||||||
@click="setIsChecked(selectedRows, true)"
|
@click="setIsChecked(selectedRows, true)"
|
||||||
|
@ -573,6 +577,7 @@ onMounted(() => {
|
||||||
<QItem>
|
<QItem>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<QBtn
|
<QBtn
|
||||||
|
size="sm"
|
||||||
icon="close"
|
icon="close"
|
||||||
flat
|
flat
|
||||||
@click="setIsChecked(selectedRows, false)"
|
@click="setIsChecked(selectedRows, false)"
|
||||||
|
@ -662,7 +667,7 @@ onMounted(() => {
|
||||||
<FetchedTags :item="row" :columns="3" />
|
<FetchedTags :item="row" :columns="3" />
|
||||||
</template>
|
</template>
|
||||||
<template #column-stickers="{ row }">
|
<template #column-stickers="{ row }">
|
||||||
<span class="editable-text">
|
<span :class="editableMode ? 'editable-text' : ''">
|
||||||
<span style="color: var(--vn-label-color)">
|
<span style="color: var(--vn-label-color)">
|
||||||
{{ row.printedStickers }}
|
{{ row.printedStickers }}
|
||||||
</span>
|
</span>
|
||||||
|
@ -693,20 +698,36 @@ onMounted(() => {
|
||||||
</template>
|
</template>
|
||||||
<template #column-create-itemFk="{ data }">
|
<template #column-create-itemFk="{ data }">
|
||||||
<VnSelect
|
<VnSelect
|
||||||
url="Items"
|
url="Items/search"
|
||||||
v-model="data.itemFk"
|
v-model="data.itemFk"
|
||||||
:label="t('Article')"
|
:label="t('Article')"
|
||||||
:fields="['id', 'name']"
|
:fields="['id', 'name', 'size', 'producerName']"
|
||||||
|
:filter-options="['id', 'name', 'size', 'producerName']"
|
||||||
option-label="name"
|
option-label="name"
|
||||||
option-value="id"
|
option-value="id"
|
||||||
@update:modelValue="
|
@update:modelValue="
|
||||||
async (value) => {
|
async (value) => {
|
||||||
setBuyUltimate(value, data);
|
await setBuyUltimate(value, data);
|
||||||
}
|
}
|
||||||
"
|
"
|
||||||
:required="true"
|
:required="true"
|
||||||
data-cy="itemFk-create-popup"
|
data-cy="itemFk-create-popup"
|
||||||
/>
|
sort-by="nickname DESC"
|
||||||
|
>
|
||||||
|
<template #option="scope">
|
||||||
|
<QItem v-bind="scope.itemProps">
|
||||||
|
<QItemSection>
|
||||||
|
<QItemLabel>
|
||||||
|
{{ scope.opt.name }}
|
||||||
|
</QItemLabel>
|
||||||
|
<QItemLabel caption>
|
||||||
|
#{{ scope.opt.id }}, {{ scope.opt?.size }},
|
||||||
|
{{ scope.opt?.producerName }}
|
||||||
|
</QItemLabel>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
</template>
|
||||||
|
</VnSelect>
|
||||||
</template>
|
</template>
|
||||||
<template #column-create-groupingMode="{ data }">
|
<template #column-create-groupingMode="{ data }">
|
||||||
<VnSelectEnum
|
<VnSelectEnum
|
||||||
|
@ -720,9 +741,14 @@ onMounted(() => {
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<template #previous-create-dialog="{ data }">
|
<template #previous-create-dialog="{ data }">
|
||||||
<div style="position: absolute">
|
<div
|
||||||
|
style="position: absolute"
|
||||||
|
:class="{ 'centered-container': !data.itemFk }"
|
||||||
|
>
|
||||||
<ItemDescriptor :id="data.itemFk" v-if="data.itemFk" />
|
<ItemDescriptor :id="data.itemFk" v-if="data.itemFk" />
|
||||||
<SkeletonDescriptor v-if="!data.itemFk" :has-image="true" />
|
<div v-else>
|
||||||
|
<span>{{ t('globals.noData') }}</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</VnTable>
|
</VnTable>
|
||||||
|
@ -744,6 +770,7 @@ es:
|
||||||
Com.: Ref.
|
Com.: Ref.
|
||||||
Comment: Referencia
|
Comment: Referencia
|
||||||
Minimum price: Precio mínimo
|
Minimum price: Precio mínimo
|
||||||
|
Stickers: Etiquetas
|
||||||
Printed Stickers/Stickers: Etiquetas impresas/Etiquetas
|
Printed Stickers/Stickers: Etiquetas impresas/Etiquetas
|
||||||
Cost: Cost.
|
Cost: Cost.
|
||||||
Buying value: Coste
|
Buying value: Coste
|
||||||
|
@ -761,7 +788,12 @@ es:
|
||||||
Check buy amount: Marcar como correcta la cantidad de compra
|
Check buy amount: Marcar como correcta la cantidad de compra
|
||||||
</i18n>
|
</i18n>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.test {
|
.centered-container {
|
||||||
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
position: absolute;
|
||||||
|
width: 40%;
|
||||||
|
height: 100%;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -147,7 +147,6 @@ async function deleteEntry() {
|
||||||
<template>
|
<template>
|
||||||
<CardDescriptor
|
<CardDescriptor
|
||||||
ref="entryDescriptorRef"
|
ref="entryDescriptorRef"
|
||||||
module="Entry"
|
|
||||||
:url="`Entries/${entityId}`"
|
:url="`Entries/${entityId}`"
|
||||||
:userFilter="entryFilter"
|
:userFilter="entryFilter"
|
||||||
title="supplier.nickname"
|
title="supplier.nickname"
|
||||||
|
|
|
@ -182,14 +182,6 @@ const columns = computed(() => [
|
||||||
name: 'entryTypeCode',
|
name: 'entryTypeCode',
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: 'dated',
|
|
||||||
label: t('entry.list.tableVisibleColumns.dated'),
|
|
||||||
component: 'date',
|
|
||||||
cardVisible: false,
|
|
||||||
visible: false,
|
|
||||||
create: true,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
name: 'companyFk',
|
name: 'companyFk',
|
||||||
label: t('entry.list.tableVisibleColumns.companyFk'),
|
label: t('entry.list.tableVisibleColumns.companyFk'),
|
||||||
|
@ -220,7 +212,8 @@ function getBadgeAttrs(row) {
|
||||||
|
|
||||||
let timeDiff = today - timeTicket;
|
let timeDiff = today - timeTicket;
|
||||||
|
|
||||||
if (timeDiff > 0) return { color: 'warning', 'text-color': 'black' };
|
if (timeDiff > 0) return { color: 'info', 'text-color': 'black' };
|
||||||
|
if (timeDiff < 0) return { color: 'warning', 'text-color': 'black' };
|
||||||
switch (row.entryTypeCode) {
|
switch (row.entryTypeCode) {
|
||||||
case 'regularization':
|
case 'regularization':
|
||||||
case 'life':
|
case 'life':
|
||||||
|
@ -245,7 +238,6 @@ function getBadgeAttrs(row) {
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (timeDiff < 0) return { color: 'info', 'text-color': 'black' };
|
|
||||||
return { color: 'transparent' };
|
return { color: 'transparent' };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -90,7 +90,6 @@ async function setInvoiceCorrection(id) {
|
||||||
<template>
|
<template>
|
||||||
<CardDescriptor
|
<CardDescriptor
|
||||||
ref="cardDescriptorRef"
|
ref="cardDescriptorRef"
|
||||||
module="InvoiceIn"
|
|
||||||
data-key="InvoiceIn"
|
data-key="InvoiceIn"
|
||||||
:url="`InvoiceIns/${entityId}`"
|
:url="`InvoiceIns/${entityId}`"
|
||||||
:filter="filter"
|
:filter="filter"
|
||||||
|
|
|
@ -36,7 +36,6 @@ function ticketFilter(invoice) {
|
||||||
<template>
|
<template>
|
||||||
<CardDescriptor
|
<CardDescriptor
|
||||||
ref="descriptor"
|
ref="descriptor"
|
||||||
module="InvoiceOut"
|
|
||||||
:url="`InvoiceOuts/${entityId}`"
|
:url="`InvoiceOuts/${entityId}`"
|
||||||
:filter="filter"
|
:filter="filter"
|
||||||
title="ref"
|
title="ref"
|
||||||
|
|
|
@ -92,7 +92,6 @@ const updateStock = async () => {
|
||||||
<template>
|
<template>
|
||||||
<CardDescriptor
|
<CardDescriptor
|
||||||
data-key="Item"
|
data-key="Item"
|
||||||
module="Item"
|
|
||||||
:summary="$props.summary"
|
:summary="$props.summary"
|
||||||
:url="`Items/${entityId}/getCard`"
|
:url="`Items/${entityId}/getCard`"
|
||||||
@on-fetch="setData"
|
@on-fetch="setData"
|
||||||
|
|
|
@ -110,10 +110,16 @@ const columns = computed(() => [
|
||||||
attrs: { inWhere: true },
|
attrs: { inWhere: true },
|
||||||
align: 'left',
|
align: 'left',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: t('globals.visible'),
|
||||||
|
name: 'stock',
|
||||||
|
attrs: { inWhere: true },
|
||||||
|
align: 'left',
|
||||||
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const totalLabels = computed(() =>
|
const totalLabels = computed(() =>
|
||||||
rows.value.reduce((acc, row) => acc + row.stock / row.packing, 0).toFixed(2)
|
rows.value.reduce((acc, row) => acc + row.stock / row.packing, 0).toFixed(2),
|
||||||
);
|
);
|
||||||
|
|
||||||
const removeLines = async () => {
|
const removeLines = async () => {
|
||||||
|
@ -157,7 +163,7 @@ watchEffect(selectedRows);
|
||||||
openConfirmationModal(
|
openConfirmationModal(
|
||||||
t('shelvings.removeConfirmTitle'),
|
t('shelvings.removeConfirmTitle'),
|
||||||
t('shelvings.removeConfirmSubtitle'),
|
t('shelvings.removeConfirmSubtitle'),
|
||||||
removeLines
|
removeLines,
|
||||||
)
|
)
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
|
|
|
@ -26,7 +26,6 @@ const entityId = computed(() => {
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<CardDescriptor
|
<CardDescriptor
|
||||||
module="ItemType"
|
|
||||||
:url="`ItemTypes/${entityId}`"
|
:url="`ItemTypes/${entityId}`"
|
||||||
:filter="filter"
|
:filter="filter"
|
||||||
title="code"
|
title="code"
|
||||||
|
|
|
@ -61,6 +61,7 @@ function exprBuilder(param, value) {
|
||||||
case 'nickname':
|
case 'nickname':
|
||||||
return { [`t.nickname`]: { like: `%${value}%` } };
|
return { [`t.nickname`]: { like: `%${value}%` } };
|
||||||
case 'zoneFk':
|
case 'zoneFk':
|
||||||
|
return { 't.zoneFk': value };
|
||||||
case 'department':
|
case 'department':
|
||||||
return { 'd.name': value };
|
return { 'd.name': value };
|
||||||
case 'totalWithVat':
|
case 'totalWithVat':
|
||||||
|
|
|
@ -39,7 +39,7 @@ const addToOrder = async () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
const { data: orderTotal } = await axios.get(
|
const { data: orderTotal } = await axios.get(
|
||||||
`Orders/${Number(route.params.id)}/getTotal`
|
`Orders/${Number(route.params.id)}/getTotal`,
|
||||||
);
|
);
|
||||||
|
|
||||||
state.set('orderTotal', orderTotal);
|
state.set('orderTotal', orderTotal);
|
||||||
|
@ -56,7 +56,7 @@ const canAddToOrder = () => {
|
||||||
if (canAddToOrder) {
|
if (canAddToOrder) {
|
||||||
const excedQuantity = prices.value.reduce(
|
const excedQuantity = prices.value.reduce(
|
||||||
(acc, { quantity }) => acc + quantity,
|
(acc, { quantity }) => acc + quantity,
|
||||||
0
|
0,
|
||||||
);
|
);
|
||||||
if (excedQuantity > props.item.available) {
|
if (excedQuantity > props.item.available) {
|
||||||
canAddToOrder = false;
|
canAddToOrder = false;
|
||||||
|
|
|
@ -57,7 +57,6 @@ const total = ref(0);
|
||||||
ref="descriptor"
|
ref="descriptor"
|
||||||
:url="`Orders/${entityId}`"
|
:url="`Orders/${entityId}`"
|
||||||
:filter="filter"
|
:filter="filter"
|
||||||
module="Order"
|
|
||||||
title="client.name"
|
title="client.name"
|
||||||
@on-fetch="setData"
|
@on-fetch="setData"
|
||||||
data-key="Order"
|
data-key="Order"
|
||||||
|
|
|
@ -22,7 +22,6 @@ const card = computed(() => store.data);
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<CardDescriptor
|
<CardDescriptor
|
||||||
module="Agency"
|
|
||||||
data-key="Agency"
|
data-key="Agency"
|
||||||
:url="`Agencies/${entityId}`"
|
:url="`Agencies/${entityId}`"
|
||||||
:title="card?.name"
|
:title="card?.name"
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { computed } from 'vue';
|
import { ref, computed, onMounted } from 'vue';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import CardDescriptor from 'components/ui/CardDescriptor.vue';
|
import CardDescriptor from 'components/ui/CardDescriptor.vue';
|
||||||
import VnLv from 'components/ui/VnLv.vue';
|
import VnLv from 'components/ui/VnLv.vue';
|
||||||
|
@ -16,14 +16,33 @@ const $props = defineProps({
|
||||||
});
|
});
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
const { t } = useI18n();
|
||||||
|
const zone = ref();
|
||||||
|
const zoneId = ref();
|
||||||
const entityId = computed(() => {
|
const entityId = computed(() => {
|
||||||
return $props.id || route.params.id;
|
return $props.id || route.params.id;
|
||||||
});
|
});
|
||||||
|
const getZone = async () => {
|
||||||
|
const filter = {
|
||||||
|
where: { routeFk: $props.id ? $props.id : route.params.id },
|
||||||
|
};
|
||||||
|
const { data } = await axios.get('Tickets/findOne', {
|
||||||
|
params: {
|
||||||
|
filter: JSON.stringify(filter),
|
||||||
|
},
|
||||||
|
});
|
||||||
|
zoneId.value = data.zoneFk;
|
||||||
|
const { data: zoneData } = await axios.get(`Zones/${zoneId.value}`);
|
||||||
|
zone.value = zoneData.name;
|
||||||
|
};
|
||||||
|
const data = ref(useCardDescription());
|
||||||
|
const setData = (entity) => (data.value = useCardDescription(entity.code, entity.id));
|
||||||
|
onMounted(async () => {
|
||||||
|
getZone();
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<CardDescriptor
|
<CardDescriptor
|
||||||
module="Route"
|
|
||||||
:url="`Routes/${entityId}`"
|
:url="`Routes/${entityId}`"
|
||||||
:filter="filter"
|
:filter="filter"
|
||||||
:title="null"
|
:title="null"
|
||||||
|
@ -31,9 +50,9 @@ const entityId = computed(() => {
|
||||||
width="lg-width"
|
width="lg-width"
|
||||||
>
|
>
|
||||||
<template #body="{ entity }">
|
<template #body="{ entity }">
|
||||||
<VnLv :label="$t('Date')" :value="toDate(entity?.created)" />
|
<VnLv :label="t('Date')" :value="toDate(entity?.dated)" />
|
||||||
<VnLv :label="$t('Agency')" :value="entity?.agencyMode?.name" />
|
<VnLv :label="t('Agency')" :value="entity?.agencyMode?.name" />
|
||||||
<VnLv :label="$t('Zone')" :value="entity?.zone?.name" />
|
<VnLv :label="t('Zone')" :value="zone" />
|
||||||
<VnLv
|
<VnLv
|
||||||
:label="$t('Volume')"
|
:label="$t('Volume')"
|
||||||
:value="`${dashIfEmpty(entity?.m3)} / ${dashIfEmpty(
|
:value="`${dashIfEmpty(entity?.m3)} / ${dashIfEmpty(
|
||||||
|
|
|
@ -29,6 +29,51 @@ const defaultInitialData = {
|
||||||
};
|
};
|
||||||
const maxDistance = ref();
|
const maxDistance = ref();
|
||||||
|
|
||||||
|
const routeFilter = {
|
||||||
|
fields: [
|
||||||
|
'id',
|
||||||
|
'workerFk',
|
||||||
|
'agencyModeFk',
|
||||||
|
'dated',
|
||||||
|
'm3',
|
||||||
|
'warehouseFk',
|
||||||
|
'description',
|
||||||
|
'vehicleFk',
|
||||||
|
'kmStart',
|
||||||
|
'kmEnd',
|
||||||
|
'started',
|
||||||
|
'finished',
|
||||||
|
'cost',
|
||||||
|
'isOk',
|
||||||
|
],
|
||||||
|
include: [
|
||||||
|
{ relation: 'agencyMode', scope: { fields: ['id', 'name'] } },
|
||||||
|
{
|
||||||
|
relation: 'vehicle',
|
||||||
|
scope: { fields: ['id', 'm3'] },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
relation: 'ticket',
|
||||||
|
scope: {
|
||||||
|
fields: ['id', 'name', 'zoneFk'],
|
||||||
|
include: { relation: 'zone', scope: { fields: ['id', 'name'] } },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
relation: 'worker',
|
||||||
|
scope: {
|
||||||
|
fields: ['id'],
|
||||||
|
include: {
|
||||||
|
relation: 'user',
|
||||||
|
scope: {
|
||||||
|
fields: ['id'],
|
||||||
|
include: { relation: 'emailUser', scope: { fields: ['email'] } },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
const onSave = (data, response) => {
|
const onSave = (data, response) => {
|
||||||
if (isNew) {
|
if (isNew) {
|
||||||
axios.post(`Routes/${response?.id}/updateWorkCenter`);
|
axios.post(`Routes/${response?.id}/updateWorkCenter`);
|
||||||
|
|
|
@ -26,12 +26,7 @@ const entityId = computed(() => {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<CardDescriptor
|
<CardDescriptor :url="`Roadmaps/${entityId}`" :filter="filter" data-key="Roadmap">
|
||||||
module="Roadmap"
|
|
||||||
:url="`Roadmaps/${entityId}`"
|
|
||||||
:filter="filter"
|
|
||||||
data-key="Roadmap"
|
|
||||||
>
|
|
||||||
<template #body="{ entity }">
|
<template #body="{ entity }">
|
||||||
<VnLv :label="t('Roadmap')" :value="entity?.name" />
|
<VnLv :label="t('Roadmap')" :value="entity?.name" />
|
||||||
<VnLv :label="t('ETD')" :value="toDateHourMin(entity?.etd)" />
|
<VnLv :label="t('ETD')" :value="toDateHourMin(entity?.etd)" />
|
||||||
|
|
|
@ -9,7 +9,6 @@ const { notify } = useNotify();
|
||||||
<template>
|
<template>
|
||||||
<CardDescriptor
|
<CardDescriptor
|
||||||
:url="`Vehicles/${$route.params.id}`"
|
:url="`Vehicles/${$route.params.id}`"
|
||||||
module="Vehicle"
|
|
||||||
data-key="Vehicle"
|
data-key="Vehicle"
|
||||||
title="numberPlate"
|
title="numberPlate"
|
||||||
:to-module="{ name: 'VehicleList' }"
|
:to-module="{ name: 'VehicleList' }"
|
||||||
|
|
|
@ -25,7 +25,6 @@ const entityId = computed(() => {
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<CardDescriptor
|
<CardDescriptor
|
||||||
module="Shelving"
|
|
||||||
:url="`Shelvings/${entityId}`"
|
:url="`Shelvings/${entityId}`"
|
||||||
:filter="filter"
|
:filter="filter"
|
||||||
title="code"
|
title="code"
|
||||||
|
|
|
@ -8,6 +8,11 @@ import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
|
|
||||||
const sectors = ref([]);
|
const sectors = ref([]);
|
||||||
const sectorFilter = { fields: ['id', 'description'] };
|
const sectorFilter = { fields: ['id', 'description'] };
|
||||||
|
|
||||||
|
const filter = {
|
||||||
|
fields: ['sectorFk', 'code', 'pickingOrder'],
|
||||||
|
include: [{ relation: 'sector', scope: sectorFilter }],
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<FetchData
|
<FetchData
|
||||||
|
@ -26,10 +31,6 @@ const sectorFilter = { fields: ['id', 'description'] };
|
||||||
:label="$t('parking.pickingOrder')"
|
:label="$t('parking.pickingOrder')"
|
||||||
/>
|
/>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow>
|
|
||||||
<VnInput v-model="data.row" :label="$t('parking.row')" />
|
|
||||||
<VnInput v-model="data.column" :label="$t('parking.column')" />
|
|
||||||
</VnRow>
|
|
||||||
<VnRow>
|
<VnRow>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
v-model="data.sectorFk"
|
v-model="data.sectorFk"
|
||||||
|
|
|
@ -17,7 +17,6 @@ const entityId = computed(() => props.id || route.params.id);
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<CardDescriptor
|
<CardDescriptor
|
||||||
module="Parking"
|
|
||||||
data-key="Parking"
|
data-key="Parking"
|
||||||
:url="`Parkings/${entityId}`"
|
:url="`Parkings/${entityId}`"
|
||||||
title="code"
|
title="code"
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
parking:
|
parking:
|
||||||
pickingOrder: Picking order
|
pickingOrder: Picking order
|
||||||
sector: Sector
|
sector: Sector
|
||||||
row: Row
|
|
||||||
column: Column
|
|
||||||
search: Search parking
|
search: Search parking
|
||||||
searchInfo: You can search by parking code
|
searchInfo: You can search by parking code
|
|
@ -1,7 +1,5 @@
|
||||||
parking:
|
parking:
|
||||||
pickingOrder: Orden de recogida
|
pickingOrder: Orden de recogida
|
||||||
row: Fila
|
|
||||||
sector: Sector
|
sector: Sector
|
||||||
column: Columna
|
|
||||||
search: Buscar parking
|
search: Buscar parking
|
||||||
searchInfo: Puedes buscar por código de parking
|
searchInfo: Puedes buscar por código de parking
|
|
@ -62,7 +62,6 @@ const getEntryQueryParams = (supplier) => {
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<CardDescriptor
|
<CardDescriptor
|
||||||
module="Supplier"
|
|
||||||
:url="`Suppliers/${entityId}`"
|
:url="`Suppliers/${entityId}`"
|
||||||
:filter="filter"
|
:filter="filter"
|
||||||
data-key="Supplier"
|
data-key="Supplier"
|
||||||
|
|
|
@ -44,7 +44,6 @@ function ticketFilter(ticket) {
|
||||||
@on-fetch="(data) => ([problems] = data)"
|
@on-fetch="(data) => ([problems] = data)"
|
||||||
/>
|
/>
|
||||||
<CardDescriptor
|
<CardDescriptor
|
||||||
module="Ticket"
|
|
||||||
:url="`Tickets/${entityId}`"
|
:url="`Tickets/${entityId}`"
|
||||||
:filter="filter"
|
:filter="filter"
|
||||||
data-key="Ticket"
|
data-key="Ticket"
|
||||||
|
|
|
@ -34,7 +34,7 @@ const redirectToCreateView = ({ itemFk }) => {
|
||||||
const columns = computed(() => [
|
const columns = computed(() => [
|
||||||
{
|
{
|
||||||
name: 'date',
|
name: 'date',
|
||||||
align: 'left',
|
align: 'center',
|
||||||
label: t('negative.date'),
|
label: t('negative.date'),
|
||||||
format: ({ timed }) => toDate(timed),
|
format: ({ timed }) => toDate(timed),
|
||||||
sortable: true,
|
sortable: true,
|
||||||
|
@ -47,7 +47,7 @@ const columns = computed(() => [
|
||||||
{
|
{
|
||||||
columnClass: 'shrink',
|
columnClass: 'shrink',
|
||||||
name: 'timed',
|
name: 'timed',
|
||||||
align: 'left',
|
align: 'center',
|
||||||
label: t('negative.timed'),
|
label: t('negative.timed'),
|
||||||
format: ({ timed }) => toHour(timed),
|
format: ({ timed }) => toHour(timed),
|
||||||
sortable: true,
|
sortable: true,
|
||||||
|
@ -58,7 +58,7 @@ const columns = computed(() => [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'itemFk',
|
name: 'itemFk',
|
||||||
align: 'left',
|
align: 'center',
|
||||||
label: t('negative.id'),
|
label: t('negative.id'),
|
||||||
format: ({ itemFk }) => itemFk,
|
format: ({ itemFk }) => itemFk,
|
||||||
sortable: true,
|
sortable: true,
|
||||||
|
@ -70,7 +70,7 @@ const columns = computed(() => [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'longName',
|
name: 'longName',
|
||||||
align: 'left',
|
align: 'center',
|
||||||
label: t('negative.longName'),
|
label: t('negative.longName'),
|
||||||
field: ({ longName }) => longName,
|
field: ({ longName }) => longName,
|
||||||
|
|
||||||
|
@ -81,7 +81,7 @@ const columns = computed(() => [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'producer',
|
name: 'producer',
|
||||||
align: 'left',
|
align: 'center',
|
||||||
label: t('negative.supplier'),
|
label: t('negative.supplier'),
|
||||||
field: ({ producer }) => dashIfEmpty(producer),
|
field: ({ producer }) => dashIfEmpty(producer),
|
||||||
sortable: true,
|
sortable: true,
|
||||||
|
@ -89,7 +89,7 @@ const columns = computed(() => [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'inkFk',
|
name: 'inkFk',
|
||||||
align: 'left',
|
align: 'center',
|
||||||
label: t('negative.colour'),
|
label: t('negative.colour'),
|
||||||
field: ({ inkFk }) => inkFk,
|
field: ({ inkFk }) => inkFk,
|
||||||
sortable: true,
|
sortable: true,
|
||||||
|
@ -97,7 +97,7 @@ const columns = computed(() => [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'size',
|
name: 'size',
|
||||||
align: 'left',
|
align: 'center',
|
||||||
label: t('negative.size'),
|
label: t('negative.size'),
|
||||||
field: ({ size }) => size,
|
field: ({ size }) => size,
|
||||||
sortable: true,
|
sortable: true,
|
||||||
|
@ -110,7 +110,7 @@ const columns = computed(() => [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'category',
|
name: 'category',
|
||||||
align: 'left',
|
align: 'center',
|
||||||
label: t('negative.origen'),
|
label: t('negative.origen'),
|
||||||
field: ({ category }) => dashIfEmpty(category),
|
field: ({ category }) => dashIfEmpty(category),
|
||||||
sortable: true,
|
sortable: true,
|
||||||
|
@ -118,7 +118,7 @@ const columns = computed(() => [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'lack',
|
name: 'lack',
|
||||||
align: 'left',
|
align: 'center',
|
||||||
label: t('negative.lack'),
|
label: t('negative.lack'),
|
||||||
field: ({ lack }) => lack,
|
field: ({ lack }) => lack,
|
||||||
columnFilter: {
|
columnFilter: {
|
||||||
|
@ -127,12 +127,12 @@ const columns = computed(() => [
|
||||||
columnClass: 'shrink',
|
columnClass: 'shrink',
|
||||||
},
|
},
|
||||||
sortable: true,
|
sortable: true,
|
||||||
headerStyle: 'padding-left: 33px',
|
headerStyle: 'padding-center: 33px',
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'tableActions',
|
name: 'tableActions',
|
||||||
align: 'left',
|
align: 'center',
|
||||||
actions: [
|
actions: [
|
||||||
{
|
{
|
||||||
title: t('Open details'),
|
title: t('Open details'),
|
||||||
|
|
|
@ -52,27 +52,26 @@ const route = useRoute();
|
||||||
const columns = computed(() => [
|
const columns = computed(() => [
|
||||||
{
|
{
|
||||||
name: 'status',
|
name: 'status',
|
||||||
align: 'left',
|
align: 'center',
|
||||||
sortable: false,
|
sortable: false,
|
||||||
columnClass: 'expand',
|
columnClass: 'shrink',
|
||||||
columnFilter: false,
|
columnFilter: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'ticketFk',
|
name: 'ticketFk',
|
||||||
label: t('negative.detail.ticketFk'),
|
label: t('negative.detail.ticketFk'),
|
||||||
align: 'left',
|
align: 'center',
|
||||||
sortable: true,
|
sortable: true,
|
||||||
columnFilter: {
|
columnFilter: {
|
||||||
component: 'input',
|
component: 'input',
|
||||||
type: 'number',
|
type: 'number',
|
||||||
},
|
},
|
||||||
columnClass: 'shrink',
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'shipped',
|
name: 'shipped',
|
||||||
label: t('negative.detail.shipped'),
|
label: t('negative.detail.shipped'),
|
||||||
field: 'shipped',
|
field: 'shipped',
|
||||||
align: 'left',
|
align: 'center',
|
||||||
format: ({ shipped }) => toDate(shipped),
|
format: ({ shipped }) => toDate(shipped),
|
||||||
sortable: true,
|
sortable: true,
|
||||||
columnFilter: {
|
columnFilter: {
|
||||||
|
@ -84,11 +83,9 @@ const columns = computed(() => [
|
||||||
name: 'minTimed',
|
name: 'minTimed',
|
||||||
label: t('negative.detail.theoreticalhour'),
|
label: t('negative.detail.theoreticalhour'),
|
||||||
field: 'minTimed',
|
field: 'minTimed',
|
||||||
align: 'left',
|
align: 'center',
|
||||||
format: ({ minTimed }) => toHour(minTimed),
|
|
||||||
sortable: true,
|
sortable: true,
|
||||||
component: 'time',
|
component: 'time',
|
||||||
columnClass: 'shrink',
|
|
||||||
columnFilter: {},
|
columnFilter: {},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -104,29 +101,27 @@ const columns = computed(() => [
|
||||||
optionValue: 'code',
|
optionValue: 'code',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
columnClass: 'expand',
|
align: 'center',
|
||||||
align: 'left',
|
|
||||||
sortable: true,
|
sortable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'zoneName',
|
name: 'zoneName',
|
||||||
label: t('negative.detail.zoneName'),
|
label: t('negative.detail.zoneName'),
|
||||||
field: 'zoneName',
|
field: 'zoneName',
|
||||||
align: 'left',
|
align: 'center',
|
||||||
sortable: true,
|
sortable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'nickname',
|
name: 'nickname',
|
||||||
label: t('negative.detail.nickname'),
|
label: t('negative.detail.nickname'),
|
||||||
field: 'nickname',
|
field: 'nickname',
|
||||||
align: 'left',
|
align: 'center',
|
||||||
sortable: true,
|
sortable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'quantity',
|
name: 'quantity',
|
||||||
label: t('negative.detail.quantity'),
|
label: t('negative.detail.quantity'),
|
||||||
field: 'quantity',
|
field: 'quantity',
|
||||||
align: 'left',
|
|
||||||
sortable: true,
|
sortable: true,
|
||||||
component: 'input',
|
component: 'input',
|
||||||
type: 'number',
|
type: 'number',
|
||||||
|
@ -167,7 +162,6 @@ const saveChange = async (field, { row }) => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const hasToIgnore = (row) => row.hasToIgnore === 1;
|
|
||||||
function onBuysFetched(data) {
|
function onBuysFetched(data) {
|
||||||
Object.assign(item.value, data[0]);
|
Object.assign(item.value, data[0]);
|
||||||
}
|
}
|
||||||
|
@ -244,7 +238,7 @@ function onBuysFetched(data) {
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #column-status="{ row }">
|
<template #column-status="{ row }">
|
||||||
<QTd style="width: 150px">
|
<QTd style="min-width: 150px">
|
||||||
<div class="icon-container">
|
<div class="icon-container">
|
||||||
<QIcon
|
<QIcon
|
||||||
v-if="row.isBasket"
|
v-if="row.isBasket"
|
||||||
|
|
|
@ -1,19 +1,16 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onMounted, ref, computed, reactive } from 'vue';
|
import { ref, computed, reactive, watch } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
|
||||||
import FetchData from 'components/FetchData.vue';
|
|
||||||
import VnInput from 'src/components/common/VnInput.vue';
|
|
||||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
|
||||||
import TicketDescriptorProxy from 'src/pages/Ticket/Card/TicketDescriptorProxy.vue';
|
import TicketDescriptorProxy from 'src/pages/Ticket/Card/TicketDescriptorProxy.vue';
|
||||||
import VnSubToolbar from 'src/components/ui/VnSubToolbar.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 RightMenu from 'src/components/common/RightMenu.vue';
|
import RightMenu from 'src/components/common/RightMenu.vue';
|
||||||
|
import VnTable from 'src/components/VnTable/VnTable.vue';
|
||||||
import TicketFutureFilter from './TicketFutureFilter.vue';
|
import TicketFutureFilter from './TicketFutureFilter.vue';
|
||||||
|
|
||||||
import { dashIfEmpty, toCurrency } from 'src/filters';
|
import { dashIfEmpty, toCurrency } from 'src/filters';
|
||||||
import { useVnConfirm } from 'composables/useVnConfirm';
|
import { useVnConfirm } from 'composables/useVnConfirm';
|
||||||
import { useArrayData } from 'composables/useArrayData';
|
|
||||||
import { getDateQBadgeColor } from 'src/composables/getDateQBadgeColor.js';
|
import { getDateQBadgeColor } from 'src/composables/getDateQBadgeColor.js';
|
||||||
import useNotify from 'src/composables/useNotify.js';
|
import useNotify from 'src/composables/useNotify.js';
|
||||||
import { useState } from 'src/composables/useState';
|
import { useState } from 'src/composables/useState';
|
||||||
|
@ -26,214 +23,126 @@ const { openConfirmationModal } = useVnConfirm();
|
||||||
const { notify } = useNotify();
|
const { notify } = useNotify();
|
||||||
const user = state.getUser();
|
const user = state.getUser();
|
||||||
|
|
||||||
const itemPackingTypesOptions = ref([]);
|
|
||||||
const selectedTickets = ref([]);
|
const selectedTickets = ref([]);
|
||||||
|
const vnTableRef = ref({});
|
||||||
const exprBuilder = (param, value) => {
|
const originElRef = ref(null);
|
||||||
switch (param) {
|
const destinationElRef = ref(null);
|
||||||
case 'id':
|
|
||||||
return { id: value };
|
|
||||||
case 'futureId':
|
|
||||||
return { futureId: value };
|
|
||||||
case 'liters':
|
|
||||||
return { liters: value };
|
|
||||||
case 'lines':
|
|
||||||
return { lines: value };
|
|
||||||
case 'iptColFilter':
|
|
||||||
return { ipt: { like: `%${value}%` } };
|
|
||||||
case 'futureIptColFilter':
|
|
||||||
return { futureIpt: { like: `%${value}%` } };
|
|
||||||
case 'totalWithVat':
|
|
||||||
return { totalWithVat: value };
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const userParams = reactive({
|
const userParams = reactive({
|
||||||
futureScopeDays: Date.vnNew().toISOString(),
|
futureScopeDays: Date.vnNew().toISOString(),
|
||||||
originScopeDays: Date.vnNew().toISOString(),
|
originScopeDays: Date.vnNew().toISOString(),
|
||||||
warehouseFk: user.value.warehouseFk,
|
warehouseFk: user.value.warehouseFk,
|
||||||
});
|
});
|
||||||
|
|
||||||
const arrayData = useArrayData('FutureTickets', {
|
|
||||||
url: 'Tickets/getTicketsFuture',
|
|
||||||
userParams: userParams,
|
|
||||||
exprBuilder: exprBuilder,
|
|
||||||
});
|
|
||||||
const { store } = arrayData;
|
|
||||||
|
|
||||||
const params = reactive({
|
|
||||||
futureScopeDays: Date.vnNew(),
|
|
||||||
originScopeDays: Date.vnNew(),
|
|
||||||
warehouseFk: user.value.warehouseFk,
|
|
||||||
});
|
|
||||||
|
|
||||||
const applyColumnFilter = async (col) => {
|
|
||||||
const paramKey = col.columnFilter?.filterParamKey || col.field;
|
|
||||||
params[paramKey] = col.columnFilter.filterValue;
|
|
||||||
await arrayData.addFilter({ params });
|
|
||||||
};
|
|
||||||
|
|
||||||
const getInputEvents = (col) => {
|
|
||||||
return col.columnFilter.type === 'select'
|
|
||||||
? { 'update:modelValue': () => applyColumnFilter(col) }
|
|
||||||
: {
|
|
||||||
'keyup.enter': () => applyColumnFilter(col),
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
const tickets = computed(() => store.data);
|
|
||||||
|
|
||||||
const ticketColumns = computed(() => [
|
const ticketColumns = computed(() => [
|
||||||
{
|
{
|
||||||
label: t('futureTickets.problems'),
|
label: '',
|
||||||
name: 'problems',
|
name: 'problems',
|
||||||
|
headerClass: 'horizontal-separator',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
columnFilter: null,
|
columnFilter: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('advanceTickets.ticketId'),
|
label: t('advanceTickets.ticketId'),
|
||||||
name: 'ticketId',
|
name: 'id',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
sortable: true,
|
headerClass: 'horizontal-separator',
|
||||||
columnFilter: {
|
|
||||||
component: VnInput,
|
|
||||||
type: 'text',
|
|
||||||
filterValue: null,
|
|
||||||
filterParamKey: 'id',
|
|
||||||
event: getInputEvents,
|
|
||||||
attrs: {
|
|
||||||
dense: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('futureTickets.shipped'),
|
label: t('futureTickets.shipped'),
|
||||||
name: 'shipped',
|
name: 'shipped',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
sortable: true,
|
columnFilter: false,
|
||||||
columnFilter: null,
|
headerClass: 'horizontal-separator',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
align: 'center',
|
||||||
|
class: 'shrink',
|
||||||
label: t('advanceTickets.ipt'),
|
label: t('advanceTickets.ipt'),
|
||||||
name: 'ipt',
|
name: 'ipt',
|
||||||
field: 'ipt',
|
|
||||||
align: 'left',
|
|
||||||
sortable: true,
|
|
||||||
columnFilter: {
|
columnFilter: {
|
||||||
component: VnSelect,
|
component: 'select',
|
||||||
filterParamKey: 'iptColFilter',
|
|
||||||
type: 'select',
|
|
||||||
filterValue: null,
|
|
||||||
event: getInputEvents,
|
|
||||||
attrs: {
|
attrs: {
|
||||||
options: itemPackingTypesOptions.value,
|
url: 'itemPackingTypes',
|
||||||
'option-value': 'code',
|
fields: ['code', 'description'],
|
||||||
'option-label': 'description',
|
where: { isActive: true },
|
||||||
dense: true,
|
optionValue: 'code',
|
||||||
|
optionLabel: 'description',
|
||||||
|
inWhere: false,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
format: (val) => dashIfEmpty(val),
|
format: (row, dashIfEmpty) => dashIfEmpty(row.ipt),
|
||||||
|
headerClass: 'horizontal-separator',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('ticketList.state'),
|
label: t('ticketList.state'),
|
||||||
name: 'state',
|
name: 'state',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
sortable: true,
|
columnFilter: false,
|
||||||
columnFilter: null,
|
headerClass: 'horizontal-separator',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('advanceTickets.liters'),
|
label: t('advanceTickets.liters'),
|
||||||
name: 'liters',
|
name: 'liters',
|
||||||
field: 'liters',
|
|
||||||
align: 'left',
|
align: 'left',
|
||||||
sortable: true,
|
headerClass: 'horizontal-separator',
|
||||||
columnFilter: {
|
|
||||||
component: VnInput,
|
|
||||||
type: 'text',
|
|
||||||
filterValue: null,
|
|
||||||
event: getInputEvents,
|
|
||||||
attrs: {
|
|
||||||
dense: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('advanceTickets.import'),
|
label: t('advanceTickets.import'),
|
||||||
field: 'import',
|
|
||||||
name: 'import',
|
name: 'import',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
sortable: true,
|
headerClass: 'horizontal-separator',
|
||||||
|
columnFilter: false,
|
||||||
|
format: (row) => toCurrency(row.totalWithVat),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('futureTickets.availableLines'),
|
label: t('futureTickets.availableLines'),
|
||||||
name: 'lines',
|
name: 'lines',
|
||||||
field: 'lines',
|
field: 'lines',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
sortable: true,
|
headerClass: 'horizontal-separator',
|
||||||
columnFilter: {
|
format: (row, dashIfEmpty) => dashIfEmpty(row.lines),
|
||||||
component: VnInput,
|
|
||||||
type: 'text',
|
|
||||||
filterValue: null,
|
|
||||||
event: getInputEvents,
|
|
||||||
attrs: {
|
|
||||||
dense: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
format: (val) => dashIfEmpty(val),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('advanceTickets.futureId'),
|
label: t('advanceTickets.futureId'),
|
||||||
name: 'futureId',
|
name: 'futureId',
|
||||||
align: 'left',
|
align: 'center',
|
||||||
sortable: true,
|
headerClass: 'horizontal-separator vertical-separator ',
|
||||||
columnFilter: {
|
columnClass: 'vertical-separator',
|
||||||
component: VnInput,
|
|
||||||
type: 'text',
|
|
||||||
filterValue: null,
|
|
||||||
filterParamKey: 'futureId',
|
|
||||||
event: getInputEvents,
|
|
||||||
attrs: {
|
|
||||||
dense: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('futureTickets.futureShipped'),
|
label: t('futureTickets.futureShipped'),
|
||||||
name: 'futureShipped',
|
name: 'futureShipped',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
sortable: true,
|
headerClass: 'horizontal-separator',
|
||||||
columnFilter: null,
|
columnFilter: false,
|
||||||
format: (val) => dashIfEmpty(val),
|
format: (row) => toDateTimeFormat(row.futureShipped),
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
|
align: 'center',
|
||||||
label: t('advanceTickets.futureIpt'),
|
label: t('advanceTickets.futureIpt'),
|
||||||
|
class: 'shrink',
|
||||||
name: 'futureIpt',
|
name: 'futureIpt',
|
||||||
field: 'futureIpt',
|
|
||||||
align: 'left',
|
|
||||||
sortable: true,
|
|
||||||
columnFilter: {
|
columnFilter: {
|
||||||
component: VnSelect,
|
component: 'select',
|
||||||
filterParamKey: 'futureIptColFilter',
|
|
||||||
type: 'select',
|
|
||||||
filterValue: null,
|
|
||||||
event: getInputEvents,
|
|
||||||
attrs: {
|
attrs: {
|
||||||
options: itemPackingTypesOptions.value,
|
url: 'itemPackingTypes',
|
||||||
'option-value': 'code',
|
fields: ['code', 'description'],
|
||||||
'option-label': 'description',
|
where: { isActive: true },
|
||||||
dense: true,
|
optionValue: 'code',
|
||||||
|
optionLabel: 'description',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
format: (val) => dashIfEmpty(val),
|
headerClass: 'horizontal-separator',
|
||||||
|
format: (row, dashIfEmpty) => dashIfEmpty(row.futureIpt),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('advanceTickets.futureState'),
|
label: t('advanceTickets.futureState'),
|
||||||
name: 'futureState',
|
name: 'futureState',
|
||||||
align: 'right',
|
align: 'right',
|
||||||
sortable: true,
|
headerClass: 'horizontal-separator',
|
||||||
columnFilter: null,
|
class: 'expand',
|
||||||
format: (val) => dashIfEmpty(val),
|
columnFilter: false,
|
||||||
|
format: (row, dashIfEmpty) => dashIfEmpty(row.futureState),
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
@ -258,26 +167,51 @@ const moveTicketsFuture = async () => {
|
||||||
await axios.post('Tickets/merge', params);
|
await axios.post('Tickets/merge', params);
|
||||||
notify(t('advanceTickets.moveTicketSuccess'), 'positive');
|
notify(t('advanceTickets.moveTicketSuccess'), 'positive');
|
||||||
selectedTickets.value = [];
|
selectedTickets.value = [];
|
||||||
arrayData.fetch({ append: false });
|
vnTableRef.value.reload();
|
||||||
};
|
};
|
||||||
onMounted(async () => {
|
|
||||||
await arrayData.fetch({ append: false });
|
watch(
|
||||||
});
|
() => vnTableRef.value.tableRef?.$el,
|
||||||
|
($el) => {
|
||||||
|
if (!$el) return;
|
||||||
|
const head = $el.querySelector('thead');
|
||||||
|
const firstRow = $el.querySelector('thead > tr');
|
||||||
|
|
||||||
|
const newRow = document.createElement('tr');
|
||||||
|
destinationElRef.value = document.createElement('th');
|
||||||
|
originElRef.value = document.createElement('th');
|
||||||
|
|
||||||
|
newRow.classList.add('bg-header');
|
||||||
|
destinationElRef.value.classList.add('text-uppercase', 'color-vn-label');
|
||||||
|
originElRef.value.classList.add('text-uppercase', 'color-vn-label');
|
||||||
|
|
||||||
|
destinationElRef.value.setAttribute('colspan', '7');
|
||||||
|
originElRef.value.setAttribute('colspan', '9');
|
||||||
|
|
||||||
|
originElRef.value.textContent = `${t('advanceTickets.origin')}`;
|
||||||
|
destinationElRef.value.textContent = `${t('advanceTickets.destination')}`;
|
||||||
|
|
||||||
|
newRow.append(destinationElRef.value, originElRef.value);
|
||||||
|
head.insertBefore(newRow, firstRow);
|
||||||
|
},
|
||||||
|
{ once: true, inmmediate: true },
|
||||||
|
);
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => vnTableRef.value.params,
|
||||||
|
() => {
|
||||||
|
if (originElRef.value && destinationElRef.value) {
|
||||||
|
destinationElRef.value.textContent = `${t('advanceTickets.origin')}`;
|
||||||
|
originElRef.value.textContent = `${t('advanceTickets.destination')}`;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ deep: true },
|
||||||
|
);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<FetchData
|
|
||||||
url="itemPackingTypes"
|
|
||||||
:filter="{
|
|
||||||
fields: ['code', 'description'],
|
|
||||||
order: 'description ASC',
|
|
||||||
where: { isActive: true },
|
|
||||||
}"
|
|
||||||
auto-load
|
|
||||||
@on-fetch="(data) => (itemPackingTypesOptions = data)"
|
|
||||||
/>
|
|
||||||
<VnSearchbar
|
<VnSearchbar
|
||||||
data-key="FutureTickets"
|
data-key="futureTicket"
|
||||||
:label="t('Search ticket')"
|
:label="t('Search ticket')"
|
||||||
:info="t('futureTickets.searchInfo')"
|
:info="t('futureTickets.searchInfo')"
|
||||||
/>
|
/>
|
||||||
|
@ -293,7 +227,7 @@ onMounted(async () => {
|
||||||
t(`futureTickets.moveTicketDialogSubtitle`, {
|
t(`futureTickets.moveTicketDialogSubtitle`, {
|
||||||
selectedTickets: selectedTickets.length,
|
selectedTickets: selectedTickets.length,
|
||||||
}),
|
}),
|
||||||
moveTicketsFuture
|
moveTicketsFuture,
|
||||||
)
|
)
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
|
@ -305,77 +239,29 @@ onMounted(async () => {
|
||||||
</VnSubToolbar>
|
</VnSubToolbar>
|
||||||
<RightMenu>
|
<RightMenu>
|
||||||
<template #right-panel>
|
<template #right-panel>
|
||||||
<TicketFutureFilter data-key="FutureTickets" />
|
<TicketFutureFilter data-key="futureTickets" />
|
||||||
</template>
|
</template>
|
||||||
</RightMenu>
|
</RightMenu>
|
||||||
<QPage class="column items-center q-pa-md">
|
<QPage class="column items-center q-pa-md">
|
||||||
<QTable
|
<VnTable
|
||||||
:rows="tickets"
|
data-key="futureTickets"
|
||||||
|
ref="vnTableRef"
|
||||||
|
url="Tickets/getTicketsFuture"
|
||||||
|
search-url="futureTickets"
|
||||||
|
:user-params="userParams"
|
||||||
|
:limit="0"
|
||||||
:columns="ticketColumns"
|
:columns="ticketColumns"
|
||||||
row-key="id"
|
:table="{
|
||||||
selection="multiple"
|
'row-key': '$index',
|
||||||
|
selection: 'multiple',
|
||||||
|
}"
|
||||||
v-model:selected="selectedTickets"
|
v-model:selected="selectedTickets"
|
||||||
:pagination="{ rowsPerPage: 0 }"
|
:right-search="false"
|
||||||
:no-data-label="t('globals.noResults')"
|
auto-load
|
||||||
style="max-width: 99%"
|
:disable-option="{ card: true }"
|
||||||
>
|
>
|
||||||
<template #header="props">
|
<template #column-problems="{ row }">
|
||||||
<QTr>
|
<span class="q-gutter-x-xs">
|
||||||
<QTh class="horizontal-separator" />
|
|
||||||
<QTh
|
|
||||||
class="horizontal-separator text-uppercase color-vn-label"
|
|
||||||
colspan="8"
|
|
||||||
translate
|
|
||||||
>
|
|
||||||
{{ t('advanceTickets.origin') }}
|
|
||||||
</QTh>
|
|
||||||
<QTh
|
|
||||||
class="horizontal-separator text-uppercase color-vn-label"
|
|
||||||
colspan="4"
|
|
||||||
translate
|
|
||||||
>
|
|
||||||
{{ t('advanceTickets.destination') }}
|
|
||||||
</QTh>
|
|
||||||
</QTr>
|
|
||||||
<QTr>
|
|
||||||
<QTh>
|
|
||||||
<QCheckbox v-model="props.selected" />
|
|
||||||
</QTh>
|
|
||||||
<QTh
|
|
||||||
v-for="(col, index) in ticketColumns"
|
|
||||||
:key="index"
|
|
||||||
:class="{ 'vertical-separator': col.name === 'futureId' }"
|
|
||||||
>
|
|
||||||
{{ col.label }}
|
|
||||||
</QTh>
|
|
||||||
</QTr>
|
|
||||||
</template>
|
|
||||||
<template #top-row="{ cols }">
|
|
||||||
<QTr>
|
|
||||||
<QTd />
|
|
||||||
<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 #header-cell-availableLines="{ col }">
|
|
||||||
<QTh class="vertical-separator">
|
|
||||||
{{ col.label }}
|
|
||||||
</QTh>
|
|
||||||
</template>
|
|
||||||
<template #body-cell-problems="{ row }">
|
|
||||||
<QTd class="q-gutter-x-xs">
|
|
||||||
<QIcon
|
<QIcon
|
||||||
v-if="row.futureAgencyFk !== row.agencyFk && row.agencyFk"
|
v-if="row.futureAgencyFk !== row.agencyFk && row.agencyFk"
|
||||||
color="primary"
|
color="primary"
|
||||||
|
@ -465,99 +351,87 @@ onMounted(async () => {
|
||||||
{{ t('futureTickets.rounding') }}
|
{{ t('futureTickets.rounding') }}
|
||||||
</QTooltip>
|
</QTooltip>
|
||||||
</QIcon>
|
</QIcon>
|
||||||
</QTd>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-ticketId="{ row }">
|
<template #column-id="{ row }">
|
||||||
<QTd>
|
<QBtn flat class="link" @click.stop dense>
|
||||||
<QBtn flat class="link">
|
{{ row.id }}
|
||||||
{{ row.id }}
|
<TicketDescriptorProxy :id="row.id" />
|
||||||
<TicketDescriptorProxy :id="row.id" />
|
</QBtn>
|
||||||
</QBtn>
|
|
||||||
</QTd>
|
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-shipped="{ row }">
|
<template #column-shipped="{ row }">
|
||||||
<QTd class="shipped">
|
<QBadge
|
||||||
<QBadge
|
text-color="black"
|
||||||
text-color="black"
|
:color="getDateQBadgeColor(row.shipped)"
|
||||||
:color="getDateQBadgeColor(row.shipped)"
|
class="q-ma-none"
|
||||||
class="q-ma-none"
|
>
|
||||||
>
|
{{ toDateTimeFormat(row.shipped) }}
|
||||||
{{ toDateTimeFormat(row.shipped) }}
|
</QBadge>
|
||||||
</QBadge>
|
|
||||||
</QTd>
|
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-state="{ row }">
|
<template #column-state="{ row }">
|
||||||
<QTd>
|
<QBadge
|
||||||
<QBadge
|
v-if="row.state"
|
||||||
text-color="black"
|
text-color="black"
|
||||||
:color="row.classColor"
|
:color="row.classColor"
|
||||||
class="q-ma-none"
|
class="q-ma-none"
|
||||||
dense
|
dense
|
||||||
>
|
>
|
||||||
{{ row.state }}
|
{{ row.state }}
|
||||||
</QBadge>
|
</QBadge>
|
||||||
</QTd>
|
<span v-else> {{ dashIfEmpty(row.state) }}</span>
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-import="{ row }">
|
<template #column-import="{ row }">
|
||||||
<QTd>
|
<QBadge
|
||||||
<QBadge
|
:text-color="
|
||||||
:text-color="
|
totalPriceColor(row.totalWithVat) === 'warning'
|
||||||
totalPriceColor(row.totalWithVat) === 'warning'
|
? 'black'
|
||||||
? 'black'
|
: 'white'
|
||||||
: 'white'
|
"
|
||||||
"
|
:color="totalPriceColor(row.totalWithVat)"
|
||||||
:color="totalPriceColor(row.totalWithVat)"
|
class="q-ma-none"
|
||||||
class="q-ma-none"
|
dense
|
||||||
dense
|
>
|
||||||
>
|
{{ toCurrency(row.totalWithVat || 0) }}
|
||||||
{{ toCurrency(row.totalWithVat || 0) }}
|
</QBadge>
|
||||||
</QBadge>
|
|
||||||
</QTd>
|
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-futureId="{ row }">
|
<template #column-futureId="{ row }">
|
||||||
<QTd class="vertical-separator">
|
<QBtn flat class="link" @click.stop dense>
|
||||||
<QBtn flat class="link" dense>
|
{{ row.futureId }}
|
||||||
{{ row.futureId }}
|
<TicketDescriptorProxy :id="row.futureId" />
|
||||||
<TicketDescriptorProxy :id="row.futureId" />
|
</QBtn>
|
||||||
</QBtn>
|
|
||||||
</QTd>
|
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-futureShipped="{ row }">
|
<template #column-futureShipped="{ row }">
|
||||||
<QTd class="shipped">
|
<QBadge
|
||||||
<QBadge
|
text-color="black"
|
||||||
text-color="black"
|
:color="getDateQBadgeColor(row.futureShipped)"
|
||||||
:color="getDateQBadgeColor(row.futureShipped)"
|
class="q-ma-none"
|
||||||
class="q-ma-none"
|
>
|
||||||
>
|
{{ toDateTimeFormat(row.futureShipped) }}
|
||||||
{{ toDateTimeFormat(row.futureShipped) }}
|
</QBadge>
|
||||||
</QBadge>
|
|
||||||
</QTd>
|
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-futureState="{ row }">
|
<template #column-futureState="{ row }">
|
||||||
<QTd>
|
<QBadge
|
||||||
<QBadge
|
text-color="black"
|
||||||
text-color="black"
|
:color="row.futureClassColor"
|
||||||
:color="row.futureClassColor"
|
class="q-mr-xs"
|
||||||
class="q-ma-none"
|
dense
|
||||||
dense
|
>
|
||||||
>
|
{{ row.futureState }}
|
||||||
{{ row.futureState }}
|
</QBadge>
|
||||||
</QBadge>
|
|
||||||
</QTd>
|
|
||||||
</template>
|
</template>
|
||||||
</QTable>
|
</VnTable>
|
||||||
</QPage>
|
</QPage>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.shipped {
|
:deep(.vertical-separator) {
|
||||||
min-width: 132px;
|
|
||||||
}
|
|
||||||
.vertical-separator {
|
|
||||||
border-left: 4px solid white !important;
|
border-left: 4px solid white !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.horizontal-separator {
|
:deep(.horizontal-separator) {
|
||||||
|
border-top: 4px solid white !important;
|
||||||
|
}
|
||||||
|
:deep(.horizontal-bottom-separator) {
|
||||||
border-bottom: 4px solid white !important;
|
border-bottom: 4px solid white !important;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -12,7 +12,7 @@ import axios from 'axios';
|
||||||
import { onMounted } from 'vue';
|
import { onMounted } from 'vue';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const props = defineProps({
|
defineProps({
|
||||||
dataKey: {
|
dataKey: {
|
||||||
type: String,
|
type: String,
|
||||||
required: true,
|
required: true,
|
||||||
|
@ -58,7 +58,7 @@ onMounted(async () => {
|
||||||
auto-load
|
auto-load
|
||||||
/>
|
/>
|
||||||
<VnFilterPanel
|
<VnFilterPanel
|
||||||
:data-key="props.dataKey"
|
:data-key
|
||||||
:un-removable-params="['warehouseFk', 'originScopeDays ', 'futureScopeDays']"
|
:un-removable-params="['warehouseFk', 'originScopeDays ', 'futureScopeDays']"
|
||||||
>
|
>
|
||||||
<template #tags="{ tag, formatFn }">
|
<template #tags="{ tag, formatFn }">
|
||||||
|
|
|
@ -232,7 +232,7 @@ const columns = computed(() => [
|
||||||
|
|
||||||
function resetAgenciesSelector(formData) {
|
function resetAgenciesSelector(formData) {
|
||||||
agenciesOptions.value = [];
|
agenciesOptions.value = [];
|
||||||
if(formData) formData.agencyModeId = null;
|
if (formData) formData.agencyModeId = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
function redirectToLines(id) {
|
function redirectToLines(id) {
|
||||||
|
@ -240,7 +240,7 @@ function redirectToLines(id) {
|
||||||
window.open(url, '_blank');
|
window.open(url, '_blank');
|
||||||
}
|
}
|
||||||
|
|
||||||
const onClientSelected = async (formData) => {
|
const onClientSelected = async (formData) => {
|
||||||
resetAgenciesSelector(formData);
|
resetAgenciesSelector(formData);
|
||||||
await fetchClient(formData);
|
await fetchClient(formData);
|
||||||
await fetchAddresses(formData);
|
await fetchAddresses(formData);
|
||||||
|
@ -248,14 +248,12 @@ const onClientSelected = async (formData) => {
|
||||||
|
|
||||||
const fetchAvailableAgencies = async (formData) => {
|
const fetchAvailableAgencies = async (formData) => {
|
||||||
resetAgenciesSelector(formData);
|
resetAgenciesSelector(formData);
|
||||||
const response= await getAgencies(formData, selectedClient.value);
|
const response = await getAgencies(formData, selectedClient.value);
|
||||||
if (!response) return;
|
if (!response) return;
|
||||||
|
|
||||||
const { options, agency } = response
|
const { options, agency } = response;
|
||||||
if(options)
|
if (options) agenciesOptions.value = options;
|
||||||
agenciesOptions.value = options;
|
if (agency) formData.agencyModeId = agency;
|
||||||
if(agency)
|
|
||||||
formData.agencyModeId = agency;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const fetchClient = async (formData) => {
|
const fetchClient = async (formData) => {
|
||||||
|
@ -330,7 +328,7 @@ function openBalanceDialog(ticket) {
|
||||||
const description = ref([]);
|
const description = ref([]);
|
||||||
const firstTicketClientId = checkedTickets[0].clientFk;
|
const firstTicketClientId = checkedTickets[0].clientFk;
|
||||||
const isSameClient = checkedTickets.every(
|
const isSameClient = checkedTickets.every(
|
||||||
(ticket) => ticket.clientFk === firstTicketClientId
|
(ticket) => ticket.clientFk === firstTicketClientId,
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!isSameClient) {
|
if (!isSameClient) {
|
||||||
|
@ -369,7 +367,7 @@ async function onSubmit() {
|
||||||
description: dialogData.value.value.description,
|
description: dialogData.value.value.description,
|
||||||
clientFk: dialogData.value.value.clientFk,
|
clientFk: dialogData.value.value.clientFk,
|
||||||
email: email[0].email,
|
email: email[0].email,
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
if (data) notify('globals.dataSaved', 'positive');
|
if (data) notify('globals.dataSaved', 'positive');
|
||||||
|
@ -388,32 +386,32 @@ function setReference(data) {
|
||||||
switch (data) {
|
switch (data) {
|
||||||
case 1:
|
case 1:
|
||||||
newDescription = `${t(
|
newDescription = `${t(
|
||||||
'ticketList.creditCard'
|
'ticketList.creditCard',
|
||||||
)}, ${dialogData.value.value.description.replace(
|
)}, ${dialogData.value.value.description.replace(
|
||||||
/^(Credit Card, |Cash, |Transfers, )/,
|
/^(Credit Card, |Cash, |Transfers, )/,
|
||||||
''
|
'',
|
||||||
)}`;
|
)}`;
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
newDescription = `${t(
|
newDescription = `${t(
|
||||||
'ticketList.cash'
|
'ticketList.cash',
|
||||||
)}, ${dialogData.value.value.description.replace(
|
)}, ${dialogData.value.value.description.replace(
|
||||||
/^(Credit Card, |Cash, |Transfers, )/,
|
/^(Credit Card, |Cash, |Transfers, )/,
|
||||||
''
|
'',
|
||||||
)}`;
|
)}`;
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
newDescription = `${newDescription.replace(
|
newDescription = `${newDescription.replace(
|
||||||
/^(Credit Card, |Cash, |Transfers, )/,
|
/^(Credit Card, |Cash, |Transfers, )/,
|
||||||
''
|
'',
|
||||||
)}`;
|
)}`;
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
newDescription = `${t(
|
newDescription = `${t(
|
||||||
'ticketList.transfers'
|
'ticketList.transfers',
|
||||||
)}, ${dialogData.value.value.description.replace(
|
)}, ${dialogData.value.value.description.replace(
|
||||||
/^(Credit Card, |Cash, |Transfers, )/,
|
/^(Credit Card, |Cash, |Transfers, )/,
|
||||||
''
|
'',
|
||||||
)}`;
|
)}`;
|
||||||
break;
|
break;
|
||||||
case 3317:
|
case 3317:
|
||||||
|
|
|
@ -32,7 +32,6 @@ const setData = (entity) => (data.value = useCardDescription(entity.ref, entity.
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<CardDescriptor
|
<CardDescriptor
|
||||||
module="Travel"
|
|
||||||
:url="`Travels/${entityId}`"
|
:url="`Travels/${entityId}`"
|
||||||
:title="data.title"
|
:title="data.title"
|
||||||
:subtitle="data.subtitle"
|
:subtitle="data.subtitle"
|
||||||
|
|
|
@ -50,7 +50,6 @@ const handlePhotoUpdated = (evt = false) => {
|
||||||
<template>
|
<template>
|
||||||
<CardDescriptor
|
<CardDescriptor
|
||||||
ref="cardDescriptorRef"
|
ref="cardDescriptorRef"
|
||||||
module="Worker"
|
|
||||||
:data-key="dataKey"
|
:data-key="dataKey"
|
||||||
url="Workers/summary"
|
url="Workers/summary"
|
||||||
:filter="{ where: { id: entityId } }"
|
:filter="{ where: { id: entityId } }"
|
||||||
|
|
|
@ -12,11 +12,6 @@ const $props = defineProps({
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<QPopupProxy>
|
<QPopupProxy>
|
||||||
<WorkerDescriptor
|
<WorkerDescriptor v-if="$props.id" :id="$props.id" :summary="WorkerSummary" />
|
||||||
v-if="$props.id"
|
|
||||||
:id="$props.id"
|
|
||||||
:summary="WorkerSummary"
|
|
||||||
data-key="workerDescriptorProxy"
|
|
||||||
/>
|
|
||||||
</QPopupProxy>
|
</QPopupProxy>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -42,7 +42,6 @@ const { openConfirmationModal } = useVnConfirm();
|
||||||
<template>
|
<template>
|
||||||
<CardDescriptor
|
<CardDescriptor
|
||||||
ref="DepartmentDescriptorRef"
|
ref="DepartmentDescriptorRef"
|
||||||
module="Department"
|
|
||||||
:url="`Departments/${entityId}`"
|
:url="`Departments/${entityId}`"
|
||||||
:summary="$props.summary"
|
:summary="$props.summary"
|
||||||
:to-module="{ name: 'WorkerDepartment' }"
|
:to-module="{ name: 'WorkerDepartment' }"
|
||||||
|
|
|
@ -31,20 +31,18 @@ onMounted(async () => {
|
||||||
ref="summary"
|
ref="summary"
|
||||||
:url="`Departments/${entityId}`"
|
:url="`Departments/${entityId}`"
|
||||||
class="full-width"
|
class="full-width"
|
||||||
style="max-width: 900px"
|
|
||||||
module-name="Department"
|
|
||||||
>
|
>
|
||||||
<template #header="{ entity }">
|
<template #header="{ entity }">
|
||||||
<div>{{ entity.name }}</div>
|
<div>{{ entity.name }}</div>
|
||||||
</template>
|
</template>
|
||||||
<template #body="{ entity: department }">
|
<template #body="{ entity: department }">
|
||||||
<QCard class="column">
|
<QCard class="vn-one">
|
||||||
<VnTitle
|
<VnTitle
|
||||||
:url="`#/worker/department/${entityId}/basic-data`"
|
:url="`#/worker/department/${entityId}/basic-data`"
|
||||||
:text="t('Basic data')"
|
:text="t('Basic data')"
|
||||||
/>
|
/>
|
||||||
<div class="full-width row wrap justify-between content-between">
|
<div class="full-width row wrap justify-between content-between">
|
||||||
<div class="column" style="min-width: 50%">
|
<div class="column">
|
||||||
<VnLv :label="t('globals.name')" :value="department.name" dash />
|
<VnLv :label="t('globals.name')" :value="department.name" dash />
|
||||||
<VnLv :label="t('globals.code')" :value="department.code" dash />
|
<VnLv :label="t('globals.code')" :value="department.code" dash />
|
||||||
<VnLv
|
<VnLv
|
||||||
|
|
|
@ -35,7 +35,7 @@ const filterWhere = computed(() => ({
|
||||||
auto-load
|
auto-load
|
||||||
@on-fetch="(data) => (validAddresses = data)"
|
@on-fetch="(data) => (validAddresses = data)"
|
||||||
/>
|
/>
|
||||||
<FormModel :url="`Zones/${route.params.id}`" auto-load model="zone">
|
<FormModel :url="`Zones/${$route.params.id}`" auto-load data-key="Zone">
|
||||||
<template #form="{ data, validate }">
|
<template #form="{ data, validate }">
|
||||||
<VnRow>
|
<VnRow>
|
||||||
<VnInput
|
<VnInput
|
||||||
|
|
|
@ -25,12 +25,7 @@ const entityId = computed(() => {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<CardDescriptor
|
<CardDescriptor :url="`Zones/${entityId}`" :filter="filter" data-key="Zone">
|
||||||
module="Zone"
|
|
||||||
:url="`Zones/${entityId}`"
|
|
||||||
:filter="filter"
|
|
||||||
data-key="Zone"
|
|
||||||
>
|
|
||||||
<template #menu="{ entity }">
|
<template #menu="{ entity }">
|
||||||
<ZoneDescriptorMenuItems :zone="entity" />
|
<ZoneDescriptorMenuItems :zone="entity" />
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -124,12 +124,12 @@ describe('Entry', () => {
|
||||||
|
|
||||||
clickAndType('stickers', '1');
|
clickAndType('stickers', '1');
|
||||||
checkText('quantity', '11');
|
checkText('quantity', '11');
|
||||||
checkText('amount', '550');
|
checkText('amount', '550.00');
|
||||||
clickAndType('packing', '2');
|
clickAndType('packing', '2');
|
||||||
checkText('packing', '12close');
|
checkText('packing', '12close');
|
||||||
checkText('weight', '12');
|
checkText('weight', '12.0');
|
||||||
checkText('quantity', '132');
|
checkText('quantity', '132');
|
||||||
checkText('amount', '6600');
|
checkText('amount', '6600.00');
|
||||||
checkColor('packing', COLORS.enabled);
|
checkColor('packing', COLORS.enabled);
|
||||||
|
|
||||||
selectCell('groupingMode').click().click().click();
|
selectCell('groupingMode').click().click().click();
|
||||||
|
@ -137,7 +137,7 @@ describe('Entry', () => {
|
||||||
checkColor('grouping', COLORS.enabled);
|
checkColor('grouping', COLORS.enabled);
|
||||||
|
|
||||||
selectCell('buyingValue').click().clear().type('{backspace}{backspace}1');
|
selectCell('buyingValue').click().clear().type('{backspace}{backspace}1');
|
||||||
checkText('amount', '132');
|
checkText('amount', '132.00');
|
||||||
checkColor('minPrice', COLORS.disable);
|
checkColor('minPrice', COLORS.disable);
|
||||||
|
|
||||||
selectCell('hasMinPrice').click().click();
|
selectCell('hasMinPrice').click().click();
|
|
@ -49,7 +49,7 @@ describe('InvoiceInBasicData', () => {
|
||||||
'test/cypress/fixtures/image.jpg',
|
'test/cypress/fixtures/image.jpg',
|
||||||
{
|
{
|
||||||
force: true,
|
force: true,
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
cy.get('[data-cy="FormModelPopup_save"]').click();
|
cy.get('[data-cy="FormModelPopup_save"]').click();
|
||||||
cy.checkNotification('Data saved');
|
cy.checkNotification('Data saved');
|
||||||
|
|
|
@ -4,9 +4,6 @@ describe('Route', () => {
|
||||||
cy.login('developer');
|
cy.login('developer');
|
||||||
cy.visit(`/#/route/extended-list`);
|
cy.visit(`/#/route/extended-list`);
|
||||||
});
|
});
|
||||||
const getVnSelect =
|
|
||||||
'> :nth-child(1) > .column > .q-field > .q-field__inner > .q-field__control > .q-field__control-container';
|
|
||||||
const getRowColumn = (row, column) => `:nth-child(${row}) > :nth-child(${column})`;
|
|
||||||
|
|
||||||
it('Route list create route', () => {
|
it('Route list create route', () => {
|
||||||
cy.addBtnClick();
|
cy.addBtnClick();
|
||||||
|
@ -16,18 +13,25 @@ describe('Route', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Route list search and edit', () => {
|
it('Route list search and edit', () => {
|
||||||
cy.get('#searchbar input').type('{enter}'); /*
|
cy.get('#searchbar input').type('{enter}');
|
||||||
cy.get('td[data-col-field="description"]').click(); */
|
cy.get('[data-col-field="description"][data-row-index="0"]')
|
||||||
cy.get('input[name="description"]').type('routeTestOne{enter}');
|
.click()
|
||||||
/* cy.get('.q-table tr')
|
.type('routeTestOne{enter}');
|
||||||
|
cy.get('.q-table tr')
|
||||||
.its('length')
|
.its('length')
|
||||||
.then((rowCount) => {
|
.then((rowCount) => {
|
||||||
expect(rowCount).to.be.greaterThan(0);
|
expect(rowCount).to.be.greaterThan(0);
|
||||||
});
|
});
|
||||||
cy.get(getRowColumn(1, 3) + getVnSelect).type('{downArrow}{enter}');
|
cy.get('[data-col-field="workerFk"][data-row-index="0"]')
|
||||||
cy.get(getRowColumn(1, 4) + getVnSelect).type('{downArrow}{enter}');
|
.click()
|
||||||
cy.get(getRowColumn(1, 5) + getVnSelect).type('{downArrow}{enter}');
|
.type('{downArrow}{enter}');
|
||||||
|
cy.get('[data-col-field="agencyModeFk"][data-row-index="0"]')
|
||||||
|
.click()
|
||||||
|
.type('{downArrow}{enter}');
|
||||||
|
cy.get('[data-col-field="vehicleFk"][data-row-index="0"]')
|
||||||
|
.click()
|
||||||
|
.type('{downArrow}{enter}');
|
||||||
cy.get('button[title="Save"]').click();
|
cy.get('button[title="Save"]').click();
|
||||||
cy.get('.q-notification__message').should('have.text', 'Data saved'); */
|
cy.get('.q-notification__message').should('have.text', 'Data saved');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -9,7 +9,7 @@ describe('WagonTypeCreate', () => {
|
||||||
it('should create a new wagon type and then delete it', () => {
|
it('should create a new wagon type and then delete it', () => {
|
||||||
cy.get('.q-page-sticky > div > .q-btn').click();
|
cy.get('.q-page-sticky > div > .q-btn').click();
|
||||||
cy.get('input').first().type('Example for testing');
|
cy.get('input').first().type('Example for testing');
|
||||||
cy.get('button[type="submit"]').click();
|
cy.get('[data-cy="FormModelPopup_save"]').click();
|
||||||
cy.get('[title="Remove"] > .q-btn__content > .q-icon').first().click();
|
cy.get('[title="Remove"] > .q-btn__content > .q-icon').first().click();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue