refactor: handle title mode paview
This commit is contained in:
parent
241c20356f
commit
2264686a34
1 changed files with 27 additions and 2 deletions
|
|
@ -8,11 +8,36 @@ import { Branch } from 'src/stores/branch/types';
|
||||||
import { CustomerBranchRelation, Details } from 'src/stores/quotations/types';
|
import { CustomerBranchRelation, Details } from 'src/stores/quotations/types';
|
||||||
// NOTE: Import Components
|
// NOTE: Import Components
|
||||||
|
|
||||||
|
enum View {
|
||||||
|
Quotation,
|
||||||
|
Invoice,
|
||||||
|
Payment,
|
||||||
|
Receipt,
|
||||||
|
}
|
||||||
|
|
||||||
defineProps<{
|
defineProps<{
|
||||||
branch: Branch;
|
branch: Branch;
|
||||||
customer: CustomerBranchRelation;
|
customer: CustomerBranchRelation;
|
||||||
details: Details;
|
details: Details;
|
||||||
|
view: View;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
|
function titleMode(mode: View): string {
|
||||||
|
if (mode === View.Quotation) {
|
||||||
|
return 'preview.title.quotation';
|
||||||
|
}
|
||||||
|
if (mode === View.Invoice) {
|
||||||
|
return 'preview.title.invoice';
|
||||||
|
}
|
||||||
|
if (mode === View.Payment) {
|
||||||
|
return 'preview.title.payment';
|
||||||
|
}
|
||||||
|
if (mode === View.Receipt) {
|
||||||
|
return 'preview.title.receipt';
|
||||||
|
}
|
||||||
|
|
||||||
|
return '';
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
@ -24,7 +49,7 @@ defineProps<{
|
||||||
class="column"
|
class="column"
|
||||||
style="text-align: center; width: 50%; font-weight: 800; font-size: 24px"
|
style="text-align: center; width: 50%; font-weight: 800; font-size: 24px"
|
||||||
>
|
>
|
||||||
ใบเสนอราคา
|
{{ $t(titleMode(view)) }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
@ -57,7 +82,7 @@ defineProps<{
|
||||||
</section>
|
</section>
|
||||||
<section class="detail-quotation-info">
|
<section class="detail-quotation-info">
|
||||||
<div>
|
<div>
|
||||||
<div>เลขที่ใบเสนอราคา</div>
|
<div>{{ $t('general.itemNo', { msg: `${$t(titleMode(view))}` }) }}</div>
|
||||||
<div>{{ details.code }}</div>
|
<div>{{ details.code }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue