This commit is contained in:
wyuu 2025-11-25 18:05:18 +08:00
parent 47017d791d
commit 57e11ad63c
8 changed files with 464 additions and 139 deletions

View File

@ -124,3 +124,11 @@ export function deletemedresult(data?: Object) {
data
})
}
//获取培养基记录
export function getmediumList(data?: Object) {
return request({
url: '/lisworkgerm/getmedium',
method: 'get',
params: data
})
}

View File

@ -106,13 +106,63 @@
.el-dialog:not(.is-fullscreen) {
margin-top: 6vh !important;
padding: 0;
// border-radius: 20px;
.el-dialog__body {
padding: 10px;
}
}
.el-dialog.scrollbar .el-dialog__body {
overflow: auto;
overflow-x: hidden;
max-height: 70vh;
padding: 10px 20px 0;
padding: 16px;
}
.el-dialog__header {
background: linear-gradient(90deg, #0c1a97 0%, #1373d3 100%);
padding: 10px 20px;
position: relative;
font-family: SourceHanSansCN, SourceHanSansCN;
&::before {
content: '';
position: absolute;
left: 20px;
top: 50%;
transform: translateY(-50%);
width: 28px;
height: 28px;
background: url('@/assets/logo/logo.png') no-repeat center;
background-size: contain;
z-index: 1;
}
// 标题文本样式
.el-dialog__title {
color: #fff;
/* 标题文字颜色 */
padding-left: 40px;
/* 给 Logo 留出空间 */
font-size: 16px;
font-weight: 600;
}
.el-dialog__headerbtn .el-dialog__close {
color: #fff;
/* 关闭按钮颜色 */
font-size: 18px;
&:hover {
color: #fff;
}
}
}
.el-dialog__footer {
padding: 10px;
}
.el-table {
@ -125,7 +175,7 @@
word-break: break-word;
background-color: #1F6DD3 !important;
color: #FFF;
height: 1.875rem !important;
height: 1.6875rem !important;
font-size: .8125rem;
}
}
@ -136,6 +186,11 @@
}
}
.el-table__body td {
font-size: .8125rem;
}
/* 表格最外层边框(可选) */
.el-table--border {
@ -177,9 +232,12 @@
padding: 0 !important;
}
.el-table--default .cell {
.el-table--default {
.cell {
padding: 0 !important;
}
}
.el-table__cell {
padding: 0 !important;
@ -249,7 +307,7 @@
}
.el-input.is-disabled .el-input__inner {
-webkit-text-fill-color: #4e4c4c
-webkit-text-fill-color: #4e4c4c;
}

View File

@ -41,7 +41,7 @@ export function useFingerprint() {
// 组件挂载时自动获取指纹
onMounted(() => {
getFingerprint();
// getFingerprint();
});
return {

View File

@ -41,7 +41,7 @@ const columns = ref([
// 左侧表格配置
const tableConfig = ref({
border: true, // 边框
height: '', // 高度
height: '82vh', // 高度
highlightCurrentRow: true, // 高亮当前行
})
const getCombination = () => {

View File

@ -56,12 +56,11 @@
@previewHandle="previewHandle" />
</el-tab-pane>
<el-tab-pane label="初级和二级报告" name="second">
<CbReport v-model:labPat="labInfo" :labPatKey="queryParams" :dictData="dictData"
:labResutsData="zbLabResuts" @fetchLabResults="resultsHandle" @changeStatus="changeStatus"
@previewHandle="previewHandle" />
<CbReport v-model:labPat="labInfo" :labPatKey="queryParams" :instrdComOpt="instrdComOpt"
:dictData="dictData" @changeStatus="changeStatus" @previewHandle="previewHandle" />
</el-tab-pane>
<el-tab-pane label="培养基接种" name="third">
<Byj />
<Byj :labPat="labInfo" :labPatKey="queryParams" />
</el-tab-pane>
<el-tab-pane label="操作记录" name="fourth">
<Record :labPat="labInfo" :labPatKey="queryParams" />
@ -195,7 +194,7 @@ const queryParams = ref({
})
const activeName = ref('first')
const activeName = ref('second');
const total = ref(0)
const ybs = ref(0)
@ -255,11 +254,6 @@ interface QueryParams {
watch(() => labPat.value, (newValue) => {
queryParams.value.ybh = newValue.ybh;
// if (newValue.jgbz == '2') {
// activeName.value = 'first'
// } else if (newValue.jgbz == '0' || newValue.jgbz == '3' || newValue.jgbz == '4') {
// activeName.value = 'second'
// }
}, { deep: true });
// 模糊查询
@ -279,8 +273,6 @@ const searchQuery = () => {
}
labPatList.value = filterMhList;
getTotals();
if (filterMhList.length > 0) {
highlightRowIndex.value = 0;
const firstRow = filterMhList[0];
@ -290,7 +282,6 @@ const searchQuery = () => {
labPat.value = {};
labInfo.value = {};
zbLabResuts.value = [];
cbLabResuts.value = [];
highlightRowIndex.value = -1;
}
};
@ -320,8 +311,6 @@ const handleQueryResult = (params: QueryParams) => {
labPatList.value = filteredList;
getTotals();
if (filteredList.length > 0) {
highlightRowIndex.value = 0;
const firstRow = filteredList[0];
@ -331,7 +320,6 @@ const handleQueryResult = (params: QueryParams) => {
labPat.value = {};
labInfo.value = {};
zbLabResuts.value = [];
cbLabResuts.value = [];
highlightRowIndex.value = -1;
}
};
@ -339,7 +327,6 @@ const handleQueryResult = (params: QueryParams) => {
// 处理重置
const handleReset = () => {
labPatList.value = [...originalLabPatList.value];
getTotals();
}
const previewHandle = (url: string) => {
if (!url) return ElMessage.warning('未查询到文件')
@ -348,14 +335,11 @@ const previewHandle = (url: string) => {
}
const handleinstrGroupChange = (val: any) => {
queryParams.value.yq = ''
// labResuts.value = []
// labPat.value = {}
getYqConfig()
}
const mbStore = useCommonStore();
const yqHandleChange = (val: any) => {
zbLabResuts.value = [];
cbLabResuts.value = [];
labPat.value = {}
labInfo.value = {}
mbStore.setLxsrList([]);
@ -414,19 +398,10 @@ const selectJob = (job: any) => {
highlightRowIndex.value = labPatList.value.findIndex((item: any) => item.ybh == labInfo.value.ybh);
}
const zbLabResuts = ref([])
const cbLabResuts = ref([])
//载入样本结果表单(中间labresult.vue组件)
const fetchLabResults = async () => {
sampleMedInfo({ jyrq: labInfo.value.jyrq ? labInfo.value.jyrq : queryParams.value.jyrq, yq: labInfo.value.yq, ybh: labInfo.value.ybh }).then((response: any) => {
zbLabResuts.value = response.data;
if (labPat.value.jgbz == '2') {
}
if (labPat.value.jgbz == '3') {
cbLabResuts.value = response.data;
}
console.log(' zbLabResuts.value==>', zbLabResuts.value);
console.log(' cbLabResuts.value==>', cbLabResuts.value);
})
}
@ -439,7 +414,6 @@ const fetchLabPat = () => {
}
queryLabPat(data).then((response: any) => {
labPat.value = response.data;
labInfo.value = response.data;
})
}
@ -487,7 +461,6 @@ const handleCreate = () => {
labInfo.value = response.data;
labPat.value.id = `temp_${Date.now()}_${Math.random().toString(36).substr(2, 8)}`;
zbLabResuts.value = [];
cbLabResuts.value = [];
labPatListRef.value?.clearCurrentRow();
fetchLabResults()
}
@ -518,7 +491,6 @@ const delSampleHd = () => {
if (res.code == 0) {
ElMessage.success('删除成功')
labPatList.value = labPatList.value.filter((item: any) => item.ybh != labInfo.value.ybh)
getTotals()
// 删除跳当前页面下一个样本
// handleNext()
if (highlightRowIndex.value > labPatList.value.length - 1) {
@ -636,7 +608,6 @@ const changeStatus = (updatedPat: any, flag: boolean) => {
labPatListRef.value.setCurrentRow(labPat.value);
});
}, 10)
getTotals()
}
}
});
@ -670,13 +641,8 @@ const fetchlabPatList = () => {
loading.value = false;
if (res.rows.length > 0) {
highlightRowIndex.value = 0;
setTimeout(() => { labPatListRef.value.setCurrentRow(res.rows[0]); }, 100)
setTimeout(() => { labPatListRef.value.setCurrentRow(res.rows[0]) }, 10)
selectJob(res.rows[0])
getTotals()
} else {
ybs.value = 0
ws.value = 0
wjs.value = 0
}
}
})
@ -708,12 +674,15 @@ interface DictData {
const dictData = ref<DictData>({});
const labInputcolList = ref([])
const resultConfig = ref([])
const instrdComOpt = 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
instrdComOpt.value = res.data.instrdComOpt
}
});
mbStore.setLxsrList([]);
@ -742,13 +711,13 @@ onMounted(async () => {
GMC: toRaw(dictRefs.GMC.value) || [],
};
// 初始化Socket
// initSocket()
initSocket()
});
const initSocket = () => {
initWebSocket({
// fullUrl: `ws://47.97.125.165:8904/ws/instr/${mbStore.fingerprint}`,
fullUrl: `ws://192.168.1.151:9801/ws/instr/${mbStore.fingerprint}`,
fullUrl: `ws://47.97.125.165:8904/ws/instr/${mbStore.fingerprint}`,
// fullUrl: `ws://192.168.1.151:9801/ws/instr/${mbStore.fingerprint}`,
onOpen: () => {
console.log('WebSocket连接成功');
},

View File

@ -1,10 +1,72 @@
<template>
<div>
培养基接种
<div class="mb5">
<el-button type="primary" plain size="small">打印培养基条码</el-button> &nbsp;
<el-checkbox v-model="checked">自动打印培养基条码</el-checkbox>
</div>
<CustomTable ref="tableRef" :data="tableData" :columns="columns" :config="tableConfig" :enable-column-drag="true"
@column-drag-end="handleColumnDragEnd">
</CustomTable>
</div>
</template>
<script setup lang="ts">
import CustomTable from '@/components/elTable/index.vue';
import { getmediumList } from '@/api/liswork/micro/index'
const props = defineProps({
labPat: {
type: Object,
required: true
},
//结果主键
labPatKey: {
type: Object,
default: () => { }
},
});
const { labPat, labPatKey } = toRefs(props);
const checked = ref(false);
const tableRef = ref();
const tableData = ref([]);
const columns = ref([
{ label: "培养基", prop: "zhxmdh", align: 'center', visible: true, headerSlot: 'xmdh', width: 100 },
{ label: "接种时间", prop: "zhxmdh", align: 'center', visible: true, width: 100 },
{ label: "培养基结果", prop: "zhxmdh", align: 'center', visible: true, width: 100 },
{ label: "转种类型", prop: "zhxmdh", align: 'center', visible: true, width: 100 },
{ label: "培养周期(小时)", prop: "zhxmdh", align: 'center', visible: true, width: 100 },
{ label: "观察间隔(小时)", prop: "zhxmdh", align: 'center', visible: true, width: 100 },
]);
const tableConfig = ref({
border: true,
height: '100%',
})
const handleColumnDragEnd = (data: any) => {
columns.value = data.columns;
}
const getbyjList = () => {
const data = {
jyrq: labPat.value.jyrq,
yq: labPat.value.yq,
ybh: labPat.value.ybh,
}
getmediumList(data).then((res: any) => {
if (res.code == 0) {
tableData.value = res.data
}
})
}
watch(() => props.labPat, (newValue) => {
if (newValue.jyrq && newValue.ybh && newValue.yq) {
getbyjList()
}
})
</script>

View File

@ -1,16 +1,22 @@
<template>
<div>
<div class="title"><span>初报人:</span>{{ labPat.confirmer }} &nbsp;&nbsp; <span>报告时间:</span>{{ labPat.confirmdt
}}&nbsp;&nbsp;</div>
<div class="title">
<div>
<el-button class="btn_green btns_box" :size="autoSize" v-if="labPat.jgbz != 2"
@click="handleCheck(1)">初报审核</el-button>
<el-button class="btns_box" :size="autoSize" v-if="labPat.jgbz == 2" @click="handleCheck(3)">取消审核</el-button>
<el-button class="btns_box" type="primary" :size="autoSize" plain
:disabled="labPat.jgbz != null && labPat.jgbz != 0" @click="openItemDictDialog">新增</el-button>
<el-button class="btns_box" type="danger" :size="autoSize" :disabled="labPat.jgbz != null && labPat.jgbz != 0"
plain @click="handleBatchDelete">删除</el-button>
<el-button class="btn_green btns_box" :size="autoSize" @click="zhHandel">组合项目</el-button>
<span>初报人:</span>{{ cbInfo?.confirmer }} &nbsp;&nbsp; <span>报告时间:</span>{{ cbInfo?.confirmdt }}&nbsp;&nbsp;
</div>
<div><span>{{ cbInfo?.jgbz == '2' ? '已初报' : '' }}</span></div>
</div>
<div>
<el-button class="btn_green btns_box" :size="autoSize" v-if="cbInfo?.jgbz != 2"
@click="handleCheck(1, 'cb')">初报审核</el-button>
<el-button class="btns_box" :size="autoSize" v-if="cbInfo?.jgbz == 2"
@click="handleCheck(2, 'cb')">取消审核</el-button>
<el-button class="btns_box" type="primary" :size="autoSize" plain :disabled="cbInfo?.jgbz == '2'"
@click="openItemDictDialog(1)">新增</el-button>
<el-button class="btns_box" type="danger" :size="autoSize" :disabled="cbInfo?.jgbz == '2'" plain
@click="handleBatchDelete(1)">删除</el-button>
<el-button class="btn_green btns_box" :size="autoSize" :disabled="cbInfo?.jgbz == '2'"
@click="zhHandel(1)">组合项目</el-button>
</div>
<CustomTable :data="tableData" :columns="columns" :config="tableConfig" :enable-column-drag="true"
@column-drag-end="handleColumnDragEnd">
@ -18,31 +24,31 @@
细菌/结果({{ tableData.length }})项
</template>
<template #od="{ row }">
<el-input v-model="row.od" v-if="labPat.jgbz == 0 || labPat.jgbz == null" size="small"
class="full-width-input foucs-input" @change="handleCsjgEnter(row)" />
<el-input v-model="row.od" v-if="cbInfo?.jgbz != '2'" size="small" class="full-width-input foucs-input"
@change="handleCsjgEnter(row, 1)" />
<span v-else>{{ row.od }}</span>
</template>
<template #csjg="{ row }">
<el-input v-model="row.csjg" v-if="labPat.jgbz == 0 || labPat.jgbz == null" size="small"
class="full-width-input" @change="handleCsjgEnter(row)" @dblclick="handleInputFocus(row)" />
<el-input v-model="row.csjg" v-if="cbInfo?.jgbz != '2'" size="small" class="full-width-input"
@change="handleCsjgEnter(row, 1)" @dblclick="handleInputFocus(row, 1)" />
<span v-else>{{ row.csjg }}</span>
</template>
<template #jgbz="{ row }">
<el-select v-model="row.jgbz" class="full-width-input" v-if="labPat.jgbz == 0 || labPat.jgbz == null"
placeholder="" @change="handleCsjgEnter(row)">
<el-select v-model="row.jgbz" class="full-width-input" v-if="cbInfo?.jgbz != '2'" placeholder=""
@change="handleCsjgEnter(row, 1)">
<el-option label="阳性" value="P" />
<el-option label="阴性" value="N" />
</el-select>
<span v-else> {{ formatJgbz(row.jgbz) }}</span>
</template>
<template #cutoff="{ row }">
<el-input v-model="row.cutoff" v-if="labPat.jgbz == 0 || labPat.jgbz == null" size="small"
class="full-width-input" @change="handleCsjgEnter(row)" />
<el-input v-model="row.cutoff" v-if="cbInfo?.jgbz != '2'" size="small" class="full-width-input"
@change="handleCsjgEnter(row, 1)" />
<span v-else>{{ row.cutoff }}</span>
</template>
<template #alarm_flag="{ row }">
<el-select v-model="row.alarm_flag" class="full-width-input" v-if="labPat.jgbz == 0 || labPat.jgbz == null"
placeholder="" @change="handleCsjgEnter(row)">
<el-select v-model="row.alarm_flag" class="full-width-input" v-if="cbInfo?.jgbz != '2'" placeholder=""
@change="handleCsjgEnter(row, 1)">
<el-option label="危急值" value="H" />
<el-option label="无" value="" />
</el-select>
@ -52,19 +58,94 @@
{{ formatDict(row.germclass, 'germclass') }}
</template>
</CustomTable>
<div class="title ertext">
<div>
<span>二报人:</span>{{ erInfo?.confirmer }} &nbsp;&nbsp; <span>报告时间:</span>{{ erInfo?.confirmdt }}&nbsp;&nbsp;
</div>
<div><span>{{ erInfo?.jgbz == '2' ? '已二报' : '' }}</span></div>
</div>
<div>
<el-button class="btn_green btns_box" :size="autoSize" v-if="erInfo?.jgbz != 2"
@click="handleCheck(1, 'erb')">二报审核</el-button>
<el-button class="btns_box" :size="autoSize" v-if="erInfo?.jgbz == 2"
@click="handleCheck(2, 'erb')">取消审核</el-button>
<el-button class="btns_box" type="primary" :size="autoSize" plain :disabled="erInfo?.jgbz == '2'"
@click="openItemDictDialog(2)">新增</el-button>
<el-button class="btns_box" type="danger" :size="autoSize" :disabled="erInfo?.jgbz == '2'" plain
@click="handleBatchDelete(2)">删除</el-button>
<el-button class="btn_green btns_box" :size="autoSize" :disabled="erInfo?.jgbz == '2'"
@click="zhHandel(2)">组合项目</el-button>
</div>
<CustomTable :data="tableData2" :columns="columns" :config="tableConfig" :enable-column-drag="true"
@column-drag-end="handleColumnDragEnd">
<template #xmdh="{ column }">
细菌/结果({{ tableData2.length }})项
</template>
<template #od="{ row }">
<el-input v-model="row.od" v-if="erInfo?.jgbz != '2'" size="small" class="full-width-input foucs-input"
@change="handleCsjgEnter(row, 2)" />
<span v-else>{{ row.od }}</span>
</template>
<template #csjg="{ row }">
<el-input v-model="row.csjg" v-if="erInfo?.jgbz != '2'" size="small" class="full-width-input"
@change="handleCsjgEnter(row, 2)" @dblclick="handleInputFocus(row, 2)" />
<span v-else>{{ row.csjg }}</span>
</template>
<template #jgbz="{ row }">
<el-select v-model="row.jgbz" class="full-width-input" v-if="erInfo?.jgbz != '2'" placeholder=""
@change="handleCsjgEnter(row, 2)">
<el-option label="阳性" value="P" />
<el-option label="阴性" value="N" />
</el-select>
<span v-else> {{ formatJgbz(row.jgbz) }}</span>
</template>
<template #cutoff="{ row }">
<el-input v-model="row.cutoff" v-if="erInfo?.jgbz != '2'" size="small" class="full-width-input"
@change="handleCsjgEnter(row, 2)" />
<span v-else>{{ row.cutoff }}</span>
</template>
<template #alarm_flag="{ row }">
<el-select v-model="row.alarm_flag" class="full-width-input" v-if="erInfo?.jgbz != '2'" placeholder=""
@change="handleCsjgEnter(row, 2)">
<el-option label="危急值" value="H" />
<el-option label="无" value="" />
</el-select>
<span v-else> {{ row.alarm_flag == 'H' ? '危急值' : '' }}</span>
</template>
<template #germclass="{ row }">
{{ formatDict(row.germclass, 'germclass') }}
</template>
</CustomTable>
<!-- 新增明细 -->
<ProjectDetails ref="itemDictRef" :dialog-title="'选择检验项目'" :tableKey="labPatKey" @select="handleItemSelect" />
<!-- 测试结果项目常用结果选择 -->
<projectsJg ref="csjgRef" :tableData='csjgTableData' :dialog-title="'项目常用结果选择'" @selectItem="selectItem"
label="qz" />
<!-- 组合项目 -->
<Combined ref="combinedRef" :queryParams="labPatKey" @dbMbHandle="combinedHandel" />
</div>
</template>
<script setup lang="ts">
import CustomTable from '@/components/elTable/index.vue'
import { LabResultItem, ymTableDataItem } from '@/types/index';
import { getresultmedList, savetestResult, changeresult, saveresult, newresult, getmeddictList, savemedresult, savemedresultall, deletemedresult } from '@/api/liswork/micro/index';
import { changeresult, saveresult, newresult, sampleMedInfo } from '@/api/liswork/micro/index';
import {
check1, check2, uncheck2, unconfirmlog, checkuser, reglimit, deleteresult, allPatquery, emrquery, datalink, changeLinkList,
viewBackup, queryXmVal, printListwork, getresultchangelog, setinputmdl, lockSample, unLockSample, clearnotComplete, clearPrintflag,
noiteMresult, queryXmInfo, setitemInter
noiteMresult, queryXmInfo, setitemInter, queryLabPat
} from "@/api/liswork/work/LisWork";
// @ts-ignore
import ProjectDetails from "@/components/projectDetails/index.vue";
import projectsJg from "@/components/projectsjg/index.vue";
// @ts-ignore
import Combined from "./components/combinedDialog.vue";
import emitter from '@/utils/mitt';
import { ElMessage } from 'element-plus';
import { useCommonStore } from "@/store/modules/commonStore";
@ -80,34 +161,84 @@ const props = defineProps({
type: Object,
default: () => { }
},
labResutsData: {
type: Array as PropType<LabResultItem[]>,
default: () => []
// 主键仪器参数
instrdComOpt: {
type: Object,
required: true
},
dictData: {
type: Object,
default: () => { }
}
})
const { labPat, labPatKey, labResutsData, dictData } = toRefs(props);
const { labPat, labPatKey, instrdComOpt } = toRefs(props);
const tableData = ref<LabResultItem[]>([])
const tableData2 = ref<LabResultItem[]>([])
const cbInfo = ref<any>({})
const erInfo = ref<any>({})
const mbStore = useCommonStore();
watch(labResutsData, (newVal: any) => {
if (newVal.length) {
tableData.value = newVal.map((item: any) => {
watch(labPat, (newVal: any) => {
//获取结果列表
getResultList()
// 获取病人信息
getLabPatInfo()
})
watch(() => tableData, (newValue) => {
// 模板数据
if (labPat.value.jgbz != null && labPat.value.jgbz != 0 && labPat.value.jgbz != 'C') return;
mbList(1)
})
watch(() => tableData2, (newValue) => {
// 模板数据
if (labPat.value.jgbz != null && labPat.value.jgbz != 0 && labPat.value.jgbz != 'C') return;
mbList(2)
})
const getLabPatInfo = () => {
queryLabPat({ jyrq: labPat.value.jyrq, yq: instrdComOpt.value.yq1, ybh: labPat.value.ybh, }).then((response: any) => {
cbInfo.value = response.data;
})
queryLabPat({ jyrq: labPat.value.jyrq, yq: instrdComOpt.value.yq2, ybh: labPat.value.ybh, }).then((response: any) => {
erInfo.value = response.data;
})
}
const getResultList = () => {
// 初级数据
sampleMedInfo({ jyrq: labPat.value.jyrq, yq: instrdComOpt.value.yq1, ybh: labPat.value.ybh, }).then((res: any) => {
if (res.code == 0) {
tableData.value = res.data.map((item: any) => {
return {
...item,
zhxmdh: item.xmdh + ' ' + item.xmmc,
}
})
console.log('tableData==>', tableData.value);
} else {
tableData.value = []
}
});
// 二级数据
sampleMedInfo({ jyrq: labPat.value.jyrq, yq: instrdComOpt.value.yq2, ybh: labPat.value.ybh, }).then((res: any) => {
if (res.code == 0) {
tableData2.value = res.data.map((item: any) => {
return {
...item,
zhxmdh: item.xmdh + ' ' + item.xmmc,
}
})
}
});
if (props.labPat.jgbz != null && props.labPat.jgbz != 0 && props.labPat.jgbz != 'C') return;
// console.log('mbStore==>', mbStore.lxsrs);
}
const mbList = (type: number) => {
const targetTable = type === 1 ? tableData.value : tableData2.value;
if (mbStore.lxsrs.length > 0) {
mbStore.lxsrs.forEach((mbmc) => {
const data = {
@ -116,10 +247,10 @@ watch(labResutsData, (newVal: any) => {
}
setinputmdl(data).then((res: any) => {
if (res.code == 0) {
const existingNames = new Set(tableData.value.map((item: any) => item.xmdh))
const existingNames = new Set(targetTable.map((item: any) => item.xmdh))
res.data?.forEach((item: any) => {
if (!existingNames.has(item.xmdh)) {
tableData.value.push({ ...item, jyrq: labPat.value.jyrq, zhxmdh: item.xmdh + ' ' + item.xmmc })
targetTable.push({ ...item, jyrq: labPat.value.jyrq, zhxmdh: item.xmdh + ' ' + item.xmmc })
existingNames.add(item.xmdh)
}
})
@ -128,7 +259,7 @@ watch(labResutsData, (newVal: any) => {
});
});
}
})
}
// 事件定义
@ -138,7 +269,6 @@ const emits = defineEmits([
'previewHandle'
]);
const tableData = ref<LabResultItem[]>([])
const columns = ref([
{ label: "细菌/结果", prop: "zhxmdh", align: 'center', visible: true, headerSlot: 'xmdh', width: 150 },
@ -193,9 +323,9 @@ const CellStyleHd = ({ row, column, rowIndex, columnIndex }: {
};
const tableConfig = ref({
height: '28vh',
height: '32vh',
border: true,
highlightCurrentRow: true,
// highlightCurrentRow: true,
cellStyle: CellStyleHd
});
@ -203,60 +333,93 @@ const handleColumnDragEnd = (data: any) => {
columns.value = data.columns;
}
const handleCheck = (checkType: number) => {
const shType = ref('') // 审核类型 cb初报 erb二报
const bgType = ref(1) // 报告类型 1初报 2二报
const handleCheck = (checkType: number, shtype: string) => {
shType.value = shtype
// yhdh = checkuserid.value
switch (checkType) {
case 1: // 初审
check1({ ...labPatKey.value, jyrq: labPat.value.jyrq, yhdh: props.labPat.yhdh }).then((res: any) => {
emits("changeStatus", props.labPat);
})
break;
case 2: // 审核
// case 1: // 初审
// check1({ ...labPatKey.value, jyrq: labPat.value.jyrq, yhdh: props.labPat.yhdh }).then((res: any) => {
// emits("changeStatus", props.labPat);
// })
// break;
case 1: // 审核
labPatKey.value.problemId = 0
// shHandleCheck()
shHandleCheck()
break;
case 3: // 取消审核
case 2: // 取消审核
labPatKey.value.problemId = 0
// unShHandle()
unShHandle()
break;
default:
break;
}
};
const openItemDictDialog = () => {
const unCheckshow = ref(false);
const reasonText = ref('');
const warningMsgdata = ref('');
const showuploadwarning = ref(false);
const shHandleCheck = () => {
check2({ ...labPatKey.value, jyrq: labPat.value.jyrq, yhdh: labPat.value.yhdh, yq: labPat.value.yq }).then((res: any) => {
if (res.code == "4" && res.problemId === 4) {
labPatKey.value.problemId = res.problemId;
warningMsgdata.value = res.msg;
showuploadwarning.value = true;
}
getLabPatInfo()
})
};
const handleBatchDelete = () => { }
const unShHandle = () => {
uncheck2({ ...labPatKey.value, jyrq: labPat.value.jyrq, yhdh: labPat.value.yhdh, yq: labPat.value.yq }).then((res: any) => {
if (res.code == "4") {
labPatKey.value.problemId = res.problemId;
reasonText.value = res.msg;
unCheckshow.value = true;
}
getLabPatInfo()
})
};
const handleBatchDelete = (type: number) => {
bgType.value = type
}
// 项目结果保存
const handleCsjgEnter = async (row: any) => {
const handleCsjgEnter = async (row: any, type: number) => {
bgType.value = type
const yq = type === 1 ? instrdComOpt.value.yq1 : instrdComOpt.value.yq2
const targetTable = type === 1 ? tableData.value : tableData2.value;
// 判断数据中包含模板新增的数据 flag
if (tableData.value.length == 0) return
const flag = tableData.value.some((item: any) => item.changeflag == 2)
if (targetTable.length == 0) return
const flag = targetTable.some((item: any) => item.changeflag == 2)
if (flag) {
saveresult(tableData.value).then((res: any) => {
saveresult(targetTable).then((res: any) => {
if (res.code == 0) {
emitter.emit('wswSaveResult');
getResultList()
}
})
} else {
if (!row) return
if (row && row.id) {
emitter.emit('wswSaveResult');
newresult({ ...row, ybh: labPat.value.ybh, jyrq: labPat.value.jyrq, yq: labPat.value.yq }).then((response: any) => {
newresult({ ...row, ybh: labPat.value.ybh, jyrq: labPat.value.jyrq, yq }).then((response: any) => {
ElMessage.success("结果保存成功");
emits('fetchLabResults');
getResultList()
}).catch((error: any) => {
emits('fetchLabResults');
getResultList()
});
} else {
changeresult(row).then((response: any) => {
ElMessage.success("结果保存成功");
emits('fetchLabResults');
getResultList()
}).catch((error: any) => {
emits('fetchLabResults');
getResultList()
});
}
@ -267,9 +430,60 @@ const handleCsjgEnter = async (row: any) => {
}
};
const itemDictRef = ref();
const openItemDictDialog = (type: number) => {
bgType.value = type
itemDictRef.value.openDictSelector();
};
const handleItemSelect = async (selectedItem: any) => {
const yq = bgType.value === 1 ? instrdComOpt.value.yq1 : instrdComOpt.value.yq2
const targetTable = bgType.value === 1 ? tableData.value : tableData2.value;
// 1. 构造新增行数据
const newRow = {
id: `temp_${Date.now()}_${Math.random().toString(36).substr(2, 8)}`,
xmdh: selectedItem.value,
xmmc: selectedItem.label,
dw: selectedItem.dw || "",
refs: selectedItem.refs || "",
jyrq: labPatKey.value.jyrq,
yq: yq,
ybh: labPatKey.value.ybh,
od: '',
csjg: "",
jgbz: "",
alarm_flag: '',
cutoff: '',
qz: '',
zhxmdh: selectedItem.value + ' ' + selectedItem.label,
};
const isDuplicate = targetTable.some((item: any) => item.xmdh === newRow.xmdh);
if (isDuplicate) return ElMessage.warning(`项目【${newRow.xmmc}】已存在`);
targetTable.push(newRow);
newresult({ ...newRow, ybh: labPat.value.ybh, jyrq: labPat.value.jyrq, yq })
// 5. 自动聚焦
// nextTick(() => {
// selectedRows.value = [newRow];
// tableRef.value.setCurrentRow(newRow);
// tableRef.value.setScrollTo(targetTable.length - 1)
// // 聚焦到新行的输入框
// const inputs = Array.from(document.querySelectorAll('.foucs-input .el-input__inner'))
// .filter(el => el instanceof HTMLElement) as HTMLElement[];
// if (inputs.length > 0) {
// inputs[inputs.length - 1].focus();
// }
// });
// ElMessage.success(`已新增项目:${newRow.xmmc}`);
};
const csjgRef = ref()
const csjgTableData = ref([])
const handleInputFocus = (row: any) => {
const handleInputFocus = (row: any, type: number) => {
bgType.value = type
// dbRow.value = row
queryXmVal({ yq: labPatKey.value.yq, xmdh: row.xmdh }).then((res: any) => {
if (res.code == 0) {
@ -282,10 +496,11 @@ const handleInputFocus = (row: any) => {
};
const selectItem = (row: any) => {
const targetTable = bgType.value === 1 ? tableData.value : tableData2.value;
// 查找修改行
const index = tableData.value.findIndex((item: any) => item.xmdh == row.xmdh)
tableData.value[index].csjg = row.qz
handleCsjgEnter(tableData.value[index])
const index = targetTable.findIndex((item: any) => item.xmdh == row.xmdh)
targetTable[index].csjg = row.qz
handleCsjgEnter(targetTable[index], bgType.value)
};
@ -293,26 +508,27 @@ const selectItem = (row: any) => {
// 组合项目
const combinedRef = ref()
const zhHandel = () => {
const zhHandel = (type: number) => {
bgType.value = type
combinedRef.value.open()
};
const combinedHandel = (row: any) => {
if (props.labPat.jgbz != null && props.labPat.jgbz != 0 && props.labPat.jgbz != 'C') return ElMessage.warning('已审核结果不可添加模板项目');
const targetTable = bgType.value === 1 ? tableData.value : tableData2.value;
const data = {
...labPatKey.value,
mbmc: row.mbmc,
}
setinputmdl(data).then((res: any) => {
if (res.code == 0) {
const existingNames = new Set(tableData.value.map((item: any) => item.xmdh))
const existingNames = new Set(targetTable.map((item: any) => item.xmdh))
res.data?.forEach((item: any) => {
if (!existingNames.has(item.xmdh)) {
tableData.value.push({ ...item, jyrq: labPat.value.jyrq, zhxmdh: item.xmdh + ' ' + item.xmmc })
targetTable.push({ ...item, jyrq: labPat.value.jyrq, zhxmdh: item.xmdh + ' ' + item.xmmc })
existingNames.add(item.xmdh)
}
})
handleCsjgEnter(null)
handleCsjgEnter(null, bgType.value)
emitter.emit('clearLxsrList')
}
});
@ -329,9 +545,22 @@ const formatJgbz = (v: string) => {
<style scoped lang="scss">
.title {
border-bottom: 1px solid #e8e8e8;
display: flex;
justify-content: space-between;
padding: 3px 0;
font-family: SourceHanSansCN, SourceHanSansCN;
span {
color: #00ff64;
color: #057c34;
}
}
.ertext {
margin-top: 10px;
span {
color: #e2e20c;
}
}
</style>

View File

@ -81,7 +81,7 @@
<el-radio value="I">I</el-radio>
<el-radio value="S">S</el-radio>
<el-radio value="N">N</el-radio>
<el-radio value="SDD">SDD</el-radio>
<el-radio value="D">SDD</el-radio>
</el-radio-group>
</template>
@ -178,12 +178,11 @@
<script setup lang="ts">
import CustomTable from "@/components/elTable/index.vue";
import { classCom } from "@/utils/classCom";
import { getresultmedList, savetestResult, changeresult, saveresult, newresult, getmeddictList, savemedresult, savemedresultall, deletemedresult, getmedgroupMbList } from '@/api/liswork/micro/index';
import {
check1, check2, uncheck2, unconfirmlog, checkuser, reglimit, deleteresult, allPatquery, emrquery,
viewBackup, queryXmVal, printListwork, getresultchangelog, setinputmdl, lockSample, unLockSample, clearnotComplete, clearPrintflag,
noiteMresult, queryXmInfo, setitemInter
} from "@/api/liswork/work/LisWork";
getresultmedList, savetestResult, changeresult, saveresult, newresult, getmeddictList, savemedresult,
savemedresultall, deletemedresult, getmedgroupMbList
} from '@/api/liswork/micro/index';
import { check2, uncheck2, unconfirmlog, checkuser, deleteresult, queryXmVal, setinputmdl, } from "@/api/liswork/work/LisWork";
import { useCommonStore } from "@/store/modules/commonStore";
// @ts-ignore
import ProjectDetails from "@/components/projectDetails/index.vue";
@ -663,8 +662,8 @@ const ymTableData = ref<ymTableDataItem[]>([]);
const ymColumns = ref([
{ label: "抗生素", prop: "zhywdh", visible: true, width: 120, headerSlot: 'ywdhHead' },
{ label: "Mic", prop: "mic", align: 'center', visible: true, width: 60, slot: 'mic' },
{ label: "KB", prop: "rad", align: 'center', visible: true, width: 40, slot: 'rad' },
{ label: "结果", prop: "csjg", align: 'center', visible: true, width: 50, slot: 'csjg' },
{ label: "KB", prop: "rad", align: 'center', visible: true, width: 50, slot: 'rad' },
{ label: "结果", prop: "csjg", align: 'center', visible: true, width: 60, slot: 'csjg' },
{ label: "结果标志", prop: "jgbz", align: 'center', visible: true, slot: 'jgbz', width: 200, showOverflowTooltip: false },
{ label: "折点", prop: "ckz", align: 'center', visible: true, },
{ label: "分组", prop: "bz", align: 'center', visible: true, slot: 'bz' },
@ -822,7 +821,7 @@ const jgbzHandle = (val: string, row: any) => {
I: '中介',
S: '敏感',
N: '非敏感',
SDD: '剂量依赖性敏感'
D: '剂量依赖性敏感'
}
row.csjg = obj[val]