import request from './request' export interface CheckinLine { lineId: number checkinId: number checkinCode: string lineNo: number orderLineId?: number trackCode?: string itemId: number itemCode: string itemName: string specification?: string unitName?: string orderQuantity?: number quantity: number stockedQuantity?: number remark?: string } export interface Checkin { checkinId: number checkinCode: string checkinDate: string status: string businessType: string orderId?: number orderCode?: string supplierId?: number supplierName?: string warehouseId?: number warehouseName?: string totalQuantity?: number stockedQuantity?: number remark?: string operatorName?: string approverName?: string approveDate?: string lines: CheckinLine[] createTime?: string } export interface CheckinQuery { trackCode?: string checkinCode?: string supplierName?: string itemCode?: string itemName?: string beginDate?: string endDate?: string status?: string pageNum?: number pageSize?: number } export interface CheckinListResponse { rows: Checkin[] total: number } // 获取采购到货单列表 export function getCheckinList(params: CheckinQuery): Promise { return request.get('/erp/po/checkin/list', { params }).then((res: any) => { return { rows: res.rows || [], total: res.total || 0 } }) } // 获取采购到货单详情 export function getCheckinDetail(checkinId: number): Promise { return request.get(`/erp/po/checkin/${checkinId}`).then((res: any) => { return res.data }) } // 新增采购到货单 export function createCheckin(data: Partial): Promise { return request.post('/erp/po/checkin', data) } // 更新采购到货单 export function updateCheckin(data: Partial): Promise { return request.put('/erp/po/checkin', data) } // 删除采购到货单 export function deleteCheckin(checkinIds: string): Promise { return request.delete(`/erp/po/checkin/${checkinIds}`) } // 注意:采购到货单审核接口后端暂未实现 // export function approveCheckin(checkinId: number): Promise { // return request.post(`/erp/po/checkin/audit/${checkinId}`) // }