Merge remote-tracking branch 'origin/develop' into develop
This commit is contained in:
@@ -893,7 +893,8 @@ public class ATDManageAppServiceImpl implements IATDManageAppService {
|
||||
public R<?> getPendingMedication(Long encounterId) {
|
||||
Integer tenantId = SecurityUtils.getLoginUser().getTenantId();
|
||||
return R.ok(atdManageAppMapper.getPendingMedication(encounterId, DispenseStatus.EXECUTED.getValue(),
|
||||
DispenseStatus.SUBMITTED.getValue(), RequestStatus.CANCELLED.getValue(), tenantId));
|
||||
DispenseStatus.SUBMITTED.getValue(), RequestStatus.CANCELLED.getValue(),
|
||||
DispenseStatus.PENDING_REFUND.getValue(), tenantId));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1329,4 +1330,3 @@ public class ATDManageAppServiceImpl implements IATDManageAppService {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -111,7 +111,8 @@ public interface ATDManageAppMapper {
|
||||
**/
|
||||
List<PendingMedicationDto> getPendingMedication(@Param("encounterId") Long encounterId,
|
||||
@Param("preparationStatus") Integer preparationStatus, @Param("summarizedStatus") Integer summarizedStatus,
|
||||
@Param("requestStatus") Integer requestStatus, @Param("tenantId") Integer tenantId);
|
||||
@Param("requestStatus") Integer requestStatus, @Param("pendingRefundStatus") Integer pendingRefundStatus,
|
||||
@Param("tenantId") Integer tenantId);
|
||||
|
||||
/**
|
||||
* 查询医嘱分页列表
|
||||
|
||||
@@ -82,7 +82,11 @@ public class PatientHomeAppServiceImpl implements IPatientHomeAppService {
|
||||
// 血型RH
|
||||
e.setBloodRh_enumText(EnumUtils.getInfoByValue(BloodTypeRH.class, e.getBloodRh()));
|
||||
// 患者状态
|
||||
e.setStatusEnum_enumText(EnumUtils.getInfoByValue(EncounterStatus.class, e.getStatusEnum()));
|
||||
if (EncounterClass.IMP.getValue().equals(e.getClassEnum())) {
|
||||
e.setStatusEnum_enumText(EnumUtils.getInfoByValue(EncounterZyStatus.class, e.getStatusEnum()));
|
||||
} else {
|
||||
e.setStatusEnum_enumText(EnumUtils.getInfoByValue(EncounterStatus.class, e.getStatusEnum()));
|
||||
}
|
||||
// 职业
|
||||
e.setPrfsEnum_enumText(EnumUtils.getInfoByValue(OccupationType.class, e.getPrfsEnum()));
|
||||
// 联系人关系
|
||||
@@ -253,13 +257,23 @@ public class PatientHomeAppServiceImpl implements IPatientHomeAppService {
|
||||
// 出院
|
||||
boolean encounterSuccess;
|
||||
// 1.就诊管理表
|
||||
Encounter existingEncounter = encounterService.getById(encounterId);
|
||||
Integer targetStatus;
|
||||
if (existingEncounter != null && EncounterClass.IMP.getValue().equals(existingEncounter.getClassEnum())) {
|
||||
// 住院就诊:状态流转为待出院结算 (DISCHARGED_FROM_HOSPITAL)
|
||||
targetStatus = EncounterZyStatus.DISCHARGED_FROM_HOSPITAL.getValue();
|
||||
} else {
|
||||
// 默认或门诊就诊:状态流转为完成 (COMPLETED)
|
||||
targetStatus = EncounterStatus.COMPLETED.getValue();
|
||||
}
|
||||
|
||||
Encounter encounter = new Encounter();
|
||||
// 就诊ID
|
||||
encounter.setId(encounterId)
|
||||
// 患者ID
|
||||
.setPatientId(patientId)
|
||||
// 状态编码
|
||||
.setStatusEnum(EncounterStatus.COMPLETED.getValue())
|
||||
.setStatusEnum(targetStatus)
|
||||
// 结束时间
|
||||
.setEndTime(DischargeHospitalYmd);
|
||||
|
||||
|
||||
@@ -349,8 +349,9 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
|
||||
}
|
||||
|
||||
} else if (ItemType.ACTIVITY.getValue().equals(adviceType)
|
||||
|| ItemType.TEXT.getValue().equals(adviceType)
|
||||
|| (adviceType != null && (adviceType == 26 || adviceType == 31))) {
|
||||
// 诊疗活动删除(包括护理type=26和未知类型type=31)
|
||||
// 诊疗活动删除(包括文字医嘱type=8、护理type=26和未知类型type=31)
|
||||
ServiceRequest serviceRequest = iServiceRequestService.getById(requestId);
|
||||
if (serviceRequest != null) {
|
||||
if (!RequestStatus.DRAFT.getValue().equals(serviceRequest.getStatusEnum())) {
|
||||
@@ -1087,6 +1088,7 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
|
||||
List<AdviceBatchOpParam> activityList = paramList.stream()
|
||||
.filter(e -> ItemType.ACTIVITY.getValue().equals(e.getAdviceType())
|
||||
|| ItemType.SURGERY.getValue().equals(e.getAdviceType())
|
||||
|| ItemType.TEXT.getValue().equals(e.getAdviceType())
|
||||
|| (e.getAdviceType() != null && e.getAdviceType() == 26))
|
||||
.collect(Collectors.toList());
|
||||
List<Long> activityRequestIds
|
||||
|
||||
@@ -417,9 +417,9 @@
|
||||
mmr.unit_code,
|
||||
mmdi.dispense_quantity,
|
||||
aci.total_price,
|
||||
mmdi.practitioner_id AS dispense_practitioner_id,
|
||||
ap.name AS dispense_practitioner_name,
|
||||
mmdi.planned_dispense_time,
|
||||
mmdi.dispense_time AS planned_dispense_time,
|
||||
NULL AS dispense_practitioner_id,
|
||||
NULL AS dispense_practitioner_name,
|
||||
mmdi.status_enum AS dispense_status_enum,
|
||||
mmr.status_enum AS request_status_enum
|
||||
|
||||
@@ -448,7 +448,8 @@
|
||||
AND ap.delete_flag = '0'
|
||||
WHERE mmr.encounter_id = #{encounterId}
|
||||
AND ((mmdi.status_enum = #{preparationStatus}
|
||||
OR mmdi.status_enum = #{summarizedStatus})
|
||||
OR mmdi.status_enum = #{summarizedStatus}
|
||||
OR mmdi.status_enum = #{pendingRefundStatus})
|
||||
OR mmr.status_enum = #{requestStatus})
|
||||
</select>
|
||||
<select id="selectInpatientAdvicePage"
|
||||
|
||||
@@ -35,7 +35,7 @@ export const INFO_KEYS = [
|
||||
show: true,
|
||||
},
|
||||
{
|
||||
name: '病历号',
|
||||
name: '住院号',
|
||||
key: 'hosNum',
|
||||
order: 6,
|
||||
show: true,
|
||||
|
||||
@@ -194,6 +194,13 @@
|
||||
placeholder=" "
|
||||
style="width: 150px"
|
||||
>
|
||||
<!-- Bug #838: 若当前值不在 inpatient_diag_category 中,从 med_type 注入选项确保 el-select 显示其 label -->
|
||||
<el-option
|
||||
v-if="getMedTypeOption(scope.row)"
|
||||
:key="'med-' + getMedTypeOption(scope.row).value"
|
||||
:label="getMedTypeOption(scope.row).label"
|
||||
:value="getMedTypeOption(scope.row).value"
|
||||
/>
|
||||
<el-option
|
||||
v-for="item in inpatient_diag_category"
|
||||
:key="item.value"
|
||||
@@ -439,8 +446,18 @@ const props = defineProps({
|
||||
const emits = defineEmits(['diagnosisSave']);
|
||||
const { proxy } = getCurrentInstance();
|
||||
const userStore = useUserStore();
|
||||
// 获取诊断类型字典(住院诊断类别)
|
||||
const { inpatient_diag_category } = proxy.useDict('inpatient_diag_category');
|
||||
// Bug #838: inpatient_diag_category 提供下拉选项,med_type 用于解析当前值的显示文本
|
||||
const { inpatient_diag_category, med_type } = proxy.useDict('inpatient_diag_category', 'med_type');
|
||||
|
||||
// Bug #838: 从 med_type 字典中查找当前值对应的选项,注入到 el-select 中确保标签正确显示
|
||||
function getMedTypeOption(row) {
|
||||
if (row.medTypeCode == null || row.medTypeCode === '') return null;
|
||||
const codeStr = String(row.medTypeCode);
|
||||
// 如果值已存在于 inpatient_diag_category 中,无需额外注入
|
||||
if (inpatient_diag_category.value.some(item => String(item.value) === codeStr)) return null;
|
||||
// 从 med_type 中查找对应标签
|
||||
return med_type.value.find(item => String(item.value) === codeStr) || null;
|
||||
}
|
||||
const rules = ref({
|
||||
name: [{ required: true, message: '请选择诊断', trigger: 'change' }],
|
||||
medTypeCode: [{ required: true, message: '请选择诊断类型', trigger: 'change' }],
|
||||
@@ -547,7 +564,8 @@ function getList() {
|
||||
syndromeGroupNo: '',
|
||||
showPopover: false,
|
||||
diagnosisTime: formatDisplayDate(item.diagnosisTime),
|
||||
syndromeOptions: []
|
||||
syndromeOptions: [],
|
||||
medTypeCode: item.medTypeCode != null ? String(item.medTypeCode) : '',
|
||||
};
|
||||
if (obj.diagSrtNo == null) {
|
||||
obj.diagSrtNo = 1;
|
||||
@@ -584,7 +602,7 @@ function getList() {
|
||||
syndromeDefinitionId: syndromeId,
|
||||
syndromeOptions: syndromeCode ? [{ value: syndromeCode, label: syndromeName, id: syndromeId }] : [],
|
||||
diagSrtNo: item.diagSrtNo,
|
||||
medTypeCode: item.medTypeCode,
|
||||
medTypeCode: item.medTypeCode != null ? String(item.medTypeCode) : '',
|
||||
maindiseFlag: item.maindiseFlag,
|
||||
verificationStatusEnum: item.verificationStatusEnum,
|
||||
diagnosisDesc: item.diagnosisDesc || '',
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
:loading="loading || isSaving"
|
||||
:loading="isSaving"
|
||||
:disabled="isSaveDisabled || loading || isSaving"
|
||||
@click="handleSave()"
|
||||
>
|
||||
@@ -401,7 +401,17 @@
|
||||
</template>
|
||||
</el-popover>
|
||||
</template>
|
||||
<span v-else>{{ scope.row.adviceName }}</span>
|
||||
<span v-else>
|
||||
<el-tag
|
||||
v-if="getAdviceTypeLabel(scope.row)"
|
||||
size="small"
|
||||
type="info"
|
||||
style="margin-right: 4px"
|
||||
>
|
||||
{{ getAdviceTypeLabel(scope.row) }}
|
||||
</el-tag>
|
||||
{{ scope.row.adviceName }}
|
||||
</span>
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column
|
||||
@@ -1085,9 +1095,13 @@ function getListInfo(addNewRow) {
|
||||
// 避免因树为空导致 orgId 无法匹配,从而显示数字 ID 而非中文名称
|
||||
const orgTreePromise = getOrgTree().then((res) => {
|
||||
organization.value = res?.data?.records ?? res?.data ?? [];
|
||||
}).catch(() => {
|
||||
// 科室树加载失败不应阻塞主数据渲染,静默降级
|
||||
organization.value = [];
|
||||
});
|
||||
getPrescriptionList(localPatient.value.encounterId).then((res) => {
|
||||
// 等待科室树加载完成后再处理处方数据,确保 resolveOrgId 能正确匹配
|
||||
// 使用 finally 确保无论科室树成功与否,loading 都能被重置
|
||||
orgTreePromise.then(() => {
|
||||
loading.value = false;
|
||||
prescriptionList.value = res.data
|
||||
@@ -1114,6 +1128,10 @@ function getListInfo(addNewRow) {
|
||||
unitCodeList: unitCodeListData,
|
||||
// 确保 therapyEnum 被正确设置,优先使用 contentJson 中的值
|
||||
therapyEnum: String(parsedContent?.therapyEnum ?? item.therapyEnum ?? '1'),
|
||||
// 🔧 Bug #840: 确保 adviceType 优先使用 contentJson 中的值
|
||||
// item.adviceType 来自 DB 可能为 null,会覆盖 parsedContent 中的正确值
|
||||
adviceType: parsedContent?.adviceType ?? item.adviceType,
|
||||
categoryCode: parsedContent?.categoryCode ?? item.categoryCode ?? '',
|
||||
// 🔧 修复:确保 orgId 为 String 类型,与 organization 树的 id 类型一致
|
||||
// 确保 skinTestFlag 是数字类型(1 或 0),从 contentJson 恢复
|
||||
skinTestFlag: parsedContent?.skinTestFlag !== undefined && parsedContent?.skinTestFlag !== null
|
||||
@@ -1280,6 +1298,17 @@ function getRowSelectValue(row) {
|
||||
return row.adviceType;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据行的 adviceType + categoryCode 获取中文类型标签
|
||||
* 供非编辑模式下显示医嘱类型(如"西药"、"中成药"、"文字"等)
|
||||
*/
|
||||
function getAdviceTypeLabel(row) {
|
||||
if (!row.adviceType) return '';
|
||||
const selectValue = getRowSelectValue(row);
|
||||
const item = adviceTypeList.value.find((opt) => opt.value === selectValue);
|
||||
return item ? item.label : '';
|
||||
}
|
||||
|
||||
// 新增医嘱
|
||||
function handleAddPrescription() {
|
||||
// 校验是否选中患者
|
||||
|
||||
@@ -626,9 +626,18 @@ const onNursingStatus = () => {
|
||||
openDrawer.value = true;
|
||||
};
|
||||
const save = async () => {
|
||||
// Bug #824: 校验动态组件和模板是否已正确加载,避免可选链静默吞掉 null 导致"无响应"
|
||||
if (!emrComponentRef.value) {
|
||||
ElMessage.warning(t('inpatientDoctor.emr.pleaseSelectEmrTemplate'));
|
||||
return;
|
||||
}
|
||||
if (!currentSelectTemplate.value?.id) {
|
||||
ElMessage.warning(t('inpatientDoctor.emr.pleaseSelectEmrTemplate'));
|
||||
return;
|
||||
}
|
||||
try {
|
||||
currentOperate.value = 'add';
|
||||
await emrComponentRef.value?.submit();
|
||||
await emrComponentRef.value.submit();
|
||||
} catch (error) {
|
||||
console.log('error=============>', error);
|
||||
|
||||
|
||||
@@ -120,11 +120,11 @@
|
||||
@ok-act="handleTransferInOk"
|
||||
/>
|
||||
<SignEntryDialog v-model:visible="signEntryDialogVisible" />
|
||||
<!-- <ChangeBedDialog
|
||||
<ChangeBedDialog
|
||||
v-model:visible="changeBedDialogVisible"
|
||||
:bad-list="badList"
|
||||
@ok-act="handleTransferInOk"
|
||||
/> -->
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
@@ -132,7 +132,7 @@ import Filter from '@/components/TableLayout/Filter.vue';
|
||||
import {computed, onBeforeMount, onMounted, reactive, ref} from 'vue';
|
||||
import TransferInDialog from './transferInDialog.vue';
|
||||
import SignEntryDialog from './signEntryDialog.vue';
|
||||
// import ChangeBedDialog from './changeBedDialog.vue';
|
||||
import ChangeBedDialog from './changeBedDialog.vue';
|
||||
import {childLocationList, getBedInfo, getInit, getPendingInfo, getPractitionerWard, cancelBedAssignment} from './api';
|
||||
import {ElLoading, ElMessage, ElMessageBox} from 'element-plus';
|
||||
import PendingPatientList from '@/components/PendingPatientList/index.vue';
|
||||
|
||||
@@ -0,0 +1,404 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-model="visible"
|
||||
title="患者换床"
|
||||
width="580px"
|
||||
destroy-on-close
|
||||
@open="handleOpen"
|
||||
@closed="handleClosed"
|
||||
>
|
||||
<div class="change-bed-dialog-container">
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
label-width="100px"
|
||||
label-position="right"
|
||||
>
|
||||
<!-- 患者甲 (换床发起主体) -->
|
||||
<div class="form-section">
|
||||
<div class="section-title">
|
||||
<span class="section-badge badge-a">患者甲</span> 换床主体选择
|
||||
</div>
|
||||
<el-form-item label="选择患者" prop="encounterId">
|
||||
<el-select
|
||||
v-model="form.encounterId"
|
||||
placeholder="请选择在床患者"
|
||||
filterable
|
||||
style="width: 100%"
|
||||
@change="handlePatientAChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in activePatients"
|
||||
:key="item.encounterId"
|
||||
:label="`${item.patientName} - 住院号: ${item.busNo} (${item.houseName || '-'}-${item.bedName || '-'})`"
|
||||
:value="item.encounterId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<transition name="fade">
|
||||
<div v-if="patientAInfo" class="patient-detail-card card-a">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<div class="info-item"><span class="label">住院号:</span> {{ patientAInfo.busNo }}</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div class="info-item"><span class="label">当前床位:</span> {{ patientAInfo.houseName || '-' }}-{{ patientAInfo.bedName || '-' }}</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</transition>
|
||||
</div>
|
||||
|
||||
<!-- 目标床位 -->
|
||||
<div class="form-section" style="margin-top: 24px;">
|
||||
<div class="section-title">
|
||||
<span class="section-badge badge-target">目标床位</span> 换床目标位置
|
||||
</div>
|
||||
<el-form-item label="选择床位" prop="targetBedId">
|
||||
<el-select
|
||||
v-model="form.targetBedId"
|
||||
placeholder="请选择目标床位"
|
||||
filterable
|
||||
style="width: 100%"
|
||||
@change="handleTargetBedChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in availableBeds"
|
||||
:key="item.bedId"
|
||||
:label="`${item.houseName || '-'}-${item.bedName || '-'} [${item.bedStatus == 5 ? '占用' : '空闲'}]`"
|
||||
:value="item.bedId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<!-- 互换模式警示/状态提示 -->
|
||||
<transition name="fade">
|
||||
<div v-if="isSwapMode" class="swap-mode-indicator">
|
||||
<div class="indicator-header">
|
||||
<el-icon class="warning-icon"><Warning /></el-icon>
|
||||
<span>检测到目标床位已被占用,将自动进入【两床对换】模式</span>
|
||||
</div>
|
||||
</div>
|
||||
</transition>
|
||||
</div>
|
||||
|
||||
<!-- 患者乙 (对换客体,仅在对换模式下显示) -->
|
||||
<transition name="slide-fade">
|
||||
<div v-if="isSwapMode" class="form-section" style="margin-top: 24px;">
|
||||
<div class="section-title">
|
||||
<span class="section-badge badge-b">患者乙</span> 对换床位占用者
|
||||
</div>
|
||||
<div class="patient-detail-card card-b">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<div class="info-item"><span class="label">患者姓名:</span> <strong style="color: var(--el-color-primary)">{{ patientBInfo?.patientName }}</strong></div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div class="info-item"><span class="label">住院号:</span> {{ patientBInfo?.busNo }}</div>
|
||||
</el-col>
|
||||
<el-col :span="24" style="margin-top: 8px">
|
||||
<div class="info-item"><span class="label">当前床位:</span> {{ patientBInfo?.houseName || '-' }}-{{ patientBInfo?.bedName || '-' }}</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</div>
|
||||
</transition>
|
||||
</el-form>
|
||||
</div>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="visible = false">取 消</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
:loading="submitLoading"
|
||||
@click="handleSubmit"
|
||||
>
|
||||
确 定
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, computed, reactive } from 'vue';
|
||||
import type { FormInstance, FormRules } from 'element-plus';
|
||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
import { Warning } from '@element-plus/icons-vue';
|
||||
import { changeBedAssignment } from './api';
|
||||
|
||||
const props = defineProps({
|
||||
visible: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
badList: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
});
|
||||
|
||||
const emits = defineEmits(['update:visible', 'okAct']);
|
||||
|
||||
// 弹窗可见性双向绑定
|
||||
const visible = computed({
|
||||
get: () => props.visible,
|
||||
set: (val) => emits('update:visible', val),
|
||||
});
|
||||
|
||||
const formRef = ref<FormInstance>();
|
||||
const submitLoading = ref(false);
|
||||
|
||||
const form = reactive({
|
||||
encounterId: undefined as number | undefined,
|
||||
targetBedId: undefined as number | undefined,
|
||||
});
|
||||
|
||||
const rules = reactive<FormRules>({
|
||||
encounterId: [{ required: true, message: '请选择换床患者', trigger: 'change' }],
|
||||
targetBedId: [{ required: true, message: '请选择目标床位', trigger: 'change' }],
|
||||
});
|
||||
|
||||
// 从床位列表中提取出当前在床的所有患者 (作为患者甲的选择项)
|
||||
const activePatients = computed(() => {
|
||||
return props.badList
|
||||
.filter((item: any) => item.encounterId && item.patientName)
|
||||
.map((item: any) => ({
|
||||
encounterId: item.encounterId,
|
||||
patientName: item.patientName,
|
||||
busNo: item.busNo,
|
||||
bedId: item.bedId,
|
||||
bedName: item.bedName,
|
||||
houseId: item.houseId,
|
||||
houseName: item.houseName,
|
||||
}));
|
||||
});
|
||||
|
||||
// 目标床位候选项 (排除患者甲当前所在的床位)
|
||||
const availableBeds = computed(() => {
|
||||
const patientA = activePatients.value.find(p => p.encounterId === form.encounterId);
|
||||
if (!patientA) {
|
||||
return props.badList;
|
||||
}
|
||||
return props.badList.filter((item: any) => item.bedId !== patientA.bedId);
|
||||
});
|
||||
|
||||
// 患者甲详细信息
|
||||
const patientAInfo = computed(() => {
|
||||
return activePatients.value.find(p => p.encounterId === form.encounterId);
|
||||
});
|
||||
|
||||
// 是否是对换模式
|
||||
const isSwapMode = ref(false);
|
||||
const patientBInfo = ref<any>(null);
|
||||
|
||||
// 选择目标床位后的联动处理
|
||||
function handleTargetBedChange(val: number) {
|
||||
const selectedBed = props.badList.find((item: any) => item.bedId === val) as any;
|
||||
if (selectedBed && selectedBed.encounterId && selectedBed.patientName) {
|
||||
// 目标床位已被占用,自动开启对换模式
|
||||
isSwapMode.value = true;
|
||||
patientBInfo.value = {
|
||||
encounterId: selectedBed.encounterId,
|
||||
patientName: selectedBed.patientName,
|
||||
busNo: selectedBed.busNo,
|
||||
bedId: selectedBed.bedId,
|
||||
bedName: selectedBed.bedName,
|
||||
houseId: selectedBed.houseId,
|
||||
houseName: selectedBed.houseName,
|
||||
};
|
||||
} else {
|
||||
// 目标床位为空闲
|
||||
isSwapMode.value = false;
|
||||
patientBInfo.value = null;
|
||||
}
|
||||
}
|
||||
|
||||
// 当换床主体变更时,清空目标床位选择,防止选到自己当前床位
|
||||
function handlePatientAChange() {
|
||||
form.targetBedId = undefined;
|
||||
isSwapMode.value = false;
|
||||
patientBInfo.value = null;
|
||||
}
|
||||
|
||||
function handleOpen() {
|
||||
// 打开弹窗时清空表单
|
||||
form.encounterId = undefined;
|
||||
form.targetBedId = undefined;
|
||||
isSwapMode.value = false;
|
||||
patientBInfo.value = null;
|
||||
}
|
||||
|
||||
function handleClosed() {
|
||||
formRef.value?.resetFields();
|
||||
}
|
||||
|
||||
// 提交换床
|
||||
async function handleSubmit() {
|
||||
if (!formRef.value) return;
|
||||
await formRef.value.validate(async (valid) => {
|
||||
if (valid) {
|
||||
if (form.encounterId === patientBInfo.value?.encounterId) {
|
||||
ElMessage.error('不能与自己互换床位!');
|
||||
return;
|
||||
}
|
||||
|
||||
const confirmMessage = isSwapMode.value
|
||||
? `确认将患者【${patientAInfo.value?.patientName}】与【${patientBInfo.value?.patientName}】进行床位互换吗?`
|
||||
: `确认将患者【${patientAInfo.value?.patientName}】换到【${patientBInfo.value?.houseName || ''}-${patientBInfo.value?.bedName || '新床位'}】吗?`;
|
||||
|
||||
ElMessageBox.confirm(confirmMessage, '换床确认', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(async () => {
|
||||
submitLoading.value = true;
|
||||
try {
|
||||
const res = await changeBedAssignment(form.encounterId!, form.targetBedId!);
|
||||
if (res.code === 200) {
|
||||
ElMessage.success(isSwapMode.value ? '床位对换成功!' : '换床成功!');
|
||||
visible.value = false;
|
||||
emits('okAct');
|
||||
} else {
|
||||
ElMessage.error(res.msg || '换床操作失败');
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('换床失败:', error);
|
||||
} finally {
|
||||
submitLoading.value = false;
|
||||
}
|
||||
})
|
||||
.catch(() => {});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.change-bed-dialog-container {
|
||||
padding: 10px 20px;
|
||||
}
|
||||
|
||||
.form-section {
|
||||
border: 1px solid var(--el-border-color-lighter);
|
||||
border-radius: 8px;
|
||||
padding: 16px;
|
||||
background-color: var(--el-bg-color-page);
|
||||
}
|
||||
|
||||
.section-title {
|
||||
font-size: 15px;
|
||||
font-weight: 600;
|
||||
margin-bottom: 16px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
color: var(--el-text-color-primary);
|
||||
}
|
||||
|
||||
.section-badge {
|
||||
font-size: 11px;
|
||||
color: #fff;
|
||||
padding: 2px 6px;
|
||||
border-radius: 4px;
|
||||
margin-right: 8px;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.badge-a {
|
||||
background-color: var(--el-color-primary);
|
||||
}
|
||||
|
||||
.badge-target {
|
||||
background-color: var(--el-color-warning);
|
||||
}
|
||||
|
||||
.badge-b {
|
||||
background-color: var(--el-color-success);
|
||||
}
|
||||
|
||||
.patient-detail-card {
|
||||
margin-top: 12px;
|
||||
padding: 12px;
|
||||
border-radius: 6px;
|
||||
font-size: 13px;
|
||||
line-height: 1.8;
|
||||
}
|
||||
|
||||
.card-a {
|
||||
background-color: var(--el-color-primary-light-9);
|
||||
border-left: 4px solid var(--el-color-primary);
|
||||
color: var(--el-color-primary-dark-2);
|
||||
}
|
||||
|
||||
.card-b {
|
||||
background-color: var(--el-color-success-light-9);
|
||||
border-left: 4px solid var(--el-color-success);
|
||||
color: var(--el-color-success-dark-2);
|
||||
}
|
||||
|
||||
.info-item {
|
||||
color: var(--el-text-color-regular);
|
||||
}
|
||||
|
||||
.info-item .label {
|
||||
font-weight: 500;
|
||||
margin-right: 6px;
|
||||
color: var(--el-text-color-secondary);
|
||||
}
|
||||
|
||||
.swap-mode-indicator {
|
||||
margin-top: 12px;
|
||||
padding: 10px 14px;
|
||||
background-color: var(--el-color-warning-light-9);
|
||||
border: 1px dashed var(--el-color-warning);
|
||||
border-radius: 6px;
|
||||
color: var(--el-color-warning-dark-2);
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.indicator-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.warning-icon {
|
||||
font-size: 16px;
|
||||
color: var(--el-color-warning);
|
||||
}
|
||||
|
||||
.dialog-footer {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
/* 动效 */
|
||||
.fade-enter-active,
|
||||
.fade-leave-active {
|
||||
transition: opacity 0.3s ease;
|
||||
}
|
||||
|
||||
.fade-enter-from,
|
||||
.fade-leave-to {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.slide-fade-enter-active {
|
||||
transition: all 0.3s ease-out;
|
||||
}
|
||||
|
||||
.slide-fade-leave-active {
|
||||
transition: all 0.3s cubic-bezier(1, 0.5, 0.8, 1);
|
||||
}
|
||||
|
||||
.slide-fade-enter-from,
|
||||
.slide-fade-leave-to {
|
||||
transform: translateY(-10px);
|
||||
opacity: 0;
|
||||
}
|
||||
</style>
|
||||
@@ -499,6 +499,77 @@
|
||||
field="medicationName"
|
||||
min-width="150"
|
||||
/>
|
||||
<vxe-column
|
||||
:title="t('inpatientNurse.transfer.orderStatus')"
|
||||
align="center"
|
||||
width="120"
|
||||
>
|
||||
<template #default="scope">
|
||||
<el-tag :type="getMedicationOrderStatus(scope.row).type">
|
||||
{{ getMedicationOrderStatus(scope.row).label }}
|
||||
</el-tag>
|
||||
<el-tag
|
||||
v-if="false && scope.row.requestStatusEnum == 6"
|
||||
type="danger"
|
||||
>
|
||||
停止
|
||||
</el-tag>
|
||||
<el-tag
|
||||
v-else-if="false && scope.row.requestStatusEnum == 13"
|
||||
type="warning"
|
||||
>
|
||||
已停嘱(待核对)
|
||||
</el-tag>
|
||||
<el-tag
|
||||
v-else-if="false && scope.row.requestStatusEnum == 5"
|
||||
type="warning"
|
||||
>
|
||||
待退药
|
||||
</el-tag>
|
||||
<el-tag
|
||||
v-else-if="false && scope.row.requestStatusEnum == 2"
|
||||
type="success"
|
||||
>
|
||||
已签发
|
||||
</el-tag>
|
||||
<el-tag
|
||||
v-else-if="false && scope.row.requestStatusEnum == 1"
|
||||
type="primary"
|
||||
>
|
||||
待签发
|
||||
</el-tag>
|
||||
<el-tag
|
||||
v-else-if="false && (scope.row.requestStatusEnum == 3 || scope.row.requestStatusEnum == 10)"
|
||||
type="primary"
|
||||
>
|
||||
已校对
|
||||
</el-tag>
|
||||
<el-tag
|
||||
v-else-if="false && scope.row.dispenseStatusEnum == 11"
|
||||
type="primary"
|
||||
>
|
||||
已执行
|
||||
</el-tag>
|
||||
<el-tag
|
||||
v-else-if="false && scope.row.dispenseStatusEnum == 18"
|
||||
type="warning"
|
||||
>
|
||||
已提交(待发药)
|
||||
</el-tag>
|
||||
<el-tag
|
||||
v-else-if="false && (scope.row.requestStatusEnum == 20 || scope.row.dispenseStatusEnum == 4)"
|
||||
type="success"
|
||||
>
|
||||
已完成
|
||||
</el-tag>
|
||||
<el-tag
|
||||
v-else-if="false"
|
||||
type="info"
|
||||
>
|
||||
-
|
||||
</el-tag>
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column
|
||||
:title="t('inpatientNurse.transfer.spec')"
|
||||
field="medicationSpec"
|
||||
@@ -989,6 +1060,52 @@ function getCategoryLabel(row: any) {
|
||||
return targetLabel;
|
||||
}
|
||||
|
||||
function getMedicationOrderStatus(row: any) {
|
||||
const requestStatus = Number(row?.requestStatusEnum);
|
||||
const dispenseStatus = Number(row?.dispenseStatusEnum);
|
||||
|
||||
if (requestStatus === 6) {
|
||||
return { label: '\u505c\u6b62', type: 'danger' };
|
||||
}
|
||||
if (requestStatus === 13) {
|
||||
return { label: '\u5df2\u505c\u5631/\u5f85\u6838\u5bf9', type: 'warning' };
|
||||
}
|
||||
if (requestStatus === 5 || dispenseStatus === 16) {
|
||||
return { label: '\u5f85\u9000\u836f', type: 'warning' };
|
||||
}
|
||||
|
||||
const dispenseStatusMap: Record<number, { label: string; type: string }> = {
|
||||
2: { label: '\u5f85\u914d\u836f', type: 'warning' },
|
||||
3: { label: '\u5f85\u53d1\u836f', type: 'warning' },
|
||||
4: { label: '\u5df2\u53d1\u836f', type: 'success' },
|
||||
8: { label: '\u5df2\u6c47\u603b', type: 'primary' },
|
||||
10: { label: '\u90e8\u5206\u9000\u836f', type: 'warning' },
|
||||
11: { label: '\u5df2\u6267\u884c', type: 'primary' },
|
||||
12: { label: '\u5df2\u9000\u836f', type: 'success' },
|
||||
15: { label: '\u64a4\u56de', type: 'info' },
|
||||
17: { label: '\u5df2\u9000\u836f', type: 'success' },
|
||||
18: { label: '\u5df2\u63d0\u4ea4(\u5f85\u53d1\u836f)', type: 'warning' },
|
||||
};
|
||||
if (dispenseStatusMap[dispenseStatus]) {
|
||||
return dispenseStatusMap[dispenseStatus];
|
||||
}
|
||||
|
||||
const requestStatusMap: Record<number, { label: string; type: string }> = {
|
||||
1: { label: '\u5f85\u7b7e\u53d1', type: 'primary' },
|
||||
2: { label: '\u5df2\u7b7e\u53d1', type: 'success' },
|
||||
3: { label: '\u5df2\u6821\u5bf9', type: 'primary' },
|
||||
4: { label: '\u6682\u505c', type: 'warning' },
|
||||
7: { label: '\u4e0d\u6267\u884c', type: 'info' },
|
||||
8: { label: '\u5df2\u51fa\u62a5\u544a', type: 'success' },
|
||||
10: { label: '\u5df2\u6821\u5bf9', type: 'primary' },
|
||||
11: { label: '\u5f85\u63a5\u6536', type: 'primary' },
|
||||
12: { label: '\u5df2\u63a5\u6536', type: 'success' },
|
||||
20: { label: '\u5df2\u53d1\u836f', type: 'success' },
|
||||
};
|
||||
|
||||
return requestStatusMap[requestStatus] || { label: '-', type: 'info' };
|
||||
}
|
||||
|
||||
function handleGetDRMedication() {
|
||||
if (!selectedPatient.value || !selectedPatient.value.encounterId) {
|
||||
medicationList.value = [];
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
<div style="width: 100%">
|
||||
<el-input
|
||||
v-model="queryParams.searchKey"
|
||||
placeholder="请输入患者名/病历号"
|
||||
placeholder="请输入患者名/住院号"
|
||||
clearable
|
||||
style="width: 48%; margin-bottom: 10px; margin-right: 10px"
|
||||
@keyup.enter="getPatientListInfo"
|
||||
@@ -56,7 +56,7 @@
|
||||
min-width="50"
|
||||
/>
|
||||
<vxe-column
|
||||
title="病历号"
|
||||
title="住院号"
|
||||
align="center"
|
||||
field="patientBusNo"
|
||||
/>
|
||||
@@ -351,7 +351,7 @@ function viewPatient(row) {
|
||||
data1.grParamBOS.age = row.ageString;
|
||||
data1.grParamBOS.birth = row.birthDate;
|
||||
data1.grParamBOS.cwh = row.bedLocationId_dictText;
|
||||
data1.grParamBOS.hosNum = row.encounterId;
|
||||
data1.grParamBOS.hosNum = row.patientBusNo || '';
|
||||
|
||||
// 入科时间存在的场合使用入科时间
|
||||
data1.grParamBOS.inDate = row.wardAdmissionDate;
|
||||
|
||||
@@ -537,7 +537,7 @@ function viewPatient(row = {}) {
|
||||
// data1.grParamBOS.cwh = row.bedLocationId_dictText;
|
||||
data1.grParamBOS.cwh = row.bedName;
|
||||
data1.grParamBOS.deptName = row.wardName;
|
||||
data1.grParamBOS.hosNum = row.encounterId;
|
||||
data1.grParamBOS.hosNum = row.busNo || '';
|
||||
data1.grParamBOS.sex = row.genderEnum_enumText;
|
||||
// 入科时间存在的场合使用入科时间
|
||||
data1.grParamBOS.inDate = row.wardAdmissionDate;
|
||||
|
||||
Reference in New Issue
Block a user