Compare commits
2 Commits
1e75be2bbe
...
b907c83aba
| Author | SHA1 | Date | |
|---|---|---|---|
| b907c83aba | |||
| 9a5039e74e |
@ -9,6 +9,14 @@ export function queryLabPatList(query?: Object) {
|
|||||||
params: query
|
params: query
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 查询微生物数据列表
|
||||||
|
export function wswsampleList(query?: Object) {
|
||||||
|
return request({
|
||||||
|
url: '/lisworkgerm/wswsamplelist',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// 查询数据
|
// 查询数据
|
||||||
export function queryLabPat(query?: Object) {
|
export function queryLabPat(query?: Object) {
|
||||||
|
|||||||
@ -114,7 +114,7 @@ setTimeout(() => {
|
|||||||
|
|
||||||
.scroll-btn {
|
.scroll-btn {
|
||||||
width: 1.875rem;
|
width: 1.875rem;
|
||||||
height: 3rem;
|
height: 2.9375rem;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
@ -173,8 +173,8 @@ setTimeout(() => {
|
|||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
color: #1F6DD3;
|
color: #1F6DD3;
|
||||||
width: 5.625rem;
|
width: 5.625rem;
|
||||||
height: 3rem;
|
height: 2.9375rem;
|
||||||
line-height: 3rem;
|
line-height: 2.9375rem;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|||||||
@ -13,13 +13,16 @@
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="common-table-container">
|
<div class="common-table-container">
|
||||||
<vxe-table :data="tableData" :loading="loading" border height="auto" class="common-table" :row-config="rowConfig"
|
<vxe-table :data="tableData" :loading="loading" border height="auto" :checkbox-config="config.checkboxConfig"
|
||||||
:show-overflow="showOverflow" @current-change="handleRowClick" ref="tableRef" :size="size"
|
@checkbox-change="handleCheckboxChange" :row-config="rowConfig" :show-overflow="showOverflow"
|
||||||
:current-row="currentRow" :highlight-current-row="highlightCurrentRow" :scroll-y="scrollYConfig"
|
@current-change="handleRowClick" ref="tableRef" :size="size" :current-row="currentRow"
|
||||||
|
:highlight-current-row="highlightCurrentRow" :scroll-y="scrollYConfig"
|
||||||
:header-cell-class-name="enableColumnDrag ? 'el-table-header-cell' : ''" v-bind="$attrs">
|
:header-cell-class-name="enableColumnDrag ? 'el-table-header-cell' : ''" v-bind="$attrs">
|
||||||
<!-- 动态渲染列 -->
|
<!-- 动态渲染列 -->
|
||||||
<template v-for="(column, i) in columns" :key="`${column.field}-${i}`">
|
<template v-for="(column, i) in columns" :key="`${column.field}-${i}`">
|
||||||
<vxe-column v-bind="column">
|
<vxe-column type="checkbox" width="40" align="center" v-if="column.type == 'selection'" />
|
||||||
|
<vxe-column type="seq" width="40" :title="column.title || '序号'" align="center" v-if="column.type == 'seq'" />
|
||||||
|
<vxe-column v-bind="column" v-if="column.field">
|
||||||
<!-- 自定义列模板 -->
|
<!-- 自定义列模板 -->
|
||||||
<template v-if="column.slotName" #default="scope">
|
<template v-if="column.slotName" #default="scope">
|
||||||
<slot :name="column.slotName" :row="scope.row"></slot>
|
<slot :name="column.slotName" :row="scope.row"></slot>
|
||||||
@ -66,6 +69,11 @@ const props = defineProps({
|
|||||||
type: Object,
|
type: Object,
|
||||||
default: () => ({ isHover: true, height: 30 })
|
default: () => ({ isHover: true, height: 30 })
|
||||||
},
|
},
|
||||||
|
// 表格配置
|
||||||
|
config: {
|
||||||
|
type: Object,
|
||||||
|
default: () => ({}),
|
||||||
|
},
|
||||||
// 是否显示内容溢出省略
|
// 是否显示内容溢出省略
|
||||||
showOverflow: {
|
showOverflow: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
@ -94,7 +102,7 @@ const props = defineProps({
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
const emits = defineEmits(['current-change', "column-drag-end",])
|
const emits = defineEmits(['current-change', "column-drag-end", "selection-change"])
|
||||||
|
|
||||||
const tableRef = ref<any>(null)
|
const tableRef = ref<any>(null)
|
||||||
const currentRow = ref<any>(null)
|
const currentRow = ref<any>(null)
|
||||||
@ -104,6 +112,23 @@ const handleRowClick = (params: { row: any }) => {
|
|||||||
emits('current-change', params.row)
|
emits('current-change', params.row)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const handleCheckboxChange = ({ checked, records }: { checked: boolean, records: any[] }) => {
|
||||||
|
// console.log('选中的数据:', records);
|
||||||
|
// console.log('是否全选:', checked);
|
||||||
|
emits('selection-change', records)
|
||||||
|
};
|
||||||
|
|
||||||
|
// 处理行选择
|
||||||
|
const toggleRowSelection = (row: any, checked: boolean) => {
|
||||||
|
if (tableRef.value) {
|
||||||
|
tableRef.value.setCheckboxRow(row, checked)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 获取所有选中行数据
|
||||||
|
const allSelection = () => {
|
||||||
|
return tableRef.value.getCheckboxRecords()
|
||||||
|
}
|
||||||
|
|
||||||
// 设置当前行
|
// 设置当前行
|
||||||
const setCurrentRow = (row: any) => {
|
const setCurrentRow = (row: any) => {
|
||||||
if (tableRef.value) {
|
if (tableRef.value) {
|
||||||
@ -180,6 +205,8 @@ const initColumnDrag = () => {
|
|||||||
defineExpose({
|
defineExpose({
|
||||||
setCurrentRow,
|
setCurrentRow,
|
||||||
clearCurrentRow,
|
clearCurrentRow,
|
||||||
|
toggleRowSelection,
|
||||||
|
allSelection,
|
||||||
tableRef,
|
tableRef,
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -26,7 +26,8 @@ const useUserStore = defineStore(
|
|||||||
loginAnonymous(data) {
|
loginAnonymous(data) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
loginAnonymous({
|
loginAnonymous({
|
||||||
username: data.name
|
username: data.name,
|
||||||
|
yljg: data.yljg
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
setToken(res.token)
|
setToken(res.token)
|
||||||
|
|||||||
@ -25,7 +25,7 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="" prop="queryValue">
|
<el-form-item label="" prop="queryValue">
|
||||||
<el-input v-model="queryParams.queryValue" clearable placeholder="条件搜索" />
|
<el-input v-model="queryParams.queryValue" clearable placeholder="条件搜索" @keyup.enter="handleQuery" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="">
|
<el-form-item label="">
|
||||||
@ -71,8 +71,10 @@
|
|||||||
:columns="columns"></right-toolbar> -->
|
:columns="columns"></right-toolbar> -->
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<CustomTable ref="tableRef" :data="tableData" :columns="columns" :config="tableConfig" :loading="loading"
|
<VxeTable :table-data="tableData" :loading="loading" :columns="columns"
|
||||||
@row-click="rowHandle" @selection-change="selectionChange" :enable-column-drag="true"
|
:row-config="{ isHover: true, keyField: 'ybh' }" @current-change="rowHandle" size="small"
|
||||||
|
:row-style="rowClassNameHd" :cell-style="cellStyleHd" class="mytable-style" ref="tableRef"
|
||||||
|
@selection-change="selectionChange" :config="tableConfig" :enable-column-drag="true"
|
||||||
@column-drag-end="handleColumnDragEnd">
|
@column-drag-end="handleColumnDragEnd">
|
||||||
<template #dy="{ row }">
|
<template #dy="{ row }">
|
||||||
<svg-icon v-if="row.zt != 1" icon-class="lvgou" />
|
<svg-icon v-if="row.zt != 1" icon-class="lvgou" />
|
||||||
@ -92,7 +94,7 @@
|
|||||||
<template #yljg="{ row }">
|
<template #yljg="{ row }">
|
||||||
{{ formatDict(row.yljg, 'HOS') }}
|
{{ formatDict(row.yljg, 'HOS') }}
|
||||||
</template>
|
</template>
|
||||||
</CustomTable>
|
</VxeTable>
|
||||||
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8" class="right-table">
|
<el-col :span="8" class="right-table">
|
||||||
@ -159,6 +161,7 @@ import { ref, reactive, toRaw, computed, watch, nextTick, onMounted, } from 'vue
|
|||||||
import { HiprintPrinter } from '@/utils/hiprintPrinter';
|
import { HiprintPrinter } from '@/utils/hiprintPrinter';
|
||||||
import { classCom } from '@/utils/classCom';
|
import { classCom } from '@/utils/classCom';
|
||||||
import CustomTable from '@/components/elTable/index.vue'
|
import CustomTable from '@/components/elTable/index.vue'
|
||||||
|
import VxeTable from '@/components/vxeTable/index.vue'
|
||||||
import { useRouter, useRoute } from 'vue-router'
|
import { useRouter, useRoute } from 'vue-router'
|
||||||
import { usePrintStore } from '@/store/modules/printStore'
|
import { usePrintStore } from '@/store/modules/printStore'
|
||||||
import { fetchCodeList, addObj, fetchCodeDetail, fetchCodeExec, fetchCodeReqmain } from '@/api/checkCode/index'
|
import { fetchCodeList, addObj, fetchCodeDetail, fetchCodeExec, fetchCodeReqmain } from '@/api/checkCode/index'
|
||||||
@ -199,23 +202,6 @@ const queryParams = reactive<QueryParams>({
|
|||||||
ksdh: '',
|
ksdh: '',
|
||||||
userid: ''
|
userid: ''
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
// 获取当前日期(当天)
|
|
||||||
const today = dayjs();
|
|
||||||
|
|
||||||
// 计算前6天的日期(当天 + 前6天 = 7天)
|
|
||||||
const startOfWeek = today.subtract(6, 'day');
|
|
||||||
|
|
||||||
const startDate = route.query.startdate ? String(route.query.startdate) : startOfWeek.format('YYYY-MM-DD HH:mm:ss');
|
|
||||||
const endDate = route.query.endate ? String(route.query.endate) : today.format('YYYY-MM-DD HH:mm:ss');
|
|
||||||
|
|
||||||
queryParams.times = [startDate, endDate];
|
|
||||||
queryParams.ksdh = (route.query.deptcode as string) ? (route.query.deptcode as string) : '';
|
|
||||||
queryParams.userid = (route.query.userid as string) ? (route.query.userid as string) : '';
|
|
||||||
queryParams.yljg = (route.query.yljg as string) ? (route.query.yljg as string) : '';
|
|
||||||
|
|
||||||
|
|
||||||
const showSearch = ref(true);
|
const showSearch = ref(true);
|
||||||
const queryRef = ref()
|
const queryRef = ref()
|
||||||
// 定义校验规则
|
// 定义校验规则
|
||||||
@ -270,28 +256,27 @@ const loading = ref(false);
|
|||||||
const tableData = ref([])
|
const tableData = ref([])
|
||||||
// 配置项
|
// 配置项
|
||||||
const columns = ref([
|
const columns = ref([
|
||||||
{ type: 'selection', visible: true, align: 'center', width: 35, label: '多选框' },
|
{ type: 'selection', field: '', title: '', resizable: true, align: 'center', width: 40 },
|
||||||
// { type: 'index', visible: true, align: 'center', width: 60, label: '序号' },
|
{ field: 'zt', title: '打印', resizable: true, align: 'center', slotName: 'dy', width: 40 },
|
||||||
{ prop: 'zt', label: '打印', visible: true, align: 'center', slot: 'dy', width: 40 },
|
{ field: 'jzbz', title: '急', align: 'center', resizable: true, slotName: 'jzbz', width: 30 },
|
||||||
{ prop: 'jzbz', label: '急', align: 'center', visible: true, slot: 'jzbz', width: 30 },
|
{ field: 'ch', title: '床号', resizable: true, align: 'center', width: 40 },//sortable: true,
|
||||||
{ prop: 'ch', label: '床号', visible: true, align: 'center', width: 40 },//sortable: true,
|
{ field: 'brxm', title: '姓名', align: 'center', resizable: true, width: 50 },
|
||||||
{ prop: 'brxm', label: '姓名', align: 'center', visible: true, width: 50 },
|
{ field: 'brxbname', title: '性别', align: 'center', resizable: true, width: 30 },
|
||||||
{ prop: 'brxbname', label: '性别', align: 'center', visible: true, width: 30 },
|
{ field: 'jymd', title: '项目名称', resizable: true, width: 130 },
|
||||||
{ prop: 'jymd', label: '项目名称', visible: true, width: 130 },
|
{ field: 'bgddhname', title: '类别', align: 'center', resizable: true, width: 80 },
|
||||||
{ prop: 'bgddhname', label: '类别', align: 'center', visible: true, width: 80 },
|
{ field: 'sampletips', title: '采样提示', align: 'center', resizable: true, width: 60 },
|
||||||
{ prop: 'sampletips', label: '采样提示', align: 'center', visible: true, width: 60 },
|
{ field: 'yblx', title: '样本类型', align: 'center', resizable: true, width: 60 },
|
||||||
{ prop: 'yblx', label: '样本类型', align: 'center', visible: true, width: 60 },
|
{ field: 'brdh', title: '病人号', align: 'center', resizable: true, width: 90 },
|
||||||
{ prop: 'brdh', label: '病人号', align: 'center', visible: true, width: 90 },
|
{ field: 'ksname', title: '科室名称', align: 'center', resizable: true, width: 100 },
|
||||||
{ prop: 'ksname', label: '科室名称', align: 'center', visible: true, width: 100 },
|
{ field: 'sqh', title: '申请号/条码', align: 'center', resizable: true, width: 100 },
|
||||||
{ prop: 'sqh', label: '申请号/条码', align: 'center', visible: true, width: 100 },
|
{ field: 'zt', title: '状态', align: 'center', resizable: true, slotName: 'zt', width: 40 },
|
||||||
{ prop: 'zt', label: '状态', align: 'center', visible: true, slot: 'zt', width: 40 },
|
{ field: 'brly', title: '病人来源', align: 'center', resizable: true, slotName: 'brly', width: 60 },
|
||||||
{ prop: 'brly', label: '病人来源', align: 'center', visible: true, slot: 'brly', width: 60 },
|
{ field: 'sqysname', title: '申请医生', align: 'center', resizable: true, width: 60 },
|
||||||
{ prop: 'sqysname', label: '申请医生', align: 'center', visible: true, width: 60 },
|
{ field: 'sqsj', title: '申请时间', align: 'center', resizable: true, width: 150 },
|
||||||
{ prop: 'sqsj', label: '申请时间', align: 'center', visible: true, width: 150 },
|
{ field: 'jjzt', title: '计价标志', align: 'center', resizable: true, slotName: 'jjzt', width: 60 },
|
||||||
{ prop: 'jjzt', label: '计价标志', align: 'center', visible: true, slot: 'jjzt', width: 60 },
|
{ field: 'zxysname', title: '执行医生', align: 'center', resizable: true, width: 60 },
|
||||||
{ prop: 'zxysname', label: '执行医生', align: 'center', visible: true, width: 60 },
|
{ field: 'bbsjrname', title: '送检人', align: 'center', resizable: true, width: 50 },
|
||||||
{ prop: 'bbsjrname', label: '送检人', align: 'center', visible: true, width: 50 },
|
{ field: 'yljg', title: '医疗机构', align: 'center', resizable: true, slotName: 'yljg', width: 150 },
|
||||||
{ prop: 'yljg', label: '医疗机构', align: 'center', visible: true, slot: 'yljg', width: 150 },
|
|
||||||
])
|
])
|
||||||
|
|
||||||
const single = ref(true);
|
const single = ref(true);
|
||||||
@ -305,11 +290,11 @@ const cellStyleHd = ({ row, column, rowIndex, columnIndex }: {
|
|||||||
columnIndex: number;
|
columnIndex: number;
|
||||||
}) => {
|
}) => {
|
||||||
// console.log(row, column, rowIndex, columnIndex);
|
// console.log(row, column, rowIndex, columnIndex);
|
||||||
if (column.label == "急" && row.jzbz == "1") {
|
if (column.title == "急" && row.jzbz == "1") {
|
||||||
return { color: '#f00' };
|
return { color: '#f00' };
|
||||||
}
|
}
|
||||||
|
|
||||||
if (column.label == "类别") {
|
if (column.title == "类别") {
|
||||||
const bgColor = classCom.decimalToHexColor(row.bkcolor);
|
const bgColor = classCom.decimalToHexColor(row.bkcolor);
|
||||||
const textColor = classCom.getContrastTextColor(bgColor);
|
const textColor = classCom.getContrastTextColor(bgColor);
|
||||||
return {
|
return {
|
||||||
@ -375,22 +360,26 @@ const selectionChange = (selection: any) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const handleColumnDragEnd = (data: any) => {
|
const handleColumnDragEnd = (data: any) => {
|
||||||
// 更新列配置
|
// 先清空再赋值,强制触发重新渲染
|
||||||
columns.value = data.columns;
|
columns.value = [];
|
||||||
// 可以在这里保存列顺序到本地存储等
|
// 使用nextTick确保DOM更新后再设置新值
|
||||||
// localStorage.setItem('tableColumnOrder', JSON.stringify(data.columns));
|
nextTick(() => {
|
||||||
|
columns.value = [...data.columns];
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
// 左侧表格配置
|
// 左侧表格配置
|
||||||
const tableConfig = ref({
|
const tableConfig = ref({
|
||||||
// stripe: true, // 斑马纹
|
height: '76.5vh', // 高度
|
||||||
border: true, // 边框
|
// 复选框配置
|
||||||
index: true, // 序号
|
checkboxConfig: {
|
||||||
height: '', // 高度
|
// 可选配置项
|
||||||
highlightCurrentRow: true, // 高亮当前行
|
checkField: 'checked', // 绑定数据中的字段(默认:checked)
|
||||||
cellStyle: cellStyleHd,
|
range: false, // 是否支持范围选择(按住 Shift 连续选择)
|
||||||
rowClassName: rowClassNameHd,
|
disabled: false, // 是否禁用全部复选框
|
||||||
fit: true
|
reserve: false, // 是否保留勾选状态(分页/筛选时)
|
||||||
|
highlight: false // 是否高亮选中行
|
||||||
|
}
|
||||||
})
|
})
|
||||||
// 右侧数据源
|
// 右侧数据源
|
||||||
const rightTableData = ref([])
|
const rightTableData = ref([])
|
||||||
@ -441,14 +430,15 @@ const cyTableConfig = ref({
|
|||||||
|
|
||||||
// 采样登记
|
// 采样登记
|
||||||
const openBlock = (value: string) => {
|
const openBlock = (value: string) => {
|
||||||
if (sqhs.value.length > 0) {
|
const selections = tableRef.value.allSelection()
|
||||||
|
if (selections.length > 0) {
|
||||||
ElMessageBox.confirm(`确定操作选中的数据吗?`, "提示", {
|
ElMessageBox.confirm(`确定操作选中的数据吗?`, "提示", {
|
||||||
confirmButtonText: "确认",
|
confirmButtonText: "确认",
|
||||||
cancelButtonText: "取消",
|
cancelButtonText: "取消",
|
||||||
beforeClose: async (action, instance, done) => {
|
beforeClose: async (action, instance, done) => {
|
||||||
if (action === "confirm") {
|
if (action === "confirm") {
|
||||||
// 生成请求Promise数组
|
// 生成请求Promise数组
|
||||||
const requests = sqhs.value.map((item: any) => { return item.sqh });
|
const requests = selections.map((item: any) => { return item.sqh });
|
||||||
fetchCodeExec({
|
fetchCodeExec({
|
||||||
sqh: requests.join(','),
|
sqh: requests.join(','),
|
||||||
userid: queryParams.userid,
|
userid: queryParams.userid,
|
||||||
@ -530,13 +520,14 @@ const goReport = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const cancelHandle = () => {
|
const cancelHandle = () => {
|
||||||
if (sqhs.value.length <= 0) return ElMessage.warning('请选择数据!')
|
const selections = tableRef.value.allSelection()
|
||||||
|
if (selections.length <= 0) return ElMessage.warning('请选择数据!')
|
||||||
ElMessageBox.confirm(`确定作废选中的数据吗?`, "提示", {
|
ElMessageBox.confirm(`确定作废选中的数据吗?`, "提示", {
|
||||||
confirmButtonText: "确认",
|
confirmButtonText: "确认",
|
||||||
cancelButtonText: "取消",
|
cancelButtonText: "取消",
|
||||||
beforeClose: async (action, instance, done) => {
|
beforeClose: async (action, instance, done) => {
|
||||||
if (action === "confirm") {
|
if (action === "confirm") {
|
||||||
const requests = sqhs.value.map((item: any) => { return item.sqh });
|
const requests = selections.map((item: any) => { return item.sqh });
|
||||||
fetchCodeExec({
|
fetchCodeExec({
|
||||||
sqh: requests.join(','),
|
sqh: requests.join(','),
|
||||||
userid: queryParams.userid,
|
userid: queryParams.userid,
|
||||||
@ -562,8 +553,21 @@ const cancelHandle = () => {
|
|||||||
|
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
// 获取当前日期(当天)
|
||||||
|
const today = dayjs();
|
||||||
|
|
||||||
|
// 计算前6天的日期(当天 + 前6天 = 7天)
|
||||||
|
const startOfWeek = today.subtract(6, 'day');
|
||||||
|
|
||||||
|
const startDate = route.query.startdate ? String(route.query.startdate) : startOfWeek.format('YYYY-MM-DD HH:mm:ss');
|
||||||
|
const endDate = route.query.endate ? String(route.query.endate) : today.format('YYYY-MM-DD HH:mm:ss');
|
||||||
|
|
||||||
|
queryParams.times = [startDate, endDate];
|
||||||
|
queryParams.ksdh = (route.query.deptcode as string) ? (route.query.deptcode as string) : '';
|
||||||
|
queryParams.userid = (route.query.userid as string) ? (route.query.userid as string) : '';
|
||||||
|
queryParams.yljg = (route.query.yljg as string) ? (route.query.yljg as string) : '1';
|
||||||
// 进入页面单点登录
|
// 进入页面单点登录
|
||||||
const result = await userStore.loginAnonymous({ name: 'admin' })
|
const result = await userStore.loginAnonymous({ name: 'admin', yljg: queryParams.yljg })
|
||||||
if (result) {
|
if (result) {
|
||||||
getList()
|
getList()
|
||||||
}
|
}
|
||||||
@ -653,7 +657,9 @@ const getList = () => {
|
|||||||
userid: queryParams.userid,
|
userid: queryParams.userid,
|
||||||
st: queryParams.times[0],
|
st: queryParams.times[0],
|
||||||
et: queryParams.times[1],
|
et: queryParams.times[1],
|
||||||
yljg: queryParams.yljg
|
yljg: queryParams.yljg,
|
||||||
|
queryType: queryParams.queryType,
|
||||||
|
queryValue: queryParams.queryValue
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!data.yljg) return ElMessage.warning('医疗机构不能为空!')
|
if (!data.yljg) return ElMessage.warning('医疗机构不能为空!')
|
||||||
@ -690,23 +696,25 @@ const getList = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const selectStatusRows = () => {
|
const selectStatusRows = () => {
|
||||||
tableRef.value.clearSelection()
|
|
||||||
tableData.value.forEach((item: any) => {
|
tableData.value.forEach((item: any) => {
|
||||||
if (item.zt == 1) {
|
if (item.zt == 1) {
|
||||||
tableRef.value.toggleRowSelection(item, true)
|
tableRef.value.toggleRowSelection(item, true)
|
||||||
|
} else {
|
||||||
|
tableRef.value.toggleRowSelection(item, false)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 打印pdf
|
// 打印pdf
|
||||||
const printPdf = () => {
|
const printPdf = () => {
|
||||||
if (sqhs.value.length <= 0) return ElMessage.warning('请选择数据!')
|
const selections = tableRef.value.allSelection()
|
||||||
|
if (selections.length <= 0) return ElMessage.warning('请选择数据!')
|
||||||
ElMessageBox.confirm(`确定打印选中的数据吗?`, "提示", {
|
ElMessageBox.confirm(`确定打印选中的数据吗?`, "提示", {
|
||||||
confirmButtonText: "确认",
|
confirmButtonText: "确认",
|
||||||
cancelButtonText: "取消",
|
cancelButtonText: "取消",
|
||||||
beforeClose: async (action, instance, done) => {
|
beforeClose: async (action, instance, done) => {
|
||||||
if (action === "confirm") {
|
if (action === "confirm") {
|
||||||
const requests = sqhs.value.map((item: any) => { return item.sqh });
|
const requests = selections.map((item: any) => { return item.sqh });
|
||||||
fetchCodeExec({
|
fetchCodeExec({
|
||||||
sqh: requests.join(','),
|
sqh: requests.join(','),
|
||||||
userid: queryParams.userid,
|
userid: queryParams.userid,
|
||||||
@ -728,6 +736,10 @@ const printPdf = () => {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
.mytable-style {
|
||||||
|
height: 76.5vh;
|
||||||
|
}
|
||||||
|
|
||||||
.custom-row-class {
|
.custom-row-class {
|
||||||
background-color: #c6c3ff !important;
|
background-color: #c6c3ff !important;
|
||||||
/* 设置行背景色 */
|
/* 设置行背景色 */
|
||||||
|
|||||||
@ -88,9 +88,13 @@
|
|||||||
:columns="columns"></right-toolbar> -->
|
:columns="columns"></right-toolbar> -->
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<CustomTable ref="tableRefs" :data="tableData" :columns="columns" :config="tableConfig" :loading="loading"
|
<!-- <CustomTable ref="tableRefs" :data="tableData" :columns="columns" :config="tableConfig" :loading="loading"
|
||||||
@selection-change="selectionChange" @row-click="rowHandle" :enableColumnDrag="true"
|
@selection-change="selectionChange" @row-click="rowHandle" :enableColumnDrag="true"
|
||||||
@column-drag-end="handleColumnDragEnd">
|
@column-drag-end="handleColumnDragEnd"> -->
|
||||||
|
<VxeTable :table-data="tableData" :loading="loading" :columns="columns"
|
||||||
|
:row-config="{ isHover: true, keyField: 'ybh' }" @current-change="rowHandle" size="small"
|
||||||
|
class="mytable-style" ref="tableRefs" :cell-style="cellStyleHd" @selection-change="selectionChange"
|
||||||
|
:config="tableConfig" :enable-column-drag="true" @column-drag-end="handleColumnDragEnd">
|
||||||
<template #dybz="{ row }">
|
<template #dybz="{ row }">
|
||||||
<svg-icon v-if="row.dybz == 1" icon-class="lvgou" />
|
<svg-icon v-if="row.dybz == 1" icon-class="lvgou" />
|
||||||
</template>
|
</template>
|
||||||
@ -100,7 +104,7 @@
|
|||||||
<template #jzbz="{ row }">
|
<template #jzbz="{ row }">
|
||||||
{{ row.jzbz == 1 ? '急' : '' }}
|
{{ row.jzbz == 1 ? '急' : '' }}
|
||||||
</template>
|
</template>
|
||||||
</CustomTable>
|
</VxeTable>
|
||||||
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8" class="right-table">
|
<el-col :span="8" class="right-table">
|
||||||
@ -168,6 +172,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, reactive, toRaw, computed, watch, nextTick, onMounted } from 'vue';
|
import { ref, reactive, toRaw, computed, watch, nextTick, onMounted } from 'vue';
|
||||||
import CustomTable from '@/components/elTable/index.vue'
|
import CustomTable from '@/components/elTable/index.vue'
|
||||||
|
import VxeTable from '@/components/vxeTable/index.vue'
|
||||||
import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
import { reportList, reportPrintPdf, reportResult, reportMedList, reportFsresult } from '@/api/checkCode/index'
|
import { reportList, reportPrintPdf, reportResult, reportMedList, reportFsresult } from '@/api/checkCode/index'
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
@ -227,21 +232,6 @@ const queryParams = reactive<QueryParams>({
|
|||||||
userid: '',
|
userid: '',
|
||||||
yljg: ''
|
yljg: ''
|
||||||
});
|
});
|
||||||
// 获取当前日期(当天)
|
|
||||||
const today = dayjs();
|
|
||||||
|
|
||||||
// 计算前6天的日期(当天 + 前6天 = 7天)
|
|
||||||
const startOfWeek = today.subtract(6, 'day');
|
|
||||||
|
|
||||||
const startDate = route.query.startdate ? String(route.query.startdate) : startOfWeek.format('YYYY-MM-DD');
|
|
||||||
const endDate = route.query.endate ? String(route.query.endate) : today.format('YYYY-MM-DD');
|
|
||||||
|
|
||||||
queryParams.times = [startDate, endDate];
|
|
||||||
queryParams.ksdh = (route.query.deptcode as string) ? (route.query.deptcode as string) : '';
|
|
||||||
queryParams.userid = (route.query.userid as string) ? (route.query.userid as string) : '';
|
|
||||||
queryParams.brdh = (route.query.brdh as string) ? (route.query.brdh as string) : '';
|
|
||||||
queryParams.yljg = (route.query.yljg as string) ? (route.query.yljg as string) : '';
|
|
||||||
|
|
||||||
|
|
||||||
const single = ref(true);
|
const single = ref(true);
|
||||||
const multiple = ref(true);
|
const multiple = ref(true);
|
||||||
@ -307,25 +297,25 @@ const rows = ref<any[]>([])
|
|||||||
const tableData = ref([])
|
const tableData = ref([])
|
||||||
// 配置项
|
// 配置项
|
||||||
const columns = ref([
|
const columns = ref([
|
||||||
{ type: 'selection', visible: true, align: 'center', width: 30, label: '多选框' },
|
{ type: 'selection', field: '', title: '', resizable: true, align: 'center', width: 40 },
|
||||||
{ prop: 'dybz', label: '印', align: 'center', visible: true, slot: 'dybz', width: 40 },
|
{ field: 'dybz', title: '印', align: 'center', resizable: true, slotName: 'dybz', width: 40 },
|
||||||
{ prop: 'jzbz', label: '急', align: 'center', visible: true, slot: 'jzbz', width: 40 },
|
{ field: 'jzbz', title: '急', align: 'center', resizable: true, slotName: 'jzbz', width: 40 },
|
||||||
{ prop: 'alarmflag', label: '危', align: 'center', visible: true, slot: 'alarmflag', width: 40 },
|
{ field: 'alarmflag', title: '危', align: 'center', resizable: true, slotName: 'alarmflag', width: 40 },
|
||||||
{ prop: 'brdh', label: '病人代号', align: 'center', visible: true, sortable: true, width: 100 },
|
{ field: 'brdh', title: '病人代号', align: 'center', resizable: true, sortable: true, width: 100 },
|
||||||
{ prop: 'brxm', label: '病人姓名', align: 'center', visible: true, },
|
{ field: 'brxm', title: '病人姓名', align: 'center', resizable: true, width: 60 },
|
||||||
{ prop: 'brxbname', label: '性别', align: 'center', visible: true, width: 40 },
|
{ field: 'brxbname', title: '性别', align: 'center', resizable: true, width: 40 },
|
||||||
{ prop: 'ch', label: '床号', align: 'center', visible: true, width: 50 },
|
{ field: 'ch', title: '床号', align: 'center', resizable: true, width: 50 },
|
||||||
{ prop: 'jymd', label: '检验目的', align: 'center', visible: true, width: 200 },
|
{ field: 'jymd', title: '检验目的', align: 'center', resizable: true, width: 200 },
|
||||||
{ prop: 'yblxname', label: '样本类型', align: 'center', visible: true, },
|
{ field: 'yblxname', title: '样本类型', align: 'center', resizable: true, width: 60 },
|
||||||
{ prop: 'sqsj', label: '送检时间', align: 'center', visible: true, width: 150 },
|
{ field: 'sqsj', title: '送检时间', align: 'center', resizable: true, width: 150 },
|
||||||
{ prop: 'confirmtime', label: '报告时间', align: 'center', visible: true, sortable: true, width: 150 },
|
{ field: 'confirmtime', title: '报告时间', align: 'center', resizable: true, sortable: true, width: 150 },
|
||||||
{ prop: 'sjysname', label: '送检医生', align: 'center', visible: true, width: 80 },
|
{ field: 'sjysname', title: '送检医生', align: 'center', resizable: true, width: 80 },
|
||||||
{ prop: 'brlyname', label: '病人类型', align: 'center', visible: true, width: 80 },
|
{ field: 'brlyname', title: '病人类型', align: 'center', resizable: true, width: 80 },
|
||||||
{ prop: 'yljg', label: '医疗机构', align: 'center', visible: true, width: 150 },
|
{ field: 'yljg', title: '医疗机构', align: 'center', resizable: true, width: 150 },
|
||||||
{ prop: 'jyrqname', label: '检验日期', align: 'center', visible: true, width: 100 },
|
{ field: 'jyrqname', title: '检验日期', align: 'center', resizable: true, width: 100 },
|
||||||
{ prop: 'ybh', label: '样本号', align: 'center', visible: true, width: 60 },
|
{ field: 'ybh', title: '样本号', align: 'center', resizable: true, width: 60 },
|
||||||
{ prop: 'yqmc', label: '仪器名称', align: 'center', visible: true, width: 150 },
|
{ field: 'yqmc', title: '仪器名称', align: 'center', resizable: true, width: 150 },
|
||||||
{ prop: 'yqdl', label: '仪器', align: 'center', visible: true, width: 100 },
|
{ field: 'yqdl', title: '仪器', align: 'center', resizable: true, width: 100 },
|
||||||
])
|
])
|
||||||
|
|
||||||
const selectionChange = (selection: any) => {
|
const selectionChange = (selection: any) => {
|
||||||
@ -379,13 +369,19 @@ const rowHandle = (row: any) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const handleColumnDragEnd = (newColumns: any) => {
|
const handleColumnDragEnd = (newColumns: any) => {
|
||||||
columns.value = newColumns.columns
|
columns.value = [];
|
||||||
|
// 使用nextTick确保DOM更新后再设置新值
|
||||||
|
nextTick(() => {
|
||||||
|
columns.value = [...newColumns.columns];
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 打印单张Pdf
|
// 打印单张Pdf
|
||||||
const printPdf = () => {
|
const printPdf = () => {
|
||||||
const printStore = usePrintStore();
|
const printStore = usePrintStore();
|
||||||
const merge = rows.value.map((item: any) => { return `${item.jyrqname.replace(/-/g, '')}_${item.yq.trim()}_${item.ybh}` })
|
const selections = tableRefs.value.allSelection()
|
||||||
|
if (selections.length <= 0) return ElMessage.warning('请选择要打印的数据!')
|
||||||
|
const merge = selections.map((item: any) => { return `${item.jyrqname.replace(/-/g, '')}_${item.yq.trim()}_${item.ybh}` })
|
||||||
|
|
||||||
reportPrintPdf(merge).then((res: any) => {
|
reportPrintPdf(merge).then((res: any) => {
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
@ -408,32 +404,35 @@ const cellStyleHd = ({ row, column, rowIndex, columnIndex }: {
|
|||||||
columnIndex: number;
|
columnIndex: number;
|
||||||
}) => {
|
}) => {
|
||||||
// console.log(row, column, rowIndex, columnIndex);
|
// console.log(row, column, rowIndex, columnIndex);
|
||||||
if (column.label == "急" && row.jzbz == "1") {
|
if (column.title == "急" && row.jzbz == "1") {
|
||||||
return { color: '#f00' };
|
return { color: '#f00' };
|
||||||
}
|
}
|
||||||
if (column.label == "危" && row.alarmflag == "1") {
|
if (column.title == "危" && row.alarmflag == "1") {
|
||||||
return { color: '#f00' };
|
return { color: '#f00' };
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// 表格配置
|
// 表格配置
|
||||||
const tableConfig = ref(
|
const tableConfig = ref({
|
||||||
{
|
height: '71vh', // 高度
|
||||||
// stripe: true, // 斑马纹
|
// 复选框配置
|
||||||
border: true, // 边框
|
checkboxConfig: {
|
||||||
height: '', // 高度
|
// 可选配置项
|
||||||
highlightCurrentRow: true, // 高亮当前行
|
checkField: 'checked', // 绑定数据中的字段(默认:checked)
|
||||||
fit: true,
|
range: false, // 是否支持范围选择(按住 Shift 连续选择)
|
||||||
cellStyle: cellStyleHd
|
disabled: false, // 是否禁用全部复选框
|
||||||
|
reserve: false, // 是否保留勾选状态(分页/筛选时)
|
||||||
|
highlight: false // 是否高亮选中行
|
||||||
}
|
}
|
||||||
)
|
})
|
||||||
|
|
||||||
// 勾选未打印
|
// 勾选未打印
|
||||||
const selectStatusRows = () => {
|
const selectStatusRows = () => {
|
||||||
tableRefs.value.clearSelection()
|
|
||||||
tableData.value.forEach((item: any) => {
|
tableData.value.forEach((item: any) => {
|
||||||
if (item.dybz != 1) {
|
if (item.dybz != 1) {
|
||||||
tableRefs.value.toggleRowSelection(item, true)
|
tableRefs.value.toggleRowSelection(item, true)
|
||||||
|
} else {
|
||||||
|
tableRefs.value.toggleRowSelection(item, false)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -529,7 +528,7 @@ const rightTableConfig = ref(
|
|||||||
{
|
{
|
||||||
// stripe: true, // 斑马纹
|
// stripe: true, // 斑马纹
|
||||||
border: true, // 边框
|
border: true, // 边框
|
||||||
height: '25vh', // 高度
|
height: '71vh', // 高度
|
||||||
highlightCurrentRow: true, // 高亮当前行
|
highlightCurrentRow: true, // 高亮当前行
|
||||||
cellStyle: rightCellStyleHd
|
cellStyle: rightCellStyleHd
|
||||||
}
|
}
|
||||||
@ -556,12 +555,12 @@ const xmrowHandle = (row: any) => {
|
|||||||
bottomTableData.value = res.rows
|
bottomTableData.value = res.rows
|
||||||
if (res.rows.length > 0) {
|
if (res.rows.length > 0) {
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
rightTableConfig.value.height = `calc(35vh - ${heightForm.value}px)`
|
rightTableConfig.value.height = `25vh`
|
||||||
rightTableRef.value?.doLayout && rightTableRef.value.doLayout();
|
rightTableRef.value?.doLayout && rightTableRef.value.doLayout();
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
rightTableConfig.value.height = `calc(83vh - ${heightForm.value}px)`
|
rightTableConfig.value.height = `71vh`
|
||||||
rightTableRef.value?.doLayout && rightTableRef.value.doLayout();
|
rightTableRef.value?.doLayout && rightTableRef.value.doLayout();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -829,17 +828,25 @@ const dictData = ref<DictData>({});
|
|||||||
|
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
// 初始化3天区间(今天-前两天)
|
// 获取当前日期(当天)
|
||||||
// const end = dayjs().format('YYYY-MM-DD HH:mm:ss');
|
const today = dayjs();
|
||||||
// const start = dayjs().subtract(1, 'day').format('YYYY-MM-DD HH:mm:ss'); //add 时间往后
|
|
||||||
// queryParams.times = [start, end];
|
// 计算前6天的日期(当天 + 前6天 = 7天)
|
||||||
// console.log(queryParams.times);
|
const startOfWeek = today.subtract(6, 'day');
|
||||||
|
|
||||||
|
const startDate = route.query.startdate ? String(route.query.startdate) : startOfWeek.format('YYYY-MM-DD');
|
||||||
|
const endDate = route.query.endate ? String(route.query.endate) : today.format('YYYY-MM-DD');
|
||||||
|
|
||||||
|
queryParams.times = [startDate, endDate];
|
||||||
|
queryParams.ksdh = (route.query.deptcode as string) ? (route.query.deptcode as string) : '';
|
||||||
|
queryParams.userid = (route.query.userid as string) ? (route.query.userid as string) : '';
|
||||||
|
queryParams.brdh = (route.query.brdh as string) ? (route.query.brdh as string) : '';
|
||||||
|
queryParams.yljg = (route.query.yljg as string) ? (route.query.yljg as string) : '1';
|
||||||
// 进入页面单点登录
|
// 进入页面单点登录
|
||||||
const result = await userStore.loginAnonymous({ name: 'admin' })
|
const result = await userStore.loginAnonymous({ name: 'admin', yljg: queryParams.yljg })
|
||||||
if (result) {
|
if (result) {
|
||||||
getList()
|
getList()
|
||||||
}
|
}
|
||||||
adjustTableHeight();
|
|
||||||
|
|
||||||
// 加载病人来源字典
|
// 加载病人来源字典
|
||||||
const dictRefs = await comDict('PT', 'DP');
|
const dictRefs = await comDict('PT', 'DP');
|
||||||
@ -914,28 +921,15 @@ const getList = () => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 计算table高度
|
|
||||||
watch(showSearch, () => {
|
|
||||||
nextTick(() => {
|
|
||||||
adjustTableHeight();
|
|
||||||
})
|
|
||||||
}, { immediate: true });
|
|
||||||
|
|
||||||
function adjustTableHeight() {
|
|
||||||
if (compactForm.value) {
|
|
||||||
heightForm.value = compactForm.value.offsetHeight;
|
|
||||||
|
|
||||||
nextTick(() => {
|
|
||||||
tableConfig.value.height = `calc(83vh - ${heightForm.value}px)`
|
|
||||||
tableRefs.value?.doLayout && tableRefs.value.doLayout();
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
.mytable-style {
|
||||||
|
height: 71vh;
|
||||||
|
}
|
||||||
|
|
||||||
.compact-form {
|
.compact-form {
|
||||||
border-bottom: 1px solid #E1E9F7;
|
border-bottom: 1px solid #E1E9F7;
|
||||||
}
|
}
|
||||||
@ -1021,7 +1015,7 @@ function adjustTableHeight() {
|
|||||||
/* 超出部分隐藏 */
|
/* 超出部分隐藏 */
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
/* 可选:设置行高和最大宽度,优化显示效果 */
|
/* 可选:设置行高和最大宽度,优化显示效果 */
|
||||||
line-height: 1.5;
|
line-height: 1.3;
|
||||||
/* 行高,根据字体大小调整 */
|
/* 行高,根据字体大小调整 */
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
pointer-events: auto;
|
pointer-events: auto;
|
||||||
|
|||||||
@ -1,11 +1,697 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div class="app-container">
|
||||||
<!-- 微生物检验录入界面 -->
|
<el-row :gutter="10">
|
||||||
|
<el-col :span="13">
|
||||||
|
<div class="box-shadow">
|
||||||
|
<el-form :model="queryParams" ref="queryRef" :inline="true" :size="aotuSize" :rules="rules"
|
||||||
|
class="compact-form">
|
||||||
|
<el-row :gutter="5">
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item label="样本号:" prop="ybh">
|
||||||
|
<el-input v-model="queryParams.ybh" placeholder="样本编号" @keyup.enter="handleQuery"
|
||||||
|
style="width:100%" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item label="日期:" prop="jyrq">
|
||||||
|
<el-date-picker v-model="queryParams.jyrq" type="date" label-width="1.25rem" placeholder="检验日期"
|
||||||
|
value-format="YYYY-MM-DD" :clearable="false" @change="" style="width:100%"></el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item label="部门:" prop="instrGroup">
|
||||||
|
<SelectTable v-model:data="queryParams.instrGroup" :fields="instrGroupFields"
|
||||||
|
:tableData="instrGroupOptions" label="zdmc" value="zddh" objKey="zddh" :border="true" width="9rem"
|
||||||
|
placeholder="请选择部门" @getDataValue="handleinstrGroupChange" :clearable="false" :size="aotuSize" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item label="仪器:" prop="yq">
|
||||||
|
<SelectTable v-model:data="queryParams.yq" :fields="yqFields" :tableData="instrOptions" label="yqmc"
|
||||||
|
value="yq" objKey="yq" :border="true" width="9rem" placeholder="请选择仪器" :clearable="false"
|
||||||
|
:size="aotuSize" @getDataValue="yqHandleChange" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<!-- <el-form-item>
|
||||||
|
<el-icon color="#3c80d9" size="20" style="margin-right: 10px;" class="cp">
|
||||||
|
<Search @click="fetchlabPatList" />
|
||||||
|
</el-icon>
|
||||||
|
<el-icon color="#3c80d9" size="20" class="cp" @click="selectJob(labPat)">
|
||||||
|
<Refresh />
|
||||||
|
</el-icon>
|
||||||
|
</el-form-item> -->
|
||||||
|
</el-form>
|
||||||
|
<el-row :gutter="5">
|
||||||
|
<el-col :span="8">
|
||||||
|
<LabPat ref="labPatRef" v-model:labPat="labPat" :labPatKey="queryParams" :labSysList="labInputcolList"
|
||||||
|
:userList="userList" @changeStatus="changeStatus" @batchShow="handleBatchScan" />
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="16">
|
||||||
|
<!-- <LabResult ref="labResultRef" :labPat="labPat" :tableData="labResuts" :tableKey="queryParams"
|
||||||
|
:userList="userList" :resultSysList="resultConfig" @fetchLabResults="resultsHandle" :dictData="dictData"
|
||||||
|
@changeStatus="changeStatus" @previewHandle="previewHandle" /> -->
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :span="11">
|
||||||
|
<div>
|
||||||
|
<tabView :tabList="tabList" v-model:activeTab="activeTab" />
|
||||||
|
<div class="box-shadow right_box">
|
||||||
|
<template v-if="activeTab == 'LabPatList'">
|
||||||
|
<div class="flex-between">
|
||||||
|
<div>
|
||||||
|
<el-button type="primary" :size="aotuSize" icon="RefreshRight" @click="fetchlabPatList">刷新</el-button>
|
||||||
|
<el-button type="danger" :size="aotuSize" @click="delSampleHd">删除</el-button>
|
||||||
|
<el-button class="btn_green" :size="aotuSize" icon="top" @click="handlePrev">上一个</el-button>
|
||||||
|
<el-button class="btn_green mr5" :size="aotuSize" icon="bottom" @click="handleNext">下一个</el-button>
|
||||||
|
<PatientQueryForm :initial-params="initialParams" @query="handleQueryResult" @reset="handleReset"
|
||||||
|
width="9rem" :size="aotuSize" placeholder="查询条件" :dict-data="dictData" :clearable="true" />
|
||||||
|
<el-input v-model="searchText" clearable :size="aotuSize" @keyup.enter="searchQuery"
|
||||||
|
@clear="clearSearch" style="width: 6rem" />
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<el-checkbox v-model="lbFlag" :size="aotuSize"> 列表翻页 </el-checkbox>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<LabPatList ref="labPatListRef" :labPatList="labPatList" :loading="loading" @select="selectJob"
|
||||||
|
:tableKey="queryParams" :dictData="dictData" @search="searchJobs" />
|
||||||
|
|
||||||
|
<div class="button-group">
|
||||||
|
<div class="text1">样本总数:<span>{{ ybs }}</span></div>
|
||||||
|
<div class="text2">未审:<span>{{ ws }}</span></div>
|
||||||
|
<div class="text3">危:<span>{{ wjs }}</span></div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
|
||||||
|
<component :is="activeTabName" :queryParams="queryParams" :dictData="dictData" :instrOptions="instrOptions"
|
||||||
|
@fetchResults="fetchLabResults" :tablekey="queryParams" />
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<!-- 批量扫码弹窗 -->
|
||||||
|
<BatchCode ref="batchRef" v-model:labPat="labPat" :labPatKey="queryParams" :dictData="dictData"
|
||||||
|
:totalCount="labPatList.length" @goNext="handleNext" @goPrev="handlePrev" @goLast="handleLast"
|
||||||
|
@queryYbh="ybhChangeTb" @changeStatus="changeStatus" />
|
||||||
|
|
||||||
|
<el-dialog v-model="previewShow" title="预览" width="90vw" :close-on-click-modal="false">
|
||||||
|
<iFrame v-if="pdfUrl" :src="pdfUrl" />
|
||||||
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import { ref, nextTick, onMounted, toRaw } from 'vue';
|
||||||
|
import LabPat from './labpat.vue';
|
||||||
|
import SelectTable from '@/components/SelectTable/index.vue';
|
||||||
|
import tabView from '@/components/tabViews/index.vue';
|
||||||
|
// @ts-ignore
|
||||||
|
import iFrame from "@/components/iFrame/index.vue";
|
||||||
|
// @ts-ignore
|
||||||
|
// import LabResult from './components/labresult.vue';
|
||||||
|
import LabPatList from './labpatlist.vue';
|
||||||
|
// @ts-ignore
|
||||||
|
import { comDict } from '@/utils/dict'
|
||||||
|
import { wswsampleList, queryLabResults, loadDefault, queryLabPat, instrdconfig, delSample, getGroupInstrdList } from "@/api/liswork/work/LisWork";
|
||||||
|
import { getComDicts, queryComDictListService } from "@/api/liswork/dict/ComDict";
|
||||||
|
import { ElMessage, ElMessageBox } from "element-plus";
|
||||||
|
import BatchCode from '../work/components/batchCode.vue';
|
||||||
|
import { getNextNumber, getPreviousNumber } from "@/utils/getNextNumber";
|
||||||
|
import { useCommonStore } from '@/store/modules/commonStore';
|
||||||
|
import { classCom } from '@/utils/classCom';
|
||||||
|
import PatientQueryForm from '@/components/selectSearch/index.vue'
|
||||||
|
// @ts-ignore
|
||||||
|
import { listUser } from '@/api/system/user.js'
|
||||||
|
|
||||||
|
const aotuSize = classCom.useAutoSize();
|
||||||
|
|
||||||
|
const previewShow = ref(false);
|
||||||
|
const lbFlag = ref(false);
|
||||||
|
const queryParams = ref({
|
||||||
|
jyrq: '2025-08-20',
|
||||||
|
yq: 'PHOENI',
|
||||||
|
ybh: '1',
|
||||||
|
instrGroup: '04',
|
||||||
|
problemId: 0,
|
||||||
|
days: 90,
|
||||||
|
})
|
||||||
|
const ybs = ref(0)
|
||||||
|
const ws = ref(0)
|
||||||
|
const wjs = ref(0)
|
||||||
|
const activeTab = ref('LabPatList')
|
||||||
|
const tabList = ref([
|
||||||
|
{ label: '标本列表', value: 'LabPatList' },
|
||||||
|
{ label: '结果图形', value: 'ResultGraph' },
|
||||||
|
{ label: '历史对照', value: 'History' },
|
||||||
|
{ label: '其他结果', value: 'Others' },
|
||||||
|
{ label: '结果复查', value: 'Reexamination' },
|
||||||
|
{ label: '收费信息', value: 'Charge' },
|
||||||
|
{ label: '组合项目', value: 'Combination' },
|
||||||
|
{ label: '临床意义', value: 'Clinical' },
|
||||||
|
{ label: '样本流转', value: 'Sample' },
|
||||||
|
])
|
||||||
|
|
||||||
|
const activeTabMap = {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
const activeTabName = computed(() => activeTabMap[activeTab.value as keyof typeof activeTabMap] || 'LabPatList');
|
||||||
|
|
||||||
|
const labPat = ref<any>({})
|
||||||
|
const labPatList = ref<Array<{ ybh: string; jgbz: string }>>([]);
|
||||||
|
const originalLabPatList = ref([]) //原始数据
|
||||||
|
const loading = ref(false)
|
||||||
|
const searchText = ref('')
|
||||||
|
|
||||||
|
const rules = ref([])
|
||||||
|
const instrGroupOptions = ref<any[]>([])
|
||||||
|
const instrOptions = ref<{ yq: string; yqmc: string }[]>([])
|
||||||
|
|
||||||
|
const pdfUrl = ref('')
|
||||||
|
|
||||||
|
// 初始查询参数(可选)
|
||||||
|
const initialParams = {}
|
||||||
|
|
||||||
|
// 定义查询参数类型
|
||||||
|
interface QueryParams {
|
||||||
|
brly?: string | number
|
||||||
|
jgbz?: string | number
|
||||||
|
dybz?: string | number
|
||||||
|
alarmflag?: string | number
|
||||||
|
jzbz?: string | number
|
||||||
|
finish?: string | number
|
||||||
|
autojgbz?: string | number
|
||||||
|
}
|
||||||
|
// 模糊查询
|
||||||
|
const searchQuery = () => {
|
||||||
|
let filterMhList = [...originalLabPatList.value];
|
||||||
|
|
||||||
|
if (searchText.value) {
|
||||||
|
const searchStr = searchText.value.trim().toLowerCase();
|
||||||
|
filterMhList = filterMhList.filter((item: any) => {
|
||||||
|
// 处理 zjf大写转为小写
|
||||||
|
const matchZjf = item.zjf && typeof item.zjf === 'string'
|
||||||
|
? item.zjf.toLowerCase().includes(searchStr)
|
||||||
|
: false; const matchBrxm = item.brxm && typeof item.brxm === 'string' && item.brxm.includes(searchStr);
|
||||||
|
const matchSqh = item.sqh && typeof item.sqh === 'string' && item.sqh.includes(searchStr);
|
||||||
|
return matchZjf || matchBrxm || matchSqh;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
labPatList.value = filterMhList;
|
||||||
|
|
||||||
|
getTotals();
|
||||||
|
|
||||||
|
if (filterMhList.length > 0) {
|
||||||
|
highlightRowIndex.value = 0;
|
||||||
|
const firstRow = filterMhList[0];
|
||||||
|
labPatListRef.value.setCurrentRow(firstRow);
|
||||||
|
selectJob(firstRow);
|
||||||
|
} else {
|
||||||
|
labPat.value = {};
|
||||||
|
labResuts.value = [];
|
||||||
|
highlightRowIndex.value = -1;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const clearSearch = () => {
|
||||||
|
searchText.value = ''
|
||||||
|
searchQuery()
|
||||||
|
}
|
||||||
|
|
||||||
|
// 多条件查询
|
||||||
|
const handleQueryResult = (params: QueryParams) => {
|
||||||
|
// console.log('查询参数:', params);
|
||||||
|
// 复制原始列表作为筛选基础
|
||||||
|
let filteredList = [...originalLabPatList.value];
|
||||||
|
|
||||||
|
// 遍历所有查询参数,进行筛选
|
||||||
|
Object.entries(params).forEach(([key, value]) => {
|
||||||
|
filteredList = filteredList.filter((item: any) => {
|
||||||
|
if (value == 0) {
|
||||||
|
return item[key] == null;
|
||||||
|
} else {
|
||||||
|
return item[key] == value;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
labPatList.value = filteredList;
|
||||||
|
|
||||||
|
getTotals();
|
||||||
|
|
||||||
|
if (filteredList.length > 0) {
|
||||||
|
highlightRowIndex.value = 0;
|
||||||
|
const firstRow = filteredList[0];
|
||||||
|
labPatListRef.value.setCurrentRow(firstRow);
|
||||||
|
selectJob(firstRow);
|
||||||
|
} else {
|
||||||
|
labPat.value = {};
|
||||||
|
labResuts.value = [];
|
||||||
|
highlightRowIndex.value = -1;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 处理重置
|
||||||
|
const handleReset = () => {
|
||||||
|
labPatList.value = [...originalLabPatList.value];
|
||||||
|
getTotals();
|
||||||
|
}
|
||||||
|
const previewHandle = (url: string) => {
|
||||||
|
if (!url) return ElMessage.warning('未查询到文件')
|
||||||
|
pdfUrl.value = `data:application/pdf;base64,${url}`
|
||||||
|
previewShow.value = true
|
||||||
|
}
|
||||||
|
const handleinstrGroupChange = (val: any) => {
|
||||||
|
queryParams.value.yq = ''
|
||||||
|
// labResuts.value = []
|
||||||
|
// labPat.value = {}
|
||||||
|
getYqConfig()
|
||||||
|
}
|
||||||
|
const mbStore = useCommonStore();
|
||||||
|
const yqHandleChange = (val: any) => {
|
||||||
|
labResuts.value = []
|
||||||
|
labPat.value = {}
|
||||||
|
mbStore.setLxsrList([]);
|
||||||
|
getSysList()
|
||||||
|
fetchlabPatList()
|
||||||
|
}
|
||||||
|
const instrGroupFields = ref([
|
||||||
|
{ prop: 'zddh', label: '代号', width: 80, enablePinyinSearch: true },
|
||||||
|
{ prop: 'zdmc', label: '名称', width: 150, enablePinyinSearch: true },
|
||||||
|
])
|
||||||
|
|
||||||
|
// 部门
|
||||||
|
const loadinstrGroupOptions = () => {
|
||||||
|
getComDicts({ zdlb: 'GROUP' }).then((res: any) => {
|
||||||
|
instrGroupOptions.value = res.data
|
||||||
|
instrGroupOptions.value.push({ zddh: 'ALL', zdmc: '所有仪器' })
|
||||||
|
queryParams.value.instrGroup = '04'
|
||||||
|
queryParams.value.yq = 'PHOENI'
|
||||||
|
getYqConfig()
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
const yqFields = ref([
|
||||||
|
{ prop: 'yq', label: '代号', width: 80, enablePinyinSearch: true },
|
||||||
|
{ prop: 'yqmc', label: '名称', width: 150, enablePinyinSearch: true },
|
||||||
|
])
|
||||||
|
// 仪器
|
||||||
|
const getYqConfig = () => {
|
||||||
|
getGroupInstrdList({ lisgroup: queryParams.value.instrGroup })
|
||||||
|
.then((res: any) => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
instrOptions.value = res.data.map((item: any) => ({
|
||||||
|
yq: item.yq.trim(),
|
||||||
|
yqmc: item.yqmc
|
||||||
|
}))
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const resultsHandle = (flag: boolean) => {
|
||||||
|
if (flag) {
|
||||||
|
fetchLabPat();
|
||||||
|
}
|
||||||
|
fetchLabResults()
|
||||||
|
}
|
||||||
|
|
||||||
|
const highlightRowIndex = ref(-1)
|
||||||
|
const labPatListRef = ref()
|
||||||
|
//样本列表点击切换样本信息,同步载入左边样本信息表单和中间结果表单
|
||||||
|
const selectJob = (job: any) => {
|
||||||
|
lastRow.value = job;
|
||||||
|
// 复制选中的job数据到当前编辑状态
|
||||||
|
// Object.assign(labPat.value, {...job})
|
||||||
|
queryParams.value.jyrq = job.jyrq;
|
||||||
|
queryParams.value.yq = job.yq.trim();
|
||||||
|
queryParams.value.ybh = job.ybh;
|
||||||
|
fetchLabPat();
|
||||||
|
fetchLabResults();
|
||||||
|
highlightRowIndex.value = labPatList.value.findIndex((item: any) => item.ybh == queryParams.value.ybh);
|
||||||
|
}
|
||||||
|
const labResuts = ref([])
|
||||||
|
//载入样本结果表单(中间labresult.vue组件)
|
||||||
|
const fetchLabResults = async () => {
|
||||||
|
queryLabResults({ jyrq: queryParams.value.jyrq, yq: queryParams.value.yq, ybh: queryParams.value.ybh }).then((response: any) => {
|
||||||
|
labResuts.value = response.data;
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//载入样本编辑表单(左边labpat.vue组件)
|
||||||
|
const fetchLabPat = () => {
|
||||||
|
queryLabPat(queryParams.value).then((response: any) => {
|
||||||
|
labPat.value = response.data;
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const lastRow: any = ref({})
|
||||||
|
|
||||||
|
// 批量扫码ybh同步样本编号
|
||||||
|
const ybhChangeTb = (val: string) => {
|
||||||
|
console.log('val==>', val);
|
||||||
|
queryParams.value.ybh = val
|
||||||
|
handleQuery();
|
||||||
|
}
|
||||||
|
const handleQuery = () => {
|
||||||
|
if (!labPatList.value.length) return
|
||||||
|
if (!queryParams.value.ybh) {
|
||||||
|
highlightRowIndex.value = -1;
|
||||||
|
ElMessage.warning('请输入样本编号')
|
||||||
|
queryParams.value.ybh = lastRow.value.ybh
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
queryParams.value = { ...queryParams.value };
|
||||||
|
// 查找匹配的行
|
||||||
|
const matchedIndex = labPatList.value.findIndex((item: any) => item.ybh == queryParams.value.ybh);
|
||||||
|
const row = labPatList.value[matchedIndex]
|
||||||
|
|
||||||
|
if (matchedIndex !== -1) {
|
||||||
|
highlightRowIndex.value = matchedIndex;
|
||||||
|
// 等待DOM更新后滚动到目标行
|
||||||
|
nextTick(() => {
|
||||||
|
labPatListRef.value.setCurrentRow(row);
|
||||||
|
});
|
||||||
|
selectJob(row);
|
||||||
|
} else {
|
||||||
|
handleCreate()
|
||||||
|
highlightRowIndex.value = -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// 创建新样本
|
||||||
|
const handleCreate = () => {
|
||||||
|
loadDefault(queryParams.value).then((response: any) => {
|
||||||
|
if (response.code == 0) {
|
||||||
|
labPat.value = response.data;
|
||||||
|
labPat.value.id = `temp_${Date.now()}_${Math.random().toString(36).substr(2, 8)}`;
|
||||||
|
labResuts.value = []
|
||||||
|
labPatListRef.value?.clearCurrentRow();
|
||||||
|
fetchLabResults()
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 删除样本
|
||||||
|
const delSampleHd = () => {
|
||||||
|
if (lastRow.value.jgbz == '2') return ElMessage.warning('标本已审核,不能删除!')
|
||||||
|
const data = {
|
||||||
|
jyrq: lastRow.value.jyrq,
|
||||||
|
yq: lastRow.value.yq.trim(),
|
||||||
|
ybh: lastRow.value.ybh,
|
||||||
|
}
|
||||||
|
|
||||||
|
ElMessageBox.confirm(
|
||||||
|
`确定删除当前${lastRow.value.ybh}号标本?`,
|
||||||
|
'提示',
|
||||||
|
{
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning',
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.then(() => {
|
||||||
|
delSample(data).then((res: any) => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
ElMessage.success('删除成功')
|
||||||
|
labPatList.value = labPatList.value.filter((item: any) => item.ybh != lastRow.value.ybh)
|
||||||
|
getTotals()
|
||||||
|
// 删除跳当前页面下一个样本
|
||||||
|
// handleNext()
|
||||||
|
if (highlightRowIndex.value > labPatList.value.length - 1) {
|
||||||
|
highlightRowIndex.value--;
|
||||||
|
}
|
||||||
|
|
||||||
|
const row = labPatList.value[highlightRowIndex.value];
|
||||||
|
labPatListRef.value.setCurrentRow(row);
|
||||||
|
selectJob(row);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 上一个样本
|
||||||
|
const handlePrev = () => {
|
||||||
|
if (!lbFlag.value) {
|
||||||
|
const ybh = getPreviousNumber(queryParams.value.ybh) as string;
|
||||||
|
queryParams.value.ybh = ybh;
|
||||||
|
const index = labPatList.value.findIndex((item: any) => item.ybh == ybh)
|
||||||
|
if (index !== -1) {
|
||||||
|
highlightRowIndex.value = index;
|
||||||
|
const row = labPatList.value[index];
|
||||||
|
labPatListRef.value.setCurrentRow(row);
|
||||||
|
selectJob(row);
|
||||||
|
} else {
|
||||||
|
handleCreate();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (highlightRowIndex.value > 0) {
|
||||||
|
highlightRowIndex.value--;
|
||||||
|
const row = labPatList.value[highlightRowIndex.value];
|
||||||
|
labPatListRef.value.setCurrentRow(row);
|
||||||
|
selectJob(row);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// 下一个样本
|
||||||
|
const handleNext = () => {
|
||||||
|
if (!lbFlag.value) {
|
||||||
|
const ybh = getNextNumber(queryParams.value.ybh) as string;
|
||||||
|
queryParams.value.ybh = ybh;
|
||||||
|
const index = labPatList.value.findIndex((item: any) => item.ybh == ybh)
|
||||||
|
if (index !== -1) {
|
||||||
|
highlightRowIndex.value = index;
|
||||||
|
const row = labPatList.value[index];
|
||||||
|
labPatListRef.value.setCurrentRow(row);
|
||||||
|
selectJob(row);
|
||||||
|
} else {
|
||||||
|
handleCreate();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (highlightRowIndex.value < labPatList.value.length - 1) {
|
||||||
|
highlightRowIndex.value++;
|
||||||
|
const row = labPatList.value[highlightRowIndex.value];
|
||||||
|
labPatListRef.value.setCurrentRow(row);
|
||||||
|
selectJob(row);
|
||||||
|
} else {
|
||||||
|
queryParams.value.ybh = getNextNumber(queryParams.value.ybh) as string;
|
||||||
|
handleCreate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 最后一个样本
|
||||||
|
const handleLast = () => {
|
||||||
|
queryParams.value.ybh = labPatList.value[labPatList.value.length - 1].ybh;
|
||||||
|
handleNext();
|
||||||
|
}
|
||||||
|
const batchRef = ref()
|
||||||
|
// 批量扫码
|
||||||
|
const handleBatchScan = () => {
|
||||||
|
batchRef.value.open()
|
||||||
|
}
|
||||||
|
// 改变样本列表中样本状态
|
||||||
|
const changeStatus = (updatedPat: any, flag: boolean) => {
|
||||||
|
queryLabPat(queryParams.value).then((response: any) => {
|
||||||
|
if (response.code == 0) {
|
||||||
|
labPat.value = response.data;
|
||||||
|
const index = labPatList.value.findIndex((item: any) => item.ybh == updatedPat.ybh);
|
||||||
|
if (index !== -1) {
|
||||||
|
labPatList.value = labPatList.value.map((item, i) =>
|
||||||
|
i === index ? { ...labPat.value } : item
|
||||||
|
);
|
||||||
|
highlightRowIndex.value = index;
|
||||||
|
|
||||||
|
nextTick(() => {
|
||||||
|
labPatListRef.value.setCurrentRow(labPat.value);
|
||||||
|
});
|
||||||
|
// 条码号输入后操作
|
||||||
|
if (flag) {
|
||||||
|
setTimeout(() => { handleNext() }, 10)
|
||||||
|
} else {
|
||||||
|
fetchLabResults()
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 条码号输入后操作
|
||||||
|
if (flag) {
|
||||||
|
setTimeout(() => { handleNext() }, 10)
|
||||||
|
} else {
|
||||||
|
fetchLabResults()
|
||||||
|
}
|
||||||
|
labPatList.value.push(labPat.value)
|
||||||
|
setTimeout(() => {
|
||||||
|
nextTick(() => {
|
||||||
|
labPatListRef.value.setCurrentRow(labPat.value);
|
||||||
|
});
|
||||||
|
}, 10)
|
||||||
|
getTotals()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
//样本列表检索时刷新列表信息
|
||||||
|
const searchJobs = async (text: string, page: number, size: number) => {
|
||||||
|
fetchlabPatList()
|
||||||
|
}
|
||||||
|
|
||||||
|
//载入样本列表(右边labpatlist.vue组件)
|
||||||
|
const fetchlabPatList = () => {
|
||||||
|
if (!queryParams.value.jyrq) {
|
||||||
|
queryParams.value.jyrq = lastRow.value.jyrq
|
||||||
|
return ElMessage.warning('请选择检验日期')
|
||||||
|
}
|
||||||
|
loading.value = true;
|
||||||
|
wswsampleList(queryParams.value).then((res: any) => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
labPatList.value = res.data;
|
||||||
|
originalLabPatList.value = res.data
|
||||||
|
loading.value = false;
|
||||||
|
if (res.data.length > 0) {
|
||||||
|
highlightRowIndex.value = 0;
|
||||||
|
setTimeout(() => { labPatListRef.value.setCurrentRow(res.data[0]); }, 100)
|
||||||
|
selectJob(res.data[0])
|
||||||
|
getTotals()
|
||||||
|
} else {
|
||||||
|
ybs.value = 0
|
||||||
|
ws.value = 0
|
||||||
|
wjs.value = 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 计算样本数
|
||||||
|
const getTotals = () => {
|
||||||
|
ybs.value = labPatList.value.length
|
||||||
|
ws.value = labPatList.value.filter((item: any) => item.jgbz != 2).length
|
||||||
|
wjs.value = labPatList.value.filter((item: any) => item.alarmflag == 1).length
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
loadinstrGroupOptions()
|
||||||
|
fetchlabPatList()
|
||||||
|
|
||||||
|
|
||||||
|
interface DictData {
|
||||||
|
PT?: Array<any>;
|
||||||
|
AU?: Array<any>;
|
||||||
|
SX?: Array<any>;
|
||||||
|
DP?: Array<any>;
|
||||||
|
BT?: Array<any>;
|
||||||
|
SRD?: Array<any>;
|
||||||
|
HOS?: Array<any>;
|
||||||
|
ST?: Array<any>;
|
||||||
|
[key: string]: any[] | undefined; // 添加索引签名以支持动态访问
|
||||||
|
}
|
||||||
|
// 字典数据存储
|
||||||
|
const dictData = ref<DictData>({});
|
||||||
|
const labInputcolList = ref([])
|
||||||
|
const resultConfig = ref([])
|
||||||
|
// 获取参数配置
|
||||||
|
const getSysList = () => {
|
||||||
|
instrdconfig({ yq: queryParams.value.yq }).then((res: any) => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
labInputcolList.value = res.data.labInputcolList.filter((item: any) => item.mrts != "年龄单位" && item.mrts != "!")
|
||||||
|
resultConfig.value = res.data.ResultConfig
|
||||||
|
}
|
||||||
|
});
|
||||||
|
mbStore.setLxsrList([]);
|
||||||
|
}
|
||||||
|
getSysList()
|
||||||
|
|
||||||
|
const userList = ref([]);
|
||||||
|
onMounted(async () => {
|
||||||
|
const data = { status: 0, del_flag: 0, pageSize: 1000, pageNum: 1 }
|
||||||
|
listUser(data).then((res: any) => {
|
||||||
|
userList.value = res.rows;
|
||||||
|
});
|
||||||
|
// 加载病人来源字典
|
||||||
|
const dictRefs = await comDict('PT', 'AU', 'SX', 'DP', 'BT', 'SRD', 'HOS', 'ST');
|
||||||
|
// 从 ref 中获取实际数据
|
||||||
|
dictData.value = {
|
||||||
|
PT: toRaw(dictRefs.PT.value) || [],
|
||||||
|
AU: toRaw(dictRefs.AU.value) || [],
|
||||||
|
SX: toRaw(dictRefs.SX.value) || [],
|
||||||
|
DP: toRaw(dictRefs.DP.value) || [],
|
||||||
|
BT: toRaw(dictRefs.BT.value) || [],
|
||||||
|
SRD: toRaw(dictRefs.SRD.value) || [],
|
||||||
|
HOS: toRaw(dictRefs.HOS.value) || [],
|
||||||
|
ST: toRaw(dictRefs.ST.value) || [],
|
||||||
|
};
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped></style>
|
<style scoped lang="scss">
|
||||||
|
.app-container {
|
||||||
|
background: #F0F3F8;
|
||||||
|
}
|
||||||
|
|
||||||
|
.box-shadow {
|
||||||
|
box-shadow: 2px 2px 4px 0px rgba(206, 217, 234, 0.7);
|
||||||
|
border-radius: .75rem;
|
||||||
|
padding: .5rem;
|
||||||
|
background-color: #fff;
|
||||||
|
|
||||||
|
.flex-between {
|
||||||
|
margin-bottom: .5rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.right_box {
|
||||||
|
height: calc(90vh - 3.4rem);
|
||||||
|
}
|
||||||
|
|
||||||
|
.compact-form {
|
||||||
|
border-bottom: 1px solid #E1E9F7;
|
||||||
|
margin-bottom: 0.5rem;
|
||||||
|
|
||||||
|
.el-form-item--default {
|
||||||
|
margin-bottom: .3125rem !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-form-item--small {
|
||||||
|
margin-bottom: .3125rem !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-content {
|
||||||
|
max-height: 28.125rem;
|
||||||
|
/* 设置最大高度 */
|
||||||
|
overflow-y: auto;
|
||||||
|
/* 超出高度时显示垂直滚动条 */
|
||||||
|
padding: .3125rem;
|
||||||
|
/* 保持与卡片默认一致的内边距 */
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.button-group {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-around;
|
||||||
|
font-family: SourceHanSansCN, SourceHanSansCN;
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 1rem;
|
||||||
|
color: #28BDBB;
|
||||||
|
// margin-top: 20px;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.text2 {
|
||||||
|
color: #1F33FF;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text3 {
|
||||||
|
color: #FF0000;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
493
src/views/liswork/micro/labpat.vue
Normal file
493
src/views/liswork/micro/labpat.vue
Normal file
@ -0,0 +1,493 @@
|
|||||||
|
<template>
|
||||||
|
<div class="labpat_box">
|
||||||
|
<div class="flex-between mb5">
|
||||||
|
<el-input v-model="sqhValue" placeholder="条码号" ref="sqhRef" :size="aotuSize" class="mr10" style="width:100%"
|
||||||
|
@keyup.enter="handleInputFocus" />
|
||||||
|
<el-button type="primary" :size="aotuSize" @click="batchHandle">扫码</el-button>
|
||||||
|
</div>
|
||||||
|
<el-form :model="labPat" label-width="5rem" class="compact-form" label-position="right">
|
||||||
|
<div :class="['sh_box', getColor(lastJgbz)]" v-if="lastJgbz != null && lastJgbz != 0 && lastJgbz != 'C'">
|
||||||
|
<div class="text">{{ getLableType(lastJgbz) }}</div>
|
||||||
|
</div>
|
||||||
|
<template v-for="v in labSysList" :key="v.xh">
|
||||||
|
<el-row :gutter="10" v-if="v.mrts == '病人来源'">
|
||||||
|
<el-col :span="18">
|
||||||
|
<el-form-item :label="v.zdts" v-if="v.kj == '1'">
|
||||||
|
<SelectTable v-model:data="labPat[v.zdmc]" :fields="brlyFields" :dictType="v.dict" placeholder=""
|
||||||
|
label="label" value="value" objKey="value" :border="true" size="small"
|
||||||
|
@getDataValue="handleFieldChange" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-checkbox v-model="labPat.jzbz" true-value="1" class="check_box"> 急诊 </el-checkbox>
|
||||||
|
<!-- :disabled="v.kybj == '0'" -->
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-form-item :label="v.zdts" v-if="v.kj == '1' && !v.dict && v.mrts != '年龄'">
|
||||||
|
<el-input v-if="v.zdlb == '1'" v-model="labPat[v.zdmc]" @change="handleFieldChange" size="small" />
|
||||||
|
|
||||||
|
|
||||||
|
<el-date-picker v-if="v.zdlb == '3'" v-model="labPat[v.zdmc]" type="datetime" format="YYYY-MM-DD HH:mm:ss"
|
||||||
|
value-format="YYYY-MM-DD HH:mm:ss" @change="handleFieldChange" size="small" style="width: 100%;" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
|
||||||
|
<el-form-item :label="v.zdts" v-if="v.kj == '1' && v.mrts == '年龄'">
|
||||||
|
<el-col :span="14" v-if="v.mrts == '年龄'">
|
||||||
|
<el-input v-model="labPat[v.zdmc]" @change="handleFieldChange" style="width:100%" size="small" />
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="10">
|
||||||
|
<SelectTable v-model:data="labPat.nldw" :fields="ksdhFields" dictType="AU" label="label" value="value"
|
||||||
|
objKey="value" :border="true" size="small" @getDataValue="handleFieldChange" placeholder="" />
|
||||||
|
</el-col>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item :label="v.zdts"
|
||||||
|
v-if="v.dict && v.kj == '1' && v.mrts != '病人来源' && v.mrts != '年龄单位' && v.mrts != '检验医师' && v.mrts != '核对医师'">
|
||||||
|
<SelectTable v-model:data="labPat[v.zdmc]" :fields="ksdhFields" :dictType="v.dict" label="label" value="value"
|
||||||
|
objKey="value" :border="true" size="small" @getDataValue="handleFieldChange" placeholder="" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item :label="v.zdts" v-if="v.mrts == '检验医师' && v.kj == '1'">
|
||||||
|
<SelectTable v-model:data="labPat[v.zdmc]" :fields="ysFields" :tableData="userList || []" label="nickName"
|
||||||
|
value="userName" objKey="userName" :border="true" size="small" @getDataValue="getJyysData" placeholder="" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item :label="v.zdts" v-if="v.mrts == '核对医师' && v.kj == '1'">
|
||||||
|
<SelectTable v-model:data="labPat[v.zdmc]" :fields="ysFields" :tableData="userList || []" label="nickName"
|
||||||
|
value="userName" objKey="userName" :border="true" size="small" @getDataValue="getHdysData" placeholder="" />
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- 医生校验 -->
|
||||||
|
<YhVerification ref="formRef" :form-value="form" :labPatKey="labPatKey" @confirm="handleConfirm"
|
||||||
|
@cancel="handleCancel" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { ref, reactive, watch, toRaw, computed, onMounted, nextTick } from 'vue';
|
||||||
|
import { changepatcolumn, updateLabPat, checkYsUser } from "@/api/liswork/work/LisWork";
|
||||||
|
import SelectTable from '@/components/SelectTable/index.vue';
|
||||||
|
import YhVerification from '../work/components/yhVerification.vue';
|
||||||
|
|
||||||
|
import emitter from '@/utils/mitt';
|
||||||
|
import { classCom } from '@/utils/classCom';
|
||||||
|
const aotuSize = classCom.useAutoSize();
|
||||||
|
|
||||||
|
|
||||||
|
interface LabSysItem {
|
||||||
|
kj: string;
|
||||||
|
dict: string;
|
||||||
|
kybj: string;
|
||||||
|
zdlb: string;
|
||||||
|
zdmc: string;
|
||||||
|
zdts: string;
|
||||||
|
xh: number;
|
||||||
|
mrts: string;
|
||||||
|
}
|
||||||
|
const props = defineProps({
|
||||||
|
labSysList: {
|
||||||
|
type: Array as PropType<LabSysItem[]>,
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
labPat: {
|
||||||
|
type: Object,
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
//结果主键
|
||||||
|
labPatKey: {
|
||||||
|
type: Object,
|
||||||
|
default: () => { }
|
||||||
|
},
|
||||||
|
userList: {
|
||||||
|
type: Array as PropType<object[]>,
|
||||||
|
default: () => []
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
const lastJgbz = ref();
|
||||||
|
const sqhValue = ref(''); // 条码号
|
||||||
|
const sqhRef = ref();
|
||||||
|
watch(() => props.labPat, (newVal) => {
|
||||||
|
// console.log('newVal==>', newVal);
|
||||||
|
lastValue.value = JSON.stringify(newVal);
|
||||||
|
lastJgbz.value = newVal?.jgbz;
|
||||||
|
sqhValue.value = '';
|
||||||
|
})
|
||||||
|
|
||||||
|
const emit = defineEmits(['update:labPat', 'changeStatus', 'batchShow']);
|
||||||
|
const lastValue = ref('');
|
||||||
|
|
||||||
|
const brlyFields = ref([
|
||||||
|
{ prop: 'value', label: '代号', width: 80, enablePinyinSearch: true },
|
||||||
|
{ prop: 'label', label: '名称', width: 120, enablePinyinSearch: true },
|
||||||
|
])
|
||||||
|
|
||||||
|
const ksdhFields = ref([
|
||||||
|
{ prop: 'value', label: '代号', width: 80, enablePinyinSearch: true },
|
||||||
|
{ prop: 'label', label: '名称', width: 150, enablePinyinSearch: true },
|
||||||
|
])
|
||||||
|
const ysFields = ref([
|
||||||
|
{ prop: 'userName', label: '用户代号', width: 80, enablePinyinSearch: true },
|
||||||
|
{ prop: 'nickName', label: '用户姓名', width: 150, enablePinyinSearch: true },
|
||||||
|
])
|
||||||
|
|
||||||
|
const form = ref({
|
||||||
|
yhdh: '',
|
||||||
|
userName: '',
|
||||||
|
mm: '',
|
||||||
|
type: 1,
|
||||||
|
zdmc: '',
|
||||||
|
ybh1: '',
|
||||||
|
ybh2: '',
|
||||||
|
});
|
||||||
|
|
||||||
|
const sqhFlag = ref(false);
|
||||||
|
const handleInputFocus = () => {
|
||||||
|
sqhFlag.value = true;
|
||||||
|
props.labPat.sqh = sqhValue.value;
|
||||||
|
handleFieldChange();
|
||||||
|
};
|
||||||
|
|
||||||
|
// 表单引用
|
||||||
|
const formRef = ref();
|
||||||
|
|
||||||
|
// 批量扫码
|
||||||
|
const batchHandle = () => {
|
||||||
|
emit('batchShow')
|
||||||
|
};
|
||||||
|
// 处理确定按钮点击
|
||||||
|
const handleConfirm = async () => {
|
||||||
|
form.value.mm = ''
|
||||||
|
handleFieldChange()
|
||||||
|
};
|
||||||
|
|
||||||
|
// 处理取消按钮点击
|
||||||
|
const handleCancel = () => {
|
||||||
|
if (form.value.zdmc = 'yhdh') {
|
||||||
|
props.labPat.yhdh = JSON.parse(lastValue.value).yhdh
|
||||||
|
}
|
||||||
|
if (form.value.zdmc = 'hdys') {
|
||||||
|
props.labPat.hdys = JSON.parse(lastValue.value).hdys
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
// 医生校验
|
||||||
|
const getJyysData = (data: any) => {
|
||||||
|
if (data.userName == JSON.parse(lastValue.value).yhdh) return
|
||||||
|
form.value.yhdh = data.userName;
|
||||||
|
form.value.userName = data.nickName;
|
||||||
|
form.value.zdmc = 'yhdh';
|
||||||
|
nextTick(() => {
|
||||||
|
formRef.value?.open()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
const getHdysData = (data: any) => {
|
||||||
|
if (data.userName == JSON.parse(lastValue.value).hdys) return
|
||||||
|
form.value.yhdh = data.userName;
|
||||||
|
form.value.userName = data.nickName;
|
||||||
|
form.value.zdmc = 'hdys';
|
||||||
|
nextTick(() => {
|
||||||
|
formRef.value?.open()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通用字段变化处理(失焦、回车触发)
|
||||||
|
*/
|
||||||
|
const handleFieldChange = async () => {
|
||||||
|
// 将当前labPat转为字符串用于比较
|
||||||
|
const currentValue = JSON.stringify(props.labPat);
|
||||||
|
// 对比与上一次保存的值是否有变化
|
||||||
|
if (currentValue !== lastValue.value) {
|
||||||
|
emitter.emit('saveLab');
|
||||||
|
// 找出变化的字段
|
||||||
|
const oldObj = JSON.parse(lastValue.value);
|
||||||
|
const newObj = props.labPat;
|
||||||
|
const changedField = getChangedField(oldObj, newObj);
|
||||||
|
if (changedField) {
|
||||||
|
// 这里可以添加实际的更新逻辑,比如调用接口
|
||||||
|
try {
|
||||||
|
saveLabPat(changedField)
|
||||||
|
} catch (error) {
|
||||||
|
console.error('更新失败:', error);
|
||||||
|
// 失败时可以恢复旧值
|
||||||
|
emit('update:labPat', oldObj);
|
||||||
|
lastValue.value = JSON.stringify(oldObj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 保存病人信息
|
||||||
|
const saveLabPat = async (changedField: any) => {
|
||||||
|
if (props.labPat.id) {
|
||||||
|
updateLabPat({ ...props.labPatKey, ...props.labPat }).then((res: any) => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
if (sqhFlag.value) {
|
||||||
|
sqhValue.value = ''
|
||||||
|
sqhRef.value.focus()
|
||||||
|
}
|
||||||
|
|
||||||
|
if (res.data) {
|
||||||
|
emit('update:labPat', res.data)
|
||||||
|
emit("changeStatus", res.data, sqhFlag.value);
|
||||||
|
} else {
|
||||||
|
emit("changeStatus", props.labPat, sqhFlag.value);
|
||||||
|
}
|
||||||
|
sqhFlag.value = false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
if (!changedField) return
|
||||||
|
changepatcolumn({ ...props.labPatKey, column: changedField?.field, value: changedField?.newValue }).then((res: any) => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
if (sqhFlag.value) {
|
||||||
|
sqhValue.value = ''
|
||||||
|
sqhRef.value.focus()
|
||||||
|
}
|
||||||
|
|
||||||
|
if (res.data) {
|
||||||
|
emit('update:labPat', res.data)
|
||||||
|
emit("changeStatus", props.labPat, sqhFlag.value);
|
||||||
|
} else {
|
||||||
|
emit("changeStatus", props.labPat, sqhFlag.value);
|
||||||
|
}
|
||||||
|
|
||||||
|
sqhFlag.value = false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
// 完善字段变化检测方法
|
||||||
|
const getChangedField = (oldObj: { [key: string]: any }, newObj: { [key: string]: any }) => {
|
||||||
|
const oldKeys = Object.keys(oldObj);
|
||||||
|
for (const key of oldKeys) {
|
||||||
|
const oldVal = oldObj[key];
|
||||||
|
const newVal = newObj[key];
|
||||||
|
|
||||||
|
if (oldVal instanceof Date && newVal instanceof Date) {
|
||||||
|
if (oldVal.getTime() !== newVal.getTime()) {
|
||||||
|
return { field: key, oldValue: oldVal, newValue: newVal };
|
||||||
|
}
|
||||||
|
} else if (oldVal !== newVal) {
|
||||||
|
return { field: key, oldValue: oldVal, newValue: newVal };
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const newKeys = Object.keys(newObj);
|
||||||
|
for (const key of newKeys) {
|
||||||
|
if (!(key in oldObj)) {
|
||||||
|
return { field: key, oldValue: undefined, newValue: newObj[key] };
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
const getLableType = (type: string) => {
|
||||||
|
switch (type) {
|
||||||
|
case '1':
|
||||||
|
return '初审';
|
||||||
|
case '2':
|
||||||
|
return '已审核';
|
||||||
|
case '3':
|
||||||
|
return '初报';
|
||||||
|
case '4':
|
||||||
|
return '二报';
|
||||||
|
case '5':
|
||||||
|
return '已锁定';
|
||||||
|
default:
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const getColor = (type: string) => {
|
||||||
|
switch (type) {
|
||||||
|
case '1':
|
||||||
|
return 'cs_color';
|
||||||
|
case '2':
|
||||||
|
return 'sh_color';
|
||||||
|
case '3':
|
||||||
|
return 'cb_color';
|
||||||
|
case '4':
|
||||||
|
return 'eb_color';
|
||||||
|
case '5':
|
||||||
|
return 'sd_color';
|
||||||
|
default:
|
||||||
|
return 'default';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
onMounted(() => {
|
||||||
|
// 监听保存病人结果
|
||||||
|
emitter.on('saveResult', () => {
|
||||||
|
saveLabPat(null)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.labpat_box {
|
||||||
|
height: calc(90vh - 4.375rem);
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
.check_box {
|
||||||
|
:deep(.el-checkbox__input.is-checked+.el-checkbox__label) {
|
||||||
|
color: #f00 !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.el-input__wrapper) {
|
||||||
|
box-shadow: 0 0 0 1px #96B8D9 inset;
|
||||||
|
background-color: rgba(236, 244, 251, 0.5);
|
||||||
|
color: #08355E;
|
||||||
|
|
||||||
|
|
||||||
|
.is-focus {
|
||||||
|
box-shadow: 0 0 0 1px #1f6dd3 inset !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
box-shadow: 0 0 0 1px #1f6dd3 inset !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
// .el-input__placeholder {
|
||||||
|
// color: none !important;
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.el-select__wrapper) {
|
||||||
|
box-shadow: 0 0 0 1px #96B8D9 inset;
|
||||||
|
background-color: rgba(236, 244, 251, 0.5);
|
||||||
|
color: #08355E;
|
||||||
|
|
||||||
|
|
||||||
|
.is-focus {
|
||||||
|
box-shadow: 0 0 0 1px #1f6dd3 inset !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
box-shadow: 0 0 0 1px #1f6dd3 inset !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-select__placeholder {
|
||||||
|
color: #08355E !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.el-input__inner) {
|
||||||
|
color: #08355E !important;
|
||||||
|
-webkit-text-fill-color: #08355E;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
:deep(.el-select__input) {
|
||||||
|
color: #08355E !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.compact-form {
|
||||||
|
flex: 1;
|
||||||
|
position: relative;
|
||||||
|
height: 100%;
|
||||||
|
overflow-y: auto;
|
||||||
|
overflow-x: hidden;
|
||||||
|
|
||||||
|
|
||||||
|
.el-form-item {
|
||||||
|
margin-bottom: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-form-item__label {
|
||||||
|
padding-bottom: 0px;
|
||||||
|
color: #08355E;
|
||||||
|
font-size: 12px;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.el-form-item--default .el-form-item__label) {
|
||||||
|
height: 27px !important;
|
||||||
|
line-height: 27px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.el-form-item--default .el-form-item__content) {
|
||||||
|
line-height: 27px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
// pointer-events: none;
|
||||||
|
|
||||||
|
:deep(.el-radio__label) {
|
||||||
|
color: #08355E;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
:deep(.el-switch__label) {
|
||||||
|
color: #08355E;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.sh_box {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
background: rgba(0, 0, 0, 0);
|
||||||
|
z-index: 9;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
writing-mode: vertical-rl;
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 100px;
|
||||||
|
|
||||||
|
.text {
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
|
// pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cs_color {
|
||||||
|
color: rgba(40, 189, 187, 0.25);
|
||||||
|
}
|
||||||
|
|
||||||
|
.sh_color {
|
||||||
|
color: rgba(238, 8, 8, 0.25);
|
||||||
|
}
|
||||||
|
|
||||||
|
.cb_color {
|
||||||
|
color: rgba(255, 165, 0, 0.25);
|
||||||
|
}
|
||||||
|
|
||||||
|
.eb_color {
|
||||||
|
color: rgba(0, 128, 0, 0.25);
|
||||||
|
}
|
||||||
|
|
||||||
|
.sd_color {
|
||||||
|
color: rgb(233, 126, 32, .25);
|
||||||
|
}
|
||||||
|
|
||||||
|
.default {
|
||||||
|
color: rgba(40, 189, 187, 0.25);
|
||||||
|
}
|
||||||
|
</style>
|
||||||
263
src/views/liswork/micro/labpatlist.vue
Normal file
263
src/views/liswork/micro/labpatlist.vue
Normal file
@ -0,0 +1,263 @@
|
|||||||
|
<template>
|
||||||
|
<div class="table-container">
|
||||||
|
<ContextMenu :items="contextMenuItems" @select="handleMenuSelect" menu-width="200">
|
||||||
|
<CommonTable :table-data="labPatList" :loading="loading" :columns="tableColumns" :dict-data="dictData"
|
||||||
|
:row-config="{ isHover: true, keyField: 'ybh' }" @current-change="handleRowClick" size="small"
|
||||||
|
:row-style="rowStyle" :cell-style="cellStyle" class="mytable-style" ref="tableRef" :enable-column-drag="true"
|
||||||
|
@column-drag-end="handleColumnDragEnd">
|
||||||
|
<!-- 完成状态列 -->
|
||||||
|
<template #finish="{ row }">
|
||||||
|
<el-checkbox :model-value="row.finish == '1'" readonly />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<template #alarmflag="{ row }">
|
||||||
|
<el-checkbox :model-value="row.alarmflag == '1'" readonly />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<template #jgbz="{ row }">
|
||||||
|
{{ getLableType(row.jgbz) }}
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<template #brly="{ row }">
|
||||||
|
{{ formatDict(row.brly, 'PT') }}
|
||||||
|
</template>
|
||||||
|
<template #brxm="{ row }">
|
||||||
|
<span :style="{ color: row.jzbz == '1' ? '#f00' : '' }">{{ row.brxm }}</span>
|
||||||
|
</template>
|
||||||
|
<template #brxb="{ row }">
|
||||||
|
{{ formatDict(row.brxb, 'SX') }}
|
||||||
|
</template>
|
||||||
|
<template #nldw="{ row }">
|
||||||
|
{{ formatDict(row.nldw, 'AU') }}
|
||||||
|
</template>
|
||||||
|
<template #yblx="{ row }">
|
||||||
|
{{ formatDict(row.yblx, 'BT') }}
|
||||||
|
</template>
|
||||||
|
<template #ksdh="{ row }">
|
||||||
|
{{ formatDict(row.ksdh, 'DP') }}
|
||||||
|
</template>
|
||||||
|
<template #yhdh="{ row }">
|
||||||
|
{{ formatDict(row.yhdh, 'SRD') }}
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<template #autojgbz="{ row }">
|
||||||
|
<el-checkbox :model-value="row.autojgbz === '1'" readonly />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<template #dybz="{ row }">
|
||||||
|
<el-checkbox :model-value="row.dybz === '1'" readonly />
|
||||||
|
</template>
|
||||||
|
<template #yljg="{ row }">
|
||||||
|
{{ formatDict(row.yljg, 'HOS') }}
|
||||||
|
</template>
|
||||||
|
</CommonTable>
|
||||||
|
</ContextMenu>
|
||||||
|
|
||||||
|
|
||||||
|
<el-dialog v-model="show" title="操作" width="300" :close-on-click-modal="false" :draggable="true"
|
||||||
|
@close="closeHandle">
|
||||||
|
<div class="form-box">
|
||||||
|
<div class="item">
|
||||||
|
<span>仪器:</span>
|
||||||
|
<yqSelectTable v-model:data="fcYq" :instrGroup="tableKey.instrGroup" />
|
||||||
|
</div>
|
||||||
|
<div class="mt10">请输入复查的样本号:</div>
|
||||||
|
<el-input v-model="fcYbh" @keyup.enter="subHandle()" />
|
||||||
|
</div>
|
||||||
|
<div class="mt10" style="text-align: center; width: 100%;">
|
||||||
|
<el-button type="primary" @click="subHandle()"> 确认 </el-button>
|
||||||
|
<el-button @click="closeHandle">取消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { ref, nextTick, onMounted, watch } from 'vue'
|
||||||
|
import CommonTable from '@/components/vxeTable/index.vue'
|
||||||
|
import ContextMenu from "@/components/contextMenu/index.vue";
|
||||||
|
import { ContextMenuItem } from '@/types/index'
|
||||||
|
import yqSelectTable from '@/components/SelectTable/YQSelectTable/index.vue';
|
||||||
|
import { setredoSample } from '@/api/liswork/work/LisWork'
|
||||||
|
import { ElMessage } from 'element-plus';
|
||||||
|
const props = defineProps({
|
||||||
|
labPatList: {
|
||||||
|
type: Array,
|
||||||
|
default: () => []
|
||||||
|
},
|
||||||
|
loading: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
|
},
|
||||||
|
dictData: {
|
||||||
|
type: Object,
|
||||||
|
default: () => ({})
|
||||||
|
},
|
||||||
|
tableKey: {
|
||||||
|
type: Object,
|
||||||
|
default: () => { }
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const emits = defineEmits(['select'])
|
||||||
|
const show = ref(false)
|
||||||
|
|
||||||
|
const fcYbh = ref('')
|
||||||
|
const fcYq = ref('')
|
||||||
|
|
||||||
|
const subHandle = () => {
|
||||||
|
if (!fcYbh.value.trim()) return ElMessage.warning('请输入复查的样本号')
|
||||||
|
const data = {
|
||||||
|
newybh: fcYbh.value,
|
||||||
|
newyq: fcYq.value,
|
||||||
|
...props.tableKey
|
||||||
|
}
|
||||||
|
setredoSample(data).then((res: any) => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
ElMessage.success('操作成功')
|
||||||
|
closeHandle()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
const closeHandle = () => {
|
||||||
|
fcYbh.value = ''
|
||||||
|
show.value = false
|
||||||
|
}
|
||||||
|
|
||||||
|
const contextMenuItems = computed<ContextMenuItem[]>(() => [
|
||||||
|
{ label: '本标本结果作其复查结果', action: 'view' }
|
||||||
|
]);
|
||||||
|
const handleMenuSelect = ((item: ContextMenuItem) => {
|
||||||
|
show.value = true
|
||||||
|
fcYq.value = props.tableKey.yq
|
||||||
|
})
|
||||||
|
// 表格列配置
|
||||||
|
const tableColumns = ref([
|
||||||
|
{ field: 'jyrq', title: '录入时间', width: 80, align: 'center', resizable: true },
|
||||||
|
{ field: 'finish', title: '敏', width: 30, align: 'center', slotName: 'finish', resizable: true },
|
||||||
|
{ field: 'alarmflag', title: '警', width: 30, align: 'center', slotName: 'alarmflag', resizable: true },
|
||||||
|
{ field: 'cp_pyzq', title: '培养周期', width: 60, align: 'center', resizable: true },
|
||||||
|
{ field: 'jgbz', title: '状态', width: 50, align: 'center', resizable: true, slotName: 'jgbz' },
|
||||||
|
{ field: 'ybh', title: '样本号', width: 100, align: 'center', resizable: true },
|
||||||
|
{ field: 'brxm', title: '姓名', width: 40, align: 'center', resizable: true, slotName: 'brxm' },
|
||||||
|
{ field: 'brdh', title: '病历号', width: 80, align: 'center', resizable: true },
|
||||||
|
{ field: 'ch', title: '床号', width: 40, align: 'center', resizable: true },
|
||||||
|
{ field: 'brxb', title: '性别', width: 40, align: 'center', slotName: 'brxb', resizable: true },
|
||||||
|
{ field: 'nl', title: '年', width: 30, align: 'center', resizable: true },
|
||||||
|
{ field: 'nldw', title: '龄', width: 20, align: 'center', slotName: 'nldw', resizable: true },
|
||||||
|
{ field: 'ksdh', title: '科室', width: 80, align: 'center', slotName: 'ksdh', resizable: true },
|
||||||
|
{ field: 'yblx', title: '标本', width: 50, align: 'center', resizable: true, slotName: 'yblx' },
|
||||||
|
{ field: 'sqh', title: '申请号/条码', width: 100, align: 'center', resizable: true, },
|
||||||
|
{ field: 'jymd', title: '检验目的', width: 120, align: 'center', resizable: true },
|
||||||
|
{ field: 'yhdh', title: '检验医生', width: 60, align: 'center', resizable: true, slotName: 'yhdh' },
|
||||||
|
{ field: 'brly', title: '类型', width: 50, align: 'center', slotName: 'brly', resizable: true },
|
||||||
|
{ field: 'dybz', title: '印', width: 30, align: 'center', slotName: 'dybz', resizable: true },
|
||||||
|
{ field: 'shcs', title: '次数', width: 40, align: 'center', resizable: true },
|
||||||
|
])
|
||||||
|
|
||||||
|
const getLableType = (type: string) => {
|
||||||
|
switch (type) {
|
||||||
|
case '0':
|
||||||
|
return '';
|
||||||
|
case '1':
|
||||||
|
return '初审';
|
||||||
|
case '2':
|
||||||
|
return '终报';
|
||||||
|
case '3':
|
||||||
|
return '初报';
|
||||||
|
case '4':
|
||||||
|
return '二报';
|
||||||
|
case '5':
|
||||||
|
return '已锁定';
|
||||||
|
default:
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 更新列配置
|
||||||
|
const handleColumnDragEnd = (data: any) => {
|
||||||
|
// 先清空再赋值,强制触发重新渲染
|
||||||
|
tableColumns.value = [];
|
||||||
|
// 使用nextTick确保DOM更新后再设置新值
|
||||||
|
nextTick(() => {
|
||||||
|
tableColumns.value = [...data.columns];
|
||||||
|
});
|
||||||
|
}
|
||||||
|
const handleRowClick = (row: any) => {
|
||||||
|
emits('select', row)
|
||||||
|
}
|
||||||
|
|
||||||
|
const tableRef = ref()
|
||||||
|
|
||||||
|
const setCurrentRow = (row: any) => {
|
||||||
|
tableRef.value.setCurrentRow(row)
|
||||||
|
}
|
||||||
|
const clearCurrentRow = () => {
|
||||||
|
tableRef.value.clearCurrentRow()
|
||||||
|
}
|
||||||
|
|
||||||
|
const cellStyle = ({ row, column }: any) => {
|
||||||
|
if (column.title == "警" && row.alarmflag == 1) {
|
||||||
|
return { background: '#f00 !important' };
|
||||||
|
}
|
||||||
|
|
||||||
|
if (column.title == "类型" && row.brly == '1') { //门诊
|
||||||
|
return { background: '#e9e930 !important' };
|
||||||
|
}
|
||||||
|
if (column.title == "类型" && row.brly == '3') { // 住院
|
||||||
|
return { background: '#8bdaf1 !important' };
|
||||||
|
}
|
||||||
|
if (column.title == "类型" && row.brly == '4') { //体检
|
||||||
|
return { background: '#9ae382 !important' };
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const rowStyle = ({ row }: any) => {
|
||||||
|
if (row.dybz == '1') {
|
||||||
|
return { background: '#C0C0C0 !important' };
|
||||||
|
}
|
||||||
|
if (row.lstd == '1') {
|
||||||
|
return { background: '#ed4ced !important' };
|
||||||
|
}
|
||||||
|
if (row.jgbz == '2') {
|
||||||
|
return { background: '#C0FFC0 !important' };
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 引入公共组件的字典格式化方法
|
||||||
|
const formatDict = (v: string, dictType: string) => {
|
||||||
|
return props.dictData[dictType]?.find((item: any) => item.value == v)?.label || v;
|
||||||
|
}
|
||||||
|
onMounted(() => {
|
||||||
|
const row = props.labPatList.find((item: any) => item.ybh == props.tableKey.ybh)
|
||||||
|
if (!row) return
|
||||||
|
setTimeout(() => { setCurrentRow(row) }, 100)
|
||||||
|
})
|
||||||
|
// 暴露公共方法
|
||||||
|
defineExpose({
|
||||||
|
setCurrentRow,
|
||||||
|
clearCurrentRow,
|
||||||
|
tableRef,
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.table-container {
|
||||||
|
height: 76vh;
|
||||||
|
|
||||||
|
.form-box {
|
||||||
|
font-family: SourceHanSansCN, SourceHanSansCN;
|
||||||
|
|
||||||
|
.item {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
span {
|
||||||
|
display: inline-block;
|
||||||
|
width: 3.75rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@ -194,9 +194,7 @@ defineExpose({
|
|||||||
});
|
});
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
for (let index = 0; index < 100; index++) {
|
|
||||||
tableData.value.push({ ybh: index, sqh: '321421321', brxm: '李是大', brdh: '4332132', jymd: '高蛋白大 大的 ' },);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@ -149,7 +149,7 @@ const queryParams = ref({
|
|||||||
ybh: '1',
|
ybh: '1',
|
||||||
instrGroup: '02',
|
instrGroup: '02',
|
||||||
problemId: 0,
|
problemId: 0,
|
||||||
days: 1,
|
days: 0,
|
||||||
})
|
})
|
||||||
const ybs = ref(0)
|
const ybs = ref(0)
|
||||||
const ws = ref(0)
|
const ws = ref(0)
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="bg">
|
<div class="bg">
|
||||||
<div class="title">智能大屏数据中心</div>
|
<div class="title">区域检验数据中心</div>
|
||||||
<div class="leftMain">
|
<div class="leftMain">
|
||||||
<div class="leftMain_top">
|
<div class="leftMain_top">
|
||||||
<div class="leftMain_topIn">
|
<div class="leftMain_topIn">
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user