import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { HppOutStockDetailVO, HppOutStockDetailForm, HppOutStockDetailQuery } from '@/api/wms/hppOutStockDetail/types';

/**
 * 查询半成品出库列表
 * @param query
 * @returns {*}
 */

export const listHppOutStockDetail = (query?: HppOutStockDetailQuery): AxiosPromise<HppOutStockDetailVO[]> => {
  return request({
    url: '/wms/hppOutStockDetail/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询半成品出库详细
 * @param objId
 */
export const getHppOutStockDetail = (objId: string | number): AxiosPromise<HppOutStockDetailVO> => {
  return request({
    url: '/wms/hppOutStockDetail/' + objId,
    method: 'get'
  });
};

/**
 * 新增半成品出库
 * @param data
 */
export const addHppOutStockDetail = (data: HppOutStockDetailForm) => {
  return request({
    url: '/wms/hppOutStockDetail',
    method: 'post',
    data: data
  });
};

/**
 * 修改半成品出库
 * @param data
 */
export const updateHppOutStockDetail = (data: HppOutStockDetailForm) => {
  return request({
    url: '/wms/hppOutStockDetail',
    method: 'put',
    data: data
  });
};

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


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