import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { BaseMouthPlateVO, BaseMouthPlateForm, BaseMouthPlateQuery } from '@/api/mes/baseMouthPlate/types';

/**
 * 查询口型板信息列表
 * @param query
 * @returns {*}
 */

export const listBaseMouthPlate = (query?: BaseMouthPlateQuery): AxiosPromise<BaseMouthPlateVO[]> => {
  return request({
    url: '/mes/baseMouthPlate/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询口型板信息详细
 * @param mouthPlateId
 */
export const getBaseMouthPlate = (mouthPlateId: string | number): AxiosPromise<BaseMouthPlateVO> => {
  return request({
    url: '/mes/baseMouthPlate/' + mouthPlateId,
    method: 'get'
  });
};

/**
 * 新增口型板信息
 * @param data
 */
export const addBaseMouthPlate = (data: BaseMouthPlateForm) => {
  return request({
    url: '/mes/baseMouthPlate',
    method: 'post',
    data: data
  });
};

/**
 * 修改口型板信息
 * @param data
 */
export const updateBaseMouthPlate = (data: BaseMouthPlateForm) => {
  return request({
    url: '/mes/baseMouthPlate',
    method: 'put',
    data: data
  });
};

/**
 * 删除口型板信息
 * @param mouthPlateId
 */
export const delBaseMouthPlate = (mouthPlateId: string | number | Array<string | number>) => {
  return request({
    url: '/mes/baseMouthPlate/' + mouthPlateId,
    method: 'delete'
  });
};


/**
 * 下拉框查询口型板信息列表
 * @param query
 * @returns {*}
 */
export function getProdBaseMouthPlateList(query) {
  return request({
    url: '/mes/baseMouthPlate/getProdBaseMouthPlateList',
    method: 'get',
    params: query
  });
};
