Merge branch 'dev' into 6802-Clientes-gestionados-por-equipos

This commit is contained in:
Javi Gallego 2025-02-14 09:52:24 +01:00
commit cb408636ff
43 changed files with 235 additions and 202 deletions

View File

@ -9,19 +9,19 @@ export default {
if (!form) return;
try {
const inputsFormCard = form.querySelectorAll(
`input:not([disabled]):not([type="checkbox"])`
`input:not([disabled]):not([type="checkbox"])`,
);
if (inputsFormCard.length) {
focusFirstInput(inputsFormCard[0]);
}
const textareas = document.querySelectorAll(
'textarea:not([disabled]), [contenteditable]:not([disabled])'
'textarea:not([disabled]), [contenteditable]:not([disabled])',
);
if (textareas.length) {
focusFirstInput(textareas[textareas.length - 1]);
}
const inputs = document.querySelectorAll(
'form#formModel input:not([disabled]):not([type="checkbox"])'
'form#formModel input:not([disabled]):not([type="checkbox"])',
);
const input = inputs[0];
if (!input) return;

View File

@ -113,7 +113,7 @@ const defaultButtons = computed(() => ({
color: 'primary',
icon: 'save',
label: 'globals.save',
click: () => myForm.value.submit(),
click: () => myForm.value.onSubmit(false),
type: 'submit',
},
reset: {
@ -207,7 +207,8 @@ async function fetch() {
}
}
async function save() {
async function save(prevent = false) {
if (prevent) return;
if ($props.observeFormChanges && !hasChanges.value)
return notify('globals.noChanges', 'negative');
@ -293,7 +294,7 @@ defineExpose({
<QForm
ref="myForm"
v-if="formData"
@submit="save"
@submit="save(!!$event)"
@reset="reset"
class="q-pa-md"
:style="maxWidth ? 'max-width: ' + maxWidth : ''"

View File

@ -1,5 +1,5 @@
<script setup>
import { ref, computed, onMounted } from 'vue';
import { ref, computed } from 'vue';
import { useI18n } from 'vue-i18n';
import FormModel from 'components/FormModel.vue';
@ -58,19 +58,6 @@ defineExpose({
<p>{{ subtitle }}</p>
<slot name="form-inputs" :data="data" :validate="validate" />
<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
:label="t('globals.cancel')"
:title="t('globals.cancel')"
@ -83,23 +70,39 @@ defineExpose({
v-close-popup
z-max
@click="
() => {
isSaveAndContinue = false;
emit('onDataCanceled');
}
isSaveAndContinue = false;
emit('onDataCanceled');
"
/>
<QBtn
:flat="showSaveAndContinueBtn"
:label="t('globals.save')"
:title="t('globals.save')"
type="submit"
@click="
formModelRef.save();
isSaveAndContinue = false;
"
color="primary"
class="q-ml-sm"
:disabled="isLoading"
:loading="isLoading"
data-cy="FormModelPopup_save"
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>
</template>

View File

@ -340,8 +340,9 @@ const clickHandler = async (event) => {
const isDateElement = event.target.closest('.q-date');
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) {
destroyInput(editingRow.value, editingField.value);
@ -411,7 +412,7 @@ async function renderInput(rowId, field, clickedElement) {
focusOnMount: true,
eventHandlers: {
'update:modelValue': async (value) => {
if (isSelect) {
if (isSelect && value) {
row[column.name] = value[column.attrs?.optionValue ?? 'id'];
row[column?.name + 'TextValue'] =
value[column.attrs?.optionLabel ?? 'name'];
@ -593,6 +594,7 @@ const checkbox = ref(null);
@row-click="(_, row) => rowClickFunction && rowClickFunction(row)"
@update:selected="emit('update:selected', $event)"
@selection="(details) => handleSelection(details, rows)"
:hide-selected-banner="true"
>
<template #top-left v-if="!$props.withoutHeader">
<slot name="top-left"> </slot>
@ -1042,7 +1044,7 @@ es:
.grid-three {
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%;
grid-gap: 20px;
margin: 0 auto;

View File

@ -1,61 +1,65 @@
import { vi, describe, expect, it, beforeEach, beforeAll, afterEach } from 'vitest';
import { vi, describe, expect, it, beforeEach, afterEach } from 'vitest';
import { createWrapper } from 'app/test/vitest/helper';
import UserPanel from 'src/components/UserPanel.vue';
import axios from 'axios';
import { useState } from 'src/composables/useState';
vi.mock('src/utils/quasarLang', () => ({
default: vi.fn(),
}));
describe('UserPanel', () => {
let wrapper;
let vm;
let state;
let wrapper;
let vm;
let state;
beforeEach(() => {
wrapper = createWrapper(UserPanel, {});
state = useState();
state.setUser({
id: 115,
name: 'itmanagement',
nickname: 'itManagementNick',
lang: 'en',
darkMode: false,
companyFk: 442,
warehouseFk: 1,
});
wrapper = wrapper.wrapper;
vm = wrapper.vm;
beforeEach(() => {
wrapper = createWrapper(UserPanel, {});
state = useState();
state.setUser({
id: 115,
name: 'itmanagement',
nickname: 'itManagementNick',
lang: 'en',
darkMode: false,
companyFk: 442,
warehouseFk: 1,
});
wrapper = wrapper.wrapper;
vm = wrapper.vm;
});
afterEach(() => {
vi.clearAllMocks();
});
afterEach(() => {
vi.clearAllMocks();
});
it('should fetch warehouses data on mounted', async () => {
const fetchData = wrapper.findComponent({ name: 'FetchData' });
expect(fetchData.props('url')).toBe('Warehouses');
expect(fetchData.props('autoLoad')).toBe(true);
});
it('should fetch warehouses data on mounted', async () => {
const fetchData = wrapper.findComponent({ name: 'FetchData' });
expect(fetchData.props('url')).toBe('Warehouses');
expect(fetchData.props('autoLoad')).toBe(true);
});
it('should toggle dark mode correctly and update preferences', async () => {
await vm.saveDarkMode(true);
expect(axios.patch).toHaveBeenCalledWith('/UserConfigs/115', { darkMode: true });
expect(vm.user.darkMode).toBe(true);
vm.updatePreferences();
expect(vm.darkMode).toBe(true);
});
it('should toggle dark mode correctly and update preferences', async () => {
await vm.saveDarkMode(true);
expect(axios.patch).toHaveBeenCalledWith('/UserConfigs/115', { darkMode: true });
expect(vm.user.darkMode).toBe(true);
await vm.updatePreferences();
expect(vm.darkMode).toBe(true);
});
it('should change user language and update preferences', async () => {
const userLanguage = 'es';
await vm.saveLanguage(userLanguage);
expect(axios.patch).toHaveBeenCalledWith('/VnUsers/115', { lang: userLanguage });
expect(vm.user.lang).toBe(userLanguage);
vm.updatePreferences();
expect(vm.locale).toBe(userLanguage);
});
it('should change user language and update preferences', async () => {
const userLanguage = 'es';
await vm.saveLanguage(userLanguage);
expect(axios.patch).toHaveBeenCalledWith('/VnUsers/115', { lang: userLanguage });
expect(vm.user.lang).toBe(userLanguage);
await vm.updatePreferences();
expect(vm.locale).toBe(userLanguage);
});
it('should update user data', async () => {
const key = 'name';
const value = 'itboss';
await vm.saveUserData(key, value);
expect(axios.post).toHaveBeenCalledWith('UserConfigs/setUserConfig', { [key]: value });
});
});
it('should update user data', async () => {
const key = 'name';
const value = 'itboss';
await vm.saveUserData(key, value);
expect(axios.post).toHaveBeenCalledWith('UserConfigs/setUserConfig', { [key]: value });
});
});

View File

@ -2,7 +2,7 @@
const $props = defineProps({
colors: {
type: String,
default: '{"value":[]}',
default: '{"value": []}',
},
});
@ -11,7 +11,7 @@ const maxHeight = 30;
const colorHeight = maxHeight / colorArray?.length;
</script>
<template>
<div class="color-div" :style="{ height: `${maxHeight}px` }">
<div v-if="colors" class="color-div" :style="{ height: `${maxHeight}px` }">
<div
v-for="(color, index) in colorArray"
:key="index"

View File

@ -6,6 +6,7 @@ import { useArrayData } from 'composables/useArrayData';
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
import { useState } from 'src/composables/useState';
import { useRoute } from 'vue-router';
import { useClipboard } from 'src/composables/useClipboard';
import VnMoreOptions from './VnMoreOptions.vue';
const $props = defineProps({
@ -29,10 +30,6 @@ const $props = defineProps({
type: String,
default: null,
},
module: {
type: String,
default: null,
},
summary: {
type: Object,
default: null,
@ -46,6 +43,7 @@ const $props = defineProps({
const state = useState();
const route = useRoute();
const { t } = useI18n();
const { copyText } = useClipboard();
const { viewSummary } = useSummaryDialog();
let arrayData;
let store;
@ -103,6 +101,14 @@ function getValueFromPath(path) {
return current;
}
function copyIdText(id) {
copyText(id, {
component: {
copyValue: id,
},
});
}
const emit = defineEmits(['onFetch']);
const iconModule = computed(() => route.matched[1].meta.icon);
@ -148,7 +154,9 @@ const toModule = computed(() =>
{{ t('components.smartCard.openSummary') }}
</QTooltip>
</QBtn>
<RouterLink :to="{ name: `${module}Summary`, params: { id: entity.id } }">
<RouterLink
:to="{ name: `${dataKey}Summary`, params: { id: entity.id } }"
>
<QBtn
class="link"
color="white"
@ -184,9 +192,22 @@ const toModule = computed(() =>
</slot>
</div>
</QItemLabel>
<QItem dense>
<QItem>
<QItemLabel class="subtitle" caption>
#{{ 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>
</QItem>
</QList>
@ -294,3 +315,11 @@ const toModule = computed(() =>
}
}
</style>
<i18n>
en:
globals:
copyId: Copy ID
es:
globals:
copyId: Copiar ID
</i18n>

View File

@ -156,6 +156,7 @@ globals:
raid: 'Raid {daysInForward} days'
isVies: Vies
department: Department
noData: No data available
pageTitles:
logIn: Login
addressEdit: Update address

View File

@ -159,6 +159,7 @@ globals:
changeState: Cambiar estado
raid: 'Redada {daysInForward} días'
isVies: Vies
noData: Datos no disponibles
department: Departamento
pageTitles:
logIn: Inicio de sesión

View File

@ -51,7 +51,6 @@ const removeAlias = () => {
<CardDescriptor
ref="descriptor"
:url="`MailAliases/${entityId}`"
module="Alias"
data-key="Alias"
title="alias"
>

View File

@ -24,7 +24,6 @@ onMounted(async () => {
ref="descriptor"
:url="`VnUsers/preview`"
:filter="{ ...filter, where: { id: entityId } }"
module="Account"
data-key="Account"
title="nickname"
>

View File

@ -35,7 +35,6 @@ const removeRole = async () => {
<CardDescriptor
url="VnRoles"
:filter="{ where: { id: entityId } }"
module="Role"
data-key="Role"
:summary="$props.summary"
>

View File

@ -47,7 +47,6 @@ onMounted(async () => {
<CardDescriptor
:url="`Claims/${entityId}`"
:filter="filter"
module="Claim"
title="client.name"
data-key="Claim"
>

View File

@ -55,7 +55,6 @@ const debtWarning = computed(() => {
<template>
<CardDescriptor
module="Customer"
:url="`Clients/${entityId}/getCard`"
:summary="$props.summary"
data-key="Customer"

View File

@ -84,7 +84,7 @@ function setPaymentType(accounting) {
viewReceipt.value = isCash.value;
if (accountingType.value.daysInFuture)
initialData.payed.setDate(
initialData.payed.getDate() + accountingType.value.daysInFuture
initialData.payed.getDate() + accountingType.value.daysInFuture,
);
maxAmount.value = accountingType.value && accountingType.value.maxAmount;

View File

@ -156,10 +156,10 @@ const columns = [
{
align: 'center',
labelAbbreviation: t('Sti.'),
label: t('Printed Stickers/Stickers'),
label: t('Stickers'),
toolTip: t('Printed Stickers/Stickers'),
name: 'stickers',
component: 'number',
component: 'input',
create: true,
attrs: {
positive: false,
@ -179,7 +179,7 @@ const columns = [
component: 'select',
attrs: {
url: 'packagings',
fields: ['id', 'volume'],
fields: ['id'],
optionLabel: 'id',
},
create: true,
@ -192,10 +192,10 @@ const columns = [
component: 'number',
create: true,
width: '35px',
format: (row, dashIfEmpty) => parseFloat(row['weight']).toFixed(1),
},
{
align: 'center',
labelAbbreviation: 'Pack',
labelAbbreviation: 'P',
label: 'Packing',
toolTip: 'Packing',
name: 'packing',
@ -209,14 +209,13 @@ const columns = [
row['amount'] = row['quantity'] * row['buyingValue'];
},
},
width: '35px',
width: '20px',
style: (row) => {
if (row.groupingMode === 'grouping')
return { color: 'var(--vn-label-color)' };
},
},
{
align: 'center',
labelAbbreviation: 'GM',
label: t('Grouping selector'),
toolTip: t('Grouping selector'),
@ -229,7 +228,7 @@ const columns = [
indeterminateValue: null,
},
size: 'xs',
width: '30px',
width: '25px',
create: true,
rightFilter: false,
getIcon: (value) => {
@ -245,12 +244,12 @@ const columns = [
},
{
align: 'center',
labelAbbreviation: 'Group',
labelAbbreviation: 'G',
label: 'Grouping',
toolTip: 'Grouping',
name: 'grouping',
component: 'number',
width: '35px',
width: '20px',
create: true,
style: (row) => {
if (row.groupingMode === 'packing') return { color: 'var(--vn-label-color)' };
@ -290,6 +289,7 @@ const columns = [
},
},
width: '45px',
format: (row) => parseFloat(row['buyingValue']).toFixed(3),
},
{
align: 'center',
@ -301,6 +301,7 @@ const columns = [
positive: false,
},
isEditable: false,
format: (row) => parseFloat(row['amount']).toFixed(2),
style: getAmountStyle,
},
{
@ -312,6 +313,7 @@ const columns = [
component: 'number',
width: '35px',
create: true,
format: (row) => parseFloat(row['price2']).toFixed(2),
},
{
align: 'center',
@ -325,6 +327,7 @@ const columns = [
},
width: '35px',
create: true,
format: (row) => parseFloat(row['price3']).toFixed(2),
},
{
align: 'center',
@ -344,6 +347,7 @@ const columns = [
style: (row) => {
if (!row?.hasMinPrice) return { color: 'var(--vn-label-color)' };
},
format: (row) => parseFloat(row['minPrice']).toFixed(2),
},
{
align: 'center',
@ -518,7 +522,7 @@ onMounted(() => {
<Teleport to="#st-data" v-if="stateStore?.isSubToolbarShown() && editableMode">
<QBtnGroup push style="column-gap: 1px">
<QBtnDropdown
icon="exposure_neg_1"
label="+/-"
color="primary"
flat
:title="t('Invert quantity value')"
@ -533,7 +537,7 @@ onMounted(() => {
@click="invertQuantitySign(selectedRows, -1)"
data-cy="set-negative-quantity"
>
<span style="font-size: medium">-1</span>
<span style="font-size: large">-</span>
</QBtn>
</QItemSection>
</QItem>
@ -544,7 +548,7 @@ onMounted(() => {
@click="invertQuantitySign(selectedRows, 1)"
data-cy="set-positive-quantity"
>
<span style="font-size: medium">1</span>
<span style="font-size: large">+</span>
</QBtn>
</QItemSection>
</QItem>
@ -558,11 +562,11 @@ onMounted(() => {
:disable="!selectedRows.length"
data-cy="check-buy-amount"
>
<QTooltip>{{}}</QTooltip>
<QList>
<QItem>
<QItemSection>
<QBtn
size="sm"
icon="check"
flat
@click="setIsChecked(selectedRows, true)"
@ -573,6 +577,7 @@ onMounted(() => {
<QItem>
<QItemSection>
<QBtn
size="sm"
icon="close"
flat
@click="setIsChecked(selectedRows, false)"
@ -662,7 +667,7 @@ onMounted(() => {
<FetchedTags :item="row" :columns="3" />
</template>
<template #column-stickers="{ row }">
<span class="editable-text">
<span :class="editableMode ? 'editable-text' : ''">
<span style="color: var(--vn-label-color)">
{{ row.printedStickers }}
</span>
@ -693,20 +698,36 @@ onMounted(() => {
</template>
<template #column-create-itemFk="{ data }">
<VnSelect
url="Items"
url="Items/search"
v-model="data.itemFk"
:label="t('Article')"
:fields="['id', 'name']"
:fields="['id', 'name', 'size', 'producerName']"
:filter-options="['id', 'name', 'size', 'producerName']"
option-label="name"
option-value="id"
@update:modelValue="
async (value) => {
setBuyUltimate(value, data);
await setBuyUltimate(value, data);
}
"
:required="true"
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 #column-create-groupingMode="{ data }">
<VnSelectEnum
@ -720,9 +741,14 @@ onMounted(() => {
/>
</template>
<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" />
<SkeletonDescriptor v-if="!data.itemFk" :has-image="true" />
<div v-else>
<span>{{ t('globals.noData') }}</span>
</div>
</div>
</template>
</VnTable>
@ -744,6 +770,7 @@ es:
Com.: Ref.
Comment: Referencia
Minimum price: Precio mínimo
Stickers: Etiquetas
Printed Stickers/Stickers: Etiquetas impresas/Etiquetas
Cost: Cost.
Buying value: Coste
@ -761,7 +788,12 @@ es:
Check buy amount: Marcar como correcta la cantidad de compra
</i18n>
<style lang="scss" scoped>
.test {
.centered-container {
display: flex;
justify-content: center;
align-items: center;
position: absolute;
width: 40%;
height: 100%;
}
</style>

View File

@ -147,7 +147,6 @@ async function deleteEntry() {
<template>
<CardDescriptor
ref="entryDescriptorRef"
module="Entry"
:url="`Entries/${entityId}`"
:userFilter="entryFilter"
title="supplier.nickname"

View File

@ -182,14 +182,6 @@ const columns = computed(() => [
name: 'entryTypeCode',
cardVisible: true,
},
{
name: 'dated',
label: t('entry.list.tableVisibleColumns.dated'),
component: 'date',
cardVisible: false,
visible: false,
create: true,
},
{
name: 'companyFk',
label: t('entry.list.tableVisibleColumns.companyFk'),
@ -220,7 +212,8 @@ function getBadgeAttrs(row) {
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) {
case 'regularization':
case 'life':
@ -245,7 +238,6 @@ function getBadgeAttrs(row) {
default:
break;
}
if (timeDiff < 0) return { color: 'info', 'text-color': 'black' };
return { color: 'transparent' };
}

View File

@ -90,7 +90,6 @@ async function setInvoiceCorrection(id) {
<template>
<CardDescriptor
ref="cardDescriptorRef"
module="InvoiceIn"
data-key="InvoiceIn"
:url="`InvoiceIns/${entityId}`"
:filter="filter"

View File

@ -36,7 +36,6 @@ function ticketFilter(invoice) {
<template>
<CardDescriptor
ref="descriptor"
module="InvoiceOut"
:url="`InvoiceOuts/${entityId}`"
:filter="filter"
title="ref"

View File

@ -92,7 +92,6 @@ const updateStock = async () => {
<template>
<CardDescriptor
data-key="Item"
module="Item"
:summary="$props.summary"
:url="`Items/${entityId}/getCard`"
@on-fetch="setData"

View File

@ -110,10 +110,16 @@ const columns = computed(() => [
attrs: { inWhere: true },
align: 'left',
},
{
label: t('globals.visible'),
name: 'stock',
attrs: { inWhere: true },
align: 'left',
},
]);
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 () => {
@ -157,7 +163,7 @@ watchEffect(selectedRows);
openConfirmationModal(
t('shelvings.removeConfirmTitle'),
t('shelvings.removeConfirmSubtitle'),
removeLines
removeLines,
)
"
>

View File

@ -26,7 +26,6 @@ const entityId = computed(() => {
</script>
<template>
<CardDescriptor
module="ItemType"
:url="`ItemTypes/${entityId}`"
:filter="filter"
title="code"

View File

@ -57,7 +57,6 @@ const total = ref(0);
ref="descriptor"
:url="`Orders/${entityId}`"
:filter="filter"
module="Order"
title="client.name"
@on-fetch="setData"
data-key="Order"

View File

@ -22,7 +22,6 @@ const card = computed(() => store.data);
</script>
<template>
<CardDescriptor
module="Agency"
data-key="Agency"
:url="`Agencies/${entityId}`"
:title="card?.name"

View File

@ -23,7 +23,6 @@ const entityId = computed(() => {
</script>
<template>
<CardDescriptor
module="Route"
:url="`Routes/${entityId}`"
:filter="filter"
:title="null"

View File

@ -26,12 +26,7 @@ const entityId = computed(() => {
</script>
<template>
<CardDescriptor
module="Roadmap"
:url="`Roadmaps/${entityId}`"
:filter="filter"
data-key="Roadmap"
>
<CardDescriptor :url="`Roadmaps/${entityId}`" :filter="filter" data-key="Roadmap">
<template #body="{ entity }">
<VnLv :label="t('Roadmap')" :value="entity?.name" />
<VnLv :label="t('ETD')" :value="toDateHourMin(entity?.etd)" />

View File

@ -9,7 +9,6 @@ const { notify } = useNotify();
<template>
<CardDescriptor
:url="`Vehicles/${$route.params.id}`"
module="Vehicle"
data-key="Vehicle"
title="numberPlate"
:to-module="{ name: 'VehicleList' }"

View File

@ -25,7 +25,6 @@ const entityId = computed(() => {
</script>
<template>
<CardDescriptor
module="Shelving"
:url="`Shelvings/${entityId}`"
:filter="filter"
title="code"

View File

@ -17,7 +17,6 @@ const entityId = computed(() => props.id || route.params.id);
</script>
<template>
<CardDescriptor
module="Parking"
data-key="Parking"
:url="`Parkings/${entityId}`"
title="code"

View File

@ -62,7 +62,6 @@ const getEntryQueryParams = (supplier) => {
<template>
<CardDescriptor
module="Supplier"
:url="`Suppliers/${entityId}`"
:filter="filter"
data-key="Supplier"

View File

@ -44,7 +44,6 @@ function ticketFilter(ticket) {
@on-fetch="(data) => ([problems] = data)"
/>
<CardDescriptor
module="Ticket"
:url="`Tickets/${entityId}`"
:filter="filter"
data-key="Ticket"

View File

@ -34,7 +34,7 @@ const redirectToCreateView = ({ itemFk }) => {
const columns = computed(() => [
{
name: 'date',
align: 'left',
align: 'center',
label: t('negative.date'),
format: ({ timed }) => toDate(timed),
sortable: true,
@ -47,7 +47,7 @@ const columns = computed(() => [
{
columnClass: 'shrink',
name: 'timed',
align: 'left',
align: 'center',
label: t('negative.timed'),
format: ({ timed }) => toHour(timed),
sortable: true,
@ -58,7 +58,7 @@ const columns = computed(() => [
},
{
name: 'itemFk',
align: 'left',
align: 'center',
label: t('negative.id'),
format: ({ itemFk }) => itemFk,
sortable: true,
@ -70,7 +70,7 @@ const columns = computed(() => [
},
{
name: 'longName',
align: 'left',
align: 'center',
label: t('negative.longName'),
field: ({ longName }) => longName,
@ -81,7 +81,7 @@ const columns = computed(() => [
},
{
name: 'producer',
align: 'left',
align: 'center',
label: t('negative.supplier'),
field: ({ producer }) => dashIfEmpty(producer),
sortable: true,
@ -89,7 +89,7 @@ const columns = computed(() => [
},
{
name: 'inkFk',
align: 'left',
align: 'center',
label: t('negative.colour'),
field: ({ inkFk }) => inkFk,
sortable: true,
@ -97,7 +97,7 @@ const columns = computed(() => [
},
{
name: 'size',
align: 'left',
align: 'center',
label: t('negative.size'),
field: ({ size }) => size,
sortable: true,
@ -110,7 +110,7 @@ const columns = computed(() => [
},
{
name: 'category',
align: 'left',
align: 'center',
label: t('negative.origen'),
field: ({ category }) => dashIfEmpty(category),
sortable: true,
@ -118,7 +118,7 @@ const columns = computed(() => [
},
{
name: 'lack',
align: 'left',
align: 'center',
label: t('negative.lack'),
field: ({ lack }) => lack,
columnFilter: {
@ -127,12 +127,12 @@ const columns = computed(() => [
columnClass: 'shrink',
},
sortable: true,
headerStyle: 'padding-left: 33px',
headerStyle: 'padding-center: 33px',
cardVisible: true,
},
{
name: 'tableActions',
align: 'left',
align: 'center',
actions: [
{
title: t('Open details'),

View File

@ -52,27 +52,26 @@ const route = useRoute();
const columns = computed(() => [
{
name: 'status',
align: 'left',
align: 'center',
sortable: false,
columnClass: 'expand',
columnClass: 'shrink',
columnFilter: false,
},
{
name: 'ticketFk',
label: t('negative.detail.ticketFk'),
align: 'left',
align: 'center',
sortable: true,
columnFilter: {
component: 'input',
type: 'number',
},
columnClass: 'shrink',
},
{
name: 'shipped',
label: t('negative.detail.shipped'),
field: 'shipped',
align: 'left',
align: 'center',
format: ({ shipped }) => toDate(shipped),
sortable: true,
columnFilter: {
@ -84,11 +83,9 @@ const columns = computed(() => [
name: 'minTimed',
label: t('negative.detail.theoreticalhour'),
field: 'minTimed',
align: 'left',
format: ({ minTimed }) => toHour(minTimed),
align: 'center',
sortable: true,
component: 'time',
columnClass: 'shrink',
columnFilter: {},
},
{
@ -104,29 +101,27 @@ const columns = computed(() => [
optionValue: 'code',
},
},
columnClass: 'expand',
align: 'left',
align: 'center',
sortable: true,
},
{
name: 'zoneName',
label: t('negative.detail.zoneName'),
field: 'zoneName',
align: 'left',
align: 'center',
sortable: true,
},
{
name: 'nickname',
label: t('negative.detail.nickname'),
field: 'nickname',
align: 'left',
align: 'center',
sortable: true,
},
{
name: 'quantity',
label: t('negative.detail.quantity'),
field: 'quantity',
align: 'left',
sortable: true,
component: 'input',
type: 'number',
@ -167,7 +162,6 @@ const saveChange = async (field, { row }) => {
}
};
const hasToIgnore = (row) => row.hasToIgnore === 1;
function onBuysFetched(data) {
Object.assign(item.value, data[0]);
}
@ -244,7 +238,7 @@ function onBuysFetched(data) {
</template>
<template #column-status="{ row }">
<QTd style="width: 150px">
<QTd style="min-width: 150px">
<div class="icon-container">
<QIcon
v-if="row.isBasket"

View File

@ -32,7 +32,6 @@ const setData = (entity) => (data.value = useCardDescription(entity.ref, entity.
<template>
<CardDescriptor
module="Travel"
:url="`Travels/${entityId}`"
:title="data.title"
:subtitle="data.subtitle"

View File

@ -50,7 +50,6 @@ const handlePhotoUpdated = (evt = false) => {
<template>
<CardDescriptor
ref="cardDescriptorRef"
module="Worker"
:data-key="dataKey"
url="Workers/summary"
:filter="{ where: { id: entityId } }"

View File

@ -12,11 +12,6 @@ const $props = defineProps({
<template>
<QPopupProxy>
<WorkerDescriptor
v-if="$props.id"
:id="$props.id"
:summary="WorkerSummary"
data-key="workerDescriptorProxy"
/>
<WorkerDescriptor v-if="$props.id" :id="$props.id" :summary="WorkerSummary" />
</QPopupProxy>
</template>

View File

@ -42,7 +42,6 @@ const { openConfirmationModal } = useVnConfirm();
<template>
<CardDescriptor
ref="DepartmentDescriptorRef"
module="Department"
:url="`Departments/${entityId}`"
:summary="$props.summary"
:to-module="{ name: 'WorkerDepartment' }"

View File

@ -25,12 +25,7 @@ const entityId = computed(() => {
</script>
<template>
<CardDescriptor
module="Zone"
:url="`Zones/${entityId}`"
:filter="filter"
data-key="Zone"
>
<CardDescriptor :url="`Zones/${entityId}`" :filter="filter" data-key="Zone">
<template #menu="{ entity }">
<ZoneDescriptorMenuItems :zone="entity" />
</template>

View File

@ -124,12 +124,12 @@ describe('Entry', () => {
clickAndType('stickers', '1');
checkText('quantity', '11');
checkText('amount', '550');
checkText('amount', '550.00');
clickAndType('packing', '2');
checkText('packing', '12close');
checkText('weight', '12');
checkText('weight', '12.0');
checkText('quantity', '132');
checkText('amount', '6600');
checkText('amount', '6600.00');
checkColor('packing', COLORS.enabled);
selectCell('groupingMode').click().click().click();
@ -137,7 +137,7 @@ describe('Entry', () => {
checkColor('grouping', COLORS.enabled);
selectCell('buyingValue').click().clear().type('{backspace}{backspace}1');
checkText('amount', '132');
checkText('amount', '132.00');
checkColor('minPrice', COLORS.disable);
selectCell('hasMinPrice').click().click();

View File

@ -49,7 +49,7 @@ describe('InvoiceInBasicData', () => {
'test/cypress/fixtures/image.jpg',
{
force: true,
}
},
);
cy.get('[data-cy="FormModelPopup_save"]').click();
cy.checkNotification('Data saved');

View File

@ -4,9 +4,6 @@ describe('Route', () => {
cy.login('developer');
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', () => {
cy.addBtnClick();
@ -16,18 +13,25 @@ describe('Route', () => {
});
it('Route list search and edit', () => {
cy.get('#searchbar input').type('{enter}'); /*
cy.get('td[data-col-field="description"]').click(); */
cy.get('input[name="description"]').type('routeTestOne{enter}');
/* cy.get('.q-table tr')
cy.get('#searchbar input').type('{enter}');
cy.get('[data-col-field="description"][data-row-index="0"]')
.click()
.type('routeTestOne{enter}');
cy.get('.q-table tr')
.its('length')
.then((rowCount) => {
expect(rowCount).to.be.greaterThan(0);
});
cy.get(getRowColumn(1, 3) + getVnSelect).type('{downArrow}{enter}');
cy.get(getRowColumn(1, 4) + getVnSelect).type('{downArrow}{enter}');
cy.get(getRowColumn(1, 5) + getVnSelect).type('{downArrow}{enter}');
cy.get('[data-col-field="workerFk"][data-row-index="0"]')
.click()
.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('.q-notification__message').should('have.text', 'Data saved'); */
cy.get('.q-notification__message').should('have.text', 'Data saved');
});
});

View File

@ -9,7 +9,7 @@ describe('WagonTypeCreate', () => {
it('should create a new wagon type and then delete it', () => {
cy.get('.q-page-sticky > div > .q-btn').click();
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();
});
});