[update] strukview
This commit is contained in:
parent
6246800b0c
commit
604148e28e
@ -1,7 +1,9 @@
|
||||
<template>
|
||||
<div v-if="isOpen"
|
||||
class="text-D pt-serif-regular-italic fixed inset-0 bg-black/75 flex items-center justify-center z-[9999]">
|
||||
<div class="bg-white w-[1224px] h-[528px] rounded-md shadow-lg relative overflow-hidden">
|
||||
|
||||
<!-- Tambahkan class "print-area" agar bisa difokuskan saat print -->
|
||||
<div class="print-area bg-white w-[1224px] h-[528px] rounded-md shadow-lg relative overflow-hidden">
|
||||
<div class="bg-yellow-500 h-8 w-full">
|
||||
<div class="bg-D h-6 w-full"></div>
|
||||
</div>
|
||||
@ -133,7 +135,7 @@
|
||||
<p class="font-semibold">Ongkos bikin</p>
|
||||
<p class="text-red-500 text-xs">diluar harga jual</p>
|
||||
</div>
|
||||
<div class="flex items-center w-40">
|
||||
<div class="flex p-1 items-center w-40 bg-B rounded-sm">
|
||||
<p>Rp</p>
|
||||
<p class="px-2 pl-0 text-left text-sm w-full">
|
||||
{{ (transaksi.ongkos_bikin || 0).toLocaleString() }},-
|
||||
@ -154,7 +156,7 @@
|
||||
</div>
|
||||
|
||||
<!-- Tombol -->
|
||||
<div class="flex justify-end gap-2 mt-4">
|
||||
<div class="flex justify-end gap-2 mt-4 no-print">
|
||||
<button @click="$emit('close')" class="bg-gray-400 text-white px-6 py-2 rounded">
|
||||
Tutup
|
||||
</button>
|
||||
@ -196,50 +198,34 @@ const props = defineProps({
|
||||
|
||||
const emit = defineEmits(['close'])
|
||||
|
||||
// Format tanggal sesuai dengan format yang ada
|
||||
const formatDate = (dateString) => {
|
||||
if (!dateString) return '-'
|
||||
|
||||
const days = ['Minggu', 'Senin', 'Selasa', 'Rabu', 'Kamis', 'Jumat', 'Sabtu']
|
||||
const months = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12']
|
||||
|
||||
const months = ['01','02','03','04','05','06','07','08','09','10','11','12']
|
||||
const date = new Date(dateString)
|
||||
const dayName = days[date.getDay()]
|
||||
const day = String(date.getDate()).padStart(2, '0')
|
||||
const month = months[date.getMonth()]
|
||||
const year = date.getFullYear()
|
||||
|
||||
return `${dayName}/${day}-${month}-${year}`
|
||||
}
|
||||
|
||||
// Menambahkan minimal 2 baris untuk tampilan yang konsisten
|
||||
const itemsWithMinimal = computed(() => {
|
||||
console.log('Transaksi data in StrukView:', props.transaksi)
|
||||
|
||||
// Coba berbagai kemungkinan nama field
|
||||
const items = props.transaksi.itemTransaksi ||
|
||||
props.transaksi.items ||
|
||||
props.transaksi.item_transaksi ||
|
||||
[]
|
||||
|
||||
console.log('Items found:', items)
|
||||
|
||||
const arr = [...items]
|
||||
|
||||
// Pastikan minimal ada 2 baris untuk tampilan yang rapi
|
||||
while (arr.length < 2) {
|
||||
arr.push({ produk: {}, harga_deal: 0, posisi_asal: '' })
|
||||
}
|
||||
|
||||
return arr
|
||||
})
|
||||
|
||||
// Fungsi print (bisa dikembangkan lebih lanjut)
|
||||
const handlePrint = () => {
|
||||
window.print()
|
||||
}
|
||||
|
||||
// Format number helper
|
||||
const formatNumber = (number) => {
|
||||
if (!number) return 0
|
||||
return parseFloat(number).toLocaleString('id-ID')
|
||||
@ -256,16 +242,22 @@ const formatNumber = (number) => {
|
||||
|
||||
/* Print styles */
|
||||
@media print {
|
||||
.fixed {
|
||||
position: static !important;
|
||||
body * {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.bg-black\/75 {
|
||||
background: none !important;
|
||||
.print-area, .print-area * {
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
button {
|
||||
.print-area {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
transform: scale(0.5); /* perkecil 2x lipat */
|
||||
transform-origin: top left; /* supaya mengecil dari pojok kiri atas */
|
||||
}
|
||||
.no-print {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user