Compare commits
No commits in common. "42d4bc05bcbca3ad7d2dce424d6d888d53e3d4dc" and "7c15a39bbd0a6275e4e6653f55320ee575b246f1" have entirely different histories.
42d4bc05bc
...
7c15a39bbd
@ -10,7 +10,7 @@ const props = defineProps<{
|
||||
<template>
|
||||
<th
|
||||
data-slot="table-head"
|
||||
:class="cn('text-foreground bg-muted h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 *:[[role=checkbox]]:translate-y-0.5', props.class)"
|
||||
:class="cn('text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 *:[[role=checkbox]]:translate-y-0.5', props.class)"
|
||||
>
|
||||
<slot />
|
||||
</th>
|
||||
|
||||
@ -40,7 +40,7 @@ const quickCreateOpen = ref(false);
|
||||
<template>
|
||||
<Card class="min-w-0">
|
||||
<CardHeader class="flex flex-row items-center justify-between pb-3 space-y-0">
|
||||
<CardTitle class="text-base">Pilih Nama Produk</CardTitle>
|
||||
<CardTitle class="text-base">Pilih Produk Hasil</CardTitle>
|
||||
<Button type="button" variant="outline" size="sm" @click="quickCreateOpen = true">
|
||||
<Plus class="size-3.5 mr-1" />
|
||||
Baru
|
||||
@ -65,18 +65,27 @@ const quickCreateOpen = ref(false);
|
||||
</div>
|
||||
|
||||
<div v-else class="grid grid-cols-1 gap-4 sm:grid-cols-2">
|
||||
<PosCatalogCard v-for="product in filteredProducts" :key="product.id" :title="product.name"
|
||||
:cover-image="getFirstCoverImage(product.variants)">
|
||||
<PosCatalogCard
|
||||
v-for="product in filteredProducts"
|
||||
:key="product.id"
|
||||
:title="product.name"
|
||||
:cover-image="getFirstCoverImage(product.variants)"
|
||||
>
|
||||
<p v-if="!product.variants.length" class="px-3 py-4 text-sm text-muted-foreground">
|
||||
Belum ada varian
|
||||
</p>
|
||||
<div v-for="variant in product.variants" :key="variant.id"
|
||||
class="flex items-center gap-2.5 px-3 py-2.5 transition-all duration-200" :class="[
|
||||
<div
|
||||
v-for="variant in product.variants"
|
||||
:key="variant.id"
|
||||
class="flex items-center gap-2.5 px-3 py-2.5 transition-all duration-200"
|
||||
:class="[
|
||||
'cursor-pointer hover:bg-muted/30',
|
||||
getResultCartItem(variant.id)
|
||||
? 'mx-1 my-0.5 rounded-md border-2 border-primary bg-primary/5'
|
||||
: '',
|
||||
]" @click="!getResultCartItem(variant.id) && emit('add-result', product, variant)">
|
||||
]"
|
||||
@click="!getResultCartItem(variant.id) && emit('add-result', product, variant)"
|
||||
>
|
||||
<PosCatalogVariantThumb :items="variant.images" />
|
||||
<div class="min-w-0 flex-1">
|
||||
<p class="truncate text-sm font-medium">
|
||||
@ -91,28 +100,46 @@ const quickCreateOpen = ref(false);
|
||||
<span class="text-primary mr-1">
|
||||
<Check class="size-4" />
|
||||
</span>
|
||||
<Button type="button" variant="outline" size="icon-sm"
|
||||
<Button
|
||||
type="button"
|
||||
variant="outline"
|
||||
size="icon-sm"
|
||||
class="hover:text-destructive hover:bg-destructive/10"
|
||||
@click.stop="emit('decrease-result-qty', variant.id)">
|
||||
@click.stop="emit('decrease-result-qty', variant.id)"
|
||||
>
|
||||
<Minus class="size-3.5" />
|
||||
</Button>
|
||||
</template>
|
||||
<template v-else>
|
||||
<Button type="button" variant="outline" size="icon-sm"
|
||||
@click.stop="emit('decrease-result-qty', variant.id)">
|
||||
<Button
|
||||
type="button"
|
||||
variant="outline"
|
||||
size="icon-sm"
|
||||
@click.stop="emit('decrease-result-qty', variant.id)"
|
||||
>
|
||||
<Minus class="size-3.5" />
|
||||
</Button>
|
||||
<span class="min-w-5 text-center text-xs font-semibold tabular-nums">
|
||||
{{ getResultCartItem(variant.id)!.cutting_result }}
|
||||
</span>
|
||||
<Button type="button" variant="outline" size="icon-sm"
|
||||
@click.stop="emit('add-result', product, variant)">
|
||||
<Button
|
||||
type="button"
|
||||
variant="outline"
|
||||
size="icon-sm"
|
||||
@click.stop="emit('add-result', product, variant)"
|
||||
>
|
||||
<Plus class="size-3.5" />
|
||||
</Button>
|
||||
</template>
|
||||
</div>
|
||||
<Button v-else type="button" variant="outline" size="icon-sm" class="shrink-0"
|
||||
@click.stop="emit('add-result', product, variant)">
|
||||
<Button
|
||||
v-else
|
||||
type="button"
|
||||
variant="outline"
|
||||
size="icon-sm"
|
||||
class="shrink-0"
|
||||
@click.stop="emit('add-result', product, variant)"
|
||||
>
|
||||
<Plus class="size-3.5" />
|
||||
</Button>
|
||||
</div>
|
||||
@ -122,6 +149,10 @@ const quickCreateOpen = ref(false);
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
<QuickCreateProductModal v-model:open="quickCreateOpen" :categories="categories" :selected-materials="materialCart"
|
||||
@created="emit('product-created', $event)" />
|
||||
<QuickCreateProductModal
|
||||
v-model:open="quickCreateOpen"
|
||||
:categories="categories"
|
||||
:selected-materials="materialCart"
|
||||
@created="emit('product-created', $event)"
|
||||
/>
|
||||
</template>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user