276 lines
9.8 KiB
Vue
Raw Normal View History

2026-03-09 18:04:16 +08:00
<template>
<div class="app-container">
<div class="compact-form">
<el-form :model="queryParams" ref="queryRef" label-width="5rem" style="width: 100%;" :size="aotuSize">
<el-row :gutter="10">
<el-col :span="4">
2026-03-19 18:00:24 +08:00
<el-form-item label="委托机构:" prop="srcHospName">
<el-input v-model="queryParams.srcHospName" :size="aotuSize" readonly />
2026-03-09 18:04:16 +08:00
</el-form-item>
</el-col>
<el-col :span="4">
2026-03-19 18:00:24 +08:00
<el-form-item label="检测医院:" prop="dstHospName">
<SelectTable v-model:data="queryParams.dstHospName" :fields="ksdhFields" :tableData="hosList"
label="label" :size="aotuSize" value="label" placeholder="请选择" />
2026-03-09 18:04:16 +08:00
</el-form-item>
</el-col>
<el-col :span="4">
2026-03-19 18:00:24 +08:00
<el-form-item label="条码号:" prop="barcode">
<el-input v-model="queryParams.barcode" placeholder="请输入条码号" clearable />
2026-03-09 18:04:16 +08:00
</el-form-item>
</el-col>
<el-col :span="4">
2026-03-19 18:00:24 +08:00
<el-form-item label="姓名:" prop="patName">
<el-input v-model="queryParams.patName" placeholder="请输入姓名" clearable />
2026-03-09 18:04:16 +08:00
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="申请项目:" prop="checkPUR">
<el-input v-model="queryParams.checkPUR" placeholder="请输入申请项目" clearable />
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="标本状态:" prop="Status">
<el-select v-model="queryParams.Status" placeholder="请选择" clearable>
<el-option v-for="item in regdictList" :label="item.dictName" :value="item.dictCode" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="4">
2026-03-19 18:00:24 +08:00
<el-form-item label="采样人:" prop="affirmUserName">
<el-input v-model="queryParams.affirmUserName" placeholder="请输入采样人" clearable />
2026-03-09 18:04:16 +08:00
</el-form-item>
</el-col>
<el-col :span="4">
2026-03-19 18:00:24 +08:00
<el-form-item label="签收人:" prop="signInUserName">
<el-input v-model="queryParams.signInUserName" placeholder="请输入签收人" clearable />
2026-03-09 18:04:16 +08:00
</el-form-item>
</el-col>
<el-col :span="4">
2026-03-19 18:00:24 +08:00
<el-form-item label="时间类型:" prop="dateType">
<el-select v-model="queryParams.dateType" placeholder="请选择">
2026-03-09 18:04:16 +08:00
<el-option label="登记时间" value="登记时间" />
<el-option label="采样时间" value="采样时间" />
<el-option label="送出时间" value="送出时间" />
<el-option label="签收时间" value="签收时间" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item label="日期:" prop="times">
<el-date-picker v-model="queryParams.times" type="daterange" range-separator="-" start-placeholder="开始时间"
end-placeholder="结束时间" format="YYYY-MM-DD" value-format="YYYY-MM-DD" />
</el-form-item>
</el-col>
<el-col :span="4">
<el-button type="primary" @click="handleQuery">查询</el-button>
<el-button @click="resetHandle">重置</el-button>
</el-col>
</el-row>
</el-form>
</div>
<div>
<CustomTable ref="tableRefs" :data="tableData" :columns="columns" :config="tableConfig" :pagination="pagination"
@size-change="sizeChange" @page-change="currentChange" @row-click="rowHandle">
<template #patAge="{ row }">
2026-03-19 18:00:24 +08:00
{{ row.patAge }}{{ formatDict(row.ageUnit, 'AU') }}
2026-03-09 18:04:16 +08:00
</template>
<template #status="{ row }">
2026-03-19 18:00:24 +08:00
{{ formatDicts(row.status, regdictList) }}
2026-03-09 18:04:16 +08:00
</template>
<template #patSex="{ row }">
{{ row.patSex == 1 ? '男' : '女' }}
</template>
</CustomTable>
</div>
<!-- 样本流程 -->
<div class="time-line-box">
<div v-for="(item, i) in timelineItems" :key="i" class="time-line-item">
<div v-if="i != 0" class="timeline-connector">
<img class="timg" src="@/assets/images/yjt.png" alt="">
</div>
<div :class="['timeline-content', i > lastTimeIndex ? 'no_active' : '']">
2026-03-19 18:00:24 +08:00
<div :class="['index', lastTimeIndex == i ? 'active' : '']">{{ Number(i) + 1 }}
2026-03-09 18:04:16 +08:00
</div>
<div class="timeline-title">{{ item.title }}</div>
<div class="timeline-time">{{ item.time }}</div>
</div>
</div>
</div>
</div>
</template>
2026-03-16 18:01:58 +08:00
<script setup lang="ts" name="Bbcx">
2026-03-09 18:04:16 +08:00
import CustomTable from '@/components/elTable/index.vue'
import { querySample } from '@/api/regional/index'
import SelectTable from '@/components/SelectTable/index.vue';
import { classCom } from '@/utils/classCom';
const aotuSize = classCom.useAutoSize();
2026-03-19 18:00:24 +08:00
import { listhospital } from "@/api/regional/dict/hospital";
import { listregdict } from "@/api/regional/dict/regdict";
import useUserStore from '@/store/modules/user'
import dayjs from 'dayjs';
import { getDictData, formatDict, dictData } from '@/hooks'
const userStore = useUserStore()
2026-03-09 18:04:16 +08:00
const queryParams: any = ref({
pageSize: 50,
pageNum: 1,
2026-03-19 18:00:24 +08:00
srcHospName: userStore.sysLoginParam.loginYLJGName,
times: []
2026-03-09 18:04:16 +08:00
})
const tableData: any = ref([])
const columns: any = ref([
{ prop: 'barcode', label: '条码号', align: 'center', visible: true, width: 150 },
2026-03-19 18:00:24 +08:00
{ prop: 'srcHospName', label: '委托机构', align: 'center', visible: true, width: 250 },
{ prop: 'patName', label: '姓名', align: 'center', visible: true, width: 100 },
2026-03-09 18:04:16 +08:00
{ prop: 'patSex', label: '性别', align: 'center', visible: true, width: 60, slot: "patSex" },
{ prop: 'patAge', label: '年龄', align: 'center', visible: true, slot: "patAge", width: 60 },
2026-03-19 18:00:24 +08:00
{ prop: 'checkPUR', label: '申请项目', align: 'center', visible: true, width: 300 },
2026-03-09 18:04:16 +08:00
{ prop: 'sampleTypeName', label: '标本类型', align: 'center', visible: true, },
2026-03-19 18:00:24 +08:00
{ prop: 'itemclass_tips', label: '采集容器', align: 'center', visible: true, },
2026-03-09 18:04:16 +08:00
{ prop: 'status', label: '标本状态', align: 'center', visible: true, slot: "status" },
{ prop: 'affirmUserName', label: '采样人', align: 'center', visible: true, },
{ prop: 'affirmTime', label: '采样时间', align: 'center', visible: true, width: 150 },
{ prop: 'signInUserName', label: '签收人', align: 'center', visible: true, },
{ prop: 'signInTime', label: '签收时间', align: 'center', visible: true, width: 150 },
{ prop: 'dstHospName', label: '检测机构名称', align: 'center', visible: true, width: 150 },
])
const tableConfig = ref({
border: true, // 边框
height: '65vh', // 高度
highlightCurrentRow: true, // 高亮当前行
// fit: true, // 列宽自适应
})
const pagination = ref({
show: true,
total: 0,
pageSize: 50,
currentPage: 1,
})
const ksdhFields = ref([
{ prop: 'label', label: '名称', width: 150, enablePinyinSearch: true },
{ prop: 'value', label: '代号', width: 120, enablePinyinSearch: true },
])
// 时间线数据
const timelineItems = ref(
[
{ title: '检验申请', time: '' },
{ title: '标本采集', time: '' },
{ title: '标本送检', time: '' },
{ title: '标本签收', time: '' },
2026-03-19 18:00:24 +08:00
{ title: '上机检验', time: '' },
2026-03-09 18:04:16 +08:00
{ title: '结果审核', time: '' },
]
);
// 计算最后一个有时间的节点索引
const lastTimeIndex = computed(() => {
const lastIndex = timelineItems.value.findLastIndex(item => item.time);
if (lastIndex === -1) {
return -1
} else {
return lastIndex;
}
});
const handleQuery = () => {
if (queryParams.value.times && queryParams.value.times.length > 0) {
2026-03-19 18:00:24 +08:00
queryParams.value.dateStart = queryParams.value.times[0]
queryParams.value.dateEnd = queryParams.value.times[1]
2026-03-09 18:04:16 +08:00
} else {
2026-03-19 18:00:24 +08:00
queryParams.value.dateStart = ''
queryParams.value.dateEnd = ''
2026-03-09 18:04:16 +08:00
}
getList()
}
const resetHandle = () => {
queryParams.value = {
pageSize: 50,
pageNum: 1,
}
2026-03-19 18:00:24 +08:00
getDays()
2026-03-09 18:04:16 +08:00
handleQuery()
}
const currentChange = (page: { currentPage: number, pageSize: number }) => {
queryParams.value.pageNum = page.currentPage
handleQuery()
}
const sizeChange = (page: { currentPage: number, pageSize: number }) => {
queryParams.value.pageSize = page.pageSize
handleQuery()
}
const rowHandle = (row: any) => {
timelineItems.value =
[
{ title: '检验申请', time: row.orderTime },
{ title: '标本采集', time: row.affirmTime },
2026-03-19 18:00:24 +08:00
{ title: '标本送检', time: row.sendPackTime },
2026-03-09 18:04:16 +08:00
{ title: '标本签收', time: row.signInTime },
2026-03-19 18:00:24 +08:00
{ title: '上机检验', time: row.sjsj },
{ title: '结果审核', time: row.confirmtime },
2026-03-09 18:04:16 +08:00
]
}
const tableRefs = ref()
const getList = () => {
querySample(queryParams.value).then((res: any) => {
tableData.value = res.rows
pagination.value.total = res.total
tableRefs.value.setCurrentRow(res.rows[0])
rowHandle(res.rows[0])
})
}
2026-03-19 18:00:24 +08:00
const getDays = () => {
const end = dayjs().format('YYYY-MM-DD');
const start = dayjs().subtract(2, 'day').format('YYYY-MM-DD'); //add 时间往后
queryParams.value.times = [start, end];
}
2026-03-09 18:04:16 +08:00
const hosList = ref([])
const regdictList: any = ref([])
onMounted(() => {
2026-03-19 18:00:24 +08:00
getDays()
handleQuery()
2026-03-09 18:04:16 +08:00
listhospital().then((res: any) => {
hosList.value = res.rows.map((item: any) => {
return {
label: item.hospitalName,
value: item.hospitalCode
}
})
})
listregdict({ pageSize: 100, pageNum: 1, dictType: 'ZT' }).then((res: any) => {
regdictList.value = res.rows;
})
2026-03-19 18:00:24 +08:00
getDictData('AU')
2026-03-09 18:04:16 +08:00
})
2026-03-19 18:00:24 +08:00
const formatDicts = (v: string, arr: Array<any>) => {
2026-03-09 18:04:16 +08:00
return arr.find((item: any) => item.dictCode == v)?.dictName || v;
};
</script>
<style scoped lang="scss">
.compact-form {
height: 5rem;
.el-form-item {
margin-bottom: 5px;
}
}
</style>