import request from '@/utils/request'
//机具类型管理
export function getMaTypeList(query) {
    return request({
        url: '/material/base/type/getMaTypeList',
        method: 'get',
        params: query,
    })
}
//获取机具类型列表
export function getListByMaType(query) {
    return request({
        url: '/material/base/type/getListByMaType',
        method: 'get',
        params: query,
    })
}
//获取机具类型列表
export function getListByMaTypePid(query) {
  return request({
    url: '/material/base/type/getListByMaTypePid',
    method: 'get',
    params: query,
  })
}
//获取机具类型树2
export function equipmentTypeTree(query) {
    return request({
        url: '/material/base/type/equipmentType',
        method: 'get',
        params: query,
    })
}
//机具类型-详情
export function getMaType(typeId) {
    return request({
        url: '/material/base/type/' + typeId,
        method: 'get',
    })
}
//获取基层单位
export function getunitInfoAll(query) {
    return request({
        url: '/material/base/bmUnitInfo/unitInfoAll',
        method: 'get',
        params: query,
    })
}

//机具类型--新增
export function addMaType(data) {
    return request({
        url: '/material/base/type',
        method: 'post',
        data: data,
    })
}
// 机具类型--修改
export function updateMaType(data) {
    return request({
        url: '/material/base/type',
        method: 'put',
        data: data,
    })
}

//供应商管理--删除
export function delMaType(typeId) {
    return request({
        url: '/material/base/type/' + typeId,
        method: 'delete',
    })
}

//供应商管理-列表
export function listSupplierInfo(query) {
    return request({
        url: '/material/base/supplierInfo/list',
        method: 'get',
        params: query,
    })
}
//供应商管理-详情
export function getSupplierInfo(supplierId) {
    return request({
        url: '/material/base/supplierInfo/' + supplierId,
        method: 'get',
    })
}
//供应商管理--新增
export function addSupplier(data) {
    return request({
        url: '/material/base/supplierInfo',
        method: 'post',
        data: data,
    })
}
// 供应商管理--修改
export function updateSupplier(data) {
    return request({
        url: '/material/base/supplierInfo',
        method: 'put',
        data: data,
    })
}
//供应商管理--删除
export function delSupplier(supplierIds) {
    return request({
        url: '/material/base/supplierInfo/' + supplierIds,
        method: 'delete',
    })
}
//供应商管理-下拉数据
export function supplierInfoList(query) {
    return request({
        url: '/material/base/supplierInfo/supplierInfoList',
        method: 'get',
        params: query,
    })
}

//机具设备管理-列表
export function listMachine(query) {
    return request({
        url: '/material/base/machine/getMachine',
        method: 'get',
        params: query,
    })
}
//机具设备管理-详情
export function getMachine(maId) {
    return request({
        url: '/material/base/machine/' + maId,
        method: 'get',
    })
}

//机具设备管理--新增
export function addMachine(data) {
    return request({
        url: '/material/base/machine',
        method: 'post',
        data: data,
    })
}
// 机具设备管理--修改
export function updateMachine(data) {
    return request({
        url: '/material/base/machine',
        method: 'put',
        data: data,
    })
}
//机具设备管理--删除
export function delMachine(maIds) {
    return request({
        url: '/material/base/machine/' + maIds,
        method: 'delete',
    })
}

//
// //配件管理-列表
export function listPartType(query) {
    return request({
        url: '/material/base/maPartType/list',
        method: 'get',
        params: query,
    })
}

//配件管理--新增
export function addPartType(data) {
    return request({
        url: '/material/base/maPartType',
        method: 'post',
        data: data,
    })
}
//配件管理--新增
export function addMaPartType(data) {
    return request({
        url: '/material/base/maPartType',
        method: 'post',
        data: data,
    })
}
// 配件管理--修改
export function updatePartType(data) {
    return request({
        url: '/material/base/maPartType',
        method: 'put',
        data: data,
    })
}
// 配件管理--修改
export function updatePartTypeById(data) {
    return request({
        url: '/material/base/maPartType/updateById',
        method: 'post',
        data: data,
    })
}
//配件管理--删除
export function delPartType(maIds) {
    return request({
        url: '/material/base/maPartType/' + maIds,
        method: 'delete',
    })
}
//配件管理--查询
export function getPartType(maIds) {
    return request({
        url: '/material/base/maPartType/' + maIds,
        method: 'get',
    })
}

// 获取库管员配置列表
export function warehouseKeeperInfoAll(query) {
    return request({
        url: '/material/base/maWarehouseKeeper/warehouseKeeperInfoAll',
        method: 'get',
        params: query,
    })
}
//库管员配置-根据人员名称查询左侧列表
export function getMaUserList(query) {
    return request({
        url: '/material/base/maWarehouseKeeper/getMaUserList',
        method: 'get',
        params: query,
    })
}

//库管员配置-保存
export function addHouseKeeper(data) {
    return request({
        url: '/material/base/maWarehouseKeeper/addList',
        method: 'post',
        data: data,
    })
}

//库管员配置-删除
export function delHouseKeeper(data) {
    return request({
        url: '/material/base/maWarehouseKeeper/remove',
        method: 'post',
        data: data,
    })
}

// 获取维修班配置列表
export function wareRepairerInfoAll(query) {
    return request({
        url: '/material/base/maintenanceGang/maintenanceGangInfoAll',
        method: 'get',
        params: query,
    })
}
//维修班配置-根据人员名称查询左侧列表
export function getRepairerList(query) {
    return request({
        url: '/material/base/maintenanceGang/getMaUserList',
        method: 'get',
        params: query,
    })
}

//维修班配置-保存
export function addRepairer(data) {
    return request({
        url: '/material/base/maintenanceGang/addList',
        method: 'post',
        data: data,
    })
}

//维修班配置-删除
export function delRepairer(data) {
    return request({
        url: '/material/base/maintenanceGang/remove',
        method: 'post',
        data: data,
    })
}

//机具厂家-下拉数据
export function getDeviceFactoryCbx(data) {
    return request({
        url: '/material/base/select/getDeviceFactoryCbx',
        method: 'post',
        data: data,
    })
}
