import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { DmsBillsLubeInstanceActivityVO, DmsBillsLubeInstanceActivityForm, DmsBillsLubeInstanceActivityQuery } from '@/api/dms/dmsBillsLubeInstanceActivity/types';

/**
 * 查询润滑工单实例节点列表
 * @param query
 * @returns {*}
 */

export const listDmsBillsLubeInstanceActivity = (query?: DmsBillsLubeInstanceActivityQuery): AxiosPromise<DmsBillsLubeInstanceActivityVO[]> => {
  return request({
    url: '/dms/dmsBillsLubeInstanceActivity/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询润滑工单实例节点详细
 * @param instanceActivityId
 */
export const getDmsBillsLubeInstanceActivity = (instanceActivityId: string | number): AxiosPromise<DmsBillsLubeInstanceActivityVO> => {
  return request({
    url: '/dms/dmsBillsLubeInstanceActivity/' + instanceActivityId,
    method: 'get'
  });
};

/**
 * 新增润滑工单实例节点
 * @param data
 */
export const addDmsBillsLubeInstanceActivity = (data: DmsBillsLubeInstanceActivityForm) => {
  return request({
    url: '/dms/dmsBillsLubeInstanceActivity',
    method: 'post',
    data: data
  });
};

/**
 * 修改润滑工单实例节点
 * @param data
 */
export const updateDmsBillsLubeInstanceActivity = (data: DmsBillsLubeInstanceActivityForm) => {
  return request({
    url: '/dms/dmsBillsLubeInstanceActivity',
    method: 'put',
    data: data
  });
};

/**
 * 删除润滑工单实例节点
 * @param instanceActivityId
 */
export const delDmsBillsLubeInstanceActivity = (instanceActivityId: string | number | Array<string | number>) => {
  return request({
    url: '/dms/dmsBillsLubeInstanceActivity/' + instanceActivityId,
    method: 'delete'
  });
};


/**
 * 下拉框查询润滑工单实例节点列表
 * @param query
 * @returns {*}
 */
export function getDmsBillsLubeInstanceActivityList (query) {
    return request({
        url: '/dms/dmsBillsLubeInstanceActivity/getDmsBillsLubeInstanceActivityList',
        method: 'get',
        params: query
    });
};
