feat: add view type
This commit is contained in:
parent
272612450f
commit
79fbba07fa
1 changed files with 33 additions and 1 deletions
|
|
@ -113,8 +113,23 @@ function getHeight(el: HTMLElement) {
|
||||||
}
|
}
|
||||||
|
|
||||||
const details = ref<Details>();
|
const details = ref<Details>();
|
||||||
|
enum View {
|
||||||
|
Quotation,
|
||||||
|
Invoice,
|
||||||
|
Payment,
|
||||||
|
Receipt,
|
||||||
|
}
|
||||||
|
const view = ref<View>(View.Quotation);
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
const currentDocumentType = new URL(window.location.href).searchParams.get(
|
||||||
|
'type',
|
||||||
|
);
|
||||||
|
|
||||||
|
if (currentDocumentType === 'invoice') view.value = View.Invoice;
|
||||||
|
if (currentDocumentType === 'payment') view.value = View.Payment;
|
||||||
|
if (currentDocumentType === 'receipt') view.value = View.Receipt;
|
||||||
|
|
||||||
let str =
|
let str =
|
||||||
localStorage.getItem('quotation-preview') ||
|
localStorage.getItem('quotation-preview') ||
|
||||||
sessionStorage.getItem('quotation-preview');
|
sessionStorage.getItem('quotation-preview');
|
||||||
|
|
@ -234,7 +249,14 @@ function print() {
|
||||||
<div class="toolbar">
|
<div class="toolbar">
|
||||||
<PrintButton solid @click="print" />
|
<PrintButton solid @click="print" />
|
||||||
</div>
|
</div>
|
||||||
<div class="row justify-between container color-quotation">
|
<div
|
||||||
|
class="row justify-between container color-quotation"
|
||||||
|
:class="{
|
||||||
|
'color-quotation': view === View.Quotation,
|
||||||
|
'color-invoice': view === View.Invoice,
|
||||||
|
'color-receipt': view === View.Receipt,
|
||||||
|
}"
|
||||||
|
>
|
||||||
<section class="content" v-for="chunk in chunks">
|
<section class="content" v-for="chunk in chunks">
|
||||||
<ViewHeader
|
<ViewHeader
|
||||||
v-if="!!branch && !!customer && !!details"
|
v-if="!!branch && !!customer && !!details"
|
||||||
|
|
@ -468,6 +490,16 @@ function print() {
|
||||||
--main-hsl: var(--orange-6-hsl);
|
--main-hsl: var(--orange-6-hsl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.color-invoice {
|
||||||
|
--main: var(--purple-9);
|
||||||
|
--main-hsl: var(--purple-9-hsl);
|
||||||
|
}
|
||||||
|
|
||||||
|
.color-receipt {
|
||||||
|
--main: var(--green-6);
|
||||||
|
--main-hsl: var(--green-6-hsl);
|
||||||
|
}
|
||||||
|
|
||||||
.toolbar {
|
.toolbar {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
position: sticky;
|
position: sticky;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue