医生排班日期的正确插入
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user