WXL (wul)
3 天以前 b57c6c97c7de4cb5aeeb6c766a4642fac5b9b500
src/views/Satisfaction/sfstatistics/components/FollowupStatistics.vue
@@ -199,13 +199,14 @@
                scope.row.followUpRate !== undefined
              "
            >
              {{ formatPercent(scope.row.followUpRate) }}
              {{ scope.row.followUpRate }}
            </span>
            <span v-else>-</span>
          </template>
        </el-table-column>
        <el-table-column
          v-if="orgname == '景宁畲族自治县人民医院'"
          label="及时率"
          align="center"
          key="rate"
@@ -322,6 +323,7 @@
        :row-data="currentRow"
        :topicList="topiclist"
        :query-params="queryParams"
        :topType="2"
        @close="topicVisible = false"
      />
    </el-dialog>
@@ -352,7 +354,7 @@
        statisticaltype: 1,
        leavehospitaldistrictcodes: ["all"],
        deptcodes: [],
        serviceType: [2],
        serviceType: [],
        dateRange: [],
        pageNum: 1,
        pageSize: 20,
@@ -371,7 +373,25 @@
      flatArraydept: [],
      // 服务类型选项
      options: [],
      options: [
        {
          value: 6,
          label: "住院满意度",
          raw: {
            cssClass: "",
            listClass: "",
          },
        },
        {
          value: 14,
          label: "门诊满意度",
          raw: {
            cssClass: "",
            listClass: "",
          },
        },
      ],
      // 表格数据
      userList: [],
@@ -381,6 +401,7 @@
      // 加载状态
      loading: false,
      orgname: "",
      // 选中的行
      ids: [],
@@ -439,6 +460,8 @@
  },
  created() {
    this.orgname = localStorage.getItem("orgname");
    this.initData();
  },
@@ -446,13 +469,13 @@
    // 初始化数据
    async initData() {
      await this.getDeptTree();
      await this.getList();
      // await this.getList();
    },
    // 获取科室树
    getDeptTree() {
      // 获取服务类型
      this.options = this.$store.getters.tasktypes || [];
      // this.options = this.$store.getters.tasktypes || [];
      // 获取科室列表
      this.flatArraydept = (this.$store.getters.belongDepts || []).map(
@@ -814,8 +837,7 @@
        const response = await getSfStatisticsJoyInfo(params);
        this.topiclist = response.data || [];
      this.topicVisible = true;
        this.topicVisible = true;
      } catch (error) {
        console.error("获取满意度详情失败:", error);
        this.$message.error("获取详情失败");
@@ -835,23 +857,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工作簿
@@ -905,7 +958,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;