From 49206ee0689d44367b9f5de3decf0c3ec02bfb51 Mon Sep 17 00:00:00 2001
From: eight <641137800@qq.com>
Date: 星期二, 15 四月 2025 10:56:18 +0800
Subject: [PATCH] update
---
src/views/ecg/doctor/components/RoutinePanel.vue | 170 +++++++++++++++++++++++++++++++++++++++++++-------------
1 files changed, 130 insertions(+), 40 deletions(-)
diff --git a/src/views/ecg/doctor/components/RoutinePanel.vue b/src/views/ecg/doctor/components/RoutinePanel.vue
index a25b38d..2b76667 100644
--- a/src/views/ecg/doctor/components/RoutinePanel.vue
+++ b/src/views/ecg/doctor/components/RoutinePanel.vue
@@ -10,13 +10,17 @@
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="鎮h�呯紪鍙�" prop="patId">
- <el-input v-model="formData.patId" placeholder="璇疯緭鍏ユ偅鑰呯紪鍙�" @input="getAppointmentInfoByPatId" />
+ <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">
- 绉戝: {{formData.patDeptDesc}} 鐥呭尯: {{formData.patWardDesc}} 搴婁綅: {{formData.patBedNo}}
+ <el-form-item label="鎮h�呮弿杩�" prop="patDetails">
+ <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="rentTime">
<el-date-picker
@@ -28,6 +32,9 @@
</el-form-item>
</el-col>
<el-col :span="12">
+ <el-form-item label="妫�鏌ラ」鐩�" prop="">
+ {{formData?.checkType && getCheckTypeName(formData?.checkType)}}
+ </el-form-item>
<el-form-item label="澶囨敞" prop="remark">
<el-input v-model="formData.remark" placeholder="璇疯緭鍏ュ娉�" />
</el-form-item>
@@ -35,23 +42,25 @@
</el-row>
</el-form>
<el-button @click="submitForm" type="primary" :disabled="formLoading">妫�鏌ュ畬鎴�</el-button>
+ <el-button @click="cancelInstall" :disabled="formLoading">鏀惧純妫�鏌�</el-button>
<el-button @click="resetForm()">閲� 缃�</el-button>
- <el-button @click="cancelInstall" :disabled="formLoading">鏀惧純瑁呮満</el-button>
+ <el-button v-if="needAutoFeeConfirm(formData.checkType)" @click="feeConfirm" :disabled="formLoading">纭垂</el-button>
+ <el-button v-if="needAutoFeeConfirm(formData.checkType)" @click="feeCancel" :disabled="formLoading">鍙栨秷纭垂</el-button>
<!-- 鍖荤敓瑁呮満鍒楄〃 -->
<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" >
+<!-- <el-table-column label="id" align="center" prop="id" />-->
+ <el-table-column label="妫�鏌ョ姸鎬�" align="center" prop="lost" >
<template #default="scope">
- <span v-if="scope.row.jobType === 10">"宸茶鏈�"</span>
- <span v-if="scope.row.jobType === 35">"宸叉斁寮�"</span>
+ <span v-if="scope.row.jobType === 60">宸叉鏌�</span>
+ <span v-if="scope.row.jobType === 50">宸叉斁寮�</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="docName" />
- <el-table-column label="璁惧缂栧彿" align="center" prop="devId" />
+<!-- <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
@@ -61,7 +70,7 @@
:formatter="dateFormatter"
width="180px"
/>
- <el-table-column label="浣滀笟姒傝" align="center" prop="summary" />
+<!-- <el-table-column label="浣滀笟姒傝" align="center" prop="summary" />-->
<el-table-column label="澶囨敞" align="center" prop="remark" />
<el-table-column
label="鍒涘缓鏃堕棿"
@@ -70,6 +79,7 @@
:formatter="dateFormatter"
width="180px"
/>
+<!--
<el-table-column label="鎿嶄綔" align="center" min-width="120px">
<template #default="scope">
<el-button
@@ -90,6 +100,7 @@
</el-button>
</template>
</el-table-column>
+-->
</el-table>
<!-- 鍒嗛〉 -->
<Pagination
@@ -108,10 +119,12 @@
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 {AppointmentApi} from "@/api/ecg/appointment";
+import {Barcode} from "@/components/Barcode";
+import {useCheckTypeStore} from "@/store/modules/checkType";
+import {DICT_TYPE} from "@/utils/dict";
+import {getCheckTypeName, needAutoFeeConfirm} from "../../../../utils/checkTypeFormatter";
/** 璁惧瑁呮満 琛ㄥ崟 */
defineComponent({ name: 'RoutinePanel' })
@@ -125,9 +138,17 @@
const emit = defineEmits(['event_routine']) // 瀹氫箟 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
- getAppointmentInfoByPatId()
+ formData.value.patName = queueVO?.patName
+ formData.value.checkType = queueVO?.bookCheckType
+ getFreeRentInfo(formData.value)
+ copyBarcode()
}
defineExpose({ setPatient }) // 鎻愪緵 setPatient 鏂规硶锛岀敤浜庤缃偅鑰�
@@ -138,13 +159,26 @@
const formLoading = ref(false) // 琛ㄥ崟鐨勫姞杞戒腑锛�1锛変慨鏀规椂鐨勬暟鎹姞杞斤紱2锛夋彁浜ょ殑鎸夐挳绂佺敤
-const formData = ref({})
+const formData = ref<Partial<DevRentVO>>({
+ id: undefined,
+ devId: undefined,
+ patId: undefined,
+ patName: undefined,
+ patDetails: undefined,
+ checkType: undefined,
+ rentTime: new Date().getTime(),
+ returnTime: undefined,
+ remark: undefined,
+ paid: undefined,
+})
const formRules = reactive({
// devId: [{ required: true, message: '璁惧缂栧彿涓嶈兘涓虹┖', trigger: 'blur' }],
rentTime: [{ required: true, message: '璇烽�夋嫨瑁呮満鏃ユ湡', trigger: 'blur' }],
})
const formRef = ref() // 琛ㄥ崟 Ref
+
+const displayBarCode = ref<string> ()
/** 鎻愪氦琛ㄥ崟 */
const submitForm = async () => {
@@ -157,12 +191,18 @@
formData.value.bedNo = props.room.bedNo
const data = formData.value as unknown as DevRentVO
await DevRentApi.routineFinish(data)
+
+ // 鑷姩纭垂
+ if (needAutoFeeConfirm(formData.value.checkType)) {
+ feeConfirm()
+ }
+
message.success(t('鎿嶄綔鎴愬姛'))
dialogVisible.value = false
// 鍙戦�佹搷浣滄垚鍔熺殑浜嬩欢
emit('event_routine')
resetForm()
- getList()
+ getList() // 鍖荤敓浣滀笟鍘嗗彶
} finally {
formLoading.value = false
}
@@ -175,44 +215,43 @@
devId: undefined,
patId: undefined,
patName: undefined,
- patDeptCode: undefined,
- patDeptDesc: undefined,
- patWardCode: undefined,
- patWardDesc: undefined,
- patBedNo: undefined,
+ checkType: undefined,
rentTime: new Date().getTime(),
returnTime: undefined,
interference: undefined,
baseline: undefined,
detachment: undefined,
remark: undefined,
- category: '',
- brand: '',
- model: '',
+ patDetails: undefined,
+ paid: undefined,
+ roomId: props.room.roomId,
+ bedNo: props.room.bedNo
}
formRef.value?.resetFields()
}
-const getAppointmentInfoByPatId = () => {
+const getRentInfoByPatId = () => {
const tempPatId = formData.value.patId;
resetForm()
if (isStringEmpty(tempPatId))
return
formData.value.patId = tempPatId;
- getAppointmentInfo()
+ getFreeRentInfo(formData.value)
+ copyBarcode()
}
-const getAppointmentInfo = async () => {
- const appointmentData = await AppointmentApi.getAppointmentByPatId(formData.value.patId)
- if (null === appointmentData)
+const getFreeRentInfo = async (devRentVO) => {
+ const data = await DevRentApi.getFreeRent(devRentVO)
+ if (null === data)
return
// formDate 瀵瑰簲 DevRent
- formData.value.patName = appointmentData.patName
- formData.value.patDeptDesc = appointmentData.patDeptDesc
- formData.value.patWardDesc = appointmentData.patWardDesc
- formData.value.patBedNo = appointmentData.patBedNo
+ // 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
}
@@ -258,18 +297,69 @@
formData.value.roomId = props.room.roomId
formData.value.bedNo = props.room.bedNo
const data = formData.value as unknown as DevRentVO
- if (formData.value.id === null || formData.value.id === undefined) {
- const result = await DevRentApi.devInstallCancel(data)
- formData.value.id = result
- message.success(t('鎿嶄綔鎴愬姛'))
- } else {
- await DevRentApi.devInstallCancel(data)
- message.success(t('鎿嶄綔鎴愬姛'))
- }
+ await DevRentApi.routineCheckCancel(data)
+
// 鍙戦�佹搷浣滄垚鍔熺殑浜嬩欢
emit('event_routine')
resetForm()
getList()
+
+ message.success(t('鎿嶄綔鎴愬姛'))
+}
+
+const feeConfirm = async () => {
+ if (formData.value.id == null) {
+ message.error(t('璇峰厛妫�鏌�'))
+ return
+ }
+
+ const result = await DevRentApi.feeConfirm(formData.value.id)
+ if (0 == result)
+ message.success(t('鎿嶄綔鎴愬姛'))
+}
+
+const feeCancel = async () => {
+ if (formData.value.id == null) {
+ message.error(t('璇峰厛妫�鏌�'))
+ return
+ }
+
+ const result = await DevRentApi.feeCancel(formData.value.id)
+ if (0 == result)
+ message.success(t('鎿嶄綔鎴愬姛'))
+}
+
+const getDisplayBarcode = (): string => {
+ if (formData.value.checkType == null)
+ return ""
+
+ 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 ""
+
+ return getBarcode()
+}
+
+const getBarcode = (): string => {
+ if (formData.value.checkType == null)
+ return ""
+
+ 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 copyBarcode = async () => {
+ displayBarCode.value = getDisplayBarcode()
+ await navigator.clipboard.writeText( getBarcode() );
}
/** 鍒濆鍖� **/
--
Gitblit v1.9.3