공용 DateInput + DataGrid 헤더 가독성 + 구매요청서 수정모드/공급업체 옵션

- 공용 DateInput (YYYY-MM-DD 통일): text input + Popover Calendar,
  숫자 8자리 자동 - 삽입. CompactDateRange / 다이얼로그 입고요청일 적용.
- DataGrid 헤더 라벨 truncate + TableHead 패딩 축소(!px-1.5):
  좁은 컬럼에서 라벨 겹침/잘림 해소.
- 구매요청서관리 그리드 컬럼 너비 합리화 (총 ~300px 절감)로 품명까지
  화면 안에 표시.
- 구매요청서 수정모드: 선택 1건 시 [구매요청서수정] 분기 →
  getDetail 로 헤더/라인 채워 다이얼로그 오픈. 확정·품의서생성 가드.
- 공급업체 옵션을 client_mng 기반 listVendorOptions 로 신설
  (운영 supply_mng=0 / client_mng=8946, M-BOM vendor 매칭).
- 주문유형 CommCodeSelect groupId 0000005 → 0000167 (계약구분).
- 고객사 셀렉트 → CustomerSelect 공용 컴포넌트로 교체.
- 그리드 delivery_request_date 점 형식 → YYYY-MM-DD 정규화.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
hjjeong
2026-05-15 14:40:28 +09:00
parent 75f4ca8127
commit 1fb438bdcb
8 changed files with 312 additions and 49 deletions
@@ -54,6 +54,16 @@ function handleError(res: Response, e: any, label: string) {
router.get("/purchase-request", (req, res) => run(svc.listPurchaseRequestReg, req as AuthenticatedRequest, res, "구매요청서관리"));
router.get("/purchase-proposal", (req, res) => run(svc.listPurchaseRegProposal, req as AuthenticatedRequest, res, "영업>품의서관리"));
// 공급업체 옵션 (client_mng 기반 — vendor/partner 직접 OBJID)
router.get("/purchase-request/vendors", async (_req, res) => {
try {
const data = await svc.listVendorOptions();
return res.json({ success: true, data });
} catch (e: any) {
return handleError(res, e, "공급업체 옵션");
}
});
// 프로젝트 자동채움 정보 (주문유형/제품구분/국내외/고객사/유무상 + mbom_header_objid)
router.get("/purchase-request/project-info/:projectObjid", async (req, res) => {
try {
@@ -336,6 +336,27 @@ export async function getPurchaseRequestDetail(srmObjid: string) {
return { header: headRes.rows[0], parts: partRes.rows };
}
// ─── 3-0) 공급업체 옵션 — client_mng 기반 ──────────────────────
// wace partMng 의 fnc_getClientMngListAppend 와 동일.
// M-BOM.vendor / sales_request_part.partner_objid 는 'C_' prefix 없이 client_mng.OBJID 직접 저장.
// → 옵션 코드는 OBJID 그대로(접두 X). 기존 listSupplierOptions(supply_mng)는 다른 메뉴 호환용으로 유지.
export async function listVendorOptions(): Promise<{ code: string; label: string }[]> {
const pool = getPool();
try {
const r = await pool.query(
`SELECT OBJID::VARCHAR AS code, CLIENT_NM AS label
FROM CLIENT_MNG
WHERE COALESCE(STATUS, 'active') IN ('active', '활성', 'ACTIVE')
AND CLIENT_NM IS NOT NULL AND CLIENT_NM <> ''
ORDER BY CLIENT_NM`,
);
return r.rows;
} catch (e: any) {
logger.error("listVendorOptions 실패", { error: e.message });
return [];
}
}
// ─── 3-1) 프로젝트 자동채움 정보 (wace purchaseOrderAdminSupplyInfo 1:1) ─
// 프로젝트 선택 시 주문유형(CATEGORY_CD) · 제품구분(PRODUCT) · 국내/해외(AREA_CD) ·
// 고객사(CUSTOMER_OBJID) · 유/무상(PAID_TYPE) 자동 채움 + M-BOM 헤더.