import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { PsmInLoadVO, PsmInLoadForm, PsmInLoadQuery } from '@/api/wms/psmInLoad/types';

/**
 * 查询装车架子信息列表
 * @param query
 * @returns {*}
 */

export const listPsmInLoad = (query?: PsmInLoadQuery): AxiosPromise<PsmInLoadVO[]> => {
  return request({
    url: '/wms/psmInLoad/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询装车架子信息详细
 * @param inLoadId
 */
export const getPsmInLoad = (inLoadId: string | number): AxiosPromise<PsmInLoadVO> => {
  return request({
    url: '/wms/psmInLoad/' + inLoadId,
    method: 'get'
  });
};

/**
 * 新增装车架子信息
 * @param data
 */
export const addPsmInLoad = (data: PsmInLoadForm) => {
  return request({
    url: '/wms/psmInLoad',
    method: 'post',
    data: data
  });
};

/**
 * 修改装车架子信息
 * @param data
 */
export const updatePsmInLoad = (data: PsmInLoadForm) => {
  return request({
    url: '/wms/psmInLoad',
    method: 'put',
    data: data
  });
};

/**
 * 删除装车架子信息
 * @param inLoadId
 */
export const delPsmInLoad = (inLoadId: string | number | Array<string | number>) => {
  return request({
    url: '/wms/psmInLoad/' + inLoadId,
    method: 'delete'
  });
};


/**
 * 下拉框查询装车架子信息列表
 * @param query
 * @returns {*}
 */
export function getWmsPsmInLoadList (query) {
    return request({
        url: '/wms/psmInLoad/getWmsPsmInLoadList',
        method: 'get',
        params: query
    });
};
