<template>
|
<div class="app-container">
|
<!-- 顶部面包屑导航 -->
|
<el-breadcrumb separator-class="el-icon-arrow-right" class="breadcrumb">
|
<el-breadcrumb-item :to="{ path: '/system/serviceGroup' }">服务组管理</el-breadcrumb-item>
|
<el-breadcrumb-item>服务组详情</el-breadcrumb-item>
|
</el-breadcrumb>
|
|
<!-- 顶部基础信息 -->
|
<el-card class="base-info-card" shadow="never">
|
<div slot="header" class="clearfix">
|
<span class="card-title">服务组基础信息</span>
|
<el-button
|
style="float: right; padding: 3px 0"
|
type="text"
|
icon="el-icon-edit"
|
@click="handleEdit"
|
>编辑</el-button
|
>
|
</div>
|
<el-row :gutter="20">
|
<el-col :span="8">
|
<div class="info-item">
|
<label>服务组名称:</label>
|
<span>{{ baseInfo.groupName }}</span>
|
</div>
|
</el-col>
|
<el-col :span="8">
|
<div class="info-item">
|
<label>服务组ID:</label>
|
<span>{{ baseInfo.groupId }}</span>
|
</div>
|
</el-col>
|
<el-col :span="8">
|
<div class="info-item">
|
<label>状态:</label>
|
<el-tag :type="baseInfo.status === 1 ? 'success' : 'info'">
|
{{ baseInfo.status === 1 ? '启用' : '停用' }}
|
</el-tag>
|
</div>
|
</el-col>
|
</el-row>
|
<el-row :gutter="20">
|
<el-col :span="24">
|
<div class="info-item">
|
<label>描述:</label>
|
<span>{{ baseInfo.groupDesc || '暂无描述' }}</span>
|
</div>
|
</el-col>
|
</el-row>
|
<el-row :gutter="20">
|
<el-col :span="8">
|
<div class="info-item">
|
<label>创建人:</label>
|
<span>{{ baseInfo.createBy }}</span>
|
</div>
|
</el-col>
|
<el-col :span="8">
|
<div class="info-item">
|
<label>创建时间:</label>
|
<span>{{ parseTime(baseInfo.createTime) }}</span>
|
</div>
|
</el-col>
|
<el-col :span="8">
|
<div class="info-item">
|
<label>更新时间:</label>
|
<span>{{ parseTime(baseInfo.updateTime) }}</span>
|
</div>
|
</el-col>
|
</el-row>
|
</el-card>
|
|
<!-- 中部关联任务 -->
|
<el-card class="task-card" shadow="never">
|
<div slot="header" class="clearfix">
|
<span class="card-title">关联任务</span>
|
<el-button
|
style="float: right; margin-left: 10px;"
|
type="primary"
|
icon="el-icon-plus"
|
size="mini"
|
@click="handleAddTask"
|
>关联任务</el-button
|
>
|
<el-button
|
style="float: right;"
|
type="text"
|
icon="el-icon-setting"
|
@click="handleManageTasks"
|
>管理</el-button
|
>
|
</div>
|
|
<el-table
|
v-loading="taskLoading"
|
:data="taskList"
|
style="width: 100%"
|
>
|
<el-table-column
|
label="任务名称"
|
prop="taskName"
|
min-width="200"
|
:show-overflow-tooltip="true"
|
/>
|
<el-table-column
|
label="任务类型"
|
prop="taskType"
|
width="120"
|
align="center"
|
>
|
<template slot-scope="scope">
|
<dict-tag :options="dict.type.task_type" :value="scope.row.taskType"/>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="任务状态"
|
prop="sendState"
|
width="100"
|
align="center"
|
>
|
<template slot-scope="scope">
|
<dict-tag :options="dict.type.task_status" :value="scope.row.sendState"/>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="总任务/已随访"
|
width="120"
|
align="center"
|
>
|
<template slot-scope="scope">
|
<span>{{ scope.row.totalCount }}/{{ scope.row.completedCount }}</span>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="创建时间"
|
prop="createTime"
|
width="180"
|
align="center"
|
>
|
<template slot-scope="scope">
|
<span>{{ parseTime(scope.row.createTime) }}</span>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="操作"
|
width="200"
|
align="center"
|
fixed="right"
|
>
|
<template slot-scope="scope">
|
<el-button
|
size="mini"
|
type="text"
|
@click="handleViewTask(scope.row)"
|
>查看</el-button
|
>
|
<el-button
|
size="mini"
|
type="text"
|
class="delete-btn"
|
@click="handleRemoveTask(scope.row)"
|
>移除</el-button
|
>
|
</template>
|
</el-table-column>
|
</el-table>
|
|
<div v-if="taskList.length === 0 && !taskLoading" class="empty-text">
|
暂无关联任务,请先关联任务
|
</div>
|
</el-card>
|
|
<!-- 底部关联患者 -->
|
<el-card class="patient-card" shadow="never">
|
<div slot="header" class="clearfix">
|
<span class="card-title">关联患者</span>
|
<el-button
|
style="float: right; margin-left: 10px;"
|
type="primary"
|
icon="el-icon-plus"
|
size="mini"
|
@click="handleAddPatient"
|
>关联患者</el-button
|
>
|
<el-button
|
style="float: right;"
|
type="text"
|
icon="el-icon-setting"
|
@click="handleManagePatients"
|
>管理</el-button
|
>
|
</div>
|
|
<el-table
|
v-loading="patientLoading"
|
:data="patientList"
|
style="width: 100%"
|
>
|
<el-table-column
|
label="患者姓名"
|
prop="patientName"
|
width="120"
|
align="center"
|
/>
|
<el-table-column
|
label="性别"
|
prop="gender"
|
width="80"
|
align="center"
|
>
|
<template slot-scope="scope">
|
<dict-tag :options="dict.type.sys_user_sex" :value="scope.row.gender"/>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="年龄"
|
prop="age"
|
width="80"
|
align="center"
|
/>
|
<el-table-column
|
label="手机号"
|
prop="phone"
|
width="130"
|
align="center"
|
/>
|
<el-table-column
|
label="病历号"
|
prop="medicalRecordNo"
|
width="120"
|
align="center"
|
/>
|
<el-table-column
|
label="诊断"
|
prop="diagnosis"
|
min-width="200"
|
:show-overflow-tooltip="true"
|
/>
|
<el-table-column
|
label="关联时间"
|
prop="relationTime"
|
width="180"
|
align="center"
|
>
|
<template slot-scope="scope">
|
<span>{{ parseTime(scope.row.relationTime) }}</span>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="操作"
|
width="150"
|
align="center"
|
fixed="right"
|
>
|
<template slot-scope="scope">
|
<el-button
|
size="mini"
|
type="text"
|
@click="handleViewPatient(scope.row)"
|
>详情</el-button
|
>
|
<el-button
|
size="mini"
|
type="text"
|
class="delete-btn"
|
@click="handleRemovePatient(scope.row)"
|
>移除</el-button
|
>
|
</template>
|
</el-table-column>
|
</el-table>
|
|
<div v-if="patientList.length === 0 && !patientLoading" class="empty-text">
|
暂无关联患者,请先关联患者
|
</div>
|
</el-card>
|
</div>
|
</template>
|
|
<script>
|
import { getServiceGroup, getGroupTasks, getGroupPatients } from "@/api/system/serviceGroup";
|
|
export default {
|
name: "ServiceGroupDetail",
|
dicts: ['sys_user_sex', 'task_status', 'task_type'],
|
data() {
|
return {
|
groupId: this.$route.params.groupId || 'SG2025001',
|
baseInfoLoading: false,
|
taskLoading: false,
|
patientLoading: false,
|
|
// 测试数据 - 基础信息
|
baseInfo: {
|
groupId: 'SG2025001',
|
groupName: '糖尿病随访管理服务组',
|
groupDesc: '专门负责糖尿病患者的定期随访、用药指导和健康管理服务,提高患者治疗依从性',
|
status: 1,
|
createBy: '张医生',
|
createTime: '2025-10-15 14:30:00',
|
updateTime: '2025-10-20 09:15:00'
|
},
|
|
// 测试数据 - 关联任务
|
taskList: [
|
{
|
taskId: 'T1001',
|
taskName: '糖尿病月度随访评估',
|
taskType: 1,
|
sendState: 2,
|
totalCount: 150,
|
completedCount: 120,
|
createTime: '2025-10-18 10:00:00'
|
},
|
{
|
taskId: 'T1002',
|
taskName: '血糖监测依从性问卷',
|
taskType: 2,
|
sendState: 1,
|
totalCount: 150,
|
completedCount: 85,
|
createTime: '2025-10-16 14:30:00'
|
},
|
{
|
taskId: 'T1003',
|
taskName: '并发症筛查提醒任务',
|
taskType: 3,
|
sendState: 3,
|
totalCount: 150,
|
completedCount: 45,
|
createTime: '2025-10-10 09:20:00'
|
}
|
],
|
|
// 测试数据 - 关联患者
|
patientList: [
|
{
|
patientId: 'P2025001',
|
patientName: '王小明',
|
gender: 1,
|
age: 45,
|
phone: '13800138000',
|
medicalRecordNo: 'MR2025001001',
|
diagnosis: '2型糖尿病,伴有周围神经并发症',
|
relationTime: '2025-10-16 09:00:00'
|
},
|
{
|
patientId: 'P2025002',
|
patientName: '李小红',
|
gender: 0,
|
age: 62,
|
phone: '13900139000',
|
medicalRecordNo: 'MR2025001002',
|
diagnosis: '1型糖尿病,胰岛素依赖型',
|
relationTime: '2025-10-17 14:30:00'
|
},
|
{
|
patientId: 'P2025003',
|
patientName: '赵建国',
|
gender: 1,
|
age: 58,
|
phone: '13600136000',
|
medicalRecordNo: 'MR2025001003',
|
diagnosis: '2型糖尿病,伴有糖尿病肾病',
|
relationTime: '2025-10-18 11:20:00'
|
}
|
]
|
};
|
},
|
created() {
|
this.groupId = this.$route.params.groupId;
|
this.getDetail();
|
this.getTaskList();
|
this.getPatientList();
|
},
|
methods: {
|
/** 获取服务组详情 */
|
getDetail() {
|
// this.baseInfoLoading = true;
|
// getServiceGroup(this.groupId).then(response => {
|
// this.baseInfo = response.data;
|
// this.baseInfoLoading = false;
|
// });
|
},
|
/** 获取关联任务列表 */
|
getTaskList() {
|
// this.taskLoading = true;
|
// getGroupTasks(this.groupId).then(response => {
|
// this.taskList = response.rows;
|
// this.taskLoading = false;
|
// });
|
},
|
/** 获取关联患者列表 */
|
getPatientList() {
|
// this.patientLoading = true;
|
// getGroupPatients(this.groupId).then(response => {
|
// this.patientList = response.rows;
|
// this.patientLoading = false;
|
// });
|
},
|
/** 编辑服务组 */
|
handleEdit() {
|
this.$router.push(`/system/serviceGroup/edit/${this.groupId}`);
|
},
|
/** 关联任务 */
|
handleAddTask() {
|
this.$router.push(`/system/serviceGroup/tasks/${this.groupId}?action=add`);
|
},
|
/** 管理任务 */
|
handleManageTasks() {
|
this.$router.push(`/system/serviceGroup/tasks/${this.groupId}`);
|
},
|
/** 查看任务详情 */
|
handleViewTask(task) {
|
// 根据任务类型跳转到不同的任务详情页
|
const routeMap = {
|
1: '/followvisit/particty',
|
2: '/followvisit/QuestionnaireTask',
|
3: '/followvisit/Missioncreation'
|
};
|
const route = routeMap[task.type] || '/followvisit/task';
|
this.$router.push(`${route}?id=${task.taskid}`);
|
},
|
/** 移除任务 */
|
handleRemoveTask(task) {
|
this.$modal.confirm(`是否确认移除任务"${task.taskName}"?`).then(() => {
|
// 调用移除任务API
|
removeTaskFromGroup(this.groupId, task.taskid).then(() => {
|
this.$modal.msgSuccess("移除成功");
|
this.getTaskList();
|
});
|
}).catch(() => {});
|
},
|
/** 关联患者 */
|
handleAddPatient() {
|
this.$router.push(`/system/serviceGroup/patients/${this.groupId}?action=add`);
|
},
|
/** 管理患者 */
|
handleManagePatients() {
|
this.$router.push(`/system/serviceGroup/patients/${this.groupId}`);
|
},
|
/** 查看患者详情 */
|
handleViewPatient(patient) {
|
this.$router.push(`/system/patient/detail/${patient.patientId}`);
|
},
|
/** 移除患者 */
|
handleRemovePatient(patient) {
|
this.$modal.confirm(`是否确认移除患者"${patient.patientName}"?`).then(() => {
|
// 调用移除患者API
|
removePatientFromGroup(this.groupId, patient.patientId).then(() => {
|
this.$modal.msgSuccess("移除成功");
|
this.getPatientList();
|
});
|
}).catch(() => {});
|
},
|
}
|
};
|
</script>
|
|
<style scoped>
|
.app-container {
|
padding: 20px;
|
}
|
|
.breadcrumb {
|
margin-bottom: 20px;
|
}
|
|
.base-info-card,
|
.task-card,
|
.patient-card {
|
margin-bottom: 20px;
|
}
|
|
.card-title {
|
font-size: 16px;
|
font-weight: bold;
|
color: #303133;
|
}
|
|
.info-item {
|
margin-bottom: 15px;
|
line-height: 1.5;
|
}
|
|
.info-item label {
|
display: inline-block;
|
width: 100px;
|
color: #606266;
|
font-weight: normal;
|
text-align: right;
|
margin-right: 10px;
|
}
|
|
.info-item span {
|
color: #303133;
|
}
|
|
.empty-text {
|
text-align: center;
|
color: #909399;
|
padding: 40px 0;
|
font-size: 14px;
|
}
|
|
.delete-btn {
|
color: #f56c6c;
|
}
|
|
.clearfix:before,
|
.clearfix:after {
|
display: table;
|
content: "";
|
}
|
.clearfix:after {
|
clear: both;
|
}
|
</style>
|