From f5dc6411333d824d8b585734d2006367df2ab76a Mon Sep 17 00:00:00 2001
From: chenyincheng <501753378@qq.com>
Date: 星期六, 25 三月 2023 09:06:00 +0800
Subject: [PATCH] 更新透后签到不计算目标脱水量
---
src/views/home/index.vue | 33 ++++++++++++++-------------------
1 files changed, 14 insertions(+), 19 deletions(-)
diff --git a/src/views/home/index.vue b/src/views/home/index.vue
index f570f20..921fc81 100644
--- a/src/views/home/index.vue
+++ b/src/views/home/index.vue
@@ -90,7 +90,7 @@
sockteStore().setweightSockte({
type: '体重秤',
deviceName: '',
- result: '',
+ result: '0',
resultTime: '',
state: 2
})
@@ -139,7 +139,7 @@
watch(
() => patientInfo.value.datetime,
() => {
- console.log('患者信息变化', patientInfo.value)
+ console.log('患者信息变化,置空临时患者code', patientInfo.value)
patientCodeLs = ''
patientCodeLsXy = ''
console.log(patientCodeLs, '患者codec初始化')
@@ -190,20 +190,15 @@
);
watch(
() => weightInfo.value.resultTime,
- () => {
+ async () => {
console.log("体重变化了", weightInfo.value)
- // if (patientInfo.value.id === 0) {
- // speech.value?.speak({ text: "没有识别的患者,请先验证患者" }).then(() => {
- // console.log("播报完成...")
- // })
- // }
- if (weightInfo.value.result !== "0") {
+ // 体重不能0
+ if (weightInfo.value.result !== "0"&&patientInfo.value.code!=='') {
// 发送结果到sockte服务
const mode = {
patientCode: patientInfo.value.code,
weight: weightInfo.value.result,
bloodPressure: ''
-
}
if (patientCodeLs !== mode.patientCode) {
const tt = mode.weight.replace('.', '点')
@@ -212,21 +207,21 @@
console.log("播报完成...")
})
console.log(111111)
- // api上传
- updatePatient(mode).then(re => {
- console.log(re)
- }).catch(() => {
- ElMessage.error('结果上报出错,请联系后台管理员')
- })
- // sendPationSet(mode)
patientCodeLs = mode.patientCode
+ for(let x=0;x<3;x++){
+ const res= await updatePatient(mode)
+ if(res.code===200){
+ return false
+ }
+ }
}
else {
- console.log(22222)
+ // 临时患者code=当前患者code
+ console.log(22222222222)
patientCodeLs = mode.patientCode
}
// 计算目标脱水量
- if (Number(weightInfo.value.result) > 0 && Number(patientInfo.value.pureWeight) !== 0) {
+ if (Number(weightInfo.value.result) > 0 && Number(patientInfo.value.pureWeight) !== 0&&patientInfo.value.isAfterMed===0) {
state.aimTSL = (Number(weightInfo.value.result) - Number(patientInfo.value.pureWeight)- Number(patientInfo.value.clothesWeight)).toFixed(2)
}
}
--
Gitblit v1.8.0