Compare commits
18 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f726312077 | ||
|
|
0efde56f70 | ||
|
|
cae70bd742 | ||
|
|
d2a89b9f31 | ||
|
|
04ac6b0ec2 | ||
|
|
c0cdfcc688 | ||
|
|
7df162177a | ||
|
|
644c8285b5 | ||
|
|
28e0228ff5 | ||
|
|
6b3f74d2ca | ||
|
|
349b0453c8 | ||
|
|
3ddd74d679 | ||
|
|
9829843b3e | ||
|
|
0d95cc1341 | ||
|
|
1dfceeaf46 | ||
|
|
1b79df4f93 | ||
|
|
f62a280dfc | ||
|
|
e5d949a740 |
@@ -633,9 +633,9 @@ public class OutpatientRegistrationAppServiceImpl implements IOutpatientRegistra
|
|||||||
Order updateOrder = new Order();
|
Order updateOrder = new Order();
|
||||||
updateOrder.setId(appointmentOrder.getId());
|
updateOrder.setId(appointmentOrder.getId());
|
||||||
updateOrder.setStatus(CommonConstants.AppointmentOrderStatus.RETURNED);
|
updateOrder.setStatus(CommonConstants.AppointmentOrderStatus.RETURNED);
|
||||||
|
updateOrder.setPayStatus(0);
|
||||||
updateOrder.setCancelTime(now);
|
updateOrder.setCancelTime(now);
|
||||||
updateOrder.setCancelReason(
|
updateOrder.setCancelReason("门诊退号");
|
||||||
StringUtils.isNotEmpty(reason) ? reason : "门诊退号");
|
|
||||||
updateOrder.setUpdateTime(now);
|
updateOrder.setUpdateTime(now);
|
||||||
orderService.updateById(updateOrder);
|
orderService.updateById(updateOrder);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -178,22 +178,26 @@ public class AdviceUtils {
|
|||||||
// 生命提示信息集合
|
// 生命提示信息集合
|
||||||
List<String> tipsList = new ArrayList<>();
|
List<String> tipsList = new ArrayList<>();
|
||||||
for (MedicationRequestUseExe medicationRequestUseExe : medUseExeList) {
|
for (MedicationRequestUseExe medicationRequestUseExe : medUseExeList) {
|
||||||
Optional<AdviceInventoryDto> matchedInventory = adviceInventory.stream()
|
// 聚合同一位置所有批次的库存总量
|
||||||
|
List<AdviceInventoryDto> matchedInventories = adviceInventory.stream()
|
||||||
.filter(inventoryDto -> medicationRequestUseExe.getMedicationId().equals(inventoryDto.getItemId())
|
.filter(inventoryDto -> medicationRequestUseExe.getMedicationId().equals(inventoryDto.getItemId())
|
||||||
&& CommonConstants.TableName.MED_MEDICATION_DEFINITION.equals(inventoryDto.getItemTable())
|
&& CommonConstants.TableName.MED_MEDICATION_DEFINITION.equals(inventoryDto.getItemTable())
|
||||||
&& medicationRequestUseExe.getPerformLocation().equals(inventoryDto.getLocationId())
|
&& medicationRequestUseExe.getPerformLocation().equals(inventoryDto.getLocationId())
|
||||||
// 如果选择了具体的批次号,校验库存时需要加上批次号的匹配条件
|
// 如果选择了具体的批次号,校验库存时需要加上批次号的匹配条件
|
||||||
&& (StringUtils.isEmpty(medicationRequestUseExe.getLotNumber())
|
&& (StringUtils.isEmpty(medicationRequestUseExe.getLotNumber())
|
||||||
|| medicationRequestUseExe.getLotNumber().equals(inventoryDto.getLotNumber())))
|
|| medicationRequestUseExe.getLotNumber().equals(inventoryDto.getLotNumber())))
|
||||||
.findFirst();
|
.collect(Collectors.toList());
|
||||||
// 匹配到库存信息
|
// 匹配到库存信息
|
||||||
if (matchedInventory.isPresent()) {
|
if (!matchedInventories.isEmpty()) {
|
||||||
AdviceInventoryDto inventoryDto = matchedInventory.get();
|
// 聚合所有批次的可用库存
|
||||||
if ((medicationRequestUseExe.getExecuteTimesNum()
|
BigDecimal totalQuantity = matchedInventories.stream()
|
||||||
.multiply(medicationRequestUseExe.getMinUnitQuantity()))
|
.map(dto -> dto.getQuantity() != null ? dto.getQuantity() : BigDecimal.ZERO)
|
||||||
.compareTo(inventoryDto.getQuantity()) > 0) {
|
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
|
BigDecimal requestQuantity = medicationRequestUseExe.getExecuteTimesNum()
|
||||||
|
.multiply(medicationRequestUseExe.getMinUnitQuantity());
|
||||||
|
if (requestQuantity.compareTo(totalQuantity) > 0) {
|
||||||
tipsList
|
tipsList
|
||||||
.add("【" + medicationRequestUseExe.getBusNo() + "】在" + inventoryDto.getLocationName() + "库存不足");
|
.add("【" + medicationRequestUseExe.getBusNo() + "】在" + matchedInventories.get(0).getLocationName() + "库存不足");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
tipsList.add("【" + medicationRequestUseExe.getBusNo() + "】未匹配到库存信息");
|
tipsList.add("【" + medicationRequestUseExe.getBusNo() + "】未匹配到库存信息");
|
||||||
|
|||||||
@@ -511,6 +511,9 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
|
|||||||
// 签发操作
|
// 签发操作
|
||||||
boolean is_sign = AdviceOpType.SIGN_ADVICE.getCode().equals(adviceOpType);
|
boolean is_sign = AdviceOpType.SIGN_ADVICE.getCode().equals(adviceOpType);
|
||||||
|
|
||||||
|
// 收集已处理的requestId,用于批量更新状态
|
||||||
|
List<Long> processedRequestIds = new ArrayList<>();
|
||||||
|
|
||||||
// 声明长期医嘱诊疗请求
|
// 声明长期医嘱诊疗请求
|
||||||
ServiceRequest longServiceRequest;
|
ServiceRequest longServiceRequest;
|
||||||
// 新增 + 修改 (长期医嘱)
|
// 新增 + 修改 (长期医嘱)
|
||||||
@@ -555,6 +558,9 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
iServiceRequestService.saveOrUpdate(longServiceRequest);
|
iServiceRequestService.saveOrUpdate(longServiceRequest);
|
||||||
|
if (longServiceRequest.getId() != null) {
|
||||||
|
processedRequestIds.add(longServiceRequest.getId());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 声明临时医嘱诊疗请求
|
// 声明临时医嘱诊疗请求
|
||||||
@@ -603,6 +609,9 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
iServiceRequestService.saveOrUpdate(tempServiceRequest);
|
iServiceRequestService.saveOrUpdate(tempServiceRequest);
|
||||||
|
if (tempServiceRequest.getId() != null) {
|
||||||
|
processedRequestIds.add(tempServiceRequest.getId());
|
||||||
|
}
|
||||||
|
|
||||||
// 保存时,保存诊疗费用项
|
// 保存时,保存诊疗费用项
|
||||||
if (is_save) {
|
if (is_save) {
|
||||||
@@ -654,6 +663,14 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 批量更新诊疗医嘱状态(使用 update 确保状态字段必定更新)
|
||||||
|
if (!processedRequestIds.isEmpty()) {
|
||||||
|
iServiceRequestService.update(null,
|
||||||
|
new LambdaUpdateWrapper<ServiceRequest>()
|
||||||
|
.set(ServiceRequest::getStatusEnum,
|
||||||
|
is_save ? RequestStatus.DRAFT.getValue() : RequestStatus.ACTIVE.getValue())
|
||||||
|
.in(ServiceRequest::getId, processedRequestIds));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -95,6 +95,13 @@ public class RequestFormManageAppServiceImpl implements IRequestFormManageAppSer
|
|||||||
prescriptionNo = assignSeqUtil.getSeq(AssignSeqEnum.ACTIVITY_PSYCHOTROPIC_NO.getPrefix(), 8);
|
prescriptionNo = assignSeqUtil.getSeq(AssignSeqEnum.ACTIVITY_PSYCHOTROPIC_NO.getPrefix(), 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 诊疗执行科室配置校验(必须在数据库操作之前执行)
|
||||||
|
List<ActivityOrganizationConfigDto> activityOrganizationConfig =
|
||||||
|
requestFormManageAppMapper.getActivityOrganizationConfig(typeCode);
|
||||||
|
if (activityOrganizationConfig.isEmpty()) {
|
||||||
|
throw new ServiceException("请先配置当前时间段的执行科室");
|
||||||
|
}
|
||||||
|
|
||||||
// 当前时间
|
// 当前时间
|
||||||
Date curDate = new Date();
|
Date curDate = new Date();
|
||||||
// 请求类型
|
// 请求类型
|
||||||
@@ -139,12 +146,6 @@ public class RequestFormManageAppServiceImpl implements IRequestFormManageAppSer
|
|||||||
// 诊疗集合
|
// 诊疗集合
|
||||||
List<ActivitySaveDto> activityList = requestFormSaveDto.getActivityList();
|
List<ActivitySaveDto> activityList = requestFormSaveDto.getActivityList();
|
||||||
log.info("保存申请单,typeCode={}, activityListSize={}, encounterId={}", typeCode, activityList != null ? activityList.size() : 0, encounterId);
|
log.info("保存申请单,typeCode={}, activityListSize={}, encounterId={}", typeCode, activityList != null ? activityList.size() : 0, encounterId);
|
||||||
// 诊疗执行科室配置
|
|
||||||
List<ActivityOrganizationConfigDto> activityOrganizationConfig =
|
|
||||||
requestFormManageAppMapper.getActivityOrganizationConfig(typeCode);
|
|
||||||
if (activityOrganizationConfig.isEmpty()) {
|
|
||||||
throw new ServiceException("请先配置当前时间段的执行科室");
|
|
||||||
}
|
|
||||||
|
|
||||||
for (ActivitySaveDto activitySaveDto : activityList) {
|
for (ActivitySaveDto activitySaveDto : activityList) {
|
||||||
serviceRequest = new ServiceRequest();
|
serviceRequest = new ServiceRequest();
|
||||||
|
|||||||
@@ -313,6 +313,7 @@
|
|||||||
data-prop="dispensePerDuration">
|
data-prop="dispensePerDuration">
|
||||||
<el-input-number v-model="scope.row.dispensePerDuration" style="width: 80px" :min="1"
|
<el-input-number v-model="scope.row.dispensePerDuration" style="width: 80px" :min="1"
|
||||||
controls-position="right" :controls="false" :ref="(el) => (inputRefs.dispensePerDuration = el)"
|
controls-position="right" :controls="false" :ref="(el) => (inputRefs.dispensePerDuration = el)"
|
||||||
|
@change="calculateTotalAmount(scope.row, scope.$index)"
|
||||||
@keyup.enter.prevent="
|
@keyup.enter.prevent="
|
||||||
handleEnter('dispensePerDuration', scope.row, scope.$index)
|
handleEnter('dispensePerDuration', scope.row, scope.$index)
|
||||||
">
|
">
|
||||||
|
|||||||
@@ -86,7 +86,11 @@
|
|||||||
</template>
|
</template>
|
||||||
<el-table-column type="index" label="序号" width="60" align="center" />
|
<el-table-column type="index" label="序号" width="60" align="center" />
|
||||||
<el-table-column prop="patientName" label="患者姓名" width="120" />
|
<el-table-column prop="patientName" label="患者姓名" width="120" />
|
||||||
<el-table-column prop="name" label="申请单名称" width="140" />
|
<el-table-column label="申请单名称" width="140">
|
||||||
|
<template #default="scope">
|
||||||
|
<span>{{ getItemName(scope.row) }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column prop="createTime" label="创建时间" width="160" />
|
<el-table-column prop="createTime" label="创建时间" width="160" />
|
||||||
<el-table-column prop="prescriptionNo" label="处方号" width="140" />
|
<el-table-column prop="prescriptionNo" label="处方号" width="140" />
|
||||||
<el-table-column prop="requesterId_dictText" label="申请者" width="120" />
|
<el-table-column prop="requesterId_dictText" label="申请者" width="120" />
|
||||||
@@ -159,7 +163,7 @@
|
|||||||
currentDetail.patientName || '-'
|
currentDetail.patientName || '-'
|
||||||
}}</el-descriptions-item>
|
}}</el-descriptions-item>
|
||||||
<el-descriptions-item label="申请单名称">{{
|
<el-descriptions-item label="申请单名称">{{
|
||||||
currentDetail.name || '-'
|
getItemName(currentDetail)
|
||||||
}}</el-descriptions-item>
|
}}</el-descriptions-item>
|
||||||
<el-descriptions-item label="申请单状态">{{
|
<el-descriptions-item label="申请单状态">{{
|
||||||
parseStatus(currentDetail.status)
|
parseStatus(currentDetail.status)
|
||||||
@@ -399,6 +403,28 @@ const parseStatus = (status) => {
|
|||||||
return statusMap[String(status)] || '-';
|
return statusMap[String(status)] || '-';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取申请单展示名称:优先使用具体医嘱名称列表
|
||||||
|
*/
|
||||||
|
const getItemName = (row) => {
|
||||||
|
const items = row?.requestFormDetailList;
|
||||||
|
if (items && items.length > 0) {
|
||||||
|
return items.map(item => item.adviceName).filter(Boolean).join('、') || row.name || '-';
|
||||||
|
}
|
||||||
|
return row.name || '-';
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 构建打印用项目名称字符串(同步函数,用于模板字符串)
|
||||||
|
*/
|
||||||
|
const buildItemNames = (row) => {
|
||||||
|
const items = row?.requestFormDetailList;
|
||||||
|
if (items && items.length > 0) {
|
||||||
|
return items.map(item => item.adviceName).filter(Boolean).join('、') || row.name || '';
|
||||||
|
}
|
||||||
|
return row.name || '';
|
||||||
|
};
|
||||||
|
|
||||||
const labelMap = {
|
const labelMap = {
|
||||||
categoryType: '项目类别',
|
categoryType: '项目类别',
|
||||||
targetDepartment: '发往科室',
|
targetDepartment: '发往科室',
|
||||||
@@ -431,19 +457,26 @@ const getLocationInfo = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const recursionFun = (targetDepartment) => {
|
const recursionFun = (targetDepartment) => {
|
||||||
|
if (!targetDepartment) return '';
|
||||||
|
if (!Array.isArray(orgOptions.value) || orgOptions.value.length === 0) return '';
|
||||||
let name = '';
|
let name = '';
|
||||||
for (let index = 0; index < orgOptions.value.length; index++) {
|
for (let index = 0; index < orgOptions.value.length; index++) {
|
||||||
const obj = orgOptions.value[index];
|
const obj = orgOptions.value[index];
|
||||||
if (obj.id == targetDepartment) {
|
if (obj.id == targetDepartment) {
|
||||||
name = obj.name;
|
name = obj.name;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
const subObjArray = obj['children'];
|
const subObjArray = obj['children'];
|
||||||
for (let index = 0; index < subObjArray.length; index++) {
|
if (Array.isArray(subObjArray)) {
|
||||||
const item = subObjArray[index];
|
for (let i = 0; i < subObjArray.length; i++) {
|
||||||
if (item.id == targetDepartment) {
|
const item = subObjArray[i];
|
||||||
name = item.name;
|
if (item.id == targetDepartment) {
|
||||||
|
name = item.name;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (name) break;
|
||||||
}
|
}
|
||||||
return name;
|
return name;
|
||||||
};
|
};
|
||||||
@@ -456,7 +489,10 @@ const handleViewDetail = (row) => {
|
|||||||
if (row.descJson) {
|
if (row.descJson) {
|
||||||
try {
|
try {
|
||||||
const obj = JSON.parse(row.descJson);
|
const obj = JSON.parse(row.descJson);
|
||||||
obj.targetDepartment = recursionFun(obj.targetDepartment);
|
if (obj.targetDepartment) {
|
||||||
|
const deptName = recursionFun(obj.targetDepartment);
|
||||||
|
obj.targetDepartment = deptName || obj.targetDepartment;
|
||||||
|
}
|
||||||
descJsonData.value = obj;
|
descJsonData.value = obj;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error('解析 descJson 失败:', e);
|
console.error('解析 descJson 失败:', e);
|
||||||
@@ -651,7 +687,7 @@ const buildPrintContent = (row) => {
|
|||||||
return `
|
return `
|
||||||
<h2>检查申请单</h2>
|
<h2>检查申请单</h2>
|
||||||
<div class="info-row"><span class="label">患者姓名:</span>${row.patientName || '-'}</div>
|
<div class="info-row"><span class="label">患者姓名:</span>${row.patientName || '-'}</div>
|
||||||
<div class="info-row"><span class="label">申请单名称:</span>${row.name || '-'}</div>
|
<div class="info-row"><span class="label">申请单名称:</span>${buildItemNames(row) || '-'}</div>
|
||||||
<div class="info-row"><span class="label">创建时间:</span>${row.createTime || '-'}</div>
|
<div class="info-row"><span class="label">创建时间:</span>${row.createTime || '-'}</div>
|
||||||
<div class="info-row"><span class="label">处方号:</span>${row.prescriptionNo || '-'}</div>
|
<div class="info-row"><span class="label">处方号:</span>${row.prescriptionNo || '-'}</div>
|
||||||
<div class="info-row"><span class="label">申请者:</span>${row.requesterId_dictText || '-'}</div>
|
<div class="info-row"><span class="label">申请者:</span>${row.requesterId_dictText || '-'}</div>
|
||||||
|
|||||||
@@ -173,7 +173,7 @@ import {computed, getCurrentInstance, ref, watch} from 'vue';
|
|||||||
import {Refresh, Search} from '@element-plus/icons-vue';
|
import {Refresh, Search} from '@element-plus/icons-vue';
|
||||||
import {patientInfo} from '../../store/patient.js';
|
import {patientInfo} from '../../store/patient.js';
|
||||||
import {getInspection} from './api';
|
import {getInspection} from './api';
|
||||||
import {getOrgList} from '@/views/doctorstation/components/api.js';
|
import {getDepartmentList} from '@/api/public.js';
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance();
|
const { proxy } = getCurrentInstance();
|
||||||
|
|
||||||
@@ -332,8 +332,8 @@ const hasMatchedFields = computed(() => {
|
|||||||
|
|
||||||
/** 查询科室 */
|
/** 查询科室 */
|
||||||
const getLocationInfo = () => {
|
const getLocationInfo = () => {
|
||||||
getOrgList().then((res) => {
|
getDepartmentList().then((res) => {
|
||||||
orgOptions.value = res.data.records;
|
orgOptions.value = res.data || [];
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -345,10 +345,12 @@ const recursionFun = (targetDepartment) => {
|
|||||||
name = obj.name;
|
name = obj.name;
|
||||||
}
|
}
|
||||||
const subObjArray = obj['children'];
|
const subObjArray = obj['children'];
|
||||||
for (let index = 0; index < subObjArray.length; index++) {
|
if (subObjArray && subObjArray.length > 0) {
|
||||||
const item = subObjArray[index];
|
for (let i = 0; i < subObjArray.length; i++) {
|
||||||
if (item.id == targetDepartment) {
|
const item = subObjArray[i];
|
||||||
name = item.name;
|
if (item.id == targetDepartment) {
|
||||||
|
name = item.name;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -122,7 +122,6 @@
|
|||||||
|
|
||||||
<el-table-column label="类型" align="center" prop="" width="120">
|
<el-table-column label="类型" align="center" prop="" width="120">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
{{ console.log(scope.row, 1111) }}
|
|
||||||
<el-radio-group
|
<el-radio-group
|
||||||
v-model="scope.row.therapyEnum"
|
v-model="scope.row.therapyEnum"
|
||||||
size="small"
|
size="small"
|
||||||
@@ -270,7 +269,6 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="频次/用法" align="center" prop="" width="180">
|
<el-table-column label="频次/用法" align="center" prop="" width="180">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
{{ console.log(scope.row) }}
|
|
||||||
<span v-if="!scope.row.isEdit && scope.row.adviceType == 1" style="text-align: right">
|
<span v-if="!scope.row.isEdit && scope.row.adviceType == 1" style="text-align: right">
|
||||||
{{
|
{{
|
||||||
[
|
[
|
||||||
@@ -1212,12 +1210,8 @@ function handleSave() {
|
|||||||
getListInfo(false);
|
getListInfo(false);
|
||||||
bindMethod.value = {};
|
bindMethod.value = {};
|
||||||
nextId.value == 1;
|
nextId.value == 1;
|
||||||
|
|
||||||
// 处方保存成功后,自动将医嘱信息同步至患者处置记录
|
|
||||||
// handleEmrTreatment();
|
|
||||||
} else {
|
} else {
|
||||||
proxy.$modal.msgError(res.message);
|
proxy.$modal.msgError(res.message);
|
||||||
conso;
|
|
||||||
isSaving.value = false;
|
isSaving.value = false;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -1317,22 +1311,26 @@ function handleCancelEdit(row, index) {
|
|||||||
function handleSaveSign(row, index) {
|
function handleSaveSign(row, index) {
|
||||||
if (row.adviceType != 2) {
|
if (row.adviceType != 2) {
|
||||||
let itemNo = row.adviceType == 1 ? row.methodCode : row.adviceDefinitionId;
|
let itemNo = row.adviceType == 1 ? row.methodCode : row.adviceDefinitionId;
|
||||||
getBindDevice({ typeCode: row.adviceType, itemNo: itemNo }).then((res) => {
|
if (!itemNo) {
|
||||||
if (res.data.length == 0) {
|
console.warn('绑定设备检查跳过:itemNo为空(adviceType=' + row.adviceType + ', adviceName=' + row.adviceName + ')');
|
||||||
return;
|
} else {
|
||||||
}
|
getBindDevice({ typeCode: row.adviceType, itemNo: itemNo }).then((res) => {
|
||||||
let openBindDialog = localStorage.getItem('doctor' + userStore.id);
|
if (res.data.length == 0) {
|
||||||
if (!JSON.parse(openBindDialog)) {
|
return;
|
||||||
proxy.$refs['orderBindInfoRef'].open(res.data);
|
|
||||||
} else {
|
|
||||||
// 如果弹窗不提示带出的项目,自动带出
|
|
||||||
// 如果有未签发的项目,并且当前的项目没有带出过绑定项目,则自动带出
|
|
||||||
if (!bindMethod.value[itemNo]) {
|
|
||||||
handleOrderBindInfo(res.data);
|
|
||||||
bindMethod.value[itemNo] = true;
|
|
||||||
}
|
}
|
||||||
}
|
let openBindDialog = localStorage.getItem('doctor' + userStore.id);
|
||||||
});
|
if (!JSON.parse(openBindDialog)) {
|
||||||
|
proxy.$refs['orderBindInfoRef'].open(res.data);
|
||||||
|
} else {
|
||||||
|
// 如果弹窗不提示带出的项目,自动带出
|
||||||
|
// 如果有未签发的项目,并且当前的项目没有带出过绑定项目,则自动带出
|
||||||
|
if (!bindMethod.value[itemNo]) {
|
||||||
|
handleOrderBindInfo(res.data);
|
||||||
|
bindMethod.value[itemNo] = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 更新UI状态
|
// 更新UI状态
|
||||||
|
|||||||
@@ -16,14 +16,12 @@
|
|||||||
<Advice ref="adviceRef" />
|
<Advice ref="adviceRef" />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<!-- <el-tab-pane label="医技报告" name="fourth">Task</el-tab-pane> -->
|
<!-- <el-tab-pane label="医技报告" name="fourth">Task</el-tab-pane> -->
|
||||||
<el-tab-pane label="检验申请" name="test">
|
<el-tab-pane label="检验申请" name="test">
|
||||||
<TestApplication ref="testApplicationRef" :show-status-column="true" />
|
<TestApplication ref="testApplicationRef" :show-status-column="false" />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
```vue
|
|
||||||
<el-tab-pane label="检查申请" name="examine">
|
<el-tab-pane label="检查申请" name="examine">
|
||||||
<ExamineApplication ref="examineApplicationRef" />
|
<ExamineApplication ref="examineApplicationRef" />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
```
|
|
||||||
<el-tab-pane label="汇总发药申请" name="summaryDrug">
|
<el-tab-pane label="汇总发药申请" name="summaryDrug">
|
||||||
<SummaryDrugApplication ref="summaryDrugApplicationRef" />
|
<SummaryDrugApplication ref="summaryDrugApplicationRef" />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
@@ -48,6 +46,10 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import {computed, onBeforeMount, onMounted, provide, reactive, ref, watch,} from 'vue';
|
import {computed, onBeforeMount, onMounted, provide, reactive, ref, watch,} from 'vue';
|
||||||
|
|
||||||
|
import Emr from './emr/index.vue';
|
||||||
|
import inPatientBarDoctorFold from '@/component
|
||||||
|
```
|
||||||
|
|
||||||
import Emr from './emr/index.vue';
|
import Emr from './emr/index.vue';
|
||||||
import inPatientBarDoctorFold from '@/components/patientBar/inPatientBarDoctorFold.vue';
|
import inPatientBarDoctorFold from '@/components/patientBar/inPatientBarDoctorFold.vue';
|
||||||
import PatientList from '@/components/PatientList/patient-list.vue';
|
import PatientList from '@/components/PatientList/patient-list.vue';
|
||||||
|
|||||||
@@ -273,8 +273,9 @@ function handleSearch() {
|
|||||||
// 清除缓存(搜索时需要重新加载)
|
// 清除缓存(搜索时需要重新加载)
|
||||||
patientDataCache.value.clear();
|
patientDataCache.value.clear();
|
||||||
|
|
||||||
// 重新加载所有已展开病区的患者列表
|
// 通过递增 key 强制重新渲染树组件,触发重新加载所有病区患者列表
|
||||||
reloadAllPatients();
|
// 此时 searchKey 已有值,loadPatientList 会将 searchKey 传给后端进行过滤
|
||||||
|
treeKey.value += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 暴露方法供外部调用
|
// 暴露方法供外部调用
|
||||||
|
|||||||
@@ -68,9 +68,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
<div
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
style="padding: 10px; background-color: #eef9fd; height: 100%; overflow-y: auto"
|
style="padding: 10px; background-color: #eef9fd; height: 100%; overflow-y: auto"
|
||||||
v-loading="loading"
|
v-loading="loading"
|
||||||
>
|
>
|
||||||
@@ -232,7 +230,7 @@ import {adviceCancel, adviceExecute, adviceNoExecute, getPrescriptionList} from
|
|||||||
import {patientInfoList} from '../../components/store/patient.js';
|
import {patientInfoList} from '../../components/store/patient.js';
|
||||||
import {lotNumberMatch} from '@/api/public';
|
import {lotNumberMatch} from '@/api/public';
|
||||||
import {formatDateStr} from '@/utils/index';
|
import {formatDateStr} from '@/utils/index';
|
||||||
import {getCurrentInstance, nextTick, ref} from 'vue';
|
import {getCurrentInstance, nextTick, ref, provide} from 'vue';
|
||||||
|
|
||||||
const activeNames = ref([]);
|
const activeNames = ref([]);
|
||||||
const prescriptionList = ref([]);
|
const prescriptionList = ref([]);
|
||||||
@@ -242,6 +240,8 @@ const therapyEnum = ref(undefined);
|
|||||||
const { proxy } = getCurrentInstance();
|
const { proxy } = getCurrentInstance();
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
const chooseAll = ref(false);
|
const chooseAll = ref(false);
|
||||||
|
// 独立维护选中行ID集合,避免el-table内部selection状态异常导致联动全选
|
||||||
|
const selectedRowIds = ref(new Set());
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
exeStatus: {
|
exeStatus: {
|
||||||
type: Number,
|
type: Number,
|
||||||
@@ -283,9 +283,10 @@ function handleGetPrescription() {
|
|||||||
exeStatus: props.exeStatus,
|
exeStatus: props.exeStatus,
|
||||||
requestStatus: props.requestStatus,
|
requestStatus: props.requestStatus,
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
// try {
|
try {
|
||||||
|
const records = res?.data?.records || [];
|
||||||
// 根据encounterId分组
|
// 根据encounterId分组
|
||||||
const groupedPrescriptions = res.data.records.reduce((groups, prescription) => {
|
const groupedPrescriptions = records.reduce((groups, prescription) => {
|
||||||
// 获取当前医嘱全部执行频次
|
// 获取当前医嘱全部执行频次
|
||||||
let rate;
|
let rate;
|
||||||
let times;
|
let times;
|
||||||
@@ -430,18 +431,26 @@ function handleGetPrescription() {
|
|||||||
|
|
||||||
// 将分组结果转换为数组形式
|
// 将分组结果转换为数组形式
|
||||||
prescriptionList.value = Object.values(groupedPrescriptions);
|
prescriptionList.value = Object.values(groupedPrescriptions);
|
||||||
loading.value = false;
|
|
||||||
// 默认选中全部行
|
// 默认选中全部行
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
defaultSelectAllRows();
|
defaultSelectAllRows();
|
||||||
});
|
});
|
||||||
// } catch {
|
} catch (error) {
|
||||||
// loading.value = false;
|
console.error('医嘱执行-获取处方列表数据处理失败:', error);
|
||||||
// }
|
prescriptionList.value = [];
|
||||||
|
} finally {
|
||||||
|
loading.value = false;
|
||||||
|
}
|
||||||
|
}).catch((error) => {
|
||||||
|
console.error('医嘱执行-获取处方列表接口失败:', error);
|
||||||
|
prescriptionList.value = [];
|
||||||
|
loading.value = false;
|
||||||
});
|
});
|
||||||
chooseAll.value = false;
|
chooseAll.value = false;
|
||||||
} else {
|
} else {
|
||||||
prescriptionList.value = [];
|
prescriptionList.value = [];
|
||||||
|
selectedRowIds.value.clear();
|
||||||
|
loading.value = false;
|
||||||
// proxy.$message.warning('请选择患者');
|
// proxy.$message.warning('请选择患者');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -530,10 +539,14 @@ function handleCancel() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getSelectRows() {
|
function getSelectRows() {
|
||||||
// 获取选中的医嘱信息
|
// 优先从独立维护的selectedRowIds集合中获取选中行,避免el-table内部selection状态异常
|
||||||
let list = [];
|
const list = [];
|
||||||
prescriptionList.value.forEach((item, index) => {
|
prescriptionList.value.forEach((item) => {
|
||||||
list = [...list, ...proxy.$refs['tableRef' + index][0].getSelectionRows()];
|
item.forEach((row) => {
|
||||||
|
if (selectedRowIds.value.has(row.requestId)) {
|
||||||
|
list.push(row);
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
@@ -609,12 +622,14 @@ function handelSwicthChange(value) {
|
|||||||
if (value) {
|
if (value) {
|
||||||
// 全选:选中所有行并联动checkbox
|
// 全选:选中所有行并联动checkbox
|
||||||
item.forEach((row) => {
|
item.forEach((row) => {
|
||||||
|
selectedRowIds.value.add(row.requestId);
|
||||||
tableRef[0].toggleRowSelection(row, true);
|
tableRef[0].toggleRowSelection(row, true);
|
||||||
selectAllCheckboxesInRow(row);
|
selectAllCheckboxesInRow(row);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// 取消全选:取消选中所有行并联动checkbox
|
// 取消全选:取消选中所有行并联动checkbox
|
||||||
item.forEach((row) => {
|
item.forEach((row) => {
|
||||||
|
selectedRowIds.value.delete(row.requestId);
|
||||||
tableRef[0].toggleRowSelection(row, false);
|
tableRef[0].toggleRowSelection(row, false);
|
||||||
unselectAllCheckboxesInRow(row);
|
unselectAllCheckboxesInRow(row);
|
||||||
});
|
});
|
||||||
@@ -625,11 +640,14 @@ function handelSwicthChange(value) {
|
|||||||
|
|
||||||
// 默认选中全部行
|
// 默认选中全部行
|
||||||
function defaultSelectAllRows() {
|
function defaultSelectAllRows() {
|
||||||
|
// 清空并重建选中集合
|
||||||
|
selectedRowIds.value.clear();
|
||||||
prescriptionList.value.forEach((item, index) => {
|
prescriptionList.value.forEach((item, index) => {
|
||||||
const tableRef = proxy.$refs['tableRef' + index];
|
const tableRef = proxy.$refs['tableRef' + index];
|
||||||
if (tableRef && tableRef[0]) {
|
if (tableRef && tableRef[0]) {
|
||||||
// 选中该表格的所有行
|
// 选中该表格的所有行
|
||||||
item.forEach((row) => {
|
item.forEach((row) => {
|
||||||
|
selectedRowIds.value.add(row.requestId);
|
||||||
tableRef[0].toggleRowSelection(row, true);
|
tableRef[0].toggleRowSelection(row, true);
|
||||||
// 同时选中该行内部的所有checkbox
|
// 同时选中该行内部的所有checkbox
|
||||||
selectAllCheckboxesInRow(row);
|
selectAllCheckboxesInRow(row);
|
||||||
@@ -709,13 +727,14 @@ function checkAndToggleRowSelection(row) {
|
|||||||
const tableRef = proxy.$refs['tableRef' + tableIndex];
|
const tableRef = proxy.$refs['tableRef' + tableIndex];
|
||||||
if (tableRef && tableRef[0]) {
|
if (tableRef && tableRef[0]) {
|
||||||
const isAllSelected = isAllCheckboxesSelected(row);
|
const isAllSelected = isAllCheckboxesSelected(row);
|
||||||
const selectedRows = tableRef[0].getSelectionRows();
|
const isCurrentlySelected = selectedRowIds.value.has(row.requestId);
|
||||||
const isCurrentlySelected = selectedRows.some((r) => r.requestId === row.requestId);
|
|
||||||
|
|
||||||
// 根据checkbox状态更新表格行选中状态
|
// 根据checkbox状态更新表格行选中状态
|
||||||
if (isAllSelected && !isCurrentlySelected) {
|
if (isAllSelected && !isCurrentlySelected) {
|
||||||
|
selectedRowIds.value.add(row.requestId);
|
||||||
tableRef[0].toggleRowSelection(row, true);
|
tableRef[0].toggleRowSelection(row, true);
|
||||||
} else if (!isAllSelected && isCurrentlySelected) {
|
} else if (!isAllSelected && isCurrentlySelected) {
|
||||||
|
selectedRowIds.value.delete(row.requestId);
|
||||||
tableRef[0].toggleRowSelection(row, false);
|
tableRef[0].toggleRowSelection(row, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -728,9 +747,11 @@ function handleRowSelect(selection, row, tableIndex) {
|
|||||||
const isSelected = selection.some((item) => item.requestId === row.requestId);
|
const isSelected = selection.some((item) => item.requestId === row.requestId);
|
||||||
|
|
||||||
if (isSelected) {
|
if (isSelected) {
|
||||||
|
selectedRowIds.value.add(row.requestId);
|
||||||
// 选中行时,选中该行内部的所有checkbox
|
// 选中行时,选中该行内部的所有checkbox
|
||||||
selectAllCheckboxesInRow(row);
|
selectAllCheckboxesInRow(row);
|
||||||
} else {
|
} else {
|
||||||
|
selectedRowIds.value.delete(row.requestId);
|
||||||
// 取消选中行时,取消选中该行内部的所有checkbox
|
// 取消选中行时,取消选中该行内部的所有checkbox
|
||||||
unselectAllCheckboxesInRow(row);
|
unselectAllCheckboxesInRow(row);
|
||||||
}
|
}
|
||||||
@@ -747,11 +768,13 @@ function handleSelectAll(selection, tableIndex) {
|
|||||||
if (selection.length > 0) {
|
if (selection.length > 0) {
|
||||||
// 全选时,选中所有行内部的所有checkbox
|
// 全选时,选中所有行内部的所有checkbox
|
||||||
tableData.forEach((row) => {
|
tableData.forEach((row) => {
|
||||||
|
selectedRowIds.value.add(row.requestId);
|
||||||
selectAllCheckboxesInRow(row);
|
selectAllCheckboxesInRow(row);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// 取消全选时,取消选中所有行内部的所有checkbox
|
// 取消全选时,取消选中所有行内部的所有checkbox
|
||||||
tableData.forEach((row) => {
|
tableData.forEach((row) => {
|
||||||
|
selectedRowIds.value.delete(row.requestId);
|
||||||
unselectAllCheckboxesInRow(row);
|
unselectAllCheckboxesInRow(row);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -763,16 +786,12 @@ function handleSelectAll(selection, tableIndex) {
|
|||||||
// 更新全选开关状态
|
// 更新全选开关状态
|
||||||
function updateChooseAllStatus() {
|
function updateChooseAllStatus() {
|
||||||
let allSelected = true;
|
let allSelected = true;
|
||||||
prescriptionList.value.forEach((item, index) => {
|
prescriptionList.value.forEach((item) => {
|
||||||
const tableRef = proxy.$refs['tableRef' + index];
|
item.forEach((row) => {
|
||||||
if (tableRef && tableRef[0]) {
|
if (!selectedRowIds.value.has(row.requestId)) {
|
||||||
const selectedRows = tableRef[0].getSelectionRows();
|
|
||||||
if (selectedRows.length !== item.length) {
|
|
||||||
allSelected = false;
|
allSelected = false;
|
||||||
}
|
}
|
||||||
} else {
|
});
|
||||||
allSelected = false;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
chooseAll.value = allSelected;
|
chooseAll.value = allSelected;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,7 +51,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import {getCurrentInstance} from 'vue';
|
import {getCurrentInstance, ref, nextTick, provide} from 'vue';
|
||||||
import PatientList from '../components/patientList.vue';
|
import PatientList from '../components/patientList.vue';
|
||||||
import PrescriptionList from './components/prescriptionList.vue';
|
import PrescriptionList from './components/prescriptionList.vue';
|
||||||
import { RequestStatus } from '@/utils/medicalConstants';
|
import { RequestStatus } from '@/utils/medicalConstants';
|
||||||
|
|||||||
@@ -181,7 +181,7 @@ function handleGetPrescription() {
|
|||||||
getPrescriptionList({
|
getPrescriptionList({
|
||||||
encounterIds: encounterIds,
|
encounterIds: encounterIds,
|
||||||
requestStatus: props.requestStatus,
|
requestStatus: props.requestStatus,
|
||||||
therapyEnum: type.value === 1 ? undefined : type.value === 2 ? 1 : 2, // 1=全部(不传), 2=长期(1), 3=临时(2)
|
...(type.value !== undefined ? { therapyEnum: type.value } : {}),
|
||||||
pageSize: 10000,
|
pageSize: 10000,
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
|
|||||||
@@ -112,6 +112,19 @@
|
|||||||
<el-form ref="dynamicForm" :model="formData" label-width="100px" :rules="formRules">
|
<el-form ref="dynamicForm" :model="formData" label-width="100px" :rules="formRules">
|
||||||
<div class="page-bottom">
|
<div class="page-bottom">
|
||||||
<el-row :gutter="24">
|
<el-row :gutter="24">
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item style="margin-top: 15px" label="录入日期">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="formData.recordingDate"
|
||||||
|
type="date"
|
||||||
|
placeholder="请选择日期"
|
||||||
|
size="small"
|
||||||
|
format="YYYY/MM/DD"
|
||||||
|
value-format="YYYY-MM-DD"
|
||||||
|
style="width: 100%"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item style="margin-top: 15px" label="录入时间">
|
<el-form-item style="margin-top: 15px" label="录入时间">
|
||||||
<div class="input-time-inline">
|
<div class="input-time-inline">
|
||||||
@@ -766,6 +779,7 @@ const receptionTime = ref(null);
|
|||||||
|
|
||||||
// 表单数据 - 体征录入
|
// 表单数据 - 体征录入
|
||||||
const formData = ref({
|
const formData = ref({
|
||||||
|
recordingDate: '',
|
||||||
timePoint: '',
|
timePoint: '',
|
||||||
temperature: '',
|
temperature: '',
|
||||||
systolicPressure: '',
|
systolicPressure: '',
|
||||||
@@ -872,6 +886,7 @@ function getPatientDetial() {
|
|||||||
// 默认查询今天的数据
|
// 默认查询今天的数据
|
||||||
const today = moment().format('YYYY-MM-DD');
|
const today = moment().format('YYYY-MM-DD');
|
||||||
receptionTime.value = [today, today];
|
receptionTime.value = [today, today];
|
||||||
|
formData.value.recordingDate = today;
|
||||||
// 自动加载数据
|
// 自动加载数据
|
||||||
getPatientList();
|
getPatientList();
|
||||||
listPatient(queryParams.value).then((res) => {
|
listPatient(queryParams.value).then((res) => {
|
||||||
@@ -920,6 +935,7 @@ function handleRowClick(row) {
|
|||||||
formData.value = {
|
formData.value = {
|
||||||
...formData.value,
|
...formData.value,
|
||||||
id: row.id,
|
id: row.id,
|
||||||
|
recordingDate: row.recordingDate || '',
|
||||||
timePoint: convertTimePoint(row.timePoint) || '',
|
timePoint: convertTimePoint(row.timePoint) || '',
|
||||||
temperature: row.temperature || '',
|
temperature: row.temperature || '',
|
||||||
systolicPressure: row.systolicPressure || '',
|
systolicPressure: row.systolicPressure || '',
|
||||||
@@ -1038,7 +1054,7 @@ function confirmCharge() {
|
|||||||
|
|
||||||
params.vitalSignsCode = vitalSignsCode;
|
params.vitalSignsCode = vitalSignsCode;
|
||||||
params.vitalSignsValues = vitalSignsValues;
|
params.vitalSignsValues = vitalSignsValues;
|
||||||
params.recordingDate = moment(new Date()).format('YYYY-MM-DD');
|
params.recordingDate = formData.value.recordingDate || moment(new Date()).format('YYYY-MM-DD');
|
||||||
|
|
||||||
addVitalSigns(params).then(res => {
|
addVitalSigns(params).then(res => {
|
||||||
console.log('保存成功:', res);
|
console.log('保存成功:', res);
|
||||||
@@ -1047,6 +1063,7 @@ function confirmCharge() {
|
|||||||
getPatientList();
|
getPatientList();
|
||||||
// 清空表单
|
// 清空表单
|
||||||
formData.value = {
|
formData.value = {
|
||||||
|
recordingDate: '',
|
||||||
timePoint: '',
|
timePoint: '',
|
||||||
temperature: '',
|
temperature: '',
|
||||||
systolicPressure: '',
|
systolicPressure: '',
|
||||||
|
|||||||
@@ -220,15 +220,15 @@
|
|||||||
|
|
||||||
<!-- 底部控制面板 -->
|
<!-- 底部控制面板 -->
|
||||||
<div class="footer-section">
|
<div class="footer-section">
|
||||||
<!-- 就诊科室快速过滤栏 -->
|
<!-- 诊室快速过滤栏 -->
|
||||||
<div class="filter-section">
|
<div class="filter-section">
|
||||||
<div class="filter-label">
|
<div class="filter-label">
|
||||||
③ 就诊科室快速过滤栏
|
③ 诊室快速过滤栏
|
||||||
</div>
|
</div>
|
||||||
<div class="filter-select-wrapper">
|
<div class="filter-select-wrapper">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="selectedDept"
|
v-model="selectedClinicRoom"
|
||||||
placeholder="请选择就诊科室"
|
placeholder="请选择诊室"
|
||||||
clearable
|
clearable
|
||||||
filterable
|
filterable
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
@@ -239,10 +239,10 @@
|
|||||||
value="all"
|
value="all"
|
||||||
/>
|
/>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dept in departmentList"
|
v-for="room in clinicRoomList"
|
||||||
:key="dept.id"
|
:key="room"
|
||||||
:label="dept.name"
|
:label="room"
|
||||||
:value="dept.id"
|
:value="room"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</div>
|
</div>
|
||||||
@@ -648,7 +648,6 @@ import { Refresh } from '@element-plus/icons-vue'
|
|||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
import {
|
import {
|
||||||
getCandidatePool,
|
getCandidatePool,
|
||||||
getLocationTree,
|
|
||||||
getTriageQueueList,
|
getTriageQueueList,
|
||||||
addToQueue,
|
addToQueue,
|
||||||
removeFromQueue,
|
removeFromQueue,
|
||||||
@@ -681,10 +680,10 @@ const selectedCandidates = ref([])
|
|||||||
// 显示选项
|
// 显示选项
|
||||||
const showOnlyWaiting = ref(false)
|
const showOnlyWaiting = ref(false)
|
||||||
|
|
||||||
// 科室过滤(改为使用就诊科室)
|
// 诊室过滤(按诊室维度筛选)
|
||||||
const selectedDept = ref('all')
|
const selectedClinicRoom = ref('all')
|
||||||
// 就诊科室列表
|
// 诊室列表(从数据中动态提取)
|
||||||
const departmentList = ref([])
|
const clinicRoomList = ref([])
|
||||||
|
|
||||||
// 修复【#397】:动态获取当前科室名称
|
// 修复【#397】:动态获取当前科室名称
|
||||||
const currentDeptName = computed(() => {
|
const currentDeptName = computed(() => {
|
||||||
@@ -907,13 +906,11 @@ const mapFrontendStatusToBackend = (status) => {
|
|||||||
// 从数据库加载队列
|
// 从数据库加载队列
|
||||||
const loadQueueFromDb = async () => {
|
const loadQueueFromDb = async () => {
|
||||||
try {
|
try {
|
||||||
// 如果选择了具体科室,就按科室加载;否则加载当前登录人科室(后端默认)
|
// 使用当前登录人的科室
|
||||||
const organizationId = selectedDept.value !== 'all' ? selectedDept.value : undefined
|
|
||||||
// 只查询今天的患者
|
|
||||||
const today = new Date()
|
const today = new Date()
|
||||||
const todayStr = `${today.getFullYear()}-${String(today.getMonth() + 1).padStart(2, '0')}-${String(today.getDate()).padStart(2, '0')}`
|
const todayStr = `${today.getFullYear()}-${String(today.getMonth() + 1).padStart(2, '0')}-${String(today.getDate()).padStart(2, '0')}`
|
||||||
console.log('【心内科】loadQueueFromDb 开始:organizationId=', organizationId, 'date=', todayStr, 'selectedDept=', selectedDept.value)
|
console.log('【心内科】loadQueueFromDb 开始:date=', todayStr)
|
||||||
const res = await getTriageQueueList({ organizationId, date: todayStr }).catch((err) => {
|
const res = await getTriageQueueList({ date: todayStr }).catch((err) => {
|
||||||
console.error('【心内科】loadQueueFromDb 请求异常:', err)
|
console.error('【心内科】loadQueueFromDb 请求异常:', err)
|
||||||
return { code: 500, msg: err?.message || '请求失败', data: null }
|
return { code: 500, msg: err?.message || '请求失败', data: null }
|
||||||
})
|
})
|
||||||
@@ -1141,6 +1138,8 @@ const loadDataFromApi = async () => {
|
|||||||
|
|
||||||
// 同步当前呼叫(队列从 DB 加载后已同步;这里再兜底一次)
|
// 同步当前呼叫(队列从 DB 加载后已同步;这里再兜底一次)
|
||||||
syncCurrentCallFromQueue()
|
syncCurrentCallFromQueue()
|
||||||
|
// 提取诊室列表供过滤栏使用
|
||||||
|
extractClinicRooms()
|
||||||
console.log('【心内科】数据加载完成:候选池', originalCandidatePoolList.value.length, '条,队列', originalQueueList.value.length, '条')
|
console.log('【心内科】数据加载完成:候选池', originalCandidatePoolList.value.length, '条,队列', originalQueueList.value.length, '条')
|
||||||
ElMessage.success('【心内科】已从门诊挂号接口加载数据')
|
ElMessage.success('【心内科】已从门诊挂号接口加载数据')
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
@@ -1152,56 +1151,37 @@ const loadDataFromApi = async () => {
|
|||||||
totalSignedIn.value = originalCandidatePoolList.value.length
|
totalSignedIn.value = originalCandidatePoolList.value.length
|
||||||
totalInQueue.value = originalQueueList.value.length
|
totalInQueue.value = originalQueueList.value.length
|
||||||
syncCurrentCallFromQueue()
|
syncCurrentCallFromQueue()
|
||||||
|
extractClinicRooms()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 原始数据存储(用于过滤)
|
// 原始数据存储(用于过滤)
|
||||||
const originalCandidatePoolList = ref(getInitialCandidatePoolList())
|
const originalCandidatePoolList = ref(getInitialCandidatePoolList())
|
||||||
|
|
||||||
// 辅助函数:扁平化科室树形结构
|
// 提取诊室列表(从队列和候选池数据中动态获取)
|
||||||
const flattenDepartmentTree = (tree, result = []) => {
|
const extractClinicRooms = () => {
|
||||||
if (!Array.isArray(tree)) return result
|
const roomSet = new Set()
|
||||||
tree.forEach(node => {
|
// 从队列中提取
|
||||||
if (node.id && node.name) {
|
originalQueueList.value.forEach(item => {
|
||||||
result.push({ id: node.id, name: node.name })
|
if (item.room && item.room !== '-') {
|
||||||
}
|
roomSet.add(item.room)
|
||||||
if (node.children && Array.isArray(node.children)) {
|
|
||||||
flattenDepartmentTree(node.children, result)
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
return result
|
// 从候选池中提取
|
||||||
}
|
originalCandidatePoolList.value.forEach(item => {
|
||||||
|
if (item.room && item.room !== '-') {
|
||||||
// 加载就诊科室列表
|
roomSet.add(item.room)
|
||||||
const loadDepartmentList = async () => {
|
|
||||||
try {
|
|
||||||
const response = await getLocationTree()
|
|
||||||
if (response && response.data) {
|
|
||||||
// 扁平化树形结构
|
|
||||||
departmentList.value = flattenDepartmentTree(response.data)
|
|
||||||
console.log('【心内科】已加载就诊科室列表:', departmentList.value.length, '个科室')
|
|
||||||
}
|
}
|
||||||
} catch (error) {
|
})
|
||||||
console.error('【心内科】加载就诊科室列表失败:', error)
|
clinicRoomList.value = Array.from(roomSet).sort()
|
||||||
ElMessage.warning('加载就诊科室列表失败,使用默认数据')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取选中科室的名称
|
|
||||||
const getSelectedDeptName = () => {
|
|
||||||
if (selectedDept.value === 'all') return null
|
|
||||||
const dept = departmentList.value.find(d => d.id === selectedDept.value)
|
|
||||||
return dept ? dept.name : null
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 过滤后的智能候选池数据
|
// 过滤后的智能候选池数据
|
||||||
const filteredCandidatePoolList = computed(() => {
|
const filteredCandidatePoolList = computed(() => {
|
||||||
if (selectedDept.value === 'all') {
|
if (selectedClinicRoom.value === 'all') {
|
||||||
return originalCandidatePoolList.value
|
return originalCandidatePoolList.value
|
||||||
}
|
}
|
||||||
const deptName = getSelectedDeptName()
|
return originalCandidatePoolList.value.filter(item => item.room === selectedClinicRoom.value)
|
||||||
if (!deptName) return originalCandidatePoolList.value
|
|
||||||
return originalCandidatePoolList.value.filter(item => item.room === deptName)
|
|
||||||
})
|
})
|
||||||
|
|
||||||
// 原始队列数据存储(用于过滤)
|
// 原始队列数据存储(用于过滤)
|
||||||
@@ -1223,19 +1203,16 @@ const formatSecondsToMmSs = (totalSeconds) => {
|
|||||||
return `${mm}:${ss}`
|
return `${mm}:${ss}`
|
||||||
}
|
}
|
||||||
|
|
||||||
// 过滤后的智能队列数据(同时考虑科室过滤和状态过滤)
|
// 过滤后的智能队列数据(同时考虑诊室过滤和状态过滤)
|
||||||
const filteredQueueList = computed(() => {
|
const filteredQueueList = computed(() => {
|
||||||
let filtered = originalQueueList.value
|
let filtered = originalQueueList.value
|
||||||
|
|
||||||
// 先过滤掉"已完成"状态的患者(无论什么情况都不显示)
|
// 先过滤掉"已完成"状态的患者(无论什么情况都不显示)
|
||||||
filtered = filtered.filter(item => item.status !== '已完成')
|
filtered = filtered.filter(item => item.status !== '已完成')
|
||||||
|
|
||||||
// 再按科室过滤
|
// 再按诊室过滤
|
||||||
if (selectedDept.value !== 'all') {
|
if (selectedClinicRoom.value !== 'all') {
|
||||||
const deptName = getSelectedDeptName()
|
filtered = filtered.filter(item => item.room === selectedClinicRoom.value)
|
||||||
if (deptName) {
|
|
||||||
filtered = filtered.filter(item => item.room === deptName)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 再按状态过滤(只显示等待)
|
// 再按状态过滤(只显示等待)
|
||||||
@@ -1747,9 +1724,9 @@ const handleNextPatient = async () => {
|
|||||||
reqData.organizationId = selectedQueueRow.value.organizationId
|
reqData.organizationId = selectedQueueRow.value.organizationId
|
||||||
} else {
|
} else {
|
||||||
// 如果没有选中患者,使用查询条件(兼容旧逻辑)
|
// 如果没有选中患者,使用查询条件(兼容旧逻辑)
|
||||||
let orgId = selectedDept.value !== 'all' ? selectedDept.value : undefined
|
// 全科模式:优先用"当前叫号中/第一个等待"所在科室
|
||||||
// "全科"模式:优先用"当前叫号中/第一个等待"所在科室
|
let orgId = null
|
||||||
if (orgId == null) {
|
{
|
||||||
const calling = originalQueueList.value.find((i) => i.status === '叫号中')
|
const calling = originalQueueList.value.find((i) => i.status === '叫号中')
|
||||||
const waiting = originalQueueList.value.find((i) => i.status === '等待')
|
const waiting = originalQueueList.value.find((i) => i.status === '等待')
|
||||||
console.log('【心内科】handleNextPatient 查找:叫号中=', calling?.patientName, '等待=', waiting?.patientName)
|
console.log('【心内科】handleNextPatient 查找:叫号中=', calling?.patientName, '等待=', waiting?.patientName)
|
||||||
@@ -1785,9 +1762,9 @@ const handleSkip = async () => {
|
|||||||
reqData.organizationId = selectedQueueRow.value.organizationId
|
reqData.organizationId = selectedQueueRow.value.organizationId
|
||||||
} else {
|
} else {
|
||||||
// 如果没有选中患者,使用查询条件(兼容旧逻辑)
|
// 如果没有选中患者,使用查询条件(兼容旧逻辑)
|
||||||
let orgId = selectedDept.value !== 'all' ? selectedDept.value : undefined
|
// 全科模式:优先用”当前叫号中”所在科室
|
||||||
// “全科”模式:优先用“当前叫号中”所在科室
|
let orgId = null
|
||||||
if (orgId == null) {
|
{
|
||||||
const calling = originalQueueList.value.find((i) => i.status === '叫号中')
|
const calling = originalQueueList.value.find((i) => i.status === '叫号中')
|
||||||
orgId = calling?.organizationId
|
orgId = calling?.organizationId
|
||||||
}
|
}
|
||||||
@@ -1819,9 +1796,9 @@ const handleComplete = async () => {
|
|||||||
reqData.organizationId = selectedQueueRow.value.organizationId
|
reqData.organizationId = selectedQueueRow.value.organizationId
|
||||||
} else {
|
} else {
|
||||||
// 如果没有选中患者,使用查询条件(兼容旧逻辑)
|
// 如果没有选中患者,使用查询条件(兼容旧逻辑)
|
||||||
let orgId = selectedDept.value !== 'all' ? selectedDept.value : undefined
|
// 全科模式:优先用”当前叫号中”所在科室
|
||||||
// “全科”模式:优先用“当前叫号中”所在科室
|
let orgId = null
|
||||||
if (orgId == null) {
|
{
|
||||||
const calling = originalQueueList.value.find((i) => i.status === '叫号中')
|
const calling = originalQueueList.value.find((i) => i.status === '叫号中')
|
||||||
orgId = calling?.organizationId
|
orgId = calling?.organizationId
|
||||||
}
|
}
|
||||||
@@ -1853,9 +1830,9 @@ const handleRequeue = async () => {
|
|||||||
reqData.organizationId = selectedQueueRow.value.organizationId
|
reqData.organizationId = selectedQueueRow.value.organizationId
|
||||||
} else {
|
} else {
|
||||||
// 如果没有选中患者,使用查询条件(兼容旧逻辑)
|
// 如果没有选中患者,使用查询条件(兼容旧逻辑)
|
||||||
let orgId = selectedDept.value !== 'all' ? selectedDept.value : undefined
|
// 全科模式:优先用”当前叫号中”所在科室
|
||||||
// “全科”模式:优先用“当前叫号中”所在科室
|
let orgId = null
|
||||||
if (orgId == null) {
|
{
|
||||||
const calling = originalQueueList.value.find((i) => i.status === '叫号中')
|
const calling = originalQueueList.value.find((i) => i.status === '叫号中')
|
||||||
orgId = calling?.organizationId
|
orgId = calling?.organizationId
|
||||||
}
|
}
|
||||||
@@ -2121,8 +2098,6 @@ const handleTestRule = () => {
|
|||||||
|
|
||||||
// 组件挂载
|
// 组件挂载
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
// 加载就诊科室列表
|
|
||||||
loadDepartmentList()
|
|
||||||
// 初始化:优先从后端加载,失败则回退本地假数据
|
// 初始化:优先从后端加载,失败则回退本地假数据
|
||||||
loadDataFromApi()
|
loadDataFromApi()
|
||||||
startWaitingTimer()
|
startWaitingTimer()
|
||||||
|
|||||||
Reference in New Issue
Block a user