Compare commits
27 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f726312077 | ||
|
|
0efde56f70 | ||
|
|
cae70bd742 | ||
|
|
d2a89b9f31 | ||
|
|
04ac6b0ec2 | ||
|
|
c0cdfcc688 | ||
|
|
7df162177a | ||
|
|
644c8285b5 | ||
|
|
28e0228ff5 | ||
|
|
6b3f74d2ca | ||
|
|
349b0453c8 | ||
|
|
3ddd74d679 | ||
|
|
9829843b3e | ||
|
|
0d95cc1341 | ||
|
|
1dfceeaf46 | ||
|
|
1b79df4f93 | ||
|
|
f62a280dfc | ||
|
|
e5d949a740 | ||
|
|
6451c308c2 | ||
|
|
772ec5537c | ||
|
|
af6494c806 | ||
|
|
2901dafe10 | ||
|
|
ffc2562aea | ||
|
|
5da537f863 | ||
|
|
facbe7cd44 | ||
|
|
283d25642a | ||
|
|
7b17a66214 |
@@ -633,9 +633,9 @@ public class OutpatientRegistrationAppServiceImpl implements IOutpatientRegistra
|
||||
Order updateOrder = new Order();
|
||||
updateOrder.setId(appointmentOrder.getId());
|
||||
updateOrder.setStatus(CommonConstants.AppointmentOrderStatus.RETURNED);
|
||||
updateOrder.setPayStatus(0);
|
||||
updateOrder.setCancelTime(now);
|
||||
updateOrder.setCancelReason(
|
||||
StringUtils.isNotEmpty(reason) ? reason : "门诊退号");
|
||||
updateOrder.setCancelReason("门诊退号");
|
||||
updateOrder.setUpdateTime(now);
|
||||
orderService.updateById(updateOrder);
|
||||
}
|
||||
|
||||
@@ -83,9 +83,14 @@ public class AdviceUtils {
|
||||
* @return 提示信息
|
||||
*/
|
||||
public String checkInventory(List<AdviceSaveDto> adviceSaveList) {
|
||||
// 医嘱定义ID集合
|
||||
// 医嘱定义ID集合(过滤null值,避免SQL查询异常)
|
||||
List<Long> adviceDefinitionIdList
|
||||
= adviceSaveList.stream().map(AdviceSaveDto::getAdviceDefinitionId).collect(Collectors.toList());
|
||||
= adviceSaveList.stream().map(AdviceSaveDto::getAdviceDefinitionId)
|
||||
.filter(id -> id != null).collect(Collectors.toList());
|
||||
// 🔧 Bug #504 修复:如果所有adviceDefinitionId都为null,跳过库存校验
|
||||
if (adviceDefinitionIdList.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
// 医嘱库存集合
|
||||
List<AdviceInventoryDto> adviceInventoryList
|
||||
= doctorStationAdviceAppMapper.getAdviceInventory(null, adviceDefinitionIdList,
|
||||
@@ -99,6 +104,10 @@ public class AdviceUtils {
|
||||
= this.subtractInventory(adviceInventoryList, adviceDraftInventoryList);
|
||||
// 检查库存
|
||||
for (AdviceSaveDto saveDto : adviceSaveList) {
|
||||
// 🔧 Bug #504 修复:退回医嘱可能adviceDefinitionId为空,跳过校验
|
||||
if (saveDto.getAdviceDefinitionId() == null) {
|
||||
continue;
|
||||
}
|
||||
boolean matched = false;
|
||||
for (AdviceInventoryDto inventoryDto : adviceInventory) {
|
||||
// 匹配条件:adviceDefinitionId, adviceTableName, locationId, lotNumber 同时相等
|
||||
@@ -108,10 +117,12 @@ public class AdviceUtils {
|
||||
|| saveDto.getLotNumber().equals(inventoryDto.getLotNumber());
|
||||
boolean tableNameMatch = StringUtils.isEmpty(saveDto.getAdviceTableName())
|
||||
|| inventoryDto.getItemTable().equals(saveDto.getAdviceTableName());
|
||||
// if (saveDto.)
|
||||
// 🔧 Bug #504 修复:退回医嘱可能locationId为空,跳过location匹配
|
||||
boolean locationMatch = saveDto.getLocationId() == null
|
||||
|| inventoryDto.getLocationId().equals(saveDto.getLocationId());
|
||||
if (inventoryDto.getItemId().equals(saveDto.getAdviceDefinitionId())
|
||||
&& tableNameMatch
|
||||
&& inventoryDto.getLocationId().equals(saveDto.getLocationId()) && lotNumberMatch) {
|
||||
&& locationMatch && lotNumberMatch) {
|
||||
matched = true;
|
||||
// 检查库存是否充足
|
||||
BigDecimal minUnitQuantity = saveDto.getMinUnitQuantity();
|
||||
@@ -167,22 +178,26 @@ public class AdviceUtils {
|
||||
// 生命提示信息集合
|
||||
List<String> tipsList = new ArrayList<>();
|
||||
for (MedicationRequestUseExe medicationRequestUseExe : medUseExeList) {
|
||||
Optional<AdviceInventoryDto> matchedInventory = adviceInventory.stream()
|
||||
// 聚合同一位置所有批次的库存总量
|
||||
List<AdviceInventoryDto> matchedInventories = adviceInventory.stream()
|
||||
.filter(inventoryDto -> medicationRequestUseExe.getMedicationId().equals(inventoryDto.getItemId())
|
||||
&& CommonConstants.TableName.MED_MEDICATION_DEFINITION.equals(inventoryDto.getItemTable())
|
||||
&& medicationRequestUseExe.getPerformLocation().equals(inventoryDto.getLocationId())
|
||||
// 如果选择了具体的批次号,校验库存时需要加上批次号的匹配条件
|
||||
&& (StringUtils.isEmpty(medicationRequestUseExe.getLotNumber())
|
||||
|| medicationRequestUseExe.getLotNumber().equals(inventoryDto.getLotNumber())))
|
||||
.findFirst();
|
||||
.collect(Collectors.toList());
|
||||
// 匹配到库存信息
|
||||
if (matchedInventory.isPresent()) {
|
||||
AdviceInventoryDto inventoryDto = matchedInventory.get();
|
||||
if ((medicationRequestUseExe.getExecuteTimesNum()
|
||||
.multiply(medicationRequestUseExe.getMinUnitQuantity()))
|
||||
.compareTo(inventoryDto.getQuantity()) > 0) {
|
||||
if (!matchedInventories.isEmpty()) {
|
||||
// 聚合所有批次的可用库存
|
||||
BigDecimal totalQuantity = matchedInventories.stream()
|
||||
.map(dto -> dto.getQuantity() != null ? dto.getQuantity() : BigDecimal.ZERO)
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
BigDecimal requestQuantity = medicationRequestUseExe.getExecuteTimesNum()
|
||||
.multiply(medicationRequestUseExe.getMinUnitQuantity());
|
||||
if (requestQuantity.compareTo(totalQuantity) > 0) {
|
||||
tipsList
|
||||
.add("【" + medicationRequestUseExe.getBusNo() + "】在" + inventoryDto.getLocationName() + "库存不足");
|
||||
.add("【" + medicationRequestUseExe.getBusNo() + "】在" + matchedInventories.get(0).getLocationName() + "库存不足");
|
||||
}
|
||||
} else {
|
||||
tipsList.add("【" + medicationRequestUseExe.getBusNo() + "】未匹配到库存信息");
|
||||
|
||||
@@ -206,6 +206,8 @@ public class AdviceProcessAppServiceImpl implements IAdviceProcessAppService {
|
||||
e.setTherapyEnum_enumText(EnumUtils.getInfoByValue(TherapyTimeType.class, e.getTherapyEnum()));
|
||||
// 请求状态
|
||||
e.setRequestStatus_enumText(EnumUtils.getInfoByValue(RequestStatus.class, e.getRequestStatus()));
|
||||
// 发药状态
|
||||
e.setDispenseStatus_enumText(EnumUtils.getInfoByValue(DispenseStatus.class, e.getDispenseStatus()));
|
||||
// 性别枚举
|
||||
e.setGenderEnum_enumText(EnumUtils.getInfoByValue(AdministrativeGender.class, e.getGenderEnum()));
|
||||
// 计算年龄
|
||||
@@ -356,6 +358,17 @@ public class AdviceProcessAppServiceImpl implements IAdviceProcessAppService {
|
||||
medRequestList.add(item);
|
||||
}
|
||||
}
|
||||
// 校验药品医嘱是否已发药,已发药的医嘱不允许退回
|
||||
if (!medRequestList.isEmpty()) {
|
||||
List<Long> medReqIds = medRequestList.stream().map(PerformInfoDto::getRequestId).toList();
|
||||
List<MedicationDispense> dispenseList = medicationDispenseService.list(
|
||||
new LambdaQueryWrapper<MedicationDispense>()
|
||||
.in(MedicationDispense::getMedReqId, medReqIds)
|
||||
.eq(MedicationDispense::getStatusEnum, DispenseStatus.COMPLETED.getValue()));
|
||||
if (!dispenseList.isEmpty()) {
|
||||
return R.fail("该医嘱已发药,无法退回");
|
||||
}
|
||||
}
|
||||
Long practitionerId = SecurityUtils.getLoginUser().getPractitionerId();
|
||||
Date checkDate = new Date();
|
||||
if (!serviceRequestList.isEmpty()) {
|
||||
|
||||
@@ -255,4 +255,8 @@ public class InpatientAdviceDto {
|
||||
|
||||
/** 总价 */
|
||||
private BigDecimal totalPrice;
|
||||
|
||||
/** 发药状态 */
|
||||
private Integer dispenseStatus;
|
||||
private String dispenseStatus_enumText;
|
||||
}
|
||||
|
||||
@@ -511,6 +511,9 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
|
||||
// 签发操作
|
||||
boolean is_sign = AdviceOpType.SIGN_ADVICE.getCode().equals(adviceOpType);
|
||||
|
||||
// 收集已处理的requestId,用于批量更新状态
|
||||
List<Long> processedRequestIds = new ArrayList<>();
|
||||
|
||||
// 声明长期医嘱诊疗请求
|
||||
ServiceRequest longServiceRequest;
|
||||
// 新增 + 修改 (长期医嘱)
|
||||
@@ -555,6 +558,9 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
|
||||
}
|
||||
}
|
||||
iServiceRequestService.saveOrUpdate(longServiceRequest);
|
||||
if (longServiceRequest.getId() != null) {
|
||||
processedRequestIds.add(longServiceRequest.getId());
|
||||
}
|
||||
}
|
||||
|
||||
// 声明临时医嘱诊疗请求
|
||||
@@ -603,6 +609,9 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
|
||||
}
|
||||
}
|
||||
iServiceRequestService.saveOrUpdate(tempServiceRequest);
|
||||
if (tempServiceRequest.getId() != null) {
|
||||
processedRequestIds.add(tempServiceRequest.getId());
|
||||
}
|
||||
|
||||
// 保存时,保存诊疗费用项
|
||||
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);
|
||||
}
|
||||
|
||||
// 诊疗执行科室配置校验(必须在数据库操作之前执行)
|
||||
List<ActivityOrganizationConfigDto> activityOrganizationConfig =
|
||||
requestFormManageAppMapper.getActivityOrganizationConfig(typeCode);
|
||||
if (activityOrganizationConfig.isEmpty()) {
|
||||
throw new ServiceException("请先配置当前时间段的执行科室");
|
||||
}
|
||||
|
||||
// 当前时间
|
||||
Date curDate = new Date();
|
||||
// 请求类型
|
||||
@@ -139,12 +146,6 @@ public class RequestFormManageAppServiceImpl implements IRequestFormManageAppSer
|
||||
// 诊疗集合
|
||||
List<ActivitySaveDto> activityList = requestFormSaveDto.getActivityList();
|
||||
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) {
|
||||
serviceRequest = new ServiceRequest();
|
||||
|
||||
@@ -153,7 +153,8 @@
|
||||
ii.balance_amount AS balance_amount,
|
||||
ii.account_id AS account_id,
|
||||
ii.performer_check_id,
|
||||
ii.category_code
|
||||
ii.category_code,
|
||||
ii.dispense_status
|
||||
FROM (( SELECT T1.encounter_id,
|
||||
T1.tenant_id,
|
||||
#{medMedicationRequest} AS advice_table,
|
||||
@@ -197,7 +198,8 @@
|
||||
pra."name" AS admitting_doctor_name,
|
||||
personal_account.balance_amount,
|
||||
personal_account.id AS account_id,
|
||||
T2.category_code
|
||||
T2.category_code,
|
||||
mmd.status_enum AS dispense_status
|
||||
FROM med_medication_request AS T1
|
||||
LEFT JOIN med_medication_definition AS T2
|
||||
ON T2.id = T1.medication_id
|
||||
@@ -278,6 +280,9 @@
|
||||
aa.balance_amount
|
||||
) AS personal_account
|
||||
ON personal_account.encounter_id = ae.id
|
||||
LEFT JOIN med_medication_dispense mmd
|
||||
ON mmd.med_req_id = T1.id
|
||||
AND mmd.delete_flag = '0'
|
||||
WHERE T1.delete_flag = '0'
|
||||
AND T1.refund_medicine_id IS NULL
|
||||
AND T1.generate_source_enum = #{doctorPrescription}
|
||||
@@ -331,7 +336,8 @@
|
||||
pra."name" AS admitting_doctor_name,
|
||||
personal_account.balance_amount,
|
||||
personal_account.id AS account_id,
|
||||
T2.category_code
|
||||
T2.category_code,
|
||||
NULL AS dispense_status
|
||||
FROM wor_service_request AS T1
|
||||
LEFT JOIN wor_activity_definition AS T2
|
||||
ON T2.id = T1.activity_id
|
||||
|
||||
@@ -105,6 +105,8 @@
|
||||
<if test="statusEnum == 4">
|
||||
T4.status_enum = #{completed}
|
||||
</if>
|
||||
AND T4.summary_no IS NOT NULL
|
||||
AND T4.summary_no != ''
|
||||
) AS ii
|
||||
${ew.customSqlSegment}
|
||||
GROUP BY ii.encounter_id,
|
||||
@@ -263,6 +265,8 @@
|
||||
AND T15.delete_flag = '0'
|
||||
WHERE T1.delete_flag = '0'
|
||||
-- 因发药配药合并,前台只能看到待发药,已发药状态,但是后台配药发药状态都查
|
||||
AND T1.summary_no IS NOT NULL
|
||||
AND T1.summary_no != ''
|
||||
AND
|
||||
<if test="dispenseStatus == null">
|
||||
T1.status_enum IN (#{inProgress},#{completed},#{preparation},#{prepared})
|
||||
|
||||
@@ -216,7 +216,8 @@
|
||||
ccd.name AS condition_definition_name,
|
||||
T1.therapy_enum AS therapyEnum,
|
||||
T1.sort_number AS sort_number,
|
||||
T1.based_on_id AS based_on_id
|
||||
T1.based_on_id AS based_on_id,
|
||||
T1.medication_id AS advice_definition_id
|
||||
FROM med_medication_request AS T1
|
||||
LEFT JOIN med_medication_definition AS T2 ON T2.ID = T1.medication_id
|
||||
AND T2.delete_flag = '0'
|
||||
@@ -268,7 +269,8 @@
|
||||
'' AS condition_definition_name,
|
||||
2 AS therapyEnum,
|
||||
99 AS sort_number,
|
||||
T1.based_on_id AS based_on_id
|
||||
T1.based_on_id AS based_on_id,
|
||||
T1.device_def_id AS advice_definition_id
|
||||
FROM wor_device_request AS T1
|
||||
LEFT JOIN adm_device_definition AS T2 ON T2.ID = T1.device_def_id
|
||||
AND T2.delete_flag = '0'
|
||||
@@ -317,7 +319,8 @@
|
||||
'' AS condition_definition_name,
|
||||
COALESCE(T1.therapy_enum, 2) AS therapyEnum,
|
||||
99 AS sort_number,
|
||||
T1.based_on_id AS based_on_id
|
||||
T1.based_on_id AS based_on_id,
|
||||
T1.activity_id AS advice_definition_id
|
||||
FROM wor_service_request AS T1
|
||||
LEFT JOIN wor_activity_definition AS T2
|
||||
ON T2.ID = T1.activity_id
|
||||
|
||||
@@ -314,6 +314,7 @@
|
||||
>
|
||||
<template #title>
|
||||
<span class="cat-title">{{ cat.categoryName }}</span>
|
||||
<span v-if="categoryLoadingSet.has(cat.typeId)" class="loading-dot"></span>
|
||||
</template>
|
||||
<div
|
||||
v-for="item in cat.items"
|
||||
@@ -329,6 +330,9 @@
|
||||
</el-checkbox>
|
||||
<span class="item-price">¥{{ item.price }}/{{ item.unit || "次" }}</span>
|
||||
</div>
|
||||
<div v-if="categoryLoadingSet.has(cat.typeId)" class="category-loading-hint">
|
||||
加载中...
|
||||
</div>
|
||||
</el-collapse-item>
|
||||
</el-collapse>
|
||||
</div>
|
||||
@@ -517,6 +521,7 @@ const rules = {
|
||||
const categoryList = ref([]); // 原始分类+项目数据
|
||||
const dictSearchKey = ref('');
|
||||
const activeNames = ref(''); // 当前展开的折叠项
|
||||
const categoryLoadingSet = ref(new Set()); // Bug #500: 正在加载方法的分类集合
|
||||
|
||||
const allMethods = ref([]);
|
||||
|
||||
@@ -632,9 +637,14 @@ const availableMethods = computed(() => {
|
||||
|
||||
// 当可选方法列表改变时,如果当前选中的方法不在新列表中,则清空
|
||||
// #428: 分类展开时联动加载检查方法
|
||||
// Bug #500: 使用 categoryLoadingSet 替代 dictLoading,避免切换分类时整个区域闪烁
|
||||
async function handleCategoryExpand(cat) {
|
||||
if (!cat || !cat.typeName) return;
|
||||
|
||||
// 如果已加载过或正在加载中,跳过
|
||||
if ((cat.methods && cat.methods.length > 0) || categoryLoadingSet.value.has(cat.typeId)) return;
|
||||
|
||||
categoryLoadingSet.value.add(cat.typeId);
|
||||
try {
|
||||
const res = await searchCheckMethod({ checkType: cat.typeName });
|
||||
let data = res?.data?.data || res?.data || res?.rows || res;
|
||||
@@ -655,14 +665,16 @@ async function handleCategoryExpand(cat) {
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('加载分类检查方法失败', err);
|
||||
} finally {
|
||||
categoryLoadingSet.value.delete(cat.typeId);
|
||||
}
|
||||
}
|
||||
async function handleCollapseChange(activeName) {
|
||||
// 当折叠面板展开时,加载对应分类的检查方法
|
||||
// Bug #500: 改为非 async 函数,避免 el-collapse 的 @change 等待异步完成导致抖动
|
||||
function handleCollapseChange(activeName) {
|
||||
if (activeName) {
|
||||
const cat = filteredCategoryList.value.find(c => c.typeId == activeName);
|
||||
if (cat && (!cat.methods || cat.methods.length === 0)) {
|
||||
await handleCategoryExpand(cat);
|
||||
handleCategoryExpand(cat); // 异步加载,不 await
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1309,6 +1321,20 @@ defineExpose({ getList });
|
||||
font-weight: 500;
|
||||
color: #303133;
|
||||
}
|
||||
/* Bug #500: 分类加载中的小圆点动画 */
|
||||
.loading-dot {
|
||||
display: inline-block;
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
border-radius: 50%;
|
||||
background: #409eff;
|
||||
margin-left: 6px;
|
||||
animation: dotPulse 1s ease-in-out infinite;
|
||||
}
|
||||
@keyframes dotPulse {
|
||||
0%, 100% { opacity: 0.3; transform: scale(0.8); }
|
||||
50% { opacity: 1; transform: scale(1.2); }
|
||||
}
|
||||
.item-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -1448,10 +1474,24 @@ defineExpose({ getList });
|
||||
height: auto;
|
||||
line-height: 1.5;
|
||||
}
|
||||
/* Bug #500: 折叠内容添加平滑过渡动画,避免切换时高度跳变 */
|
||||
:deep(.el-collapse-item__content) {
|
||||
padding-bottom: 4px;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
/* Bug #500: 折叠面板展开/收起动画使用 will-change 优化性能 */
|
||||
:deep(.el-collapse-item__wrap) {
|
||||
border: none;
|
||||
will-change: height;
|
||||
}
|
||||
:deep(.el-collapse-item) {
|
||||
transition: margin 0.2s ease;
|
||||
}
|
||||
/* Bug #500: 分类加载中提示样式 */
|
||||
.category-loading-hint {
|
||||
color: #909399;
|
||||
font-size: 12px;
|
||||
text-align: center;
|
||||
padding: 8px 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -313,6 +313,7 @@
|
||||
data-prop="dispensePerDuration">
|
||||
<el-input-number v-model="scope.row.dispensePerDuration" style="width: 80px" :min="1"
|
||||
controls-position="right" :controls="false" :ref="(el) => (inputRefs.dispensePerDuration = el)"
|
||||
@change="calculateTotalAmount(scope.row, scope.$index)"
|
||||
@keyup.enter.prevent="
|
||||
handleEnter('dispensePerDuration', scope.row, scope.$index)
|
||||
">
|
||||
|
||||
@@ -121,3 +121,25 @@ export function getTestResultPage(queryParams) {
|
||||
data: queryParams,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除申请单(仅待签发状态可删除)
|
||||
*/
|
||||
export function deleteRequestForm(data) {
|
||||
return request({
|
||||
url: '/reg-doctorstation/request-form/delete',
|
||||
method: 'post',
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 撤回申请单(已签发状态撤回至待签发)
|
||||
*/
|
||||
export function withdrawRequestForm(data) {
|
||||
return request({
|
||||
url: '/reg-doctorstation/request-form/withdraw',
|
||||
method: 'post',
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -86,7 +86,11 @@
|
||||
</template>
|
||||
<el-table-column type="index" label="序号" width="60" align="center" />
|
||||
<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="prescriptionNo" label="处方号" width="140" />
|
||||
<el-table-column prop="requesterId_dictText" label="申请者" width="120" />
|
||||
@@ -95,9 +99,49 @@
|
||||
<span>{{ parseStatus(scope.row.status) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" fixed="right">
|
||||
<el-table-column label="操作" align="center" fixed="right" width="240">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" @click="handleViewDetail(scope.row)">详情</el-button>
|
||||
<!-- 待签发:修改、删除 -->
|
||||
<template v-if="scope.row.status === '0' || scope.row.status === 0">
|
||||
<el-button link type="primary" @click="handleEdit(scope.row)">修改</el-button>
|
||||
<el-popconfirm
|
||||
title="确认删除该申请单?"
|
||||
@confirm="handleDelete(scope.row)"
|
||||
width="200"
|
||||
>
|
||||
<template #reference>
|
||||
<el-button link type="danger">删除</el-button>
|
||||
</template>
|
||||
</el-popconfirm>
|
||||
</template>
|
||||
<!-- 已签发(护士未校对):撤回 -->
|
||||
<template v-else-if="scope.row.status === '1' || scope.row.status === 1">
|
||||
<el-popconfirm
|
||||
title="确认撤回该申请单?撤回后将回滚至待签发状态"
|
||||
@confirm="handleWithdraw(scope.row)"
|
||||
width="260"
|
||||
>
|
||||
<template #reference>
|
||||
<el-button link type="warning">撤回</el-button>
|
||||
</template>
|
||||
</el-popconfirm>
|
||||
</template>
|
||||
<!-- 已校对/待接收:打印 -->
|
||||
<template v-else-if="scope.row.status === '2' || scope.row.status === 2 || scope.row.status === '3' || scope.row.status === 3">
|
||||
<el-button link type="primary" @click="handlePrint(scope.row)">打印</el-button>
|
||||
</template>
|
||||
<!-- 已接收/已检查:打印、看报告 -->
|
||||
<template v-else-if="scope.row.status === '4' || scope.row.status === 4 || scope.row.status === '5' || scope.row.status === 5">
|
||||
<el-button link type="primary" @click="handlePrint(scope.row)">打印</el-button>
|
||||
<el-button link type="primary" @click="handleViewReport(scope.row)">看报告</el-button>
|
||||
</template>
|
||||
<!-- 已出报告:打印、看报告 -->
|
||||
<template v-else-if="scope.row.status === '6' || scope.row.status === 6">
|
||||
<el-button link type="primary" @click="handlePrint(scope.row)">打印</el-button>
|
||||
<el-button link type="success" @click="handleViewReport(scope.row)">看报告</el-button>
|
||||
</template>
|
||||
<!-- 已作废:仅详情 -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -119,7 +163,7 @@
|
||||
currentDetail.patientName || '-'
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="申请单名称">{{
|
||||
currentDetail.name || '-'
|
||||
getItemName(currentDetail)
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="申请单状态">{{
|
||||
parseStatus(currentDetail.status)
|
||||
@@ -169,6 +213,60 @@
|
||||
<el-button @click="detailDialogVisible = false">关闭</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<!-- 修改申请单弹窗 -->
|
||||
<el-dialog
|
||||
v-model="editDialogVisible"
|
||||
title="修改检查申请"
|
||||
width="800px"
|
||||
destroy-on-close
|
||||
top="5vh"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<div v-if="editDetail" class="applicationShow-container">
|
||||
<el-form :model="editForm" label-width="120px">
|
||||
<el-form-item label="申请单名称">
|
||||
<el-input v-model="editForm.name" />
|
||||
</el-form-item>
|
||||
<el-form-item label="临床诊断">
|
||||
<el-input v-model="editForm.clinicalDiagnosis" type="textarea" :rows="2" />
|
||||
</el-form-item>
|
||||
<el-form-item label="注意事项">
|
||||
<el-input v-model="editForm.attention" type="textarea" :rows="2" />
|
||||
</el-form-item>
|
||||
<div v-if="editDetail.requestFormDetailList && editDetail.requestFormDetailList.length">
|
||||
<el-divider>申请项目</el-divider>
|
||||
<el-table :data="editDetail.requestFormDetailList" border size="small">
|
||||
<el-table-column type="index" label="序号" width="60" align="center" />
|
||||
<el-table-column prop="adviceName" label="医嘱名称" />
|
||||
<el-table-column prop="quantity" label="数量" width="80" align="center" />
|
||||
<el-table-column prop="unitCode_dictText" label="单位" width="100" />
|
||||
<el-table-column prop="totalPrice" label="总价" width="100" align="right" />
|
||||
</el-table>
|
||||
</div>
|
||||
</el-form>
|
||||
</div>
|
||||
<template #footer>
|
||||
<el-button @click="editDialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="handleSaveEdit" :loading="saveLoading">保存</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<!-- 报告查看弹窗 -->
|
||||
<el-dialog
|
||||
v-model="reportDialogVisible"
|
||||
title="检查报告"
|
||||
width="900px"
|
||||
destroy-on-close
|
||||
top="5vh"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<div v-if="reportUrl" style="min-height: 500px;">
|
||||
<iframe :src="reportUrl" style="width: 100%; height: 500px; border: none;" />
|
||||
</div>
|
||||
<el-empty v-else description="暂无报告数据" />
|
||||
<template #footer>
|
||||
<el-button @click="reportDialogVisible = false">关闭</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -176,7 +274,7 @@
|
||||
import {computed, getCurrentInstance, ref, watch} from 'vue';
|
||||
import {Refresh, Search} from '@element-plus/icons-vue';
|
||||
import {patientInfo} from '../../store/patient.js';
|
||||
import {getCheck} from './api';
|
||||
import {getCheck, deleteRequestForm, withdrawRequestForm, getTestResult} from './api';
|
||||
import {getOrgList} from '@/views/doctorstation/components/api.js';
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
@@ -188,6 +286,16 @@ const currentDetail = ref(null);
|
||||
const descJsonData = ref(null);
|
||||
const orgOptions = ref([]);
|
||||
|
||||
// 修改申请单相关
|
||||
const editDialogVisible = ref(false);
|
||||
const editDetail = ref(null);
|
||||
const editForm = ref({});
|
||||
const saveLoading = ref(false);
|
||||
|
||||
// 报告查看相关
|
||||
const reportDialogVisible = ref(false);
|
||||
const reportUrl = ref('');
|
||||
|
||||
// 筛选表单数据
|
||||
const getDefaultDateRange = () => {
|
||||
const now = new Date();
|
||||
@@ -295,6 +403,28 @@ const parseStatus = (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 = {
|
||||
categoryType: '项目类别',
|
||||
targetDepartment: '发往科室',
|
||||
@@ -327,20 +457,27 @@ const getLocationInfo = () => {
|
||||
};
|
||||
|
||||
const recursionFun = (targetDepartment) => {
|
||||
if (!targetDepartment) return '';
|
||||
if (!Array.isArray(orgOptions.value) || orgOptions.value.length === 0) return '';
|
||||
let name = '';
|
||||
for (let index = 0; index < orgOptions.value.length; index++) {
|
||||
const obj = orgOptions.value[index];
|
||||
if (obj.id == targetDepartment) {
|
||||
name = obj.name;
|
||||
break;
|
||||
}
|
||||
const subObjArray = obj['children'];
|
||||
for (let index = 0; index < subObjArray.length; index++) {
|
||||
const item = subObjArray[index];
|
||||
if (Array.isArray(subObjArray)) {
|
||||
for (let i = 0; i < subObjArray.length; i++) {
|
||||
const item = subObjArray[i];
|
||||
if (item.id == targetDepartment) {
|
||||
name = item.name;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (name) break;
|
||||
}
|
||||
return name;
|
||||
};
|
||||
|
||||
@@ -352,7 +489,10 @@ const handleViewDetail = (row) => {
|
||||
if (row.descJson) {
|
||||
try {
|
||||
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;
|
||||
} catch (e) {
|
||||
console.error('解析 descJson 失败:', e);
|
||||
@@ -364,6 +504,217 @@ const handleViewDetail = (row) => {
|
||||
detailDialogVisible.value = true;
|
||||
};
|
||||
|
||||
/**
|
||||
* 修改申请单
|
||||
*/
|
||||
const handleEdit = (row) => {
|
||||
editDetail.value = row;
|
||||
// 解析 descJson 为表单数据
|
||||
const form = { name: row.name || '' };
|
||||
if (row.descJson) {
|
||||
try {
|
||||
const desc = JSON.parse(row.descJson);
|
||||
form.clinicalDiagnosis = desc.clinicalDiagnosis || '';
|
||||
form.attention = desc.attention || '';
|
||||
form.symptom = desc.symptom || '';
|
||||
form.sign = desc.sign || '';
|
||||
} catch (e) {
|
||||
console.error('解析 descJson 失败:', e);
|
||||
}
|
||||
}
|
||||
editForm.value = form;
|
||||
editDialogVisible.value = true;
|
||||
};
|
||||
|
||||
/**
|
||||
* 保存修改
|
||||
*/
|
||||
const handleSaveEdit = async () => {
|
||||
if (!editDetail.value?.requestFormId) {
|
||||
proxy.$modal?.msgWarning?.('申请单ID不存在');
|
||||
return;
|
||||
}
|
||||
saveLoading.value = true;
|
||||
try {
|
||||
// 复用 save-check 接口进行更新(传入 requestFormId 即为编辑场景)
|
||||
const res = await proxy.$http?.post?.('/reg-doctorstation/request-form/save-check', {
|
||||
requestFormId: editDetail.value.requestFormId,
|
||||
encounterId: editDetail.value.encounterId,
|
||||
patientId: editDetail.value.patientId,
|
||||
name: editForm.value.name,
|
||||
organizationId: editDetail.value.inHospitalOrgId || patientInfo.value?.inHospitalOrgId,
|
||||
descJson: JSON.stringify({
|
||||
clinicalDiagnosis: editForm.value.clinicalDiagnosis,
|
||||
attention: editForm.value.attention,
|
||||
symptom: editForm.value.symptom,
|
||||
sign: editForm.value.sign,
|
||||
}),
|
||||
activityList: [], // 修改场景仅更新描述信息,不修改项目
|
||||
});
|
||||
if (res?.code === 200) {
|
||||
proxy.$modal?.msgSuccess?.('修改成功');
|
||||
editDialogVisible.value = false;
|
||||
await fetchData();
|
||||
} else {
|
||||
proxy.$modal?.msgError?.(res?.msg || '修改失败');
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn('修改申请单失败:', e.message);
|
||||
proxy.$modal?.msgError?.('修改失败: ' + (e.message || '网络异常'));
|
||||
} finally {
|
||||
saveLoading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 删除申请单(仅待签发状态可删除)
|
||||
*/
|
||||
const handleDelete = async (row) => {
|
||||
if (!row.requestFormId) {
|
||||
proxy.$modal?.msgWarning?.('申请单ID不存在');
|
||||
return;
|
||||
}
|
||||
try {
|
||||
const res = await deleteRequestForm({ requestFormId: row.requestFormId });
|
||||
if (res?.code === 200) {
|
||||
proxy.$modal?.msgSuccess?.('删除成功');
|
||||
await fetchData();
|
||||
} else {
|
||||
proxy.$modal?.msgError?.(res?.msg || '删除失败');
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn('删除申请单失败:', e.message);
|
||||
proxy.$modal?.msgError?.('删除失败: ' + (e.message || '网络异常'));
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 撤回申请单(已签发状态撤回至待签发)
|
||||
*/
|
||||
const handleWithdraw = async (row) => {
|
||||
if (!row.requestFormId) {
|
||||
proxy.$modal?.msgWarning?.('申请单ID不存在');
|
||||
return;
|
||||
}
|
||||
try {
|
||||
const res = await withdrawRequestForm({ requestFormId: row.requestFormId });
|
||||
if (res?.code === 200) {
|
||||
proxy.$modal?.msgSuccess?.('撤回成功');
|
||||
await fetchData();
|
||||
} else {
|
||||
proxy.$modal?.msgError?.(res?.msg || '撤回失败');
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn('撤回申请单失败:', e.message);
|
||||
proxy.$modal?.msgError?.('撤回失败: ' + (e.message || '网络异常'));
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 打印申请单
|
||||
*/
|
||||
const handlePrint = (row) => {
|
||||
// 打开新窗口进行打印
|
||||
const printWindow = window.open('', '_blank');
|
||||
if (!printWindow) {
|
||||
proxy.$modal?.msgWarning?.('请允许浏览器弹出窗口以进行打印');
|
||||
return;
|
||||
}
|
||||
const content = buildPrintContent(row);
|
||||
printWindow.document.write(`
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>检查申请单打印</title>
|
||||
<style>
|
||||
body { font-family: "Microsoft YaHei", sans-serif; padding: 20px; font-size: 14px; }
|
||||
h2 { text-align: center; margin-bottom: 20px; }
|
||||
table { width: 100%; border-collapse: collapse; margin-top: 10px; }
|
||||
th, td { border: 1px solid #ddd; padding: 8px; text-align: left; }
|
||||
th { background: #f5f5f5; }
|
||||
.info-row { margin: 8px 0; }
|
||||
.label { font-weight: bold; display: inline-block; width: 100px; }
|
||||
@media print { .no-print { display: none; } }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
${content}
|
||||
<div class="no-print" style="text-align: center; margin-top: 20px;">
|
||||
<button onclick="window.print()">打印</button>
|
||||
<button onclick="window.close()">关闭</button>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
`);
|
||||
printWindow.document.close();
|
||||
};
|
||||
|
||||
/**
|
||||
* 构建打印内容
|
||||
*/
|
||||
const buildPrintContent = (row) => {
|
||||
let descHtml = '';
|
||||
if (row.descJson) {
|
||||
try {
|
||||
const desc = JSON.parse(row.descJson);
|
||||
descHtml = Object.entries(labelMap)
|
||||
.filter(([key]) => desc[key])
|
||||
.map(([key, label]) => `<div class="info-row"><span class="label">${label}:</span>${desc[key]}</div>`)
|
||||
.join('');
|
||||
} catch (e) {
|
||||
console.error('解析 descJson 失败:', e);
|
||||
}
|
||||
}
|
||||
let itemsHtml = '';
|
||||
if (row.requestFormDetailList && row.requestFormDetailList.length) {
|
||||
itemsHtml = `
|
||||
<h3>申请项目</h3>
|
||||
<table>
|
||||
<tr><th>序号</th><th>医嘱名称</th><th>数量</th><th>单位</th><th>总价</th></tr>
|
||||
${row.requestFormDetailList.map((item, i) => `
|
||||
<tr>
|
||||
<td>${i + 1}</td>
|
||||
<td>${item.adviceName || '-'}</td>
|
||||
<td>${item.quantity || '-'}</td>
|
||||
<td>${item.unitCode_dictText || '-'}</td>
|
||||
<td>${item.totalPrice || '-'}</td>
|
||||
</tr>
|
||||
`).join('')}
|
||||
</table>
|
||||
`;
|
||||
}
|
||||
return `
|
||||
<h2>检查申请单</h2>
|
||||
<div class="info-row"><span class="label">患者姓名:</span>${row.patientName || '-'}</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.prescriptionNo || '-'}</div>
|
||||
<div class="info-row"><span class="label">申请者:</span>${row.requesterId_dictText || '-'}</div>
|
||||
<div class="info-row"><span class="label">申请单状态:</span>${parseStatus(row.status)}</div>
|
||||
${descHtml ? `<h3>申请单描述</h3>${descHtml}` : ''}
|
||||
${itemsHtml}
|
||||
`;
|
||||
};
|
||||
|
||||
/**
|
||||
* 查看报告
|
||||
*/
|
||||
const handleViewReport = async (row) => {
|
||||
reportUrl.value = '';
|
||||
reportDialogVisible.value = true;
|
||||
try {
|
||||
const res = await getTestResult({ encounterId: row.encounterId, requestFormId: row.requestFormId });
|
||||
if (res?.code === 200 && res?.data) {
|
||||
reportUrl.value = res.data;
|
||||
} else {
|
||||
console.warn('获取检查报告失败:', res?.msg || '无数据');
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn('获取检查报告异常:', e.message);
|
||||
}
|
||||
};
|
||||
|
||||
watch(
|
||||
() => patientInfo.value?.encounterId,
|
||||
(val) => {
|
||||
|
||||
@@ -173,7 +173,7 @@ import {computed, getCurrentInstance, ref, watch} from 'vue';
|
||||
import {Refresh, Search} from '@element-plus/icons-vue';
|
||||
import {patientInfo} from '../../store/patient.js';
|
||||
import {getInspection} from './api';
|
||||
import {getOrgList} from '@/views/doctorstation/components/api.js';
|
||||
import {getDepartmentList} from '@/api/public.js';
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
|
||||
@@ -332,8 +332,8 @@ const hasMatchedFields = computed(() => {
|
||||
|
||||
/** 查询科室 */
|
||||
const getLocationInfo = () => {
|
||||
getOrgList().then((res) => {
|
||||
orgOptions.value = res.data.records;
|
||||
getDepartmentList().then((res) => {
|
||||
orgOptions.value = res.data || [];
|
||||
});
|
||||
};
|
||||
|
||||
@@ -345,13 +345,15 @@ const recursionFun = (targetDepartment) => {
|
||||
name = obj.name;
|
||||
}
|
||||
const subObjArray = obj['children'];
|
||||
for (let index = 0; index < subObjArray.length; index++) {
|
||||
const item = subObjArray[index];
|
||||
if (subObjArray && subObjArray.length > 0) {
|
||||
for (let i = 0; i < subObjArray.length; i++) {
|
||||
const item = subObjArray[i];
|
||||
if (item.id == targetDepartment) {
|
||||
name = item.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return name;
|
||||
};
|
||||
|
||||
|
||||
@@ -122,7 +122,6 @@
|
||||
|
||||
<el-table-column label="类型" align="center" prop="" width="120">
|
||||
<template #default="scope">
|
||||
{{ console.log(scope.row, 1111) }}
|
||||
<el-radio-group
|
||||
v-model="scope.row.therapyEnum"
|
||||
size="small"
|
||||
@@ -270,7 +269,6 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="频次/用法" align="center" prop="" width="180">
|
||||
<template #default="scope">
|
||||
{{ console.log(scope.row) }}
|
||||
<span v-if="!scope.row.isEdit && scope.row.adviceType == 1" style="text-align: right">
|
||||
{{
|
||||
[
|
||||
@@ -879,14 +877,12 @@ function handleDiagnosisChange(item) {
|
||||
function handleFocus(row, index) {
|
||||
rowIndex.value = index;
|
||||
row.showPopover = true;
|
||||
// el-popover 懒渲染,需要等两帧组件才会挂载
|
||||
const adviceType = row.adviceType !== undefined ? row.adviceType : adviceQueryParams.value.adviceType;
|
||||
// 用 adviceType + categoryCode 组合查找匹配的选项
|
||||
const selectValue = (adviceType == 1 && row.categoryCode) ? '1-' + row.categoryCode : adviceType;
|
||||
const selectedItem = adviceTypeList.value.find(item => item.value === selectValue) || adviceTypeList.value.find(item => item.adviceType === adviceType);
|
||||
// 诊疗(3)和手术(6)没有categoryCode,传空字符串给refresh,由子组件转为undefined不发送
|
||||
// 药品(1)才有categoryCode(如'1'=中成药,'2'=西药,'4'=中草药)
|
||||
const categoryCode = selectedItem ? selectedItem.categoryCode : (adviceQueryParams.value.categoryCode || '');
|
||||
// 修复Bug #486:当行没有显式选择医嘱类型时,不传categoryCode,让搜索在全药库中进行
|
||||
const categoryCode = selectedItem ? selectedItem.categoryCode : (row.adviceType !== undefined ? (adviceQueryParams.value.categoryCode || '') : '');
|
||||
const searchKey = row.adviceName || '';
|
||||
|
||||
nextTick(() => {
|
||||
@@ -923,8 +919,8 @@ function handleChange(value) {
|
||||
// 用 adviceType + categoryCode 组合查找匹配的选项
|
||||
const selectValue = (adviceType == 1 && row?.categoryCode) ? '1-' + row.categoryCode : adviceType;
|
||||
const selectedItem = adviceTypeList.value.find(item => item.value === selectValue) || adviceTypeList.value.find(item => item.adviceType === adviceType);
|
||||
// 诊疗/手术的categoryCode为空字符串,由子组件转为undefined不发送
|
||||
const categoryCode = selectedItem ? selectedItem.categoryCode : (adviceQueryParams.value.categoryCode || '');
|
||||
// 修复Bug #486:当行没有显式选择医嘱类型时,不传categoryCode,让搜索在全药库中进行
|
||||
const categoryCode = selectedItem ? selectedItem.categoryCode : (row?.adviceType !== undefined ? (adviceQueryParams.value.categoryCode || '') : '');
|
||||
tableRef.refresh(adviceType, categoryCode, value);
|
||||
}
|
||||
}
|
||||
@@ -1214,12 +1210,8 @@ function handleSave() {
|
||||
getListInfo(false);
|
||||
bindMethod.value = {};
|
||||
nextId.value == 1;
|
||||
|
||||
// 处方保存成功后,自动将医嘱信息同步至患者处置记录
|
||||
// handleEmrTreatment();
|
||||
} else {
|
||||
proxy.$modal.msgError(res.message);
|
||||
conso;
|
||||
isSaving.value = false;
|
||||
}
|
||||
})
|
||||
@@ -1319,6 +1311,9 @@ function handleCancelEdit(row, index) {
|
||||
function handleSaveSign(row, index) {
|
||||
if (row.adviceType != 2) {
|
||||
let itemNo = row.adviceType == 1 ? row.methodCode : row.adviceDefinitionId;
|
||||
if (!itemNo) {
|
||||
console.warn('绑定设备检查跳过:itemNo为空(adviceType=' + row.adviceType + ', adviceName=' + row.adviceName + ')');
|
||||
} else {
|
||||
getBindDevice({ typeCode: row.adviceType, itemNo: itemNo }).then((res) => {
|
||||
if (res.data.length == 0) {
|
||||
return;
|
||||
@@ -1336,6 +1331,7 @@ function handleSaveSign(row, index) {
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// 更新UI状态
|
||||
row.isEdit = false;
|
||||
|
||||
@@ -17,13 +17,11 @@
|
||||
</el-tab-pane>
|
||||
<!-- <el-tab-pane label="医技报告" name="fourth">Task</el-tab-pane> -->
|
||||
<el-tab-pane label="检验申请" name="test">
|
||||
<TestApplication ref="testApplicationRef" :show-status-column="true" />
|
||||
<TestApplication ref="testApplicationRef" :show-status-column="false" />
|
||||
</el-tab-pane>
|
||||
```vue
|
||||
<el-tab-pane label="检查申请" name="examine">
|
||||
<ExamineApplication ref="examineApplicationRef" />
|
||||
</el-tab-pane>
|
||||
```
|
||||
<el-tab-pane label="汇总发药申请" name="summaryDrug">
|
||||
<SummaryDrugApplication ref="summaryDrugApplicationRef" />
|
||||
</el-tab-pane>
|
||||
@@ -48,6 +46,10 @@
|
||||
<script setup>
|
||||
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 inPatientBarDoctorFold from '@/components/patientBar/inPatientBarDoctorFold.vue';
|
||||
import PatientList from '@/components/PatientList/patient-list.vue';
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
</template>
|
||||
</el-input>
|
||||
</div>
|
||||
<el-button type="primary">划价组套</el-button>
|
||||
<el-button type="primary" @click="openGroupSetDialog">划价组套</el-button>
|
||||
</div>
|
||||
<!-- 弹窗内容 - 左右布局 -->
|
||||
<div style="display: flex; gap: 20px; height: 70vh">
|
||||
@@ -147,6 +147,7 @@
|
||||
<el-select
|
||||
v-model="scope.row.selectUnitCode"
|
||||
placeholder="单位"
|
||||
filterable
|
||||
style="width: 100px"
|
||||
@change="unitCodeChange(scope.row)"
|
||||
>
|
||||
@@ -171,12 +172,13 @@
|
||||
v-if="scope.row.adviceType == 3"
|
||||
clearable
|
||||
filterable
|
||||
:filter-method="(val) => filterOptions(val, scope.row, 'departmentOptions')"
|
||||
v-model="scope.row.positionId"
|
||||
placeholder="选择科室"
|
||||
style="width: 220px"
|
||||
>
|
||||
<el-option
|
||||
v-for="dept in departmentOptions"
|
||||
v-for="dept in getFilteredOptions(scope.row, 'departmentOptions')"
|
||||
:key="dept.id"
|
||||
:label="dept.name"
|
||||
:value="dept.id"
|
||||
@@ -186,12 +188,13 @@
|
||||
v-if="scope.row.adviceType == 2"
|
||||
clearable
|
||||
filterable
|
||||
:filter-method="(val) => filterOptions(val, scope.row, 'locationOptions')"
|
||||
v-model="scope.row.positionId"
|
||||
placeholder="选择药房/耗材房"
|
||||
style="width: 220px"
|
||||
>
|
||||
<el-option
|
||||
v-for="dept in locationOptions"
|
||||
v-for="dept in getFilteredOptions(scope.row, 'locationOptions')"
|
||||
:key="dept.value"
|
||||
:label="dept.label"
|
||||
:value="dept.value"
|
||||
@@ -247,6 +250,49 @@
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!-- 划价组套选择对话框 -->
|
||||
<el-dialog v-model="groupSetDialogVisible" title="划价组套选择" width="600px" :close-on-click-modal="false" append-to-body>
|
||||
<div style="margin-bottom: 15px; display: flex; align-items: center; gap: 10px">
|
||||
<el-input
|
||||
v-model="groupSetSearchText"
|
||||
placeholder="请输入组套名称搜索"
|
||||
clearable
|
||||
style="width: 250px"
|
||||
@keyup.enter="loadGroupSets"
|
||||
>
|
||||
<template #append>
|
||||
<el-button icon="Search" @click="loadGroupSets" />
|
||||
</template>
|
||||
</el-input>
|
||||
<el-radio-group v-model="groupSetRange" @change="loadGroupSets">
|
||||
<el-radio-button :label="1">个人</el-radio-button>
|
||||
<el-radio-button :label="2">科室</el-radio-button>
|
||||
<el-radio-button :label="3">全院</el-radio-button>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
<el-table
|
||||
:data="groupSetList"
|
||||
v-loading="groupSetLoading"
|
||||
highlight-current-row
|
||||
border
|
||||
stripe
|
||||
@current-change="handleGroupSetSelect"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-table-column type="index" label="序号" width="60" align="center" />
|
||||
<el-table-column label="组套名称" prop="name" min-width="180" show-overflow-tooltip />
|
||||
<el-table-column label="使用范围" prop="rangeCode_dictText" width="100" align="center" />
|
||||
<el-table-column label="明细数量" width="100" align="center">
|
||||
<template #default="scope">
|
||||
{{ scope.row.detailList?.length || 0 }} 项
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div style="margin-top: 15px; text-align: right">
|
||||
<el-button @click="groupSetDialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="applyGroupSet" :disabled="!selectedGroupSet">应用</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
@@ -254,6 +300,7 @@ import {computed, getCurrentInstance, onMounted, reactive, ref, watch} from 'vue
|
||||
import {ElMessage} from 'element-plus';
|
||||
import {formatDateStr} from '@/utils/index';
|
||||
import {getAdviceBaseInfo, getDiseaseTreatmentInitLoc, getOrgList} from './api.js';
|
||||
import {getOrderGroup} from '@/views/doctorstation/components/api.js';
|
||||
import useUserStore from '@/store/modules/user';
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
@@ -312,6 +359,8 @@ const locationOptions = ref([]);
|
||||
const searchText = ref('');
|
||||
const userId = ref('');
|
||||
const orgId = ref('');
|
||||
// 下拉框模糊搜索关键字(按行存储)
|
||||
const filterKeywords = ref({});
|
||||
const queryParams = ref({
|
||||
pageSize: 100,
|
||||
pageNum: 1,
|
||||
@@ -389,6 +438,14 @@ const submitData = reactive({
|
||||
});
|
||||
const adviceLoading = ref(false);
|
||||
|
||||
// 划价组套相关
|
||||
const groupSetDialogVisible = ref(false);
|
||||
const groupSetList = ref([]);
|
||||
const groupSetLoading = ref(false);
|
||||
const groupSetSearchText = ref('');
|
||||
const groupSetRange = ref(2);
|
||||
const selectedGroupSet = ref(null);
|
||||
|
||||
// 【优化核心】计算总金额 - 使用计算属性实现实时更新
|
||||
const totalAmount = computed(() => {
|
||||
return feeItemsList.value.reduce((sum, item) => {
|
||||
@@ -452,6 +509,25 @@ function getDiseaseInitLoc() {
|
||||
locationOptions.value = response.data.locationOptions;
|
||||
});
|
||||
}
|
||||
// 下拉框模糊搜索过滤
|
||||
function filterOptions(val, row, optionsKey) {
|
||||
const key = row.adviceDefinitionId + '_' + optionsKey;
|
||||
filterKeywords.value[key] = val;
|
||||
}
|
||||
function getFilteredOptions(row, optionsKey) {
|
||||
const key = row.adviceDefinitionId + '_' + optionsKey;
|
||||
const keyword = filterKeywords.value[key];
|
||||
const options = optionsKey === 'departmentOptions' ? departmentOptions.value : locationOptions.value;
|
||||
if (!keyword || keyword.trim() === '') {
|
||||
return options;
|
||||
}
|
||||
const lower = keyword.toLowerCase();
|
||||
return options.filter(item => {
|
||||
const name = (item.name || item.label || '').toLowerCase();
|
||||
const id = String(item.id || item.value || '').toLowerCase();
|
||||
return name.includes(lower) || id.includes(lower);
|
||||
});
|
||||
}
|
||||
// 获取组套类型文本
|
||||
function getItemType_Text(type) {
|
||||
const map = { 2: '耗材', 3: '诊疗' };
|
||||
@@ -527,14 +603,24 @@ function selectChange(row) {
|
||||
const price = row.priceList?.[0]?.price || 0;
|
||||
//获取大小单位
|
||||
const uniqueUnitCodes = getUnitCodeOptions(row);
|
||||
// 设置默认执行科室/位置
|
||||
let defaultPositionId = undefined;
|
||||
if (row.adviceType === 3 && departmentOptions.value.length > 0) {
|
||||
// 诊疗:优先使用患者所在科室,否则取第一个科室
|
||||
defaultPositionId = departmentOptions.value.find(d => d.id === props.patientInfo.organizationId)?.id
|
||||
|| departmentOptions.value[0]?.id;
|
||||
} else if (row.adviceType === 2 && locationOptions.value.length > 0) {
|
||||
// 耗材:默认取第一个药房/耗材房
|
||||
defaultPositionId = locationOptions.value[0]?.value;
|
||||
}
|
||||
//插入费用列表
|
||||
feeItemsList.value.push({
|
||||
...row,
|
||||
uniqueUnitCodes: uniqueUnitCodes,
|
||||
unitPrice: (price / (row.partPercent || 1)).toFixed(6), // 根据拆零比计算单价
|
||||
quantity: 1,
|
||||
// positionId: row.positionId === null || row.positionId === undefined ? orgId : row.positionId, // 默认执行科室
|
||||
selectUnitCode: row.minUnitCode, // 默认选择小单位
|
||||
positionId: defaultPositionId, // 默认执行科室/位置
|
||||
selectUnitCode: String(row.minUnitCode || ''), // 默认选择小单位,确保字符串类型
|
||||
});
|
||||
}
|
||||
|
||||
@@ -648,6 +734,94 @@ function resetData() {
|
||||
searchText.value = '';
|
||||
executeTime.value = '';
|
||||
}
|
||||
|
||||
// 划价组套相关功能
|
||||
function openGroupSetDialog() {
|
||||
groupSetDialogVisible.value = true;
|
||||
groupSetSearchText.value = '';
|
||||
selectedGroupSet.value = null;
|
||||
loadGroupSets();
|
||||
}
|
||||
|
||||
function loadGroupSets() {
|
||||
groupSetLoading.value = true;
|
||||
getOrderGroup({ organizationId: orgId.value, searchKey: groupSetSearchText.value })
|
||||
.then((res) => {
|
||||
const data = res?.data || {};
|
||||
if (groupSetRange.value === 1) {
|
||||
groupSetList.value = data.personalList || [];
|
||||
} else if (groupSetRange.value === 2) {
|
||||
groupSetList.value = data.organizationList || [];
|
||||
} else {
|
||||
groupSetList.value = data.hospitalList || [];
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
console.warn('组套列表加载失败(可能无权限)');
|
||||
groupSetList.value = [];
|
||||
})
|
||||
.finally(() => {
|
||||
groupSetLoading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
function handleGroupSetSelect(row) {
|
||||
selectedGroupSet.value = row;
|
||||
}
|
||||
|
||||
function applyGroupSet() {
|
||||
if (!selectedGroupSet.value) {
|
||||
ElMessage.warning('请先选择一个组套');
|
||||
return;
|
||||
}
|
||||
const detailList = selectedGroupSet.value.detailList;
|
||||
if (!detailList || detailList.length === 0) {
|
||||
ElMessage.warning('该组套没有明细项');
|
||||
return;
|
||||
}
|
||||
let successCount = 0;
|
||||
detailList.forEach((item) => {
|
||||
const orderDetail = item.orderDetailInfos || {};
|
||||
const feeItem = {
|
||||
adviceDefinitionId: item.orderDefinitionId || orderDetail.adviceDefinitionId,
|
||||
adviceName: orderDetail.adviceName || item.orderDefinitionName || '未知项目',
|
||||
adviceType: orderDetail.adviceType,
|
||||
unitPrice: orderDetail.unitPrice,
|
||||
minUnitPrice: orderDetail.minUnitPrice,
|
||||
inventoryList: orderDetail.inventoryList || [],
|
||||
priceList: orderDetail.priceList || [],
|
||||
partPercent: orderDetail.partPercent || 1,
|
||||
positionId: item.positionId || orderDetail.positionId,
|
||||
defaultLotNumber: orderDetail.defaultLotNumber,
|
||||
unitCode: item.unitCode || orderDetail.unitCode,
|
||||
unitCode_dictText: item.unitCodeName || orderDetail.unitCode_dictText,
|
||||
minUnitCode: orderDetail.minUnitCode,
|
||||
doseUnitCode: orderDetail.doseUnitCode,
|
||||
categoryCode: orderDetail.categoryCode,
|
||||
pharmacologyCategoryCode: orderDetail.pharmacologyCategoryCode,
|
||||
partAttributeEnum: orderDetail.partAttributeEnum,
|
||||
chargeItemDefinitionId: orderDetail.chargeItemDefinitionId,
|
||||
adviceTableName: orderDetail.adviceTableName,
|
||||
methodCode: item.methodCode || orderDetail.methodCode,
|
||||
rateCode: item.rateCode || orderDetail.rateCode,
|
||||
dose: item.dose || orderDetail.dose,
|
||||
doseQuantity: item.doseQuantity,
|
||||
dispensePerDuration: item.dispensePerDuration || orderDetail.dispensePerDuration,
|
||||
dosageInstruction: orderDetail.dosageInstruction,
|
||||
skinTestFlag: orderDetail.skinTestFlag,
|
||||
injectFlag: orderDetail.injectFlag,
|
||||
quantity: item.quantity || 1,
|
||||
chrgitmLv_dictText: orderDetail.chrgitmLv_dictText,
|
||||
volume: orderDetail.volume,
|
||||
};
|
||||
selectChange(feeItem);
|
||||
successCount++;
|
||||
});
|
||||
if (successCount > 0) {
|
||||
ElMessage.success(`已添加 ${successCount} 项组套费用`);
|
||||
}
|
||||
groupSetDialogVisible.value = false;
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
@@ -273,8 +273,9 @@ function handleSearch() {
|
||||
// 清除缓存(搜索时需要重新加载)
|
||||
patientDataCache.value.clear();
|
||||
|
||||
// 重新加载所有已展开病区的患者列表
|
||||
reloadAllPatients();
|
||||
// 通过递增 key 强制重新渲染树组件,触发重新加载所有病区患者列表
|
||||
// 此时 searchKey 已有值,loadPatientList 会将 searchKey 传给后端进行过滤
|
||||
treeKey.value += 1;
|
||||
}
|
||||
|
||||
// 暴露方法供外部调用
|
||||
|
||||
@@ -67,6 +67,7 @@
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
style="padding: 10px; background-color: #eef9fd; height: 100%; overflow-y: auto"
|
||||
v-loading="loading"
|
||||
@@ -229,7 +230,7 @@ import {adviceCancel, adviceExecute, adviceNoExecute, getPrescriptionList} from
|
||||
import {patientInfoList} from '../../components/store/patient.js';
|
||||
import {lotNumberMatch} from '@/api/public';
|
||||
import {formatDateStr} from '@/utils/index';
|
||||
import {getCurrentInstance, nextTick, ref} from 'vue';
|
||||
import {getCurrentInstance, nextTick, ref, provide} from 'vue';
|
||||
|
||||
const activeNames = ref([]);
|
||||
const prescriptionList = ref([]);
|
||||
@@ -239,6 +240,8 @@ const therapyEnum = ref(undefined);
|
||||
const { proxy } = getCurrentInstance();
|
||||
const loading = ref(false);
|
||||
const chooseAll = ref(false);
|
||||
// 独立维护选中行ID集合,避免el-table内部selection状态异常导致联动全选
|
||||
const selectedRowIds = ref(new Set());
|
||||
const props = defineProps({
|
||||
exeStatus: {
|
||||
type: Number,
|
||||
@@ -280,9 +283,10 @@ function handleGetPrescription() {
|
||||
exeStatus: props.exeStatus,
|
||||
requestStatus: props.requestStatus,
|
||||
}).then((res) => {
|
||||
// try {
|
||||
try {
|
||||
const records = res?.data?.records || [];
|
||||
// 根据encounterId分组
|
||||
const groupedPrescriptions = res.data.records.reduce((groups, prescription) => {
|
||||
const groupedPrescriptions = records.reduce((groups, prescription) => {
|
||||
// 获取当前医嘱全部执行频次
|
||||
let rate;
|
||||
let times;
|
||||
@@ -427,18 +431,26 @@ function handleGetPrescription() {
|
||||
|
||||
// 将分组结果转换为数组形式
|
||||
prescriptionList.value = Object.values(groupedPrescriptions);
|
||||
loading.value = false;
|
||||
// 默认选中全部行
|
||||
nextTick(() => {
|
||||
defaultSelectAllRows();
|
||||
});
|
||||
// } catch {
|
||||
// loading.value = false;
|
||||
// }
|
||||
} catch (error) {
|
||||
console.error('医嘱执行-获取处方列表数据处理失败:', error);
|
||||
prescriptionList.value = [];
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
}).catch((error) => {
|
||||
console.error('医嘱执行-获取处方列表接口失败:', error);
|
||||
prescriptionList.value = [];
|
||||
loading.value = false;
|
||||
});
|
||||
chooseAll.value = false;
|
||||
} else {
|
||||
prescriptionList.value = [];
|
||||
selectedRowIds.value.clear();
|
||||
loading.value = false;
|
||||
// proxy.$message.warning('请选择患者');
|
||||
}
|
||||
}
|
||||
@@ -497,8 +509,15 @@ function handleCancel() {
|
||||
let list = getSelectRows();
|
||||
let producerIds = [];
|
||||
list.forEach((item) => {
|
||||
// 从 exePerformRecordList 直接提取 procedureId,确保取消执行时数据完整
|
||||
const procedureIds = (item.exePerformRecordList || []).map((record) => record.procedureId);
|
||||
if (procedureIds.length === 0 && (!item.procedureIds || item.procedureIds.length === 0)) {
|
||||
proxy.$modal.msgError('请选择已执行的医嘱记录');
|
||||
return;
|
||||
}
|
||||
const ids = procedureIds.length > 0 ? procedureIds : item.procedureIds;
|
||||
producerIds.push(
|
||||
...item.procedureIds.map((value) => {
|
||||
...ids.map((value) => {
|
||||
return {
|
||||
procedureId: value,
|
||||
therapyEnum: item.therapyEnum,
|
||||
@@ -506,6 +525,9 @@ function handleCancel() {
|
||||
})
|
||||
);
|
||||
});
|
||||
if (producerIds.length === 0) {
|
||||
return;
|
||||
}
|
||||
adviceCancel({ adviceExecuteDetailList: producerIds }).then((res) => {
|
||||
if (res.code == 200) {
|
||||
proxy.$modal.msgSuccess(res.msg || '取消执行成功');
|
||||
@@ -517,10 +539,14 @@ function handleCancel() {
|
||||
}
|
||||
|
||||
function getSelectRows() {
|
||||
// 获取选中的医嘱信息
|
||||
let list = [];
|
||||
prescriptionList.value.forEach((item, index) => {
|
||||
list = [...list, ...proxy.$refs['tableRef' + index][0].getSelectionRows()];
|
||||
// 优先从独立维护的selectedRowIds集合中获取选中行,避免el-table内部selection状态异常
|
||||
const list = [];
|
||||
prescriptionList.value.forEach((item) => {
|
||||
item.forEach((row) => {
|
||||
if (selectedRowIds.value.has(row.requestId)) {
|
||||
list.push(row);
|
||||
}
|
||||
});
|
||||
});
|
||||
return list;
|
||||
}
|
||||
@@ -596,12 +622,14 @@ function handelSwicthChange(value) {
|
||||
if (value) {
|
||||
// 全选:选中所有行并联动checkbox
|
||||
item.forEach((row) => {
|
||||
selectedRowIds.value.add(row.requestId);
|
||||
tableRef[0].toggleRowSelection(row, true);
|
||||
selectAllCheckboxesInRow(row);
|
||||
});
|
||||
} else {
|
||||
// 取消全选:取消选中所有行并联动checkbox
|
||||
item.forEach((row) => {
|
||||
selectedRowIds.value.delete(row.requestId);
|
||||
tableRef[0].toggleRowSelection(row, false);
|
||||
unselectAllCheckboxesInRow(row);
|
||||
});
|
||||
@@ -612,11 +640,14 @@ function handelSwicthChange(value) {
|
||||
|
||||
// 默认选中全部行
|
||||
function defaultSelectAllRows() {
|
||||
// 清空并重建选中集合
|
||||
selectedRowIds.value.clear();
|
||||
prescriptionList.value.forEach((item, index) => {
|
||||
const tableRef = proxy.$refs['tableRef' + index];
|
||||
if (tableRef && tableRef[0]) {
|
||||
// 选中该表格的所有行
|
||||
item.forEach((row) => {
|
||||
selectedRowIds.value.add(row.requestId);
|
||||
tableRef[0].toggleRowSelection(row, true);
|
||||
// 同时选中该行内部的所有checkbox
|
||||
selectAllCheckboxesInRow(row);
|
||||
@@ -696,13 +727,14 @@ function checkAndToggleRowSelection(row) {
|
||||
const tableRef = proxy.$refs['tableRef' + tableIndex];
|
||||
if (tableRef && tableRef[0]) {
|
||||
const isAllSelected = isAllCheckboxesSelected(row);
|
||||
const selectedRows = tableRef[0].getSelectionRows();
|
||||
const isCurrentlySelected = selectedRows.some((r) => r.requestId === row.requestId);
|
||||
const isCurrentlySelected = selectedRowIds.value.has(row.requestId);
|
||||
|
||||
// 根据checkbox状态更新表格行选中状态
|
||||
if (isAllSelected && !isCurrentlySelected) {
|
||||
selectedRowIds.value.add(row.requestId);
|
||||
tableRef[0].toggleRowSelection(row, true);
|
||||
} else if (!isAllSelected && isCurrentlySelected) {
|
||||
selectedRowIds.value.delete(row.requestId);
|
||||
tableRef[0].toggleRowSelection(row, false);
|
||||
}
|
||||
}
|
||||
@@ -715,9 +747,11 @@ function handleRowSelect(selection, row, tableIndex) {
|
||||
const isSelected = selection.some((item) => item.requestId === row.requestId);
|
||||
|
||||
if (isSelected) {
|
||||
selectedRowIds.value.add(row.requestId);
|
||||
// 选中行时,选中该行内部的所有checkbox
|
||||
selectAllCheckboxesInRow(row);
|
||||
} else {
|
||||
selectedRowIds.value.delete(row.requestId);
|
||||
// 取消选中行时,取消选中该行内部的所有checkbox
|
||||
unselectAllCheckboxesInRow(row);
|
||||
}
|
||||
@@ -734,11 +768,13 @@ function handleSelectAll(selection, tableIndex) {
|
||||
if (selection.length > 0) {
|
||||
// 全选时,选中所有行内部的所有checkbox
|
||||
tableData.forEach((row) => {
|
||||
selectedRowIds.value.add(row.requestId);
|
||||
selectAllCheckboxesInRow(row);
|
||||
});
|
||||
} else {
|
||||
// 取消全选时,取消选中所有行内部的所有checkbox
|
||||
tableData.forEach((row) => {
|
||||
selectedRowIds.value.delete(row.requestId);
|
||||
unselectAllCheckboxesInRow(row);
|
||||
});
|
||||
}
|
||||
@@ -750,17 +786,13 @@ function handleSelectAll(selection, tableIndex) {
|
||||
// 更新全选开关状态
|
||||
function updateChooseAllStatus() {
|
||||
let allSelected = true;
|
||||
prescriptionList.value.forEach((item, index) => {
|
||||
const tableRef = proxy.$refs['tableRef' + index];
|
||||
if (tableRef && tableRef[0]) {
|
||||
const selectedRows = tableRef[0].getSelectionRows();
|
||||
if (selectedRows.length !== item.length) {
|
||||
allSelected = false;
|
||||
}
|
||||
} else {
|
||||
prescriptionList.value.forEach((item) => {
|
||||
item.forEach((row) => {
|
||||
if (!selectedRowIds.value.has(row.requestId)) {
|
||||
allSelected = false;
|
||||
}
|
||||
});
|
||||
});
|
||||
chooseAll.value = allSelected;
|
||||
}
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {getCurrentInstance} from 'vue';
|
||||
import {getCurrentInstance, ref, nextTick, provide} from 'vue';
|
||||
import PatientList from '../components/patientList.vue';
|
||||
import PrescriptionList from './components/prescriptionList.vue';
|
||||
import { RequestStatus } from '@/utils/medicalConstants';
|
||||
|
||||
@@ -181,7 +181,7 @@ function handleGetPrescription() {
|
||||
getPrescriptionList({
|
||||
encounterIds: encounterIds,
|
||||
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,
|
||||
pageNo: 1,
|
||||
}).then((res) => {
|
||||
@@ -288,6 +288,12 @@ function handleCheck() {
|
||||
function handleCancel() {
|
||||
let list = getSelectRows();
|
||||
if (list.length > 0) {
|
||||
// 校验已发药的医嘱不允许退回
|
||||
let dispensedItems = list.filter(item => item.dispenseStatus === 4);
|
||||
if (dispensedItems.length > 0) {
|
||||
proxy.$message.error('该医嘱已发药,无法退回');
|
||||
return;
|
||||
}
|
||||
cancel(list).then((res) => {
|
||||
if (res.code == 200) {
|
||||
proxy.$modal.msgSuccess(res.msg);
|
||||
|
||||
@@ -112,6 +112,19 @@
|
||||
<el-form ref="dynamicForm" :model="formData" label-width="100px" :rules="formRules">
|
||||
<div class="page-bottom">
|
||||
<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-form-item style="margin-top: 15px" label="录入时间">
|
||||
<div class="input-time-inline">
|
||||
@@ -766,6 +779,7 @@ const receptionTime = ref(null);
|
||||
|
||||
// 表单数据 - 体征录入
|
||||
const formData = ref({
|
||||
recordingDate: '',
|
||||
timePoint: '',
|
||||
temperature: '',
|
||||
systolicPressure: '',
|
||||
@@ -872,6 +886,7 @@ function getPatientDetial() {
|
||||
// 默认查询今天的数据
|
||||
const today = moment().format('YYYY-MM-DD');
|
||||
receptionTime.value = [today, today];
|
||||
formData.value.recordingDate = today;
|
||||
// 自动加载数据
|
||||
getPatientList();
|
||||
listPatient(queryParams.value).then((res) => {
|
||||
@@ -920,6 +935,7 @@ function handleRowClick(row) {
|
||||
formData.value = {
|
||||
...formData.value,
|
||||
id: row.id,
|
||||
recordingDate: row.recordingDate || '',
|
||||
timePoint: convertTimePoint(row.timePoint) || '',
|
||||
temperature: row.temperature || '',
|
||||
systolicPressure: row.systolicPressure || '',
|
||||
@@ -1038,7 +1054,7 @@ function confirmCharge() {
|
||||
|
||||
params.vitalSignsCode = vitalSignsCode;
|
||||
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 => {
|
||||
console.log('保存成功:', res);
|
||||
@@ -1047,6 +1063,7 @@ function confirmCharge() {
|
||||
getPatientList();
|
||||
// 清空表单
|
||||
formData.value = {
|
||||
recordingDate: '',
|
||||
timePoint: '',
|
||||
temperature: '',
|
||||
systolicPressure: '',
|
||||
|
||||
@@ -220,15 +220,15 @@
|
||||
|
||||
<!-- 底部控制面板 -->
|
||||
<div class="footer-section">
|
||||
<!-- 就诊科室快速过滤栏 -->
|
||||
<!-- 诊室快速过滤栏 -->
|
||||
<div class="filter-section">
|
||||
<div class="filter-label">
|
||||
③ 就诊科室快速过滤栏
|
||||
③ 诊室快速过滤栏
|
||||
</div>
|
||||
<div class="filter-select-wrapper">
|
||||
<el-select
|
||||
v-model="selectedDept"
|
||||
placeholder="请选择就诊科室"
|
||||
v-model="selectedClinicRoom"
|
||||
placeholder="请选择诊室"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 100%"
|
||||
@@ -239,10 +239,10 @@
|
||||
value="all"
|
||||
/>
|
||||
<el-option
|
||||
v-for="dept in departmentList"
|
||||
:key="dept.id"
|
||||
:label="dept.name"
|
||||
:value="dept.id"
|
||||
v-for="room in clinicRoomList"
|
||||
:key="room"
|
||||
:label="room"
|
||||
:value="room"
|
||||
/>
|
||||
</el-select>
|
||||
</div>
|
||||
@@ -648,7 +648,6 @@ import { Refresh } from '@element-plus/icons-vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import {
|
||||
getCandidatePool,
|
||||
getLocationTree,
|
||||
getTriageQueueList,
|
||||
addToQueue,
|
||||
removeFromQueue,
|
||||
@@ -681,10 +680,10 @@ const selectedCandidates = ref([])
|
||||
// 显示选项
|
||||
const showOnlyWaiting = ref(false)
|
||||
|
||||
// 科室过滤(改为使用就诊科室)
|
||||
const selectedDept = ref('all')
|
||||
// 就诊科室列表
|
||||
const departmentList = ref([])
|
||||
// 诊室过滤(按诊室维度筛选)
|
||||
const selectedClinicRoom = ref('all')
|
||||
// 诊室列表(从数据中动态提取)
|
||||
const clinicRoomList = ref([])
|
||||
|
||||
// 修复【#397】:动态获取当前科室名称
|
||||
const currentDeptName = computed(() => {
|
||||
@@ -907,13 +906,11 @@ const mapFrontendStatusToBackend = (status) => {
|
||||
// 从数据库加载队列
|
||||
const loadQueueFromDb = async () => {
|
||||
try {
|
||||
// 如果选择了具体科室,就按科室加载;否则加载当前登录人科室(后端默认)
|
||||
const organizationId = selectedDept.value !== 'all' ? selectedDept.value : undefined
|
||||
// 只查询今天的患者
|
||||
// 使用当前登录人的科室
|
||||
const today = new Date()
|
||||
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)
|
||||
const res = await getTriageQueueList({ organizationId, date: todayStr }).catch((err) => {
|
||||
console.log('【心内科】loadQueueFromDb 开始:date=', todayStr)
|
||||
const res = await getTriageQueueList({ date: todayStr }).catch((err) => {
|
||||
console.error('【心内科】loadQueueFromDb 请求异常:', err)
|
||||
return { code: 500, msg: err?.message || '请求失败', data: null }
|
||||
})
|
||||
@@ -1141,6 +1138,8 @@ const loadDataFromApi = async () => {
|
||||
|
||||
// 同步当前呼叫(队列从 DB 加载后已同步;这里再兜底一次)
|
||||
syncCurrentCallFromQueue()
|
||||
// 提取诊室列表供过滤栏使用
|
||||
extractClinicRooms()
|
||||
console.log('【心内科】数据加载完成:候选池', originalCandidatePoolList.value.length, '条,队列', originalQueueList.value.length, '条')
|
||||
ElMessage.success('【心内科】已从门诊挂号接口加载数据')
|
||||
} catch (e) {
|
||||
@@ -1152,56 +1151,37 @@ const loadDataFromApi = async () => {
|
||||
totalSignedIn.value = originalCandidatePoolList.value.length
|
||||
totalInQueue.value = originalQueueList.value.length
|
||||
syncCurrentCallFromQueue()
|
||||
extractClinicRooms()
|
||||
}
|
||||
}
|
||||
|
||||
// 原始数据存储(用于过滤)
|
||||
const originalCandidatePoolList = ref(getInitialCandidatePoolList())
|
||||
|
||||
// 辅助函数:扁平化科室树形结构
|
||||
const flattenDepartmentTree = (tree, result = []) => {
|
||||
if (!Array.isArray(tree)) return result
|
||||
tree.forEach(node => {
|
||||
if (node.id && node.name) {
|
||||
result.push({ id: node.id, name: node.name })
|
||||
}
|
||||
if (node.children && Array.isArray(node.children)) {
|
||||
flattenDepartmentTree(node.children, result)
|
||||
// 提取诊室列表(从队列和候选池数据中动态获取)
|
||||
const extractClinicRooms = () => {
|
||||
const roomSet = new Set()
|
||||
// 从队列中提取
|
||||
originalQueueList.value.forEach(item => {
|
||||
if (item.room && item.room !== '-') {
|
||||
roomSet.add(item.room)
|
||||
}
|
||||
})
|
||||
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)
|
||||
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
|
||||
})
|
||||
clinicRoomList.value = Array.from(roomSet).sort()
|
||||
}
|
||||
|
||||
// 过滤后的智能候选池数据
|
||||
const filteredCandidatePoolList = computed(() => {
|
||||
if (selectedDept.value === 'all') {
|
||||
if (selectedClinicRoom.value === 'all') {
|
||||
return originalCandidatePoolList.value
|
||||
}
|
||||
const deptName = getSelectedDeptName()
|
||||
if (!deptName) return originalCandidatePoolList.value
|
||||
return originalCandidatePoolList.value.filter(item => item.room === deptName)
|
||||
return originalCandidatePoolList.value.filter(item => item.room === selectedClinicRoom.value)
|
||||
})
|
||||
|
||||
// 原始队列数据存储(用于过滤)
|
||||
@@ -1223,19 +1203,16 @@ const formatSecondsToMmSs = (totalSeconds) => {
|
||||
return `${mm}:${ss}`
|
||||
}
|
||||
|
||||
// 过滤后的智能队列数据(同时考虑科室过滤和状态过滤)
|
||||
// 过滤后的智能队列数据(同时考虑诊室过滤和状态过滤)
|
||||
const filteredQueueList = computed(() => {
|
||||
let filtered = originalQueueList.value
|
||||
|
||||
// 先过滤掉"已完成"状态的患者(无论什么情况都不显示)
|
||||
filtered = filtered.filter(item => item.status !== '已完成')
|
||||
|
||||
// 再按科室过滤
|
||||
if (selectedDept.value !== 'all') {
|
||||
const deptName = getSelectedDeptName()
|
||||
if (deptName) {
|
||||
filtered = filtered.filter(item => item.room === deptName)
|
||||
}
|
||||
// 再按诊室过滤
|
||||
if (selectedClinicRoom.value !== 'all') {
|
||||
filtered = filtered.filter(item => item.room === selectedClinicRoom.value)
|
||||
}
|
||||
|
||||
// 再按状态过滤(只显示等待)
|
||||
@@ -1747,9 +1724,9 @@ const handleNextPatient = async () => {
|
||||
reqData.organizationId = selectedQueueRow.value.organizationId
|
||||
} else {
|
||||
// 如果没有选中患者,使用查询条件(兼容旧逻辑)
|
||||
let orgId = selectedDept.value !== 'all' ? selectedDept.value : undefined
|
||||
// "全科"模式:优先用"当前叫号中/第一个等待"所在科室
|
||||
if (orgId == null) {
|
||||
// 全科模式:优先用"当前叫号中/第一个等待"所在科室
|
||||
let orgId = null
|
||||
{
|
||||
const calling = originalQueueList.value.find((i) => i.status === '叫号中')
|
||||
const waiting = originalQueueList.value.find((i) => i.status === '等待')
|
||||
console.log('【心内科】handleNextPatient 查找:叫号中=', calling?.patientName, '等待=', waiting?.patientName)
|
||||
@@ -1785,9 +1762,9 @@ const handleSkip = async () => {
|
||||
reqData.organizationId = selectedQueueRow.value.organizationId
|
||||
} else {
|
||||
// 如果没有选中患者,使用查询条件(兼容旧逻辑)
|
||||
let orgId = selectedDept.value !== 'all' ? selectedDept.value : undefined
|
||||
// “全科”模式:优先用“当前叫号中”所在科室
|
||||
if (orgId == null) {
|
||||
// 全科模式:优先用”当前叫号中”所在科室
|
||||
let orgId = null
|
||||
{
|
||||
const calling = originalQueueList.value.find((i) => i.status === '叫号中')
|
||||
orgId = calling?.organizationId
|
||||
}
|
||||
@@ -1819,9 +1796,9 @@ const handleComplete = async () => {
|
||||
reqData.organizationId = selectedQueueRow.value.organizationId
|
||||
} else {
|
||||
// 如果没有选中患者,使用查询条件(兼容旧逻辑)
|
||||
let orgId = selectedDept.value !== 'all' ? selectedDept.value : undefined
|
||||
// “全科”模式:优先用“当前叫号中”所在科室
|
||||
if (orgId == null) {
|
||||
// 全科模式:优先用”当前叫号中”所在科室
|
||||
let orgId = null
|
||||
{
|
||||
const calling = originalQueueList.value.find((i) => i.status === '叫号中')
|
||||
orgId = calling?.organizationId
|
||||
}
|
||||
@@ -1853,9 +1830,9 @@ const handleRequeue = async () => {
|
||||
reqData.organizationId = selectedQueueRow.value.organizationId
|
||||
} else {
|
||||
// 如果没有选中患者,使用查询条件(兼容旧逻辑)
|
||||
let orgId = selectedDept.value !== 'all' ? selectedDept.value : undefined
|
||||
// “全科”模式:优先用“当前叫号中”所在科室
|
||||
if (orgId == null) {
|
||||
// 全科模式:优先用”当前叫号中”所在科室
|
||||
let orgId = null
|
||||
{
|
||||
const calling = originalQueueList.value.find((i) => i.status === '叫号中')
|
||||
orgId = calling?.organizationId
|
||||
}
|
||||
@@ -2121,8 +2098,6 @@ const handleTestRule = () => {
|
||||
|
||||
// 组件挂载
|
||||
onMounted(() => {
|
||||
// 加载就诊科室列表
|
||||
loadDepartmentList()
|
||||
// 初始化:优先从后端加载,失败则回退本地假数据
|
||||
loadDataFromApi()
|
||||
startWaitingTimer()
|
||||
|
||||
Reference in New Issue
Block a user