This commit is contained in:
parent
ccce5849f8
commit
04c2ffe8de
@ -395,6 +395,9 @@
|
|||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.el-table--default .cell {
|
||||||
|
padding: 0 0 0 .3125rem !important;
|
||||||
|
}
|
||||||
|
|
||||||
// 表格input宽度,表格select宽度
|
// 表格input宽度,表格select宽度
|
||||||
.full-width-input .el-input__inner .el-select__inner {
|
.full-width-input .el-input__inner .el-select__inner {
|
||||||
@ -411,6 +414,7 @@
|
|||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
background: transparent !important;
|
background: transparent !important;
|
||||||
padding: 0 !important;
|
padding: 0 !important;
|
||||||
|
padding-left: .3125rem !important;
|
||||||
outline: none;
|
outline: none;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
|
|||||||
@ -26,7 +26,10 @@
|
|||||||
<el-table-column v-if="!item.type && item.slot && item.visible" :prop="item.prop" :label="item.label"
|
<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'"
|
:width="item.width" :min-width="item.minWidth" :fixed="item.fixed" :align="item.align || 'left'"
|
||||||
:sortable="item.sortable" :show-overflow-tooltip="item.showOverflowTooltip !== false">
|
: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" />
|
<slot :name="item.slot" :row="scope.row" :$index="scope.$index" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|||||||
@ -100,9 +100,12 @@ const getInfoList = () => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
watch(() => props.queryParams, (newValue) => {
|
watch(() => queryParams, (newValue) => {
|
||||||
getInfoList()
|
getInfoList()
|
||||||
}, { immediate: true })
|
}, {
|
||||||
|
immediate: true,
|
||||||
|
deep: true
|
||||||
|
})
|
||||||
|
|
||||||
const getMxInfo = (row: any) => {
|
const getMxInfo = (row: any) => {
|
||||||
const data = {
|
const data = {
|
||||||
|
|||||||
@ -13,7 +13,6 @@ const info = ref('')
|
|||||||
const getClinicalInfo = (data: any) => {
|
const getClinicalInfo = (data: any) => {
|
||||||
clinicInfo(data).then((res: any) => {
|
clinicInfo(data).then((res: any) => {
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
console.log('临床意义==>', res.data);
|
|
||||||
info.value = res.data
|
info.value = res.data
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -26,7 +25,6 @@ onMounted(() => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
emitter.on('refreshClinical', (data) => {
|
emitter.on('refreshClinical', (data) => {
|
||||||
console.log('data==>', data);
|
|
||||||
getClinicalInfo(data)
|
getClinicalInfo(data)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@ -58,7 +58,10 @@ const getCombination = () => {
|
|||||||
};
|
};
|
||||||
watch(() => props.queryParams.yq, (newValue) => {
|
watch(() => props.queryParams.yq, (newValue) => {
|
||||||
getCombination()
|
getCombination()
|
||||||
}, { immediate: true })
|
}, {
|
||||||
|
immediate: true,
|
||||||
|
deep: true
|
||||||
|
})
|
||||||
|
|
||||||
const changeLxsr = (row: any) => {
|
const changeLxsr = (row: any) => {
|
||||||
const lxsrs = tableData.value.filter((item: any) => item.lxsr).map((item: any) => item.mbmc);
|
const lxsrs = tableData.value.filter((item: any) => item.lxsr).map((item: any) => item.mbmc);
|
||||||
|
|||||||
@ -203,7 +203,10 @@ const getList = () => {
|
|||||||
|
|
||||||
watch(() => props.queryParams, (newValue) => {
|
watch(() => props.queryParams, (newValue) => {
|
||||||
getList()
|
getList()
|
||||||
}, { immediate: true })
|
}, {
|
||||||
|
immediate: true,
|
||||||
|
deep: true
|
||||||
|
})
|
||||||
|
|
||||||
const handleRowClick = (row: any) => {
|
const handleRowClick = (row: any) => {
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
|
|||||||
@ -171,7 +171,10 @@ const getOthersInfo = () => {
|
|||||||
|
|
||||||
watch(() => props.queryParams, (newValue) => {
|
watch(() => props.queryParams, (newValue) => {
|
||||||
getOthersInfo()
|
getOthersInfo()
|
||||||
}, { immediate: true })
|
}, {
|
||||||
|
immediate: true,
|
||||||
|
deep: true
|
||||||
|
})
|
||||||
|
|
||||||
// 获取明细
|
// 获取明细
|
||||||
const handleRowClick = (row: any) => {
|
const handleRowClick = (row: any) => {
|
||||||
|
|||||||
@ -56,7 +56,10 @@ const getReexamination = () => {
|
|||||||
|
|
||||||
watch(() => queryParams.value, () => {
|
watch(() => queryParams.value, () => {
|
||||||
getReexamination();
|
getReexamination();
|
||||||
}, { immediate: true })
|
}, {
|
||||||
|
immediate: true,
|
||||||
|
deep: true
|
||||||
|
})
|
||||||
|
|
||||||
const tableRef = ref();
|
const tableRef = ref();
|
||||||
const itemDictRef = ref(); // DictInput组件引用
|
const itemDictRef = ref(); // DictInput组件引用
|
||||||
@ -111,7 +114,6 @@ const addRowFromDict = async (rowData: any) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleCsjgEnter = (row: any) => {
|
const handleCsjgEnter = (row: any) => {
|
||||||
console.log('复查结果修改', row);
|
|
||||||
saveRedo(row)
|
saveRedo(row)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -43,7 +43,10 @@ const getResultGraph = () => {
|
|||||||
|
|
||||||
watch(() => props.queryParams, (newValue) => {
|
watch(() => props.queryParams, (newValue) => {
|
||||||
getResultGraph()
|
getResultGraph()
|
||||||
}, { immediate: true })
|
}, {
|
||||||
|
immediate: true,
|
||||||
|
deep: true
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
|||||||
@ -195,7 +195,10 @@ const getInfo = () => {
|
|||||||
|
|
||||||
watch(() => props.queryParams, (newValue) => {
|
watch(() => props.queryParams, (newValue) => {
|
||||||
getInfo()
|
getInfo()
|
||||||
}, { immediate: true })
|
}, {
|
||||||
|
immediate: true,
|
||||||
|
deep: true
|
||||||
|
})
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
const data = { status: 0, del_flag: 0, pageSize: 1000, pageNum: 1 }
|
const data = { status: 0, del_flag: 0, pageSize: 1000, pageNum: 1 }
|
||||||
|
|||||||
@ -73,16 +73,12 @@
|
|||||||
@previewHandle="previewHandle" />
|
@previewHandle="previewHandle" />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="培养基接种" name="third">
|
<el-tab-pane label="培养基接种" name="third">
|
||||||
<Byj :labPat="labInfo" :labPatKey="queryParams" />
|
<Pyj :labPat="labInfo" :labPatKey="queryParams" />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="操作记录" name="fourth">
|
<el-tab-pane label="操作记录" name="fourth">
|
||||||
<Record :labPat="labInfo" :labPatKey="queryParams" />
|
<Record :labPat="labInfo" :labPatKey="queryParams" />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
|
|
||||||
<!-- <LabResult ref="labResultRef" v-model:labPat="labInfo" :labPatKey="queryParams" :dictData="dictData"
|
|
||||||
:labResutsData="labResuts" @fetchLabResults="resultsHandle" @changeStatus="changeStatus"
|
|
||||||
@previewHandle="previewHandle" /> -->
|
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
@ -115,7 +111,11 @@
|
|||||||
<el-radio :value="60">近60天</el-radio>
|
<el-radio :value="60">近60天</el-radio>
|
||||||
<el-radio :value="90">近90天</el-radio>
|
<el-radio :value="90">近90天</el-radio>
|
||||||
<el-radio :value="7">近7天</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-radio-group>
|
||||||
<el-date-picker v-model="queryParams.jyrq" type="date" :size="aotuSize" @change="fetchlabPatList"
|
<el-date-picker v-model="queryParams.jyrq" type="date" :size="aotuSize" @change="fetchlabPatList"
|
||||||
style="width: 9.375rem;" />
|
style="width: 9.375rem;" />
|
||||||
@ -124,9 +124,6 @@
|
|||||||
:tableKey="queryParams" :dictData="dictData" @search="searchJobs" />
|
:tableKey="queryParams" :dictData="dictData" @search="searchJobs" />
|
||||||
|
|
||||||
<div class="button-group">
|
<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"
|
<el-pagination v-model:current-page="queryParams.pageNum" v-model:page-size="queryParams.pageSize"
|
||||||
:page-sizes="[300, 600, 1000]" :size="aotuSize" background
|
:page-sizes="[300, 600, 1000]" :size="aotuSize" background
|
||||||
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="handleSizeChange"
|
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';
|
import tabView from '@/components/tabViews/index.vue';
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import iFrame from "@/components/iFrame/index.vue";
|
import iFrame from "@/components/iFrame/index.vue";
|
||||||
// @ts-ignore
|
|
||||||
import LabResult from './labresult/index.vue';
|
|
||||||
import LabPatList from './labpatlist.vue';
|
import LabPatList from './labpatlist.vue';
|
||||||
import History from '../components/history/index.vue'
|
import History from '../components/history/index.vue'
|
||||||
import Others from '../components/others/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 ZbReport from './labresult/zbReport.vue';
|
||||||
import CbReport from './labresult/cbReport.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';
|
import Record from './labresult/record.vue';
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import { comDict } from '@/utils/dict'
|
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 total = ref(0)
|
||||||
const ybs = ref(0)
|
const ybs = ref(0)
|
||||||
@ -249,9 +244,7 @@ const searchText = ref('')
|
|||||||
const rules = ref([])
|
const rules = ref([])
|
||||||
const instrGroupOptions = ref<any[]>([])
|
const instrGroupOptions = ref<any[]>([])
|
||||||
const instrOptions = ref<{ yq: string; yqmc: string }[]>([])
|
const instrOptions = ref<{ yq: string; yqmc: string }[]>([])
|
||||||
|
|
||||||
const pdfUrl = ref('')
|
const pdfUrl = ref('')
|
||||||
|
|
||||||
// 初始查询参数(可选)
|
// 初始查询参数(可选)
|
||||||
const initialParams = {}
|
const initialParams = {}
|
||||||
|
|
||||||
@ -437,6 +430,7 @@ const lastRow: any = ref({})
|
|||||||
const ybhChangeTb = (val: string) => {
|
const ybhChangeTb = (val: string) => {
|
||||||
// console.log('val==>', val);
|
// console.log('val==>', val);
|
||||||
labInfo.value.ybh = val
|
labInfo.value.ybh = val
|
||||||
|
queryParams.value.ybh = val
|
||||||
handleQuery();
|
handleQuery();
|
||||||
}
|
}
|
||||||
const handleQuery = () => {
|
const handleQuery = () => {
|
||||||
@ -445,6 +439,7 @@ const handleQuery = () => {
|
|||||||
highlightRowIndex.value = -1;
|
highlightRowIndex.value = -1;
|
||||||
ElMessage.warning('请输入样本编号')
|
ElMessage.warning('请输入样本编号')
|
||||||
labInfo.value.ybh = lastRow.value.ybh
|
labInfo.value.ybh = lastRow.value.ybh
|
||||||
|
queryParams.value.ybh = lastRow.value.ybh
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// queryParams.value = { ...queryParams.value };
|
// queryParams.value = { ...queryParams.value };
|
||||||
@ -526,11 +521,14 @@ const handlePrev = () => {
|
|||||||
if (!lbFlag.value) {
|
if (!lbFlag.value) {
|
||||||
const ybh = getPreviousNumber(labInfo.value.ybh) as string;
|
const ybh = getPreviousNumber(labInfo.value.ybh) as string;
|
||||||
labInfo.value.ybh = ybh;
|
labInfo.value.ybh = ybh;
|
||||||
|
queryParams.value.ybh = ybh;
|
||||||
const index = labPatList.value.findIndex((item: any) => item.ybh == ybh)
|
const index = labPatList.value.findIndex((item: any) => item.ybh == ybh)
|
||||||
if (index !== -1) {
|
if (index !== -1) {
|
||||||
highlightRowIndex.value = index;
|
highlightRowIndex.value = index;
|
||||||
const row = labPatList.value[index];
|
const row = labPatList.value[index];
|
||||||
labPatListRef.value.setCurrentRow(row);
|
if (activeTab.value == 'LabPatList') {
|
||||||
|
labPatListRef.value.setCurrentRow(row);
|
||||||
|
}
|
||||||
selectJob(row);
|
selectJob(row);
|
||||||
} else {
|
} else {
|
||||||
handleCreate();
|
handleCreate();
|
||||||
@ -539,7 +537,9 @@ const handlePrev = () => {
|
|||||||
if (highlightRowIndex.value > 0) {
|
if (highlightRowIndex.value > 0) {
|
||||||
highlightRowIndex.value--;
|
highlightRowIndex.value--;
|
||||||
const row = labPatList.value[highlightRowIndex.value];
|
const row = labPatList.value[highlightRowIndex.value];
|
||||||
labPatListRef.value.setCurrentRow(row);
|
if (activeTab.value == 'LabPatList') {
|
||||||
|
labPatListRef.value.setCurrentRow(row);
|
||||||
|
}
|
||||||
selectJob(row);
|
selectJob(row);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -551,11 +551,14 @@ const handleNext = () => {
|
|||||||
if (!lbFlag.value) {
|
if (!lbFlag.value) {
|
||||||
const ybh = getNextNumber(labInfo.value.ybh) as string;
|
const ybh = getNextNumber(labInfo.value.ybh) as string;
|
||||||
labInfo.value.ybh = ybh;
|
labInfo.value.ybh = ybh;
|
||||||
|
queryParams.value.ybh = ybh;
|
||||||
const index = labPatList.value.findIndex((item: any) => item.ybh == ybh)
|
const index = labPatList.value.findIndex((item: any) => item.ybh == ybh)
|
||||||
if (index !== -1) {
|
if (index !== -1) {
|
||||||
highlightRowIndex.value = index;
|
highlightRowIndex.value = index;
|
||||||
const row = labPatList.value[index];
|
const row = labPatList.value[index];
|
||||||
labPatListRef.value.setCurrentRow(row);
|
if (activeTab.value == 'LabPatList') {
|
||||||
|
labPatListRef.value.setCurrentRow(row);
|
||||||
|
}
|
||||||
selectJob(row);
|
selectJob(row);
|
||||||
} else {
|
} else {
|
||||||
handleCreate();
|
handleCreate();
|
||||||
@ -564,10 +567,13 @@ const handleNext = () => {
|
|||||||
if (highlightRowIndex.value < labPatList.value.length - 1) {
|
if (highlightRowIndex.value < labPatList.value.length - 1) {
|
||||||
highlightRowIndex.value++;
|
highlightRowIndex.value++;
|
||||||
const row = labPatList.value[highlightRowIndex.value];
|
const row = labPatList.value[highlightRowIndex.value];
|
||||||
labPatListRef.value.setCurrentRow(row);
|
if (activeTab.value == 'LabPatList') {
|
||||||
|
labPatListRef.value.setCurrentRow(row);
|
||||||
|
}
|
||||||
selectJob(row);
|
selectJob(row);
|
||||||
} else {
|
} else {
|
||||||
labInfo.value.ybh = getNextNumber(labInfo.value.ybh) as string;
|
labInfo.value.ybh = getNextNumber(labInfo.value.ybh) as string;
|
||||||
|
queryParams.value.ybh = labInfo.value.ybh;
|
||||||
handleCreate();
|
handleCreate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -575,6 +581,7 @@ const handleNext = () => {
|
|||||||
// 最后一个样本
|
// 最后一个样本
|
||||||
const handleLast = () => {
|
const handleLast = () => {
|
||||||
labInfo.value.ybh = labPatList.value[labPatList.value.length - 1].ybh;
|
labInfo.value.ybh = labPatList.value[labPatList.value.length - 1].ybh;
|
||||||
|
queryParams.value.ybh = labPatList.value[labPatList.value.length - 1].ybh;
|
||||||
handleNext();
|
handleNext();
|
||||||
}
|
}
|
||||||
const batchRef = ref()
|
const batchRef = ref()
|
||||||
|
|||||||
160
src/views/liswork/micro/labresult/components/pyjDict.vue
Normal file
160
src/views/liswork/micro/labresult/components/pyjDict.vue
Normal 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>
|
||||||
@ -1,22 +1,31 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<div class="top-btns">
|
<div class="top-btns">
|
||||||
<el-button type="primary" plain size="small" @click="printHandle">打印培养基条码</el-button>
|
<el-button type="primary" plain :size="autoSize" @click="addItem">新增</el-button>
|
||||||
<el-checkbox v-model="checked">自动打印培养基条码</el-checkbox>
|
<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>
|
</div>
|
||||||
<CustomTable ref="tableRef" :data="tableData" :columns="columns" :config="tableConfig" :enable-column-drag="true"
|
<CustomTable ref="tableRef" :data="tableData" :columns="columns" :config="tableConfig" :enable-column-drag="true"
|
||||||
@column-drag-end="handleColumnDragEnd" @selection-change="handleSelectionChange">
|
@column-drag-end="handleColumnDragEnd" @selection-change="handleSelectionChange">
|
||||||
<template #mediumname="{ column }">
|
<template #mediumnameHeadTitle="{ column }">
|
||||||
培养基 {{ tableData.length }}个
|
培养基 {{ tableData?.length }}个
|
||||||
|
</template>
|
||||||
|
<template #mediumname="{ row }">
|
||||||
|
<el-input v-model="row.mediumname" size="small" class="full-width-input" @dblclick="handleInputFocus(row)" />
|
||||||
</template>
|
</template>
|
||||||
</CustomTable>
|
</CustomTable>
|
||||||
|
<PyjDict ref="pyjRef" :dialogTitle="'培养基选择'" @select="selectItem" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import CustomTable from '@/components/elTable/index.vue';
|
import CustomTable from '@/components/elTable/index.vue';
|
||||||
import { getmediumList } from '@/api/liswork/micro/index';
|
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({
|
const props = defineProps({
|
||||||
labPat: {
|
labPat: {
|
||||||
type: Object,
|
type: Object,
|
||||||
@ -36,7 +45,7 @@ const tableRef = ref();
|
|||||||
const tableData = ref([]);
|
const tableData = ref([]);
|
||||||
const columns = ref([
|
const columns = ref([
|
||||||
{ type: "selection", width: 40, align: 'center', visible: true },
|
{ 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: "sheetdate", align: 'center', visible: true, width: 120 },
|
||||||
{ label: "接种人", prop: "sheetuser", align: 'center', visible: true, width: 60 },
|
{ label: "接种人", prop: "sheetuser", align: 'center', visible: true, width: 60 },
|
||||||
{ label: "培养基结果", prop: "mediu", align: 'center', visible: true, },
|
{ label: "培养基结果", prop: "mediu", align: 'center', visible: true, },
|
||||||
@ -48,13 +57,40 @@ const tableConfig = ref({
|
|||||||
border: true,
|
border: true,
|
||||||
height: '74vh',
|
height: '74vh',
|
||||||
})
|
})
|
||||||
|
const pyjRef = ref();
|
||||||
const handleColumnDragEnd = (data: any) => {
|
const handleColumnDragEnd = (data: any) => {
|
||||||
columns.value = data.columns;
|
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) => {
|
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 = () => {
|
const printHandle = () => {
|
||||||
@ -85,8 +121,8 @@ watch(() => props.labPat, (newValue) => {
|
|||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.top-btns {
|
.top-btns {
|
||||||
margin-bottom: .3125rem;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
margin: .3125rem;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@ -604,7 +604,7 @@ const ymColumns = ref([
|
|||||||
{ label: "Mic", prop: "mic", align: 'center', visible: true, width: 60, slot: 'mic' },
|
{ 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: "KB", prop: "rad", align: 'center', visible: true, width: 50, slot: 'rad' },
|
||||||
{ label: "结果", prop: "csjg", align: 'center', visible: true, width: 60, slot: 'csjg' },
|
{ 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: "ckz", align: 'center', visible: true, },
|
||||||
{ label: "分组", prop: "bz", align: 'center', visible: true, slot: 'bz' },
|
{ label: "分组", prop: "bz", align: 'center', visible: true, slot: 'bz' },
|
||||||
{ label: "专家值", prop: "txtresult", align: 'center', visible: true, slot: 'txtresult' },
|
{ label: "专家值", prop: "txtresult", align: 'center', visible: true, slot: 'txtresult' },
|
||||||
|
|||||||
@ -480,7 +480,9 @@ const handlePrev = () => {
|
|||||||
if (index !== -1) {
|
if (index !== -1) {
|
||||||
highlightRowIndex.value = index;
|
highlightRowIndex.value = index;
|
||||||
const row = labPatList.value[index];
|
const row = labPatList.value[index];
|
||||||
labPatListRef.value.setCurrentRow(row);
|
if (activeTab.value == 'LabPatList') {
|
||||||
|
labPatListRef.value.setCurrentRow(row);
|
||||||
|
}
|
||||||
selectJob(row);
|
selectJob(row);
|
||||||
} else {
|
} else {
|
||||||
handleCreate();
|
handleCreate();
|
||||||
@ -489,7 +491,9 @@ const handlePrev = () => {
|
|||||||
if (highlightRowIndex.value > 0) {
|
if (highlightRowIndex.value > 0) {
|
||||||
highlightRowIndex.value--;
|
highlightRowIndex.value--;
|
||||||
const row = labPatList.value[highlightRowIndex.value];
|
const row = labPatList.value[highlightRowIndex.value];
|
||||||
labPatListRef.value.setCurrentRow(row);
|
if (activeTab.value == 'LabPatList') {
|
||||||
|
labPatListRef.value.setCurrentRow(row);
|
||||||
|
}
|
||||||
selectJob(row);
|
selectJob(row);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -505,7 +509,9 @@ const handleNext = () => {
|
|||||||
if (index !== -1) {
|
if (index !== -1) {
|
||||||
highlightRowIndex.value = index;
|
highlightRowIndex.value = index;
|
||||||
const row = labPatList.value[index];
|
const row = labPatList.value[index];
|
||||||
labPatListRef.value.setCurrentRow(row);
|
if (activeTab.value == 'LabPatList') {
|
||||||
|
labPatListRef.value.setCurrentRow(row);
|
||||||
|
}
|
||||||
selectJob(row);
|
selectJob(row);
|
||||||
} else {
|
} else {
|
||||||
handleCreate();
|
handleCreate();
|
||||||
@ -514,7 +520,9 @@ const handleNext = () => {
|
|||||||
if (highlightRowIndex.value < labPatList.value.length - 1) {
|
if (highlightRowIndex.value < labPatList.value.length - 1) {
|
||||||
highlightRowIndex.value++;
|
highlightRowIndex.value++;
|
||||||
const row = labPatList.value[highlightRowIndex.value];
|
const row = labPatList.value[highlightRowIndex.value];
|
||||||
labPatListRef.value.setCurrentRow(row);
|
if (activeTab.value == 'LabPatList') {
|
||||||
|
labPatListRef.value.setCurrentRow(row);
|
||||||
|
}
|
||||||
selectJob(row);
|
selectJob(row);
|
||||||
} else {
|
} else {
|
||||||
queryParams.value.ybh = getNextNumber(queryParams.value.ybh) as string;
|
queryParams.value.ybh = getNextNumber(queryParams.value.ybh) as string;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user