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 | 184 ++++++++++++++++++++++++++++++++++------------
1 files changed, 136 insertions(+), 48 deletions(-)
diff --git a/src/views/ecg/doctor/components/DevInstallPanel.vue b/src/views/ecg/doctor/components/DevInstallPanel.vue
index fbd7d95..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>
@@ -50,11 +50,14 @@
</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級锛氥�屾挙閿�銆嶄綔涓�**宸插畬鎴愯鏈鸿褰曞垪琛ㄧ殑绗竴鍒�**锛堣〃澶存彃妲斤級锛�
@@ -66,7 +69,8 @@
type="warning"
:disabled="undoDisabled"
:loading="undoLoading"
- @click="$emit('event_undo_finish')"
+ title="鍏堝湪涓嬫柟鐐归�変竴鏉″畬鎴愯褰曪紝鍐嶇偣姝ゆ挙閿�"
+ @click="undoSelected"
>
鎾ら攢
</el-button>
@@ -79,6 +83,10 @@
<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" />-->
@@ -111,6 +119,7 @@
</template>
</el-table-column>-->
</el-table>
+ </div>
</ContentWrap>
<!-- 鍒嗛〉 -->
<Pagination
@@ -136,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 椤圭粺涓�灞曠ず鍧�
@@ -171,7 +182,6 @@
const formRef = ref() // 琛ㄥ崟 Ref
-const displayBarCode = ref<string>()
const formLoading = ref(false) // 琛ㄥ崟鐨勫姞杞戒腑锛�1锛変慨鏀规椂鐨勬暟鎹姞杞斤紱2锛夋彁浜ょ殑鎸夐挳绂佺敤
@@ -199,6 +209,29 @@
patId: [{ required: true, message: '鎮h�呬笉鑳戒负绌�', trigger: 'blur' }],
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()
@@ -234,9 +267,19 @@
formData.value.doctorAdviceNo = queueVO?.doctorAdviceNo
formData.value.patIdentityId = queueVO?.patIdentityId
getReadyRentInfo(formData.value) // 鑾峰彇棰嗙敤淇℃伅
- copyBarcode()
}
-defineExpose({ setPatient, getList: () => getList() }) // 鎻愪緵 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 鏂规硶锛岀敤浜庤缃偅鑰�
/** 鎻愪氦琛ㄥ崟 */
@@ -249,7 +292,7 @@
message.warning(
`銆�${ctName}銆嶄笉闇�瑕佽澶囬鐢紝涓嶈兘鍔炵悊瑁呮満銆傝纭鏄惁搴斿埌銆屽彨鍙锋鏌ャ�嶉〉闈㈠鐞嗚鎮h�呫�俙
)
- return
+ return false
}
// 鏍¢獙琛ㄥ崟
@@ -271,6 +314,7 @@
// 鍙戦�佹搷浣滄垚鍔熺殑浜嬩欢
emit('event_dev_install')
message.success(t('鎿嶄綔鎴愬姛'))
+ return true
} finally {
formLoading.value = false
}
@@ -321,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
@@ -344,7 +389,6 @@
formData.value.patId = tempPatId;
getReadyRentInfo(formData.value)
- copyBarcode()
}
// 鑾峰彇鎮h�呯殑棰嗙敤淇℃伅
@@ -435,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) => {
@@ -474,52 +538,58 @@
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)
+})
- // 銆愭湰娆′慨澶嶃�戙�屾偅鑰呮潯鐮佹樉绀恒�嶆湭閰嶇疆锛坣ull/绌猴級鈫� 涓嶆樉绀猴紙鎸夌幇鍦虹‘璁ゅ彛寰勶級
- const displayBarcode: number[] | undefined = checkTypeStore.getCheckTypeDispBarCode(formData.value.checkType!)
- if (displayBarcode == null || displayBarcode.length === 0)
- 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)
+})
- // 銆愭湰娆′慨澶嶃�戞潵婧愪紭鍏堝彇 patDetails.source锛岀己澶辨椂鍥為��鍒板钩閾虹殑 patSrc
- // 锛堝師鏉ョ洿鎺ュ彇 patDetails.source锛宲atDetails 缂哄け鏃� `.includes` 杩樹細鎶涘紓甯革級
- const patSource = formData.value.patDetails?.source ?? formData.value.patSrc
- if (patSource == null)
- return ""
- if (!displayBarcode.map(Number).includes(Number(patSource)))
- return ""
+/** 鏉$爜 / 澶嶅埗鐨勫唴瀹癸細缁熶竴鍙栥�屽氨璇婃祦姘村彿銆� */
+const barcodeContent = computed<string>(() =>
+ barcodeEnabled.value ? (formData.value.episodeId ?? '') : ''
+)
- return getBarcode()
-}
+/** 鏄惁鏄剧ず鏉$爜锛氫綇闄紙鏉ユ簮 3锛変笉鏄剧ず锛涘唴瀹逛负绌烘椂涔熶笉鏄剧ず */
+const showBarCode = computed<boolean>(
+ () => barcodeEnabled.value && patSourceValue.value !== 3 && barcodeContent.value !== ''
+)
-const getBarcode = (): string => {
- if (!formData.value.checkType)
- return ""
-
- const patSource = formData.value.patDetails?.source ?? formData.value.patSrc
- if (patSource == null)
- return ""
-
- // 闂ㄨ瘖/鎬ヨ瘖 鈫� 鐢宠鍗曞彿锛涗綇闄�/浣撴 鈫� 灏辫瘖娴佹按鍙�
- if (1 === Number(patSource) || 2 === Number(patSource))
- return formData.value.applyNo ?? ""
- else if (3 === Number(patSource) || 4 === Number(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>
@@ -542,7 +612,7 @@
}
&__text {
- font-size: 14px;
+ font-size: 15px;
font-weight: 600;
color: var(--el-text-color-primary);
}
@@ -619,4 +689,22 @@
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