解决当日已挂号页面费用性质不一致问题

This commit is contained in:
Auora
2025-11-12 09:47:28 +08:00
parent fe8fb3d321
commit 73efeecfc1
6 changed files with 176 additions and 34 deletions

View File

@@ -131,13 +131,16 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract> i
*/
@Override
public Contract getContract(String contractNo) {
// 先从缓存中查找
List<Contract> contractList = getRedisContractList();
for (Contract contract : contractList) {
if (contractNo.equals(contract.getBusNo())) {
return contract;
}
}
return null;
// 缓存中找不到时直接从数据库查询支持contractNo动态变化
return getByContractNo(contractNo);
}
/**

View File

@@ -10,6 +10,16 @@ export function getRegistrationfeeList(query) {
})
}
// 根据位置id筛选医生
export function getPractitionerMetadata(query) {
return request({
url: '/charge-manage/register/practitioner-metadata',
method: 'get',
params: query
})
}
// 查询服务管理详细
export function getRegistrationfeeOne(id) {
return request({

View File

@@ -102,7 +102,7 @@
/>
<el-table-column
label="地点"
align="center"
align="center"
key="locationId_dictText"
prop="locationId_dictText"
/>
@@ -228,6 +228,7 @@
placeholder="请选择提供部门"
check-strictly
clearable
@change="handleDeptChange"
/>
</el-form-item>
</el-col>
@@ -279,6 +280,25 @@
/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="医生:" prop="practitionerId">
<el-select
v-model="form.practitionerId"
placeholder="医生"
clearable
style="width: 240px"
@change="setInfo"
ref="doctorRef"
>
<el-option
v-for="doctor in doctorList"
:key="doctor.id"
:label="`${doctor.name}${doctor.qualification ? ' - '+doctor.qualification : ''}${doctor.department ? ' - '+doctor.department : ''}`"
:value="doctor.id"
></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<div class="title">费用管理</div>
<el-row>
@@ -368,28 +388,13 @@ import {
locationTreeSelect,
delRegistrationfee,
getInitOption,
getPractitionerMetadata,
} from './components/registrationfee';
const router = useRouter();
const { proxy } = getCurrentInstance();
const registrationfeeRef = ref(null); // 初始化 ref
const {
adm_location,
category_code,
service_type_code,
specialty_code,
med_chrgitm_type,
fin_type_code,
yb_type,
} = proxy.useDict(
'adm_location',
'category_code',
'service_type_code',
'specialty_code',
'med_chrgitm_type',
'fin_type_code',
'yb_type'
);
const { proxy } = getCurrentInstance();
const { adm_location, category_code, service_type_code, specialty_code, med_chrgitm_type, fin_type_code, yb_type,} = proxy.useDict( 'adm_location', 'category_code', 'service_type_code', 'specialty_code', 'med_chrgitm_type', 'fin_type_code', 'yb_type');
const registrationfeeList = ref([]);
const open = ref(false);
@@ -403,12 +408,19 @@ const total = ref(0);
const title = ref('');
const activeFlagOptions = ref(undefined);
const appointmentRequiredFlagOptions = ref(undefined);
const doctorList = ref([]);
const deptOptions = ref(undefined); // 部门树选项
const locationOptions = ref(undefined); // 地点树选项
// 是否停用
const statusFlagOptions = ref(undefined);
// 获取选中的医生信息
const getSelectedDoctorInfo = computed(() => {
if (!form.value.practitionerId) return null;
return doctorList.value.find(doctor => doctor.id === form.value.practitionerId) || null;
});
const data = reactive({
form: {},
queryParams: {
@@ -427,7 +439,7 @@ const data = reactive({
// locationId: [{ required: true, message: "地点不能为空", trigger: "blur" }],
name: [{ required: true, message: '服务名称不能为空', trigger: 'blur' }],
contact: [{ required: true, message: '联系人电话不能为空', trigger: 'blur' }],
appointmentRequiredFlag: [{ required: true, message: '预约要求不能为空', trigger: 'blur' }],
practitionerId: [{ required: true, message: '医生不能为空', trigger: 'blur' }],
activeFlag: [{ required: true, message: '活动标识不能为空', trigger: 'blur' }],
chargeName: [{ required: true, message: '名称不能为空', trigger: 'blur' }],
description: [{ required: true, message: '描述不能为空', trigger: 'blur' }],
@@ -452,6 +464,10 @@ function getRegistrationfeeTypeList() {
console.log(response, 'response');
activeFlagOptions.value = response.data.activeFlagOptions; // 活动标记
appointmentRequiredFlagOptions.value = response.data.appointmentRequiredFlagOptions; // 预约必填标记
// 获取医生列表
if (response.data.doctorList) {
doctorList.value = response.data.doctorList;
}
});
}
@@ -531,9 +547,60 @@ function reset() {
ybType: undefined,
title: undefined,
comment: undefined,
practitionerId: undefined,
doctorName: undefined
};
proxy.resetForm('registrationfeeRef');
}
/** 设置医生信息 */
function setInfo() {
const doctor = doctorList.value.find(item => item.id === form.value.practitionerId);
if (doctor) {
form.value.doctorName = doctor.name;
} else {
form.value.doctorName = '';
}
}
/** 科室变化时,加载对应医生 */
function handleDeptChange(orgId) {
if (!orgId) {
doctorList.value = []; // 清空医生
form.value.practitionerId = null;
return;
}
// 调用接口获取该科室下的医生
getPractitionerByOrgId(orgId);
}
/** 根据科室ID获取医生列表 */
function getPractitionerByOrgId(orgId) {
// 假设你已有类似 outpatientregistration 中的 getPractitionerMetadata 接口
// 如果 registrationfee/components/registrationfee.js 中没有,需要补充或复用
getPractitionerMetadata({ orgId }).then((response) => {
doctorList.value = response.data.records || [];
// 如果当前选中的医生不在新列表中,清空选择
if (form.value.practitionerId && !doctorList.value.some(d => d.id === form.value.practitionerId)) {
form.value.practitionerId = null;
form.value.doctorName = '';
}
// 如果医生列表不为空且没有选中的医生,默认选中第一个医生
if (doctorList.value.length > 0 && !form.value.practitionerId) {
form.value.practitionerId = doctorList.value[0].id;
form.value.doctorName = doctorList.value[0].name;
}
}).catch(() => {
doctorList.value = [];
form.value.practitionerId = null;
});
}
/** 取消按钮 */
function cancel() {
open.value = false;
@@ -555,6 +622,11 @@ function handleUpdate(row) {
form.value.cwTypeCode = '1011';
open.value = true;
title.value = '编辑';
// 当编辑时如果有科室ID自动加载对应科室的医生
if (form.value.offeredOrgId) {
getPractitionerByOrgId(form.value.offeredOrgId);
}
}
/** 提交按钮 */
function submitForm() {
@@ -639,6 +711,11 @@ function handleView(row) {
getRegistrationfeeOne(row.id).then((response) => {
console.log(response, 'responsebbbb', row.id);
form.value = response.data;
// 当查看详情时如果有科室ID自动加载对应科室的医生
if (form.value.offeredOrgId) {
getPractitionerByOrgId(form.value.offeredOrgId);
}
});
}
@@ -766,4 +843,25 @@ init();
font-size: large;
margin-bottom: 10px;
}
/* 医生信息显示样式 */
.selected-info {
margin-top: 8px;
padding: 10px;
background-color: #f5f7fa;
border-radius: 4px;
border: 1px solid #e4e7ed;
}
.info-item {
display: inline-block;
margin-right: 16px;
color: #606266;
font-size: 14px;
}
.info-item:first-child {
color: #303133;
font-weight: 500;
}
</style>

View File

@@ -296,23 +296,17 @@ function submit() {
return;
}
dialogLoading.value = true;
// 确保设置默认合同编号,避免非医保结算时查询合同信息
// 根据费用性质动态设置合同编号
if (props.transformedData && props.transformedData.accountFormData) {
props.transformedData.accountFormData.contractNo = '0000';
// 直接使用传入的feeType作为contractNo
// 如果feeType存在就使用否则使用patientInfo中的medfeePaymtdCode最后默认使用'0000'
props.transformedData.accountFormData.contractNo = props.feeType || props.patientInfo?.medfeePaymtdCode || '0000';
}
savePayment({
// paymentEnum: 0,
// kindEnum: 1,
// patientId: props.patientInfo.patientId,
// encounterId: props.patientInfo.encounterId,
// chargeItemIds: props.chargeItemIds,
outpatientRegistrationAddParam: props.transformedData,
chrgBchno: props.chrgBchno,
busNo: props.registerBusNo,
paymentDetails: formData.selfPay,
// ybFlag: '0',
// eleFlag: '0',
// returnedAmount: parseFloat(returnedAmount.value),
})
.then((res) => {
if (res.code == 200) {

View File

@@ -11,7 +11,7 @@
<el-text size="large" style="display: block; margin-bottom: 15px">
退费日期{{ currentDate }}
</el-text>
<el-text size="large">费用性质{{ '自费' }}</el-text>
<el-text size="large">费用性质{{ getFeeTypeText }}</el-text>
<div class="amount-row">
<el-text size="large">应退金额</el-text>
<el-text size="large" type="primary" class="amount">
@@ -112,6 +112,23 @@ import { cancelRegister } from './outpatientregistration';
import { computed, watch, reactive, ref, getCurrentInstance } from 'vue';
import { Delete } from '@element-plus/icons-vue';
// 获取费用性质文本
const getFeeTypeText = computed(() => {
if (!props.medfee_paymtd_code || !Array.isArray(props.medfee_paymtd_code)) {
return '自费';
}
// 如果有feeType根据feeType查找对应的文本
if (props.feeType) {
const dict = props.medfee_paymtd_code.find(item => item.value === props.feeType);
return dict ? dict.label : '自费';
}
// 如果只有一个选项,直接返回第一个选项的文本
if (props.medfee_paymtd_code.length === 1) {
return props.medfee_paymtd_code[0].label || '自费';
}
return '自费';
});
const props = defineProps({
open: {
type: Boolean,
@@ -135,6 +152,14 @@ const props = defineProps({
type: [],
default: [],
},
medfee_paymtd_code: {
type: Array,
default: () => [],
},
feeType: {
type: String,
default: '',
}
});
const { proxy } = getCurrentInstance();

View File

@@ -438,7 +438,8 @@
align="center"
key="contractName"
prop="contractName"
/>
>
</el-table-column>
<el-table-column label="挂号金额" align="center" key="totalPrice" prop="totalPrice">
<template #default="scope">
<span>
@@ -571,6 +572,8 @@
:patientInfo="patientInfo"
:paymentId="paymentId"
:chargeItemIds="chargeItemIdList"
:feeType="(patientInfo && patientInfo.medfeePaymtdCode) || (form && form.value && form.value.contractNo) || ''"
:medfee_paymtd_code="medfee_paymtd_code"
/>
<ReprintDialog
:open="openReprintDialog"
@@ -606,7 +609,7 @@ import { invokeYbPlugin } from '@/api/public';
import patientInfoDialog from './components/patientInfoDialog';
import PatientAddDialog from './components/patientAddDialog';
import patientList from './components/patientList';
import { nextTick, ref } from 'vue';
import { nextTick, ref, onMounted, onUnmounted } from 'vue';
import ChargeDialog from './components/chargeDialog.vue';
import RefundDialog from './components/refundDialog.vue';
import ReprintDialog from './components/reprintDialog.vue';
@@ -771,6 +774,15 @@ onUnmounted(() => {
const { queryParams, form, rules } = toRefs(data);
/** 根据contractNo获取费用性质名称 */
function getFeeTypeName(contractNo) {
if (!contractNo || !medfee_paymtd_code || !Array.isArray(medfee_paymtd_code)) {
return '';
}
const dictItem = medfee_paymtd_code.find(item => item.value === contractNo);
return dictItem ? dictItem.label : '';
}
/** 初期所用数据查询 */
function getInitData() {
getInit().then((response) => {