import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { PsmInLoadDetailVO, PsmInLoadDetailForm, PsmInLoadDetailQuery } from '@/api/wms/psmInLoadDetail/types';

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

export const listPsmInLoadDetail = (query?: PsmInLoadDetailQuery): AxiosPromise<PsmInLoadDetailVO[]> => {
  return request({
    url: '/wms/psmInLoadDetail/list',
    method: 'get',
    params: query
  });
};

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

/**
 * 新增装车架子详细信息
 * @param data
 */
export const addPsmInLoadDetail = (data: PsmInLoadDetailForm) => {
  return request({
    url: '/wms/psmInLoadDetail',
    method: 'post',
    data: data
  });
};

/**
 * 修改装车架子详细信息
 * @param data
 */
export const updatePsmInLoadDetail = (data: PsmInLoadDetailForm) => {
  return request({
    url: '/wms/psmInLoadDetail',
    method: 'put',
    data: data
  });
};

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


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