import { get, uget, post, upost, parmasPost, put } from '@/http/index'

// 查询列表
export const queryListDeviceModel = async (data) => {
  return await get('/system/deviceModel/queryList', data)
}

// 根据装备专业查询设备型号列表
export const queryDeviceModelsByProfessions = async (formData) => {
  return await get('/system/deviceModel/queryDeviceModelByEquipmentProfession', formData)
}

// 新老接口同时使用
// 根据装备专业查询设备型号列表
// export function queryDeviceModelsByProfessions(query) {
//   return request({
//     url: '/system/deviceModel/queryDeviceModelByEquipmentProfession',
//     method: 'get',
//     params: query
//   })
// } // 查询设备型号列表
// export function queryDeviceModel(query) {
//   return request({
//     url: '/CatalogueOfMaintenanceController/queryDeviceModel',
//     method: 'get',
//     params: query
//   })
// }

// 查询装备-弹窗-下拉框
export const queryListEquipmentModel = async (formData) => {
  return await get('/system/equipmentModel/queryList', formData)
}
// 查询器材-弹窗-下拉框
export const queryListMaterialModel = async (formData) => {
  return await get('/system/materialModel/queryList', formData)
}

// 查询装备型号详细
export const getEquipmentModel = async (formData) => {
  return await parmasPost('/system/equipmentModel/getInfoById', formData)
}

// 删除装备型号
export const delEquipmentModel = async (formData) => {
  return await post('/system/equipmentModel/delete', formData)
}

// 新增装备型号
export const addEquipmentModel = async (formData) => {
  return await post('/system/equipmentModel/add', formData)
}

// 修改装备型号
export const updateEquipmentModel = async (formData) => {
  return await post('/system/equipmentModel/edit', formData)
}

// 导出装备型号
export const exportEquipmentModel = async (formData) => {
  return await post('/system/equipmentModel/export', formData)
}

// 根据装备专业查询装备型号列表
export const queryEquipmentModelByEquipmentProfession = async (data) => {
  return await get('/CatalogueOfMaintenanceController/queryEquipmentModelByEquipmentProfession', data)
}

// 移动
export const moveEquipmentProfession = async (formData) => {
  return await post('/system/equipmentModel/moveProfession', formData)
}

// 查询器材型号详细
export const getMaterialModel = async (data) => {
  return await uget('/system/materialModel/', data)
}

// 新增器材型号
export const addMaterialModel = async (formData) => {
  return await post('/system/materialModel', formData)
}

// 修改器材型号
export const updateMaterialModel = async (formData) => {
  return await post('/system/materialModel/edit', formData)
}

// 删除器材型号
export const delMaterialModel = async (formData) => {
  return await post('/system/materialModel/delete', formData)
}

// 查询器材型号列表
export const queryMaterialModel = async (data) => {
  return await get('/CatalogueOfMaintenanceController/queryMaterialModel', data)
}

// 移动
export const moveMaterialProfession = async (formData) => {
  return await post('/system/materialModel/moveProfession', formData)
}

// 查询设备型号详细
export const getDeviceModel = async (data) => {
  return await uget('/system/deviceModel/', data)
}

// 新增设备型号
export const addDeviceModel = async (formData) => {
  return await post('/system/deviceModel', formData)
}

// 修改设备型号
export const updateDeviceModel = async (formData) => {
  return await post('/system/deviceModel/edit', formData)
}

// 删除设备型号
export const delDeviceModel = async (formData) => {
  return await post('/system/deviceModel/delete', formData)
}

// 导出设备型号
export const exportDeviceModel = async (formData) => {
  return await post('/system/deviceModel/export', formData)
}

// 查询设备型号列表
export const queryDeviceModel = async (data) => {
  return await get('/CatalogueOfMaintenanceController/queryDeviceModel', data)
}

// 移动
export const moveDeviceProfession = async (formData) => {
  return await post('/system/deviceModel/moveProfession', formData)
}

// 查询装备型号
export const queryEmdByProfessionIdNew = async (formData) => {
  return await parmasPost('/CatalogueOfTechnicalStandardsController/queryEmdByProfessionId/', formData)
}

// 导出器材型号
export const exportMaterialModel = async (formData) => {
  return await post('/system/materialModel/export', formData)
}

// 下载器材型号模板
export function downLoadMaterialFile() {
  window.open(process.env.VUE_APP_BASE_API + '/system/materialModel/downLoadFile')
}

// 下载装备型号模板
export function downLoadEquipmentFile() {
  window.open(process.env.VUE_APP_BASE_API + '/system/equipmentModel/downLoadFile')
}

// 下载设备型号模板
export function downLoadDeviceFile() {
  window.open(process.env.VUE_APP_BASE_API + '/system/deviceModel/downLoadFile')
}
