import request from '@/utils/request'

const preUrl = '/repair/tickets'

// 新增
export function createTickets(data){
  return request({
    url: preUrl + "/create",
    method: "post",
    data
  })
}

// 分页
export function getTicketsPage(params){
  return request({
    url: preUrl + "/page",
    method: "get",
    params
  })
}

// 查看单个工单
export function getTicketsById(id){
  return request({
    url: preUrl + "/get?id=" + id,
    method: "get"
  })
}

// 作废
export function setTicketsVoid(data){
  return request({
    url: preUrl + "/void",
    method: "post",
    data
  })
}

// 结算
export function setTicketsPaid(data){
  return request({
    url: preUrl + "/paid",
    method: 'post',
    data
  })
}
