|
@@ -23,11 +23,6 @@
|
|
|
style="margin-right: 20px;"
|
|
|
@change="editLockChange"
|
|
|
/>
|
|
|
- <el-button v-if="editLock" type="success" @click="initTest">写入测试数据</el-button>
|
|
|
- <el-button v-if="editLock" type="danger" @click="deleteTest">擦除测试数据</el-button>
|
|
|
- <el-button v-if="editLock" type="success" icon="el-icon-mobile-phone" @click="addVirtualDevice(3)">添加虚拟门口机</el-button>
|
|
|
- <el-button v-if="editLock" type="warning" icon="el-icon-coin" @click="addVirtualDevice(13)">添加虚拟紧急按钮</el-button>
|
|
|
- <el-button v-if="editLock" type="info" @click="appointRoom">设定门口机自动注册</el-button>
|
|
|
<el-button v-if="editLock" type="primary" @click="handlerAdd">新增设备</el-button>
|
|
|
<el-button v-if="editLock" type="danger" @click="batchDelete">批量删除</el-button>
|
|
|
</div>
|
|
@@ -42,28 +37,23 @@
|
|
|
|
|
|
<el-table-column prop="id" sortable="custom" label="ID" width="100" align="center" />
|
|
|
<el-table-column prop="device_type" sortable="custom" label="设备类型" width="160" align="center" :formatter="formatterDeviceType" />
|
|
|
- <el-table-column prop="device_name" sortable="custom" label="设备别名" width="160" align="center" />
|
|
|
- <el-table-column prop="device_room_num" sortable="custom" label="安装病房号" width="160" align="center" />
|
|
|
- <el-table-column prop="device_bed_num" sortable="custom" label="安装床号" width="160" align="center" />
|
|
|
- <el-table-column prop="device_hosting_id" sortable="custom" label="上级设备名称" width="160" align="center" :formatter="formatterHosting" />
|
|
|
- <el-table-column prop="device_status" sortable="custom" label="设备状态" width="120" align="center" :formatter="formatterStatus">
|
|
|
+ <el-table-column prop="name" sortable="custom" label="设备别名" width="160" align="center" />
|
|
|
+ <el-table-column prop="status" sortable="custom" label="设备状态" width="120" align="center" :formatter="formatterStatus">
|
|
|
<template slot-scope="scope">
|
|
|
- <span :class="scope.row.device_status===1?'green-text':'red-text'">{{ scope.row.device_status===1?'已启用':'未启用' }}</span>
|
|
|
+ <span :class="scope.row.status===1?'green-text':'red-text'">{{ scope.row.status===1?'已启用':'未启用' }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
-
|
|
|
- <el-table-column prop="device_eth_mac" sortable="custom" label="有线物理地址" width="160" align="center" />
|
|
|
- <el-table-column prop="device_eth_ip" sortable="custom" label="有线IP地址" width="160" align="center" />
|
|
|
- <el-table-column prop="device_model" sortable="custom" label="设备型号" width="160" align="center" />
|
|
|
-
|
|
|
- <el-table-column prop="device_sn" sortable="custom" label="出厂编号" width="160" align="center" />
|
|
|
- <el-table-column prop="device_soft_ver" sortable="custom" label="软件版本" width="160" align="center" />
|
|
|
- <el-table-column prop="device_hard_ver" sortable="custom" label="硬件版本" width="160" align="center" />
|
|
|
- <el-table-column prop="device_wifi_mac" sortable="custom" label="WIFI物理地址" width="160" align="center" />
|
|
|
- <el-table-column prop="device_wifi_ip" sortable="custom" label="WIFIIP地址" width="160" align="center" />
|
|
|
-
|
|
|
- <el-table-column prop="device_sip_id" sortable="custom" label="SIP账号" width="160" align="center" />
|
|
|
- <el-table-column prop="device_datetime" sortable="custom" label="最后修改时间" width="160" align="center" />
|
|
|
+ <el-table-column prop="eth_mac" sortable="custom" label="有线物理地址" width="160" align="center" />
|
|
|
+ <el-table-column prop="eth_ip" sortable="custom" label="有线IP地址" width="160" align="center" />
|
|
|
+ <el-table-column prop="model" sortable="custom" label="设备型号" width="160" align="center" />
|
|
|
+ <el-table-column prop="code" sortable="custom" label="出厂编号" width="160" align="center" />
|
|
|
+ <el-table-column prop="soft_ver" sortable="custom" label="软件版本" width="160" align="center" />
|
|
|
+ <el-table-column prop="hard_ver" sortable="custom" label="硬件版本" width="160" align="center" />
|
|
|
+ <el-table-column prop="wifi_mac" sortable="custom" label="WIFI物理地址" width="160" align="center" />
|
|
|
+ <el-table-column prop="wifi_ip" sortable="custom" label="WIFIIP地址" width="160" align="center" />
|
|
|
+
|
|
|
+ <el-table-column prop="sip_id" sortable="custom" label="SIP账号" width="160" align="center" />
|
|
|
+ <el-table-column prop="update_time" sortable="custom" label="最后修改时间" width="160" align="center" />
|
|
|
<el-table-column
|
|
|
v-if="editLock"
|
|
|
label="操作"
|
|
@@ -98,7 +88,7 @@
|
|
|
/>
|
|
|
</en-table-layout>
|
|
|
|
|
|
- <el-dialog :title.sync="formtitle" :visible.sync="formshow" width="50%">
|
|
|
+ <el-dialog :title.sync="formtitle" :visible.sync="formshow" width="70%">
|
|
|
<div>
|
|
|
<el-form ref="editform" :rules="rules" label-width="120px" :model="formmodel">
|
|
|
<el-row>
|
|
@@ -119,117 +109,82 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="设备别名" prop="device_name">
|
|
|
- <el-input v-model="formmodel.device_name" clearable :maxlength="20" placeholder="请输入设备别名" />
|
|
|
+ <el-form-item label="设备别名" prop="name">
|
|
|
+ <el-input v-model="formmodel.name" clearable :maxlength="20" placeholder="请输入设备别名" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
-
|
|
|
<el-row>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="出厂编号" prop="device_sn">
|
|
|
- <el-input v-model="formmodel.device_sn" clearable placeholder="请输入出厂编号" />
|
|
|
+ <el-form-item label="出厂编号" prop="code">
|
|
|
+ <el-input v-model="formmodel.code" clearable placeholder="请输入出厂编号" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="设备型号" prop="device_model">
|
|
|
- <el-input v-model="formmodel.device_model" clearable placeholder="请输入设备型号" />
|
|
|
+ <el-form-item label="设备型号" prop="model">
|
|
|
+ <el-input v-model="formmodel.model" clearable placeholder="请输入设备型号" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
|
|
|
<el-row>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="有线物理地址" prop="device_eth_mac">
|
|
|
- <el-input v-model="formmodel.device_eth_mac" clearable placeholder="请输入物理MAC地址" />
|
|
|
+ <el-form-item label="有线物理地址" prop="eth_mac">
|
|
|
+ <el-input v-model="formmodel.eth_mac" clearable placeholder="请输入物理MAC地址" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="有线IP地址" prop="device_eth_ip">
|
|
|
- <el-input v-model="formmodel.device_eth_ip" clearable :readonly="deviceEthIPReadonly" placeholder="请输入IP地址" />
|
|
|
+ <el-form-item label="有线IP地址" prop="eth_ip">
|
|
|
+ <el-input v-model="formmodel.eth_ip" clearable :readonly="deviceEthIPReadonly" placeholder="请输入IP地址" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<el-row>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="WIFI物理地址" prop="device_wifi_mac">
|
|
|
- <el-input v-model="formmodel.device_wifi_mac" clearable placeholder="请输入WIFI MAC地址" readonly />
|
|
|
+ <el-form-item label="WIFI物理地址" prop="wifi_mac">
|
|
|
+ <el-input v-model="formmodel.wifi_mac" clearable placeholder="请输入WIFI MAC地址" readonly />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="WIFIIP地址" prop="device_wifi_ip">
|
|
|
- <el-input v-model="formmodel.device_wifi_ip" clearable placeholder="请输入WIFI IP地址" readonly />
|
|
|
+ <el-form-item label="WIFIIP地址" prop="wifi_ip">
|
|
|
+ <el-input v-model="formmodel.wifi_ip" clearable placeholder="请输入WIFI IP地址" readonly />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<el-row>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="软件版本" prop="device_soft_ver">
|
|
|
- <el-input v-model="formmodel.device_soft_ver" clearable placeholder="请输入软件版本号" />
|
|
|
+ <el-form-item label="软件版本" prop="soft_ver">
|
|
|
+ <el-input v-model="formmodel.soft_ver" clearable placeholder="请输入软件版本号" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="硬件版本" prop="device_hard_ver">
|
|
|
- <el-input v-model="formmodel.device_hard_ver" clearable placeholder="请输入硬件版本号" />
|
|
|
+ <el-form-item label="硬件版本" prop="hard_ver">
|
|
|
+ <el-input v-model="formmodel.hard_ver" clearable placeholder="请输入硬件版本号" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
|
|
|
<el-row>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="上级设备" prop="device_hosting_id">
|
|
|
- <el-select v-model="formmodel.device_hosting_id" placeholder="请选择上级设备" :disabled="deviceHostingDisabled" clearable @change="hostDeviceChange">
|
|
|
- <el-option v-for="(item,index) in hostDevices" :key="index" :label="item.device_name" :value="item.id+''" />
|
|
|
- </el-select>
|
|
|
+ <el-form-item label="WIFI热点">
|
|
|
+ <el-input v-model="formmodel.wifi_hostname" :readonly="wifiHostReadonly" clearable placeholder="请输入WIFI热点名称" />
|
|
|
</el-form-item>
|
|
|
-
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="床位号" prop="device_bed_num">
|
|
|
- <el-input v-model="formmodel.device_bed_num" :readonly="bedNameReadonly" clearable placeholder="请输入床位号" />
|
|
|
+ <el-form-item label="WIFI密码">
|
|
|
+ <el-input v-model="formmodel.wifi_password" :readonly="wifiHostReadonly" clearable placeholder="请输入WIFI热点密码" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
|
|
|
<el-row>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="安装病房名称" prop="device_room_id">
|
|
|
- <el-select v-model="formmodel.device_room_id" :allow-create="roomNumAllowCreate" :filterable="roomNumAllowCreate" placeholder="请选择病房门口机" :disabled="roomNumDisabled" clearable @change="deviceRoomChange">
|
|
|
- <el-option v-for="(item,index) in doorDevices" :key="index" :label="item.device_room_num" :value="item.id" :disabled="roomOptionDisabed" />
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item v-if="false" label="WIFI热点" prop="device_wifi_hostname">
|
|
|
- <el-input v-model="formmodel.device_wifi_hostname" :readonly="wifiHostReadonly" clearable placeholder="请输入WIFI热点名称" />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
-
|
|
|
- <el-row>
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="" prop="device_status">
|
|
|
- <el-checkbox v-model="formmodel.device_status" :true-label="1" :false-label="0">启用设备</el-checkbox>
|
|
|
+ <el-form-item label="" prop="status">
|
|
|
+ <el-checkbox v-model="formmodel.status" :true-label="1" :false-label="0">启用设备</el-checkbox>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12" />
|
|
|
</el-row>
|
|
|
-
|
|
|
- <div class="dashed">
|
|
|
- <el-row>
|
|
|
- <el-col :span="24">
|
|
|
- <el-form-item label="分区配置">
|
|
|
- <el-checkbox v-model="formmodel.device_zone0" :true-label="1" :false-label="0">全局广播</el-checkbox>
|
|
|
- <el-checkbox v-model="formmodel.device_zone1" :true-label="1" :false-label="0">定时广播分区1</el-checkbox>
|
|
|
- <el-checkbox v-model="formmodel.device_zone2" :true-label="1" :false-label="0">定时广播分区2</el-checkbox>
|
|
|
- <el-checkbox v-model="formmodel.device_zone3" :true-label="1" :false-label="0">定时广播分区3</el-checkbox>
|
|
|
- <el-checkbox v-model="formmodel.device_zone4" :true-label="1" :false-label="0">定时广播分区4</el-checkbox>
|
|
|
- <el-checkbox v-model="formmodel.device_zone5" :true-label="1" :false-label="0">定时广播分区5</el-checkbox>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- </div>
|
|
|
-
|
|
|
</el-form>
|
|
|
|
|
|
</div>
|
|
@@ -253,39 +208,11 @@
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
|
|
|
- <el-dialog title="自动注册门口机环境设定" :visible.sync="appointRoomShow" width="30%">
|
|
|
- <div>
|
|
|
-
|
|
|
- <el-form ref="editformAppointRoom" :rules="rulesAppointRoom" label-width="120px" :model="formmodelAppointRoom">
|
|
|
- <el-form-item label="" prop="room_appointed">
|
|
|
- <el-checkbox v-model="formmodelAppointRoom.room_appointed" :true-label="1" :false-label="0" @change="roomAppointChange">是否开启指定房间注册</el-checkbox>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="护士主机" prop="appoint_host_id">
|
|
|
- <el-select v-model="formmodelAppointRoom.appoint_host_id" default-first-option placeholder="请选择护士主机" clearable @change="hostDeviceChange">
|
|
|
- <el-option v-for="(item,index) in hostDevices" :key="index" :label="item.device_name" :value="item.id" />
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
-
|
|
|
- <el-form-item label="选定门口机" prop="appoint_room_id">
|
|
|
- <el-select v-model="formmodelAppointRoom.appoint_room_id" placeholder="请选择病房门口机" clearable @change="deviceRoomChange">
|
|
|
- <el-option v-for="(item,index) in doorDevices" :key="index" :label="item.device_name+'---房号:'+item.device_room_num" :value="item.id" />
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
- </div>
|
|
|
- <div slot="footer" class="dialog-footer">
|
|
|
- <el-button @click="appointRoomShow = false">取 消</el-button>
|
|
|
- <el-button type="primary" @click.native.prevent="onSubmit">确 定</el-button>
|
|
|
- </div>
|
|
|
- </el-dialog>
|
|
|
-
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import * as API_Device from '@/api/calling-device'
|
|
|
-import { runtimeUrl } from '@/utils/domain'
|
|
|
-import * as API_DeviceRegisterParams from '@/api/calling-deviceRegisterParams'
|
|
|
export default {
|
|
|
|
|
|
name: 'Index',
|
|
@@ -297,7 +224,7 @@ export default {
|
|
|
createform: {},
|
|
|
/** 表单数据 */
|
|
|
formmodel: {
|
|
|
- device_eth_ip: null
|
|
|
+ eth_ip: null
|
|
|
},
|
|
|
formmodel1: {
|
|
|
manager_password: null
|
|
@@ -308,35 +235,25 @@ export default {
|
|
|
formtitle: '新增设备',
|
|
|
formshow: false, // 编辑表单显示开关
|
|
|
formshow1: false,
|
|
|
- appointRoomShow: false, // 自动注册时,选定门口机编辑窗口,编辑自动注册参数,选定门口机后将后续分机注册到该门口机下
|
|
|
/** 表单校验 */
|
|
|
rules: {
|
|
|
device_type: [
|
|
|
{ required: true, message: '设备类型必须选择', trigger: 'blur' }
|
|
|
],
|
|
|
- device_name: [
|
|
|
+ name: [
|
|
|
{ required: true, message: '设备别名必须填写', trigger: 'blur' }
|
|
|
],
|
|
|
- device_sn: [
|
|
|
+ code: [
|
|
|
{ required: true, message: '设备出厂编号必须填写', trigger: 'blur' }
|
|
|
],
|
|
|
- device_model: [
|
|
|
+ model: [
|
|
|
{ required: true, message: '设备型号必须填写', trigger: 'blur' }
|
|
|
],
|
|
|
- device_hosting_id: [
|
|
|
- { required: true, message: '上级设备必须选择', trigger: 'blur' }
|
|
|
- ],
|
|
|
- device_eth_mac: [
|
|
|
+ eth_mac: [
|
|
|
{ required: true, message: '设备有线MC地址必须填写', trigger: 'blur' }
|
|
|
],
|
|
|
- device_eth_ip: [
|
|
|
+ eth_ip: [
|
|
|
{ required: true, message: '设备有线IP地址必须填写', trigger: 'blur' }
|
|
|
- ],
|
|
|
- device_room_id: [
|
|
|
- { required: false, message: '安装病房必须选择', trigger: 'blur' }
|
|
|
- ],
|
|
|
- device_bed_num: [
|
|
|
- { required: false, message: '床位号必须填写', trigger: 'blur' }
|
|
|
]
|
|
|
},
|
|
|
rulesAppointRoom: {
|
|
@@ -351,7 +268,7 @@ export default {
|
|
|
params: {
|
|
|
page_size: 20,
|
|
|
page_no: 1,
|
|
|
- fixedCondition: 'PARTID=' + this.$store.getters.partId,
|
|
|
+ fixedCondition: 'part_id=' + this.$store.getters.partId,
|
|
|
sort: 'id',
|
|
|
dir: 'desc'
|
|
|
},
|
|
@@ -362,8 +279,6 @@ export default {
|
|
|
multipleSelection: [],
|
|
|
/** 表单提交指示 0 代表新增 1代表修改 */
|
|
|
editflag: 0,
|
|
|
- /** 护士主机可选项 */
|
|
|
- hostDevices: [],
|
|
|
/** 门口机可选项 病房号 */
|
|
|
doorDevices: [],
|
|
|
/** 房间号禁用 **/
|
|
@@ -392,73 +307,22 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
async mounted() {
|
|
|
- this.getHostDevices(-1)
|
|
|
this.getList()
|
|
|
- this.initWebSocket()
|
|
|
},
|
|
|
methods: {
|
|
|
-
|
|
|
- initWebSocket: function() {
|
|
|
- var stockbase = runtimeUrl.replace('http', 'ws')
|
|
|
- this.websock = new WebSocket(stockbase + '/deviceautoregister/' + this.$store.getters.uuid)
|
|
|
- this.websock.onopen = this.websocketonopen
|
|
|
- this.websock.onerror = this.websocketonerror
|
|
|
- this.websock.onmessage = this.websocketonmessage
|
|
|
- this.websock.onclose = this.websocketclose
|
|
|
- },
|
|
|
- websocketonopen: function() {
|
|
|
- this.$message.success('WebStocket 连接成功,可开始自动注册设备。')
|
|
|
- console.log('WebSocket连接成功')
|
|
|
- },
|
|
|
- websocketonerror: function(e) {
|
|
|
- console.log('WebSocket连接发生错误')
|
|
|
- },
|
|
|
- websocketonmessage: function(e) {
|
|
|
- const registerDevice = JSON.parse(e.data)
|
|
|
- console.log(registerDevice)
|
|
|
- if (registerDevice.code && registerDevice.code === 'success') {
|
|
|
- this.$message({
|
|
|
- type: 'success',
|
|
|
- message: '设备注册成功![' + registerDevice.device_eth_mac + ']',
|
|
|
- duration: 2000
|
|
|
- })
|
|
|
- this.getList()
|
|
|
- } else {
|
|
|
- this.$message({
|
|
|
- type: 'error',
|
|
|
- message: registerDevice.message,
|
|
|
- duration: 2000
|
|
|
- })
|
|
|
- }
|
|
|
- this.formmodel = { ...this.formmodel, ...registerDevice }
|
|
|
- this.setFormStatus(this.formmodel.device_type)
|
|
|
- },
|
|
|
- websocketclose: function(e) {
|
|
|
- console.log('connection closed (' + e.code + ')')
|
|
|
- },
|
|
|
-
|
|
|
/** 新增按钮 */
|
|
|
async handlerAdd() {
|
|
|
- this.nextIp = await API_Device.getNextIP()
|
|
|
+ // this.nextIp = await API_Device.getNextIP()
|
|
|
this.deviceTypeDisabled = false
|
|
|
this.formmodel = {
|
|
|
- device_soft_ver: 'SV1.0',
|
|
|
- device_hard_ver: 'HV1.0',
|
|
|
- device_eth_mac: null,
|
|
|
- device_eth_ip: this.nextIp,
|
|
|
- device_wifi_mac: 'FF:FF:FF:FF:FF:FF',
|
|
|
- device_wifi_ip: ' ',
|
|
|
- device_room_num: ' ',
|
|
|
- device_room_id: null,
|
|
|
- device_zone0: 1,
|
|
|
- device_zone1: 1,
|
|
|
- device_zone2: 1,
|
|
|
- device_zone3: 1,
|
|
|
- device_zone4: 1,
|
|
|
- device_zone5: 1,
|
|
|
- device_human_type: 0,
|
|
|
- device_status: 1,
|
|
|
- device_hosting_id: null
|
|
|
+ part_id: this.$store.getters.partId,
|
|
|
+ soft_ver: 'SV1.0',
|
|
|
+ hard_ver: 'HV1.0',
|
|
|
+ eth_mac: null,
|
|
|
+ eth_ip: this.nextIp,
|
|
|
+ wifi_mac: 'FF:FF:FF:FF:FF:FF',
|
|
|
+ wifi_ip: ' ',
|
|
|
+ status: 1
|
|
|
}
|
|
|
if (this.$refs.editform) {
|
|
|
this.$refs.editform.resetFields()
|
|
@@ -474,12 +338,6 @@ export default {
|
|
|
}
|
|
|
this.formmodel = { ...row }
|
|
|
this.setFormStatus(this.formmodel.device_type)
|
|
|
- /** 加载可用的门口机设备 */
|
|
|
- if (this.formmodel.device_hosting_id !== null && this.formmodel.device_hosting_id !== '') {
|
|
|
- await this.getDoorDevice()
|
|
|
- } else {
|
|
|
- this.doorDevices = []
|
|
|
- }
|
|
|
this.editflag = 1
|
|
|
this.formtitle = '修改设备'
|
|
|
this.formshow = true
|
|
@@ -659,107 +517,70 @@ export default {
|
|
|
this.formmodel.device_room_num = value
|
|
|
}
|
|
|
},
|
|
|
- /** 上级设备切换时 更新设备门口机可选择项 */
|
|
|
- async hostDeviceChange(value) {
|
|
|
- this.formmodel.device_room_id = '' // 清空已选择 安装病房
|
|
|
- if (value !== '') {
|
|
|
- const parentDevice = this.hostDevices.find(p => p.id === Number(value))
|
|
|
- if (parentDevice.device_type === 1) {
|
|
|
- this.doorDevices = await API_Device.getSubDevices(value, 3)
|
|
|
- } else {
|
|
|
- this.doorDevices = await API_Device.getSubDevices(value, 13)
|
|
|
- }
|
|
|
- } else {
|
|
|
- this.doorDevices = []
|
|
|
- }
|
|
|
- },
|
|
|
deviceTypeChange(value) {
|
|
|
- this.rules.device_eth_mac[0].required = true
|
|
|
- this.rules.device_eth_ip[0].required = true
|
|
|
- this.rules.device_hosting_id[0].required = true // 上级设备 必选:护士主机不选
|
|
|
- this.rules.device_room_id[0].required = false
|
|
|
- this.rules.device_bed_num[0].required = false // 床位号必填
|
|
|
- this.rules.device_sn[0].required = true // 设备出厂编号 ,总线转换盒不需要填写
|
|
|
+ this.rules.eth_mac[0].required = true
|
|
|
+ this.rules.eth_ip[0].required = true
|
|
|
+ this.rules.code[0].required = true // 设备出厂编号 ,总线转换盒不需要填写
|
|
|
this.deviceHostingDisabled = false // 上级设备选择,默认启用:护士主机禁用
|
|
|
this.roomNumDisabled = false // 房间号选择禁用:护士主机 医生主机 门口机
|
|
|
this.bedNameReadonly = false // 床位号默认不用填写,例外:
|
|
|
this.roomNumAllowCreate = false // 房间名称选择器是否可以创建条目:门口机设备需开启,门口机作为房其他设备的房间信息获取来源,需要自行填写。
|
|
|
this.roomOptionDisabed = false // 房间名称选择器条目是否禁用,门口机类型需要禁用
|
|
|
this.deviceEthIPReadonly = false // ip 地址只读
|
|
|
- this.formmodel.device_eth_ip = this.nextIp
|
|
|
- this.formmodel.device_eth_mac = null
|
|
|
+ this.formmodel.eth_ip = this.nextIp
|
|
|
+ this.formmodel.eth_mac = null
|
|
|
this.wifiHostReadonly = true
|
|
|
- this.formmodel.device_hosting_id = '' // 清空已选择上级设备
|
|
|
- this.formmodel.device_room_id = '' // 清空已选择 安装病房
|
|
|
if (value === 1) { // 护士主机
|
|
|
- this.rules.device_hosting_id[0].required = false // 无需选择上级设备
|
|
|
this.roomNumDisabled = true
|
|
|
this.bedNameReadonly = true
|
|
|
this.deviceHostingDisabled = true
|
|
|
} else if (value === 2) {
|
|
|
this.roomNumDisabled = true
|
|
|
this.bedNameReadonly = true
|
|
|
- this.getHostDevices(1)
|
|
|
} else if (value === 3) {
|
|
|
this.bedNameReadonly = true
|
|
|
this.roomNumAllowCreate = true // 门口机需要填写房间名称
|
|
|
this.roomOptionDisabed = true
|
|
|
this.wifiHostReadonly = false
|
|
|
- this.rules.device_room_id[0].required = true
|
|
|
- this.getHostDevices(1)
|
|
|
} else if (value === 4) { // 病床分机
|
|
|
- this.rules.device_room_id[0].required = true // 安装房间必须选择
|
|
|
- this.rules.device_bed_num[0].required = true // 床位必须填写
|
|
|
- this.getHostDevices(1)
|
|
|
} else if (value === 6) {
|
|
|
this.roomNumDisabled = true
|
|
|
this.bedNameReadonly = true
|
|
|
} else if (value === 11) {
|
|
|
- this.rules.device_sn[0].required = false
|
|
|
+ this.rules.code[0].required = false
|
|
|
this.roomNumDisabled = true
|
|
|
this.bedNameReadonly = true
|
|
|
- this.getHostDevices(1)
|
|
|
} else if (value === 12) {
|
|
|
- this.rules.device_eth_mac[0].required = false
|
|
|
- this.rules.device_eth_ip[0].required = false
|
|
|
- this.formmodel.device_eth_ip = null
|
|
|
- this.formmodel.device_eth_mac = '1000'
|
|
|
+ this.rules.eth_mac[0].required = false
|
|
|
+ this.rules.eth_ip[0].required = false
|
|
|
+ this.formmodel.eth_ip = null
|
|
|
+ this.formmodel.eth_mac = '1000'
|
|
|
this.deviceEthIPReadonly = true
|
|
|
- this.rules.device_room_id[0].required = true // 安装房间必须选择
|
|
|
- this.rules.device_bed_num[0].required = true
|
|
|
- this.getHostDevices(11)
|
|
|
} else if (value === 13) {
|
|
|
- this.rules.device_eth_mac[0].required = false
|
|
|
- this.rules.device_eth_ip[0].required = false
|
|
|
- this.formmodel.device_eth_ip = null
|
|
|
- this.formmodel.device_eth_mac = '3000'
|
|
|
+ this.rules.eth_mac[0].required = false
|
|
|
+ this.rules.eth_ip[0].required = false
|
|
|
+ this.formmodel.eth_ip = null
|
|
|
+ this.formmodel.eth_mac = '3000'
|
|
|
this.deviceEthIPReadonly = true
|
|
|
this.bedNameReadonly = true
|
|
|
- this.getHostDevices(11)
|
|
|
} else if (value === 14) {
|
|
|
- this.rules.device_eth_mac[0].required = false
|
|
|
- this.rules.device_eth_ip[0].required = false
|
|
|
- this.formmodel.device_eth_ip = null
|
|
|
- this.formmodel.device_eth_mac = '2000'
|
|
|
+ this.rules.eth_mac[0].required = false
|
|
|
+ this.rules.eth_ip[0].required = false
|
|
|
+ this.formmodel.eth_ip = null
|
|
|
+ this.formmodel.eth_mac = '2000'
|
|
|
this.deviceEthIPReadonly = true
|
|
|
this.bedNameReadonly = true
|
|
|
- this.getHostDevices(11)
|
|
|
} else if (value === 16) {
|
|
|
- this.rules.device_eth_mac[0].required = true
|
|
|
- this.rules.device_sn[0].required = false
|
|
|
- this.rules.device_room_id[0].required = true // 安装房间必须选择
|
|
|
+ this.rules.eth_mac[0].required = true
|
|
|
+ this.rules.code[0].required = false
|
|
|
this.deviceEthIPReadonly = true
|
|
|
- this.getHostDevices(1)
|
|
|
}
|
|
|
},
|
|
|
setFormStatus(value) {
|
|
|
this.deviceTypeDisabled = true // 不允许修改设备类型
|
|
|
- this.rules.device_eth_mac[0].required = true
|
|
|
- this.rules.device_eth_ip[0].required = true
|
|
|
- this.rules.device_hosting_id[0].required = true // 上级设备 必选:护士主机不选
|
|
|
- this.rules.device_room_id[0].required = false
|
|
|
- this.rules.device_bed_num[0].required = false // 床位号必填
|
|
|
- this.rules.device_sn[0].required = true // 设备出厂编号 ,总线转换盒不需要填写
|
|
|
+ this.rules.eth_mac[0].required = true
|
|
|
+ this.rules.eth_ip[0].required = true
|
|
|
+ this.rules.code[0].required = true // 设备出厂编号 ,总线转换盒不需要填写
|
|
|
this.deviceHostingDisabled = false // 上级设备选择,默认启用:护士主机禁用
|
|
|
this.roomNumDisabled = false // 房间号选择禁用:护士主机 医生主机 门口机
|
|
|
this.bedNameReadonly = false // 床位号默认不用填写,例外:
|
|
@@ -768,93 +589,41 @@ export default {
|
|
|
this.deviceEthIPReadonly = false // ip 地址只读
|
|
|
this.wifiHostReadonly = true
|
|
|
if (value === 1) { // 护士主机
|
|
|
- this.rules.device_hosting_id[0].required = false // 无需选择上级设备
|
|
|
this.roomNumDisabled = true
|
|
|
this.bedNameReadonly = true
|
|
|
this.deviceHostingDisabled = true
|
|
|
- this.getHostDevices(1)
|
|
|
} else if (value === 2) {
|
|
|
this.roomNumDisabled = true
|
|
|
this.bedNameReadonly = true
|
|
|
- this.getHostDevices(1)
|
|
|
} else if (value === 3) {
|
|
|
this.bedNameReadonly = true
|
|
|
this.roomNumAllowCreate = true // 门口机需要填写房间名称
|
|
|
this.roomOptionDisabed = true
|
|
|
this.wifiHostReadonly = false
|
|
|
- this.getHostDevices(1)
|
|
|
} else if (value === 4) { // 病床分机
|
|
|
- this.rules.device_room_id[0].required = true // 安装房间必须选择
|
|
|
- this.rules.device_bed_num[0].required = true // 床位必须填写
|
|
|
- this.getHostDevices(1)
|
|
|
} else if (value === 6) {
|
|
|
this.roomNumDisabled = true
|
|
|
this.bedNameReadonly = true
|
|
|
- this.getHostDevices(1)
|
|
|
} else if (value === 11) {
|
|
|
- this.rules.device_sn[0].required = false
|
|
|
+ this.rules.code[0].required = false
|
|
|
this.roomNumDisabled = true
|
|
|
this.bedNameReadonly = true
|
|
|
- this.getHostDevices(1)
|
|
|
} else if (value === 12) {
|
|
|
- this.rules.device_eth_mac[0].required = false
|
|
|
- this.rules.device_eth_ip[0].required = false
|
|
|
+ this.rules.eth_mac[0].required = false
|
|
|
+ this.rules.eth_ip[0].required = false
|
|
|
this.deviceEthIPReadonly = true
|
|
|
- this.rules.device_room_id[0].required = true // 安装房间必须选择
|
|
|
- this.rules.device_bed_num[0].required = true
|
|
|
- this.getHostDevices(11)
|
|
|
} else if (value === 13) {
|
|
|
- this.rules.device_eth_mac[0].required = false
|
|
|
- this.rules.device_eth_ip[0].required = false
|
|
|
+ this.rules.eth_mac[0].required = false
|
|
|
+ this.rules.eth_ip[0].required = false
|
|
|
this.deviceEthIPReadonly = true
|
|
|
this.bedNameReadonly = true
|
|
|
- this.getHostDevices(11)
|
|
|
} else if (value === 14) {
|
|
|
- this.rules.device_eth_mac[0].required = false
|
|
|
- this.rules.device_eth_ip[0].required = false
|
|
|
+ this.rules.eth_mac[0].required = false
|
|
|
+ this.rules.eth_ip[0].required = false
|
|
|
this.deviceEthIPReadonly = true
|
|
|
this.bedNameReadonly = true
|
|
|
- this.getHostDevices(11)
|
|
|
- }
|
|
|
- },
|
|
|
- async getDoorDevice() {
|
|
|
- const simulate = await API_Device.getSubDevices(this.formmodel.device_hosting_id, 13)
|
|
|
- const digtal = await API_Device.getSubDevices(this.formmodel.device_hosting_id, 3)
|
|
|
- this.doorDevices = [...simulate, ...digtal]
|
|
|
- },
|
|
|
- async getHostDevices(type) {
|
|
|
- const nurseHosts = await API_Device.getDeviceByType(this.$store.getters.partId, 1)
|
|
|
- const transfers = await API_Device.getDeviceByType(this.$store.getters.partId, 11)
|
|
|
- if (type === 1) {
|
|
|
- this.hostDevices = [...nurseHosts]
|
|
|
- } else if (type === 11) {
|
|
|
- this.hostDevices = [...transfers]
|
|
|
- } else {
|
|
|
- this.hostDevices = [...nurseHosts, ...transfers]
|
|
|
}
|
|
|
},
|
|
|
- addVirtualDevice(type) {
|
|
|
- const param = {
|
|
|
- partid: this.$store.getters.partId,
|
|
|
- devicetype: type
|
|
|
- }
|
|
|
- API_Device.addVirtualDevice(param).then(res => {
|
|
|
- this.getList()
|
|
|
- })
|
|
|
- },
|
|
|
- /** 设备初始化测试数据,为病床分机写入测试住院信息,测试通话 功能*/
|
|
|
- initTest() {
|
|
|
- API_Device.addTestData().then(res => {
|
|
|
- this.getList()
|
|
|
- this.$message.success('写入数据成功!')
|
|
|
- })
|
|
|
- },
|
|
|
- deleteTest() {
|
|
|
- API_Device.deleteTestData().then(res => {
|
|
|
- this.$message.success('擦除数据成功!')
|
|
|
- this.getList()
|
|
|
- })
|
|
|
- },
|
|
|
editLockChange(val) {
|
|
|
if (val) {
|
|
|
this.formshow1 = true
|
|
@@ -872,37 +641,6 @@ export default {
|
|
|
this.$message.error('密码错误!')
|
|
|
}
|
|
|
},
|
|
|
- async appointRoom() {
|
|
|
- const registparam = await API_DeviceRegisterParams.get()
|
|
|
- if (registparam === '') {
|
|
|
- this.formmodelAppointRoom = {}
|
|
|
- } else {
|
|
|
- this.formmodelAppointRoom = { ...registparam }
|
|
|
- }
|
|
|
- if (this.formmodelAppointRoom.device_register_part_id === undefined) {
|
|
|
- this.$message.error('请先设定自动注册参数!')
|
|
|
- return false
|
|
|
- } else if (this.formmodelAppointRoom.device_register_part_id !== Number(this.$store.getters.partId)) {
|
|
|
- this.$message.error('设备自动注册的科室与当前科室不一致,请更改设置!')
|
|
|
- return false
|
|
|
- }
|
|
|
- this.appointRoomShow = true
|
|
|
- },
|
|
|
- /** 更新自动注册参数 */
|
|
|
- onSubmit() {
|
|
|
- this.$refs['editformAppointRoom'].validate((valid) => {
|
|
|
- if (valid) {
|
|
|
- API_DeviceRegisterParams.update(this.formmodelAppointRoom).then(res => {
|
|
|
- this.$message.success('保存成功!')
|
|
|
- this.appointRoomShow = false
|
|
|
- }).catch(err => {
|
|
|
- this.$message.error(err.message)
|
|
|
- })
|
|
|
- } else {
|
|
|
- this.$message.error('表单填写错误,请检查!')
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
roomAppointChange(val) {
|
|
|
if (val === 1) {
|
|
|
this.rulesAppointRoom.appoint_host_id[0].required = true
|