diff --git a/openhis-server-new/openhis-domain/src/main/java/com/openhis/financial/service/impl/ContractServiceImpl.java b/openhis-server-new/openhis-domain/src/main/java/com/openhis/financial/service/impl/ContractServiceImpl.java index b2ab9295..daba0620 100644 --- a/openhis-server-new/openhis-domain/src/main/java/com/openhis/financial/service/impl/ContractServiceImpl.java +++ b/openhis-server-new/openhis-domain/src/main/java/com/openhis/financial/service/impl/ContractServiceImpl.java @@ -131,13 +131,16 @@ public class ContractServiceImpl extends ServiceImpl i */ @Override public Contract getContract(String contractNo) { + // 先从缓存中查找 List contractList = getRedisContractList(); for (Contract contract : contractList) { if (contractNo.equals(contract.getBusNo())) { return contract; } } - return null; + + // 缓存中找不到时,直接从数据库查询,支持contractNo动态变化 + return getByContractNo(contractNo); } /** diff --git a/openhis-ui-vue3/src/views/basicservices/registrationfee/components/registrationfee.js b/openhis-ui-vue3/src/views/basicservices/registrationfee/components/registrationfee.js index 0c81cc58..57c0db65 100644 --- a/openhis-ui-vue3/src/views/basicservices/registrationfee/components/registrationfee.js +++ b/openhis-ui-vue3/src/views/basicservices/registrationfee/components/registrationfee.js @@ -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({ diff --git a/openhis-ui-vue3/src/views/basicservices/registrationfee/index.vue b/openhis-ui-vue3/src/views/basicservices/registrationfee/index.vue index 8466cfe0..fa5d3395 100644 --- a/openhis-ui-vue3/src/views/basicservices/registrationfee/index.vue +++ b/openhis-ui-vue3/src/views/basicservices/registrationfee/index.vue @@ -102,7 +102,7 @@ /> @@ -228,6 +228,7 @@ placeholder="请选择提供部门" check-strictly clearable + @change="handleDeptChange" /> @@ -279,6 +280,25 @@ /> + + + + + + +
费用管理
@@ -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; +} \ No newline at end of file diff --git a/openhis-ui-vue3/src/views/charge/outpatientregistration/components/chargeDialog.vue b/openhis-ui-vue3/src/views/charge/outpatientregistration/components/chargeDialog.vue index fb64ad54..034d26b8 100644 --- a/openhis-ui-vue3/src/views/charge/outpatientregistration/components/chargeDialog.vue +++ b/openhis-ui-vue3/src/views/charge/outpatientregistration/components/chargeDialog.vue @@ -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) { diff --git a/openhis-ui-vue3/src/views/charge/outpatientregistration/components/refundDialog.vue b/openhis-ui-vue3/src/views/charge/outpatientregistration/components/refundDialog.vue index cbf68dcb..d77859f1 100644 --- a/openhis-ui-vue3/src/views/charge/outpatientregistration/components/refundDialog.vue +++ b/openhis-ui-vue3/src/views/charge/outpatientregistration/components/refundDialog.vue @@ -11,7 +11,7 @@ 退费日期:{{ currentDate }} - 费用性质:{{ '自费' }} + 费用性质:{{ getFeeTypeText }}
应退金额: @@ -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(); diff --git a/openhis-ui-vue3/src/views/charge/outpatientregistration/index.vue b/openhis-ui-vue3/src/views/charge/outpatientregistration/index.vue index 7a54bd6d..aabfe5d1 100644 --- a/openhis-ui-vue3/src/views/charge/outpatientregistration/index.vue +++ b/openhis-ui-vue3/src/views/charge/outpatientregistration/index.vue @@ -438,7 +438,8 @@ align="center" key="contractName" prop="contractName" - /> + > +