import { get, put, post, deletes } from '@/http/index'

// 查询有寿件列表
export const getLifetimeSpareParts = async (data) => {
  return await get('/als/lifetimeSpareParts/list', data)
}

// 新增有寿件
export const addLifetimeSpareParts = async (data) => {
  return await post('/als/lifetimeSpareParts', data)
}

// 修改有寿件
export const updateLifetimeSpareParts = async (data) => {
  return await put('/als/lifetimeSpareParts', data)
}

// 删除有寿件
export const removeLifetimeSpareParts = async (id) => {
  return await deletes('/als/lifetimeSpareParts/' + id)
}

//  获取机种和机型树
export const getAircaftTypeAndModelTree = async (data) => {
  return await get('/basicdata/aircaftCatalog/getAircaftTypeAndModelTree', data)
}

//下载模板
export const downLoadLifetimeSpareParts = async (data) => {
  window.open(process.env.VUE_APP_BASE_API + '/als/lifetimeSpareParts/importTemplate')
}
//导出
export const exportLifetimeSparePartsExcel = async (data) => {
  window.open(process.env.VUE_APP_BASE_API + '/als/lifetimeSpareParts/export', data)
}
