forked from verdnatura/salix-front
fix: refs #7553 fixed QChips like Salix
This commit is contained in:
parent
8bcecb91c6
commit
b622f6ef96
|
@ -255,7 +255,11 @@ const fetchAddresses = async (formData) => {
|
|||
}
|
||||
};
|
||||
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) => {
|
||||
|
@ -264,13 +268,8 @@ const getDateColor = (date) => {
|
|||
const timeTicket = new Date(date);
|
||||
timeTicket.setHours(0, 0, 0, 0);
|
||||
const comparation = today - timeTicket;
|
||||
return comparation < 0 ? 'bg-success' : 'bg-warning';
|
||||
};
|
||||
|
||||
const getTotalColor = () => {
|
||||
// const total = row.totalWithVat;
|
||||
// return total > 0 && total < 50 ? 'bg-warning' : '';
|
||||
return 'bg-warning';
|
||||
if (comparation == 0) return 'bg-warning';
|
||||
if (comparation < 0) return 'bg-success';
|
||||
};
|
||||
|
||||
onMounted(() => (stateStore.rightDrawer = true));
|
||||
|
@ -523,9 +522,11 @@ function setReference(data) {
|
|||
</span>
|
||||
</template>
|
||||
<template #column-shippedDate="{ row }">
|
||||
<span v-if="getDateColor(row.shipped)">
|
||||
<QChip :class="getDateColor(row.shipped)" dense square>
|
||||
{{ row.shippedDate }}
|
||||
</QChip>
|
||||
</span>
|
||||
</template>
|
||||
<template #column-nickname="{ row }">
|
||||
<span class="link" @click.stop>
|
||||
|
@ -534,9 +535,14 @@ function setReference(data) {
|
|||
</span>
|
||||
</template>
|
||||
<template #column-stateFk="{ row }">
|
||||
<span v-if="getColor(row)">
|
||||
<QChip :class="getColor(row)" dense square>
|
||||
{{ row.state }}
|
||||
</QChip>
|
||||
</span>
|
||||
<span v-else>
|
||||
{{ row.state }}
|
||||
</span>
|
||||
</template>
|
||||
<template #column-zoneFk="{ row }">
|
||||
<span class="link" @click.stop>
|
||||
|
@ -547,7 +553,7 @@ function setReference(data) {
|
|||
<template #column-totalWithVat="{ row }">
|
||||
<QChip
|
||||
v-if="row.totalWithVat > 0 && row.totalWithVat < 50"
|
||||
:class="getTotalColor()"
|
||||
class="bg-warning"
|
||||
dense
|
||||
square
|
||||
>
|
||||
|
|
Loading…
Reference in New Issue