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 | 256 +++++++++++++++++++++++++++++++++++++++++----------
1 files changed, 206 insertions(+), 50 deletions(-)
diff --git a/src/views/Satisfaction/sfstatistics/components/FollowupStatistics.vue b/src/views/Satisfaction/sfstatistics/components/FollowupStatistics.vue
index 80f1160..754e244 100644
--- a/src/views/Satisfaction/sfstatistics/components/FollowupStatistics.vue
+++ b/src/views/Satisfaction/sfstatistics/components/FollowupStatistics.vue
@@ -9,6 +9,19 @@
label-width="100px"
class="query-form"
>
+ <el-form-item label="婊℃剰搴︾被鍨�" prop="satisfactionScope">
+ <el-select
+ v-model="satisfactionScope"
+ placeholder="榛樿鍦ㄩ櫌"
+ clearable
+ style="width: 150px"
+ @change="handleSatisfactionScopeChange"
+ >
+ <el-option label="绂婚櫌婊℃剰搴�" value="leave" />
+ <el-option label="鍦ㄩ櫌婊℃剰搴�" value="hospital" />
+ </el-select>
+ </el-form-item>
+
<el-form-item label="缁熻绫诲瀷" prop="statisticaltype">
<el-select
v-model="queryParams.statisticaltype"
@@ -137,29 +150,67 @@
@selection-change="handleSelectionChange"
:row-key="getRowKey"
>
- <!-- 鐥呭尯鍒� -->
+ <!-- 鐥呭尯缁熻锛氬湪闄㈢梾鍖� + 绂婚櫌鐥呭尯 -->
<el-table-column
v-if="queryParams.statisticaltype == 1"
- label="鍑洪櫌鐥呭尯"
+ 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">
+ {{ 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="鍑洪櫌浜烘"
@@ -349,12 +400,17 @@
},
data() {
return {
+ // 婊℃剰搴︾被鍨嬶細leave=绂婚櫌婊℃剰搴︼紙鎸夊嚭闄㈢梾鍖虹粺璁★級锛宧ospital=鍦ㄩ櫌婊℃剰搴︼紙鎸夊湪闄㈢梾鍖虹粺璁★級
+ // 榛樿鍦ㄩ櫌婊℃剰搴�
+ satisfactionScope: "hospital",
+
// 鏌ヨ鍙傛暟
queryParams: {
statisticaltype: 1,
leavehospitaldistrictcodes: ["all"],
deptcodes: [],
- serviceType: [2],
+ // 榛樿鏈嶅姟绫诲瀷锛�6=浣忛櫌婊℃剰搴︼紙鍑哄叆闄㈡弧鎰忓害锛�
+ serviceType: [6],
dateRange: [],
pageNum: 1,
pageSize: 20,
@@ -373,7 +429,25 @@
flatArraydept: [],
// 鏈嶅姟绫诲瀷閫夐」
- options: [],
+ options: [
+ {
+ value: 6,
+ label: "浣忛櫌婊℃剰搴�",
+ raw: {
+ cssClass: "",
+ listClass: "",
+ },
+ },
+
+ {
+ value: 14,
+ label: "闂ㄨ瘖婊℃剰搴�",
+ raw: {
+ cssClass: "",
+ listClass: "",
+ },
+ },
+ ],
// 琛ㄦ牸鏁版嵁
userList: [],
@@ -441,6 +515,15 @@
};
},
+ computed: {
+ // 鏄惁鎸夈�屽湪闄㈡弧鎰忓害銆嶅彛寰勭粺璁★細鍦ㄩ櫌鐢� hospitaldistrictcodes / hospitaldeptcodes锛�
+ // 绂婚櫌鐢� leavehospitaldistrictcodes / leaveldeptcodes
+ // 榛樿鍦ㄩ櫌锛屾墍浠ユ竻绌轰笅鎷夋椂浠嶆寜鍦ㄩ櫌鍙e緞澶勭悊
+ isInHospitalSatisfaction() {
+ return this.satisfactionScope !== "leave";
+ },
+ },
+
created() {
this.orgname = localStorage.getItem("orgname");
@@ -503,36 +586,56 @@
params.endTime = this.queryParams.dateRange[1];
}
- // 澶勭悊鐥呭尯/绉戝閫夋嫨
+ // 澶勭悊鐥呭尯/绉戝閫夋嫨锛氬彧淇濈暀褰撳墠缁熻绫诲瀷 + 褰撳墠婊℃剰搴︾被鍨嬪搴旂殑瀛楁锛�
+ // 閬垮厤鍦ㄩ櫌/绂婚櫌涓ゅ鏉′欢鍚屾椂鎷艰繘 SQL
if (params.statisticaltype == 1) {
// 鐥呭尯缁熻
- if (params.leavehospitaldistrictcodes.includes("all")) {
- // 濡傛灉閫夋嫨浜�"鍏ㄩ儴"锛屽垯绉婚櫎"all"鍊�
- params.leavehospitaldistrictcodes =
- params.leavehospitaldistrictcodes.filter(
- (item) => item !== "all"
- );
- // 濡傛灉闇�瑕佷紶鎵�鏈夌梾鍖轰唬鐮侊紝鍙互浠巗tore涓幏鍙�
- params.leavehospitaldistrictcodes = (
- this.$store.getters.belongWards || []
- ).map((ward) => ward.districtCode);
+ let wardCodes = params.leavehospitaldistrictcodes || [];
+ if (wardCodes.includes("all")) {
+ // 濡傛灉閫夋嫨浜�"鍏ㄩ儴"锛屽垯浣跨敤褰撳墠鐢ㄦ埛鎵�灞炵殑鍏ㄩ儴鐥呭尯
+ wardCodes = (this.$store.getters.belongWards || []).map(
+ (ward) => ward.districtCode
+ );
+ }
+ delete params.leavehospitaldistrictcodes;
+ delete params.hospitaldistrictcodes;
+ delete params.deptcodes;
+ delete params.leaveldeptcodes;
+ delete params.hospitaldeptcodes;
+ if (this.isInHospitalSatisfaction) {
+ params.hospitaldistrictcodes = wardCodes;
+ } else {
+ params.leavehospitaldistrictcodes = wardCodes;
}
} 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);
@@ -542,9 +645,22 @@
}
},
sortChineseNumber(aRow, bRow) {
- const a = aRow.leavehospitaldistrictname;
- const b = bRow.leavehospitaldistrictname;
-
+ 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,
@@ -703,14 +819,12 @@
return -1;
};
- const indexA = getIndex(a.leavehospitaldistrictname);
- const indexB = getIndex(b.leavehospitaldistrictname);
+ const indexA = getIndex(this.getWardName(a));
+ const indexB = getIndex(this.getWardName(b));
// 鎺掑簭閫昏緫
if (indexA === -1 && indexB === -1) {
- return (a.leavehospitaldistrictname || "").localeCompare(
- b.leavehospitaldistrictname || ""
- );
+ return this.getWardName(a).localeCompare(this.getWardName(b));
}
if (indexA === -1) return 1;
if (indexB === -1) return -1;
@@ -734,13 +848,20 @@
this.getList();
},
- // 閲嶇疆鏌ヨ
+ // 鍒囨崲婊℃剰搴︾被鍨嬶紙绂婚櫌/鍦ㄩ櫌锛夊悗閲嶆柊鏌ヨ
+ handleSatisfactionScopeChange() {
+ this.queryParams.pageNum = 1;
+ this.getList();
+ },
+
+ // 閲嶇疆鏌ヨ锛堟仮澶嶉粯璁わ細鍦ㄩ櫌婊℃剰搴� + 鏈嶅姟绫诲瀷 6锛�
resetQuery() {
+ this.satisfactionScope = "hospital";
this.queryParams = {
statisticaltype: 1,
leavehospitaldistrictcodes: [],
deptcodes: [],
- serviceType: [2],
+ serviceType: [6],
dateRange: [],
pageNum: 1,
pageSize: 20,
@@ -768,11 +889,19 @@
this.multiple = !selection.length;
},
- // 鑾峰彇琛宬ey
+ // 鑾峰彇琛宬ey锛堟寜褰撳墠缁熻绫诲瀷鍙栧搴旂淮搴︾紪鐮侊級
getRowKey(row) {
- return row.statisticaltype === 1
- ? row.leavehospitaldistrictcode
- : row.deptcode;
+ return this.queryParams.statisticaltype == 1
+ ? row.hospitaldistrictcode || row.leavehospitaldistrictcode
+ : row.hospitaldeptcode || row.deptcode;
+ },
+
+ // 褰撳墠婊℃剰搴︾被鍨嬪搴旂殑鐥呭尯鍚嶇О锛堢敤浜庢帓搴�/瀵煎嚭/璇︽儏鏍囬锛�
+ getWardName(row) {
+ if (!row) return "";
+ return this.isInHospitalSatisfaction
+ ? row.hospitaldistrictname || ""
+ : row.leavehospitaldistrictname || "";
},
// 鏍煎紡鍖栫櫨鍒嗘瘮
@@ -809,12 +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 = row.leavehospitaldistrictname;
- params.leavehospitaldistrictcodes = [row.leavehospitaldistrictcode];
+ if (this.isInHospitalSatisfaction) {
+ 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);
@@ -937,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 ? "鍑洪櫌鐥呭尯" : "绉戝",
+ isWardStatistics ? "鍦ㄩ櫌鐥呭尯" : "鍦ㄩ櫌绉戝",
+ isWardStatistics ? "绂婚櫌鐥呭尯" : "绂婚櫌绉戝",
"鍑洪櫌浜烘",
"鏃犻渶闅忚浜烘",
"搴旈殢璁夸汉娆�",
@@ -966,9 +1118,12 @@
// 娣诲姞鏁版嵁琛�
this.userList.forEach((item) => {
const dataRow = worksheet.addRow([
- this.queryParams.statisticaltype == 1
- ? item.leavehospitaldistrictname
- : item.deptname,
+ isWardStatistics
+ ? item.hospitaldistrictname || "-"
+ : item.hospitaldeptname || "-",
+ isWardStatistics
+ ? item.leavehospitaldistrictname || "-"
+ : item.deptname || "-",
item.dischargeCount || 0,
item.nonFollowUp || 0,
item.followUpNeeded || 0,
@@ -988,6 +1143,7 @@
// 璁剧疆鍒楀
worksheet.columns = [
{ width: 20 },
+ { width: 20 },
{ width: 12 },
{ width: 12 },
{ width: 12 },
--
Gitblit v1.9.3