WXL (wul)
4 天以前 ec47fecd41a22861c3fc65ca86311225dd28d7ee
src/views/followvisit/record/detailpage/index.vue
@@ -302,7 +302,7 @@
                              handleOptionChange(
                                $event,
                                index,
                                item.svyLibTemplateTargetoptions,
                                item.svyTaskTemplateTargetoptions,
                                item
                              )
                            "
@@ -310,7 +310,7 @@
                            <el-radio
                              v-for="(
                                items, indexs
                              ) in item.svyLibTemplateTargetoptions"
                              ) in item.svyTaskTemplateTargetoptions"
                              :class="items.isabnormal ? 'red-star' : ''"
                              :key="indexs"
                              :label="items.optioncontent"
@@ -363,7 +363,7 @@
                              @change="$forceUpdate()"
                              v-for="(
                                items, indexs
                              ) in item.svyLibTemplateTargetoptions"
                              ) in item.svyTaskTemplateTargetoptions"
                              :key="indexs"
                              :label="items.optioncontent"
                            >
@@ -437,10 +437,11 @@
                          >
                            <el-radio
                              v-for="(items, index) in item.scriptResult"
                              :key="items"
                              :key="index"
                              :label="items"
                              :class="items.isabnormal ? 'red-star' : ''"
                              @click.native.prevent="
                                handleRadioToggle(item, items.optioncontent)
                                handleRadioToggles(item, items)
                              "
                              >{{ items }}</el-radio
                            >
@@ -1532,7 +1533,7 @@
      console.log(date);
      if (!date) {
        this.form.date1 = '';
        this.form.date1 = "";
        this.$refs.zcform.clearValidate(["date1"]);
        return;
      }
@@ -1542,7 +1543,7 @@
      if (selectedDate < now) {
        this.$message.warning("随访时间不能早于当前日期");
        this.form.date1 = '';
        this.form.date1 = "";
        this.$refs.zcform.validateField("date1"); // 触发验证
      }
    },
@@ -1612,7 +1613,7 @@
            return;
          }
        }
        var objs = item.svyLibTemplateTargetoptions.find(
        var objs = item.svyTaskTemplateTargetoptions.find(
          (items) => items.optioncontent == item.scriptResult
        );
        if (obj) {
@@ -2046,10 +2047,10 @@
        .confirm('是否查看任务为"' + row.taskName + '"的服务详情数据?')
        .then(() => {
          let type = "";
      console.log(row, "rwo");
        if (row.type == 1) {
          type = 1;
        }
          console.log(row, "rwo");
          if (row.type == 1) {
            type = 1;
          }
          this.taskid = row.taskid;
          this.id = row.id;
          this.patid = row.patid;
@@ -2076,7 +2077,7 @@
          (item) => item.optioncontent == a
        );
      } else {
        var obj = this.tableDatatop[b].svyLibTemplateTargetoptions.find(
        var obj = this.tableDatatop[b].svyTaskTemplateTargetoptions.find(
          (item) => item.optioncontent == a
        );
      }
@@ -2089,6 +2090,8 @@
    },
    // 新增的切换选中/取消选中方法
    handleRadioToggle(questionItem, optionValue) {
      console.log(questionItem, optionValue, 999);
      // 如果点击的是当前已选中的选项,则取消选中
      if (questionItem.scriptResult === optionValue) {
        questionItem.scriptResult = ""; // 清空选中值
@@ -2104,8 +2107,28 @@
        // 后续的跳转等复杂逻辑会在 handleOptionChange 中正常执行
      }
    },
    handleRadioToggles(questionItem, optionValue) {
      if (!questionItem.matchedtext) {
        questionItem.matchedtext == "";
      }
      // 如果点击的是当前已选中的选项,则取消选中
      if (questionItem.matchedtext == optionValue) {
        this.$set(questionItem, "matchedtext", "");
        // 同时重置与选项相关的状态
        questionItem.isabnormal = false;
        questionItem.showAppendInput = false;
        // 注意:取消选中时,我们通常不希望触发题目跳转逻辑,所以直接返回
        // 如果需要,可以在这里添加取消选中后的特定逻辑,例如重置题目序列
      } else {
        // 如果点击的是未选中的选项,则通过更改绑定值来触发原始的 handleOptionChange 方法
        // 这里只需要改变 v-model 绑定的值,change事件会自动触发
        this.$set(questionItem, "matchedtext", optionValue); // 后续的跳转等复杂逻辑会在 handleOptionChange 中正常执行
      }
    },
    // 在methods部分,修改handleOptionChange方法:
    handleOptionChange(selectedOption, questionIndex, options, a) {
      console.log(selectedOption, questionIndex, options, a, "888");
      if (document.activeElement) {
        document.activeElement.blur();
      }
@@ -2198,7 +2221,7 @@
    },
    overdata() {
      this.tableDatatop.forEach((item, index) => {
        var obj = item.svyLibTemplateTargetoptions.find(
        var obj = item.svyTaskTemplateTargetoptions.find(
          (items) => items.optioncontent == item.scriptResult
        );
        if (obj) {