From 09dc74e264b6262cbe41c9c8476e24705871d4a6 Mon Sep 17 00:00:00 2001
From: yxh <172933527@qq.com>
Date: 星期日, 08 十一月 2026 23:31:17 +0800
Subject: [PATCH] yxh
---
src/views/ecg/doctor/components/DevInstallPanel.vue | 599 ++++++++++++++++++++++++++++++++++++++++++-----------------
1 files changed, 429 insertions(+), 170 deletions(-)
diff --git a/src/views/ecg/doctor/components/DevInstallPanel.vue b/src/views/ecg/doctor/components/DevInstallPanel.vue
index 9253690..7ba56dd 100644
--- a/src/views/ecg/doctor/components/DevInstallPanel.vue
+++ b/src/views/ecg/doctor/components/DevInstallPanel.vue
@@ -1,88 +1,96 @@
<template>
- <el-form
- ref="formRef"
- :model="formData"
- :rules="formRules"
- label-width="100px"
- v-loading="formLoading"
- >
- <el-form-item label="妫�鏌ラ」鐩�" prop="">
- {{formData.checkType && checkTypeStore.getCheckTypeName(formData.checkType)}}
- </el-form-item>
- <el-row :gutter="20">
- <el-col :span="12">
- <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="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="璇疯緭鍏ユ偅鑰呭悕绉�" />
- </el-form-item>
- <el-form-item label="鎮h�呮弿杩�" prop="patDeptDesc">
- <dict-tag :type="DICT_TYPE.ECG_PAT_SOURCE" :value="formData.patSrc" />
- {{formData.patDetails?.deptDesc}} {{formData.patDetails?.wardDesc}} {{formData.patDetails?.bedNo}}
- </el-form-item>
- <el-form-item label="瑁呮満鏃堕棿" prop="rentTime">
- <el-date-picker
- v-model="formData.rentTime"
- type="date"
- value-format="x"
- placeholder="閫夋嫨瑁呮満鏃堕棿"
- />
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="璁惧缂栧彿" prop="devId">
- <el-input v-model="formData.devId" placeholder="璇疯緭鍏ヨ澶囩紪鍙�" @input="getDevInfo"/>
- </el-form-item>
- <el-form-item label="璁惧鎻忚堪" prop="">
- {{formData.brand + " " + formData.model + " " + tranlateDevState(formData.state)}}
- </el-form-item>
- <el-form-item label="澶囨敞" prop="remark">
- <el-input v-model="formData.remark" placeholder="璇疯緭鍏ュ娉�" />
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <el-button @click="submitForm" type="primary" :disabled="formLoading">瑁呮満瀹屾垚</el-button>
- <el-button @click="resetForm()">閲� 缃�</el-button>
- <el-button @click="cancelInstall" :disabled="formLoading">鏀惧純瑁呮満</el-button>
+ <el-form class="patient-compact-form" ref="formRef" :model="formData" :rules="formRules" label-width="100px" v-loading="formLoading">
+ <!-- ===== 缂栬緫鍖猴紙闇�瑕佸綍鍏ョ殑瀛楁锛�===== -->
+ <el-row :gutter="20">
+ <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 :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="showBarCode" :value="barcodeContent" :width=100 />
+ <el-button v-if="showCopyButton" :disabled="!barcodeContent" @click="copyBarcode()">澶嶅埗</el-button>
+ </el-form-item>
+ </el-col>
+ <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-form-item>
+ </el-col>
+ </el-row>
+
+ <!-- ===== 鎮h�呬俊鎭紙闇�姹�1锛�18 椤圭粺涓�灞曠ず锛屼竴琛屽洓鍒楋級=====
+ 鍚庣 DevRentRespVO 宸蹭粠棰勭害鍗曞钩閾哄洖濉紝setPatient 宸茶祴鍊煎埌 formData -->
+ <PatientInfoBlock :data="formData" check-type-field="checkType" :span="6" />
+
+ <!-- ===== 璁惧淇℃伅锛堜竴琛屽洓鍒楋級===== -->
+ <DeviceInfoBlock :data="formData" :device="devInfo" time-label-mode="install" :span="6">
+ <template #rentTime>
+ <el-date-picker v-model="formData.rentTime" type="date" value-format="x" placeholder="閫夋嫨瑁呮満鏃堕棿" />
+ </template>
+ </DeviceInfoBlock>
+
+ <el-form-item label="澶囨敞" prop="remark">
+ <el-input v-model="formData.remark" placeholder="璇疯緭鍏ュ娉�" />
+ </el-form-item>
+ </el-form>
+ <div class="patient-actions">
+ <el-button size="small" @click="submitForm" type="primary" :disabled="formLoading">瑁呮満瀹屾垚</el-button>
+ <el-button size="small" @click="resetForm()">閲� 缃�</el-button>
+ <el-button size="small" @click="cancelInstall" :disabled="formLoading">鏀惧純瑁呮満</el-button>
+ </div>
<!-- 鍖荤敓瑁呮満鍒楄〃 -->
- <ContentWrap>
- <el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true" @row-click="onRowClick" >
- <el-table-column label="id" align="center" prop="id" />
- <el-table-column label="瑁呮満鎯呭喌" align="center" prop="lost" >
+ <!-- 銆愭湰娆¢渶姹傘�戞搷浣滃姛鑳藉尯涓庡凡瀹屾垚璁板綍涔嬮棿鐨勬爣棰樻爮 -->
+ <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">
+ <el-table
+ v-loading="loading"
+ :data="list"
+ :stripe="true"
+ :show-overflow-tooltip="true"
+ @row-click="onRowClick"
+ >
+ <!-- 闇�姹�11锛堜慨姝o級锛氥�屾挙閿�銆嶄綔涓�**宸插畬鎴愯鏈鸿褰曞垪琛ㄧ殑绗竴鍒�**锛堣〃澶存彃妲斤級锛�
+ 鍙嚭鐜颁竴娆★紝浣滅敤浜庢渶杩戜竴浣嶅凡瀹屾垚鎮h�咃紝璇箟涓庡悗绔� lastFinishedPatient 涓�鑷淬�� -->
+ <el-table-column label="鎾ら攢" align="center" width="90px" fixed="left">
+ <template #header>
+ <el-button
+ link
+ type="warning"
+ :disabled="undoDisabled"
+ :loading="undoLoading"
+ @click="$emit('event_undo_finish')"
+ >
+ 鎾ら攢
+ </el-button>
+ </template>
+ </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>
-<!-- <el-table-column label="浣滀笟绫诲瀷" align="center" prop="jobType" />-->
-<!-- <el-table-column label="鍖荤敓缂栧彿" align="center" prop="docId" />-->
+ <!-- <el-table-column label="浣滀笟绫诲瀷" align="center" prop="jobType" />-->
+ <!-- <el-table-column label="鍖荤敓缂栧彿" align="center" prop="docId" />-->
<el-table-column label="鍖荤敓鍚嶇О" align="center" prop="docName" />
<el-table-column label="璁惧缂栧彿" align="center" prop="devId" />
<el-table-column label="鎮h�呯紪鍙�" align="center" prop="patId" />
<el-table-column label="鎮h�呭悕绉�" align="center" prop="patName" />
- <el-table-column
- label="浣滀笟鏃堕棿"
- align="center"
- prop="jobTime"
- :formatter="dateFormatter"
- width="180px"
- />
+ <el-table-column label="浣滀笟鏃堕棿" align="center" prop="jobTime" :formatter="dateFormatter" width="180px" />
<el-table-column label="浣滀笟姒傝" align="center" prop="summary" />
<el-table-column label="澶囨敞" align="center" prop="remark" />
- <el-table-column
- label="鍒涘缓鏃堕棿"
- align="center"
- prop="createTime"
- :formatter="dateFormatter"
- width="180px"
- />
- <el-table-column label="鎿嶄綔" align="center" min-width="120px">
+ <el-table-column label="鍒涘缓鏃堕棿" align="center" prop="createTime" :formatter="dateFormatter" width="180px" />
+ <!-- <el-table-column label="鎿嶄綔" align="center" min-width="120px">
<template #default="scope">
<el-button
link
@@ -101,68 +109,88 @@
鍒犻櫎
</el-button>
</template>
- </el-table-column>
+ </el-table-column>-->
</el-table>
+ </ContentWrap>
<!-- 鍒嗛〉 -->
<Pagination
- :total="total"
- v-model:page="queryParams.pageNo"
- v-model:limit="queryParams.pageSize"
- @pagination="getList"
+ :total="total"
+ v-model:page="queryParams.pageNo"
+ v-model:limit="queryParams.pageSize"
+ @pagination="getList"
/>
- </ContentWrap>
+ </div>
</template>
<script setup lang="ts">
import { DevRentApi, DevRentVO } from '@/api/ecg/devrent'
-import {dateFormatter} from "@/utils/formatTime";
-import {JobRecordApi, JobRecordVO} from "@/api/ecg/jobrecord";
-import {isStringEmpty} from "@/utils/stringUtil";
-import {curDayEnd, curDayStart} from "@/utils/dateUtil";
-import {DeviceApi} from "@/api/ecg/devmanage";
-import {QueueVO} from "@/api/ecg/queue";
-import {RoomBedVO} from "@/api/ecg/doctor";
-import {Barcode} from "@/components/Barcode";
-import {useCheckTypeStore} from "@/store/modules/checkType";
-import {DICT_TYPE} from "@/utils/dict";
-import {tranlateDevState} from "../../../../utils/statusFormatter";
+import { dateFormatter } from "@/utils/formatTime";
+import { JobRecordApi, JobRecordVO } from "@/api/ecg/jobrecord";
+import { isStringEmpty } from "@/utils/stringUtil";
+import { curDayEnd, curDayStart } from "@/utils/dateUtil";
+import { DeviceApi, DeviceVO } from "@/api/ecg/devmanage";
+import { QueueVO } from "@/api/ecg/queue";
+import { RoomBedVO } from "@/api/ecg/doctor";
+import { Barcode } from "@/components/Barcode";
+import { useCheckTypeStore } from "@/store/modules/checkType";
+import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
+import { tranlateDevState } from "../../../../utils/statusFormatter";
+import { getCheckTypeName, needDevReady } from "../../../../utils/checkTypeFormatter";
+import { useRoomStore } from '@/store/modules/room'
+// 闇�姹�1锛氭偅鑰呬俊鎭� 18 椤圭粺涓�灞曠ず鍧�
+import PatientInfoBlock from "@/views/ecg/doctor/components/PatientInfoBlock.vue";
+import DeviceInfoBlock from "@/views/ecg/doctor/components/DeviceInfoBlock.vue";
/** 璁惧瑁呮満 琛ㄥ崟 */
defineComponent({ name: 'DevInstallPanel' })
-const props = defineProps({
+const props = defineProps({
room: {
type: Object as PropType<RoomBedVO>,
required: true
+ },
+ /** 闇�姹�11锛氳褰曞垪琛ㄧ涓�鍒椼�屾挙閿�銆嶆寜閽殑绂佺敤鎬侊紙鐢辩埗椤甸潰鎺у埗锛� */
+ undoDisabled: {
+ type: Boolean,
+ required: false,
+ default: false
+ },
+ /** 闇�姹�11锛氳褰曞垪琛ㄧ涓�鍒椼�屾挙閿�銆嶆寜閽殑 loading锛堢敱鐖堕〉闈㈡帶鍒讹級 */
+ undoLoading: {
+ type: Boolean,
+ required: false,
+ default: false
}
})
-const emit = defineEmits(['event_dev_install']) // 瀹氫箟 success 浜嬩欢锛岀敤浜庢搷浣滄垚鍔熷悗鐨勫洖璋�
-
-const checkTypeStore = useCheckTypeStore()
-
-const setPatient = (queueVO: QueueVO | undefined) => {
- resetForm()
- formData.value.applyNo = queueVO?.applyNo
- formData.value.episodeId = queueVO?.episodeId
- formData.value.patId = queueVO?.patId
- formData.value.patName = queueVO?.patName
- formData.value.checkType = queueVO?.bookCheckType
- formData.value.patSrc = queueVO?.patDetails.source
- getReadyRentInfo(formData.value)
- copyBarcode()
-}
-defineExpose({ setPatient }) // 鎻愪緵 setPatient 鏂规硶锛岀敤浜庤缃偅鑰�
+const emit = defineEmits(['event_dev_install', 'event_undo_finish'])
const { t } = useI18n() // 鍥介檯鍖�
const message = useMessage() // 娑堟伅寮圭獥
-const dialogVisible = ref(false) // 寮圭獥鐨勬槸鍚﹀睍绀�
+const formRef = ref() // 琛ㄥ崟 Ref
+
const formLoading = ref(false) // 琛ㄥ崟鐨勫姞杞戒腑锛�1锛変慨鏀规椂鐨勬暟鎹姞杞斤紱2锛夋彁浜ょ殑鎸夐挳绂佺敤
-const formData = ref({})
+const formData = ref<Partial<DevRentVO>>({
+ applyNo: undefined,
+ episodeId: undefined,
+ patId: '',
+ patName: '',
+ rentTime: new Date().getTime(),
+ devId: '',
+ remark: '',
+ checkType: undefined,
+})
+
+const devInfo = ref<Partial<DeviceVO>>({
+ category: undefined,
+ brand: undefined,
+ model: undefined,
+ state: undefined,
+})
const formRules = reactive({
devId: [{ required: true, message: '璁惧缂栧彿涓嶈兘涓虹┖', trigger: 'blur' }],
@@ -170,27 +198,77 @@
patId: [{ required: true, message: '鎮h�呬笉鑳戒负绌�', trigger: 'blur' }],
patName: [{ required: true, message: '鎮h�呭悕涓嶈兘涓虹┖', trigger: 'blur' }]
})
-const formRef = ref() // 琛ㄥ崟 Ref
-const displayBarCode = ref<string> ()
+
+const checkTypeStore = useCheckTypeStore()
+
+const setPatient = (queueVO: QueueVO | undefined | null) => {
+ console.log("setPatient...", queueVO)
+ resetForm()
+ formData.value.applyNo = queueVO?.applyNo
+ formData.value.episodeId = queueVO?.episodeId
+ formData.value.patId = queueVO?.patId
+ formData.value.patName = queueVO?.patName
+ formData.value.checkType = queueVO?.bookCheckType
+ formData.value.tolerance = queueVO?.tolerance // 澶氳�愯嵂锛屽悗绔粠棰勭害鍗曡ˉ榻�
+ // 闇�姹�1锛氫互涓嬪钩閾哄瓧娈电敱鍚庣浠庨绾﹀崟鍥炲~鍒� QueueRespVO锛�
+ // 蹇呴』鏄惧紡璧嬪�肩粰 formData锛屽惁鍒欐ā鏉块噷璇讳笉鍒般��
+ formData.value.patGender = queueVO?.patGender
+ formData.value.patBirthday = queueVO?.patBirthday
+ formData.value.registerDate = queueVO?.registerDate
+ 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
+ formData.value.patBedNo = queueVO?.patBedNo
+ formData.value.medicalCard = queueVO?.medicalCard
+ formData.value.outpatientNo = queueVO?.outpatientNo
+ // 闇�姹�1锛氬尰鍢卞彿锛堟鍓� 3 涓潰鏉块兘閬楁紡浜嗚瀛楁鐨勮祴鍊硷紝瀵艰嚧 PatientInfoBlock 鎭掓樉绀� '-'锛�
+ formData.value.doctorAdviceNo = queueVO?.doctorAdviceNo
+ formData.value.patIdentityId = queueVO?.patIdentityId
+ getReadyRentInfo(formData.value) // 鑾峰彇棰嗙敤淇℃伅
+}
+defineExpose({ setPatient, getList: () => getList() }) // 鎻愪緵 setPatient 鏂规硶锛岀敤浜庤缃偅鑰�
+
/** 鎻愪氦琛ㄥ崟 */
const submitForm = async () => {
+ // 銆愬畧鍗�戣鏈哄彈鐞嗙殑鏄�屽凡棰嗙敤銆嶆偅鑰咃紝鍏舵鏌ラ」鐩繀椤诲睘浜庨渶瑕佽澶囬鐢ㄧ殑娴佺▼銆�
+ // 涓� DevReadyPanel 鍚屼竴瀹堝崼锛歚check_type.need_dev_ready` 鍦ㄥ悗绔粠鏈鏍¢獙锛�
+ // 浜哄伐鎶婂父瑙勫績鐢靛浘杩欑被鎮h�呮媺杩涙潵浼氶�犳垚"妫�鏌ョ被鎮h�呭嚭鐜板湪璁惧娴佺▼"鐨勬贩涔便��
+ if (formData.value.checkType != null && !needDevReady(formData.value.checkType)) {
+ const ctName = getCheckTypeName(formData.value.checkType) || String(formData.value.checkType)
+ message.warning(
+ `銆�${ctName}銆嶄笉闇�瑕佽澶囬鐢紝涓嶈兘鍔炵悊瑁呮満銆傝纭鏄惁搴斿埌銆屽彨鍙锋鏌ャ�嶉〉闈㈠鐞嗚鎮h�呫�俙
+ )
+ return
+ }
+
// 鏍¢獙琛ㄥ崟
await formRef.value.validate()
// 鎻愪氦璇锋眰
formLoading.value = true
try {
+ if (null == formData.value)
+ return
+
formData.value.roomId = props.room.roomId
formData.value.bedNo = props.room.bedNo
const data = formData.value as unknown as DevRentVO
await DevRentApi.devInstall(data)
- message.success(t('鎿嶄綔鎴愬姛'))
- dialogVisible.value = false
- // 鍙戦�佹搷浣滄垚鍔熺殑浜嬩欢
- emit('event_dev_install')
+
resetForm()
getList()
+
+ // 鍙戦�佹搷浣滄垚鍔熺殑浜嬩欢
+ emit('event_dev_install')
+ message.success(t('鎿嶄綔鎴愬姛'))
} finally {
formLoading.value = false
}
@@ -203,72 +281,109 @@
devId: undefined,
patId: undefined,
patName: undefined,
- patDeptCode: undefined,
- patDeptDesc: undefined,
- patWardCode: undefined,
- patWardDesc: undefined,
- patBedNo: undefined,
rentTime: new Date().getTime(),
returnTime: undefined,
+ tolerance: undefined,
interference: undefined,
baseline: undefined,
detachment: undefined,
remark: undefined,
- category: '',
- brand: '',
- model: '',
- state: -1,
+ checkType: undefined,
+ // 闇�姹�1锛歅atientInfoBlock 渚濊禆鐨勫钩閾哄瓧娈碉紙鐢� setPatient 浠� QueueVO 璧嬪�硷級
+ applyNo: undefined,
+ episodeId: undefined,
+ patGender: undefined,
+ patBirthday: undefined,
+ registerDate: undefined,
+ doctor: undefined,
+ doctorTime: undefined,
+ patSrc: undefined,
+ patMobile: undefined,
+ patPhone: undefined,
+ patWardDesc: undefined,
+ patBedNo: undefined,
+ medicalCard: undefined,
+ doctorAdviceNo: undefined,
+ outpatientNo: undefined,
+ patIdentityId: undefined,
+ status: undefined,
+ seqNum: undefined,
}
formRef.value?.resetFields()
+ devInfo.value = {
+ category: undefined,
+ brand: undefined,
+ model: undefined,
+ state: undefined,
+ }
}
const getDevInfo = async () => {
- if (isStringEmpty(formData.value.devId)) {
- formData.value.category = ""
- formData.value.brand = ""
- formData.value.model = ""
- formData.value.state = -1
+ if (formData.value?.devId == null) {
+ devInfo.value.brand = undefined
+ devInfo.value.model = undefined
+ devInfo.value.state = undefined
return
}
- const data = await DeviceApi.getDeviceByDevId(formData.value.devId!)
- console.info( data )
- formData.value.category = data?.category || ""
- formData.value.brand = data?.brand || ""
- formData.value.model = data?.model || ""
- formData.value.state = data?.state || -1
+ const data = await DeviceApi.getDeviceByDevId(formData.value?.devId)
+ if (null !== data)
+ devInfo.value = data
}
const getRentInfoByPatId = () => {
- const tempPatId = formData.value.patId;
+ if (null == formData.value?.patId)
+ return;
+
+ const tempPatId = formData.value?.patId;
resetForm()
if (isStringEmpty(tempPatId))
return
formData.value.patId = tempPatId;
getReadyRentInfo(formData.value)
- copyBarcode()
}
+// 鑾峰彇鎮h�呯殑棰嗙敤淇℃伅
const getReadyRentInfo = async (devRentVO) => {
- const data = await DevRentApi.getReadyRent(devRentVO)
- if (null === data)
+ if ((devRentVO.devId == null || devRentVO.devId === '') && (devRentVO.patId == null || devRentVO.patId === ''))
return
- // formData.value = data //涓嶈兘鏁翠釜璧嬪�硷紝 榛樿瑁呮満鏃堕棿琚竻绌�
- formData.value.id = data.id;
- formData.value.applyNo = data.applyNo;
- formData.value.episodeId = data.episodeId;
- //formData.value.devId = data.devId // 璁╁尰鐢熸墜鍔ㄨ緭鍏ワ紝閬垮厤鍑洪敊
- formData.value.category = data.category
- formData.value.brand = data.brand
- formData.value.model = data.model
- formData.value.patDetails = data.patDetails
+ const data = await DevRentApi.getReadyRent(devRentVO)
+ if (data == null)
+ return
+
+ // 鈿狅笍 鍘熷疄鐜版槸鏁翠綋鏇挎崲 formData锛屼細鎶婃偅鑰呬俊鎭啿鎴� null锛�
+ // 瀹炴祴 GET /ecg/dev-rent/get 鐨勫搷搴旈噷锛岄櫎 patName 澶栫殑鎮h�呭瓧娈靛叏鏄� null
+ // 锛坉ev_rent 琛ㄤ笉瀛樿繖浜涘垪锛屼笖璇ヨ矾寰勬湭浠� appointment 鍥炲~锛夈��
+ // 鏁呮敼涓恒�屽彧瑕嗙洊闈炵┖瀛楁銆嶏紝淇濈暀宸插洖濉殑鎮h�呬俊鎭紙PatientInfoBlock 渚濊禆锛夈��
+ const _merged = { ...formData.value } as Record<string, any>
+ Object.keys(data as Record<string, any>).forEach((k) => {
+ const v = (data as Record<string, any>)[k]
+ if (v !== null && v !== undefined && v !== '') _merged[k] = v
+ })
+ formData.value = _merged as typeof formData.value //涓嶈兘鏁翠釜璧嬪�硷紝 榛樿瑁呮満鏃堕棿琚竻绌�
+ if (formData.value == null)
+ return
+
+ // 榛樿瑁呮満鏃堕棿 閲囩敤褰撳墠鏃ユ湡
+ formData.value.rentTime = new Date().getTime()
+
+ // 璁╁尰鐢熸墜鍔ㄨ緭鍏ワ紝閬垮厤鍑洪敊
+ formData.value.devId = ''
+ devInfo.value.category = undefined
+ devInfo.value.brand = undefined
+ devInfo.value.model = undefined
+ devInfo.value.state = undefined
}
const loading = ref(true) // 鍒楄〃鐨勫姞杞戒腑
const list = ref<JobRecordVO[]>([]) // 鍒楄〃鐨勬暟鎹�
const total = ref(0) // 鍒楄〃鐨勬�婚〉鏁�
+// 褰撳墠璇婂淇℃伅锛堢敤浜庡彇璇婂寮�灞曠殑妫�鏌ラ」鐩仛鍏滃簳锛岃 syncRoomCheckTypes锛�
+const roomStore = useRoomStore()
+
+
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
@@ -281,10 +396,37 @@
jobTime: [curDayStart(), curDayEnd()],
summary: undefined,
remark: undefined,
- createTime: []
+ createTime: [],
+ // ========================================================================
+ // 鎸�**褰撳墠璇婂寮�灞曠殑妫�鏌ラ」鐩�**闅旂宸插畬鎴愯褰曘��
+ //
+ // 鑳屾櫙锛歚job_record` 琛ㄥ彧鏈� doc_id + check_type锛�**娌℃湁 room_id**锛�
+ // 鑰� /ecg/job-record/doctor-page 鏄己鍒舵寜鐧诲綍鍖荤敓鏌�"鑷繁鐨勮褰�"銆�
+ // 浜庢槸鍚屼竴鍖荤敓鍦ㄥ涓瘖瀹ゅ潗璇婃椂锛堝 1鍙烽棬璇� ct=[100,1100]銆�6鍙烽棬璇� ct=[400] 骞虫澘杩愬姩蹇冪數锛夛紝
+ // 鍙彿妫�鏌ラ〉浼氭妸**澶氫釜璇婂鐨勮褰曟贩鍦ㄤ竴璧�**鏄剧ず 鈥斺�� 姝f槸鐢ㄦ埛鍙嶉鐨勭幇璞°��
+ //
+ // 鐢卞悇椤甸潰锛圧outine.vue / index.vue / DevInstall.vue锛夊湪 onMounted 鏃�
+ // 鐢ㄥ綋鍓嶈瘖瀹ょ殑 checkTypes 璧嬪�硷紝骞跺湪姣忔鏌ヨ鍓嶅悓姝ワ紝纭繚鍒囪瘖瀹ゅ悗绔嬪嵆鐢熸晥銆�
+ // ========================================================================
+ checkTypes: undefined as number[] | undefined
})
+
+/**
+ * 鎶娿�屽綋鍓嶈瘖瀹ゅ紑灞曠殑妫�鏌ラ」鐩�嶅悓姝ュ埌鏌ヨ鏉′欢锛屽疄鐜板凡瀹屾垚璁板綍鎸夎瘖瀹ら殧绂汇��
+ * 瑙� queryParams.checkTypes 鐨勮鏄庛��
+ */
+const syncRoomCheckTypes = () => {
+ // 浼樺厛鐢ㄩ〉闈紶鍏ョ殑璇婂淇℃伅锛涗负绌烘椂鍥為��鍒� store锛堟洿鍙潬锛岃 TitlePanel 鍚屽璇存槑锛�
+ const fromProp = props.room?.checkTypes
+ const types = (Array.isArray(fromProp) && fromProp.length > 0)
+ ? fromProp
+ : roomStore.room?.checkTypes
+ queryParams.checkTypes = (Array.isArray(types) && types.length > 0) ? [...types] : undefined
+}
/** 鏌ヨ鍒楄〃 */
const getList = async () => {
+ // 鏌ヨ鍓嶅悓姝ュ綋鍓嶈瘖瀹ゅ紑灞曠殑妫�鏌ラ」鐩紝淇濊瘉鍙樉绀烘湰璇婂鐨勮褰�
+ syncRoomCheckTypes()
loading.value = true
try {
const data = await JobRecordApi.getJobRecordDoctorPage(queryParams)
@@ -297,11 +439,18 @@
const onRowClick = (cur) => {
if (cur !== null)
- getSelectedRent( cur.rentId )
+ getSelectedRent(cur.rentId)
}
const getSelectedRent = async (rentId) => {
- formData.value = await DevRentApi.getDevRent(rentId)
+ const data = await DevRentApi.getDevRent(rentId)
+
+ formData.value = data
+
+ devInfo.value.category = data.category
+ devInfo.value.brand = data.brand
+ devInfo.value.model = data.model
+ devInfo.value.state = data.devState
}
const cancelInstall = async () => {
@@ -322,32 +471,45 @@
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 (!displayBarcode.includes( formData.value.patSrc ))
- 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 !== ''
+)
- if (1 === formData.value.patSrc || 2 === formData.value.patSrc)
- return formData.value.applyNo??""
- else if (3 === formData.value.patSrc || 4 === formData.value.patSrc)
- 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
+ await navigator.clipboard.writeText(barcodeContent.value)
}
/** 鍒濆鍖� **/
@@ -357,3 +519,100 @@
})
</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: 14px;
+ font-weight: 600;
+ color: var(--el-text-color-primary);
+ }
+}
+/* ==========================================================================
+ 闇�姹傦細琛ㄥ崟鍐呭鎸ゅ崰浜嗕笅鏂硅褰曡〃鏍肩殑绌洪棿 鈥斺�� 鍘嬬缉琛岄棿璺濄��
+ Element Plus 榛樿 `.el-form-item { margin-bottom: 18px }`锛�
+ 鏈〉琛ㄥ崟鍚� 18 椤规偅鑰呬俊鎭紙4 鍒� = 5 琛岋級+ 9 椤硅澶囦俊鎭紝
+ 浠呴棿璺濆氨瑕佷笂鐧� px锛屾妸 el-table 鎸ゅ埌鐪嬩笉瑙併��
+ 杩欓噷缁熶竴鍘嬪埌 4px銆傛敞鎰� :deep 鏄繀闇�鐨勶紙el-form-item 鏄湰缁勪欢鐨勫瓙缁勪欢娓叉煋锛夈��
+ ========================================================================== */
+.patient-compact-form :deep(.el-form-item) {
+ margin-bottom: 4px;
+}
+
+/* ==========================================================================
+ 鎮h�呬俊鎭浐瀹氬湪鍐呭鍖洪《閮ㄣ��
+ 鍐呭鍖鸿嚜韬笉婊氬姩锛堟粴鍔ㄦ潯鍦ㄨ褰曡〃鏍间笂锛夛紝鍥犳**涓嶉渶瑕� position:sticky** 鈥斺��
+ 鐩存帴浣滀负 flex 鐨勫浐瀹氶」锛坒lex:none锛夊嵆鍙缁堢暀鍦ㄩ《閮ㄣ��
+ 鑳屾櫙涓嶉�忔槑锛屼繚璇佷笌涓嬫柟璁板綍琛ㄦ牸瑙嗚鍒嗙銆�
+ ========================================================================== */
+:deep(.doctor-page__content) > .patient-compact-form {
+ flex: none;
+ padding-bottom: 4px;
+ background-color: var(--el-bg-color);
+ border-bottom: 1px solid var(--el-border-color-lighter);
+}
+
+
+
+/* ==========================================================================
+ 鎮h�呬俊鎭浐瀹氬湪鍐呭鍖洪《閮ㄣ��
+ 鍐呭鍖猴紙.doctor-page__content锛夎嚜韬粴鍔紝鎵�浠ヨ繖閲屽繀椤荤敤 position:sticky
+ 鎵嶈兘璁� 18 椤规偅鑰呬俊鎭湪璁板綍鍒楄〃婊氬姩鏃朵繚鎸佸彲瑙併��
+ 鑳屾櫙涓嶉�忔槑锛岄伩鍏嶆粴鍔ㄥ唴瀹逛粠琛ㄥ崟椤归棿闅欓�忓嚭銆�
+ ========================================================================== */
+:deep(.doctor-page__content) > .patient-compact-form {
+ position: sticky;
+ top: 0;
+ z-index: 3;
+ padding-bottom: 4px;
+ background-color: var(--el-bg-color);
+ border-bottom: 1px solid var(--el-border-color-lighter);
+}
+
+/* ==========================================================================
+ 鎮h�呮搷浣滃姛鑳藉潡锛氫綅浜庛�屾偅鑰呬俊鎭�嶄笌銆屽凡瀹屾垚璁板綍鍒楄〃銆嶄箣闂达紝鐙珛鎴愬潡銆�
+ 闇�姹傦細鍚勫姛鑳芥寜閽紙妫�鏌ュ畬鎴� / 鏀惧純妫�鏌� / 閲嶇疆 / 鐭ユ儏鍚屾剰涔� 鈥︼級**鎺掑湪涓�琛�**銆�
+ 鍋氭硶锛歠lex + gap锛屽苟 **绂佹鎹㈣**锛坒lex-wrap:nowrap锛夛紱
+ 鎸夐挳鐢� size="small" 浠ュ绾冲叏閮ㄦ寜閽紱鍗充娇瀹藉害涓嶈冻涔熶笉鎶樿銆�
+ 涓婁笅杈规 + 搴曡壊锛屼娇瀹冧笌鎮h�呬俊鎭�佽褰曞垪琛ㄥ湪瑙嗚涓婂垎鍖恒��
+ ========================================================================== */
+.patient-actions {
+ display: flex;
+ flex: none;
+ /* 鎸夐挳澶氭椂鍏佽鎹㈣锛岄伩鍏嶆尋鍦ㄤ竴琛岋紙妫�鏌ラ〉鏈�澶� 6 涓寜閽級 */
+ flex-wrap: wrap;
+ gap: 8px;
+ align-items: center;
+ /*
+ 銆愭湰娆¢渶姹傘�戞搷浣滃姛鑳藉尯鍋氫竴鐐硅瑙夊尯鍒嗭紝鏂逛究鍖荤敓涓�鐪煎畾浣嶏細
+ 鏋佹祬鐨勪富鑹插簳 + 缁嗚竟妗� + 宸︿晶 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;
+ }
+}
+</style>
--
Gitblit v1.9.3