| | |
| | | const sockte = sockteStore() |
| | | const inputRef = ref() |
| | | let patientCodeLs='' |
| | | let patientCodeLsXy='' |
| | | const isUseFaceRecogService=ref(false) |
| | | const isLink = computed(() => { |
| | | return !sockte.isLink |
| | |
| | | () => { |
| | | console.log('患者信息变化',patientInfo.value) |
| | | patientCodeLs='' |
| | | patientCodeLsXy='' |
| | | console.log(patientCodeLs,'患者codec初始化') |
| | | if (patientInfo.value.id !== 0&&patientInfo.value.name!==''&&patientInfo.value.isScheduled===1) { |
| | | let str=`${patientInfo.value.name}识别成功。` |
| | | speech.value?.speak({text:str}).then(()=>{ |
| | | console.log("播报完成...") |
| | | }) |
| | | sockteStore().setweightSockte({ |
| | | sockteStore().setweightSockte({ |
| | | type: "体重秤", |
| | | state: 2, |
| | | deviceName: "", |
| | | result: "0", |
| | | resultTime: "" |
| | | }) |
| | | sockteStore().setxyjSockte({ |
| | | type: "血压计", |
| | | state: 2, |
| | | deviceName: "", |
| | | result: "", |
| | | resultTime: "" |
| | | sockteStore().setxyjSockte({ |
| | | type: "血压计", |
| | | state: 2, |
| | | deviceName: "", |
| | | result: "", |
| | | resultTime: "" |
| | | }) |
| | | settime() |
| | | if (patientInfo.value.id !== 0&&patientInfo.value.name!==''&&patientInfo.value.isScheduled===1) { |
| | | let str=`${patientInfo.value.name}识别成功。` |
| | | speech.value?.speak({text:str}).then(()=>{ |
| | | console.log("播报完成...") |
| | | }) |
| | | settime() |
| | | |
| | | } |
| | | // 没有找到患者 |
| | |
| | | } |
| | | console.log('发送患者结果,前提是患者code 不能重复', mode) |
| | | if(patientCodeLs!==mode.patientCode){ |
| | | console.log('发送患者结果') |
| | | speech.value?.speak({text:`称重完成,${mode.weight}kg`}).then(()=>{ |
| | | const tt=mode.weight.replace('.','点') |
| | | console.log('发送患者结果',tt) |
| | | speech.value?.speak({text:`称重完成,${tt}kg`}).then(()=>{ |
| | | console.log("播报完成...") |
| | | }) |
| | | // api上传 |
| | |
| | | settime() |
| | | const mode = { |
| | | patientCode: patientInfo.value.code, |
| | | weight: weightInfo.value.result, |
| | | weight: '', |
| | | bloodPressure: xyjInfo.value.result |
| | | |
| | | } |
| | | console.log('发送患者结果', mode) |
| | | speech.value?.speak({text:`收缩压:${state.gao_ya},舒张压:${state.di_ya},脉搏:${state.mai_bu}`}).then(()=>{ |
| | | console.log("播报完成...") |
| | | }) |
| | | updatePatient(mode).then(re=>{ |
| | | console.log(re) |
| | | }) |
| | | sendPationSet(mode) |
| | | if(patientCodeLsXy===mode.patientCode){ |
| | | speech.value?.speak({text:'不能重复测量血压,请重新识别患者再测量血压'}).then(()=>{ |
| | | console.log("播报完成...") |
| | | }) |
| | | console.log('如果是重复提交 就不要上传到api') |
| | | return false |
| | | }else{ |
| | | updatePatient(mode).then(re=>{ |
| | | speech.value?.speak({text:`收缩压:${state.gao_ya},舒张压:${state.di_ya},脉搏:${state.mai_bu}`}).then(()=>{ |
| | | console.log("播报完成...") |
| | | }) |
| | | patientCodeLsXy=mode.patientCode |
| | | console.log(re) |
| | | }) |
| | | sendPationSet(mode) |
| | | } |
| | | } |
| | | } else { |
| | | state.gao_ya = "" |