From 09bf895711bcb6b44e3114a041395c4cb8951f5e Mon Sep 17 00:00:00 2001 From: suizihe <2958847195@qq.com> Date: Wed, 12 Nov 2025 10:58:12 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=B4=E6=8A=A4=E6=8D=A2=E5=8D=A1=E5=A4=84?= =?UTF-8?q?=E7=90=86=E7=9A=84=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/framework/config/FilterConfig.java | 5 +- openhis-ui-vue3/src/api/cardRenewal/api.js | 101 ++++++------------ 2 files changed, 37 insertions(+), 69 deletions(-) diff --git a/openhis-server-new/core-framework/src/main/java/com/core/framework/config/FilterConfig.java b/openhis-server-new/core-framework/src/main/java/com/core/framework/config/FilterConfig.java index 67fba684..f4fa0a26 100644 --- a/openhis-server-new/core-framework/src/main/java/com/core/framework/config/FilterConfig.java +++ b/openhis-server-new/core-framework/src/main/java/com/core/framework/config/FilterConfig.java @@ -22,10 +22,11 @@ import com.core.common.utils.StringUtils; */ @Configuration public class FilterConfig { - @Value("${xss.excludes}") + // 添加默认值,避免配置不存在时启动失败 + @Value("${xss.excludes:/system/notice}") private String excludes; - @Value("${xss.urlPatterns}") + @Value("${xss.urlPatterns:/system/*,/monitor/*,/tool/*}") private String urlPatterns; @SuppressWarnings({"rawtypes", "unchecked"}) diff --git a/openhis-ui-vue3/src/api/cardRenewal/api.js b/openhis-ui-vue3/src/api/cardRenewal/api.js index eac34ea0..c43a9457 100644 --- a/openhis-ui-vue3/src/api/cardRenewal/api.js +++ b/openhis-ui-vue3/src/api/cardRenewal/api.js @@ -1,82 +1,49 @@ import request from '@/utils/request'; +import { parseStrEmpty } from "@/utils/openhis"; -// 查询患者列表 - 更新为匹配后端实际路径 +/** + * 查询患者列表 + * 完全复用门诊挂号查询患者的逻辑和API + * @param {Object} query - 查询参数 + * @returns {Promise} 请求结果 + */ export function getPatientList(query) { - console.log('查询患者列表API被调用,参数:', query); + // 打印日志便于调试 + console.log('调用患者查询API,参数:', query); - // 调整参数以匹配后端控制器的要求 - const backendParams = { - patientName: query.patientName || '', - idCard: query.idCard || '', - phoneNumber: query.phoneNumber || '', // 添加phoneNumber参数 - cardNo: '' // 后端控制器中有cardNo参数,但前端没有,可以传空字符串 - }; - - console.log('调整后的后端参数:', backendParams); - - // 实际API调用代码 - 使用后端实际路径 + // 直接复用门诊挂号模块完全相同的实现方式 + // 不做额外的参数处理,直接将query传递给后端 return request({ - url: '/openhis/charge/patientCardRenewal/getPatientInfo', + url: '/charge-manage/register/patient-metadata', method: 'get', - params: backendParams - }).then(response => { - console.log('API返回结果:', response); - - // 转换后端返回格式以适应前端组件 - if (response && response.code === 200) { - // 检查后端返回的数据结构 - if (Array.isArray(response.data)) { - // 如果是数组,直接使用 - return { - code: 200, - msg: 'success', - rows: response.data, - total: response.data.length - }; - } else if (response.data) { - // 如果是单个对象,包装成数组 - return { - code: 200, - msg: 'success', - rows: [response.data], - total: 1 - }; - } - } - - // 默认返回空数据 - return { - code: response?.code || 500, - msg: response?.msg || '查询失败', - rows: [], - total: 0 - }; - }).catch(error => { - console.error('查询患者列表API调用失败:', error); - // API调用失败时返回空数据 - return { - code: 500, - msg: 'API调用失败', - rows: [], - total: 0 - }; + params: query }); -} +}; -// 执行患者换卡 -export function renewPatientCard(data) { +/** + * 更新患者换卡信息 + * @param {Object} params - 换卡参数 + * @returns {Promise} 请求结果 + */ +export const renewPatientCard = (params) => { return request({ url: '/cardRenewal/card/renewal', method: 'post', - data: data - }).catch(error => { - console.error('换卡操作API调用失败:', error); - return { - code: 500, - msg: 'API调用失败' - }; + data: params }); -} +}; + +/** + * 获取患者详情信息 + * @param {string} patientId - 患者ID + * @returns {Promise} 请求结果 + */ +export const getPatientInfo = (patientId) => { + return request({ + url: `/cardRenewal/patient/info/${patientId}`, + method: 'get' + }); +}; // 获取患者详细信息 export function getPatientInfo(patientId) {