import request from '@/utils/request'
import qs from 'qs';
// 真查询部门下拉树结构  建筑
export function treeDat() {
  return request({
    url: '/ems/buildInfo/treeData',
    method: 'get'
  })
}
//业态
export function treeDattwo() {
  return request({
    url: '/ems/businessType/treeData',
    method: 'get'
  })
}
//分页
export function treeDatthree() {
  return request({
    url: '/ems/subentryType/treeData',
    method: 'get'
  })
}
// 查询计量与类型对应关系列表
export function listTypeRelation(query) {
  return request({
    url: '/ems/base/typeRelation/list',
    method: 'get',
    params: query
  })
}

// 查询计量与类型对应关系详细
export function getTypeRelation(objid) {
  return request({
    url: '/ems/base/typeRelation/' + objid,
    method: 'get'
  })
}

// 新增计量与类型对应关系
export function addTypeRelation(data) {
  return request({
    url: '/ems/base/typeRelation/edit',
    method: 'post',
    data: qs.stringify(data),
    contentType:'application/x-www-form-urlencoded',
  })
}

// 修改计量与类型对应关系
export function updateTypeRelation(data) {
  return request({
    url: '/ems/base/typeRelation/edit',
    method: 'post',
    data: qs.stringify(data),
    contentType:'application/x-www-form-urlencoded',
  })
}

// 删除计量与类型对应关系
export function delTypeRelation(objid) {
  return request({
    url: '/ems/base/typeRelation/' + objid,
    method: 'delete'
  })
}
