From 18acf59e72e031632e798d13fd06f13a4ff738e1 Mon Sep 17 00:00:00 2001
From: eight <641137800@qq.com>
Date: 星期四, 08 八月 2024 22:08:23 +0800
Subject: [PATCH] 预约确认
---
src/api/ecg/appointment/index.ts | 10 ++++-
src/views/ecg/appointment/AppointmentConfirm.vue | 93 +++++++++++++++++++---------------------------
src/views/ecg/appointment/AppointmentForm.vue | 4 ++
3 files changed, 50 insertions(+), 57 deletions(-)
diff --git a/src/api/ecg/appointment/index.ts b/src/api/ecg/appointment/index.ts
index 609fa7b..c138ee5 100644
--- a/src/api/ecg/appointment/index.ts
+++ b/src/api/ecg/appointment/index.ts
@@ -2,7 +2,7 @@
// 棰勭害 VO
export interface AppointmentVO {
- id: string
+ id: number,
patId: string // 鎮h�呯紪鍙�
patName: string // 鎮h�呭鍚�
patGender: number // 鎮h�呮�у埆
@@ -20,7 +20,7 @@
bookDate: Date // 棰勭害鏃ユ湡
bookTimeslot: number // 棰勭害鏃堕棿娈�
bookTime: Date // 棰勭害鍙戠敓鏃堕棿
- bookCheckType: boolean // 棰勭害妫�鏌ョ被鍨�
+ bookCheckType: number // 棰勭害妫�鏌ョ被鍨�
}
// 棰勭害 API
@@ -53,5 +53,11 @@
// 瀵煎嚭棰勭害 Excel
exportAppointment: async (params) => {
return await request.download({ url: `/ecg/appointment/export-excel`, params })
+ },
+
+ // 淇敼棰勭害
+ confirmAppointment: async (data: AppointmentVO) => {
+ return await request.post({ url: `/ecg/appointment/confirm`, data })
}
+
}
diff --git a/src/views/ecg/appointment/AppointmentConfirm.vue b/src/views/ecg/appointment/AppointmentConfirm.vue
index c456482..db8a21c 100644
--- a/src/views/ecg/appointment/AppointmentConfirm.vue
+++ b/src/views/ecg/appointment/AppointmentConfirm.vue
@@ -3,7 +3,7 @@
<el-input v-model="queryParams.patId" placeholder="璇疯緭鍏ユ偅鑰呯紪鍙�" clearable @input="searchBookInfo"/>
</el-form-item>
- <el-button @click="message.alert('p')"><Icon icon="ep:refresh" class="mr-5px" /> 鎺掗槦 </el-button>
+ <el-button @click="_confirmAppointment"><Icon icon="ep:refresh" class="mr-5px" /> 鎺掗槦 </el-button>
<el-divider/>
@@ -11,7 +11,6 @@
ref="formRef"
:model="formData"
label-width="100px"
- v-loading="formLoading"
class="two-column-form"
>
<div class="form-row">
@@ -116,40 +115,35 @@
/** 棰勭害纭 琛ㄥ崟 */
defineOptions({ name: 'AppointmentConfirm' })
-const { t } = useI18n() // 鍥介檯鍖�
const message = useMessage() // 娑堟伅寮圭獥
-
-const dialogVisible = ref(false) // 寮圭獥鐨勬槸鍚﹀睍绀�
-const dialogTitle = ref('') // 寮圭獥鐨勬爣棰�
-const formLoading = ref(false) // 琛ㄥ崟鐨勫姞杞戒腑锛�1锛変慨鏀规椂鐨勬暟鎹姞杞斤紱2锛夋彁浜ょ殑鎸夐挳绂佺敤
-const formType = ref('') // 琛ㄥ崟鐨勭被鍨嬶細create - 鏂板锛泆pdate - 淇敼
const loading = ref(true) // 鍒楄〃鐨勫姞杞戒腑
const list = ref<AppointmentVO[]>([]) // 鍒楄〃鐨勬暟鎹�
const total = ref(0) // 鍒楄〃鐨勬�婚〉鏁�
const queryParams = reactive({
pageNo: 1,
- pageSize: 1,
+ pageSize: 10,
patId: undefined
})
const formData = ref({
- patId: undefined,
- patName: undefined,
+ id: 0,
+ patId: "",
+ patName: "",
patGender: 1, // 1 鐢� 2 濂�
- patBirthday: undefined,
- patMobile: undefined,
- patPhone: undefined,
- patIdentityId: undefined,
- patAddr: undefined,
- patDeptCode: undefined,
- patDeptDesc: undefined,
- patWardCode: undefined,
- patWardDesc: undefined,
- patBedNo: undefined,
- bookId: undefined,
- bookTime: undefined,
- bookDate: new Date().getTime(),
+ patBirthday: new Date(),
+ patMobile: "",
+ patPhone: "",
+ patIdentityId: "",
+ patAddr: "",
+ patDeptCode: "",
+ patDeptDesc: "",
+ patWardCode: "",
+ patWardDesc: "",
+ patBedNo: "",
+ bookId: "",
+ bookTime: new Date(),
+ bookDate: new Date(),
bookTimeslot: 10001015,
bookCheckType: 10
})
@@ -180,43 +174,32 @@
}
}
-/** 鎵撳紑寮圭獥 */
-const open = async (type: string, id?: number) => {
- dialogVisible.value = true
- dialogTitle.value = t('action.' + type)
- formType.value = type
- resetForm()
- // 淇敼鏃讹紝璁剧疆鏁版嵁
- if (id) {
- formLoading.value = true
- try {
- formData.value = await AppointmentApi.getAppointment(id)
- } finally {
- formLoading.value = false
- }
- }
+const _confirmAppointment = async () => {
+ const data = await AppointmentApi.confirmAppointment(formData.value)
+ message.info(data)
}
-defineExpose({ open }) // 鎻愪緵 open 鏂规硶锛岀敤浜庢墦寮�寮圭獥
+
/** 閲嶇疆琛ㄥ崟 */
const resetForm = () => {
formData.value = {
- patId: undefined,
- patName: undefined,
+ id: 0,
+ patId: "",
+ patName: "",
patGender: 1, // 1 鐢� 2 濂�
- patBirthday: undefined,
- patMobile: undefined,
- patPhone: undefined,
- patIdentityId: undefined,
- patAddr: undefined,
- patDeptCode: undefined,
- patDeptDesc: undefined,
- patWardCode: undefined,
- patWardDesc: undefined,
- patBedNo: undefined,
- bookId: undefined,
- bookTime: undefined,
- bookDate: new Date().getTime(),
+ patBirthday: new Date(),
+ patMobile: "",
+ patPhone: "",
+ patIdentityId: "",
+ patAddr: "",
+ patDeptCode: "",
+ patDeptDesc: "",
+ patWardCode: "",
+ patWardDesc: "",
+ patBedNo: "",
+ bookId: "",
+ bookTime: new Date(),
+ bookDate: new Date(),
bookTimeslot: 10001015,
bookCheckType: 10
}
diff --git a/src/views/ecg/appointment/AppointmentForm.vue b/src/views/ecg/appointment/AppointmentForm.vue
index f10b1fa..3d9b7b0 100644
--- a/src/views/ecg/appointment/AppointmentForm.vue
+++ b/src/views/ecg/appointment/AppointmentForm.vue
@@ -24,6 +24,9 @@
</el-radio>
</el-radio-group>
</el-form-item>
+ <el-form-item label="棰勭害缂栧彿" prop="bookId">
+ <el-input v-model="formData.bookId" placeholder="璇疯緭鍏ラ绾︾紪鍙�" />
+ </el-form-item>
<el-form-item label="棰勭害鏃ユ湡" prop="bookDate">
<el-date-picker
v-model="formData.bookDate"
@@ -132,6 +135,7 @@
patId: [{ required: true, message: '鎮h�呯紪鍙蜂笉鑳戒负绌�', trigger: 'blur' }],
patName: [{ required: true, message: '鎮h�呭鍚嶄笉鑳戒负绌�', trigger: 'blur' }],
patGender: [{ required: true, message: '鎮h�呮�у埆涓嶈兘涓虹┖', trigger: 'blur' }],
+ bookId: [{ required: true, message: '棰勭害缂栧彿涓嶈兘涓虹┖', trigger: 'blur' }],
bookDate: [{ required: true, message: '棰勭害鏃ユ湡涓嶈兘涓虹┖', trigger: 'blur' }],
bookTimeslot: [{ required: true, message: '棰勭害妫�鏌ユ椂闂存涓嶈兘涓虹┖', trigger: 'blur' }],
bookCheckType: [{ required: true, message: '棰勭害妫�鏌ョ被鍨嬩笉鑳戒负绌�', trigger: 'change' }]
--
Gitblit v1.9.3