需求27:增加挂号收费系统参数维护界面-》挂号处理相关参数
This commit is contained in:
16
openhis-ui-vue3/package-lock.json
generated
16
openhis-ui-vue3/package-lock.json
generated
@@ -3,14 +3,6 @@
|
||||
"version": "3.8.7",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"resolutions": {
|
||||
"stable": "^0.1.8",
|
||||
"source-map-url": "^0.4.1",
|
||||
"urix": "^0.1.0",
|
||||
"resolve-url": "^0.2.1",
|
||||
"source-map-resolve": "^0.6.0",
|
||||
"sourcemap-codec": "^1.4.8"
|
||||
},
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "openhis",
|
||||
@@ -8329,5 +8321,13 @@
|
||||
"tslib": "2.3.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"resolutions": {
|
||||
"resolve-url": "^0.2.1",
|
||||
"source-map-resolve": "^0.6.0",
|
||||
"source-map-url": "^0.4.1",
|
||||
"sourcemap-codec": "^1.4.8",
|
||||
"stable": "^0.1.8",
|
||||
"urix": "^0.1.0"
|
||||
}
|
||||
}
|
||||
@@ -18,10 +18,11 @@ export function getConfig(configId) {
|
||||
}
|
||||
|
||||
// 根据参数键名查询参数值
|
||||
export function getConfigKey(configKey) {
|
||||
export function getConfigKey(configKey, options = {}) {
|
||||
return request({
|
||||
url: '/system/config/configKey/' + configKey,
|
||||
method: 'get'
|
||||
method: 'get',
|
||||
...options
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -16,97 +16,147 @@
|
||||
</el-tab-pane>
|
||||
|
||||
<el-tab-pane label="挂号处理" name="tab3">
|
||||
<el-form ref="formRef" :model="formData" label-width="120px" class="config-form">
|
||||
<el-form ref="formRef" :model="formData" label-width="150px" class="config-form compact-form">
|
||||
<!-- 第一行 -->
|
||||
<div class="form-row">
|
||||
<el-form-item label="病历本费用(元)" prop="medicalRecordFee" style="margin-right: 20px;">
|
||||
<el-input v-model="formData.medicalRecordFee" style="width: 180px" />
|
||||
<el-form-item label="病历本费用(元)" prop="medicalRecordFee">
|
||||
<el-input-number v-model="formData.medicalRecordFee" style="width: 150px" :controls-position="'right'" :step="1" :min="0" />
|
||||
</el-form-item>
|
||||
<el-form-item style="margin-left: 20px;">
|
||||
<el-checkbox v-model="formData.medicalRecordFlag">病历费入账标志</el-checkbox>
|
||||
<el-form-item label="" prop="medicalRecordFlag" checkbox-label>
|
||||
<template #label>
|
||||
<div class="checkbox-label-container">
|
||||
<el-checkbox v-model="formData.medicalRecordFlag" style="margin-right: 8px;" />
|
||||
<span>病历费入账标志</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-form-item>
|
||||
</div>
|
||||
|
||||
<!-- 第二行 -->
|
||||
<div class="form-row">
|
||||
<el-form-item label="就诊卡费(元)" prop="patientCardFee" style="margin-right: 20px;">
|
||||
<el-input v-model="formData.patientCardFee" style="width: 180px" />
|
||||
<el-form-item label="就诊卡费(元)" prop="patientCardFee">
|
||||
<el-input-number v-model="formData.patientCardFee" style="width: 150px" :controls-position="'right'" :step="1" :min="0" />
|
||||
</el-form-item>
|
||||
<el-form-item style="margin-left: 20px;">
|
||||
<el-checkbox v-model="formData.isNightShift">是否启用晚班</el-checkbox>
|
||||
<el-form-item label="" prop="isNightShift" checkbox-label>
|
||||
<template #label>
|
||||
<div class="checkbox-label-container">
|
||||
<el-checkbox v-model="formData.isNightShift" style="margin-right: 8px;" />
|
||||
<span>是否启用晚班</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-form-item>
|
||||
</div>
|
||||
|
||||
<!-- 第三行 -->
|
||||
<div class="form-row">
|
||||
<el-form-item style="margin-right: 40px;">
|
||||
<el-checkbox v-model="formData.patientCardFlag">就诊卡记账标志</el-checkbox>
|
||||
<el-form-item label="" prop="patientCardFlag" checkbox-label>
|
||||
<template #label>
|
||||
<div class="checkbox-label-container">
|
||||
<el-checkbox v-model="formData.patientCardFlag" style="margin-right: 8px;" />
|
||||
<span>就诊卡记账标志</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-form-item>
|
||||
<el-form-item label="上午接诊起始时间" prop="morningStartTime" style="width: 300px; white-space: nowrap;">
|
||||
<el-input v-model="formData.morningStartTime" style="width: 120px" />
|
||||
<el-form-item label="上午接诊起始时间" prop="morningStartTime">
|
||||
<el-input v-model="formData.morningStartTime" style="width: 150px" />
|
||||
</el-form-item>
|
||||
</div>
|
||||
|
||||
<!-- 第四行 -->
|
||||
<div class="form-row">
|
||||
<el-form-item style="margin-right: 40px;">
|
||||
<el-checkbox v-model="formData.autoGenerateOutpatientNo">自动产生门诊号</el-checkbox>
|
||||
<el-form-item label="" prop="autoGenerateOutpatientNo" checkbox-label>
|
||||
<template #label>
|
||||
<div class="checkbox-label-container">
|
||||
<el-checkbox v-model="formData.autoGenerateOutpatientNo" style="margin-right: 8px;" />
|
||||
<span>自动产生门诊号</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-form-item>
|
||||
<el-form-item style="margin-right: 40px;">
|
||||
<el-checkbox v-model="formData.allowModifyOutpatientNo">建档时是否允许修改门诊号</el-checkbox>
|
||||
<el-form-item label="" prop="allowModifyOutpatientNo" checkbox-label>
|
||||
<template #label>
|
||||
<div class="checkbox-label-container">
|
||||
<el-checkbox v-model="formData.allowModifyOutpatientNo" style="margin-right: 8px;" />
|
||||
<span>允许修改门诊号</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-form-item>
|
||||
</div>
|
||||
|
||||
<!-- 第五行 -->
|
||||
<div class="form-row">
|
||||
<el-form-item label="下午起始时间" prop="afternoonStartTime" style="margin-right: 40px;">
|
||||
<el-input v-model="formData.afternoonStartTime" style="width: 120px" />
|
||||
<el-form-item label="下午起始时间" prop="afternoonStartTime">
|
||||
<el-input v-model="formData.afternoonStartTime" style="width: 150px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="晚上起始时间" prop="eveningStartTime">
|
||||
<el-input v-model="formData.eveningStartTime" style="width: 120px" />
|
||||
<el-input v-model="formData.eveningStartTime" style="width: 150px" />
|
||||
</el-form-item>
|
||||
</div>
|
||||
|
||||
<!-- 第六行 -->
|
||||
<div class="form-row">
|
||||
<el-form-item label="挂号有效期" prop="registrationValidity" style="margin-right: 40px;">
|
||||
<el-input v-model="formData.registrationValidity" style="width: 120px" />
|
||||
<el-form-item label="挂号有效期" prop="registrationValidity">
|
||||
<el-input-number v-model="formData.registrationValidity" style="width: 150px" :controls-position="'right'" :step="1" :min="0" />
|
||||
</el-form-item>
|
||||
<el-form-item label="挂号单据模式" prop="registrationDocumentMode">
|
||||
<el-select v-model="formData.registrationDocumentMode" style="width: 150px">
|
||||
<el-option label="使用发票" value="使用发票" />
|
||||
<el-option label="其他模式" value="其他模式" />
|
||||
<el-option label="普通单据" value="其他模式" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</div>
|
||||
|
||||
<!-- 第七行 -->
|
||||
<div class="form-row">
|
||||
<el-form-item style="margin-right: 40px;">
|
||||
<el-checkbox v-model="formData.exemptFlag">减免标志</el-checkbox>
|
||||
<el-form-item label="" prop="exemptFlag" checkbox-label>
|
||||
<template #label>
|
||||
<div class="checkbox-label-container">
|
||||
<el-checkbox v-model="formData.exemptFlag" style="margin-right: 8px;" />
|
||||
<span>减免标志</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-form-item>
|
||||
<el-form-item style="margin-right: 40px;">
|
||||
<el-checkbox v-model="formData.consultationFlag">义诊标志</el-checkbox>
|
||||
<el-form-item label="" prop="consultationFlag" checkbox-label>
|
||||
<template #label>
|
||||
<div class="checkbox-label-container">
|
||||
<el-checkbox v-model="formData.consultationFlag" style="margin-right: 8px;" />
|
||||
<span>义诊标志</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-form-item>
|
||||
<el-form-item style="margin-right: 40px;">
|
||||
<el-checkbox v-model="formData.enableHolidayFeeFloat">启用法定节假日挂号费浮动</el-checkbox>
|
||||
<el-form-item label="" prop="enableHolidayFeeFloat" checkbox-label>
|
||||
<template #label>
|
||||
<div class="checkbox-label-container">
|
||||
<el-checkbox v-model="formData.enableHolidayFeeFloat" style="margin-right: 8px;" />
|
||||
<span>节假日费浮动</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-form-item>
|
||||
</div>
|
||||
|
||||
<!-- 第八行 -->
|
||||
<div class="form-row">
|
||||
<el-form-item label="监护人规定年龄" prop="guardianAge" style="margin-right: 40px;">
|
||||
<el-input v-model="formData.guardianAge" style="width: 120px" />
|
||||
<el-form-item label="监护人规定年龄" prop="guardianAge">
|
||||
<el-input-number v-model="formData.guardianAge" style="width: 150px" :controls-position="'right'" :step="1" :min="0" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-checkbox v-model="formData.enableDoubleScreen">门诊挂号启用双屏</el-checkbox>
|
||||
<el-form-item label="" prop="enableDoubleScreen" checkbox-label>
|
||||
<template #label>
|
||||
<div class="checkbox-label-container">
|
||||
<el-checkbox v-model="formData.enableDoubleScreen" style="margin-right: 8px;" />
|
||||
<span>挂号启用双屏</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-form-item>
|
||||
</div>
|
||||
|
||||
<!-- 第九行 -->
|
||||
<div class="form-row">
|
||||
<el-form-item>
|
||||
<el-checkbox v-model="formData.optionalRegistrationType">挂号类型可选择</el-checkbox>
|
||||
<el-form-item label="" prop="optionalRegistrationType" checkbox-label>
|
||||
<template #label>
|
||||
<div class="checkbox-label-container">
|
||||
<el-checkbox v-model="formData.optionalRegistrationType" style="margin-right: 8px;" />
|
||||
<span>挂号类型可选择</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-form>
|
||||
@@ -132,10 +182,10 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive } from 'vue';
|
||||
import { ref, reactive, onMounted } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { getConfigKey, addConfig, updateConfig } from '@/api/system/config';
|
||||
import { listConfig, getConfigKey, addConfig, updateConfig } from '@/api/system/config';
|
||||
|
||||
const router = useRouter();
|
||||
const formRef = ref(null);
|
||||
@@ -164,6 +214,61 @@ const formData = reactive({
|
||||
isPrint: false,
|
||||
});
|
||||
|
||||
// 加载配置数据
|
||||
const loadConfigData = async (showSuccessMessage = true) => {
|
||||
try {
|
||||
// 调用系统配置API获取数据,不设置configType过滤条件以获取所有配置
|
||||
const response = await listConfig({ pageSize: 1000 });
|
||||
|
||||
// 处理响应数据,兼容不同的返回格式
|
||||
let configs = [];
|
||||
if (response && response.data) {
|
||||
if (Array.isArray(response.data)) {
|
||||
configs = response.data;
|
||||
} else if (response.data.rows && Array.isArray(response.data.rows)) {
|
||||
configs = response.data.rows;
|
||||
} else {
|
||||
console.error('返回数据格式不符合预期:', response);
|
||||
}
|
||||
} else if (response && response.rows && Array.isArray(response.rows)) {
|
||||
configs = response.rows;
|
||||
} else {
|
||||
console.error('API返回空响应:', response);
|
||||
}
|
||||
|
||||
console.log('loadConfigData - 获取到的配置列表:', configs);
|
||||
console.log('loadConfigData - 配置总数:', configs.length);
|
||||
|
||||
// 将配置数据映射到表单
|
||||
if (configs && configs.length > 0) {
|
||||
configs.forEach(config => {
|
||||
const { configKey, configValue } = config;
|
||||
|
||||
// 处理布尔类型字段
|
||||
if (configKey in formData) {
|
||||
if (typeof formData[configKey] === 'boolean') {
|
||||
formData[configKey] = configValue === '1';
|
||||
} else {
|
||||
formData[configKey] = configValue;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (showSuccessMessage) {
|
||||
ElMessage.success('配置数据加载成功');
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('加载配置数据失败:', error);
|
||||
ElMessage.warning('无法加载配置数据,使用默认值');
|
||||
}
|
||||
};
|
||||
|
||||
// 组件挂载时加载数据
|
||||
onMounted(() => {
|
||||
loadConfigData();
|
||||
});
|
||||
|
||||
// 默认按钮点击事件
|
||||
const handleDefault = () => {
|
||||
// 重置为默认值
|
||||
@@ -225,40 +330,88 @@ const handleSave = async () => {
|
||||
let successCount = 0;
|
||||
let failedParams = [];
|
||||
|
||||
// 调用系统配置API保存每个参数
|
||||
for (const config of configData) {
|
||||
try {
|
||||
// 先查询是否存在该配置
|
||||
const existingConfig = await getConfigKey(config.configKey, { skipErrorMsg: true });
|
||||
try {
|
||||
// 先获取所有配置,避免重复调用API
|
||||
const allConfigsResponse = await listConfig({ pageSize: 1000 });
|
||||
console.log('handleSave - listConfig返回完整结果:', JSON.stringify(allConfigsResponse));
|
||||
|
||||
if (existingConfig.data && existingConfig.data.configId) {
|
||||
// 如果存在则更新,保留原有数据的configId
|
||||
await updateConfig({
|
||||
...config,
|
||||
configId: existingConfig.data.configId,
|
||||
createTime: existingConfig.data.createTime, // 保留创建时间
|
||||
remark: existingConfig.data.remark || '收费系统配置参数' // 保留或设置默认备注
|
||||
});
|
||||
} else {
|
||||
// 如果不存在则新增,添加默认备注
|
||||
await addConfig({
|
||||
...config,
|
||||
remark: '收费系统配置参数'
|
||||
});
|
||||
// 检查返回结果结构
|
||||
let allConfigs = [];
|
||||
if (allConfigsResponse.code === 200) {
|
||||
if (allConfigsResponse.data && Array.isArray(allConfigsResponse.data)) {
|
||||
allConfigs = allConfigsResponse.data;
|
||||
} else if (allConfigsResponse.data && allConfigsResponse.data.rows) {
|
||||
allConfigs = allConfigsResponse.data.rows;
|
||||
} else if (Array.isArray(allConfigsResponse.rows)) {
|
||||
allConfigs = allConfigsResponse.rows;
|
||||
} else if (Array.isArray(allConfigsResponse)) {
|
||||
allConfigs = allConfigsResponse;
|
||||
}
|
||||
successCount++;
|
||||
} catch (paramError) {
|
||||
console.error(`保存参数 ${config.configName} (${config.configKey}) 失败:`, paramError);
|
||||
failedParams.push(config.configName);
|
||||
// 继续处理下一个参数,不中断整体流程
|
||||
}
|
||||
|
||||
console.log('handleSave - 最终获取到的所有配置:', allConfigs);
|
||||
console.log('handleSave - 配置总数:', allConfigs.length);
|
||||
|
||||
// 构建配置项映射表,方便快速查找
|
||||
const configMap = new Map();
|
||||
allConfigs.forEach(config => {
|
||||
configMap.set(config.configKey, config);
|
||||
console.log('handleSave - 添加到映射表:', config.configKey);
|
||||
});
|
||||
|
||||
// 调用系统配置API保存每个参数
|
||||
for (const config of configData) {
|
||||
try {
|
||||
const existingConfig = configMap.get(config.configKey);
|
||||
|
||||
console.log(`处理参数: ${config.configName} (${config.configKey})`);
|
||||
console.log(`现有配置:`, existingConfig);
|
||||
console.log(`要保存的值:`, config.configValue);
|
||||
|
||||
if (existingConfig && existingConfig.configId) {
|
||||
// 如果存在则更新,保留原有数据的configId和创建时间
|
||||
console.log(`更新参数 ${config.configKey},使用configId: ${existingConfig.configId}`);
|
||||
const updateResult = await updateConfig({
|
||||
...config,
|
||||
configId: existingConfig.configId,
|
||||
createTime: existingConfig.createTime,
|
||||
remark: existingConfig.remark || '收费系统配置参数',
|
||||
configType: existingConfig.configType || 'N'
|
||||
});
|
||||
console.log(`更新结果:`, updateResult);
|
||||
} else {
|
||||
// 如果不存在则新增,添加默认备注
|
||||
console.log(`新增参数 ${config.configKey}`);
|
||||
const addResult = await addConfig({
|
||||
...config,
|
||||
remark: '收费系统配置参数',
|
||||
configType: 'N'
|
||||
});
|
||||
console.log(`新增结果:`, addResult);
|
||||
}
|
||||
successCount++;
|
||||
} catch (paramError) {
|
||||
console.error(`保存参数 ${config.configName} (${config.configKey}) 失败:`, paramError);
|
||||
console.error(`错误详情:`, paramError.response || paramError);
|
||||
failedParams.push(config.configName);
|
||||
// 继续处理下一个参数,不中断整体流程
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取配置列表失败:', error);
|
||||
ElMessage.error('获取配置列表失败,无法保存参数');
|
||||
return;
|
||||
}
|
||||
|
||||
// 根据保存结果显示相应消息
|
||||
if (failedParams.length === 0) {
|
||||
ElMessage.success(`所有 ${successCount} 个参数保存成功`);
|
||||
ElMessage.success(`保存成功`);
|
||||
// 保存成功后重新加载数据,确保页面显示最新配置
|
||||
loadConfigData(false); // 不显示加载成功消息
|
||||
} else if (successCount > 0) {
|
||||
ElMessage.warning(`${successCount} 个参数保存成功,但以下 ${failedParams.length} 个参数保存失败: ${failedParams.join(', ')}`);
|
||||
// 部分成功也重新加载数据
|
||||
loadConfigData(false); // 不显示加载成功消息
|
||||
} else {
|
||||
ElMessage.error(`所有参数保存失败,请检查系统配置`);
|
||||
}
|
||||
@@ -300,23 +453,96 @@ const handleClose = () => {
|
||||
.form-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 5px;
|
||||
flex-wrap: wrap;
|
||||
margin-bottom: 15px;
|
||||
flex-wrap: nowrap; /* 禁止行内元素换行 */
|
||||
overflow-x: hidden; /* 防止溢出 */
|
||||
}
|
||||
|
||||
.config-form .el-form-item {
|
||||
margin-bottom: 0;
|
||||
margin-right: 0;
|
||||
margin-right: 60px; /* 增加间距 */
|
||||
min-width: 350px; /* 增加最小宽度 */
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-shrink: 0; /* 禁止压缩 */
|
||||
}
|
||||
|
||||
/* 紧凑表单样式 */
|
||||
.compact-form {
|
||||
label-width: 150px !important;
|
||||
}
|
||||
|
||||
.compact-form .el-form-item {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
/* 所有表单标签的统一样式 */
|
||||
.config-form .el-form-item__label {
|
||||
font-weight: 500;
|
||||
width: 120px;
|
||||
width: 220px !important; /* 足够宽的标签宽度 */
|
||||
text-align: right;
|
||||
padding-right: 15px;
|
||||
white-space: nowrap !important; /* 强制不换行 */
|
||||
overflow: visible !important; /* 允许内容溢出(确保不截断) */
|
||||
text-overflow: clip !important; /* 不显示省略号 */
|
||||
flex-shrink: 0 !important; /* 禁止压缩 */
|
||||
font-size: 14px !important; /* 统一字体大小 */
|
||||
line-height: 32px !important; /* 统一行高 */
|
||||
height: 32px !important; /* 统一高度 */
|
||||
margin: 0 !important; /* 清除默认边距 */
|
||||
padding: 0 15px 0 0 !important; /* 统一内边距 */
|
||||
}
|
||||
|
||||
/* 复选框标签样式 */
|
||||
.compact-form .el-form-item[checkbox-label] .el-form-item__label {
|
||||
padding-right: 10px;
|
||||
width: 150px !important;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.compact-form .el-form-item[checkbox-label] .el-form-item__content {
|
||||
margin-left: 0 !important;
|
||||
}
|
||||
|
||||
/* 自定义复选框标签容器 */
|
||||
.checkbox-label-container {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.checkbox-label-container span {
|
||||
font-size: 14px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* 空标签的样式,用于对齐 */
|
||||
.config-form .el-form-item__label:empty {
|
||||
width: 18px !important;
|
||||
padding-right: 5px !important;
|
||||
}
|
||||
|
||||
.config-form .el-form-item--medium .el-form-item__content {
|
||||
line-height: 28px;
|
||||
line-height: 32px;
|
||||
flex-shrink: 0;
|
||||
height: 32px;
|
||||
}
|
||||
|
||||
.config-form .el-checkbox {
|
||||
margin-left: 0;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
/* 确保输入框与标签对齐 */
|
||||
.config-form .el-input {
|
||||
height: 32px;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.config-form .el-input__wrapper {
|
||||
height: 32px;
|
||||
}
|
||||
|
||||
.tab-content {
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user