|
@@ -1,639 +0,0 @@
|
|
-<template>
|
|
|
|
- <div class="app-container">
|
|
|
|
-
|
|
|
|
- <en-table-layout
|
|
|
|
- toolbar
|
|
|
|
- pagination
|
|
|
|
- :table-data="tableData"
|
|
|
|
- :height="tableHeight"
|
|
|
|
- :loading="loading"
|
|
|
|
- @selection-change="selectFun"
|
|
|
|
- @sort-change="tableSort"
|
|
|
|
- >
|
|
|
|
- <!--工具栏-->
|
|
|
|
- <div slot="toolbar" class="inner-toolbar">
|
|
|
|
- <div class="toolbar-search">
|
|
|
|
- <en-table-search placeholder="请输入搜索关键字" @search="handlerSearch" />
|
|
|
|
- </div>
|
|
|
|
- <div class="toolbar-btns">
|
|
|
|
- <el-switch
|
|
|
|
- v-model="editLock"
|
|
|
|
- active-text="打开编辑"
|
|
|
|
- inactive-text="关闭编辑"
|
|
|
|
- style="margin-right: 20px;"
|
|
|
|
- @change="editLockChange"
|
|
|
|
- />
|
|
|
|
- <el-button v-if="editLock" type="primary" @click="handlerAdd">新增设备</el-button>
|
|
|
|
- <el-button v-if="editLock" type="danger" @click="batchDelete">批量删除</el-button>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- <!--表头-->
|
|
|
|
- <template slot="table-columns">
|
|
|
|
- <el-table-column
|
|
|
|
- type="selection"
|
|
|
|
- width="55"
|
|
|
|
- align="center"
|
|
|
|
- />
|
|
|
|
-
|
|
|
|
- <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="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.status===1?'green-text':'red-text'">{{ scope.row.status===1?'已启用':'未启用' }}</span>
|
|
|
|
- </template>
|
|
|
|
- </el-table-column>
|
|
|
|
- <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="操作"
|
|
|
|
- align="center"
|
|
|
|
- fixed="right"
|
|
|
|
- width="160"
|
|
|
|
- >
|
|
|
|
- <template slot-scope="scope">
|
|
|
|
- <el-button type="success" size="mini" @click="handlerEdit(scope.$index,scope.row)">
|
|
|
|
- 编辑
|
|
|
|
- </el-button>
|
|
|
|
-
|
|
|
|
- <el-button type="danger" size="mini" @click="handlerDelete(scope.row.id)">
|
|
|
|
- 删除
|
|
|
|
- </el-button>
|
|
|
|
- </template>
|
|
|
|
- </el-table-column>
|
|
|
|
-
|
|
|
|
- </template>
|
|
|
|
-
|
|
|
|
- <!--翻页-->
|
|
|
|
- <el-pagination
|
|
|
|
- v-if="pageData"
|
|
|
|
- slot="pagination"
|
|
|
|
- :current-page="pageData.page_no"
|
|
|
|
- :page-sizes="[10, 20, 50, 100]"
|
|
|
|
- :page-size="pageData.page_size"
|
|
|
|
- layout="total, sizes, prev, pager, next, jumper"
|
|
|
|
- :total="pageData.data_total"
|
|
|
|
- @size-change="handlePageSizeChange"
|
|
|
|
- @current-change="handlePageCurrentChange"
|
|
|
|
- />
|
|
|
|
- </en-table-layout>
|
|
|
|
-
|
|
|
|
- <el-dialog :title.sync="formtitle" :visible.sync="formshow" width="70%">
|
|
|
|
- <div>
|
|
|
|
- <el-form ref="editform" :rules="rules" label-width="120px" :model="formmodel">
|
|
|
|
- <el-row>
|
|
|
|
- <el-col :span="12">
|
|
|
|
- <el-form-item label="设备类型" prop="device_type">
|
|
|
|
- <el-select v-model="formmodel.device_type" placeholder="请选择设备类型" :disabled="deviceTypeDisabled" clearable @change="deviceTypeChange">
|
|
|
|
- <el-option label="护士主机" :value="1" />
|
|
|
|
- <el-option label="医生主机" :value="2" />
|
|
|
|
- <el-option label="门口机" :value="3" />
|
|
|
|
- <el-option label="病床分机" :value="4" />
|
|
|
|
- <el-option label="LED点阵屏" :value="6" />
|
|
|
|
- <el-option label="总线转换盒" :value="11" />
|
|
|
|
- <el-option label="模拟分机" :value="12" />
|
|
|
|
- <el-option label="模拟紧急按钮" :value="13" />
|
|
|
|
- <el-option label="模拟门灯" :value="14" />
|
|
|
|
- <el-option label="信标" :value="16" />
|
|
|
|
- </el-select>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col>
|
|
|
|
- <el-col :span="12">
|
|
|
|
- <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="code">
|
|
|
|
- <el-input v-model="formmodel.code" clearable placeholder="请输入出厂编号" />
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col>
|
|
|
|
- <el-col :span="12">
|
|
|
|
- <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="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="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="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="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="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="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="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="WIFI密码">
|
|
|
|
- <el-input v-model="formmodel.wifi_password" :readonly="wifiHostReadonly" clearable placeholder="请输入WIFI热点密码" />
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col>
|
|
|
|
- </el-row>
|
|
|
|
- </el-form>
|
|
|
|
-
|
|
|
|
- </div>
|
|
|
|
- <div slot="footer" class="dialog-footer">
|
|
|
|
- <el-button @click="formshow = false">取 消</el-button>
|
|
|
|
- <el-button type="primary" @click="handlerFormSubmit('editform')">确 定</el-button>
|
|
|
|
- </div>
|
|
|
|
- </el-dialog>
|
|
|
|
-
|
|
|
|
- <el-dialog title="开启设备编辑" :visible.sync="formshow1" width="30%">
|
|
|
|
- <div>
|
|
|
|
- <el-form ref="editform1" :rules="rules" label-width="120px" :model="formmodel1">
|
|
|
|
- <el-form-item label="管理密码" prop="manager_password">
|
|
|
|
- <el-input v-model="formmodel1.manager_password" clearable type="password" placeholder="请输入管理密码" />
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-form>
|
|
|
|
- </div>
|
|
|
|
- <div slot="footer" class="dialog-footer">
|
|
|
|
- <el-button @click="formshow1 = false">取 消</el-button>
|
|
|
|
- <el-button type="primary" @click.native.prevent="validEditPassword">确 定</el-button>
|
|
|
|
- </div>
|
|
|
|
- </el-dialog>
|
|
|
|
-
|
|
|
|
- </div>
|
|
|
|
-</template>
|
|
|
|
-
|
|
|
|
-<script>
|
|
|
|
-import * as API_Device from '@/api/ncs_device'
|
|
|
|
-export default {
|
|
|
|
-
|
|
|
|
- name: 'Index',
|
|
|
|
- data: function() {
|
|
|
|
- return {
|
|
|
|
- /** 表格数据 */
|
|
|
|
- tableData: [],
|
|
|
|
- imageUrl: null,
|
|
|
|
- createform: {},
|
|
|
|
- /** 表单数据 */
|
|
|
|
- formmodel: {
|
|
|
|
- eth_ip: null
|
|
|
|
- },
|
|
|
|
- formmodel1: {
|
|
|
|
- manager_password: null
|
|
|
|
- },
|
|
|
|
- formmodelAppointRoom: {},
|
|
|
|
- /** 弹出窗口标题信息 */
|
|
|
|
- formtitle: '新增设备',
|
|
|
|
- formshow: false, // 编辑表单显示开关
|
|
|
|
- formshow1: false,
|
|
|
|
- /** 表单校验 */
|
|
|
|
- rules: {
|
|
|
|
- device_type: [
|
|
|
|
- { required: true, message: '设备类型必须选择', trigger: 'blur' }
|
|
|
|
- ],
|
|
|
|
- name: [
|
|
|
|
- { required: true, message: '设备别名必须填写', trigger: 'blur' }
|
|
|
|
- ],
|
|
|
|
- code: [
|
|
|
|
- { required: true, message: '设备出厂编号必须填写', trigger: 'blur' }
|
|
|
|
- ],
|
|
|
|
- model: [
|
|
|
|
- { required: true, message: '设备型号必须填写', trigger: 'blur' }
|
|
|
|
- ],
|
|
|
|
- eth_mac: [
|
|
|
|
- { required: true, message: '设备有线MC地址必须填写', trigger: 'blur' }
|
|
|
|
- ],
|
|
|
|
- eth_ip: [
|
|
|
|
- { required: true, message: '设备有线IP地址必须填写', trigger: 'blur' }
|
|
|
|
- ]
|
|
|
|
- },
|
|
|
|
- rulesAppointRoom: {
|
|
|
|
- appoint_host_id: [
|
|
|
|
- { required: true, message: '请选择护士主机', trigger: 'blur' }
|
|
|
|
- ],
|
|
|
|
- appoint_room_id: [
|
|
|
|
- { required: true, message: '请选择门口机', trigger: 'blur' }
|
|
|
|
- ]
|
|
|
|
- },
|
|
|
|
- /** 列表参数 */
|
|
|
|
- params: {
|
|
|
|
- page_size: 20,
|
|
|
|
- page_no: 1,
|
|
|
|
- fixedCondition: 'part_id=' + this.$store.getters.partId,
|
|
|
|
- sort: 'id',
|
|
|
|
- dir: 'desc'
|
|
|
|
- },
|
|
|
|
- /** 翻页数据*/
|
|
|
|
- pageData: [],
|
|
|
|
- loading: false,
|
|
|
|
- /** 表格选中记录 */
|
|
|
|
- multipleSelection: [],
|
|
|
|
- /** 表单提交指示 0 代表新增 1代表修改 */
|
|
|
|
- editflag: 0,
|
|
|
|
- /** 房间号禁用 **/
|
|
|
|
- roomNumDisabled: false,
|
|
|
|
- /** 床位号只读 **/
|
|
|
|
- bedNameReadonly: false,
|
|
|
|
- /** 上级设备选择禁用 **/
|
|
|
|
- deviceHostingDisabled: false,
|
|
|
|
- /** 房间名称是否可输入 添加门口机设备时需要输入房间名称 **/
|
|
|
|
- roomNumAllowCreate: false,
|
|
|
|
- /** 房间号选择项是否禁用,如果选择门口机,房间号只能填写,不能选择*/
|
|
|
|
- roomOptionDisabed: false,
|
|
|
|
- /** 设备IP地址是否只读 **/
|
|
|
|
- deviceEthIPReadonly: false,
|
|
|
|
- wifiHostReadonly: true,
|
|
|
|
- /** 设备类型选择禁用 编辑时不允许修改设备类型 */
|
|
|
|
- deviceTypeDisabled: false,
|
|
|
|
- nextIp: '',
|
|
|
|
- editLock: this.$store.getters.editLock === 'true'
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- computed: {
|
|
|
|
- tableHeight() {
|
|
|
|
- return this.mainAreaHeight - 130
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- async mounted() {
|
|
|
|
- this.getList()
|
|
|
|
- },
|
|
|
|
- methods: {
|
|
|
|
- /** 新增按钮 */
|
|
|
|
- async handlerAdd() {
|
|
|
|
- // this.nextIp = await API_Device.getNextIP()
|
|
|
|
- this.deviceTypeDisabled = false
|
|
|
|
- this.formmodel = {
|
|
|
|
- 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: ' '
|
|
|
|
- }
|
|
|
|
- if (this.$refs.editform) {
|
|
|
|
- this.$refs.editform.resetFields()
|
|
|
|
- }
|
|
|
|
- this.editflag = 0
|
|
|
|
- this.formtitle = '新增设备'
|
|
|
|
- this.formshow = true
|
|
|
|
- },
|
|
|
|
- /** 编辑按钮 */
|
|
|
|
- async handlerEdit(index, row) {
|
|
|
|
- if (this.$refs.editform) {
|
|
|
|
- this.$refs.editform.resetFields()
|
|
|
|
- }
|
|
|
|
- this.formmodel = { ...row }
|
|
|
|
- this.setFormStatus(this.formmodel.device_type)
|
|
|
|
- this.editflag = 1
|
|
|
|
- this.formtitle = '修改设备'
|
|
|
|
- this.formshow = true
|
|
|
|
- },
|
|
|
|
- /** 表格行选择变化记录选中行数据*/
|
|
|
|
- selectFun: function(val) {
|
|
|
|
- this.multipleSelection = val
|
|
|
|
- },
|
|
|
|
- /** 删除单条数据 */
|
|
|
|
-
|
|
|
|
- handlerDelete(ids) {
|
|
|
|
- this.$confirm('删除操作后数据不可复原,您确定要删除此数据?', '警告', {
|
|
|
|
- confirmButtonText: '确定',
|
|
|
|
- cancelButtonText: '取消',
|
|
|
|
- type: 'warning'
|
|
|
|
- }).then(() => {
|
|
|
|
- API_Device.remove(ids).then(
|
|
|
|
- response => {
|
|
|
|
- this.getList()
|
|
|
|
- this.$message({
|
|
|
|
- type: 'success',
|
|
|
|
- message: '删除成功!'
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- ).catch(response => {
|
|
|
|
- this.$message({
|
|
|
|
- type: 'info',
|
|
|
|
- message: response.message
|
|
|
|
- })
|
|
|
|
- })
|
|
|
|
- }).catch(() => {
|
|
|
|
- this.$message({
|
|
|
|
- type: 'info',
|
|
|
|
- message: '已取消删除'
|
|
|
|
- })
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- /** 批量数据删除处理(删除选中的行) */
|
|
|
|
- batchDelete: function() {
|
|
|
|
- if (this.multipleSelection.length === 0) {
|
|
|
|
- this.$alert('没有选择任何记录!', '系统提示', {
|
|
|
|
- confirmButtonText: '确定',
|
|
|
|
- callback: action => {
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- } else {
|
|
|
|
- const ids = []
|
|
|
|
- this.multipleSelection.forEach(function(item) {
|
|
|
|
- ids.push(item.id)
|
|
|
|
- })
|
|
|
|
- this.handlerDelete(ids.join(','))
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- /** 分页大小发生改变 */
|
|
|
|
- handlePageSizeChange(size) {
|
|
|
|
- this.params.page_size = size
|
|
|
|
- this.getList()
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
- /** 分页页数发生改变 */
|
|
|
|
- handlePageCurrentChange(page) {
|
|
|
|
- this.params.page_no = page
|
|
|
|
- this.getList()
|
|
|
|
- },
|
|
|
|
- /** 加载列表数据 */
|
|
|
|
- getList() {
|
|
|
|
- this.loading = true
|
|
|
|
- const param = this.MixinClone(this.params)
|
|
|
|
- API_Device.getList(param).then(response => {
|
|
|
|
- this.loading = false
|
|
|
|
- this.tableData = [...response.data]
|
|
|
|
- this.pageData = {
|
|
|
|
- page_no: response.page_no,
|
|
|
|
- page_size: response.page_size,
|
|
|
|
- data_total: response.data_total
|
|
|
|
- }
|
|
|
|
- }).catch(() => {
|
|
|
|
- this.loading = false
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
- /** 新增 提交表单 */
|
|
|
|
- handlerFormSubmit(formName) {
|
|
|
|
- this.$refs[formName].validate((valid) => {
|
|
|
|
- if (valid) {
|
|
|
|
- /** 新增 */
|
|
|
|
- if (this.editflag === 0) {
|
|
|
|
- this.formmodel.partid = this.$store.getters.partId
|
|
|
|
- API_Device.add(this.formmodel).then(() => {
|
|
|
|
- this.formshow = false
|
|
|
|
- this.$message.success('保存成功!')
|
|
|
|
- this.getList()
|
|
|
|
- })
|
|
|
|
- } else {
|
|
|
|
- /** 修改 */
|
|
|
|
- API_Device.update(this.formmodel.id, this.formmodel).then(() => {
|
|
|
|
- this.formshow = false
|
|
|
|
- this.$message.success('修改成功!')
|
|
|
|
- this.getList()
|
|
|
|
- }).catch(response => {
|
|
|
|
- this.formshow = false
|
|
|
|
- this.$message.warning(response.message)
|
|
|
|
- this.getList()
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- formatterDeviceType(row, column, cellValue) {
|
|
|
|
- switch (cellValue) {
|
|
|
|
- case 1:
|
|
|
|
- return '护士主机'
|
|
|
|
- case 2:
|
|
|
|
- return '医生主机'
|
|
|
|
- case 3:
|
|
|
|
- return '门口机'
|
|
|
|
- case 4:
|
|
|
|
- return '病床分机'
|
|
|
|
- case 6:
|
|
|
|
- return 'LED点阵屏'
|
|
|
|
- case 11:
|
|
|
|
- return '总线转换盒'
|
|
|
|
- case 12:
|
|
|
|
- return '模拟分机'
|
|
|
|
- case 13:
|
|
|
|
- return '模拟紧急按钮'
|
|
|
|
- case 14:
|
|
|
|
- return '模拟门灯'
|
|
|
|
- case 16:
|
|
|
|
- return '信标'
|
|
|
|
- case 17:
|
|
|
|
- return '看板'
|
|
|
|
- default:
|
|
|
|
- return '未知设备'
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- formatterStatus(row, column, cellValue) {
|
|
|
|
- return cellValue === 1 ? '<span class="text">已启用</span>' : '未启用'
|
|
|
|
- },
|
|
|
|
- formatterHosting(row, column, cellValue) {
|
|
|
|
- return row.device_host_name
|
|
|
|
- },
|
|
|
|
- /** 处理搜索 */
|
|
|
|
- handlerSearch(keywords) {
|
|
|
|
- this.params.query = keywords
|
|
|
|
- this.getList()
|
|
|
|
- },
|
|
|
|
- /** 处理字段排序 */
|
|
|
|
- tableSort(column) {
|
|
|
|
- if (column.order !== null) {
|
|
|
|
- this.params.sort = column.prop
|
|
|
|
- this.params.dir = column.order === 'ascending' ? 'asc' : 'desc'
|
|
|
|
- } else {
|
|
|
|
- this.params.sort = null
|
|
|
|
- this.params.dir = null
|
|
|
|
- }
|
|
|
|
- this.getList()
|
|
|
|
- },
|
|
|
|
- deviceTypeChange(value) {
|
|
|
|
- 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.eth_ip = this.nextIp
|
|
|
|
- this.formmodel.eth_mac = null
|
|
|
|
- this.wifiHostReadonly = true
|
|
|
|
- if (value === 1) { // 护士主机
|
|
|
|
- this.roomNumDisabled = true
|
|
|
|
- this.bedNameReadonly = true
|
|
|
|
- this.deviceHostingDisabled = true
|
|
|
|
- } else if (value === 2) {
|
|
|
|
- this.roomNumDisabled = true
|
|
|
|
- this.bedNameReadonly = true
|
|
|
|
- } else if (value === 3) {
|
|
|
|
- this.bedNameReadonly = true
|
|
|
|
- this.roomNumAllowCreate = true // 门口机需要填写房间名称
|
|
|
|
- this.roomOptionDisabed = true
|
|
|
|
- this.wifiHostReadonly = false
|
|
|
|
- } else if (value === 4) { // 病床分机
|
|
|
|
- } else if (value === 6) {
|
|
|
|
- this.roomNumDisabled = true
|
|
|
|
- this.bedNameReadonly = true
|
|
|
|
- } else if (value === 11) {
|
|
|
|
- this.rules.code[0].required = false
|
|
|
|
- this.roomNumDisabled = true
|
|
|
|
- this.bedNameReadonly = true
|
|
|
|
- } else if (value === 12) {
|
|
|
|
- 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
|
|
|
|
- } else if (value === 13) {
|
|
|
|
- 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
|
|
|
|
- } else if (value === 14) {
|
|
|
|
- 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
|
|
|
|
- } else if (value === 16) {
|
|
|
|
- this.rules.eth_mac[0].required = true
|
|
|
|
- this.rules.code[0].required = false
|
|
|
|
- this.deviceEthIPReadonly = true
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- setFormStatus(value) {
|
|
|
|
- this.deviceTypeDisabled = 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.wifiHostReadonly = true
|
|
|
|
- if (value === 1) { // 护士主机
|
|
|
|
- this.roomNumDisabled = true
|
|
|
|
- this.bedNameReadonly = true
|
|
|
|
- this.deviceHostingDisabled = true
|
|
|
|
- } else if (value === 2) {
|
|
|
|
- this.roomNumDisabled = true
|
|
|
|
- this.bedNameReadonly = true
|
|
|
|
- } else if (value === 3) {
|
|
|
|
- this.bedNameReadonly = true
|
|
|
|
- this.roomNumAllowCreate = true // 门口机需要填写房间名称
|
|
|
|
- this.roomOptionDisabed = true
|
|
|
|
- this.wifiHostReadonly = false
|
|
|
|
- } else if (value === 4) { // 病床分机
|
|
|
|
- } else if (value === 6) {
|
|
|
|
- this.roomNumDisabled = true
|
|
|
|
- this.bedNameReadonly = true
|
|
|
|
- } else if (value === 11) {
|
|
|
|
- this.rules.code[0].required = false
|
|
|
|
- this.roomNumDisabled = true
|
|
|
|
- this.bedNameReadonly = true
|
|
|
|
- } else if (value === 12) {
|
|
|
|
- this.rules.eth_mac[0].required = false
|
|
|
|
- this.rules.eth_ip[0].required = false
|
|
|
|
- this.deviceEthIPReadonly = true
|
|
|
|
- } else if (value === 13) {
|
|
|
|
- this.rules.eth_mac[0].required = false
|
|
|
|
- this.rules.eth_ip[0].required = false
|
|
|
|
- this.deviceEthIPReadonly = true
|
|
|
|
- this.bedNameReadonly = true
|
|
|
|
- } else if (value === 14) {
|
|
|
|
- this.rules.eth_mac[0].required = false
|
|
|
|
- this.rules.eth_ip[0].required = false
|
|
|
|
- this.deviceEthIPReadonly = true
|
|
|
|
- this.bedNameReadonly = true
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- editLockChange(val) {
|
|
|
|
- this.formshow1 = true
|
|
|
|
- this.editLock = false
|
|
|
|
- },
|
|
|
|
- validEditPassword() {
|
|
|
|
- if (this.formmodel1.manager_password === 'wdkl2020') {
|
|
|
|
- this.formshow1 = false
|
|
|
|
- this.editLock = true
|
|
|
|
- this.$store.dispatch('user/toggleEditLock', true)
|
|
|
|
- } else {
|
|
|
|
- this.$message.error('密码错误!')
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-</script>
|
|
|
|
-
|
|
|
|
-<style scoped type="text/scss">
|
|
|
|
- /deep/ .avatar-uploader .el-upload {
|
|
|
|
- border: 1px dashed #d9d9d9;
|
|
|
|
- border-radius: 6px;
|
|
|
|
- cursor: pointer;
|
|
|
|
- position: relative;
|
|
|
|
- overflow: hidden;
|
|
|
|
- }
|
|
|
|
- .avatar-uploader .el-upload:hover {
|
|
|
|
- border-color: #409EFF;
|
|
|
|
- }
|
|
|
|
- .avatar-uploader-icon {
|
|
|
|
- font-size: 28px;
|
|
|
|
- color: #8c939d;
|
|
|
|
- width: 178px;
|
|
|
|
- height: 178px;
|
|
|
|
- line-height: 178px;
|
|
|
|
- text-align: center;
|
|
|
|
- }
|
|
|
|
- .avatar {
|
|
|
|
- width: 178px;
|
|
|
|
- height: 178px;
|
|
|
|
- display: block;
|
|
|
|
- }
|
|
|
|
- .green-text{
|
|
|
|
- color: green;
|
|
|
|
- }
|
|
|
|
- .red-text{
|
|
|
|
- color:red;
|
|
|
|
- }
|
|
|
|
-</style>
|
|
|