Files
MrleeAdmin/frontend/web/app/apps/produce/api/query.ts
T

61 lines
1.5 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
step_name?: string
status_name?: string
result_name?: string
operator?: string
user_code?: string
quantity?: number | null
event_at?: number
event_date?: string | null
remark?: string
// 异常提报和维修记录详情
exception_reason?: string
exception_content?: string
material_category?: string
fault_description?: 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 })
}