From 3cf6f5204b0ade9aa5022d5fcecbef095c575918 Mon Sep 17 00:00:00 2001
From: WXL (wul) <wl_5969728@163.com>
Date: 星期二, 16 十二月 2025 09:44:41 +0800
Subject: [PATCH] 测试完成

---
 /dev/null                                         |    0 
 src/main.js                                       |    3 
 src/views/followvisit/record/detailpage/index.vue |   17 +
 src/views/sfstatistics/percentage/index.vue       |  337 ++++++++++++++++++++++++++++++++++++++++++++----
 lishui (2).zip                                    |    0 
 lishui.zip                                        |    0 
 package.json                                      |    5 
 7 files changed, 326 insertions(+), 36 deletions(-)

diff --git a/SLTD-WL.zip b/SLTD-WL.zip
deleted file mode 100644
index 3ef20a5..0000000
--- a/SLTD-WL.zip
+++ /dev/null
Binary files differ
diff --git "a/dist \0502\051.zip" "b/dist \0502\051.zip"
deleted file mode 100644
index 3b4f14b..0000000
--- "a/dist \0502\051.zip"
+++ /dev/null
Binary files differ
diff --git "a/dist \0503\051.zip" "b/dist \0503\051.zip"
deleted file mode 100644
index f404e41..0000000
--- "a/dist \0503\051.zip"
+++ /dev/null
Binary files differ
diff --git "a/dist \0504\051.zip" "b/dist \0504\051.zip"
deleted file mode 100644
index e148d2b..0000000
--- "a/dist \0504\051.zip"
+++ /dev/null
Binary files differ
diff --git a/dist.zip b/dist.zip
deleted file mode 100644
index 943fe42..0000000
--- a/dist.zip
+++ /dev/null
Binary files differ
diff --git a/jinyun.zip b/jinyun.zip
deleted file mode 100644
index ed0fc8b..0000000
--- a/jinyun.zip
+++ /dev/null
Binary files differ
diff --git "a/lishui \0502\051.zip" "b/lishui \0502\051.zip"
index ec6a348..6830e94 100644
--- "a/lishui \0502\051.zip"
+++ "b/lishui \0502\051.zip"
Binary files differ
diff --git a/lishui.zip b/lishui.zip
index dba804c..d790779 100644
--- a/lishui.zip
+++ b/lishui.zip
Binary files differ
diff --git a/package.json b/package.json
index 291269c..f92688c 100644
--- a/package.json
+++ b/package.json
@@ -52,6 +52,7 @@
     "dayjs": "^1.11.7",
     "echarts": "^5.4.2",
     "element-ui": "^2.15.4",
+    "exceljs": "^4.4.0",
     "file-saver": "^2.0.5",
     "fuse.js": "6.4.3",
     "highlight.js": "9.18.5",
@@ -81,11 +82,13 @@
     "vue-count-to": "1.0.13",
     "vue-cropper": "0.5.5",
     "vue-meta": "2.4.0",
+    "vue-print-nb": "^1.7.5",
     "vue-quill-editor": "^3.0.6",
     "vue-router": "3.4.9",
     "vuedraggable": "^2.24.3",
     "vuex": "3.6.0",
-    "xlsx": "^0.18.5"
+    "xlsx": "^0.18.5",
+    "xlsx-js-style": "^1.2.0"
   },
   "devDependencies": {
     "@vue/cli-plugin-babel": "4.4.6",
diff --git a/sltd-zs.zip b/sltd-zs.zip
deleted file mode 100644
index c49b570..0000000
--- a/sltd-zs.zip
+++ /dev/null
Binary files differ
diff --git a/src/main.js b/src/main.js
index 1207e98..ebc84a8 100644
--- a/src/main.js
+++ b/src/main.js
@@ -13,6 +13,7 @@
 import router from "./router";
 import directive from "./directive"; // directive
 import plugins from "./plugins"; // plugins
+import Print from 'vue-print-nb'
 import { download } from "@/utils/request";
 //寮曞叆quill-editor缂栬緫鍣�
 import VueQuillEditor from "vue-quill-editor";
@@ -21,6 +22,8 @@
 import "quill/dist/quill.snow.css";
 import "quill/dist/quill.bubble.css";
 Vue.use(VueQuillEditor);
+Vue.use(Print)
+
 // 寮曞叆
 import { codemirror } from "vue-codemirror";
 import "@/utils/cm-setting.js";
diff --git a/src/views/followvisit/record/detailpage/index.vue b/src/views/followvisit/record/detailpage/index.vue
index 8526297..af7df91 100644
--- a/src/views/followvisit/record/detailpage/index.vue
+++ b/src/views/followvisit/record/detailpage/index.vue
@@ -1448,7 +1448,8 @@
         {
           value: "涓�涓湀鍚�",
           label: "涓�涓湀鍚�",
-        },   {
+        },
+        {
           value: "涓や釜鏈堝悗",
           label: "涓や釜鏈堝悗",
         },
@@ -1605,17 +1606,17 @@
       // 鏍规嵁閫夋嫨鐨勯殢璁挎柟寮忚绠楅殢璁挎棩鏈�
       if (value.includes("涓冨ぉ鍚�")) {
         followupDate.setDate(dischargeDate.getDate() + 7);
-      } else if (value.includes("15澶╁悗")||value.includes("鍗婁釜鏈堝悗")) {
+      } else if (value.includes("15澶╁悗") || value.includes("鍗婁釜鏈堝悗")) {
         followupDate.setDate(dischargeDate.getDate() + 15);
       } else if (value.includes("涓�涓湀鍚�")) {
         followupDate.setMonth(dischargeDate.getMonth() + 1);
-      }else if (value.includes("涓や釜鏈堝悗")) {
+      } else if (value.includes("涓や釜鏈堝悗")) {
         followupDate.setMonth(dischargeDate.getMonth() + 2);
       } else if (value.includes("涓変釜鏈堝悗")) {
         followupDate.setMonth(dischargeDate.getMonth() + 3);
       } else if (value.includes("鍏釜鏈堝悗")) {
         followupDate.setMonth(dischargeDate.getMonth() + 6);
-      } else if (value.includes("涓�骞村悗")||value.includes("12涓湀鍚�")) {
+      } else if (value.includes("涓�骞村悗") || value.includes("12涓湀鍚�")) {
         followupDate.setFullYear(dischargeDate.getFullYear() + 1);
       }
 
@@ -1760,7 +1761,7 @@
             }
           });
           this.Editsingletasksonyic(6);
-          if (this.visitCount != 1) {
+          if (this.form.isVisitAgain != 1) {
             this.Torouter();
             return;
           }
@@ -1945,7 +1946,7 @@
         param2: this.patid,
         subId: this.id,
       };
-      if (this.visitCount != 1) {
+      if (this.form.isVisitAgain != 1) {
         this.Torouter();
         return;
       }
@@ -2165,6 +2166,10 @@
                 this.formtidy();
                 this.dialogFormVisible = true;
               });
+          } else {
+            document.querySelector("#app").scrollTo(0, 0);
+            this.formtidy();
+            this.dialogFormVisible = true;
           }
         } else {
           document.querySelector("#app").scrollTo(0, 0);
diff --git a/src/views/sfstatistics/percentage/index.vue b/src/views/sfstatistics/percentage/index.vue
index 8557dce..15efdc4 100644
--- a/src/views/sfstatistics/percentage/index.vue
+++ b/src/views/sfstatistics/percentage/index.vue
@@ -113,7 +113,7 @@
                   plain
                   icon="el-icon-download"
                   size="medium"
-                  @click="handleExport"
+                  @click="exportTable"
                   >瀵煎嚭</el-button
                 >
                 <el-button
@@ -128,6 +128,8 @@
             </el-form>
             <div class="your-table-container">
               <el-table
+                ref="exportTable"
+                id="exportTableid"
                 v-loading="loading"
                 :data="userList"
                 :border="true"
@@ -864,7 +866,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 = [
@@ -1089,7 +1094,7 @@
           sums[index] = "鍚堣";
           return;
         }
-         if (index === 1||index === 2) {
+        if (index === 1 || index === 2) {
           sums[index] = "/";
           return;
         }
@@ -1460,31 +1465,293 @@
         })
         .catch(() => {});
     },
-    /** 瀵煎嚭鎸夐挳鎿嶄綔 */
-    handleExport() {
-      const params = {
-        ...this.queryParams,
-        // 濡傛灉閫夋嫨浜�"鍏ㄩ儴"锛屽垯浼犳墍鏈夌梾鍖�/绉戝浠g爜
-        leavehospitaldistrictcodes:
-          this.queryParams.leavehospitaldistrictcodes.includes("all")
-            ? this.allWardCodes
-            : this.queryParams.leavehospitaldistrictcodes,
-        deptcodes: this.queryParams.deptcodes.includes("all")
-          ? this.allDeptCodes
-          : this.queryParams.deptcodes,
-      };
-       delete params.leavehospitaldistrictcodes.all;
-      delete params.deptcodes.all;
-      console.log(params);
+    // 瀵煎嚭鏂规硶
+    // 鏇挎崲鎮ㄥ師鏉ョ殑 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("闅忚缁熻");
 
-      this.download(
-        "smartor/serviceSubtask/getSfStatisticsExport",
-        {
-          ...params,
-        },
-        `user_${new Date().getTime()}.xlsx`
-      );
+        // 瀹氫箟鏍峰紡
+        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. 棣栧厛锛屽垱寤哄苟璁剧疆绗簩琛岋紙瀛愯〃澶达級鐨勬墍鏈夊崟鍏冩牸
+        const secondRowHeaders = [
+          "", // A2 灞曞紑鍒楀崰浣嶏紙鍏跺�煎皢鐢辩涓�琛屽悎骞跺悗鐨勪富鍗曞厓鏍煎喅瀹氾級
+          "鍑洪櫌鐥呭尯",
+          "绉戝",
+          "鍑洪櫌浜烘",
+          "鏃犻渶闅忚浜烘",
+          "搴旈殢璁夸汉娆�", // B2 to F2
+          // 棣栨鍑洪櫌闅忚瀛愯〃澶�
+          "闇�闅忚",
+          "寰呴殢璁�",
+          "闅忚鎴愬姛",
+          "闅忚澶辫触",
+          "闅忚鐜�",
+          "鍙婃椂鐜�",
+          "浜哄伐",
+          "鐭俊",
+          "寰俊",
+          // 鍐嶆鍑洪櫌闅忚瀛愯〃澶�
+          "闇�闅忚",
+          "寰呴殢璁�",
+          "闅忚鎴愬姛",
+          "闅忚澶辫触",
+          "闅忚鐜�",
+          "浜哄伐",
+          "鐭俊",
+          "寰俊",
+        ];
+
+        // 娣诲姞绗簩琛屽苟璁剧疆鏍峰紡
+        secondRowHeaders.forEach((header, index) => {
+          // 娉ㄦ剰锛氬垪绱㈠紩浠�1寮�濮嬶紝瀵瑰簲A鍒楁槸1锛孊鍒楁槸2锛屼互姝ょ被鎺ㄣ��
+          const cell = worksheet.getCell(2, index + 1);
+          cell.value = header;
+          cell.style = headerStyle;
+        });
+
+        // 2. 鐒跺悗锛屽垱寤虹涓�琛岀殑涓绘爣棰樺崟鍏冩牸骞惰缃牱寮忥紝绱ф帴鐫�杩涜绾靛悜鍚堝苟
+        // 鍚堝苟 A1:A2 骞惰缃��
+        worksheet.mergeCells(1, 1, 2, 1); // 鍚堝苟 A1 鍒� A2
+        worksheet.getCell(1, 1).value = ""; // 璁剧疆涓诲崟鍏冩牸(A1)鐨勫��
+        worksheet.getCell(1, 1).style = headerStyle; // 璁剧疆涓诲崟鍏冩牸鏍峰紡
+
+        // 鍚堝苟 B1:B2 骞惰缃��
+        worksheet.mergeCells(1, 2, 2, 2); // 鍚堝苟 B1 鍒� B2
+        worksheet.getCell(1, 2).value = "鍑洪櫌鐥呭尯";
+        worksheet.getCell(1, 2).style = headerStyle;
+
+        // 鍚堝苟 C1:C2 骞惰缃��
+        worksheet.mergeCells(1, 3, 2, 3); // 鍚堝苟 C1 鍒� C2
+        worksheet.getCell(1, 3).value = "绉戝";
+        worksheet.getCell(1, 3).style = headerStyle;
+
+        // 鍚堝苟 D1:D2 骞惰缃��
+        worksheet.mergeCells(1, 4, 2, 4); // 鍚堝苟 D1 鍒� D2
+        worksheet.getCell(1, 4).value = "鍑洪櫌浜烘";
+        worksheet.getCell(1, 4).style = headerStyle;
+
+        // 鍚堝苟 E1:E2 骞惰缃��
+        worksheet.mergeCells(1, 5, 2, 5); // 鍚堝苟 E1 鍒� E2
+        worksheet.getCell(1, 5).value = "鏃犻渶闅忚浜烘";
+        worksheet.getCell(1, 5).style = headerStyle;
+
+        // 鍚堝苟 F1:F2 骞惰缃��
+        worksheet.mergeCells(1, 6, 2, 6); // 鍚堝苟 F1 鍒� F2
+        worksheet.getCell(1, 6).value = "搴旈殢璁夸汉娆�";
+        worksheet.getCell(1, 6).style = headerStyle;
+
+        // 3. 璁剧疆绗竴琛岀殑妯悜鍚堝苟鏍囬锛堣繖浜涗繚鎸佷笉鍙橈紝鍥犱负鍙秹鍙婄涓�琛岋級
+        // 棣栨鍑洪櫌闅忚锛堝悎骞禛1鍒癘1锛�
+        worksheet.mergeCells("G1:O1");
+        worksheet.getCell("G1").value = "棣栨鍑洪櫌闅忚";
+        worksheet.getCell("G1").style = headerStyle;
+
+        // 鍐嶆鍑洪櫌闅忚锛堝悎骞禤1鍒癢1锛�
+        worksheet.mergeCells("P1:W1");
+        worksheet.getCell("P1").value = "鍐嶆鍑洪櫌闅忚";
+        worksheet.getCell("P1").style = headerStyle;
+
+        // 4. 璁剧疆琛岄珮锛堝彲閫夛紝浣嗗缓璁缃級
+        worksheet.getRow(1).height = 28; // 绗竴琛岃楂�
+        worksheet.getRow(2).height = 25; // 绗簩琛岃楂�
+
+        // 娣诲姞鏁版嵁琛�
+        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,
+          ]);
+
+          // 搴旂敤鏁版嵁琛屾牱寮�
+          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() {
@@ -1946,9 +2213,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;
 }
diff --git "a/\344\270\275\346\260\264.zip" "b/\344\270\275\346\260\264.zip"
deleted file mode 100644
index 6ac2f7c..0000000
--- "a/\344\270\275\346\260\264.zip"
+++ /dev/null
Binary files differ

--
Gitblit v1.9.3