From b5b91d8971f8218a1b53b4eaf2e0ab3ba8426b5a Mon Sep 17 00:00:00 2001 From: chenjinyang <1950285536@qq.com> Date: Tue, 10 Feb 2026 16:49:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90100=E9=9C=80=E6=B1=82,?= =?UTF-8?q?=E8=A1=A5=E5=85=8599=E9=9C=80=E6=B1=82=E8=BF=BD=E6=BA=AF?= =?UTF-8?q?=E6=9C=AF=E4=B8=AD=E4=BA=A7=E7=94=9F=E7=9A=84=E8=B4=B9=E7=94=A8?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=B4=B9=E7=94=A8=E9=A1=B9=E6=97=B6=E5=90=91?= =?UTF-8?q?=E8=A1=A8=E4=B8=AD=E6=8F=92=E5=85=A5SourceBillNo=E5=92=8Cgenera?= =?UTF-8?q?te=5Fsource=5Fenum=E5=AD=97=E6=AE=B5=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SurgicalScheduleController.java | 28 + .../DoctorStationAdviceAppServiceImpl.java | 28 +- openhis-ui-vue3/src/api/surgicalschedule.js | 9 + .../src/views/surgicalschedule/index.vue | 194 +++-- .../surgicalschedule/temporaryMedical.vue | 673 ++++++++++++++++++ 5 files changed, 882 insertions(+), 50 deletions(-) create mode 100644 openhis-ui-vue3/src/views/surgicalschedule/temporaryMedical.vue diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/clinicalmanage/controller/SurgicalScheduleController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/clinicalmanage/controller/SurgicalScheduleController.java index 746a94a3..3666bdcd 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/clinicalmanage/controller/SurgicalScheduleController.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/clinicalmanage/controller/SurgicalScheduleController.java @@ -2,11 +2,14 @@ package com.openhis.web.clinicalmanage.controller; import com.baomidou.mybatisplus.core.metadata.IPage; import com.core.common.core.domain.R; +import com.core.common.core.domain.model.LoginUser; +import com.core.common.utils.SecurityUtils; import com.openhis.web.clinicalmanage.appservice.ISurgicalScheduleAppService; import com.openhis.web.clinicalmanage.dto.OpCreateScheduleDto; import com.openhis.web.clinicalmanage.dto.OpScheduleDto; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.apache.catalina.User; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; @@ -98,4 +101,29 @@ public class SurgicalScheduleController { surgicalScheduleAppService.exportSurgerySchedule(opScheduleDto, response); } + /** + * 验证密码 + * @param password 密码 + * @return 结果 + */ + @PostMapping(value = "/checkPassword") + public R checkPassword(@RequestParam String password) { + try { + //获取当前登录用户信息 + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (loginUser == null) { + return R.fail("用户未登录"); + } + // 直接使用 SecurityUtils.matchesPassword 进行密码验证 + boolean isMatch = SecurityUtils.matchesPassword(password, loginUser.getPassword()); + if (isMatch) { + return R.ok(true); + } else { + return R.fail("密码错误"); + } + } catch (Exception e) { + return R.fail("密码验证失败:" + e.getMessage()); + } + } + } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationAdviceAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationAdviceAppServiceImpl.java index 37552c92..b276f344 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationAdviceAppServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationAdviceAppServiceImpl.java @@ -635,6 +635,10 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp } else { chargeItem.setGenerateSourceEnum(GenerateSource.DOCTOR_PRESCRIPTION.getValue()); } + // 来源业务单据号:如果前端指定了来源业务单据号,设置该字段 + if (adviceSaveDto.getSourceBillNo() != null) { + chargeItem.setSourceBillNo(adviceSaveDto.getSourceBillNo()); + } chargeItem.setPrescriptionNo(adviceSaveDto.getPrescriptionNo()); // 处方号 chargeItem.setPatientId(adviceSaveDto.getPatientId()); // 患者 chargeItem.setContextEnum(adviceSaveDto.getAdviceType()); // 类型 @@ -652,10 +656,6 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp chargeItem.setConditionId(adviceSaveDto.getConditionId()); // 诊断id chargeItem.setEncounterDiagnosisId(adviceSaveDto.getEncounterDiagnosisId()); // 就诊诊断id chargeItem.setDispenseId(dispenseId); // 发放ID - // 来源业务单据号:如果前端指定了来源业务单据号,设置该字段 - if (adviceSaveDto.getSourceBillNo() != null) { - chargeItem.setSourceBillNo(adviceSaveDto.getSourceBillNo()); - } chargeItem.setTenantId(tenantId); // 设置租户ID (修复本次报错) chargeItem.setCreateBy(currentUsername); // 设置创建人 chargeItem.setCreateTime(curDate); // 设置创建时间 @@ -768,6 +768,16 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp // 保存耗材费用项 chargeItem = new ChargeItem(); + // 生成来源:如果前端指定了生成来源,使用前端值;否则使用默认的医生开立 + if (adviceSaveDto.getGenerateSourceEnum() != null) { + chargeItem.setGenerateSourceEnum(adviceSaveDto.getGenerateSourceEnum()); + } else { + chargeItem.setGenerateSourceEnum(GenerateSource.DOCTOR_PRESCRIPTION.getValue()); + } + // 来源业务单据号:如果前端指定了来源业务单据号,设置该字段 + if (adviceSaveDto.getSourceBillNo() != null) { + chargeItem.setSourceBillNo(adviceSaveDto.getSourceBillNo()); + } chargeItem.setId(adviceSaveDto.getChargeItemId()); // 费用项id chargeItem.setTenantId(tenantId); // 补全租户ID chargeItem.setCreateBy(currentUsername); // 补全创建人 @@ -909,6 +919,16 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp // 保存时保存诊疗费用项 if (is_save) { chargeItem = new ChargeItem(); + // 生成来源:如果前端指定了生成来源,使用前端值;否则使用默认的医生开立 + if (adviceSaveDto.getGenerateSourceEnum() != null) { + chargeItem.setGenerateSourceEnum(adviceSaveDto.getGenerateSourceEnum()); + } else { + chargeItem.setGenerateSourceEnum(GenerateSource.DOCTOR_PRESCRIPTION.getValue()); + } + // 来源业务单据号:如果前端指定了来源业务单据号,设置该字段 + if (adviceSaveDto.getSourceBillNo() != null) { + chargeItem.setSourceBillNo(adviceSaveDto.getSourceBillNo()); + } chargeItem.setId(adviceSaveDto.getChargeItemId()); // 费用项id chargeItem.setTenantId(tenantId); // 补全租户ID chargeItem.setCreateBy(currentUsername); // 补全创建人 diff --git a/openhis-ui-vue3/src/api/surgicalschedule.js b/openhis-ui-vue3/src/api/surgicalschedule.js index 8616869c..274b5d9a 100644 --- a/openhis-ui-vue3/src/api/surgicalschedule.js +++ b/openhis-ui-vue3/src/api/surgicalschedule.js @@ -59,4 +59,13 @@ export function exportSurgerySchedule(query) { method: 'get', params: query }) +} + +//签名密码验证 +export function checkPassword(params) { + return request({ + url: '/clinical-manage/surgery-schedule/checkPassword', + method: 'POST', + params: params + }) } \ No newline at end of file diff --git a/openhis-ui-vue3/src/views/surgicalschedule/index.vue b/openhis-ui-vue3/src/views/surgicalschedule/index.vue index 8e5d190c..6ea0a1e6 100644 --- a/openhis-ui-vue3/src/views/surgicalschedule/index.vue +++ b/openhis-ui-vue3/src/views/surgicalschedule/index.vue @@ -55,6 +55,9 @@ 计费 + + 医嘱 + 导出表格 @@ -62,7 +65,7 @@ - + @@ -810,6 +825,9 @@ import { useDict } from '@/utils/dict' import download from '@/plugins/download' import Prescriptionlist from '@/views/clinicmanagement/bargain/component/prescriptionlist.vue' import useUserStore from '@/store/modules/user' +import { ElMessage } from 'element-plus' +// 导入计费相关接口 +import { getPrescriptionList } from '@/views/clinicmanagement/bargain/component/api' // API 导入 import { getSurgerySchedulePage, addSurgerySchedule, updateSurgerySchedule, deleteSurgerySchedule, getSurgeryScheduleDetail } from '@/api/surgicalschedule' @@ -820,6 +838,7 @@ import { getTestResultPage} from '@/views/inpatientDoctor/home/components/applic import { getTenantPage } from '@/api/system/tenant' import { getContract } from '@/views/inpatientDoctor/home/components/api.js' import SurgeryCharge from '../charge/surgerycharge/index.vue' +import TemporaryMedical from './temporaryMedical.vue' const { proxy } = getCurrentInstance() const userStore = useUserStore() @@ -947,6 +966,13 @@ const chargePatientInfo = ref({}) const chargeSurgeryInfo = ref({}) const prescriptionRef = ref() +// 临时医嘱弹窗 +const showTemporaryMedical = ref(false) +const temporaryMedicalTitle = ref('门诊术中临时医嘱') +const temporaryPatientInfo = ref({}) +const temporaryBillingMedicines = ref([]) +const temporaryAdvices = ref([]) + // 下拉列表数据 const orgList = ref([]) const deptList = ref([]) @@ -1026,8 +1052,7 @@ function loadOrgList() { orgList.value = [] } }) - .catch(error => { - console.error('加载卫生机构列表失败:', error) + .catch(() => { proxy.$modal.msgError('获取卫生机构列表失败') orgList.value = [] }) @@ -1046,7 +1071,6 @@ function loadDeptList() { } }) .catch(error => { - console.error('加载科室列表失败:', error) proxy.$modal.msgError('获取科室列表失败') deptList.value = [] }) @@ -1065,7 +1089,6 @@ function loadDoctorList() { } }) .catch(error => { - console.error('加载医生列表失败:', error) proxy.$modal.msgError('获取医生列表失败') doctorList.value = [] }) @@ -1084,7 +1107,6 @@ function loadNurseList() { } }) .catch(error => { - console.error('加载护士列表失败:', error) proxy.$modal.msgError('获取护士列表失败') nurseList.value = [] }) @@ -1103,7 +1125,6 @@ function loadOperatingRoomList() { } }) .catch(error => { - console.error('加载手术室列表失败:', error) proxy.$modal.msgError('获取手术室列表失败') operatingRoomList.value = [] }) @@ -1116,7 +1137,6 @@ function getList() { surgeryList.value = res.data.records total.value = res.data.total }).catch(error => { - console.error('获取手术安排列表失败:', error) proxy.$modal.msgError('获取手术安排列表失败,请稍后重试') surgeryList.value = [] total.value = 0 @@ -1170,8 +1190,7 @@ function handleEdit(row) { } else { proxy.$modal.msgError('获取手术安排详情失败') } - }).catch(error => { - console.error('获取手术安排详情失败:', error) + }).catch(() => { proxy.$modal.msgError('获取手术安排详情失败') }) open.value = true @@ -1190,8 +1209,7 @@ function handleView(row) { } else { proxy.$modal.msgError('获取手术安排详情失败') } - }).catch(error => { - console.error('获取手术安排详情失败:', error) + }).catch(() => { proxy.$modal.msgError('获取手术安排详情失败') }) open.value = true @@ -1215,7 +1233,8 @@ function handleDelete(row) { }).then(() => { getPageList() proxy.$modal.msgSuccess('手术安排已取消') - }).catch(error => { + }).catch(() => { + return }) } @@ -1232,32 +1251,18 @@ async function handleChargeCharge(row) { return } - console.log('计费按钮被点击,行数据:', row) - - // 检查用户信息中的机构信息 - console.log('完整的用户信息:', JSON.stringify(userStore, null, 2)) - console.log('用户机构信息:', { - organizationId: userStore.organizationId, - orgId: userStore.orgId, - tenantId: userStore.tenantId, - userInfo: userStore.userInfo - }) - // 调用接口获取账户信息 let accountId = null try { const contractResult = await getContract({ encounterId: row.visitId }) - console.log('账户信息接口返回:', contractResult) - if (contractResult.code === 200 && contractResult.data && contractResult.data.length > 0) { // 从返回数据中提取accountId - data是数组,取第一个元素的accountId accountId = contractResult.data[0].accountId || contractResult.data[0].id - console.log('获取到的accountId:', accountId) } else { - console.warn('获取账户信息失败:', contractResult.msg) + proxy.$modal.msgError('获取账户信息失败') } } catch (error) { - console.error('调用账户信息接口出错:', error) + return } // 设置计费弹窗数据 - 直接复制划价页面的逻辑 @@ -1279,7 +1284,9 @@ async function handleChargeCharge(row) { // 添加账户ID accountId: accountId, // 添加手术申请单号用于追溯 - sourceBillNo: row.applyId || row.operCode + sourceBillNo: row.applyId, + //添加计费标志手术计费 + generateSourceEnum: 6 } chargeSurgeryInfo.value = { @@ -1287,21 +1294,12 @@ async function handleChargeCharge(row) { surgeryNo: row.operCode } - console.log('计费弹窗数据设置完成:', { - chargeDialogTitle: chargeDialogTitle.value, - chargePatientInfo: chargePatientInfo.value, - chargeSurgeryInfo: chargeSurgeryInfo.value - }) - // 打开计费弹窗 showChargeDialog.value = true - console.log('计费弹窗状态:', showChargeDialog.value) // 延迟加载处方列表,确保组件已经渲染 nextTick(() => { - console.log('nextTick执行,prescriptionRef:', prescriptionRef.value) if (prescriptionRef.value && prescriptionRef.value.getListInfo) { - console.log('调用prescriptionRef.getListInfo()') prescriptionRef.value.getListInfo() } }) @@ -1314,6 +1312,114 @@ function closeChargeDialog() { chargeSurgeryInfo.value = {} } +// 处理医嘱按钮点击事件 +function handleMedicalAdvice(row) { + // 如果没有传入行数据,使用选中的行 + if (!row && selectedRow.value) { + row = selectedRow.value + } + + // 如果还是没有行数据,显示提示 + if (!row) { + proxy.$modal.msgWarning('请先选择要开具医嘱的手术安排') + return + } + + // 设置临时医嘱弹窗数据 + temporaryPatientInfo.value = { + patientName: row.patientName, + visitId: row.visitId, + operCode: row.operCode, + roomCode: row.roomCode, + doctorName: userStore.nickName, + role: userStore.roles[0], + } + + // 初始化临时医嘱列表 + temporaryAdvices.value = [] + + // 调用计费接口获取数据 + getPrescriptionList(row.visitId).then((res) => { + if (res.code === 200 && res.data) { + // 过滤数据,只保留 adviceType 值为 1 的药品 + const filteredItems = res.data.filter(item => { + try { + // 尝试从 contentJson 中解析数据 + const contentData = JSON.parse(item.contentJson) + const adviceType = Number(contentData.adviceType) + return adviceType === 3 + } catch (e) { + // 如果解析失败,尝试使用顶层的 adviceType + const adviceType = Number(item.adviceType) + return adviceType === 3 + } + }) + + // 将过滤后的数据转换为临时医嘱需要的格式 + temporaryBillingMedicines.value = filteredItems.map(item => { + try { + // 从 contentJson 中解析详细数据 + const contentData = JSON.parse(item.contentJson) + return { + medicineName: contentData.adviceName || item.adviceName || '', + specification: contentData.volume || contentData.specification || '', + quantity: contentData.quantity || item.quantity || 0, + batchNumber: contentData.lotNumber || item.lotNumber || '', + unitPrice: contentData.unitPrice || item.unitPrice || 0, + subtotal: contentData.totalPrice || item.totalPrice || 0, + insuranceType: contentData.insuranceType === 1 ? '医保' : '自费' + } + } catch (e) { + // 如果解析失败,使用顶层数据 + return { + medicineName: item.adviceName || '', + specification: item.specification || '', + quantity: item.quantity || 0, + batchNumber: item.lotNumber || '', + unitPrice: item.unitPrice || 0, + subtotal: item.totalPrice || 0, + insuranceType: item.insuranceType === 1 ? '医保' : '自费' + } + } + }) + } else { + // 如果没有数据或接口调用失败,初始化空列表 + temporaryBillingMedicines.value = [] + } + }).catch(() => { + temporaryBillingMedicines.value = [] + }) + + // 打开临时医嘱弹窗 + showTemporaryMedical.value = true +} + +// 关闭临时医嘱弹窗 +function closeTemporaryMedical() { + showTemporaryMedical.value = false + temporaryPatientInfo.value = {} + temporaryBillingMedicines.value = [] + temporaryAdvices.value = [] +} + +// 处理临时医嘱提交 +function handleTemporaryMedicalSubmit(data) { + // 这里可以调用后端API保存临时医嘱数据 + proxy.$modal.msgSuccess('临时医嘱提交成功') + closeTemporaryMedical() +} + +// 处理临时医嘱取消 +function handleTemporaryMedicalCancel() { + closeTemporaryMedical() +} + +// 处理删除临时医嘱 +function handleDeleteTemporaryAdvice(index) { + temporaryAdvices.value.splice(index, 1) + proxy.$modal.msgSuccess('临时医嘱已删除') +} + // 格式化计费弹窗中的日期 function formatChargeDate(date) { if (!date) return '-' @@ -1394,15 +1500,13 @@ function submitForm() { proxy.$refs['surgeryRef'].validate((valid) => { if (valid) { const submitData = { ...form } - console.log("scheduleId:", form.scheduleId) if (!form.scheduleId) { // 新增手术安排 addSurgerySchedule(submitData).then((res) => { proxy.$modal.msgSuccess('新增成功') open.value = false getPageList() - }).catch(error => { - console.error('新增手术安排失败:', error) + }).catch(() => { proxy.$message.error('新增手术安排失败,请检查表单信息') }) } else { @@ -1411,8 +1515,7 @@ function submitForm() { proxy.$modal.msgSuccess('修改成功') open.value = false getPageList() - }).catch(error => { - console.error('更新手术安排失败:', error) + }).catch(() => { proxy.$message.error('更新手术安排失败,请检查表单信息') }) } @@ -1455,8 +1558,7 @@ function getSurgicalScheduleList() { const responseData = res.data.data || res.data applyList.value = responseData.records || [] applyTotal.value = responseData.total || 0 - }).catch(error => { - console.error('获取手术申请列表失败:', error) + }).catch(() => { proxy.$modal.msgError('获取手术申请列表失败,请稍后重试') applyList.value = [] applyTotal.value = 0 diff --git a/openhis-ui-vue3/src/views/surgicalschedule/temporaryMedical.vue b/openhis-ui-vue3/src/views/surgicalschedule/temporaryMedical.vue new file mode 100644 index 00000000..dfd09089 --- /dev/null +++ b/openhis-ui-vue3/src/views/surgicalschedule/temporaryMedical.vue @@ -0,0 +1,673 @@ + + + + + \ No newline at end of file