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/index.vue | 956 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 937 insertions(+), 19 deletions(-)
diff --git a/src/views/sfstatistics/percentage/index.vue b/src/views/sfstatistics/percentage/index.vue
index fe833bd..745f8f0 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"
@@ -391,6 +395,21 @@
key="needFollowUp"
prop="needFollowUp"
>
+ <template slot-scope="scope">
+ <el-button
+ size="medium"
+ type="text"
+ @click="
+ viewDetails(
+ scope.row.needFollowUpInfo,
+ scope.row.leavehospitaldistrictname + '闇�闅忚鍒楄〃'
+ )
+ "
+ ><span class="button-zx">{{
+ scope.row.needFollowUp
+ }}</span></el-button
+ >
+ </template>
</el-table-column>
<el-table-column
label="寰呴殢璁�"
@@ -398,6 +417,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="闅忚鎴愬姛"
@@ -405,6 +439,21 @@
key="followUpSuccess"
prop="followUpSuccess"
>
+ <template slot-scope="scope">
+ <el-button
+ size="medium"
+ type="text"
+ @click="
+ viewDetails(
+ scope.row.followUpSuccessInfo,
+ scope.row.leavehospitaldistrictname + '闅忚鎴愬姛鍒楄〃'
+ )
+ "
+ ><span class="button-zx">{{
+ scope.row.followUpSuccess
+ }}</span></el-button
+ >
+ </template>
</el-table-column>
<el-table-column
label="闅忚澶辫触"
@@ -412,6 +461,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="闅忚鐜�"
@@ -454,6 +518,21 @@
key="manual"
prop="manual"
>
+ <template slot-scope="scope">
+ <el-button
+ size="medium"
+ type="text"
+ @click="
+ viewDetails(
+ scope.row.manualInfo,
+ scope.row.leavehospitaldistrictname + '浜哄伐闅忚鍒楄〃'
+ )
+ "
+ ><span class="button-zx">{{
+ scope.row.manual
+ }}</span></el-button
+ >
+ </template>
</el-table-column>
<el-table-column
label="鐭俊"
@@ -461,6 +540,21 @@
key="sms"
prop="sms"
>
+ <template slot-scope="scope">
+ <el-button
+ size="medium"
+ type="text"
+ @click="
+ viewDetails(
+ scope.row.smsInfo,
+ scope.row.leavehospitaldistrictname + '鐭俊闅忚鍒楄〃'
+ )
+ "
+ ><span class="button-zx">{{
+ scope.row.sms
+ }}</span></el-button
+ >
+ </template>
</el-table-column>
<el-table-column
label="寰俊"
@@ -468,6 +562,21 @@
key="weChat"
prop="weChat"
>
+ <template slot-scope="scope">
+ <el-button
+ size="medium"
+ type="text"
+ @click="
+ viewDetails(
+ scope.row.weChatInfo,
+ scope.row.leavehospitaldistrictname + '寰俊闅忚鍒楄〃'
+ )
+ "
+ ><span class="button-zx">{{
+ scope.row.weChat
+ }}</span></el-button
+ >
+ </template>
</el-table-column>
</el-table-column>
<el-table-column align="center" label="鍐嶆鍑洪櫌闅忚">
@@ -477,6 +586,22 @@
key="needFollowUpAgain"
prop="needFollowUpAgain"
>
+ <template slot-scope="scope">
+ <el-button
+ size="medium"
+ type="text"
+ @click="
+ viewDetails(
+ scope.row.needFollowUpAgainInfo,
+ scope.row.leavehospitaldistrictname +
+ '鍐嶆闅忚闇�闅忚鍒楄〃'
+ )
+ "
+ ><span class="button-zx">{{
+ scope.row.needFollowUpAgain
+ }}</span></el-button
+ >
+ </template>
</el-table-column>
<el-table-column
label="寰呴殢璁�"
@@ -484,6 +609,22 @@
key="pendingFollowUpAgain"
prop="pendingFollowUpAgain"
>
+ <template slot-scope="scope">
+ <el-button
+ size="medium"
+ type="text"
+ @click="
+ viewDetails(
+ scope.row.pendingFollowUpAgainInfo,
+ scope.row.leavehospitaldistrictname +
+ '鍐嶆闅忚寰呴殢璁垮垪琛�'
+ )
+ "
+ ><span class="button-zx">{{
+ scope.row.pendingFollowUpAgain
+ }}</span></el-button
+ >
+ </template>
</el-table-column>
<el-table-column
label="闅忚鎴愬姛"
@@ -491,6 +632,22 @@
key="followUpSuccessAgain"
prop="followUpSuccessAgain"
>
+ <template slot-scope="scope">
+ <el-button
+ size="medium"
+ type="text"
+ @click="
+ viewDetails(
+ scope.row.followUpSuccessAgainInfo,
+ scope.row.leavehospitaldistrictname +
+ '鍐嶆闅忚闅忚鎴愬姛鍒楄〃'
+ )
+ "
+ ><span class="button-zx">{{
+ scope.row.followUpSuccessAgain
+ }}</span></el-button
+ >
+ </template>
</el-table-column>
<el-table-column
label="闅忚澶辫触"
@@ -498,6 +655,22 @@
key="followUpFailAgain"
prop="followUpFailAgain"
>
+ <template slot-scope="scope">
+ <el-button
+ size="medium"
+ type="text"
+ @click="
+ viewDetails(
+ scope.row.followUpFailAgainInfo,
+ scope.row.leavehospitaldistrictname +
+ '鍐嶆闅忚闅忚澶辫触鍒楄〃'
+ )
+ "
+ ><span class="button-zx">{{
+ scope.row.followUpFailAgain
+ }}</span></el-button
+ >
+ </template>
</el-table-column>
<el-table-column
label="闅忚鐜�"
@@ -520,6 +693,22 @@
key="manualAgain"
prop="manualAgain"
>
+ <template slot-scope="scope">
+ <el-button
+ size="medium"
+ type="text"
+ @click="
+ viewDetails(
+ scope.row.manualAgainInfo,
+ scope.row.leavehospitaldistrictname +
+ '鍐嶆闅忚浜哄伐闅忚鍒楄〃'
+ )
+ "
+ ><span class="button-zx">{{
+ scope.row.manualAgain
+ }}</span></el-button
+ >
+ </template>
</el-table-column>
<el-table-column
label="鐭俊"
@@ -527,6 +716,22 @@
key="smsAgain"
prop="smsAgain"
>
+ <template slot-scope="scope">
+ <el-button
+ size="medium"
+ type="text"
+ @click="
+ viewDetails(
+ scope.row.smsAgainInfo,
+ scope.row.leavehospitaldistrictname +
+ '鍐嶆闅忚鐭俊闅忚鍒楄〃'
+ )
+ "
+ ><span class="button-zx">{{
+ scope.row.smsAgain
+ }}</span></el-button
+ >
+ </template>
</el-table-column>
<el-table-column
label="寰俊"
@@ -534,6 +739,22 @@
key="weChatAgain"
prop="weChatAgain"
>
+ <template slot-scope="scope">
+ <el-button
+ size="medium"
+ type="text"
+ @click="
+ viewDetails(
+ scope.row.weChatAgainInfo,
+ scope.row.leavehospitaldistrictname +
+ '鍐嶆闅忚寰俊闅忚鍒楄〃'
+ )
+ "
+ ><span class="button-zx">{{
+ scope.row.weChatAgain
+ }}</span></el-button
+ >
+ </template>
</el-table-column>
</el-table-column>
<el-table-column
@@ -852,6 +1073,226 @@
</div>
</div>
</el-dialog>
+ <!-- 鍚勭被璇︽儏 -->
+ <el-dialog
+ :title="infotitle"
+ :visible.sync="infotitleVisible"
+ v-loading="infotitloading"
+ width="70%"
+ :close-on-click-modal="false"
+ >
+ <div style="margin-bottom: 16px; display: flex; align-items: center">
+ <span style="margin-right: 10px; font-weight: bold">鎮h�呭鍚嶆煡璇�:</span>
+ <el-input
+ v-model="searchName"
+ placeholder="璇疯緭鍏ユ偅鑰呭鍚嶈繘琛岀瓫閫�"
+ clearable
+ style="width: 300px"
+ @input="handleSearch"
+ @clear="handleSearch"
+ >
+ </el-input>
+ <span
+ style="margin-left: 10px; color: rgb(35, 81, 233); font-size: 16px"
+ >
+ 鍏� {{ infotitlelist.length }} 鏉¤褰�
+ </span>
+ </div>
+ <div class="examine-jic">
+ <div class="jic-value">
+ <el-row :gutter="20">
+ <!-- 閫夋嫨鎮h�呭垪琛� -->
+ <div
+ class="data-list"
+ ref="dataList"
+ @scroll="handleScroll"
+ v-loading="infotitloading"
+ >
+ <el-table
+ :data="currentDisplayList"
+ 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>
+ </div>
+ </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 +1305,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 +1345,19 @@
activeName: "first", //渚ц竟閫夋嫨
orgname: "",
expands: [],
+ infotitlelist: [],
+ currentDisplayList: [], // 褰撳墠鏄剧ず鐨勬暟鎹�
+ loadIndex: 0, // 褰撳墠宸插姞杞界殑鏁版嵁绱㈠紩
+ pageSize: 100, // 姣忔鍔犺浇鐨勬暟鎹噺
+ isLoading: false, // 闃叉婊氬姩鏃堕噸澶嶅姞杞�
// 閬僵灞�
loading: false,
Seedloading: false,
chartDialogVisible: false,
+ infotitleVisible: false,
+ searchName: "", // 鎼滅储鍏抽敭璇�
+ infotitloading: false,
+ infotitle: "",
pieChart: null,
barLineChart: null,
// 閫変腑鏁扮粍
@@ -994,8 +1447,6 @@
},
// 鏌ヨ鏍囩鍒楄〃鍙傛暟
queryParams: {
- pageNum: 1,
- pageSize: 10,
serviceType: [2],
dateRange: [],
statisticaltype: 1,
@@ -1043,7 +1494,72 @@
getSfStatistics(params).then((response) => {
console.log(response);
// this.total = response.total;
- this.userList = response.data;
+ this.userList = this.customSort(response.data);
+ });
+ },
+ // 鎼滅储澶勭悊鍑芥暟
+ handleSearch() {
+ if (!this.searchName.trim()) {
+ // 濡傛灉鎼滅储妗嗕负绌猴紝鏄剧ず鎵�鏈夋暟鎹�
+ this.currentDisplayList = [...this.infotitlelist];
+ } else {
+ // 鏍规嵁鎮h�呭鍚嶈繘琛岀瓫閫夛紙涓嶅尯鍒嗗ぇ灏忓啓锛�
+ const keyword = this.searchName.toLowerCase();
+ this.currentDisplayList = this.infotitlelist.filter((item) => {
+ return item.sendname && item.sendname.toLowerCase().includes(keyword);
+ });
+ }
+ },
+ customSort(data) {
+ // 瀹氫箟鎮ㄦ湡鏈涚殑鐥呭尯椤哄簭锛堟墿灞曞埌涓夊崄锛�
+ const order = [
+ "浜�",
+ "涓�",
+ "鍥�",
+ "浜�",
+ "鍏�",
+ "涓�",
+ "鍏�",
+ "涔�",
+ "鍗�",
+ "鍗佷竴",
+ "鍗佷簩",
+ "鍗佷笁",
+ "鍗佸洓",
+ "鍗佷簲",
+ "鍗佸叚",
+ "鍗佷竷",
+ "鍗佸叓",
+ "鍗佷節",
+ "浜屽崄",
+ "浜屽崄涓�",
+ "浜屽崄浜�",
+ "浜屽崄涓�",
+ "浜屽崄鍥�",
+ "浜屽崄浜�",
+ "浜屽崄鍏�",
+ "浜屽崄涓�",
+ "浜屽崄鍏�",
+ "浜屽崄涔�",
+ "涓夊崄",
+ ];
+
+ return data.sort((a, b) => {
+ // 鎻愬彇鐥呭尯鍚嶇О涓殑涓枃鏁板瓧閮ㄥ垎[6](@ref)
+ const getIndex = (name) => {
+ const numStr = name.match(
+ /^(浜寍涓墊鍥泑浜攟鍏瓅涓億鍏珅涔潀鍗亅鍗佷竴|鍗佷簩|鍗佷笁|鍗佸洓|鍗佷簲|鍗佸叚|鍗佷竷|鍗佸叓|鍗佷節|浜屽崄|浜屽崄涓�|浜屽崄浜寍浜屽崄涓墊浜屽崄鍥泑浜屽崄浜攟浜屽崄鍏瓅浜屽崄涓億浜屽崄鍏珅浜屽崄涔潀涓夊崄)/
+ )?.[1];
+ return order.indexOf(numStr);
+ };
+
+ const indexA = getIndex(a.leavehospitaldistrictname);
+ const indexB = getIndex(b.leavehospitaldistrictname);
+
+ // 濡傛灉閮藉湪瀹氫箟鐨勯『搴忎腑锛屾寜瀹氫箟椤哄簭鎺掞紱鍚﹀垯锛屾湭瀹氫箟鐨勬帓鍦ㄥ悗闈2](@ref)
+ if (indexA === -1) return 1;
+ if (indexB === -1) return -1;
+ return indexA - indexB;
});
},
getRowKey(row) {
@@ -1065,9 +1581,16 @@
const params = {
...this.queryParams,
// 濡傛灉閫夋嫨浜�"鍏ㄩ儴"锛屽垯浼犳墍鏈夌梾鍖�/绉戝浠g爜
+ deptcodes: this.queryParams.deptcodes.includes("all")
+ ? this.allDeptCodes
+ : this.queryParams.deptcodes,
leavehospitaldistrictcodes: [row.leavehospitaldistrictcode],
drcode: "1",
};
+
+ // 绉婚櫎鍙兘瀛樺湪鐨�"all"鍊�
+ delete params.leavehospitaldistrictcodes.all;
+ delete params.deptcodes.all;
// 濡傛灉璇ヨ杩樻病鏈夊姞杞藉尰鐢熸暟鎹紝鍒欏姞杞�
if (!row.doctorStats) {
this.loading = true;
@@ -1089,7 +1612,7 @@
sums[index] = "鍚堣";
return;
}
- if (index === 1||index === 2) {
+ if (index === 1 || index === 2) {
sums[index] = "/";
return;
}
@@ -1324,6 +1847,48 @@
this.Seedloading = false;
});
},
+ viewDetails(row, title) {
+ this.infotitleVisible = true;
+ this.infotitle = title;
+ this.infotitlelist = row; // 鍋囪row灏辨槸闇�瑕佸睍绀虹殑璇︾粏鏁扮粍
+
+ // 鍒濆鍖栧姞杞�
+ this.loadIndex = 0;
+ this.currentDisplayList = [];
+ this.$nextTick(() => {
+ this.loadMoreData();
+ });
+ },
+ loadMoreData() {
+ if (this.isLoading) return;
+ this.isLoading = true;
+
+ // 妯℃嫙寮傛鍔犺浇锛屽疄闄呭彲鑳芥槸鐩存帴鍒囩墖鏈湴鏁版嵁
+ setTimeout(() => {
+ const nextChunk = this.infotitlelist.slice(
+ this.loadIndex,
+ this.loadIndex + this.pageSize
+ );
+ this.currentDisplayList = this.currentDisplayList.concat(nextChunk);
+ this.loadIndex += this.pageSize;
+ this.isLoading = false;
+ }, 200);
+ },
+ handleScroll(event) {
+ const scrollContainer = event.target;
+ // 鍒ゆ柇鏄惁婊氬姩鍒板簳閮�
+ const isAtBottom =
+ scrollContainer.scrollTop + scrollContainer.clientHeight >=
+ scrollContainer.scrollHeight - 10;
+
+ if (
+ isAtBottom &&
+ !this.isLoading &&
+ this.loadIndex < this.infotitlelist.length
+ ) {
+ this.loadMoreData();
+ }
+ },
SeedetailsgGo(row) {
this.SeedetailsVisible = false;
let type = "";
@@ -1460,16 +2025,353 @@
})
.catch(() => {});
},
- /** 瀵煎嚭鎸夐挳鎿嶄綔 */
- handleExport() {
- this.download(
- "smartor/serviceSubtask/getSfStatisticsExport",
- {
- ...this.queryParams,
- },
- `user_${new Date().getTime()}.xlsx`
- );
+ // 瀵煎嚭鏂规硶
+ // 鏇挎崲鎮ㄥ師鏉ョ殑 exportTable 鏂规硶
+ async exportTable() {
+ try {
+ // 1. 鑾峰彇骞舵牸寮忓寲鏃ユ湡鑼冨洿
+ let dateRangeString = ""; // 鐢ㄤ簬鏂囦欢鍚�
+ let sheetNameSuffix = ""; // 鐢ㄤ簬宸ヤ綔琛ㄥ悕
+
+ // 妫�鏌ユ槸鍚﹀瓨鍦ㄩ�変腑鐨勬棩鏈熻寖鍥�
+ if (
+ this.queryParams.dateRange &&
+ this.queryParams.dateRange.length === 2
+ ) {
+ const startDateStr = this.queryParams.dateRange[0]; // 寮�濮嬫棩鏈熷瓧绗︿覆锛屼緥濡� "2026-01-01 00:00:00"
+ const endDateStr = this.queryParams.dateRange[1]; // 缁撴潫鏃ユ湡瀛楃涓�
+
+ // 鏍煎紡鍖栨棩鏈熶负 YYYY-MM-DD锛堝幓鎺夋椂闂撮儴鍒嗭級
+ const formatDateForDisplay = (dateTimeStr) => {
+ return dateTimeStr.split(" ")[0]; // 鍙栫┖鏍煎墠鐨勯儴鍒嗭紝鍗� "YYYY-MM-DD"
+ };
+
+ const startDateFormatted = formatDateForDisplay(startDateStr);
+ const endDateFormatted = formatDateForDisplay(endDateStr);
+
+ // 鏋勫缓鏃ユ湡鑼冨洿瀛楃涓�
+ dateRangeString = `${startDateFormatted}鑷�${endDateFormatted}`;
+ sheetNameSuffix = `${startDateFormatted}鑷�${endDateFormatted}`;
+ } else {
+ // 濡傛灉娌℃湁閫夋嫨鏃ユ湡鑼冨洿锛屽垯浣跨敤褰撳墠鏈堜唤浣滀负澶囬�夋柟妗�
+ const now = new Date();
+ const currentMonth = now.getMonth() + 1;
+ dateRangeString = `${currentMonth}鏈坄;
+ sheetNameSuffix = `${currentMonth}鏈坄;
+ }
+
+ // 2. 鍔ㄦ�佹瀯寤烘枃浠跺悕鍜屽伐浣滆〃鍚�
+ const excelName = `鍑洪櫌闅忚缁熻琛╛${dateRangeString}.xlsx`;
+ const worksheetName = `闅忚缁熻_${sheetNameSuffix}`; // 宸ヤ綔琛ㄥ悕涓嶈兘瓒呰繃31涓瓧绗2](@ref)
+ // 鍒涘缓鏂扮殑宸ヤ綔绨垮拰宸ヤ綔琛�
+ 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" } },
+ },
+ };
+
+ 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 = `${sheetNameSuffix}鍑洪櫌闅忚缁熻琛╜; // 浣跨敤鏂囦欢鍚嶄綔涓烘�绘爣棰�
+ 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 +2833,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;
}
@@ -2003,6 +2917,10 @@
width: 100px;
height: 50px;
}
+.data-list {
+ max-height: 800px;
+ overflow-y: auto;
+}
.documentf {
display: flex;
justify-content: flex-end;
--
Gitblit v1.9.3