dedsudiyu 1 年之前
父節點
當前提交
7414392808

+ 8 - 0
src/api/medicUniversity-3_1/index.js

@@ -723,6 +723,14 @@ export function laboratoryLockGatewayId(id) {
     method: 'get',
     method: 'get',
   })
   })
 }
 }
+// 柜锁配置-详情
+export function laboratoryLockGatewayGetList(query) {
+  return request({
+    url: '/laboratory/lockGateway/getList',
+    method: 'get',
+    params: query
+  })
+}
 // 柜锁配置-新增
 // 柜锁配置-新增
 export function laboratoryLockGatewayAdd(data) {
 export function laboratoryLockGatewayAdd(data) {
   return request({
   return request({

+ 43 - 8
src/views/medicUniversity-3_1/chemicalManagement/deviceManagement/smartLocker/index.vue

@@ -89,7 +89,9 @@
           <!--<template slot-scope="scope">{{scope.row.status == 3||scope.row.status == 4?'在线':'离线'}}</template>-->
           <!--<template slot-scope="scope">{{scope.row.status == 3||scope.row.status == 4?'在线':'离线'}}</template>-->
         <!--</el-table-column>-->
         <!--</el-table-column>-->
         <el-table-column label="关联化学品柜" align="center" prop="cabinetName" width="160"/>
         <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.gatewayMac}}</template>
+        </el-table-column>
         <el-table-column label="摄像头IP" align="center" prop="ipAddress" width="200"/>
         <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="relayCode" width="200"/>
         <!--<el-table-column label="操作最大时长" align="center" prop="operateTime" width="120">-->
         <!--<el-table-column label="操作最大时长" align="center" prop="operateTime" width="120">-->
@@ -195,15 +197,26 @@
             </el-option>
             </el-option>
           </el-select>
           </el-select>
         </el-form-item>
         </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-form-item label="摄像头IP:" prop="ipAddress">
           <el-input v-model="form.ipAddress" placeholder="请输入摄像头IP" maxlength="20" style="width:360px;"/>
           <el-input v-model="form.ipAddress" placeholder="请输入摄像头IP" maxlength="20" style="width:360px;"/>
         </el-form-item>
         </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-input v-model="form.relayCode" placeholder="请输入采集器编号" maxlength="20" onkeyup="value=value.replace(/[^\w\.\/]/ig,'')" style="width:360px;"/>
         </el-form-item>
         </el-form-item>
+        <el-form-item label="mac地址" prop="gatewayId" v-if="form.lockType == 2">
+          <el-select v-model="form.gatewayId" placeholder="请选择mac地址" 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>
       </el-form>
       <div slot="footer" class="dialog-footer">
       <div slot="footer" class="dialog-footer">
         <el-button type="primary" @click="submitForm">确 定</el-button>
         <el-button type="primary" @click="submitForm">确 定</el-button>
@@ -237,7 +250,7 @@
 
 
 <script>
 <script>
   import { hxpSmartTerminal,filterDept,getSubList,addHxpSmartTerminal,putHxpSmartTerminal,getHxpSmartTerminal,delHxpSmartTerminal } from "@/api/medicUniversity-3_1/index";
   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 { listDepartments } from "@/api/system/dept";
   import { getToken } from "@/utils/auth";
   import { getToken } from "@/utils/auth";
   import associatedCabinetLock from "./associatedCabinetLock.vue"
   import associatedCabinetLock from "./associatedCabinetLock.vue"
@@ -327,6 +340,12 @@
           subjectId: [
           subjectId: [
             { required: true, trigger: "blur", message: "搜索选择实验室" },
             { required: true, trigger: "blur", message: "搜索选择实验室" },
           ],
           ],
+          lockType: [
+            { required: true, trigger: "blur", message: "请选择柜锁类型" },
+          ],
+          gatewayId: [
+            { required: true, trigger: "blur", message: "请选择mac地址" },
+          ],
           operateTime: [
           operateTime: [
             { required: true, trigger: "blur", message: "请输入操作时长" },
             { required: true, trigger: "blur", message: "请输入操作时长" },
             { required: true, message: "请输入操作时长", validator: this.spaceJudgment, trigger: "blur" },
             { required: true, message: "请输入操作时长", validator: this.spaceJudgment, trigger: "blur" },
@@ -353,17 +372,25 @@
         operationRecordPropsData:{},
         operationRecordPropsData:{},
         //关联记录传参数据
         //关联记录传参数据
         associatedCabinetLockPropsData:{},
         associatedCabinetLockPropsData:{},
+        //柜锁MAC列表
+        optionsLockGateway:[],
       };
       };
     },
     },
     created() {
     created() {
 
 
     },
     },
     mounted(){
     mounted(){
+      this.laboratoryLockGatewayGetList();
       this.filterDept();
       this.filterDept();
       this.listDepartments();
       this.listDepartments();
       this.getList();
       this.getList();
     },
     },
     methods: {
     methods: {
+      laboratoryLockGatewayGetList(){
+        laboratoryLockGatewayGetList().then(response => {
+          this.$set(this,'optionsLockGateway',response.data);
+        });
+      },
       selectFocus(){
       selectFocus(){
         if(!this.selectList[0]){
         if(!this.selectList[0]){
           this.filterDept();
           this.filterDept();
@@ -393,8 +420,14 @@
           //新增
           //新增
           this.dialogTitle = '新增';
           this.dialogTitle = '新增';
           this.$set(this,'form',{
           this.$set(this,'form',{
-            hardwareNum:"",
-            subjectId:""
+            subjectId:'',
+            name:'',
+            hardwareNum:'',
+            lockId:'',
+            ipAddress:'',
+            relayCode:'',
+            lockType:'',
+            gatewayId:'',
           });
           });
           this.clearClick();
           this.clearClick();
           this.addDialogType = true;
           this.addDialogType = true;
@@ -409,6 +442,8 @@
             lockId:item.lockId,
             lockId:item.lockId,
             ipAddress:item.ipAddress,
             ipAddress:item.ipAddress,
             relayCode:item.relayCode,
             relayCode:item.relayCode,
+            lockType:item.lockType,
+            gatewayId:item.gatewayId,
           };
           };
           this.$set(this,'form',obj);
           this.$set(this,'form',obj);
           this.clearClick();
           this.clearClick();