import request from '@/utils/request'

// 创建工单类型
export function createWorkorderType(data) {
  return request({
    url: '/server/workorder-type/create',
    method: 'post',
    data: data
  })
}

// 更新工单类型
export function updateWorkorderType(data) {
  return request({
    url: '/server/workorder-type/update',
    method: 'post',
    data: data
  })
}

// 删除工单类型
export function deleteWorkorderType(id) {
  return request({
    url: '/server/workorder-type/delete?id=' + id,
    method: 'post'
  })
}

// 获得工单类型
export function getWorkorderType(id) {
  return request({
    url: '/server/workorder-type/get?id=' + id,
    method: 'get'
  })
}

// 获得工单类型列表
export function getWorkorderTypeList(params) {
  return request({
    url: '/server/workorder-type/list',
    method: 'get',
    params
  })
}
// 导出工单类型 Excel
export function exportWorkorderTypeExcel(params) {
  return request({
    url: '/server/workorder-type/export-excel',
    method: 'get',
    params,
    responseType: 'blob'
  })
}

// 查询工单运维商
export function suplierListWorkorder(suplier) {
  return request({
    url: '/server/workorder-type/suplierlist-workorder?suplier=' + suplier,
    method: 'get'
  })
}

// 查询运维商
export function suplierList(suplier) {
  return request({
    url: '/server/workorder-type/suplierlist?suplier=' + suplier,
    method: 'get'
  })
}
