<script setup lang="ts">
|
import {defineComponent, PropType} from "vue";
|
import {useCheckTypeStore} from "@/store/modules/checkType";
|
import {AppointmentApi, AppointmentVO} from "@/api/ecg/appointment";
|
import {dateFormatter2, formatDate} from "@/utils/formatTime";
|
import {formatTimeslot} from "@/utils/formatter";
|
import {isCurrentDay} from "@/utils/dateUtil";
|
|
defineComponent({
|
name: 'CheckItemPanel'
|
})
|
|
const props = defineProps({
|
appointment: {
|
type: Object as PropType<AppointmentVO>,
|
required: true
|
}
|
})
|
|
const checkTypeStore = useCheckTypeStore();
|
|
const _confirmAppointment = async () => {
|
const data = await AppointmentApi.confirmAppointment(props.appointment)
|
ElNotification({
|
title: '温馨提示',
|
message: data,
|
type: 'warning'
|
})
|
}
|
|
</script>
|
|
<template>
|
<el-card style="width: 200px" shadow="hover" >
|
<template #header>{{checkTypeStore.getCheckTypeName(appointment.bookCheckType)}}</template>
|
<div>{{formatDate(appointment.bookDate, 'YYYY-MM-DD')}}</div>
|
<div>{{formatTimeslot(appointment.bookTimeslot)}}</div>
|
<el-divider/>
|
<el-button :type="isCurrentDay(appointment.bookDate)?'primary':'warning'" @click="_confirmAppointment"><Icon icon="ep:refresh" class="mr-5px" /> 排队 </el-button>
|
</el-card>
|
</template>
|
|
<style scoped lang="scss">
|
.el-card ::v-deep {
|
.el-card__header {
|
background-color: var(--el-color-primary-light-3);
|
padding: 2px;
|
text-align: center;
|
}
|
.el-card__body {
|
//background-color: var(--el-color-primary-light-3);
|
padding: 4px;
|
text-align: center;
|
}
|
}
|
</style>
|