医生排班日期的正确插入

This commit is contained in:
HuangXinQuan
2026-02-05 16:00:56 +08:00
parent 74892ea80f
commit f69de5e78f
8 changed files with 161 additions and 6 deletions

View File

@@ -239,7 +239,7 @@ import {computed, onMounted, ref, watch} from 'vue'
import {useRoute, useRouter} from 'vue-router'
import {ElDialog, ElMessage, ElMessageBox} from 'element-plus'
import {View} from '@element-plus/icons-vue'
import {addDoctorSchedule, deleteDoctorSchedule} from '../api'
import {addDoctorSchedule, addDoctorScheduleWithDate, deleteDoctorSchedule} from '../api'
// 路由和导航
const route = useRoute()
@@ -587,6 +587,7 @@ const handleSave = async () => {
isStopped: item.stopClinic || false,
stopReason: item.stopClinic ? (item.stopReason || '') : '',
deptId: currentDept.value?.id || route.query.deptId || null,
scheduledDate: item.date // 添加具体日期字段
}
}
})
@@ -608,13 +609,14 @@ const handleSave = async () => {
let successCount = 0
let failCount = 0
const errors = []
for (const { localIndex, localId, scheduleData } of newSchedulesToSave) {
try {
// 确保新记录的id为null
scheduleData.id = null
const res = await addDoctorSchedule(scheduleData)
// 使用带日期的API日期信息已包含在scheduleData
const res = await addDoctorScheduleWithDate(scheduleData)
if (res.code === 200 && res.data) {
successCount++
// 更新本地记录的backendId