import request from '@/config/axios'

// 报工 VO
export interface BaogongRecordVO {
  id: number // id
  planId: number // 关联计划id
  num: number // 派工数量
  baogongTime: Date // 派工时间
}

// 报工 API
export const BaogongRecordApi = {
  // 查询报工分页
  getBaogongRecordPage: async (params: any) => {
    return await request.get({ url: `/mes/baogong-record/page`, params })
  },

  // 查询报工详情
  getBaogongRecord: async (id: number) => {
    return await request.get({ url: `/mes/baogong-record/get?id=` + id })
  },

  // 新增报工
  createBaogongRecord: async (data: BaogongRecordVO) => {
    return await request.post({ url: `/mes/baogong-record/create`, data })
  },

  // 修改报工
  updateBaogongRecord: async (data: BaogongRecordVO) => {
    return await request.put({ url: `/mes/baogong-record/update`, data })
  },

  // 删除报工
  deleteBaogongRecord: async (id: number) => {
    return await request.delete({ url: `/mes/baogong-record/delete?id=` + id })
  },

  // 导出报工 Excel
  exportBaogongRecord: async (params) => {
    return await request.download({ url: `/mes/baogong-record/export-excel`, params })
  },

}
