import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { ProdOutputScanInfoVO, ProdOutputScanInfoForm, ProdOutputScanInfoQuery } from '@/api/mes/prodOutputScanInfo/types';

/**
 * 查询生产产出扫描信息列表
 * @param query
 * @returns {*}
 */

export const listProdOutputScanInfo = (query?: ProdOutputScanInfoQuery): AxiosPromise<ProdOutputScanInfoVO[]> => {
  return request({
    url: '/mes/prodOutputScanInfo/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询生产产出扫描信息详细
 * @param prodOutputScanInfoId
 */
export const getProdOutputScanInfo = (prodOutputScanInfoId: string | number): AxiosPromise<ProdOutputScanInfoVO> => {
  return request({
    url: '/mes/prodOutputScanInfo/' + prodOutputScanInfoId,
    method: 'get'
  });
};

/**
 * 新增生产产出扫描信息
 * @param data
 */
export const addProdOutputScanInfo = (data: ProdOutputScanInfoForm) => {
  return request({
    url: '/mes/prodOutputScanInfo',
    method: 'post',
    data: data
  });
};

/**
 * 修改生产产出扫描信息
 * @param data
 */
export const updateProdOutputScanInfo = (data: ProdOutputScanInfoForm) => {
  return request({
    url: '/mes/prodOutputScanInfo',
    method: 'put',
    data: data
  });
};

/**
 * 删除生产产出扫描信息
 * @param prodOutputScanInfoId
 */
export const delProdOutputScanInfo = (prodOutputScanInfoId: string | number | Array<string | number>) => {
  return request({
    url: '/mes/prodOutputScanInfo/' + prodOutputScanInfoId,
    method: 'delete'
  });
};


/**
 * 下拉框查询生产产出扫描信息列表
 * @param query
 * @returns {*}
 */
export function getProdOutputScanInfoList (query) {
    return request({
        url: '/mes/prodOutputScanInfo/getProdOutputScanInfoList',
        method: 'get',
        params: query
    });
};
