/**
 * 设备收发接口
*/
import request from '../../index'
import type { IListQuery } from '@/views/business/schedule/interchange/interchange_interface'

// 列表查询
export function getInterChangeList(data: IListQuery) {
  return request({
    url: `/device/dispatch/listPage?offset=${data.offset}&limit=${data.limit}`,
    method: 'post',
    data,
  })
}

// 导出列表
export function exportInterchangeList(data: Omit<IListQuery, 'limit' | 'offset'>) {
  return request({
    url: '/device/dispatch/export',
    method: 'post',
    responseType: 'blob',
    data,
  })
}

// 更改状态-回退、收入、归还、无需检测 按钮
export function interchangeStatusChange(data: any) {
  return request({
    url: '/device/dispatch/status/change',
    method: 'post',
    data,
  })
}

// 根据样品id催办
export function interchangeListUrge(data: { orderId: string | number; reason: string; sampleId: string | number; status: string }) {
  return request({
    url: '/device/dispatch/remindWorker',
    method: 'post',
    data,
  })
}

// 根据样品id终止、完成
export function interchangeListTerminate(data: any) {
  return request({
    url: '/device/dispatch/terminate',
    method: 'post',
    data,
  })
}

