import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { performanceVO,performanceForm,performanceQuery } from './types';
/**
 * 成交商机汇总
 * @param query
 * @returns {*}
 */

export const closedBusiness = (query?: performanceQuery & PageQuery): AxiosPromise => {
    return request({
      url: '/Summary/closed-business',
      method: 'post',
      data: query
    });
  };

/**
 * 成交商机明细
 * @param query
 * @returns {*}
 */

export const salesBusiness = (query?: performanceQuery & PageQuery): AxiosPromise => {
    return request({
      url: '/Summary/closed-business-list',
      method: 'post',
      data: query
    });
  };

  /**
 * 产品销售汇总-按产品分类
 * @param query
 * @returns {*}
 */

export const productSalesBusiness = (query?: performanceQuery & PageQuery): AxiosPromise => {
    return request({
      url: '/Summary/product-sales-prodList',
      method: 'post',
      data: query
    });
  };

  /**
 * 产品销售汇总-按时间段分类
 * @param query
 * @returns {*}
 */

export const productTimeBusiness = (query?: performanceQuery & PageQuery): AxiosPromise => {
    return request({
      url: '/Summary/product-sales-timeList',
      method: 'post',
      data: query
    });
  };

