feat: update quotation card
This commit is contained in:
parent
e08c3232eb
commit
26ada83f93
2 changed files with 55 additions and 46 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { Icon } from '@iconify/vue/dist/iconify.js';
|
import { Icon } from '@iconify/vue/dist/iconify.js';
|
||||||
import { formatNumberDecimal } from 'src/stores/utils';
|
import { formatNumberDecimal } from 'src/stores/utils';
|
||||||
|
import BadgeComponent from 'components/BadgeCompoent.vue';
|
||||||
import KebabAction from '../shared/KebabAction.vue';
|
import KebabAction from '../shared/KebabAction.vue';
|
||||||
import MainButton from '../button/MainButton.vue';
|
import MainButton from '../button/MainButton.vue';
|
||||||
|
|
||||||
|
|
@ -14,7 +15,11 @@ defineProps<{
|
||||||
title?: string;
|
title?: string;
|
||||||
code?: string;
|
code?: string;
|
||||||
amount?: number;
|
amount?: number;
|
||||||
date?: string;
|
status?: string;
|
||||||
|
workerCount?: number;
|
||||||
|
workerMax?: number;
|
||||||
|
createdAt?: string;
|
||||||
|
validUntil?: string;
|
||||||
customerName?: string;
|
customerName?: string;
|
||||||
reporter?: string;
|
reporter?: string;
|
||||||
totalPrice?: number;
|
totalPrice?: number;
|
||||||
|
|
@ -35,14 +40,9 @@ defineEmits<{
|
||||||
<div class="surface-1 rounded bordered q-pa-sm quo-card">
|
<div class="surface-1 rounded bordered q-pa-sm quo-card">
|
||||||
<!-- SEC: header -->
|
<!-- SEC: header -->
|
||||||
<header class="row items-center no-wrap">
|
<header class="row items-center no-wrap">
|
||||||
<div
|
<q-img src="/images/quotation-avatar.png" width="2rem" />
|
||||||
class="badge-card rounded q-pa-xs"
|
|
||||||
:class="{ [`badge-card__${type}`]: true }"
|
|
||||||
>
|
|
||||||
{{ $t(`quotation.type.${type}`) }}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="column q-ml-md relative-position" style="font-size: 12px">
|
<div class="column q-ml-sm relative-position" style="font-size: 12px">
|
||||||
<span>
|
<span>
|
||||||
{{ $t('general.itemNo', { msg: $t('quotation.title') }) }}
|
{{ $t('general.itemNo', { msg: $t('quotation.title') }) }}
|
||||||
</span>
|
</span>
|
||||||
|
|
@ -62,6 +62,14 @@ defineEmits<{
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<nav class="col text-right">
|
<nav class="col text-right">
|
||||||
|
<q-btn
|
||||||
|
flat
|
||||||
|
dense
|
||||||
|
rounded
|
||||||
|
icon="mdi-play-box-outline"
|
||||||
|
size="12px"
|
||||||
|
@click.stop="$emit('preview')"
|
||||||
|
/>
|
||||||
<q-btn
|
<q-btn
|
||||||
flat
|
flat
|
||||||
dense
|
dense
|
||||||
|
|
@ -85,47 +93,45 @@ defineEmits<{
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<!-- SEC: body -->
|
<!-- SEC: body -->
|
||||||
<section class="row no-wrap q-py-md">
|
<section class="row no-wrap q-py-md items-center" style="font-size: 90%">
|
||||||
<q-img src="/images/quotation-avatar.png" width="4rem" class="q-mr-lg" />
|
<span class="app-text-muted q-pr-sm">{{ $t('general.status') }} :</span>
|
||||||
<div class="column">
|
<BadgeComponent :title="status" hsla-color="--blue-6-hsl" />
|
||||||
<span class="col q-pt-sm">{{ title || '-' }}</span>
|
|
||||||
<span class="app-text-muted">x {{ amount || '0' }}</span>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
class="col text-right app-text-muted q-mr-md self-end"
|
|
||||||
style="font-size: 12px"
|
|
||||||
>
|
|
||||||
{{ date || '-' }}
|
|
||||||
</div>
|
|
||||||
</section>
|
</section>
|
||||||
<q-separator />
|
<q-separator />
|
||||||
<section class="row q-py-sm">
|
<section class="row q-py-sm">
|
||||||
<div class="col-3 app-text-muted">{{ $t('quotation.customerName') }}</div>
|
<div class="col-4 app-text-muted q-pr-sm">
|
||||||
<div class="col-9">{{ customerName || '-' }}</div>
|
{{ $t('quotation.customerName') }}
|
||||||
<div class="col-3 app-text-muted">{{ $t('quotation.actor') }}</div>
|
</div>
|
||||||
<div class="col-9">{{ reporter || '-' }}</div>
|
<div class="col-8">{{ customerName || '-' }}</div>
|
||||||
</section>
|
<div class="col-4 app-text-muted q-pr-sm">
|
||||||
<q-separator />
|
{{ $t('quotation.actor') }}
|
||||||
<footer class="row no-wrap items-center q-mt-sm" style="text-wrap: nowrap">
|
</div>
|
||||||
<Icon
|
<div class="col-8">{{ reporter || '-' }}</div>
|
||||||
class="q-mr-xs"
|
<div class="col-4 app-text-muted q-pr-sm">
|
||||||
icon="ph:money-fill"
|
{{ $t('quotation.employee') }}
|
||||||
style="font-size: 24px; color: var(--green-9)"
|
</div>
|
||||||
/>
|
<div class="col-8">
|
||||||
{{ $t('quotation.totalPriceBaht') }} :
|
<BadgeComponent :title="[workerCount, workerMax].join(' / ')" />
|
||||||
<div class="q-ml-xs" style="color: var(--orange-5)">
|
</div>
|
||||||
|
<div class="col-4 app-text-muted q-pr-sm">
|
||||||
|
{{ $t('general.createdAt') }}
|
||||||
|
</div>
|
||||||
|
<div class="col-8">
|
||||||
|
{{ createdAt }}
|
||||||
|
</div>
|
||||||
|
<div class="col-4 app-text-muted q-pr-sm">
|
||||||
|
{{ $t('general.validUntil') }}
|
||||||
|
</div>
|
||||||
|
<div class="col-8">
|
||||||
|
{{ validUntil }}
|
||||||
|
</div>
|
||||||
|
<div class="col-4 app-text-muted q-pr-sm">
|
||||||
|
{{ $t('quotation.totalPrice') }}
|
||||||
|
</div>
|
||||||
|
<div class="col-8">
|
||||||
{{ formatNumberDecimal(totalPrice || 0, 2) }}
|
{{ formatNumberDecimal(totalPrice || 0, 2) }}
|
||||||
</div>
|
</div>
|
||||||
<MainButton
|
</section>
|
||||||
outlined
|
|
||||||
icon="mdi-play-box-outline"
|
|
||||||
color="207 96% 32%"
|
|
||||||
class="q-ml-auto"
|
|
||||||
@click="$emit('preview')"
|
|
||||||
>
|
|
||||||
{{ $t('general.view', { msg: $t('general.example') }) }}
|
|
||||||
</MainButton>
|
|
||||||
</footer>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -583,8 +583,11 @@ async function storeDataLocal(id: string) {
|
||||||
"
|
"
|
||||||
:code="v.code"
|
:code="v.code"
|
||||||
:title="v.workName"
|
:title="v.workName"
|
||||||
:date="new Date(v.createdAt).toLocaleString()"
|
:created-at="new Date(v.createdAt).toLocaleString()"
|
||||||
:amount="v._count.worker"
|
:valid-until="new Date(v.dueDate).toLocaleString()"
|
||||||
|
:status="v.quotationStatus"
|
||||||
|
:worker-count="v._count.worker"
|
||||||
|
:worker-max="v.workerMax || v._count.worker"
|
||||||
:customer-name="
|
:customer-name="
|
||||||
v.customerBranch.registerName ||
|
v.customerBranch.registerName ||
|
||||||
`${v.customerBranch.firstName || '-'} ${v.customerBranch.lastName || ''}`
|
`${v.customerBranch.firstName || '-'} ${v.customerBranch.lastName || ''}`
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue