import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { PsmInStockDetailVO, PsmInStockDetailForm, PsmInStockDetailQuery } from '@/api/wms/psmInStockDetail/types';

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

export const listPsmInStockDetail = (query?: PsmInStockDetailQuery): AxiosPromise<PsmInStockDetailVO[]> => {
  return request({
    url: '/wms/psmInStockDetail/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询成品入库详细
 * @param objid
 */
export const getPsmInStockDetail = (objid: string | number): AxiosPromise<PsmInStockDetailVO> => {
  return request({
    url: '/wms/psmInStockDetail/' + objid,
    method: 'get'
  });
};

/**
 * 新增成品入库
 * @param data
 */
export const addPsmInStockDetail = (data: PsmInStockDetailForm) => {
  return request({
    url: '/wms/psmInStockDetail',
    method: 'post',
    data: data
  });
};

/**
 * 修改成品入库
 * @param data
 */
export const updatePsmInStockDetail = (data: PsmInStockDetailForm) => {
  return request({
    url: '/wms/psmInStockDetail',
    method: 'put',
    data: data
  });
};

/**
 * 删除成品入库
 * @param objid
 */
export const delPsmInStockDetail = (objid: string | number | Array<string | number>) => {
  return request({
    url: '/wms/psmInStockDetail/' + objid,
    method: 'delete'
  });
};


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