WXL (wul)
2 天以前 a90765e9ee65717c6ba9923a90b3fc21c03753c1
src/views/followvisit/record/detailpage/index.vue
@@ -1465,6 +1465,7 @@
import {
  messagelistpatient,
  alterpatient,
  particularpatient,
  listcontactinformation,
} from "@/api/patient/homepage";
import CallButton from "@/components/CallButton";
@@ -1846,7 +1847,8 @@
    unansweredQuestions() {
      return (this.tableDatatop || [])
        .map((item, i) => ({ index: i + 1, title: item.scriptContent || "未命名题目", raw: item }))
        .filter((q) => !this.hasOptionValue(q.raw));
        // astrict=1 表示该题因选项跳转被跳过(已隐藏),跳过题不算“未作答”
        .filter((q) => !q.raw.astrict && !this.hasOptionValue(q.raw));
    },
    callStatusText() {
      if (this.customCallStatus) {
@@ -2043,6 +2045,35 @@
        const newPos = start + text.length;
        target.setSelectionRange(newPos, newPos);
      });
      // 快捷语包含“死亡”时,过滤排除该患者
      if (text && text.includes("死亡")) {
        this.filterDeathPatient(text);
      }
    },
    // 快捷语包含“死亡”时过滤排除患者(参考 discharge 页患者过滤)
    filterDeathPatient(text) {
      this.$modal
        .confirm(
          "该快捷语包含“死亡”,确认将该患者过滤排除吗?过滤后该患者所有进行中任务将全部停止,且无法匹配新的随访任务,请谨慎操作!"
        )
        .then(() => {
          particularpatient(this.patid).then((response) => {
            const patient = response.data;
            patient.isoperation = 2;
            patient.notrequiredFlag = 1;
            patient.notrequiredreason = text;
            patient.filterDrname = store.getters.nickName;
            alterpatient(patient).then((res) => {
              if (res.code == 200) {
                this.$modal.msgSuccess("患者过滤成功");
              } else {
                this.$modal.msgError("患者过滤失败");
              }
            });
          });
        })
        .catch(() => {});
    },
    // 获取问卷数据
    getsearchrResults(id) {
@@ -2082,6 +2113,8 @@
          });
          this.taskname = res.data.taskName;
          this.overdata();
          // 根据已保存答案回放选项跳转逻辑,恢复被跳过题目的隐藏状态
          this.restoreJumpState();
        }
      });
    },
@@ -3252,6 +3285,63 @@
        }
      });
    },
    // 根据已保存答案回放“选项跳转”逻辑,恢复被跳过题目的隐藏状态(astrict)
    restoreJumpState() {
      const list = this.tableDatatop;
      if (!list || !list.length) return;
      // 先全部置为可见
      list.forEach((item) => {
        this.$set(item, "astrict", 0);
        this.$set(item, "hiddenByEnd", false);
      });
      for (let i = 0; i < list.length; ) {
        const q = list[i];
        let jumped = false;
        // 只有“单选 + 由选项配置跳转”且已作答的题目才可能产生跳转
        if (q.branchFlag == 1 && q.scriptType == 1 && this.hasOptionValue(q)) {
          const opt = (q.svyTaskTemplateTargetoptions || []).find(
            (o) => o.optioncontent == q.scriptResult
          );
          const next = opt ? opt.nextQuestion : null;
          if (next !== null && next !== undefined && next !== "") {
            const targetNum = Number(next);
            // 结束问答:隐藏后面所有题
            if (targetNum === 0) {
              for (let j = i + 1; j < list.length; j++) {
                this.$set(list[j], "astrict", 1);
                this.$set(list[j], "hiddenByEnd", true);
              }
              break;
            }
            const target = targetNum - 1; // 转 0-indexed
            if (target > i && target < list.length) {
              // 隐藏当前题和目标题之间的题
              for (let j = i + 1; j < target; j++) {
                this.$set(list[j], "astrict", 1);
                this.$set(list[j], "hiddenByEnd", false);
              }
              // 目标题保持可见
              this.$set(list[target], "astrict", 0);
              this.$set(list[target], "hiddenByEnd", false);
              i = target;
              jumped = true;
            }
          }
        }
        if (!jumped) {
          i++;
        }
      }
      this.$forceUpdate();
    },
    // 切换随访类型后,重置医生处理意见的校验状态(必填条件随类型变化)
    handleResourceChange() {
      this.$nextTick(() => {