报告统计
This commit is contained in:
parent
8a8a61799f
commit
22a614959e
@ -1,3 +1,4 @@
|
||||
import { ref, onMounted, onUnmounted, Ref } from 'vue';
|
||||
|
||||
/**
|
||||
* 颜色处理工具类
|
||||
@ -104,9 +105,19 @@ function base64ToBlob(base64: string) {
|
||||
return new Blob([bytes], { type: 'application/pdf' });
|
||||
}
|
||||
|
||||
// 计算两个日期的天数差(支持带时分秒)
|
||||
const getDayDiff = (start: string, end: string): number => {
|
||||
const startTime = new Date(start).getTime();
|
||||
const endTime = new Date(end).getTime();
|
||||
|
||||
if (isNaN(startTime) || isNaN(endTime)) {
|
||||
return -2; // -2 表示日期无效
|
||||
}
|
||||
|
||||
const dayDiff = Math.ceil((endTime - startTime) / (24 * 60 * 60 * 1000));
|
||||
return dayDiff < 0 ? -1 : dayDiff; // -1 表示结束时间早于开始时间,>=0 为正常天数
|
||||
};
|
||||
|
||||
import { ref, onMounted, onUnmounted, Ref } from 'vue';
|
||||
|
||||
/**
|
||||
* 自动根据屏幕分辨率切换按钮尺寸(small/default)
|
||||
@ -150,4 +161,4 @@ function useAutoSize() {
|
||||
return autoSize;
|
||||
}
|
||||
|
||||
export const classCom = { decimalToHexColor, convertHexToNumber, getContrastTextColor, printBase64PDF, printPDF, useAutoSize }
|
||||
export const classCom = { decimalToHexColor, convertHexToNumber, getContrastTextColor, printBase64PDF, printPDF, useAutoSize, getDayDiff }
|
||||
|
||||
@ -7,12 +7,12 @@
|
||||
label-width="80px">
|
||||
<el-form-item label="开始时间:" prop="st">
|
||||
<el-date-picker v-model="queryParams.st" type="date" format="YYYY-MM-DD" value-format="YYYY-MM-DD"
|
||||
@change="handletime" />
|
||||
style="width: 10rem;" @change="handletime" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="结束时间:" prop="et">
|
||||
<el-date-picker v-model="queryParams.et" type="date" format="YYYY-MM-DD" value-format="YYYY-MM-DD"
|
||||
@change="handletime" />
|
||||
@change="handletime" style="width: 10rem;" />
|
||||
</el-form-item>
|
||||
|
||||
<!-- <el-form-item label="医疗机构:" prop="yljg">
|
||||
@ -59,6 +59,9 @@
|
||||
<el-col :span="1.5">
|
||||
<el-button type="info" :size="aotuSize" plain icon="Upload" @click="openBlock('采样登记')">采样登记</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="info" :size="aotuSize" plain @click="closeHadnle">取消登记</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" :size="aotuSize" plain @click="openBlock('送检登记')">送检登记</el-button>
|
||||
</el-col>
|
||||
@ -137,17 +140,12 @@
|
||||
<div class="flex-between">
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-input v-model="sqhText" clearable placeholder="条形码" @keyup.enter="sqdQuery" @clear="sqdQuery" />
|
||||
<el-input ref="sqhRef" v-model="sqhText" clearable placeholder="条形码" @keyup.enter="sqdQuery"
|
||||
@clear="sqdQuery" />
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" @click="sqdQuery" plain>读取</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="delete">删除选中行</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="info" plain>打印</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!-- <el-button type="primary" plain>保存</el-button> -->
|
||||
</div>
|
||||
@ -455,11 +453,11 @@ const cyColumns = ref([
|
||||
// 表格配置
|
||||
const cyTableConfig = ref({
|
||||
border: true, // 边框
|
||||
height: '100%', // 高度
|
||||
height: '70vh', // 高度
|
||||
highlightCurrentRow: true, // 高亮当前行
|
||||
})
|
||||
|
||||
|
||||
const sqhRef = useTemplateRef('sqhRef')
|
||||
|
||||
// 采样登记
|
||||
const openBlock = (value: string) => {
|
||||
@ -495,8 +493,19 @@ const openBlock = (value: string) => {
|
||||
} else {
|
||||
title.value = value
|
||||
dialogVisible.value = true
|
||||
|
||||
setTimeout(() => {
|
||||
sqhRef.value?.focus()
|
||||
}, 30);
|
||||
}
|
||||
}
|
||||
|
||||
const closeHadnle = () => {
|
||||
const selections = tableRef.value.allSelection()
|
||||
if (selections.length <= 0) return ElMessage.warning('请选择数据!')
|
||||
|
||||
}
|
||||
|
||||
// 采样读取
|
||||
const sqdQuery = () => {
|
||||
const index = cyTableData.value.findIndex((item: any) => item.sqh == sqhText.value)
|
||||
@ -509,9 +518,17 @@ const sqdQuery = () => {
|
||||
userid: queryParams.userid,
|
||||
status: 12,
|
||||
yljg: queryParams.yljg
|
||||
}).then((res: any) => {
|
||||
if (res.code == 0) {
|
||||
cyTableData.value = cyTableData.value.concat(res.data)
|
||||
}
|
||||
})
|
||||
cyTableData.value = cyTableData.value.concat(res.data)
|
||||
}
|
||||
}).finally(() => {
|
||||
sqhText.value = ''
|
||||
nextTick(() => {
|
||||
sqhRef.value?.focus()
|
||||
})
|
||||
})
|
||||
}
|
||||
// 关闭弹窗清空
|
||||
@ -622,6 +639,7 @@ const timeDate = () => {
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
// 获取当前时间 7天内的数据
|
||||
timeDate()
|
||||
|
||||
queryParams.ksdh = (route.query.deptcode as string) ? (route.query.deptcode as string) : '';
|
||||
|
||||
16
src/views/statisticalAnalysis/applicationSingle/index.vue
Normal file
16
src/views/statisticalAnalysis/applicationSingle/index.vue
Normal file
@ -0,0 +1,16 @@
|
||||
/**
|
||||
* @file index.vue 申请单统计
|
||||
* @author: w
|
||||
* @since: 2026-01-27
|
||||
*/
|
||||
<template>
|
||||
<div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
||||
223
src/views/statisticalAnalysis/report/index.vue
Normal file
223
src/views/statisticalAnalysis/report/index.vue
Normal file
@ -0,0 +1,223 @@
|
||||
/**
|
||||
* @file index.vue 报告统计
|
||||
* @author: w
|
||||
* @since: 2026-01-27
|
||||
*/
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form ref="form" :model="queryParams" label-width="90px" inline size="small">
|
||||
<el-form-item label="日期:">
|
||||
<el-date-picker v-model="queryParams.st" type="date" format="YYYY-MM-DD" value-format="YYYY-MM-DD"
|
||||
@change="handletime" style="width:180px" /> -
|
||||
<el-date-picker v-model="queryParams.et" type="date" format="YYYY-MM-DD" value-format="YYYY-MM-DD"
|
||||
@change="handletime" style="width:178px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="仪器组合:">
|
||||
<SelectTable v-model:data="queryParams.instrGroup" :tableData="instrGroupOptions" :fields="instrGroupFields"
|
||||
label="zdmc" value="zddh" objKey="zddh" style="width:150px" size="small" />
|
||||
</el-form-item>
|
||||
<el-form-item label="仪器:">
|
||||
<YQSelectTable v-model:data="queryParams.yq" style="width:150px" size="small" />
|
||||
</el-form-item>
|
||||
<el-form-item label="检验医生:">
|
||||
<SelectTable v-model:data="queryParams.yhdh" :fields="ysFields" :tableData="userList" label="nickName"
|
||||
value="userName" objKey="userName" placeholder="请选择" style="width:150px" size="small" />
|
||||
</el-form-item>
|
||||
<el-form-item label="病人类型:">
|
||||
<SelectTable v-model:data="queryParams.brlyname" dictType="PT" label="label" value="label" objKey="label"
|
||||
placeholder="请选择" style="width:150px" size="small" />
|
||||
</el-form-item>
|
||||
<el-form-item label="性别:">
|
||||
<SelectTable v-model:data="queryParams.brxb" dictType="SX" placeholder="请选择" style="width:150px" size="small" />
|
||||
</el-form-item>
|
||||
<el-form-item label="科室:" label-width="3.75rem">
|
||||
<SelectTable v-model:data="queryParams.ksdh" dictType="DP" placeholder="请选择" style="width:150px" size="small" />
|
||||
</el-form-item>
|
||||
<el-form-item label="送检医生:">
|
||||
<SelectTable v-model:data="queryParams.sjys" :fields="ysFields" :tableData="userList" label="nickName"
|
||||
value="userName" objKey="userName" placeholder="请选择" style="width:150px" size="small" />
|
||||
</el-form-item>
|
||||
<el-form-item label="送检医院:">
|
||||
<SelectTable v-model:data="queryParams.DstHospName" :tableData="hosList" label="label" value="label"
|
||||
objKey="label" placeholder="请选择" style="width:150px" size="small" />
|
||||
</el-form-item>
|
||||
<div>
|
||||
<el-form-item label=" ">
|
||||
<el-checkbox v-model="queryParams.failed1" label="无病人代号的标本不统计" />
|
||||
<el-checkbox v-model="queryParams.failed2" label="无病人姓名的标本不统计" />
|
||||
<el-checkbox v-model="queryParams.failed3" label="未打印的标本不统计" />
|
||||
<el-checkbox v-model="queryParams.failed4" label="未审核的标本不统计" />
|
||||
<el-checkbox v-model="queryParams.failed6" label="显示人数" />
|
||||
<el-checkbox v-model="queryParams.failed5" label="按审核日期" />
|
||||
时间段: <el-time-picker v-model="queryParams.time" is-range range-separator="-" value-format="HH:mm"
|
||||
format="HH:mm" style="width: 12rem;" />
|
||||
</el-form-item>
|
||||
</div>
|
||||
<el-form-item label="统计项目:">
|
||||
<el-checkbox-group v-model="queryParams.statItems">
|
||||
<el-checkbox v-for="item in checkBoxs" :key="item.value" :label="item.value">{{ item.label }}</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
|
||||
<el-checkbox v-model="queryParams.failed6" label="智能合并" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<div class="title">{{ formatDict(userStore.sysLoginParam.loginYLJG, 'HOS') }}</div>
|
||||
<div class="content">工作量统计表</div>
|
||||
<div class="table-container">
|
||||
<el-table :data="tableData" height="100%" border highlight-current-row v-loading="loading">
|
||||
<el-table-column v-for="col in visibleColumns" :key="col.key" :label="col.label" :prop="col.prop" />
|
||||
</el-table>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import YQSelectTable from '@/components/SelectTable/YQSelectTable/index.vue'
|
||||
import { getComDicts, } from "@/api/liswork/dict/ComDict";
|
||||
import { useCommonStore } from '@/store/modules/commonStore';
|
||||
import { classCom } from '@/utils/classCom';
|
||||
import { listhospital } from "@/api/regional/dict/hospital.js";
|
||||
import { listUser } from '@/api/system/user.js'
|
||||
import useUserStore from '@/store/modules/user'
|
||||
import { getDictData, formatDict } from '@/hooks'
|
||||
const userStore = useUserStore()
|
||||
const mbStore = useCommonStore();
|
||||
const queryParams = reactive({
|
||||
st: '',
|
||||
et: '',
|
||||
instrGroup: '',
|
||||
yq: mbStore.defaultConfig.defaultinstr || '1',
|
||||
brlyname: '',
|
||||
yhdh: '',
|
||||
brxb: '',
|
||||
ksdh: '',
|
||||
sjys: '',
|
||||
DstHospName: '',
|
||||
statItems: ['0', '1', '2', '3'],
|
||||
})
|
||||
|
||||
const checkBoxs = ref([
|
||||
{ label: '病人类型', value: '0' },
|
||||
{ label: '性别', value: '1' },
|
||||
{ label: '科室', value: '2' },
|
||||
{ label: '送检医生', value: '3' },
|
||||
{ label: '核对医生', value: '4' },
|
||||
{ label: '费别', value: '5' },
|
||||
{ label: '年', value: '6' },
|
||||
{ label: '月', value: '7' },
|
||||
{ label: '日', value: '8' },
|
||||
{ label: '专业组', value: '9' },
|
||||
{ label: '检查组', value: '10' },
|
||||
{ label: '送检医院', value: '11' },
|
||||
{ label: '急诊', value: '12' },
|
||||
{ label: '绿色通道', value: '13' },
|
||||
{ label: '部门组别', value: '14' },
|
||||
{ label: '仪器', value: '15' },
|
||||
{ label: '标本', value: '16' },
|
||||
])
|
||||
|
||||
// 表格列配置:key对应checkBoxs的value,label为列名,prop为字段名(根据实际业务调整)
|
||||
const tableColumns = ref([
|
||||
{ key: '0', label: '病人类型', prop: 'brlyname' },
|
||||
{ key: '1', label: '性别', prop: 'brxb' },
|
||||
{ key: '2', label: '科室', prop: 'ksdh' },
|
||||
{ key: '3', label: '送检医生', prop: 'sjys' },
|
||||
{ key: '4', label: '核对医生', prop: 'yhdh' },
|
||||
{ key: '5', label: '费别', prop: 'fabei' },
|
||||
{ key: '6', label: '年', prop: 'year' },
|
||||
{ key: '7', label: '月', prop: 'month' },
|
||||
{ key: '8', label: '日', prop: 'day' },
|
||||
{ key: '9', label: '专业组', prop: 'zyz' },
|
||||
{ key: '10', label: '检查组', prop: 'jcz' },
|
||||
{ key: '11', label: '送检医院', prop: 'DstHospName' },
|
||||
{ key: '12', label: '急诊', prop: 'jizhen' },
|
||||
{ key: '13', label: '绿色通道', prop: 'lvse' },
|
||||
{ key: '14', label: '部门组别', prop: 'bmzb' },
|
||||
{ key: '15', label: '仪器', prop: 'yq' },
|
||||
{ key: '16', label: '标本', prop: 'bb' },
|
||||
]);
|
||||
|
||||
// 过滤后的列
|
||||
const visibleColumns = computed(() => {
|
||||
|
||||
if (!queryParams.statItems || queryParams.statItems.length === 0) {
|
||||
return tableColumns.value;
|
||||
}
|
||||
|
||||
return tableColumns.value.filter(col => queryParams.statItems.includes(col.key));
|
||||
});
|
||||
|
||||
const instrGroupOptions = ref([])
|
||||
const instrGroupFields = ref([
|
||||
{ prop: 'zddh', label: '代号', width: 80, enablePinyinSearch: true },
|
||||
{ prop: 'zdmc', label: '名称', width: 150, enablePinyinSearch: true },
|
||||
])
|
||||
|
||||
|
||||
const ysFields = ref([
|
||||
{ prop: 'userName', label: '用户代号', width: 80, enablePinyinSearch: true },
|
||||
{ prop: 'nickName', label: '用户姓名', width: 150, enablePinyinSearch: true },
|
||||
])
|
||||
// 部门组
|
||||
const loadinstrGroupOptions = () => {
|
||||
getComDicts({ zdlb: 'GROUP' }).then((res) => {
|
||||
instrGroupOptions.value = res.data
|
||||
instrGroupOptions.value.push({ zddh: 'ALL', zdmc: '所有仪器' })
|
||||
});
|
||||
}
|
||||
|
||||
const handletime = () => {
|
||||
const dayDiff = classCom.getDayDiff(queryParams.st, queryParams.et)
|
||||
if (dayDiff === -1 || dayDiff === -2) return ElMessage.warning('请选择有效的日期范围');
|
||||
}
|
||||
|
||||
|
||||
const userList = ref([]);
|
||||
const hosList = ref([]);
|
||||
onMounted(() => {
|
||||
loadinstrGroupOptions()
|
||||
const data = { status: 0, del_flag: 0, pageSize: 1000, pageNum: 1 }
|
||||
listUser(data).then((res) => {
|
||||
userList.value = res.rows;
|
||||
});
|
||||
|
||||
listhospital().then((res) => {
|
||||
hosList.value = res.rows.map((item) => {
|
||||
return {
|
||||
label: item.hospitalName,
|
||||
value: item.hospitalCode
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
getDictData('HOS')
|
||||
})
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.el-form-item {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 20px;
|
||||
text-align: center;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.content {
|
||||
font-size: 16px;
|
||||
text-align: center;
|
||||
margin-top: 10px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.table-container {
|
||||
margin-top: 10px;
|
||||
height: calc(100% - 200px);
|
||||
}
|
||||
</style>
|
||||
Loading…
x
Reference in New Issue
Block a user