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 |   32 ++++++++++++++++++++++++++++----
 1 files changed, 28 insertions(+), 4 deletions(-)

diff --git a/src/views/home/index.vue b/src/views/home/index.vue
index 77c3d32..a612b9a 100644
--- a/src/views/home/index.vue
+++ b/src/views/home/index.vue
@@ -34,6 +34,9 @@
         const xyjInfo = computed(() => {
             return sockte.xyjSockte
         })
+        const dkqInfo = computed(() => {
+            return sockte.dkqSockte
+        })
         const patientInfo = computed(() => {
             return patientInfoStore().patientInfo
         })
@@ -193,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
@@ -245,6 +259,14 @@
           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">
@@ -255,6 +277,11 @@
               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>
@@ -337,10 +364,6 @@
           </div>
         </div>
       </div>
-      <div class="inputDeep" style="display:none;">1
-        <input id="inputCode" style="border-style: none;" type="text" @change="inputChabge" ref="inputRef" :value="inputCode">
-        <!-- <input  @change="inputChabge" v-model="inputCode" ref="inputRef" placeholder="" /> -->
-      </div>
     </div>
 
 </template>
@@ -348,4 +371,5 @@
 @import './css/common.css';
 @import './css/index.css';
 
+
 </style>

--
Gitblit v1.8.0