Compare commits
3 Commits
master
...
4da5ca427b
| Author | SHA1 | Date | |
|---|---|---|---|
| 4da5ca427b | |||
|
|
d2babdc9ed | ||
| 4d0599eac1 |
@@ -10,22 +10,14 @@
|
||||
<el-table
|
||||
ref="emrHistoryRef"
|
||||
:data="emrHistory"
|
||||
row-key="patientId"
|
||||
highlight-current-row
|
||||
row-key="id"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<!-- @cell-click="clickRow" -->
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column label="主诉" align="left" prop="name" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="时间" align="center" prop="createTime" width="180" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="操作" align="center" width="80">
|
||||
<template #default="scope">
|
||||
<!-- <el-button
|
||||
link
|
||||
type="primary"
|
||||
@click.stop="handelDetail(scope.row)"
|
||||
>详情
|
||||
</el-button> -->
|
||||
<el-button link type="primary" @click.stop="clickRow(scope.row)">复用</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -43,6 +35,7 @@
|
||||
<script setup>
|
||||
import { formatDate, formatDateymd } from '@/utils/index';
|
||||
import { getEmrHistoryList } from '../api';
|
||||
|
||||
const queryParams = ref({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
@@ -51,13 +44,19 @@ const queryParams = ref({
|
||||
const selectRow = ref({});
|
||||
const emrHistory = ref([]);
|
||||
const emits = defineEmits(['selectRow']);
|
||||
const emrHistoryRef = ref(null);
|
||||
const selectedRows = ref([]);
|
||||
|
||||
const total = ref(0);
|
||||
|
||||
getList();
|
||||
|
||||
function getList() {
|
||||
if (sessionStorage.getItem('patientId')) {
|
||||
queryParams.value.patientId = sessionStorage.getItem('patientId');
|
||||
getEmrHistoryList(queryParams.value).then((res) => {
|
||||
emrHistory.value = res.data.records;
|
||||
total.value = res.data.total;
|
||||
emrHistory.value.map((k) => {
|
||||
k.name = JSON.parse(k.contextJson).chiefComplaint;
|
||||
k.createTime = formatDate(k.createTime);
|
||||
@@ -66,6 +65,20 @@ function getList() {
|
||||
}
|
||||
}
|
||||
|
||||
function handleSelectionChange(selection) {
|
||||
selectedRows.value = selection;
|
||||
|
||||
// 如果选择的行数大于1,只保留最后一行
|
||||
if (selection.length > 1) {
|
||||
// 清除所有选择
|
||||
emrHistoryRef.value?.clearSelection();
|
||||
// 只选择最后一行
|
||||
const lastSelected = selection[selection.length - 1];
|
||||
emrHistoryRef.value?.toggleRowSelection(lastSelected, true);
|
||||
selectedRows.value = [lastSelected];
|
||||
}
|
||||
}
|
||||
|
||||
function clickRow(row) {
|
||||
selectRow.value = JSON.parse(row.contextJson);
|
||||
emits('selectRow', selectRow.value);
|
||||
|
||||
@@ -43,7 +43,7 @@ const props = defineProps({
|
||||
required: true,
|
||||
},
|
||||
});
|
||||
// getList();
|
||||
getList();
|
||||
function getList() {
|
||||
queryParams.value.useScopeCode = 1;
|
||||
getEmrTemplateList(queryParams.value).then((res) => {
|
||||
|
||||
@@ -69,7 +69,11 @@ import bindUser from "./bindUser";
|
||||
import { getTenantUserPage, unbindTenantUser } from "@/api/system/tenant";
|
||||
// 在 <script setup> 顶部添加导入
|
||||
import { ref, reactive, onMounted } from "vue"; // 补充 onMounted 导入
|
||||
import { useRoute, useRouter } from "vue-router"; // 添加 useRouter 导入
|
||||
|
||||
const route = useRoute();
|
||||
const router = useRouter(); // 创建 router 实例
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
const { sys_normal_disable } = proxy.useDict("sys_normal_disable");
|
||||
|
||||
@@ -100,8 +104,14 @@ function getList() {
|
||||
}
|
||||
// 返回按钮
|
||||
function handleClose() {
|
||||
/* const obj = { path: "/system/basicmanage/tenant" };
|
||||
proxy.$tab.closeOpenPage(obj); 目前先注释掉改成返回上一级页面*/
|
||||
// 先关闭当前标签页
|
||||
const obj={ path: "/system/basicmanage/tenant" };
|
||||
proxy.$tab.closeOpenPage(obj);
|
||||
proxy.$tab.closeOpenPage(route).then(() => {
|
||||
// 然后返回上一个页面
|
||||
router.go(-1);
|
||||
});
|
||||
}
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
|
||||
Reference in New Issue
Block a user