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

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

// 导出列表
export function exportInterchangeList(data: Omit<IListQuery, 'limit' | 'offset'>) {
  return request({
    url: `${prefix}/schedule/interChange/listExport`,
    method: 'post',
    responseType: 'blob',
    data,
  })
}

// 根据样品id收入
export function interchangeListTake(data: { id: string; type: string }) {
  return request({
    url: `${prefix}/schedule/interChange/take`,
    method: 'post',
    data,
  })
}

// 根据样品id删除
export function interchangeListDelete(data: { id: string; type: string }) {
  return request({
    url: `${prefix}/schedule/interChange/delete`,
    method: 'post',
    data,
  })
}

// 根据样品id完成
export function interchangeListComplete(data: { id: string; type: string }) {
  return request({
    url: `${prefix}/schedule/interChange/complete`,
    method: 'post',
    data,
  })
}

// 根据样品id回退
export function interchangeListBack(data: { id: string; type: string }) {
  return request({
    url: `${prefix}/schedule/interChange/back`,
    method: 'post',
    data,
  })
}

// 根据样品id归还
export function interchangeListReturn(data: { id: string; type: string }) {
  return request({
    url: `${prefix}/schedule/interChange/return`,
    method: 'post',
    data,
  })
}

// 根据样品id催办
export function interchangeListUrge(data: { id: string; type: string }) {
  return request({
    url: `${prefix}/schedule/interChange/urge`,
    method: 'post',
    data,
  })
}

// 根据样品id终止
export function interchangeListTerminate(data: { id: string; type: string }) {
  return request({
    url: `${prefix}/schedule/interChange/terminate`,
    method: 'post',
    data,
  })
}

