import request from '@/utils/request'

// 获取工单列表数据
export function getOrderLists(params) {
  return request({
    url: 'workorderapi/api/workorder/getlistbypage',
    method: 'get',
    params
  })
}

// 获取工单详情数据
export function getOrder(ordercode) {
  return request({
    url: 'workorderapi/api/workorder/getsingle',
    method: 'get',
    params: {
      ordercode
    }
  })
}

// 获取工单动态数据
export function getOrderDynamic(ordercode) {
  return request({
    url: 'workorderapi/api/workorder/getdt',
    method: 'get',
    params: {
      ordercode
    }
  })
}

// 添加工单数据
export function addOrder(data) {
  return request({
    url: 'workorderapi/api/workorder/add',
    method: 'post',
    data
  })
}

// 编辑工单数据
export function editOrder(data) {
  return request({
    url: 'workorderapi/api/workorder/update',
    method: 'post',
    data
  })
}

// 删除工单数据
export function deleteOrder(ids) {
  return request({
    url: 'workorderapi/api/workorder/delete',
    method: 'post',
    data: {
      ids
    }
  })
}

// 处理工单数据
export function dealOrderOperate(data) {
  return request({
    url: 'workorderapi/api/workorder/dealorder',
    method: 'post',
    data
  })
}

// 获取待指派工单列表
export function getOrderAppointedList(params) {
  return request({
    url: 'workorderapi/api/workorder/getdzplist',
    method: 'get',
    params
  })
}

// 获取待接单工单列表
export function getOrderWaitingList(params) {
  return request({
    url: 'workorderapi/api/workorder/getdjdlist',
    method: 'get',
    params
  })
}

// 获取待处理工单列表
export function getOrderDisposalList(params) {
  return request({
    url: 'workorderapi/api/workorder/getdcllist',
    method: 'get',
    params
  })
}

// 获取已处理工单列表
export function getOrderProcessedList(params) {
  return request({
    url: 'workorderapi/api/workorder/getycllist',
    method: 'get',
    params
  })
}
