Compare commits
No commits in common. "1253711147a67c51e73e678fe0ebd6ed16a550d6" and "60aae40575fde40194584e954d354ad828e3dc8d" have entirely different histories.
1253711147
...
60aae40575
@ -128,6 +128,18 @@ watch(open, (isOpen) => {
|
||||
}
|
||||
});
|
||||
|
||||
function onGoodChange(result: any, value: string | number) {
|
||||
const val = Number(value) || 0;
|
||||
result.good = val;
|
||||
result.reject = Math.max(0, result.cutting_result - val);
|
||||
}
|
||||
|
||||
function onRejectChange(result: any, value: string | number) {
|
||||
const val = Number(value) || 0;
|
||||
result.reject = val;
|
||||
result.good = Math.max(0, result.cutting_result - val);
|
||||
}
|
||||
|
||||
function setSharedPrice(type: string, value: string) {
|
||||
verifyForm.shared_prices[type] = value;
|
||||
verifyForm.variant_prices = verifyForm.variant_prices.map((row) => ({
|
||||
@ -227,13 +239,15 @@ function submitVerify() {
|
||||
<label :for="`stock-good-${index}`"
|
||||
class="text-[10px] text-muted-foreground block mb-0.5">Bagus</label>
|
||||
<NumberInput :id="`stock-good-${index}`" :model-value="result.good"
|
||||
class="h-7 w-20 px-1.5 text-xs text-center" />
|
||||
class="h-7 w-20 px-1.5 text-xs text-center"
|
||||
@update:model-value="val => onGoodChange(result, val)" />
|
||||
</div>
|
||||
<div class="text-center">
|
||||
<label :for="`stock-reject-${index}`"
|
||||
class="text-[10px] text-muted-foreground block mb-0.5">Reject</label>
|
||||
<NumberInput :id="`stock-reject-${index}`" :model-value="result.reject"
|
||||
class="h-7 w-20 px-1.5 text-xs text-center" />
|
||||
class="h-7 w-20 px-1.5 text-xs text-center"
|
||||
@update:model-value="val => onRejectChange(result, val)" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -259,29 +273,7 @@ function submitVerify() {
|
||||
</div>
|
||||
<div class="space-y-2">
|
||||
<div v-for="material in group.items" :key="material.id"
|
||||
class="flex items-center gap-3 rounded-md border bg-background p-2.5">
|
||||
<div class="shrink-0">
|
||||
<MediaThumbnailCell :items="material.images ?? material.raw_material_price?.images ?? []" :max-visible="1" />
|
||||
</div>
|
||||
<div class="min-w-0 flex-1">
|
||||
<p class="truncate text-sm font-medium">
|
||||
{{ material.raw_material_name || material.raw_material_price?.raw_material?.name }}
|
||||
</p>
|
||||
<p class="truncate text-xs text-muted-foreground">
|
||||
{{ material.variant || material.raw_material_price?.variant }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<template v-else>
|
||||
<div v-for="material in group.items" :key="material.id"
|
||||
class="flex items-center gap-3 rounded-lg border p-3">
|
||||
<div class="shrink-0">
|
||||
<MediaThumbnailCell :items="material.images ?? material.raw_material_price?.images ?? []" :max-visible="1" />
|
||||
</div>
|
||||
<div class="min-w-0 flex-1">
|
||||
class="rounded-md border bg-background p-2.5">
|
||||
<p class="truncate text-sm font-medium">
|
||||
{{ material.raw_material_name || material.raw_material_price?.raw_material?.name }}
|
||||
</p>
|
||||
@ -290,6 +282,18 @@ function submitVerify() {
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<template v-else>
|
||||
<div v-for="material in group.items" :key="material.id"
|
||||
class="rounded-lg border p-3">
|
||||
<p class="truncate text-sm font-medium">
|
||||
{{ material.raw_material_name || material.raw_material_price?.raw_material?.name }}
|
||||
</p>
|
||||
<p class="truncate text-xs text-muted-foreground">
|
||||
{{ material.variant || material.raw_material_price?.variant }}
|
||||
</p>
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user