wr: message alert matMng

This commit is contained in:
2026-03-18 14:46:36 +09:00
parent 3d11a8be21
commit 59e3dd0804
7 changed files with 59 additions and 41 deletions
@@ -13,6 +13,7 @@ import {
getInterpolation,
transformAndInterpolate,
} from "@/components/lib/func/calculateConstCost ";
import { useAlertStore } from "@/src/shared/lib";
import { ConstCostFeeTable } from "@/components/ui/modal/coMat/constCostFeeTable";
import { RateFeeTableModal } from "@/components/ui/modal/coMat/rateFeeModal";
import {
@@ -53,6 +54,7 @@ export default function ConCostForm({
getRateFee,
getConstCostFee,
} = useWrStore((state) => state);
const alert = useAlertStore((state) => state.setMessage);
const ref = useRef<boolean>(false);
@@ -108,11 +110,11 @@ export default function ConCostForm({
const calculateConstCost = useCallback(() => {
const usgPrcsProcs = usgPrcsProcsWatch;
if (!dmndQtyWatch) {
toast.error("요구수량(m³/일)을 확인해주세요 계산할수 없습니다. ");
alert("요구수량(m³/일)을 확인해주세요 계산할수 없습니다. ");
return;
}
if (usgPrcsProcs === null || usgPrcsProcs === undefined) {
toast.error(
alert(
"용도에 따른 처리공정을 확인할수 없습니다. 용도를 확인해주세요. "
);
return;
@@ -175,9 +177,9 @@ export default function ConCostForm({
form.setValue("totalConstCost", Math.round(realResult));
}
}, [constCostRes, rateFeeRes, usgPrcsProcsWatch, dmndQtyWatch]);
const onSubmit = (value: DmdCoReqType) => {
const onSubmit = async (value: DmdCoReqType) => {
if (value.demandCst && !value.demandCst.prcsFcltCpctCstrnCst) {
toast.error("공사비 계산 진행 후 저장을 눌러주새요");
alert("공사비 계산 진행 후 저장을 눌러주새요");
return;
}
@@ -211,10 +213,15 @@ export default function ConCostForm({
<div className="flex gap-2 mt-2">
<Button
size="sm"
onClick={() => {
onClick={async () => {
toast.dismiss(t.id);
coMatRvwUpdate(pk, form.getValues("dmdInfoId"), data);
const message = await coMatRvwUpdate(
pk,
form.getValues("dmdInfoId"),
data
);
alert(message);
}}
>
확인
@@ -226,10 +233,15 @@ export default function ConCostForm({
</span>
));
} else {
coMatRvwUpdate(pk, form.getValues("dmdInfoId"), data);
const message = await coMatRvwUpdate(
pk,
form.getValues("dmdInfoId"),
data
);
alert(message);
}
}else{
toast.error('후보지를 먼저 선택해주세요')
alert('후보지를 먼저 선택해주세요')
}
}
} else if (type === "hist") {