WXL (wul)
2026-11-09 b4fe2c16274a91fee4fb26d91374f95fbe2dbcec
src/views/sfstatistics/percentage/index.vue
@@ -14,6 +14,7 @@
          <el-select
            v-model="queryParams.statisticaltype"
            placeholder="请选择统计类型"
            @change="handleQuery"
          >
            <el-option
              v-for="item in Statisticallist"
@@ -57,8 +58,7 @@
        <el-form-item label="服务类型" prop="userName">
          <el-select
            v-model="queryParams.serviceType"
            multiple
            v-model="serviceTypeSingle"
            placeholder="请选择"
          >
            <el-option
@@ -66,6 +66,25 @@
              :key="item.value"
              :label="item.label"
              :value="item.value"
            />
          </el-select>
        </el-form-item>
        <el-form-item label="任务" prop="taskIds">
          <el-select
            v-model="queryParams.taskIds"
            multiple
            filterable
            clearable
            collapse-tags
            placeholder="请选择任务"
            style="width: 220px"
          >
            <el-option
              v-for="item in taskList"
              :key="item.taskid"
              :label="item.taskName"
              :value="item.taskid"
            />
          </el-select>
        </el-form-item>
@@ -132,6 +151,21 @@
    <!-- Tab切换区域 -->
    <div class="tab-section">
      <el-tabs v-model="activeTab" @tab-click="handleTabClick">
        <el-tab-pane
          label="综合统计"
          v-if="orgname == '丽水市中医院'"
          name="combined"
        >
          <CombinedFollowUp
            ref="combinedFollowUp"
            :query-params="queryParams"
            :flat-array-hospit="flatArrayhospit"
            :flat-array-dept="flatArraydept"
            :options="options"
            :orgname="orgname"
            @view-details="viewDetails"
          />
        </el-tab-pane>
        <el-tab-pane label="首次随访" name="first">
          <FirstFollowUp
            ref="firstFollowUp"
@@ -179,6 +213,7 @@
    <ChartDialog
      :visible="chartDialogVisible"
      :data="chartData"
      :statisticaltype="queryParams.statisticaltype"
      :active-tab="activeTab"
      @close="chartDialogVisible = false"
    />
@@ -213,8 +248,8 @@
import ChartDialog from "./components/ChartDialog.vue";
import DetailDialog from "./components/DetailDialog.vue";
import TimelyRateDialog from "./components/TimelyRateDialog.vue";
import { getSfStatisticsHyperlink } from "@/api/AiCentre/index";
import CombinedFollowUp from "./components/CombinedFollowUp.vue";
import { getSfStatisticsHyperlink, getTasklist } from "@/api/AiCentre/index";
export default {
  name: "Percentage",
@@ -225,6 +260,7 @@
    ChartDialog,
    DetailDialog,
    TimelyRateDialog,
    CombinedFollowUp,
  },
  data() {
    return {
@@ -237,11 +273,19 @@
      options: this.$store.getters.tasktypes,
      queryParams: {
        serviceType: [2],
        dateRange: this.getLastMonthRange(),
        dateRangecy: [],
        statisticaltype: 1,
        dateRange:
          localStorage.getItem("orgname") == "丽水市中医院"
            ? this.getLastMonthRange()
            : [],
        dateRangecy: '',
        statisticaltype:
          localStorage.getItem("orgname") == "缙云县人民医院" ||
          localStorage.getItem("orgname") == "景宁畲族自治县人民医院"
            ? 2
            : 1,
        leavehospitaldistrictcodes: ["all"],
        deptcodes: [],
        deptcodes: ["all"],
        taskIds: [],
      },
      pickerOptions: {
        shortcuts: [
@@ -276,6 +320,7 @@
      },
      flatArrayhospit: [],
      flatArraydept: [],
      taskList: [],
      allDeptCodes: [],
      allWardCodes: [],
      showSearch: true,
@@ -297,8 +342,29 @@
      },
    };
  },
  computed: {
    // 服务类型单选:UI 绑定单值,内部仍以数组形式传给后端
    serviceTypeSingle: {
      get() {
        const st = this.queryParams.serviceType;
        return Array.isArray(st) ? st[0] : st;
      },
      set(val) {
        this.queryParams.serviceType = val == null || val === "" ? [] : [val];
      },
    },
  },
  created() {
    this.getDeptTree();
    // 当前机构为丽水市中医院时,应随访时间范围默认最近一个月并直接应用
    if (localStorage.getItem("orgname") == "丽水市中医院") {
      this.queryParams.startTime = this.parseTime(
        this.queryParams.dateRange[0]
      );
      this.queryParams.endTime = this.parseTime(
        this.queryParams.dateRange[1]
      );
    }
    this.loadCurrentTabData();
  },
  methods: {
@@ -327,6 +393,11 @@
      this.flatArraydept.push({ label: "全部", value: "all" });
      this.flatArrayhospit.push({ label: "全部", value: "all" });
      // 任务列表(用于任务筛选)
      getTasklist({ pageNum: 1, pageSize: 100 }).then((response) => {
        this.taskList = response.rows || [];
      });
    },
    // 添加获取最近一个月时间范围的方法
    getLastMonthRange() {
@@ -367,10 +438,16 @@
        case "continued":
          this.$refs.continuedCare.loadData();
          break;
        case "combined":
          this.$refs.combinedFollowUp.loadData();
          break;
      }
    },
    handleQuery() {
      if (!this.queryParams.dateRange) this.queryParams.dateRange = [];
      if (!this.queryParams.dateRangecy) this.queryParams.dateRangecy = [];
      this.queryParams.startTime = this.parseTime(
        this.queryParams.dateRange[0]
      );
@@ -393,6 +470,7 @@
    resetQuery() {
      this.queryParams.dateRange = [];
      this.queryParams.leavehospitaldistrictcodes = [];
      this.queryParams.taskIds = [];
      this.handleQuery();
    },
@@ -406,6 +484,9 @@
          break;
        case "continued":
          await this.$refs.continuedCare.exportTable();
          break;
        case "combined":
          await this.$refs.combinedFollowUp.exportTable();
          break;
      }
    },
@@ -423,6 +504,8 @@
          return this.$refs.secondFollowUp.tableData;
        case "continued":
          return this.$refs.continuedCare.tableData;
        case "combined":
          return this.$refs.combinedFollowUp.tableData;
        default:
          return [];
      }
@@ -439,6 +522,7 @@
      if (type == 1) {
        obj.drcode = row.drcode;
      }
      // 统计类型:病区统计(1)传病区code,科室统计(2)传科室code
      if (this.queryParams.statisticaltype == 1) {
        obj.leavehospitaldistrictcodes = [row.leavehospitaldistrictcode];
        obj.deptcodes = [];
@@ -446,8 +530,23 @@
        obj.deptcodes = [row.deptcode];
        obj.leavehospitaldistrictcodes = [];
      }
      obj.endTime = this.queryParams.endTime;
      obj.startTime = this.queryParams.startTime;
      // 应随访时间范围
      if (this.queryParams.endTime) {
        obj.endTime = this.queryParams.endTime;
        obj.startTime = this.queryParams.startTime;
      } else {
        obj.startTime = this.parseTime(this.queryParams.dateRange[0]);
        obj.endTime = this.parseTime(this.queryParams.dateRange[1]);
      }
      // 出院时间范围
      if (this.queryParams.hospitalEndTime) {
        obj.hospitalEndTime = this.queryParams.hospitalEndTime;
        obj.hospitalStartTime = this.queryParams.hospitalStartTime;
      } else {
        obj.hospitalStartTime = this.parseTime(this.queryParams.dateRangecy[0]);
        obj.hospitalEndTime = this.parseTime(this.queryParams.dateRangecy[1]);
      }
      obj.statisticaltype = this.queryParams.statisticaltype;
      getSfStatisticsHyperlink(obj).then((response) => {
@@ -483,6 +582,8 @@
    SeedetailsgGo(row) {
      this.SeedetailsVisible = false;
      this.infotitleVisible = false;
      let type = "";
      if (row.preachformson && row.preachformson.includes("3")) {
        type = 1;