refactor: urgent quotation card (#60)

This commit is contained in:
Methapon Metanipat 2024-11-07 10:55:55 +07:00 committed by GitHub
parent b86e011ca7
commit 4bfa5e8906
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 73 additions and 54 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Before After
Before After

View file

@ -31,10 +31,13 @@ defineEmits<{
}>(); }>();
</script> </script>
<template> <template>
<div class="surface-1 rounded bordered q-pa-sm quo-card"> <div
class="surface-1 rounded q-pa-xs quo-card bordered"
:class="{ 'urgent-card': urgent }"
>
<!-- SEC: header --> <!-- SEC: header -->
<header class="row items-center no-wrap"> <header class="row items-center no-wrap">
<q-img src="/images/quotation-avatar.png" width="2rem" /> <q-img src="/images/quotation-avatar-border.png" width="2rem" />
<div class="column q-ml-sm relative-position" style="font-size: 12px"> <div class="column q-ml-sm relative-position" style="font-size: 12px">
<span> <span>
@ -42,18 +45,15 @@ defineEmits<{
</span> </span>
<span <span
class="text-caption row items-center" class="text-caption row items-center"
:class="urgent ? 'urgent' : 'app-text-muted'" :class="urgent ? 'code' : 'app-text-muted'"
style="top: 10px"
> >
{{ code }} {{ code }}
<q-icon
v-if="urgent"
name="mdi-fire"
size="xs"
style="position: absolute; top: 7px"
></q-icon>
</span> </span>
</div> </div>
<div v-if="urgent" class="tag q-px-xs q-ml-sm">
<q-icon name="mdi-fire" size="12px" />
<span>{{ $t('general.urgent2') }}</span>
</div>
<nav class="col text-right"> <nav class="col text-right">
<q-btn <q-btn
@ -88,7 +88,7 @@ defineEmits<{
</nav> </nav>
</header> </header>
<div class="q-pt-md ellipsis"> <div class="ellipsis q-px-sm q-py-sm">
{{ title || '-' }} {{ title || '-' }}
<q-tooltip anchor="bottom start" self="top left"> <q-tooltip anchor="bottom start" self="top left">
{{ title || '-' }} {{ title || '-' }}
@ -96,47 +96,49 @@ defineEmits<{
</div> </div>
<!-- SEC: body --> <!-- SEC: body -->
<section class="row no-wrap q-py-md items-center" style="font-size: 90%"> <section class="surface-1 rounded q-px-sm">
<span class="app-text-muted q-pr-sm">{{ $t('general.status') }} :</span> <article class="row no-wrap q-py-sm items-center" style="font-size: 90%">
<BadgeComponent :title="status" hsla-color="--blue-6-hsl" /> <span class="app-text-muted q-pr-sm">{{ $t('general.status') }} :</span>
</section> <BadgeComponent :title="status" hsla-color="--blue-6-hsl" />
<q-separator /> </article>
<section class="row q-py-sm"> <q-separator />
<div class="col-4 app-text-muted q-pr-sm"> <article class="row q-py-sm">
{{ $t('quotation.customerName') }} <div class="col-4 app-text-muted q-pr-sm">
</div> {{ $t('quotation.customerName') }}
<div class="col-8">{{ customerName || '-' }}</div> </div>
<div class="col-4 app-text-muted q-pr-sm"> <div class="col-8">{{ customerName || '-' }}</div>
{{ $t('quotation.actor') }} <div class="col-4 app-text-muted q-pr-sm">
</div> {{ $t('quotation.actor') }}
<div class="col-8">{{ reporter || '-' }}</div> </div>
<div class="col-4 app-text-muted q-pr-sm"> <div class="col-8">{{ reporter || '-' }}</div>
{{ $t('quotation.employee') }} <div class="col-4 app-text-muted q-pr-sm">
</div> {{ $t('quotation.employee') }}
<div class="col-8"> </div>
<BadgeComponent <div class="col-8">
icon="mdi-account-multiple-outline" <BadgeComponent
:title="[workerCount, workerMax].join(' / ')" icon="mdi-account-multiple-outline"
/> :title="[workerCount, workerMax].join(' / ')"
</div> />
<div class="col-4 app-text-muted q-pr-sm"> </div>
{{ $t('general.createdAt') }} <div class="col-4 app-text-muted q-pr-sm">
</div> {{ $t('general.createdAt') }}
<div class="col-8"> </div>
{{ createdAt }} <div class="col-8">
</div> {{ createdAt }}
<div class="col-4 app-text-muted q-pr-sm"> </div>
{{ $t('general.validUntil') }} <div class="col-4 app-text-muted q-pr-sm">
</div> {{ $t('general.validUntil') }}
<div class="col-8"> </div>
{{ validUntil }} <div class="col-8">
</div> {{ validUntil }}
<div class="col-4 app-text-muted q-pr-sm"> </div>
{{ $t('quotation.totalPrice') }} <div class="col-4 app-text-muted q-pr-sm">
</div> {{ $t('quotation.totalPrice') }}
<div class="col-8"> </div>
{{ formatNumberDecimal(totalPrice || 0, 2) }} <div class="col-8">
</div> {{ formatNumberDecimal(totalPrice || 0, 2) }}
</div>
</article>
</section> </section>
</div> </div>
</template> </template>
@ -175,7 +177,22 @@ span {
height: 12px; height: 12px;
} }
.urgent { .urgent-card {
color: hsl(var(--red-6-hsl)); background-color: hsla(var(--red-3-hsl) / 0.2) !important;
border: 1px solid var(--red-6) !important;
.code {
color: var(--red-6);
}
.tag {
font-size: 12px;
border-radius: var(--radius-2);
background: hsl(var(--red-7-hsl));
color: white;
-webkit-box-shadow: 0px 0px 6px 0px rgba(240, 62, 62, 1);
-moz-box-shadow: 0px 0px 6px 0px rgba(240, 62, 62, 1);
box-shadow: 0px 0px 6px 0px rgba(240, 62, 62, 1);
}
} }
</style> </style>

View file

@ -100,6 +100,7 @@ export default {
afterEdit: 'After', afterEdit: 'After',
generated: 'System Generated', generated: 'System Generated',
urgent: 'Urgent', urgent: 'Urgent',
urgent2: 'Urgent',
oldData: 'Select existing data', oldData: 'Select existing data',
newData: 'Add new ', newData: 'Add new ',
male: 'Male', male: 'Male',

View file

@ -100,6 +100,7 @@ export default {
afterEdit: 'แก้ใหม่', afterEdit: 'แก้ใหม่',
generated: 'ระบบออกให้', generated: 'ระบบออกให้',
urgent: 'เร่งด่วน', urgent: 'เร่งด่วน',
urgent2: 'ด่วน',
oldData: 'เลือกข้อมูลที่มีอยู่เเล้ว', oldData: 'เลือกข้อมูลที่มีอยู่เเล้ว',
newData: 'เพิ่มมาใหม่', newData: 'เพิ่มมาใหม่',
male: 'ชาย', male: 'ชาย',