From 08c5612cb1bfc239428b5bb1bf073b62eda012cd Mon Sep 17 00:00:00 2001
From: eight <641137800@qq.com>
Date: 星期二, 10 九月 2024 16:34:46 +0800
Subject: [PATCH] 装机逻辑修改
---
src/views/ecg/doctor/components/DevDismantlePanel.vue | 5 --
src/views/ecg/doctor/index.vue | 14 +++++--
src/views/ecg/doctor/components/DevInstallPanel.vue | 71 +++++++++++------------------------
3 files changed, 32 insertions(+), 58 deletions(-)
diff --git a/src/views/ecg/doctor/components/DevRentPanel.vue b/src/views/ecg/doctor/components/DevDismantlePanel.vue
similarity index 96%
rename from src/views/ecg/doctor/components/DevRentPanel.vue
rename to src/views/ecg/doctor/components/DevDismantlePanel.vue
index 5015812..815d7e5 100644
--- a/src/views/ecg/doctor/components/DevRentPanel.vue
+++ b/src/views/ecg/doctor/components/DevDismantlePanel.vue
@@ -40,7 +40,6 @@
</el-form-item>
</el-form>
<el-button @click="submitForm" type="primary" :disabled="formLoading">瑁呮満</el-button>
- <el-button @click="submitDismantleForm" type="primary" :disabled="formLoading">鎷嗘満</el-button>
<el-button @click="dialogVisible = false">鍙� 娑�</el-button>
</template>
@@ -131,10 +130,6 @@
} finally {
formLoading.value = false
}
-}
-
-const submitDismantleForm = async () => {
-
}
/** 閲嶇疆琛ㄥ崟 */
diff --git a/src/views/ecg/doctor/components/DevRentPanel.vue b/src/views/ecg/doctor/components/DevInstallPanel.vue
similarity index 74%
copy from src/views/ecg/doctor/components/DevRentPanel.vue
copy to src/views/ecg/doctor/components/DevInstallPanel.vue
index 5015812..22b0a62 100644
--- a/src/views/ecg/doctor/components/DevRentPanel.vue
+++ b/src/views/ecg/doctor/components/DevInstallPanel.vue
@@ -8,7 +8,7 @@
v-loading="formLoading"
>
<el-form-item label="璁惧缂栧彿" prop="devId">
- <el-input v-model="formData.devId" placeholder="璇疯緭鍏ヨ澶囩紪鍙�" @input="searchRentInfo"/>
+ <el-input v-model="formData.devId" placeholder="璇疯緭鍏ヨ澶囩紪鍙�" />
</el-form-item>
<el-form-item label="瑁呮満鏃堕棿" prop="rentTime">
<el-date-picker
@@ -40,7 +40,6 @@
</el-form-item>
</el-form>
<el-button @click="submitForm" type="primary" :disabled="formLoading">瑁呮満</el-button>
- <el-button @click="submitDismantleForm" type="primary" :disabled="formLoading">鎷嗘満</el-button>
<el-button @click="dialogVisible = false">鍙� 娑�</el-button>
</template>
@@ -51,16 +50,9 @@
import {isStringEmpty} from "@/utils/stringUtil";
/** 瑁呮満鎷嗘満 琛ㄥ崟 */
-defineComponent({ name: 'DevRentPanel' })
+defineComponent({ name: 'DevInstallPanel' })
const emit = defineEmits(['success']) // 瀹氫箟 success 浜嬩欢锛岀敤浜庢搷浣滄垚鍔熷悗鐨勫洖璋�
-
-const props = defineProps({
- patient: {
- type: Object as PropType<QueueVO>,
- required: true
- }
-})
const { t } = useI18n() // 鍥介檯鍖�
const message = useMessage() // 娑堟伅寮圭獥
@@ -69,12 +61,18 @@
const formLoading = ref(false) // 琛ㄥ崟鐨勫姞杞戒腑锛�1锛変慨鏀规椂鐨勬暟鎹姞杞斤紱2锛夋彁浜ょ殑鎸夐挳绂佺敤
const formType = ref('create') // 琛ㄥ崟鐨勭被鍨嬶細create - 鏂板锛泆pdate - 淇敼
+
+const patient = ref<QueueVO>({
+ patId: '',
+ patName: ''
+})
+
const formData = ref({
id: undefined,
devId: undefined,
- patId: props.patient.patId,
- patName: props.patient.patName,
- rentTime: undefined,
+ patId: patient.value.patId,
+ patName: patient.value.patName,
+ rentTime: new Date().getTime(),
returnTime: undefined,
interference: undefined,
baseline: undefined,
@@ -88,25 +86,7 @@
})
const formRef = ref() // 琛ㄥ崟 Ref
-/** 鎵撳紑寮圭獥 */
-const open = async (type: string, id?: number) => {
- dialogVisible.value = true
- formType.value = type
- resetForm()
- // 淇敼鏃讹紝璁剧疆鏁版嵁
- if (id) {
- formLoading.value = true
- try {
- formData.value = await DevRentApi.getDevRent(id)
- } finally {
- formLoading.value = false
- }
- }
-}
-defineExpose({ open }) // 鎻愪緵 open 鏂规硶锛岀敤浜庢墦寮�寮圭獥
-
/** 鎻愪氦琛ㄥ崟 */
-
const submitForm = async () => {
// 鏍¢獙琛ㄥ崟
await formRef.value.validate()
@@ -114,12 +94,11 @@
formLoading.value = true
try {
const data = formData.value as unknown as DevRentVO
- data.id = null
- data.patId = props.patient.patId
- data.patName = props.patient.patName
- if (formType.value === 'create') {
+ data.patId = patient.value.patId
+ data.patName = patient.value.patName
+ if (formData.value.id === null || formData.value.id === undefined) {
const result = await DevRentApi.createDevRent(data)
- formData.value.id = result.data
+ formData.value.id = result
message.success(t('common.createSuccess'))
} else {
await DevRentApi.updateDevRent(data)
@@ -133,18 +112,14 @@
}
}
-const submitDismantleForm = async () => {
-
-}
-
/** 閲嶇疆琛ㄥ崟 */
const resetForm = () => {
formData.value = {
id: undefined,
devId: undefined,
- patId: props.patient.patId,
- patName: props.patient.patName,
- rentTime: undefined,
+ patId: patient.value.patId,
+ patName: patient.value.patName,
+ rentTime: new Date().getTime(),
returnTime: undefined,
interference: undefined,
baseline: undefined,
@@ -154,13 +129,11 @@
formRef.value?.resetFields()
}
-const searchRentInfo = async () => {
- const result = await DevRentApi.getLatestRent(formData.value.patId, formData.value.devId!)
- console.info( result )
- if (null != result.data) {
- formData.value = result.data
- }
+const setPatient = (queueVO: QueueVO) => {
+ patient.value = queueVO
+ formData.value.id = undefined
}
+defineExpose({ setPatient }) // 鎻愪緵 setPatient 鏂规硶锛岀敤浜庤缃偅鑰�
</script>
diff --git a/src/views/ecg/doctor/index.vue b/src/views/ecg/doctor/index.vue
index 4ecc39b..1a8b80e 100644
--- a/src/views/ecg/doctor/index.vue
+++ b/src/views/ecg/doctor/index.vue
@@ -5,7 +5,7 @@
import {useUserStore} from "@/store/modules/user";
import {QueueVO} from "@/api/ecg/queue";
import {ElNotification} from "element-plus";
-import DevRentPanel from "@/views/ecg/doctor/components/DevRentPanel.vue";
+import DevInstallPanel from "@/views/ecg/doctor/components/DevInstallPanel.vue";
const userStore = useUserStore();
@@ -58,9 +58,9 @@
const getOnstagePatient = () => {
const tempPatient : QueueVO | undefined = patientList.value.find(item => item.status === 30)
- if (tempPatient !== undefined) {
+ if (tempPatient !== undefined && tempPatient.patId !== onStagePatient.value.patId) {
onStagePatient.value= tempPatient
- //onStagePatient.value.patName = tempPatient.patName
+ setOnStagePatient(tempPatient)
}
}
@@ -138,6 +138,12 @@
console.info("onDevRentPanelEvent...")
}
+/** 鎮h�呭彉鏇存搷浣� */
+const devInstallPanelRef = ref()
+const setOnStagePatient = (tempPatient: QueueVO) => {
+ devInstallPanelRef.value.setPatient(tempPatient)
+}
+
</script>
<template>
@@ -147,7 +153,7 @@
</el-header>
<el-container>
<el-main>
- <DevRentPanel :patient="onStagePatient" @success="onEvent"/>
+ <DevInstallPanel ref="devInstallPanelRef" @success="onEvent"/>
</el-main>
<el-aside width="300px" style="background-color: var(--el-color-primary-light-7);">
<QueuePanel :queue="patientList"/>
--
Gitblit v1.9.3