This commit is contained in:
tangw 2025-12-12 18:06:10 +08:00
commit f0c3aaa59b
18 changed files with 197 additions and 211 deletions

View File

@ -5,38 +5,34 @@ import { getGroupInstrdList } from '@/api/liswork/work/LisWork';
import { comDict } from '@/utils/dict'
const dictData = ref<DictData>({});
const instrOptions = ref<{ yq: string; yqmc: string }[]>([])
const instrOptions = ref<{ yq: string; yqmc: string }[]>([]);
export const getYqData = () => {
getGroupInstrdList()
.then((res: any) => {
export const getYqData = (data?: any) => {
// 避免重复请求
if (instrOptions.value.length > 0) return;
getGroupInstrdList(data).then((res: any) => {
if (res.code == 0) {
instrOptions.value = res.data.map((item: any) => ({
yq: item.yq.trim(),
yqmc: item.yqmc
}))
}));
}
})
}
};
//'XMGL','ITEMCLASS', 'YQDL'
export const getDictData = async (...args: string[]) => {
const dictRefs = await comDict(...args);
if(dictRefs.XMGL != undefined) dictData.value.XMGL = toRaw(dictRefs.XMGL.value) || []
if(dictRefs.ITEMCLASS != undefined) dictData.value.ITEMCLASS = toRaw(dictRefs.ITEMCLASS.value) || []
if(dictRefs.YQDL != undefined) dictData.value.YQDL = toRaw(dictRefs.YQDL.value) || []
if(dictRefs.VA != undefined) dictData.value.VA = toRaw(dictRefs.VA.value) || []
if(dictRefs.LF != undefined) dictData.value.LF = toRaw(dictRefs.LF.value) || []
if(dictRefs.BT != undefined) dictData.value.BT = toRaw(dictRefs.BT.value) || []
if(dictRefs.SLZQ != undefined) dictData.value.SLZQ = toRaw(dictRefs.SLZQ.value) || []
if(dictRefs.UT != undefined) dictData.value.UT = toRaw(dictRefs.UT.value) || [] //单位
if(dictRefs.MD != undefined) dictData.value.MD = toRaw(dictRefs.MD.value) || [] //测试方法
if(dictRefs.ITEMCLASS != undefined) dictData.value.ITEMCLASS = toRaw(dictRefs.ITEMCLASS.value) || [] //细菌项目类别
if(dictRefs.GBDM != undefined) dictData.value.GBDM = toRaw(dictRefs.GBDM.value) || [] //国标代码
// 遍历传入的字典类型参数,动态处理赋值
args.forEach(key => {
if (dictRefs[key] !== undefined) {
dictData.value[key] = toRaw(dictRefs[key].value) || [];
}
});
}
//字典数据格式化方法
export const formatDict = (v: string, dictType: string) => {
if(v == undefined) return ;
if (v == undefined) return;
return dictData.value[dictType]?.find((item: any) => item.value == v.trim())?.label;
}
@ -45,4 +41,4 @@ export const formatInstr = (v: string) => {
return instrOptions.value.find((item: any) => item.yq == v.trim())?.yqmc;
}
export {dictData}
export { dictData, instrOptions }

View File

@ -28,9 +28,9 @@ export const useCommonStore = defineStore('commonStore', {
// 持久化配置
persist: {
// 指定要持久化的状态字段
paths: ['fingerprint', 'defaultConfig',],
pick: ['fingerprint', 'defaultConfig'],
// 可选配置:自定义存储键名(默认是store的id)
key: 'common_store',
// key: 'common_store',
// 可选配置:指定存储位置(默认是localStorage 也可以用sessionStorage)
storage: localStorage,
}

View File

@ -9,7 +9,7 @@ declare module 'pinia' {
// 定义持久化配置的类型(根据插件实际参数调整)
interface PersistOptions {
paths?: string[]
pick?: string[]
key?: string
storage?: Storage
}

View File

@ -74,8 +74,8 @@
<VxeTable :table-data="tableData" :loading="loading" :columns="columns"
: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">
:scrollYConfig="{ enabled: true, rSize: 30, height: '100%', }" @selection-change="selectionChange"
:config="tableConfig" :enable-column-drag="true" @column-drag-end="handleColumnDragEnd">
<template #dy="{ row }">
<svg-icon v-if="row.zt != 1" icon-class="lvgou" />
</template>
@ -370,7 +370,6 @@ const handleColumnDragEnd = (data: any) => {
// 左侧表格配置
const tableConfig = ref({
height: '76.5vh', // 高度
// 复选框配置
checkboxConfig: {
// 可选配置项
@ -397,7 +396,7 @@ const rightColumns = ref([
const rightTableConfig = ref({
// stripe: true, // 斑马纹
border: true, // 边框
height: '', // 高度
height: '78vh', // 高度
highlightCurrentRow: true, // 高亮当前行
})
@ -572,8 +571,6 @@ onMounted(async () => {
getList()
}
adjustTableHeight();
// 加载病人来源字典
const dictRefs = await comDict('PT', 'HOS', 'ST');
@ -590,22 +587,6 @@ const formatDict = (v: string, dictType: string) => {
return dictData.value[dictType]?.find((item: any) => item.value == v)?.label || v;
};
// 计算table高度
watch(showSearch, () => {
nextTick(() => {
adjustTableHeight();
})
}, { immediate: true });
function adjustTableHeight() {
if (compactForm.value) {
// 获取高度
heightForm.value = compactForm.value.offsetHeight;
tableConfig.value.height = `calc(80vh - ${heightForm.value}px)`; // 设置表格容器的高度
rightTableConfig.value.height = `calc(80vh - ${heightForm.value}px)`;
}
}
const handletime = (val: Array<string>) => {
// console.log('时间', val);
// 校验日期格式
@ -737,7 +718,7 @@ const printPdf = () => {
<style scoped lang="scss">
.mytable-style {
height: 76.5vh;
height: 78vh;
}
.custom-row-class {

View File

@ -93,8 +93,9 @@
@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">
:scrollYConfig="{ enabled: true, rSize: 30, height: '100%', }" class="mytable-style" ref="tableRefs"
:cell-style="cellStyleHd" @selection-change="selectionChange" :config="tableConfig" :enable-column-drag="true"
@column-drag-end="handleColumnDragEnd">
<template #dybz="{ row }">
<svg-icon v-if="row.dybz == 1" icon-class="lvgou" />
</template>

View File

@ -78,10 +78,10 @@
<!-- 右侧区域-->
<el-col :span="10">
<tabView :tabList="tabList" v-model:activeTab="activeTab" @update:active-tab="updateActive" />
<KeepAlive>
<!-- <KeepAlive> -->
<component class="tabDiv" ref="tableTabRef" :is="activeTabN" :formData="selectRow" v-model="modelParam"
@refreshTabData="rowChange"></component>
</KeepAlive>
<!-- </KeepAlive> -->
<BatchInstrVs v-model="batchInstrVsModel" />
</el-col>
</el-row>
@ -461,7 +461,7 @@ const changeActiveTab = () => {
}
onMounted(async () => {
getDictData('XMGL', 'ITEMCLASS', 'YQDL', 'UT', 'MD', 'GBDM', 'YQ');
getDictData('XMGL', 'ITEMCLASS', 'YQDL', 'UT', 'MD', 'GBDM', 'YQ', 'VA', 'LF', 'BT', 'SLZQ');
getList()
getYqConfig();
})

View File

@ -9,12 +9,12 @@
@column-drag-end="handleColumnDragEnd" :config="tableConfig" @row-click="handRowClick">
<template #qz="{ row }">
<el-select v-model="row.qz" clearable allow-create filterable default-first-option class="full-width-input">
<el-option v-for="item in qzOptions" :key="item.value" :label="item.label" :value="item.value"></el-option>
<el-option v-for="item in dictData.VA" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
</template>
<template #jgbz="{ row }">
<el-select v-model="row.jgbz" clearable class="full-width-input">
<el-option v-for="item in jgbzOptions" :key="item.value" :label="item.label" :value="item.value"></el-option>
<el-option v-for="item in dictData.LF" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
</template>
<template #srm="{ row }">
@ -34,6 +34,10 @@ import { delXmValNewService } from '@/api/liswork/labItem/labItemApi'
const modelParam = defineModel<any>()
const emit = defineEmits(['refreshTabData'])
watch(() => modelParam.value.commonlyValuesData, () => {
selectRow.value = null
})
const tableRef = ref<any>();
const columns = ref([
{ prop: 'qz', label: '取值', visible: true, align: 'center', slot: 'qz', showOverflowTooltip: false },
@ -46,9 +50,7 @@ const tableConfig = ref({
highlightCurrentRow: true, // 高亮当前行
// cellStyle: cellStyleHd
})
const qzOptions = ref()
const selectRow = ref()
const jgbzOptions = ref()
//退拽属性
const handleColumnDragEnd = (data: any) => {
@ -90,12 +92,6 @@ const handRowClick = (row: any) => {
selectRow.value = row
}
onActivated(async () => {
//默认取值
await getDictData('VA', 'LF')
qzOptions.value = dictData.value.VA
jgbzOptions.value = dictData.value.LF
})
</script>

View File

@ -1,15 +1,14 @@
<template>
<!-- 计算项目表达式生成向导 -->
<el-dialog :model-value="visible" @update:model-value="handleVisibleChange" title="计算项目表达式生成向导" width="600px"
@close="onClose" @open="onOpen">
:close-on-click-modal="false" :draggable="true" @close="onClose" @open="onOpen">
<el-row class="input-text">
<el-input type="textarea" v-model="inputText"></el-input>
</el-row>
<el-row>
<el-col :span="12">
<CustomTable ref="tableRefs" :data="tableData" :columns="columns" :config="tableConfig"
@row-click="rowHandle" :enableColumnDrag="true"
@column-drag-end="handleColumnDragEnd"/>
<CustomTable ref="tableRefs" :data="tableData" :columns="columns" :config="tableConfig" @row-click="rowHandle"
:enableColumnDrag="true" @column-drag-end="handleColumnDragEnd" />
</el-col>
<el-col :span="12" class="right">
<el-button type="" @click="bClickAdd">+ 加</el-button>
@ -41,7 +40,7 @@ import CustomTable from '@/components/elTable/index.vue'
import { queryXmInfoNew } from '@/api/liswork/labItem/labItemApi'
const props = defineProps({
formData:{
formData: {
type: Object,
default: {}
}
@ -70,11 +69,11 @@ const tableConfig = ref(
)
//向外暴露数据
defineExpose({inputText})
defineExpose({ inputText })
watch(
() => props.formData.jsgs, // 监听的目标:formData.jsgs
(newVal:any) => {
(newVal: any) => {
inputText.value = newVal // 当新值变化时,更新 inputText
},
{ immediate: true } // 立即执行一次(确保初始化时也能同步)
@ -85,7 +84,7 @@ const handleColumnDragEnd = (newColumns: any) => {
}
const rowHandle = (row: any) => {
inputText.value += '['+row.xmdh+']'
inputText.value += '[' + row.xmdh + ']'
}
const onClose = () => {
@ -93,7 +92,7 @@ const onClose = () => {
}
const handleOk = () => {
emit('confirm',inputText.value) // 通知外部执行确认操作
emit('confirm', inputText.value) // 通知外部执行确认操作
emit('update:model-value', false) // 确认后关闭
}
@ -154,6 +153,7 @@ const onOpen = async () => {
.input-text {
margin-bottom: 10px;
}
// .right {
// margin-left: 2px;
// }

View File

@ -1,6 +1,7 @@
<template>
<!-- 危急值特定判断条件 -->
<el-dialog title="危急值特定判断条件" width="700px" v-model="visible" @open="onOpen">
<el-dialog title="危急值特定判断条件" width="700px" v-model="visible" :close-on-click-modal="false" :draggable="true"
@open="onOpen" @close="onClose">
<el-row class="row-up">
<div class="top-button">
<el-button type="primary" @click="bClickAdd">增加</el-button>
@ -8,8 +9,7 @@
<el-button type="primary" @click="bClickSave">保存</el-button>
</div>
<CustomTable ref="tableRefs" :data="tableDataUp" :columns="columnsUp" :config="tableConfigUp"
@row-click="rowHandleUp" :enableColumnDrag="true"
@column-drag-end="handleColumnDragEnd">
@row-click="rowHandleUp" :enableColumnDrag="true" @column-drag-end="handleColumnDragEnd">
<template #samplecondition="{ row }">
<el-input v-model="row.samplecondition" class="full-width-input"></el-input>
</template>
@ -20,9 +20,9 @@
</el-row>
<el-row class="row-down">
<el-col :span="12">
<CustomTable ref="tableRefs" :data="tableDataDown" :columns="columnsDown" :config="tableConfigDown"
@row-click="rowHandleDown" :enableColumnDrag="true"
@column-drag-end="handleColumnDragEnd"/>
<VxeTable ref="tableRefs" :data="tableDataDown" :columns="columnsDown" class="mytable-style"
:scrollYConfig="{ enabled: true, rSize: 30, height: '400', }" @current-change="rowHandleDown"
:enableColumnDrag="true" @column-drag-end="handleColumnDragEnd" />
</el-col>
<el-col :span="12" class="rigth-col">
<el-button type="primary" @click="bClickDept" size="small">科室</el-button>
@ -31,7 +31,8 @@
<el-button type="primary" @click="bClickResult" size="small">结果</el-button>
<el-button type="primary" @click="bClickSample" size="small">样本状态</el-button>
<h4>1公式举例:科室诊断条件:[科室] = '血液科' or [诊断] ='白血病' 当前结果判断条件:[结果] &gt; 20 or [结果] &lt;2 or [结果] ='阳性'</h4>
<h4>2公式举例:科室诊断条件(其他项目代号如):[WBC] = '阳性' or [WBC] &gt; 20 or [WBC] &lt;20 当前结果判断条件: [结果] &gt; 20 or [结果] &lt;2</h4>
<h4>2公式举例:科室诊断条件(其他项目代号如):[WBC] = '阳性' or [WBC] &gt; 20 or [WBC] &lt;20 当前结果判断条件: [结果] &gt; 20 or [结果] &lt;2
</h4>
<h4>3公式举例:只发一次危急值病人条件:[初报] = 'brdh' and [初报] = 'brxm' 当前结果判断条件:[结果] &gt; 20 or [结果] &lt;2 or [结果] ='阳性'</h4>
<h4>只要符合科室或诊断条件的,就不会再断默认的危机值标准了</h4>
<h4>注意科室用中文,结果如果是字符型用单引号引起来</h4>
@ -43,9 +44,10 @@
<script setup lang="ts">
import CustomTable from '@/components/elTable/index.vue'
import { queryXmInfoNew,queryXmAlarmdetailNew,addXmAlarmdetailNew,delXmAlarmdetailNew } from '@/api/liswork/labItem/labItemApi'
import {XmAlarmdetailNew} from '@/types'
import { ElMessageBox,ElMessage } from 'element-plus'
import VxeTable from '@/components/vxeTable/index.vue'
import { queryXmInfoNew, queryXmAlarmdetailNew, addXmAlarmdetailNew, delXmAlarmdetailNew } from '@/api/liswork/labItem/labItemApi'
import { XmAlarmdetailNew } from '@/types'
import { ElMessageBox, ElMessage } from 'element-plus'
const columnsUp = ref([
@ -55,16 +57,21 @@ const columnsUp = ref([
])
const columnsDown = ref([
{ prop: 'xmdh', label: '项目代号', align: 'center', visible: true, width: 100 },
{ prop: 'xmmc', label: '项目名称', align: 'center', visible: true, width: 220 }
{ field: 'xmdh', title: '项目代号', align: 'center', visible: true, width: 100, resizable: true },
{ field: 'xmmc', title: '项目名称', align: 'center', visible: true, width: 220, resizable: true }
])
const tableDataUp = ref<Array<XmAlarmdetailNew>>([])
const tableDataDown = ref()
const selectRowUp = ref<XmAlarmdetailNew>()
const tableDataDown = ref([])
const selectRowUp = ref<XmAlarmdetailNew>({
xmid: 0,
seq: 0,
samplecondition: '',
resultcondition: ''
})
const visible = defineModel()
const props = defineProps({
formData:{
formData: {
type: Object,
default: {}
}
@ -81,15 +88,7 @@ const tableConfigUp = ref(
}
)
const tableConfigDown = ref(
{
// stripe: true, // 斑马纹
border: true, // 边框
height: '400', // 高度
highlightCurrentRow: true, // 高亮当前行
fit: true
}
)
//序号最大值
const maxXh = computed(() => {
@ -102,11 +101,11 @@ const handleColumnDragEnd = (newColumns: any) => {
columnsDown.value = newColumns.columns
}
const rowHandleUp = (row:any) => {
const rowHandleUp = (row: any) => {
selectRowUp.value = row
}
const rowHandleDown = (row:any) => {
const rowHandleDown = (row: any) => {
if (selectRowUp.value) {
selectRowUp.value.samplecondition += `[${row.xmdh}]`
}
@ -114,10 +113,18 @@ const rowHandleDown = (row:any) => {
const onOpen = async () => {
const res = await queryXmAlarmdetailNew(props.formData.xmid);
tableDataUp.value = res.data;
if (!tableDataDown.value.length) {
let res = await queryXmInfoNew(props.formData.xmgl);
tableDataDown.value = res.data;
res = await queryXmAlarmdetailNew(props.formData.xmid);
tableDataUp.value = res.data;
}
}
const onClose = () => {
tableDataUp.value = []
selectRowUp.value = { xmid: 0, seq: 0, samplecondition: '', resultcondition: '' }
}
const bClickAdd = () => {
@ -130,58 +137,65 @@ const bClickAdd = () => {
tableDataUp.value.push(newData);
}
const bClickDel = async () => {
if(selectRowUp.value){
await ElMessageBox.confirm('是否要删除选中的数据?','Warning',
const bClickDel = () => {
if (!selectRowUp.value.xmid) return ElMessage.warning('请选择要删除的行!')
ElMessageBox.confirm('是否要删除选中的数据?', '警告',
{
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning',
});
}).then(() => {
const xmid = selectRowUp.value.xmid
const seq = selectRowUp.value.seq
await delXmAlarmdetailNew(xmid,seq)
await queryXmAlarmdetailNew(props.formData.xmid);
delXmAlarmdetailNew(xmid, seq).then((res: any) => {
if (res.code == 0) {
onOpen()
ElMessage.success('删除成功!')
}
})
})
}
const bClickSave = async() => {
await addXmAlarmdetailNew(tableDataUp.value);
await queryXmAlarmdetailNew(props.formData.xmid);
const bClickSave = () => {
const flag = tableDataUp.value.every((item: XmAlarmdetailNew) => item.samplecondition && item.resultcondition)
if (!flag) return ElMessage.warning('请检查填写科室或诊断条件和结果判断条件!')
addXmAlarmdetailNew(tableDataUp.value).then((res: any) => {
if (res.code == 0) {
onOpen()
ElMessage.success('保存成功!')
}
})
}
const bClickDept = () => {
if(selectRowUp.value){
if (selectRowUp.value) {
selectRowUp.value.samplecondition += '[科室]'
}
}
const bClickDiag = () => {
if(selectRowUp.value){
if (selectRowUp.value) {
selectRowUp.value.samplecondition += '[诊断]'
}
}
const bClickPre = () => {
if(selectRowUp.value){
if (selectRowUp.value) {
selectRowUp.value.samplecondition += '[初报]'
}
}
//结果
const bClickResult = () => {
if(selectRowUp.value){
if (selectRowUp.value) {
selectRowUp.value.resultcondition += '[结果]'
}
}
const bClickSample = () => {
if(selectRowUp.value){
if (selectRowUp.value) {
selectRowUp.value.samplecondition += '[样本状态]'
}
}

View File

@ -1,6 +1,7 @@
<template>
<!-- 多行参考值配置界面 -->
<el-dialog v-model="dialogTableVisibleVal" @close="handleDialogClose" title="多行参考值" width="600px" align-center>
<el-dialog v-model="dialogTableVisibleVal" @close="handleDialogClose" title="多行参考值" width="600px" align-center
:close-on-click-modal="false" :draggable="true">
<el-form :model="formData" inline>
<el-row :gutter="10">
<el-col :span="12">

View File

@ -18,12 +18,15 @@
<script setup lang="ts">
import CustomTable from '@/components/elTable/index.vue'
import { XmTextresultNew } from '@/types';
import { ElMessageBox } from 'element-plus';
import { ElMessage, ElMessageBox } from 'element-plus';
import { ref } from 'vue';
import { delXmTextresultNew } from '@/api/liswork/labItem/labItemApi';
const modelParam = defineModel<any>()
watch(() => modelParam.value.commonDescriptionsData, (val) => {
selectRow.value = null
})
const tableRef = ref();
const columns = ref([
{ prop: 'textresult', label: '文字描述', visible: true, align: 'center', slot: 'textresult', width: 500, showOverflowTooltip: false },
@ -59,20 +62,22 @@ const onAddClick = () => {
const newData: XmTextresultNew = {
xmid: modelParam.value.basicData.xmid,
xmdh: modelParam.value.basicData.xmdh,
xh: maxXh.value
xh: maxXh.value,
textresult: ''
}
modelParam.value.commonDescriptionsData.push(newData)
}
const onDelClick = async () => {
if (selectRow.value) {
await ElMessageBox.confirm('是否要删除选中的数据?', '警告',
{ confirmButtonText: 'OK', cancelButtonText: 'Cancel', type: 'warning', });
//tableList.value = tableList.value.filter((item:any) => item.xh != selectRow.value.xh)
await delXmTextresultNew({ xmid: modelParam.value.basicData.xmid, xh: selectRow.value.xh })
emit('refreshTabData', modelParam.value.basicData)
const onDelClick = () => {
if (!selectRow.value) return ElMessage.warning('请选择要删除的数据!');
ElMessageBox.confirm('是否要删除选中的数据?', '警告',
{ confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning', }).then(() => {
delXmTextresultNew({ xmid: modelParam.value.basicData.xmid, xh: selectRow.value.xh }).then((res: any) => {
if (res.code == 0) {
modelParam.value.commonDescriptionsData = modelParam.value.commonDescriptionsData.filter((item: any) => item.xh != selectRow.value.xh)
}
})
})
}
</script>

View File

@ -24,11 +24,11 @@ const props = defineProps({
const tableRef = ref<any>(null);
const dataList = ref();
const columns = ref([
{ prop: 'reserve', label: '类别', visible: true, align: 'center', width: 200 },
{ prop: 'textresult', label: '描述', visible: true, align: 'center', width: 100 },
{ prop: 'yxjs', label: '医学解释', visible: true, align: 'center', width: 100 },
{ prop: 'cjyy', label: '常见原因,', visible: true, align: 'center', width: 100 },
{ prop: 'zd', label: '指导,', visible: true, align: 'center', width: 100 },
{ prop: 'reserve', label: '类别', visible: true, align: 'center', },
{ prop: 'textresult', label: '描述', visible: true, align: 'center', },
{ prop: 'yxjs', label: '医学解释', visible: true, align: 'center', },
{ prop: 'cjyy', label: '常见原因', visible: true, align: 'center', },
{ prop: 'zd', label: '指导', visible: true, align: 'center', },
]);
const tableConfig = ref({
border: true, // 边框

View File

@ -29,12 +29,13 @@
</el-select>
</template>
<template #bblx="{ row }">
<SelectTable v-model:data="row.bblx" :fields="fields" :tableData="bblxOptions" label="label" value="label"
<SelectTable v-model:data="row.bblx" :fields="fields" :tableData="dictData.BT" label="label" value="label"
objKey="label" :border="true" />
</template>
<template #slzq="{ row }">
<el-select v-model="row.slzq" clearable>
<el-option v-for="item in optionsSLZQ" :key="item.value" :label="item.label" :value="item.value"></el-option>
<el-option v-for="item in dictData.SLZQ" :key="item.value" :label="item.label"
:value="item.value"></el-option>
</el-select>
</template>
<template #zd="{ row }">
@ -91,7 +92,6 @@ const optionsNLDW = [
{ value: '4', label: '时' },
]
const optionsSLZQ = ref<any>([])
const fields = ref(
[
@ -99,10 +99,6 @@ const fields = ref(
{ prop: 'label', label: '名称', width: 150, enablePinyinSearch: true },
]
)
const bblxOptions = ref<Array<{ zddh: string; zdmc: string }>>([]);
const tableRefUp = ref<any>();
const tableRefDown = ref<any>();
// const dataListUp = ref();
const dataListDown = ref();
const columnsUp = ref([
@ -183,13 +179,6 @@ const rowClick = (row: any) => {
selectRow.value = row
}
onActivated(async () => {
//加载字典数据
await getDictData('BT', 'SLZQ')
bblxOptions.value = dictData.value.BT || []
optionsSLZQ.value = dictData.value.SLZQ || []
})
</script>

View File

@ -8,7 +8,8 @@
<CustomTable ref="tableRef" :data="modelParam.userInstrData" :columns="columns" :enable-column-drag="true"
@column-drag-end="handleColumnDragEnd" :config="tableConfig" @row-click="onRowClick">
<template #yq="{ row }">
<YQSelectTable v-model:data="row.yq" placeholder="请选择仪器名称" class="full-width-input" />
<SelectTable v-model:data="row.yq" :fields="yqFields" :tableData="instrOptions" label="yqmc" value="yq"
objKey="yq" :border="true" placeholder="请选择仪器" :clearable="false" class="full-width-input" />
</template>
<template #xs="{ row }">
<el-input v-model="row.xs" class="full-width-input" />
@ -33,10 +34,10 @@
<script setup lang="ts">
import CustomTable from '@/components/elTable/index.vue'
import { XmInfoVs } from '@/types';
import YQSelectTable from '@/components/SelectTable/YQSelectTable/index.vue'
import SelectTable from '@/components/SelectTable/index.vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { deleteXmInfoVs } from '@/api/liswork/labItem/labItemApi';
import { getYqData, instrOptions } from '@/hooks'
const modelParam = defineModel<any>()
const tableRef = ref<any>();
@ -55,6 +56,13 @@ const tableConfig = ref({
highlightCurrentRow: true, // 高亮当前行
// cellStyle: cellStyleHd
})
const yqFields = ref([
{ prop: 'yq', label: '代号', width: 80, enablePinyinSearch: true },
{ prop: 'yqmc', label: '名称', width: 150, enablePinyinSearch: true },
])
const selectRow = ref<XmInfoVs>({
yq: '',
xmid: 0
@ -103,11 +111,9 @@ const getDyckz = (row: XmInfoVs) => {
} else {
return `${row.ckxx || ''}--${row.cksx || ''}`;
}
}
onActivated(() => {
})
onMounted(() => {
getYqData();
});
</script>

View File

@ -67,7 +67,7 @@
</template>
<script setup lang="ts">
import { ref, defineProps, defineEmits, nextTick, watch } from 'vue'
import { ref, nextTick, watch } from 'vue'
import { ElMessage } from 'element-plus'
// 定义下拉选项类型

View File

@ -151,14 +151,13 @@ const mbStore = useCommonStore();
const aotuSize = classCom.useAutoSize();
import { initWebSocket, sendWebSocketMessage, closeWebSocket, getWebSocketState } from '@/utils/webSocket';
import dayjs from 'dayjs';
const previewShow = ref(false);
const lbFlag = ref(false);
const queryParams = ref({
jyrq: dayjs().format('YYYY-MM-DD'), //'2025-08-20'
ybh: '1',
instrGroup: mbStore.defaultConfig.lisgroupid,
yq: mbStore.defaultConfig.defaultinstr,
instrGroup: mbStore.defaultConfig.lisgroupid || 'ALL',
yq: mbStore.defaultConfig.defaultinstr || '1',
problemId: 0,
days: 0,
yhdh: ''
@ -382,7 +381,6 @@ const lastRow: any = ref({})
// 批量扫码ybh同步样本编号
const ybhChangeTb = (val: string) => {
console.log('val==>', val);
queryParams.value.ybh = val
handleQuery();
}

View File

@ -1,7 +1,7 @@
<template>
<div class="table-container">
<ContextMenu :items="contextMenuItems" @select="handleMenuSelect" menu-width="200">
<CommonTable :table-data="labPatList" :loading="loading" :columns="tableColumns" :dict-data="dictData"
<CommonTable :table-data="labPatList" :loading="loading" :columns="tableColumns"
:row-config="{ isHover: true, keyField: 'ybh' }" @current-change="handleRowClick" size="small"
:scrollYConfig="{ enabled: true, rSize: 30, height: '100%', }" :row-style="rowStyle" :cell-style="cellStyle"
class="mytable-style" ref="tableRef" :enable-column-drag="true" @column-drag-end="handleColumnDragEnd">

View File

@ -132,22 +132,6 @@ const radioChange = (val: string) => {
}
deptOptions.value = result
}
// 默认展开第一个一级节点的子级
nextTick(() => {
if (deptOptions.value.length > 0) {
const firstLevelNode = deptOptions.value[0]
if (firstLevelNode && firstLevelNode.children && firstLevelNode.children.length > 0) {
expandedKeys.value = [firstLevelNode.id]
const firstChildNode = firstLevelNode.children[0]
queryParams.value.yq = firstChildNode.id
yqmc.value = firstChildNode.label
deptTreeRef.value?.setCurrentKey(firstChildNode.id)
}
}
})
}
// ========== 树操作核心方法 ==========
@ -222,8 +206,23 @@ const getDeptTree = async (): Promise<void> => {
const response = await paramTree() as ParamTreeResponse
if (response.code === "0" && response.data) {
treeData.value = response.data
radioChange('1')
if (!expandedKeys.value.length) {
// 默认展开第一个一级节点的子级
nextTick(() => {
if (deptOptions.value.length > 0) {
const firstLevelNode = deptOptions.value[0]
if (firstLevelNode && firstLevelNode.children && firstLevelNode.children.length > 0) {
expandedKeys.value = [firstLevelNode.id]
const firstChildNode = firstLevelNode.children[0]
queryParams.value.yq = firstChildNode.id
yqmc.value = firstChildNode.label
deptTreeRef.value?.setCurrentKey(firstChildNode.id)
}
}
})
}
} else {
ElMessage.warning(response.msg || "获取树数据失败")
}