完善生产异常维修与备件管理功能

This commit is contained in:
2026-09-01 19:17:09 +08:00
parent 02a429af66
commit 32f1486f5e
49 changed files with 1765 additions and 121 deletions
@@ -56,12 +56,30 @@ export interface ProduceRepairPart {
export interface ProduceScanRecord {
id: string | number
process_id?: string | number | null
step_id?: string | number | null
process_name?: string
step_name?: string
operator?: string
user_code?: string
}
export type ProduceOperationFaultStep = string | number
export type ProduceResponsibleOperator = string | number
export interface ProduceRepairRecordPayload {
exception_id: string | number
user_code: string
repair_result: string
images?: string[]
category_ids?: Array<string | number>
parts?: ProduceRepairPart[]
operation_fault_steps?: ProduceOperationFaultStep[]
responsible_operators?: ProduceResponsibleOperator[]
remark?: string
}
export function getExceptionSettings() {
return request.get<ProduceExceptionSetting[]>('/produce/exception/settings', {}, { showErrorMessage: false })
}
@@ -78,6 +96,10 @@ export function checkExceptionOrder(orderNo: string) {
return request.get<Record<string, any>>('/produce/exception/order-check', { order_no: orderNo.trim() }, { showErrorMessage: false })
}
export function checkMemberUser(userCode: string) {
return request.get<{ id: number; username: string; nickname: string }>('/produce/member-user/check', { user_code: userCode.trim() }, { showErrorMessage: false })
}
export function submitExceptionRecord(data: Record<string, any>) {
return request.post<{ code: number; msg: string; data?: { id: string | number } }>('/produce/exception/record', data, {
showErrorMessage: false,
@@ -127,7 +149,22 @@ export function lookupMaterial(productCode: string) {
}>('/produce/material/lookup', { product_code: productCode.trim() }, { showErrorMessage: false })
}
export function submitRepairRecord(data: Record<string, any>) {
export function searchMaterials(productCode = '', productName = '', categoryId: string | number = '', page = 1, limit = 10) {
return request.get<{
items: Array<{
id: string | number
category_id: string | number
category_name: string
product_code: string
product_name: string
}>
total: number
page: number
limit: number
}>('/produce/material/options', { product_code: productCode.trim(), product_name: productName.trim(), category_id: categoryId, page, limit }, { showErrorMessage: false })
}
export function submitRepairRecord(data: ProduceRepairRecordPayload) {
return request.post<{ code: number; msg: string; data?: { id: string | number; repair_no: string } }>('/produce/repair-record/record', data, {
showErrorMessage: false,
returnFullResponse: true,
@@ -9,6 +9,7 @@ export interface ProduceQueryRecord {
order_no?: string
product_code?: string
process_name?: string
step_name?: string
exception_reason?: string
exception_content?: string
material_category?: string