80 门诊医生站检查申请单开单界面,排班的回显问题

This commit is contained in:
HuangXinQuan
2026-02-27 14:25:17 +08:00
parent 87c7981ad9
commit fcd2d03424
6 changed files with 323 additions and 120 deletions

View File

@@ -904,11 +904,12 @@ const getTaskIcon = (category) => {
// 获取日程数据实际应用中应该从API获取
const fetchScheduleList = async () => {
try {
console.log('Fetching schedule list...')
const response = await getTodayMySchedule()
console.log('今日日程原始响应:', response)
if (response.code === 200) {
// 将API返回的数据转换为前端所需的格式
const scheduleData = response.data.map((schedule, index) => {
const scheduleData = (response.data || []).map((schedule, index) => {
console.log(`排班记录[${index}]:`, schedule)
// 根据排班类型设置标签类型
let tagType = 'info'
if (schedule.shift) {
@@ -920,8 +921,15 @@ const fetchScheduleList = async () => {
// 确定标题
const title = schedule.doctorName ? `${schedule.doctorName}医生排班` : '医生排班'
// 确定位置
const location = schedule.clinicRoom || schedule.deptId || '未知科室'
// 按照用户最新要求:直接展示 adm_doctor_schedule 的 clinic 字段或诊室名clinicRoom优先于科室名称。
// 增加对下划线命名的兼容性检查,防止后端映射异常。
const clinic = schedule.clinic
const roomName = schedule.clinicRoom || schedule.clinic_room
const department = schedule.deptName || schedule.dept_name
// 优先显示排班里设置的 clinic其次是号源池的诊室名称如果没有则显示科室名称最后显示默认值
const location = clinic || roomName || (department ? `${department}` : '院内')
console.log(`排班记录[${index}] 位置信息:`, { clinic, roomName, department, location })
return {
id: schedule.id || index,