import request from '@/utils/request'

// 工程项目-列表
export function getProjectList(query) {
  return request({
    url: '/material/base/bmProjectInfo/projectInfoAll',
    method: 'get',
    params: query
  })
}
//工程项目--新增
export function addProject(data) {
  return request({
    url: '/material/base/bmProjectInfo',
    method: 'post',
    data: data
  })
}

// 工程项目--修改
export function updateProject(data) {
  return request({
    url: '/material/base/bmProjectInfo',
    method: 'put',
    data: data
  })
}
// //工程项目--删除
export function delProject(proId) {
  return request({
    url: '/material/base/bmProjectInfo/' + proId,
    method: 'delete'
  })
}

// 标段工程-列表
export function ProjectLotList(query) {
  return request({
    url: '/material/base/bmProjectLot/projectLotAll',
    method: 'get',
    params: query
  })
}
//标段工程--新增
export function addProjectLot(data) {
  return request({
    url: '/material/base/bmProjectLot',
    method: 'post',
    data: data
  })
}

// 标段工程--修改
export function updateProjectLot(data) {
  return request({
    url: '/material/base/bmProjectLot',
    method: 'put',
    data: data
  })
}
//标段工程--删除
export function delProjectLot(lotId) {
  return request({
    url: '/material/base/bmProjectLot/' + lotId,
    method: 'delete'
  })
}
//工程项目下拉数据
export function getProjectSelect(data) {
  return request({
    url: '/material/base/bmProjectInfo/getProjectLot',
    method: 'post',
    data: data
  })
}


// 往来单位-列表
export function unitInfoAll(query) {
  return request({
    url: '/material/base/bmUnitInfo/unitInfoAll',
    method: 'get',
    params: query
  })
}
//往来单位--新增
export function addUnit(data) {
  return request({
    url: '/material/base/bmUnitInfo',
    method: 'post',
    data: data
  })
}

// 往来单位--修改
export function updateUnit(data) {
  return request({
    url: '/material/base/bmUnitInfo',
    method: 'put',
    data: data
  })
}
// 往来单位--删除
export function delUnit(unitId) {
  return request({
    url: '/material/base/bmUnitInfo/' + unitId,
    method: 'delete'
  })
}


// 往来单位-人员配置-左侧人员
export function getUserList(query) {
  return request({
    url: '/system/user/list',
    method: 'get',
    params: query
  })
}

// 往来单位-人员配置-右侧单位
export function getTypeList(query) {
  return request({
    url: '/material/base/bmUnitInfo/typeList',
    method: 'get',
    params: query
  })
}

// 往来单位-人员配置-保存按钮
export function unitPersonAll(query) {
  return request({
    url: '/material/base/bmUnitPerson',
    method: 'post',
    data: query
  })
}

// 往来单位-人员配置-解绑
export function delUnitPerson(unitId) {
  return request({
    url: '/material/base/bmUnitPerson/' + unitId,
    method: 'delete'
  })
}


// 字典表数据库
// 单位类型-列表
export function unitTypeList(query) {
  return request({
    url: '/material/base/dic/list',
    method: 'get',
    params: query
  })
}
// 单位类型-列表-下拉
export function unitTypeListAll(query) {
  return request({
    url: '/material/base/dic/lists',
    method: 'get',
    params: query
  })
}
// 标签编号-列表
export function getMaMachineLabelApi(query) {
  return request({
    url: '/material/base/maMachineLabel/list',
    method: 'get',
    params: query
  })
}
//单位类型--新增
export function addMaMachineLabelApi(data) {
  return request({
    url: '/material/base/maMachineLabel',
    method: 'post',
    data: data
  })
}
// 单位类型-详情
export function unitTypeDetail(query) {
  return request({
    url: '/material/base/dic/listId',
    method: 'get',
    params: query
  })
}
//单位类型--新增
export function addUnitType(data) {
  return request({
    url: '/material/base/dic',
    method: 'post',
    data: data
  })
}

// 单位类型--修改
export function updateUnitType(data) {
  return request({
    url: '/material/base/dic',
    method: 'put',
    data: data
  })
}

export function statusUnitType(data) {
  return request({
    url: '/material/base/dic/status',
    method: 'put',
    params: data
  })
}

//单位类型--删除
export function delUnitType(typeIds) {
  return request({
    url: '/material/base/dic/' + typeIds,
    method: 'delete'
  })
}



// 资产属性管理-列表
export function propInfoList(query) {
  return request({
    url: '/material/base/maPropInfo/list',
    method: 'get',
    params: query
  })
}
//资产属性管理--新增
export function addPropInfo(data) {
  return request({
    url: '/material/base/maPropInfo',
    method: 'post',
    data: data
  })
}

// 资产属性管理--修改
export function updatePropInfo(data) {
  return request({
    url: '/material/base/maPropInfo',
    method: 'put',
    data: data
  })
}
//资产属性管理--删除
export function delPropInfo(propId) {
  return request({
    url: '/material/base/maPropInfo/' + propId,
    method: 'delete'
  })
}





// 资产属性配置-左侧人员
export function getProLists(query) {
  return request({
    url: '/material/base/maPropInfo/lists',
    method: 'get',
    params: query
  })
}

// 资产属性配置-右侧list
export function getMaTypeList(query) {
  return request({
    url: '/material/base/maPropInfo/getMaTypeList',
    method: 'get',
    params: query
  })
}

// 资产属性配置-保存按钮
export function savePropInfo(query) {
  return request({
    url: '/material/base/maPropInfo/save',
    method: 'post',
    data: query
  })
}

// 资产属性配置-解绑
export function UnbindPropInfo(unitId) {
  return request({
    url: '/material/base/maPropSet/' + unitId,
    method: 'delete'
  })
}


// 获取设备信息-qrCode
export function getMachineByQrCode(query) {
  return request({
    url: '/material/base/machine/getMachineByQrCode',
    method: 'get',
    params: query
  })
}




