From a30f5ac1fd3b69457b16f8332cd918aa2f5a093b Mon Sep 17 00:00:00 2001 From: eight <641137800@qq.com> Date: 星期一, 02 十二月 2024 11:37:42 +0800 Subject: [PATCH] 条码复制完成 --- src/views/ecg/doctor/components/DevInstallPanel.vue | 25 +++++++++++++++++++++---- 1 files changed, 21 insertions(+), 4 deletions(-) diff --git a/src/views/ecg/doctor/components/DevInstallPanel.vue b/src/views/ecg/doctor/components/DevInstallPanel.vue index dc8b793..931b5a5 100644 --- a/src/views/ecg/doctor/components/DevInstallPanel.vue +++ b/src/views/ecg/doctor/components/DevInstallPanel.vue @@ -14,7 +14,8 @@ <el-form-item label="鎮h�呯紪鍙�" prop="patId"> <el-input v-model="formData.patId" placeholder="璇疯緭鍏ユ偅鑰呯紪鍙�" @input="getRentInfoByPatId" /> <!-- <Qrcode v-if="formData.patId !== undefined && formData.patId !== ''" :text="formData.patId" logo="/logo.gif" width=100 />--> - <Barcode v-if="getDisplayBarcode()" :value="getDisplayBarcode()" :width=100 /> + <Barcode v-if="displayBarCode" :value="displayBarCode" :width=100 /> + <el-button @click="copyBarcode()">澶嶅埗</el-button> </el-form-item> <el-form-item label="鎮h�呭悕绉�" prop="patName"> <el-input v-model="formData.patName" placeholder="璇疯緭鍏ユ偅鑰呭悕绉�" /> @@ -151,6 +152,7 @@ formData.value.checkType = queueVO?.bookCheckType formData.value.patSrc = queueVO?.patDetails.source getReadyRentInfo(formData.value) + copyBarcode() } defineExpose({ setPatient }) // 鎻愪緵 setPatient 鏂规硶锛岀敤浜庤缃偅鑰� @@ -170,6 +172,8 @@ patName: [{ required: true, message: '鎮h�呭悕涓嶈兘涓虹┖', trigger: 'blur' }] }) const formRef = ref() // 琛ㄥ崟 Ref + +const displayBarCode = ref<string> () /** 鎻愪氦琛ㄥ崟 */ const submitForm = async () => { @@ -241,6 +245,7 @@ formData.value.patId = tempPatId; getReadyRentInfo(formData.value) + copyBarcode() } const getReadyRentInfo = async (devRentVO) => { @@ -315,7 +320,7 @@ getList() } -const getDisplayBarcode = () => { +const getDisplayBarcode = (): string => { if (!formData.value.checkType) return "" @@ -323,14 +328,26 @@ if (!displayBarcode.includes( formData.value.patSrc )) return "" + return getBarcode() +} + +const getBarcode = (): string => { + if (!formData.value.checkType) + return "" + if (1 === formData.value.patSrc || 2 === formData.value.patSrc) - return formData.value.applyNo + return formData.value.applyNo??"" else if (3 === formData.value.patSrc || 4 === formData.value.patSrc) - return formData.value.episodeId + return formData.value.episodeId??"" return "" } +const copyBarcode = async () => { + displayBarCode.value = getDisplayBarcode() + await navigator.clipboard.writeText( getBarcode() ); +} + /** 鍒濆鍖� **/ onMounted(() => { resetForm() -- Gitblit v1.9.3