fix(ui): 修复多个功能模块的验证和数据处理问题

- 在医生工作站退费功能中添加患者选择验证
- 统一药品管理中的仓库类型选择逻辑,移除重复代码
- 修复统计管理页面清空按钮的数据重置问题
- 修正西药管理页面处方打印按钮的功能绑定
- 完善库存报表查询的SQL过滤条件实现
- 更新多个控制器接口参数类型以支持业务流程
- 优化退费列表对话框的数据加载和错误处理
This commit is contained in:
2026-03-02 23:27:11 +08:00
parent ce8b0b16b1
commit 9116ea4a84
22 changed files with 447 additions and 155 deletions

View File

@@ -714,11 +714,11 @@ function handleNodeClick(data) {
? Math.max(...form.value.diagnosisList.map(item => item.diagSrtNo || 0))
: 0;
form.value.diagnosisList.push({
form.value.diagnosisList.push({
ybNo: data.ybNo,
name: data.name,
verificationStatusEnum: 4,
medTypeCode: '11',
medTypeCode: '初诊诊断',
diagSrtNo: maxSortNo + 1,
definitionId: data.definitionId,
classification: '西医', // 默认为西医

View File

@@ -230,6 +230,67 @@
</el-button>
</div>
</template>
<!-- 🔧 Bug #147 修复:耗材类型(adviceType=4)的编辑模板 -->
<template v-else-if="scope.row.adviceType == 4">
<div style="
display: flex;
align-items: center;
margin-bottom: 16px;
gap: 16px;
">
<span class="medicine-title">
{{
scope.row.adviceName +
" " +
(scope.row.volume || '') +
" [" +
(scope.row.unitPrice !== undefined && scope.row.unitPrice !== null && !isNaN(scope.row.unitPrice) &&
isFinite(scope.row.unitPrice) ? Number(scope.row.unitPrice).toFixed(2) : '-') +
" " +
"/" +
(scope.row.unitCode_dictText || '个') +
"]"
}}
</span>
<el-form-item label="数量" prop="quantity" class="required-field" data-prop="quantity">
<el-input-number placeholder="数量" v-model="scope.row.quantity" style="width: 70px"
controls-position="right" :controls="false" :ref="(el) => (inputRefs.quantity = el)"
@keyup.enter.prevent="handleEnter('quantity', scope.row, scope.$index)"
@input="calculateTotalAmount(scope.row, scope.$index)" />
</el-form-item>
<el-form-item>
<el-select v-model="scope.row.unitCode" style="width: 70px; margin-right: 20px" placeholder=" "
@change="calculateTotalAmount(scope.row, scope.$index)">
<template v-for="item in scope.row.unitCodeList" :key="item.value">
<el-option v-if="item.type != unitMap['dose']" :value="item.value" :label="item.label" @click="
() => {
scope.row.unitCode_dictText = item.label;
}
" @keyup.enter.prevent="
handleEnter(
'executeNum',
scope.row,
scope.$index,
prescription.id
)
" style="width: 70px; margin-right: 20px" />
</template>
</el-select>
</el-form-item>
<span class="total-amount">
总金额:{{
(scope.row.totalPrice !== undefined && scope.row.totalPrice !== null && !isNaN(scope.row.totalPrice)
&&
isFinite(scope.row.totalPrice))
? Number(scope.row.totalPrice).toFixed(2) + ' 元'
: '0.00 元'
}}
</span>
</div>
<el-button type="primary" @click="handleSaveSign(scope.row, scope.$index)">
确定
</el-button>
</template>
<template v-else-if="scope.row.adviceType == 2">
<div style="
display: flex;
@@ -2390,7 +2451,9 @@ function setValue(row) {
prescriptionList.value[rowIndex.value].executeNum = 1;
// 库存列表 + 价格列表拼成批次号的下拉框
if (row.adviceType != 3) {
// 🔧 Bug #147 修复:耗材(adviceType=4)和诊疗(adviceType=3, adviceType=5)不检查库存
// 耗材从getDeviceList接口获取inventoryList为空但需要设置价格
if (row.adviceType != 3 && row.adviceType != 4 && row.adviceType != 5) {
if (row.inventoryList && row.inventoryList.length == 0) {
expandOrder.value = [];
proxy.$modal.msgWarning(row.adviceName + '无库存');
@@ -2431,6 +2494,18 @@ function setValue(row) {
.toFixed(6);
prescriptionList.value[rowIndex.value].positionName = stock.locationName;
}
} else if (row.adviceType == 4) {
// 🔧 Bug #147 修复:耗材类型(adviceType=4)的专门处理
// 耗材从getDeviceList接口获取使用priceList中的价格
if (row.priceList && row.priceList.length > 0) {
prescriptionList.value[rowIndex.value].unitPrice = row.priceList[0].price;
prescriptionList.value[rowIndex.value].unitTempPrice = row.priceList[0].price;
prescriptionList.value[rowIndex.value].minUnitPrice = row.priceList[0].price;
prescriptionList.value[rowIndex.value].quantity = 1;
prescriptionList.value[rowIndex.value].totalPrice = row.priceList[0].price;
prescriptionList.value[rowIndex.value].positionName = row.positionName || '';
prescriptionList.value[rowIndex.value].locationId = row.positionId;
}
} else {
getOrgList();
// 会诊类型adviceType == 5和诊疗类型adviceType == 3的处理

View File

@@ -758,10 +758,10 @@ function handleEdit(row) {
loadDoctorList()
}
getSurgeryDetail(row.surgeryNo).then(res => {
if (res.code === 200) {
console.log('【编辑手术】完整返回数据:', res.data)
console.log('【编辑手术】手术指征字段值:', res.data.surgeryIndication)
getSurgeryDetail(row.id).then(res => {
if (res.code === 200) {
console.log('【编辑手术】完整返回数据:', res.data)
console.log('【编辑手术】手术指征字段值:', res.data.surgeryIndication)
Object.assign(form.value, res.data)
@@ -796,7 +796,7 @@ function handleEdit(row) {
// 查看
function handleView(row) {
viewOpen.value = true
getSurgeryDetail(row.surgeryNo).then(res => {
getSurgeryDetail(row.id).then(res => {
if (res.code === 200) {
console.log('【手术详情】完整返回数据:', res.data)
console.log('【手术详情】手术指征字段值:', res.data.surgeryIndication)
@@ -822,7 +822,7 @@ function handleDelete(row) {
if (row.statusEnum === 0) {
// 新开状态 - 直接删除
proxy.$modal.confirm('是否确认删除手术"' + row.surgeryName + '"?').then(() => {
return deleteSurgery(row.surgeryNo)
return deleteSurgery(row.id)
}).then(() => {
getList()
proxy.$modal.msgSuccess('删除成功')
@@ -833,7 +833,7 @@ function handleDelete(row) {
} else if (row.statusEnum === 1) {
// 已安排状态 - 更新为已取消
proxy.$modal.confirm('是否确认取消手术"' + row.surgeryName + '"?').then(() => {
return updateSurgeryStatus(row.surgeryNo, 4) // 4 = 已取消
return updateSurgeryStatus(row.id, 4) // 4 = 已取消
}).then(() => {
getList()
proxy.$modal.msgSuccess('手术已取消')

View File

@@ -109,7 +109,8 @@
<el-button type="primary" plain @click.stop="handleLeave(patientInfo.encounterId)">
暂离
</el-button>
<el-button type="primary" plain @click.stop="handleRefund(patientInfo.encounterId)">
<el-button type="primary" plain :disabled="isRefundButtonDisabled"
@click.stop="handleRefund(patientInfo.encounterId)">
退费
</el-button>
<el-button type="primary" plain class="top-layer-btn"
@@ -289,6 +290,16 @@ const isHospitalizationButtonDisabled = computed(() => {
patientInfo.value.encounterId === undefined;
});
// 计算属性:确定退费按钮是否应被禁用(与住院按钮使用相同的逻辑)
const isRefundButtonDisabled = computed(() => {
return !patientInfo.value ||
typeof patientInfo.value !== 'object' ||
!patientInfo.value.encounterId ||
patientInfo.value.encounterId === '' ||
patientInfo.value.encounterId === null ||
patientInfo.value.encounterId === undefined;
});
const prescriptionInfo = ref([]);
const registerTime = ref(formatDate(new Date()));
const patientDrawerRef = ref();