From 1b145b5655fa023032c8713bb2375bccdf0fc314 Mon Sep 17 00:00:00 2001 From: eight <641137800@qq.com> Date: 星期四, 24 十月 2024 11:13:40 +0800 Subject: [PATCH] 领用完成后 立即刷新 患者列表 --- src/views/ecg/appointment/AppointmentConfirm.vue | 109 ++++++++++++++++++++++++------------------------------ 1 files changed, 49 insertions(+), 60 deletions(-) diff --git a/src/views/ecg/appointment/AppointmentConfirm.vue b/src/views/ecg/appointment/AppointmentConfirm.vue index c456482..f795312 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"> @@ -54,7 +53,7 @@ <el-form-item label="棰勭害妫�鏌ョ被鍨�" prop="bookCheckType"> <el-select v-model="formData.bookCheckType" placeholder="璇烽�夋嫨棰勭害妫�鏌ョ被鍨�"> <el-option - v-for="dict in getIntDictOptions(DICT_TYPE.ECG_CHECK_TYPE)" + v-for="dict in checkTypeStore.getCheckTypeOptions()" :key="dict.value" :label="dict.label" :value="dict.value" @@ -112,46 +111,44 @@ <script setup lang="ts"> import {DICT_TYPE, getIntDictOptions} from '@/utils/dict' import { AppointmentApi, AppointmentVO } from '@/api/ecg/appointment' +import {useCheckTypeStore} from "@/store/modules/checkType"; /** 棰勭害纭 琛ㄥ崟 */ defineOptions({ name: 'AppointmentConfirm' }) -const { t } = useI18n() // 鍥介檯鍖� -const message = useMessage() // 娑堟伅寮圭獥 +const checkTypeStore = useCheckTypeStore(); -const dialogVisible = ref(false) // 寮圭獥鐨勬槸鍚﹀睍绀� -const dialogTitle = ref('') // 寮圭獥鐨勬爣棰� -const formLoading = ref(false) // 琛ㄥ崟鐨勫姞杞戒腑锛�1锛変慨鏀规椂鐨勬暟鎹姞杞斤紱2锛夋彁浜ょ殑鎸夐挳绂佺敤 -const formType = ref('') // 琛ㄥ崟鐨勭被鍨嬶細create - 鏂板锛泆pdate - 淇敼 +const message = useMessage() // 娑堟伅寮圭獥 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, +const formData = ref<AppointmentVO>({ + 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(), - bookTimeslot: 10001015, - bookCheckType: 10 + patBirthday: new Date(), + patMobile: "", + patPhone: "", + patIdentityId: "", + patAddr: "", + patDeptCode: "", + patDeptDesc: "", + patWardCode: "", + patWardDesc: "", + patBedNo: "", + bookId: "", + bookTime: new Date(), + bookDate: new Date(), + bookTimeslot: 9000930, + bookCheckType: checkTypeStore.getCheckTypeName(100) }) const formRef = ref() // 琛ㄥ崟 Ref @@ -180,44 +177,36 @@ } } -/** 鎵撳紑寮圭獥 */ -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) + ElNotification({ + title: '娓╅Θ鎻愮ず', + message: data, + type: 'warning' + }) } -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(), - bookTimeslot: 10001015, + patBirthday: new Date(), + patMobile: "", + patPhone: "", + patIdentityId: "", + patAddr: "", + patDeptCode: "", + patDeptDesc: "", + patWardCode: "", + patWardDesc: "", + patBedNo: "", + bookId: "", + bookTime: new Date(), + bookDate: new Date(), + bookTimeslot: 9000930, bookCheckType: 10 } formRef.value?.resetFields() -- Gitblit v1.9.3