From 17efc8b0fb7d3fa66eb8e22f32b81e3e14bcd7f6 Mon Sep 17 00:00:00 2001
From: WXL (wul) <wl_5969728@163.com>
Date: 星期二, 06 一月 2026 17:37:57 +0800
Subject: [PATCH] 测试完成
---
src/views/sfstatistics/percentage/index.vue | 588 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 572 insertions(+), 16 deletions(-)
diff --git a/src/views/sfstatistics/percentage/index.vue b/src/views/sfstatistics/percentage/index.vue
index fe833bd..34a7bdb 100644
--- a/src/views/sfstatistics/percentage/index.vue
+++ b/src/views/sfstatistics/percentage/index.vue
@@ -83,12 +83,14 @@
>
<el-date-picker
v-model="queryParams.dateRange"
- value-format="yyyy-MM-dd"
+ value-format="yyyy-MM-dd HH:mm:ss"
type="daterange"
range-separator="鑷�"
start-placeholder="寮�濮嬫棩鏈�"
end-placeholder="缁撴潫鏃ユ湡"
+ :default-time="['00:00:00', '23:59:59']"
>
+ >
</el-date-picker>
</el-form-item>
@@ -113,7 +115,7 @@
plain
icon="el-icon-download"
size="medium"
- @click="handleExport"
+ @click="exportTable"
>瀵煎嚭</el-button
>
<el-button
@@ -128,6 +130,8 @@
</el-form>
<div class="your-table-container">
<el-table
+ ref="exportTable"
+ id="exportTableid"
v-loading="loading"
:data="userList"
:border="true"
@@ -398,6 +402,21 @@
key="pendingFollowUp"
prop="pendingFollowUp"
>
+ <template slot-scope="scope">
+ <el-button
+ size="medium"
+ type="text"
+ @click="
+ viewDetails(
+ scope.row.pendingFollowUpInfo,
+ scope.row.leavehospitaldistrictname + '寰呴殢璁垮垪琛�'
+ )
+ "
+ ><span class="button-zx">{{
+ scope.row.pendingFollowUp
+ }}</span></el-button
+ >
+ </template>
</el-table-column>
<el-table-column
label="闅忚鎴愬姛"
@@ -412,6 +431,21 @@
key="followUpFail"
prop="followUpFail"
>
+ <template slot-scope="scope">
+ <el-button
+ size="medium"
+ type="text"
+ @click="
+ viewDetails(
+ scope.row.followUpFailInfo,
+ scope.row.leavehospitaldistrictname + '闅忚澶辫触鍒楄〃'
+ )
+ "
+ ><span class="button-zx">{{
+ scope.row.followUpFail
+ }}</span></el-button
+ >
+ </template>
</el-table-column>
<el-table-column
label="闅忚鐜�"
@@ -852,6 +886,198 @@
</div>
</div>
</el-dialog>
+ <!-- 鍚勭被璇︽儏 -->
+ <el-dialog
+ :title="infotitle"
+ :visible.sync="infotitleVisible"
+ v-loading="infotitloading"
+ width="70%"
+ :close-on-click-modal="false"
+ >
+ <div class="examine-jic">
+ <div class="jic-value">
+ <el-row :gutter="20">
+ <!-- 閫夋嫨鎮h�呭垪琛� -->
+ <el-table :data="infotitlelist" height="660" style="width: 100%">
+ <el-table-column
+ prop="sendname"
+ align="center"
+ label="濮撳悕"
+ width="100"
+ >
+ </el-table-column>
+ <el-table-column
+ prop="taskName"
+ align="center"
+ width="200"
+ show-overflow-tooltip
+ label="浠诲姟鍚嶇О"
+ >
+ </el-table-column>
+ <el-table-column
+ prop="sendstate"
+ align="center"
+ width="200"
+ label="浠诲姟鐘舵��"
+ >
+ <template slot-scope="scope">
+ <div v-if="scope.row.sendstate == 1">
+ <el-tag type="primary" :disable-transitions="false"
+ >琛ㄥ崟宸查鍙�</el-tag
+ >
+ </div>
+ <div v-if="scope.row.sendstate == 2">
+ <el-tag type="primary" :disable-transitions="false"
+ >寰呴殢璁�</el-tag
+ >
+ </div>
+ <div v-if="scope.row.sendstate == 3">
+ <el-tag type="success" :disable-transitions="false"
+ >琛ㄥ崟宸插彂閫�</el-tag
+ >
+ </div>
+ <div v-if="scope.row.sendstate == 4">
+ <el-tag type="info" :disable-transitions="false"
+ >涓嶆墽琛�</el-tag
+ >
+ </div>
+ <div v-if="scope.row.sendstate == 5">
+ <el-tag type="danger" :disable-transitions="false"
+ >鍙戦�佸け璐�</el-tag
+ >
+ </div>
+ <div v-if="scope.row.sendstate == 6">
+ <el-tag type="success" :disable-transitions="false"
+ >宸插畬鎴�</el-tag
+ >
+ </div>
+ </template>
+ </el-table-column>
+ <el-table-column
+ prop="visitTime"
+ align="center"
+ label="搴旈殢璁挎椂闂�"
+ width="200"
+ show-overflow-tooltip
+ >
+ </el-table-column>
+ <el-table-column
+ prop="finishtime"
+ align="center"
+ label="闅忚瀹屾垚鏃堕棿"
+ width="200"
+ show-overflow-tooltip
+ >
+ </el-table-column>
+ <el-table-column
+ label="鍑洪櫌鏃ユ湡"
+ width="200"
+ align="center"
+ key="endtime"
+ prop="endtime"
+ >
+ <template slot-scope="scope">
+ <span>{{ formatTime(scope.row.endtime) }}</span>
+ </template></el-table-column
+ >
+ <el-table-column
+ label="璐d换鎶ゅ+"
+ width="120"
+ align="center"
+ key="nurseName"
+ prop="nurseName"
+ />
+ <el-table-column
+ label="涓绘不鍖荤敓"
+ width="120"
+ align="center"
+ key="drname"
+ prop="drname"
+ />
+
+ <el-table-column
+ label="缁撴灉鐘舵��"
+ align="center"
+ key="excep"
+ prop="excep"
+ width="120"
+ >
+ <template slot-scope="scope">
+ <dict-tag
+ :options="dict.type.sys_yujing"
+ :value="scope.row.excep"
+ />
+ </template>
+ </el-table-column>
+ <el-table-column
+ label="澶勭悊鎰忚"
+ align="center"
+ key="suggest"
+ prop="suggest"
+ width="120"
+ >
+ <template slot-scope="scope">
+ <dict-tag
+ :options="dict.type.sys_suggest"
+ :value="scope.row.suggest"
+ />
+ </template>
+ </el-table-column>
+
+ <el-table-column
+ prop="templatename"
+ align="center"
+ label="鏈嶅姟妯℃澘"
+ width="200"
+ show-overflow-tooltip
+ >
+ </el-table-column>
+ <el-table-column
+ prop="remark"
+ align="center"
+ label="鏈嶅姟璁板綍"
+ width="200"
+ show-overflow-tooltip
+ >
+ </el-table-column>
+
+ <el-table-column
+ prop="bankcardno"
+ align="center"
+ label="鍛煎彨鐘舵��"
+ width="210"
+ >
+ </el-table-column>
+ <el-table-column
+ label="鎿嶄綔"
+ fixed="right"
+ align="center"
+ width="200"
+ class-name="small-padding fixed-width"
+ >
+ <template slot-scope="scope">
+ <el-button
+ size="medium"
+ type="text"
+ @click="SeedetailsgGo(scope.row)"
+ ><span class="button-zx"
+ ><i class="el-icon-s-order"></i>鏌ョ湅</span
+ ></el-button
+ >
+ </template>
+ </el-table-column>
+ </el-table>
+ </el-row>
+ <pagination
+ v-show="patienttotal > 0 && this.patientqueryParams.allhosp != 6"
+ :total="patienttotal"
+ :page.sync="patientqueryParams.pn"
+ :limit.sync="patientqueryParams.ps"
+ @pagination="Seedetails"
+ />
+ </div>
+ </div>
+ </el-dialog>
</div>
</template>
@@ -864,7 +1090,10 @@
} from "@/api/system/label";
import store from "@/store";
import { getSfStatistics, selectTimelyRate } from "@/api/system/user";
-
+import * as XLSX from "xlsx";
+import FileSaver from "file-saver";
+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 = [
@@ -901,10 +1130,14 @@
activeName: "first", //渚ц竟閫夋嫨
orgname: "",
expands: [],
+ infotitlelist: [],
// 閬僵灞�
loading: false,
Seedloading: false,
chartDialogVisible: false,
+ infotitleVisible: false,
+ infotitloading: false,
+ infotitle: "",
pieChart: null,
barLineChart: null,
// 閫変腑鏁扮粍
@@ -1089,7 +1322,7 @@
sums[index] = "鍚堣";
return;
}
- if (index === 1||index === 2) {
+ if (index === 1 || index === 2) {
sums[index] = "/";
return;
}
@@ -1324,6 +1557,11 @@
this.Seedloading = false;
});
},
+ viewDetails(row, title) {
+ this.infotitleVisible = true;
+ this.infotitle = title;
+ this.infotitlelist = row;
+ },
SeedetailsgGo(row) {
this.SeedetailsVisible = false;
let type = "";
@@ -1460,16 +1698,322 @@
})
.catch(() => {});
},
- /** 瀵煎嚭鎸夐挳鎿嶄綔 */
- handleExport() {
- this.download(
- "smartor/serviceSubtask/getSfStatisticsExport",
- {
- ...this.queryParams,
- },
- `user_${new Date().getTime()}.xlsx`
- );
+ // 瀵煎嚭鏂规硶
+ // 鏇挎崲鎮ㄥ師鏉ョ殑 exportTable 鏂规硶
+ async exportTable() {
+ try {
+ // 鑾峰彇褰撳墠鏃ユ湡
+ const now = new Date();
+ // 鑾峰彇褰撳墠鏈堜唤锛堟敞鎰忔湀浠戒粠0寮�濮嬶紝闇�瑕佸姞1锛�
+ const currentMonth = now.getMonth() + 1;
+ // 鏋勫缓鏂囦欢鍚�
+ const excelName = `${currentMonth}鏈堝嚭闄㈤殢璁跨粺璁¤〃.xlsx`;
+ // 鍒涘缓鏂扮殑宸ヤ綔绨垮拰宸ヤ綔琛�
+ const workbook = new ExcelJS.Workbook();
+ const worksheet = workbook.addWorksheet(`${currentMonth}鏈堝嚭闄㈤殢璁跨粺璁¤〃`);
+// 瀹氫箟鏍峰紡锛堟柊澧炴�绘爣棰樻牱寮忥級
+ 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" } },
+ },
+ };
+
+ const summaryStyle = {
+ font: {
+ name: "瀹嬩綋",
+ size: 10,
+ bold: true,
+ color: { argb: "FF409EFF" },
+ },
+ fill: {
+ type: "pattern",
+ pattern: "solid",
+ fgColor: { argb: "FFF5F7FA" },
+ },
+ 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" } },
+ },
+ };
+// 1. 娣诲姞鎬绘爣棰樿锛堢涓�琛岋級
+ worksheet.mergeCells(1, 1, 1, 23); // 鍚堝苟A1鍒癢1鐨勬墍鏈夊垪[1,4](@ref)
+ const titleCell = worksheet.getCell(1, 1);
+ titleCell.value = `${currentMonth}鏈堝嚭闄㈤殢璁跨粺璁¤〃`; // 浣跨敤鏂囦欢鍚嶄綔涓烘�绘爣棰�
+ titleCell.style = titleStyle;
+ worksheet.getRow(1).height = 35; // 璁剧疆鎬绘爣棰樿楂�
+ // 1. 棣栧厛锛屽垱寤哄苟璁剧疆绗簩琛岋紙瀛愯〃澶达級鐨勬墍鏈夊崟鍏冩牸
+ const secondRowHeaders = [
+ "", // A2 灞曞紑鍒楀崰浣嶏紙鍏跺�煎皢鐢辩涓�琛屽悎骞跺悗鐨勪富鍗曞厓鏍煎喅瀹氾級
+ "鍑洪櫌鐥呭尯",
+ "绉戝",
+ "鍑洪櫌浜烘",
+ "鏃犻渶闅忚浜烘",
+ "搴旈殢璁夸汉娆�", // B2 to F2
+ // 棣栨鍑洪櫌闅忚瀛愯〃澶�
+ "闇�闅忚",
+ "寰呴殢璁�",
+ "闅忚鎴愬姛",
+ "闅忚澶辫触",
+ "闅忚鐜�",
+ "鍙婃椂鐜�",
+ "浜哄伐",
+ "鐭俊",
+ "寰俊",
+ // 鍐嶆鍑洪櫌闅忚瀛愯〃澶�
+ "闇�闅忚",
+ "寰呴殢璁�",
+ "闅忚鎴愬姛",
+ "闅忚澶辫触",
+ "闅忚鐜�",
+ "浜哄伐",
+ "鐭俊",
+ "寰俊",
+ ];
+
+ // 娣诲姞绗簩琛岋紙鍘熺涓�琛屼笅绉伙級
+ secondRowHeaders.forEach((header, index) => {
+ const cell = worksheet.getCell(3, index + 1); // 鏀逛负绗�3琛�
+ cell.value = header;
+ cell.style = headerStyle;
+ });
+
+ // 3. 璋冩暣鍘熷悎骞跺崟鍏冩牸浣嶇疆锛堝師绗�1琛屽悎骞跺崟鍏冩牸涓嬬Щ鍒扮2琛岋級
+ // 鍚堝苟 A2:A3
+ worksheet.mergeCells(2, 1, 3, 1);
+ worksheet.getCell(2, 1).value = "";
+ worksheet.getCell(2, 1).style = headerStyle;
+
+ // 鍚堝苟 B2:B3
+ worksheet.mergeCells(2, 2, 3, 2);
+ worksheet.getCell(2, 2).value = "鍑洪櫌鐥呭尯";
+ worksheet.getCell(2, 2).style = headerStyle;
+
+ // 鍚堝苟 C2:C3
+ worksheet.mergeCells(2, 3, 3, 3);
+ worksheet.getCell(2, 3).value = "绉戝";
+ worksheet.getCell(2, 3).style = headerStyle;
+
+ // 鍚堝苟 D2:D3
+ worksheet.mergeCells(2, 4, 3, 4);
+ worksheet.getCell(2, 4).value = "鍑洪櫌浜烘";
+ worksheet.getCell(2, 4).style = headerStyle;
+
+ // 鍚堝苟 E2:E3
+ worksheet.mergeCells(2, 5, 3, 5);
+ worksheet.getCell(2, 5).value = "鏃犻渶闅忚浜烘";
+ worksheet.getCell(2, 5).style = headerStyle;
+
+ // 鍚堝苟 F2:F3
+ worksheet.mergeCells(2, 6, 3, 6);
+ worksheet.getCell(2, 6).value = "搴旈殢璁夸汉娆�";
+ worksheet.getCell(2, 6).style = headerStyle;
+
+ // 4. 璋冩暣妯悜鍚堝苟鏍囬浣嶇疆锛堜笅绉诲埌绗�2琛岋級
+ // 棣栨鍑洪櫌闅忚锛堝悎骞禛2:O2锛�
+ worksheet.mergeCells(2, 7, 2, 15); // G2:O2
+ worksheet.getCell(2, 7).value = "棣栨鍑洪櫌闅忚";
+ worksheet.getCell(2, 7).style = headerStyle;
+
+ // 鍐嶆鍑洪櫌闅忚锛堝悎骞禤2:W2锛�
+ worksheet.mergeCells(2, 16, 2, 23); // P2:W2
+ worksheet.getCell(2, 16).value = "鍐嶆鍑洪櫌闅忚";
+ worksheet.getCell(2, 16).style = headerStyle;
+
+ // 5. 璁剧疆琛岄珮
+ worksheet.getRow(1).height = 35; // 鎬绘爣棰樿楂�
+ worksheet.getRow(2).height = 28; // 鍘熺涓�琛屼笅绉�
+ worksheet.getRow(3).height = 25; // 鍘熺浜岃涓嬬Щ
+
+ // 6. 娣诲姞鏁版嵁琛岋紙娉ㄦ剰琛岀储寮曢渶瑕�+1锛屽洜涓轰笂闈㈡彃鍏ヤ簡涓�琛岋級
+ this.userList.forEach((item, rowIndex) => {
+ const dataRow = worksheet.addRow([
+ "", // 灞曞紑鍒�
+ item.leavehospitaldistrictname || "",
+ item.deptname || "",
+ item.dischargeCount || 0,
+ item.nonFollowUp || 0,
+ item.followUpNeeded || 0,
+ // 棣栨鍑洪櫌闅忚鏁版嵁
+ item.needFollowUp || 0,
+ item.pendingFollowUp || 0,
+ item.followUpSuccess || 0,
+ item.followUpFail || 0,
+ item.followUpRate || "0%",
+ item.rate ? (Number(item.rate) * 100).toFixed(2) + "%" : "0%",
+ item.manual || 0,
+ item.sms || 0,
+ item.weChat || 0,
+ // 鍐嶆鍑洪櫌闅忚鏁版嵁
+ item.needFollowUpAgain || 0,
+ item.pendingFollowUpAgain || 0,
+ item.followUpSuccessAgain || 0,
+ item.followUpFailAgain || 0,
+ item.followUpRateAgain || "0%",
+ item.manualAgain || 0,
+ item.smsAgain || 0,
+ item.weChatAgain || 0,
+ ], rowIndex + 4); // 浠庣4琛屽紑濮嬫坊鍔犳暟鎹紙鍘熺3琛岋級
+
+ // 搴旂敤鏁版嵁琛屾牱寮�
+ dataRow.eachCell((cell) => {
+ cell.style = cellStyle;
+ });
+ dataRow.height = 24;
+ });
+
+ // 娣诲姞鍚堣琛�
+ const summaries = this.getSummaries({
+ columns: [
+ { property: "" },
+ { property: "leavehospitaldistrictname" },
+ { property: "deptname" },
+ { property: "dischargeCount" },
+ { property: "nonFollowUp" },
+ { property: "followUpNeeded" },
+ { property: "needFollowUp" },
+ { property: "pendingFollowUp" },
+ { property: "followUpSuccess" },
+ { property: "followUpFail" },
+ { property: "followUpRate" },
+ { property: "rate" },
+ { property: "manual" },
+ { property: "sms" },
+ { property: "weChat" },
+ { property: "needFollowUpAgain" },
+ { property: "pendingFollowUpAgain" },
+ { property: "followUpSuccessAgain" },
+ { property: "followUpFailAgain" },
+ { property: "followUpRateAgain" },
+ { property: "manualAgain" },
+ { property: "smsAgain" },
+ { property: "weChatAgain" },
+ ],
+ data: this.userList,
+ });
+
+ const summaryRow = worksheet.addRow(summaries);
+ summaryRow.eachCell((cell, colNumber) => {
+ cell.style = summaryStyle;
+ // 绗竴鍒楁樉绀�"鍚堣"
+ if (colNumber === 1) {
+ cell.value = "鍚堣";
+ }
+ });
+ summaryRow.height = 28;
+
+ // 璁剧疆鍒楀
+ worksheet.columns = [
+ { width: 8 }, // 灞曞紑鍒�
+ { width: 20 }, // 鍑洪櫌鐥呭尯
+ { width: 15 }, // 绉戝
+ { width: 12 }, // 鍑洪櫌浜烘
+ { width: 12 }, // 鏃犻渶闅忚浜烘
+ { width: 12 }, // 搴旈殢璁夸汉娆�
+ // 棣栨鍑洪櫌闅忚鍒�
+ { width: 10 },
+ { width: 10 },
+ { width: 10 },
+ { width: 10 },
+ { width: 12 },
+ { width: 12 },
+ { width: 8 },
+ { width: 8 },
+ { width: 8 },
+ // 鍐嶆鍑洪櫌闅忚鍒�
+ { width: 10 },
+ { width: 10 },
+ { width: 10 },
+ { width: 10 },
+ { width: 12 },
+ { width: 8 },
+ { width: 8 },
+ { width: 8 },
+ ];
+
+ // 鐢熸垚骞朵笅杞芥枃浠�
+ 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;
+ }
},
+
// 鏄剧ず鍥捐〃寮圭獥
showChartDialog() {
@@ -1931,9 +2475,21 @@
}
// 鐧惧垎姣斿瓧娈电壒娈婃牱寮�
-.your-table-container ::v-deep .el-table__footer .el-table__cell[data-field="followUpRate"] .cell,
-.your-table-container ::v-deep .el-table__footer .el-table__cell[data-field="rate"] .cell,
-.your-table-container ::v-deep .el-table__footer .el-table__cell[data-field="followUpRateAgain"] .cell {
+.your-table-container
+ ::v-deep
+ .el-table__footer
+ .el-table__cell[data-field="followUpRate"]
+ .cell,
+.your-table-container
+ ::v-deep
+ .el-table__footer
+ .el-table__cell[data-field="rate"]
+ .cell,
+.your-table-container
+ ::v-deep
+ .el-table__footer
+ .el-table__cell[data-field="followUpRateAgain"]
+ .cell {
color: #e6a23c !important;
font-weight: 700 !important;
}
--
Gitblit v1.9.3