From a5cba9ab040f6f97558046885dce3017f9bab7e9 Mon Sep 17 00:00:00 2001
From: WXL (wul) <wl_5969728@163.com>
Date: 星期二, 11 八月 2026 14:12:29 +0800
Subject: [PATCH] 提交
---
src/views/sfstatistics/percentage/components/SecondFollowUp.vue | 316 ++++++++++++++++++++++++++++++----------------------
1 files changed, 182 insertions(+), 134 deletions(-)
diff --git a/src/views/sfstatistics/percentage/components/SecondFollowUp.vue b/src/views/sfstatistics/percentage/components/SecondFollowUp.vue
index 2a6b8e7..ed11442 100644
--- a/src/views/sfstatistics/percentage/components/SecondFollowUp.vue
+++ b/src/views/sfstatistics/percentage/components/SecondFollowUp.vue
@@ -229,11 +229,13 @@
</template>
</el-table-column>
<el-table-column
+ v-if="orgname != '鏅畞鐣叉棌鑷不鍘夸汉姘戝尰闄�'"
label="鎴愬姛鐜�"
align="center"
width="120"
key="successRateAgain"
prop="successRateAgain"
+ :render-header="Tooltipcgl"
>
<template slot-scope="scope">
<span class="success-rate">{{
@@ -251,6 +253,7 @@
width="120"
key="followUpRateAgain"
prop="followUpRateAgain"
+ :render-header="Tooltipsfl"
/>
<el-table-column
label="浜哄伐"
@@ -524,11 +527,13 @@
</template>
</el-table-column>
<el-table-column
+ v-if="orgname != '鏅畞鐣叉棌鑷不鍘夸汉姘戝尰闄�'"
label="鎴愬姛鐜�"
align="center"
width="120"
key="successRateAgain"
prop="successRateAgain"
+ :render-header="Tooltipcgl"
>
<template slot-scope="scope">
<span class="success-rate">{{
@@ -546,6 +551,7 @@
width="120"
key="followUpRateAgain"
prop="followUpRateAgain"
+ :render-header="Tooltipsfl"
/>
<el-table-column
label="浜哄伐"
@@ -693,7 +699,7 @@
delete params.leavehospitaldistrictcodes.all;
delete params.deptcodes.all;
- params.rateDay = 7;
+ params.rateDay = this.orgname == "榫欐硥甯備汉姘戝尰闄�" ? 21 : 7;
getSfStatistics(params)
.then((response) => {
@@ -707,7 +713,46 @@
this.loading = false;
});
},
-
+ Tooltipcgl(h, { column }) {
+ return h(
+ "el-tooltip",
+ {
+ props: {
+ content: "闅忚鎴愬姛/(闇�闅忚-寰呴殢璁�)",
+ placement: "top",
+ effect: "dark",
+ },
+ },
+ [h("span", column.label)]
+ );
+ },
+ Tooltipjsl(h, { column }) {
+ return h(
+ "el-tooltip",
+ {
+ props: {
+ content:
+ "(鍑洪櫌鏃堕棿+浠诲姟鍛ㄦ湡)灏忎簬瀹屾垚鏃堕棿鍗充负瓒呮椂;(闇�闅忚-瓒呮椂)/闇�闅忚",
+ placement: "top",
+ effect: "dark",
+ },
+ },
+ [h("span", column.label)]
+ );
+ },
+ Tooltipsfl(h, { column }) {
+ return h(
+ "el-tooltip",
+ {
+ props: {
+ content: "(闅忚鎴愬姛+棣栨闅忚澶辫触)/棣栨搴旈殢璁�",
+ placement: "top",
+ effect: "dark",
+ },
+ },
+ [h("span", column.label)]
+ );
+ },
getAllWardCodes() {
return this.flatArrayhospit
.filter((item) => item.value !== "all")
@@ -907,7 +952,7 @@
if (!row.doctorStats) {
this.loading = true;
- params.rateDay = 7;
+ params.rateDay = this.orgname == "榫欐硥甯備汉姘戝尰闄�" ? 21 : 7;
getSfStatistics(params).then((res) => {
this.$set(row, "doctorStats", res.data);
@@ -1107,143 +1152,145 @@
return rate.toFixed(2) + "%";
},
async exportTable() {
- try {
- let dateRangeString = "";
- let sheetNameSuffix = "";
+ try {
+ let dateRangeString = "";
+ let sheetNameSuffix = "";
- // 鍒ゆ柇鏄惁鏄附姘村競涓尰闄�
- const isLishuiHospital = this.orgname == "涓芥按甯備腑鍖婚櫌";
+ // 鍒ゆ柇鏄惁鏄附姘村競涓尰闄�
+ const isLishuiHospital = this.orgname == "涓芥按甯備腑鍖婚櫌";
- if (
- this.queryParams.dateRange &&
- this.queryParams.dateRange.length === 2
- ) {
- const startDateStr = this.queryParams.dateRange[0];
- const endDateStr = this.queryParams.dateRange[1];
+ if (
+ this.queryParams.dateRange &&
+ this.queryParams.dateRange.length === 2
+ ) {
+ const startDateStr = this.queryParams.dateRange[0];
+ const endDateStr = this.queryParams.dateRange[1];
- if (isLishuiHospital) {
- // 涓芥按甯備腑鍖婚櫌锛氬彧鏄剧ず骞存湀
- const formatMonthOnly = (dateTimeStr) => {
- const date = new Date(dateTimeStr);
- const year = date.getFullYear();
- const month = date.getMonth() + 1;
- return `${year}骞�${month}鏈坄;
+ if (isLishuiHospital) {
+ // 涓芥按甯備腑鍖婚櫌锛氬彧鏄剧ず骞存湀
+ const formatMonthOnly = (dateTimeStr) => {
+ const date = new Date(dateTimeStr);
+ const year = date.getFullYear();
+ const month = date.getMonth() + 1;
+ return `${year}骞�${month}鏈坄;
+ };
+ const startDateFormatted = formatMonthOnly(startDateStr);
+ const endDateFormatted = formatMonthOnly(endDateStr);
+ dateRangeString = `${startDateFormatted}鑷�${endDateFormatted}`;
+ sheetNameSuffix = `${startDateFormatted}鑷�${endDateFormatted}`;
+ } else {
+ // 鍏朵粬鍖婚櫌锛氭樉绀哄勾鏈堟棩
+ const formatDateForDisplay = (dateTimeStr) => {
+ return dateTimeStr.split(" ")[0];
+ };
+ const startDateFormatted = formatDateForDisplay(startDateStr);
+ const endDateFormatted = formatDateForDisplay(endDateStr);
+ dateRangeString = `${startDateFormatted}鑷�${endDateFormatted}`;
+ sheetNameSuffix = `${startDateFormatted}鑷�${endDateFormatted}`;
+ }
+ } else {
+ const now = new Date();
+ const currentMonth = now.getMonth() + 1;
+ const currentYear = now.getFullYear();
+
+ if (isLishuiHospital) {
+ // 涓芥按甯備腑鍖婚櫌锛氭樉绀哄勾鏈�
+ dateRangeString = `${currentYear}骞�${currentMonth}鏈坄;
+ sheetNameSuffix = `${currentYear}骞�${currentMonth}鏈坄;
+ } else {
+ // 鍏朵粬鍖婚櫌锛氭樉绀烘湀浠�
+ dateRangeString = `${currentMonth}鏈坄;
+ sheetNameSuffix = `${currentMonth}鏈坄;
+ }
+ }
+
+ // 鏍规嵁 serviceType 鐢熸垚闅忚绫诲瀷鍚嶇О
+ let serviceTypeName = "鍑洪櫌闅忚"; // 鏂囦欢鍚嶄娇鐢ㄧ殑鍚嶇О
+ let sheetTypeName = "鍐嶆闅忚"; // 宸ヤ綔琛ㄤ娇鐢ㄧ殑鍚嶇О锛堢畝鍖栫増锛�
+ console.log(this.queryParams.serviceType);
+
+ if (
+ this.queryParams.serviceType &&
+ Array.isArray(this.queryParams.serviceType) &&
+ this.queryParams.serviceType.length > 0
+ ) {
+ if (this.tasktypes && Array.isArray(this.tasktypes)) {
+ // 杩囨护鍑哄尮閰嶇殑闅忚绫诲瀷
+ const matchedTypes = this.tasktypes.filter((task) =>
+ this.queryParams.serviceType.includes(task.value)
+ );
+
+ if (matchedTypes.length === 1) {
+ // 鍗曚釜绫诲瀷
+ const label = matchedTypes[0].label;
+ serviceTypeName = label;
+ sheetTypeName = label;
+ } else if (matchedTypes.length > 1) {
+ // 澶氫釜绫诲瀷
+ const typeNames = matchedTypes.map((task) => task.label);
+
+ // 鏂囦欢鍚嶏細鐢ㄦ枩鏉犲垎闅�
+ serviceTypeName = typeNames.join("/");
+
+ // 宸ヤ綔琛ㄥ悕锛氫娇鐢ㄧ涓�涓被鍨嬫垨绠�鍖栧悕绉�
+ if (matchedTypes.length <= 2) {
+ // 濡傛灉鍙湁2涓被鍨嬶紝閮芥樉绀�
+ sheetTypeName = `${typeNames[0]}绛塦;
+ } else {
+ // 濡傛灉瓒呰繃2涓被鍨嬶紝鍙樉绀虹涓�涓�
+ sheetTypeName = `${typeNames[0]}绛塦;
+ }
+ } else if (this.queryParams.serviceType.length > 0) {
+ // 濡傛灉娌℃湁鍖归厤鐨勶紝浣跨敤鍘熷鍊�
+ const typeStr = this.queryParams.serviceType.join("/");
+ serviceTypeName = typeStr;
+ sheetTypeName = "鍐嶆闅忚";
+ }
+ } else if (this.queryParams.serviceType.length > 0) {
+ // 濡傛灉娌℃湁 tasktypes锛屼娇鐢ㄥ師濮嬪��
+ const typeStr = this.queryParams.serviceType.join("/");
+ serviceTypeName = typeStr;
+ sheetTypeName = "鍐嶆闅忚";
+ }
+ }
+
+ const excelName = `鍐嶆${serviceTypeName}缁熻琛╛${dateRangeString}.xlsx`;
+
+ // 娓呯悊宸ヤ綔琛ㄥ悕绉帮紝绉婚櫎闈炴硶瀛楃
+ const cleanSheetName = (name) => {
+ // Excel宸ヤ綔琛ㄥ悕涓嶈兘鍖呭惈鐨勫瓧绗�: * ? : \ / [ ]
+ return name.replace(/[*?:\\/[\]]/g, " ");
};
- const startDateFormatted = formatMonthOnly(startDateStr);
- const endDateFormatted = formatMonthOnly(endDateStr);
- dateRangeString = `${startDateFormatted}鑷�${endDateFormatted}`;
- sheetNameSuffix = `${startDateFormatted}鑷�${endDateFormatted}`;
- } else {
- // 鍏朵粬鍖婚櫌锛氭樉绀哄勾鏈堟棩
- const formatDateForDisplay = (dateTimeStr) => {
- return dateTimeStr.split(" ")[0];
- };
- const startDateFormatted = formatDateForDisplay(startDateStr);
- const endDateFormatted = formatDateForDisplay(endDateStr);
- dateRangeString = `${startDateFormatted}鑷�${endDateFormatted}`;
- sheetNameSuffix = `${startDateFormatted}鑷�${endDateFormatted}`;
- }
- } else {
- const now = new Date();
- const currentMonth = now.getMonth() + 1;
- const currentYear = now.getFullYear();
- if (isLishuiHospital) {
- // 涓芥按甯備腑鍖婚櫌锛氭樉绀哄勾鏈�
- dateRangeString = `${currentYear}骞�${currentMonth}鏈坄;
- sheetNameSuffix = `${currentYear}骞�${currentMonth}鏈坄;
- } else {
- // 鍏朵粬鍖婚櫌锛氭樉绀烘湀浠�
- dateRangeString = `${currentMonth}鏈坄;
- sheetNameSuffix = `${currentMonth}鏈坄;
- }
- }
-
- // 鏍规嵁 serviceType 鐢熸垚闅忚绫诲瀷鍚嶇О
- let serviceTypeName = "鍑洪櫌闅忚"; // 鏂囦欢鍚嶄娇鐢ㄧ殑鍚嶇О
- let sheetTypeName = "鍐嶆闅忚"; // 宸ヤ綔琛ㄤ娇鐢ㄧ殑鍚嶇О锛堢畝鍖栫増锛�
- console.log(this.queryParams.serviceType);
-
- if (
- this.queryParams.serviceType &&
- Array.isArray(this.queryParams.serviceType) &&
- this.queryParams.serviceType.length > 0
- ) {
- if (this.tasktypes && Array.isArray(this.tasktypes)) {
- // 杩囨护鍑哄尮閰嶇殑闅忚绫诲瀷
- const matchedTypes = this.tasktypes.filter((task) =>
- this.queryParams.serviceType.includes(task.value)
+ const worksheetName = cleanSheetName(
+ `鍐嶆${sheetTypeName}缁熻_${sheetNameSuffix}`
);
- if (matchedTypes.length === 1) {
- // 鍗曚釜绫诲瀷
- const label = matchedTypes[0].label;
- serviceTypeName = label;
- sheetTypeName = label;
- } else if (matchedTypes.length > 1) {
- // 澶氫釜绫诲瀷
- const typeNames = matchedTypes.map((task) => task.label);
-
- // 鏂囦欢鍚嶏細鐢ㄦ枩鏉犲垎闅�
- serviceTypeName = typeNames.join("/");
-
- // 宸ヤ綔琛ㄥ悕锛氫娇鐢ㄧ涓�涓被鍨嬫垨绠�鍖栧悕绉�
- if (matchedTypes.length <= 2) {
- // 濡傛灉鍙湁2涓被鍨嬶紝閮芥樉绀�
- sheetTypeName = `${typeNames[0]}绛塦;
- } else {
- // 濡傛灉瓒呰繃2涓被鍨嬶紝鍙樉绀虹涓�涓�
- sheetTypeName = `${typeNames[0]}绛塦;
- }
- } else if (this.queryParams.serviceType.length > 0) {
- // 濡傛灉娌℃湁鍖归厤鐨勶紝浣跨敤鍘熷鍊�
- const typeStr = this.queryParams.serviceType.join("/");
- serviceTypeName = typeStr;
- sheetTypeName = "鍐嶆闅忚";
+ if (!this.tableData || this.tableData.length === 0) {
+ this.$message.warning(`鏆傛棤鍐嶆${serviceTypeName}鏁版嵁鍙鍑篳);
+ return false;
}
- } else if (this.queryParams.serviceType.length > 0) {
- // 濡傛灉娌℃湁 tasktypes锛屼娇鐢ㄥ師濮嬪��
- const typeStr = this.queryParams.serviceType.join("/");
- serviceTypeName = typeStr;
- sheetTypeName = "鍐嶆闅忚";
+
+ const workbook = new ExcelJS.Workbook();
+ const worksheet = workbook.addWorksheet(worksheetName);
+
+ // 鏋勫缓琛ㄦ牸
+ this.buildExportSheet(worksheet, sheetNameSuffix, serviceTypeName);
+
+ const buffer = await workbook.xlsx.writeBuffer();
+ const blob = new Blob([buffer], {
+ type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
+ });
+ saveAs(blob, excelName);
+
+ this.$message.success("瀵煎嚭鎴愬姛");
+ return true;
+ } catch (error) {
+ console.error("瀵煎嚭澶辫触:", error);
+ this.$message.error(`瀵煎嚭澶辫触: ${error.message}`);
+ return false;
}
- }
-
- const excelName = `鍐嶆${serviceTypeName}缁熻琛╛${dateRangeString}.xlsx`;
-
- // 娓呯悊宸ヤ綔琛ㄥ悕绉帮紝绉婚櫎闈炴硶瀛楃
- const cleanSheetName = (name) => {
- // Excel宸ヤ綔琛ㄥ悕涓嶈兘鍖呭惈鐨勫瓧绗�: * ? : \ / [ ]
- return name.replace(/[*?:\\/[\]]/g, ' ');
- };
-
- const worksheetName = cleanSheetName(`鍐嶆${sheetTypeName}缁熻_${sheetNameSuffix}`);
-
- if (!this.tableData || this.tableData.length === 0) {
- this.$message.warning(`鏆傛棤鍐嶆${serviceTypeName}鏁版嵁鍙鍑篳);
- return false;
- }
-
- const workbook = new ExcelJS.Workbook();
- const worksheet = workbook.addWorksheet(worksheetName);
-
- // 鏋勫缓琛ㄦ牸
- this.buildExportSheet(worksheet, sheetNameSuffix);
-
- const buffer = await workbook.xlsx.writeBuffer();
- const blob = new Blob([buffer], {
- type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
- });
- saveAs(blob, excelName);
-
- this.$message.success("瀵煎嚭鎴愬姛");
- return true;
- } catch (error) {
- console.error("瀵煎嚭澶辫触:", error);
- this.$message.error(`瀵煎嚭澶辫触: ${error.message}`);
- return false;
- }
-},
+ },
/** 瀵煎嚭鍖荤敓瀛愯〃锛堝啀娆¢殢璁匡級 */
async exportDoctorTable(row) {
try {
@@ -1457,7 +1504,7 @@
return sums;
},
- buildExportSheet(worksheet, sheetNameSuffix) {
+ buildExportSheet(worksheet, sheetNameSuffix, serviceTypeName) {
const titleStyle = {
font: {
name: "寰蒋闆呴粦",
@@ -1532,10 +1579,11 @@
},
};
+ const titleText = `鍐嶆${serviceTypeName}缁熻琛╛${sheetNameSuffix}`;
// 娣诲姞鏍囬琛�
- worksheet.mergeCells(1, 1, 1, 15);
+ worksheet.mergeCells(1, 1, 1, 16);
const titleCell = worksheet.getCell(1, 1);
- titleCell.value = `鍐嶆鍑洪櫌闅忚缁熻琛╛${sheetNameSuffix}`;
+ titleCell.value = titleText; // 浣跨敤鍔ㄦ�佹爣棰�
titleCell.style = titleStyle;
worksheet.getRow(1).height = 35;
--
Gitblit v1.9.3