import request from '@/config/axios'

// 物资检查记录查询参数
export interface CheckRecordQuery {
  current: number
  size: number
  cabinetId?: number
  materialsId?: number
  checkStatus?: number
  checkTime?: Date[]
}

// 物资检查记录表单对象
export interface CheckRecordVO {
  recordId?: number
  cabinetId: number
  materialsId: number
  checkStatus: number
  checkTime: Date
  checkResult: string
  remark?: string
  createTime?: Date
}

// 查询物资检查记录列表
export const listCheckRecord = async (params: CheckRecordQuery) => {
  return await request.get({ url: '/iscs/materials-check-record/getMaterialsCheckRecordPage', params })
}

// 查询物资检查记录详情
export const getCheckRecordInfo = async (id: number) => {
  return await request.get({
    url: '/iscs/materials-check-record/selectMaterialsCheckRecordById',
    params: { id: id }
  })
}

// 新增物资检查记录
export const addCheckRecord = async (data: CheckRecordVO) => {
  return await request.post({ url: '/iscs/materials-check-record/insertMaterialsCheckRecord', data })
}

// 修改物资检查记录
export const updateCheckRecord = async (data: CheckRecordVO) => {
  return await request.post({ url: '/iscs/materials-check-record/updateMaterialsCheckRecord', data })
}

// 删除物资检查记录
export const deleteCheckRecord = async (ids: number) => {
  return await request.post({
    url: '/iscs/materials-check-record/deleteMaterialsCheckRecordList?ids='+ids
  })
}
// 导出物资检查记录
export const exportCheckRecord = (params: any) => {
  return request.get({ url: '/iscs/materials-check-record/exportMaterialsCheckRecordExcel', params })
}
