|
@@ -2,12 +2,12 @@
|
|
|
<el-container style="height:850px; border: 1px solid #eee">
|
|
|
<el-aside width="25%" style="background-color: rgb(255,255,255);border: 1px solid #eee">
|
|
|
<div>
|
|
|
- <el-input v-model="searchDeviceStr" placeholder="输入搜索" clearable @change="clickSearch">
|
|
|
- <el-select v-model="frameType" slot="prepend" placeholder="请选择设备位置级别" @change="changeFrameType">
|
|
|
- <el-option label="全部" value="all"></el-option>
|
|
|
- <el-option label="科室" value="part"></el-option>
|
|
|
- <el-option label="房间" value="room"></el-option>
|
|
|
- <el-option label="床位" value="bed"></el-option>
|
|
|
+ <el-input v-model="searchDeviceStr" :placeholder="$t('action.search')" clearable @change="clickSearch">
|
|
|
+ <el-select v-model="frameType" slot="prepend" :placeholder="$t('deviceManage.deviceLocationLevel')" @change="changeFrameType">
|
|
|
+ <el-option :label="$t('action.all')" value="all"></el-option>
|
|
|
+ <el-option :label="$t('frameManage.part')" value="part"></el-option>
|
|
|
+ <el-option :label="$t('frameManage.room2')" value="room"></el-option>
|
|
|
+ <el-option :label="$t('frameManage.bed2')" value="bed"></el-option>
|
|
|
</el-select>
|
|
|
<el-button slot="append" size="mini" icon="el-icon-search" @click="clickSearch"></el-button>
|
|
|
</el-input>
|
|
@@ -22,13 +22,14 @@
|
|
|
<el-container>
|
|
|
<el-header style="font-size: 12px; margin-top: 10px;">
|
|
|
<div style="text-align: left; float: left">
|
|
|
- <el-button type="success" @click="onekeySave" :loading="isSave">一键分配</el-button>
|
|
|
- <el-button type="danger" plain @click="onekeyDel">一键重置</el-button>
|
|
|
+ <el-button type="success" @click="onekeySave" :loading="isSave">{{ $t('deviceManage.assignment') }}</el-button>
|
|
|
+ <el-button type="danger" plain @click="onekeyDel">{{ $t('deviceManage.reset') }}</el-button>
|
|
|
</div>
|
|
|
<div style="text-align: right">
|
|
|
- <el-switch v-model="openType" active-text="折叠显示" inactive-text="卡片显示" style="margin-right: 20px;"></el-switch>
|
|
|
- <el-button type="success" icon="el-icon-check" :loading="isSave" :disabled="needUpdateList.length === 0" @click="saveUpdate">保存</el-button>
|
|
|
- <el-button icon="el-icon-close" :disabled="needUpdateList.length === 0" @click="canle">取消</el-button>
|
|
|
+ <el-switch v-model="openType" :active-text="$t('deviceManage.collapse')" :inactive-text="$t('deviceManage.card')" style="margin-right: 20px;"></el-switch>
|
|
|
+ <el-button type="success" icon="el-icon-check" :loading="isSave" :disabled="needUpdateList.length === 0" @click="saveUpdate">
|
|
|
+ {{ $t('action.save') }}</el-button>
|
|
|
+ <el-button icon="el-icon-close" :disabled="needUpdateList.length === 0" @click="canle">{{ $t('action.cancel') }}</el-button>
|
|
|
</div>
|
|
|
</el-header>
|
|
|
|
|
@@ -38,7 +39,7 @@
|
|
|
<el-col :span="24">
|
|
|
<el-card class="box-card" shadow="hover" :body-style="{ padding: '0px', margin: '0px' }">
|
|
|
<div slot="header" class="clearfix">
|
|
|
- <span>{{ framesAndDevices.full_name }}-{{ framesAndDevices.device_size }}台设备</span>
|
|
|
+ <span>{{ framesAndDevices.full_name }}-{{ framesAndDevices.device_size }}{{ $t('deviceManage.devices') }}</span>
|
|
|
<!-- <el-button style="float: right; padding: 3px 0" type="text">操作按钮</el-button>-->
|
|
|
</div>
|
|
|
<div :class="boolPart ? 'mybg' : ''" style="width: 100%; height: 100%; padding: 15px 0px 10px 0px; min-height: 80px;">
|
|
@@ -67,7 +68,8 @@
|
|
|
<div slot="title" style="width: 100%;min-height: 50px;">
|
|
|
<div style="font-size: 15px;float: left;width: 10%;" :class="boolRoom ? 'mybg' : ''">{{ item.full_name }}</div>
|
|
|
<div :class="boolRoom ? 'mybg' : ''" style="margin: 0;float: left;width: 85%;">
|
|
|
- <div v-if="item.device_dos.length === 0" style="float: left;height: 100%"><el-tag effect="plain" type="info">房间无设备</el-tag></div>
|
|
|
+ <div v-if="item.device_dos.length === 0" style="float: left;height: 100%"><el-tag effect="plain" type="info">
|
|
|
+ {{ $t('deviceManage.roomNoDevice') }}</el-tag></div>
|
|
|
<draggable class="selected-list" v-model="item.device_dos" tag="div" :options="dragOptions" :disabled="boolRoom" @start="roomMove" @end="onEnd" @remove="otherRemove">
|
|
|
<el-tag v-for="(t, i) in item.device_dos" :key="i" :type="getColor(i)" style="margin-bottom: 5px;"> {{ t.name }}</el-tag>
|
|
|
</draggable>
|
|
@@ -78,7 +80,8 @@
|
|
|
<div class="clearfix" :class="boolBed ? 'mybg' : ''" style="margin: 0;padding: 15px 0px 10px 0px">
|
|
|
<div style="font-size: 15px;float: left;width: 10%;margin-left: 5px;">{{ t.full_name }}</div>
|
|
|
<div style="margin: 0;float: left;width: 85%;">
|
|
|
- <div v-if="t.device_dos.length === 0" style="float: left;height: 100%"><el-tag effect="plain" type="info">床位无设备</el-tag></div>
|
|
|
+ <div v-if="t.device_dos.length === 0" style="float: left;height: 100%"><el-tag effect="plain" type="info">
|
|
|
+ {{ $t('deviceManage.bedNoDevice') }}</el-tag></div>
|
|
|
<draggable class="selected-list" tag="div" v-model="t.device_dos" :options="dragOptions" :disabled="boolBed" style="height: 100%" @start="bedMove" @end="onEnd" @remove="otherRemove">
|
|
|
<el-tag v-for="(tt, ii) in t.device_dos" :key="ii" :type="getColor(ii)"> {{ tt.name }}</el-tag>
|
|
|
</draggable>
|
|
@@ -96,7 +99,8 @@
|
|
|
<div slot="header" :class="boolRoom ? 'mybg' : ''" class="clearfix" style="width: 100%;min-height: 40px;">
|
|
|
<div style="font-size: 15px;float: left;width: 10%;margin-top: 5px;">{{ item.full_name }}</div>
|
|
|
<div style="margin: 0;float: left;width: 85%;">
|
|
|
- <div v-if="item.device_dos.length === 0" style="float: left;height: 100%"><el-tag effect="plain" type="info">房间无设备</el-tag></div>
|
|
|
+ <div v-if="item.device_dos.length === 0" style="float: left;height: 100%"><el-tag effect="plain" type="info">
|
|
|
+ {{ $t('deviceManage.roomNoDevice') }}</el-tag></div>
|
|
|
<draggable class="selected-list" v-model="item.device_dos" tag="div" :options="dragOptions" :disabled="boolRoom" @start="roomMove" @end="onEnd" @remove="otherRemove">
|
|
|
<el-tag v-for="(t, i) in item.device_dos" :key="i" :type="getColor(i)" style="margin-bottom: 5px;"> {{ t.name }}</el-tag>
|
|
|
</draggable>
|
|
@@ -109,7 +113,8 @@
|
|
|
<div class="clearfix" :class="boolBed ? 'mybg' : ''" style="margin: 0;padding: 15px 0 10px 0;min-height: 40px">
|
|
|
<div style="font-size: 15px;float: left;width: 10%;margin: 5px">{{ t.full_name }}</div>
|
|
|
<div style="margin: 0;float: left;width: 85%;">
|
|
|
- <div v-if="t.device_dos.length === 0" style="float: left;height: 100%"><el-tag effect="plain" type="info">床位无设备</el-tag></div>
|
|
|
+ <div v-if="t.device_dos.length === 0" style="float: left;height: 100%"><el-tag effect="plain" type="info">
|
|
|
+ {{ $t('deviceManage.bedNoDevice') }}</el-tag></div>
|
|
|
<draggable class="selected-list" tag="div" v-model="t.device_dos" :options="dragOptions" :disabled="boolBed" style="height: 100%" @start="bedMove" @end="onEnd" @remove="otherRemove">
|
|
|
<el-tag v-for="(tt, ii) in t.device_dos" :key="ii" :type="getColor(ii)"> {{ tt.name }}</el-tag>
|
|
|
</draggable>
|
|
@@ -390,7 +395,7 @@ export default {
|
|
|
this.isSave = false
|
|
|
this.API_getDeviceList()
|
|
|
this.API_getFrameAndDevice()
|
|
|
- this.$message.success('保存成功!')
|
|
|
+ this.$message.success(this.$t('action.saveSuccess'))
|
|
|
})
|
|
|
},
|
|
|
// 取消
|
|
@@ -406,7 +411,7 @@ export default {
|
|
|
this.isSave = true
|
|
|
if (this.deviceList.length === 0) {
|
|
|
this.isSave = false
|
|
|
- this.$message.info('没有空余分配的设备!')
|
|
|
+ this.$message.info(this.$t('deviceManage.assignmentMsg'))
|
|
|
return
|
|
|
}
|
|
|
this.canle()
|
|
@@ -430,7 +435,7 @@ export default {
|
|
|
// }
|
|
|
if (this.framesAndDevices.device_size > this.framesAndDevices.device_dos.length) {
|
|
|
this.isSave = false
|
|
|
- this.$message.info('房间及床位有设备,只能自动分配科室级设备!')
|
|
|
+ this.$message.info(this.$t('deviceManage.assignmentMsg2'))
|
|
|
// let item
|
|
|
// while(i--){
|
|
|
// item = this.deviceList[i]
|
|
@@ -443,7 +448,7 @@ export default {
|
|
|
// }
|
|
|
return
|
|
|
}
|
|
|
- this.$message.info('开始自动分配!')
|
|
|
+ this.$message.info(this.$t('deviceManage.assignmentMsg3'))
|
|
|
const roomList = this.returnRoomList()
|
|
|
const groupBy = (arr, func) =>
|
|
|
arr.map(typeof func === 'function' ? func : val => val[func]).reduce((acc, val, i) => {
|
|
@@ -479,23 +484,23 @@ export default {
|
|
|
})
|
|
|
this.isSave = false
|
|
|
this.changeDeviceList = this.deviceList
|
|
|
- this.$alert('自动分配已完成,全级别设备需手动分配,分配完成后请点击【保存】!', '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
+ this.$alert(this.$t('deviceManage.assignmentMsg4'), this.$t('action.prompt'), {
|
|
|
+ confirmButtonText: this.$t('action.yes'),
|
|
|
callback: action => {
|
|
|
- console.log('确定')
|
|
|
+ console.log(this.$t('action.yes'))
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
// 一键重置
|
|
|
onekeyDel() {
|
|
|
const _this = this
|
|
|
- this.$confirm('确定要重置所有设备吗?', this.$t('action.tips'), {
|
|
|
+ this.$confirm(this.$t('deviceManage.resetMsg'), this.$t('action.tips'), {
|
|
|
confirmButtonText: this.$t('action.yes'),
|
|
|
cancelButtonText: this.$t('action.cancel'),
|
|
|
type: 'warning'
|
|
|
}).then(() => {
|
|
|
delAllDeviceFrame(_this.$route.params.id, _this.$route.params.parent_id).then(res => {
|
|
|
- _this.$message.success('已成功重置!')
|
|
|
+ _this.$message.success(this.$t('deviceManage.resetMsg2'))
|
|
|
_this.canle()
|
|
|
_this.API_getDeviceList()
|
|
|
_this.API_getFrameAndDevice()
|