From feb5a669dced68415bc7e32f237f77bf9842fe8b Mon Sep 17 00:00:00 2001
From: WXL (wul) <wl_5969728@163.com>
Date: 星期三, 03 六月 2026 17:42:18 +0800
Subject: [PATCH] 测试完成
---
src/views/Satisfaction/sfstatistics/IndicatorStatistics.vue | 2
src/views/sfstatistics/percentage/components/SecondFollowUp.vue | 191 +++++++++++++-----
src/views/followvisit/operation/index.vue | 2
src/views/followvisit/beHospitalized/followUp.vue | 2
src/views/sfstatistics/percentage/components/FirstFollowUp.vue | 201 +++++++++++++------
src/views/Satisfaction/sfstatistics/components/visitStatistics.vue | 48 ++++
src/views/followvisit/zysatisfaction/index.vue | 2
src/views/patient/propaganda/QuestionnaireTask.vue | 5
src/views/sfstatistics/percentage/index.vue | 57 +++++
src/views/Satisfaction/sfstatistics/components/FollowupStatistics.vue | 47 +++
src/views/Satisfaction/sfstatistics/index.vue | 4
src/views/patient/propaganda/particty.vue | 5
src/views/followvisit/discharge/index.vue | 2
13 files changed, 411 insertions(+), 157 deletions(-)
diff --git a/src/views/Satisfaction/sfstatistics/IndicatorStatistics.vue b/src/views/Satisfaction/sfstatistics/IndicatorStatistics.vue
index 53f5355..1f6e0fc 100644
--- a/src/views/Satisfaction/sfstatistics/IndicatorStatistics.vue
+++ b/src/views/Satisfaction/sfstatistics/IndicatorStatistics.vue
@@ -2,7 +2,7 @@
<template>
<div class="statistics-main">
<el-tabs v-model="activeTab" @tab-click="handleTabChange">
- <el-tab-pane label="婊℃剰搴︾粺璁�" name="followup">
+ <el-tab-pane label="婊℃剰搴﹂殢璁跨粺璁�" name="followup">
<followup-statistics
v-if="activeTab === 'followup'"
ref="followupRef"
diff --git a/src/views/Satisfaction/sfstatistics/components/FollowupStatistics.vue b/src/views/Satisfaction/sfstatistics/components/FollowupStatistics.vue
index 20938e3..0c0dd0c 100644
--- a/src/views/Satisfaction/sfstatistics/components/FollowupStatistics.vue
+++ b/src/views/Satisfaction/sfstatistics/components/FollowupStatistics.vue
@@ -838,23 +838,54 @@
// 鏋勫缓鏃ユ湡鑼冨洿瀛楃涓�
let dateRangeString = "";
let sheetNameSuffix = "";
+ const isLishuiHospital = this.orgname == "涓芥按甯備腑鍖婚櫌";
if (
this.queryParams.dateRange &&
this.queryParams.dateRange.length === 2
) {
- const startDateFormatted = this.queryParams.dateRange[0];
- const endDateFormatted = this.queryParams.dateRange[1];
- dateRangeString = `${startDateFormatted}鑷�${endDateFormatted}`;
- sheetNameSuffix = `${startDateFormatted}鑷�${endDateFormatted}`;
+ 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}鏈坄;
+ };
+ 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;
- dateRangeString = `${currentMonth}鏈坄;
- sheetNameSuffix = `${currentMonth}鏈坄;
+ const currentYear = now.getFullYear();
+
+ if (isLishuiHospital) {
+ // 涓芥按甯備腑鍖婚櫌锛氭樉绀哄勾鏈�
+ dateRangeString = `${currentYear}骞�${currentMonth}鏈坄;
+ sheetNameSuffix = `${currentYear}骞�${currentMonth}鏈坄;
+ } else {
+ // 鍏朵粬鍖婚櫌锛氭樉绀烘湀浠�
+ dateRangeString = `${currentMonth}鏈坄;
+ sheetNameSuffix = `${currentMonth}鏈坄;
+ }
}
- const excelName = `闅忚缁熻琛╛${dateRangeString}.xlsx`;
+ const excelName = `婊℃剰搴﹂殢璁跨粺璁¤〃_${dateRangeString}.xlsx`;
const worksheetName = `闅忚缁熻_${sheetNameSuffix}`;
// 鍒涘缓Excel宸ヤ綔绨�
@@ -908,7 +939,7 @@
// 娣诲姞鎬绘爣棰�
worksheet.mergeCells(1, 1, 1, 10);
const titleCell = worksheet.getCell(1, 1);
- titleCell.value = `闅忚缁熻琛紙${sheetNameSuffix}锛塦;
+ titleCell.value = `婊℃剰搴﹂殢璁跨粺璁¤〃锛�${sheetNameSuffix}锛塦;
titleCell.style = titleStyle;
worksheet.getRow(1).height = 35;
diff --git a/src/views/Satisfaction/sfstatistics/components/visitStatistics.vue b/src/views/Satisfaction/sfstatistics/components/visitStatistics.vue
index d751be2..ee25d7e 100644
--- a/src/views/Satisfaction/sfstatistics/components/visitStatistics.vue
+++ b/src/views/Satisfaction/sfstatistics/components/visitStatistics.vue
@@ -837,22 +837,54 @@
let dateRangeString = "";
let sheetNameSuffix = "";
+ const isLishuiHospital = this.orgname == "涓芥按甯備腑鍖婚櫌";
+
if (
this.queryParams.dateRange &&
this.queryParams.dateRange.length === 2
) {
- const startDateFormatted = this.queryParams.dateRange[0];
- const endDateFormatted = this.queryParams.dateRange[1];
- dateRangeString = `${startDateFormatted}鑷�${endDateFormatted}`;
- sheetNameSuffix = `${startDateFormatted}鑷�${endDateFormatted}`;
+ 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}鏈坄;
+ };
+ 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;
- dateRangeString = `${currentMonth}鏈坄;
- sheetNameSuffix = `${currentMonth}鏈坄;
+ const currentYear = now.getFullYear();
+
+ if (isLishuiHospital) {
+ // 涓芥按甯備腑鍖婚櫌锛氭樉绀哄勾鏈�
+ dateRangeString = `${currentYear}骞�${currentMonth}鏈坄;
+ sheetNameSuffix = `${currentYear}骞�${currentMonth}鏈坄;
+ } else {
+ // 鍏朵粬鍖婚櫌锛氭樉绀烘湀浠�
+ dateRangeString = `${currentMonth}鏈坄;
+ sheetNameSuffix = `${currentMonth}鏈坄;
+ }
}
- const excelName = `闅忚缁熻琛╛${dateRangeString}.xlsx`;
+ const excelName = `澶嶈瘖閫氱煡缁熻琛╛${dateRangeString}.xlsx`;
const worksheetName = `闅忚缁熻_${sheetNameSuffix}`;
// 鍒涘缓Excel宸ヤ綔绨�
@@ -906,7 +938,7 @@
// 娣诲姞鎬绘爣棰�
worksheet.mergeCells(1, 1, 1, 10);
const titleCell = worksheet.getCell(1, 1);
- titleCell.value = `闅忚缁熻琛紙${sheetNameSuffix}锛塦;
+ titleCell.value = `澶嶈瘖閫氱煡缁熻琛紙${sheetNameSuffix}锛塦;
titleCell.style = titleStyle;
worksheet.getRow(1).height = 35;
diff --git a/src/views/Satisfaction/sfstatistics/index.vue b/src/views/Satisfaction/sfstatistics/index.vue
index 96bda01..6042306 100644
--- a/src/views/Satisfaction/sfstatistics/index.vue
+++ b/src/views/Satisfaction/sfstatistics/index.vue
@@ -2,13 +2,13 @@
<template>
<div class="statistics-main">
<el-tabs v-model="activeTab" @tab-click="handleTabChange">
- <el-tab-pane label="闅忚缁熻" name="followup">
+ <el-tab-pane label="婊℃剰搴﹂殢璁跨粺璁�" name="followup">
<followup-statistics
v-if="activeTab === 'followup'"
ref="followupRef"
/>
</el-tab-pane>
- <el-tab-pane label="婊℃剰搴︾粺璁�" name="satisfaction">
+ <el-tab-pane label="婊℃剰搴︽槑缁嗙粺璁�" name="satisfaction">
<satisfaction-statistics
v-if="activeTab === 'satisfaction'"
ref="satisfactionRef"
diff --git a/src/views/followvisit/beHospitalized/followUp.vue b/src/views/followvisit/beHospitalized/followUp.vue
index e8bd9a4..2de6cc0 100644
--- a/src/views/followvisit/beHospitalized/followUp.vue
+++ b/src/views/followvisit/beHospitalized/followUp.vue
@@ -1306,7 +1306,7 @@
pageNum: 1,
pageSize: 10,
sendstateView:
- localStorage.getItem("orgname") == "鐪佺珛鍚屽痉缈犺嫅闄㈠尯" ? null : 1,
+ localStorage.getItem("orgname") == "鐪佺珛鍚屽痉缈犺嫅闄㈠尯" ? null : 2,
sort: localStorage.getItem("orgname") == "涓芥按甯備腑鍖婚櫌" ? 8 : 2, //0 鍑洪櫌鏃堕棿(姝e簭) 1 鍑洪櫌鏃堕棿(鍊掑簭) 2 鍙戦�佹椂闂�(姝e簭) 3 鍙戦�佹椂闂�(鍊掑簭) 7搴旈殢璁挎棩鏈�(鍊掑簭) 搴旈殢璁挎棩鏈�(姝e簭)
serviceType: 18,
searchscope: 3,
diff --git a/src/views/followvisit/discharge/index.vue b/src/views/followvisit/discharge/index.vue
index e14bc4f..0f3f605 100644
--- a/src/views/followvisit/discharge/index.vue
+++ b/src/views/followvisit/discharge/index.vue
@@ -1253,7 +1253,7 @@
pageNum: 1,
pageSize: 10,
sendstateView:
- localStorage.getItem("orgname") == "鐪佺珛鍚屽痉缈犺嫅闄㈠尯" ? null : 1,
+ localStorage.getItem("orgname") == "鐪佺珛鍚屽痉缈犺嫅闄㈠尯" ? null : 2,
sort: localStorage.getItem("orgname") == "涓芥按甯備腑鍖婚櫌" ? 8 : 2, //0 鍑洪櫌鏃堕棿(姝e簭) 1 鍑洪櫌鏃堕棿(鍊掑簭) 2 鍙戦�佹椂闂�(姝e簭) 3 鍙戦�佹椂闂�(鍊掑簭) 7搴旈殢璁挎棩鏈�(鍊掑簭) 搴旈殢璁挎棩鏈�(姝e簭)
serviceType: 2,
searchscope: 3,
diff --git a/src/views/followvisit/operation/index.vue b/src/views/followvisit/operation/index.vue
index 759b943..8e3b599 100644
--- a/src/views/followvisit/operation/index.vue
+++ b/src/views/followvisit/operation/index.vue
@@ -1266,7 +1266,7 @@
pageNum: 1,
pageSize: 10,
sendstateView:
- localStorage.getItem("orgname") == "鐪佺珛鍚屽痉缈犺嫅闄㈠尯" ? null : 1,
+ localStorage.getItem("orgname") == "鐪佺珛鍚屽痉缈犺嫅闄㈠尯" ? null : 2,
sort: localStorage.getItem("orgname") == "涓芥按甯備腑鍖婚櫌" ? 8 : 2, //0 鎵嬫湳瀹屾垚鏃堕棿(姝e簭) 1 鎵嬫湳瀹屾垚鏃堕棿(鍊掑簭) 2 鍙戦�佹椂闂�(姝e簭) 3 鍙戦�佹椂闂�(鍊掑簭) 7搴旈殢璁挎棩鏈�(鍊掑簭) 搴旈殢璁挎棩鏈�(姝e簭)
serviceType: 19,
searchscope: 3,
diff --git a/src/views/followvisit/zysatisfaction/index.vue b/src/views/followvisit/zysatisfaction/index.vue
index 720b30b..4848da4 100644
--- a/src/views/followvisit/zysatisfaction/index.vue
+++ b/src/views/followvisit/zysatisfaction/index.vue
@@ -1101,7 +1101,7 @@
pageNum: 1,
pageSize: 10,
sendstateView:
- localStorage.getItem("orgname") == "鐪佺珛鍚屽痉缈犺嫅闄㈠尯" ? null : 1,
+ localStorage.getItem("orgname") == "鐪佺珛鍚屽痉缈犺嫅闄㈠尯" ? null : 2,
sort: localStorage.getItem("orgname") == "涓芥按甯備腑鍖婚櫌" ? 8 : 2, //0 鍑洪櫌鏃堕棿(姝e簭) 1 鍑洪櫌鏃堕棿(鍊掑簭) 2 鍙戦�佹椂闂�(姝e簭) 3 鍙戦�佹椂闂�(鍊掑簭) 7搴旈殢璁挎棩鏈�(鍊掑簭) 搴旈殢璁挎棩鏈�(姝e簭)
serviceType: 6,
searchscope: 3,
diff --git a/src/views/patient/propaganda/QuestionnaireTask.vue b/src/views/patient/propaganda/QuestionnaireTask.vue
index 2613017..47284f1 100644
--- a/src/views/patient/propaganda/QuestionnaireTask.vue
+++ b/src/views/patient/propaganda/QuestionnaireTask.vue
@@ -428,10 +428,7 @@
placeholder="璇风偣鍑诲彸渚ч�夋嫨"
/>
<el-button
- v-if="
- (form.templateid && form.sendState == 1) ||
- !form.templateid
- "
+ v-if="form.templateid"
style="margin-left: 10px"
type="primary"
icon="el-icon-edit"
diff --git a/src/views/patient/propaganda/particty.vue b/src/views/patient/propaganda/particty.vue
index 3be475e..ed9f86a 100644
--- a/src/views/patient/propaganda/particty.vue
+++ b/src/views/patient/propaganda/particty.vue
@@ -449,10 +449,7 @@
placeholder="璇风偣鍑诲彸渚ч�夋嫨"
/>
<el-button
- v-if="
- (form.templateid && form.sendState == 1) ||
- !form.templateid
- "
+ v-if="form.templateid"
style="margin-left: 10px"
type="primary"
icon="el-icon-edit"
diff --git a/src/views/sfstatistics/percentage/components/FirstFollowUp.vue b/src/views/sfstatistics/percentage/components/FirstFollowUp.vue
index b463732..bcd91ea 100644
--- a/src/views/sfstatistics/percentage/components/FirstFollowUp.vue
+++ b/src/views/sfstatistics/percentage/components/FirstFollowUp.vue
@@ -275,7 +275,6 @@
</template>
</el-table-column>
<el-table-column
- v-if="orgname != '涓芥按甯備腑鍖婚櫌'"
label="浜哄伐"
align="center"
key="manual"
@@ -299,7 +298,6 @@
</template>
</el-table-column>
<el-table-column
- v-if="orgname != '涓芥按甯備腑鍖婚櫌'"
label="璇煶"
align="center"
key="voice"
@@ -323,7 +321,6 @@
</template>
</el-table-column>
<el-table-column
- v-if="orgname != '涓芥按甯備腑鍖婚櫌'"
label="鐭俊"
align="center"
key="sms"
@@ -347,7 +344,6 @@
</template>
</el-table-column>
<el-table-column
- v-if="orgname != '涓芥按甯備腑鍖婚櫌'"
label="寰俊"
align="center"
key="weChat"
@@ -586,7 +582,6 @@
</template>
</el-table-column>
<el-table-column
- v-if="orgname != '涓芥按甯備腑鍖婚櫌'"
label="浜哄伐"
align="center"
key="manual"
@@ -604,13 +599,7 @@
</el-button>
</template>
</el-table-column>
- <el-table-column
- v-if="orgname != '涓芥按甯備腑鍖婚櫌'"
- label="璇煶"
- align="center"
- key="voice"
- prop="voice"
- >
+ <el-table-column label="璇煶" align="center" key="voice" prop="voice">
<template slot-scope="scope">
<el-button
size="medium"
@@ -623,13 +612,7 @@
</el-button>
</template>
</el-table-column>
- <el-table-column
- v-if="orgname != '涓芥按甯備腑鍖婚櫌'"
- label="鐭俊"
- align="center"
- key="sms"
- prop="sms"
- >
+ <el-table-column label="鐭俊" align="center" key="sms" prop="sms">
<template slot-scope="scope">
<el-button
size="medium"
@@ -641,7 +624,6 @@
</template>
</el-table-column>
<el-table-column
- v-if="orgname != '涓芥按甯備腑鍖婚櫌'"
label="寰俊"
align="center"
key="weChat"
@@ -719,6 +701,7 @@
<script>
import { getSfStatisticsHyperlink } from "@/api/AiCentre/index";
+import store from "@/store";
import { getSfStatistics, selectTimelyRate } from "@/api/system/user";
import ExcelJS from "exceljs";
@@ -755,6 +738,7 @@
expands: [],
ids: [],
patientqueryParams: { pn: 1, ps: 10 },
+ tasktypes: store.getters.tasktypes,
};
},
methods: {
@@ -1197,58 +1181,138 @@
},
// 涓昏〃瀵煎嚭
async exportTable() {
- try {
- let dateRangeString = "";
- let sheetNameSuffix = "";
+ try {
+ let dateRangeString = "";
+ let sheetNameSuffix = "";
- if (
- this.queryParams.dateRange &&
- this.queryParams.dateRange.length === 2
- ) {
- const startDateStr = this.queryParams.dateRange[0];
- const endDateStr = this.queryParams.dateRange[1];
- 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;
- dateRangeString = `${currentMonth}鏈坄;
- sheetNameSuffix = `${currentMonth}鏈坄;
- }
+ // 鍒ゆ柇鏄惁鏄附姘村競涓尰闄�
+ const isLishuiHospital = this.orgname == "涓芥按甯備腑鍖婚櫌";
- const excelName = `棣栨鍑洪櫌闅忚缁熻琛╛${dateRangeString}.xlsx`;
- const worksheetName = `棣栨闅忚缁熻_${sheetNameSuffix}`;
+ if (
+ this.queryParams.dateRange &&
+ this.queryParams.dateRange.length === 2
+ ) {
+ const startDateStr = this.queryParams.dateRange[0];
+ const endDateStr = this.queryParams.dateRange[1];
- if (!this.tableData || this.tableData.length === 0) {
- this.$message.warning("鏆傛棤棣栨闅忚鏁版嵁鍙鍑�");
- 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;
+ 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 = "棣栨闅忚"; // 宸ヤ綔琛ㄤ娇鐢ㄧ殑鍚嶇О锛堢畝鍖栫増锛�
+
+ 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 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) {
@@ -1769,7 +1833,6 @@
this.patientqueryParams.serviceTypes = queryParams.serviceType
? queryParams.serviceType.join(",")
: null;
- console.log(2);
return selectTimelyRate(this.patientqueryParams);
},
diff --git a/src/views/sfstatistics/percentage/components/SecondFollowUp.vue b/src/views/sfstatistics/percentage/components/SecondFollowUp.vue
index c3a6bae..2a6b8e7 100644
--- a/src/views/sfstatistics/percentage/components/SecondFollowUp.vue
+++ b/src/views/sfstatistics/percentage/components/SecondFollowUp.vue
@@ -253,7 +253,6 @@
prop="followUpRateAgain"
/>
<el-table-column
- v-if="orgname != '涓芥按甯備腑鍖婚櫌'"
label="浜哄伐"
align="center"
key="manualAgain"
@@ -277,7 +276,6 @@
</template>
</el-table-column>
<el-table-column
- v-if="orgname != '涓芥按甯備腑鍖婚櫌'"
label="璇煶"
align="center"
key="voiceAgain"
@@ -301,7 +299,6 @@
</template>
</el-table-column>
<el-table-column
- v-if="orgname != '涓芥按甯備腑鍖婚櫌'"
label="鐭俊"
align="center"
key="smsAgain"
@@ -325,7 +322,6 @@
</template>
</el-table-column>
<el-table-column
- v-if="orgname != '涓芥按甯備腑鍖婚櫌'"
label="寰俊"
align="center"
key="weChatAgain"
@@ -552,7 +548,6 @@
prop="followUpRateAgain"
/>
<el-table-column
- v-if="orgname != '涓芥按甯備腑鍖婚櫌'"
label="浜哄伐"
align="center"
key="manualAgain"
@@ -575,7 +570,6 @@
</template>
</el-table-column>
<el-table-column
- v-if="orgname != '涓芥按甯備腑鍖婚櫌'"
label="璇煶"
align="center"
key="voiceAgain"
@@ -594,7 +588,6 @@
</template>
</el-table-column>
<el-table-column
- v-if="orgname != '涓芥按甯備腑鍖婚櫌'"
label="鐭俊"
align="center"
key="smsAgain"
@@ -617,7 +610,6 @@
</template>
</el-table-column>
<el-table-column
- v-if="orgname != '涓芥按甯備腑鍖婚櫌'"
label="寰俊"
align="center"
key="weChatAgain"
@@ -649,6 +641,7 @@
import { getSfStatistics } from "@/api/system/user";
import ExcelJS from "exceljs";
import { saveAs } from "file-saver";
+import store from "@/store";
export default {
name: "SecondFollowUp",
@@ -680,6 +673,7 @@
loading: false,
expands: [],
ids: [],
+ tasktypes: store.getters.tasktypes,
};
},
methods: {
@@ -1113,58 +1107,143 @@
return rate.toFixed(2) + "%";
},
async exportTable() {
- try {
- let dateRangeString = "";
- let sheetNameSuffix = "";
+ try {
+ let dateRangeString = "";
+ let sheetNameSuffix = "";
- if (
- this.queryParams.dateRange &&
- this.queryParams.dateRange.length === 2
- ) {
- const startDateStr = this.queryParams.dateRange[0];
- const endDateStr = this.queryParams.dateRange[1];
- 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;
- dateRangeString = `${currentMonth}鏈坄;
- sheetNameSuffix = `${currentMonth}鏈坄;
- }
+ // 鍒ゆ柇鏄惁鏄附姘村競涓尰闄�
+ const isLishuiHospital = this.orgname == "涓芥按甯備腑鍖婚櫌";
- const excelName = `鍐嶆鍑洪櫌闅忚缁熻琛╛${dateRangeString}.xlsx`;
- const worksheetName = `鍐嶆闅忚缁熻_${sheetNameSuffix}`;
+ if (
+ this.queryParams.dateRange &&
+ this.queryParams.dateRange.length === 2
+ ) {
+ const startDateStr = this.queryParams.dateRange[0];
+ const endDateStr = this.queryParams.dateRange[1];
- if (!this.tableData || this.tableData.length === 0) {
- this.$message.warning("鏆傛棤鍐嶆闅忚鏁版嵁鍙鍑�");
- 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;
+ 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 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 {
diff --git a/src/views/sfstatistics/percentage/index.vue b/src/views/sfstatistics/percentage/index.vue
index dd731d8..b924ce3 100644
--- a/src/views/sfstatistics/percentage/index.vue
+++ b/src/views/sfstatistics/percentage/index.vue
@@ -75,10 +75,12 @@
v-model="queryParams.dateRange"
value-format="yyyy-MM-dd HH:mm:ss"
type="daterange"
+ unlink-panels
range-separator="鑷�"
start-placeholder="寮�濮嬫棩鏈�"
end-placeholder="缁撴潫鏃ユ湡"
:default-time="['00:00:00', '23:59:59']"
+ :picker-options="pickerOptions"
/>
</el-form-item>
@@ -222,10 +224,41 @@
options: this.$store.getters.tasktypes,
queryParams: {
serviceType: [2],
- dateRange: [],
+ dateRange: this.getLastMonthRange(),
statisticaltype: 1,
leavehospitaldistrictcodes: ["all"],
deptcodes: [],
+ },
+ pickerOptions: {
+ shortcuts: [
+ {
+ text: "鏈�杩戜竴鍛�",
+ onClick(picker) {
+ const end = new Date();
+ const start = new Date();
+ start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
+ picker.$emit("pick", [start, end]);
+ },
+ },
+ {
+ text: "鏈�杩戜竴涓湀",
+ onClick(picker) {
+ const end = new Date();
+ const start = new Date();
+ start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
+ picker.$emit("pick", [start, end]);
+ },
+ },
+ {
+ text: "鏈�杩戜笁涓湀",
+ onClick(picker) {
+ const end = new Date();
+ const start = new Date();
+ start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
+ picker.$emit("pick", [start, end]);
+ },
+ },
+ ],
},
flatArrayhospit: [],
flatArraydept: [],
@@ -281,7 +314,29 @@
this.flatArraydept.push({ label: "鍏ㄩ儴", value: "all" });
this.flatArrayhospit.push({ label: "鍏ㄩ儴", value: "all" });
},
+ // 娣诲姞鑾峰彇鏈�杩戜竴涓湀鏃堕棿鑼冨洿鐨勬柟娉�
+ getLastMonthRange() {
+ const end = new Date();
+ const start = new Date();
+ start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
+ // 鏍煎紡鍖栦负 yyyy-MM-dd HH:mm:ss
+ const formatDate = (date) => {
+ const year = date.getFullYear();
+ const month = String(date.getMonth() + 1).padStart(2, "0");
+ const day = String(date.getDate()).padStart(2, "0");
+ return `${year}-${month}-${day} 00:00:00`;
+ };
+
+ const formatEndDate = (date) => {
+ const year = date.getFullYear();
+ const month = String(date.getMonth() + 1).padStart(2, "0");
+ const day = String(date.getDate()).padStart(2, "0");
+ return `${year}-${month}-${day} 23:59:59`;
+ };
+
+ return [formatDate(start), formatEndDate(end)];
+ },
handleTabClick(tab) {
this.activeTab = tab.name;
this.loadCurrentTabData();
--
Gitblit v1.9.3