95-门诊医生站开立会诊申请单界面PRD_2026-01-15,全部功能。

This commit is contained in:
weixin_45799331
2026-02-06 11:24:08 +08:00
parent f3d56bff45
commit faf73a5ac4
25 changed files with 4225 additions and 25 deletions

View File

@@ -86,7 +86,7 @@
<script setup>
import { getCurrentInstance, nextTick, onMounted, ref, computed, watch } from 'vue';
import { getAdviceBaseInfo, getDeviceList } from './api';
import { getAdviceBaseInfo, getDeviceList, getConsultationActivities } from './api';
import { throttle, debounce } from 'lodash-es';
const { proxy } = getCurrentInstance();
@@ -274,8 +274,50 @@ async function getList() {
};
const isConsumables = queryParams.adviceTypes === '2' || queryParams.adviceTypes === 2;
const isConsultation = queryParams.adviceTypes === '5' || queryParams.adviceTypes === 5;
if (isConsumables) {
if (isConsultation) {
// 会诊类型:调用会诊项目接口
const res = await getConsultationActivities();
if (res.data && Array.isArray(res.data)) {
const result = res.data.map((item) => ({
adviceName: item.name || item.activityName,
adviceType: 5, // 会诊类型
unitCode: '111', // 次
unitCode_dictText: '次',
minUnitCode: '111',
minUnitCode_dictText: '次',
volume: '',
partPercent: 1,
priceList: item.price ? [{ price: item.price }] : [],
inventoryList: [],
adviceDefinitionId: item.id || item.activityId,
chargeItemDefinitionId: item.id || item.activityId,
positionId: '',
positionName: '',
dose: 0,
doseUnitCode: '111',
doseUnitCode_dictText: '次',
injectFlag: 0,
injectFlag_enumText: '否',
skinTestFlag: 0,
skinTestFlag_enumText: '否',
categoryCode: 31, // 会诊的category_enum
unitPrice: item.price || 0,
...item,
}));
// 缓存结果
searchCache.set(cacheKey, {
data: result,
timestamp: Date.now()
});
adviceBaseList.value = result;
} else {
adviceBaseList.value = [];
}
} else if (isConsumables) {
const deviceQueryParams = {
pageNo: queryParams.pageNum || 1,
pageSize: queryParams.pageSize || 1000,

View File

@@ -894,3 +894,90 @@ export function deleteInspectionApplication(id) {
method: 'delete',
});
}
// ========== 会诊相关接口 ==========
/**
* 获取会诊列表
*/
export function getConsultationList(queryParams) {
return request({
url: '/consultation/list',
method: 'get',
params: queryParams,
});
}
/**
* 保存会诊申请
*/
export function saveConsultation(data) {
return request({
url: '/consultation/save',
method: 'post',
data: data,
});
}
/**
* 提交会诊申请
*/
export function submitConsultation(queryParams) {
return request({
url: '/consultation/submit',
method: 'post',
params: queryParams,
});
}
/**
* 作废会诊申请
*/
export function cancelConsultation(queryParams) {
return request({
url: '/consultation/cancel',
method: 'post',
params: queryParams,
});
}
/**
* 结束会诊申请
*/
export function completeConsultation(consultationId) {
return request({
url: '/consultation/complete',
method: 'post',
params: { consultationId },
});
}
/**
* 获取科室医生树
*/
export function getDepartmentTree() {
return request({
url: '/consultation/departmentTree',
method: 'get',
});
}
/**
* 获取主诊断
*/
export function getMainDiagnosis(params) {
return request({
url: '/consultation/mainDiagnosis',
method: 'get',
params: params,
});
}
/**
* 获取会诊项目列表及价格
*/
export function getConsultationActivities() {
return request({
url: '/consultation/activities',
method: 'get',
});
}

File diff suppressed because it is too large Load Diff

View File

@@ -346,7 +346,7 @@
expandOrder = [];
// 当医嘱类型改变时,清空当前选择的项目名称,因为不同类型项目的数据结构可能不兼容
prescriptionList[scope.$index].adviceName = undefined;
adviceQueryParams.adviceType = value;
adviceQueryParams.adviceTypes = value; // 🎯 修复:改为 adviceTypes复数
// 根据选择的类型设置categoryCode用于药品分类筛选
if (value == 1) { // 西药
@@ -357,6 +357,8 @@
adviceQueryParams.categoryCode = ''; // 诊疗不需要categoryCode筛选
} else if (value == 4) { // 耗材
adviceQueryParams.categoryCode = ''; // 耗材不需要categoryCode筛选
} else if (value == 5) { // 会诊
adviceQueryParams.categoryCode = ''; // 会诊不需要categoryCode筛选
} else {
adviceQueryParams.categoryCode = ''; // 全部类型
}
@@ -438,6 +440,7 @@
<el-tag v-if="scope.row.chargeStatus == 5" type="info">
{{ scope.row.chargeStatus_enumText }}
</el-tag>
<el-tag v-else-if="scope.row.statusEnum == 5" type="danger">已作废</el-tag>
<el-tag v-else-if="scope.row.statusEnum == 2" type="success">已签发</el-tag>
<el-tag v-else-if="!scope.row.requestId && scope.row.statusEnum == 1" type="warning">
待保存
@@ -569,7 +572,7 @@ import {
} from '../api';
import { advicePrint, getAdjustPriceSwitchState } from '@/api/public';
import adviceBaseList from '../adviceBaseList.vue';
import { computed, getCurrentInstance, nextTick, ref, watch } from 'vue';
import { computed, getCurrentInstance, nextTick, ref, watch, onMounted, onBeforeUnmount } from 'vue';
import { calculateQuantityByDays } from '@/utils/his';
import OrderGroupDrawer from './orderGroupDrawer';
import PrescriptionHistory from './prescriptionHistory';
@@ -591,7 +594,7 @@ const form = ref({
});
const adviceQueryParams = ref({
searchKey: '',
adviceType: '',
adviceTypes: '', // 🎯 修复:改为 adviceTypes复数
categoryCode: '' // 用于筛选西药(2)和中成药(1)
});
const rowIndex = ref(-1);
@@ -664,7 +667,7 @@ const { method_code, unit_code, rate_code, distribution_category_code, drord_doc
);
// 删除硬编码的adviceTypeList直接使用drord_doctor_type字典
// drord_doctor_type: 1=西药, 2=中成药, 3=诊疗, 4=耗材, 5=全部
// drord_doctor_type: 1=西药, 2=中成药, 3=诊疗, 4=耗材, 5=会诊, 6=全部
const adviceTypeList = ref([
{
label: '西药',
@@ -682,6 +685,10 @@ const adviceTypeList = ref([
label: '耗材',
value: 4,
},
{
label: '会诊',
value: 5,
},
{
label: '全部',
value: '',
@@ -742,6 +749,8 @@ const allPrescriptionsData = ref({}); // 存储所有处方的数据,格式: {
const allPrescriptionCheckStates = ref({}); // 存储每个处方的选中状态,格式: { prescriptionId: { checkedIndexes: [], checkAll: false } }
onMounted(() => {
document.addEventListener('keydown', escKeyListener);
// 初始化时预加载组织数据,避免选择诊疗/会诊项目时显示"无数据"
getOrgList();
// 初始化时自动创建第一个西药处方
if (westernPrescriptions.value.length === 0) {
createNewPrescription();
@@ -1144,7 +1153,7 @@ async function disposalPrint() {
function handleTotalAmount() {
totalAmount.value = prescriptionList.value.reduce((accumulator, currentRow) => {
if (currentRow.chargeStatus != 8) {
if (currentRow.chargeStatus != 8 && currentRow.statusEnum != 5) {
return new Decimal(accumulator).add(currentRow.totalPrice || 0);
} else {
// 跳过已退费项目,保持累加结果不变
@@ -1183,13 +1192,41 @@ function getListInfo(addNewRow) {
// 关键:先等待处方列表数据获取完成
isAdding.value = false;
const res = await getPrescriptionList(props.patientInfo.encounterId);
prescriptionList.value = res.data.map((item) => {
return {
...JSON.parse(item.contentJson),
const contentJson = JSON.parse(item.contentJson);
// 🎯 判断是否为会诊医嘱:
// 方法1检查 category_enum 字段(需要后端重新编译)
// 方法2检查 contentJson 中是否包含会诊相关字段(临时方案)
const categoryEnum = contentJson?.categoryEnum || contentJson?.category_enum || item.category_enum;
const isConsultation = categoryEnum === 31 || categoryEnum === '31' ||
contentJson?.consultationType ||
contentJson?.consultationId ||
contentJson?.consultationRequestId;
let adviceType = item.adviceType;
let adviceType_dictText = item.adviceType_dictText || mapAdviceTypeLabel(item.adviceType);
// 如果是会诊类型,设置为会诊类型
if (isConsultation) {
adviceType = 5; // 前端会诊类型值为 5
adviceType_dictText = '会诊';
}
const result = {
...contentJson,
...item,
doseQuantity: JSON.parse(item.contentJson)?.doseQuantity,
doseUnitCode_dictText: JSON.parse(item.contentJson)?.doseUnitCode_dictText,
doseQuantity: contentJson?.doseQuantity,
doseUnitCode_dictText: contentJson?.doseUnitCode_dictText,
// 🎯 修复:将 adviceType 和 adviceType_dictText 放在最后,确保不被 item 覆盖
adviceType: adviceType,
adviceType_dictText: adviceType_dictText,
// 🎯 修复:确保 orgId 被正确设置(从 positionId 映射)
orgId: item.positionId || item.orgId,
};
return result;
});
getGroupMarkers(); // 更新标记
if (props.activeTab == 'prescription' && addNewRow) {
@@ -1283,7 +1320,7 @@ function handleAddPrescription(prescriptionId, showWarning = true) {
// 重置查询参数
adviceQueryParams.value = {
searchKey: '',
adviceType: '',
adviceTypes: '', // 🎯 修复:改为 adviceTypes复数
categoryCode: ''
};
@@ -1363,7 +1400,7 @@ function handleFocus(row, index) {
let adviceType = row.adviceType || '';
// 根据医嘱类型设置筛选条件
// drord_doctor_type: 1=西药, 2=中成药, 3=诊疗, 4=耗材, 5=全部
// drord_doctor_type: 1=西药, 2=中成药, 3=诊疗, 4=耗材, 5=会诊
if (row.adviceType == 1) {
// 西药
categoryCode = '2';
@@ -1380,6 +1417,10 @@ function handleFocus(row, index) {
// 耗材adviceType = 2后端接口中耗材的adviceType是2
categoryCode = '';
adviceType = 2; // 耗材类型
} else if (row.adviceType == 5) {
// 🎯 会诊adviceType = 5
categoryCode = '';
adviceType = 5; // 会诊类型
} else {
// 全部(5)或其他:显示所有类型
categoryCode = '';
@@ -1387,8 +1428,7 @@ function handleFocus(row, index) {
}
adviceQueryParams.value = {
adviceType: adviceType,
adviceTypes: adviceType ? adviceType.toString() : '1,2,3', // 根据当前类型设置查询类型,避免显示其他类型的数据
adviceTypes: adviceType ? adviceType.toString() : '1,2,3', // 🎯 修复:只保留 adviceTypes复数
categoryCode: categoryCode,
searchKey: adviceQueryParams.value.searchKey || ''
};
@@ -1566,7 +1606,7 @@ function handleDelete() {
handleEmrTreatment();
updateExpandOrder([]);
isAdding.value = false;
adviceQueryParams.value.adviceType = undefined;
adviceQueryParams.value.adviceTypes = undefined; // 🎯 修复:改为 adviceTypes复数
if (sum == selectRows.length) {
proxy.$modal.msgSuccess('删除成功');
return;
@@ -1732,6 +1772,8 @@ function handleSave(prescriptionId) {
saveAdviceType = 2; // 耗材前端4 -> 后端2
} else if (item.adviceType == 2) {
saveAdviceType = 1; // 中成药前端2 -> 后端1
} else if (item.adviceType == 5) {
saveAdviceType = 3; // 会诊前端5 -> 后端3诊疗类
}
// 构造请求参数
@@ -2105,6 +2147,10 @@ function handleSaveSign(row, index, prescriptionId) {
else if (params.adviceType == 2) {
params.adviceType = 1;
}
// 前端5(会诊) -> 后端3 (诊疗类)
else if (params.adviceType == 5) {
params.adviceType = 3;
}
// 发送处理后的 params而不是原始 row
savePrescription({ adviceSaveList: [params] }).then((res) => {
@@ -2122,7 +2168,7 @@ function handleSaveSign(row, index, prescriptionId) {
isAdding.value = false;
// --- 修改结束 ---
}
adviceQueryParams.value.adviceType = undefined;
adviceQueryParams.value.adviceTypes = undefined; // 🎯 修复:改为 adviceTypes复数
}
});
}
@@ -2211,6 +2257,8 @@ function handleSaveBatch(prescriptionId) {
saveAdviceType = 2; // 耗材前端4 -> 后端2
} else if (item.adviceType == 2) {
saveAdviceType = 1; // 中成药前端2 -> 后端1
} else if (item.adviceType == 5) {
saveAdviceType = 3; // 会诊前端5 -> 后端3诊疗类
}
// 构造 contentJson (保持前端UI原始数据)
@@ -2385,10 +2433,21 @@ function setValue(row) {
}
} else {
getOrgList();
prescriptionList.value[rowIndex.value].orgId = JSON.parse(JSON.stringify(row)).positionId;
prescriptionList.value[rowIndex.value].quantity = 1;
prescriptionList.value[rowIndex.value].unitPrice = row.priceList[0].price;
prescriptionList.value[rowIndex.value].totalPrice = row.priceList[0].price;
// 会诊类型adviceType == 5和诊疗类型adviceType == 3的处理
if (row.adviceType == 5) {
// 会诊类型:设置默认值
prescriptionList.value[rowIndex.value].orgId = props.patientInfo.orgId; // 执行科室默认为申请医生的科室
prescriptionList.value[rowIndex.value].quantity = 1; // 执行次数默认1次
prescriptionList.value[rowIndex.value].unitPrice = row.priceList && row.priceList[0] ? row.priceList[0].price : (row.unitPrice || 0);
prescriptionList.value[rowIndex.value].totalPrice = prescriptionList.value[rowIndex.value].unitPrice;
prescriptionList.value[rowIndex.value].categoryEnum = 31; // 会诊的category_enum设置为31
} else {
// 诊疗类型adviceType == 3
prescriptionList.value[rowIndex.value].orgId = JSON.parse(JSON.stringify(row)).positionId;
prescriptionList.value[rowIndex.value].quantity = 1;
prescriptionList.value[rowIndex.value].unitPrice = row.priceList[0].price;
prescriptionList.value[rowIndex.value].totalPrice = row.priceList[0].price;
}
}
}

View File

@@ -169,6 +169,9 @@
<el-tab-pane label="报告查询" name="reportQuery">
<ReportQuery :patientInfo="patientInfo" ref="reportQueryRef" />
</el-tab-pane>
<el-tab-pane label="会诊" name="consultation">
<Consultation :patientInfo="patientInfo" :activeTab="activeTab" ref="consultationRef" />
</el-tab-pane>
</el-tabs>
<div class="overlay" :class="{ 'overlay-disabled': disabled }" v-if="disabled"></div>
</div>
@@ -203,6 +206,7 @@ import {
import prescriptionlist from './components/prescription/prescriptionlist.vue';
import RefundListDialog from './components/prescription/refundListDialog.vue';
import ReportQuery from './components/reportQuery.vue';
import Consultation from './components/consultation.vue';
import PatientList from './components/patientList.vue';
import Diagnosis from './components/diagnosis/diagnosis.vue';
import PrescriptionInfo from './components/prescription/prescriptionInfo.vue';
@@ -294,6 +298,7 @@ const inspectionRef = ref();
const surgeryRef = ref();
const emrRef = ref();
const diagnosisRef = ref();
const consultationRef = ref();
const waitCount = ref(0);
const loading = ref(false);
const { proxy } = getCurrentInstance();
@@ -486,6 +491,9 @@ function handleClick(tab) {
case 'eprescription':
eprescriptionRef.value.getList();
break;
case 'consultation':
consultationRef.value.fetchConsultationList();
break;
}
// if (tab != 'emr') {
// if (!saveStatus.value) {
@@ -586,6 +594,7 @@ function handleCardClick(item, index) {
surgeryRef.value.getList();
diagnosisRef.value.getList();
eprescriptionRef.value.getList();
consultationRef.value.fetchConsultationList();
// emrRef.value.getDetail(item.encounterId);
setTimeout(() => {
loading.value = false;