import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { WmsMonthlyReportVO, WmsMonthlyReportForm, WmsMonthlyReportQuery } from '@/api/wms/wmsMonthlyReport/types';

/**
 * 查询WMS月度报列表
 * @param query
 * @returns {*}
 */

export const listWmsMonthlyReport = (query?: WmsMonthlyReportQuery): AxiosPromise<WmsMonthlyReportVO[]> => {
  return request({
    url: '/wms/wmsMonthlyReport/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询WMS月度报详细
 * @param reportId
 */
export const getWmsMonthlyReport = (reportId: string | number): AxiosPromise<WmsMonthlyReportVO> => {
  return request({
    url: '/wms/wmsMonthlyReport/' + reportId,
    method: 'get'
  });
};

/**
 * 新增WMS月度报
 * @param data
 */
export const addWmsMonthlyReport = (data: WmsMonthlyReportForm) => {
  return request({
    url: '/wms/wmsMonthlyReport',
    method: 'post',
    data: data
  });
};

/**
 * 修改WMS月度报
 * @param data
 */
export const updateWmsMonthlyReport = (data: WmsMonthlyReportForm) => {
  return request({
    url: '/wms/wmsMonthlyReport',
    method: 'put',
    data: data
  });
};

/**
 * 删除WMS月度报
 * @param reportId
 */
export const delWmsMonthlyReport = (reportId: string | number | Array<string | number>) => {
  return request({
    url: '/wms/wmsMonthlyReport/' + reportId,
    method: 'delete'
  });
};


/**
 * 下拉框查询WMS月度报列表
 * @param query
 * @returns {*}
 */
export function getWmsMonthlyReportList (query) {
    return request({
        url: '/wms/wmsMonthlyReport/getWmsMonthlyReportList',
        method: 'get',
        params: query
    });
};
