import request from '../../utils/request';

export function getBusinessListFromServer (params) { // 业务功能查询
  return request({
    url: '/featureTenant/query/features',
    method: 'get',
    params,
  });
}
export function getWorkFlowDefinitionFromServer (params) {
  return request({
    url: '/workflow/query/workflowDefinitions',
    method: 'get',
    params,
  });
}
export function createWorkFlowToServer (data) {
  return request({
    url: '/workflow/api/create',
    method: 'post',
    data,
    headers: { 'content-type': 'application/json' },
  });
}
export function queryPersonsUnderDept (params) {
  return request({
    url: '/baseStaff/query/staffsByDept',
    params,
  });
}
export function queryRolesUnderDept (params) {
  return request({
    url: '/baseRole/query/findRoles',
    params,
  });
}
export function queryAllRolesInCompany (params) {
  return request({
    url: '/baseRole/query/roleList',
    params,
  });
}
export function queryWorkFlowInfo (params) {
  return request({
    url: '/workflow/query/workflowInfo',
    params,
  })
}
export function changeWorkFlowToServer (data) {
  return request({
    url: '/workflow/api/changeInfo',
    method: 'post',
    headers: { 'content-type': 'application/json' },
    data,
  })
}

export function removeLatestWorkflow (data) {
  return request({
    url: '/workflow/api/removeLatestWorkflow',
    method: 'post',
    data,
  })
}

// 获取物料类型
export function getMaterielType (data) {
  return request({
    url: '/supplyMaterielTypeInfo/query/selectListMaterielType',
    method: 'get',
    params: data
  });
}
