288 lines
11 KiB
Vue
Raw Normal View History

2026-02-09 17:37:03 +08:00
<!-- 批量审核 -->
<template>
2026-02-10 17:36:00 +08:00
<div class="app-container">
2026-05-12 18:01:47 +08:00
<el-form ref="form" :model="formData" class="query-form" label-width="6.25rem" inline>
<el-form-item label="医疗机构:" prop="yljg">
<SelectTable v-model:data="formData.yljg" :fields="fields" width="150px" dict-type="HOS" />
2026-02-10 17:36:00 +08:00
</el-form-item>
2026-05-12 18:01:47 +08:00
<el-form-item label="仪器分组:" prop="lisgroup">
<SelectTable v-model:data="formData.lisgroup" :fields="fields" width="150px" dict-type="GROUP"
@get-data-value="getYqConfig()" />
2026-02-10 17:36:00 +08:00
</el-form-item>
2026-05-12 18:01:47 +08:00
<el-form-item label="检验仪器:" prop="yq">
<SelectTable v-model:data="formData.yq" :tableData="instrOptions" width="150px" placeholder="请选择仪器"
@getDataValue="getYQList" />
2026-02-10 17:36:00 +08:00
</el-form-item>
2026-05-12 18:01:47 +08:00
<el-form-item label="申请科室:" prop="ksdh">
<SelectTable v-model:data="formData.ksdh" :fields="fields" width="150px" dict-type="DP" />
2026-02-10 17:36:00 +08:00
</el-form-item>
2026-05-12 18:01:47 +08:00
<el-form-item label="检验医师:" prop="yhdh">
<el-input placeholder="请填写检验医师" v-model="formData.yhdh" style="width: 150px;" />
2026-02-10 17:36:00 +08:00
</el-form-item>
2026-05-12 18:01:47 +08:00
<el-form-item label="病人来源:" prop="brly">
<SelectTable v-model:data="formData.brly" :fields="fields" width="150px" dict-type="PT" />
2026-02-11 17:19:40 +08:00
</el-form-item>
2026-05-12 18:01:47 +08:00
<el-form-item label="标本日期:" prop="jyrq">
<el-date-picker v-model="formData.jyrq1" type="date" style="width: 150px;" />&nbsp;-&nbsp;
<el-date-picker v-model="formData.jyrq2" type="date" style="width: 150px;" />
2026-02-10 17:36:00 +08:00
</el-form-item>
2026-05-12 18:01:47 +08:00
<el-form-item label="标本号:" prop="ybh">
<el-input placeholder="开始标本号" v-model="formData.ybh1" style="width: 120px;" /> &nbsp;-&nbsp;
<el-input placeholder="结束标本号" v-model="formData.ybh2" style="width: 120px;" />
2026-02-10 17:36:00 +08:00
</el-form-item>
2026-05-12 18:01:47 +08:00
<el-form-item label="审核标志:">
2026-02-11 17:19:40 +08:00
<el-select v-model="formData.jgbz" style="width: 150px" clearable>
2026-02-10 17:36:00 +08:00
<el-option v-for="item in jgbzOption" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-checkbox v-model="formData.jzbz" label="急诊报告" true-value="1" false-value="0"></el-checkbox>
</el-form-item>
</el-form>
2026-05-12 18:01:47 +08:00
<div class="mb5">
<el-button type="primary" @click="getList">查询</el-button>
<el-button type="primary" :disabled="!multiple" @click="checkData">批量审核</el-button>
<el-button type="primary" :disabled="!multiple" @click="cancelCheck">取消审核</el-button>
</div>
2026-02-10 17:36:00 +08:00
<div class="table-container">
2026-05-12 18:01:47 +08:00
<el-row :gutter="10">
2026-02-11 17:19:40 +08:00
<el-col :span="18">
2026-02-12 16:40:57 +08:00
<CustomTable ref="tableRef" :data="tableData" :columns="columns" :config="tableConfig" :loading="loading"
2026-05-12 18:01:47 +08:00
@selection-change="selectionChange" @row-click="tableRowClick">
2026-02-11 17:19:40 +08:00
<template #jgbz="{ row }">
<span>{{ displayJGBZ(row.jgbz) }}</span>
</template>
<template #brly="{ row }">
<span>{{ formatDict(row.brly, 'PT') }}</span>
</template>
<template #brxb="{ row }">
<span>{{ displayBRXB(row.brxb) }}</span>
</template>
<template #brnl="{ row }">
<span>{{ displayBRNL(row.nl, row.nldw) }}</span>
</template>
<template #ksdh="{ row }">
<span>{{ formatDict(row.ksdh, 'DP') }}</span>
</template>
<template #sjys="{ row }">
<span>{{ formatDict(row.sjys, 'SRD') }}</span>
</template>
<template #yblx="{ row }">
<span>{{ formatDict(row.yblx, 'BT') }}</span>
</template>
<template #dybz="{ row }">
<span>{{ row.dybz === "1" ? "已打印" : "未打印" }}</span>
</template>
</CustomTable>
</el-col>
<el-col :span="6">
<LabResult v-model="paramObj" v-if="!isXJY" />
<LabResultMed v-model="paramObj" v-if="isXJY" />
</el-col>
</el-row>
2026-02-10 17:36:00 +08:00
</div>
</div>
2026-02-09 17:37:03 +08:00
</template>
<script setup lang="ts">
import CustomTable from '@/components/elTable/index.vue'
import YQSelectTable from '@/components/SelectTable/YQSelectTable/index.vue';
import SelectTable from '@/components/SelectTable/index.vue';
2026-02-10 17:36:00 +08:00
import { batchCheckService, queryBatchCheckListService, cancelBatchCheckService } from '@/api/liswork/batchCheck/batchCheckApi';
import dayjs from 'dayjs';
import { formatDict, getDictData } from '@/hooks'
import { displayBRNL, displayBRXB } from '@/utils/czUtil/lisUtil'
2026-02-11 17:19:40 +08:00
import useUserStore from '@/store/modules/user';
import LabResult from './LabResult.vue';
import LabResultMed from './LabResultMed.vue';
2026-05-12 18:01:47 +08:00
import { getGroupInstrdList } from '@/api/liswork/work/LisWork';
import { useCommonStore } from '@/store/modules/commonStore';
2026-02-11 17:19:40 +08:00
2026-05-12 18:01:47 +08:00
const tableRef = ref();
const msg = ref('') //审核后结果显示
const tableData = ref([])
const userStore = useUserStore()
const commonStore = useCommonStore()
const paramObj = ref<any>(null) // 用于传递给 LabResult 组件的参数对象
const isXJY = ref(false)
const loading = ref(false)
2026-02-10 17:36:00 +08:00
const formData = ref({
2026-05-12 18:01:47 +08:00
lisgroup: commonStore.defaultConfig.lisgroupid, //仪器分组
yljg: userStore.sysLoginParam.loginYLJG,
2026-02-10 17:36:00 +08:00
ksdh: '', //申请科室
2026-05-12 18:01:47 +08:00
yq: commonStore.defaultConfig.defaultinstr,
jyrq1: dayjs().format('YYYY-MM-DD'), //标本日期开始
jyrq2: dayjs().format('YYYY-MM-DD'), //标本日期结束
2026-02-10 17:36:00 +08:00
yhdh: '', //检验医师
brly: '', //病人来源
ybh1: '', //标本号开始
ybh2: '', //标本号结束
jgbz: '0', //审核标志
jzbz: 0 //急诊标志
})
2026-02-09 17:37:03 +08:00
const columns = ref([
2026-02-10 17:36:00 +08:00
{ type: 'selection', title: '选择', visible: true, align: 'center', width: 40 },
{ prop: 'jgbz', label: '审核标志', visible: true, align: 'center', slot: 'jgbz' },
{ prop: 'yqmc', label: '检验仪器', visible: true, align: 'center', width: 150 },
{ prop: 'jyrq', label: '检验日期', visible: true, align: 'center', width: 150 },
2026-02-09 17:37:03 +08:00
{ prop: 'ybh', label: '样本号', visible: true, align: 'center' },
{ prop: 'brxm', label: '姓名', visible: true, align: 'center' },
2026-02-10 17:36:00 +08:00
{ prop: 'brdh', label: '住院号', visible: true, align: 'center' },
2026-02-09 17:37:03 +08:00
{ prop: 'sqh', label: '申请号', visible: true, align: 'center' },
2026-02-10 17:36:00 +08:00
{ prop: 'brly', label: '病人类型', visible: true, align: 'center', slot: 'brly' },
{ prop: 'brxb', label: '性别', visible: true, align: 'center', slot: 'brxb' },
{ prop: 'brnl', label: '年龄', visible: true, align: 'center', slot: 'brnl' },
{ prop: 'ksdh', label: '科室', visible: true, align: 'center', slot: 'ksdh' },
2026-02-09 17:37:03 +08:00
{ prop: 'ch', label: '床号', visible: true, align: 'center' },
2026-02-10 17:36:00 +08:00
{ prop: 'sjys', label: '送检医生', visible: true, align: 'center', slot: 'sjys' },
2026-02-11 17:19:40 +08:00
{ prop: 'sqsj', label: '送检时间', visible: true, align: 'center', width: 150 },
{ prop: 'cyrq', label: '采样时间', visible: true, align: 'center', width: 150 },
2026-02-10 17:36:00 +08:00
{ prop: 'yhdhmc', label: '检验医师', visible: true, align: 'center' },
{ prop: 'dysj', label: '报告日期', visible: true, align: 'center', width: 150 },
2026-02-11 17:19:40 +08:00
{ prop: 'yblx', label: '样本类型', visible: true, align: 'center', slot: 'yblx' },
2026-02-10 17:36:00 +08:00
{ prop: 'hdysmc', label: '核对医生', visible: true, align: 'center' },
2026-02-11 17:19:40 +08:00
{ prop: 'dybz', label: '打印标志', visible: true, align: 'center', slot: 'dybz' },
2026-02-09 17:37:03 +08:00
{ prop: 'zd', label: '临床诊断', visible: true, align: 'center' },
{ prop: 'bz', label: '备注', visible: true, align: 'center' },
2026-02-10 17:36:00 +08:00
{ prop: 'confirmermc', label: '审核人', visible: true, align: 'center' },
{ prop: 'confirmdt', label: '审核时间', visible: true, align: 'center', width: 150 },
2026-02-09 17:37:03 +08:00
]);
const jgbzOption = ref([
{ value: '0', label: '未审核' },
{ value: '2', label: '已审核' },
{ value: '1', label: '初审' },
])
const tableConfig = ref({
border: true, // 边框
2026-05-12 18:01:47 +08:00
height: '100%', // 高度,
2026-02-09 17:37:03 +08:00
highlightCurrentRow: true, // 高亮当前行
// cellStyle: cellStyleHd
})
const fields = ref(
[
{ prop: 'value', label: '代号', width: 80, enablePinyinSearch: true },
{ prop: 'label', label: '名称', width: 150, enablePinyinSearch: true },
]
)
2026-02-10 17:36:00 +08:00
const displayJGBZ = (jgbz: string) => {
const option = jgbzOption.value.find((opt) => opt.value === jgbz)
return option ? option.label : jgbz
}
const getList = async () => {
2026-05-12 18:01:47 +08:00
formData.value.jyrq1 = formData.value.jyrq1 + ' 00:00:00'
formData.value.jyrq2 = formData.value.jyrq2 + ' 23:59:59'
2026-02-10 17:36:00 +08:00
const res = await queryBatchCheckListService(formData.value)
tableData.value = res.data
}
const checkData = async () => {
const selected = tableRef.value?.getSelectionRows
? tableRef.value.getSelectionRows()
: (tableRef.value?.tableRef?.getSelectionRows ? tableRef.value.tableRef.getSelectionRows() : [])
const paramList = (selected || []).map((item: any) => ({
2026-02-11 17:19:40 +08:00
userId: userStore.name || '',
2026-02-10 17:36:00 +08:00
yq: String(item.yq).trim(),
jyrq: dayjs(item.jyrq).format('YYYY-MM-DD HH:mm:ss'),
ybh: item.ybh,
}))
if (!paramList.length) {
msg.value = '请先选择要审核的行'
return
}
2026-02-12 16:40:57 +08:00
loading.value = true
2026-02-10 17:36:00 +08:00
const ret = await batchCheckService(paramList)
if (ret && ret.code === 200) {
2026-02-12 16:40:57 +08:00
msg.value = '批量审核成功:' + ret.msg
} else {
msg.value = '批量审核失败:' + ret.msg
2026-02-10 17:36:00 +08:00
}
2026-02-12 16:40:57 +08:00
getList()
loading.value = false
2026-02-10 17:36:00 +08:00
}
const cancelCheck = async () => {
2026-02-11 17:19:40 +08:00
const selected = tableRef.value?.getSelectionRows
? tableRef.value.getSelectionRows()
: (tableRef.value?.tableRef?.getSelectionRows ? tableRef.value.tableRef.getSelectionRows() : [])
const paramList = (selected || []).map((item: any) => ({
userId: userStore.name || '',
yq: String(item.yq).trim(),
jyrq: dayjs(item.jyrq).format('YYYY-MM-DD HH:mm:ss'),
ybh: item.ybh,
}))
2026-02-12 16:40:57 +08:00
loading.value = true
2026-02-10 17:36:00 +08:00
const ret = await cancelBatchCheckService(paramList)
if (ret.code === 200) {
2026-02-12 16:40:57 +08:00
msg.value = '取消审核成功:' + ret.msg
} else {
msg.value = '取消审核失败:' + ret.msg
2026-02-10 17:36:00 +08:00
}
2026-02-12 16:40:57 +08:00
getList()
loading.value = false
2026-02-10 17:36:00 +08:00
}
2026-05-12 18:01:47 +08:00
const instrOptions = ref([])
// 仪器
const getYqConfig = () => {
getGroupInstrdList({ lisgroup: formData.value.lisgroup })
.then((res) => {
if (res.code == 0) {
instrOptions.value = res.data.map((item: any) => ({
value: item.yq.trim(),
label: item.yqmc
}))
}
})
}
2026-02-11 17:19:40 +08:00
const tableRowClick = (row: any) => {
paramObj.value = {
yq: String(row.yq).trim(),
jyrq: dayjs(row.jyrq).format('YYYY-MM-DD'),
ybh: row.ybh,
}
}
2026-05-12 18:01:47 +08:00
const multiple = ref(false)
const selectionList = ref([])
const selectionChange = (selection) => {
// 这里可以处理选中行变化的逻辑,例如更新批量审核按钮的状态
multiple.value = selection.length > 0
selectionList.value = selection
}
2026-02-11 17:19:40 +08:00
const getYQList = (val: { yq: string; yqmc: string; yqdl: string } | null) => {
isXJY.value = String(val?.yqdl ?? '').trim() === '细菌仪';
2026-02-12 16:40:57 +08:00
//console.log('选择的仪器大类:', val?.yqdl, '是否是细菌仪:', isXJY.value)
2026-02-11 17:19:40 +08:00
}
2026-02-10 17:36:00 +08:00
onMounted(() => {
2026-05-12 18:01:47 +08:00
getYqConfig()
2026-02-11 17:19:40 +08:00
getDictData('DP', 'SRD', 'BT', 'PT')
2026-02-10 17:36:00 +08:00
})
2026-02-09 17:37:03 +08:00
</script>
2026-02-10 17:36:00 +08:00
<style scoped lang="scss">
.table-container {
2026-05-12 18:01:47 +08:00
height: calc(100% - 140px);
.el-row {
height: 100%;
.el-col {
height: 100%;
}
}
2026-02-10 17:36:00 +08:00
}
</style>