refactor: integrate MediaThumbnailCell component into CuttingPosMaterialSummaryItems and CuttingPosResultSummaryItems for enhanced visual representation of items
This commit is contained in:
parent
bd781b8f76
commit
78dcc4b39d
@ -3,6 +3,7 @@ import { Layers, Trash2 } from '@lucide/vue';
|
|||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
import { DecimalInput } from '@/components/form/decimal-input';
|
import { DecimalInput } from '@/components/form/decimal-input';
|
||||||
import { NumberInput } from '@/components/form/number-input';
|
import { NumberInput } from '@/components/form/number-input';
|
||||||
|
import MediaThumbnailCell from '@/components/media/MediaThumbnailCell.vue';
|
||||||
import { Badge } from '@/components/ui/badge';
|
import { Badge } from '@/components/ui/badge';
|
||||||
import { Button } from '@/components/ui/button';
|
import { Button } from '@/components/ui/button';
|
||||||
import {
|
import {
|
||||||
@ -131,13 +132,22 @@ function setCombinationResult(combinationId: number | undefined, value: string)
|
|||||||
<div v-for="{ item, index } in group.items" :key="item.raw_material_price_id"
|
<div v-for="{ item, index } in group.items" :key="item.raw_material_price_id"
|
||||||
class="rounded-md border bg-background p-2.5">
|
class="rounded-md border bg-background p-2.5">
|
||||||
<div class="mb-1.5 flex items-start justify-between gap-2">
|
<div class="mb-1.5 flex items-start justify-between gap-2">
|
||||||
<div class="min-w-0">
|
<div class="min-w-0 flex-1">
|
||||||
<p class="truncate text-sm font-medium">
|
<div class="flex items-center gap-2">
|
||||||
{{ item.raw_material_name }}
|
<MediaThumbnailCell
|
||||||
</p>
|
v-if="item.images?.length"
|
||||||
<p class="truncate text-xs text-muted-foreground">
|
:items="item.images"
|
||||||
{{ item.variant }} · Stok {{ item.stock_input }} {{ item.unit_abbreviation }}
|
:max-visible="1"
|
||||||
</p>
|
/>
|
||||||
|
<div class="min-w-0">
|
||||||
|
<p class="truncate text-sm font-medium">
|
||||||
|
{{ item.raw_material_name }}
|
||||||
|
</p>
|
||||||
|
<p class="truncate text-xs text-muted-foreground">
|
||||||
|
{{ item.variant }} · Stok {{ item.stock_input }} {{ item.unit_abbreviation }}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<Button type="button" variant="ghost" size="icon"
|
<Button type="button" variant="ghost" size="icon"
|
||||||
class="size-6 shrink-0 text-destructive hover:text-destructive"
|
class="size-6 shrink-0 text-destructive hover:text-destructive"
|
||||||
@ -164,13 +174,22 @@ function setCombinationResult(combinationId: number | undefined, value: string)
|
|||||||
<div v-else v-for="{ item, index } in group.items" :key="item.raw_material_price_id"
|
<div v-else v-for="{ item, index } in group.items" :key="item.raw_material_price_id"
|
||||||
class="rounded-lg border p-3">
|
class="rounded-lg border p-3">
|
||||||
<div class="mb-2 flex items-start justify-between gap-2">
|
<div class="mb-2 flex items-start justify-between gap-2">
|
||||||
<div class="min-w-0">
|
<div class="min-w-0 flex-1">
|
||||||
<p class="truncate text-sm font-medium">
|
<div class="flex items-center gap-2">
|
||||||
{{ item.raw_material_name }}
|
<MediaThumbnailCell
|
||||||
</p>
|
v-if="item.images?.length"
|
||||||
<p class="truncate text-xs text-muted-foreground">
|
:items="item.images"
|
||||||
{{ item.variant }} · Stok {{ item.stock_input }} {{ item.unit_abbreviation }}
|
:max-visible="1"
|
||||||
</p>
|
/>
|
||||||
|
<div class="min-w-0">
|
||||||
|
<p class="truncate text-sm font-medium">
|
||||||
|
{{ item.raw_material_name }}
|
||||||
|
</p>
|
||||||
|
<p class="truncate text-xs text-muted-foreground">
|
||||||
|
{{ item.variant }} · Stok {{ item.stock_input }} {{ item.unit_abbreviation }}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<Button type="button" variant="ghost" size="icon"
|
<Button type="button" variant="ghost" size="icon"
|
||||||
class="size-7 shrink-0 text-destructive hover:text-destructive"
|
class="size-7 shrink-0 text-destructive hover:text-destructive"
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { Trash2 } from '@lucide/vue';
|
import { Trash2 } from '@lucide/vue';
|
||||||
import { NumberInput } from '@/components/form/number-input';
|
import { NumberInput } from '@/components/form/number-input';
|
||||||
|
import MediaThumbnailCell from '@/components/media/MediaThumbnailCell.vue';
|
||||||
import { Badge } from '@/components/ui/badge';
|
import { Badge } from '@/components/ui/badge';
|
||||||
import { Button } from '@/components/ui/button';
|
import { Button } from '@/components/ui/button';
|
||||||
import {
|
import {
|
||||||
@ -43,13 +44,22 @@ const emit = defineEmits<{
|
|||||||
<div v-else class="scrollbar-thin max-h-80 space-y-3 overflow-y-auto overscroll-y-contain">
|
<div v-else class="scrollbar-thin max-h-80 space-y-3 overflow-y-auto overscroll-y-contain">
|
||||||
<div v-for="(item, index) in resultCart" :key="item.product_variant_id" class="rounded-lg border p-3">
|
<div v-for="(item, index) in resultCart" :key="item.product_variant_id" class="rounded-lg border p-3">
|
||||||
<div class="mb-2 flex items-start justify-between gap-2">
|
<div class="mb-2 flex items-start justify-between gap-2">
|
||||||
<div class="min-w-0">
|
<div class="min-w-0 flex-1">
|
||||||
<p class="truncate text-sm font-medium">
|
<div class="flex items-center gap-2">
|
||||||
{{ item.product_name }}
|
<MediaThumbnailCell
|
||||||
</p>
|
v-if="item.images?.length"
|
||||||
<p class="truncate text-xs text-muted-foreground">
|
:items="item.images"
|
||||||
{{ item.variant_name }} · Stok {{ item.stock }} pcs
|
:max-visible="1"
|
||||||
</p>
|
/>
|
||||||
|
<div class="min-w-0">
|
||||||
|
<p class="truncate text-sm font-medium">
|
||||||
|
{{ item.product_name }}
|
||||||
|
</p>
|
||||||
|
<p class="truncate text-xs text-muted-foreground">
|
||||||
|
{{ item.variant_name }} · Stok {{ item.stock }} pcs
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<Button type="button" variant="ghost" size="icon"
|
<Button type="button" variant="ghost" size="icon"
|
||||||
class="size-7 shrink-0 text-destructive hover:text-destructive" @click="emit('remove', index)">
|
class="size-7 shrink-0 text-destructive hover:text-destructive" @click="emit('remove', index)">
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user