import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { PsmStoreTypeVO, PsmStoreTypeForm, PsmStoreTypeQuery } from '@/api/wms/psmStoreType/types';

/**
 * 查询成品仓库类型列表
 * @param query
 * @returns {*}
 */

export const listPsmStoreType = (query?: PsmStoreTypeQuery): AxiosPromise<PsmStoreTypeVO[]> => {
  return request({
    url: '/wms/psmStoreType/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询成品仓库类型详细
 * @param storeTypeId
 */
export const getPsmStoreType = (storeTypeId: string | number): AxiosPromise<PsmStoreTypeVO> => {
  return request({
    url: '/wms/psmStoreType/' + storeTypeId,
    method: 'get'
  });
};

/**
 * 新增成品仓库类型
 * @param data
 */
export const addPsmStoreType = (data: PsmStoreTypeForm) => {
  return request({
    url: '/wms/psmStoreType',
    method: 'post',
    data: data
  });
};

/**
 * 修改成品仓库类型
 * @param data
 */
export const updatePsmStoreType = (data: PsmStoreTypeForm) => {
  return request({
    url: '/wms/psmStoreType',
    method: 'put',
    data: data
  });
};

/**
 * 删除成品仓库类型
 * @param storeTypeId
 */
export const delPsmStoreType = (storeTypeId: string | number | Array<string | number>) => {
  return request({
    url: '/wms/psmStoreType/' + storeTypeId,
    method: 'delete'
  });
};


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