feat(doctorstation): 新增传染病报告卡功能并优化患者登记组件
- 新增传染病报告卡完整实现,包含甲乙丙类传染病选择和报告信息录入 - 在患者登记组件中修复性别字典数据去重问题 - 添加编辑模式支持和原始数据存储功能 - 实现姓名和身份证唯一性校验的编辑模式跳过逻辑 - 添加年龄自动计算功能基于出生日期 - 确保性别值为字符串类型以便与下拉框选项匹配 - 更新患者登记组件的标题和状态管理逻辑
This commit is contained in:
@@ -191,11 +191,18 @@ const filteredAdviceBaseList = computed(() => {
|
||||
}
|
||||
|
||||
// 过滤无库存的药品(只针对药品类型 adviceType === 1)
|
||||
// Bug #129 修复:确保库存为0的药品不被检索出来
|
||||
result = result.filter(item => {
|
||||
if (item.adviceType === 1) {
|
||||
// 检查是否有库存
|
||||
if (item.inventoryList && item.inventoryList.length > 0) {
|
||||
const totalQuantity = item.inventoryList.reduce((sum, inv) => sum + (inv.quantity || 0), 0);
|
||||
// 计算总库存数量,确保转换为数字进行正确计算
|
||||
const totalQuantity = item.inventoryList.reduce((sum, inv) => {
|
||||
const qty = inv.quantity !== undefined && inv.quantity !== null
|
||||
? (typeof inv.quantity === 'number' ? inv.quantity : Number(inv.quantity) || 0)
|
||||
: 0;
|
||||
return sum + qty;
|
||||
}, 0);
|
||||
return totalQuantity > 0;
|
||||
}
|
||||
return false; // 无库存列表或库存为空,视为无库存
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -3,7 +3,7 @@
|
||||
<el-table
|
||||
ref="adviceBaseRef"
|
||||
height="400"
|
||||
:data="adviceBaseList"
|
||||
:data="filteredAdviceBaseList"
|
||||
highlight-current-row
|
||||
@current-change="handleCurrentChange"
|
||||
row-key="patientId"
|
||||
@@ -28,7 +28,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {nextTick} from 'vue';
|
||||
import {nextTick, ref, computed, watch} from 'vue';
|
||||
import {getTcmMedicine} from '@/views/doctorstation/components/api';
|
||||
import {throttle} from 'lodash-es';
|
||||
|
||||
@@ -53,6 +53,29 @@ const queryParams = ref({
|
||||
pageNum: 1,
|
||||
});
|
||||
const adviceBaseList = ref([]);
|
||||
|
||||
// 计算属性:过滤无库存的药品
|
||||
const filteredAdviceBaseList = computed(() => {
|
||||
// 过滤无库存的药品(只针对药品类型 adviceType === 1)
|
||||
return adviceBaseList.value.filter(item => {
|
||||
if (item.adviceType === 1) {
|
||||
// 检查是否有库存
|
||||
if (item.inventoryList && item.inventoryList.length > 0) {
|
||||
// 计算总库存数量,确保转换为数字进行正确计算
|
||||
const totalQuantity = item.inventoryList.reduce((sum, inv) => {
|
||||
const qty = inv.quantity !== undefined && inv.quantity !== null
|
||||
? (typeof inv.quantity === 'number' ? inv.quantity : Number(inv.quantity) || 0)
|
||||
: 0;
|
||||
return sum + qty;
|
||||
}, 0);
|
||||
return totalQuantity > 0;
|
||||
}
|
||||
return false; // 无库存列表或库存为空,视为无库存
|
||||
}
|
||||
return true; // 非药品类型不过滤
|
||||
});
|
||||
});
|
||||
|
||||
// 节流函数
|
||||
const throttledGetList = throttle(
|
||||
() => {
|
||||
@@ -79,8 +102,8 @@ function getList() {
|
||||
total.value = res.data.total;
|
||||
nextTick(() => {
|
||||
currentIndex.value = 0;
|
||||
if (adviceBaseList.value.length > 0) {
|
||||
adviceBaseRef.value.setCurrentRow(adviceBaseList.value[0]);
|
||||
if (filteredAdviceBaseList.value.length > 0) {
|
||||
adviceBaseRef.value.setCurrentRow(filteredAdviceBaseList.value[0]);
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -89,7 +112,7 @@ function getList() {
|
||||
// 处理键盘事件
|
||||
const handleKeyDown = (event) => {
|
||||
const key = event.key;
|
||||
const data = adviceBaseList.value;
|
||||
const data = filteredAdviceBaseList.value;
|
||||
|
||||
switch (key) {
|
||||
case 'ArrowUp': // 上箭头
|
||||
@@ -138,7 +161,7 @@ const setCurrentRow = (row) => {
|
||||
|
||||
// 当前行变化时更新索引
|
||||
const handleCurrentChange = (currentRow) => {
|
||||
currentIndex.value = adviceBaseList.value.findIndex((item) => item === currentRow);
|
||||
currentIndex.value = filteredAdviceBaseList.value.findIndex((item) => item === currentRow);
|
||||
currentSelectRow.value = currentRow;
|
||||
};
|
||||
|
||||
|
||||
@@ -160,6 +160,9 @@
|
||||
<el-tab-pane label="会诊" name="consultation">
|
||||
<Consultation :patientInfo="patientInfo" :activeTab="activeTab" ref="consultationRef" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="传染病报卡" name="infectiousReport">
|
||||
<InfectiousReport :patientInfo="patientInfo" :activeTab="activeTab" ref="infectiousReportRef" @saved="handleInfectiousReportSaved" />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<div class="overlay" :class="{ 'overlay-disabled': disabled }" v-if="disabled"></div>
|
||||
</div>
|
||||
@@ -205,6 +208,7 @@ import inspectionApplication from './components/inspection/inspectionApplication
|
||||
import examinationApplication from './components/examination/examinationApplication.vue';
|
||||
import surgeryApplication from './components/surgery/surgeryApplication.vue';
|
||||
import DoctorCallDialog from './components/callQueue/DoctorCallDialog.vue';
|
||||
import InfectiousReport from './components/infectiousReport/index.vue';
|
||||
import { formatDate, formatDateStr } from '@/utils/index';
|
||||
import useUserStore from '@/store/modules/user';
|
||||
import { nextTick } from 'vue';
|
||||
@@ -299,6 +303,7 @@ const surgeryRef = ref();
|
||||
const emrRef = ref();
|
||||
const diagnosisRef = ref();
|
||||
const consultationRef = ref();
|
||||
const infectiousReportRef = ref();
|
||||
const waitCount = ref(0);
|
||||
const loading = ref(false);
|
||||
const { proxy } = getCurrentInstance();
|
||||
@@ -708,6 +713,12 @@ function handleEmrSaved(isSaved) {
|
||||
outpatientEmrSaved.value = isSaved;
|
||||
}
|
||||
|
||||
// 处理传染病报卡保存成功事件
|
||||
function handleInfectiousReportSaved() {
|
||||
// 可以在这里添加刷新列表或其他逻辑
|
||||
proxy.$modal.msgSuccess('传染病报告卡保存成功');
|
||||
}
|
||||
|
||||
// 处理写病历事件
|
||||
function handleWriteEmr(row) {
|
||||
console.log('处理写病历:', row);
|
||||
|
||||
Reference in New Issue
Block a user