import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { PsmStoreVO, PsmStoreForm, PsmStoreQuery } from '@/api/wms/psmStore/types';

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

export const listPsmStore = (query?: PsmStoreQuery): AxiosPromise<PsmStoreVO[]> => {
  return request({
    url: '/wms/psmStore/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询成品仓库管理详细
 * @param storeId
 */
export const getPsmStore = (storeId: string | number): AxiosPromise<PsmStoreVO> => {
  return request({
    url: '/wms/psmStore/' + storeId,
    method: 'get'
  });
};

/**
 * 新增成品仓库管理
 * @param data
 */
export const addPsmStore = (data: PsmStoreForm) => {
  return request({
    url: '/wms/psmStore',
    method: 'post',
    data: data
  });
};

/**
 * 修改成品仓库管理
 * @param data
 */
export const updatePsmStore = (data: PsmStoreForm) => {
  return request({
    url: '/wms/psmStore',
    method: 'put',
    data: data
  });
};

/**
 * 删除成品仓库管理
 * @param storeId
 */
export const delPsmStore = (storeId: string | number | Array<string | number>) => {
  return request({
    url: '/wms/psmStore/' + storeId,
    method: 'delete'
  });
};


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