维护换卡处理的查询
This commit is contained in:
@@ -22,10 +22,11 @@ import com.core.common.utils.StringUtils;
|
|||||||
*/
|
*/
|
||||||
@Configuration
|
@Configuration
|
||||||
public class FilterConfig {
|
public class FilterConfig {
|
||||||
@Value("${xss.excludes}")
|
// 添加默认值,避免配置不存在时启动失败
|
||||||
|
@Value("${xss.excludes:/system/notice}")
|
||||||
private String excludes;
|
private String excludes;
|
||||||
|
|
||||||
@Value("${xss.urlPatterns}")
|
@Value("${xss.urlPatterns:/system/*,/monitor/*,/tool/*}")
|
||||||
private String urlPatterns;
|
private String urlPatterns;
|
||||||
|
|
||||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||||
|
|||||||
@@ -1,82 +1,49 @@
|
|||||||
import request from '@/utils/request';
|
import request from '@/utils/request';
|
||||||
|
import { parseStrEmpty } from "@/utils/openhis";
|
||||||
|
|
||||||
// 查询患者列表 - 更新为匹配后端实际路径
|
/**
|
||||||
|
* 查询患者列表
|
||||||
|
* 完全复用门诊挂号查询患者的逻辑和API
|
||||||
|
* @param {Object} query - 查询参数
|
||||||
|
* @returns {Promise} 请求结果
|
||||||
|
*/
|
||||||
export function getPatientList(query) {
|
export function getPatientList(query) {
|
||||||
console.log('查询患者列表API被调用,参数:', query);
|
// 打印日志便于调试
|
||||||
|
console.log('调用患者查询API,参数:', query);
|
||||||
|
|
||||||
// 调整参数以匹配后端控制器的要求
|
// 直接复用门诊挂号模块完全相同的实现方式
|
||||||
const backendParams = {
|
// 不做额外的参数处理,直接将query传递给后端
|
||||||
patientName: query.patientName || '',
|
|
||||||
idCard: query.idCard || '',
|
|
||||||
phoneNumber: query.phoneNumber || '', // 添加phoneNumber参数
|
|
||||||
cardNo: '' // 后端控制器中有cardNo参数,但前端没有,可以传空字符串
|
|
||||||
};
|
|
||||||
|
|
||||||
console.log('调整后的后端参数:', backendParams);
|
|
||||||
|
|
||||||
// 实际API调用代码 - 使用后端实际路径
|
|
||||||
return request({
|
return request({
|
||||||
url: '/openhis/charge/patientCardRenewal/getPatientInfo',
|
url: '/charge-manage/register/patient-metadata',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: backendParams
|
params: query
|
||||||
}).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
|
|
||||||
};
|
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
// 执行患者换卡
|
/**
|
||||||
export function renewPatientCard(data) {
|
* 更新患者换卡信息
|
||||||
|
* @param {Object} params - 换卡参数
|
||||||
|
* @returns {Promise} 请求结果
|
||||||
|
*/
|
||||||
|
export const renewPatientCard = (params) => {
|
||||||
return request({
|
return request({
|
||||||
url: '/cardRenewal/card/renewal',
|
url: '/cardRenewal/card/renewal',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data
|
data: params
|
||||||
}).catch(error => {
|
|
||||||
console.error('换卡操作API调用失败:', error);
|
|
||||||
return {
|
|
||||||
code: 500,
|
|
||||||
msg: 'API调用失败'
|
|
||||||
};
|
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取患者详情信息
|
||||||
|
* @param {string} patientId - 患者ID
|
||||||
|
* @returns {Promise} 请求结果
|
||||||
|
*/
|
||||||
|
export const getPatientInfo = (patientId) => {
|
||||||
|
return request({
|
||||||
|
url: `/cardRenewal/patient/info/${patientId}`,
|
||||||
|
method: 'get'
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
// 获取患者详细信息
|
// 获取患者详细信息
|
||||||
export function getPatientInfo(patientId) {
|
export function getPatientInfo(patientId) {
|
||||||
|
|||||||
Reference in New Issue
Block a user