This commit is contained in:
wyuu 2025-11-27 17:50:31 +08:00
parent ccce5849f8
commit 04c2ffe8de
15 changed files with 281 additions and 45 deletions

View File

@ -395,6 +395,9 @@
cursor: pointer;
}
.el-table--default .cell {
padding: 0 0 0 .3125rem !important;
}
// 表格input宽度,表格select宽度
.full-width-input .el-input__inner .el-select__inner {
@ -411,6 +414,7 @@
box-shadow: none;
background: transparent !important;
padding: 0 !important;
padding-left: .3125rem !important;
outline: none;
&:hover {

View File

@ -26,7 +26,10 @@
<el-table-column v-if="!item.type && item.slot && item.visible" :prop="item.prop" :label="item.label"
:width="item.width" :min-width="item.minWidth" :fixed="item.fixed" :align="item.align || 'left'"
:sortable="item.sortable" :show-overflow-tooltip="item.showOverflowTooltip !== false">
<template #default="scope">
<template v-if="item.headerSlot" #header="scope">
<slot :name="item.headerSlot" :column="scope.column" :$index="scope.$index" />
</template>
<template v-if="item.slot" #default="scope">
<slot :name="item.slot" :row="scope.row" :$index="scope.$index" />
</template>
</el-table-column>

View File

@ -100,9 +100,12 @@ const getInfoList = () => {
})
}
watch(() => props.queryParams, (newValue) => {
watch(() => queryParams, (newValue) => {
getInfoList()
}, { immediate: true })
}, {
immediate: true,
deep: true
})
const getMxInfo = (row: any) => {
const data = {

View File

@ -13,7 +13,6 @@ const info = ref('')
const getClinicalInfo = (data: any) => {
clinicInfo(data).then((res: any) => {
if (res.code == 0) {
console.log('临床意义==>', res.data);
info.value = res.data
}
})
@ -26,7 +25,6 @@ onMounted(() => {
}
emitter.on('refreshClinical', (data) => {
console.log('data==>', data);
getClinicalInfo(data)
})
})

View File

@ -58,7 +58,10 @@ const getCombination = () => {
};
watch(() => props.queryParams.yq, (newValue) => {
getCombination()
}, { immediate: true })
}, {
immediate: true,
deep: true
})
const changeLxsr = (row: any) => {
const lxsrs = tableData.value.filter((item: any) => item.lxsr).map((item: any) => item.mbmc);

View File

@ -203,7 +203,10 @@ const getList = () => {
watch(() => props.queryParams, (newValue) => {
getList()
}, { immediate: true })
}, {
immediate: true,
deep: true
})
const handleRowClick = (row: any) => {
nextTick(() => {

View File

@ -171,7 +171,10 @@ const getOthersInfo = () => {
watch(() => props.queryParams, (newValue) => {
getOthersInfo()
}, { immediate: true })
}, {
immediate: true,
deep: true
})
// 获取明细
const handleRowClick = (row: any) => {

View File

@ -56,7 +56,10 @@ const getReexamination = () => {
watch(() => queryParams.value, () => {
getReexamination();
}, { immediate: true })
}, {
immediate: true,
deep: true
})
const tableRef = ref();
const itemDictRef = ref(); // DictInput组件引用
@ -111,7 +114,6 @@ const addRowFromDict = async (rowData: any) => {
};
const handleCsjgEnter = (row: any) => {
console.log('复查结果修改', row);
saveRedo(row)
}

View File

@ -43,7 +43,10 @@ const getResultGraph = () => {
watch(() => props.queryParams, (newValue) => {
getResultGraph()
}, { immediate: true })
}, {
immediate: true,
deep: true
})
</script>
<style scoped lang="scss">

View File

@ -195,7 +195,10 @@ const getInfo = () => {
watch(() => props.queryParams, (newValue) => {
getInfo()
}, { immediate: true })
}, {
immediate: true,
deep: true
})
onMounted(() => {
const data = { status: 0, del_flag: 0, pageSize: 1000, pageNum: 1 }

View File

@ -73,16 +73,12 @@
@previewHandle="previewHandle" />
</el-tab-pane>
<el-tab-pane label="培养基接种" name="third">
<Byj :labPat="labInfo" :labPatKey="queryParams" />
<Pyj :labPat="labInfo" :labPatKey="queryParams" />
</el-tab-pane>
<el-tab-pane label="操作记录" name="fourth">
<Record :labPat="labInfo" :labPatKey="queryParams" />
</el-tab-pane>
</el-tabs>
<!-- <LabResult ref="labResultRef" v-model:labPat="labInfo" :labPatKey="queryParams" :dictData="dictData"
:labResutsData="labResuts" @fetchLabResults="resultsHandle" @changeStatus="changeStatus"
@previewHandle="previewHandle" /> -->
</el-col>
</el-row>
</div>
@ -115,7 +111,11 @@
<el-radio :value="60">近60天</el-radio>
<el-radio :value="90">近90天</el-radio>
<el-radio :value="7">近7天</el-radio>
<el-radio :value="0">此日 -></el-radio>
<el-radio :value="0">此日
<el-icon>
<Right />
</el-icon>
</el-radio>
</el-radio-group>
<el-date-picker v-model="queryParams.jyrq" type="date" :size="aotuSize" @change="fetchlabPatList"
style="width: 9.375rem;" />
@ -124,9 +124,6 @@
: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> -->
<el-pagination v-model:current-page="queryParams.pageNum" v-model:page-size="queryParams.pageSize"
:page-sizes="[300, 600, 1000]" :size="aotuSize" background
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="handleSizeChange"
@ -160,8 +157,6 @@ 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 './labresult/index.vue';
import LabPatList from './labpatlist.vue';
import History from '../components/history/index.vue'
import Others from '../components/others/index.vue'
@ -174,7 +169,7 @@ import ResultGraph from '../components/resultGraph/index.vue'
// 中间部分
import ZbReport from './labresult/zbReport.vue';
import CbReport from './labresult/cbReport.vue';
import Byj from './labresult/byj.vue';
import Pyj from './labresult/pyj.vue';
import Record from './labresult/record.vue';
// @ts-ignore
import { comDict } from '@/utils/dict'
@ -208,7 +203,7 @@ const queryParams = ref({
})
const activeName = ref('second');
const activeName = ref('first');
const total = ref(0)
const ybs = ref(0)
@ -249,9 +244,7 @@ const searchText = ref('')
const rules = ref([])
const instrGroupOptions = ref<any[]>([])
const instrOptions = ref<{ yq: string; yqmc: string }[]>([])
const pdfUrl = ref('')
// 初始查询参数(可选)
const initialParams = {}
@ -437,6 +430,7 @@ const lastRow: any = ref({})
const ybhChangeTb = (val: string) => {
// console.log('val==>', val);
labInfo.value.ybh = val
queryParams.value.ybh = val
handleQuery();
}
const handleQuery = () => {
@ -445,6 +439,7 @@ const handleQuery = () => {
highlightRowIndex.value = -1;
ElMessage.warning('请输入样本编号')
labInfo.value.ybh = lastRow.value.ybh
queryParams.value.ybh = lastRow.value.ybh
return;
}
// queryParams.value = { ...queryParams.value };
@ -526,11 +521,14 @@ const handlePrev = () => {
if (!lbFlag.value) {
const ybh = getPreviousNumber(labInfo.value.ybh) as string;
labInfo.value.ybh = ybh;
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];
if (activeTab.value == 'LabPatList') {
labPatListRef.value.setCurrentRow(row);
}
selectJob(row);
} else {
handleCreate();
@ -539,7 +537,9 @@ const handlePrev = () => {
if (highlightRowIndex.value > 0) {
highlightRowIndex.value--;
const row = labPatList.value[highlightRowIndex.value];
if (activeTab.value == 'LabPatList') {
labPatListRef.value.setCurrentRow(row);
}
selectJob(row);
}
}
@ -551,11 +551,14 @@ const handleNext = () => {
if (!lbFlag.value) {
const ybh = getNextNumber(labInfo.value.ybh) as string;
labInfo.value.ybh = ybh;
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];
if (activeTab.value == 'LabPatList') {
labPatListRef.value.setCurrentRow(row);
}
selectJob(row);
} else {
handleCreate();
@ -564,10 +567,13 @@ const handleNext = () => {
if (highlightRowIndex.value < labPatList.value.length - 1) {
highlightRowIndex.value++;
const row = labPatList.value[highlightRowIndex.value];
if (activeTab.value == 'LabPatList') {
labPatListRef.value.setCurrentRow(row);
}
selectJob(row);
} else {
labInfo.value.ybh = getNextNumber(labInfo.value.ybh) as string;
queryParams.value.ybh = labInfo.value.ybh;
handleCreate();
}
}
@ -575,6 +581,7 @@ const handleNext = () => {
// 最后一个样本
const handleLast = () => {
labInfo.value.ybh = labPatList.value[labPatList.value.length - 1].ybh;
queryParams.value.ybh = labPatList.value[labPatList.value.length - 1].ybh;
handleNext();
}
const batchRef = ref()

View File

@ -0,0 +1,160 @@
<template>
<div class="dict-input-wrapper">
<!-- 字典选择弹窗 -->
<el-dialog v-model="dialogVisible" :title="dialogTitle" width="30vw" :close-on-click-modal="false" :draggable="true"
@close="handleDialogClose">
<el-input ref="inputRef" v-model="searchKey" placeholder="搜索(支持名称、编码、简拼)..." class="mb10" clearable
@clear="filterDictData" @input="filterDictData" />
<el-table :data="filteredDictData" height="300px" border @row-dblclick="selectItem" highlight-current-row>
<el-table-column prop="value" label="培养基代号" align="center" width="150" />
<el-table-column prop="label" label="培养基名称" align="center" show-overflow-tooltip />
<el-table-column prop="pinyin" label="简拼" align="center" width="150" /> <!-- 显示简拼便于调试 -->
</el-table>
</el-dialog>
</div>
</template>
<script setup lang="ts">
import { ref, computed, watch, onMounted } from 'vue';
import { getmeddictList } from '@/api/liswork/micro/index';
// @ts-ignore
import { getFirstLetter } from '@/utils/pinyin.js'; // 引入拼音处理工具
// 组件参数
const props = defineProps({
modelValue: { type: [String, Number], default: '' },
dictType: { type: String },
placeholder: { type: String, default: '请输入或双击选择' },
clearable: { type: Boolean, default: true },
disabled: { type: Boolean, default: false },
dialogTitle: { type: String, default: '选择字典项' },
tableKey: { type: Object, default: () => { } },
});
// 组件事件
const emit = defineEmits(['select']);
const dictData = ref([]); // 存储带简拼的字典数据
const filteredDictData = ref([]);
const isDictLoading = ref(false);
const dialogVisible = ref(false);
const searchKey = ref('');
// 加载字典数据(并添加简拼字段)
const loadDictData = async () => {
try {
isDictLoading.value = true;
const response = await getmeddictList();
const rawData = response.data.map((item: any, index: number) => {
return {
value: item.ywdh || `未知编码_${index}`, // 确保value存在
label: item.ywmc || `未知名称_${index}`, // 确保label存在
};
});
// 为每个字典项添加简拼字段
dictData.value = (rawData || []).map((item: any) => ({
...item,
pinyin: getFirstLetter(item.label) // 新增pinyin字段存储简拼
}));
filteredDictData.value = [...dictData.value];
} catch (error) {
console.error(`加载${props.dictType}字典失败:`, error);
dictData.value = [];
filteredDictData.value = [];
} finally {
isDictLoading.value = false;
}
};
// 核心搜索逻辑(支持模糊搜索+简拼搜索)
const filterDictData = () => {
const key = searchKey.value.trim().toLowerCase();
if (!key) {
filteredDictData.value = [...dictData.value];
return;
}
filteredDictData.value = dictData.value.filter((item: any) => {
// 1. 模糊搜索:匹配label(名称)或value(编码)
const matchLabel = item.label.toLowerCase().includes(key);
const matchValue = String(item.value).toLowerCase().includes(key);
// 2. 简拼搜索:匹配首字母简拼
const matchPinyin = item.pinyin.toLowerCase().includes(key);
// 满足任一条件即匹配
return matchLabel || matchValue || matchPinyin;
});
};
const inputRef = ref()
// 关键修改:打开弹窗时重新加载数据
const openDictSelector = async () => {
if (props.disabled || isDictLoading.value) {
return;
}
// 打开弹窗前先加载数据(确保每次打开都是最新的)
// await loadDictData();
// 数据加载完成后再显示弹窗
dialogVisible.value = true;
searchKey.value = '';
nextTick(() => {
setTimeout(() => {
inputRef.value.focus();
}, 100);
});
filterDictData();
};
// 选择字典项
const selectItem = (item: any) => {
emit('select', item);
dialogVisible.value = false;
};
const handleDialogClose = () => {
dialogVisible.value = false;
};
defineExpose({
openDictSelector, // 暴露打开弹窗的方法
// 可选:暴露其他可能需要的方法(如刷新字典数据)
loadDictData
});
</script>
<style scoped>
/* 样式保持不变 */
.dict-input-wrapper {
position: relative;
}
.select-icon {
cursor: pointer;
color: #666;
margin-left: 5px;
}
.select-icon:hover {
color: #409eff;
}
:deep(.el-input__suffix) {
gap: 4px;
}
</style>

View File

@ -1,22 +1,31 @@
<template>
<div>
<div class="top-btns">
<el-button type="primary" plain size="small" @click="printHandle">打印培养基条码</el-button> &nbsp;
<el-checkbox v-model="checked">自动打印培养基条码</el-checkbox>
<el-button type="primary" plain :size="autoSize" @click="addItem">新增</el-button>
<el-button type="danger" plain :size="autoSize" @click="deleteItem">删除</el-button>
<el-button type="primary" plain :size="autoSize" @click="printHandle">打印培养基条码</el-button>
<el-checkbox v-model="checked" :size="autoSize" class="ml5">自动打印培养基条码</el-checkbox>
</div>
<CustomTable ref="tableRef" :data="tableData" :columns="columns" :config="tableConfig" :enable-column-drag="true"
@column-drag-end="handleColumnDragEnd" @selection-change="handleSelectionChange">
<template #mediumname="{ column }">
培养基 {{ tableData.length }}个
<template #mediumnameHeadTitle="{ column }">
培养基 {{ tableData?.length }}个
</template>
<template #mediumname="{ row }">
<el-input v-model="row.mediumname" size="small" class="full-width-input" @dblclick="handleInputFocus(row)" />
</template>
</CustomTable>
<PyjDict ref="pyjRef" :dialogTitle="'培养基选择'" @select="selectItem" />
</div>
</template>
<script setup lang="ts">
import CustomTable from '@/components/elTable/index.vue';
import { getmediumList } from '@/api/liswork/micro/index';
import { classCom } from '@/utils/classCom';
import { ElMessage, ElMessageBox } from 'element-plus';
import PyjDict from './components/pyjDict.vue';
const autoSize = classCom.useAutoSize()
const props = defineProps({
labPat: {
type: Object,
@ -36,7 +45,7 @@ const tableRef = ref();
const tableData = ref([]);
const columns = ref([
{ type: "selection", width: 40, align: 'center', visible: true },
{ label: "培养基", prop: "mediumname", align: 'center', visible: true, width: 80, headerSlot: 'mediumname' },
{ label: "培养基", prop: "mediumname", align: 'center', visible: true, width: 80, headerSlot: 'mediumnameHeadTitle', slot: 'mediumname' },
{ label: "接种时间", prop: "sheetdate", align: 'center', visible: true, width: 120 },
{ label: "接种人", prop: "sheetuser", align: 'center', visible: true, width: 60 },
{ label: "培养基结果", prop: "mediu", align: 'center', visible: true, },
@ -48,13 +57,40 @@ const tableConfig = ref({
border: true,
height: '74vh',
})
const pyjRef = ref();
const handleColumnDragEnd = (data: any) => {
columns.value = data.columns;
}
const handleInputFocus = (row: any) => {
pyjRef.value.openDictSelector();
console.log('row', row);
}
const selectItem = (item: any) => {
}
const selectedRows = ref([]);
const handleSelectionChange = (selection: any) => {
console.log(selection);
selectedRows.value = selection;
}
const addItem = () => {
pyjRef.value.openDictSelector();
}
const deleteItem = () => {
if (selectedRows.value.length === 0) return ElMessage.warning('请选择要删除的培养基!');
ElMessageBox.confirm(
`确定删除当前${selectedRows.value.length}个培养基?`,
'提示',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}
).then(() => {
})
}
const printHandle = () => {
@ -85,8 +121,8 @@ watch(() => props.labPat, (newValue) => {
<style scoped lang="scss">
.top-btns {
margin-bottom: .3125rem;
display: flex;
align-items: center;
margin: .3125rem;
}
</style>

View File

@ -604,7 +604,7 @@ const ymColumns = ref([
{ label: "Mic", prop: "mic", align: 'center', visible: true, width: 60, slot: 'mic' },
{ 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: "jgbz", align: 'center', visible: true, slot: 'jgbz', width: 180, showOverflowTooltip: false },
{ label: "折点", prop: "ckz", align: 'center', visible: true, },
{ label: "分组", prop: "bz", align: 'center', visible: true, slot: 'bz' },
{ label: "专家值", prop: "txtresult", align: 'center', visible: true, slot: 'txtresult' },

View File

@ -480,7 +480,9 @@ const handlePrev = () => {
if (index !== -1) {
highlightRowIndex.value = index;
const row = labPatList.value[index];
if (activeTab.value == 'LabPatList') {
labPatListRef.value.setCurrentRow(row);
}
selectJob(row);
} else {
handleCreate();
@ -489,7 +491,9 @@ const handlePrev = () => {
if (highlightRowIndex.value > 0) {
highlightRowIndex.value--;
const row = labPatList.value[highlightRowIndex.value];
if (activeTab.value == 'LabPatList') {
labPatListRef.value.setCurrentRow(row);
}
selectJob(row);
}
}
@ -505,7 +509,9 @@ const handleNext = () => {
if (index !== -1) {
highlightRowIndex.value = index;
const row = labPatList.value[index];
if (activeTab.value == 'LabPatList') {
labPatListRef.value.setCurrentRow(row);
}
selectJob(row);
} else {
handleCreate();
@ -514,7 +520,9 @@ const handleNext = () => {
if (highlightRowIndex.value < labPatList.value.length - 1) {
highlightRowIndex.value++;
const row = labPatList.value[highlightRowIndex.value];
if (activeTab.value == 'LabPatList') {
labPatListRef.value.setCurrentRow(row);
}
selectJob(row);
} else {
queryParams.value.ybh = getNextNumber(queryParams.value.ybh) as string;