import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { QcTaskQuery, QcTaskVO, QcTaskSubmitForm, QcTaskAuditForm } from './types';

/**
 * 查询质控任务列表
 * @param query
 */
export const listQcTasks = (query: QcTaskQuery): AxiosPromise<QcTaskVO[]> => {
    return request({
        url: '/home/taskCenter/qc/list',
        method: 'get',
        params: query
    });
};

/**
 * 递交质控任务
 * @param data
 */
export const submitQcTask = (data: QcTaskSubmitForm): AxiosPromise<any> => {
    return request({
        url: '/home/taskCenter/qc/submit',
        method: 'put',
        data: data
    });
};

/**
 * 审核质控任务
 * @param data
 */
export const auditQcTask = (data: QcTaskAuditForm): AxiosPromise<any> => {
    return request({
        url: '/home/taskCenter/qc/audit',
        method: 'put',
        data: data
    });
};
