WXL (wul)
6 天以前 a5cba9ab040f6f97558046885dce3017f9bab7e9
src/views/sfstatistics/percentage/index.vue
@@ -75,10 +75,25 @@
            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>
        <el-form-item label-width="200" label="出院时间范围" prop="userName">
          <el-date-picker
            v-model="queryParams.dateRangecy"
            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>
@@ -117,6 +132,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"
@@ -164,6 +194,7 @@
    <ChartDialog
      :visible="chartDialogVisible"
      :data="chartData"
      :statisticaltype="queryParams.statisticaltype"
      :active-tab="activeTab"
      @close="chartDialogVisible = false"
    />
@@ -198,11 +229,11 @@
import ChartDialog from "./components/ChartDialog.vue";
import DetailDialog from "./components/DetailDialog.vue";
import TimelyRateDialog from "./components/TimelyRateDialog.vue";
import CombinedFollowUp from "./components/CombinedFollowUp.vue";
import { getSfStatisticsHyperlink } from "@/api/AiCentre/index";
export default {
  name: "FollowUpStatistics",
  name: "Percentage",
  components: {
    FirstFollowUp,
    SecondFollowUp,
@@ -210,6 +241,7 @@
    ChartDialog,
    DetailDialog,
    TimelyRateDialog,
    CombinedFollowUp,
  },
  data() {
    return {
@@ -222,10 +254,46 @@
      options: this.$store.getters.tasktypes,
      queryParams: {
        serviceType: [2],
        dateRange: [],
        statisticaltype: 1,
        dateRange: this.getLastMonthRange(),
        dateRangecy: [],
        statisticaltype:
          localStorage.getItem("orgname") == "缙云县人民医院" ||
          localStorage.getItem("orgname") == "景宁畲族自治县人民医院"
            ? 2
            : 1,
        leavehospitaldistrictcodes: ["all"],
        deptcodes: [],
        deptcodes: ["all"],
      },
      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 +349,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();
@@ -298,6 +388,9 @@
        case "continued":
          this.$refs.continuedCare.loadData();
          break;
        case "combined":
          this.$refs.combinedFollowUp.loadData();
          break;
      }
    },
@@ -306,7 +399,12 @@
        this.queryParams.dateRange[0]
      );
      this.queryParams.endTime = this.parseTime(this.queryParams.dateRange[1]);
      this.queryParams.hospitalStartTime = this.parseTime(
        this.queryParams.dateRangecy[0]
      );
      this.queryParams.hospitalEndTime = this.parseTime(
        this.queryParams.dateRangecy[1]
      );
      if (this.queryParams.statisticaltype == 1) {
        this.queryParams.deptcodes = [];
      } else if (this.queryParams.statisticaltype == 2) {
@@ -333,6 +431,9 @@
        case "continued":
          await this.$refs.continuedCare.exportTable();
          break;
        case "combined":
          await this.$refs.combinedFollowUp.exportTable();
          break;
      }
    },
@@ -349,6 +450,8 @@
          return this.$refs.secondFollowUp.tableData;
        case "continued":
          return this.$refs.continuedCare.tableData;
        case "combined":
          return this.$refs.combinedFollowUp.tableData;
        default:
          return [];
      }
@@ -372,6 +475,9 @@
        obj.deptcodes = [row.deptcode];
        obj.leavehospitaldistrictcodes = [];
      }
      obj.endTime = this.queryParams.endTime;
      obj.startTime = this.queryParams.startTime;
      obj.statisticaltype = this.queryParams.statisticaltype;
      getSfStatisticsHyperlink(obj).then((response) => {
        this.infotitlelist = response.data;