预约管理->相关文件转移、号源后端接口实现、前端页面逻辑、数据处理修改。
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
package com.openhis.web.appointmentmanage.appservice;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.administration.domain.DoctorSchedule;
|
||||
import com.openhis.appointmentmanage.domain.DoctorSchedule;
|
||||
|
||||
public interface IDoctorScheduleAppService {
|
||||
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.openhis.web.appointmentmanage.appservice;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.appointmentmanage.dto.SchedulePoolDto;
|
||||
|
||||
public interface ISchedulePoolAppService {
|
||||
R<?> addSchedulePool(SchedulePoolDto schedulePoolDto);
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package com.openhis.web.appointmentmanage.appservice;
|
||||
|
||||
public interface IScheduleSlotAppService {
|
||||
}
|
||||
@@ -3,8 +3,8 @@ package com.openhis.web.appointmentmanage.appservice.impl;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.administration.domain.Dept;
|
||||
import com.openhis.administration.service.IDeptService;
|
||||
import com.openhis.appointmentmanage.domain.Dept;
|
||||
import com.openhis.appointmentmanage.service.IDeptService;
|
||||
import com.openhis.web.appointmentmanage.appservice.IDeptAppService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@ package com.openhis.web.appointmentmanage.appservice.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.administration.domain.DoctorSchedule;
|
||||
import com.openhis.administration.service.IDoctorScheduleService;
|
||||
import com.openhis.appointmentmanage.domain.DoctorSchedule;
|
||||
import com.openhis.appointmentmanage.service.IDoctorScheduleService;
|
||||
import com.openhis.web.appointmentmanage.appservice.IDoctorScheduleAppService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.openhis.web.appointmentmanage.appservice.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.appointmentmanage.domain.SchedulePool;
|
||||
import com.openhis.appointmentmanage.service.ISchedulePoolService;
|
||||
import com.openhis.web.appointmentmanage.appservice.ISchedulePoolAppService;
|
||||
import com.openhis.web.appointmentmanage.dto.SchedulePoolDto;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@Service
|
||||
public class SchedulePoolAppServiceImpl implements ISchedulePoolAppService {
|
||||
|
||||
@Resource
|
||||
private ISchedulePoolService schedulePoolService;
|
||||
|
||||
@Override
|
||||
public R<?> addSchedulePool(SchedulePoolDto schedulePoolDto) {
|
||||
//12/15 实体封装过程数据关系复杂 尚未完全理清 下次继续改
|
||||
if(ObjectUtil.isNull(schedulePoolDto)){
|
||||
return R.fail("号源不能为空");
|
||||
}
|
||||
|
||||
SchedulePool schedulePool = new SchedulePool();
|
||||
schedulePool.setHospitalId(schedulePoolDto.getHospitalId());
|
||||
schedulePool.setDeptId(schedulePoolDto.getDeptId());
|
||||
schedulePool.setDoctorId(schedulePoolDto.getDoctorId());
|
||||
schedulePool.setDoctorName(schedulePoolDto.getDoctorName());
|
||||
schedulePool.setScheduleDate(schedulePoolDto.getScheduleDate());
|
||||
schedulePool.setShift(schedulePoolDto.getShift());
|
||||
schedulePool.setStartTime(schedulePoolDto.getStartTime());
|
||||
schedulePool.setEndTime(schedulePoolDto.getEndTime());
|
||||
|
||||
schedulePool.setRegType(schedulePoolDto.getRegType());
|
||||
schedulePool.setFee(schedulePoolDto.getFee());
|
||||
boolean save = schedulePoolService.save(schedulePool);
|
||||
return R.ok(save);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.openhis.web.appointmentmanage.appservice.impl;
|
||||
|
||||
import com.openhis.web.appointmentmanage.appservice.IScheduleSlotAppService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class ScheduleSlotAppServiceImpl implements IScheduleSlotAppService {
|
||||
}
|
||||
@@ -1,12 +1,11 @@
|
||||
package com.openhis.web.appointmentmanage.controller;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.administration.domain.DoctorSchedule;
|
||||
import com.openhis.appointmentmanage.domain.DoctorSchedule;
|
||||
import com.openhis.web.appointmentmanage.appservice.IDoctorScheduleAppService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.websocket.server.PathParam;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/doctor-schedule")
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.openhis.web.appointmentmanage.controller;
|
||||
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.appointmentmanage.domain.SchedulePool;
|
||||
import com.openhis.web.appointmentmanage.appservice.ISchedulePoolAppService;
|
||||
import com.openhis.web.appointmentmanage.dto.SchedulePoolDto;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/schedule-pool")
|
||||
public class SchedulePoolController {
|
||||
@Resource
|
||||
private ISchedulePoolAppService schedulePoolAppService;
|
||||
|
||||
/*
|
||||
* 新增号源
|
||||
*
|
||||
* */
|
||||
public R<?> addSchedulePool(@RequestBody SchedulePoolDto schedulePoolDto) {
|
||||
return R.ok(schedulePoolAppService.addSchedulePool(schedulePoolDto));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.openhis.web.appointmentmanage.controller;
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/schedule-slot")
|
||||
public class ScheduleSlotController {
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package com.openhis.web.appointmentmanage.dto;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
|
||||
/**
|
||||
* 号源池Dto
|
||||
*
|
||||
* @date 2025-12-12
|
||||
*/
|
||||
@Data
|
||||
public class SchedulePoolDto {
|
||||
/** id */
|
||||
private Integer id;
|
||||
|
||||
/** 业务编号 */
|
||||
private String poolCode;
|
||||
|
||||
/** 医院ID */
|
||||
private Integer hospitalId;
|
||||
|
||||
/** 科室ID */
|
||||
private Integer deptId;
|
||||
|
||||
/** 医生ID */
|
||||
private Integer doctorId;
|
||||
|
||||
/** 医生姓名 */
|
||||
private String doctorName;
|
||||
|
||||
/** 诊室 */
|
||||
private String clinicRoom;
|
||||
|
||||
/** 出诊日期 */
|
||||
private LocalDate scheduleDate;
|
||||
|
||||
/** 班别 */
|
||||
private String shift;
|
||||
|
||||
/** 开始时间 */
|
||||
private LocalTime startTime;
|
||||
|
||||
/** 结束时间 */
|
||||
private LocalTime endTime;
|
||||
|
||||
/** 总号量 */
|
||||
private Integer totalQuota;
|
||||
|
||||
/** 已约 */
|
||||
private Integer bookedNum;
|
||||
|
||||
/** 铁号数 */
|
||||
private Integer lockedNum;
|
||||
|
||||
/** 剩余号数 */
|
||||
private Integer availableNum;
|
||||
|
||||
/** 号别 */
|
||||
private String regType;
|
||||
|
||||
/** 原价 (元) */
|
||||
private Double fee;
|
||||
|
||||
/** 医保限价 (元) */
|
||||
private Double insurancePrice;
|
||||
|
||||
/** 支持渠道 */
|
||||
private String supportChannel;
|
||||
|
||||
/** 号源状态 */
|
||||
private Integer status;
|
||||
|
||||
/** 停诊原因 */
|
||||
private String stopReason;
|
||||
|
||||
/** 放号时间 */
|
||||
private LocalDateTime releaseTime;
|
||||
|
||||
/** 截止预约时间 */
|
||||
private LocalDateTime deadlineTime;
|
||||
|
||||
/** 乐观锁版本 */
|
||||
private Integer version;
|
||||
|
||||
/** 操作人ID */
|
||||
private Integer opUserId;
|
||||
|
||||
/** 备注 */
|
||||
private String remark;
|
||||
|
||||
/** 排班ID */
|
||||
private Integer scheduleId;
|
||||
|
||||
/** 创建时间 */
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/** 更新时间 */
|
||||
private LocalDateTime updateTime;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.openhis.web.appointmentmanage.mapper;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
public interface SchedulePoolAppMapper {
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.openhis.web.appointmentmanage.mapper;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
public interface ScheduleSlotAppMapper {
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
package com.openhis.administration.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.openhis.administration.domain.Dept;
|
||||
import com.openhis.administration.mapper.DeptMapper;
|
||||
import com.openhis.administration.service.IDeptService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class DeptImpl extends ServiceImpl<DeptMapper, Dept> implements IDeptService {
|
||||
}
|
||||
@@ -1,14 +1,13 @@
|
||||
package com.openhis.administration.domain;
|
||||
package com.openhis.appointmentmanage.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 科室Entity实体
|
||||
* 科室Entity
|
||||
*
|
||||
* @date 2025-12-08
|
||||
*/
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.openhis.administration.domain;
|
||||
package com.openhis.appointmentmanage.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
@@ -6,7 +6,11 @@ import lombok.experimental.Accessors;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
|
||||
/**
|
||||
* 医生排班Entity
|
||||
*
|
||||
* @date 2025-12-12
|
||||
*/
|
||||
@Data
|
||||
@TableName(value = "adm_doctor_schedule")
|
||||
@Accessors(chain = true)
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.openhis.administration.domain;
|
||||
package com.openhis.appointmentmanage.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
@@ -7,7 +7,11 @@ import lombok.experimental.Accessors;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
|
||||
/**
|
||||
* 号源池Entity
|
||||
*
|
||||
* @date 2025-12-12
|
||||
*/
|
||||
@Data
|
||||
@TableName(value = "adm_schedule_pool")
|
||||
@Accessors(chain = true)
|
||||
@@ -15,36 +19,84 @@ public class SchedulePool {
|
||||
/** id */
|
||||
private Integer id;
|
||||
|
||||
/** 业务编号 */
|
||||
private String poolCode;
|
||||
|
||||
/** 医院ID */
|
||||
private Integer hospitalId;
|
||||
|
||||
/** 科室ID */
|
||||
private Integer deptId;
|
||||
|
||||
/** 医生ID */
|
||||
private Integer doctorId;
|
||||
|
||||
/** 医生姓名 */
|
||||
private String doctorName;
|
||||
|
||||
/** 诊室 */
|
||||
private String clinicRoom;
|
||||
|
||||
/** 出诊日期 */
|
||||
private LocalDate scheduleDate;
|
||||
|
||||
/** 班别 */
|
||||
private String shift;
|
||||
|
||||
/** 开始时间 */
|
||||
private LocalTime startTime;
|
||||
|
||||
/** 结束时间 */
|
||||
private LocalTime endTime;
|
||||
/**/
|
||||
|
||||
/** 总号量 */
|
||||
private Integer totalQuota;
|
||||
|
||||
/** 已约 */
|
||||
private Integer bookedNum;
|
||||
|
||||
/** 铁号数 */
|
||||
private Integer lockedNum;
|
||||
|
||||
/** 剩余号数 */
|
||||
private Integer availableNum;
|
||||
|
||||
/** 号别 */
|
||||
private String regType;
|
||||
|
||||
/** 原价 (元) */
|
||||
private Double fee;
|
||||
|
||||
/** 医保限价 (元) */
|
||||
private Double insurancePrice;
|
||||
|
||||
/** 支持渠道 */
|
||||
private String supportChannel;
|
||||
|
||||
/** 号源状态 */
|
||||
private Integer status;
|
||||
|
||||
/** 停诊原因 */
|
||||
private String stopReason;
|
||||
|
||||
/** 放号时间 */
|
||||
private LocalDateTime releaseTime;
|
||||
|
||||
/** 截止预约时间 */
|
||||
private LocalDateTime deadlineTime;
|
||||
|
||||
/** 乐观锁版本 */
|
||||
private Integer version;
|
||||
|
||||
/** 操作人ID */
|
||||
private Integer opUserId;
|
||||
|
||||
/** 备注 */
|
||||
private String remark;
|
||||
|
||||
/** 排班ID */
|
||||
private Integer scheduleId;
|
||||
|
||||
/** 创建时间 */
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.openhis.administration.domain;
|
||||
package com.openhis.appointmentmanage.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
@@ -6,17 +6,33 @@ import lombok.experimental.Accessors;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
|
||||
/**
|
||||
* 号源池明细Entity
|
||||
*
|
||||
* @date 2025-12-12
|
||||
*/
|
||||
@Data
|
||||
@TableName(value = "adm_schedule_slot")
|
||||
@Accessors(chain = true)
|
||||
public class ScheduleSlot {
|
||||
/** 明细主键 */
|
||||
private Integer id;
|
||||
|
||||
/** 号源池ID */
|
||||
private Integer poolId;
|
||||
|
||||
/** 序号 */
|
||||
private Integer seqNo;
|
||||
|
||||
/** 序号状态: 0-可用,1-已预约,2-已取消,3-已过期等 */
|
||||
private Integer status;
|
||||
|
||||
/** 预约订单ID */
|
||||
private Integer orderId;
|
||||
|
||||
/** 预计叫号时间 */
|
||||
private LocalTime expectTime;
|
||||
|
||||
/** 创建时间 */
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.openhis.administration.mapper;
|
||||
package com.openhis.appointmentmanage.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.openhis.administration.domain.Dept;
|
||||
import com.openhis.appointmentmanage.domain.Dept;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.openhis.administration.mapper;
|
||||
package com.openhis.appointmentmanage.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.openhis.administration.domain.DoctorSchedule;
|
||||
import com.openhis.appointmentmanage.domain.DoctorSchedule;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.openhis.administration.mapper;
|
||||
package com.openhis.appointmentmanage.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.openhis.administration.domain.SchedulePool;
|
||||
import com.openhis.appointmentmanage.domain.SchedulePool;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.openhis.administration.mapper;
|
||||
package com.openhis.appointmentmanage.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.openhis.administration.domain.ScheduleSlot;
|
||||
import com.openhis.appointmentmanage.domain.ScheduleSlot;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.openhis.administration.service;
|
||||
package com.openhis.appointmentmanage.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.administration.domain.Dept;
|
||||
import com.openhis.appointmentmanage.domain.Dept;
|
||||
|
||||
public interface IDeptService extends IService<Dept> {
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.openhis.administration.service;
|
||||
package com.openhis.appointmentmanage.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.administration.domain.DoctorSchedule;
|
||||
import com.openhis.appointmentmanage.domain.DoctorSchedule;
|
||||
|
||||
public interface IDoctorScheduleService extends IService<DoctorSchedule> {
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.openhis.administration.service;
|
||||
package com.openhis.appointmentmanage.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.administration.domain.SchedulePool;
|
||||
import com.openhis.appointmentmanage.domain.SchedulePool;
|
||||
|
||||
public interface ISchedulePoolService extends IService<SchedulePool> {
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.openhis.administration.service;
|
||||
package com.openhis.appointmentmanage.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.administration.domain.ScheduleSlot;
|
||||
import com.openhis.appointmentmanage.domain.ScheduleSlot;
|
||||
|
||||
public interface IScheduleSlotService extends IService<ScheduleSlot> {
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.openhis.appointmentmanage.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.openhis.appointmentmanage.domain.Dept;
|
||||
import com.openhis.appointmentmanage.mapper.DeptMapper;
|
||||
import com.openhis.appointmentmanage.service.IDeptService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class DeptImpl extends ServiceImpl<DeptMapper, Dept> implements IDeptService {
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
package com.openhis.administration.service.impl;
|
||||
package com.openhis.appointmentmanage.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.openhis.administration.domain.DoctorSchedule;
|
||||
import com.openhis.administration.mapper.DoctorScheduleMapper;
|
||||
import com.openhis.administration.service.IDoctorScheduleService;
|
||||
import com.openhis.appointmentmanage.domain.DoctorSchedule;
|
||||
import com.openhis.appointmentmanage.mapper.DoctorScheduleMapper;
|
||||
import com.openhis.appointmentmanage.service.IDoctorScheduleService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@@ -1,9 +1,9 @@
|
||||
package com.openhis.administration.service.impl;
|
||||
package com.openhis.appointmentmanage.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.openhis.administration.domain.SchedulePool;
|
||||
import com.openhis.administration.mapper.SchedulePoolMapper;
|
||||
import com.openhis.administration.service.ISchedulePoolService;
|
||||
import com.openhis.appointmentmanage.domain.SchedulePool;
|
||||
import com.openhis.appointmentmanage.mapper.SchedulePoolMapper;
|
||||
import com.openhis.appointmentmanage.service.ISchedulePoolService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@@ -1,9 +1,9 @@
|
||||
package com.openhis.administration.service.impl;
|
||||
package com.openhis.appointmentmanage.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.openhis.administration.domain.ScheduleSlot;
|
||||
import com.openhis.administration.mapper.ScheduleSlotMapper;
|
||||
import com.openhis.administration.service.IScheduleSlotService;
|
||||
import com.openhis.appointmentmanage.domain.ScheduleSlot;
|
||||
import com.openhis.appointmentmanage.mapper.ScheduleSlotMapper;
|
||||
import com.openhis.appointmentmanage.service.IScheduleSlotService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@@ -98,10 +98,24 @@
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="maxNumber" label="限号数量" width="80"></el-table-column>
|
||||
<el-table-column prop="maxNumber" label="限号数量" width="80">
|
||||
<template #default="scope">
|
||||
<el-input
|
||||
v-model="scope.row.maxNumber"
|
||||
type="number"
|
||||
:disabled="!isEditMode"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="record" label="号源记录" width="80">
|
||||
<template #default="scope">
|
||||
<el-icon><View /></el-icon>
|
||||
<el-icon
|
||||
@click="handleViewRecord(scope.row)"
|
||||
class="record-icon"
|
||||
title="查看号源记录"
|
||||
>
|
||||
<View />
|
||||
</el-icon>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="appointmentItem" label="挂号项目" width="120">
|
||||
@@ -186,13 +200,32 @@
|
||||
<el-button @click="handleCancel">取消</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 号源记录对话框 -->
|
||||
<el-dialog
|
||||
v-model="recordDialogVisible"
|
||||
title="号源记录"
|
||||
width="30%"
|
||||
:close-on-click-modal="true"
|
||||
>
|
||||
<div class="appointment-records">
|
||||
<div class="record-item" v-for="record in appointmentRecords" :key="record.index">
|
||||
<span class="record-time">{{ record.time }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="recordDialogVisible = false">确定</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="DoctorSchedule">
|
||||
import { ref, onMounted, computed } from 'vue'
|
||||
import { ref, onMounted, computed, watch } from 'vue'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { ElMessage, ElMessageBox, ElDialog } from 'element-plus'
|
||||
import { View } from '@element-plus/icons-vue'
|
||||
|
||||
// 路由和导航
|
||||
@@ -264,7 +297,7 @@ const generateWeekSchedule = (startDate) => {
|
||||
endTime: slot.endTime,
|
||||
doctorName: '',
|
||||
room: '',
|
||||
maxNumber: 20,
|
||||
maxNumber: '',
|
||||
appointmentItem: '',
|
||||
registrationFee: '',
|
||||
clinicItem: '',
|
||||
@@ -299,6 +332,59 @@ const handleDeleteSchedule = (row) => {
|
||||
ElMessage.info('删除排班功能待实现')
|
||||
}
|
||||
|
||||
// 号源记录对话框相关
|
||||
const recordDialogVisible = ref(false)
|
||||
const currentRow = ref(null)
|
||||
const appointmentRecords = ref([])
|
||||
|
||||
// 计算号源记录
|
||||
const calculateAppointmentRecords = (row) => {
|
||||
const { startTime, endTime, maxNumber } = row
|
||||
|
||||
// 将时间转换为分钟数
|
||||
const [startHour, startMinute] = startTime.split(':').map(Number)
|
||||
const [endHour, endMinute] = endTime.split(':').map(Number)
|
||||
|
||||
const startTotalMinutes = startHour * 60 + startMinute
|
||||
const endTotalMinutes = endHour * 60 + endMinute
|
||||
|
||||
// 计算总时长和间隔
|
||||
const totalDuration = endTotalMinutes - startTotalMinutes
|
||||
const interval = Math.floor(totalDuration / maxNumber)
|
||||
|
||||
// 生成号源记录
|
||||
const records = []
|
||||
for (let i = 0; i < maxNumber; i++) {
|
||||
const minutes = startTotalMinutes + i * interval
|
||||
const hour = Math.floor(minutes / 60).toString().padStart(2, '0')
|
||||
const minute = (minutes % 60).toString().padStart(2, '0')
|
||||
records.push({
|
||||
index: i + 1,
|
||||
time: `${hour}:${minute}`
|
||||
})
|
||||
}
|
||||
|
||||
return records
|
||||
}
|
||||
|
||||
// 查看号源记录
|
||||
const handleViewRecord = (row) => {
|
||||
// 验证开始时间、结束时间和限号数量
|
||||
if (!row.startTime || !row.endTime || !row.maxNumber) {
|
||||
ElMessageBox.confirm('请先设置开始时间、结束时间和限号数量', '', {
|
||||
confirmButtonText: '确定',
|
||||
type: 'warning',
|
||||
showCancelButton: false
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
// 计算号源记录
|
||||
currentRow.value = row
|
||||
appointmentRecords.value = calculateAppointmentRecords(row)
|
||||
recordDialogVisible.value = true
|
||||
}
|
||||
|
||||
// 保存排班
|
||||
const handleSave = () => {
|
||||
ElMessage.success('排班保存成功')
|
||||
@@ -316,6 +402,15 @@ const handleCancel = () => {
|
||||
onMounted(() => {
|
||||
initData()
|
||||
})
|
||||
|
||||
// 监听路由参数变化,重新初始化数据
|
||||
watch(
|
||||
() => [route.params.deptId, route.query.mode],
|
||||
() => {
|
||||
initData()
|
||||
},
|
||||
{ deep: true }
|
||||
)
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@@ -462,9 +557,55 @@ onMounted(() => {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.record-icon {
|
||||
font-size: 18px;
|
||||
color: #409eff;
|
||||
cursor: pointer;
|
||||
transition: color 0.2s;
|
||||
}
|
||||
|
||||
.record-icon:hover {
|
||||
color: #66b1ff;
|
||||
}
|
||||
|
||||
.bottom-buttons {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
/* 号源记录对话框样式 */
|
||||
.appointment-records {
|
||||
max-height: 300px;
|
||||
overflow-y: auto;
|
||||
padding: 10px 0;
|
||||
}
|
||||
|
||||
.record-item {
|
||||
padding: 8px 0;
|
||||
border-bottom: 1px solid #f0f0f0;
|
||||
}
|
||||
|
||||
.record-item:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.record-time {
|
||||
font-size: 16px;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.dialog-footer {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/* 隐藏数字输入框的增减按钮 */
|
||||
:deep(.el-input__inner[type="number"]) {
|
||||
-moz-appearance: textfield;
|
||||
}
|
||||
:deep(.el-input__inner[type="number"])::-webkit-outer-spin-button,
|
||||
:deep(.el-input__inner[type="number"])::-webkit-inner-spin-button {
|
||||
-webkit-appearance: none;
|
||||
margin: 0;
|
||||
}
|
||||
</style>
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="appoinmentmanage-container">
|
||||
<div class="appoinmentmanage-header">
|
||||
<h2 class="appoinmentmanage-title">预约管理</h2>
|
||||
<h2 class="appoinmentmanage-title">科室名称管理</h2>
|
||||
</div>
|
||||
|
||||
<div class="appoinmentmanage-content">
|
||||
|
||||
Reference in New Issue
Block a user