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 | 930 ++++++++++++++++++++++++++++++++++++++++-----------------
1 files changed, 647 insertions(+), 283 deletions(-)
diff --git a/src/views/sfstatistics/percentage/index.vue b/src/views/sfstatistics/percentage/index.vue
index de63b4a..745f8f0 100644
--- a/src/views/sfstatistics/percentage/index.vue
+++ b/src/views/sfstatistics/percentage/index.vue
@@ -395,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="寰呴殢璁�"
@@ -424,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="闅忚澶辫触"
@@ -488,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="鐭俊"
@@ -495,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="寰俊"
@@ -502,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="鍐嶆鍑洪櫌闅忚">
@@ -511,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="寰呴殢璁�"
@@ -518,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="闅忚鎴愬姛"
@@ -525,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="闅忚澶辫触"
@@ -532,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="闅忚鐜�"
@@ -554,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="鐭俊"
@@ -561,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="寰俊"
@@ -568,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
@@ -894,179 +1081,207 @@
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�呭垪琛� -->
- <el-table :data="infotitlelist" height="660" style="width: 100%">
- <el-table-column
- prop="sendname"
- align="center"
- label="濮撳悕"
- width="100"
+ <div
+ class="data-list"
+ ref="dataList"
+ @scroll="handleScroll"
+ v-loading="infotitloading"
+ >
+ <el-table
+ :data="currentDisplayList"
+ height="660"
+ style="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
+ 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
+ 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="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-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"
@@ -1131,11 +1346,16 @@
orgname: "",
expands: [],
infotitlelist: [],
+ currentDisplayList: [], // 褰撳墠鏄剧ず鐨勬暟鎹�
+ loadIndex: 0, // 褰撳墠宸插姞杞界殑鏁版嵁绱㈠紩
+ pageSize: 100, // 姣忔鍔犺浇鐨勬暟鎹噺
+ isLoading: false, // 闃叉婊氬姩鏃堕噸澶嶅姞杞�
// 閬僵灞�
loading: false,
Seedloading: false,
chartDialogVisible: false,
infotitleVisible: false,
+ searchName: "", // 鎼滅储鍏抽敭璇�
infotitloading: false,
infotitle: "",
pieChart: null,
@@ -1274,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) {
@@ -1296,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;
@@ -1558,7 +1850,44 @@
viewDetails(row, title) {
this.infotitleVisible = true;
this.infotitle = title;
- this.infotitlelist = row;
+ 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;
@@ -1700,40 +2029,68 @@
// 鏇挎崲鎮ㄥ師鏉ョ殑 exportTable 鏂规硶
async exportTable() {
try {
- // 鑾峰彇褰撳墠鏃ユ湡
- const now = new Date();
- // 鑾峰彇褰撳墠鏈堜唤锛堟敞鎰忔湀浠戒粠0寮�濮嬶紝闇�瑕佸姞1锛�
- const currentMonth = now.getMonth() + 1;
- // 鏋勫缓鏂囦欢鍚�
- const excelName = `${currentMonth}鏈堝嚭闄㈤殢璁跨粺璁¤〃.xlsx`;
+ // 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(`${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 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: {
@@ -1801,12 +2158,12 @@
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. 娣诲姞鎬绘爣棰樿锛堢涓�琛岋級
+ 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 灞曞紑鍒楀崰浣嶏紙鍏跺�煎皢鐢辩涓�琛屽悎骞跺悗鐨勪富鍗曞厓鏍煎喅瀹氾級
@@ -1837,95 +2194,98 @@
];
// 娣诲姞绗簩琛岋紙鍘熺涓�琛屼笅绉伙級
- secondRowHeaders.forEach((header, index) => {
- const cell = worksheet.getCell(3, index + 1); // 鏀逛负绗�3琛�
- cell.value = header;
- cell.style = headerStyle;
- });
+ 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;
+ // 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;
+ // 鍚堝苟 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;
+ // 鍚堝苟 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;
+ // 鍚堝苟 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;
+ // 鍚堝苟 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;
+ // 鍚堝苟 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;
+ // 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;
+ // 鍐嶆鍑洪櫌闅忚锛堝悎骞禤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; // 鍘熺浜岃涓嬬Щ
+ // 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琛岋級
+ // 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;
- });
+ // 搴旂敤鏁版嵁琛屾牱寮�
+ dataRow.eachCell((cell) => {
+ cell.style = cellStyle;
+ });
+ dataRow.height = 24;
+ });
// 娣诲姞鍚堣琛�
const summaries = this.getSummaries({
@@ -2557,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