258 预约管理-》医生排班管理:点【预约设置】界面编辑内容【确定】提示”保存成功“但是刷新重新进入未显示最后一次更新的数据
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
/**
|
||||
* 获取预约配置
|
||||
* @returns
|
||||
*/
|
||||
export function getAppointmentConfig() {
|
||||
return request({
|
||||
url: '/dept/config',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存预约配置
|
||||
* @param {Object} data - 预约配置数据
|
||||
* @returns
|
||||
*/
|
||||
export function saveAppointmentConfig(data) {
|
||||
return request({
|
||||
url: '/dept/config',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
@@ -100,9 +100,9 @@
|
||||
<el-form label-position="top" :model="appointmentSettingForm">
|
||||
<el-form-item label="取消预约时间类型">
|
||||
<el-select v-model="appointmentSettingForm.cancelAppointmentType" placeholder="请选择" style="width: 200px">
|
||||
<el-option label="年" value="年"></el-option>
|
||||
<el-option label="月" value="月"></el-option>
|
||||
<el-option label="日" value="日"></el-option>
|
||||
<el-option label="年" value="YEAR"></el-option>
|
||||
<el-option label="月" value="MONTH"></el-option>
|
||||
<el-option label="日" value="DAY"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="取消预约次数">
|
||||
@@ -390,6 +390,7 @@ import {useRouter} from 'vue-router'
|
||||
import {ElDialog, ElForm, ElFormItem, ElInput, ElMessage, ElMessageBox, ElOption, ElSelect} from 'element-plus'
|
||||
import {DocumentRemove, EditPen, View, Delete} from '@element-plus/icons-vue'
|
||||
import {listDept, searchDept} from '@/api/appoinmentmanage/dept'
|
||||
import {getAppointmentConfig, saveAppointmentConfig} from '@/api/appoinmentmanage/appointmentConfig'
|
||||
import {getLocationTree, getPractitionerMetadata, getHealthcareMetadata} from '@/views/charge/outpatientregistration/components/outpatientregistration'
|
||||
import {addDoctorSchedule, addDoctorScheduleWithDate, updateDoctorSchedule, deleteDoctorSchedule, getRegisterOrganizations, getDoctorScheduleListByDeptId, getDoctorScheduleListByDeptIdAndDateRange} from './api'
|
||||
import {getClinicRoomList} from '@/api/appoinmentmanage/clinicRoom'
|
||||
@@ -922,16 +923,51 @@ const handleReset = async () => {
|
||||
}
|
||||
|
||||
// 预约设置弹窗显示
|
||||
const handleAppointmentSetting = () => {
|
||||
const handleAppointmentSetting = async () => {
|
||||
// 获取当前机构的预约配置
|
||||
try {
|
||||
const res = await getAppointmentConfig()
|
||||
if (res.code === 200 && res.data) {
|
||||
// 回显已有配置
|
||||
appointmentSettingForm.value = {
|
||||
cancelAppointmentType: res.data.cancelAppointmentType || 'YEAR',
|
||||
cancelAppointmentCount: res.data.cancelAppointmentCount || 0
|
||||
}
|
||||
} else {
|
||||
// 无配置时使用默认值
|
||||
appointmentSettingForm.value = {
|
||||
cancelAppointmentType: 'YEAR',
|
||||
cancelAppointmentCount: 0
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取预约配置失败:', error)
|
||||
appointmentSettingForm.value = {
|
||||
cancelAppointmentType: 'YEAR',
|
||||
cancelAppointmentCount: 0
|
||||
}
|
||||
}
|
||||
appointmentSettingDialog.value = true
|
||||
}
|
||||
|
||||
// 预约设置确定
|
||||
const handleAppointmentSettingConfirm = () => {
|
||||
// 这里可以添加表单验证和提交逻辑
|
||||
console.log('预约设置提交:', appointmentSettingForm.value)
|
||||
ElMessage.success('预约设置保存成功')
|
||||
appointmentSettingDialog.value = false
|
||||
const handleAppointmentSettingConfirm = async () => {
|
||||
try {
|
||||
const res = await saveAppointmentConfig({
|
||||
cancelAppointmentType: appointmentSettingForm.value.cancelAppointmentType,
|
||||
cancelAppointmentCount: appointmentSettingForm.value.cancelAppointmentCount,
|
||||
validFlag: 1
|
||||
})
|
||||
if (res.code === 200) {
|
||||
ElMessage.success('预约设置保存成功')
|
||||
appointmentSettingDialog.value = false
|
||||
} else {
|
||||
ElMessage.error(res.msg || '保存失败')
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('保存预约配置失败:', error)
|
||||
ElMessage.error('保存失败')
|
||||
}
|
||||
}
|
||||
|
||||
// 预约设置取消
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<el-form-item label="所属机构" prop="institution" class="filter-item">
|
||||
<el-select
|
||||
v-model="queryParams.institution"
|
||||
placeholder="演示医院"
|
||||
placeholder="请选择"
|
||||
clearable
|
||||
style="width: 150px"
|
||||
:popper-append-to-body="false"
|
||||
|
||||
@@ -510,8 +510,7 @@ export default {
|
||||
this.closeContextMenu();
|
||||
}
|
||||
}).catch(error => {
|
||||
const errorMsg = error.message || '取消预约失败,请稍后重试';
|
||||
ElMessage.error(`取消预约失败:${errorMsg}`);
|
||||
console.error('取消预约失败:', error);
|
||||
this.closeContextMenu();
|
||||
});
|
||||
},
|
||||
@@ -590,12 +589,10 @@ export default {
|
||||
|
||||
ElMessage.success('预约成功,号源已锁定。患者到院签到时需缴费取号。');
|
||||
}).catch(error => {
|
||||
// 显示具体的错误信息
|
||||
const errorMessage = error.response?.data?.msg || error.response?.data?.message || '预约失败,请稍后重试。';
|
||||
ElMessage.error(errorMessage);
|
||||
console.error('预约失败:', error);
|
||||
});
|
||||
} catch (error) {
|
||||
ElMessage.error('预约信息格式错误,请重新操作。');
|
||||
console.error('操作异常:', error);
|
||||
}
|
||||
},
|
||||
// 切换侧边栏显示/隐藏
|
||||
|
||||
Reference in New Issue
Block a user