import http from '../utils/http'

/**
 * 设备相关的
 */
// 设备分类
export const apiFindEquipmentType = data => {
  return http({ url: '/lz_management/api/findEquipmentType', method: 'post', data })
}

// 修改设备信息
export const apiChangeEquipment = data => {
  return http({ url: '/lz_management/api/changeEquipmentInfo', method: 'post', data })
}

// 根据编码获取设备信息
export const apiFindEquipmentByCode = (data, code) => {
  return http({ url: `/lz_management/api/findEquipmentById?code=${code}`, method: 'get', data })
}


// 搜索用户
export const apiFindStaff = data => {
  return http({ url: `/lz_management/api/findEmployeeByName`, method: 'post', data })
}

// 搜索使用地
export const apiFindDepat = data => {
  return http({ url: `/lz_management/api/findSpecialApplyByName`, method: 'post', data })
}

// 获取使用地，使用人的设备信息
export const apiFindStaffDevice = data => {
  return http({ url: `/lz_management/api/findUsersEquipmentsByName`, method: 'post', data })
}

// 获取类型信息
export const apiGetDeviceTypes = data => {
  return http({ url: `/lz_management/modules/type/equipmentTypeList`, method: 'post', data })
}

// 获取规格信息
export const apiGetDeviceSpecs = data => {
  return http({ url: `/lz_management/modules/specs/equipmentSpecsList`, method: 'post', data })
}

// 获取品牌信息
export const apiGetDeviceBrands = data => {
  return http({ url: `/lz_management/modules/specs/brandList`, method: 'post', data })
}

// 获取品牌信息列表
export const apiGetDeviceBrandList = data => {
  return http({ url: `/lz_management/modules/brand/equipmentBrandList`, method: 'post', data })
}

// 编辑规格信息
export const apiEditDeviceSpecs = data => {
  return http({ url: `/lz_management/modules/specs/equipmentSpecsEdit`, method: 'post', data })
}

// 添加规格信息
export const apiAddDeviceSpecs = data => {
  return http({ url: `/lz_management/modules/specs/equipmentSpecsAdd`, method: 'post', data })
}

// 删除规格信息
export const apiDelDeviceSpecs = data => {
  return http({ url: `/lz_management/modules/specs/equipmentSpecsDelete`, method: 'post', data })
}

// 编辑规格信息
export const apiEditDeviceTypes = data => {
  return http({ url: `/lz_management/modules/type/equipmentTypeEdit`, method: 'post', data })
}

// 添加规格信息
export const apiAddDeviceTypes = data => {
  return http({ url: `/lz_management/modules/type/equipmentTypeAdd`, method: 'post', data })
}

// 删除规格信息
export const apiDelDeviceTypes = data => {
  return http({ url: `/lz_management/modules/type/equipmentTypeDelete`, method: 'post', data })
}

// 编辑品牌信息
export const apiEditDeviceBrands = data => {
  return http({ url: `/lz_management/modules/brand/equipmentBrandEdit`, method: 'post', data })
}

// 添加品牌信息
export const apiAddDeviceBrands = data => {
  return http({ url: `/lz_management/modules/brand/equipmentBrandAdd`, method: 'post', data })
}

// 删除品牌信息
export const apiDelDeviceBrands = data => {
  return http({ url: `/lz_management/modules/brand/equipmentBrandDelete`, method: 'post', data })
}

// 获取使用设备列表
export const apiGetUseDeviceList = data => {
  return http({ url: `/lz_management/modules/usereq/equipmentInfoList`, method: 'post', data })
}

// 编辑使用设备信息
export const apiEditUseDevice = data => {
  return http({ url: `/lz_management/modules/usereq/equipmentInfoEdit`, method: 'post', data })
}


// 删除使用设备信息
export const apiDelUseDevice = data => {
  return http({ url: `/lz_management/modules/usereq/equipmentInfoDelete`, method: 'post', data })
}

// 打印编码
export const apiGetRePrintCode = (data, code) => {
  return http({ url: `/lz_management/oneCode/re/print?code=${code}`, method: 'get', data })
}

// 批量生成制定数量的编码
export const apiGetNewPrintCodes = (data, count) => {
  return http({ url: `/lz_management/oneCode/new/prints?counts=${count}`, method: 'get', data })
}

// 获取编码
export const apiGetCodes = data => {
  return http({ url: `/lz_management/oneCode/get/getPrints`, method: 'post', data })
}

// 获取盘点次数
export const apiGetTCounts = data => {
  return http({ url: `/lz_management/modules/count/tCountList`, method: 'post', data })
}

// 新增盘点次数
export const apiAddTCounts = () => {
  return http({ url: `/lz_management/modules/count/newStart`, method: 'get',  })
}

// 删除盘点次数
export const apiDelTCounts = data => {
  return http({ url: `/lz_management/modules/count/tCountDelete`, method: 'post', data })
}

