// @ts-ignore
/* eslint-disable */

// 该文件自动生成，请勿手动修改！

// --------------------------------------------------------------------------
// 监测机构上报类型服务
// --------------------------------------------------------------------------

import { request } from '@umijs/max';
import { DataReportType } from '../enums';

/** 提交上报 POST /api/exam/org/data/report/submit */
export async function submit(
    data: API.SubmitExamOrgDataReportInput,
    options?: { [key: string]: any },
) {
    const url = '/api/exam/org/data/report/submit';
    const config = { method: 'POST', data, ...(options || {}) };
    const res = await request<API.ResponseType<any>>(url, config);
    return res?.data;
}

/** 退回机构上报 POST /api/exam/org/data/report/report-reject */
export async function reportReject(data: API.BaseId, options?: { [key: string]: any }) {
    const url = '/api/exam/org/data/report/report-reject';
    const config = { method: 'POST', data, ...(options || {}) };
    const res = await request<API.ResponseType<any>>(url, config);
    return res?.data;
}

/** 上传佐证材料 POST /api/exam/org/data/report/upload-attachment */
export async function uploadAttachment(data: FormData, options?: { [key: string]: any }) {
    const url = '/api/exam/org/data/report/upload-attachment';
    const config = { method: 'POST', data, ...(options || {}) };
    const res = await request<API.ResponseType<any>>(url, config);
    return res?.data;
}

/** 删除特殊学生佐证材料 POST /api/exam/org/data/report/del-attachment */
export async function delAttachment(
    data: API.DeleteAttachmentInput,
    options?: { [key: string]: any },
) {
    const url = '/api/exam/org/data/report/del-attachment';
    const config = { method: 'POST', data, ...(options || {}) };
    const res = await request<API.ResponseType<any>>(url, config);
    return res?.data;
}

/** 获取监测机构上报类型列表 GET /api/exam/org/data/report/get-list-by-exam-plan-id */
export async function getListByExamPlanId(
    params: {
        /**  */
        examplanid: number;
        /** 机构ID */
        sysorgid?: number;
    },
    options?: { [key: string]: any },
) {
    const url = '/api/exam/org/data/report/get-list-by-exam-plan-id';
    const config = { method: 'GET', params, ...(options || {}) };
    const res = await request<API.ResponseType<API.ExamOrgDataReportUnionOutput[]>>(url, config);
    return res?.data;
}

/** 根据监测计划ID和上报类型获取机构上报信息 GET /api/exam/org/data/report/get-by-type-exam-plan-id */
export async function getByTypeExamPlanId(
    params: {
        /** 上报类型 */
        type: DataReportType;
        /** 监测计划ID */
        examplanid: number;
        /** 机构ID */
        sysorgid?: number;
    },
    options?: { [key: string]: any },
) {
    const url = '/api/exam/org/data/report/get-by-type-exam-plan-id';
    const config = { method: 'GET', params, ...(options || {}) };
    const res = await request<API.ResponseType<API.ExamOrgDataReportUnionOutput>>(url, config);
    return res?.data;
}

/** 分页查询机构上报类型列表 POST /api/exam/org/data/report/query-page-list */
export async function queryPageList(
    data: API.ExamOrgDataReportPageInput,
    options?: { [key: string]: any },
) {
    const url = '/api/exam/org/data/report/query-page-list';
    const config = { method: 'POST', data, ...(options || {}) };
    const res = await request<API.ResponseType<API.PageResponse<API.ExamPlanOrgDataReportOutput>>>(
        url,
        config,
    );
    return res?.data;
}

export default {
    /** 提交上报 POST /api/exam/org/data/report/submit */
    submit,
    /** 退回机构上报 POST /api/exam/org/data/report/report-reject */
    reportReject,
    /** 上传佐证材料 POST /api/exam/org/data/report/upload-attachment */
    uploadAttachment,
    /** 删除特殊学生佐证材料 POST /api/exam/org/data/report/del-attachment */
    delAttachment,
    /** 获取监测机构上报类型列表 GET /api/exam/org/data/report/get-list-by-exam-plan-id */
    getListByExamPlanId,
    /** 根据监测计划ID和上报类型获取机构上报信息 GET /api/exam/org/data/report/get-by-type-exam-plan-id */
    getByTypeExamPlanId,
    /** 分页查询机构上报类型列表 POST /api/exam/org/data/report/query-page-list */
    queryPageList,
};
