From 7c71fcb61dd0bfc6a179a973f9cab5ef979ad5f2 Mon Sep 17 00:00:00 2001
From: WXL (wul) <wl_5969728@163.com>
Date: 星期一, 02 二月 2026 17:11:56 +0800
Subject: [PATCH] 测试完成
---
src/views/sfstatistics/percentage/satisfaction.vue | 394 ++++++++++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 370 insertions(+), 24 deletions(-)
diff --git a/src/views/sfstatistics/percentage/satisfaction.vue b/src/views/sfstatistics/percentage/satisfaction.vue
index 99a6ba4..8a9b19e 100644
--- a/src/views/sfstatistics/percentage/satisfaction.vue
+++ b/src/views/sfstatistics/percentage/satisfaction.vue
@@ -61,7 +61,7 @@
</el-select>
</el-form-item>
- <el-form-item label="缁熻棰樼洰" prop="userName">
+ <el-form-item label="鏈嶅姟绫诲瀷" prop="userName">
<el-select
v-model="queryParams.serviceType"
multiple
@@ -223,15 +223,8 @@
prop="joyTotal"
>
<template slot-scope="scope">
- <el-button
- size="medium"
- type="text"
- @click="Seedetails(scope.row)"
- ><span class="button-zx"
- >{{
- (Number(scope.row.joyTotal) * 100).toFixed(2)
- }}%</span
- ></el-button
+ <span class="button-zx"
+ >{{ (Number(scope.row.joyTotal) * 100).toFixed(2) }}%</span
>
</template>
</el-table-column>
@@ -246,7 +239,7 @@
<el-button
size="medium"
type="text"
- @click="Seedetails(scope.row)"
+ @click="getinfo(scope.row)"
><span class="button-zx"
><i class="el-icon-s-order"></i>鏌ョ湅璇︽儏</span
></el-button
@@ -514,6 +507,47 @@
</div>
</div>
</el-dialog>
+ <!-- 鍗曠瀹ょ粺璁¤鎯� -->
+ <el-dialog :visible.sync="topicVisible" width="45%">
+ <div class="topicdia">
+ <div class="top-text">
+ {{ topicvalue.name }}<span>婊℃剰搴︽寚鏍囪鎯�</span>
+ </div>
+ <div style="overflow-x: hidden; overflow-y: auto; max-height: 65vh">
+ <div
+ class="ttaabbcc"
+ v-for="(item, index) in topiclist"
+ :key="item.name"
+ >
+ <div class="describe">
+ 绗瑊{ index }}棰橈細 {{ item.scriptContent }}?<span
+ >[{{ item.scriptType == 1 ? "鍗曢�夐" : "澶氶�夐" }}]</span
+ >
+ </div>
+ <div>
+ <el-table :data="item.details" style="width: 100%">
+ <el-table-column prop="optionText" label="闂閫夐」">
+ </el-table-column>
+ <el-table-column prop="chosenQuantity" label="閫夋嫨浜烘暟">
+ </el-table-column>
+ <el-table-column prop="chosenPercentage" label="姣斾緥">
+ <template slot-scope="scope">
+ <span class="button-zx"
+ >{{
+ (Number(scope.row.chosenPercentage) * 100).toFixed(2)
+ }}%</span
+ >
+ </template>
+ </el-table-column>
+ </el-table>
+ </div>
+ </div>
+ </div>
+ </div>
+ <span slot="footer" class="dialog-footer">
+ <el-button @click="topicVisible = false">鍏� 闂�</el-button>
+ </span>
+ </el-dialog>
</div>
</template>
@@ -526,11 +560,12 @@
} from "@/api/system/label";
import store from "@/store";
import {
- getSfStatisticsJoydetails,
getSfStatisticsJoy,
+ getSfStatisticsJoyInfo,
selectTimelyRate,
} from "@/api/system/user";
-
+import ExcelJS from "exceljs";
+import { saveAs } from "file-saver";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
const shortcuts = [
@@ -601,6 +636,40 @@
pn: 1,
ps: 10,
},
+ topiclist: [
+ {
+ name: "鎮ㄧ殑韬綋搴峰鎯呭喌濡備綍",
+ number: 1,
+ type: 1,
+ },
+ {
+ name: "鎮ㄧ殑楗鎯呭喌濡備綍",
+ number: 2,
+ type: 2,
+ },
+ {
+ name: "鎮ㄧ殑鎭㈠鎯呭喌濡備綍",
+ number: 3,
+ type: 1,
+ },
+ ],
+ tableData: [
+ {
+ date: "濂�",
+ name: 12,
+ address: "50%",
+ },
+ {
+ date: "涓�鑸�",
+ name: 2,
+ address: "6.2%",
+ },
+ {
+ date: "宸�",
+ name: 0,
+ address: "0%",
+ },
+ ],
amendtag: false, //鏄惁淇敼绫诲埆
lstamendtag: false, //鏄惁淇敼鏍囩
scavisible: false, //鍒犻櫎寮规
@@ -641,6 +710,11 @@
dialogFormVisible: false, //娣诲姞銆佷慨鏀圭被鍒脊妗�
lstamendtagVisible: false, //娣诲姞銆佷慨鏀规爣绛惧脊妗�
goQRCodeVisible: false, //浜岀淮鐮佸脊妗�
+ topicVisible: false, //鎺у埗鍗曢寮规
+ topicvalue: {
+ name: "楠ㄧ闅忚妯℃澘",
+ number: 222,
+ },
sidecolumnval: "", //绫诲埆鎼滅储
propss: { multiple: true },
SeedetailsVisible: false,
@@ -659,8 +733,6 @@
},
// 鏌ヨ鏍囩鍒楄〃鍙傛暟
queryParams: {
- pageNum: 1,
- pageSize: 10,
serviceType: [2],
dateRange: [],
statisticaltype: 1,
@@ -690,6 +762,7 @@
getList() {
// 澶勭悊鏌ヨ鍙傛暟
const params = {
+ configKey: "joyCount",
...this.queryParams,
// 濡傛灉閫夋嫨浜�"鍏ㄩ儴"锛屽垯浼犳墍鏈夌梾鍖�/绉戝浠g爜
leavehospitaldistrictcodes:
@@ -706,7 +779,7 @@
delete params.deptcodes.all;
getSfStatisticsJoy(params).then((response) => {
console.log(response);
- // this.total = response.total;
+ this.total = response.total;
this.userList = response.data;
});
},
@@ -821,6 +894,32 @@
},
});
}, 300);
+ },
+ // 璋冭捣璇︽儏
+ getinfo(row) {
+ this.topicVisible = true;
+ // 澶勭悊鏌ヨ鍙傛暟
+ const params = {
+ configKey: "joyCount",
+ ...this.queryParams,
+ };
+ if (this.queryParams.statisticaltype == 1) {
+ this.topicvalue.name = row.leavehospitaldistrictname;
+
+ params.leavehospitaldistrictcodes = [row.leavehospitaldistrictcode];
+ } else {
+ this.topicvalue.name = row.deptname;
+
+ params.deptcodes = [row.deptcode];
+ }
+
+ // 绉婚櫎鍙兘瀛樺湪鐨�"all"鍊�
+ delete params.leavehospitaldistrictcodes.all;
+ delete params.deptcodes.all;
+ getSfStatisticsJoyInfo(params).then((response) => {
+ console.log(response);
+ this.topiclist = response.data;
+ });
},
// 娣诲姞/淇敼鏍囩
Maintenancetag() {
@@ -940,14 +1039,191 @@
.catch(() => {});
},
/** 瀵煎嚭鎸夐挳鎿嶄綔 */
- handleExport() {
- this.download(
- "smartor/serviceSubtask/getSfStatisticsExport",
- {
- ...this.queryParams,
- },
- `user_${new Date().getTime()}.xlsx`
- );
+ /** 瀵煎嚭鎸夐挳鎿嶄綔 */
+ async handleExport() {
+ try {
+ // 鑾峰彇骞舵牸寮忓寲鏃ユ湡鑼冨洿
+ let dateRangeString = "";
+ let sheetNameSuffix = "";
+
+ // 妫�鏌ユ槸鍚﹀瓨鍦ㄩ�変腑鐨勬棩鏈熻寖鍥�
+ if (
+ this.queryParams.dateRange &&
+ this.queryParams.dateRange.length === 2
+ ) {
+ const startDateStr = this.queryParams.dateRange[0]; // 寮�濮嬫棩鏈燂紝鏍煎紡 "yyyy-MM-dd"
+ const endDateStr = this.queryParams.dateRange[1]; // 缁撴潫鏃ユ湡
+
+ // 鐩存帴浣跨敤鏃ユ湡閮ㄥ垎锛堝凡缁忔槸 yyyy-MM-dd 鏍煎紡锛�
+ const startDateFormatted = startDateStr;
+ const endDateFormatted = endDateStr;
+
+ // 鏋勫缓鏃ユ湡鑼冨洿瀛楃涓�
+ dateRangeString = `${startDateFormatted}鑷�${endDateFormatted}`;
+ sheetNameSuffix = `${startDateFormatted}鑷�${endDateFormatted}`;
+ } else {
+ // 濡傛灉娌℃湁閫夋嫨鏃ユ湡鑼冨洿锛屽垯浣跨敤褰撳墠鏈堜唤浣滀负澶囬�夋柟妗�
+ const now = new Date();
+ const currentMonth = now.getMonth() + 1;
+ dateRangeString = `${currentMonth}鏈坄;
+ sheetNameSuffix = `${currentMonth}鏈坄;
+ }
+
+ // 鏋勫缓鏂囦欢鍚嶅拰宸ヤ綔琛ㄥ悕
+ const excelName = `婊℃剰搴︾粺璁¤〃_${dateRangeString}.xlsx`;
+ const worksheetName = `婊℃剰搴︾粺璁${sheetNameSuffix}`;
+
+ // 鍒涘缓宸ヤ綔绨垮拰宸ヤ綔琛�
+ const workbook = new ExcelJS.Workbook();
+ const worksheet = workbook.addWorksheet(worksheetName);
+
+ // 瀹氫箟鏍峰紡
+ const titleStyle = {
+ font: {
+ name: "寰蒋闆呴粦",
+ size: 16,
+ bold: true,
+ color: { argb: "FF000000" },
+ },
+ fill: {
+ type: "pattern",
+ pattern: "solid",
+ fgColor: { argb: "FFE6F3FF" },
+ },
+ alignment: {
+ vertical: "middle",
+ horizontal: "center",
+ wrapText: true,
+ },
+ border: {
+ top: { style: "thin", color: { argb: "FFD0D0D0" } },
+ left: { style: "thin", color: { argb: "FFD0D0D0" } },
+ bottom: { style: "thin", color: { argb: "FFD0D0D0" } },
+ right: { style: "thin", color: { argb: "FFD0D0D0" } },
+ },
+ };
+
+ const headerStyle = {
+ font: {
+ name: "寰蒋闆呴粦",
+ size: 11,
+ bold: true,
+ color: { argb: "FF000000" },
+ },
+ fill: {
+ type: "pattern",
+ pattern: "solid",
+ fgColor: { argb: "FFF5F7FA" },
+ },
+ alignment: {
+ vertical: "middle",
+ horizontal: "center",
+ wrapText: true,
+ },
+ border: {
+ top: { style: "thin", color: { argb: "FFD0D0D0" } },
+ left: { style: "thin", color: { argb: "FFD0D0D0" } },
+ bottom: { style: "thin", color: { argb: "FFD0D0D0" } },
+ right: { style: "thin", color: { argb: "FFD0D0D0" } },
+ },
+ };
+
+ const cellStyle = {
+ font: {
+ name: "瀹嬩綋",
+ size: 10,
+ color: { argb: "FF000000" },
+ },
+ alignment: {
+ vertical: "middle",
+ horizontal: "center",
+ },
+ border: {
+ top: { style: "thin", color: { argb: "FFD0D0D0" } },
+ left: { style: "thin", color: { argb: "FFD0D0D0" } },
+ bottom: { style: "thin", color: { argb: "FFD0D0D0" } },
+ right: { style: "thin", color: { argb: "FFD0D0D0" } },
+ },
+ };
+
+ // 娣诲姞鎬绘爣棰�
+ worksheet.mergeCells(1, 1, 1, 10);
+ const titleCell = worksheet.getCell(1, 1);
+ titleCell.value = `婊℃剰搴︾粺璁¤〃锛�${sheetNameSuffix}锛塦;
+ titleCell.style = titleStyle;
+ worksheet.getRow(1).height = 35;
+
+ // 娣诲姞琛ㄥご
+ const headers = [
+ "鍑洪櫌鐥呭尯",
+ "绉戝",
+ "鍑洪櫌浜烘",
+ "鏃犻渶闅忚浜烘",
+ "搴旈殢璁夸汉娆�",
+ "闅忚鐜�",
+ "鍙婃椂鐜�",
+ "婊℃剰搴﹂鐩�婚噺",
+ "婊℃剰搴﹀~鎶ラ噺",
+ "瀹屾垚姣旂巼",
+ ];
+
+ const headerRow = worksheet.addRow(headers);
+ headerRow.eachCell((cell) => {
+ cell.style = headerStyle;
+ });
+ headerRow.height = 25;
+
+ // 娣诲姞鏁版嵁琛�
+ this.userList.forEach((item) => {
+ const dataRow = worksheet.addRow([
+ item.leavehospitaldistrictname || "",
+ item.deptname || "",
+ item.dischargeCount || 0,
+ item.nonFollowUp || 0,
+ item.followUpNeeded || 0,
+ item.followUpRate || "0%",
+ item.rate ? (Number(item.rate) * 100).toFixed(2) + "%" : "0%",
+ item.joyAllCount || 0,
+ item.joyCount || 0,
+ item.joyTotal
+ ? (Number(item.joyTotal) * 100).toFixed(2) + "%"
+ : "0%",
+ ]);
+
+ dataRow.eachCell((cell) => {
+ cell.style = cellStyle;
+ });
+ dataRow.height = 22;
+ });
+
+ // 璁剧疆鍒楀
+ worksheet.columns = [
+ { width: 20 }, // 鍑洪櫌鐥呭尯
+ { width: 15 }, // 绉戝
+ { width: 12 }, // 鍑洪櫌浜烘
+ { width: 12 }, // 鏃犻渶闅忚浜烘
+ { width: 12 }, // 搴旈殢璁夸汉娆�
+ { width: 12 }, // 闅忚鐜�
+ { width: 12 }, // 鍙婃椂鐜�
+ { width: 15 }, // 婊℃剰搴﹂鐩�婚噺
+ { width: 15 }, // 婊℃剰搴﹀~鎶ラ噺
+ { width: 12 }, // 瀹屾垚姣旂巼
+ ];
+
+ // 鐢熸垚骞朵笅杞芥枃浠�
+ const buffer = await workbook.xlsx.writeBuffer();
+ const blob = new Blob([buffer], {
+ type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
+ });
+
+ // 浣跨敤FileSaver.js淇濆瓨鏂囦欢[2,3](@ref)
+ saveAs(blob, excelName);
+
+ this.$message.success("瀵煎嚭鎴愬姛");
+ } catch (error) {
+ console.error("瀵煎嚭澶辫触:", error);
+ this.$message.error(`瀵煎嚭澶辫触: ${error.message}`);
+ }
},
// 鏄剧ず鍥捐〃寮圭獥
@@ -1362,6 +1638,76 @@
height: 400px;
}
}
+.topicdia {
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
+ "Helvetica Neue", Arial, sans-serif;
+ color: #333; /* 涓绘枃瀛楄壊 */
+}
+
+/* 澶撮儴鏍囬鏍峰紡 */
+.top-text {
+ font-size: 18px;
+ font-weight: 600;
+ padding-bottom: 16px;
+ margin-bottom: 20px;
+ border-bottom: 1px solid #e8e8e8; /* 绾ょ粏鐨勫垎闅旂嚎 */
+ color: #1f2d3d; /* 娣辫壊鏍囬 */
+}
+.top-text span {
+ font-size: 14px;
+ font-weight: normal;
+ color: #666; /* 鍓爣棰橀鑹茬◢娴� */
+ margin-left: 10px;
+}
+
+/* 棰樼洰瀹瑰櫒鏍峰紡 */
+.ttaabbcc {
+ background: #fafafa; /* 闈炲父娴呯殑鐏拌壊鑳屾櫙 */
+ border-radius: 6px;
+ padding: 16px;
+ margin-bottom: 20px;
+ border-left: 4px solid #4794c5; /* 宸︿晶瑁呴グ鑹叉潯锛屽鍔犲眰娆℃劅 */
+}
+
+/* 棰樼洰鎻忚堪鏍峰紡 */
+.describe {
+ font-size: 15px;
+ line-height: 1.6;
+ margin-bottom: 12px;
+ color: #1f2d3d;
+}
+.describe span {
+ font-size: 13px;
+ color: #999; /* 棰樺瀷鎻愮ず淇℃伅棰滆壊鏇存祬 */
+ font-style: italic;
+ margin-left: 8px;
+}
+
+/* 琛ㄦ牸鏁翠綋鏍峰紡璋冩暣 */
+.ttaabbcc .el-table {
+ border-radius: 4px;
+ overflow: hidden;
+ font-size: 14px;
+}
+
+/* 琛ㄥご鏍峰紡 */
+.ttaabbcc .el-table th {
+ background-color: #f1f5f9; /* 娴呰摑鑹茶〃澶磋儗鏅� */
+ color: #333;
+ font-weight: 600;
+}
+
+/* 鍗曞厓鏍兼牱寮� */
+.ttaabbcc .el-table td {
+ border-bottom: 1px solid #f0f0f0; /* 绾ょ粏鐨勮鍒嗛殧绾� */
+ padding: 12px 0;
+}
+
+/* 姣斾緥鏁版嵁鏍峰紡 */
+.button-zx {
+ color: #4794c5; /* 浣跨敤涓庝富棰樺懠搴旂殑钃濊壊 */
+ font-weight: 500;
+}
::v-deep.el-tabs--left,
.el-tabs--right {
overflow: hidden;
--
Gitblit v1.9.3