물재이용 수요매칭 검토 후보처 선택을 위한 사전작업
This commit is contained in:
@@ -50,6 +50,10 @@ export default function ConCostForm({
|
||||
const ref = useRef<boolean>(false);
|
||||
|
||||
const [checkFinish, setCheckFinish] = useState<boolean>(false);
|
||||
const [lastSub, setLastSub] = useState<{
|
||||
ruseUtztnFcltNm: string;
|
||||
ruseUtztnFcltCd: string;
|
||||
} | null>(null);
|
||||
|
||||
useEffect(() => {
|
||||
if (!ref.current) {
|
||||
@@ -80,7 +84,7 @@ export default function ConCostForm({
|
||||
const dmndQtyWatch = form.watch("dmndQty");
|
||||
const totalConstCost = form.watch("totalConstCost");
|
||||
const cstrnCst = form.watch("demandCst.cstrnCst");
|
||||
|
||||
const splyList = form.watch("splyCndtList");
|
||||
const calculateConstCost = useCallback(() => {
|
||||
const usgPrcsProcs = usgPrcsProcsWatch;
|
||||
if (!dmndQtyWatch) {
|
||||
@@ -157,8 +161,11 @@ export default function ConCostForm({
|
||||
return;
|
||||
}
|
||||
|
||||
const splycd = form.getValues("splyCndtList")
|
||||
const pk = splycd&&splycd[0]?.ruseUtztnFcltCd?splycd[0]?.ruseUtztnFcltCd:'11000SW001R1'
|
||||
const splycd = form.getValues("splyCndtList");
|
||||
const pk =
|
||||
splycd && splycd[0]?.ruseUtztnFcltCd
|
||||
? splycd[0]?.ruseUtztnFcltCd
|
||||
: "11000SW001R1";
|
||||
|
||||
if (type === "mat") {
|
||||
if (value.demandCst) {
|
||||
@@ -183,11 +190,7 @@ export default function ConCostForm({
|
||||
onClick={() => {
|
||||
toast.dismiss(t.id);
|
||||
|
||||
coMatRvwUpdate(
|
||||
pk,
|
||||
form.getValues("dmdInfoId"),
|
||||
data
|
||||
);
|
||||
coMatRvwUpdate(pk, form.getValues("dmdInfoId"), data);
|
||||
}}
|
||||
>
|
||||
확인
|
||||
@@ -199,7 +202,6 @@ export default function ConCostForm({
|
||||
</span>
|
||||
));
|
||||
} else {
|
||||
|
||||
coMatRvwUpdate(pk, form.getValues("dmdInfoId"), data);
|
||||
}
|
||||
}
|
||||
@@ -216,6 +218,10 @@ export default function ConCostForm({
|
||||
console.log(" form ", form.formState.errors);
|
||||
}, [form.formState]);
|
||||
|
||||
useEffect(() => {
|
||||
console.log("splyCndtList ", splyList);
|
||||
}, [splyList]);
|
||||
|
||||
useEffect(() => {
|
||||
form.register("dmdInfoSn");
|
||||
form.register("dmdInfoId");
|
||||
@@ -369,8 +375,8 @@ export default function ConCostForm({
|
||||
console.log("dmndQty ", e);
|
||||
//field.onChange(Number(e.target.value) * 365 );
|
||||
}}
|
||||
// value={Number(field.value) * 365 || 0}
|
||||
value={Number(field.value) || 0}
|
||||
// value={Number(field.value) * 365 || 0}
|
||||
value={Number(field.value) || 0}
|
||||
readOnly
|
||||
/>
|
||||
</FormUi>
|
||||
@@ -501,30 +507,32 @@ export default function ConCostForm({
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
{/* <div className="col-span-3 mt-4">
|
||||
<div className="col-span-3 mt-4">
|
||||
<div className="flex items-center justify-between">
|
||||
<Label>공급처 선정</Label>
|
||||
<Button size={"sm"} onClick={(e) => {}} className="bg-none">
|
||||
<Button
|
||||
size={"sm"}
|
||||
onClick={(e) => {
|
||||
console.log(e);
|
||||
setLastSub(null) // 빌드오류때문에 넣은거 삭제필요
|
||||
|
||||
//splyList => 해당객체가 대민에서 선택한 후보처 리스트
|
||||
//setLastSub => 해당 스테이트가 선택한 마지막 후보처를 넣어야하는 스테이트
|
||||
}}
|
||||
className="bg-none"
|
||||
>
|
||||
후보지 조회
|
||||
</Button>
|
||||
</div>
|
||||
<FormField
|
||||
control={form.control}
|
||||
name=""
|
||||
render={({ field }) => (
|
||||
<FormUi label="">
|
||||
<Input
|
||||
placeholder=""
|
||||
type="text"
|
||||
onChange={(e) => {
|
||||
field.onChange(e.target.value);
|
||||
}}
|
||||
value={field.value ?? ""}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div> */}
|
||||
<FormUi label="">
|
||||
<Input
|
||||
placeholder=""
|
||||
type="text"
|
||||
value={lastSub?.ruseUtztnFcltNm || ""}
|
||||
readOnly
|
||||
/>
|
||||
</FormUi>
|
||||
</div>
|
||||
<div className="col-span-3 mt-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
@@ -536,9 +544,8 @@ export default function ConCostForm({
|
||||
type="number"
|
||||
step="0.01"
|
||||
onChange={(e) => {
|
||||
if (readonly) return;
|
||||
|
||||
if(readonly) return;
|
||||
|
||||
field.onChange(Number(e.target.value));
|
||||
}}
|
||||
value={field.value ?? 0}
|
||||
|
||||
Reference in New Issue
Block a user