From 94f16f6a5770c10fce8267e9e851dfc35d8dfbc2 Mon Sep 17 00:00:00 2001
From: chenyc <501753378@qq.com>
Date: 星期五, 26 八月 2022 15:42:47 +0800
Subject: [PATCH] 新增读卡器功能
---
src/views/home/index.vue | 416 +++++++++++++++++++++--------------------------------------
1 files changed, 150 insertions(+), 266 deletions(-)
diff --git a/src/views/home/index.vue b/src/views/home/index.vue
index 145cc96..a612b9a 100644
--- a/src/views/home/index.vue
+++ b/src/views/home/index.vue
@@ -6,10 +6,10 @@
import { reactive, computed, toRefs, onMounted, ref, watch } from "vue"
import { sendPationCode, sendPationSet } from '../../samples/sockteStomp'
import { formatDate } from '@/utils/formatTime'
-import logo from '@/assets/LOGO.png'
import state1 from '@/assets/state1.png'
import state2 from '@/assets/state2.png'
import state3 from '@/assets/state3.png'
+import logo from '@/assets/LOGO.png'
export default {
setup() {
@@ -21,6 +21,7 @@
const AudioRef = ref()
const AudioRef2 = ref()
const AudioRef3 = ref()
+ const AudioRef4=ref()
const isLink = computed(() => {
return !sockte.isLink
})
@@ -32,6 +33,9 @@
})
const xyjInfo = computed(() => {
return sockte.xyjSockte
+ })
+ const dkqInfo = computed(() => {
+ return sockte.dkqSockte
})
const patientInfo = computed(() => {
return patientInfoStore().patientInfo
@@ -52,6 +56,7 @@
}
else {
clearInterval(timer)
+ const datetimeCON=patientInfoStore().patientInfo.datetime
patientInfoStore().setpatientInfo({
id: 0,
code: '',
@@ -59,7 +64,8 @@
patientAvatarIcon: '',
deviceCode: '',
hemoCode: '',
- pureWeight: ''
+ pureWeight: '',
+ datetime:datetimeCON
})
state.clockNum = patientInfoStore().viewNumber
sockteStore().setweightSockte({
@@ -87,10 +93,10 @@
console.log(timer)
}
const state = reactive({
+ logo:logo,
state1:state1,
state2:state2,
state3:state3,
- logo:logo,
dialogVisible: false,
isActive: false,
inputCode: "",
@@ -103,9 +109,8 @@
mai_bu: ""//脉搏
})
watch(
- () => patientInfo.value.id,
+ () => patientInfo.value.datetime,
() => {
- console.log('患者变化了', patientInfo)
if (patientInfo.value.id !== 0) {
AudioRef.value.play();
sockteStore().setweightSockte({
@@ -124,6 +129,11 @@
})
settime()
+ }else{
+ if(patientInfo.value.name===''){
+ AudioRef4.value.play();
+ }
+
}
}
)
@@ -186,6 +196,17 @@
}
}
)
+ watch(
+ () => dkqInfo.value.resultTime,
+ () => {
+ console.log(dkqInfo.value,'读卡器')
+ if (dkqInfo.value.result !== ''&&dkqInfo.value.result !== undefined) {
+ const code=dkqInfo.value.result.split(",")[0]
+ console.log('获取读卡器的code',code)
+ sendPationCode(code)
+ }
+ }
+ )
watch(() => viewNumber,
() => {
state.clockNum = viewNumber.value
@@ -209,283 +230,146 @@
}, 1000)
})
return {
- ...toRefs(state), isLink, netLink, weightInfo, patientInfo, xyjInfo, inputRef, AudioRef0, AudioRef, AudioRef2, AudioRef3, inputChabge
+ ...toRefs(state), isLink, netLink, weightInfo, patientInfo, xyjInfo, inputRef, AudioRef0, AudioRef, AudioRef4, AudioRef2, AudioRef3, inputChabge
}
}
}
</script>
<template>
- <div class="home">
- <!-- 提醒刷卡 -->
- <audio src="https://dhcdn.leon056.com/hemo/autoselfsign/step1.mp3" ref="AudioRef0" id="eventAudio"></audio>
+ <div class="page flex-col">
+ <!-- 提醒刷卡 -->
+ <audio src="https://dhcdn.leon056.com/hemo/autoselfsign/step1.mp3" ref="AudioRef0" id="eventAudio2"></audio>
<!-- 患者信息读取成功 -->
- <audio src="https://dhcdn.leon056.com/hemo/autoselfsign/step2.mp3" ref="AudioRef" id="eventAudio"></audio>
+ <audio src="https://dhcdn.leon056.com/hemo/autoselfsign/step2.mp3" ref="AudioRef" id="eventAudio2"></audio>
<!-- 体重结果回传成功 -->
- <audio src="https://dhcdn.leon056.com/hemo/autoselfsign/step3.mp3" ref="AudioRef2" id="eventAudio"></audio>
+ <audio src="https://dhcdn.leon056.com/hemo/autoselfsign/step3.mp3" ref="AudioRef2" id="eventAudio3"></audio>
<!-- 血压结果回传成功 -->
- <audio src="https://dhcdn.leon056.com/hemo/autoselfsign/step4.mp3" ref="AudioRef3" id="eventAudio"></audio>
+ <audio src="https://dhcdn.leon056.com/hemo/autoselfsign/step4.mp3" ref="AudioRef3" id="eventAudio4"></audio>
+ <!-- 没有找到患者 -->
+ <audio src="https://dhcdn.leon056.com/hemo/autoselfsign/step5.mp3" ref="AudioRef4" id="eventAudio5"></audio>
<el-dialog title="提示" v-model="netLink" width="30%">
<span>无法链接到网络!</span>
</el-dialog>
<el-dialog title="提示" v-model="isLink" width="30%">
<span>sockte连接失败正在重连。。。。。。</span>
</el-dialog>
- <div>
- <el-row>
- <el-col :span="6">
- <div class="imglogo">
- <el-image :src="logo" />
- </div>
-
- </el-col>
- <el-col :span="2">
- <el-input id="inputCode" @change="inputChabge" v-model="inputCode" ref="inputRef" placeholder="" />
- </el-col>
- <el-col :span="8" class="titleText">
- 患者签到
- </el-col>
- <el-col class="clockNum" :span="8">{{clockNum}}</el-col>
- </el-row>
+ <div class="header flex-row">
+ <img
+ class="image_1"
+ referrerpolicy="no-referrer"
+ :src="logo"
+ />
+ <el-input
+ v-model="inputCode"
+ ref="inputRef"
+ id="inputCode"
+ class="inputCode"
+ @change="inputChabge"
+ placeholder="请输入患者卡号或扫描条码"
+ />
+ <span class="text_1">自助签到</span> <span class="text_2">{{clockNum}}</span>
+ </div>
+ <div class="body flex-col">
+ <div class="grid_6 flex-row">
+ <div class="box_1 flex-row">
+ <img
+ class="image_2"
+ referrerpolicy="no-referrer"
+ :src="patientInfo.patientAvatarIcon"
+ />
+
+ <!-- <div class="inputDeep">
+ <input id="inputCode" type="text" @change="inputChabge" ref="inputRef" :value="inputCode">
+
+ </div> -->
+ <div class="group_9 flex-col">
+ <div class="text-wrapper_31 flex-row justify-between">
+ <span class="text_3">姓名:</span>
+ <span class="text_4">{{patientInfo.name}}</span>
+ </div>
+ <div class="group_1 flex-col"></div>
+ <div class="text-wrapper_32 flex-row justify-between">
+ <span class="text_5">透析号:</span>
+ <span class="text_6">{{patientInfo.hemoCode}}</span>
+ </div>
+ </div>
+ </div>
+ <div class="box_2 flex-col">
+ <div class="block_11 flex-row justify-between">
+ <span class="text_7">血压(mmHg):</span>
+ <img
+ class="image_3"
+ v-if="xyjInfo.state === 2"
+ referrerpolicy="no-referrer"
+ :src="state1"
+ />
+ <img
+ class="image_3"
+ v-if="xyjInfo.state === 1"
+ referrerpolicy="no-referrer"
+ :src="state2"
+ />
+ <img
+ class="image_3"
+ v-if="xyjInfo.state === 0"
+ referrerpolicy="no-referrer"
+ :src="state3"
+ />
+ </div>
+ <div class="text-wrapper_33 flex-row">
+ <span class="text_8">{{ gao_ya }}/{{ di_ya }}</span>
+ </div>
+ </div>
+ <div class="box_3 flex-col">
+ <div class="text-wrapper_34 flex-row justify-between">
+ <span class="text_9">机号:</span> <span class="text_10">{{patientInfo.deviceCode}}</span>
+ </div>
+ <div class="block_1 flex-col"></div>
+ <div class="text-wrapper_35 flex-row justify-between">
+ <span class="text_11">干体重(kg):</span>
+ <span class="text_12">{{ patientInfo.pureWeight }}</span>
+ </div>
+ <div class="block_2 flex-col"></div>
+ <div class="text-wrapper_36 flex-row justify-between">
+ <span class="text_13">目标脱水量(L):</span>
+ <span class="text_14">{{aimTSL}}</span>
+ </div>
+ </div>
+ <div class="box_4 flex-col">
+ <div class="section_10 flex-row justify-between">
+ <span class="text_15">透前体重(kg):</span>
+ <img
+ v-if="weightInfo.state === 2"
+ class="image_4"
+ referrerpolicy="no-referrer"
+ :src="state1"
+ />
+ <img
+ v-if="weightInfo.state === 1"
+ class="image_4"
+ referrerpolicy="no-referrer"
+ :src="state2"
+ />
+ <img
+ v-if="weightInfo.state === 0"
+ class="image_4"
+ referrerpolicy="no-referrer"
+ :src="state3"
+ />
+ </div>
+ <div class="section_11 flex-row justify-between">
+ <span class="text_16">{{ weightInfo.result }}</span>
+
+ </div>
+ </div>
</div>
- <el-row :gutter="30">
- <el-col :span="12" class="item">
- <div>
- <el-row>
- <el-col :span="10">
- <div class="patimg">
- <el-image style="width:200px;height:280px;" :src="patientInfo.patientAvatarIcon" />
- </div>
- </el-col>
- <el-col :span="14">
- <div class="chenlabe">
- <div class="chenlabel">
- <div class="chenlabe2">
- <el-row>
- <el-col class="lableClass" :span="12">
- 姓名:
- </el-col>
- <el-col class="inputClasss" :span="12">
- {{patientInfo.name}}
- </el-col>
- </el-row>
-
- </div>
- </div>
- <div class="chenlabel" >
- <div class="chenlabe2">
- <el-row>
- <el-col class="lableClass" :span="12">
- 透析号:
- </el-col>
- <el-col class="inputClasss" :span="12">
- {{patientInfo.hemoCode}}
- </el-col>
- </el-row>
- </div>
- </div>
- </div>
- </el-col>
- </el-row>
- </div>
-
- </el-col>
- <el-col :span="12" class="item">
- <div class="xyjCON">
- <el-row class="xyclass">
- <el-col :span="12" >血压(mmHg):</el-col>
- <el-col :span="12" >
- <div class="xyimg">
- <el-image v-if="xyjInfo.state === 2" style="width: 60px; height: 60px" :src="state1" />
- <el-image v-if="xyjInfo.state === 1" style="width: 60px; height: 60px" :src="state2" />
- <el-image v-if="xyjInfo.state === 0" style="width: 60px; height: 60px" :src="state3" />
- </div>
- </el-col>
- </el-row>
- <el-row>
- <div class="xyjnumber">
- {{ gao_ya }}/{{ di_ya }}
- </div>
- </el-row>
- </div>
- </el-col>
- <el-col :span="12" class="item">
- <div>
- <div class="deviceInfo">
- <el-row class="deviceInfoItem">
- <el-col class="text" :span="12" >机号:</el-col>
- <el-col class="value" :span="12" > {{patientInfo.deviceCode}}</el-col>
- </el-row>
- <el-row class="deviceInfoItem">
- <el-col class="text" :span="12" >干体重(kg):</el-col>
- <el-col class="value" :span="12" > {{ patientInfo.pureWeight }}</el-col>
- </el-row>
- <el-row class="deviceInfoItem">
- <el-col class="text" :span="12" >目标脱水量(L):</el-col>
- <el-col class="value" :span="12" > {{aimTSL}}</el-col>
- </el-row>
- </div>
- </div>
- </el-col>
- <el-col :span="12" class="item">
- <div class="xyjCON">
- <el-row class="xyclass">
- <el-col :span="12" >透前体重(kg):</el-col>
- <el-col :span="12" >
- <div class="xyimg">
- <el-image v-if="weightInfo.state === 2" style="width: 60px; height: 60px" :src="state1" />
- <el-image v-if="weightInfo.state === 1" style="width: 60px; height: 60px" :src="state2" />
- <el-image v-if="weightInfo.state === 0" style="width: 60px; height: 60px" :src="state3" />
- </div>
- </el-col>
- </el-row>
- <el-row>
- <div class="xyjnumber">
- {{ weightInfo.result }}
- </div>
- </el-row>
- </div>
- </el-col>
- </el-row>
+ </div>
</div>
+
</template>
-<style lang="scss">
-.home{
-background: #F3F6FE;
-}
-.item{
- padding: 20px;
-}
-.item>div{
- background: #FFFFFF;
- box-shadow: 1px 2px 4px 0px rgba(201,223,246,0.5000);
- border-radius: 10px;
- height: 330px;
-}
-.chenlabe{
- padding-top: 15%;
-}
-.chenlabel{
- height: 50%;
- // background: #d9ecff;
-}
-.chenlabe2{
- padding-top: 10%;
- padding-left: 30px;
- .lableClass{
- height: 42px;
- font-size: 30px;
- font-family: AlibabaPuHuiTi-Regular, AlibabaPuHuiTi;
- font-weight: 400;
- color: #777777;
- line-height: 42px;
- letter-spacing: 1px;
- }
- .inputClasss{
- height: 42px;
- font-size: 30px;
- font-family: AlibabaPuHuiTi-Medium, AlibabaPuHuiTi;
- font-weight: 500;
- color: #769AFF;
- line-height: 42px;
- letter-spacing: 1px;
- }
-}
-.patimg{
- width: 227px;height: 315px;border-radius: 4px;
- padding-left: 13px;
- padding-top: 17px;
-}
-.xyclass{
- padding-top: 10px;
- padding-left: 10px;
- padding-right: 10px;
- font-size: 30px;
- font-family: AlibabaPuHuiTi-Regular, AlibabaPuHuiTi;
- font-weight: 400;
- color: #333333;
-}
-.xyimg{
- text-align: right;
-}
-.xyjnumber{
- width:100%;
- height: 100%;
- font-size: 120px;
- font-family: DINAlternate-Bold, DINAlternate;
- font-weight: bold;
- color: #769AFF;
- line-height: 100%;
- margin-top: 7%;
- text-align: center;
-}
-.xyjCON{
- height: 100%;
-}
-.deviceInfo{
- padding-top: 60px;
+<style>
+@import './css/common.css';
+@import './css/index.css';
-}
-.deviceInfoItem{
- // background: #333333;
- height: 70px;
- width: 100%;
- line-height: 70px;
- // background: #769AFF;
- .text{
- padding-left: 50px;
- height: 42px;
- font-size: 30px;
- font-family: AlibabaPuHuiTi-Regular, AlibabaPuHuiTi;
- font-weight: 400;
- color: #777777;
- line-height: 42px;
- letter-spacing: 1px;
- text-align: right;
- }
- .value{
- text-align: center;
- height: 47px;
- font-size: 40px;
- font-family: DINAlternate-Bold, DINAlternate;
- font-weight: bold;
- color: #769AFF;
- line-height: 47px;
- letter-spacing: 2px;
- }
-}
-.titlerow{
- height: 72px;
- background: #FFFFFF;
- line-height: 72px;
- box-shadow: 1px 3px 5px 0px #E9E9E9;
-}
-.imglogo{
- padding-top: 10px;
- width: 102px;
- height: 40px;
-// background: #769AFF;
-}
-.titleText{
- text-align: center;
- height: 38px;
- font-size: 27px;
- font-family: PingFangSC-Medium, PingFang SC;
- font-weight: 500;
- color: #333333;
- line-height: 38px;
- letter-spacing: 1px;
-}
-.clockNum{
- width: 100%;
- height: 38px;
- font-size: 27px;
- font-family: PingFangSC-Medium, PingFang SC;
- font-weight: 500;
- color: #FF7472;
- line-height: 38px;
- letter-spacing: 1px;
- text-align:right;
- padding-right: 10px;
-}
-</style>
\ No newline at end of file
+</style>
--
Gitblit v1.8.0