84 lines
1.9 KiB
TypeScript
84 lines
1.9 KiB
TypeScript
import request from '@/utils/http'
|
|
|
|
export interface QcMonthTemplateRow {
|
|
id: string
|
|
materialId?: string
|
|
materialCode: string
|
|
materialName: string
|
|
specModel?: string
|
|
unit?: string
|
|
catalogNo: string
|
|
batchNo: string
|
|
manufacturer: string
|
|
unitPrice: number
|
|
amount: number
|
|
inQty: number
|
|
expireDate: string
|
|
orderNum?: number
|
|
remark?: string
|
|
}
|
|
|
|
export interface QcMonthImportPreviewLine {
|
|
templateId?: string
|
|
materialId?: string
|
|
materialCode: string
|
|
materialName: string
|
|
specModel?: string
|
|
unit?: string
|
|
stockInNo: string
|
|
stockInDate: string
|
|
expireDate: string
|
|
catalogNo: string
|
|
batchNo: string
|
|
manufacturer: string
|
|
unitPrice: number
|
|
amount: number
|
|
qty: number
|
|
remark?: string
|
|
}
|
|
|
|
export function fetchQcMonthTemplateList() {
|
|
return request.get<QcMonthTemplateRow[]>({
|
|
url: '/web/admin/qc-material-month-templates'
|
|
})
|
|
}
|
|
|
|
export function fetchCreateQcMonthTemplate(data: Record<string, any>) {
|
|
return request.post<QcMonthTemplateRow>({
|
|
url: '/web/admin/qc-material-month-templates',
|
|
data
|
|
})
|
|
}
|
|
|
|
export function fetchUpdateQcMonthTemplate(id: string, data: Record<string, any>) {
|
|
return request.put<QcMonthTemplateRow>({
|
|
url: `/web/admin/qc-material-month-templates/${id}`,
|
|
data
|
|
})
|
|
}
|
|
|
|
export function fetchDeleteQcMonthTemplate(id: string) {
|
|
return request.delete<void>({
|
|
url: `/web/admin/qc-material-month-templates/${id}`
|
|
})
|
|
}
|
|
|
|
export function fetchPreviewQcMonthImport(stockInDate: string) {
|
|
return request.post<QcMonthImportPreviewLine[]>({
|
|
url: '/web/admin/qc-material-month-templates/preview',
|
|
data: { stockInDate }
|
|
})
|
|
}
|
|
|
|
export function fetchConfirmQcMonthImport(data: {
|
|
stockInDate: string
|
|
items: QcMonthImportPreviewLine[]
|
|
remark?: string
|
|
stockInTime?: string
|
|
}) {
|
|
return request.post<{ count: number }>({
|
|
url: '/web/admin/qc-material-month-templates/confirm',
|
|
data
|
|
})
|
|
}
|