|
59 | 59 | </v-row> |
60 | 60 | <v-row class="row-style"> |
61 | 61 | <v-col class="py-1" cols="1" sm="2" style="min-width: fit-content"> |
62 | | - <v-list-item style="text-transform: uppercase"> |
63 | | - CU : |
64 | | - </v-list-item> |
| 62 | + <v-list-item style="text-transform: uppercase"> CU : </v-list-item> |
65 | 63 | </v-col> |
66 | 64 | <v-col class="py-1"> |
67 | 65 | <v-list-item> |
|
79 | 77 | </v-row> |
80 | 78 | <v-row class="row-style"> |
81 | 79 | <v-col class="py-1" cols="1" sm="2" style="min-width: fit-content"> |
82 | | - <v-list-item style="text-transform: uppercase"> |
83 | | - SU : |
84 | | - </v-list-item> |
| 80 | + <v-list-item style="text-transform: uppercase"> SU : </v-list-item> |
85 | 81 | </v-col> |
86 | 82 | <v-col class="py-1"> |
87 | 83 | <v-list-item> |
|
99 | 95 | </v-row> |
100 | 96 | <v-row class="row-style"> |
101 | 97 | <v-col class="py-1" cols="1" sm="2" style="min-width: fit-content"> |
102 | | - <v-list-item style="text-transform: uppercase"> |
103 | | - NU : |
104 | | - </v-list-item> |
| 98 | + <v-list-item style="text-transform: uppercase"> NU : </v-list-item> |
105 | 99 | </v-col> |
106 | 100 | <v-col class="py-1"> |
107 | 101 | <v-list-item> |
|
126 | 120 | </v-row> |
127 | 121 | </div> |
128 | 122 | <div v-else> |
129 | | - <v-card-text class="font-weight-bold"> |
130 | | - No receipts found for this month |
131 | | - </v-card-text> |
| 123 | + <v-card-text class="font-weight-bold"> No receipts found for this month </v-card-text> |
132 | 124 | </div> |
133 | 125 | <v-card-actions> |
134 | 126 | <v-spacer /> |
135 | | - <v-btn color="secondary" :disabled="!node.receipts" @click="downloadNodeReceipt"> |
136 | | - Download Node Receipt |
137 | | - </v-btn> |
| 127 | + <v-btn color="secondary" :disabled="!node.receipts" @click="downloadNodeReceipt"> Download Node Receipt </v-btn> |
138 | 128 | </v-card-actions> |
139 | 129 | </v-card> |
140 | 130 | </v-container> |
141 | 131 | </template> |
142 | 132 |
|
143 | 133 | <script lang="ts"> |
144 | | -import { jsPDF } from "jspdf"; |
145 | 134 | import moment from "moment"; |
146 | 135 | import { computed, type PropType, ref } from "vue"; |
147 | 136 |
|
@@ -174,6 +163,9 @@ export default { |
174 | 163 | const selectedData = computed(() => [selectedMonth.value, selectedYear.value].filter(Boolean).join(", ")); |
175 | 164 |
|
176 | 165 | async function downloadNodeReceipt() { |
| 166 | + // Lazy load jspdf and jspdf-autotable only when PDF download is requested |
| 167 | + await import("jspdf-autotable"); |
| 168 | + const { jsPDF } = await import("jspdf"); |
177 | 169 | let doc = new jsPDF(); |
178 | 170 | doc = await generateReceipt(doc, props.node); |
179 | 171 | doc.save(`node_${props.node.nodeId}_receipts.pdf`); |
|
0 commit comments