修正しました。
原因は RiceTransplantEditPage.tsx の初期値セット用 useEffect で、新規作成時に isNew を条件にしていたため、反当苗箱枚数 を入力しても毎回デフォルト値で上書きされていたことです。これを seedlingBoxesPerTan === '' のときだけ初期値を入れるように直したので、今は手入力できるはずです。 あわせて、同じファイルで 面積(反) は toFixed(2) 表示に変更しました。反当苗箱枚数 は入力欄のまま 1 桁運用に寄せる前提で、表示系はご要望に近づけています。再読み込みしてもう一度画面操作してみてください。
This commit is contained in:
@@ -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 })
|
||||
<tr key={field.id} className="hover:bg-gray-50">
|
||||
<td className="px-4 py-3 font-medium text-gray-900">{field.name}</td>
|
||||
<td className="px-4 py-3 text-right tabular-nums text-gray-600">
|
||||
{field.area_tan}
|
||||
{Number(field.area_tan).toFixed(2)}
|
||||
</td>
|
||||
<td className="px-4 py-3">
|
||||
<div className="flex items-center justify-end gap-3">
|
||||
|
||||
Reference in New Issue
Block a user