import request from '@/router/axios';

// 获取数据
export function getTaskV2PageApi(query) {
  return request({
    url: '/admin/task/v2/page',
    method: 'get',
    params: query
  });
}

// 获取任务数据
export function getTaskTypeAvailApi(query) {
  return request({
    url: '/admin/task/type/v2/avail',
    method: 'get',
    params: query
  });
}

// 获取生产企业
export function getDeptv2Avail(query) {
  return request({
    url: '/admin/dept/v2/avail',
    method: 'get',
    params: query
  });
}

// 获取代表名称
export function getUserV2Avail(query) {
  return request({
    url: '/admin/user/v2/avail',
    method: 'get',
    params: query
  });
}
// 管理产品名称
export function getDrug2Avail(query) {
  return request({
    url: '/admin/drug/v2/avail',
    method: 'get',
    params: query
  });
}

export function getTaskV2TokenApi(data) {
  return request({
    url: '/admin/task/v2/token',
    method: 'post',
    data: data
  });
}

// 单条审核
export function checkSingleApi(data) {
  return request({
    url: '/admin/task/v2/check/single',
    method: 'post',
    data: data
  });
}

// 批量审核
export function taskV2CheckBatchApi(data) {
  return request({
    url: '/admin/task/v2/check/batch',
    method: 'post',
    data: data
  });
}

// 获取积分包
export function getPkgV2Api() {
  return request({
    url: '/admin/pkg/avail',
    method: 'get'
  });
}

// 获取平铺的任务

export function getTaskV2PageTileApi(params) {
  return request({
    url: '/admin/task/v2/page/tile',
    method: 'get',
    params: params
  });
}

export function getTaskV2PageCheckedApi(params) {
  return request({
    url: '/admin/task/v2/page/checked',
    method: 'get',
    params: params
  });
}

// 获取任务审核记录
export function getTaskV2CheckHisApi(params) {
  return request({
    url: '/admin/task/v2/check/his',
    method: 'get',
    params: params
  });
}

// 获取任务审核记录
export function getPretreatmentApi(data) {
  return request({
    url: '/admin/task/v2/check/pretreatment',
    method: 'post',
    data: data
  });
}

export function pretreatmentClearApi(data) {
  return request({
    url: '/admin/task/v2/check/pretreatment/clear',
    method: 'post',
    data: data
  });
}

export function pkgCheckExportApi(data) {
  return request({
    url: '/admin/pkg/check/export',
    method: 'get',
    params: data,
    responseType: 'arraybuffer'
  });
}
