维护系统->检查方法、部位前端需求优化。
This commit is contained in:
@@ -5,6 +5,7 @@ import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 科室Entity实体
|
||||
@@ -38,4 +39,7 @@ public class Dept {
|
||||
|
||||
/** 更新时间 */
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/** 关联的排班列表(一对多关系) */
|
||||
private List<DoctorSchedule> schedules;
|
||||
}
|
||||
|
||||
@@ -26,21 +26,7 @@ import Layout from '@/layout'
|
||||
|
||||
// 公共路由
|
||||
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: '/appoinmentmanage', component: Layout, redirect: '/appoinmentmanage', name: 'AppoinmentManage', hidden: true, meta: { title: '预约管理', icon: 'component' }, children: [ { path: '', component: () => import('@/views/appoinmentmanage/index.vue'), name: 'AppoinmentManageIndex', meta: { title: '预约管理' } } ] },
|
||||
{
|
||||
path: '/redirect',
|
||||
component: Layout,
|
||||
|
||||
@@ -107,16 +107,16 @@
|
||||
<select v-model="item.type" :class="{ 'placeholder-text': !item.type }">
|
||||
<option value="">选择检查类型</option>
|
||||
<option
|
||||
v-for="type in checkTypes"
|
||||
:key="type"
|
||||
:value="type"
|
||||
v-for="dict in inspectionTypeDicts"
|
||||
:key="dict.dictValue"
|
||||
:value="dict.dictValue"
|
||||
>
|
||||
{{ type }}
|
||||
{{ dict.dictLabel }}
|
||||
</option>
|
||||
</select>
|
||||
</template>
|
||||
<template v-else>
|
||||
<span v-if="item.type">{{ item.type }}</span>
|
||||
<span v-if="item.type">{{ getInspectionTypeLabel(item.type) }}</span>
|
||||
<span v-else class="placeholder-text">选择检查类型</span>
|
||||
</template>
|
||||
</td>
|
||||
@@ -205,10 +205,10 @@
|
||||
<label>检查类型</label>
|
||||
<el-select v-model="searchParamsMethod.checkType" placeholder="选择检查类型" style="width: 150px">
|
||||
<el-option
|
||||
v-for="type in checkTypes"
|
||||
:key="type"
|
||||
:label="type"
|
||||
:value="type"
|
||||
v-for="dict in inspectionTypeDicts"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="dict.dictValue"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
@@ -279,10 +279,19 @@
|
||||
</td>
|
||||
<td>
|
||||
<template v-if="item.editing">
|
||||
<input type="text" placeholder="请输入检查类型" v-model="item.checkType">
|
||||
<select v-model="item.checkType">
|
||||
<option value="">选择检查类型</option>
|
||||
<option
|
||||
v-for="dict in inspectionTypeDicts"
|
||||
:key="dict.dictValue"
|
||||
:value="dict.dictValue"
|
||||
>
|
||||
{{ dict.dictLabel }}
|
||||
</option>
|
||||
</select>
|
||||
</template>
|
||||
<template v-else>
|
||||
{{ item.checkType || '无' }}
|
||||
{{ getInspectionTypeLabel(item.checkType) || '无' }}
|
||||
</template>
|
||||
</td>
|
||||
|
||||
@@ -344,14 +353,14 @@
|
||||
<div class="search-item">
|
||||
<label>检查类型</label>
|
||||
<el-select v-model="searchParamsPart.checkType" placeholder="选择检查类型" style="width: 150px">
|
||||
<el-option
|
||||
v-for="type in checkTypes"
|
||||
:key="type"
|
||||
:label="type"
|
||||
:value="type"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-option
|
||||
v-for="dict in inspectionTypeDicts"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="dict.dictValue"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<div class="search-item">
|
||||
<label>名称</label>
|
||||
@@ -414,10 +423,19 @@
|
||||
</td>
|
||||
<td>
|
||||
<template v-if="item.editing">
|
||||
<input type="text" placeholder="请输入检查类型" v-model="item.checkType">
|
||||
<select v-model="item.checkType">
|
||||
<option value="">选择检查类型</option>
|
||||
<option
|
||||
v-for="dict in inspectionTypeDicts"
|
||||
:key="dict.dictValue"
|
||||
:value="dict.dictValue"
|
||||
>
|
||||
{{ dict.dictLabel }}
|
||||
</option>
|
||||
</select>
|
||||
</template>
|
||||
<template v-else>
|
||||
{{ item.checkType || '无' }}
|
||||
{{ getInspectionTypeLabel(item.checkType) || '无' }}
|
||||
</template>
|
||||
</td>
|
||||
<td>
|
||||
@@ -454,10 +472,19 @@
|
||||
</td>
|
||||
<td>
|
||||
<template v-if="item.editing">
|
||||
<input type="text" placeholder="请输入服务范围" v-model="item.serviceScope">
|
||||
<select v-model="item.serviceScope">
|
||||
<option value="">选择服务范围</option>
|
||||
<option
|
||||
v-for="dict in serviceScopeDicts"
|
||||
:key="dict.dictValue"
|
||||
:value="dict.dictValue"
|
||||
>
|
||||
{{ dict.dictLabel }}
|
||||
</option>
|
||||
</select>
|
||||
</template>
|
||||
<template v-else>
|
||||
{{ item.serviceScope || '' }}
|
||||
{{ getServiceScopeLabel(item.serviceScope) || '' }}
|
||||
</template>
|
||||
</td>
|
||||
<td>
|
||||
@@ -523,7 +550,23 @@ const currentPackageData = ref(null)
|
||||
|
||||
// 检查类型和科室选项
|
||||
const checkTypes = ref([]);
|
||||
const checkMethods = ref([]);
|
||||
// 完整的检查类型字典数据
|
||||
const inspectionTypeDicts = ref([]);
|
||||
// 完整的服务范围字典数据
|
||||
const serviceScopeDicts = ref([]);
|
||||
const checkMethods = ref([]);
|
||||
|
||||
// 根据字典值获取检查类型标签
|
||||
const getInspectionTypeLabel = (value) => {
|
||||
const dictItem = inspectionTypeDicts.value.find(item => item.dictValue === value);
|
||||
return dictItem ? dictItem.dictLabel : value;
|
||||
};
|
||||
|
||||
// 根据字典值获取服务范围标签
|
||||
const getServiceScopeLabel = (value) => {
|
||||
const dictItem = serviceScopeDicts.value.find(item => item.dictValue === value);
|
||||
return dictItem ? dictItem.dictLabel : value;
|
||||
};
|
||||
const checkParts = ref([]);
|
||||
const checkPackages = ref([]);
|
||||
const departments = ref([]);
|
||||
@@ -592,17 +635,33 @@ onMounted(async () => {
|
||||
departments.value = deptResponse.data;
|
||||
}
|
||||
|
||||
// 获取检查类型数据
|
||||
const typeResponse = await listCheckType();
|
||||
// 获取检查类型数据(从数据字典获取)
|
||||
const typeResponse = await getDicts('inspection_type');
|
||||
if (typeResponse && typeResponse.data) {
|
||||
// 将数据库返回的检查类型数据转换为表格所需格式
|
||||
const types = typeResponse.data;
|
||||
// 获取所有不重复的检查类型值
|
||||
checkTypes.value = [...new Set(types.map(item => item.type))];
|
||||
|
||||
// 保存完整的字典数据
|
||||
inspectionTypeDicts.value = typeResponse.data;
|
||||
// 从数据字典获取检查类型值
|
||||
checkTypes.value = typeResponse.data.map(item => item.dictValue);
|
||||
} else {
|
||||
checkTypes.value = [];
|
||||
inspectionTypeDicts.value = [];
|
||||
}
|
||||
|
||||
// 获取服务范围数据(从数据字典获取)
|
||||
const scopeResponse = await getDicts('scope_of_services');
|
||||
if (scopeResponse && scopeResponse.data) {
|
||||
// 保存完整的服务范围字典数据
|
||||
serviceScopeDicts.value = scopeResponse.data;
|
||||
} else {
|
||||
serviceScopeDicts.value = [];
|
||||
}
|
||||
|
||||
// 获取检查类型表格数据(仍然从API获取)
|
||||
const typeTableResponse = await listCheckType();
|
||||
if (typeTableResponse && typeTableResponse.data) {
|
||||
// 构建检查类型表格数据
|
||||
checkTypeData.splice(0, checkTypeData.length);
|
||||
types.forEach((item, index) => {
|
||||
typeTableResponse.data.forEach((item, index) => {
|
||||
checkTypeData.push({
|
||||
id: item.id, // 保存id字段,用于判断是新增还是修改
|
||||
row: (index + 1).toString(),
|
||||
@@ -859,13 +918,13 @@ async function loadMenuData(menu) {
|
||||
|
||||
// 处理编辑按钮点击
|
||||
function handleEdit(index) {
|
||||
const item = tableData[index];
|
||||
const item = tableData.value[index];
|
||||
item.editing = true;
|
||||
}
|
||||
|
||||
// 处理确认按钮点击
|
||||
async function handleConfirm(index) {
|
||||
const item = tableData[index];
|
||||
const item = tableData.value[index];
|
||||
try {
|
||||
// 根据当前激活的菜单调用不同的API
|
||||
if (activeMenu.value === '检查方法') {
|
||||
@@ -972,7 +1031,7 @@ async function handleConfirm(index) {
|
||||
}
|
||||
}
|
||||
// 退出编辑状态
|
||||
tableData[index].editing = false;
|
||||
tableData.value[index].editing = false;
|
||||
// 显示保存成功提示
|
||||
ElMessage.success(`第 ${item.row} 行数据已保存`);
|
||||
} catch (error) {
|
||||
@@ -989,7 +1048,7 @@ async function handleDelete(index) {
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(async () => {
|
||||
const item = tableData[index];
|
||||
const item = tableData.value[index];
|
||||
try {
|
||||
// 如果有id,调用API删除数据库中的数据
|
||||
if (item.id) {
|
||||
@@ -1002,7 +1061,7 @@ async function handleDelete(index) {
|
||||
}
|
||||
}
|
||||
// 从数组中删除该行数据
|
||||
tableData.splice(index, 1);
|
||||
tableData.value.splice(index, 1);
|
||||
ElMessage.success('删除成功!');
|
||||
} catch (error) {
|
||||
ElMessage.error('删除失败,请稍后重试');
|
||||
@@ -1017,7 +1076,7 @@ function handleAddNewRow() {
|
||||
// 获取当前最大行号,为新建行生成行号
|
||||
const maxRowNum = Math.max(
|
||||
0,
|
||||
...tableData.map(item => {
|
||||
...tableData.value.map(item => {
|
||||
// 处理子行编号,如"1.1"只取主行号"1"
|
||||
const rowParts = item.row.split('.');
|
||||
return parseInt(rowParts[0]) || 0;
|
||||
@@ -1089,12 +1148,12 @@ function handleAddNewRow() {
|
||||
};
|
||||
}
|
||||
|
||||
tableData.push(newRow);
|
||||
tableData.value.push(newRow);
|
||||
}
|
||||
|
||||
// 处理添加按钮点击
|
||||
function handleAdd(index) {
|
||||
const parentRow = tableData[index];
|
||||
const parentRow = tableData.value[index];
|
||||
|
||||
// 创建子行数据,继承父行的编码
|
||||
const childRow = {
|
||||
@@ -1111,7 +1170,7 @@ function handleAdd(index) {
|
||||
};
|
||||
|
||||
// 在父行后插入子行
|
||||
tableData.splice(index + 1, 0, childRow);
|
||||
tableData.value.splice(index + 1, 0, childRow);
|
||||
}
|
||||
|
||||
// 处理搜索功能
|
||||
|
||||
Reference in New Issue
Block a user