import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { HppInStockDetailVO, HppInStockDetailForm, HppInStockDetailQuery } from '@/api/wms/hppInStockDetail/types';

/**
 * 查询半制品入库列表
 * @param query
 * @returns {*}
 */

export const listHppInStockDetail = (query?: HppInStockDetailQuery): AxiosPromise<HppInStockDetailVO[]> => {
  return request({
    url: '/wms/hppInStockDetail/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询半制品入库详细
 * @param objId
 */
export const getHppInStockDetail = (objId: string | number): AxiosPromise<HppInStockDetailVO> => {
  return request({
    url: '/wms/hppInStockDetail/' + objId,
    method: 'get'
  });
};

/**
 * 新增半制品入库
 * @param data
 */
export const addHppInStockDetail = (data: HppInStockDetailForm) => {
  return request({
    url: '/wms/hppInStockDetail',
    method: 'post',
    data: data
  });
};

/**
 * 修改半制品入库
 * @param data
 */
export const updateHppInStockDetail = (data: HppInStockDetailForm) => {
  return request({
    url: '/wms/hppInStockDetail',
    method: 'put',
    data: data
  });
};

/**
 * 删除半制品入库
 * @param objId
 */
export const delHppInStockDetail = (objId: string | number | Array<string | number>) => {
  return request({
    url: '/wms/hppInStockDetail/' + objId,
    method: 'delete'
  });
};


/**
 * 下拉框查询半制品入库列表
 * @param query
 * @returns {*}
 */
export function getWmsHppInStockDetailList (query) {
    return request({
        url: '/wms/hppInStockDetail/getWmsHppInStockDetailList',
        method: 'get',
        params: query
    });
};
