Merge remote-tracking branch 'origin/develop' into guanyu
This commit is contained in:
@@ -461,12 +461,15 @@ public class AdviceProcessAppServiceImpl implements IAdviceProcessAppService {
|
||||
}
|
||||
// 处理转科/出院等特殊医嘱
|
||||
for (ServiceRequest serviceRequest : allServiceRequests) {
|
||||
// Bug #718: 延迟状态变更时机。核对通过时不立即变更患者就诊状态,
|
||||
// 而是等到护士在【入出转管理】中手动点击“转科”或“清床”时再处理。
|
||||
// 这样可以确保护士在真正转出前,依然能在在科列表中选中患者并处理遗留医嘱。
|
||||
if (ActivityDefCategory.TRANSFER.getValue().equals(serviceRequest.getCategoryEnum())) {
|
||||
encounterService.updateEncounterStatus(serviceRequest.getEncounterId(),
|
||||
EncounterZyStatus.PENDING_TRANSFER.getValue());
|
||||
// encounterService.updateEncounterStatus(serviceRequest.getEncounterId(),
|
||||
// EncounterZyStatus.PENDING_TRANSFER.getValue());
|
||||
} else if (ActivityDefCategory.DISCHARGE.getValue().equals(serviceRequest.getCategoryEnum())) {
|
||||
encounterService.updateEncounterStatus(serviceRequest.getEncounterId(),
|
||||
EncounterZyStatus.AWAITING_DISCHARGE.getValue());
|
||||
// encounterService.updateEncounterStatus(serviceRequest.getEncounterId(),
|
||||
// EncounterZyStatus.AWAITING_DISCHARGE.getValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -206,8 +206,8 @@ public class MedicineSummaryAppServiceImpl implements IMedicineSummaryAppService
|
||||
// 领药人
|
||||
Long receiverId = medicineSummaryParamList.get(0).getReceiverId();
|
||||
// 申请时间(优先使用前端传递的操作时间,确保与实际操作时间一致)
|
||||
Date now = medicineSummaryParamList.get(0).getDispenseTime() != null
|
||||
? medicineSummaryParamList.get(0).getDispenseTime() : DateUtils.getNowDate();
|
||||
Date now = medicineSummaryParamList.get(0).getExecuteTime() != null
|
||||
? medicineSummaryParamList.get(0).getExecuteTime() : DateUtils.getNowDate();
|
||||
// 申请人
|
||||
Long practitionerId = SecurityUtils.getLoginUser().getPractitionerId();
|
||||
// 药品发放id
|
||||
|
||||
@@ -22,10 +22,10 @@ import java.util.Date;
|
||||
public class MedicineSummaryParam {
|
||||
|
||||
/**
|
||||
* 领药时间
|
||||
* 实际执行时间
|
||||
*/
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date dispenseTime;
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date executeTime;
|
||||
|
||||
/**
|
||||
* 发放id
|
||||
|
||||
@@ -322,33 +322,60 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
|
||||
|
||||
try {
|
||||
// 根据adviceType判断删除哪种类型的医嘱
|
||||
if (ItemType.MEDICINE.getValue().equals(adviceType)) {
|
||||
// 药品删除
|
||||
iMedicationRequestService.removeById(requestId);
|
||||
iMedicationDispenseService.deleteMedicationDispense(requestId);
|
||||
iChargeItemService.deleteByServiceTableAndId(CommonConstants.TableName.MED_MEDICATION_REQUEST, requestId);
|
||||
log.info("删除药品医嘱成功,requestId: {}", requestId);
|
||||
if (ItemType.MEDICINE.getValue().equals(adviceType) || (adviceType != null && adviceType == 7)) {
|
||||
// 药品删除 (7表示出院带药,也按药品逻辑删除)
|
||||
MedicationRequest medRequest = iMedicationRequestService.getById(requestId);
|
||||
if (medRequest != null) {
|
||||
if (!RequestStatus.DRAFT.getValue().equals(medRequest.getStatusEnum())) {
|
||||
throw new ServiceException("仅待签发状态的医嘱允许删除");
|
||||
}
|
||||
iMedicationRequestService.removeById(requestId);
|
||||
iMedicationDispenseService.deleteMedicationDispense(requestId);
|
||||
iChargeItemService.deleteByServiceTableAndId(CommonConstants.TableName.MED_MEDICATION_REQUEST, requestId);
|
||||
log.info("删除药品医嘱成功,requestId: {}", requestId);
|
||||
}
|
||||
|
||||
} else if (ItemType.DEVICE.getValue().equals(adviceType)) {
|
||||
// 耗材删除
|
||||
iDeviceRequestService.removeById(requestId);
|
||||
iDeviceDispenseService.deleteDeviceDispense(requestId);
|
||||
iChargeItemService.deleteByServiceTableAndId(CommonConstants.TableName.WOR_DEVICE_REQUEST, requestId);
|
||||
log.info("删除耗材医嘱成功,requestId: {}", requestId);
|
||||
DeviceRequest deviceRequest = iDeviceRequestService.getById(requestId);
|
||||
if (deviceRequest != null) {
|
||||
if (!RequestStatus.DRAFT.getValue().equals(deviceRequest.getStatusEnum())) {
|
||||
throw new ServiceException("仅待签发状态的医嘱允许删除");
|
||||
}
|
||||
iDeviceRequestService.removeById(requestId);
|
||||
iDeviceDispenseService.deleteDeviceDispense(requestId);
|
||||
iChargeItemService.deleteByServiceTableAndId(CommonConstants.TableName.WOR_DEVICE_REQUEST, requestId);
|
||||
log.info("删除耗材医嘱成功,requestId: {}", requestId);
|
||||
}
|
||||
|
||||
} else if (ItemType.ACTIVITY.getValue().equals(adviceType)
|
||||
|| (adviceType != null && (adviceType == 26 || adviceType == 31))) {
|
||||
// 诊疗活动删除(包括护理type=26和未知类型type=31)
|
||||
iServiceRequestService.removeById(requestId);
|
||||
iChargeItemService.deleteByServiceTableAndId(CommonConstants.TableName.WOR_SERVICE_REQUEST, requestId);
|
||||
log.info("删除诊疗/护理医嘱成功,requestId: {}, adviceType: {}", requestId, adviceType);
|
||||
ServiceRequest serviceRequest = iServiceRequestService.getById(requestId);
|
||||
if (serviceRequest != null) {
|
||||
if (!RequestStatus.DRAFT.getValue().equals(serviceRequest.getStatusEnum())) {
|
||||
throw new ServiceException("仅待签发状态的医嘱允许删除");
|
||||
}
|
||||
iServiceRequestService.removeById(requestId);
|
||||
iChargeItemService.deleteByServiceTableAndId(CommonConstants.TableName.WOR_SERVICE_REQUEST, requestId);
|
||||
log.info("删除诊疗/护理医嘱成功,requestId: {}, adviceType: {}", requestId, adviceType);
|
||||
}
|
||||
|
||||
} else {
|
||||
// 未知类型,尝试按诊疗活动删除(兜底策略)
|
||||
log.warn("未知的adviceType: {},尝试按诊疗活动删除,requestId: {}", adviceType, requestId);
|
||||
ServiceRequest serviceRequest = iServiceRequestService.getById(requestId);
|
||||
if (serviceRequest != null) {
|
||||
if (!RequestStatus.DRAFT.getValue().equals(serviceRequest.getStatusEnum())) {
|
||||
throw new ServiceException("仅待签发状态的医嘱允许删除");
|
||||
}
|
||||
}
|
||||
iServiceRequestService.removeById(requestId);
|
||||
iChargeItemService.deleteByServiceTableAndId(CommonConstants.TableName.WOR_SERVICE_REQUEST, requestId);
|
||||
}
|
||||
} catch (ServiceException e) {
|
||||
// 业务校验异常,直接向上抛出,中断并回滚事务
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
log.error("删除医嘱失败,requestId: {}, adviceType: {}", requestId, adviceType, e);
|
||||
// 继续处理其他记录,不中断整个流程
|
||||
|
||||
@@ -211,7 +211,7 @@
|
||||
NULL::numeric AS unit_price,
|
||||
NULL::numeric AS total_price,
|
||||
NULL::bigint AS stopper_id,
|
||||
NULL::varchar AS stopper_name
|
||||
CASE WHEN T1.status_enum IN (6, 13) THEN T1.update_by ELSE NULL END AS stopper_name
|
||||
FROM med_medication_request AS T1
|
||||
LEFT JOIN med_medication_definition AS T2
|
||||
ON T2.id = T1.medication_id
|
||||
@@ -331,7 +331,7 @@
|
||||
T1.unit_code AS unit_code,
|
||||
T1.status_enum AS request_status,
|
||||
NULL::varchar AS method_code,
|
||||
NULL::varchar AS rate_code,
|
||||
T1.rate_code AS rate_code,
|
||||
NULL::numeric AS dose,
|
||||
NULL::varchar AS dose_unit_code,
|
||||
ao1.id AS position_id,
|
||||
@@ -359,7 +359,7 @@
|
||||
NULL::numeric AS unit_price,
|
||||
NULL::numeric AS total_price,
|
||||
NULL::bigint AS stopper_id,
|
||||
NULL::varchar AS stopper_name
|
||||
CASE WHEN T1.status_enum IN (6, 13) THEN T1.update_by ELSE NULL END AS stopper_name
|
||||
FROM wor_service_request AS T1
|
||||
LEFT JOIN wor_activity_definition AS T2
|
||||
ON T2.id = T1.activity_id
|
||||
@@ -496,7 +496,7 @@
|
||||
NULL::numeric AS unit_price,
|
||||
NULL::numeric AS total_price,
|
||||
NULL::bigint AS stopper_id,
|
||||
NULL::varchar AS stopper_name
|
||||
CASE WHEN T1.status_enum IN (6, 13) THEN T1.update_by ELSE NULL END AS stopper_name
|
||||
FROM wor_device_request AS T1
|
||||
LEFT JOIN adm_device_definition AS T2
|
||||
ON T2.id = T1.device_def_id
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
<collection property="medicineSummaryParamList" ofType="com.healthlink.his.web.inhospitalnursestation.dto.MedicineSummaryParam">
|
||||
<result property="procedureId" column="procedure_id"/>
|
||||
<result property="dispenseId" column="dispense_id"/>
|
||||
<result property="dispenseTime" column="execution_time"/>
|
||||
<result property="executeTime" column="execution_time"/>
|
||||
<result property="dispenseStatus" column="dispense_status"/>
|
||||
</collection>
|
||||
</resultMap>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<template>
|
||||
<template>
|
||||
<div class="table-container">
|
||||
<div ref="tableWrapperRef" class="table-wrapper">
|
||||
<vxe-table
|
||||
@@ -9,8 +9,7 @@
|
||||
:stripe="stripe"
|
||||
:size="size === 'large' ? 'medium' : size === 'small' ? 'mini' : 'small'"
|
||||
:height="computedTableHeight"
|
||||
:row-config="{ keyField: rowKey || 'id', isHover: true }"
|
||||
:highlight-current-row="highlightCurrentRow"
|
||||
:row-config="{ keyField: rowKey || 'id', isHover: true, isCurrent: highlightCurrentRow }"
|
||||
show-overflow="title"
|
||||
show-header-overflow="title"
|
||||
:auto-resize="true"
|
||||
|
||||
@@ -198,7 +198,7 @@
|
||||
<el-dialog
|
||||
v-model="open"
|
||||
:title="title"
|
||||
width="1000px"
|
||||
width="1200px"
|
||||
teleported
|
||||
:close-on-click-modal="false"
|
||||
@close="cancel"
|
||||
@@ -397,7 +397,7 @@
|
||||
</el-row>
|
||||
|
||||
<!-- 次要手术表格 -->
|
||||
<el-row v-if="form.secondarySurgeries && form.secondarySurgeries.length > 0">
|
||||
<el-row v-if="form.secondarySurgeries && form.secondarySurgeries.length > 0" style="margin-top: 12px;">
|
||||
<el-col
|
||||
:span="24"
|
||||
style="margin-bottom: 20px;"
|
||||
@@ -407,10 +407,12 @@
|
||||
border
|
||||
stripe
|
||||
size="small"
|
||||
style="width: 100%"
|
||||
:column-config="{ resizable: true }"
|
||||
>
|
||||
<vxe-column
|
||||
title="手术名称"
|
||||
min-width="200"
|
||||
min-width="250"
|
||||
>
|
||||
<template #default="scope">
|
||||
<el-select
|
||||
@@ -518,7 +520,7 @@
|
||||
</vxe-column>
|
||||
<vxe-column
|
||||
title="操作"
|
||||
width="100"
|
||||
width="80"
|
||||
align="center"
|
||||
>
|
||||
<template #default="scope">
|
||||
@@ -1815,4 +1817,11 @@ defineExpose({
|
||||
text-align: center;
|
||||
padding: 20px 0;
|
||||
}
|
||||
|
||||
/* Bug #770: 确保对话框表单内容可滚动,防止操作按钮遮盖字段 */
|
||||
:deep(.el-dialog__body) {
|
||||
max-height: calc(100vh - 200px);
|
||||
overflow-y: auto;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
>
|
||||
<el-select
|
||||
v-model="form.targetLocationId"
|
||||
no-data-text="请先选择科室"
|
||||
:no-data-text="form.targetOrganizationId ? '该科室暂无对应病区' : '请先选择科室'"
|
||||
placeholder="请选择转入病区"
|
||||
>
|
||||
<el-option
|
||||
@@ -70,7 +70,7 @@
|
||||
<el-input
|
||||
v-model="form.reasonText"
|
||||
type="textarea"
|
||||
rows="5"
|
||||
:rows="5"
|
||||
placeholder="请输入转科原因"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
@@ -236,7 +236,7 @@
|
||||
style="width: 62%"
|
||||
v-model="scope.row.adviceName"
|
||||
placeholder="请选择项目"
|
||||
@input="handleChange"
|
||||
@input="(value) => handleChange(value, scope.row, scope.rowIndex)"
|
||||
@focus="handleFocus(scope.row, scope.rowIndex)"
|
||||
@keyup.enter.stop="handleFocus(scope.row, scope.rowIndex)"
|
||||
@keydown="
|
||||
@@ -1150,7 +1150,12 @@ function expandTextRow(rowIndex) {
|
||||
}
|
||||
|
||||
function handleFocus(row, index) {
|
||||
rowIndex.value = index;
|
||||
const actualIndex = prescriptionList.value.findIndex((item) => item.uniqueKey === row.uniqueKey);
|
||||
if (actualIndex !== -1) {
|
||||
rowIndex.value = actualIndex;
|
||||
} else {
|
||||
rowIndex.value = index;
|
||||
}
|
||||
// 同步表格水平滚动偏移,确保浮框位置正确
|
||||
const scrollWrapper = document.querySelector('.vxe-table--body-wrapper');
|
||||
if (scrollWrapper) {
|
||||
@@ -1184,11 +1189,9 @@ function handleBlur(row) {
|
||||
popoverJustClosedByKey.value = row.uniqueKey;
|
||||
}
|
||||
|
||||
function handleChange(value) {
|
||||
function handleChange(value, row, index) {
|
||||
// 文字医嘱(type=8)不触发药品搜索
|
||||
const currentIndex = rowIndex.value;
|
||||
if (currentIndex < 0) return;
|
||||
const row = filterPrescriptionList.value[currentIndex];
|
||||
if (index < 0 || !row) return;
|
||||
const adviceType = row?.adviceType !== undefined ? row.adviceType : adviceQueryParams.value.adviceType;
|
||||
if (adviceType == 8) {
|
||||
return;
|
||||
@@ -1199,7 +1202,7 @@ function handleChange(value) {
|
||||
if (!row.showPopover) {
|
||||
row.showPopover = true;
|
||||
}
|
||||
const tableRef = Array.isArray(adviceTableRef.value) ? adviceTableRef.value[currentIndex] : adviceTableRef.value;
|
||||
const tableRef = Array.isArray(adviceTableRef.value) ? adviceTableRef.value[index] : adviceTableRef.value;
|
||||
if (tableRef && tableRef.refresh) {
|
||||
const adviceType = row?.adviceType !== undefined ? row.adviceType : adviceQueryParams.value.adviceType;
|
||||
let categoryCode = '';
|
||||
@@ -1217,8 +1220,14 @@ function handleChange(value) {
|
||||
*/
|
||||
function selectAdviceBase(key, row) {
|
||||
|
||||
// 每次选择药品时,根据 uniqueKey 找到 prescriptionList 中的正确索引
|
||||
const actualIndex = prescriptionList.value.findIndex((item) => item.uniqueKey === key);
|
||||
if (actualIndex !== -1) {
|
||||
rowIndex.value = actualIndex;
|
||||
}
|
||||
|
||||
// 每次选择药品时,将当前行数据初始化为最初状态
|
||||
const currentUniqueKey = prescriptionList.value[rowIndex.value]?.uniqueKey || key;
|
||||
const currentUniqueKey = key;
|
||||
const prevRow = prescriptionList.value[rowIndex.value] || {};
|
||||
prescriptionList.value[rowIndex.value] = {
|
||||
uniqueKey: currentUniqueKey,
|
||||
@@ -1411,7 +1420,7 @@ function handleDelete() {
|
||||
deleteList.push({
|
||||
requestId: deleteItem.requestId,
|
||||
dbOpType: '3',
|
||||
adviceType: deleteItem.adviceType,
|
||||
adviceType: deleteItem.adviceType == 7 ? 1 : deleteItem.adviceType,
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1976,6 +1985,7 @@ function setValue(row) {
|
||||
...baseRow,
|
||||
uniqueKey: currentUniqueKey, // 确保 uniqueKey 不被覆盖
|
||||
// Bug #589: 出院带药在 baseRow 中被药品的 adviceType=1 覆盖,此处恢复
|
||||
dischargeFlag: prevRow.dischargeFlag, // 显式保留,防止被 baseRow 中的 undefined/null/0 覆盖
|
||||
adviceType: prevRow.dischargeFlag ? 7 : baseRow.adviceType,
|
||||
// 🔧 修复执行科室逻辑:
|
||||
// 1. 非诊疗类型(adviceType!=3)不需要执行科室,设为undefined
|
||||
|
||||
@@ -147,7 +147,7 @@
|
||||
field="requestTime"
|
||||
width="150"
|
||||
>
|
||||
<template #default="scope">
|
||||
<template #default>
|
||||
{{ '1支' }}
|
||||
</template>
|
||||
</vxe-column>
|
||||
@@ -166,17 +166,17 @@
|
||||
>
|
||||
<template #default="scope">
|
||||
<div
|
||||
v-for="(item, timeIndex) in scope.row.times"
|
||||
v-for="(timeItem, timeIndex) in scope.row.times"
|
||||
:key="timeIndex"
|
||||
style="padding-bottom: 5px"
|
||||
>
|
||||
<span>{{ item }}</span>
|
||||
<span>{{ timeItem }}</span>
|
||||
<el-checkbox-group
|
||||
v-model="scope.row.checkedRates[item]"
|
||||
v-model="scope.row.checkedRates[timeItem]"
|
||||
style="display: inline-block; margin-left: 15px"
|
||||
>
|
||||
<el-checkbox
|
||||
v-for="(rateItem, rateIndex) in scope.row.rate[item]"
|
||||
v-for="(rateItem, rateIndex) in scope.row.rate[timeItem]"
|
||||
:key="rateIndex"
|
||||
:value="rateItem.rate"
|
||||
border
|
||||
@@ -252,7 +252,6 @@ const activeNames = ref([]);
|
||||
|
||||
const userStore = useUserStore();
|
||||
const prescriptionList = ref([]);
|
||||
const deadline = ref(formatDateStr(new Date(), 'YYYY-MM-DD') + ' 23:59:59');
|
||||
const { proxy } = getCurrentInstance();
|
||||
const loading = ref(false);
|
||||
const chooseAll = ref(false);
|
||||
@@ -267,6 +266,7 @@ const props = defineProps({
|
||||
},
|
||||
deadline: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
therapyEnum: {
|
||||
type: Number,
|
||||
@@ -309,8 +309,8 @@ function handleGetPrescription() {
|
||||
});
|
||||
|
||||
// 将全部的时间点拆分 把日期去重,页面显示示例 05-15 [01:30 02:30 03:30]
|
||||
let time = item.dispenseTime?.substring(5, 10);
|
||||
let rateTime = item.dispenseTime?.substring(11, 16);
|
||||
let time = item.executeTime?.substring(5, 10);
|
||||
let rateTime = item.executeTime?.substring(11, 16);
|
||||
times.add(time);
|
||||
rate[time] = rate[time] || [];
|
||||
rate[time].push({ rate: rateTime, dispenseId: item.dispenseId });
|
||||
@@ -367,7 +367,7 @@ function handleMedicineSummary() {
|
||||
const now = proxy.formatDateStr(new Date(), 'YYYY-MM-DD HH:mm:ss');
|
||||
paramList.forEach((item) => {
|
||||
item.dispenseIds.forEach((d) => {
|
||||
ids.push({ ...d, dispenseTime: now });
|
||||
ids.push({ ...d, executeTime: now });
|
||||
});
|
||||
});
|
||||
if (ids.length === 0) {
|
||||
|
||||
@@ -687,15 +687,15 @@ import {
|
||||
} from '../api'
|
||||
|
||||
// 当前日期 & 统计信息(总已签到/在队列中)
|
||||
const currentDate = ref('2025/12/22 上午')
|
||||
const currentDate = ref('')
|
||||
const totalSignedIn = ref(0)
|
||||
const totalInQueue = ref(0)
|
||||
|
||||
// 当前呼叫信息
|
||||
const currentCall = ref({
|
||||
number: '1',
|
||||
name: '郑华',
|
||||
room: '4号诊室'
|
||||
number: '-',
|
||||
name: '-',
|
||||
room: '-'
|
||||
})
|
||||
|
||||
// 当前选中的队列行(用于选呼)
|
||||
@@ -785,85 +785,6 @@ const weekOptions = [
|
||||
// 叫号类型
|
||||
const callType = ref('选呼')
|
||||
|
||||
// ============ 数据初始化/刷新(前端模拟) ============
|
||||
const getInitialCandidatePoolList = () => ([
|
||||
{
|
||||
sequenceNo: 12,
|
||||
patientName: '陈明',
|
||||
age: 65,
|
||||
appointmentType: '专家',
|
||||
room: '3号诊室',
|
||||
doctor: '张医生',
|
||||
matchingRule: '年龄≥60'
|
||||
},
|
||||
{
|
||||
sequenceNo: 13,
|
||||
patientName: '刘芳',
|
||||
age: 58,
|
||||
appointmentType: '普通',
|
||||
room: '4号诊室',
|
||||
doctor: '李医生',
|
||||
matchingRule: '-'
|
||||
},
|
||||
{
|
||||
sequenceNo: 14,
|
||||
patientName: '周强',
|
||||
age: 45,
|
||||
appointmentType: '普通',
|
||||
room: '5号诊室',
|
||||
doctor: '王医生',
|
||||
matchingRule: '-'
|
||||
},
|
||||
{
|
||||
sequenceNo: 15,
|
||||
patientName: '吴伟',
|
||||
age: 72,
|
||||
appointmentType: '专家',
|
||||
room: '3号诊室',
|
||||
doctor: '张医生',
|
||||
matchingRule: '年龄≥70'
|
||||
}
|
||||
])
|
||||
|
||||
const getInitialQueueList = () => ([
|
||||
{
|
||||
queueOrder: 1,
|
||||
patientName: '林静',
|
||||
appointmentType: '专家',
|
||||
room: '3号诊室',
|
||||
doctor: '张医生',
|
||||
waitingTime: '05:00',
|
||||
status: '等待'
|
||||
},
|
||||
{
|
||||
queueOrder: 2,
|
||||
patientName: '郑华',
|
||||
appointmentType: '普通',
|
||||
room: '4号诊室',
|
||||
doctor: '李医生',
|
||||
waitingTime: '00:00',
|
||||
status: '叫号中'
|
||||
},
|
||||
{
|
||||
queueOrder: 3,
|
||||
patientName: '王丽',
|
||||
appointmentType: '普通',
|
||||
room: '5号诊室',
|
||||
doctor: '王医生',
|
||||
waitingTime: '08:00',
|
||||
status: '等待'
|
||||
},
|
||||
{
|
||||
queueOrder: 4,
|
||||
patientName: '张伟',
|
||||
appointmentType: '专家',
|
||||
room: '3号诊室',
|
||||
doctor: '张医生',
|
||||
waitingTime: '12:00',
|
||||
status: '等待'
|
||||
}
|
||||
])
|
||||
|
||||
const syncCurrentCallFromQueue = () => {
|
||||
const calling = originalQueueList.value.find((i) => i.status === '叫号中')
|
||||
if (!calling) {
|
||||
@@ -1108,12 +1029,12 @@ const loadDataFromApi = async () => {
|
||||
}))
|
||||
console.log('【心内科】候选池已加载', originalCandidatePoolList.value.length, '条今天的数据')
|
||||
} else {
|
||||
console.log('【心内科】候选池数据为空数组或非数组,使用默认数据')
|
||||
originalCandidatePoolList.value = getInitialCandidatePoolList()
|
||||
console.log('【心内科】候选池数据为空数组或非数组')
|
||||
originalCandidatePoolList.value = []
|
||||
}
|
||||
} else {
|
||||
console.log('【心内科】候选池响应为空或格式错误,使用默认数据')
|
||||
originalCandidatePoolList.value = getInitialCandidatePoolList()
|
||||
console.log('【心内科】候选池响应为空或格式错误')
|
||||
originalCandidatePoolList.value = []
|
||||
}
|
||||
|
||||
// 2) 队列列表:从数据库读取(可刷新、可恢复)
|
||||
@@ -1161,10 +1082,8 @@ const loadDataFromApi = async () => {
|
||||
console.log('【心内科】数据加载完成:候选池', originalCandidatePoolList.value.length, '条,队列', originalQueueList.value.length, '条')
|
||||
ElMessage.success('【心内科】已从门诊挂号接口加载数据')
|
||||
} catch (e) {
|
||||
console.error('【心内科】loadDataFromApi 执行异常,使用本地假数据:', e)
|
||||
// 任何异常:回退本地假数据
|
||||
originalCandidatePoolList.value = getInitialCandidatePoolList()
|
||||
// 队列不再回退假数据,避免误导
|
||||
console.error('【心内科】loadDataFromApi 执行异常:', e)
|
||||
originalCandidatePoolList.value = []
|
||||
originalQueueList.value = []
|
||||
totalSignedIn.value = originalCandidatePoolList.value.length
|
||||
totalInQueue.value = originalQueueList.value.length
|
||||
@@ -1173,7 +1092,7 @@ const loadDataFromApi = async () => {
|
||||
}
|
||||
|
||||
// 原始数据存储(用于过滤)
|
||||
const originalCandidatePoolList = ref(getInitialCandidatePoolList())
|
||||
const originalCandidatePoolList = ref([])
|
||||
|
||||
// 过滤后的智能候选池数据(按诊室过滤)
|
||||
const filteredCandidatePoolList = computed(() => {
|
||||
@@ -1184,7 +1103,7 @@ const filteredCandidatePoolList = computed(() => {
|
||||
})
|
||||
|
||||
// 原始队列数据存储(用于过滤)
|
||||
const originalQueueList = ref(getInitialQueueList())
|
||||
const originalQueueList = ref([])
|
||||
|
||||
// 动态计算已加载数据中的唯一诊室列表(依赖上方两个 ref,确保声明顺序正确)
|
||||
const uniqueRooms = computed(() => {
|
||||
|
||||
Reference in New Issue
Block a user