wr: 표준공사비 산정 toast > useConfirm으로
This commit is contained in:
@@ -22,11 +22,11 @@ import {
|
||||
FormUi,
|
||||
UiTable,
|
||||
} from "@common/business_components/ui";
|
||||
import { useConfirm } from "@frontend-opensource/use-react-hooks";
|
||||
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 { type UseFormReturn } from "react-hook-form";
|
||||
import toast from "react-hot-toast";
|
||||
/**
|
||||
* ConCostForm
|
||||
* 호출: (with-layout)/matMng/coMat/coMatRvw 에서 호출
|
||||
@@ -57,6 +57,7 @@ export default function ConCostForm({
|
||||
code,
|
||||
} = useWrStore((state) => state);
|
||||
const alert = useAlertStore((state) => state.setMessage);
|
||||
const { confirm } = useConfirm();
|
||||
|
||||
const ref = useRef<boolean>(false);
|
||||
|
||||
@@ -233,43 +234,16 @@ export default function ConCostForm({
|
||||
if(pk !==null){
|
||||
|
||||
if (checkFinish) {
|
||||
toast((t) => (
|
||||
<span className="flex flex-col items-center text-2xl">
|
||||
검토완료 변경시 공사비는 변경할수 없습니다.
|
||||
<br />
|
||||
진행하시겠습니까?
|
||||
<div className="flex gap-2 mt-2">
|
||||
<Button
|
||||
size="sm"
|
||||
onClick={async () => {
|
||||
toast.dismiss(t.id);
|
||||
|
||||
const message = await coMatRvwUpdate(
|
||||
pk,
|
||||
form.getValues("dmdInfoId"),
|
||||
data
|
||||
);
|
||||
alert(message);
|
||||
}}
|
||||
>
|
||||
확인
|
||||
</Button>
|
||||
<Button size="sm" onClick={() => toast.dismiss(t.id)}>
|
||||
취소
|
||||
</Button>
|
||||
</div>
|
||||
</span>
|
||||
));
|
||||
if (await confirm("검토완료 변경시 공사비는 변경할수 없습니다.\n진행하시겠습니까?")) {
|
||||
const message = await coMatRvwUpdate( pk, form.getValues("dmdInfoId"), data );
|
||||
alert(message);
|
||||
}
|
||||
} else {
|
||||
const message = await coMatRvwUpdate(
|
||||
pk,
|
||||
form.getValues("dmdInfoId"),
|
||||
data
|
||||
);
|
||||
const message = await coMatRvwUpdate( pk, form.getValues("dmdInfoId"), data );
|
||||
alert(message);
|
||||
}
|
||||
}else{
|
||||
alert('후보지를 먼저 선택해주세요')
|
||||
alert('후보지를 먼저 선택해주세요');
|
||||
}
|
||||
}
|
||||
} else if (type === "hist") {
|
||||
|
||||
Reference in New Issue
Block a user