From 9903954c85f651dd5cc6d4b538cfe66b17fc5baa Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期三, 28 十月 2026 18:23:45 +0800
Subject: [PATCH] 提交
---
src/views/Satisfaction/sfstatistics/components/FollowupStatistics.vue | 185 +++++++++++++++++++++++++++++++++-------------
1 files changed, 133 insertions(+), 52 deletions(-)
diff --git a/src/views/Satisfaction/sfstatistics/components/FollowupStatistics.vue b/src/views/Satisfaction/sfstatistics/components/FollowupStatistics.vue
index e5eb304..754e244 100644
--- a/src/views/Satisfaction/sfstatistics/components/FollowupStatistics.vue
+++ b/src/views/Satisfaction/sfstatistics/components/FollowupStatistics.vue
@@ -12,7 +12,7 @@
<el-form-item label="婊℃剰搴︾被鍨�" prop="satisfactionScope">
<el-select
v-model="satisfactionScope"
- placeholder="榛樿绂婚櫌"
+ placeholder="榛樿鍦ㄩ櫌"
clearable
style="width: 150px"
@change="handleSatisfactionScopeChange"
@@ -150,33 +150,67 @@
@selection-change="handleSelectionChange"
:row-key="getRowKey"
>
- <!-- 鐥呭尯鍒楋細浣忛櫌婊℃剰搴︾粺璁″湪闄㈢梾鍖猴紝鍏朵綑缁熻鍑洪櫌鐥呭尯 -->
+ <!-- 鐥呭尯缁熻锛氬湪闄㈢梾鍖� + 绂婚櫌鐥呭尯 -->
<el-table-column
v-if="queryParams.statisticaltype == 1"
- :label="wardColumnLabel"
+ label="鍦ㄩ櫌鐥呭尯"
+ align="center"
+ sortable
+ key="hospitaldistrictname"
+ prop="hospitaldistrictname"
+ :show-overflow-tooltip="true"
+ :sort-method="sortHospitalWard"
+ min-width="120"
+ >
+ <template slot-scope="scope">
+ {{ scope.row.hospitaldistrictname || "-" }}
+ </template>
+ </el-table-column>
+
+ <el-table-column
+ v-if="queryParams.statisticaltype == 1"
+ label="绂婚櫌鐥呭尯"
align="center"
sortable
key="leavehospitaldistrictname"
prop="leavehospitaldistrictname"
:show-overflow-tooltip="true"
- :sort-method="sortChineseNumber"
+ :sort-method="sortLeaveWard"
min-width="120"
>
<template slot-scope="scope">
- {{ getWardName(scope.row) || "-" }}
+ {{ scope.row.leavehospitaldistrictname || "-" }}
</template>
</el-table-column>
- <!-- 绉戝鍒� -->
+ <!-- 绉戝缁熻锛氬湪闄㈢瀹� + 绂婚櫌绉戝 -->
<el-table-column
v-if="queryParams.statisticaltype == 2"
- label="绉戝"
+ label="鍦ㄩ櫌绉戝"
+ align="center"
+ key="hospitaldeptname"
+ prop="hospitaldeptname"
+ :show-overflow-tooltip="true"
+ min-width="120"
+ >
+ <template slot-scope="scope">
+ {{ scope.row.hospitaldeptname || "-" }}
+ </template>
+ </el-table-column>
+
+ <el-table-column
+ v-if="queryParams.statisticaltype == 2"
+ label="绂婚櫌绉戝"
align="center"
key="deptname"
prop="deptname"
:show-overflow-tooltip="true"
min-width="120"
- />
+ >
+ <template slot-scope="scope">
+ {{ scope.row.deptname || "-" }}
+ </template>
+ </el-table-column>
<el-table-column
label="鍑洪櫌浜烘"
@@ -367,14 +401,16 @@
data() {
return {
// 婊℃剰搴︾被鍨嬶細leave=绂婚櫌婊℃剰搴︼紙鎸夊嚭闄㈢梾鍖虹粺璁★級锛宧ospital=鍦ㄩ櫌婊℃剰搴︼紙鎸夊湪闄㈢梾鍖虹粺璁★級
- satisfactionScope: "leave",
+ // 榛樿鍦ㄩ櫌婊℃剰搴�
+ satisfactionScope: "hospital",
// 鏌ヨ鍙傛暟
queryParams: {
statisticaltype: 1,
leavehospitaldistrictcodes: ["all"],
deptcodes: [],
- serviceType: [2],
+ // 榛樿鏈嶅姟绫诲瀷锛�6=浣忛櫌婊℃剰搴︼紙鍑哄叆闄㈡弧鎰忓害锛�
+ serviceType: [6],
dateRange: [],
pageNum: 1,
pageSize: 20,
@@ -480,15 +516,11 @@
},
computed: {
- // 鏄惁鎸夈�屽湪闄㈡弧鎰忓害銆嶅彛寰勭粺璁★細鍦ㄩ櫌鎮h�呮寜鍦ㄩ櫌鐥呭尯(hospitaldistrictcodes)缁熻锛�
- // 绂婚櫌婊℃剰搴︿粛鎸夊嚭闄㈢梾鍖�(leavehospitaldistrictcodes)缁熻
+ // 鏄惁鎸夈�屽湪闄㈡弧鎰忓害銆嶅彛寰勭粺璁★細鍦ㄩ櫌鐢� hospitaldistrictcodes / hospitaldeptcodes锛�
+ // 绂婚櫌鐢� leavehospitaldistrictcodes / leaveldeptcodes
+ // 榛樿鍦ㄩ櫌锛屾墍浠ユ竻绌轰笅鎷夋椂浠嶆寜鍦ㄩ櫌鍙e緞澶勭悊
isInHospitalSatisfaction() {
- return this.satisfactionScope === "hospital";
- },
-
- // 鐥呭尯鍒楁爣棰�
- wardColumnLabel() {
- return this.isInHospitalSatisfaction ? "鍦ㄩ櫌鐥呭尯" : "鍑洪櫌鐥呭尯";
+ return this.satisfactionScope !== "leave";
},
},
@@ -554,7 +586,8 @@
params.endTime = this.queryParams.dateRange[1];
}
- // 澶勭悊鐥呭尯/绉戝閫夋嫨
+ // 澶勭悊鐥呭尯/绉戝閫夋嫨锛氬彧淇濈暀褰撳墠缁熻绫诲瀷 + 褰撳墠婊℃剰搴︾被鍨嬪搴旂殑瀛楁锛�
+ // 閬垮厤鍦ㄩ櫌/绂婚櫌涓ゅ鏉′欢鍚屾椂鎷艰繘 SQL
if (params.statisticaltype == 1) {
// 鐥呭尯缁熻
let wardCodes = params.leavehospitaldistrictcodes || [];
@@ -564,9 +597,11 @@
(ward) => ward.districtCode
);
}
- // 浣忛櫌婊℃剰搴﹂拡瀵瑰湪闄㈡偅鑰咃紝鎸夊湪闄㈢梾鍖�(hospitaldistrictcodes)缁熻锛�
- // 鍑洪櫌闅忚绛夊叾浠栨湇鍔$被鍨嬩粛鎸夊嚭闄㈢梾鍖�(leavehospitaldistrictcodes)缁熻
delete params.leavehospitaldistrictcodes;
+ delete params.hospitaldistrictcodes;
+ delete params.deptcodes;
+ delete params.leaveldeptcodes;
+ delete params.hospitaldeptcodes;
if (this.isInHospitalSatisfaction) {
params.hospitaldistrictcodes = wardCodes;
} else {
@@ -574,20 +609,33 @@
}
} else if (params.statisticaltype == 2) {
// 绉戝缁熻
- if (params.deptcodes.includes("all")) {
+ let deptCodes = params.deptcodes || [];
+ if (deptCodes.includes("all")) {
// 濡傛灉閫夋嫨浜�"鍏ㄩ儴"锛屽垯绉婚櫎"all"鍊�
- params.deptcodes = params.deptcodes.filter(
- (item) => item !== "all"
- );
+ deptCodes = deptCodes.filter((item) => item !== "all");
// 濡傛灉闇�瑕佷紶鎵�鏈夌瀹や唬鐮侊紝鍙互浠巗tore涓幏鍙�
- params.deptcodes = (this.$store.getters.belongDepts || []).map(
+ deptCodes = (this.$store.getters.belongDepts || []).map(
(dept) => dept.deptCode
);
+ }
+ delete params.deptcodes;
+ delete params.leaveldeptcodes;
+ delete params.hospitaldeptcodes;
+ delete params.leavehospitaldistrictcodes;
+ delete params.hospitaldistrictcodes;
+ if (this.isInHospitalSatisfaction) {
+ params.hospitaldeptcodes = deptCodes;
+ } else {
+ params.leaveldeptcodes = deptCodes;
}
}
const response = await getSfStatisticsJoy(params);
- this.userList = this.customSort(response.data) || [];
+ // 绉戝缁熻鎸夋帴鍙h繑鍥為『搴忥紝鐥呭尯缁熻淇濇寔鍘熸湁鐨勪腑鏂囧簭鍙锋帓搴�
+ this.userList =
+ this.queryParams.statisticaltype == 1
+ ? this.customSort(response.data) || []
+ : response.data || [];
this.total = response.total || 0;
} catch (error) {
console.error("鑾峰彇缁熻鍒楄〃澶辫触:", error);
@@ -597,9 +645,22 @@
}
},
sortChineseNumber(aRow, bRow) {
- const a = this.getWardName(aRow);
- const b = this.getWardName(bRow);
-
+ return this.compareWardNames(this.getWardName(aRow), this.getWardName(bRow));
+ },
+ sortHospitalWard(aRow, bRow) {
+ return this.compareWardNames(
+ aRow && aRow.hospitaldistrictname,
+ bRow && bRow.hospitaldistrictname
+ );
+ },
+ sortLeaveWard(aRow, bRow) {
+ return this.compareWardNames(
+ aRow && aRow.leavehospitaldistrictname,
+ bRow && bRow.leavehospitaldistrictname
+ );
+ },
+ // 姣旇緝涓や釜鐥呭尯鍚嶇О鐨勪腑鏂囧簭鍙凤紱鏃犲簭鍙锋椂鎸夊瓧绗︿覆姣旇緝
+ compareWardNames(a, b) {
// 涓枃鏁板瓧鍒伴樋鎷変集鏁板瓧鐨勬槧灏勶紙鎵╁睍鍒�45锛�
const chineseNumMap = {
涓�: 1,
@@ -793,13 +854,14 @@
this.getList();
},
- // 閲嶇疆鏌ヨ
+ // 閲嶇疆鏌ヨ锛堟仮澶嶉粯璁わ細鍦ㄩ櫌婊℃剰搴� + 鏈嶅姟绫诲瀷 6锛�
resetQuery() {
+ this.satisfactionScope = "hospital";
this.queryParams = {
statisticaltype: 1,
leavehospitaldistrictcodes: [],
deptcodes: [],
- serviceType: [2],
+ serviceType: [6],
dateRange: [],
pageNum: 1,
pageSize: 20,
@@ -827,17 +889,19 @@
this.multiple = !selection.length;
},
- // 鑾峰彇琛宬ey
+ // 鑾峰彇琛宬ey锛堟寜褰撳墠缁熻绫诲瀷鍙栧搴旂淮搴︾紪鐮侊級
getRowKey(row) {
- return row.statisticaltype === 1
+ return this.queryParams.statisticaltype == 1
? row.hospitaldistrictcode || row.leavehospitaldistrictcode
- : row.deptcode;
+ : row.hospitaldeptcode || row.deptcode;
},
- // 鐥呭尯鍚嶇О锛氫綇闄㈡弧鎰忓害鎺ュ彛杩斿洖鍦ㄩ櫌鐥呭尯瀛楁锛屽叾浣欒繑鍥炲嚭闄㈢梾鍖哄瓧娈�
+ // 褰撳墠婊℃剰搴︾被鍨嬪搴旂殑鐥呭尯鍚嶇О锛堢敤浜庢帓搴�/瀵煎嚭/璇︽儏鏍囬锛�
getWardName(row) {
if (!row) return "";
- return row.hospitaldistrictname || row.leavehospitaldistrictname || "";
+ return this.isInHospitalSatisfaction
+ ? row.hospitaldistrictname || ""
+ : row.leavehospitaldistrictname || "";
},
// 鏍煎紡鍖栫櫨鍒嗘瘮
@@ -874,22 +938,33 @@
params.endTime = this.queryParams.dateRange[1];
}
+ // 璇︽儏鍙寜褰撳墠鍒嗙粍缁村害杩囨护锛屾竻鎺夊叾浣欑淮搴︼紝閬垮厤鍦ㄩ櫌/绂婚櫌鏉′欢浜掔浉骞叉壈
+ delete params.deptcodes;
+ delete params.leaveldeptcodes;
+ delete params.hospitaldeptcodes;
+ delete params.leavehospitaldistrictcodes;
+ delete params.hospitaldistrictcodes;
+
if (this.queryParams.statisticaltype == 1) {
- this.topicvalue.name = this.getWardName(row);
- // 浣忛櫌婊℃剰搴︽寜鍦ㄩ櫌鐥呭尯缁熻锛屽叾浣欐寜鍑洪櫌鐥呭尯缁熻
if (this.isInHospitalSatisfaction) {
- delete params.leavehospitaldistrictcodes;
- params.hospitaldistrictcodes = [
- row.hospitaldistrictcode || row.leavehospitaldistrictcode,
- ];
+ this.topicvalue.name = row.hospitaldistrictname || "-";
+ params.hospitaldistrictcodes = [row.hospitaldistrictcode].filter(
+ Boolean
+ );
} else {
+ this.topicvalue.name = row.leavehospitaldistrictname || "-";
params.leavehospitaldistrictcodes = [
row.leavehospitaldistrictcode,
- ];
+ ].filter(Boolean);
}
} else {
- this.topicvalue.name = row.deptname;
- params.deptcodes = [row.deptcode];
+ if (this.isInHospitalSatisfaction) {
+ this.topicvalue.name = row.hospitaldeptname || "-";
+ params.hospitaldeptcodes = [row.hospitaldeptcode].filter(Boolean);
+ } else {
+ this.topicvalue.name = row.deptname || "-";
+ params.leaveldeptcodes = [row.deptcode].filter(Boolean);
+ }
}
const response = await getSfStatisticsJoyInfo(params);
@@ -1012,16 +1087,18 @@
},
};
- // 娣诲姞鎬绘爣棰�
+ // 娣诲姞鎬绘爣棰橈紙涓ゅ垪缁村害 + 鍏釜鎸囨爣鍒楋紝鍏� 10 鍒楋級
worksheet.mergeCells(1, 1, 1, 10);
const titleCell = worksheet.getCell(1, 1);
titleCell.value = `婊℃剰搴﹂殢璁跨粺璁¤〃锛�${sheetNameSuffix}锛塦;
titleCell.style = titleStyle;
worksheet.getRow(1).height = 35;
- // 娣诲姞琛ㄥご
+ // 娣诲姞琛ㄥご锛堢瀹ょ粺璁″鍑哄湪闄㈢瀹�+绂婚櫌绉戝锛岀梾鍖虹粺璁″鍑哄湪闄㈢梾鍖�+绂婚櫌鐥呭尯锛�
+ const isWardStatistics = this.queryParams.statisticaltype == 1;
const headers = [
- this.queryParams.statisticaltype == 1 ? this.wardColumnLabel : "绉戝",
+ isWardStatistics ? "鍦ㄩ櫌鐥呭尯" : "鍦ㄩ櫌绉戝",
+ isWardStatistics ? "绂婚櫌鐥呭尯" : "绂婚櫌绉戝",
"鍑洪櫌浜烘",
"鏃犻渶闅忚浜烘",
"搴旈殢璁夸汉娆�",
@@ -1041,9 +1118,12 @@
// 娣诲姞鏁版嵁琛�
this.userList.forEach((item) => {
const dataRow = worksheet.addRow([
- this.queryParams.statisticaltype == 1
- ? this.getWardName(item)
- : item.deptname,
+ isWardStatistics
+ ? item.hospitaldistrictname || "-"
+ : item.hospitaldeptname || "-",
+ isWardStatistics
+ ? item.leavehospitaldistrictname || "-"
+ : item.deptname || "-",
item.dischargeCount || 0,
item.nonFollowUp || 0,
item.followUpNeeded || 0,
@@ -1063,6 +1143,7 @@
// 璁剧疆鍒楀
worksheet.columns = [
{ width: 20 },
+ { width: 20 },
{ width: 12 },
{ width: 12 },
{ width: 12 },
--
Gitblit v1.9.3