版本更新
This commit is contained in:
@@ -0,0 +1,148 @@
|
||||
<template>
|
||||
<div @keyup="handleKeyDown" tabindex="0" ref="tableWrapper">
|
||||
<el-table
|
||||
ref="adviceBaseRef"
|
||||
height="400"
|
||||
:data="adviceBaseList"
|
||||
highlight-current-row
|
||||
@current-change="handleCurrentChange"
|
||||
row-key="patientId"
|
||||
@cell-click="clickRow"
|
||||
>
|
||||
<el-table-column label="名称" align="center" prop="adviceName" />
|
||||
<el-table-column label="类型" align="center" prop="activityType_enumText" />
|
||||
<el-table-column label="包装单位" align="center" prop="unitCode_dictText" />
|
||||
<el-table-column label="最小单位" align="center" prop="minUnitCode_dictText" />
|
||||
<el-table-column label="规格" align="center" prop="volume" />
|
||||
<el-table-column label="用法" align="center" prop="methodCode_dictText" />
|
||||
<el-table-column label="频次" align="center" prop="rateCode_dictText" />
|
||||
<el-table-column label="单次剂量" align="center" prop="dose" />
|
||||
<el-table-column label="剂量单位" align="center" prop="doseUnitCode_dictText" />
|
||||
<el-table-column label="注射药品" align="center" prop="injectFlag_enumText" />
|
||||
<el-table-column label="皮试" align="center" prop="skinTestFlag_enumText" />
|
||||
</el-table>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { nextTick } from 'vue';
|
||||
import { getAdviceBaseInfo } from './api';
|
||||
import { throttle } from 'lodash-es';
|
||||
|
||||
const props = defineProps({
|
||||
adviceQueryParams: {
|
||||
type: Object,
|
||||
default: '',
|
||||
},
|
||||
patientInfo: {
|
||||
type: Object,
|
||||
required: true,
|
||||
},
|
||||
});
|
||||
const emit = defineEmits(['selectAdviceBase']);
|
||||
const total = ref(0);
|
||||
const adviceBaseRef = ref();
|
||||
const tableWrapper = ref();
|
||||
const currentIndex = ref(0); // 当前选中行索引
|
||||
const currentSelectRow = ref({});
|
||||
const queryParams = ref({
|
||||
pageSize: 100,
|
||||
pageNum: 1,
|
||||
});
|
||||
const adviceBaseList = ref([]);
|
||||
// 节流函数
|
||||
const throttledGetList = throttle(
|
||||
() => {
|
||||
getList();
|
||||
},
|
||||
300,
|
||||
{ leading: true, trailing: true }
|
||||
);
|
||||
watch(
|
||||
() => props.adviceQueryParams,
|
||||
(newValue) => {
|
||||
queryParams.value.searchKey = newValue.searchKey;
|
||||
queryParams.value.adviceType = newValue.adviceType;
|
||||
console.log(queryParams.value);
|
||||
throttledGetList();
|
||||
},
|
||||
{ deep: true }
|
||||
);
|
||||
|
||||
getList();
|
||||
function getList() {
|
||||
queryParams.value.organizationId = '1922545444781481985';
|
||||
getAdviceBaseInfo(queryParams.value).then((res) => {
|
||||
adviceBaseList.value = res.data.records;
|
||||
total.value = res.data.total;
|
||||
nextTick(() => {
|
||||
currentIndex.value = 0;
|
||||
if (adviceBaseList.value.length > 0) {
|
||||
adviceBaseRef.value.setCurrentRow(adviceBaseList.value[0]);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// 处理键盘事件
|
||||
const handleKeyDown = (event) => {
|
||||
const key = event.key;
|
||||
const data = adviceBaseList.value;
|
||||
|
||||
switch (key) {
|
||||
case 'ArrowUp': // 上箭头
|
||||
event.preventDefault(); // 阻止默认滚动行为
|
||||
if (currentIndex.value > 0) {
|
||||
currentIndex.value--;
|
||||
setCurrentRow(data[currentIndex.value]);
|
||||
}
|
||||
break;
|
||||
case 'ArrowDown': // 下箭头`
|
||||
event.preventDefault();
|
||||
if (currentIndex.value < data.length - 1) {
|
||||
currentIndex.value++;
|
||||
setCurrentRow(data[currentIndex.value]);
|
||||
}
|
||||
break;
|
||||
case 'Enter': // 回车键
|
||||
// const currentRow = adviceBaseRef.value.getSelectionRows();
|
||||
event.preventDefault();
|
||||
if (currentSelectRow.value) {
|
||||
// 这里可以触发自定义逻辑,如弹窗、跳转等
|
||||
emit('selectAdviceBase', currentSelectRow.value);
|
||||
}
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
// 设置选中行(带滚动)
|
||||
const setCurrentRow = (row) => {
|
||||
adviceBaseRef.value.setCurrentRow(row);
|
||||
// 滚动到选中行
|
||||
const tableBody = adviceBaseRef.value.$el.querySelector('.el-table__body-wrapper');
|
||||
const currentRowEl = adviceBaseRef.value.$el.querySelector('.current-row');
|
||||
if (tableBody && currentRowEl) {
|
||||
currentRowEl.scrollIntoView({ behavior: 'smooth', block: 'nearest' });
|
||||
}
|
||||
};
|
||||
|
||||
// 当前行变化时更新索引
|
||||
const handleCurrentChange = (currentRow) => {
|
||||
currentIndex.value = adviceBaseList.value.findIndex((item) => item === currentRow);
|
||||
currentSelectRow.value = currentRow;
|
||||
};
|
||||
|
||||
function clickRow(row) {
|
||||
emit('selectAdviceBase', row);
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
handleKeyDown,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.popover-table-wrapper:focus {
|
||||
outline: 2px solid #409eff; /* 聚焦时的高亮效果 */
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,69 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function getOrderGroup(queryParams) {
|
||||
return request({
|
||||
url: '/personalization/order-group/order-group',
|
||||
method: 'get',
|
||||
param: queryParams
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
export function saveOrderGroup(data) {
|
||||
return request({
|
||||
url: '/personalization/order-group/order-group',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function getAdviceBaseInfo(queryParams) {
|
||||
return request({
|
||||
url: '/doctor-station/advice/advice-base-info',
|
||||
method: 'get',
|
||||
params: queryParams
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取科室列表
|
||||
*/
|
||||
export function getOrgTree() {
|
||||
return request({
|
||||
url: '/base-data-manage/organization/organization',
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
/**
|
||||
* 添加组套获取科室列表
|
||||
*/
|
||||
export function getDepartmentList() {
|
||||
return request({
|
||||
url: '/app-common/department-list',
|
||||
method: 'get',
|
||||
|
||||
})
|
||||
}
|
||||
/**
|
||||
* 添加组套获取使用人列表
|
||||
*/
|
||||
export function getUserPractitionerPCage(params) {
|
||||
return request({
|
||||
url: '/base-data-manage/practitioner/user-practitioner-page',
|
||||
method: 'get',
|
||||
params:params
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除组套
|
||||
*/
|
||||
export function deleteOrderGroup(params) {
|
||||
return request({
|
||||
url: '/personalization/order-group/order-group',
|
||||
method: 'delete',
|
||||
params:params
|
||||
})
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,361 @@
|
||||
<template>
|
||||
<div class="main-content">
|
||||
<!-- 中间组套列表 -->
|
||||
<div class="section-card-left">
|
||||
<div class="section-header">
|
||||
<div class="actions">
|
||||
<span class="descriptions-item-label">组套名称:</span>
|
||||
<el-input
|
||||
v-model="queryParams.searchKey"
|
||||
placeholder="请输入组套名称"
|
||||
clearable
|
||||
class="search-input"
|
||||
@keydown.enter="getOrderGroupList"
|
||||
>
|
||||
<template #append>
|
||||
<el-button icon="Search" @click="getOrderGroupList" />
|
||||
</template>
|
||||
</el-input>
|
||||
<span class="descriptions-item-label">使用范围:</span>
|
||||
<el-select
|
||||
v-model="queryParams.rangeCode"
|
||||
placeholder="请选择使用范围"
|
||||
prefix-icon="el-icon-search"
|
||||
clearable
|
||||
@change="getOrderGroupList"
|
||||
class="search-input"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in use_range"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
<el-table
|
||||
:data="orderGroupList"
|
||||
highlight-current-row
|
||||
@current-change="handleTemplateSelect"
|
||||
style="width: 100%"
|
||||
v-loading="templateLoading"
|
||||
border
|
||||
>
|
||||
<el-table-column type="index" label="序号" width="60" align="center" />
|
||||
<el-table-column prop="name" label="组套名称" min-width="180" header-align="center" />
|
||||
<el-table-column prop="rangeCode_dictText" label="使用范围" width="100" align="center" />
|
||||
<el-table-column prop="createdAt" label="创建时间" width="160" align="center">
|
||||
<template #default="{ row }">
|
||||
<!-- {{ formatDate(row.createdAt) }} -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="100" fixed="right" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-button type="text" @click="editTemplate(row)">编辑</el-button>
|
||||
<el-button type="text" @click="deleteTemplate(row.id)" style="color: #f56c6c">
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<!-- 右侧组套详情 -->
|
||||
<div draggable="true" class="section-card-right">
|
||||
<div class="template-detail">
|
||||
<!-- 基本信息卡片 -->
|
||||
<div class="info-card">
|
||||
<div class="card-header">
|
||||
<span>基本信息</span>
|
||||
<el-button type="primary" @click="addTemplate">新建组套</el-button>
|
||||
<el-button type="primary" @click="addTemplate">保存组套</el-button>
|
||||
</div>
|
||||
<el-form :model="currentTemplate" label-width="100px" class="info-form" :inline="true">
|
||||
<el-form-item label="组套名称">
|
||||
<el-input v-model="currentTemplate.name" ref="name" placeholder="请输入组套名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="组套类型">
|
||||
<el-select
|
||||
v-model="currentTemplate.typeEnum"
|
||||
placeholder="请选择组套类型"
|
||||
class="search-input"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in typeEnum"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="使用范围">
|
||||
<el-select
|
||||
v-model="currentTemplate.rangeCode"
|
||||
placeholder="请选择使用范围"
|
||||
class="search-input"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in use_range"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<div class="info-card">
|
||||
<div class="card-header">
|
||||
<span>项目列表</span>
|
||||
</div>
|
||||
<div style="padding: 10px 10px">
|
||||
<Prescriptionlist :comtination="comtination" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import Prescriptionlist from './components/prescriptionlist.vue';
|
||||
import { getOrderGroup, deleteOrderGroup } from './components/api.js';
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
const { use_range } = proxy.useDict('use_range');
|
||||
|
||||
const currentTemplate = ref({});
|
||||
// 查询参数
|
||||
const queryParams = ref({});
|
||||
// 组套列表
|
||||
const orderGroupList = ref([]);
|
||||
const typeEnum = ref([
|
||||
{
|
||||
value: '1',
|
||||
label: '医嘱组套',
|
||||
},
|
||||
{
|
||||
value: '2',
|
||||
label: '诊疗组套',
|
||||
},
|
||||
]);
|
||||
const comtination = ref('');
|
||||
const templateLoading = ref(false);
|
||||
|
||||
getOrderGroupList();
|
||||
function getOrderGroupList() {
|
||||
getOrderGroup(queryParams.value).then((res) => {
|
||||
orderGroupList.value = res.data.records;
|
||||
});
|
||||
}
|
||||
|
||||
// 处理组套选择
|
||||
const handleTemplateSelect = (row) => {
|
||||
currentTemplate.value = row;
|
||||
comtination.value = row;
|
||||
};
|
||||
|
||||
// 添加组套
|
||||
const addTemplate = () => {
|
||||
currentTemplate.value = {};
|
||||
proxy.$refs.name.focus();
|
||||
};
|
||||
|
||||
// 编辑组套
|
||||
const editTemplate = () => {};
|
||||
|
||||
// 删除组套
|
||||
const deleteTemplate = (id) => {
|
||||
deleteOrderGroup({ id: id }).then((res) => {
|
||||
if (res.code == 200) {
|
||||
proxy.$modal.msgSuccess('删除成功');
|
||||
}
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.main-content {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
gap: 10px;
|
||||
padding: 30px;
|
||||
width: 100%;
|
||||
height: calc(100% - 80px);
|
||||
}
|
||||
|
||||
.section-card-left {
|
||||
background: white;
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
|
||||
width: 35%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
padding: 10px;
|
||||
border: 1px solid #ebeef5;
|
||||
}
|
||||
|
||||
.section-card-right {
|
||||
background: white;
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
|
||||
width: 64%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.section-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 15px 10px;
|
||||
background: #f8fafc;
|
||||
border-bottom: 1px solid #ebeef5;
|
||||
}
|
||||
|
||||
.search-area {
|
||||
padding: 10px 15px;
|
||||
border-bottom: 1px solid #ebeef5;
|
||||
background: #f8fafc;
|
||||
}
|
||||
|
||||
.search-input {
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
.template-detail {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 20px;
|
||||
overflow-y: auto;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.info-card {
|
||||
background: #ffffff;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
|
||||
border: 1px solid #ebeef5;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.card-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 12px 15px;
|
||||
background: #f8fafc;
|
||||
border-bottom: 1px solid #ebeef5;
|
||||
font-weight: 600;
|
||||
color: #555;
|
||||
}
|
||||
|
||||
.card-header i {
|
||||
margin-right: 10px;
|
||||
color: #409eff;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.card-header span {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.add-btn {
|
||||
padding: 5px 10px;
|
||||
}
|
||||
|
||||
.info-form {
|
||||
padding: 20px 15px 10px;
|
||||
}
|
||||
|
||||
.empty-state {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.custom-tree-node {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
font-size: 14px;
|
||||
padding: 5px 0;
|
||||
}
|
||||
|
||||
.custom-tree-node i {
|
||||
margin-right: 8px;
|
||||
color: #909399;
|
||||
}
|
||||
|
||||
.node-label {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.count-badge {
|
||||
background-color: #e6f7ff;
|
||||
color: #1890ff;
|
||||
border-radius: 10px;
|
||||
padding: 2px 8px;
|
||||
font-size: 14px;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.tree-actions {
|
||||
visibility: hidden;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.el-tree-node__content:hover .tree-actions {
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
:deep(.el-tree-node.is-current > .el-tree-node__content) {
|
||||
background-color: #ecf5ff;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
:deep(.el-tree-node__content) {
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
:deep(.el-table) {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
:deep(.el-table__header) {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
:deep(.el-table__row) {
|
||||
transition: background-color 0.3s;
|
||||
}
|
||||
|
||||
:deep(.el-table__row:hover) {
|
||||
background-color: #f5f7fa !important;
|
||||
}
|
||||
|
||||
.el-button--primary {
|
||||
background: linear-gradient(135deg, #409eff, #337ecc);
|
||||
border: none;
|
||||
}
|
||||
|
||||
.el-button--primary:hover {
|
||||
opacity: 0.9;
|
||||
}
|
||||
|
||||
.cost {
|
||||
font-weight: 600;
|
||||
color: #e53935;
|
||||
}
|
||||
|
||||
:deep(.el-tag) {
|
||||
border-radius: 12px;
|
||||
padding: 0 10px;
|
||||
}
|
||||
|
||||
:deep(.el-input__inner) {
|
||||
border-radius: 8px;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user