新增患者:监护人信息限制

This commit is contained in:
2025-12-31 13:43:24 +08:00
parent aeb6b95970
commit 61f4020487
3 changed files with 80 additions and 6 deletions

View File

@@ -701,6 +701,7 @@ const paymentId = ref('');
const loadingText = ref('');
const registerInfo = ref({}); // 原挂号记录信息
const queryType = ref('all'); // 查询类型all-全部, normal-正常挂号, returned-退号记录
const guardianAgeConfig = ref(''); // 监护人规定年龄配置
// 使用 ref 定义查询所得用户信息数据
const patientInfoList = ref(undefined);
@@ -1524,11 +1525,49 @@ getLocationInfo();
async function loadGuardianAgeConfig() {
try {
const response = await getConfigKey('guardianAge');
if (response.code === 200) {
guardianAgeConfig.value = response.data;
console.log('获取监护人年龄配置完整响应:', JSON.stringify(response, null, 2));
console.log('响应 code:', response.code);
console.log('响应 data:', response.data);
console.log('响应 data 类型:', typeof response.data);
console.log('响应 data === null:', response.data === null);
console.log('响应 data === undefined:', response.data === undefined);
console.log('响应 data === "":', response.data === '');
if (response && response.code === 200) {
// response.data 可能是字符串、数字或对象
let configValue = response.data;
// 如果是对象,尝试获取 configValue 字段
if (typeof configValue === 'object' && configValue !== null) {
configValue = configValue.configValue || configValue.value || '';
console.log('从对象中提取的 configValue:', configValue);
}
// 处理数字类型(可能是数字 18
if (typeof configValue === 'number') {
configValue = String(configValue);
console.log('将数字转换为字符串:', configValue);
}
// 转换为字符串并去除空白
const trimmedValue = configValue !== null && configValue !== undefined ? String(configValue).trim() : '';
console.log('trimmedValue:', trimmedValue, '长度:', trimmedValue.length);
if (trimmedValue) {
guardianAgeConfig.value = trimmedValue;
console.log('✅ 监护人年龄配置值已设置为:', guardianAgeConfig.value, '类型:', typeof guardianAgeConfig.value);
} else {
console.warn('⚠️ 配置值为空trimmedValue:', trimmedValue);
guardianAgeConfig.value = '';
}
} else {
console.warn('⚠️ 获取监护人年龄配置失败,响应码:', response?.code, '响应:', response);
guardianAgeConfig.value = '';
}
} catch (error) {
console.error('获取监护人规定年龄配置失败:', error);
console.error('获取监护人规定年龄配置失败:', error);
console.error('错误详情:', error.response || error);
guardianAgeConfig.value = '';
}
}
// 组件加载时获取配置