WXL (wul)
4 天以前 c70f5e1d471ddf002ef0ebd5f4c6a5ed1c865d0d
src/views/Satisfaction/sfstatistics/components/SatisfactionStatistics.vue
@@ -16,6 +16,8 @@
              v-model="queryParams.type"
              placeholder="请选择统计类型"
              clearable
            @change="handleSearch"
              style="width: 100%"
            >
              <el-option label="问卷类型" :value="2" />
@@ -104,13 +106,13 @@
            <h3 class="chart-title">{{ getChartTitle() }}</h3>
            <div class="statistic-info">
              <div class="statistic-item">
                <span class="statistic-label">发送问卷总量:</span>
                <span class="statistic-label">发送题目总量:</span>
                <span class="statistic-value">{{
                  totalSendCount.toLocaleString()
                }}</span>
              </div>
              <div class="statistic-item">
                <span class="statistic-label">回收问卷总量:</span>
                <span class="statistic-label">回收题目总量:</span>
                <span class="statistic-value">{{
                  totalReceiveCount.toLocaleString()
                }}</span>
@@ -139,6 +141,8 @@
          <div
            id="satisfactionBarChart"
            v-loading="loading"
            element-loading-text="统计加载中..."
            style="width: 100%; height: 400px"
          ></div>
        </div>
@@ -290,7 +294,7 @@
              </el-table>
              <!-- 综合得分行 -->
              <div class="summary-row">
              <!-- <div class="summary-row">
                <div class="summary-content">
                  <div class="summary-item">
                    <span class="label">总答题人数:</span>
@@ -303,7 +307,7 @@
                    }}</span>
                  </div>
                </div>
              </div>
              </div> -->
              <!-- 分页 -->
              <div
@@ -856,6 +860,12 @@
      }
      return this.wardList.map((ward) => ward.value);
    },
    // 问题维度集合:从 dimensionality_type 字典取维度编码,查维度时必传
    dimensionList() {
      const dict = this.dict && this.dict.type && this.dict.type.dimensionality_type;
      return dict ? dict.map((d) => String(d.value)) : [];
    },
  },
  mounted() {
@@ -976,6 +986,9 @@
        deptcodes: this.deptCodes, // 使用计算属性
        hospitaldistrictcodes: this.hospitalDistrictCodes, // 使用计算属性
        templateid: this.templateId,
        questionType: this.queryParams.type || null,
        serviceTypes: this.defaultServiceTypes,
        dimensionList: this.dimensionList, // 问题维度集合,查维度时必传
      };
      const response = await satisfactionGraphDimension(params);
@@ -1151,14 +1164,14 @@
        return {
          scriptContent: item.scriptContent || "",
          scriptType: 1,
          answerPerson: item.answerPerson || 0,
          noAnswerPerson: item.noAnswerPerson || 0,
          answerCount: item.answerPerson || 0,
          averageScore: item.averageScore || 0,
          maxScore: item.maxScore || 0,
          minScore: item.minScore || 0,
          answerRate: item.answerRate || 0,
          totalCount: (item.answerPerson || 0) + (item.noAnswerPerson || 0),
          answerPerson: Number(item.answerPerson) || 0,
          noAnswerPerson: Number(item.noAnswerPerson) || 0,
          answerCount: Number(item.answerPerson) || 0,
          averageScore: Number(item.averageScore) || 0,
          maxScore: Number(item.maxScore) || 0,
          minScore: Number(item.minScore) || 0,
          answerRate: Number(item.answerRate) || 0,
          totalCount: (Number(item.answerPerson) || 0) + (Number(item.noAnswerPerson) || 0),
          options: options,
        };
      });
@@ -1187,6 +1200,7 @@
          templateid: this.templateId,
          questionType: this.queryParams.type || null,
          serviceTypes: this.defaultServiceTypes,
          dimensionList: this.dimensionList, // 问题维度集合,查维度时必传
        };
        const response = await statisticsByDimension(params);
@@ -1236,14 +1250,14 @@
          dimension: item.dimension || "0", // 维度代码
          dimensionName: this.getDimensionLabel(item.dimension || "0"), // 维度名称
          scriptType: 1,
          answerPerson: item.answerPerson || 0,
          noAnswerPerson: item.noAnswerPerson || 0,
          answerCount: item.answerPerson || 0,
          averageScore: item.averageScore || 0,
          maxScore: item.maxScore || 0,
          minScore: item.minScore || 0,
          answerRate: item.answerRate || 0,
          totalCount: (item.answerPerson || 0) + (item.noAnswerPerson || 0),
          answerPerson: Number(item.answerPerson) || 0,
          noAnswerPerson: Number(item.noAnswerPerson) || 0,
          answerCount: Number(item.answerPerson) || 0,
          averageScore: Number(item.averageScore) || 0,
          maxScore: Number(item.maxScore) || 0,
          minScore: Number(item.minScore) || 0,
          answerRate: Number(item.answerRate) || 0,
          totalCount: (Number(item.answerPerson) || 0) + (Number(item.noAnswerPerson) || 0),
          options: options,
        };
      });
@@ -2067,7 +2081,7 @@
      const num = parseFloat(value);
      if (isNaN(num)) return "-";
      // 如果值小于1,认为是小数比例,需要乘以100
      const percentValue = num < 1 ? num * 100 : num;
      const percentValue = num <= 1 ? num * 100 : num;
      return `${percentValue.toFixed(2)}%`;
    },