WXL (wul)
16 小时以前 a9d2b856e0f6be6475319c2dc36bf405c2f908fc
src/views/followvisit/discharge/index.vue
@@ -243,6 +243,17 @@
            </div>
          </div>
        </el-col>
        <div class="color-legend">
          <span class="legend-item" v-if="orgname == '南华大学附属第一医院'">
            <span class="legend-block legend-blue"></span>未到随访时间
          </span>
          <span class="legend-item">
            <span class="legend-block legend-red"></span>填报内容存在异常
          </span>
          <span class="legend-item">
            <span class="legend-block legend-yellow"></span>填报内容存在警告
          </span>
        </div>
      </el-row>
      <div class="selected-info">
        已选中
@@ -1500,6 +1511,8 @@
        value: dept.districtCode,
      };
    });
    // 免登直达:根据科室/病区编码预填患者范围
    this.applyFollowUpScope();
    if (this.errtype == 1) {
      this.toleadExport(2);
    } else if (this.errtype == 2) {
@@ -1546,7 +1559,7 @@
    async getList(refresh) {
      // 默认全部
      this.applyDeptWardScope();
      if (this.endOut == 0) {
      if (this.endOut == 0 && !this.topqueryParams.endSendDateTime) {
        this.topqueryParams.endSendDateTime = this.formatDateToYYYYMMDDHHMMSS(
          this.getEndOfDay()
        );
@@ -1714,8 +1727,10 @@
    onthatday() {
      this.resetQuerykj();
      this.topqueryParams.startSendDateTime = this.getCurrentDate();
      this.topqueryParams.endSendDateTime = this.getCurrentDate();
      this.topqueryParams.sendstateView = 1; // 待随访
      this.topqueryParams.sendstate = null;
      this.topqueryParams.startSendDateTime = null;
      this.topqueryParams.endSendDateTime = this.getCurrentDate(); // 开始随访日期 <= 今天
      this.getList(1);
    },
    getCurrentDate() {
@@ -1724,10 +1739,12 @@
    },
    buidegetTasklist(type) {
      if (type) {
        this.resetQuerykj();
      }
      this.applyDeptWardScope();
      // 用户权限下所有待随访任务:传递全部科室和病区
      this.topqueryParams.leaveldeptcodes = store.getters.belongDepts.map(
        (obj) => obj.deptCode
      );
      this.topqueryParams.leavehospitaldistrictcodes =
        store.getters.belongWards.map((obj) => obj.districtCode);
      // 接受异常跳转
      if (this.errtype) {
        this.topqueryParams.leavehospitaldistrictcodes.push(
@@ -1739,7 +1756,7 @@
        pageSize: 10,
        leavehospitaldistrictcodes:
          this.topqueryParams.leavehospitaldistrictcodes,
        sendstates: [2, 3],
        sendstateView: 1,
        leaveldeptcodes: this.topqueryParams.leaveldeptcodes,
      };
      buidegetTasklist(obj).then((response) => {
@@ -1836,6 +1853,7 @@
    /** 搜索按钮操作 */
    handleQuery(refresh) {
      this.applyDeptWardScope();
      this.clearAllSelection();
      this.topqueryParams.pageNum = 1;
      // 判断是不是工作台快捷查询
      if (this.errtype != 2) {
@@ -1845,6 +1863,17 @@
        this.topqueryParams.endSendDateTime = this.dateRangefs[1];
      }
      this.getList(refresh);
    },
    // 免登直达:根据路由中的科室/病区编码预填患者范围
    applyFollowUpScope() {
      const deptCode = this.$route.query.followUpDeptCode;
      const wardCode = this.$route.query.followUpWardCode;
      if (!deptCode && !wardCode) return;
      const scope = [];
      if (deptCode) scope.push([1, deptCode]);
      if (wardCode) scope.push([2, wardCode]);
      this.topqueryParams.scopetype = scope;
      this.lastScopeType = deptCode ? 1 : 2;
    },
    // 患者范围处理:从多选级联 scopetype 解析科室/病区
    applyDeptWardScope() {
@@ -2309,14 +2338,41 @@
        this.getList();
      });
    },
    // 异常列渲染
    // 行颜色渲染:蓝色(未到随访时间) / 红色(异常) / 黄色(警告)
    tableRowClassName({ row, rowIndex }) {
      // 当前时间小于应随访时间且任务状态为待随访 → 整行蓝色(南华大学附属第一医院不生效)
      if (
        this.orgname == "南华大学附属第一医院" &&
        row.sendstate == 2 &&
        this.isBeforeVisitTime(row.visitTime)
      ) {
        return "blue-row";
      }
      if (row.excep == 1) {
        return "warning-row";
      } else if (row.excep == 2) {
        return "remind-row";
      }
      return "";
    },
    // 判断当前时间是否早于应随访时间(按“天”比较)
    isBeforeVisitTime(visitTime) {
      if (!visitTime) return false;
      let date;
      if (typeof visitTime === "number") {
        date = new Date(visitTime);
      } else {
        date = new Date(String(visitTime).replace(/-/g, "/"));
      }
      if (isNaN(date.getTime())) return false;
      const now = new Date();
      const today = new Date(now.getFullYear(), now.getMonth(), now.getDate());
      const visitDay = new Date(
        date.getFullYear(),
        date.getMonth(),
        date.getDate()
      );
      return today.getTime() < visitDay.getTime();
    },
    restoreSelection() {
      if (!this.$refs.userform) {
@@ -2549,12 +2605,46 @@
::v-deep.el-table .remind-row {
  background: #fcf5aa;
}
::v-deep.el-table .blue-row {
  background: #c6e2ff;
}
.documentf {
  display: flex;
  justify-content: flex-end;
}
.color-legend {
  float: right;
  display: flex;
  align-items: center;
  height: 40px;
  gap: 16px;
  margin-right: 5px;
}
.legend-item {
  display: inline-flex;
  align-items: center;
  font-size: 16px;
  color: #666;
}
.legend-block {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  margin-right: 6px;
}
.legend-blue {
  background: #9cc9fa;
}
.legend-red {
  background: #f1aaaa;
}
.legend-yellow {
  background: #faf18d;
}
.download {
  text-align: center;