- Added a new controller for item inspection information to handle grouped data retrieval with pagination. - Created routes for accessing item inspection data, specifically for grouped item codes. - Updated frontend components to support server-side pagination, including total count display and page navigation. - Enhanced the item inspection info page to utilize the new API for fetching data, ensuring a smooth user experience. This implementation improves the management of item inspection data and enhances usability in the quality module.
62 lines
1.7 KiB
TypeScript
62 lines
1.7 KiB
TypeScript
/**
|
|
* 품목검사정보 API 클라이언트
|
|
* - 좌측 품목 패널 그룹 페이징 조회
|
|
*/
|
|
|
|
import { apiClient } from "./client";
|
|
|
|
export interface InspectionRowApi {
|
|
id: string;
|
|
item_code: string;
|
|
item_name: string;
|
|
inspection_type: string | null;
|
|
inspection_standard: string | null;
|
|
inspection_standard_id: string | null;
|
|
inspection_item_name: string | null;
|
|
inspection_method: string | null;
|
|
apply_process: string | null;
|
|
classification: string | null;
|
|
pass_criteria: string | null;
|
|
is_required: string | null;
|
|
is_active: string | null;
|
|
manager_id: string | null;
|
|
memo: string | null;
|
|
sort_order: string | null;
|
|
change_record?: string | null;
|
|
created_date?: string | null;
|
|
updated_date?: string | null;
|
|
// 프론트가 추가로 참조하는 필드(있을 수도, 없을 수도)
|
|
[key: string]: any;
|
|
}
|
|
|
|
export interface InspectionGroupApi {
|
|
item_code: string;
|
|
item_name: string;
|
|
is_active: string;
|
|
rows: InspectionRowApi[];
|
|
}
|
|
|
|
export interface InspectionGroupedResponse {
|
|
success: boolean;
|
|
groups: InspectionGroupApi[];
|
|
total: number;
|
|
page: number;
|
|
size: number;
|
|
totalPages: number;
|
|
message?: string;
|
|
}
|
|
|
|
export async function getInspectionGrouped(params: {
|
|
page?: number;
|
|
size?: number;
|
|
search?: string;
|
|
}): Promise<InspectionGroupedResponse> {
|
|
const qp = new URLSearchParams();
|
|
if (params.page) qp.set("page", String(params.page));
|
|
if (params.size) qp.set("size", String(params.size));
|
|
if (params.search && params.search.trim()) qp.set("search", params.search.trim());
|
|
const qs = qp.toString();
|
|
const res = await apiClient.get(`/item-inspection/grouped${qs ? `?${qs}` : ""}`);
|
|
return res.data;
|
|
}
|