import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { DmsBillsLubeDetailVO, DmsBillsLubeDetailForm, DmsBillsLubeDetailQuery } from '@/api/dms/dmsBillsLubeDetail/types';

/**
 * 查询润滑工单明细列表
 * @param query
 * @returns {*}
 */

export const listDmsBillsLubeDetail = (query?: DmsBillsLubeDetailQuery): AxiosPromise<DmsBillsLubeDetailVO[]> => {
  return request({
    url: '/dms/dmsBillsLubeDetail/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询润滑工单明细详细
 * @param billsLubeDetailId
 */
export const getDmsBillsLubeDetail = (billsLubeDetailId: string | number): AxiosPromise<DmsBillsLubeDetailVO> => {
  return request({
    url: '/dms/dmsBillsLubeDetail/' + billsLubeDetailId,
    method: 'get'
  });
};

/**
 * 新增润滑工单明细
 * @param data
 */
export const addDmsBillsLubeDetail = (data: DmsBillsLubeDetailForm) => {
  return request({
    url: '/dms/dmsBillsLubeDetail',
    method: 'post',
    data: data
  });
};

/**
 * 修改润滑工单明细
 * @param data
 */
export const updateDmsBillsLubeDetail = (data: DmsBillsLubeDetailForm) => {
  return request({
    url: '/dms/dmsBillsLubeDetail',
    method: 'put',
    data: data
  });
};

/**
 * 删除润滑工单明细
 * @param billsLubeDetailId
 */
export const delDmsBillsLubeDetail = (billsLubeDetailId: string | number | Array<string | number>) => {
  return request({
    url: '/dms/dmsBillsLubeDetail/' + billsLubeDetailId,
    method: 'delete'
  });
};


/**
 * 下拉框查询润滑工单明细列表
 * @param query
 * @returns {*}
 */
export function getDmsBillsLubeDetailList (query) {
    return request({
        url: '/dms/dmsBillsLubeDetail/getDmsBillsLubeDetailList',
        method: 'get',
        params: query
    });
};
