jws-frontend/src/pages/05_quotation/preview/ViewHeader.vue
Methapon Metanipat fef8bb4987 refactor: use variable for color
This will be used to change color for different doc later on
2024-10-28 13:25:46 +07:00

142 lines
3.6 KiB
Vue

<script lang="ts" setup>
import { dateFormat } from 'src/utils/datetime';
// NOTE: Import stores
// NOTE Import Types
import { Branch } from 'src/stores/branch/types';
import { CustomerBranchRelation, Details } from 'src/stores/quotations/types';
// NOTE: Import Components
defineProps<{
branch: Branch;
customer: CustomerBranchRelation;
details: Details;
}>();
</script>
<template>
<div class="row items-center q-mb-lg">
<div class="column" style="width: 50%">
<img src="/logo.png" width="192px" style="object-fit: scale-down" />
</div>
<div
class="column"
style="text-align: center; width: 50%; font-weight: 800; font-size: 24px"
>
ใบเสนอราคา
</div>
</div>
<article class="detail-card">
<section class="detail-customer-info">
<article>
<b>บร {{ branch.name }}</b>
<span>
{{ !branch.moo ? '' : `หมู่.${branch.moo}` }} .{{
branch.subDistrict?.name
}}
.{{ branch.district?.name }} .{{ branch.province?.name }}
{{ branch.subDistrict?.zipCode }}
</span>
<span>เลขประจำตวผเสยภาษ {{ branch.taxNo }}</span>
<span>เบอรโทร {{ branch.telephoneNo }}</span>
<span>{{ branch.webUrl }}</span>
</article>
<article>
<b>กค</b>
<span>
.{{ customer.subDistrict?.name }} .{{
customer.district?.name
}}
.{{ customer.province?.name }} {{ customer.subDistrict?.zipCode }}
</span>
<span>เลขประจำตวผเสยภาษ {{ customer.citizenId }}</span>
<span>เบอรโทร {{ customer.telephoneNo }}</span>
</article>
</section>
<section class="detail-quotation-info">
<div>
<div>เลขทใบเสนอราคา</div>
<div>{{ details.code }}</div>
</div>
<div>
<div>นทใบเสนอราคา</div>
<div>{{ dateFormat(details.createdAt, true, false, true) }}</div>
</div>
<div>
<div>ขาย</div>
<div>{{ details.createdBy }}</div>
</div>
<div>
<div>เงอนไขการชำระ</div>
<div>
{{
{
Full: $t('quotation.type.fullAmountCash'),
Split: $t('quotation.type.installmentsCash'),
BillFull: $t('quotation.type.fullAmountBill'),
BillSplit: $t('quotation.type.installmentsBill'),
}[details.payCondition]
}}
</div>
</div>
<div>
<div>องาน</div>
<div>{{ details.workName }}</div>
</div>
<div>
<div>ดต</div>
<div>{{ details.contactName }}</div>
</div>
<div>
<div>นครบกำหนดชำระ</div>
<div>{{ dateFormat(details.dueDate, true, false, true) }}</div>
</div>
</section>
</article>
</template>
<style scoped>
.detail-card {
display: flex;
gap: 16px;
& > * {
flex-grow: 1;
}
& > :first-child {
max-width: 57.5%;
}
}
.detail-customer-info {
display: flex;
flex-direction: column;
gap: 16px;
& > * {
display: flex;
flex-direction: column;
& > :first-child {
color: var(--main);
}
}
}
.detail-quotation-info {
& > * {
display: flex;
& > :first-child {
color: var(--main);
}
& > * {
width: 50%;
}
}
}
</style>