forked from verdnatura/salix-front
refs #5986 fix state color
This commit is contained in:
parent
f94f87590a
commit
8ba7615aee
|
@ -67,7 +67,12 @@ const filter = {
|
|||
},
|
||||
],
|
||||
};
|
||||
|
||||
function stateColor(state) {
|
||||
if (state.code === 'OK') return 'text-green';
|
||||
if (state.code === 'FREE') return 'text-blue-3';
|
||||
if (state.alertLevel === 1) return 'text-primary';
|
||||
if (state.alertLevel === 0) return 'text-red';
|
||||
}
|
||||
const data = ref(useCardDescription());
|
||||
const setData = (entity) =>
|
||||
(data.value = useCardDescription(entity.client.name, entity.id));
|
||||
|
@ -88,9 +93,9 @@ const setData = (entity) =>
|
|||
<template #body="{ entity }">
|
||||
<VnLv v-if="entity.ticketState" :label="t('ticket.card.state')">
|
||||
<template #value>
|
||||
<QChip square size="sm" :color="entity.ticketState.state.classColor">
|
||||
<span :class="stateColor(entity.ticketState.state)">
|
||||
{{ entity.ticketState.state.name }}
|
||||
</QChip>
|
||||
</span>
|
||||
</template>
|
||||
</VnLv>
|
||||
<VnLv :label="t('ticket.card.shipped')" :value="toDate(entity.shipped)" />
|
||||
|
|
|
@ -136,7 +136,7 @@ async function changeState(value) {
|
|||
{{ t('ticket.summary.state') }}
|
||||
</QItemLabel>
|
||||
<QItemLabel
|
||||
:class="`text-${ticket.ticketState.state.classColor}`"
|
||||
:class="stateColor(ticket.ticketState.state)"
|
||||
>
|
||||
{{ ticket.ticketState.state.name }}
|
||||
</QItemLabel>
|
||||
|
|
|
@ -142,15 +142,13 @@ function viewSummary(id) {
|
|||
{{ t('ticket.list.state') }}
|
||||
</QItemLabel>
|
||||
<QItemLabel>
|
||||
<QChip
|
||||
square
|
||||
size="sm"
|
||||
<QBadge
|
||||
:color="stateColor(row)"
|
||||
class="q-ma-none"
|
||||
dense
|
||||
>
|
||||
{{ row.state }}
|
||||
</QChip>
|
||||
</QBadge>
|
||||
</QItemLabel>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
|
|
Loading…
Reference in New Issue