|
@@ -1,9 +1,11 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
- <el-card style="margin: 15px">
|
|
|
+
|
|
|
<el-form ref="editform" label-width="80px">
|
|
|
- <fieldset class="margin-top-sm">
|
|
|
- <legend>{{ watchDeviceFrame }}</legend>
|
|
|
+ <el-tabs v-model="activeName" style="margin:0px;" type="border-card">
|
|
|
+ <el-tab-pane label="所有房间" name="frameInfo">
|
|
|
+<!-- <fieldset class="margin-top-sm">-->
|
|
|
+<!-- <legend>{{ watchDeviceFrame }}</legend>-->
|
|
|
<el-row v-if="rooms.length > 1" :gutter="20" type="flex">
|
|
|
<el-col v-for="(item,index) in rooms" :key="index" :xs="8" :sm="8" :md="6" :lg="6" :xl="6">
|
|
|
<el-card class="box-card">
|
|
@@ -11,7 +13,7 @@
|
|
|
<el-checkbox v-if="uiVersion === 1" v-model="item.checked" @change="handleCheckboxChanged(item)"><svg-icon icon-class="sickroom" style="color: #9aaabf;margin-right: 5px" /><span>{{ item.name }}</span></el-checkbox>
|
|
|
<span v-if="uiVersion !== 1"><svg-icon icon-class="sickroom" style="color: #9aaabf;margin-right: 5px" /><span>{{ item.name }}</span></span>
|
|
|
<el-checkbox v-model="item.allCkeck" style="float: right" :indeterminate="item.indeterminate" @change="(checked)=>{handleCheckAll(checked,item)}">
|
|
|
- {{ this.$t('action.choiceAll') }}</el-checkbox>
|
|
|
+ {{ $t('action.choiceAll') }}</el-checkbox>
|
|
|
</div>
|
|
|
<div v-for="(bed,_index) in item.children" :key="_index" class="text item">
|
|
|
<el-checkbox v-if="roleName !== '护士组长'" v-model="bed.checked" @change="handleCheckboxChanged(item)"><svg-icon icon-class="bed" style="color: #9aaabf;margin-right: 5px" />
|
|
@@ -33,7 +35,7 @@
|
|
|
<div v-if="roleName !== '护士组长'" style="margin: 10px;">
|
|
|
<el-checkbox v-if="uiVersion === 1" v-model="rooms[0].checked" @change="handleCheckboxChanged(rooms[0])"><svg-icon icon-class="sickroom" style="color: #9aaabf;margin-right: 5px" /><span>{{ rooms[0].name }}</span></el-checkbox>
|
|
|
<span v-if="uiVersion !== 1"><svg-icon icon-class="sickroom" style="color: #9aaabf;margin-right: 5px" /><span>{{ rooms[0].name }}</span></span>
|
|
|
- <el-checkbox v-model="rooms[0].allCkeck" style="margin-left: 30px;" :indeterminate="rooms[0].indeterminate" @change="(checked)=>{handleCheckAll(checked,rooms[0])}">{{ this.$t('action.choiceAll') }}</el-checkbox>
|
|
|
+ <el-checkbox v-model="rooms[0].allCkeck" style="margin-left: 30px;" :indeterminate="rooms[0].indeterminate" @change="(checked)=>{handleCheckAll(checked,rooms[0])}">{{ $t('action.choiceAll') }}</el-checkbox>
|
|
|
</div>
|
|
|
<el-row>
|
|
|
<el-col v-for="(bed,_index) in rooms[0].children" :key="_index" :xs="8" :sm="8" :md="6" :lg="6" :xl="6">
|
|
@@ -52,17 +54,44 @@
|
|
|
</div>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
- </fieldset>
|
|
|
+<!-- </fieldset>-->
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane v-for="(group,idx) in roomGroup" v-if="group[0]!=='null'" :key="idx" :label="group[0]" :name="'zone-'+idx">
|
|
|
+ <el-row v-if="group[1].length > 1" :gutter="20" type="flex">
|
|
|
+ <el-col v-for="(item,index) in group[1]" :key="index" :xs="8" :sm="8" :md="6" :lg="6" :xl="6">
|
|
|
+ <el-card class="box-card">
|
|
|
+ <div v-if="roleName !== '护士组长'" slot="header" class="clearfix">
|
|
|
+ <el-checkbox v-if="uiVersion === 1" v-model="item.checked" @change="handleCheckboxChanged(item)"><svg-icon icon-class="sickroom" style="color: #9aaabf;margin-right: 5px" /><span>{{ item.name }}</span></el-checkbox>
|
|
|
+ <span v-if="uiVersion !== 1"><svg-icon icon-class="sickroom" style="color: #9aaabf;margin-right: 5px" /><span>{{ item.name }}</span></span>
|
|
|
+ <el-checkbox v-model="item.allCkeck" style="float: right" :indeterminate="item.indeterminate" @change="(checked)=>{handleCheckAll(checked,item)}">
|
|
|
+ {{ $t('action.choiceAll') }}</el-checkbox>
|
|
|
+ </div>
|
|
|
+ <div v-for="(bed,_index) in item.children" :key="_index" class="text item">
|
|
|
+ <el-checkbox v-if="roleName !== '护士组长'" v-model="bed.checked" @change="handleCheckboxChanged(item)"><svg-icon icon-class="bed" style="color: #9aaabf;margin-right: 5px" />
|
|
|
+ <span v-if="bed.device_id && !bed.checked" style="color: #13ce66">{{ bed.full_name }} {{ bed.clerk_name }}</span>
|
|
|
+ <span v-else>{{ bed.full_name }}</span>
|
|
|
+ </el-checkbox>
|
|
|
+ <div v-if="roleName === '护士组长'">
|
|
|
+ <svg-icon icon-class="bed" style="color: #9aaabf;margin-right: 5px" />
|
|
|
+ <span v-if="bed.device_id && !bed.checked" style="color: #13ce66">{{ bed.full_name }} {{ bed.clerk_name }}</span>
|
|
|
+ <span v-else>{{ bed.full_name }}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-card>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-tab-pane>
|
|
|
+ </el-tabs>
|
|
|
<el-form-item v-if="roleName !== '护士组长'" align="center" class="margin-top-sm">
|
|
|
- <el-button type="success" @click="onSubmit">{{ this.$t('action.choiceAll') }}</el-button>
|
|
|
- <el-button type="primary" @click="onQK">{{ this.$t('action.deleteSettings') }}</el-button>
|
|
|
- <el-button @click="back">{{ this.$t('action.back') }}</el-button>
|
|
|
+ <el-button type="success" @click="onSubmit">{{ $t('action.saveSettings') }}</el-button>
|
|
|
+ <el-button type="primary" @click="onQK">{{ $t('action.deleteSettings') }}</el-button>
|
|
|
+ <el-button @click="back">{{ $t('action.back') }}</el-button>
|
|
|
</el-form-item>
|
|
|
<el-form-item v-else>
|
|
|
- <div style="text-align:center;color: #13ce66">{{ this.$t('watch.nurseManageFrame') }}</div>
|
|
|
+ <div style="text-align:center;color: #13ce66">{{ $t('watch.nurseManageFrame') }}</div>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
- </el-card>
|
|
|
+
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -104,9 +133,12 @@ export default {
|
|
|
/** 空间结构房间 **/
|
|
|
rooms: [],
|
|
|
checkList: [],
|
|
|
+ /** 空间结构分区 **/
|
|
|
+ roomGroup:[],
|
|
|
checkDate: [],
|
|
|
uiVersion: null,
|
|
|
- watchDeviceFrame: this.$t('watch.keywords'),
|
|
|
+ watchDeviceFrame: this.$t('watch.watchDeviceFrame'),
|
|
|
+ activeName:'frameInfo'
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
@@ -141,15 +173,24 @@ export default {
|
|
|
// API_hospitalFrame.getFrameByType(this.$store.getters.partId, this.deviceId, this.roleId).then(res => {
|
|
|
// _this.rooms = _this.filterGroupFrames(res)
|
|
|
// })
|
|
|
- if (this.roleName === '护士组长') {
|
|
|
- API_hospitalFrame.getFrameByRoleGroupId(this.$store.getters.partId, this.memberId).then(res => {
|
|
|
- _this.rooms = _this.filterGroupFrames(res)
|
|
|
- })
|
|
|
- } else {
|
|
|
- API_hospitalFrame.getFrameByRoleId(this.$store.getters.partId, this.roleId).then(res => {
|
|
|
+ const groupBy = (arr, func) =>
|
|
|
+ arr.map(typeof func === 'function' ? func : val => val[func]).reduce((acc, val, i) => {
|
|
|
+ acc[val] = (acc[val] || []).concat(arr[i])
|
|
|
+ return acc
|
|
|
+ }, {})
|
|
|
+
|
|
|
+ // if () {
|
|
|
+ API_hospitalFrame.getFrameByRoleGroupId(this.$store.getters.partId, this.roleName === '护士组长'?this.memberId:this.roleId).then(res => {
|
|
|
_this.rooms = _this.filterGroupFrames(res)
|
|
|
+ const room_group = groupBy(_this.rooms, item => item.group_name)
|
|
|
+ _this.roomGroup = Object.entries(room_group)
|
|
|
+ console.log(_this.roomGroup)
|
|
|
})
|
|
|
- }
|
|
|
+ // } else {
|
|
|
+ // API_hospitalFrame.getFrameByRoleId(this.$store.getters.partId, this.roleId).then(res => {
|
|
|
+ // _this.rooms = _this.filterGroupFrames(res)
|
|
|
+ // })
|
|
|
+ // }
|
|
|
},
|
|
|
/** 递归筛选被选空间节点 */
|
|
|
filterGroupFrames(frames) {
|
|
@@ -172,7 +213,7 @@ export default {
|
|
|
countAllFrame(frame) {
|
|
|
const _list = []
|
|
|
if (!Array.isArray(frame)) {
|
|
|
- _list.push(frame)
|
|
|
+ // _list.push(frame)
|
|
|
if (frame.children) _list.push(...this.countAllFrame(frame.children))
|
|
|
} else {
|
|
|
frame.forEach(item => {
|