Files
MrleeAdmin/frontend/web/app/apps/produce/api/query.ts
T
2026-08-31 19:17:33 +08:00

55 lines
1.3 KiB
TypeScript

import request from '~/utils/request'
export type ProduceQueryRecordType = 'scan' | 'product' | 'exception' | 'repair'
export interface ProduceQueryRecord {
id: string
record_type: ProduceQueryRecordType
record_type_name: string
order_no?: string
product_code?: string
process_name?: string
exception_reason?: string
exception_content?: string
material_category?: string
fault_description?: string
quantity?: number | null
event_at?: number
event_date?: string | null
remark?: string
}
export interface ProduceQueryPage {
items: ProduceQueryRecord[]
total: number
page: number
limit: number
}
export interface ProduceQueryParams {
record_type: ProduceQueryRecordType
order_no?: string
keyword?: string
user_code?: string
status?: string | number
scan_result?: string | number
start_date?: string
end_date?: string
page?: number
limit?: number
}
export interface ProduceQueryTimeline {
order_no: string
total: number
items: ProduceQueryRecord[]
}
export function queryProduceRecords(params: ProduceQueryParams) {
return request.get<ProduceQueryPage>('/produce/query/records', params, { showErrorMessage: false })
}
export function queryProduceTimeline(orderNo: string) {
return request.get<ProduceQueryTimeline>('/produce/query/timeline', { order_no: orderNo.trim() }, { showErrorMessage: false })
}