From df2c4a7a693323a43dc74168a780a52c69e41c1b Mon Sep 17 00:00:00 2001
From: eight <641137800@qq.com>
Date: 星期四, 10 四月 2025 16:11:10 +0800
Subject: [PATCH] update
---
src/api/ecg/devrent/index.ts | 1
src/views/ecg/doctor/components/DevInstallPanel.vue | 158 ++++++++++++++++++++++++---------------
src/views/ecg/doctor/components/DevReadyPanel.vue | 60 ++++++++++-----
3 files changed, 136 insertions(+), 83 deletions(-)
diff --git a/src/api/ecg/devrent/index.ts b/src/api/ecg/devrent/index.ts
index 6965373..05509e3 100644
--- a/src/api/ecg/devrent/index.ts
+++ b/src/api/ecg/devrent/index.ts
@@ -18,7 +18,6 @@
detachment: string | undefined // 鑴辫惤
remark: string | undefined // 澶囨敞
paid: number | undefined
- patSrc: number | undefined // 鎮h�呮潵婧�
roomId: number | undefined | null
bedNo: string | undefined | null
}
diff --git a/src/views/ecg/doctor/components/DevInstallPanel.vue b/src/views/ecg/doctor/components/DevInstallPanel.vue
index 9253690..b81c3de 100644
--- a/src/views/ecg/doctor/components/DevInstallPanel.vue
+++ b/src/views/ecg/doctor/components/DevInstallPanel.vue
@@ -7,7 +7,7 @@
v-loading="formLoading"
>
<el-form-item label="妫�鏌ラ」鐩�" prop="">
- {{formData.checkType && checkTypeStore.getCheckTypeName(formData.checkType)}}
+ {{formData?.checkType && checkTypeStore.getCheckTypeName(formData?.checkType)}}
</el-form-item>
<el-row :gutter="20">
<el-col :span="12">
@@ -20,9 +20,9 @@
<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 label="鎮h�呮弿杩�" prop="patDetails">
+ <dict-tag :type="DICT_TYPE.ECG_PAT_SOURCE" :value="formData.patDetails?.source ||''" />
+ {{formData?.patDetails?.deptDesc}} {{formData?.patDetails?.wardDesc}} {{formData?.patDetails?.bedNo}}
</el-form-item>
<el-form-item label="瑁呮満鏃堕棿" prop="rentTime">
<el-date-picker
@@ -38,7 +38,7 @@
<el-input v-model="formData.devId" placeholder="璇疯緭鍏ヨ澶囩紪鍙�" @input="getDevInfo"/>
</el-form-item>
<el-form-item label="璁惧鎻忚堪" prop="">
- {{formData.brand + " " + formData.model + " " + tranlateDevState(formData.state)}}
+ {{devInfo?.brand || '-'}} {{devInfo?.model || '-' }} {{tranlateDevState(devInfo?.state)}}
</el-form-item>
<el-form-item label="澶囨敞" prop="remark">
<el-input v-model="formData.remark" placeholder="璇疯緭鍏ュ娉�" />
@@ -82,7 +82,7 @@
:formatter="dateFormatter"
width="180px"
/>
- <el-table-column label="鎿嶄綔" align="center" min-width="120px">
+<!-- <el-table-column label="鎿嶄綔" align="center" min-width="120px">
<template #default="scope">
<el-button
link
@@ -101,7 +101,7 @@
鍒犻櫎
</el-button>
</template>
- </el-table-column>
+ </el-table-column>-->
</el-table>
<!-- 鍒嗛〉 -->
<Pagination
@@ -120,7 +120,7 @@
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 {DeviceApi, DeviceVO} from "@/api/ecg/devmanage";
import {QueueVO} from "@/api/ecg/queue";
import {RoomBedVO} from "@/api/ecg/doctor";
import {Barcode} from "@/components/Barcode";
@@ -138,6 +138,43 @@
}
})
+const { t } = useI18n() // 鍥介檯鍖�
+const message = useMessage() // 娑堟伅寮圭獥
+
+const dialogVisible = ref(false) // 寮圭獥鐨勬槸鍚﹀睍绀�
+
+const formRef = ref() // 琛ㄥ崟 Ref
+
+const displayBarCode = ref<string> ()
+
+const formLoading = ref(false) // 琛ㄥ崟鐨勫姞杞戒腑锛�1锛変慨鏀规椂鐨勬暟鎹姞杞斤紱2锛夋彁浜ょ殑鎸夐挳绂佺敤
+
+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' }],
+ rentTime: [{ required: true, message: '璇烽�夋嫨瑁呮満鏃ユ湡', trigger: 'blur' }],
+ patId: [{ required: true, message: '鎮h�呬笉鑳戒负绌�', trigger: 'blur' }],
+ patName: [{ required: true, message: '鎮h�呭悕涓嶈兘涓虹┖', trigger: 'blur' }]
+})
+
+
const emit = defineEmits(['event_dev_install']) // 瀹氫箟 success 浜嬩欢锛岀敤浜庢搷浣滄垚鍔熷悗鐨勫洖璋�
const checkTypeStore = useCheckTypeStore()
@@ -149,30 +186,11 @@
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 { t } = useI18n() // 鍥介檯鍖�
-const message = useMessage() // 娑堟伅寮圭獥
-
-const dialogVisible = ref(false) // 寮圭獥鐨勬槸鍚﹀睍绀�
-
-const formLoading = ref(false) // 琛ㄥ崟鐨勫姞杞戒腑锛�1锛変慨鏀规椂鐨勬暟鎹姞杞斤紱2锛夋彁浜ょ殑鎸夐挳绂佺敤
-
-const formData = ref({})
-
-const formRules = reactive({
- devId: [{ required: true, message: '璁惧缂栧彿涓嶈兘涓虹┖', trigger: 'blur' }],
- rentTime: [{ required: true, message: '璇烽�夋嫨瑁呮満鏃ユ湡', trigger: 'blur' }],
- patId: [{ required: true, message: '鎮h�呬笉鑳戒负绌�', trigger: 'blur' }],
- patName: [{ required: true, message: '鎮h�呭悕涓嶈兘涓虹┖', trigger: 'blur' }]
-})
-const formRef = ref() // 琛ㄥ崟 Ref
-
-const displayBarCode = ref<string> ()
/** 鎻愪氦琛ㄥ崟 */
const submitForm = async () => {
@@ -181,6 +199,9 @@
// 鎻愪氦璇锋眰
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
@@ -203,44 +224,40 @@
devId: undefined,
patId: undefined,
patName: undefined,
- patDeptCode: undefined,
- patDeptDesc: undefined,
- patWardCode: undefined,
- patWardDesc: undefined,
- patBedNo: undefined,
rentTime: new Date().getTime(),
returnTime: undefined,
interference: undefined,
baseline: undefined,
detachment: undefined,
remark: undefined,
- category: '',
- brand: '',
- model: '',
- state: -1,
}
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
@@ -250,20 +267,25 @@
copyBarcode()
}
+// 鑾峰彇鎮h�呯殑棰嗙敤淇℃伅
const getReadyRentInfo = async (devRentVO) => {
const data = await DevRentApi.getReadyRent(devRentVO)
- if (null === data)
+ if ( data == null)
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
+ formData.value = data //涓嶈兘鏁翠釜璧嬪�硷紝 榛樿瑁呮満鏃堕棿琚竻绌�
+ 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) // 鍒楄〃鐨勫姞杞戒腑
@@ -301,7 +323,14 @@
}
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 () => {
@@ -327,7 +356,8 @@
return ""
const displayBarcode: number[] = checkTypeStore.getCheckTypeDispBarCode(formData.value.checkType!)
- if (!displayBarcode.includes( formData.value.patSrc ))
+ if (formData.value.patDetails == null || formData.value.patDetails.source == null ||
+ !displayBarcode.includes( formData.value.patDetails.source ))
return ""
return getBarcode()
@@ -337,9 +367,13 @@
if (!formData.value.checkType)
return ""
- if (1 === formData.value.patSrc || 2 === formData.value.patSrc)
+ const patSource = formData.value.patDetails?.source
+ if (patSource == null)
+ return ""
+
+ if (1 === patSource || 2 === patSource)
return formData.value.applyNo??""
- else if (3 === formData.value.patSrc || 4 === formData.value.patSrc)
+ else if (3 === patSource || 4 === patSource)
return formData.value.episodeId??""
return ""
diff --git a/src/views/ecg/doctor/components/DevReadyPanel.vue b/src/views/ecg/doctor/components/DevReadyPanel.vue
index de70cc7..8b3411f 100644
--- a/src/views/ecg/doctor/components/DevReadyPanel.vue
+++ b/src/views/ecg/doctor/components/DevReadyPanel.vue
@@ -23,14 +23,14 @@
</el-form-item>
<el-form-item label="鎮h�呮弿杩�" prop="patDeptDesc">
- <dict-tag v-if="formData?.patSrc" :type="DICT_TYPE.ECG_PAT_SOURCE" :value="formData?.patSrc" />
+ <dict-tag v-if="formData.patDetails?.source" :type="DICT_TYPE.ECG_PAT_SOURCE" :value="formData.patDetails?.source" />
{{formData?.patDetails?.deptDesc}} {{formData?.patDetails?.wardDesc}} {{formData?.patDetails?.bedNo}}
</el-form-item>
<el-form-item label="璁惧缂栧彿" prop="devId">
<el-input v-model="formData.devId" placeholder="璇疯緭鍏ヨ澶囩紪鍙�" @input="getDevInfo"/>
</el-form-item>
<el-form-item label="璁惧鎻忚堪" prop="">
- {{(deviceInfo?.brand||'-') + " " + (deviceInfo?.model||'-') + " " + tranlateDevState(deviceInfo?.state)}}
+ {{ devInfo?.brand||'-' }} {{ devInfo?.model||'-' }} {{ tranlateDevState(devInfo?.state) }}
</el-form-item>
<el-form-item label="棰嗙敤鏃堕棿" prop="rentTime">
<el-date-picker
@@ -190,7 +190,6 @@
detachment: undefined,
remark: undefined,
paid: undefined,
- patSrc: undefined,
roomId: props.room.roomId,
bedNo: props.room.bedNo
})
@@ -203,7 +202,12 @@
})
const formRef = ref() // 琛ㄥ崟 Ref
-const deviceInfo = ref<DeviceVO> ()
+const devInfo = ref<Partial<DeviceVO>>({
+ category: undefined,
+ brand: undefined,
+ model: undefined,
+ state: undefined,
+})
const displayBarCode = ref<string> ()
@@ -225,11 +229,10 @@
return
// formDate 瀵瑰簲 DevRent
- // formData.value = data //涓嶈兘鏁翠釜璧嬪�硷紝 榛樿棰嗙敤鏃堕棿琚竻绌�
- formData.value.id = data.id; //rent id
- formData.value.applyNo = data.applyNo;
- formData.value.episodeId = data.episodeId;
- formData.value.patDetails = data.patDetails
+ formData.value = data
+
+ // 棰嗙敤鏃堕棿 閲囩敤褰撳墠鏃堕棿
+ formData.value.rentTime = new Date().getTime()
}
/** 鎻愪氦琛ㄥ崟 */
@@ -294,13 +297,17 @@
remark: undefined,
patDetails: undefined,
paid: undefined,
- patSrc: undefined,
roomId: props.room.roomId,
bedNo: props.room.bedNo
}
formRef.value?.resetFields()
- deviceInfo.value = undefined
+ devInfo.value = {
+ category: undefined,
+ brand: undefined,
+ model: undefined,
+ state: undefined,
+ }
}
const setPatient = (queueVO: QueueVO | undefined) => {
@@ -310,7 +317,6 @@
formData.value.patId = queueVO?.patId
formData.value.patName = queueVO?.patName
formData.value.checkType = queueVO?.bookCheckType
- formData.value.patSrc = queueVO?.patDetails.source
getFreeRentInfo(formData.value)
copyBarcode()
}
@@ -353,7 +359,14 @@
}
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 printBill = async (patId: string, checkType: number, printMode?: number) => {
@@ -430,14 +443,16 @@
*/
const getDevInfo = async () => {
- deviceInfo.value = undefined
- if (isStringEmpty(formData.value.devId))
+ 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 )
if ( null !== data)
- deviceInfo.value = data
+ devInfo.value = data
}
const feeConfirm = async () => {
@@ -467,7 +482,8 @@
return ""
const displayBarcode: number[] = checkTypeStore.getCheckTypeDispBarCode(formData.value.checkType!)
- if (formData.value.patSrc == null || !displayBarcode.includes( formData.value.patSrc ))
+ if (formData.value.patDetails == null || formData.value.patDetails.source == null ||
+ !displayBarcode.includes( formData.value.patDetails.source ))
return ""
return getBarcode()
@@ -477,9 +493,13 @@
if (!formData.value.checkType)
return ""
- if (1 === formData.value.patSrc || 2 === formData.value.patSrc)
+ const patSource = formData.value.patDetails?.source
+ if (patSource == null)
+ return ""
+
+ if (1 === patSource || 2 === patSource)
return formData.value.applyNo??""
- else if (3 === formData.value.patSrc || 4 === formData.value.patSrc)
+ else if (3 === patSource || 4 === patSource)
return formData.value.episodeId??""
return ""
--
Gitblit v1.9.3