95-门诊医生站开立会诊申请单界面PRD_2026-01-15,全部功能。
This commit is contained in:
@@ -0,0 +1,402 @@
|
||||
<template>
|
||||
<div class="app-container consultation-confirmation">
|
||||
<div class="page-header">
|
||||
<span class="tab-title">会诊确认</span>
|
||||
</div>
|
||||
|
||||
<div class="action-bar no-print">
|
||||
<el-button type="success" @click="handlePrint">打印</el-button>
|
||||
<el-button @click="handleRefresh">刷新</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
:disabled="!currentRow"
|
||||
@click="handleConfirm"
|
||||
>
|
||||
{{ confirmButtonText }}
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
:disabled="!canSign"
|
||||
@click="handleSign"
|
||||
>
|
||||
签名
|
||||
</el-button>
|
||||
</div>
|
||||
|
||||
<div class="list-section no-print">
|
||||
<el-table
|
||||
:data="tableData"
|
||||
border
|
||||
stripe
|
||||
highlight-current-row
|
||||
@current-change="handleRowChange"
|
||||
>
|
||||
<el-table-column type="index" width="60" label="序号" align="center" />
|
||||
<el-table-column label="紧急" width="70" align="center">
|
||||
<template #default="scope">
|
||||
<el-checkbox v-model="scope.row.urgent" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="consultationId" label="申请单号" min-width="160" />
|
||||
<el-table-column prop="patientName" label="病人姓名" min-width="100" />
|
||||
<el-table-column prop="consultationTime" label="会诊时间" min-width="160" />
|
||||
<el-table-column prop="invitee" label="邀请对象" min-width="120" />
|
||||
<el-table-column prop="applyDept" label="申请科室" min-width="120" />
|
||||
<el-table-column prop="applyDoctor" label="申请医师" min-width="120" />
|
||||
<el-table-column prop="applyTime" label="申请时间" min-width="160" />
|
||||
<el-table-column label="确认" width="70" align="center">
|
||||
<template #default="scope">
|
||||
<el-checkbox v-model="scope.row.confirmed" disabled />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="签名" width="70" align="center">
|
||||
<template #default="scope">
|
||||
<el-checkbox v-model="scope.row.signed" disabled />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
|
||||
<div class="form-section">
|
||||
<div class="section-title">会诊记录单</div>
|
||||
<el-form :model="formData" label-width="110px">
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="病人姓名">
|
||||
<el-input v-model="formData.patientName" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="性别">
|
||||
<el-input v-model="formData.gender" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="年龄">
|
||||
<el-input v-model="formData.age" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="就诊卡号">
|
||||
<el-input v-model="formData.cardNo" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="申请单号">
|
||||
<el-input v-model="formData.consultationId" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="申请科室">
|
||||
<el-input v-model="formData.applyDept" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="会诊时间">
|
||||
<el-input v-model="formData.consultationTime" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="紧急标志">
|
||||
<el-input :model-value="formData.urgent ? '是' : '否'" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="会诊邀请对象">
|
||||
<el-input v-model="formData.invitee" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="提交医生">
|
||||
<el-input v-model="formData.applyDoctor" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="提交时间">
|
||||
<el-input v-model="formData.applyTime" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-form-item label="病史及目的">
|
||||
<el-input v-model="formData.history" type="textarea" :rows="3" disabled />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="会诊确认参加医师" required>
|
||||
<el-input v-model="formData.confirmingPhysician" placeholder="请输入会诊确认参加医师" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="会诊意见" required>
|
||||
<el-input v-model="formData.opinion" type="textarea" :rows="4" placeholder="请输入会诊意见" />
|
||||
</el-form-item>
|
||||
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="所属医生">
|
||||
<el-input v-model="formData.confirmDoctor" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="代表科室">
|
||||
<el-input v-model="formData.confirmDept" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="签名医生">
|
||||
<el-input v-model="formData.signDoctor" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="签名时间">
|
||||
<el-input v-model="formData.signTime" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="consultationConfirmation">
|
||||
import { computed, ref } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import useUserStore from '@/store/modules/user'
|
||||
|
||||
const userStore = useUserStore()
|
||||
|
||||
const buildMockRows = () => ([
|
||||
{
|
||||
consultationId: 'CS20250812001',
|
||||
urgent: false,
|
||||
patientName: '陈明',
|
||||
gender: '男',
|
||||
age: '45',
|
||||
cardNo: 'CARD20250812001',
|
||||
consultationTime: '2025-08-12 17:48',
|
||||
invitee: '演示测试',
|
||||
applyDept: '内科',
|
||||
applyDoctor: '徐斌',
|
||||
applyTime: '2025-08-12 16:30',
|
||||
history: '胸闷、气短一周,既往有高血压史。',
|
||||
confirmingPhysician: '',
|
||||
opinion: '',
|
||||
confirmed: false,
|
||||
signed: false
|
||||
},
|
||||
{
|
||||
consultationId: 'CS20250812002',
|
||||
urgent: true,
|
||||
patientName: '赵敏',
|
||||
gender: '女',
|
||||
age: '32',
|
||||
cardNo: 'CARD20250812002',
|
||||
consultationTime: '2025-08-12 18:10',
|
||||
invitee: '李医生',
|
||||
applyDept: '神经内科',
|
||||
applyDoctor: '王婷',
|
||||
applyTime: '2025-08-12 16:50',
|
||||
history: '头晕伴视物模糊3天。',
|
||||
confirmingPhysician: '',
|
||||
opinion: '',
|
||||
confirmed: false,
|
||||
signed: false
|
||||
}
|
||||
])
|
||||
|
||||
const tableData = ref(buildMockRows())
|
||||
const currentRow = ref(null)
|
||||
|
||||
const formData = ref({
|
||||
consultationId: '',
|
||||
urgent: false,
|
||||
patientName: '',
|
||||
gender: '',
|
||||
age: '',
|
||||
cardNo: '',
|
||||
consultationTime: '',
|
||||
invitee: '',
|
||||
applyDept: '',
|
||||
applyDoctor: '',
|
||||
applyTime: '',
|
||||
history: '',
|
||||
confirmingPhysician: '',
|
||||
opinion: '',
|
||||
confirmDoctor: '',
|
||||
confirmDept: '',
|
||||
signDoctor: '',
|
||||
signTime: ''
|
||||
})
|
||||
|
||||
const confirmButtonText = computed(() => {
|
||||
if (!currentRow.value) {
|
||||
return '确认'
|
||||
}
|
||||
return currentRow.value.confirmed ? '取消确认' : '确认'
|
||||
})
|
||||
|
||||
const canSign = computed(() => {
|
||||
return !!currentRow.value && currentRow.value.confirmed && !currentRow.value.signed
|
||||
})
|
||||
|
||||
const formatDateTime = (date = new Date()) => {
|
||||
const pad = (value) => String(value).padStart(2, '0')
|
||||
const yyyy = date.getFullYear()
|
||||
const mm = pad(date.getMonth() + 1)
|
||||
const dd = pad(date.getDate())
|
||||
const hh = pad(date.getHours())
|
||||
const mi = pad(date.getMinutes())
|
||||
const ss = pad(date.getSeconds())
|
||||
return `${yyyy}-${mm}-${dd} ${hh}:${mi}:${ss}`
|
||||
}
|
||||
|
||||
const getDoctorName = () => userStore.nickName || userStore.name || '当前医生'
|
||||
const getDoctorDept = () => userStore.orgName || '当前科室'
|
||||
|
||||
const applyRowToForm = (row) => {
|
||||
if (!row) {
|
||||
Object.keys(formData.value).forEach((key) => {
|
||||
formData.value[key] = key === 'urgent' ? false : ''
|
||||
})
|
||||
return
|
||||
}
|
||||
formData.value.consultationId = row.consultationId
|
||||
formData.value.urgent = row.urgent
|
||||
formData.value.patientName = row.patientName
|
||||
formData.value.gender = row.gender
|
||||
formData.value.age = row.age
|
||||
formData.value.cardNo = row.cardNo
|
||||
formData.value.consultationTime = row.consultationTime
|
||||
formData.value.invitee = row.invitee
|
||||
formData.value.applyDept = row.applyDept
|
||||
formData.value.applyDoctor = row.applyDoctor
|
||||
formData.value.applyTime = row.applyTime
|
||||
formData.value.history = row.history
|
||||
formData.value.confirmingPhysician = row.confirmingPhysician
|
||||
formData.value.opinion = row.opinion
|
||||
formData.value.confirmDoctor = row.confirmDoctor || ''
|
||||
formData.value.confirmDept = row.confirmDept || ''
|
||||
formData.value.signDoctor = row.signDoctor || ''
|
||||
formData.value.signTime = row.signTime || ''
|
||||
}
|
||||
|
||||
const handleRowChange = (row) => {
|
||||
currentRow.value = row
|
||||
applyRowToForm(row)
|
||||
}
|
||||
|
||||
const handleConfirm = () => {
|
||||
if (!currentRow.value) {
|
||||
return
|
||||
}
|
||||
if (!currentRow.value.confirmed) {
|
||||
if (!formData.value.opinion.trim()) {
|
||||
ElMessage.warning('请先填写会诊意见')
|
||||
return
|
||||
}
|
||||
if (!formData.value.confirmingPhysician.trim()) {
|
||||
ElMessage.warning('请先填写会诊确认参加医师')
|
||||
return
|
||||
}
|
||||
currentRow.value.confirmed = true
|
||||
currentRow.value.confirmingPhysician = formData.value.confirmingPhysician
|
||||
currentRow.value.opinion = formData.value.opinion
|
||||
currentRow.value.confirmDoctor = getDoctorName()
|
||||
currentRow.value.confirmDept = getDoctorDept()
|
||||
formData.value.confirmDoctor = currentRow.value.confirmDoctor
|
||||
formData.value.confirmDept = currentRow.value.confirmDept
|
||||
ElMessage.success('会诊已确认')
|
||||
return
|
||||
}
|
||||
if (currentRow.value.signed) {
|
||||
ElMessage.warning('已签名的会诊无法取消确认')
|
||||
return
|
||||
}
|
||||
currentRow.value.confirmed = false
|
||||
currentRow.value.confirmDoctor = ''
|
||||
currentRow.value.confirmDept = ''
|
||||
formData.value.confirmDoctor = ''
|
||||
formData.value.confirmDept = ''
|
||||
ElMessage.success('已取消确认')
|
||||
}
|
||||
|
||||
const handleSign = () => {
|
||||
if (!currentRow.value) {
|
||||
return
|
||||
}
|
||||
if (!currentRow.value.confirmed) {
|
||||
ElMessage.warning('请先确认会诊申请')
|
||||
return
|
||||
}
|
||||
currentRow.value.signed = true
|
||||
currentRow.value.signDoctor = getDoctorName()
|
||||
currentRow.value.signTime = formatDateTime()
|
||||
formData.value.signDoctor = currentRow.value.signDoctor
|
||||
formData.value.signTime = currentRow.value.signTime
|
||||
ElMessage.success('签名完成')
|
||||
}
|
||||
|
||||
const handlePrint = () => {
|
||||
if (!currentRow.value) {
|
||||
ElMessage.warning('请先选择会诊申请')
|
||||
return
|
||||
}
|
||||
window.print()
|
||||
}
|
||||
|
||||
const handleRefresh = () => {
|
||||
tableData.value = buildMockRows()
|
||||
currentRow.value = null
|
||||
applyRowToForm(null)
|
||||
ElMessage.success('已刷新')
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.consultation-confirmation .page-header {
|
||||
padding-bottom: 8px;
|
||||
border-bottom: 1px solid #e5e7eb;
|
||||
}
|
||||
|
||||
.consultation-confirmation .tab-title {
|
||||
display: inline-block;
|
||||
font-size: 16px;
|
||||
font-weight: 700;
|
||||
color: #4a89dc;
|
||||
border-bottom: 2px solid #4a89dc;
|
||||
padding-bottom: 6px;
|
||||
}
|
||||
|
||||
.action-bar {
|
||||
margin: 16px 0;
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.list-section {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.section-title {
|
||||
font-size: 15px;
|
||||
font-weight: 600;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
@media print {
|
||||
.no-print {
|
||||
display: none !important;
|
||||
}
|
||||
.consultation-confirmation {
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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',
|
||||
});
|
||||
}
|
||||
|
||||
1287
openhis-ui-vue3/src/views/doctorstation/components/consultation.vue
Normal file
1287
openhis-ui-vue3/src/views/doctorstation/components/consultation.vue
Normal file
File diff suppressed because it is too large
Load Diff
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user