门诊医生排班->科室名称管理后端接口,前端基础页面

This commit is contained in:
qk123
2025-12-08 16:46:37 +08:00
parent 205c58782b
commit eaa681c9ff
12 changed files with 432 additions and 1 deletions

View File

@@ -0,0 +1,8 @@
package com.openhis.web.appointmentmanage.appservice;
import com.core.common.core.domain.R;
public interface IDeptAppService {
R<?> getDeptList();
R<?> searchDept(Integer pageNo, Integer pageSize, String orgName, String deptName);
}

View File

@@ -0,0 +1,39 @@
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.web.appointmentmanage.appservice.IDeptAppService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service
public class DeptAppServiceImpl implements IDeptAppService {
@Resource
private IDeptService deptService;
@Override
public R<?> getDeptList() {
List<Dept> list = deptService.list();
return R.ok(list);
}
@Override
public R<?> searchDept(Integer pageNo, Integer pageSize, String orgName, String deptName) {
LambdaQueryWrapper<Dept> wrapper = new LambdaQueryWrapper<>();
if (orgName != null && ObjectUtil.isNotEmpty(orgName)) {
wrapper.eq(Dept::getOrgName, orgName);
}
if (deptName != null && ObjectUtil.isNotEmpty(deptName)) {
wrapper.eq(Dept::getDeptName, deptName);
}
List<Dept> list = deptService.list(wrapper);
return R.ok(list);
}
}

View File

@@ -0,0 +1,41 @@
package com.openhis.web.appointmentmanage.controller;
import com.core.common.core.domain.R;
import com.openhis.web.appointmentmanage.appservice.IDeptAppService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
@RestController
@RequestMapping("/dept")
public class DeptController {
@Resource
private IDeptAppService deptAppService;
/*
* 获取科室列表
*
* */
@GetMapping("/list")
public R<?> getDeptList(){
return R.ok(deptAppService.getDeptList());
}
/*
* 查询科室
*
* */
@GetMapping("/search")
public R<?> searchDept(
@RequestParam(required = false) Integer pageNo,
@RequestParam(required = false) Integer pageSize,
@RequestParam(required = false)String orgName,
@RequestParam(required = false)String deptName
){
return R.ok(deptAppService.searchDept(pageNo,pageSize,orgName,deptName));
}
}

View File

@@ -0,0 +1,7 @@
package com.openhis.web.appointmentmanage.mapper;
import org.springframework.stereotype.Repository;
@Repository
public interface DeptAppMapper {
}

View File

@@ -0,0 +1,41 @@
package com.openhis.administration.domain;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.experimental.Accessors;
import java.time.LocalDateTime;
/**
* 科室Entity实体
*
* @date 2025-12-08
*/
@Data
@TableName(value = "adm_dept_info")
@Accessors(chain = true)
public class Dept {
/** id */
private Integer id;
/** 关联租户的租户名称 */
private String orgName;
/** 科室名称 */
private String deptName;
/** 启用状态 */
private Boolean status;
/** 预约取消限制 */
private Integer cancelLimit;
/** 备注 */
private String remark;
/** 创建时间 */
private LocalDateTime createTime;
/** 更新时间 */
private LocalDateTime updateTime;
}

View File

@@ -0,0 +1,9 @@
package com.openhis.administration.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.openhis.administration.domain.Dept;
import org.springframework.stereotype.Repository;
@Repository
public interface DeptMapper extends BaseMapper<Dept> {
}

View File

@@ -0,0 +1,7 @@
package com.openhis.administration.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.openhis.administration.domain.Dept;
public interface IDeptService extends IService<Dept> {
}

View File

@@ -0,0 +1,11 @@
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 {
}

View File

@@ -0,0 +1,27 @@
import request from '@/utils/request'
// 查询科室列表
export function listDept(query) {
return request({
url: '/dept/list',
method: 'get',
params: query
})
}
// 查询科室详细
export function getDept(deptId) {
return request({
url: '/dept/' + deptId,
method: 'get'
})
}
// 搜索科室列表
export function searchDept(query) {
return request({
url: '/dept/search',
method: 'get',
params: query
})
}

View File

@@ -26,6 +26,21 @@ import Layout from '@/layout'
// 公共路由 // 公共路由
export const constantRoutes = [ export const constantRoutes = [
{
path: '/appoinmentmanage',
component: Layout,
redirect: '/appoinmentmanage',
name: 'AppoinmentManage',
meta: { title: '预约管理', icon: 'component' },
children: [
{
path: '',
component: () => import('@/views/appoinmentmanage/index.vue'),
name: 'AppoinmentManageIndex',
meta: { title: '预约管理' }
}
]
},
{ {
path: '/redirect', path: '/redirect',
component: Layout, component: Layout,

View File

@@ -0,0 +1,222 @@
<template>
<div class="appoinmentmanage-container">
<div class="appoinmentmanage-header">
<h2 class="appoinmentmanage-title">预约管理</h2>
</div>
<div class="appoinmentmanage-content">
<!-- 查询条件 -->
<div class="query-condition">
<el-select v-model="queryParams.orgName" placeholder="全部机构" class="query-select">
<el-option label="全部机构" value=""></el-option>
<el-option label="演示医院" value="演示医院"></el-option>
</el-select>
<el-select v-model="queryParams.deptName" placeholder="全部科室" class="query-select">
<el-option label="全部科室" value=""></el-option>
<el-option label="口腔科" value="口腔科"></el-option>
<el-option label="妇产科" value="妇产科"></el-option>
<el-option label="测试内科" value="测试内科"></el-option>
<el-option label="高值耗材房" value="高值耗材房"></el-option>
<el-option label="其他内科" value="其他内科"></el-option>
</el-select>
<el-button type="primary" @click="handleQuery" class="query-button">查询</el-button>
<el-button @click="handleReset" class="reset-button">重置</el-button>
<el-button type="success" @click="handleAppointmentSetting" class="appointment-setting-button">预约设置</el-button>
</div>
<!-- 科室列表 -->
<div class="dept-table-container">
<el-table :data="deptList" border style="width: 100%" class="centered-table">
<el-table-column prop="id" label="ID" width="150"></el-table-column>
<el-table-column prop="orgName" label="卫生机构" width="350"></el-table-column>
<el-table-column prop="deptName" label="科室名称" width="350"></el-table-column>
<el-table-column prop="remark" label="备注" width="400"></el-table-column>
<el-table-column prop="status" label="作废标志">
<template #default="scope">
<el-tag :type="scope.row.status ? 'success' : 'danger'">
{{ scope.row.status ? '有效' : '无效' }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="操作" width="350" fixed="right">
<template #default="scope">
<el-button type="primary" size="small" @click="handleEdit(scope.row)">
<el-icon><EditPen /></el-icon>
</el-button>
<el-button type="info" size="small" @click="handleView(scope.row)">
<el-icon><View /></el-icon>
</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<div class="pagination-container">
<el-pagination
v-model:current-page="pagination.currentPage"
v-model:page-size="pagination.pageSize"
:page-sizes="[10, 20, 30, 50]"
layout="total, sizes, prev, pager, next, jumper"
:total="pagination.total"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</div>
</div>
</div>
</div>
</template>
<script setup name="AppoinmentManage">
import { ref, onMounted } from 'vue'
import { ElMessage } from 'element-plus'
import { EditPen, View } from '@element-plus/icons-vue'
import { listDept } from '@/api/appoinmentmanage/dept'
// 查询参数
const queryParams = ref({
orgName: '',
deptName: ''
})
// 科室列表
const deptList = ref([])
// 分页参数
const pagination = ref({
currentPage: 1,
pageSize: 10,
total: 0
})
// 获取科室列表
const getDeptList = async () => {
try {
const res = await listDept({
...queryParams.value,
pageNo: pagination.value.currentPage,
pageSize: pagination.value.pageSize
})
if (res.code === 200) {
// 修改数据赋值方式,适配后端返回的数据结构
deptList.value = res.data
pagination.value.total = res.data.length
} else {
ElMessage.error(res.msg || '获取科室列表失败')
}
} catch (error) {
console.error('获取科室列表失败:', error)
ElMessage.error('获取科室列表失败')
}
}
// 查询
const handleQuery = () => {
pagination.value.currentPage = 1
getDeptList()
}
// 重置
const handleReset = () => {
queryParams.value = {
orgName: '',
deptName: ''
}
pagination.value.currentPage = 1
getDeptList()
}
// 预约设置
const handleAppointmentSetting = () => {
ElMessage.info('预约设置功能待开发')
}
// 编辑
const handleEdit = (row) => {
ElMessage.info(`编辑科室: ${row.deptName}`)
}
// 查看
const handleView = (row) => {
ElMessage.info(`查看科室: ${row.deptName}`)
}
// 分页大小变化
const handleSizeChange = (size) => {
pagination.value.pageSize = size
getDeptList()
}
// 当前页码变化
const handleCurrentChange = (current) => {
pagination.value.currentPage = current
getDeptList()
}
// 页面加载时获取科室列表
onMounted(() => {
getDeptList()
})
</script>
<style scoped lang="scss">
.appoinmentmanage-container {
width: 100%;
height: 100%;
padding: 20px;
background-color: #f5f7fa;
}
.appoinmentmanage-header {
margin-bottom: 20px;
}
.appoinmentmanage-title {
font-size: 20px;
font-weight: 600;
color: #333;
margin: 0;
}
.appoinmentmanage-content {
background-color: #fff;
border-radius: 8px;
padding: 20px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.query-condition {
display: flex;
align-items: center;
margin-bottom: 20px;
gap: 16px;
}
.query-select {
width: 200px;
}
.query-button, .reset-button, .appointment-setting-button {
min-width: 100px;
}
.dept-table-container {
width: 100%;
}
.pagination-container {
margin-top: 20px;
display: flex;
justify-content: flex-end;
}
/* 表格居中样式 */
.centered-table {
:deep(.el-table__header-wrapper th.el-table__cell),
:deep(.el-table__body-wrapper td.el-table__cell) {
text-align: center;
}
}
</style>

View File

@@ -30,7 +30,7 @@
<span class="menu-icon">👥</span> <span class="menu-icon">👥</span>
<span>患者管理</span> <span>患者管理</span>
</div> </div>
<div class="menu-item"> <div class="menu-item" @click="navigateToAppoinmentManage">
<span class="menu-icon">💉</span> <span class="menu-icon">💉</span>
<span>预约管理</span> <span>预约管理</span>
</div> </div>
@@ -203,6 +203,10 @@ function awaitingMedicineBtn() {
router.push({ path: '/medicationmanagement/statisticalManagement/earlyWarning' }); router.push({ path: '/medicationmanagement/statisticalManagement/earlyWarning' });
} }
// 跳转到预约管理页面
function navigateToAppoinmentManage() {
router.push({ path: '/appoinmentmanage' });
}
function getExpirationWarningCount() { function getExpirationWarningCount() {
getExpirationWarning({ pageNo: 1, pageSize: 10 }).then((res) => { getExpirationWarning({ pageNo: 1, pageSize: 10 }).then((res) => {
total.value = res.data.total || 0; total.value = res.data.total || 0;