eight
2025-04-15 589bcdb26f8e9d3e0d5ef46d27acc901c96d50ea
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<script lang="ts" setup>
import { RoomApi, RoomVO } from '@/api/ecg/room'
import { QueueApi } from '@/api/ecg/queue'
import {PropType} from "vue";
import {DICT_TYPE, getIntDictOptions} from "@/utils/dict";
import {useCheckTypeStore} from "@/store/modules/checkType";
import {getCheckTypeName} from "../../../utils/checkTypeFormatter";
const emit = defineEmits(['refresh'])
 
defineComponent({
  name: 'RoomStatus'
})
 
const  props = defineProps({
  title: {
    type: String,
    required: true
  },
  bedList: {
    type: Array as PropType<RoomVO[]>,
    required: true
  }
})
 
const checkTypeStore = useCheckTypeStore();
 
const openBed = async (item) => {
    await QueueApi.bedOpen(item)
    emit('refresh')
}
 
const closeBed = async (item) => {
    await QueueApi.bedClose(item)
    emit('refresh')
}
 
/** 初始化 **/
onMounted(() => {
})
 
</script>
 
<template>
  <el-card style="width: 200px" shadow="hover" >
    <template #header>{{title}}</template>
    <div v-for="(bedItem, index) in bedList" :key="index">
      <div class="deskwarp">
        <img
            v-if="bedItem.status === 0"
            src="@/assets/room/close.jpg"
            style="width: 100%"
             @click = openBed(bedItem)
            alt="工位已关闭"
        />
        <img
            v-else-if="bedItem.status === 10"
            src="@/assets/room/open.jpg"
            style="width: 100%"
             @click = closeBed(bedItem)
            alt="工位开放中"
        />
        <img v-else-if="bedItem.status === 20 || bedItem.status === 30"
            src="@/assets/room/doctor.png"
            style="width: 100%"
        />
        {{bedItem.bedNo}} {{bedItem.docName}} {{bedItem.status === 30?"-暂停":""}}
        <div v-for="(checkType, subIndex) in bedItem.checkTypes" :key="subIndex">
          {{getCheckTypeName(checkType)}}
        </div>
        <div>
          {{bedItem.opType === 1?"领用":""}}
          {{bedItem.opType === 2?"安装":""}}
        </div>
        <el-divider/>
      </div>
    </div>
  </el-card>
</template>
 
<style scoped lang="scss">
.card-title {
  font-size: 14px;
  font-weight: 600;
 
  &::before {
    position: relative;
    top: 8px;
    left: -5px;
    display: inline-block;
    width: 3px;
    height: 14px;
    //background-color: #105cfb;
    background: var(--el-color-primary);
    border-radius: 5px;
    content: '';
    transform: translateY(-50%);
  }
}
 
.deskwarp {
  display: flex;
  flex-direction: column;
  align-items: center;
}
 
</style>