/**
 * 设备收发接口
*/
import request from '../../index'
import type { IListQuery } from '@/views/business/manager/sendReceive/sendReceive-interface'
const prefix = '/business/dispatch'
// 列表查询
export function getInterChangeList(data: IListQuery) {
  return request({
    url: `${prefix}/listPage?offset=${data.offset}&limit=${data.limit}`,
    method: 'post',
    data,
  })
}

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

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

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

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

// 获取详情--基本信息
export function getDetailBaseInfo(params: { equipmentId: string }) {
  return request({
    url: `${prefix}/detail/baseInfo`,
    method: 'get',
    params,
  })
}

// 根据样品id查询证书监控
export function getCertificateMonitors(data: { customerId: string; sampleId: string; offset: number; limit: number }) {
  return request({
    url: `/business/certificate/certificateMonitorsById?offset=${data.offset}&limit=${data.limit}`,
    method: 'post',
    data,
  })
}

// 根据样品id查询证书报告
export function getCertificateRecords(data: { customerId: string; sampleId: string; offset: number; limit: number }) {
  return request({
    url: `/business/certificate/certificateRecordsById?offset=${data.offset}&limit=${data.limit}`,
    method: 'post',
    data,
  })
}

