| | |
| | | <template> |
| | | <el-form |
| | | ref="formRef" |
| | | :model="formData" |
| | | :rules="formRules" |
| | | label-width="100px" |
| | | v-loading="formLoading" |
| | | > |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="患者编号" prop="patId"> |
| | | <el-input v-model="formData.patId" placeholder="请输入患者编号" @input="getRentInfoByPatId" /> |
| | | </el-form-item> |
| | | <el-form-item label="患者名称" prop="patName"> |
| | | <el-input v-model="formData.patName" placeholder="请输入患者名称" /> |
| | | </el-form-item> |
| | | <el-form-item label="患者描述" prop="patDeptDesc"> |
| | | 科室: {{formData.patDeptDesc}} 病区: {{formData.patWardDesc}} 床位: {{formData.patBedNo}} |
| | | </el-form-item> |
| | | <el-form-item label="装机时间" prop="rentTime"> |
| | | <el-date-picker |
| | | v-model="formData.rentTime" |
| | | type="date" |
| | | value-format="x" |
| | | placeholder="选择装机时间" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="设备编号" prop="devId"> |
| | | <el-input v-model="formData.devId" placeholder="请输入设备编号" @input="getDevInfo"/> |
| | | </el-form-item> |
| | | <el-form-item label="设备描述" prop=""> |
| | | <span v-if="formData.brand !== null"> {{formData.brand}} </span> |
| | | {{" "}} |
| | | <span v-if="formData.model !== null"> {{formData.model}} </span> |
| | | </el-form-item> |
| | | <el-form-item label="备注" prop="remark"> |
| | | <el-input v-model="formData.remark" placeholder="请输入备注" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <el-button @click="submitForm" type="primary" :disabled="formLoading">装机完成</el-button> |
| | | <el-button @click="resetForm()">重 置</el-button> |
| | | <el-button @click="cancelInstall" :disabled="formLoading">放弃装机</el-button> |
| | | <el-form ref="formRef" :model="formData" :rules="formRules" label-width="100px" v-loading="formLoading"> |
| | | <el-form-item label="检查项目" prop=""> |
| | | {{ getCheckTypeName(formData.checkType) }} |
| | | </el-form-item> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="患者编号" prop="patId"> |
| | | <el-input v-model="formData.patId" placeholder="请输入患者编号" @input="getRentInfoByPatId" /> |
| | | <!-- <Qrcode v-if="formData.patId !== undefined && formData.patId !== ''" :text="formData.patId" logo="/logo.gif" width=100 />--> |
| | | <Barcode v-if="displayBarCode" :value="displayBarCode" :width=100 /> |
| | | <el-button @click="copyBarcode()">复制</el-button> |
| | | </el-form-item> |
| | | <el-form-item label="患者名称" prop="patName"> |
| | | <el-input v-model="formData.patName" placeholder="请输入患者名称" /> |
| | | </el-form-item> |
| | | <el-form-item label="患者描述" prop="patDetails"> |
| | | <dict-tag :type="DICT_TYPE.ECG_PAT_SOURCE" :value="formData.patSrc ?? formData.patDetails?.source ?? ''" /> |
| | | {{ formData.patWardDesc || formData?.patDetails?.wardDesc || '-' }} {{ formData.patBedNo || formData?.patDetails?.bedNo || '-' }} |
| | | </el-form-item> |
| | | <!-- 需求1:患者信息 18 项统一展示(后端已从预约单平铺回填,setPatient 已赋值到 formData) --> |
| | | <PatientInfoBlock :data="formData" check-type-field="checkType" :span="12" /> |
| | | <el-form-item label="装机时间" prop="rentTime"> |
| | | <el-date-picker v-model="formData.rentTime" type="date" value-format="x" placeholder="选择装机时间" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="设备编号" prop="devId"> |
| | | <el-input v-model="formData.devId" placeholder="请输入设备编号" @input="getDevInfo" /> |
| | | </el-form-item> |
| | | <el-form-item label="设备描述" prop=""> |
| | | {{ devInfo?.brand || '-' }} {{ devInfo?.model || '-' }} {{ tranlateDevState(devInfo?.state) }} |
| | | </el-form-item> |
| | | <el-form-item label="备注" prop="remark"> |
| | | <el-input v-model="formData.remark" placeholder="请输入备注" /> |
| | | </el-form-item> |
| | | <el-form-item label="多耐药" prop="tolerance"> |
| | | <!-- 需求6:统一走字典 ecg_tolerance(0=无 1=多耐 2=多重耐药);NULL 按"无"显示(Q12) --> |
| | | <dict-tag :type="DICT_TYPE.ECG_TOLERANCE" :value="formData.tolerance ?? 0" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <el-button @click="submitForm" type="primary" :disabled="formLoading">装机完成</el-button> |
| | | <el-button @click="resetForm()">重 置</el-button> |
| | | <el-button @click="cancelInstall" :disabled="formLoading">放弃装机</el-button> |
| | | |
| | | <!-- 医生装机列表 --> |
| | | <ContentWrap> |
| | | <el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true" @row-click="onRowClick" > |
| | | <el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true" @row-click="onRowClick"> |
| | | <el-table-column label="id" align="center" prop="id" /> |
| | | <el-table-column label="装机情况" align="center" prop="lost" > |
| | | <el-table-column label="装机情况" align="center" prop="lost"> |
| | | <template #default="scope"> |
| | | <span v-if="scope.row.jobType === 10">"已装机"</span> |
| | | <span v-if="scope.row.jobType === 35">"已放弃"</span> |
| | | </template> |
| | | </el-table-column> |
| | | <!-- <el-table-column label="作业类型" align="center" prop="jobType" />--> |
| | | <!-- <el-table-column label="医生编号" align="center" prop="docId" />--> |
| | | <!-- <el-table-column label="作业类型" align="center" prop="jobType" />--> |
| | | <!-- <el-table-column label="医生编号" align="center" prop="docId" />--> |
| | | <el-table-column label="医生名称" align="center" prop="docName" /> |
| | | <el-table-column label="设备编号" align="center" prop="devId" /> |
| | | <el-table-column label="患者编号" align="center" prop="patId" /> |
| | | <el-table-column label="患者名称" align="center" prop="patName" /> |
| | | <el-table-column |
| | | label="作业时间" |
| | | align="center" |
| | | prop="jobTime" |
| | | :formatter="dateFormatter" |
| | | width="180px" |
| | | /> |
| | | <el-table-column label="作业时间" align="center" prop="jobTime" :formatter="dateFormatter" width="180px" /> |
| | | <el-table-column label="作业概要" align="center" prop="summary" /> |
| | | <el-table-column label="备注" align="center" prop="remark" /> |
| | | <el-table-column |
| | | label="创建时间" |
| | | align="center" |
| | | prop="createTime" |
| | | :formatter="dateFormatter" |
| | | width="180px" |
| | | /> |
| | | <el-table-column label="操作" align="center" min-width="120px"> |
| | | <el-table-column label="创建时间" align="center" prop="createTime" :formatter="dateFormatter" width="180px" /> |
| | | <!-- <el-table-column label="操作" align="center" min-width="120px"> |
| | | <template #default="scope"> |
| | | <el-button |
| | | link |
| | |
| | | 删除 |
| | | </el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table-column>--> |
| | | </el-table> |
| | | <!-- 分页 --> |
| | | <Pagination |
| | | :total="total" |
| | | v-model:page="queryParams.pageNo" |
| | | v-model:limit="queryParams.pageSize" |
| | | @pagination="getList" |
| | | /> |
| | | <Pagination :total="total" v-model:page="queryParams.pageNo" v-model:limit="queryParams.pageSize" |
| | | @pagination="getList" /> |
| | | </ContentWrap> |
| | | |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import { DevRentApi, DevRentVO } from '@/api/ecg/devrent' |
| | | import {dateFormatter} from "@/utils/formatTime"; |
| | | import {JobRecordApi, JobRecordVO} from "@/api/ecg/jobrecord"; |
| | | import {isStringEmpty} from "@/utils/stringUtil"; |
| | | import {curDayEnd, curDayStart} from "@/utils/dateUtil"; |
| | | import {DeviceApi} from "@/api/ecg/devmanage"; |
| | | import { dateFormatter } from "@/utils/formatTime"; |
| | | import { JobRecordApi, JobRecordVO } from "@/api/ecg/jobrecord"; |
| | | import { isStringEmpty } from "@/utils/stringUtil"; |
| | | import { curDayEnd, curDayStart } from "@/utils/dateUtil"; |
| | | import { DeviceApi, DeviceVO } from "@/api/ecg/devmanage"; |
| | | import { QueueVO } from "@/api/ecg/queue"; |
| | | import { RoomBedVO } from "@/api/ecg/doctor"; |
| | | import { Barcode } from "@/components/Barcode"; |
| | | import { useCheckTypeStore } from "@/store/modules/checkType"; |
| | | import { DICT_TYPE, getIntDictOptions } from '@/utils/dict' |
| | | import { tranlateDevState } from "../../../../utils/statusFormatter"; |
| | | import { getCheckTypeName } from "../../../../utils/checkTypeFormatter"; |
| | | // 需求1:患者信息 18 项统一展示块 |
| | | import PatientInfoBlock from "@/views/ecg/doctor/components/PatientInfoBlock.vue"; |
| | | |
| | | /** 装机 表单 */ |
| | | defineOptions({ name: 'DevrInstall' }) |
| | | /** 设备装机 表单 */ |
| | | defineComponent({ name: 'DevInstallPanel' }) |
| | | |
| | | const emit = defineEmits(['event_dev_install']) // 定义 success 事件,用于操作成功后的回调 |
| | | const props = defineProps({ |
| | | room: { |
| | | type: Object as PropType<RoomBedVO>, |
| | | required: true |
| | | } |
| | | }) |
| | | |
| | | const { t } = useI18n() // 国际化 |
| | | const message = useMessage() // 消息弹窗 |
| | | |
| | | const dialogVisible = ref(false) // 弹窗的是否展示 |
| | | const formRef = ref() // 表单 Ref |
| | | |
| | | const displayBarCode = ref<string>() |
| | | |
| | | const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用 |
| | | |
| | | const formData = ref({}) |
| | | const formData = ref<Partial<DevRentVO>>({ |
| | | applyNo: undefined, |
| | | episodeId: undefined, |
| | | patId: '', |
| | | patName: '', |
| | | rentTime: new Date().getTime(), |
| | | devId: '', |
| | | remark: '', |
| | | checkType: undefined, |
| | | }) |
| | | |
| | | const devInfo = ref<Partial<DeviceVO>>({ |
| | | category: undefined, |
| | | brand: undefined, |
| | | model: undefined, |
| | | state: undefined, |
| | | }) |
| | | |
| | | const formRules = reactive({ |
| | | // devId: [{ required: true, message: '设备编号不能为空', trigger: 'blur' }], |
| | | devId: [{ required: true, message: '设备编号不能为空', trigger: 'blur' }], |
| | | rentTime: [{ required: true, message: '请选择装机日期', trigger: 'blur' }], |
| | | patId: [{ required: true, message: '患者不能为空', trigger: 'blur' }], |
| | | patName: [{ required: true, message: '患者名不能为空', trigger: 'blur' }] |
| | | }) |
| | | const formRef = ref() // 表单 Ref |
| | | |
| | | |
| | | const emit = defineEmits(['event_dev_install']) // 定义 success 事件,用于操作成功后的回调 |
| | | |
| | | const checkTypeStore = useCheckTypeStore() |
| | | |
| | | const setPatient = (queueVO: QueueVO | undefined | null) => { |
| | | console.log("setPatient...", queueVO) |
| | | resetForm() |
| | | formData.value.applyNo = queueVO?.applyNo |
| | | formData.value.episodeId = queueVO?.episodeId |
| | | formData.value.patId = queueVO?.patId |
| | | formData.value.patName = queueVO?.patName |
| | | formData.value.checkType = queueVO?.bookCheckType |
| | | formData.value.tolerance = queueVO?.tolerance // 多耐药,后端从预约单补齐 |
| | | // 需求1:以下平铺字段由后端从预约单回填到 QueueRespVO, |
| | | // 必须显式赋值给 formData,否则模板里读不到。 |
| | | formData.value.patGender = queueVO?.patGender |
| | | formData.value.patBirthday = queueVO?.patBirthday |
| | | formData.value.registerDate = queueVO?.registerDate |
| | | formData.value.doctor = queueVO?.doctor |
| | | formData.value.doctorTime = queueVO?.doctorTime |
| | | formData.value.patSrc = queueVO?.patSrc |
| | | formData.value.patMobile = queueVO?.patMobile |
| | | formData.value.patPhone = queueVO?.patPhone |
| | | formData.value.patWardDesc = queueVO?.patWardDesc |
| | | formData.value.patBedNo = queueVO?.patBedNo |
| | | formData.value.medicalCard = queueVO?.medicalCard |
| | | formData.value.outpatientNo = queueVO?.outpatientNo |
| | | // 需求1:医嘱号(此前 3 个面板都遗漏了该字段的赋值,导致 PatientInfoBlock 恒显示 '-') |
| | | formData.value.doctorAdviceNo = queueVO?.doctorAdviceNo |
| | | formData.value.patIdentityId = queueVO?.patIdentityId |
| | | getReadyRentInfo(formData.value) // 获取领用信息 |
| | | copyBarcode() |
| | | } |
| | | defineExpose({ setPatient }) // 提供 setPatient 方法,用于设置患者 |
| | | |
| | | |
| | | /** 提交表单 */ |
| | | const submitForm = async () => { |
| | |
| | | // 提交请求 |
| | | formLoading.value = true |
| | | try { |
| | | if (null == formData.value) |
| | | return |
| | | |
| | | 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 |
| | | // 发送操作成功的事件 |
| | | emit('event_dev_install') |
| | | |
| | | resetForm() |
| | | getList() |
| | | |
| | | // 发送操作成功的事件 |
| | | emit('event_dev_install') |
| | | message.success(t('操作成功')) |
| | | } finally { |
| | | formLoading.value = false |
| | | } |
| | |
| | | devId: undefined, |
| | | patId: undefined, |
| | | patName: undefined, |
| | | patDeptCode: undefined, |
| | | patDeptDesc: undefined, |
| | | patWardCode: undefined, |
| | | patWardDesc: undefined, |
| | | patBedNo: undefined, |
| | | rentTime: new Date().getTime(), |
| | | returnTime: undefined, |
| | | tolerance: undefined, |
| | | interference: undefined, |
| | | baseline: undefined, |
| | | detachment: undefined, |
| | | remark: undefined, |
| | | category: '', |
| | | brand: '', |
| | | model: '', |
| | | checkType: undefined, |
| | | // 需求1:PatientInfoBlock 依赖的平铺字段(由 setPatient 从 QueueVO 赋值) |
| | | applyNo: undefined, |
| | | episodeId: undefined, |
| | | patGender: undefined, |
| | | patBirthday: undefined, |
| | | registerDate: undefined, |
| | | doctor: undefined, |
| | | doctorTime: undefined, |
| | | patSrc: undefined, |
| | | patMobile: undefined, |
| | | patPhone: undefined, |
| | | patWardDesc: undefined, |
| | | patBedNo: undefined, |
| | | medicalCard: undefined, |
| | | doctorAdviceNo: undefined, |
| | | outpatientNo: undefined, |
| | | patIdentityId: undefined, |
| | | status: undefined, |
| | | seqNum: undefined, |
| | | } |
| | | formRef.value?.resetFields() |
| | | devInfo.value = { |
| | | category: undefined, |
| | | brand: undefined, |
| | | model: undefined, |
| | | state: undefined, |
| | | } |
| | | } |
| | | |
| | | const getDevInfo = async () => { |
| | | if (isStringEmpty(formData.value.devId)) { |
| | | formData.value.category = "" |
| | | formData.value.brand = "" |
| | | formData.value.model = "" |
| | | if (formData.value?.devId == null) { |
| | | devInfo.value.brand = undefined |
| | | devInfo.value.model = undefined |
| | | devInfo.value.state = undefined |
| | | return |
| | | } |
| | | |
| | | const data = await DeviceApi.getDeviceByDevId(formData.value.devId!) |
| | | console.info( data ) |
| | | formData.value.category = data === null ? "" : data.category |
| | | formData.value.brand = data === null ? "" : data.brand |
| | | formData.value.model = data === null ? "" : data.model |
| | | const data = await DeviceApi.getDeviceByDevId(formData.value?.devId) |
| | | if (null !== data) |
| | | devInfo.value = data |
| | | } |
| | | |
| | | /* |
| | | const getRentInfoByDevId = () => { |
| | | const tempDevId = formData.value.devId; |
| | | resetForm() |
| | | if (isStringEmpty(tempDevId)) |
| | | return |
| | | |
| | | formData.value.devId = tempDevId; |
| | | getRentInfo() |
| | | } |
| | | */ |
| | | |
| | | const getRentInfoByPatId = () => { |
| | | const tempPatId = formData.value.patId; |
| | | if (null == formData.value?.patId) |
| | | return; |
| | | |
| | | const tempPatId = formData.value?.patId; |
| | | resetForm() |
| | | if (isStringEmpty(tempPatId)) |
| | | return |
| | | |
| | | formData.value.patId = tempPatId; |
| | | getRentInfo() |
| | | getReadyRentInfo(formData.value) |
| | | copyBarcode() |
| | | } |
| | | |
| | | const getRentInfo = async () => { |
| | | const data = await DevRentApi.getReadyRent(formData.value) |
| | | if (null === data) |
| | | // 获取患者的领用信息 |
| | | const getReadyRentInfo = async (devRentVO) => { |
| | | if ((devRentVO.devId == null || devRentVO.devId === '') && (devRentVO.patId == null || devRentVO.patId === '')) |
| | | return |
| | | |
| | | formData.value = data |
| | | if (data.returnTime === null) |
| | | data.returnTime = new Date().getTime() |
| | | } |
| | | const data = await DevRentApi.getReadyRent(devRentVO) |
| | | if (data == null) |
| | | return |
| | | |
| | | formData.value = data //不能整个赋值, 默认装机时间被清空 |
| | | if (formData.value == null) |
| | | return |
| | | |
| | | // 默认装机时间 采用当前日期 |
| | | formData.value.rentTime = new Date().getTime() |
| | | |
| | | // 让医生手动输入,避免出错 |
| | | formData.value.devId = '' |
| | | devInfo.value.category = undefined |
| | | devInfo.value.brand = undefined |
| | | devInfo.value.model = undefined |
| | | devInfo.value.state = undefined |
| | | } |
| | | |
| | | const loading = ref(true) // 列表的加载中 |
| | | const list = ref<JobRecordVO[]>([]) // 列表的数据 |
| | |
| | | |
| | | const onRowClick = (cur) => { |
| | | if (cur !== null) |
| | | getSelectedRent( cur.rentId ) |
| | | getSelectedRent(cur.rentId) |
| | | } |
| | | |
| | | const getSelectedRent = async (rentId) => { |
| | | formData.value = await DevRentApi.getDevRent(rentId) |
| | | const data = await DevRentApi.getDevRent(rentId) |
| | | |
| | | formData.value = data |
| | | |
| | | devInfo.value.category = data.category |
| | | devInfo.value.brand = data.brand |
| | | devInfo.value.model = data.model |
| | | devInfo.value.state = data.devState |
| | | } |
| | | |
| | | 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) |
| | |
| | | getList() |
| | | } |
| | | |
| | | const getDisplayBarcode = (): string => { |
| | | if (!formData.value.checkType) |
| | | return "" |
| | | |
| | | const displayBarcode: number[] = checkTypeStore.getCheckTypeDispBarCode(formData.value.checkType!) |
| | | if (formData.value.patDetails == null || formData.value.patDetails.source == null || |
| | | !displayBarcode.includes(formData.value.patDetails.source)) |
| | | return "" |
| | | |
| | | return getBarcode() |
| | | } |
| | | |
| | | const getBarcode = (): string => { |
| | | if (!formData.value.checkType) |
| | | return "" |
| | | |
| | | const patSource = formData.value.patDetails?.source |
| | | if (patSource == null) |
| | | return "" |
| | | |
| | | if (1 === patSource || 2 === patSource) |
| | | return formData.value.applyNo ?? "" |
| | | else if (3 === patSource || 4 === patSource) |
| | | return formData.value.episodeId ?? "" |
| | | |
| | | return "" |
| | | } |
| | | |
| | | const copyBarcode = async () => { |
| | | displayBarCode.value = getDisplayBarcode() |
| | | await navigator.clipboard.writeText(getBarcode()); |
| | | } |
| | | |
| | | /** 初始化 **/ |
| | | onMounted(() => { |
| | | resetForm() |