import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { WipTrackingReportVO, WipTrackingReportQuery } from './types';

/**
 * 在制品跟踪报表（分页）
 */
export const listWipTrackingReport = (query: WipTrackingReportQuery): AxiosPromise<WipTrackingReportVO[]> => {
  return request({
    url: '/mes/prodReport/wipTrackingReport',
    method: 'get',
    params: query
  });
};

/**
 * 在制品跟踪报表（导出）
 */
export const exportWipTrackingReport = (query: WipTrackingReportQuery) => {
  return request({
    url: '/mes/prodReport/wipTrackingReport/export',
    method: 'post',
    params: query,
    responseType: 'blob'
  });
};