|
@@ -89,7 +89,9 @@
|
|
|
<!--<template slot-scope="scope">{{scope.row.status == 3||scope.row.status == 4?'在线':'离线'}}</template>-->
|
|
|
<!--</el-table-column>-->
|
|
|
<el-table-column label="关联化学品柜" align="center" prop="cabinetName" width="160"/>
|
|
|
- <el-table-column label="锁柜ID" align="center" prop="lockId" width="100"/>
|
|
|
+ <el-table-column label="锁柜ID/mac地址" align="center" prop="lockId" width="140">
|
|
|
+ <template slot-scope="scope">{{scope.row.lockType==1?scope.row.lockId:scope.row.lockMac}}</template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="摄像头IP" align="center" prop="ipAddress" width="200"/>
|
|
|
<el-table-column label="采集器编号" align="center" prop="relayCode" width="200"/>
|
|
|
<!--<el-table-column label="操作最大时长" align="center" prop="operateTime" width="120">-->
|
|
@@ -195,15 +197,29 @@
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="锁柜ID:" prop="lockId">
|
|
|
- <el-input v-model="form.lockId" placeholder="0-253" maxlength="3" style="width:360px;" onkeyup="value=value.replace(/[^\d]/g,'')"/>
|
|
|
- </el-form-item>
|
|
|
<el-form-item label="摄像头IP:" prop="ipAddress">
|
|
|
<el-input v-model="form.ipAddress" placeholder="请输入摄像头IP" maxlength="20" style="width:360px;"/>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="采集器编号:" prop="relayCode">
|
|
|
+ <el-form-item label="柜锁类型" prop="lockType">
|
|
|
+ <el-select v-model="form.lockType" placeholder="请选择柜锁类型" style="width:360px;">
|
|
|
+ <el-option label="485" :value="1"></el-option>
|
|
|
+ <el-option label="蓝牙" :value="2"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="锁柜ID:" prop="lockId" v-if="form.lockType == 1">
|
|
|
+ <el-input v-model="form.lockId" placeholder="0-253" maxlength="3" style="width:360px;" onkeyup="value=value.replace(/[^\d]/g,'')"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="采集器编号:" prop="relayCode" v-if="form.lockType == 1">
|
|
|
<el-input v-model="form.relayCode" placeholder="请输入采集器编号" maxlength="20" onkeyup="value=value.replace(/[^\w\.\/]/ig,'')" style="width:360px;"/>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="mac地址:" prop="lockMac" v-if="form.lockType == 2">
|
|
|
+ <el-input v-model="form.lockMac" placeholder="请输入mac地址" maxlength="20" onkeyup="value=value.replace(/[^\w\.\/]/ig,'')" style="width:360px;"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="蓝牙网关" prop="gatewayId" v-if="form.lockType == 2">
|
|
|
+ <el-select v-model="form.gatewayId" placeholder="请选择蓝牙网关" style="width:360px;">
|
|
|
+ <el-option v-for="(item,index) in optionsLockGateway" :key="index" :label="item.gatewayName" :value="item.id"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
|
@@ -237,7 +253,7 @@
|
|
|
|
|
|
<script>
|
|
|
import { hxpSmartTerminal,filterDept,getSubList,addHxpSmartTerminal,putHxpSmartTerminal,getHxpSmartTerminal,delHxpSmartTerminal } from "@/api/medicUniversity-3_1/index";
|
|
|
- import { listHardware, delHardware, addHardware, updateHardware,setLock,getCabinetLockList } from "@/api/medicUniversity-3_1/index";
|
|
|
+ import { listHardware, delHardware, addHardware, updateHardware,setLock,getCabinetLockList,laboratoryLockGatewayGetList } from "@/api/medicUniversity-3_1/index";
|
|
|
import { listDepartments } from "@/api/system/dept";
|
|
|
import { getToken } from "@/utils/auth";
|
|
|
import associatedCabinetLock from "./associatedCabinetLock.vue"
|
|
@@ -327,6 +343,12 @@
|
|
|
subjectId: [
|
|
|
{ required: true, trigger: "blur", message: "搜索选择实验室" },
|
|
|
],
|
|
|
+ lockType: [
|
|
|
+ { required: true, trigger: "blur", message: "请选择柜锁类型" },
|
|
|
+ ],
|
|
|
+ gatewayId: [
|
|
|
+ { required: true, trigger: "blur", message: "请选择蓝牙网关" },
|
|
|
+ ],
|
|
|
operateTime: [
|
|
|
{ required: true, trigger: "blur", message: "请输入操作时长" },
|
|
|
{ required: true, message: "请输入操作时长", validator: this.spaceJudgment, trigger: "blur" },
|
|
@@ -341,6 +363,10 @@
|
|
|
{ required: true, trigger: "blur", message: "请输入摄像头ip" },
|
|
|
{ required: true, message: "请输入摄像头ip", validator: this.spaceJudgment, trigger: "blur" }
|
|
|
],
|
|
|
+ lockMac: [
|
|
|
+ { required: true, trigger: "blur", message: "请输入mac地址" },
|
|
|
+ { required: true, message: "请输入mac地址", validator: this.spaceJudgment, trigger: "blur" }
|
|
|
+ ],
|
|
|
relayCode: [
|
|
|
{ required: true, trigger: "blur", message: "请输入采集器编号" },
|
|
|
{ required: true, message: "请输入采集器编号", validator: this.spaceJudgment, trigger: "blur" }
|
|
@@ -353,17 +379,25 @@
|
|
|
operationRecordPropsData:{},
|
|
|
//关联记录传参数据
|
|
|
associatedCabinetLockPropsData:{},
|
|
|
+ //柜锁MAC列表
|
|
|
+ optionsLockGateway:[],
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
|
|
|
},
|
|
|
mounted(){
|
|
|
+ this.laboratoryLockGatewayGetList();
|
|
|
this.filterDept();
|
|
|
this.listDepartments();
|
|
|
this.getList();
|
|
|
},
|
|
|
methods: {
|
|
|
+ laboratoryLockGatewayGetList(){
|
|
|
+ laboratoryLockGatewayGetList().then(response => {
|
|
|
+ this.$set(this,'optionsLockGateway',response.data);
|
|
|
+ });
|
|
|
+ },
|
|
|
selectFocus(){
|
|
|
if(!this.selectList[0]){
|
|
|
this.filterDept();
|
|
@@ -393,8 +427,15 @@
|
|
|
//新增
|
|
|
this.dialogTitle = '新增';
|
|
|
this.$set(this,'form',{
|
|
|
- hardwareNum:"",
|
|
|
- subjectId:""
|
|
|
+ subjectId:'',
|
|
|
+ name:'',
|
|
|
+ hardwareNum:'',
|
|
|
+ lockId:'',
|
|
|
+ ipAddress:'',
|
|
|
+ relayCode:'',
|
|
|
+ lockType:'',
|
|
|
+ gatewayId:'',
|
|
|
+ lockMac:'',
|
|
|
});
|
|
|
this.clearClick();
|
|
|
this.addDialogType = true;
|
|
@@ -409,6 +450,9 @@
|
|
|
lockId:item.lockId,
|
|
|
ipAddress:item.ipAddress,
|
|
|
relayCode:item.relayCode,
|
|
|
+ lockType:item.lockType,
|
|
|
+ lockMac:item.lockMac,
|
|
|
+ gatewayId:item.gatewayId,
|
|
|
};
|
|
|
this.$set(this,'form',obj);
|
|
|
this.clearClick();
|
|
@@ -501,8 +545,29 @@
|
|
|
if (valid) {
|
|
|
if(this.form.id){
|
|
|
//编辑
|
|
|
- this.form.type = "AI_CABINETLOCK";
|
|
|
- updateHardware(this.form).then(response => {
|
|
|
+ let obj = {
|
|
|
+ id:this.form.id,
|
|
|
+ type:'AI_CABINETLOCK',
|
|
|
+ subjectId:this.form.subjectId,
|
|
|
+ name:this.form.name,
|
|
|
+ hardwareNum:this.form.hardwareNum,
|
|
|
+ lockId:this.form.lockId,
|
|
|
+ ipAddress:this.form.ipAddress,
|
|
|
+ relayCode:this.form.relayCode,
|
|
|
+ lockType:this.form.lockType,
|
|
|
+ }
|
|
|
+ if(obj.lockType == 1){
|
|
|
+ obj.lockId=this.form.lockId;
|
|
|
+ obj.relayCode=this.form.relayCode;
|
|
|
+ obj.gatewayId='';
|
|
|
+ obj.lockMac='';
|
|
|
+ }else if(obj.lockType == 2){
|
|
|
+ obj.gatewayId=this.form.gatewayId;
|
|
|
+ obj.lockMac=this.form.lockMac;
|
|
|
+ obj.lockId='';
|
|
|
+ obj.relayCode='';
|
|
|
+ }
|
|
|
+ updateHardware(obj).then(response => {
|
|
|
if (response.code == 200){
|
|
|
this.addDialogType = false;
|
|
|
this.msgSuccess(response.msg);
|
|
@@ -511,8 +576,28 @@
|
|
|
});
|
|
|
}else{
|
|
|
//新增
|
|
|
- this.form.type = "AI_CABINETLOCK";
|
|
|
- addHardware(this.form).then(response => {
|
|
|
+ let obj = {
|
|
|
+ type:'AI_CABINETLOCK',
|
|
|
+ subjectId:this.form.subjectId,
|
|
|
+ name:this.form.name,
|
|
|
+ hardwareNum:this.form.hardwareNum,
|
|
|
+ lockId:this.form.lockId,
|
|
|
+ ipAddress:this.form.ipAddress,
|
|
|
+ relayCode:this.form.relayCode,
|
|
|
+ lockType:this.form.lockType,
|
|
|
+ }
|
|
|
+ if(obj.lockType == 1){
|
|
|
+ obj.lockId=this.form.lockId;
|
|
|
+ obj.relayCode=this.form.relayCode;
|
|
|
+ obj.gatewayId='';
|
|
|
+ obj.lockMac='';
|
|
|
+ }else if(obj.lockType == 2){
|
|
|
+ obj.gatewayId=this.form.gatewayId;
|
|
|
+ obj.lockMac=this.form.lockMac;
|
|
|
+ obj.lockId='';
|
|
|
+ obj.relayCode='';
|
|
|
+ }
|
|
|
+ addHardware(obj).then(response => {
|
|
|
if (response.code == 200){
|
|
|
this.addDialogType = false;
|
|
|
this.msgSuccess(response.msg);
|