import request from '@/utils/request';
import { AxiosPromise } from 'axios';

/**
 * 查询检测套餐列表
 * @param query
 * @returns {*}
 */

export const testPackageList = (query?: any): any => {
    return request({
        url: '/dgtmedicine/testPackage/list',
        method: 'get',
        params: query
    });
};
/**
 * 查询检测套餐列表统计
 * @param query
 * @returns {*}
 */
export const testPackageListCount = (query?: any): any => {
    return request({
        url: '/dgtmedicine/testPackage/queryPackCount',
        method: 'get',
        params: query
    });
};
/**
 * 获取企业信息列表
 * @param id
 * @returns {*}
 */
export const getEnterpriseList = (query?: any): any => {
    return request({
        url: '/dgtmedicine/member/list',
        method: 'get',
        params: query
    });
};
/**
 * 新增检测套餐
 * @param id
 * @returns {*}
 */
export const addTestPackage = (data?: any): any => {
    return request({
        url: '/dgtmedicine/testPackage/add',
        method: 'post',
        data
    });
};
/**
 * 修改检测套餐
 * @param id
 * @returns {*}
 */
export const editTestPackage = (data?: any): any => {
    return request({
        url: '/dgtmedicine/testPackage/edit',
        method: 'post',
        data
    });
};
/**
 * 上架检测套餐
 * @param id
 * @returns {*}
 */
export const testPackageSale = (id?: string): any => {
    return request({
        url: `/dgtmedicine/testPackage/onSale/${id}`,
        method: 'post'
    });
};
/**
 * 下架套餐
 * @param id
 * @returns {*}
 */
export const testPackageUnSale = (id?: string): any => {
    return request({
        url: `/dgtmedicine/testPackage/offSale/${id}`,
        method: 'post'
    });
};
/**
 * 复制套餐
 * @param id
 * @returns {*}
 */
export const copyTestPackage = (id?: string): any => {
    return request({
        url: `/dgtmedicine/testPackage/copy/${id}`,
        method: 'get'
    });
};
/**
 * 获取检测套餐详细信息
 * @param id
 * @returns {*}
 */
export const getTestPackage = (id?: string): any => {
    return request({
        url: `/dgtmedicine/testPackage/getInfo/${id}`,
        method: 'get'
    });
};
/**
 * 查询检测套餐项目列表
 * @param id
 * @returns {*}
 */
export const getTestPackageItems = (query?: any): any => {
    return request({
        url: `/dgtmedicine/testItem/list`,
        method: 'get',
        params: query
    });
};
/**
 * 企业id查企业详情
 * @param id
 * @returns {*}
 */
export const getEnterpriseDetail = (id?: string): any => {
    return request({
        url: `/dgtmedicine/member//getMemberInfoById/${id}`,
        method: 'get'
    });
};
/**
 * 删除套餐
 * @param id
 * @returns {*}
 */
export const deleteTestPackage = (id?: string): any => {
    return request({
        url: `/dgtmedicine/testPackage/remove/${id}`,
        method: 'get'
    });
};
