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

// 查询【请填写功能名称】列表
export const listSupply = async (formData) => {
  return await get('/system/supply/list', formData)
}

// 查询【请填写功能名称】详细
export const getSupply = async (formData) => {
  return await uget('/system/supply/', formData)
}

// 删除【请填写功能名称】
export const delSupply = async (formData) => {
  return await deletes('/system/supply/', formData)
}

// 新增【请填写功能名称】
export const addSupply = async (formData) => {
  return await post('/system/supply', formData)
}

// 修改【请填写功能名称】
export const updateSupply = async (formData) => {
  return await put('/system/supply', formData)
}

// 导出【请填写功能名称】
export const exportSupply = async (formData) => {
  let pdata = []
  if (formData != null && formData != undefined) {
    pdata = formData
  }
  if (formData == 1) {
    pdata = [1]
  }
  return await post('/system/supply/export', pdata)
}

// 启用/禁用 0启用1禁用
export const isAvitve = async (formData) => {
  return await parmasPost('/system/supply/isEnables', formData)
}

export function downLoadTemplate() {
  window.open(process.env.VUE_APP_BASE_API + '/system/supply/downLoadFile')
  // return request({
  //   url: '/system/supply/downLoadFile',
  //   method: 'get'
  // })
}

export const getListSupply = async (formData) => {
  return await get('/system/supply/getListByName', formData)
}
