Merge branch '8612-shelvinge2e' of https://gitea.verdnatura.es/verdnatura/salix-front into 8612-shelvinge2e
gitea/salix-front/pipeline/pr-dev There was a failure building this commit Details

This commit is contained in:
PAU ROVIRA ROSALENY 2025-02-26 08:04:08 +01:00
commit 71d693e2a4
32 changed files with 335 additions and 296 deletions

View File

@ -1,11 +1,6 @@
import { defineConfig } from 'cypress'; import { defineConfig } from 'cypress';
// https://docs.cypress.io/app/tooling/reporters
// https://docs.cypress.io/app/references/configuration
// https://www.npmjs.com/package/cypress-mochawesome-reporter
let urlHost, let urlHost, reporter, reporterOptions;
reporter,
reporterOptions;
if (process.env.CI) { if (process.env.CI) {
urlHost = 'front'; urlHost = 'front';
@ -30,7 +25,7 @@ if (process.env.CI) {
export default defineConfig({ export default defineConfig({
e2e: { e2e: {
baseUrl: `http://${urlHost}:9000`, baseUrl: `http://${urlHost}:9000`,
experimentalStudio: false, // Desactivado para evitar tiempos de espera innecesarios experimentalStudio: false,
defaultCommandTimeout: 10000, defaultCommandTimeout: 10000,
trashAssetsBeforeRuns: false, trashAssetsBeforeRuns: false,
requestTimeout: 10000, requestTimeout: 10000,
@ -43,31 +38,22 @@ export default defineConfig({
downloadsFolder: 'test/cypress/downloads', downloadsFolder: 'test/cypress/downloads',
video: false, video: false,
specPattern: 'test/cypress/integration/**/*.spec.js', specPattern: 'test/cypress/integration/**/*.spec.js',
experimentalRunAllSpecs: true, experimentalRunAllSpecs: false,
watchForFileChanges: true, watchForFileChanges: false,
reporter, reporter: 'cypress-mochawesome-reporter',
reporterOptions, reporterOptions: {
charts: true,
reportPageTitle: 'Cypress Inline Reporter',
reportFilename: '[status]_[datetime]-report',
embeddedScreenshots: true,
reportDir: 'test/cypress/reports',
inlineAssets: true,
},
component: { component: {
componentFolder: 'src', componentFolder: 'src',
testFiles: '**/*.spec.js', testFiles: '**/*.spec.js',
supportFile: 'test/cypress/support/unit.js', supportFile: 'test/cypress/support/unit.js',
},/*
setupNodeEvents: async (on, config) => {
const plugin = await import('cypress-mochawesome-reporter/plugin');
plugin.default(on);
const fs = await import('fs');
on('task', {
deleteFile(filePath) {
if (fs.existsSync(filePath)) {
fs.unlinkSync(filePath);
return true;
}
return false;
}, },
});
return config;
},*/
viewportWidth: 1280, viewportWidth: 1280,
viewportHeight: 720, viewportHeight: 720,
}, },

View File

@ -12,6 +12,7 @@ import SkeletonForm from 'components/ui/SkeletonForm.vue';
import VnConfirm from './ui/VnConfirm.vue'; import VnConfirm from './ui/VnConfirm.vue';
import { tMobile } from 'src/composables/tMobile'; import { tMobile } from 'src/composables/tMobile';
import { useArrayData } from 'src/composables/useArrayData'; import { useArrayData } from 'src/composables/useArrayData';
import { getDifferences, getUpdatedValues } from 'src/filters';
const { push } = useRouter(); const { push } = useRouter();
const quasar = useQuasar(); const quasar = useQuasar();
@ -284,7 +285,12 @@ function trimData(data) {
} }
return data; return data;
} }
function onBeforeSave(formData, originalData) {
return getUpdatedValues(
Object.keys(getDifferences(formData, originalData)),
formData,
);
}
async function onKeyup(evt) { async function onKeyup(evt) {
if (evt.key === 'Enter' && !('prevent-submit' in attrs)) { if (evt.key === 'Enter' && !('prevent-submit' in attrs)) {
const input = evt.target; const input = evt.target;
@ -321,6 +327,7 @@ defineExpose({
class="q-pa-md" class="q-pa-md"
:style="maxWidth ? 'max-width: ' + maxWidth : ''" :style="maxWidth ? 'max-width: ' + maxWidth : ''"
id="formModel" id="formModel"
:mapper="onBeforeSave"
> >
<QCard> <QCard>
<slot <slot

View File

@ -1,12 +1,13 @@
<script setup> <script setup>
import { ref, computed } from 'vue'; import { ref, computed, useAttrs, nextTick } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useState } from 'src/composables/useState';
import FormModel from 'components/FormModel.vue'; import FormModel from 'components/FormModel.vue';
const emit = defineEmits(['onDataSaved', 'onDataCanceled']); const emit = defineEmits(['onDataSaved', 'onDataCanceled']);
defineProps({ const props = defineProps({
title: { title: {
type: String, type: String,
default: '', default: '',
@ -22,12 +23,21 @@ defineProps({
}); });
const { t } = useI18n(); const { t } = useI18n();
const attrs = useAttrs();
const state = useState();
const formModelRef = ref(null); const formModelRef = ref(null);
const closeButton = ref(null); const closeButton = ref(null);
const isSaveAndContinue = ref(false); const isSaveAndContinue = ref(props.showSaveAndContinueBtn);
const onDataSaved = (formData, requestResponse) => { const isLoading = computed(() => formModelRef.value?.isLoading);
if (closeButton.value && !isSaveAndContinue.value) closeButton.value.click(); const reset = computed(() => formModelRef.value?.reset);
const onDataSaved = async (formData, requestResponse) => {
if (!isSaveAndContinue.value) closeButton.value?.click();
if (isSaveAndContinue.value) {
await nextTick();
state.set(attrs.model, attrs.formInitialData);
}
isSaveAndContinue.value = props.showSaveAndContinueBtn;
emit('onDataSaved', formData, requestResponse); emit('onDataSaved', formData, requestResponse);
}; };
@ -36,9 +46,6 @@ const onClick = async (saveAndContinue) => {
await formModelRef.value.save(); await formModelRef.value.save();
}; };
const isLoading = computed(() => formModelRef.value?.isLoading);
const reset = computed(() => formModelRef.value?.reset);
defineExpose({ defineExpose({
isLoading, isLoading,
onDataSaved, onDataSaved,
@ -74,10 +81,7 @@ defineExpose({
data-cy="FormModelPopup_cancel" data-cy="FormModelPopup_cancel"
v-close-popup v-close-popup
z-max z-max
@click=" @click="emit('onDataCanceled')"
isSaveAndContinue = false;
emit('onDataCanceled');
"
/> />
<QBtn <QBtn
:flat="showSaveAndContinueBtn" :flat="showSaveAndContinueBtn"

View File

@ -165,6 +165,7 @@ const app = inject('app');
const editingRow = ref(null); const editingRow = ref(null);
const editingField = ref(null); const editingField = ref(null);
const isTableMode = computed(() => mode.value == TABLE_MODE); const isTableMode = computed(() => mode.value == TABLE_MODE);
const showRightIcon = computed(() => $props.rightSearch || $props.rightSearchIcon);
const selectRegex = /select/; const selectRegex = /select/;
const emit = defineEmits(['onFetch', 'update:selected', 'saveChanges']); const emit = defineEmits(['onFetch', 'update:selected', 'saveChanges']);
const tableModes = [ const tableModes = [
@ -953,14 +954,6 @@ function cardClick(_, row) {
transition-show="scale" transition-show="scale"
transition-hide="scale" transition-hide="scale"
:full-width="createComplement?.isFullWidth ?? false" :full-width="createComplement?.isFullWidth ?? false"
@before-hide="
() => {
if (createRef.isSaveAndContinue) {
showForm = true;
createForm.formInitialData = { ...create.formInitialData };
}
}
"
data-cy="vn-table-create-dialog" data-cy="vn-table-create-dialog"
> >
<FormModelPopup <FormModelPopup

View File

@ -196,7 +196,6 @@ const toModule = computed(() =>
<QItemLabel class="subtitle"> <QItemLabel class="subtitle">
#{{ getValueFromPath(subtitle) ?? entity.id }} #{{ getValueFromPath(subtitle) ?? entity.id }}
</QItemLabel> </QItemLabel>
<QBtn <QBtn
round round
flat flat
@ -210,7 +209,6 @@ const toModule = computed(() =>
{{ t('globals.copyId') }} {{ t('globals.copyId') }}
</QTooltip> </QTooltip>
</QBtn> </QBtn>
<!-- </QItemLabel> -->
</QItem> </QItem>
</QList> </QList>
<div class="list-box q-mt-xs"> <div class="list-box q-mt-xs">

View File

@ -27,6 +27,7 @@ const claimActionsForm = ref();
const rows = ref([]); const rows = ref([]);
const selectedRows = ref([]); const selectedRows = ref([]);
const destinationTypes = ref([]); const destinationTypes = ref([]);
const shelvings = ref([]);
const totalClaimed = ref(null); const totalClaimed = ref(null);
const DEFAULT_MAX_RESPONSABILITY = 5; const DEFAULT_MAX_RESPONSABILITY = 5;
const DEFAULT_MIN_RESPONSABILITY = 1; const DEFAULT_MIN_RESPONSABILITY = 1;
@ -56,6 +57,12 @@ const columns = computed(() => [
field: (row) => row.claimDestinationFk, field: (row) => row.claimDestinationFk,
align: 'left', align: 'left',
}, },
{
name: 'shelving',
label: t('shelvings.shelving'),
field: (row) => row.shelvingFk,
align: 'left',
},
{ {
name: 'Landed', name: 'Landed',
label: t('Landed'), label: t('Landed'),
@ -125,6 +132,10 @@ async function updateDestination(claimDestinationFk, row, options = {}) {
options.reload && claimActionsForm.value.reload(); options.reload && claimActionsForm.value.reload();
} }
} }
async function updateShelving(shelvingFk, row) {
await axios.patch(`ClaimEnds/${row.id}`, { shelvingFk });
claimActionsForm.value.reload();
}
async function regularizeClaim() { async function regularizeClaim() {
await post(`Claims/${claimId}/regularizeClaim`); await post(`Claims/${claimId}/regularizeClaim`);
@ -200,6 +211,7 @@ async function post(query, params) {
auto-load auto-load
@on-fetch="(data) => (destinationTypes = data)" @on-fetch="(data) => (destinationTypes = data)"
/> />
<FetchData url="Shelvings" auto-load @on-fetch="(data) => (shelvings = data)" />
<RightMenu v-if="claim"> <RightMenu v-if="claim">
<template #right-panel> <template #right-panel>
<QCard class="totalClaim q-my-md q-pa-sm no-box-shadow"> <QCard class="totalClaim q-my-md q-pa-sm no-box-shadow">
@ -312,6 +324,20 @@ async function post(query, params) {
/> />
</QTd> </QTd>
</template> </template>
<template #body-cell-shelving="{ row }">
<QTd>
<VnSelect
v-model="row.shelvingFk"
:options="shelvings"
option-label="code"
option-value="id"
style="width: 100px"
hide-selected
@update:model-value="(value) => updateShelving(value, row)"
/>
</QTd>
</template>
<template #body-cell-price="{ value }"> <template #body-cell-price="{ value }">
<QTd align="center"> <QTd align="center">
{{ toCurrency(value) }} {{ toCurrency(value) }}
@ -354,7 +380,7 @@ async function post(query, params) {
(value) => (value) =>
updateDestination( updateDestination(
value, value,
props.row props.row,
) )
" "
/> />
@ -371,6 +397,17 @@ async function post(query, params) {
</QTable> </QTable>
</template> </template>
<template #moreBeforeActions> <template #moreBeforeActions>
<QBtn
color="primary"
text-color="white"
:unelevated="true"
:label="tMobile('Import claim')"
:title="t('Import claim')"
icon="Download"
@click="importToNewRefundTicket"
:disable="claim.claimStateFk == resolvedStateId"
:loading="loading"
/>
<QBtn <QBtn
color="primary" color="primary"
text-color="white" text-color="white"
@ -394,17 +431,6 @@ async function post(query, params) {
@click="dialogDestination = !dialogDestination" @click="dialogDestination = !dialogDestination"
:loading="loading" :loading="loading"
/> />
<QBtn
color="primary"
text-color="white"
:unelevated="true"
:label="tMobile('Import claim')"
:title="t('Import claim')"
icon="Upload"
@click="importToNewRefundTicket"
:disable="claim.claimStateFk == resolvedStateId"
:loading="loading"
/>
</template> </template>
</CrudModel> </CrudModel>
<QDialog v-model="dialogDestination"> <QDialog v-model="dialogDestination">

View File

@ -40,7 +40,7 @@ const workersOptions = ref([]);
</VnRow> </VnRow>
<VnRow> <VnRow>
<VnSelect <VnSelect
:label="t('claim.assignedTo')" :label="t('claim.attendedBy')"
v-model="data.workerFk" v-model="data.workerFk"
:options="workersOptions" :options="workersOptions"
option-value="id" option-value="id"

View File

@ -233,20 +233,27 @@ function claimUrl(section) {
<ClaimDescriptorMenu :claim="entity.claim" /> <ClaimDescriptorMenu :claim="entity.claim" />
</template> </template>
<template #body="{ entity: { claim, salesClaimed, developments } }"> <template #body="{ entity: { claim, salesClaimed, developments } }">
<QCard class="vn-one" v-if="$route.name != 'ClaimSummary'"> <QCard class="vn-one">
<VnTitle <VnTitle
:url="claimUrl('basic-data')" :url="claimUrl('basic-data')"
:text="t('globals.pageTitles.basicData')" :text="t('globals.pageTitles.basicData')"
/> />
<VnLv :label="t('claim.created')" :value="toDate(claim.created)" /> <VnLv
<VnLv :label="t('claim.state')"> v-if="$route.name != 'ClaimSummary'"
:label="t('claim.created')"
:value="toDate(claim.created)"
/>
<VnLv v-if="$route.name != 'ClaimSummary'" :label="t('claim.state')">
<template #value> <template #value>
<QChip :color="stateColor(claim.claimState.code)" dense> <QChip :color="stateColor(claim.claimState.code)" dense>
{{ claim.claimState.description }} {{ claim.claimState.description }}
</QChip> </QChip>
</template> </template>
</VnLv> </VnLv>
<VnLv :label="t('globals.salesPerson')"> <VnLv
v-if="$route.name != 'ClaimSummary'"
:label="t('globals.salesPerson')"
>
<template #value> <template #value>
<VnUserLink <VnUserLink
:name="claim.client?.salesPersonUser?.name" :name="claim.client?.salesPersonUser?.name"
@ -254,7 +261,7 @@ function claimUrl(section) {
/> />
</template> </template>
</VnLv> </VnLv>
<VnLv :label="t('claim.attendedBy')"> <VnLv v-if="$route.name != 'ClaimSummary'" :label="t('claim.attendedBy')">
<template #value> <template #value>
<VnUserLink <VnUserLink
:name="claim.worker?.user?.nickname" :name="claim.worker?.user?.nickname"
@ -262,7 +269,7 @@ function claimUrl(section) {
/> />
</template> </template>
</VnLv> </VnLv>
<VnLv :label="t('claim.customer')"> <VnLv v-if="$route.name != 'ClaimSummary'" :label="t('claim.customer')">
<template #value> <template #value>
<span class="link cursor-pointer"> <span class="link cursor-pointer">
{{ claim.client?.name }} {{ claim.client?.name }}
@ -274,6 +281,11 @@ function claimUrl(section) {
:label="t('claim.pickup')" :label="t('claim.pickup')"
:value="`${dashIfEmpty(claim.pickup)}`" :value="`${dashIfEmpty(claim.pickup)}`"
/> />
<VnLv
:label="t('globals.packages')"
:value="`${dashIfEmpty(claim.packages)}`"
:translation="(value) => t(`claim.packages`)"
/>
</QCard> </QCard>
<QCard class="vn-two"> <QCard class="vn-two">
<VnTitle :url="claimUrl('notes')" :text="t('claim.notes')" /> <VnTitle :url="claimUrl('notes')" :text="t('claim.notes')" />

View File

@ -19,30 +19,36 @@ const columns = [
name: 'itemFk', name: 'itemFk',
label: t('Id item'), label: t('Id item'),
columnFilter: false, columnFilter: false,
align: 'left', align: 'right',
}, },
{ {
name: 'ticketFk', name: 'ticketFk',
label: t('Ticket'), label: t('Ticket'),
columnFilter: false, columnFilter: false,
align: 'left', align: 'right',
}, },
{ {
name: 'claimDestinationFk', name: 'claimDestinationFk',
label: t('Destination'), label: t('Destination'),
columnFilter: false, columnFilter: false,
align: 'left', align: 'right',
},
{
name: 'shelvingCode',
label: t('Shelving'),
columnFilter: false,
align: 'right',
}, },
{ {
name: 'landed', name: 'landed',
label: t('Landed'), label: t('Landed'),
format: (row) => toDate(row.landed), format: (row) => toDate(row.landed),
align: 'left', align: 'center',
}, },
{ {
name: 'quantity', name: 'quantity',
label: t('Quantity'), label: t('Quantity'),
align: 'left', align: 'right',
}, },
{ {
name: 'concept', name: 'concept',
@ -52,18 +58,18 @@ const columns = [
{ {
name: 'price', name: 'price',
label: t('Price'), label: t('Price'),
align: 'left', align: 'right',
}, },
{ {
name: 'discount', name: 'discount',
label: t('Discount'), label: t('Discount'),
format: ({ discount }) => toPercentage(discount / 100), format: ({ discount }) => toPercentage(discount / 100),
align: 'left', align: 'right',
}, },
{ {
name: 'total', name: 'total',
label: t('Total'), label: t('Total'),
align: 'left', align: 'right',
}, },
]; ];
</script> </script>

View File

@ -106,7 +106,6 @@ const props = defineProps({
:label="t('claim.zone')" :label="t('claim.zone')"
v-model="params.zoneFk" v-model="params.zoneFk"
url="Zones" url="Zones"
:use-like="false"
outlined outlined
rounded rounded
dense dense

View File

@ -13,7 +13,6 @@ claim:
province: Province province: Province
zone: Zone zone: Zone
customerId: client ID customerId: client ID
assignedTo: Assigned
created: Created created: Created
details: Details details: Details
item: Item item: Item

View File

@ -13,7 +13,6 @@ claim:
province: Provincia province: Provincia
zone: Zona zone: Zona
customerId: ID de cliente customerId: ID de cliente
assignedTo: Asignado a
created: Creado created: Creado
details: Detalles details: Detalles
item: Artículo item: Artículo

View File

@ -143,6 +143,7 @@ const exprBuilder = (param, value) => {
outlined outlined
rounded rounded
auto-load auto-load
sortBy="name ASC"
/></QItemSection> /></QItemSection>
</QItem> </QItem>
<QItem class="q-mb-sm"> <QItem class="q-mb-sm">

View File

@ -78,10 +78,20 @@ const columns = computed(() => [
component: 'select', component: 'select',
attrs: { attrs: {
url: 'Workers/activeWithInheritedRole', url: 'Workers/activeWithInheritedRole',
fields: ['id', 'name'], fields: ['id', 'name', 'firstName'],
where: { role: 'salesPerson' }, where: { role: 'salesPerson' },
optionFilter: 'firstName', optionFilter: 'firstName',
}, },
columnFilter: {
component: 'select',
attrs: {
url: 'Workers/activeWithInheritedRole',
fields: ['id', 'name', 'firstName'],
where: { role: 'salesPerson' },
optionLabel: 'firstName',
optionValue: 'id',
},
},
create: false, create: false,
columnField: { columnField: {
component: null, component: null,

View File

@ -77,7 +77,6 @@ onBeforeMount(() => {
function setPaymentType(accounting) { function setPaymentType(accounting) {
if (!accounting) return; if (!accounting) return;
accountingType.value = accounting.accountingType; accountingType.value = accounting.accountingType;
initialData.description = []; initialData.description = [];
initialData.payed = Date.vnNew(); initialData.payed = Date.vnNew();
isCash.value = accountingType.value.code == 'cash'; isCash.value = accountingType.value.code == 'cash';
@ -87,14 +86,14 @@ function setPaymentType(accounting) {
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;
if (accountingType.value.code == 'compensation') if (accountingType.value.code == 'compensation')
return (initialData.description = ''); return (initialData.description = '');
if (accountingType.value.receiptDescription)
initialData.description.push(accountingType.value.receiptDescription);
if (initialData.description) initialData.description.push(initialData.description);
initialData.description = initialData.description.join(', '); let descriptions = [];
if (accountingType.value.receiptDescription)
descriptions.push(accountingType.value.receiptDescription);
if (initialData.description) descriptions.push(initialData.description);
initialData.description = descriptions.join(', ');
} }
const calculateFromAmount = (event) => { const calculateFromAmount = (event) => {

View File

@ -18,6 +18,7 @@ import VnInput from 'src/components/common/VnInput.vue';
import VnInputDate from 'src/components/common/VnInputDate.vue'; import VnInputDate from 'src/components/common/VnInputDate.vue';
import CustomerSamplesPreview from 'src/pages/Customer/components/CustomerSamplesPreview.vue'; import CustomerSamplesPreview from 'src/pages/Customer/components/CustomerSamplesPreview.vue';
import FormPopup from 'src/components/FormPopup.vue'; import FormPopup from 'src/components/FormPopup.vue';
import { useArrayData } from 'src/composables/useArrayData';
const { dialogRef, onDialogOK } = useDialogPluginComponent(); const { dialogRef, onDialogOK } = useDialogPluginComponent();
@ -39,7 +40,7 @@ const optionsSamplesVisible = ref([]);
const sampleType = ref({ hasPreview: false }); const sampleType = ref({ hasPreview: false });
const initialData = reactive({}); const initialData = reactive({});
const entityId = computed(() => route.params.id); const entityId = computed(() => route.params.id);
const customer = computed(() => state.get('Customer')); const customer = computed(() => useArrayData('Customer').store?.data);
const filterEmailUsers = { where: { userFk: user.value.id } }; const filterEmailUsers = { where: { userFk: user.value.id } };
const filterClientsAddresses = { const filterClientsAddresses = {
include: [ include: [
@ -65,9 +66,9 @@ const filterSamplesVisible = {
defineEmits(['confirm', ...useDialogPluginComponent.emits]); defineEmits(['confirm', ...useDialogPluginComponent.emits]);
onBeforeMount(async () => { onBeforeMount(async () => {
initialData.clientFk = customer.value.id; initialData.clientFk = customer.value?.id;
initialData.recipient = customer.value.email; initialData.recipient = customer.value?.email;
initialData.recipientId = customer.value.id; initialData.recipientId = customer.value?.id;
}); });
const setEmailUser = (data) => { const setEmailUser = (data) => {

View File

@ -27,7 +27,7 @@ const user = state.getUser();
const today = Date.vnNew(); const today = Date.vnNew();
today.setHours(0, 0, 0, 0); today.setHours(0, 0, 0, 0);
const warehousesOptions = ref([]); const warehousesOptions = ref([]);
const itemBalances = computed(() => arrayDataItemBalances.store.data); const itemBalances = computed(() => arrayDataItemBalances.store.data || []);
const where = computed(() => arrayDataItemBalances.store.filter.where || {}); const where = computed(() => arrayDataItemBalances.store.filter.where || {});
const showWhatsBeforeInventory = ref(false); const showWhatsBeforeInventory = ref(false);
const inventoriedDate = ref(null); const inventoriedDate = ref(null);

View File

@ -87,7 +87,7 @@ const insertTag = (rows) => {
tagFk: undefined, tagFk: undefined,
}" }"
:default-remove="false" :default-remove="false"
:filter="{ :user-filter="{
fields: ['id', 'itemFk', 'tagFk', 'value', 'priority'], fields: ['id', 'itemFk', 'tagFk', 'value', 'priority'],
where: { itemFk: route.params.id }, where: { itemFk: route.params.id },
include: { include: {
@ -119,6 +119,7 @@ const insertTag = (rows) => {
" "
:required="true" :required="true"
:rules="validate('itemTag.tagFk')" :rules="validate('itemTag.tagFk')"
:data-cy="`tag${row?.tag?.name}`"
/> />
<VnSelect <VnSelect
v-if="row.tag?.isFree === false" v-if="row.tag?.isFree === false"
@ -145,6 +146,7 @@ const insertTag = (rows) => {
:label="t('itemTags.value')" :label="t('itemTags.value')"
:is-clearable="false" :is-clearable="false"
@keyup.enter.stop="(data) => itemTagsRef.onSubmit(data)" @keyup.enter.stop="(data) => itemTagsRef.onSubmit(data)"
:data-cy="`tag${row?.tag?.name}Value`"
/> />
<VnInput <VnInput
:label="t('itemBasicData.relevancy')" :label="t('itemBasicData.relevancy')"
@ -162,6 +164,7 @@ const insertTag = (rows) => {
name="delete" name="delete"
size="sm" size="sm"
dense dense
:data-cy="`deleteTag${row?.tag?.name}`"
> >
<QTooltip> <QTooltip>
{{ t('itemTags.removeTag') }} {{ t('itemTags.removeTag') }}
@ -177,6 +180,7 @@ const insertTag = (rows) => {
icon="add" icon="add"
v-shortcut="'+'" v-shortcut="'+'"
fab fab
data-cy="createNewTag"
> >
<QTooltip> <QTooltip>
{{ t('itemTags.addTag') }} {{ t('itemTags.addTag') }}

View File

@ -335,7 +335,6 @@ const openTicketsDialog = (id) => {
<QBtn <QBtn
icon="vn:clone" icon="vn:clone"
color="primary" color="primary"
flat
class="q-mr-sm" class="q-mr-sm"
:disable="!selectedRows?.length" :disable="!selectedRows?.length"
@click="confirmationDialog = true" @click="confirmationDialog = true"
@ -345,7 +344,6 @@ const openTicketsDialog = (id) => {
<QBtn <QBtn
icon="cloud_download" icon="cloud_download"
color="primary" color="primary"
flat
class="q-mr-sm" class="q-mr-sm"
:disable="!selectedRows?.length" :disable="!selectedRows?.length"
@click="showRouteReport" @click="showRouteReport"
@ -355,7 +353,6 @@ const openTicketsDialog = (id) => {
<QBtn <QBtn
icon="check" icon="check"
color="primary" color="primary"
flat
class="q-mr-sm" class="q-mr-sm"
:disable="!selectedRows?.length" :disable="!selectedRows?.length"
@click="markAsServed()" @click="markAsServed()"

View File

@ -1,32 +1,26 @@
<script setup> <script setup>
import { ref } from 'vue'; import axios from 'axios';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { computed, ref } from 'vue';
import { useRoute } from 'vue-router';
import { toCurrency } from 'src/filters'; import { toCurrency } from 'src/filters';
import VnUsesMana from 'components/ui/VnUsesMana.vue'; import VnUsesMana from 'components/ui/VnUsesMana.vue';
const $props = defineProps({ const $props = defineProps({
mana: {
type: Number,
default: null,
},
newPrice: { newPrice: {
type: Number, type: Number,
default: 0, default: 0,
}, },
usesMana: {
type: Boolean,
default: false,
},
manaCode: {
type: String,
default: 'mana',
},
sale: { sale: {
type: Object, type: Object,
default: null, default: null,
}, },
}); });
const route = useRoute();
const mana = ref(null);
const usesMana = ref(false);
const emit = defineEmits(['save', 'cancel']); const emit = defineEmits(['save', 'cancel']);
const { t } = useI18n(); const { t } = useI18n();
@ -38,20 +32,35 @@ const save = (sale = $props.sale) => {
QPopupProxyRef.value.hide(); QPopupProxyRef.value.hide();
}; };
const getMana = async () => {
const { data } = await axios.get(`Tickets/${route.params.id}/getSalesPersonMana`);
mana.value = data;
await getUsesMana();
};
const getUsesMana = async () => {
const { data } = await axios.get('Sales/usesMana');
usesMana.value = data;
};
const cancel = () => { const cancel = () => {
emit('cancel'); emit('cancel');
QPopupProxyRef.value.hide(); QPopupProxyRef.value.hide();
}; };
const hasMana = computed(() => typeof mana.value === 'number');
defineExpose({ save }); defineExpose({ save });
</script> </script>
<template> <template>
<QPopupProxy ref="QPopupProxyRef" data-cy="ticketEditManaProxy"> <QPopupProxy
ref="QPopupProxyRef"
@before-show="getMana"
data-cy="ticketEditManaProxy"
>
<div class="container"> <div class="container">
<QSpinner v-if="!mana" color="primary" size="md" />
<div v-else>
<div class="header">Mana: {{ toCurrency(mana) }}</div> <div class="header">Mana: {{ toCurrency(mana) }}</div>
<div class="q-pa-md"> <QSpinner v-if="!hasMana" color="primary" size="md" />
<div class="q-pa-md" v-else>
<slot :popup="QPopupProxyRef" /> <slot :popup="QPopupProxyRef" />
<div v-if="usesMana" class="column q-gutter-y-sm q-mt-sm"> <div v-if="usesMana" class="column q-gutter-y-sm q-mt-sm">
<VnUsesMana :mana-code="manaCode" /> <VnUsesMana :mana-code="manaCode" />
@ -63,7 +72,7 @@ defineExpose({ save });
</span> </span>
</div> </div>
</div> </div>
</div>
<div class="row"> <div class="row">
<QBtn <QBtn
color="primary" color="primary"

View File

@ -45,7 +45,6 @@ const isTicketEditable = ref(false);
const sales = ref([]); const sales = ref([]);
const editableStatesOptions = ref([]); const editableStatesOptions = ref([]);
const selectedSales = ref([]); const selectedSales = ref([]);
const mana = ref(null);
const manaCode = ref('mana'); const manaCode = ref('mana');
const ticketState = computed(() => store.data?.ticketState?.state?.code); const ticketState = computed(() => store.data?.ticketState?.state?.code);
const transfer = ref({ const transfer = ref({
@ -175,17 +174,21 @@ const getSaleTotal = (sale) => {
return price - discount; return price - discount;
}; };
const getRowUpdateInputEvents = (sale) => ({
'keyup.enter': () => {
changeQuantity(sale);
},
blur: () => {
changeQuantity(sale);
},
});
const resetChanges = async () => { const resetChanges = async () => {
arrayData.fetch({ append: false }); arrayData.fetch({ append: false });
tableRef.value.reload(); tableRef.value.reload();
}; };
const rowToUpdate = ref(null);
const changeQuantity = async (sale) => { const changeQuantity = async (sale) => {
if ( if (!sale.itemFk || sale.quantity == null || sale?.originalQuantity === sale.quantity)
!sale.itemFk ||
sale.quantity == null ||
edit.value?.oldQuantity === sale.quantity
)
return; return;
if (!sale.id) return addSale(sale); if (!sale.id) return addSale(sale);
@ -197,11 +200,8 @@ const changeQuantity = async (sale) => {
const updateQuantity = async (sale) => { const updateQuantity = async (sale) => {
try { try {
let { quantity, id } = sale; let { quantity, id } = sale;
if (!rowToUpdate.value) return;
rowToUpdate.value = null;
sale.isNew = false; sale.isNew = false;
const params = { quantity: quantity }; await axios.post(`Sales/${id}/updateQuantity`, { quantity });
await axios.post(`Sales/${id}/updateQuantity`, params);
notify('globals.dataSaved', 'positive'); notify('globals.dataSaved', 'positive');
tableRef.value.reload(); tableRef.value.reload();
} catch (e) { } catch (e) {
@ -258,18 +258,6 @@ const DEFAULT_EDIT = {
oldQuantity: null, oldQuantity: null,
}; };
const edit = ref({ ...DEFAULT_EDIT }); const edit = ref({ ...DEFAULT_EDIT });
const usesMana = ref(null);
const getUsesMana = async () => {
const { data } = await axios.get('Sales/usesMana');
usesMana.value = data;
};
const getMana = async () => {
const { data } = await axios.get(`Tickets/${route.params.id}/getSalesPersonMana`);
mana.value = data;
await getUsesMana();
};
const selectedValidSales = computed(() => { const selectedValidSales = computed(() => {
if (!sales.value) return; if (!sales.value) return;
@ -277,7 +265,6 @@ const selectedValidSales = computed(() => {
}); });
const onOpenEditPricePopover = async (sale) => { const onOpenEditPricePopover = async (sale) => {
await getMana();
edit.value = { edit.value = {
sale: JSON.parse(JSON.stringify(sale)), sale: JSON.parse(JSON.stringify(sale)),
price: sale.price, price: sale.price,
@ -285,7 +272,6 @@ const onOpenEditPricePopover = async (sale) => {
}; };
const onOpenEditDiscountPopover = async (sale) => { const onOpenEditDiscountPopover = async (sale) => {
await getMana();
if (isLocked.value) return; if (isLocked.value) return;
if (sale) { if (sale) {
edit.value = { edit.value = {
@ -306,7 +292,6 @@ const changePrice = async (sale) => {
await confirmUpdate(() => updatePrice(sale, newPrice)); await confirmUpdate(() => updatePrice(sale, newPrice));
} else updatePrice(sale, newPrice); } else updatePrice(sale, newPrice);
} }
await getMana();
}; };
const updatePrice = async (sale, newPrice) => { const updatePrice = async (sale, newPrice) => {
await axios.post(`Sales/${sale.id}/updatePrice`, { newPrice }); await axios.post(`Sales/${sale.id}/updatePrice`, { newPrice });
@ -599,9 +584,7 @@ watch(
:is-ticket-editable="isTicketEditable" :is-ticket-editable="isTicketEditable"
:sales="selectedValidSales" :sales="selectedValidSales"
:disable="!hasSelectedRows" :disable="!hasSelectedRows"
:mana="mana"
:ticket-config="ticketConfig" :ticket-config="ticketConfig"
@get-mana="getMana()"
@update-discounts="updateDiscounts" @update-discounts="updateDiscounts"
@refresh-table="resetChanges" @refresh-table="resetChanges"
/> />
@ -772,9 +755,7 @@ watch(
v-if="row.isNew || isTicketEditable" v-if="row.isNew || isTicketEditable"
type="number" type="number"
v-model.number="row.quantity" v-model.number="row.quantity"
@blur="changeQuantity(row)" v-on="getRowUpdateInputEvents(row)"
@keyup.enter.stop="changeQuantity(row)"
@update:model-value="() => (rowToUpdate = row)"
@focus="edit.oldQuantity = row.quantity" @focus="edit.oldQuantity = row.quantity"
/> />
<span v-else>{{ row.quantity }}</span> <span v-else>{{ row.quantity }}</span>
@ -786,7 +767,6 @@ watch(
</QBtn> </QBtn>
<TicketEditManaProxy <TicketEditManaProxy
ref="editPriceProxyRef" ref="editPriceProxyRef"
:mana="mana"
:sale="row" :sale="row"
:new-price="getNewPrice" :new-price="getNewPrice"
@save="changePrice" @save="changePrice"
@ -809,10 +789,8 @@ watch(
<TicketEditManaProxy <TicketEditManaProxy
ref="editManaProxyRef" ref="editManaProxyRef"
:mana="mana"
:sale="row" :sale="row"
:new-price="getNewPrice" :new-price="getNewPrice"
:uses-mana="usesMana"
:mana-code="manaCode" :mana-code="manaCode"
@save="changeDiscount" @save="changeDiscount"
> >

View File

@ -34,10 +34,6 @@ const props = defineProps({
type: Array, type: Array,
default: () => [], default: () => [],
}, },
mana: {
type: Number,
default: null,
},
ticketConfig: { ticketConfig: {
type: Array, type: Array,
default: () => [], default: () => [],
@ -50,6 +46,7 @@ const { dialog } = useQuasar();
const { notify } = useNotify(); const { notify } = useNotify();
const acl = useAcl(); const acl = useAcl();
const btnDropdownRef = ref(null); const btnDropdownRef = ref(null);
const editManaProxyRef = ref(null);
const { openConfirmationModal } = useVnConfirm(); const { openConfirmationModal } = useVnConfirm();
const newDiscount = ref(null); const newDiscount = ref(null);
@ -131,13 +128,13 @@ const createClaim = () => {
openConfirmationModal( openConfirmationModal(
t('Claim out of time'), t('Claim out of time'),
t('Do you want to continue?'), t('Do you want to continue?'),
onCreateClaimAccepted onCreateClaimAccepted,
); );
else else
openConfirmationModal( openConfirmationModal(
t('Do you want to create a claim?'), t('Do you want to create a claim?'),
false, false,
onCreateClaimAccepted onCreateClaimAccepted,
); );
}; };
@ -216,8 +213,14 @@ const createRefund = async (withWarehouse) => {
<QItemSection> <QItemSection>
<QItemLabel>{{ t('Update discount') }}</QItemLabel> <QItemLabel>{{ t('Update discount') }}</QItemLabel>
</QItemSection> </QItemSection>
<TicketEditManaProxy :mana="props.mana" @save="changeMultipleDiscount()"> <TicketEditManaProxy
ref="editManaProxyRef"
:sale="row"
@save="changeMultipleDiscount"
>
<VnInput <VnInput
autofocus
@keyup.enter.stop="() => editManaProxyRef.save(row)"
v-model.number="newDiscount" v-model.number="newDiscount"
:label="t('ticketSale.discount')" :label="t('ticketSale.discount')"
type="number" type="number"

View File

@ -31,7 +31,7 @@ const oldQuantity = ref(null);
watch( watch(
() => route.params.id, () => route.params.id,
async () => nextTick(async () => await saleTrackingFetchDataRef.value.fetch()) async () => nextTick(async () => await saleTrackingFetchDataRef.value.fetch()),
); );
const columns = computed(() => [ const columns = computed(() => [
@ -212,7 +212,7 @@ const updateShelving = async (sale) => {
const { data: patchResponseData } = await axios.patch( const { data: patchResponseData } = await axios.patch(
`ItemShelvings/${sale.itemShelvingFk}`, `ItemShelvings/${sale.itemShelvingFk}`,
params params,
); );
const filter = { const filter = {
fields: ['parkingFk'], fields: ['parkingFk'],
@ -385,7 +385,7 @@ const qCheckBoxController = (sale, action) => {
</template> </template>
<template #body-cell-parking="{ row }"> <template #body-cell-parking="{ row }">
<QTd style="width: 10%"> <QTd style="width: 10%">
{{ dashIfEmpty(row.parkingFk) }} {{ dashIfEmpty(row.parkingCode) }}
</QTd> </QTd>
</template> </template>
<template #body-cell-actions="{ row }"> <template #body-cell-actions="{ row }">

View File

@ -46,6 +46,15 @@ const descriptorData = useArrayData('Ticket');
onMounted(async () => { onMounted(async () => {
ticketUrl.value = (await getUrl('ticket/')) + entityId.value + '/'; ticketUrl.value = (await getUrl('ticket/')) + entityId.value + '/';
}); });
const formattedAddress = computed(() => {
if (!ticket.value) return '';
const address = ticket.value.address;
const postcode = address.postalCode;
const province = address.province ? `(${address.province.name})` : '';
return `${address.street} - ${postcode} - ${address.city} ${province}`;
});
function isEditable() { function isEditable() {
try { try {
@ -238,7 +247,7 @@ onMounted(async () => {
/> />
<VnLv <VnLv
:label="t('ticket.summary.consigneeStreet')" :label="t('ticket.summary.consigneeStreet')"
:value="entity.address?.street" :value="formattedAddress"
/> />
</QCard> </QCard>
<QCard class="vn-one" v-if="entity.notes.length"> <QCard class="vn-one" v-if="entity.notes.length">

View File

@ -293,6 +293,7 @@ en:
clientFk: Customer clientFk: Customer
orderFk: Order orderFk: Order
from: From from: From
shipped: Shipped
to: To to: To
salesPersonFk: Salesperson salesPersonFk: Salesperson
stateFk: State stateFk: State
@ -320,6 +321,7 @@ es:
clientFk: Cliente clientFk: Cliente
orderFk: Pedido orderFk: Pedido
from: Desde from: Desde
shipped: F. envío
to: Hasta to: Hasta
salesPersonFk: Comercial salesPersonFk: Comercial
stateFk: Estado stateFk: Estado

View File

@ -108,13 +108,11 @@ const columns = computed(() => [
}, },
{ {
align: 'left', align: 'left',
name: 'shippedDate', name: 'shipped',
cardVisible: true, cardVisible: true,
label: t('ticketList.shipped'), label: t('ticketList.shipped'),
columnFilter: { columnFilter: {
component: 'date', component: 'date',
alias: 't',
inWhere: true,
}, },
format: ({ shippedDate }) => toDate(shippedDate), format: ({ shippedDate }) => toDate(shippedDate),
}, },

View File

@ -3,7 +3,7 @@ import { ref, computed } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import VnTable from 'components/VnTable/VnTable.vue'; import VnTable from 'components/VnTable/VnTable.vue';
import { toDate } from 'src/filters'; import { dashIfEmpty, toDate } from 'src/filters';
import { useQuasar } from 'quasar'; import { useQuasar } from 'quasar';
import axios from 'axios'; import axios from 'axios';
@ -15,7 +15,7 @@ const quasar = useQuasar();
async function reactivateWorker() { async function reactivateWorker() {
const hasToReactive = tableRef.value.CrudModelRef.formData.find( const hasToReactive = tableRef.value.CrudModelRef.formData.find(
(data) => !data.ended (data) => !data.ended,
); );
if (hasToReactive) { if (hasToReactive) {
quasar quasar
@ -38,25 +38,25 @@ const columns = computed(() => [
{ {
name: 'started', name: 'started',
label: t('worker.business.tableVisibleColumns.started'), label: t('worker.business.tableVisibleColumns.started'),
align: 'left',
format: ({ started }) => toDate(started), format: ({ started }) => toDate(started),
component: 'date', component: 'date',
cardVisible: true, cardVisible: true,
create: true, create: true,
width: '90px',
}, },
{ {
name: 'ended', name: 'ended',
label: t('worker.business.tableVisibleColumns.ended'), label: t('worker.business.tableVisibleColumns.ended'),
align: 'left',
format: ({ ended }) => toDate(ended), format: ({ ended }) => toDate(ended),
component: 'date', component: 'date',
cardVisible: true, cardVisible: true,
create: true, create: true,
width: '90px',
}, },
{ {
label: t('worker.business.tableVisibleColumns.company'), label: t('worker.business.tableVisibleColumns.company'),
align: 'left', toolTip: t('worker.business.tableVisibleColumns.company'),
name: 'companyCodeFk', name: 'companyCodeFk',
component: 'select', component: 'select',
attrs: { attrs: {
@ -65,23 +65,23 @@ const columns = computed(() => [
optionLabel: 'code', optionLabel: 'code',
optionValue: 'code', optionValue: 'code',
}, },
cardVisible: true,
create: true, create: true,
width: '60px',
}, },
{ {
align: 'left',
name: 'reasonEndFk', name: 'reasonEndFk',
component: 'select', component: 'select',
label: t('worker.business.tableVisibleColumns.reasonEnd'), label: t('worker.business.tableVisibleColumns.reasonEnd'),
toolTip: t('worker.business.tableVisibleColumns.reasonEnd'),
attrs: { attrs: {
url: 'BusinessReasonEnds', url: 'BusinessReasonEnds',
fields: ['id', 'reason'], fields: ['id', 'reason'],
optionLabel: 'reason', optionLabel: 'reason',
}, },
cardVisible: true, cardVisible: true,
format: ({ reason }, dashIfEmpty) => dashIfEmpty(reason),
}, },
{ {
align: 'left',
name: 'departmentFk', name: 'departmentFk',
component: 'select', component: 'select',
label: t('worker.business.tableVisibleColumns.department'), label: t('worker.business.tableVisibleColumns.department'),
@ -89,15 +89,19 @@ const columns = computed(() => [
url: 'Departments', url: 'Departments',
fields: ['id', 'name'], fields: ['id', 'name'],
optionLabel: 'name', optionLabel: 'name',
optionValue: 'id',
}, },
cardVisible: true, cardVisible: true,
create: true, create: true,
width: '80px',
format: ({ departmentName }, dashIfEmpty) => dashIfEmpty(departmentName),
}, },
{ {
align: 'left', align: 'left',
name: 'workerBusinessProfessionalCategoryFk', name: 'workerBusinessProfessionalCategoryFk',
component: 'select', component: 'select',
label: t('worker.business.tableVisibleColumns.professionalCategory'), label: t('worker.business.tableVisibleColumns.professionalCategory'),
toolTip: t('worker.business.tableVisibleColumns.professionalCategory'),
attrs: { attrs: {
url: 'WorkerBusinessProfessionalCategories', url: 'WorkerBusinessProfessionalCategories',
fields: ['id', 'description', 'code'], fields: ['id', 'description', 'code'],
@ -105,6 +109,9 @@ const columns = computed(() => [
}, },
cardVisible: true, cardVisible: true,
create: true, create: true,
width: '100px',
format: ({ professionalDescription }, dashIfEmpty) =>
dashIfEmpty(professionalDescription),
}, },
{ {
align: 'left', align: 'left',
@ -118,6 +125,8 @@ const columns = computed(() => [
}, },
cardVisible: true, cardVisible: true,
create: true, create: true,
format: ({ calendarTypeDescription }, dashIfEmpty) =>
dashIfEmpty(calendarTypeDescription),
}, },
{ {
align: 'left', align: 'left',
@ -131,6 +140,8 @@ const columns = computed(() => [
}, },
cardVisible: true, cardVisible: true,
create: true, create: true,
width: '100px',
format: ({ workCenterName }, dashIfEmpty) => dashIfEmpty(workCenterName),
}, },
{ {
align: 'left', align: 'left',
@ -144,6 +155,7 @@ const columns = computed(() => [
}, },
cardVisible: true, cardVisible: true,
create: true, create: true,
format: ({ payrollDescription }, dashIfEmpty) => dashIfEmpty(payrollDescription),
}, },
{ {
align: 'left', align: 'left',
@ -157,6 +169,7 @@ const columns = computed(() => [
}, },
cardVisible: true, cardVisible: true,
create: true, create: true,
format: ({ occupationName }, dashIfEmpty) => dashIfEmpty(occupationName),
}, },
{ {
align: 'left', align: 'left',
@ -165,6 +178,7 @@ const columns = computed(() => [
component: 'input', component: 'input',
cardVisible: true, cardVisible: true,
create: true, create: true,
width: '50px',
}, },
{ {
align: 'left', align: 'left',
@ -177,6 +191,8 @@ const columns = computed(() => [
}, },
cardVisible: true, cardVisible: true,
create: true, create: true,
format: ({ workerBusinessTypeName }, dashIfEmpty) =>
dashIfEmpty(workerBusinessTypeName),
}, },
{ {
align: 'left', align: 'left',
@ -185,6 +201,7 @@ const columns = computed(() => [
component: 'input', component: 'input',
cardVisible: true, cardVisible: true,
create: true, create: true,
width: '70px',
}, },
{ {
align: 'left', align: 'left',
@ -193,6 +210,7 @@ const columns = computed(() => [
component: 'input', component: 'input',
cardVisible: true, cardVisible: true,
create: true, create: true,
width: '70px',
}, },
{ {
name: 'notes', name: 'notes',
@ -208,7 +226,7 @@ const columns = computed(() => [
<VnTable <VnTable
ref="tableRef" ref="tableRef"
data-key="WorkerBusiness" data-key="WorkerBusiness"
:url="`Workers/${entityId}/Business`" :url="`Workers/${entityId}/getWorkerBusiness`"
save-url="/Businesses/crud" save-url="/Businesses/crud"
:create="{ :create="{
urlCreate: `Workers/${entityId}/Business`, urlCreate: `Workers/${entityId}/Business`,
@ -218,13 +236,12 @@ const columns = computed(() => [
}" }"
order="id DESC" order="id DESC"
:columns="columns" :columns="columns"
default-mode="card"
auto-load auto-load
:disable-option="{ table: true }" :disable-option="{ card: true }"
:right-search="false" :right-search="false"
card-class="grid-two q-gutter-x-xl q-gutter-y-md q-pr-lg q-py-lg"
:is-editable="true" :is-editable="true"
:use-model="true" :use-model="true"
:right-search-icon="false"
@save-changes="(data) => reactivateWorker(data)" @save-changes="(data) => reactivateWorker(data)"
/> />
</template> </template>

View File

@ -111,6 +111,7 @@ const handlePhotoUpdated = (evt = false) => {
<template #body="{ entity }"> <template #body="{ entity }">
<VnLv :label="t('globals.user')" :value="entity.user?.name" /> <VnLv :label="t('globals.user')" :value="entity.user?.name" />
<VnLv <VnLv
class="ellipsis-text"
:label="t('globals.params.email')" :label="t('globals.params.email')"
:value="entity.user?.emailUser?.email" :value="entity.user?.emailUser?.email"
copy copy
@ -177,6 +178,12 @@ const handlePhotoUpdated = (evt = false) => {
.photo { .photo {
height: 256px; height: 256px;
} }
.ellipsis-text {
width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
</style> </style>
<i18n> <i18n>

View File

@ -65,6 +65,7 @@ const tableFilter = {
const columns = computed(() => [ const columns = computed(() => [
{ {
align: 'left',
name: 'id', name: 'id',
label: t('list.id'), label: t('list.id'),
chip: { chip: {
@ -74,8 +75,6 @@ const columns = computed(() => [
columnFilter: { columnFilter: {
inWhere: true, inWhere: true,
}, },
columnClass: 'shrink-column',
component: 'number',
}, },
{ {
align: 'left', align: 'left',
@ -107,6 +106,7 @@ const columns = computed(() => [
format: (row, dashIfEmpty) => dashIfEmpty(row?.agencyMode?.name), format: (row, dashIfEmpty) => dashIfEmpty(row?.agencyMode?.name),
}, },
{ {
align: 'left',
name: 'price', name: 'price',
label: t('list.price'), label: t('list.price'),
cardVisible: true, cardVisible: true,
@ -114,11 +114,9 @@ const columns = computed(() => [
columnFilter: { columnFilter: {
inWhere: true, inWhere: true,
}, },
columnClass: 'shrink-column',
component: 'number',
}, },
{ {
align: 'center', align: 'left',
name: 'hour', name: 'hour',
label: t('list.close'), label: t('list.close'),
cardVisible: true, cardVisible: true,
@ -180,8 +178,6 @@ function formatRow(row) {
<ZoneFilterPanel data-key="ZonesList" /> <ZoneFilterPanel data-key="ZonesList" />
</template> </template>
</RightMenu> </RightMenu>
<div class="table-container">
<div class="column items-center">
<VnTable <VnTable
ref="tableRef" ref="tableRef"
data-key="ZonesList" data-key="ZonesList"
@ -196,8 +192,6 @@ function formatRow(row) {
:columns="columns" :columns="columns"
redirect="zone" redirect="zone"
:right-search="false" :right-search="false"
table-height="85vh"
order="id ASC"
> >
<template #column-addressFk="{ row }"> <template #column-addressFk="{ row }">
{{ dashIfEmpty(formatRow(row)) }} {{ dashIfEmpty(formatRow(row)) }}
@ -245,8 +239,6 @@ function formatRow(row) {
/> />
</template> </template>
</VnTable> </VnTable>
</div>
</div>
</template> </template>
<i18n> <i18n>
@ -254,20 +246,3 @@ es:
Search zone: Buscar zona Search zone: Buscar zona
You can search zones by id or name: Puedes buscar zonas por id o nombre You can search zones by id or name: Puedes buscar zonas por id o nombre
</i18n> </i18n>
<style lang="scss" scoped>
.table-container {
display: flex;
justify-content: center;
}
.column {
display: flex;
flex-direction: column;
align-items: center;
min-width: 70%;
}
:deep(.shrink-column) {
width: 8%;
}
</style>

View File

@ -1,6 +1,6 @@
/// <reference types="cypress" /> /// <reference types="cypress" />
describe('ClaimAction', () => { describe('ClaimAction', () => {
const claimId = 2; const claimId = 1;
const firstRow = 'tbody > :nth-child(1)'; const firstRow = 'tbody > :nth-child(1)';
const destinationRow = '.q-item__section > .q-field'; const destinationRow = '.q-item__section > .q-field';

View File

@ -20,7 +20,7 @@ describe('Entry', () => {
); );
}); });
it.skip('Create entry, modify travel and add buys', () => { it('Create entry, modify travel and add buys', () => {
createEntryAndBuy(); createEntryAndBuy();
cy.get('a[data-cy="EntryBasicData-menu-item"]').click(); cy.get('a[data-cy="EntryBasicData-menu-item"]').click();
selectTravel('two'); selectTravel('two');
@ -184,9 +184,8 @@ describe('Entry', () => {
} }
function deleteEntry() { function deleteEntry() {
cy.get('[data-cy="descriptor-more-opts"]').click(); cy.get('[data-cy="descriptor-more-opts"]').should('be.visible').click();
cy.waitForElement('div[data-cy="delete-entry"]'); cy.waitForElement('div[data-cy="delete-entry"]').click();
cy.get('div[data-cy="delete-entry"]').should('be.visible').click();
cy.url().should('include', 'list'); cy.url().should('include', 'list');
} }

View File

@ -1,4 +1,3 @@
/// <reference types="cypress" />
describe('Item tag', () => { describe('Item tag', () => {
beforeEach(() => { beforeEach(() => {
cy.viewport(1920, 1080); cy.viewport(1920, 1080);
@ -8,25 +7,27 @@ describe('Item tag', () => {
cy.waitForElement('[data-cy="itemTags"]'); cy.waitForElement('[data-cy="itemTags"]');
}); });
const createNewTag = 'createNewTag';
const saveBtn = 'crudModelDefaultSaveBtn';
const newTag = 'tagundefined';
it('should throw an error adding an existent tag', () => { it('should throw an error adding an existent tag', () => {
cy.get('.q-page-sticky > div').click(); cy.dataCy(createNewTag).click();
cy.selectOption(':nth-child(8) > .q-select', 'Tallos'); cy.dataCy(newTag).should('be.visible').click().type('Genero{enter}');
cy.get(':nth-child(8) > [label="Value"]').type('1'); cy.dataCy('tagGeneroValue').eq(1).should('be.visible');
cy.dataCy('crudModelDefaultSaveBtn').click(); cy.dataCy(saveBtn).click();
cy.checkNotification("The tag or priority can't be repeated for an item"); cy.checkNotification("The tag or priority can't be repeated for an item");
}); });
it('should add a new tag', () => { it('should add a new tag', () => {
cy.get('.q-page-sticky > div').click(); cy.dataCy(createNewTag).click();
cy.selectOption(':nth-child(8) > .q-select', 'Ancho de la base'); cy.dataCy(newTag).should('be.visible').click().type('Forma{enter}');
cy.get(':nth-child(8) > [label="Value"]').type('50'); cy.dataCy('tagFormaValue').should('be.visible').type('50');
cy.dataCy('crudModelDefaultSaveBtn').click(); cy.dataCy(saveBtn).click();
cy.checkNotification('Data saved'); cy.checkNotification('Data saved');
cy.dataCy('itemTags') cy.dataCy('deleteTagForma').should('be.visible').click();
.children(':nth-child(8)') cy.dataCy('VnConfirm_confirm').should('be.visible').click();
.find('.justify-center > .q-icon')
.click();
cy.dataCy('VnConfirm_confirm').click();
cy.checkNotification('Data saved'); cy.checkNotification('Data saved');
}); });
}); });