wr: 수요처 매칭 검토 천단위 , 건수 10건
This commit is contained in:
@@ -28,6 +28,19 @@ import PopoverUi from "@common/business_components/ui/popover_ui";
|
||||
import { Button, Checkbox, Input, Label } from "@common/components/ui";
|
||||
import { useCallback, useEffect, useRef, useState } from "react";
|
||||
import { useForm, type UseFormReturn } from "react-hook-form";
|
||||
|
||||
const formatNumberWithComma = (value: string | number | null | undefined) => {
|
||||
if (value === null || value === undefined || value === "") return "";
|
||||
|
||||
const normalized =
|
||||
typeof value === "string" ? Number(value.replace(/,/g, "")) : Number(value);
|
||||
|
||||
if (Number.isNaN(normalized)) {
|
||||
return String(value);
|
||||
}
|
||||
|
||||
return normalized.toLocaleString("ko-KR");
|
||||
};
|
||||
/**
|
||||
* ConCostForm
|
||||
* 호출: (with-layout)/matMng/coMat/coMatRvw
|
||||
@@ -456,12 +469,16 @@ export default function ConCostForm({
|
||||
<FormUi label="요구수량(m³/일)">
|
||||
<Input
|
||||
placeholder=""
|
||||
type="number"
|
||||
step="0.1"
|
||||
type={isSim ? "number" : "text"}
|
||||
step={isSim ? "0.1" : undefined}
|
||||
onChange={(e) => {
|
||||
field.onChange(Number(e.target.value));
|
||||
}}
|
||||
value={field.value ?? 0}
|
||||
value={
|
||||
isSim
|
||||
? field.value ?? 0
|
||||
: formatNumberWithComma(field.value)
|
||||
}
|
||||
readOnly={!isSim}
|
||||
className={!isSim ? readOnlyInputClass : ""}
|
||||
/>
|
||||
@@ -524,14 +541,13 @@ export default function ConCostForm({
|
||||
<FormUi label="처리시설용량(m³/일)">
|
||||
<Input
|
||||
placeholder=""
|
||||
type="number"
|
||||
step="0.001"
|
||||
type="text"
|
||||
onChange={(e) => {
|
||||
console.log("dmndQty ", e);
|
||||
//field.onChange(Number(e.target.value) * 365 );
|
||||
}}
|
||||
// value={Number(field.value) * 365 || 0}
|
||||
value={Number(field.value) || 0}
|
||||
value={formatNumberWithComma(Number(field.value) || 0)}
|
||||
readOnly
|
||||
className={readOnlyInputClass}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user