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

/**
 * 查询订单列表
 * @param query
 * @returns {*}
 */
export const testOrderList = (query?: any): any => {
    return request({
        url: '/dgtmedicine/testOrder/list',
        method: 'get',
        params: query
    });
};
/**
 * 查询订单状态统计
 * @param query
 * @returns {*}
 */
export const testOrderListCount = (query?: any): any => {
    return request({
        url: '/dgtmedicine/testOrder/statusCount',
        method: 'get',
        params: query
    });
};
/**
 * 获取检测订单详细信息
 * @param query
 * @returns {*}
 */
export const getTestOrderDetail = (orderId?: any): any => {
    return request({
        url: `/dgtmedicine/testOrder/getInfo/${orderId}`,
        method: 'get'
    });
};
/**
 * 备注订单
 * @param query
 * @returns {*}
 */
export const testOrderRemark = (data?: any): any => {
    return request({
        url: '/dgtmedicine/testOrder/remark',
        method: 'post',
        data
    });
};
/**
 * 上传检测报告
 * @param query
 * @returns {*}
 */
export const uploadTestOrderReport = (data?: any): any => {
    return request({
        url: '/dgtmedicine/testOrder/uploadReport',
        method: 'post',
        data
    });
};
/**
 * 上传发票
 * @param query
 * @returns {*}
 */
export const uploadTestOrderInvoice = (data?: any): any => {
    return request({
        url: '/dgtmedicine/testOrder/uploadInvoice',
        method: 'post',
        data
    });
};

/**
 * 订单确认付款
 * @param query
 * @returns {*}
 */
export const testOrderConfirmPay = (orderId?: any): any => {
    return request({
        url: 'dgtmedicine/testOrder/confirmTestOrderPay/' + orderId,
        method: 'get'
    });
};
/**
 * 取消订单
 * @param query
 * @returns {*}
 */
export const testOrderCancel = (orderId?: any): any => {
    return request({
        url: `/dgtmedicine/testOrder/refundPc/${orderId}`,
        method: 'get'
    });
};
