Add preview functionality for outsource purchase order numbers
- Introduced a new endpoint `/preview-order-no` to generate order numbers based on registered numbering rules without incrementing the sequence. - Implemented the `previewOrderNo` function in the `outsourcePurchaseController` to handle the logic for generating the preview order number. - Updated the `outsourcePurchaseRoutes` to include the new route for previewing order numbers. - Enhanced the `RegistrationModal` component to automatically fill the order number input with the preview value when the modal opens. - Added a new API function `previewOrderNo` in the frontend to call the backend endpoint. (TASK:ERP-019)
This commit is contained in:
@@ -182,6 +182,22 @@ export async function autoProcesses(
|
||||
}
|
||||
}
|
||||
|
||||
// ─────────────────────────────────────────────────────────────────────────────
|
||||
// 외주발주번호 미리보기 — 모달 진입 시 input 자동 채움용 (시퀀스 증가 없음)
|
||||
// ─────────────────────────────────────────────────────────────────────────────
|
||||
export async function previewOrderNo(
|
||||
req: AuthenticatedRequest,
|
||||
res: Response,
|
||||
) {
|
||||
try {
|
||||
const companyCode = req.user!.companyCode;
|
||||
const code = await svc.previewOrderNo(companyCode);
|
||||
return ok(res, { generatedCode: code || "" });
|
||||
} catch (e: any) {
|
||||
return fail(res, 500, e?.message || "외주발주번호 미리보기 실패", e);
|
||||
}
|
||||
}
|
||||
|
||||
// ─────────────────────────────────────────────────────────────────────────────
|
||||
// 공정 자재투입(material_input) 자동 채움
|
||||
// — 사급자재 체크 시 해당 공정의 자재 목록을 외주발주 자재 형식으로 반환
|
||||
|
||||
Reference in New Issue
Block a user