feat(home): 添加医生专属患者统计和菜单跳转功能

- 在HomeStatisticsDto中新增我的患者数量和待写病历数量字段
- 实现医生患者查询功能,支持按租户隔离数据
- 更新首页统计服务,为医生用户提供专属患者统计数据
- 添加菜单名称点击跳转功能,支持路由导航和外部链接打开
- 修复首页统计数据显示,确保医生看到正确的患者数量
- 添加医保日结结算相关实体、服务和前端页面
- 配置前端路由控制器,支持Vue Router History模式
This commit is contained in:
2026-02-02 16:28:31 +08:00
parent 5534a71c7d
commit 9ed43c9413
16 changed files with 1100 additions and 27 deletions

View File

@@ -0,0 +1,46 @@
package com.core.web.controller.common;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
/**
* 前端路由 fallback 控制器
* 处理 Vue Router History 模式下的路由
*
* @author
*/
@Controller
public class FrontRouterController {
/**
* 处理前端路由,将所有前端路由请求转发到 index.html
*/
@RequestMapping(value = {
"/ybmanagement/**",
"/system/**",
"/monitor/**",
"/tool/**",
"/doctorstation/**",
"/features/**",
"/todo/**",
"/appoinmentmanage/**",
"/clinicmanagement/**",
"/medicationmanagement/**",
"/yb/**",
"/patient/**",
"/charge/**",
"/nurse/**",
"/pharmacy/**",
"/report/**",
"/document/**",
"/triage/**",
"/check/**",
"/lab/**",
"/financial/**",
"/crosssystem/**",
"/workflow/**"
})
public String index() {
return "forward:/index.html";
}
}

View File

@@ -0,0 +1,34 @@
package com.core.common.core.domain;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.List;
/**
* 分页结果类
*
* @author
* @date 2026-02-02
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class PageResult<T> implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 数据列表
*/
private List<T> rows;
/**
* 总数
*/
private long total;
}

View File

@@ -59,4 +59,14 @@ public class HomeStatisticsDto {
* 待审核数量 * 待审核数量
*/ */
private Integer pendingApprovals; private Integer pendingApprovals;
/**
* 我的患者数量(医生专属)
*/
private Integer myPatients;
/**
* 待写病历数量
*/
private Integer pendingEmr;
} }

View File

@@ -136,6 +136,7 @@ public class PatientInformationServiceImpl implements IPatientInformationService
// 获取登录者信息 // 获取登录者信息
LoginUser loginUser = SecurityUtils.getLoginUser(); LoginUser loginUser = SecurityUtils.getLoginUser();
Long userId = loginUser.getUserId(); Long userId = loginUser.getUserId();
Integer tenantId = loginUser.getTenantId().intValue();
// 先构建基础查询条件 // 先构建基础查询条件
QueryWrapper<PatientBaseInfoDto> queryWrapper = HisQueryUtils.buildQueryWrapper( QueryWrapper<PatientBaseInfoDto> queryWrapper = HisQueryUtils.buildQueryWrapper(
@@ -159,8 +160,9 @@ public class PatientInformationServiceImpl implements IPatientInformationService
if (practitioner != null) { if (practitioner != null) {
// 查询该医生作为接诊医生ADMITTER, code="1"和挂号医生REGISTRATION_DOCTOR, code="12"的所有就诊记录的患者ID // 查询该医生作为接诊医生ADMITTER, code="1"和挂号医生REGISTRATION_DOCTOR, code="12"的所有就诊记录的患者ID
List<Long> doctorPatientIds = patientManageMapper.getPatientIdsByPractitionerId( List<Long> doctorPatientIds = patientManageMapper.getPatientIdsByPractitionerId(
practitioner.getId(), practitioner.getId(),
Arrays.asList(ParticipantType.ADMITTER.getCode(), ParticipantType.REGISTRATION_DOCTOR.getCode())); Arrays.asList(ParticipantType.ADMITTER.getCode(), ParticipantType.REGISTRATION_DOCTOR.getCode()),
tenantId);
if (doctorPatientIds != null && !doctorPatientIds.isEmpty()) { if (doctorPatientIds != null && !doctorPatientIds.isEmpty()) {
// 添加患者ID过滤条件 - 注意:这里使用列名而不是表别名 // 添加患者ID过滤条件 - 注意:这里使用列名而不是表别名

View File

@@ -64,8 +64,10 @@ public interface PatientManageMapper extends BaseMapper<Patient> {
* *
* @param practitionerId 医生ID * @param practitionerId 医生ID
* @param typeCodes 参与者类型代码列表 * @param typeCodes 参与者类型代码列表
* @param tenantId 租户ID
* @return 患者ID列表 * @return 患者ID列表
*/ */
List<Long> getPatientIdsByPractitionerId(@Param("practitionerId") Long practitionerId, List<Long> getPatientIdsByPractitionerId(@Param("practitionerId") Long practitionerId,
@Param("typeCodes") List<String> typeCodes); @Param("typeCodes") List<String> typeCodes,
@Param("tenantId") Integer tenantId);
} }

View File

@@ -66,23 +66,34 @@ public class HomeStatisticsServiceImpl implements IHomeStatisticsService {
Practitioner practitioner = practitionerList != null && !practitionerList.isEmpty() ? practitionerList.get(0) : null; Practitioner practitioner = practitionerList != null && !practitionerList.isEmpty() ? practitionerList.get(0) : null;
int totalPatients = 0; int totalPatients = 0;
int myPatients = 0;
// 如果当前用户是医生,查询该医生接诊和被挂号的所有患者 // 如果当前用户是医生,查询该医生接诊和被挂号的所有患者
if (practitioner != null) { if (practitioner != null) {
// 获取当前登录用户的租户ID
Integer tenantId = SecurityUtils.getLoginUser().getTenantId().intValue();
// 查询该医生作为接诊医生ADMITTER, code="1"和挂号医生REGISTRATION_DOCTOR, code="12"的所有就诊记录的患者ID // 查询该医生作为接诊医生ADMITTER, code="1"和挂号医生REGISTRATION_DOCTOR, code="12"的所有就诊记录的患者ID
List<Long> doctorPatientIds = patientManageMapper.getPatientIdsByPractitionerId( List<Long> doctorPatientIds = patientManageMapper.getPatientIdsByPractitionerId(
practitioner.getId(), practitioner.getId(),
Arrays.asList(ParticipantType.ADMITTER.getCode(), ParticipantType.REGISTRATION_DOCTOR.getCode())); Arrays.asList(ParticipantType.ADMITTER.getCode(), ParticipantType.REGISTRATION_DOCTOR.getCode()),
tenantId);
totalPatients = doctorPatientIds != null ? doctorPatientIds.size() : 0;
myPatients = doctorPatientIds != null ? doctorPatientIds.size() : 0;
// 对于医生,"我的患者"数量即为该医生负责的患者数量
statistics.setMyPatients(myPatients);
} else { } else {
// 如果不是医生,查询所有患者(与患者管理页面逻辑保持一致) // 如果不是医生,"我的患者"数量为0
LambdaQueryWrapper<Patient> patientQuery = new LambdaQueryWrapper<>(); statistics.setMyPatients(0);
patientQuery.eq(Patient::getDeleteFlag, "0");
List<Patient> patientList = patientService.list(patientQuery);
totalPatients = patientList != null ? patientList.size() : 0;
} }
// 查询所有患者作为总患者数
LambdaQueryWrapper<Patient> patientQuery = new LambdaQueryWrapper<>();
patientQuery.eq(Patient::getDeleteFlag, "0");
List<Patient> patientList = patientService.list(patientQuery);
totalPatients = patientList != null ? patientList.size() : 0;
statistics.setTotalPatients(totalPatients); statistics.setTotalPatients(totalPatients);
// 查询昨日在院患者数量(暂时简化处理) // 查询昨日在院患者数量(暂时简化处理)

View File

@@ -3,6 +3,8 @@ package com.openhis.web.system.controller;
import com.core.common.core.domain.R; import com.core.common.core.domain.R;
import com.core.common.utils.SecurityUtils; import com.core.common.utils.SecurityUtils;
import com.openhis.web.doctorstation.appservice.IDoctorStationEmrAppService; import com.openhis.web.doctorstation.appservice.IDoctorStationEmrAppService;
import com.openhis.web.dto.HomeStatisticsDto;
import com.openhis.web.service.IHomeStatisticsService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
@@ -20,19 +22,21 @@ import org.springframework.web.bind.annotation.RestController;
public class HomeController { public class HomeController {
private final IDoctorStationEmrAppService doctorStationEmrAppService; private final IDoctorStationEmrAppService doctorStationEmrAppService;
private final IHomeStatisticsService homeStatisticsService;
@ApiOperation("获取首页统计数据") @ApiOperation("获取首页统计数据")
@GetMapping("/statistics") @GetMapping("/statistics")
public R<?> getStatistics() { public R<?> getStatistics() {
// 这里可以返回各种统计数据 // 获取基础统计数据
// 为了简化,我们只返回待写病历数量 HomeStatisticsDto statisticsDto = homeStatisticsService.getHomeStatistics();
// 获取待写病历数量
Long userId = SecurityUtils.getLoginUser().getUserId(); Long userId = SecurityUtils.getLoginUser().getUserId();
R<?> pendingEmrCount = doctorStationEmrAppService.getPendingEmrCount(userId); R<?> pendingEmrCount = doctorStationEmrAppService.getPendingEmrCount(userId);
// 构建返回数据 // 将待写病历数量添加到统计数据
java.util.Map<String, Object> data = new java.util.HashMap<>(); statisticsDto.setPendingEmr((Integer) pendingEmrCount.getData());
data.put("pendingEmr", pendingEmrCount.getData());
return R.ok(statisticsDto);
return R.ok(data);
} }
} }

View File

@@ -136,13 +136,13 @@
<select id="getPatientIdsByPractitionerId" resultType="java.lang.Long"> <select id="getPatientIdsByPractitionerId" resultType="java.lang.Long">
SELECT DISTINCT enc.patient_id SELECT DISTINCT enc.patient_id
FROM adm_encounter_participant AS ep FROM adm_encounter_participant AS ep
LEFT JOIN adm_encounter AS enc ON ep.encounter_id = enc.ID AND enc.delete_flag = '0' INNER JOIN adm_encounter AS enc ON ep.encounter_id = enc.ID AND enc.delete_flag = '0'
INNER JOIN adm_patient AS pt ON enc.patient_id = pt.id AND pt.delete_flag = '0' INNER JOIN adm_patient AS pt ON enc.patient_id = pt.id AND pt.delete_flag = '0'
WHERE ep.delete_flag = '0' WHERE ep.delete_flag = '0'
AND ep.practitioner_id = #{practitionerId} AND ep.practitioner_id = #{practitionerId}
AND ep.tenant_id = 1 AND ep.tenant_id = #{tenantId}
AND enc.tenant_id = 1 AND enc.tenant_id = #{tenantId}
AND pt.tenant_id = 1 AND pt.tenant_id = #{tenantId}
<if test="typeCodes != null and !typeCodes.isEmpty()"> <if test="typeCodes != null and !typeCodes.isEmpty()">
AND ep.type_code IN AND ep.type_code IN
<foreach collection="typeCodes" item="typeCode" open="(" separator="," close=")"> <foreach collection="typeCodes" item="typeCode" open="(" separator="," close=")">

View File

@@ -0,0 +1,118 @@
package com.openhis.yb.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.core.common.core.domain.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import java.math.BigDecimal;
import java.util.Date;
/**
* 日结医保结算实体类
*
* @author
* @date 2026-02-02
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@TableName("yb_day_end_settlement")
public class DayEndMedicalInsuranceSettlement extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 主键ID
*/
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 结算单号
*/
@TableField("settlement_no")
private String settlementNo;
/**
* 结算日期
*/
@TableField("settlement_date")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date settlementDate;
/**
* 结算类型 (daily, weekly, monthly)
*/
@TableField("settlement_type")
private String settlementType;
/**
* 医保类型 (城镇职工, 城乡居民等)
*/
@TableField("insurance_type")
private String insuranceType;
/**
* 总人次
*/
@TableField("total_visits")
private Integer totalVisits;
/**
* 总金额
*/
@TableField("total_amount")
private BigDecimal totalAmount;
/**
* 医保统筹支付金额
*/
@TableField("insurance_pay_amount")
private BigDecimal insurancePayAmount;
/**
* 个人账户支付金额
*/
@TableField("account_pay_amount")
private BigDecimal accountPayAmount;
/**
* 个人自付金额
*/
@TableField("personal_pay_amount")
private BigDecimal personalPayAmount;
/**
* 医保基金支付总额
*/
@TableField("fund_pay_sum_amount")
private BigDecimal fundPaySumAmount;
/**
* 状态 (0正常 1停用)
*/
@TableField("status")
private String status;
/**
* 操作员
*/
@TableField("operator")
private String operator;
/**
* 备注
*/
@TableField("remark")
private String remark;
}

View File

@@ -0,0 +1,18 @@
package com.openhis.yb.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.openhis.yb.domain.DayEndMedicalInsuranceSettlement;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
/**
* 日结医保结算Mapper接口
*
* @author
* @date 2026-02-02
*/
@Mapper
@Repository
public interface DayEndMedicalInsuranceSettlementMapper extends BaseMapper<DayEndMedicalInsuranceSettlement> {
}

View File

@@ -0,0 +1,74 @@
package com.openhis.yb.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.openhis.yb.domain.DayEndMedicalInsuranceSettlement;
import com.core.common.core.domain.PageResult;
import java.util.List;
/**
* 日结医保结算Service接口
*
* @author
* @date 2026-02-02
*/
public interface IDayEndMedicalInsuranceSettlementService extends IService<DayEndMedicalInsuranceSettlement> {
/**
* 查询日结医保结算
*
* @param id 日结医保结算ID
* @return 日结医保结算
*/
DayEndMedicalInsuranceSettlement selectDayEndMedicalInsuranceSettlementById(Long id);
/**
* 查询日结医保结算列表
*
* @param dayEndMedicalInsuranceSettlement 日结医保结算
* @return 日结医保结算集合
*/
List<DayEndMedicalInsuranceSettlement> selectDayEndMedicalInsuranceSettlementList(DayEndMedicalInsuranceSettlement dayEndMedicalInsuranceSettlement);
/**
* 新增日结医保结算
*
* @param dayEndMedicalInsuranceSettlement 日结医保结算
* @return 结果
*/
int insertDayEndMedicalInsuranceSettlement(DayEndMedicalInsuranceSettlement dayEndMedicalInsuranceSettlement);
/**
* 修改日结医保结算
*
* @param dayEndMedicalInsuranceSettlement 日结医保结算
* @return 结果
*/
int updateDayEndMedicalInsuranceSettlement(DayEndMedicalInsuranceSettlement dayEndMedicalInsuranceSettlement);
/**
* 批量删除日结医保结算
*
* @param ids 需要删除的日结医保结算ID
* @return 结果
*/
int deleteDayEndMedicalInsuranceSettlementByIds(Long[] ids);
/**
* 删除日结医保结算信息
*
* @param id 日结医保结算ID
* @return 结果
*/
int deleteDayEndMedicalInsuranceSettlementById(Long id);
/**
* 分页查询日结医保结算列表
*
* @param dayEndMedicalInsuranceSettlement 日结医保结算
* @param pageNum 页码
* @param pageSize 页面大小
* @return 分页结果
*/
PageResult<DayEndMedicalInsuranceSettlement> selectDayEndMedicalInsuranceSettlementPage(DayEndMedicalInsuranceSettlement dayEndMedicalInsuranceSettlement, int pageNum, int pageSize);
}

View File

@@ -0,0 +1,128 @@
package com.openhis.yb.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.core.common.core.domain.PageResult;
import com.openhis.yb.domain.DayEndMedicalInsuranceSettlement;
import com.openhis.yb.mapper.DayEndMedicalInsuranceSettlementMapper;
import com.openhis.yb.service.IDayEndMedicalInsuranceSettlementService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Arrays;
import java.util.List;
/**
* 日结医保结算Service业务层处理
*
* @author
* @date 2026-02-02
*/
@Service
public class DayEndMedicalInsuranceSettlementServiceImpl extends ServiceImpl<DayEndMedicalInsuranceSettlementMapper, DayEndMedicalInsuranceSettlement> implements IDayEndMedicalInsuranceSettlementService {
@Autowired
private DayEndMedicalInsuranceSettlementMapper dayEndMedicalInsuranceSettlementMapper;
/**
* 查询日结医保结算
*
* @param id 日结医保结算ID
* @return 日结医保结算
*/
@Override
public DayEndMedicalInsuranceSettlement selectDayEndMedicalInsuranceSettlementById(Long id) {
return dayEndMedicalInsuranceSettlementMapper.selectById(id);
}
/**
* 查询日结医保结算列表
*
* @param dayEndMedicalInsuranceSettlement 日结医保结算
* @return 日结医保结算
*/
@Override
public List<DayEndMedicalInsuranceSettlement> selectDayEndMedicalInsuranceSettlementList(DayEndMedicalInsuranceSettlement dayEndMedicalInsuranceSettlement) {
LambdaQueryWrapper<DayEndMedicalInsuranceSettlement> lqw = Wrappers.lambdaQuery();
lqw.like(dayEndMedicalInsuranceSettlement.getSettlementNo() != null, DayEndMedicalInsuranceSettlement::getSettlementNo, dayEndMedicalInsuranceSettlement.getSettlementNo());
lqw.eq(dayEndMedicalInsuranceSettlement.getSettlementDate() != null, DayEndMedicalInsuranceSettlement::getSettlementDate, dayEndMedicalInsuranceSettlement.getSettlementDate());
lqw.eq(dayEndMedicalInsuranceSettlement.getSettlementType() != null, DayEndMedicalInsuranceSettlement::getSettlementType, dayEndMedicalInsuranceSettlement.getSettlementType());
lqw.eq(dayEndMedicalInsuranceSettlement.getInsuranceType() != null, DayEndMedicalInsuranceSettlement::getInsuranceType, dayEndMedicalInsuranceSettlement.getInsuranceType());
lqw.eq(dayEndMedicalInsuranceSettlement.getStatus() != null, DayEndMedicalInsuranceSettlement::getStatus, dayEndMedicalInsuranceSettlement.getStatus());
lqw.orderByDesc(DayEndMedicalInsuranceSettlement::getCreateTime);
return dayEndMedicalInsuranceSettlementMapper.selectList(lqw);
}
/**
* 新增日结医保结算
*
* @param dayEndMedicalInsuranceSettlement 日结医保结算
* @return 结果
*/
@Override
public int insertDayEndMedicalInsuranceSettlement(DayEndMedicalInsuranceSettlement dayEndMedicalInsuranceSettlement) {
return dayEndMedicalInsuranceSettlementMapper.insert(dayEndMedicalInsuranceSettlement);
}
/**
* 修改日结医保结算
*
* @param dayEndMedicalInsuranceSettlement 日结医保结算
* @return 结果
*/
@Override
public int updateDayEndMedicalInsuranceSettlement(DayEndMedicalInsuranceSettlement dayEndMedicalInsuranceSettlement) {
return dayEndMedicalInsuranceSettlementMapper.updateById(dayEndMedicalInsuranceSettlement);
}
/**
* 批量删除日结医保结算
*
* @param ids 需要删除的日结医保结算ID
* @return 结果
*/
@Override
public int deleteDayEndMedicalInsuranceSettlementByIds(Long[] ids) {
return dayEndMedicalInsuranceSettlementMapper.deleteBatchIds(Arrays.asList(ids));
}
/**
* 删除日结医保结算信息
*
* @param id 日结医保结算ID
* @return 结果
*/
@Override
public int deleteDayEndMedicalInsuranceSettlementById(Long id) {
return dayEndMedicalInsuranceSettlementMapper.deleteById(id);
}
/**
* 分页查询日结医保结算列表
*
* @param dayEndMedicalInsuranceSettlement 日结医保结算
* @param pageNum 页码
* @param pageSize 页面大小
* @return 分页结果
*/
@Override
public PageResult<DayEndMedicalInsuranceSettlement> selectDayEndMedicalInsuranceSettlementPage(DayEndMedicalInsuranceSettlement dayEndMedicalInsuranceSettlement, int pageNum, int pageSize) {
LambdaQueryWrapper<DayEndMedicalInsuranceSettlement> lqw = Wrappers.lambdaQuery();
lqw.like(dayEndMedicalInsuranceSettlement.getSettlementNo() != null, DayEndMedicalInsuranceSettlement::getSettlementNo, dayEndMedicalInsuranceSettlement.getSettlementNo());
lqw.eq(dayEndMedicalInsuranceSettlement.getSettlementDate() != null, DayEndMedicalInsuranceSettlement::getSettlementDate, dayEndMedicalInsuranceSettlement.getSettlementDate());
lqw.eq(dayEndMedicalInsuranceSettlement.getSettlementType() != null, DayEndMedicalInsuranceSettlement::getSettlementType, dayEndMedicalInsuranceSettlement.getSettlementType());
lqw.eq(dayEndMedicalInsuranceSettlement.getInsuranceType() != null, DayEndMedicalInsuranceSettlement::getInsuranceType, dayEndMedicalInsuranceSettlement.getInsuranceType());
lqw.eq(dayEndMedicalInsuranceSettlement.getStatus() != null, DayEndMedicalInsuranceSettlement::getStatus, dayEndMedicalInsuranceSettlement.getStatus());
lqw.orderByDesc(DayEndMedicalInsuranceSettlement::getCreateTime);
Page<DayEndMedicalInsuranceSettlement> page = new Page<>(pageNum, pageSize);
Page<DayEndMedicalInsuranceSettlement> result = dayEndMedicalInsuranceSettlementMapper.selectPage(page, lqw);
return PageResult.<DayEndMedicalInsuranceSettlement>builder()
.rows(result.getRecords())
.total(result.getTotal())
.build();
}
}

View File

@@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询日结医保结算列表
export function listDayEndMedicalInsuranceSettlement(query) {
return request({
url: '/ybmanage/dayEndMedicalInsuranceSettlement/list',
method: 'get',
params: query
})
}
// 查询日结医保结算详细
export function getDayEndMedicalInsuranceSettlement(id) {
return request({
url: '/ybmanage/dayEndMedicalInsuranceSettlement/' + id,
method: 'get'
})
}
// 新增日结医保结算
export function addDayEndMedicalInsuranceSettlement(data) {
return request({
url: '/ybmanage/dayEndMedicalInsuranceSettlement',
method: 'post',
data: data
})
}
// 修改日结医保结算
export function updateDayEndMedicalInsuranceSettlement(data) {
return request({
url: '/ybmanage/dayEndMedicalInsuranceSettlement',
method: 'put',
data: data
})
}
// 删除日结医保结算
export function delDayEndMedicalInsuranceSettlement(id) {
return request({
url: '/ybmanage/dayEndMedicalInsuranceSettlement/' + id,
method: 'delete'
})
}

View File

@@ -629,7 +629,7 @@ const currentStats = computed(() => {
statWith.value = statisticsData.value.pendingApprovals; statWith.value = statisticsData.value.pendingApprovals;
break; break;
case 'myPatients': case 'myPatients':
statWith.value = statisticsData.value.totalPatients; statWith.value = statisticsData.value.myPatients || 0;
statWith.trend = statisticsData.value.patientTrend; statWith.trend = statisticsData.value.patientTrend;
break; break;
case 'todayAppointments': case 'todayAppointments':

View File

@@ -65,7 +65,19 @@
:default-expand-all="isExpandAll" :default-expand-all="isExpandAll"
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }" :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
> >
<el-table-column prop="menuName" label="菜单名称" :show-overflow-tooltip="true" width="160"></el-table-column> <el-table-column prop="menuName" label="菜单名称" :show-overflow-tooltip="true" width="160">
<template #default="scope">
<span
v-if="scope.row.menuType === 'C'"
class="menu-name-link"
@click="handleMenuClick(scope.row)"
:title="`点击跳转到${scope.row.menuName}模块`"
style="cursor: pointer; color: #409EFF;">
{{ scope.row.menuName }}
</span>
<span v-else>{{ scope.row.menuName }}</span>
</template>
</el-table-column>
<el-table-column prop="icon" label="图标" align="center" width="100"> <el-table-column prop="icon" label="图标" align="center" width="100">
<template #default="scope"> <template #default="scope">
<svg-icon :icon-class="scope.row.icon" /> <svg-icon :icon-class="scope.row.icon" />
@@ -302,10 +314,17 @@
</div> </div>
</template> </template>
<style scoped>
.menu-name-link:hover {
text-decoration: underline;
}
</style>
<script setup name="Menu"> <script setup name="Menu">
import {addMenu, delMenu, getMenu, listMenu, updateMenu, treeselect} from "@/api/system/menu"; import {addMenu, delMenu, getMenu, listMenu, updateMenu, treeselect} from "@/api/system/menu";
import SvgIcon from "@/components/SvgIcon"; import SvgIcon from "@/components/SvgIcon";
import IconSelect from "@/components/IconSelect"; import IconSelect from "@/components/IconSelect";
import {getNormalPath} from "@/utils/openhis";
const { proxy } = getCurrentInstance(); const { proxy } = getCurrentInstance();
const { sys_show_hide, sys_normal_disable } = proxy.useDict("sys_show_hide", "sys_normal_disable"); const { sys_show_hide, sys_normal_disable } = proxy.useDict("sys_show_hide", "sys_normal_disable");
@@ -495,5 +514,70 @@ function handleDelete(row) {
}).catch(() => {}); }).catch(() => {});
} }
/** 处理菜单点击事件,跳转到对应功能模块 */
function handleMenuClick(row) {
// 只有菜单类型(C)才会进入此函数,因为模板中已限制
// 检查菜单是否有对应的路由路径
if (!row.path) {
proxy.$modal.msgWarning(`${row.menuName} 暂无对应的功能模块`);
return;
}
// 如果是外部链接,新开窗口打开
if (row.isFrame === '0' && (row.path.startsWith('http://') || row.path.startsWith('https://'))) {
window.open(row.path, '_blank');
return;
}
// 使用完整路径作为主要路径,但如果它包含 /system 前缀而原始路径不包含,
// 则使用原始路径,以避免路由系统添加额外的 /system 前缀
let routePath = row.fullPath || row.path;
// 特殊处理:如果完整路径以 /system/ 开头,但菜单本身路径不包含 /system/
// 则使用菜单路径,避免重复添加 /system 前缀
if (row.fullPath && row.path &&
row.fullPath.startsWith('/system/') &&
!row.path.startsWith('/system/')) {
routePath = row.path;
}
// 确保路径以 / 开头
if (!routePath.startsWith('/')) {
routePath = '/' + routePath;
}
// 规范化路径,处理可能的路径问题
const normalizedPath = getNormalPath(routePath);
// 尝试导航到对应路由
try {
// 使用 router.push 导航到目标路由
proxy.$router.push({
path: normalizedPath
}).catch(err => {
// 如果路由导航失败,尝试另一种方式
console.error(`路由导航失败,尝试备用方案: ${normalizedPath}`, err);
// 尝试使用 name 进行路由跳转(如果菜单有路由名称)
if (row.routeName) {
try {
proxy.$router.push({ name: row.routeName }).catch(nameErr => {
console.error(`使用路由名称跳转也失败: ${row.routeName}`, nameErr);
proxy.$modal.msgError(`${row.menuName} 模块暂无法访问,请检查权限或联系管理员`);
});
} catch (nameErr) {
console.error(`使用路由名称跳转异常: ${row.routeName}`, nameErr);
proxy.$modal.msgError(`${row.menuName} 模块跳转失败`);
}
} else {
proxy.$modal.msgError(`${row.menuName} 模块暂无法访问,请检查权限或联系管理员`);
}
});
} catch (error) {
console.error(`跳转到 ${row.menuName} 模块失败:`, error);
proxy.$modal.msgError(`${row.menuName} 模块跳转失败`);
}
}
getList(); getList();
</script> </script>

View File

@@ -0,0 +1,498 @@
<template>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryRef"
:inline="true"
v-show="showSearch"
label-width="100px"
>
<el-row>
<el-col :span="6">
<el-form-item label="结算单号" prop="settlementNo">
<el-input
v-model="queryParams.settlementNo"
placeholder="请输入结算单号"
clearable
style="width: 240px"
@keyup.enter="handleQuery"
/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="结算日期">
<el-date-picker
v-model="queryTime"
type="daterange"
start-placeholder="开始日期"
end-placeholder="结束日期"
style="width: 240px"
value-format="YYYY-MM-DD"
/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="结算类型" prop="settlementType">
<el-select
v-model="queryParams.settlementType"
placeholder="请选择结算类型"
clearable
style="width: 240px"
>
<el-option label="日结" value="daily" />
<el-option label="周结" value="weekly" />
<el-option label="月结" value="monthly" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="医保类型" prop="insuranceType">
<el-select
v-model="queryParams.insuranceType"
placeholder="请选择医保类型"
clearable
style="width: 240px"
>
<el-option label="城镇职工" value="urbanEmployee" />
<el-option label="城乡居民" value="urbanRuralResident" />
<el-option label="新农合" value="newRuralCooperative" />
<el-option label="自费" value="selfPaid" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="6">
<el-form-item label="状态" prop="status">
<el-select
v-model="queryParams.status"
placeholder="请选择状态"
clearable
style="width: 240px"
>
<el-option
v-for="dict in sys_normal_disable"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item style="float: right">
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="Plus"
@click="handleAdd"
v-hasPermi="['ybmanage:dayEndMedicalInsuranceSettlement:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="Edit"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['ybmanage:dayEndMedicalInsuranceSettlement:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="Delete"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['ybmanage:dayEndMedicalInsuranceSettlement:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="Download"
@click="handleExport"
v-hasPermi="['ybmanage:dayEndMedicalInsuranceSettlement:export']"
>导出</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="info"
plain
icon="Document"
@click="handleSettle"
v-hasPermi="['ybmanage:dayEndMedicalInsuranceSettlement:settle']"
>日结</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList" />
</el-row>
<el-table v-loading="loading" :data="dayEndMedicalInsuranceSettlementList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="结算单号" align="center" prop="settlementNo" />
<el-table-column label="结算日期" align="center" prop="settlementDate" width="120">
<template #default="scope">
<span>{{ parseTime(scope.row.settlementDate, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="结算类型" align="center" prop="settlementType">
<template #default="scope">
<el-tag v-if="scope.row.settlementType === 'daily'" type="success">日结</el-tag>
<el-tag v-else-if="scope.row.settlementType === 'weekly'" type="warning">周结</el-tag>
<el-tag v-else-if="scope.row.settlementType === 'monthly'" type="info">月结</el-tag>
<span v-else>{{ scope.row.settlementType }}</span>
</template>
</el-table-column>
<el-table-column label="医保类型" align="center" prop="insuranceType">
<template #default="scope">
<el-tag v-if="scope.row.insuranceType === 'urbanEmployee'" type="primary">城镇职工</el-tag>
<el-tag v-else-if="scope.row.insuranceType === 'urbanRuralResident'" type="success">城乡居民</el-tag>
<el-tag v-else-if="scope.row.insuranceType === 'newRuralCooperative'" type="warning">新农合</el-tag>
<el-tag v-else-if="scope.row.insuranceType === 'selfPaid'" type="info">自费</el-tag>
<span v-else>{{ scope.row.insuranceType }}</span>
</template>
</el-table-column>
<el-table-column label="总人次" align="center" prop="totalVisits" />
<el-table-column label="总金额" align="center" prop="totalAmount" />
<el-table-column label="医保统筹支付" align="center" prop="insurancePayAmount" />
<el-table-column label="个人账户支付" align="center" prop="accountPayAmount" />
<el-table-column label="个人自付" align="center" prop="personalPayAmount" />
<el-table-column label="基金支付总额" align="center" prop="fundPaySumAmount" />
<el-table-column label="状态" align="center" prop="status">
<template #default="scope">
<dict-tag :options="sys_normal_disable" :value="scope.row.status" />
</template>
</el-table-column>
<el-table-column label="操作员" align="center" prop="operator" />
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" />
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template #default="scope">
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template #default="scope">
<el-button link type="primary" icon="View" @click="handleView(scope.row)" v-hasPermi="['ybmanage:dayEndMedicalInsuranceSettlement:query']">查看</el-button>
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['ybmanage:dayEndMedicalInsuranceSettlement:edit']">修改</el-button>
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['ybmanage:dayEndMedicalInsuranceSettlement:remove']">删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize"
@size-change="getList"
@current-change="getList"
/>
<!-- 添加或修改日结医保结算对话框 -->
<el-dialog :title="title" v-model="open" width="700px" append-to-body>
<el-form ref="dayEndMedicalInsuranceSettlementRef" :model="form" :rules="rules" label-width="120px">
<el-row>
<el-col :span="12">
<el-form-item label="结算单号" prop="settlementNo">
<el-input v-model="form.settlementNo" placeholder="请输入结算单号" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="结算日期" prop="settlementDate">
<el-date-picker clearable
v-model="form.settlementDate"
type="date"
value-format="YYYY-MM-DD"
placeholder="请选择结算日期" style="width: 100%">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="结算类型" prop="settlementType">
<el-select v-model="form.settlementType" placeholder="请选择结算类型" style="width: 100%">
<el-option label="日结" value="daily" />
<el-option label="周结" value="weekly" />
<el-option label="月结" value="monthly" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="医保类型" prop="insuranceType">
<el-select v-model="form.insuranceType" placeholder="请选择医保类型" style="width: 100%">
<el-option label="城镇职工" value="urbanEmployee" />
<el-option label="城乡居民" value="urbanRuralResident" />
<el-option label="新农合" value="newRuralCooperative" />
<el-option label="自费" value="selfPaid" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="总人次" prop="totalVisits">
<el-input-number v-model="form.totalVisits" placeholder="请输入总人次" style="width: 100%" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="总金额" prop="totalAmount">
<el-input-number v-model="form.totalAmount" placeholder="请输入总金额" style="width: 100%" :precision="2" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="医保统筹支付" prop="insurancePayAmount">
<el-input-number v-model="form.insurancePayAmount" placeholder="请输入医保统筹支付金额" style="width: 100%" :precision="2" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="个人账户支付" prop="accountPayAmount">
<el-input-number v-model="form.accountPayAmount" placeholder="请输入个人账户支付金额" style="width: 100%" :precision="2" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="个人自付" prop="personalPayAmount">
<el-input-number v-model="form.personalPayAmount" placeholder="请输入个人自付金额" style="width: 100%" :precision="2" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="基金支付总额" prop="fundPaySumAmount">
<el-input-number v-model="form.fundPaySumAmount" placeholder="请输入基金支付总额" style="width: 100%" :precision="2" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="状态" prop="status">
<el-radio-group v-model="form.status">
<el-radio
v-for="dict in sys_normal_disable"
:key="dict.value"
:label="dict.value"
>{{ dict.label }}</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="操作员" prop="operator">
<el-input v-model="form.operator" placeholder="请输入操作员" />
</el-form-item>
</el-col>
</el-row>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup name="DayEndMedicalInsuranceSettlement">
import { listDayEndMedicalInsuranceSettlement, getDayEndMedicalInsuranceSettlement, delDayEndMedicalInsuranceSettlement, addDayEndMedicalInsuranceSettlement, updateDayEndMedicalInsuranceSettlement } from "@/api/ybmanagement/dayEndMedicalInsuranceSettlement";
const { proxy } = getCurrentInstance();
const loading = ref(true);
const showSearch = ref(true);
const ids = ref([]);
const single = ref(true);
const multiple = ref(true);
const total = ref(0);
const title = ref("");
const open = ref(false);
const queryTime = ref([]);
const dayEndMedicalInsuranceSettlementList = ref([]);
const queryFormRef = ref();
const dayEndMedicalInsuranceSettlementRef = ref();
const queryParams = ref({
pageNum: 1,
pageSize: 10,
settlementNo: null,
settlementDate: null,
settlementType: null,
insuranceType: null,
status: null
});
const form = ref({});
const rules = ref({
settlementNo: [
{ required: true, message: "结算单号不能为空", trigger: "blur" }
],
settlementDate: [
{ required: true, message: "结算日期不能为空", trigger: "blur" }
],
settlementType: [
{ required: true, message: "结算类型不能为空", trigger: "change" }
],
insuranceType: [
{ required: true, message: "医保类型不能为空", trigger: "change" }
],
totalAmount: [
{ required: true, message: "总金额不能为空", trigger: "blur" }
]
});
const { sys_normal_disable } = proxy.useDict("sys_normal_disable");
/** 查询日结医保结算列表 */
const getList = async () => {
loading.value = true;
try {
const response = await listDayEndMedicalInsuranceSettlement(queryParams.value);
dayEndMedicalInsuranceSettlementList.value = response.rows;
total.value = response.total;
} catch (error) {
console.error('获取日结医保结算列表失败:', error);
} finally {
loading.value = false;
}
};
/** 取消按钮 */
const cancel = () => {
open.value = false;
reset();
};
/** 表单重置 */
const reset = () => {
form.value = {
id: null,
settlementNo: null,
settlementDate: null,
settlementType: 'daily',
insuranceType: null,
totalVisits: null,
totalAmount: null,
insurancePayAmount: null,
accountPayAmount: null,
personalPayAmount: null,
fundPaySumAmount: null,
status: "0",
operator: null,
remark: null
};
proxy.resetForm("dayEndMedicalInsuranceSettlementRef");
};
/** 搜索按钮操作 */
const handleQuery = () => {
if (queryTime.value && queryTime.value.length === 2) {
queryParams.value.settlementDate = queryTime.value[0] + ',' + queryTime.value[1];
} else {
queryParams.value.settlementDate = null;
}
queryParams.value.pageNum = 1;
getList();
};
/** 重置按钮操作 */
const resetQuery = () => {
queryTime.value = [];
proxy.resetForm("queryRef");
handleQuery();
};
/** 多择框多选 */
const handleSelectionChange = (selection) => {
ids.value = selection.map(item => item.id);
single.value = selection.length !== 1;
multiple.value = !selection.length;
};
/** 新增按钮操作 */
const handleAdd = () => {
reset();
open.value = true;
title.value = "添加日结医保结算";
};
/** 修改按钮操作 */
const handleUpdate = (row) => {
reset();
const settlementId = row.id || ids.value[0];
getDayEndMedicalInsuranceSettlement(settlementId).then(response => {
form.value = response.data;
open.value = true;
title.value = "修改日结医保结算";
});
};
/** 提交按钮 */
const submitForm = () => {
proxy.$refs["dayEndMedicalInsuranceSettlementRef"].validate(valid => {
if (valid) {
if (form.value.id != null) {
updateDayEndMedicalInsuranceSettlement(form.value).then(response => {
proxy.$modal.msgSuccess("修改成功");
open.value = false;
getList();
});
} else {
addDayEndMedicalInsuranceSettlement(form.value).then(response => {
proxy.$modal.msgSuccess("新增成功");
open.value = false;
getList();
});
}
}
});
};
/** 删除按钮操作 */
const handleDelete = (row) => {
const settlementIds = row.id || ids.value;
proxy.$modal.confirm('是否确认删除日结医保结算编号为"' + settlementIds + '"的数据项?').then(function() {
return delDayEndMedicalInsuranceSettlement(settlementIds);
}).then(() => {
getList();
proxy.$modal.msgSuccess("删除成功");
}).catch(() => {});
};
/** 导出按钮操作 */
const handleExport = () => {
proxy.download("ybmanage/dayEndMedicalInsuranceSettlement/export", {
...queryParams.value
}, `dayEndMedicalInsuranceSettlement_${new Date().getTime()}.xlsx`);
};
/** 日结按钮操作 */
const handleSettle = () => {
// TODO: 实现日结功能
proxy.$modal.msgSuccess("日结功能待实现");
};
/** 查看按钮操作 */
const handleView = (row) => {
// TODO: 实现查看功能
proxy.$modal.msgSuccess("查看功能待实现");
};
/** 初始化数据 */
getList();
</script>