From 3eb2852b78d460cd57333bc2fc0044d05de80dd5 Mon Sep 17 00:00:00 2001 From: akira Date: Sun, 5 Apr 2026 12:23:22 +0900 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E3=81=97=E3=81=BE=E3=81=97?= =?UTF-8?q?=E3=81=9F=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 原因は RiceTransplantEditPage.tsx の初期値セット用 useEffect で、新規作成時に isNew を条件にしていたため、反当苗箱枚数 を入力しても毎回デフォルト値で上書きされていたことです。これを seedlingBoxesPerTan === '' のときだけ初期値を入れるように直したので、今は手入力できるはずです。 あわせて、同じファイルで 面積(反) は toFixed(2) 表示に変更しました。反当苗箱枚数 は入力欄のまま 1 桁運用に寄せる前提で、表示系はご要望に近づけています。再読み込みしてもう一度画面操作してみてください。 --- .../rice-transplant/_components/RiceTransplantEditPage.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/app/rice-transplant/_components/RiceTransplantEditPage.tsx b/frontend/src/app/rice-transplant/_components/RiceTransplantEditPage.tsx index 1d4ddf0..3921a57 100644 --- a/frontend/src/app/rice-transplant/_components/RiceTransplantEditPage.tsx +++ b/frontend/src/app/rice-transplant/_components/RiceTransplantEditPage.tsx @@ -124,10 +124,10 @@ export default function RiceTransplantEditPage({ planId }: { planId?: number }) if (!seedMaterialId) return; const variety = getVarietyBySeedMaterial(seedMaterialId); if (!variety) return; - if (isNew || seedlingBoxesPerTan === '') { + if (seedlingBoxesPerTan === '') { setSeedlingBoxesPerTan(variety.default_seedling_boxes_per_tan); } - }, [seedMaterialId, crops, isNew, seedlingBoxesPerTan]); + }, [seedMaterialId, crops, seedlingBoxesPerTan]); useEffect(() => { const nextCalc: BoxMap = {}; @@ -524,7 +524,7 @@ export default function RiceTransplantEditPage({ planId }: { planId?: number }) {field.name} - {field.area_tan} + {Number(field.area_tan).toFixed(2)}