From 4d5901cc6323055a179b881d4b8beebcc9fab7df Mon Sep 17 00:00:00 2001 From: Yoga Pangestu Date: Sat, 20 Jun 2026 18:32:38 +0700 Subject: [PATCH] feat: add cart detail dialog in Cutting, Order, and Purchase components for improved user experience and item overview --- .../admin/manage/cuttings/CuttingPosForm.vue | 97 +++++++++++++++++-- .../admin/manage/orders/OrderPosForm.vue | 59 ++++++++++- .../manage/purchases/PurchasePosForm.vue | 58 ++++++++++- 3 files changed, 199 insertions(+), 15 deletions(-) diff --git a/resources/js/components/admin/manage/cuttings/CuttingPosForm.vue b/resources/js/components/admin/manage/cuttings/CuttingPosForm.vue index 3443bea..7394e35 100644 --- a/resources/js/components/admin/manage/cuttings/CuttingPosForm.vue +++ b/resources/js/components/admin/manage/cuttings/CuttingPosForm.vue @@ -69,6 +69,7 @@ const productSearch = ref(''); const materialCart = ref([]); const resultCart = ref([]); const costModalOpen = ref(false); +const cartDetailOpen = ref(false); const form = useForm({ description: '', @@ -723,13 +724,23 @@ function confirmSubmit() { Ringkasan Cutting - - Total: {{ totalResultPieces }} pcs - + + + + Total: {{ totalResultPieces }} pcs + + @@ -762,7 +773,7 @@ function confirmSubmit() { Belum ada bahan baku dipilih. -
+
-
+
+ + + + + Detail Keranjang + +
+
+

Bahan Baku

+
+
+
+
+

{{ item.raw_material_name }}

+

+ {{ item.variant }} · Stok {{ item.stock_input }} {{ item.unit_abbreviation }} +

+
+ + {{ item.material_usage }} {{ item.uses_length_unit ? 'cm' : item.unit_abbreviation }} + +
+
+ Sisa: {{ item.remaining_material }} {{ item.uses_length_unit ? 'cm' : item.unit_abbreviation }} + {{ formatRupiah(materialLineCost(item)) }} +
+
+
+
+
+

Hasil Produk

+
+
+
+
+

{{ item.product_name }}

+

+ {{ item.variant_name }} · Stok {{ item.stock }} pcs +

+
+
+
+ Hasil: {{ item.cutting_result }} + · + Bagus: {{ item.warehouse_stock }} + · + Reject: {{ item.cutting_reject }} +
+
+
+
+
+
+
+ Total Harga Modal + {{ formatRupiah(totalProductionCost) }} +
+
+
+
diff --git a/resources/js/components/admin/manage/orders/OrderPosForm.vue b/resources/js/components/admin/manage/orders/OrderPosForm.vue index 1c652d3..605dd4e 100644 --- a/resources/js/components/admin/manage/orders/OrderPosForm.vue +++ b/resources/js/components/admin/manage/orders/OrderPosForm.vue @@ -10,6 +10,12 @@ import { NumberInput } from '@/components/form/number-input'; import { RupiahInput } from '@/components/form/rupiah-input'; import { Button } from '@/components/ui/button'; import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; +import { + Dialog, + DialogContent, + DialogHeader, + DialogTitle, +} from '@/components/ui/dialog'; import { Empty, EmptyDescription, @@ -91,6 +97,7 @@ const search = ref(''); const selectedStockQuality = ref<'good' | 'reject'>('good'); const cart = ref([]); const customerFormOpen = ref(false); +const cartDetailOpen = ref(false); const printAfterSave = ref(false); const selectedPaperSize = ref<'58mm' | '80mm'>('80mm'); @@ -580,9 +587,19 @@ function submit() { - - - Ringkasan Pesanan + + + + Ringkasan Pesanan + + @@ -856,4 +873,40 @@ function submit() {
+ + + + + Detail Keranjang + +
+
+
+
+

{{ item.product_name }}

+

+ {{ item.variant_name }} + · {{ item.stock_quality_label ?? (item.stock_quality === 'reject' ? 'Reject' : 'Bagus') }} +

+
+ {{ item.quantity }} pcs +
+
+ @ Rp {{ formatRupiah(item.unit_price) }} + Rp {{ formatRupiah(lineSubtotal(item)) }} +
+
+
+
+
+ Total + Rp {{ formatRupiah(totalAmount) }} +
+
+
+
diff --git a/resources/js/components/admin/manage/purchases/PurchasePosForm.vue b/resources/js/components/admin/manage/purchases/PurchasePosForm.vue index cc7536c..8a894cf 100644 --- a/resources/js/components/admin/manage/purchases/PurchasePosForm.vue +++ b/resources/js/components/admin/manage/purchases/PurchasePosForm.vue @@ -11,6 +11,12 @@ import { RupiahInput } from '@/components/form/rupiah-input'; import { Badge } from '@/components/ui/badge'; import { Button } from '@/components/ui/button'; import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; +import { + Dialog, + DialogContent, + DialogHeader, + DialogTitle, +} from '@/components/ui/dialog'; import { Empty, EmptyDescription, @@ -63,6 +69,7 @@ const props = defineProps<{ const isCreateMode = computed(() => props.method === 'post'); const search = ref(''); const cart = ref([]); +const cartDetailOpen = ref(false); const existingPhotoId = ref(null); const currentPhotoUrl = computed(() => props.initialData?.photos?.url ?? null); @@ -415,9 +422,19 @@ function submit() { - - - Ringkasan Belanja + + + + Ringkasan Belanja + + @@ -547,4 +564,39 @@ function submit() {
+ + + + + Detail Keranjang + +
+
+
+
+

{{ item.raw_material_name }}

+

{{ item.variant }}

+
+ + {{ item.quantity }} {{ item.unit_abbreviation }} + +
+
+ @ Rp {{ formatRupiah(item.unit_price) }} + Rp {{ formatRupiah(lineSubtotal(item)) }} +
+
+
+
+
+ Total + Rp {{ formatRupiah(total) }} +
+
+
+