import { request } from '/@/utils/service';
import { UserPageQuery } from '@fast-crud/fast-crud';

// 任务列表接口
export function postCreateTask(body) {
  return request({
    url: '/api/report_manage/summary-tasks/',
    method: 'POST',
    data: body,
  });
}

export function getTasks(query) {
  return request({
    url: '/api/report_manage/summary-tasks/',
    method: 'GET',
    params: query,
  });
}

export function getTasksId(query) {
  return request({
    url: `/api/report_manage/summary-tasks/search/`,
    method: 'GET',
    params: query,
  });
}

export function postDeleteTask(body) {
  return request({
    url: `/api/report_manage/summary-tasks/delete/`,
    method: 'POST',
    data: body,
  });
}

export function postUpdateTask(body) {
  return request({
    url: `/api/report_manage/summary-tasks/${body.id}/`,
    method: 'POST',
    data: body,
  });
}

export function postUpdateManyTask(body) {
  return request({
    url: `/api/report_manage/summary-tasks/update/many/`,
    method: 'POST',
    data: body,
  });
}

export function postUpdateTaskStatus(query, body) {
  return request({
    url: `/api/report_manage/summary-tasks/${body.id}/`,
    method: 'POST',
    data: body,
    params: query,
  });
}

export function getOperationSelect(query) {
  return request({
    url: '/api/system/user-select/',
    method: 'GET',
    params: query,
  });
}

export function getSelect(query) {
  return request({
    url: '/api/report_manage/summary-tasks/box/data/',
    method: 'GET',
    params: query,
  });
}

export function getCurrencyCodeSelect(query) {
  return request({
    url: '/api/report_manage/summary-tasks/currency_code_select/',
    method: 'GET',
    params: query,
  });
}

export function exportTaskData(query) {
  return request({
    url: '/api/report_manage/summary-tasks/download/',
    method: 'GET',
    params: query,
    responseType: 'blob'
  });
}

export function postSendMessage(body) {
  return request({
    url: `/api/report_manage/summary-tasks/sendinform/`,
    method: 'POST',
    data: body,
  });
}

export function postNoticePerson(body) {
  return request({
    url: `/api/report_manage/summary-tasks/sendinform/people/`,
    method: 'POST',
    data: body,
  });
}

export function getPlanList(query) {
  return request({
    url: '/api/report_manage/summary-tasks/data/plan/all/',
    method: 'GET',
    params: query,
  });
}


