bug338:门诊划价新增时未校验当前就诊记录及诊断记录,未接诊患者也可新增划价项目。

bug339:【库存商品明细查询报表】“药房”筛选条件失效,查询结果中包含非选中药房的数据
This commit is contained in:
2026-04-09 18:15:26 +08:00
parent d8511ecb1b
commit 8deefd2cb1
7 changed files with 131 additions and 18 deletions

View File

@@ -61,6 +61,26 @@ export function getPrescriptionList(encounterId) {
method: 'get',
})
}
/**
* 门诊病历详情(与医生站一致,无记录时 data 为 null
*/
export function getEmrDetail(encounterId) {
return request({
url: '/doctor-station/emr/emr-detail?encounterId=' + encounterId,
method: 'get',
})
}
/**
* 当前就诊诊断列表
*/
export function getEncounterDiagnosis(encounterId) {
return request({
url: '/doctor-station/diagnosis/get-encounter-diagnosis?encounterId=' + encounterId,
method: 'get',
})
}
/**
* 获取科室列表
*/

View File

@@ -335,7 +335,15 @@
</template>
<script setup>
import {getOrgTree, getPrescriptionList, savePrescription, savePrescriptionSign, singOut,} from './api';
import {
getOrgTree,
getPrescriptionList,
savePrescription,
savePrescriptionSign,
singOut,
getEmrDetail,
getEncounterDiagnosis,
} from './api';
import adviceBaseList from './adviceBaseList';
import {getCurrentInstance, nextTick, ref, watch} from 'vue';
@@ -488,19 +496,87 @@ function getRowDisabled(row) {
return row.isEdit;
}
/**
* 是否已由医生接诊(非待诊)
* EncounterStatus: 1=待诊 2=在诊 3=暂离 …
*/
function assertEncounterReceived(patientInfo) {
const status = Number(patientInfo.statusEnum)
if (status === 1) {
proxy.$modal.msgWarning('当前就诊尚未接诊,不能进行门诊划价')
return false
}
return true
}
/** 是否存在有效就诊记录(门诊 doc_emr 或住院 doc_record与 emr-detail 一致) */
function assertHasEmrRecord(emrRes) {
if (!emrRes || emrRes.code !== 200) {
proxy.$modal.msgWarning(emrRes?.msg || '获取就诊记录失败,不能进行门诊划价')
return false
}
const row = emrRes.data
if (row == null || row === '') {
proxy.$modal.msgWarning('当前就诊无就诊记录,不能进行门诊划价')
return false
}
if (typeof row === 'object' && row.id == null && row.ID == null) {
proxy.$modal.msgWarning('当前就诊无就诊记录,不能进行门诊划价')
return false
}
return true
}
function assertHasDiagnosis(diagRes) {
if (!diagRes || diagRes.code !== 200) {
proxy.$modal.msgWarning(diagRes?.msg || '获取诊断失败,不能进行门诊划价')
return false
}
const raw = diagRes.data
const list = Array.isArray(raw) ? raw : []
if (list.length === 0) {
proxy.$modal.msgWarning('当前就诊无诊断记录,不能进行门诊划价')
return false
}
return true
}
// 新增医嘱
function handleAddPrescription() {
async function handleAddPrescription() {
// 验证是否已选择患者
if (!props.patientInfo || Object.keys(props.patientInfo).length === 0) {
proxy.$modal.msgWarning('请先选择患者');
return;
proxy.$modal.msgWarning('请先选择患者')
return
}
if (!props.patientInfo.encounterId) {
proxy.$modal.msgWarning('当前就诊信息不完整,不能进行门诊划价')
return
}
if (!assertEncounterReceived(props.patientInfo)) {
return
}
try {
const emrRes = await getEmrDetail(props.patientInfo.encounterId)
if (!assertHasEmrRecord(emrRes)) {
return
}
const diagRes = await getEncounterDiagnosis(props.patientInfo.encounterId)
if (!assertHasDiagnosis(diagRes)) {
return
}
} catch (e) {
console.error(e)
proxy.$modal.msgError(e?.message || '校验失败,请稍后重试')
return
}
if (isAdding.value) {
proxy.$modal.msgWarning('请先保存当前医嘱');
return;
proxy.$modal.msgWarning('请先保存当前医嘱')
return
}
isAdding.value = true;
isAdding.value = true
// 在数组最前方添加一行,让新增行显示在最上边
prescriptionList.value.unshift({
uniqueKey: nextId.value++,
@@ -512,10 +588,10 @@ function handleAddPrescription() {
adviceType: undefined,
adviceType_dictText: '',
categoryCode: '',
});
})
nextTick(() => {
proxy.$refs['adviceRef0'].focus();
});
proxy.$refs['adviceRef0'].focus()
})
}
// 行双击打开编辑块,仅待发送的可编辑

View File

@@ -81,8 +81,8 @@
style="width: 150px"
>
<el-option
v-for="supplyStatus in locationIdList"
:key="supplyStatus.value"
v-for="supplyStatus in locationIdList"
:key="supplyStatus.id ?? supplyStatus.value"
:label="supplyStatus.name"
:value="supplyStatus.id"
/>