| | |
| | | import {isStringEmpty} from "@/utils/stringUtil"; |
| | | import {curDayEnd, curDayStart} from "@/utils/dateUtil"; |
| | | import {DeviceApi} from "@/api/ecg/devmanage"; |
| | | import {QueueVO} from "@/api/ecg/queue"; |
| | | import {RoomBedVO} from "@/api/ecg/doctor"; |
| | | |
| | | /** 装机 表单 */ |
| | | defineOptions({ name: 'DevrInstall' }) |
| | | /** 设备装机 表单 */ |
| | | defineComponent({ name: 'DevInstallPanel' }) |
| | | |
| | | const props = defineProps({ |
| | | room: { |
| | | type: Object as PropType<RoomBedVO>, |
| | | required: true |
| | | } |
| | | }) |
| | | |
| | | const emit = defineEmits(['event_dev_install']) // 定义 success 事件,用于操作成功后的回调 |
| | | |
| | | const setPatient = (queueVO: QueueVO | undefined) => { |
| | | formData.value.patId = queueVO?.patId |
| | | getRentInfoByPatId() |
| | | } |
| | | defineExpose({ setPatient }) // 提供 setPatient 方法,用于设置患者 |
| | | |
| | | const { t } = useI18n() // 国际化 |
| | | const message = useMessage() // 消息弹窗 |
| | |
| | | // 提交请求 |
| | | formLoading.value = true |
| | | try { |
| | | formData.value.roomId = props.room.roomId |
| | | formData.value.bedNo = props.room.bedNo |
| | | const data = formData.value as unknown as DevRentVO |
| | | //await DevRentApi.updateDevRent(data) |
| | | await DevRentApi.devInstall(data) |
| | | message.success(t('操作成功')) |
| | | dialogVisible.value = false |
| | |
| | | } |
| | | |
| | | const cancelInstall = async () => { |
| | | formData.value.roomId = props.room.roomId |
| | | formData.value.bedNo = props.room.bedNo |
| | | const data = formData.value as unknown as DevRentVO |
| | | if (formData.value.id === null || formData.value.id === undefined) { |
| | | const result = await DevRentApi.devInstallCancel(data) |