fix: refs #7553 fixed QChips like Salix
gitea/salix-front/pipeline/pr-dev There was a failure building this commit Details

This commit is contained in:
Jon Elias 2024-09-03 07:36:40 +02:00
parent 8bcecb91c6
commit b622f6ef96
1 changed files with 20 additions and 14 deletions

View File

@ -255,7 +255,11 @@ const fetchAddresses = async (formData) => {
} }
}; };
const getColor = (row) => { const getColor = (row) => {
return row?.classColor ? `bg-${row.classColor}` : 'bg-orange'; // return row?.classColor ? `bg-${row.classColor}` : 'bg-orange';
if (row.alertLevelCode === 'OK') return 'bg-success';
else if (row.alertLevelCode === 'FREE') return 'bg-notice';
else if (row.alertLevel === 1) return 'bg-warning';
else if (row.alertLevel === 0) return 'bg-alert';
}; };
const getDateColor = (date) => { const getDateColor = (date) => {
@ -264,13 +268,8 @@ const getDateColor = (date) => {
const timeTicket = new Date(date); const timeTicket = new Date(date);
timeTicket.setHours(0, 0, 0, 0); timeTicket.setHours(0, 0, 0, 0);
const comparation = today - timeTicket; const comparation = today - timeTicket;
return comparation < 0 ? 'bg-success' : 'bg-warning'; if (comparation == 0) return 'bg-warning';
}; if (comparation < 0) return 'bg-success';
const getTotalColor = () => {
// const total = row.totalWithVat;
// return total > 0 && total < 50 ? 'bg-warning' : '';
return 'bg-warning';
}; };
onMounted(() => (stateStore.rightDrawer = true)); onMounted(() => (stateStore.rightDrawer = true));
@ -523,9 +522,11 @@ function setReference(data) {
</span> </span>
</template> </template>
<template #column-shippedDate="{ row }"> <template #column-shippedDate="{ row }">
<QChip :class="getDateColor(row.shipped)" dense square> <span v-if="getDateColor(row.shipped)">
{{ row.shippedDate }} <QChip :class="getDateColor(row.shipped)" dense square>
</QChip> {{ row.shippedDate }}
</QChip>
</span>
</template> </template>
<template #column-nickname="{ row }"> <template #column-nickname="{ row }">
<span class="link" @click.stop> <span class="link" @click.stop>
@ -534,9 +535,14 @@ function setReference(data) {
</span> </span>
</template> </template>
<template #column-stateFk="{ row }"> <template #column-stateFk="{ row }">
<QChip :class="getColor(row)" dense square> <span v-if="getColor(row)">
<QChip :class="getColor(row)" dense square>
{{ row.state }}
</QChip>
</span>
<span v-else>
{{ row.state }} {{ row.state }}
</QChip> </span>
</template> </template>
<template #column-zoneFk="{ row }"> <template #column-zoneFk="{ row }">
<span class="link" @click.stop> <span class="link" @click.stop>
@ -547,7 +553,7 @@ function setReference(data) {
<template #column-totalWithVat="{ row }"> <template #column-totalWithVat="{ row }">
<QChip <QChip
v-if="row.totalWithVat > 0 && row.totalWithVat < 50" v-if="row.totalWithVat > 0 && row.totalWithVat < 50"
:class="getTotalColor()" class="bg-warning"
dense dense
square square
> >