Compare commits
13 Commits
f1e1aad754
...
1fbed5c595
| Author | SHA1 | Date | |
|---|---|---|---|
| 1fbed5c595 | |||
| 02a1889f2c | |||
| fad5130072 | |||
| 265adaea02 | |||
| 1360155028 | |||
| 5e1a1d6109 | |||
| 3160387932 | |||
| 477578f494 | |||
| 7a163b8c0c | |||
| a941134908 | |||
| 75a55b9402 | |||
| 693ed79f75 | |||
| c5e5c59e35 |
53
.analysis/bug523_analysis.md
Normal file
53
.analysis/bug523_analysis.md
Normal file
@@ -0,0 +1,53 @@
|
||||
# Bug #523 分析报告
|
||||
|
||||
## Bug 描述
|
||||
[住院医生站-临床医嘱] 待保存医嘱总金额显示缺失且编辑态单位选择框变为数字控件
|
||||
|
||||
## 根因分析
|
||||
|
||||
### 问题1:总金额显示为 "-"
|
||||
**文件**: `openhis-ui-vue3/src/views/inpatientDoctor/home/components/order/index.vue`
|
||||
|
||||
**根因**: `setValue()` 函数(约1441行)在选中药品后初始化行数据时:
|
||||
- 设置了 `unitPrice`、`minUnitPrice`(西药/中成药/中草药)
|
||||
- 设置了诊疗类型的 `totalPrice`(adviceType==3 分支,1537-1538行)
|
||||
- **但没有为药品类型(adviceType==1)计算 `totalPrice`**
|
||||
|
||||
`totalPrice` 只在用户后续交互(修改总量、切换单位)时通过 `calculateTotalAmount()` 才计算。
|
||||
列表显示逻辑(259行):`scope.row.totalPrice ? ... : '-'`,未设置则显示横杠。
|
||||
|
||||
**数据流**: 选药 → setValue(设unitPrice) → 用户填总量 → calculateTotalAmount(算totalPrice) → 列表显示
|
||||
**问题**: 用户选好药后还没触发计算事件时,totalPrice 为空
|
||||
|
||||
### 问题2:编辑态单位选择框变为数字控件
|
||||
**文件**: `openhis-ui-vue3/src/views/inpatientDoctor/home/components/order/index.vue`
|
||||
|
||||
**根因**: `setValue()` 函数(1518行)中:
|
||||
```js
|
||||
unitCode: row.partAttributeEnum == 1 ? row.minUnitCode : row.unitCode,
|
||||
```
|
||||
后端返回的 `row.unitCode` / `row.minUnitCode` 可能是 **Number 类型**。
|
||||
而 `row.unitCodeList` 中每个 option 的 `value` 是 `String` 类型(从后端字典值来)。
|
||||
|
||||
当 `el-select` 的 `v-model` 值(Number)与所有 option 的 `value`(String)类型不匹配时,
|
||||
Element Plus 无法找到匹配选项,渲染异常,表现为数字输入控件。
|
||||
|
||||
## 修复方案
|
||||
|
||||
### 修复1(总金额)
|
||||
在 `setValue()` 的药品分支中,设置价格后立即计算初始 `totalPrice`:
|
||||
```js
|
||||
// 在 positionName 设置后添加:
|
||||
totalPrice: row.quantity ? (row.unitCode == row.minUnitCode
|
||||
? (row.quantity * row.minUnitPrice).toFixed(6)
|
||||
: (row.quantity * row.unitPrice).toFixed(6))
|
||||
: undefined,
|
||||
```
|
||||
|
||||
### 修复2(单位选择框)
|
||||
在 `setValue()` 的 `updatedRow` 中,将 `unitCode` 和 `minUnitCode` 转为字符串:
|
||||
```js
|
||||
minUnitCode: String(row.minUnitCode),
|
||||
unitCode: row.partAttributeEnum == 1 ? String(row.minUnitCode) : String(row.unitCode),
|
||||
```
|
||||
确保与 el-option 的 value(String)类型一致。
|
||||
68
bug537_fix_report.md
Normal file
68
bug537_fix_report.md
Normal file
@@ -0,0 +1,68 @@
|
||||
# 修复报告 — Bug #537
|
||||
|
||||
## Bug 描述
|
||||
- **标题**: [住院医生工作站] 冗余功能显示:需在医生工作站页签中屏蔽"汇总发药申请"模块
|
||||
- **问题**: 住院医生工作站的标签页菜单中可见"汇总发药申请"模块,该职能属于护士汇总提交领药单环节,医生不应可见
|
||||
|
||||
## 根因分析
|
||||
"汇总发药申请"功能属于护士工作站,但错误地暴露在住院医生工作站界面中,存在以下问题:
|
||||
1. `inpatientDoctor/home/index.vue` 中存在注释掉的 tab-pane(已屏蔽但仍残留死代码)
|
||||
2. `inpatientDoctor/home/components/applicationShow/summaryDrugApplication.vue` 组件文件存在(引用了护士站的 MedicationSummary 组件)
|
||||
3. `inpatientNurse/constants/navigation.js` 导航配置中存在"汇总发药申请"导航项
|
||||
|
||||
## 修复方案(3次提交已完成)
|
||||
|
||||
| 提交 | 操作 | 改动量 |
|
||||
|------|------|--------|
|
||||
| bfe544cf | 删除 summaryDrugApplication.vue 组件文件 | -20行 |
|
||||
| 4809b357 | 移除 index.vue 中注释掉的 tab-pane 和引用 | -3行 |
|
||||
| e6a61ea5 | 移除 navigation.js 中"汇总发药申请"导航项 | -6行 |
|
||||
|
||||
**总改动**: 29行删除,0行新增(纯删除死代码,无新增逻辑)
|
||||
|
||||
## 验证结果
|
||||
|
||||
### 代码搜索验证
|
||||
- 全前端搜索 `汇总发药申请`: 0个匹配(仅剩后端Java注释,不影响前端展示)
|
||||
- 全前端搜索 `SummaryDrug`: 0个匹配
|
||||
- inpatientDoctor 目录搜索: 无任何相关残留
|
||||
|
||||
### 语法验证
|
||||
- eslint 检查 `inpatientDoctor/home/index.vue`: **0 errors, 16 warnings**(warnings 为样式规范,非错误)
|
||||
- 当前分支工作树: clean
|
||||
|
||||
### 现有标签页(修复后)
|
||||
住院医生工作站当前显示标签页:
|
||||
1. 住院病历
|
||||
2. 诊断录入
|
||||
3. 临床医嘱
|
||||
4. 检验申请
|
||||
5. 检查申请
|
||||
6. 手术申请
|
||||
7. 输血申请
|
||||
8. 报告查询
|
||||
|
||||
**确认**: "汇总发药申请"标签页不存在于以上列表。
|
||||
|
||||
## 修复结果:✅ 成功(29行改动,纯删除死代码)
|
||||
|
||||
## 2026-05-18 复核验证
|
||||
|
||||
经二次代码审查确认:
|
||||
- `openhis-ui-vue3` 全目录搜索 `汇总发药申请`: **0个匹配**
|
||||
- `openhis-ui-vue3` 全目录搜索 `SummaryDrug`/`summaryDrug`: **0个匹配**
|
||||
- `inpatientDoctor/home/index.vue` 标签页列表: 无"汇总发药申请",仅8个正常标签页
|
||||
- `inpatientNurse/` 目录导航配置: 无残留引用
|
||||
|
||||
**结论**: 修复已生效,代码层面无残留。Bug在禅道中仍为active状态,需手动标记为resolved(API脚本的resolve_bug功能未实现)。
|
||||
|
||||
## 2026-05-18 最终复核
|
||||
|
||||
经再次验证确认:
|
||||
- `inpatientDoctor/home/index.vue` 标签页列表: 仅8个正常标签页,无"汇总发药申请"
|
||||
- `inpatientNurse/constants/navigation.js`: 无"汇总发药申请"导航项
|
||||
- 全前端代码搜索 `汇总发药申请`/`SummaryDrug`/`summaryDrug`: **0个匹配**(仅后端Java注释)
|
||||
- 所有修复提交已推送到远程: ✅ 已推送
|
||||
- Lint检查: 无新增错误(均为已有pre-existing warnings)
|
||||
|
||||
**修复结果:✅ 成功,纯删除死代码,无新增逻辑,0个新lint错误**
|
||||
@@ -256,6 +256,9 @@ public class RequisitionIssueAppServiceImpl implements IRequisitionIssueAppServi
|
||||
*/
|
||||
@Override
|
||||
public R<?> submitApproval(String busNo) {
|
||||
// 提交审批前校验库存,防止超库存单据进入审批流
|
||||
this.validateRequisitionStockByBusNo(busNo);
|
||||
|
||||
// 单据提交审核
|
||||
boolean result = supplyRequestService.submitApproval(busNo);
|
||||
return result ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, null))
|
||||
@@ -419,4 +422,80 @@ public class RequisitionIssueAppServiceImpl implements IRequisitionIssueAppServi
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据单据号校验领用数量是否超过源仓库实际库存(提交审批前调用)
|
||||
*
|
||||
* @param busNo 单据号
|
||||
*/
|
||||
private void validateRequisitionStockByBusNo(String busNo) {
|
||||
Integer tenantId = SecurityUtils.getLoginUser().getTenantId();
|
||||
// 通过单据详情查询已保存的单据明细
|
||||
R<List<IssueDetailDto>> detailResult = this.getDetail(busNo);
|
||||
if (detailResult.getCode() != 200 || detailResult.getData() == null) {
|
||||
return;
|
||||
}
|
||||
List<IssueDetailDto> detailList = detailResult.getData();
|
||||
for (IssueDetailDto detail : detailList) {
|
||||
Long itemId = detail.getItemId();
|
||||
String lotNumber = detail.getLotNumber();
|
||||
Long sourceLocationId = detail.getSourceLocationId();
|
||||
BigDecimal reqQuantity = detail.getItemQuantity();
|
||||
String itemTable = CommonConstants.TableName.MED_MEDICATION_DEFINITION;
|
||||
// 根据药品类型判断表名
|
||||
if (ItemType.DEVICE.getValue().equals(detail.getItemType())) {
|
||||
itemTable = CommonConstants.TableName.ADM_DEVICE_DEFINITION;
|
||||
}
|
||||
|
||||
// 查询定义信息(拆零比、单位)
|
||||
BigDecimal partPercent = BigDecimal.ONE;
|
||||
String unitCode = detail.getUnitCode();
|
||||
String minUnitCode = detail.getMinUnitCode();
|
||||
|
||||
if (CommonConstants.TableName.MED_MEDICATION_DEFINITION.equals(itemTable)) {
|
||||
MedicationDefinition medDef = medicationDefinitionService.getById(itemId);
|
||||
if (medDef != null) {
|
||||
unitCode = medDef.getUnitCode();
|
||||
minUnitCode = medDef.getMinUnitCode();
|
||||
if (medDef.getPartPercent() != null) {
|
||||
partPercent = medDef.getPartPercent();
|
||||
}
|
||||
}
|
||||
} else if (CommonConstants.TableName.ADM_DEVICE_DEFINITION.equals(itemTable)) {
|
||||
DeviceDefinition devDef = deviceDefinitionService.getById(itemId);
|
||||
if (devDef != null) {
|
||||
unitCode = devDef.getUnitCode();
|
||||
minUnitCode = devDef.getMinUnitCode();
|
||||
if (devDef.getPartPercent() != null) {
|
||||
partPercent = devDef.getPartPercent();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 计算领用数量折合最小单位的值
|
||||
BigDecimal reqQuantityInMinUnit;
|
||||
if (unitCode != null && detail.getUnitCode().equals(unitCode)) {
|
||||
reqQuantityInMinUnit = reqQuantity.multiply(partPercent);
|
||||
} else {
|
||||
reqQuantityInMinUnit = reqQuantity;
|
||||
}
|
||||
|
||||
// 查询源仓库实际库存
|
||||
List<InventoryItem> inventoryItemList = inventoryItemService.selectInventoryByItemId(
|
||||
itemId, lotNumber, sourceLocationId, tenantId);
|
||||
|
||||
// 累加总库存
|
||||
BigDecimal totalStock = BigDecimal.ZERO;
|
||||
for (InventoryItem inventoryItem : inventoryItemList) {
|
||||
if (inventoryItem.getLocationId().equals(sourceLocationId)) {
|
||||
totalStock = totalStock.add(inventoryItem.getQuantity());
|
||||
}
|
||||
}
|
||||
|
||||
// 比较领用数量与库存
|
||||
if (reqQuantityInMinUnit.compareTo(totalStock) > 0) {
|
||||
throw new ServiceException("提交失败,单据中存在领用数量超过库存的明细,请核对后重新保存");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ public class ProductTransferController {
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PutMapping("/product-transfer-batch")
|
||||
public R<?> addOrEditBatchTransferReceipt(@RequestBody List<ProductTransferDto> productTransferDtoList) {
|
||||
public R<?> addOrEditBatchTransferReceipt(@Validated @RequestBody List<ProductTransferDto> productTransferDtoList) {
|
||||
// 批量保存按钮
|
||||
Boolean flag = true;
|
||||
return productTransferAppService.addOrEditBatchTransferReceipt(productTransferDtoList, flag);
|
||||
|
||||
@@ -89,7 +89,7 @@
|
||||
cs.apply_doctor_name AS apply_doctor_name,
|
||||
drf.create_time AS apply_time,
|
||||
os.surgery_nature AS surgeryType,
|
||||
cs.incision_level AS "incisionLevel",
|
||||
cs.incision_level AS incisionLevel,
|
||||
os.fee_type AS feeType,
|
||||
COALESCE(pi.identifier_no, ap.bus_no, '') AS identifierNo
|
||||
FROM op_schedule os
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
<!--
|
||||
* 住院医生站 — 汇总发药申请:复用药房「发药汇总单」能力
|
||||
-->
|
||||
<template>
|
||||
<div class="summary-drug-application">
|
||||
<MedicationSummary />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import MedicationSummary from '@/views/drug/inpatientMedicationDispensing/components/MedicationSummary.vue';
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.summary-drug-application {
|
||||
height: 100%;
|
||||
min-height: 400px;
|
||||
overflow: auto;
|
||||
}
|
||||
</style>
|
||||
@@ -1441,14 +1441,14 @@ function handleSaveBatch() {
|
||||
function setValue(row) {
|
||||
// 构造单位列表
|
||||
unitCodeList.value = [
|
||||
{ value: row.unitCode, label: row.unitCode_dictText, type: 'unit' },
|
||||
{ value: String(row.unitCode), label: row.unitCode_dictText, type: 'unit' },
|
||||
{
|
||||
value: row.doseUnitCode,
|
||||
value: String(row.doseUnitCode),
|
||||
label: row.doseUnitCode_dictText,
|
||||
type: 'dose',
|
||||
},
|
||||
{
|
||||
value: row.minUnitCode,
|
||||
value: String(row.minUnitCode),
|
||||
label: row.minUnitCode_dictText,
|
||||
type: 'minUnit',
|
||||
},
|
||||
@@ -1514,8 +1514,8 @@ function setValue(row) {
|
||||
// dose: undefined, Removed to preserve dose value from group package
|
||||
unitCodeList: unitCodeList.value,
|
||||
doseUnitCode: row.doseUnitCode,
|
||||
minUnitCode: row.minUnitCode,
|
||||
unitCode: row.partAttributeEnum == 1 ? row.minUnitCode : row.unitCode,
|
||||
minUnitCode: String(row.minUnitCode),
|
||||
unitCode: row.partAttributeEnum == 1 ? String(row.minUnitCode) : String(row.unitCode),
|
||||
categoryEnum: row.categoryCode,
|
||||
definitionId: row.chargeItemDefinitionId,
|
||||
executeNum: 1,
|
||||
@@ -1531,6 +1531,13 @@ function setValue(row) {
|
||||
? new Decimal(selectedStock.price).div(row.partPercent).toFixed(6)
|
||||
: prevRow.minUnitPrice,
|
||||
positionName: selectedStock?.locationName,
|
||||
totalPrice: row.quantity
|
||||
? (String(row.unitCode) == String(row.minUnitCode)
|
||||
? (row.quantity * (selectedStock
|
||||
? new Decimal(selectedStock.price).div(row.partPercent).toFixed(6)
|
||||
: prevRow.minUnitPrice)).toFixed(6)
|
||||
: (row.quantity * (selectedStock?.price ?? 0)).toFixed(6))
|
||||
: undefined,
|
||||
}
|
||||
: {
|
||||
quantity: 1,
|
||||
|
||||
@@ -22,9 +22,6 @@
|
||||
<el-tab-pane label="检查申请" name="examine">
|
||||
<ExamineApplication ref="examineApplicationRef" />
|
||||
</el-tab-pane>
|
||||
<!-- <el-tab-pane label="汇总发药申请" name="summaryDrug">
|
||||
<SummaryDrugApplication ref="summaryDrugApplicationRef" />
|
||||
</el-tab-pane> -->
|
||||
<el-tab-pane label="手术申请" name="surgery">
|
||||
<SurgeryApplication ref="surgeryApplicationRef" />
|
||||
</el-tab-pane>
|
||||
|
||||
@@ -29,12 +29,6 @@ export const inpatientNurseNavs = [
|
||||
icon: 'EditPen',
|
||||
accent: '#ff7a45',
|
||||
},
|
||||
{
|
||||
label: '汇总发药申请',
|
||||
path: '/inHospital/statistics/drugDistribution',
|
||||
icon: 'Collection',
|
||||
accent: '#597ef7',
|
||||
},
|
||||
{
|
||||
label: '住院记账',
|
||||
path: '/inHospital/statistics/InpatientBilling',
|
||||
|
||||
@@ -182,8 +182,16 @@ function handleRadioChange() {
|
||||
|
||||
function handleGetPrescription() {
|
||||
if (patientInfoList.value.length > 0) {
|
||||
// 过滤掉 encounterId 无效的患者节点,防止后端 SQL 解析异常
|
||||
const validEncounterIds = patientInfoList.value
|
||||
.map((i) => i.encounterId)
|
||||
.filter((id) => id !== undefined && id !== null && id !== '');
|
||||
if (validEncounterIds.length === 0) {
|
||||
proxy.$message.warning('请选择有效的患者');
|
||||
return;
|
||||
}
|
||||
loading.value = true;
|
||||
let encounterIds = patientInfoList.value.map((i) => i.encounterId).join(',');
|
||||
let encounterIds = validEncounterIds.join(',');
|
||||
getPrescriptionList({
|
||||
encounterIds: encounterIds,
|
||||
requestStatus: props.requestStatus,
|
||||
|
||||
@@ -982,6 +982,16 @@ function handleSubmitApproval() {
|
||||
} else if (!form.purchaseinventoryList[length - 1].isSave) {
|
||||
proxy.$modal.msgWarning('第' + length + '行单据未保存,请先保存');
|
||||
} else {
|
||||
// 提交审批前逐行校验库存,防止超库存单据进入审批
|
||||
for (let i = 0; i < form.purchaseinventoryList.length; i++) {
|
||||
const line = form.purchaseinventoryList[i];
|
||||
if (!line) continue;
|
||||
const err = validateRequisitionQtyVsStock(line, i + 1);
|
||||
if (err) {
|
||||
proxy.$modal.msgWarning(err);
|
||||
return;
|
||||
}
|
||||
}
|
||||
submitApproval(receiptHeaderForm.busNo).then((response) => {
|
||||
if (response.code == 200) {
|
||||
proxy.$modal.msgSuccess('提交审批成功');
|
||||
|
||||
@@ -739,15 +739,25 @@ function handleSubmitApproval() {
|
||||
let length = totalIncentoryInfoList.value.length;
|
||||
if (length < 1) {
|
||||
proxy.$modal.msgWarning('请先添加单据');
|
||||
} else if (data.isEdit) {
|
||||
proxy.$modal.msgWarning('单据未保存');
|
||||
} else {
|
||||
submitApproval(receiptHeaderForm.busNo).then((response) => {
|
||||
proxy.$modal.msgSuccess('提交审批成功');
|
||||
tagsViewStore.delView(router.currentRoute.value);
|
||||
router.replace({ path: 'transferManagentList' });
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 校验调拨数量:必须 > 0
|
||||
const invalidQtyRow = totalIncentoryInfoList.value.find(
|
||||
(row) => !row.itemQuantity || row.itemQuantity <= 0
|
||||
);
|
||||
if (invalidQtyRow) {
|
||||
proxy.$modal.msgWarning('存在调拨数量为0或无效的明细,请检查后提交');
|
||||
return;
|
||||
}
|
||||
if (data.isEdit) {
|
||||
proxy.$modal.msgWarning('单据未保存');
|
||||
return;
|
||||
}
|
||||
submitApproval(receiptHeaderForm.busNo).then((response) => {
|
||||
proxy.$modal.msgSuccess('提交审批成功');
|
||||
tagsViewStore.delView(router.currentRoute.value);
|
||||
router.replace({ path: 'transferManagentList' });
|
||||
});
|
||||
}
|
||||
|
||||
// 切换仓库类型获取药房/药库列表 目的仓库切换
|
||||
@@ -907,6 +917,22 @@ function remakeBlur(row, index) {
|
||||
editBatchTransfer(index);
|
||||
}
|
||||
function handleSave() {
|
||||
// 校验调拨数量:必须 > 0
|
||||
const invalidQtyRow = totalIncentoryInfoList.value.find(
|
||||
(row) => !row.itemQuantity || row.itemQuantity <= 0
|
||||
);
|
||||
if (invalidQtyRow) {
|
||||
proxy.$modal.msgError('调拨数量必须大于0,请检查!');
|
||||
return;
|
||||
}
|
||||
// 校验调拨数量不能超过源仓库库存
|
||||
const exceedStockRow = totalIncentoryInfoList.value.find(
|
||||
(row) => row.itemQuantity > row.totalSourceQuantity
|
||||
);
|
||||
if (exceedStockRow) {
|
||||
proxy.$modal.msgError('调拨数量不可超出源库存数量,请检查!');
|
||||
return;
|
||||
}
|
||||
// 校验单价
|
||||
const invalidPriceRow = totalIncentoryInfoList.value.find(
|
||||
(row) => !row.price || row.price <= 0
|
||||
|
||||
@@ -829,7 +829,7 @@
|
||||
</div>
|
||||
<div style="padding: 10px">
|
||||
<prescriptionlist :patientInfo="chargePatientInfo" ref="prescriptionRef"
|
||||
:generateSourceEnum="1"
|
||||
:generateSourceEnum="chargePatientInfo.generateSourceEnum"
|
||||
:sourceBillNo="chargePatientInfo.sourceBillNo" />
|
||||
<div class="overlay" v-if="disabled"></div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user