From 1253711147a67c51e73e678fe0ebd6ed16a550d6 Mon Sep 17 00:00:00 2001 From: Yoga Pangestu Date: Sun, 5 Jul 2026 16:38:23 +0700 Subject: [PATCH] refactor: simplify onGoodChange and onRejectChange functions in StockVerifyDialog to directly update results by index for improved clarity and maintainability --- .../manage/stocks/table/StockVerifyDialog.vue | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/resources/js/pages/admin/manage/stocks/table/StockVerifyDialog.vue b/resources/js/pages/admin/manage/stocks/table/StockVerifyDialog.vue index 35294a3..cbd1323 100644 --- a/resources/js/pages/admin/manage/stocks/table/StockVerifyDialog.vue +++ b/resources/js/pages/admin/manage/stocks/table/StockVerifyDialog.vue @@ -128,18 +128,6 @@ 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) => ({ @@ -239,15 +227,13 @@ function submitVerify() { + class="h-7 w-20 px-1.5 text-xs text-center" />
+ class="h-7 w-20 px-1.5 text-xs text-center" />