/**
 * 任务分发,实验室检测
*/
import request from '../index'
import type { ITaskQuery } from '@/views/business/schedule/task/task-interface'
const prefix = '/meter'

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

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

// 检测流程配置
export function setMeasureProcess(data: { id: string; scheduleId: string }) {
  return request({
    url: `${prefix}/schedule/task/setSchedule`,
    method: 'post',
    data,
  })
}

// 退回
export function rollbackTask(data) {
  return request({
    url: `${prefix}/schedule/task/setSchedule`,
    method: 'post',
    data,
  })
}

// 实验室收入样品
export function takeInSample(data) {
  return request({
    url: `${prefix}/schedule/task/setSchedule`,
    method: 'post',
    data,
  })
}

// 批量收入样品
export function batchTakeInSample(data) {
  return request({
    url: `${prefix}/schedule/task/setSchedule`,
    method: 'post',
    data,
  })
}

// 检完样品
export function overSample(data) {
  return request({
    url: `${prefix}/schedule/task/setSchedule`,
    method: 'post',
    data,
  })
}

// 批量检完样品
export function batchOverSample(data) {
  return request({
    url: `${prefix}/schedule/task/setSchedule`,
    method: 'post',
    data,
  })
}

