import request from '@/config/axios'

// 物资使用说明查询参数
export interface InstructionsQuery {
  current: number
  size: number
  instructionsTitle?: string
  materialsTypeId?: number
  fileType?: string
}

// 物资使用说明表单对象
export interface InstructionsVO {
  instructionsId?: number
  instructionsTitle: string
  materialsTypeId: number
  fileType: string
  fileUrl: string
  remark?: string
  createTime?: Date
}

// 查询物资使用说明列表
export const listInstructions = async (params: InstructionsQuery) => {
  return await request.get({ url: '/iscs/materials-instructions/getMaterialsInstructionsPage', params })
}

// 查询物资使用说明详情
export const getInstructionsInfo = async (id: number) => {
  return await request.get({
    url: '/iscs/materials-instructions/selectMaterialsInstructionsById',
    params: { id: id }
  })
}

// 新增物资使用说明
export const addInstructions = async (data: InstructionsVO) => {
  return await request.post({ url: '/iscs/materials-instructions/insertMaterialsInstructions', data })
}

// 修改物资使用说明
export const updateInstructions = async (data: InstructionsVO) => {
  return await request.put({ url: '/iscs/materials-instructions/updateMaterialsInstructions', data })
}

// 删除物资使用说明
export const delInstructions = async (ids: number) => {
  return await request.delete({
    url: '/iscs/materials-instructions/deleteMaterialsInstructionsList?ids='+ids,

  })
}
