From 97f4e581af58ca03ff4c39210fd4b2f3ae11f8ff Mon Sep 17 00:00:00 2001
From: yxh <172933527@qq.com>
Date: 星期五, 27 十一月 2026 10:35:43 +0800
Subject: [PATCH] 设备编号记录要求
---
src/views/ecg/doctor/components/DevInstallPanel.vue | 228 +++++++++++++++++++++++++++++++++++++++++++++-----------
1 files changed, 182 insertions(+), 46 deletions(-)
diff --git a/src/views/ecg/doctor/components/DevInstallPanel.vue b/src/views/ecg/doctor/components/DevInstallPanel.vue
index 77c7038..0a73709 100644
--- a/src/views/ecg/doctor/components/DevInstallPanel.vue
+++ b/src/views/ecg/doctor/components/DevInstallPanel.vue
@@ -2,21 +2,21 @@
<el-form class="patient-compact-form" ref="formRef" :model="formData" :rules="formRules" label-width="100px" v-loading="formLoading">
<!-- ===== 缂栬緫鍖猴紙闇�瑕佸綍鍏ョ殑瀛楁锛�===== -->
<el-row :gutter="20">
- <el-col :span="6">
+ <el-col :xs="24" :sm="12" :md="12" :lg="6">
<el-form-item label="妫�鏌ラ」鐩�" prop="">
{{ getCheckTypeName(formData.checkType) }}
</el-form-item>
</el-col>
- <el-col :span="12">
+ <el-col :xs="24" :sm="24" :md="12" :lg="12">
<el-form-item label="鎮h�呯紪鍙�" prop="patId">
<el-input v-model="formData.patId" placeholder="璇疯緭鍏ユ偅鑰呯紪鍙�" @input="getRentInfoByPatId" />
- <Barcode v-if="displayBarCode" :value="displayBarCode" :width=100 />
- <el-button @click="copyBarcode()">澶嶅埗</el-button>
+ <Barcode v-if="showBarCode" :value="barcodeContent" :width=100 />
+ <el-button v-if="showCopyButton" :disabled="!barcodeContent" @click="copyBarcode()">澶嶅埗</el-button>
</el-form-item>
</el-col>
- <el-col :span="6">
+ <el-col :xs="24" :sm="12" :md="12" :lg="6">
<el-form-item label="璁惧缂栧彿" prop="devId">
- <el-input v-model="formData.devId" placeholder="璇疯緭鍏ヨ澶囩紪鍙�" @input="getDevInfo" />
+ <el-input v-model="formData.devId" :placeholder="requireDevId ? '璇疯緭鍏ヨ澶囩紪鍙�' : '鍙暀绌�'" @input="getDevInfo" />
</el-form-item>
</el-col>
</el-row>
@@ -43,13 +43,21 @@
</div>
<!-- 鍖荤敓瑁呮満鍒楄〃 -->
+ <!-- 銆愭湰娆¢渶姹傘�戞搷浣滃姛鑳藉尯涓庡凡瀹屾垚璁板綍涔嬮棿鐨勬爣棰樻爮 -->
+ <div class="records-title">
+ <span class="records-title__bar"></span>
+ <span class="records-title__text">宸插畬鎴愬垪琛�</span>
+ </div>
<div class="records-host">
<ContentWrap class="records-wrap">
+ <div class="records-scroll">
<el-table
v-loading="loading"
:data="list"
:stripe="true"
:show-overflow-tooltip="true"
+ highlight-current-row
+ @current-change="onCurrentRowChange"
@row-click="onRowClick"
>
<!-- 闇�姹�11锛堜慨姝o級锛氥�屾挙閿�銆嶄綔涓�**宸插畬鎴愯鏈鸿褰曞垪琛ㄧ殑绗竴鍒�**锛堣〃澶存彃妲斤級锛�
@@ -61,7 +69,8 @@
type="warning"
:disabled="undoDisabled"
:loading="undoLoading"
- @click="$emit('event_undo_finish')"
+ title="鍏堝湪涓嬫柟鐐归�変竴鏉″畬鎴愯褰曪紝鍐嶇偣姝ゆ挙閿�"
+ @click="undoSelected"
>
鎾ら攢
</el-button>
@@ -69,9 +78,15 @@
</el-table-column>
<el-table-column label="瑁呮満鎯呭喌" align="center" prop="lost">
<template #default="scope">
- <span v-if="scope.row.jobType === 10">"宸茶鏈�"</span>
+ <!-- 銆愭湰闇�姹傘�戝畬鎴愯鎾ら攢杩囷細璇ユ潯璁板綍鏄剧ず銆屽凡鎾ら攢銆嶏紱鍐嶆瀹屾垚鏃跺悗绔� undone 鑷姩鍙樺洖 false -->
+ <el-tag v-if="scope.row.undone" type="danger" size="small">宸叉挙閿�</el-tag>
+ <span v-else-if="scope.row.jobType === 10">"宸茶鏈�"</span>
<span v-if="scope.row.jobType === 35">"宸叉斁寮�"</span>
</template>
+ </el-table-column>
+ <!-- 銆�2026-11-25 闇�姹傘�戝悓涓�鎮h�呭彲鑳芥湁澶氫釜妫�鏌ラ」鐩紝宸插畬鎴愬垪琛ㄥ垪鍑烘潵鎵嶈兘鍖哄垎/绮剧‘鎾ら攢 -->
+ <el-table-column label="妫�鏌ラ」鐩�" align="center" width="150">
+ <template #default="scope">{{ getCheckTypeName(scope.row.checkType) }}</template>
</el-table-column>
<!-- <el-table-column label="浣滀笟绫诲瀷" align="center" prop="jobType" />-->
<!-- <el-table-column label="鍖荤敓缂栧彿" align="center" prop="docId" />-->
@@ -104,6 +119,7 @@
</template>
</el-table-column>-->
</el-table>
+ </div>
</ContentWrap>
<!-- 鍒嗛〉 -->
<Pagination
@@ -129,6 +145,8 @@
import { useCheckTypeStore } from "@/store/modules/checkType";
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
import { tranlateDevState } from "../../../../utils/statusFormatter";
+import { copyText } from '@/utils/copyText'
+import { getConfigKey } from '@/api/infra/config'
import { getCheckTypeName, needDevReady } from "../../../../utils/checkTypeFormatter";
import { useRoomStore } from '@/store/modules/room'
// 闇�姹�1锛氭偅鑰呬俊鎭� 18 椤圭粺涓�灞曠ず鍧�
@@ -164,7 +182,6 @@
const formRef = ref() // 琛ㄥ崟 Ref
-const displayBarCode = ref<string>()
const formLoading = ref(false) // 琛ㄥ崟鐨勫姞杞戒腑锛�1锛変慨鏀规椂鐨勬暟鎹姞杞斤紱2锛夋彁浜ょ殑鎸夐挳绂佺敤
@@ -193,6 +210,29 @@
patName: [{ required: true, message: '鎮h�呭悕涓嶈兘涓虹┖', trigger: 'blur' }]
})
+/**
+ * 銆愮郴缁熷弬鏁般�戝姩鎬佽鍘嬪拰蹇冪數璁惧棰嗙敤瀹夎鐧昏璁惧缂栧彿
+ * 鍊尖�滄槸鈥濓紙榛樿锛夆啋 璁惧缂栧彿蹇呭~锛�
+ * 鍊尖�滃惁鈥� 鈫� 鍏佽涓嶅~锛堟牎楠岃鍒欏悓姝ユ斁寮�锛夈��
+ */
+const requireDevId = ref(true)
+const loadDevIdRequired = async () => {
+ try {
+ const value = await getConfigKey('ecg.dev.rent.device.no.required')
+ const text = String(value ?? '').trim()
+ requireDevId.value = !(
+ text === '鍚�' || text === '0' ||
+ text.toLowerCase() === 'false' || text.toLowerCase() === 'no'
+ )
+ } catch (e) {
+ console.warn('[DevInstallPanel] 璇诲彇鈥滆澶囩紪鍙峰繀濉�濈郴缁熷弬鏁板け璐ワ紝鎸夊繀濉鐞�', e)
+ requireDevId.value = true
+ }
+ formRules.devId = requireDevId.value
+ ? [{ required: true, message: '璁惧缂栧彿涓嶈兘涓虹┖', trigger: 'blur' }]
+ : []
+}
+
const checkTypeStore = useCheckTypeStore()
@@ -213,6 +253,10 @@
formData.value.doctor = queueVO?.doctor
formData.value.doctorTime = queueVO?.doctorTime
formData.value.patSrc = queueVO?.patSrc
+ // 銆愭湰娆′慨澶嶃�戞潯鐮�/鎵撳嵃灏忕エ渚濊禆 patDetails锛堝惈 source/appointmentId锛夛紝
+ // 闃熷垪琛屾湰灏卞甫鐫�瀹冿紱鍘熷厛鍙湪 getFreeRentInfo() 鏌ュ埌"寰呮鏌ュ崟"鏃舵墠璧嬪�硷紝
+ // 瀵艰嚧缁濆ぇ澶氭暟鎯呭喌涓� patDetails 涓� undefined 鈫� 鏉$爜涓嶆樉绀恒��
+ formData.value.patDetails = queueVO?.patDetails
formData.value.patMobile = queueVO?.patMobile
formData.value.patPhone = queueVO?.patPhone
formData.value.patWardDesc = queueVO?.patWardDesc
@@ -223,9 +267,19 @@
formData.value.doctorAdviceNo = queueVO?.doctorAdviceNo
formData.value.patIdentityId = queueVO?.patIdentityId
getReadyRentInfo(formData.value) // 鑾峰彇棰嗙敤淇℃伅
- copyBarcode()
}
-defineExpose({ setPatient }) // 鎻愪緵 setPatient 鏂规硶锛岀敤浜庤缃偅鑰�
+/**
+ * 銆愬彨鍙疯嚜鍔ㄥ畬鎴愩�戜緵鐖堕〉闈㈢偣銆屽彨鍙枫�嶆椂鍏堣嚜鍔ㄥ畬鎴愬綋鍓嶆偅鑰咃紙绛夊悓鐐广�岃鏈哄畬鎴愩�嶏級銆�
+ */
+const completeCurrent = async (): Promise<boolean> => {
+ try {
+ return (await submitForm()) === true
+ } catch (e) {
+ console.warn('[DevInstallPanel] 鑷姩銆岃鏈哄畬鎴愩�嶅け璐�', e)
+ return false
+ }
+}
+defineExpose({ setPatient, getList: () => getList(), completeCurrent }) // 鎻愪緵 setPatient 鏂规硶锛岀敤浜庤缃偅鑰�
/** 鎻愪氦琛ㄥ崟 */
@@ -238,7 +292,7 @@
message.warning(
`銆�${ctName}銆嶄笉闇�瑕佽澶囬鐢紝涓嶈兘鍔炵悊瑁呮満銆傝纭鏄惁搴斿埌銆屽彨鍙锋鏌ャ�嶉〉闈㈠鐞嗚鎮h�呫�俙
)
- return
+ return false
}
// 鏍¢獙琛ㄥ崟
@@ -260,6 +314,7 @@
// 鍙戦�佹搷浣滄垚鍔熺殑浜嬩欢
emit('event_dev_install')
message.success(t('鎿嶄綔鎴愬姛'))
+ return true
} finally {
formLoading.value = false
}
@@ -310,7 +365,8 @@
}
const getDevInfo = async () => {
- if (formData.value?.devId == null) {
+ // 璁惧缂栧彿鍏佽鐣欑┖锛堢郴缁熷弬鏁�=鍚︼級鏃讹紝绌哄�间笉鍐嶅幓鏌ヨ澶囷紝閬垮厤鏃犳剰涔夎姹�/鎶ラ敊
+ if (!formData.value?.devId) {
devInfo.value.brand = undefined
devInfo.value.model = undefined
devInfo.value.state = undefined
@@ -333,7 +389,6 @@
formData.value.patId = tempPatId;
getReadyRentInfo(formData.value)
- copyBarcode()
}
// 鑾峰彇鎮h�呯殑棰嗙敤淇℃伅
@@ -424,9 +479,29 @@
const data = await JobRecordApi.getJobRecordDoctorPage(queryParams)
list.value = data.list
total.value = data.total
+ // 鍒楄〃鍒锋柊鍚庢棫鐨勯�変腑琛屽凡澶辨晥锛屾竻鎺夛紝閬垮厤銆屾挙閿�銆嶄綔鐢ㄥ埌涓婁竴灞忕殑璁板綍
+ selectedRecord.value = undefined
} finally {
loading.value = false
}
+}
+
+/** 銆�2026-11-25 闇�姹傘�戝凡瀹屾垚鍒楄〃鐨勯�変腑琛岋細鎾ら攢鍓嶅厛鐐归�変竴鏉★紝鎾ら攢浣滅敤鍦ㄩ�変腑璁板綍涓� */
+const selectedRecord = ref<any>()
+const onCurrentRowChange = (row: any) => {
+ selectedRecord.value = row || undefined
+}
+
+/** 鎾ら攢锛氬彧鎾ら攢褰撳墠閫変腑鐨勯偅鏉″畬鎴愯褰曪紙鏈�変腑鏃舵彁绀猴紝涓嶅啀榛樿鎾ら攢"鏈�杩戜竴鏉�"锛� */
+const undoSelected = () => {
+ if (!selectedRecord.value) {
+ message.warning('璇峰厛鍦ㄣ�屽凡瀹屾垚鍒楄〃銆嶄腑鐐归�変竴鏉¤褰曪紝鍐嶇偣銆屾挙閿�銆�')
+ return
+ }
+ emit('event_undo_finish', {
+ ...selectedRecord.value,
+ checkTypeName: getCheckTypeName(selectedRecord.value.checkType)
+ })
}
const onRowClick = (cur) => {
@@ -463,48 +538,85 @@
getList()
}
-const getDisplayBarcode = (): string => {
- if (!formData.value.checkType)
- return ""
+/**
+ * 銆愭湰闇�姹傘�戞偅鑰呮潯鐮佸彛寰勶紙闂ㄨ瘖/鎬ヨ瘖/浣撴 = 灏辫瘖娴佹按鍙凤紱浣忛櫌涓嶅嚭鏉$爜锛屽彧鐣欍�屽鍒躲�嶏級
+ *
+ * 路 闂ㄨ瘖(1) / 鎬ヨ瘖(2) / 浣撴(4) 鈫� 鏉$爜鍐呭 = **灏辫瘖娴佹按鍙�**锛坋pisodeId锛�
+ * 路 浣忛櫌(3) 鈫� **涓嶆樉绀烘潯鐮�**锛屽彧淇濈暀銆屽鍒躲�嶆寜閽紙澶嶅埗鍐呭鍚屾牱鏄氨璇婃祦姘村彿锛�
+ * 路 銆屽鍒躲�嶆寜閽笌鏉$爜涓�鑷达細鍚屽彈銆屾鏌ョ被鍨� 鈫� 鎮h�呮潯鐮佹樉绀恒�嶉厤缃帶鍒�
+ * 锛堣妫�鏌ョ被鍨嬫湭鍕鹃�夎繖涓偅鑰呮潵婧愭椂锛屾潯鐮佸拰澶嶅埗鎸夐挳閮戒笉鏄剧ず锛�
+ */
+const patSourceValue = computed<number | null>(() => {
+ const source = formData.value.patDetails?.source ?? formData.value.patSrc
+ return source === null || source === undefined || source === '' ? null : Number(source)
+})
- const displayBarcode: number[] = checkTypeStore.getCheckTypeDispBarCode(formData.value.checkType!)
- if (formData.value.patDetails == null || formData.value.patDetails.source == null ||
- !displayBarcode.includes(formData.value.patDetails.source))
- return ""
+/** 鏄惁閫氳繃浜嗐�屾偅鑰呮潯鐮佹樉绀恒�嶉厤缃紙鍕鹃�変簡褰撳墠鎮h�呮潵婧愶級 */
+const barcodeEnabled = computed<boolean>(() => {
+ if (formData.value.checkType == null) return false
+ const displayBarcode: number[] | undefined = checkTypeStore.getCheckTypeDispBarCode(formData.value.checkType)
+ if (displayBarcode == null || displayBarcode.length === 0) return false
+ const patSource = patSourceValue.value
+ if (patSource == null) return false
+ return displayBarcode.map(Number).includes(patSource)
+})
- return getBarcode()
-}
+/** 鏉$爜 / 澶嶅埗鐨勫唴瀹癸細缁熶竴鍙栥�屽氨璇婃祦姘村彿銆� */
+const barcodeContent = computed<string>(() =>
+ barcodeEnabled.value ? (formData.value.episodeId ?? '') : ''
+)
-const getBarcode = (): string => {
- if (!formData.value.checkType)
- return ""
+/** 鏄惁鏄剧ず鏉$爜锛氫綇闄紙鏉ユ簮 3锛変笉鏄剧ず锛涘唴瀹逛负绌烘椂涔熶笉鏄剧ず */
+const showBarCode = computed<boolean>(
+ () => barcodeEnabled.value && patSourceValue.value !== 3 && barcodeContent.value !== ''
+)
- const patSource = formData.value.patDetails?.source
- if (patSource == null)
- return ""
-
- if (1 === patSource || 2 === patSource)
- return formData.value.applyNo ?? ""
- else if (3 === patSource || 4 === patSource)
- return formData.value.episodeId ?? ""
-
- return ""
-}
+/** 鏄惁鏄剧ず銆屽鍒躲�嶆寜閽細涓庢潯鐮佷竴鑷达紙鍚屽彈閰嶇疆鎺у埗锛� */
+const showCopyButton = computed<boolean>(() => barcodeEnabled.value)
const copyBarcode = async () => {
- displayBarCode.value = getDisplayBarcode()
- await navigator.clipboard.writeText(getBarcode());
+ if (!barcodeContent.value) return
+ // 銆愬吋瀹� Chrome 85 / http 璁块棶銆戦潪瀹夊叏涓婁笅鏂囦笅 navigator.clipboard 涓嶅彲鐢紝鐢ㄥ吋瀹瑰疄鐜�
+ const ok = await copyText(barcodeContent.value)
+ if (ok) {
+ message.success('宸插鍒�')
+ } else {
+ message.warning('褰撳墠娴忚鍣ㄤ笉鏀寔鑷姩澶嶅埗锛岃鎵嬪姩閫変腑澶嶅埗')
+ }
}
/** 鍒濆鍖� **/
onMounted(() => {
resetForm()
getList()
+ loadDevIdRequired()
})
</script>
<style scoped lang="scss">
+
+/* 銆愭湰娆¢渶姹傘�戙�屽凡瀹屾垚鍒楄〃銆嶆爣棰樻爮锛氬乏渚т富鑹茬珫绾� + 鍔犵矖灏忔爣棰橈紝绱у噾楂樺害涓嶆尋鍘嬭〃鏍� */
+.records-title {
+ display: flex;
+ align-items: center;
+ flex: none;
+ gap: 6px;
+ padding: 2px 0 6px;
+
+ &__bar {
+ width: 3px;
+ height: 14px;
+ background-color: var(--el-color-primary);
+ border-radius: 2px;
+ }
+
+ &__text {
+ font-size: 15px;
+ font-weight: 600;
+ color: var(--el-text-color-primary);
+ }
+}
/* ==========================================================================
闇�姹傦細琛ㄥ崟鍐呭鎸ゅ崰浜嗕笅鏂硅褰曡〃鏍肩殑绌洪棿 鈥斺�� 鍘嬬缉琛岄棿璺濄��
Element Plus 榛樿 `.el-form-item { margin-bottom: 18px }`锛�
@@ -556,19 +668,43 @@
.patient-actions {
display: flex;
flex: none;
- flex-wrap: nowrap;
+ /* 鎸夐挳澶氭椂鍏佽鎹㈣锛岄伩鍏嶆尋鍦ㄤ竴琛岋紙妫�鏌ラ〉鏈�澶� 6 涓寜閽級 */
+ flex-wrap: wrap;
gap: 8px;
align-items: center;
- /* 涓婁笅鐣欑櫧 + 鍒嗛殧绾匡紝褰㈡垚鐙珛鍔熻兘鍧� */
- padding: 6px 4px;
- margin-bottom: 6px;
- background-color: var(--el-bg-color);
- border-top: 1px solid var(--el-border-color-lighter);
- border-bottom: 1px solid var(--el-border-color-lighter);
+ /*
+ 銆愭湰娆¢渶姹傘�戞搷浣滃姛鑳藉尯鍋氫竴鐐硅瑙夊尯鍒嗭紝鏂逛究鍖荤敓涓�鐪煎畾浣嶏細
+ 鏋佹祬鐨勪富鑹插簳 + 缁嗚竟妗� + 宸︿晶 3px 涓昏壊绔栨潯锛堜笌銆屸枎宸插畬鎴愬垪琛ㄣ�嶆爣棰樻潯鍚屾璇█锛夈��
+ 鍙仛"绋嶆湁鍖哄垎"锛屼笉鏀规寜閽湰韬殑灏哄/棰滆壊/椤哄簭銆�
+ */
+ padding: 8px 10px;
+ margin: 2px 0 10px;
+ background-color: var(--el-color-primary-light-9);
+ border: 1px solid var(--el-color-primary-light-7);
+ border-left: 3px solid var(--el-color-primary);
+ border-radius: 4px;
/* Element Plus 缁欑浉閭� el-button 榛樿鍔犱簡 margin-left:12px锛屼細涓� gap 鍙犲姞锛屾竻鎺� */
:deep(.el-button + .el-button) {
margin-left: 0;
}
}
+
+/* ==========================================================================
+ 銆�2026-11-25 闇�姹傘�戝凡瀹屾垚鍒楄〃锛氬彧鏄剧ず 4 琛屽乏鍙筹紝瓒呰繃灏卞嚭鐜扮旱鍚戞粴鍔ㄦ潯
+ 锛堝疄娴嬭楂� 40px銆佽〃澶� 63px 鈫� 63 + 4脳40 + 2 = 225px锛夈��
+ ========================================================================== */
+.records-scroll {
+ max-height: 225px;
+ min-height: 120px;
+ overflow-y: auto;
+ overflow-x: hidden;
+
+ :deep(.el-table__header-wrapper) {
+ position: sticky;
+ top: 0;
+ z-index: 2;
+ background-color: var(--el-bg-color);
+ }
+}
</style>
--
Gitblit v1.9.3