import request, { downloadFile } from '@/utils/request';
import { AxiosPromise } from 'axios';
// 查询会议列表
export const trainingList = (query?: any): AxiosPromise => {
    return request({
        url: '/dgtmedicine/training/list',
        method: 'get',
        params: query
    });
};
// 会议新增
export const trainingAdd = (data: any): AxiosPromise => {
    return request({
        url: '/dgtmedicine/training/add',
        method: 'post',
        data
    });
};
// 会议修改
export const trainingUpdate = (data: any): AxiosPromise => {
    return request({
        url: '/dgtmedicine/training/edit',
        method: 'post',
        data
    });
};
// 会议详情
export const trainingDetail = (id: string): AxiosPromise => {
    return request({
        url: `/dgtmedicine/training/getInfo/${id}`,
        method: 'get'
    });
};
// 会议状态统计
export const queryTrainingCount = (query?: any): AxiosPromise => {
    return request({
        url: '/dgtmedicine/training/queryTrainingCount',
        method: 'get',
        params: query
    });
};
// 会议删除
export const trainingDelete = (id: string): AxiosPromise => {
    return request({
        url: `/dgtmedicine/training/delById/${id}`,
        method: 'get'
    });
};
// 会议上架
export const publishTraining = (id: string): AxiosPromise => {
    return request({
        url: `/dgtmedicine/training/publishTraining/${id}`,
        method: 'get'
    });
};
// 会议下架
export const unpublishTraining = (id: string): AxiosPromise => {
    return request({
        url: `/dgtmedicine/training/unpublishTraining/${id}`,
        method: 'get'
    });
};
// 会议详情
export const trainingDetailById = (id: string): AxiosPromise => {
    return request({
        url: `/dgtmedicine/training/getInfo/${id}`,
        method: 'get'
    });
};
// 当前会议下报名成员
export const trainingMembers = (params: any): AxiosPromise => {
    return request({
        url: `/dgtmedicine/trainingSignup/list`,
        method: 'get',
        params
    });
};
// 按搜索结果导出参会人员
export const exportTrainingMembers = (params: any): AxiosPromise => {
    return downloadFile({
        url: `/dgtmedicine/trainingSignup/download`,
        method: 'get',
        params,
        responseType: 'blob'
    });
};
// 报名审批统计
export const signupCount = (id): AxiosPromise => {
    return request({
        url: `/dgtmedicine/trainingSignup/signupCount?trainingId=${id}`,
        method: 'get'
    });
};
// 报名审核
export const signupApproval = (data: any): AxiosPromise => {
    return request({
        url: '/dgtmedicine/trainingSignup/signupApproval',
        method: 'post',
        data
    });
};
// 开关会议临时状态
export const offOrNoTemp = (params: any): AxiosPromise => {
    return request({
        url: `/dgtmedicine/training/offOrNoTemp`,
        method: 'get',
        params
    });
};
// 修改价格
export const editPrice = (data: any): AxiosPromise => {
    return request({
        url: `/dgtmedicine/trainingSignup/editPrice`,
        method: 'post',
        data
    });
};
// 开关会议临时状态
export const confirmSigPublicPay = (id: any, payType:any): AxiosPromise => {
    return request({
        url: `/dgtmedicine/trainingSignup/confirmSigPublicPay/${id}?payType=${payType}`,
        method: 'get'
    });
};
// 上传发票
export const uploadInvoice = (data: any): AxiosPromise => {
    return request({
        url: `/dgtmedicine/trainingSignup/uploadInvoice`,
        method: 'post',
        data
    });
};
// 会议门户开关
export const switchPage = (params: any): AxiosPromise => {
    return request({
        url: `/dgtmedicine/training/switchPage`,
        method: 'get',
        params
    });
};
// 导入会议特殊人员收费列表
export const importFeeList = (data: any): AxiosPromise => {
    return request({
        url: `/dgtmedicine/training/importFeeList`,
        method: 'post',
        data
    });
};
// 查询培训特殊人员收费列表
export const trainingfee = (params: any): AxiosPromise => {
    return request({
        url: `/dgtmedicine/trainingfee/list`,
        method: 'get',
        params
    });
};
// 清空会议特殊人员收费列表
export const clearFeeList = (id: any): AxiosPromise => {
    return request({
        url: `/dgtmedicine/training/clearFeeList/${id}`,
        method: 'get'
    });
};
//报名信息标注
export const markTags = (data: any): AxiosPromise => {
    return request({
        url: `/dgtmedicine/trainingSignup/markTags`,
        method: 'post',
        data
    });
};
//修改指定联系人
export const signupContact = (data: any): AxiosPromise => {
    return request({
        url: `/dgtmedicine/trainingSignup/signupContact`,
        method: 'post',
        data
    });
};
// 取消报名
export const cancelTrainingSignup = (id: any): AxiosPromise => {
    return request({
        url: `/dgtmedicine/trainingSignup/cancelTrainingSignup/${id}`,
        method: 'get'
    });
};
