<select-org-area
ref="selectOrgAreaComponent"
@handleStatistics="handleStatistics"
@exportCurrentPage="exportCurrentPage"
@exportAllPage="exportAllPage"
:btnPermission="btnPermission"
:statisticalDescription="statisticalDescription"
:searchLoading="searchLoading"
/>
<el-table
height="100%"
ref="tables"
v-loading="loading"
:data="list"
border
>
<el-table-column label="序号" align="center" type="index" width="55">
<template slot-scope="scope">
{{
scope.$index + queryList.pageSize * (queryList.pageNum - 1) + 1
}}
</template>
</el-table-column>
<el-table-column
label="名称"
prop="name"
align="center"
min-width="300"
:show-overflow-tooltip="true"
/>
<el-table-column
sortable
align="center"
label="住院人次"
prop="hospitalizedNumber"
width="120"
:show-overflow-tooltip="true"
/>
<el-table-column
sortable
align="center"
label="同比增减人次"
prop="numberChange"
width="130"
/>
<el-table-column
sortable
align="center"
label="增减比例(%)"
prop="numberChangeRate"
width="140"
:show-overflow-tooltip="true"
/>
<el-table-column
sortable
align="center"
label="总住院日"
prop="hospitalizedDays"
width="120"
:show-overflow-tooltip="true"
/>
<el-table-column
sortable
align="center"
label="平均住院日"
prop="medianHospitalizedDays"
width="120"
:show-overflow-tooltip="true"
/>
</el-table>
<pagination
:total="total"
:page.sync="queryList.pageNum"
:limit.sync="queryList.pageSize"
:pageSizes="[10, 20, 30, 50, 300]"
@pagination="handleStatistics"
/>
</template>
<script>
import { hospitalizedQuery } from "@/api/dataAnalysis/medicalServiceAnalysis";
import SelectOrgArea from "@/components/SelectOrgArea";
export default {
name: "HospitalManTime",
components: {
SelectOrgArea,
},
data() {
return {
// 查询参数
queryList: {
pageNum: 1,
pageSize: 10,
},
// 总条数
total: 0,
// 表格数据
list: [],
// 统计按钮loading
searchLoading: false,
// 遮罩层
loading: true,
// 按钮权限
btnPermission: {
statistics:
"dataAnalysis:dtjcfx:medicalService:hospitalManTime:statistics",
statisticalDescription:
"dataAnalysis:dtjcfx:medicalService:hospitalManTime:statisticalDescription",
exportPage:
"dataAnalysis:dtjcfx:medicalService:hospitalManTime:exportPage",
exportAll:
"dataAnalysis:dtjcfx:medicalService:hospitalManTime:exportAll",
},
// 统计说明
statisticalDescription: {
bbtjfwContent: [
"符合选定统计条件(例如:统计周期、机构类别等)的相关业务数据。",
],
tjzbjsContent: [
"住院人次:统计周期内患者住院就诊总人数。",
"同比增减人次:与上年同期相比,住院人次的增减量,公式:本期住院人次-上年同期住院人次。",
"增减比例(%):同比增减幅度,公式:(同比增减人次÷上年同期住院人次)×100%。",
"总住院日:统计周期内住院患者的住院天数总和。",
"平均住院日:统计周期内患者平均住院天数,公式:总住院日÷住院人次。",
],
},
};
},
methods: {
//统计(子组件发过来的自定义事件)
handleStatistics(query, type) {
this.queryList = Object.assign(query, this.queryList);
this.getList(type);
},
/**
* 统计
*/
async getList(type) {
try {
if (type == 2) {
this.searchLoading = true;
}
this.loading = true;
let res = await hospitalizedQuery(this.queryList);
if (res.code == 200) {
this.list = res.data;
this.total = res.total;
} else {
this.$message.error(res.message || "获取数据失败");
}
} catch (e) {
this.handleApiError(e);
} finally {
this.loading = false;
this.searchLoading = false;
}
},
/**
* 导出当前页
*/
exportCurrentPage(query) {
let queryParams = Object.assign(query, this.queryList);
this.handleExport(queryParams);
},
/**
* 导出全部
*/
exportAllPage(query) {
this.handleExport(query);
},
/**
* 导出公共方法
*/
handleExport(query) {
this.download(
"/qcmge/hospitalizedAnalysis/numberExport",
{
...query,
},
`住院人次分析${this.formatDateTime()}.xlsx`
);
},
/**
* 获取当前时间yyyyMMddHHmmss
*/
formatDateTime() {
const date = new Date();
// 获取日期时间各部分
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, "0"); // 月份从0开始需+1
const day = String(date.getDate()).padStart(2, "0");
const hours = String(date.getHours()).padStart(2, "0");
const minutes = String(date.getMinutes()).padStart(2, "0");
const seconds = String(date.getSeconds()).padStart(2, "0");
// 拼接成 yyyyMMddHHmmss 格式
return `${year}${month}${day}${hours}${minutes}${seconds}`;
},
},
};
</script>
<style lang="scss" scoped>
::v-deep .el-table .has-gutter .cell {
line-height: 20px !important;
height: auto !important;
}
</style>
需求:合计行一直在第一行显示,不会跟着排序的变化而变化,不管升序降序不排序,始终都在第一行,我说的这个第一行是表头下的第一行
接口返回数据结构如下:
[
{
"id": "-",
"code": "-",
"name": "合计",
"hospitalizedCost": "1.60",
"lastTotalCost": "0.00",
"costChange": "1.60",
"costChangeRate": "100",
"urbanWorkersInsuranceFees": "0.79",
"urbanWorkersInsuranceNumber": "34.00",
"townspeopleInsuranceFees": "0.00",
"townspeopleInsuranceNumber": "0.00",
"otherInsuranceFees": "0.53",
"otherInsuranceNumber": "23.00",
"voluntaryFees": "0.27",
"voluntaryNumber": "5.00",
"hospitalizedNumber": "62",
"lastHospitalizedNumber": "0.00",
"numberChange": "62",
"numberChangeRate": "100",
"hospitalizedDays": "62",
"medianHospitalizedDays": "1.00",
"hospitalizedOnceCost": "257.44",
"costOnceChange": "257.44",
"costOnceChangeRate": "100",
"urbanWorkersInsuranceOnceFees": "232.94",
"townspeopleInsuranceOnceFees": "0",
"otherInsuranceOnceFees": "231.83",
"voluntaryOnceFees": "541.77"
},
{
"id": "90257d833a6d0962ff00872efeaf7e69",
"code": "a",
"name": "a",
"hospitalizedCost": "0.00",
"lastTotalCost": "0.00",
"costChange": "0.00",
"costChangeRate": "100",
"urbanWorkersInsuranceFees": "0.00",
"urbanWorkersInsuranceNumber": "0.00",
"townspeopleInsuranceFees": "0.00",
"townspeopleInsuranceNumber": "0.00",
"otherInsuranceFees": "0.00",
"otherInsuranceNumber": "0.00",
"voluntaryFees": "0.00",
"voluntaryNumber": "0.00",
"hospitalizedNumber": "0",
"lastHospitalizedNumber": "0.00",
"numberChange": "0",
"numberChangeRate": "100",
"hospitalizedDays": "0",
"medianHospitalizedDays": "0",
"hospitalizedOnceCost": "0",
"costOnceChange": "0.00",
"costOnceChangeRate": "100",
"urbanWorkersInsuranceOnceFees": "0",
"townspeopleInsuranceOnceFees": "0",
"otherInsuranceOnceFees": "0",
"voluntaryOnceFees": "0"
},
{
"id": "fd34344443684a56a88a21a210182187",
"code": "340000-03-10025-50012",
"name": "安徽省儿童医院",
"hospitalizedCost": "0.00",
"lastTotalCost": "0.00",
"costChange": "0.00",
"costChangeRate": "100",
"urbanWorkersInsuranceFees": "0.00",
"urbanWorkersInsuranceNumber": "0.00",
"townspeopleInsuranceFees": "0.00",
"townspeopleInsuranceNumber": "0.00",
"otherInsuranceFees": "0.00",
"otherInsuranceNumber": "0.00",
"voluntaryFees": "0.00",
"voluntaryNumber": "0.00",
"hospitalizedNumber": "0",
"lastHospitalizedNumber": "0.00",
"numberChange": "0",
"numberChangeRate": "100",
"hospitalizedDays": "0",
"medianHospitalizedDays": "0",
"hospitalizedOnceCost": "0",
"costOnceChange": "0.00",
"costOnceChangeRate": "100",
"urbanWorkersInsuranceOnceFees": "0",
"townspeopleInsuranceOnceFees": "0",
"otherInsuranceOnceFees": "0",
"voluntaryOnceFees": "0"
},
{
"id": "e8d261df4f87422707b18ceb35f3f949",
"code": "340100-YL-01-50001",
"name": "合肥市第一人民医院",
"hospitalizedCost": "1.60",
"lastTotalCost": "0.00",
"costChange": "1.60",
"costChangeRate": "100",
"urbanWorkersInsuranceFees": "0.79",
"urbanWorkersInsuranceNumber": "34.00",
"townspeopleInsuranceFees": "0.00",
"townspeopleInsuranceNumber": "0.00",
"otherInsuranceFees": "0.53",
"otherInsuranceNumber": "23.00",
"voluntaryFees": "0.27",
"voluntaryNumber": "5.00",
"hospitalizedNumber": "62",
"lastHospitalizedNumber": "0.00",
"numberChange": "62",
"numberChangeRate": "100",
"hospitalizedDays": "62",
"medianHospitalizedDays": "1.00",
"hospitalizedOnceCost": "257.44",
"costOnceChange": "257.44",
"costOnceChangeRate": "100",
"urbanWorkersInsuranceOnceFees": "232.94",
"townspeopleInsuranceOnceFees": "0",
"otherInsuranceOnceFees": "231.83",
"voluntaryOnceFees": "541.77"
},
{
"id": "c65cce448ff02dca4c69ed6e7b6d3f52",
"code": "340000-03-10040-50020-50001-50002",
"name": "安徽省公共卫生临床中心",
"hospitalizedCost": "0.00",
"lastTotalCost": "0.00",
"costChange": "0.00",
"costChangeRate": "100",
"urbanWorkersInsuranceFees": "0.00",
"urbanWorkersInsuranceNumber": "0.00",
"townspeopleInsuranceFees": "0.00",
"townspeopleInsuranceNumber": "0.00",
"otherInsuranceFees": "0.00",
"otherInsuranceNumber": "0.00",
"voluntaryFees": "0.00",
"voluntaryNumber": "0.00",
"hospitalizedNumber": "0",
"lastHospitalizedNumber": "0.00",
"numberChange": "0",
"numberChangeRate": "100",
"hospitalizedDays": "0",
"medianHospitalizedDays": "0",
"hospitalizedOnceCost": "0",
"costOnceChange": "0.00",
"costOnceChangeRate": "100",
"urbanWorkersInsuranceOnceFees": "0",
"townspeopleInsuranceOnceFees": "0",
"otherInsuranceOnceFees": "0",
"voluntaryOnceFees": "0"
},
{
"id": "df52003aac460f34d93496e37185b2f3",
"code": "341124-03-10017-50014-50006",
"name": "全椒县武岗镇中心村卫生室",
"hospitalizedCost": "0.00",
"lastTotalCost": "0.00",
"costChange": "0.00",
"costChangeRate": "100",
"urbanWorkersInsuranceFees": "0.00",
"urbanWorkersInsuranceNumber": "0.00",
"townspeopleInsuranceFees": "0.00",
"townspeopleInsuranceNumber": "0.00",
"otherInsuranceFees": "0.00",
"otherInsuranceNumber": "0.00",
"voluntaryFees": "0.00",
"voluntaryNumber": "0.00",
"hospitalizedNumber": "0",
"lastHospitalizedNumber": "0.00",
"numberChange": "0",
"numberChangeRate": "100",
"hospitalizedDays": "0",
"medianHospitalizedDays": "0",
"hospitalizedOnceCost": "0",
"costOnceChange": "0.00",
"costOnceChangeRate": "100",
"urbanWorkersInsuranceOnceFees": "0",
"townspeopleInsuranceOnceFees": "0",
"otherInsuranceOnceFees": "0",
"voluntaryOnceFees": "0"
},
{
"id": "e224f278e21e0f07e6b0e80cc22d7fe1",
"code": "340000-03-10025-50047",
"name": "安徽省卫生健康委员会信息中心",
"hospitalizedCost": "0.00",
"lastTotalCost": "0.00",
"costChange": "0.00",
"costChangeRate": "100",
"urbanWorkersInsuranceFees": "0.00",
"urbanWorkersInsuranceNumber": "0.00",
"townspeopleInsuranceFees": "0.00",
"townspeopleInsuranceNumber": "0.00",
"otherInsuranceFees": "0.00",
"otherInsuranceNumber": "0.00",
"voluntaryFees": "0.00",
"voluntaryNumber": "0.00",
"hospitalizedNumber": "0",
"lastHospitalizedNumber": "0.00",
"numberChange": "0",
"numberChangeRate": "100",
"hospitalizedDays": "0",
"medianHospitalizedDays": "0",
"hospitalizedOnceCost": "0",
"costOnceChange": "0.00",
"costOnceChangeRate": "100",
"urbanWorkersInsuranceOnceFees": "0",
"townspeopleInsuranceOnceFees": "0",
"otherInsuranceOnceFees": "0",
"voluntaryOnceFees": "0"
},
{
"id": "f78a86d37da8624b18ef573545782146",
"code": "341124-03-10017-50011-50002",
"name": "全椒县西王镇管坝村卫生室",
"hospitalizedCost": "0.00",
"lastTotalCost": "0.00",
"costChange": "0.00",
"costChangeRate": "100",
"urbanWorkersInsuranceFees": "0.00",
"urbanWorkersInsuranceNumber": "0.00",
"townspeopleInsuranceFees": "0.00",
"townspeopleInsuranceNumber": "0.00",
"otherInsuranceFees": "0.00",
"otherInsuranceNumber": "0.00",
"voluntaryFees": "0.00",
"voluntaryNumber": "0.00",
"hospitalizedNumber": "0",
"lastHospitalizedNumber": "0.00",
"numberChange": "0",
"numberChangeRate": "100",
"hospitalizedDays": "0",
"medianHospitalizedDays": "0",
"hospitalizedOnceCost": "0",
"costOnceChange": "0.00",
"costOnceChangeRate": "100",
"urbanWorkersInsuranceOnceFees": "0",
"townspeopleInsuranceOnceFees": "0",
"otherInsuranceOnceFees": "0",
"voluntaryOnceFees": "0"
},
{
"id": "6d02dda2869f3d2335d9c5a0ce913a86",
"code": "341124-03-10017-50014-50001",
"name": "全椒县武岗镇官渡村卫生室",
"hospitalizedCost": "0.00",
"lastTotalCost": "0.00",
"costChange": "0.00",
"costChangeRate": "100",
"urbanWorkersInsuranceFees": "0.00",
"urbanWorkersInsuranceNumber": "0.00",
"townspeopleInsuranceFees": "0.00",
"townspeopleInsuranceNumber": "0.00",
"otherInsuranceFees": "0.00",
"otherInsuranceNumber": "0.00",
"voluntaryFees": "0.00",
"voluntaryNumber": "0.00",
"hospitalizedNumber": "0",
"lastHospitalizedNumber": "0.00",
"numberChange": "0",
"numberChangeRate": "100",
"hospitalizedDays": "0",
"medianHospitalizedDays": "0",
"hospitalizedOnceCost": "0",
"costOnceChange": "0.00",
"costOnceChangeRate": "100",
"urbanWorkersInsuranceOnceFees": "0",
"townspeopleInsuranceOnceFees": "0",
"otherInsuranceOnceFees": "0",
"voluntaryOnceFees": "0"
},
{
"id": "20220622160936160-4A2F-0A54C7B54",
"code": "20220622160936160-4A2F-0A54C7B54",
"name": "滁州市第一人民医院",
"hospitalizedCost": "0.00",
"lastTotalCost": "0.00",
"costChange": "0.00",
"costChangeRate": "100",
"urbanWorkersInsuranceFees": "0.00",
"urbanWorkersInsuranceNumber": "0.00",
"townspeopleInsuranceFees": "0.00",
"townspeopleInsuranceNumber": "0.00",
"otherInsuranceFees": "0.00",
"otherInsuranceNumber": "0.00",
"voluntaryFees": "0.00",
"voluntaryNumber": "0.00",
"hospitalizedNumber": "0",
"lastHospitalizedNumber": "0.00",
"numberChange": "0",
"numberChangeRate": "100",
"hospitalizedDays": "0",
"medianHospitalizedDays": "0",
"hospitalizedOnceCost": "0",
"costOnceChange": "0.00",
"costOnceChangeRate": "100",
"urbanWorkersInsuranceOnceFees": "0",
"townspeopleInsuranceOnceFees": "0",
"otherInsuranceOnceFees": "0",
"voluntaryOnceFees": "0"
},
{
"id": "56402cd4320679ef9473da29ed93def9",
"code": "341102-03-10002",
"name": "琅琊区卫生健康委员会(疾病预防控制局)",
"hospitalizedCost": "0.00",
"lastTotalCost": "0.00",
"costChange": "0.00",
"costChangeRate": "100",
"urbanWorkersInsuranceFees": "0.00",
"urbanWorkersInsuranceNumber": "0.00",
"townspeopleInsuranceFees": "0.00",
"townspeopleInsuranceNumber": "0.00",
"otherInsuranceFees": "0.00",
"otherInsuranceNumber": "0.00",
"voluntaryFees": "0.00",
"voluntaryNumber": "0.00",
"hospitalizedNumber": "0",
"lastHospitalizedNumber": "0.00",
"numberChange": "0",
"numberChangeRate": "100",
"hospitalizedDays": "0",
"medianHospitalizedDays": "0",
"hospitalizedOnceCost": "0",
"costOnceChange": "0.00",
"costOnceChangeRate": "100",
"urbanWorkersInsuranceOnceFees": "0",
"townspeopleInsuranceOnceFees": "0",
"otherInsuranceOnceFees": "0",
"voluntaryOnceFees": "0"
}
]