浏览代码

远程开锁

hwy 2 月之前
父节点
当前提交
745235a956
共有 2 个文件被更改,包括 994 次插入975 次删除
  1. 753 763
      mini-pro-web/src/api/api-medicineAbinet.js
  2. 241 212
      mini-pro-web/src/views/device/detail.vue

+ 753 - 763
mini-pro-web/src/api/api-medicineAbinet.js

@ -1,767 +1,757 @@
import request from "@/utils/request";
import {BASE} from "@/api/apiGateway"
import request from '@/utils/request'
import { BASE } from '@/api/apiGateway'
let service = {
	reviewerOrder: function(data) {
		return request({
			url: `${BASE}/baseOrder/reviewerOrder`,
			method: "post",
			data
		});
    },
	//备药单相关接口 start
	replenishList: function(params) {
		return request({
			url: `${BASE}/baseUp/docFullInfo`,
			method: "get",
			params
		});
    },
	replenishFindById: function(params) {
		return request({
			url: `${BASE}/baseUp/getUpDetailListById`,
			method: "get",
			params
		});
    },
	replenishCreate: function(data) {
		return request({
			url: `${BASE}/baseUp/create`,
			method: "post",
			data
		});
    },
	replenishUpdate: function(data) {
		return request({
			url: `${BASE}/baseUp/update`,
			method: "post",
			data
		});
    },
	replenishDelete: function(data) {
		return request({
			url: `${BASE}/baseUp/delete`,
			method: "post",
			data
		});
    },
	baseUpGetRecordByPage: function(params) {
		return request({
			url: `${BASE}/baseUp/getRecordByPage`,
			method: "get",
			params
		});
    },
	// 生成备药单
	baseUpCreateUp: function(data) {
		return request({
			url: `${BASE}/baseUp/createUp`,
			method: "post",
			data
		});
    },
	getUpDetailById: function(params) {
		return request({
			url: `${BASE}/baseUp/getUpDetailById`,
			method: "get",
			params
		});
    },
	// .获取补货记录明细  recordId
	getRecordDetailListById: function(params) {
		return request({
			url: `${BASE}/baseUp/getRecordDetailListById`,
			method: "get",
			params
		});
    },
	//备药单相关接口 end
	//出库单相关接口 start
	outboundOrderList: function(params) {
		return request({
			url: `${BASE}/baseOut/docFullInfo`,
			method: "get",
			params
		});
    },
	outboundOrderCreate: function(data) {
		return request({
			url: `${BASE}/baseOut/create`,
			method: "post",
			data
		});
    },
	outboundOrderUpdate: function(data) {
		return request({
			url: `${BASE}/baseOut/update`,
			method: "post",
			data
		});
    },
	outboundOrderDelete: function(data) {
		return request({
			url: `${BASE}/baseOut/delete`,
			method: "post",
			data
		});
    },
	// 修改出货单领取状态
	changeReceiveState: function(data) {
		return request({
			url: `${BASE}/baseOut/changeReceiveState`,
			method: "post",
			data
		});
    },
	changeMoreReceiveState: function(data) {
		return request({
			url: `${BASE}/baseOut/changeMoreReceiveState`,
			method: "post",
			data
		});
    },
	// 生成出库单
	baseOutCreateUp: function(data) {
		return request({
			url: `${BASE}/baseOut/createUp`,
			method: "post",
			data
		});
    },
	// 出库单明细
	getOutDetailById: function(params) {
		return request({
			url: `${BASE}/baseOut/getOutDetailById`,
			method: "get",
			params
		});
    },
	//出库单相关接口 end
	
	
	//药品信息 start
	drugList: function(params) {
		return request({
			url: `${BASE}/baseDrug/docFullInfo`,
			method: "get",
			params
		});
    },
	getDrugListByDevice: function(params) {
		return request({
			url: `${BASE}/baseDrug/getDrugListByDevice`,
			method: "get",
			params
		});
    },
	getDrugDetailListById: function(params) {
		return request({
			url: `${BASE}/baseDrug/getDrugDetailListById`,
			method: "get",
			params
		});
    },
	//药品信息 end
	//设备相关接口 start
	deviceList: function(params) {
		return request({
			url: `${BASE}/baseDevice/docFullInfo`,
			method: "get",
			params
		});
    },
	deviceCreate: function(data) {
		return request({
			url: `${BASE}/baseDevice/create`,
			method: "post",
			data
		});
    },
	deviceUpdate: function(data) {
		return request({
			url: `${BASE}/baseDevice/update`,
			method: "post",
			data
		});
    },
	deviceDelete: function(data) {
		return request({
			url: `${BASE}/baseDevice/delete`,
			method: "post",
			data
		});
    },
	// 获取缺药列表
	getOutOfStockDeviceList: function(params) {
		return request({
			url: `${BASE}/baseDevice/getOutOfStockDeviceList`,
			method: "get",
			params
		});
    },
	// 获取缺药信息
	getDetialOutOfStock: function(data) {
		return request({
			url: `${BASE}/baseDevice/getDetialOutOfStock`,
			method: "post",
			data
		});
    },
	//通过设备id  查询 所绑定的补货员信息列表  deviceId
	getUserListByDeviceId: function(params) {
		return request({
			url: `${BASE}/baseDevice/getUserListByDeviceId`,
			method: "get",
			params
		});
    },
	//获取设备信息
	findDeviceById: function(params) {
		return request({
			url: `${BASE}/baseDevice/findById`,
			method: "get",
			params
		});
    },
	findDeviceByIdNoLogin: function(params) {
		return request({
			url: `${BASE}/open/noLogin/findById`,
			method: "get",
			params
		});
    },
	getDevicesByMoreContent: function(params) {
		return request({
			url: `${BASE}/baseDevice/getDevicesByMoreContent`,
			method: "get",
			params
		});
    },
	// 更新设备投放地址
	updateAddressInfo: function(data) {
		return request({
			url: `${BASE}/baseDevice/updateAddressInfo`,
			method: "post",
			data
		});
    },
	// 更新设备社区
	updateCommunity: function(data) {
		return request({
			url: `${BASE}/baseDevice/updateCommunity`,
			method: "post",
			data
		});
    },
	//解绑设备 deviceIds
	unbindDevice: function(data) {
		return request({
			url: `${BASE}/baseDevice/unbindDevice`,
			method: "post",
			data
		});
    },
	updateSaleStatus: function(data) {
		return request({
			url: `${BASE}/baseDevice/updateSaleStatus`,
			method: "post",
			data
		});
    },
	// 新增投放地址
	createAddress: function(data) {
		return request({
			url: `${BASE}/baseDevice/createAddress`,
			method: "post",
			data
		});
    },
	// 删除投放地址
	deleteAddress: function(data) {
		return request({
			url: `${BASE}/baseDevice/deleteAddress`,
			method: "post",
			data
		});
    },
	// 获取投放地址列表
	getDevicesDeliveryList: function(params) {
		return request({
			url: `${BASE}/baseDevice/getDevicesDeliveryList`,
			method: "get",
			params
		});
    },
	// 处方明细接口
	getOrderDetailById: function(params) {
		return request({
			url: `${BASE}/baseOrder/getOrderDetailById`,
			method: "get",
			params
		});
    },
	//获取设备统计
	countall: function(params) {
		return request({
			url: `${BASE}/baseDevice/countall`,
			method: "get",
			params
		});
    },
	
	
	warrayGetExceed: function(params) {
		return request({
			url: `${BASE}/baseWarray/getExceed`,
			method: "get",
			params
		});
    },
	warrayGetFlow: function(params) {
		return request({
			url: `${BASE}/baseWarray/getFlow`,
			method: "get",
			params
		});
    },
	warrayGetNetwork: function(params) {
		return request({
			url: `${BASE}/baseWarray/getNetwork`,
			method: "get",
			params
		});
    },
	warrayGetFault: function(params) {
		return request({
			url: `${BASE}/baseWarray/getFault`,
			method: "get",
			params
		});
    },
	warrayGetOffline: function(params) {
		return request({
			url: `${BASE}/baseWarray/getOffline`,
			method: "get",
			params
		});
    },
	warrayGetHumidity: function(params) {
		return request({
			url: `${BASE}/baseWarray/getHumidity`,
			method: "get",
			params
		});
    },
	warrayGetTemperature: function(params) {
		return request({
			url: `${BASE}/baseWarray/getTemperature`,
			method: "get",
			params
		});
    },
	//设备相关接口 end
	//订单相关接口 start
	orderList: function(params) {
		return request({
			url: `${BASE}/baseOrder/docFullInfo`,
			method: "get",
			params
		});
    },
	getOrderDetailListById: function(params) {
		return request({
			url: `${BASE}/baseOrder/getOrderDetailListById`,
			method: "get",
			params
		});
    },
	//设备相关接口 end
	//补货员列表
	replenishErList: function(params) {
		return request({
			url: `${BASE}/baseUser/docFullInfo`,
			method: "get",
			params
		});
    },
	// 分配设备(员工)  userIds deviceIds  isAll
	allotDevice: function(params) {
		return request({
			url: `${BASE}/baseUser/allotDevice`,
			method: "get",
			params
		});
    },
	// 检查订单并且返回药品库存信息
	checkOrderAndReturn: function(params) {
		return request({
			url: `${BASE}/open/noLogin/checkOrderAndReturn`,
			method: "get",
			params
		});
    },
	// 获取设备广告
	devinfoAdvList: function(params) {
		return request({
			url: `${BASE}/open/noLogin/devinfo`,
			method: "get",
			params
		});
    },
	// 根据用户id,查询设备在线统计
	countAllDevice: function(params) {
		return request({
			url: `${BASE}/baseDevice/getFirstPageInfo`,
			method: "get",
			params
		});
    },
    // 根据用户id,天数,查询设备取药次数
	getmedicine: function(params) {
		return request({
			url: `${BASE}/baseDevice/getShippingTypeByUserId`,
			method: "get",
			params
		});
    },
    // 根据用户id,天数,查询设备电子处方单次数
	getprescriptions: function(params) {
		return request({
			url: `${BASE}/baseDevice/getPrescriptionStaticsByUserId`,
			method: "get",
			params
		});
    },
    // 根据用户id,天数,查询销售额
	getechartsData: function(params) {
		return request({
			url: `${BASE}/baseDevice/getDevicePriceStatisticsByUserId`,
			method: "get",
			params
		});
    },
	// 根据设备id查询设备轨道数据
	findMediicinecabinetInventoryByDeviceId: function(params) {
		return new Promise((resolve, reject)=>{
			var req = [
				service.findMediicinecabinetInventoryByDeviceIdPage(_.assign({start: 1, end: 2}, params)),
				service.findMediicinecabinetInventoryByDeviceIdPage(_.assign({start: 3, end: 4}, params)),
				service.findMediicinecabinetInventoryByDeviceIdPage(_.assign({start: 5, end: 999}, params)),
			]
			Promise.all(req)
				.then(res=>{
					if(res[0].status==200 && res[1].status==200 && res[2].status==200){
						var list = (res[0].detailModelList || [])
							.concat(res[1].detailModelList || [])
							.concat(res[2].detailModelList || [])
						return resolve({
							message: "success",
							status: 200,
							detailModelList: list
						})
					} else {
						reject("获取设备轨道数据失败")
					}
				})
				.catch(err=>{
					reject(err)
				})
		})
		
		// return request({
		// 	url: `${BASE}/baseDevice/findMediicinecabinetInventoryByDeviceId`,
		// 	method: "get",
		// 	params
		// });
    },
	// 根据设备id查询设备轨道数据
	findMediicinecabinetInventoryByDeviceIdPage: function(params) {
		return request({
			url: `${BASE}/baseDevice/findMediicinecabinetInventoryByDeviceIdPage`,
			method: "get",
			params
		});
    },
	// 更换药品,或者设定药品
	updateMediicinecabineInventory: function(data) {
		return request({
			url: `${BASE}/baseDevice/updateMediicinecabineInventory`,
			method: "post",
			data
		});
    },
	// 根据货道id获取单个货道详情
	selectMediicinecabineInventoryById: function(params) {
		return request({
			url: `${BASE}/baseDevice/selectMediicinecabineInventoryById`,
			method: "get",
			params
		});
    },
	// 矫正库存\\ 更新容量 \\下架药品
	updateMediicinecabineInventoryInfoById: function(data) {
		return request({
			url: `${BASE}/baseDevice/updateMediicinecabineInventoryInfoById`,
			method: "post",
			data
		});
    },
	// 通过userId, 获取缺药列表
	getOutOfStockDeviceListByUserId: function(params) {
		return request({
			url: `${BASE}/baseDevice/getOutOfStockDeviceListByUserId`,
			method: "get",
			params
		});
    },
	// 通过userId 获取设备列表
	getDeviceListWithUserId: function(params) {
		return request({
			url: `${BASE}/baseDevice/getDeviceListWithUserId`,
			method: "get",
			params
		});
    },
	openAndCloseCargo: function(data) {
		return request({
			url: `${BASE}/baseDevice/openAndCloseCargo`,
			method: "post",
			data
		});
    },
	checkOrderAndReturnOrderList: function(params) {
		return request({
			url: `${BASE}/open/noLogin/checkOrderAndReturnOrderList`,
			method: "get",
			params
		});
    },
	// 更新出货状态
	updateOrderOutStatus: function(data) {
		return request({
			url: `${BASE}/open/noLogin/updateOrderOutStatus`,
			method: "post",
			data
		});
    },
	mergeAndSplitCargo: function(data) {
		return request({
			url: `${BASE}/baseDevice/mergeAndSplitCargo`,
			method: "post",
			data
		});
    },
    
    //设备温度湿度设置和控制
    updateTAndH: function(data) {
		return request({
			url: `${BASE}/baseDevice/updateTAndH`,
			method: "post",
			data
		});
    },
    //更新设备名称
    updateDevEquName: function(data) {
		return request({
			url: `${BASE}/baseDevice/updateDevEquName`,
			method: "post",
			data
		});
    },
    // 获取设备携带不同类型的日志的二级树,补货日志、换货日志、上货日志
	// getDeviceInventoryRecordListWithUserId: function(params) {
	// 	return request({
	// 		url: `${BASE}/baseDevice/getDeviceInventoryRecordListWithUserId`,
	// 		method: "get",
	// 		params
	// 	});
    // },
	findOrgList(params){
        return request({
            url: `${BASE}/equipment/findOrgList`,
            method: 'get',
            params
  reviewerOrder: function(data) {
    return request({
      url: `${BASE}/baseOrder/reviewerOrder`,
      method: 'post',
      data
    })
  },
  //备药单相关接口 start
  replenishList: function(params) {
    return request({
      url: `${BASE}/baseUp/docFullInfo`,
      method: 'get',
      params
    })
  },
  replenishFindById: function(params) {
    return request({
      url: `${BASE}/baseUp/getUpDetailListById`,
      method: 'get',
      params
    })
  },
  replenishCreate: function(data) {
    return request({
      url: `${BASE}/baseUp/create`,
      method: 'post',
      data
    })
  },
  replenishUpdate: function(data) {
    return request({
      url: `${BASE}/baseUp/update`,
      method: 'post',
      data
    })
  },
  replenishDelete: function(data) {
    return request({
      url: `${BASE}/baseUp/delete`,
      method: 'post',
      data
    })
  },
  sendSocketMessage: function(params) {
    return request({
      url: `${BASE}/baseDevice/sendSocketMessage`,
      method: 'get',
      params
    })
  },
  baseUpGetRecordByPage: function(params) {
    return request({
      url: `${BASE}/baseUp/getRecordByPage`,
      method: 'get',
      params
    })
  },
  // 生成备药单
  baseUpCreateUp: function(data) {
    return request({
      url: `${BASE}/baseUp/createUp`,
      method: 'post',
      data
    })
  },
  getUpDetailById: function(params) {
    return request({
      url: `${BASE}/baseUp/getUpDetailById`,
      method: 'get',
      params
    })
  },
  // .获取补货记录明细  recordId
  getRecordDetailListById: function(params) {
    return request({
      url: `${BASE}/baseUp/getRecordDetailListById`,
      method: 'get',
      params
    })
  },
  //备药单相关接口 end
  //出库单相关接口 start
  outboundOrderList: function(params) {
    return request({
      url: `${BASE}/baseOut/docFullInfo`,
      method: 'get',
      params
    })
  },
  outboundOrderCreate: function(data) {
    return request({
      url: `${BASE}/baseOut/create`,
      method: 'post',
      data
    })
  },
  outboundOrderUpdate: function(data) {
    return request({
      url: `${BASE}/baseOut/update`,
      method: 'post',
      data
    })
  },
  outboundOrderDelete: function(data) {
    return request({
      url: `${BASE}/baseOut/delete`,
      method: 'post',
      data
    })
  },
  // 修改出货单领取状态
  changeReceiveState: function(data) {
    return request({
      url: `${BASE}/baseOut/changeReceiveState`,
      method: 'post',
      data
    })
  },
  changeMoreReceiveState: function(data) {
    return request({
      url: `${BASE}/baseOut/changeMoreReceiveState`,
      method: 'post',
      data
    })
  },
  // 生成出库单
  baseOutCreateUp: function(data) {
    return request({
      url: `${BASE}/baseOut/createUp`,
      method: 'post',
      data
    })
  },
  // 出库单明细
  getOutDetailById: function(params) {
    return request({
      url: `${BASE}/baseOut/getOutDetailById`,
      method: 'get',
      params
    })
  },
  //出库单相关接口 end
  //药品信息 start
  drugList: function(params) {
    return request({
      url: `${BASE}/baseDrug/docFullInfo`,
      method: 'get',
      params
    })
  },
  getDrugListByDevice: function(params) {
    return request({
      url: `${BASE}/baseDrug/getDrugListByDevice`,
      method: 'get',
      params
    })
  },
  getDrugDetailListById: function(params) {
    return request({
      url: `${BASE}/baseDrug/getDrugDetailListById`,
      method: 'get',
      params
    })
  },
  //药品信息 end
  //设备相关接口 start
  deviceList: function(params) {
    return request({
      url: `${BASE}/baseDevice/docFullInfo`,
      method: 'get',
      params
    })
  },
  deviceCreate: function(data) {
    return request({
      url: `${BASE}/baseDevice/create`,
      method: 'post',
      data
    })
  },
  deviceUpdate: function(data) {
    return request({
      url: `${BASE}/baseDevice/update`,
      method: 'post',
      data
    })
  },
  deviceDelete: function(data) {
    return request({
      url: `${BASE}/baseDevice/delete`,
      method: 'post',
      data
    })
  },
  // 获取缺药列表
  getOutOfStockDeviceList: function(params) {
    return request({
      url: `${BASE}/baseDevice/getOutOfStockDeviceList`,
      method: 'get',
      params
    })
  },
  // 获取缺药信息
  getDetialOutOfStock: function(data) {
    return request({
      url: `${BASE}/baseDevice/getDetialOutOfStock`,
      method: 'post',
      data
    })
  },
  //通过设备id  查询 所绑定的补货员信息列表  deviceId
  getUserListByDeviceId: function(params) {
    return request({
      url: `${BASE}/baseDevice/getUserListByDeviceId`,
      method: 'get',
      params
    })
  },
  //获取设备信息
  findDeviceById: function(params) {
    return request({
      url: `${BASE}/baseDevice/findById`,
      method: 'get',
      params
    })
  },
  findDeviceByIdNoLogin: function(params) {
    return request({
      url: `${BASE}/open/noLogin/findById`,
      method: 'get',
      params
    })
  },
  getDevicesByMoreContent: function(params) {
    return request({
      url: `${BASE}/baseDevice/getDevicesByMoreContent`,
      method: 'get',
      params
    })
  },
  // 更新设备投放地址
  updateAddressInfo: function(data) {
    return request({
      url: `${BASE}/baseDevice/updateAddressInfo`,
      method: 'post',
      data
    })
  },
  // 更新设备社区
  updateCommunity: function(data) {
    return request({
      url: `${BASE}/baseDevice/updateCommunity`,
      method: 'post',
      data
    })
  },
  //解绑设备 deviceIds
  unbindDevice: function(data) {
    return request({
      url: `${BASE}/baseDevice/unbindDevice`,
      method: 'post',
      data
    })
  },
  updateSaleStatus: function(data) {
    return request({
      url: `${BASE}/baseDevice/updateSaleStatus`,
      method: 'post',
      data
    })
  },
  // 新增投放地址
  createAddress: function(data) {
    return request({
      url: `${BASE}/baseDevice/createAddress`,
      method: 'post',
      data
    })
  },
  // 删除投放地址
  deleteAddress: function(data) {
    return request({
      url: `${BASE}/baseDevice/deleteAddress`,
      method: 'post',
      data
    })
  },
  // 获取投放地址列表
  getDevicesDeliveryList: function(params) {
    return request({
      url: `${BASE}/baseDevice/getDevicesDeliveryList`,
      method: 'get',
      params
    })
  },
  // 处方明细接口
  getOrderDetailById: function(params) {
    return request({
      url: `${BASE}/baseOrder/getOrderDetailById`,
      method: 'get',
      params
    })
  },
  //获取设备统计
  countall: function(params) {
    return request({
      url: `${BASE}/baseDevice/countall`,
      method: 'get',
      params
    })
  },
  warrayGetExceed: function(params) {
    return request({
      url: `${BASE}/baseWarray/getExceed`,
      method: 'get',
      params
    })
  },
  warrayGetFlow: function(params) {
    return request({
      url: `${BASE}/baseWarray/getFlow`,
      method: 'get',
      params
    })
  },
  warrayGetNetwork: function(params) {
    return request({
      url: `${BASE}/baseWarray/getNetwork`,
      method: 'get',
      params
    })
  },
  warrayGetFault: function(params) {
    return request({
      url: `${BASE}/baseWarray/getFault`,
      method: 'get',
      params
    })
  },
  warrayGetOffline: function(params) {
    return request({
      url: `${BASE}/baseWarray/getOffline`,
      method: 'get',
      params
    })
  },
  warrayGetHumidity: function(params) {
    return request({
      url: `${BASE}/baseWarray/getHumidity`,
      method: 'get',
      params
    })
  },
  warrayGetTemperature: function(params) {
    return request({
      url: `${BASE}/baseWarray/getTemperature`,
      method: 'get',
      params
    })
  },
  //设备相关接口 end
  //订单相关接口 start
  orderList: function(params) {
    return request({
      url: `${BASE}/baseOrder/docFullInfo`,
      method: 'get',
      params
    })
  },
  getOrderDetailListById: function(params) {
    return request({
      url: `${BASE}/baseOrder/getOrderDetailListById`,
      method: 'get',
      params
    })
  },
  //设备相关接口 end
  //补货员列表
  replenishErList: function(params) {
    return request({
      url: `${BASE}/baseUser/docFullInfo`,
      method: 'get',
      params
    })
  },
  // 分配设备(员工)  userIds deviceIds  isAll
  allotDevice: function(params) {
    return request({
      url: `${BASE}/baseUser/allotDevice`,
      method: 'get',
      params
    })
  },
  // 检查订单并且返回药品库存信息
  checkOrderAndReturn: function(params) {
    return request({
      url: `${BASE}/open/noLogin/checkOrderAndReturn`,
      method: 'get',
      params
    })
  },
  // 获取设备广告
  devinfoAdvList: function(params) {
    return request({
      url: `${BASE}/open/noLogin/devinfo`,
      method: 'get',
      params
    })
  },
  // 根据用户id,查询设备在线统计
  countAllDevice: function(params) {
    return request({
      url: `${BASE}/baseDevice/getFirstPageInfo`,
      method: 'get',
      params
    })
  },
  // 根据用户id,天数,查询设备取药次数
  getmedicine: function(params) {
    return request({
      url: `${BASE}/baseDevice/getShippingTypeByUserId`,
      method: 'get',
      params
    })
  },
  // 根据用户id,天数,查询设备电子处方单次数
  getprescriptions: function(params) {
    return request({
      url: `${BASE}/baseDevice/getPrescriptionStaticsByUserId`,
      method: 'get',
      params
    })
  },
  // 根据用户id,天数,查询销售额
  getechartsData: function(params) {
    return request({
      url: `${BASE}/baseDevice/getDevicePriceStatisticsByUserId`,
      method: 'get',
      params
    })
  },
  // 根据设备id查询设备轨道数据
  findMediicinecabinetInventoryByDeviceId: function(params) {
    return new Promise((resolve, reject) => {
      var req = [
        service.findMediicinecabinetInventoryByDeviceIdPage(_.assign({ start: 1, end: 2 }, params)),
        service.findMediicinecabinetInventoryByDeviceIdPage(_.assign({ start: 3, end: 4 }, params)),
        service.findMediicinecabinetInventoryByDeviceIdPage(_.assign({ start: 5, end: 999 }, params))
      ]
      Promise.all(req)
        .then(res => {
          if (res[0].status == 200 && res[1].status == 200 && res[2].status == 200) {
            var list = (res[0].detailModelList || []).concat(res[1].detailModelList || []).concat(res[2].detailModelList || [])
            return resolve({
              message: 'success',
              status: 200,
              detailModelList: list
            })
          } else {
            reject('获取设备轨道数据失败')
          }
        })
    },
	findOrgDeviceList(params){
        return request({
            url: `${BASE}/equipment/findOrgDeviceList`,
            method: 'get',
            params
        .catch(err => {
          reject(err)
        })
    },
	baseTownList: function(data) {
		return request({
			url: `${BASE}/baseTown/list`,
			method: "get",
			params: data
		});
	},
	//获取所有设备最后一次补货记录
	getDeviceInventoryRecordListWithUserId: function(data) {
		return request({
			url: `${BASE}/baseDevice/getDeviceInventoryRecordListWithUserId`,
			method: "get",
			params: data
		});
	},
	//获取单个设备的补货记录
	getDeviceInventoryRecordListByDeviceId: function(data) {
		return request({
			url: `${BASE}/baseDevice/getDeviceInventoryRecordListByDeviceId`,
			method: "get",
			params: data
		});
	},
	// 通过设备id获取该设备的缺药信息
	getOutOfStockInfoByDeviceWithPage: function(data) {
		return request({
			url: `${BASE}/baseDevice/getOutOfStockInfoByDeviceWithPage`,
			method: "get",
			params: data
		});
	},
	// 以药品为维度的药品库存统计
	getDrugInventoryCount: function(params) {
		return request({
			url: `${BASE}/baseDevice/getDrugInventoryCount`,
			method: "get",
			params
		});
    },
	//根据用户和设备获取出货单详情
	getOutDetailByUserIdAndDeviceId: function(params) {
		return request({
			url: `${BASE}/baseOut/getOutDetailByUserIdAndDeviceId`,
			method: "get",
			params
		});
    },
	// 批量补货
	batchAddInventory: function(data) {
		return request({
			url: `${BASE}/baseDevice/batchAddInventory`,
			method: "post",
			data
		});
    },
	
	//设备出货日志
	getDeviceOrderInfoPage: function(params) {
		return request({
			url: `${BASE}/baseDevice/getDeviceOrderInfoPage`,
			method: "get",
			params
		});
    },
	queryUpListByDeviceIdAndStatus: function(params) {
		return request({
			url: `${BASE}/baseUp/queryUpListByDeviceIdAndStatus`,
			method: "get",
			params
		});
    },
	queryUpListByStatus: function(params) {
		return request({
			url: `${BASE}/baseUp/queryUpListByStatus`,
			method: "get",
			params
		});
    },
	updateStockUpStatus: function(data) {
		return request({
			url: `${BASE}/baseUp/updateStockUpStatus`,
			method: "post",
			data
		});
    },
	updateDeviceCargoStateApp: function(data) {
		return request({
			url: `${BASE}/baseDevice/updateDeviceCargoStateApp`,
			method: "post",
			data
		});
    },
	getPrescriptionStatics: function(params) {
		return request({
			url: `${BASE}/baseDevice/getPrescriptionStatics`,
			method: "get",
			params
		});
    },
	getPrescriptionStaticsRank: function(params) {
		return request({
			url: `${BASE}/baseDevice/getPrescriptionStaticsRank`,
			method: "get",
			params
		});
    },
	updateOrderToWaitOut: function(data) {
		return request({
			url: `${BASE}/baseOrder/updateOrderToWaitOut`,
			method: "post",
			data
		});
    },
	//触发设备端更新事件
	systemUpdate: function(data) {
		return request({
			url: `${BASE}/baseDevice/systemUpdate`,
			method: "post",
			data
		});
    },
};
export default service;
    })
    // return request({
    // 	url: `${BASE}/baseDevice/findMediicinecabinetInventoryByDeviceId`,
    // 	method: "get",
    // 	params
    // });
  },
  // 根据设备id查询设备轨道数据
  findMediicinecabinetInventoryByDeviceIdPage: function(params) {
    return request({
      url: `${BASE}/baseDevice/findMediicinecabinetInventoryByDeviceIdPage`,
      method: 'get',
      params
    })
  },
  // 更换药品,或者设定药品
  updateMediicinecabineInventory: function(data) {
    return request({
      url: `${BASE}/baseDevice/updateMediicinecabineInventory`,
      method: 'post',
      data
    })
  },
  // 根据货道id获取单个货道详情
  selectMediicinecabineInventoryById: function(params) {
    return request({
      url: `${BASE}/baseDevice/selectMediicinecabineInventoryById`,
      method: 'get',
      params
    })
  },
  // 矫正库存\\ 更新容量 \\下架药品
  updateMediicinecabineInventoryInfoById: function(data) {
    return request({
      url: `${BASE}/baseDevice/updateMediicinecabineInventoryInfoById`,
      method: 'post',
      data
    })
  },
  // 通过userId, 获取缺药列表
  getOutOfStockDeviceListByUserId: function(params) {
    return request({
      url: `${BASE}/baseDevice/getOutOfStockDeviceListByUserId`,
      method: 'get',
      params
    })
  },
  // 通过userId 获取设备列表
  getDeviceListWithUserId: function(params) {
    return request({
      url: `${BASE}/baseDevice/getDeviceListWithUserId`,
      method: 'get',
      params
    })
  },
  openAndCloseCargo: function(data) {
    return request({
      url: `${BASE}/baseDevice/openAndCloseCargo`,
      method: 'post',
      data
    })
  },
  checkOrderAndReturnOrderList: function(params) {
    return request({
      url: `${BASE}/open/noLogin/checkOrderAndReturnOrderList`,
      method: 'get',
      params
    })
  },
  // 更新出货状态
  updateOrderOutStatus: function(data) {
    return request({
      url: `${BASE}/open/noLogin/updateOrderOutStatus`,
      method: 'post',
      data
    })
  },
  mergeAndSplitCargo: function(data) {
    return request({
      url: `${BASE}/baseDevice/mergeAndSplitCargo`,
      method: 'post',
      data
    })
  },
  //设备温度湿度设置和控制
  updateTAndH: function(data) {
    return request({
      url: `${BASE}/baseDevice/updateTAndH`,
      method: 'post',
      data
    })
  },
  //更新设备名称
  updateDevEquName: function(data) {
    return request({
      url: `${BASE}/baseDevice/updateDevEquName`,
      method: 'post',
      data
    })
  },
  // 获取设备携带不同类型的日志的二级树,补货日志、换货日志、上货日志
  // getDeviceInventoryRecordListWithUserId: function(params) {
  // 	return request({
  // 		url: `${BASE}/baseDevice/getDeviceInventoryRecordListWithUserId`,
  // 		method: "get",
  // 		params
  // 	});
  // },
  findOrgList(params) {
    return request({
      url: `${BASE}/equipment/findOrgList`,
      method: 'get',
      params
    })
  },
  findOrgDeviceList(params) {
    return request({
      url: `${BASE}/equipment/findOrgDeviceList`,
      method: 'get',
      params
    })
  },
  baseTownList: function(data) {
    return request({
      url: `${BASE}/baseTown/list`,
      method: 'get',
      params: data
    })
  },
  //获取所有设备最后一次补货记录
  getDeviceInventoryRecordListWithUserId: function(data) {
    return request({
      url: `${BASE}/baseDevice/getDeviceInventoryRecordListWithUserId`,
      method: 'get',
      params: data
    })
  },
  //获取单个设备的补货记录
  getDeviceInventoryRecordListByDeviceId: function(data) {
    return request({
      url: `${BASE}/baseDevice/getDeviceInventoryRecordListByDeviceId`,
      method: 'get',
      params: data
    })
  },
  // 通过设备id获取该设备的缺药信息
  getOutOfStockInfoByDeviceWithPage: function(data) {
    return request({
      url: `${BASE}/baseDevice/getOutOfStockInfoByDeviceWithPage`,
      method: 'get',
      params: data
    })
  },
  // 以药品为维度的药品库存统计
  getDrugInventoryCount: function(params) {
    return request({
      url: `${BASE}/baseDevice/getDrugInventoryCount`,
      method: 'get',
      params
    })
  },
  //根据用户和设备获取出货单详情
  getOutDetailByUserIdAndDeviceId: function(params) {
    return request({
      url: `${BASE}/baseOut/getOutDetailByUserIdAndDeviceId`,
      method: 'get',
      params
    })
  },
  // 批量补货
  batchAddInventory: function(data) {
    return request({
      url: `${BASE}/baseDevice/batchAddInventory`,
      method: 'post',
      data
    })
  },
  //设备出货日志
  getDeviceOrderInfoPage: function(params) {
    return request({
      url: `${BASE}/baseDevice/getDeviceOrderInfoPage`,
      method: 'get',
      params
    })
  },
  queryUpListByDeviceIdAndStatus: function(params) {
    return request({
      url: `${BASE}/baseUp/queryUpListByDeviceIdAndStatus`,
      method: 'get',
      params
    })
  },
  queryUpListByStatus: function(params) {
    return request({
      url: `${BASE}/baseUp/queryUpListByStatus`,
      method: 'get',
      params
    })
  },
  updateStockUpStatus: function(data) {
    return request({
      url: `${BASE}/baseUp/updateStockUpStatus`,
      method: 'post',
      data
    })
  },
  updateDeviceCargoStateApp: function(data) {
    return request({
      url: `${BASE}/baseDevice/updateDeviceCargoStateApp`,
      method: 'post',
      data
    })
  },
  getPrescriptionStatics: function(params) {
    return request({
      url: `${BASE}/baseDevice/getPrescriptionStatics`,
      method: 'get',
      params
    })
  },
  getPrescriptionStaticsRank: function(params) {
    return request({
      url: `${BASE}/baseDevice/getPrescriptionStaticsRank`,
      method: 'get',
      params
    })
  },
  updateOrderToWaitOut: function(data) {
    return request({
      url: `${BASE}/baseOrder/updateOrderToWaitOut`,
      method: 'post',
      data
    })
  },
  //触发设备端更新事件
  systemUpdate: function(data) {
    return request({
      url: `${BASE}/baseDevice/systemUpdate`,
      method: 'post',
      data
    })
  }
}
export default service

+ 241 - 212
mini-pro-web/src/views/device/detail.vue

@ -1,153 +1,153 @@
<template>
    <div class="deviceDetail pb10">
        <div class="c-border-tb c-f14 c-999 mt10 plr15 ptb10 bgc-fff">
            <div class=" kitbox">
                <div class="box-flex-1 fs-16 c-333 ellipsis_1">
                    {{info.equName}}
                </div>
                <div class="pt2 ml10">
                    <van-tag type="success" v-if="info.networkStatus==1">在线</van-tag>
                    <van-tag type="danger" v-else>离线</van-tag>
                    <van-tag type="success" v-if="info.saleStatus==1" class="ml5">在售</van-tag>
                    <van-tag type="danger" v-else class="ml5">停售</van-tag>
                </div>
            </div>
  <div class="deviceDetail pb10">
    <div class="c-border-tb c-f14 c-999 mt10 plr15 ptb10 bgc-fff">
      <div class=" kitbox">
        <div class="box-flex-1 fs-16 c-333 ellipsis_1">
          {{ info.equName }}
        </div>
        <div class="pt2 ml10">
          <van-tag type="success" v-if="info.networkStatus == 1">在线</van-tag>
          <van-tag type="danger" v-else>离线</van-tag>
            <div class="mt10">
                <span>设备所属:</span>
                <span>{{info.community}}</span>
            </div>
            <div>
                <span>设备编号:</span>
                <span>{{info.equNum}}</span>
            </div>
            <div>
                <span>设备地址:</span>
                <span>{{info.deliveryAddress}}</span>
            </div>
          <van-tag type="success" v-if="info.saleStatus == 1" class="ml5">在售</van-tag>
          <van-tag type="danger" v-else class="ml5">停售</van-tag>
        </div>
      </div>
        <div class="mt10 bgc-fff c-border-tb">
            <div class="panel-title">药品管理</div>
            <div class='grid-4 c-f14 c-333 ptb15'>
                <!-- @click='gotoUrl("/device/temperature/index", {id: id})' -->
                <div class='c-t-center' @click='gotoUrl("/device/stock", {deviceId: id})'>
                    <div>
                        <van-image class='ability' :src='require("@/assets/images/yaopingaikuang.png")'/>
                    </div>
                    <div>药品概况</div>
                </div>
                <div v-if="hasAuth('stockUp') || createOutAuth" class='c-t-center' @click='toApplyDrug() '>
                    <div>
                        <van-image class='ability' :src='require("@/assets/images/beihuo.png")'/>
                    </div>
                    <div>药品申领</div>
                </div>
                <div v-if="hasAuth('replenish')" class='c-t-center' @click='gotoUrl("/replenishment/start/deviceDetail", {deviceId: id})'>
                    <div>
                        <van-image class='ability' :src='require("@/assets/images/buhuo.png")'/>
                    </div>
                    <div>药品入库</div>
                </div>
            </div>
      <div class="mt10">
        <span>设备所属:</span>
        <span>{{ info.community }}</span>
      </div>
      <div>
        <span>设备编号:</span>
        <span>{{ info.equNum }}</span>
      </div>
      <div>
        <span>设备地址:</span>
        <span>{{ info.deliveryAddress }}</span>
      </div>
    </div>
    <div class="mt10 bgc-fff c-border-tb">
      <div class="panel-title">药品管理</div>
      <div class="grid-4 c-f14 c-333 ptb15">
        <!-- @click='gotoUrl("/device/temperature/index", {id: id})' -->
        <div class="c-t-center" @click="gotoUrl('/device/stock', { deviceId: id })">
          <div>
            <van-image class="ability" :src="require('@/assets/images/yaopingaikuang.png')" />
          </div>
          <div>药品概况</div>
        </div>
        <div v-if="hasAuth('stockUp') || createOutAuth" class="c-t-center" @click="toApplyDrug()">
          <div>
            <van-image class="ability" :src="require('@/assets/images/beihuo.png')" />
          </div>
          <div>药品申领</div>
        </div>
        <div v-if="hasAuth('replenish')" class="c-t-center" @click="gotoUrl('/replenishment/start/deviceDetail', { deviceId: id })">
          <div>
            <van-image class="ability" :src="require('@/assets/images/buhuo.png')" />
          </div>
          <div>药品入库</div>
        </div>
      </div>
    </div>
        <div v-if="cargoSettingAuth||temperatureCtrlAuth||cargoStateAuth||putDeviceAuth" class="mt10 bgc-fff c-border-tb">
            <div class="panel-title">设备设置</div>
            <div class='grid-4 c-f14 c-333 ptb15'>
                <div v-if="cargoSettingAuth" class='c-t-center' @click='gotoUrl("/device/cargoLane/setting", {deviceId: id})'>
                    <div>
                        <van-image class='ability' :src='require("@/assets/images/huodaoshezhi.png")'/>
                    </div>
                    <div>货道设置</div>
                </div>
                <div v-if="temperatureCtrlAuth" class='c-t-center' @click='gotoUrl("/device/temperature/index", {id: $route.query.id})'>
                    <div>
                        <van-image class='ability' :src='require("@/assets/images/wendukongzhi.png")'/>
                    </div>
                    <div>温湿度控制</div>
                </div>
                <div v-if="cargoStateAuth" class='c-t-center' @click='gotoUrl("/device/cargoLane/index", {deviceId: id})'>
                    <div>
                        <van-image class='ability' :src='require("@/assets/images/huodaozhuangtai.png")'/>
                    </div>
                    <div>货道状态</div>
                </div>
                <div v-if="putDeviceAuth" class='c-t-center' @click='gotoUrl("/device/sell", {id: info.id, status: info.saleStatus})'>
                    <div>
                        <van-image class='ability' :src='require("@/assets/images/zaishoutingshou.png")'/>
                    </div>
                    <div>维护/上架</div>
                </div>
                <div  class='c-t-center' @click='gotoUrl("/device/reboot", {equNum: info.equNum, equName: info.equName, id: id})'>
                    <div>
                        <van-image class='ability' :src='require("@/assets/images/shebeichongqi.png")'/>
                    </div>
                    <div>设备调试</div>
                </div>
    <div v-if="cargoSettingAuth || temperatureCtrlAuth || cargoStateAuth || putDeviceAuth" class="mt10 bgc-fff c-border-tb">
      <div class="panel-title">设备设置</div>
      <div class="grid-4 c-f14 c-333 ptb15">
        <div v-if="cargoSettingAuth" class="c-t-center" @click="gotoUrl('/device/cargoLane/setting', { deviceId: id })">
          <div>
            <van-image class="ability" :src="require('@/assets/images/huodaoshezhi.png')" />
          </div>
          <div>货道设置</div>
        </div>
        <div v-if="temperatureCtrlAuth" class="c-t-center" @click="gotoUrl('/device/temperature/index', { id: $route.query.id })">
          <div>
            <van-image class="ability" :src="require('@/assets/images/wendukongzhi.png')" />
          </div>
          <div>温湿度控制</div>
        </div>
        <div v-if="cargoStateAuth" class="c-t-center" @click="gotoUrl('/device/cargoLane/index', { deviceId: id })">
          <div>
            <van-image class="ability" :src="require('@/assets/images/huodaozhuangtai.png')" />
          </div>
          <div>货道状态</div>
        </div>
        <div v-if="putDeviceAuth" class="c-t-center" @click="gotoUrl('/device/sell', { id: info.id, status: info.saleStatus })">
          <div>
            <van-image class="ability" :src="require('@/assets/images/zaishoutingshou.png')" />
          </div>
          <div>维护/上架</div>
        </div>
        <div class="c-t-center" @click="gotoUrl('/device/reboot', { equNum: info.equNum, equName: info.equName, id: id })">
          <div>
            <van-image class="ability" :src="require('@/assets/images/shebeichongqi.png')" />
          </div>
          <div>设备调试</div>
        </div>
                <!-- <div class='c-t-center' @click='gotoUrl("/device/temperature/index", {id: $route.query.id})'>
        <!-- <div class='c-t-center' @click='gotoUrl("/device/temperature/index", {id: $route.query.id})'>
                    <div>
                        <van-image class='ability' :src='require("@/assets/images/shidukongzhi.png")'/>
                    </div>
                    <div>湿度控制</div>
                </div> -->
                <!-- <div class='c-t-center' @click='gotoUrl("/device/status", {id: info.id})'>
        <!-- <div class='c-t-center' @click='gotoUrl("/device/status", {id: info.id})'>
                    <div>
                        <van-image class='ability' :src='require("@/assets/images/shebeizhuangtai.png")'/>
                    </div>
                    <div>设备状态</div>
                </div> -->
                <!-- <div class='c-t-center' @click='gotoUrl("/device/reboot")'>
        <!-- <div class='c-t-center' @click='gotoUrl("/device/reboot")'>
                    <div>
                        <van-image class='ability' :src='require("@/assets/images/shebeichongqi.png")'/>
                    </div>
                    <div>设备重启</div>
                </div> -->
                <!-- <div class='c-t-center' @click='gotoUrl("/device/infoLog/index")'>
        <!-- <div class='c-t-center' @click='gotoUrl("/device/infoLog/index")'>
                    <div>
                        <van-image class='ability' :src='require("@/assets/images/xinxirizhi.png")'/>
                    </div>
                    <div>信息日志</div>
                </div> -->
            </div>
        </div>
      </div>
    </div>
        <div class="mt10 bgc-fff c-border-tb">
            <div class="panel-title">操作日志</div>
            <div class='grid-4 c-f14 c-333 ptb15'>
                <div class='c-t-center' @click='gotoUrl("/device/infoLog/index", {deviceId: id, equNum: info.equNum})'>
                    <div>
                        <van-image class='ability' :src='require("@/assets/images/xinxirizhi.png")'/>
                    </div>
                    <div>信息日志</div>
                </div>
                <div class='c-t-center' @click='gotoUrl("/replenishment/picking/list", {deviceId: id})'>
                    <div>
                        <van-image class='ability' :src='require("@/assets/images/beihuojilu.png")'/>
                    </div>
                    <div>申领记录</div>
                </div>
                <div class='c-t-center' @click='gotoUrl("/replenishment/record/list", {deviceId: id})'>
                    <div>
                        <van-image class='ability' :src='require("@/assets/images/buhuojilu.png")'/>
                    </div>
                    <div>入库记录</div>
                </div>
                <!-- <div class='c-t-center' @click='gotoUrl("/device/status", {id: info.id})'>
    <div class="mt10 bgc-fff c-border-tb">
      <div class="panel-title">操作日志</div>
      <div class="grid-4 c-f14 c-333 ptb15">
        <div class="c-t-center" @click="gotoUrl('/device/infoLog/index', { deviceId: id, equNum: info.equNum })">
          <div>
            <van-image class="ability" :src="require('@/assets/images/xinxirizhi.png')" />
          </div>
          <div>信息日志</div>
        </div>
        <div class="c-t-center" @click="gotoUrl('/replenishment/picking/list', { deviceId: id })">
          <div>
            <van-image class="ability" :src="require('@/assets/images/beihuojilu.png')" />
          </div>
          <div>申领记录</div>
        </div>
        <div class="c-t-center" @click="gotoUrl('/replenishment/record/list', { deviceId: id })">
          <div>
            <van-image class="ability" :src="require('@/assets/images/buhuojilu.png')" />
          </div>
          <div>入库记录</div>
        </div>
        <!-- <div class='c-t-center' @click='gotoUrl("/device/status", {id: info.id})'>
                    <div>
                        <van-image class='ability' :src='require("@/assets/images/shebeizhuangtai.png")'/>
                    </div>
                    <div>设备状态</div>
                </div> -->
                <!-- <div class='c-t-center' @click='gotoUrl("/device/reboot")'>
        <!-- <div class='c-t-center' @click='gotoUrl("/device/reboot")'>
                    <div>
                        <van-image class='ability' :src='require("@/assets/images/shebeichongqi.png")'/>
                    </div>
                    <div>设备重启</div>
                </div> -->
                <!-- <div class='c-t-center' @click='gotoUrl("/device/infoLog/index")'>
        <!-- <div class='c-t-center' @click='gotoUrl("/device/infoLog/index")'>
                    <div>
                        <van-image class='ability' :src='require("@/assets/images/xinxirizhi.png")'/>
                    </div>
@ -159,117 +159,146 @@
                    </div>
                    <div>在售停售</div>
                </div> -->
            </div>
        </div>
      </div>
    </div>
    <div style="height: 100px;width: 100%;"></div>
    <div style="padding:  0 20px 20px;">
      <van-button block class="c-border-r-5" type="info" @click="openLock()">远程开锁</van-button>
    </div>
  </div>
</template>
<script>
import medicineAbinetApi from '@/api/api-medicineAbinet'
export default {
    name: "deviceDetail",
    data() {
        return {
            info: {},
            id: this.$route.query.id,
            menuAuth: []
        };
  name: 'deviceDetail',
  data() {
    return {
      info: {},
      id: this.$route.query.id,
      menuAuth: []
    }
  },
  computed: {
    createOutAuth() {
      return this.$hasAuth('replenishmentMgnt', 'pickingList', 'createOut')
    },
    cargoSettingAuth() {
      return this.hasAuth('cargoSetting')
    },
    computed:{
        createOutAuth(){
            return this.$hasAuth('replenishmentMgnt', 'pickingList','createOut')
        },
        cargoSettingAuth(){
            return this.hasAuth('cargoSetting')
        },
        cargoStateAuth(){
            return this.hasAuth('cargoState')
        },
        temperatureCtrlAuth(){
            return this.hasAuth('temperatureCtrl')
        },
        putDeviceAuth(){
            return this.hasAuth('putDevice')
        },
        debugDeviceAuth(){
            return this.hasAuth('debugDevice')
        },
    cargoStateAuth() {
      return this.hasAuth('cargoState')
    },
    created() {
        this.findById()
        this.menuAuth = _.find(_.find(this.$store.state.app.authMenu, v=>{
            return v.url == 'device'
        }).children, v=>{
            return v.url == 'operate'
        }).children
        console.log('this.menuAuth', this.menuAuth)
    temperatureCtrlAuth() {
      return this.hasAuth('temperatureCtrl')
    },
    methods: {
        $refreshData(){
            this.findById()
        },
        findById(){
            this.$loading('加载中..')
            let p = {
                deviceId: this.id
            }
            medicineAbinetApi
                .findDeviceById(p)
                .then(res=>{
                    console.log(' res.obj.device', res.obj.device)
                    this.$toast.clear()
                    this.info = res.obj.device
                })
                .catch(err=>{
                    console.error(err)
                })
        },
        hasAuth(name){
            return _.find(this.menuAuth, v=>{
                return v.url == name
    putDeviceAuth() {
      return this.hasAuth('putDevice')
    },
    debugDeviceAuth() {
      return this.hasAuth('debugDevice')
    }
  },
  created() {
    this.findById()
    this.menuAuth = _.find(
      _.find(this.$store.state.app.authMenu, v => {
        return v.url == 'device'
      }).children,
      v => {
        return v.url == 'operate'
      }
    ).children
    console.log('this.menuAuth', this.menuAuth)
  },
  methods: {
    openLock() {
      this.$dialog
        .confirm({
          title: '确认远程开锁?',
          message: '您可以通过远程开锁,打开药柜门进行补药。'
        })
        .then(() => {
          var p = {
            equNum: this.info.equNum,
            type: 'remoteUnlocking',
            message: '远程开锁'
          }
          medicineAbinetApi
            .sendSocketMessage(p)
            .then(res => {
              this.$toast.success(res.message)
            })
        },
        toApplyDrug(){
            if(this.createOutAuth){
                this.gotoUrl("/replenishment/picking/list", {
                    deviceId: this.id,
                    status: 2
                })
            } else {
                this.gotoUrl("/replenishment/stockUp/detail", {
                    deviceId: this.id,
                })
            }
        }
            .catch(err => {
              this.$toast.fail(err.message)
            })
        })
    },
    $refreshData() {
      this.findById()
    },
    findById() {
      this.$loading('加载中..')
      let p = {
        deviceId: this.id
      }
      medicineAbinetApi
        .findDeviceById(p)
        .then(res => {
          console.log(' res.obj.device', res.obj.device)
          this.$toast.clear()
          this.info = res.obj.device
        })
        .catch(err => {
          console.error(err)
        })
    },
    hasAuth(name) {
      return _.find(this.menuAuth, v => {
        return v.url == name
      })
    },
};
    toApplyDrug() {
      if (this.createOutAuth) {
        this.gotoUrl('/replenishment/picking/list', {
          deviceId: this.id,
          status: 2
        })
      } else {
        this.gotoUrl('/replenishment/stockUp/detail', {
          deviceId: this.id
        })
      }
    }
  }
}
</script>
<style scoped lang='scss'>
<style scoped lang="scss">
.deviceDetail {
    .panel-title{
        position: relative;
        padding: 10px 15px ;
        font-size: 15px;
        &::before{
            content: "";
            display: block;
            position: absolute;
            top: 50%;
            left: 0;
            transform: translateY(-50%);
            height: 15px;
            background: #17b3ec;
            width: 3px;
            border-radius: 3px;
        }
    }
    .grid-4{
        display: grid;
        grid-template-columns: 1fr 1fr 1fr 1fr;
        grid-row-gap: 20px;
    }
    .ability{
        width: 50px;
        height: 50px;
  .panel-title {
    position: relative;
    padding: 10px 15px;
    font-size: 15px;
    &::before {
      content: '';
      display: block;
      position: absolute;
      top: 50%;
      left: 0;
      transform: translateY(-50%);
      height: 15px;
      background: #17b3ec;
      width: 3px;
      border-radius: 3px;
    }
  }
  .grid-4 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    grid-row-gap: 20px;
  }
  .ability {
    width: 50px;
    height: 50px;
  }
}
</style>
</style>