From 812ffe6f989303514b45f8106f09ff902bbe0d8a Mon Sep 17 00:00:00 2001
From: eight <641137800@qq.com>
Date: 星期四, 31 十月 2024 16:19:56 +0800
Subject: [PATCH] update
---
src/views/ecg/appointment/AppointmentForm.vue | 27 ++++++++++++++++++++++-----
1 files changed, 22 insertions(+), 5 deletions(-)
diff --git a/src/views/ecg/appointment/AppointmentForm.vue b/src/views/ecg/appointment/AppointmentForm.vue
index 71248fe..f79ec29 100644
--- a/src/views/ecg/appointment/AppointmentForm.vue
+++ b/src/views/ecg/appointment/AppointmentForm.vue
@@ -219,10 +219,25 @@
}
}
}
-defineExpose({ open }) // 鎻愪緵 open 鏂规硶锛岀敤浜庢墦寮�寮圭獥
+const openByQueue = async (type: string, patId: string) => {
+ dialogVisible.value = true
+ dialogTitle.value = t('action.' + type)
+ formType.value = type
+ resetForm()
+ // 淇敼鏃讹紝璁剧疆鏁版嵁
+ if (patId) {
+ formLoading.value = true
+ try {
+ formData.value = await AppointmentApi.getCurAppointmentByPatId( patId )
+ } finally {
+ formLoading.value = false
+ }
+ }
+}
+defineExpose({ open, openByQueue }) // 鎻愪緵 open 鏂规硶锛岀敤浜庢墦寮�寮圭獥
/** 鎻愪氦琛ㄥ崟 */
-const emit = defineEmits(['success']) // 瀹氫箟 success 浜嬩欢锛岀敤浜庢搷浣滄垚鍔熷悗鐨勫洖璋�
+const emit = defineEmits(['event_appointment_success']) // 瀹氫箟 success 浜嬩欢锛岀敤浜庢搷浣滄垚鍔熷悗鐨勫洖璋�
const submitForm = async () => {
// 鏍¢獙琛ㄥ崟
await formRef.value.validate()
@@ -232,14 +247,16 @@
const data = formData.value as unknown as AppointmentVO
if (formType.value === 'create') {
await AppointmentApi.createAppointment(data)
+ // 鍙戦�佹搷浣滄垚鍔熺殑浜嬩欢
+ emit('event_appointment_success')
message.success(t('common.createSuccess'))
- } else {
+ } else if (formType.value === 'update') {
await AppointmentApi.updateAppointment(data)
+ // 鍙戦�佹搷浣滄垚鍔熺殑浜嬩欢
+ emit('event_appointment_success')
message.success(t('common.updateSuccess'))
}
dialogVisible.value = false
- // 鍙戦�佹搷浣滄垚鍔熺殑浜嬩欢
- emit('success')
} finally {
formLoading.value = false
}
--
Gitblit v1.9.3