2025-10-16 11:20:50 +08:00
|
|
|
<template>
|
2025-10-22 17:36:25 +08:00
|
|
|
<div class="bination_box">
|
2025-10-28 17:22:53 +08:00
|
|
|
<CustomTable ref="tableRef" :data="tableData" :columns="columns" :config="tableConfig"
|
|
|
|
|
@row-dblclick="handleRowDblclick">
|
2025-10-22 17:36:25 +08:00
|
|
|
<template #lxsr="{ row }">
|
2025-10-28 17:22:53 +08:00
|
|
|
<el-checkbox v-model="row.lxsr" @change="changeLxsr(row)" />
|
2025-10-22 17:36:25 +08:00
|
|
|
</template>
|
|
|
|
|
<template #zdsr="{ row }">
|
2025-10-24 17:36:06 +08:00
|
|
|
<el-checkbox :model-value="row.zdsr == 'Y'" readonly />
|
2025-10-22 17:36:25 +08:00
|
|
|
</template>
|
|
|
|
|
</CustomTable>
|
2025-10-16 11:20:50 +08:00
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
2025-10-22 17:36:25 +08:00
|
|
|
import { ref, watch, toRefs, onMounted, computed } from 'vue'
|
|
|
|
|
import { inputmdl } from "@/api/liswork/work/LisWork";
|
|
|
|
|
import CustomTable from '@/components/elTable/index.vue'
|
2025-10-28 17:22:53 +08:00
|
|
|
import emitter from '@/utils/mitt'
|
|
|
|
|
import { useCommonStore } from '@/store/modules/commonStore';
|
2025-10-22 17:36:25 +08:00
|
|
|
const props = defineProps({
|
|
|
|
|
// 主键
|
|
|
|
|
queryParams: {
|
|
|
|
|
type: Object,
|
|
|
|
|
default: {}
|
|
|
|
|
},
|
|
|
|
|
})
|
2025-10-28 17:22:53 +08:00
|
|
|
const mbStore = useCommonStore();
|
2025-10-22 17:36:25 +08:00
|
|
|
const { queryParams } = toRefs(props);
|
|
|
|
|
const tableData = ref([])
|
|
|
|
|
const columns = ref([
|
|
|
|
|
{ prop: 'mbmc', label: '批输入模板', visible: true, align: 'center', },
|
|
|
|
|
{ prop: 'yblx', label: '标本类型', visible: true, align: 'center', width: 80 },
|
|
|
|
|
{ prop: 'lxsr', label: '连续输入', visible: true, align: 'center', width: 80, slot: 'lxsr' },
|
|
|
|
|
{ prop: 'zdsr', label: '自动输入', visible: true, align: 'center', width: 80, slot: 'zdsr' },
|
|
|
|
|
{ prop: 'qsybh', label: '自动起始号', visible: true, align: 'center', width: 100 },
|
|
|
|
|
{ prop: 'jsybh', label: '自动结束号', visible: true, align: 'center', width: 100 },
|
|
|
|
|
{ prop: 'srbh', label: '输入编号', visible: true, align: 'center', width: 100 },
|
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
// 左侧表格配置
|
|
|
|
|
const tableConfig = ref({
|
|
|
|
|
border: true, // 边框
|
|
|
|
|
height: '', // 高度
|
|
|
|
|
highlightCurrentRow: true, // 高亮当前行
|
|
|
|
|
})
|
|
|
|
|
const getCombination = () => {
|
|
|
|
|
inputmdl(queryParams.value).then((res: any) => {
|
|
|
|
|
if (res.code == 0) {
|
2025-10-28 17:22:53 +08:00
|
|
|
tableData.value = res.data?.map((item: any) => {
|
|
|
|
|
return {
|
|
|
|
|
...item,
|
|
|
|
|
lxsr: mbStore.lxsrs.includes(item.mbmc) ? true : false,
|
|
|
|
|
}
|
|
|
|
|
})
|
2025-10-22 17:36:25 +08:00
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
};
|
2025-10-28 17:22:53 +08:00
|
|
|
watch(() => props.queryParams.yq, (newValue) => {
|
2025-10-22 17:36:25 +08:00
|
|
|
getCombination()
|
|
|
|
|
}, { immediate: true })
|
|
|
|
|
|
2025-10-28 17:22:53 +08:00
|
|
|
const changeLxsr = (row: any) => {
|
|
|
|
|
const lxsrs = tableData.value.filter((item: any) => item.lxsr).map((item: any) => item.mbmc);
|
|
|
|
|
console.log('lxsrs==>', lxsrs);
|
|
|
|
|
mbStore.setLxsrList(lxsrs);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const handleRowDblclick = (row: any) => {
|
|
|
|
|
emitter.emit('dbMbHandle', row);
|
|
|
|
|
}
|
2025-10-16 11:20:50 +08:00
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
2025-10-22 17:36:25 +08:00
|
|
|
<style scoped lang="scss">
|
|
|
|
|
.bination_box {
|
|
|
|
|
height: 82vh;
|
|
|
|
|
overflow-y: auto;
|
|
|
|
|
}
|
|
|
|
|
</style>
|