import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { BaseEpiRollerVO, BaseEpiRollerForm, BaseEpiRollerQuery } from '@/api/mes/baseEpiRoller/types';

/**
 * 查询EPI辊信息列表
 * @param query
 * @returns {*}
 */

export const listBaseEpiRoller = (query?: BaseEpiRollerQuery): AxiosPromise<BaseEpiRollerVO[]> => {
  return request({
    url: '/mes/baseEpiRoller/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询EPI辊信息详细
 * @param epiRollerId
 */
export const getBaseEpiRoller = (epiRollerId: string | number): AxiosPromise<BaseEpiRollerVO> => {
  return request({
    url: '/mes/baseEpiRoller/' + epiRollerId,
    method: 'get'
  });
};

/**
 * 新增EPI辊信息
 * @param data
 */
export const addBaseEpiRoller = (data: BaseEpiRollerForm) => {
  return request({
    url: '/mes/baseEpiRoller',
    method: 'post',
    data: data
  });
};

/**
 * 修改EPI辊信息
 * @param data
 */
export const updateBaseEpiRoller = (data: BaseEpiRollerForm) => {
  return request({
    url: '/mes/baseEpiRoller',
    method: 'put',
    data: data
  });
};

/**
 * 删除EPI辊信息
 * @param epiRollerId
 */
export const delBaseEpiRoller = (epiRollerId: string | number | Array<string | number>) => {
  return request({
    url: '/mes/baseEpiRoller/' + epiRollerId,
    method: 'delete'
  });
};


/**
 * 下拉框查询EPI辊信息列表
 * @param query
 * @returns {*}
 */
export function getProdBaseEpiRollerList (query) {
    return request({
        url: '/mes/baseEpiRoller/getProdBaseEpiRollerList',
        method: 'get',
        params: query
    });
};
