Merge branch 'master' of http://114.203.209.83:3000/SamProject/sam-react-prod
This commit is contained in:
@@ -61,6 +61,8 @@ import { type QuotationForSelect, type QuotationItem } from "./actions";
|
||||
import { ItemAddDialog, OrderItem } from "./ItemAddDialog";
|
||||
import { formatAmount } from "@/utils/formatAmount";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { useDevFill } from "@/components/dev";
|
||||
import { generateOrderDataFull } from "@/components/dev/generators/orderData";
|
||||
|
||||
// 수주 폼 데이터 타입
|
||||
export interface OrderFormData {
|
||||
@@ -218,6 +220,24 @@ export function OrderRegistration({
|
||||
}));
|
||||
}, [form.items, form.discountRate]);
|
||||
|
||||
// DevToolbar 자동 채우기
|
||||
useDevFill(
|
||||
'order',
|
||||
useCallback(() => {
|
||||
const sampleData = generateOrderDataFull();
|
||||
|
||||
// 거래처 목록에서 실제 데이터 사용
|
||||
if (clients.length > 0) {
|
||||
const randomClient = clients[Math.floor(Math.random() * clients.length)];
|
||||
sampleData.clientId = randomClient.id;
|
||||
sampleData.clientName = randomClient.name;
|
||||
}
|
||||
|
||||
setForm(sampleData);
|
||||
toast.success('[Dev] 수주 폼이 자동으로 채워졌습니다.');
|
||||
}, [clients])
|
||||
);
|
||||
|
||||
// 견적 선택 핸들러
|
||||
const handleQuotationSelect = (quotation: QuotationForSelect) => {
|
||||
// 견적 정보로 폼 자동 채우기 (견적에서 가져온 품목은 삭제 불가)
|
||||
|
||||
Reference in New Issue
Block a user