278 lines
9.9 KiB
Vue
278 lines
9.9 KiB
Vue
<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">
|
|
<el-form-item label="委托机构:" prop="srcHospName">
|
|
<el-input v-model="queryParams.srcHospName" :size="aotuSize" readonly />
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="4">
|
|
<el-form-item label="检测医院:" prop="dstHospName">
|
|
<SelectTable v-model:data="queryParams.dstHospName" :fields="ksdhFields" :tableData="hosList"
|
|
label="label" :size="aotuSize" value="label" placeholder="请选择" />
|
|
</el-form-item>
|
|
</el-col>
|
|
|
|
<el-col :span="4">
|
|
<el-form-item label="条码号:" prop="barcode">
|
|
<el-input v-model="queryParams.barcode" placeholder="请输入条码号" clearable />
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="4">
|
|
<el-form-item label="姓名:" prop="patName">
|
|
<el-input v-model="queryParams.patName" placeholder="请输入姓名" clearable />
|
|
</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">
|
|
<el-form-item label="采样人:" prop="affirmUserName">
|
|
<el-input v-model="queryParams.affirmUserName" placeholder="请输入采样人" clearable />
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="4">
|
|
<el-form-item label="签收人:" prop="signInUserName">
|
|
<el-input v-model="queryParams.signInUserName" placeholder="请输入签收人" clearable />
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="4">
|
|
<el-form-item label="时间类型:" prop="dateType">
|
|
<el-select v-model="queryParams.dateType" placeholder="请选择">
|
|
<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 }">
|
|
{{ row.patAge }}{{ formatDict(row.ageUnit, 'AU') }}
|
|
</template>
|
|
<template #status="{ row }">
|
|
{{ formatDicts(row.status, regdictList) }}
|
|
</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' : '']">
|
|
<div :class="['index', lastTimeIndex == i ? 'active' : '']">{{ Number(i) + 1 }}
|
|
</div>
|
|
<div class="timeline-title">{{ item.title }}</div>
|
|
<div class="timeline-time">{{ item.time }}</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</template>
|
|
|
|
<script setup lang="ts" name="Bbcx">
|
|
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();
|
|
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()
|
|
|
|
|
|
const queryParams = ref({
|
|
pageSize: 50,
|
|
pageNum: 1,
|
|
srcHospName: userStore.sysLoginParam.loginYLJGName,
|
|
times: [],
|
|
dateType: '登记时间'
|
|
})
|
|
const tableData = ref([])
|
|
const columns = ref([
|
|
{ prop: 'barcode', label: '条码号', align: 'center', visible: true, width: 150 },
|
|
{ prop: 'srcHospName', label: '委托机构', align: 'center', visible: true, width: 200 },
|
|
{ prop: 'patName', label: '姓名', align: 'center', visible: true, width: 100 },
|
|
{ prop: 'patSex', label: '性别', align: 'center', visible: true, width: 60, slot: "patSex" },
|
|
{ prop: 'patAge', label: '年龄', align: 'center', visible: true, slot: "patAge", width: 60 },
|
|
{ prop: 'checkPUR', label: '申请项目', align: 'center', visible: true, width: 250 },
|
|
{ prop: 'orderTime', label: '申请时间', align: 'center', visible: true, width: 140 },
|
|
{ prop: 'sampleTypeName', label: '标本类型', align: 'center', visible: true, },
|
|
{ prop: 'itemclass_tips', label: '采集容器', align: 'center', visible: true, },
|
|
{ prop: 'status', label: '标本状态', align: 'center', visible: true, slot: "status" },
|
|
{ prop: 'affirmUserName', label: '采样人', align: 'center', visible: true, },
|
|
{ prop: 'affirmTime', label: '采样时间', align: 'center', visible: true, width: 140 },
|
|
{ prop: 'signInUserName', label: '签收人', align: 'center', visible: true, },
|
|
{ prop: 'signInTime', label: '签收时间', align: 'center', visible: true, width: 140 },
|
|
{ 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: '' },
|
|
{ title: '上机检验', time: '' },
|
|
{ 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) {
|
|
queryParams.value.dateStart = queryParams.value.times[0]
|
|
queryParams.value.dateEnd = queryParams.value.times[1]
|
|
} else {
|
|
queryParams.value.dateStart = ''
|
|
queryParams.value.dateEnd = ''
|
|
}
|
|
|
|
getList()
|
|
}
|
|
|
|
|
|
const resetHandle = () => {
|
|
queryParams.value = {
|
|
pageSize: 50,
|
|
pageNum: 1,
|
|
}
|
|
getDays()
|
|
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) => {
|
|
timelineItems.value =
|
|
[
|
|
{ title: '检验申请', time: row.orderTime },
|
|
{ title: '标本采集', time: row.affirmTime },
|
|
{ title: '标本送检', time: row.sendPackTime },
|
|
{ title: '标本签收', time: row.signInTime },
|
|
{ title: '上机检验', time: row.sjsj },
|
|
{ title: '结果审核', time: row.confirmtime },
|
|
]
|
|
}
|
|
|
|
const tableRefs = ref()
|
|
const getList = () => {
|
|
querySample(queryParams.value).then((res) => {
|
|
tableData.value = res.rows
|
|
pagination.value.total = res.total
|
|
tableRefs.value.setCurrentRow(res.rows[0])
|
|
rowHandle(res.rows[0])
|
|
})
|
|
}
|
|
|
|
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];
|
|
}
|
|
|
|
const hosList = ref([])
|
|
const regdictList = ref([])
|
|
onMounted(() => {
|
|
getDays()
|
|
handleQuery()
|
|
listhospital().then((res) => {
|
|
hosList.value = res.rows.map((item) => {
|
|
return {
|
|
label: item.hospitalName,
|
|
value: item.hospitalCode
|
|
}
|
|
})
|
|
})
|
|
|
|
listregdict({ pageSize: 100, pageNum: 1, dictType: 'ZT' }).then((res) => {
|
|
regdictList.value = res.rows;
|
|
})
|
|
getDictData('AU')
|
|
})
|
|
|
|
|
|
const formatDicts = (v: string, arr: Array<any>) => {
|
|
return arr.find((item) => item.dictCode == v)?.dictName || v;
|
|
};
|
|
</script>
|
|
|
|
<style scoped lang="scss">
|
|
.compact-form {
|
|
height: 5rem;
|
|
|
|
.el-form-item {
|
|
margin-bottom: 5px;
|
|
}
|
|
}
|
|
</style> |