WXL (wul)
2 天以前 43017c316ab6a2e11305a7f016b12d13736e8cc1
src/views/followvisit/record/detailpage/index.vue
@@ -282,11 +282,7 @@
                    >
                      <!-- 单选 -->
                      <div
                        :class="
                          item.isabnormal
                            ? 'scriptTopic-isabnormal'
                            : 'scriptTopic-dev'
                        "
                        :class="getTopicClass(item)"
                        :key="index"
                        v-if="item.scriptType == 1 && !item.astrict"
                      >
@@ -296,26 +292,21 @@
                          }}</span>
                        </div>
                        <div class="dev-xx">
                          <el-radio-group
                            v-model="item.scriptResult"
                            @change="
                              handleOptionChange(
                                $event,
                                index,
                                item.svyLibTemplateTargetoptions,
                                item
                              )
                            "
                          >
                          <el-radio-group v-model="item.scriptResult">
                            <el-radio
                              v-for="(
                                items, indexs
                              ) in item.svyLibTemplateTargetoptions"
                              :class="items.isabnormal ? 'red-star' : ''"
                              ) in item.svyTaskTemplateTargetoptions"
                              :class="getOptionClass(items)"
                              :key="indexs"
                              :label="items.optioncontent"
                              @click.native.prevent="
                                handleRadioToggle(item, items.optioncontent)
                                handleRadioToggle(
                                  item,
                                  index,
                                  item.svyTaskTemplateTargetoptions,
                                  items.optioncontent
                                )
                              "
                              >{{ items.optioncontent }}</el-radio
                            >
@@ -363,7 +354,7 @@
                              @change="$forceUpdate()"
                              v-for="(
                                items, indexs
                              ) in item.svyLibTemplateTargetoptions"
                              ) in item.svyTaskTemplateTargetoptions"
                              :key="indexs"
                              :label="items.optioncontent"
                            >
@@ -437,11 +428,9 @@
                          >
                            <el-radio
                              v-for="(items, index) in item.scriptResult"
                              :key="items"
                              :key="index"
                              :label="items"
                              @click.native.prevent="
                                handleRadioToggle(item, items.optioncontent)
                              "
                              :class="items.isabnormal ? 'red-star' : ''"
                              >{{ items }}</el-radio
                            >
                          </el-radio-group>
@@ -639,8 +628,8 @@
                        icon="el-icon-phone"
                        @click="handleCall(userform.telcode, 'tel')"
                        :disabled="!isValidPhone(userform.telcode)"
                      ></el-button
                    ></el-input> </el-form-item
                      ></el-button>
                    </el-input> </el-form-item
                ></el-col>
              </el-row>
              <el-row>
@@ -675,22 +664,44 @@
                  style="display: none"
                />
                <div v-if="callStatus === 'connected'" class="hangup-btn">
                <!-- 挂断按钮样式优化 -->
                <div v-if="callStatus === 'connected'" class="hangup-container">
                  <el-button
                    type="danger"
                    icon="el-icon-phone"
                    @click="endCurrentCall"
                    :loading="isEndingCall"
                    class="hangup-btn"
                    size="medium"
                  >
                    挂断电话
                    {{ isEndingCall ? "挂断中..." : "挂断电话" }}
                  </el-button>
                  <!-- 通话计时显示 -->
                  <div class="call-timer" v-if="callStartTime">
                    通话时长: {{ formatCallTime }}
                  </div>
                </div>
                <div class="call-status" v-if="callStatus !== 'idle'">
                <!-- 状态提示优化 -->
                <div class="call-status-container" v-if="callStatus !== 'idle'">
                  <el-alert
                    :title="callStatusText"
                    :type="callStatusType"
                    :closable="false"
                    show-icon
                    :class="['status-alert', `status-${callStatus}`]"
                  />
                </div>
                <!-- SIP注册状态提示 -->
                <div v-if="isSipRegistering&&orgname == '丽水市中医院'" class="sip-registering">
                  <el-alert
                    title="呼叫座机初始化中,请稍候..."
                    type="info"
                    :closable="false"
                    show-icon
                    class="registering-alert"
                  />
                </div>
              </div>
@@ -1030,10 +1041,7 @@
        :visible.sync="CaldialogVisible"
        width="60%"
      >
        <CallCenterLs
          ref="callCenterModal"
          :initial-phone="currentPhoneNumber"
        />
        <CallCenterLs ref="CallCenterLs" :initial-phone="currentPhoneNumber" />
      </el-dialog>
    </div>
  </div>
@@ -1147,11 +1155,15 @@
      userid: "",
      currentPhoneNumber: "",
      callType: "", // 用于区分是哪个电话
      isSipRegistering: true, // SIP注册状态
      // 已有数据...
      callStatus: "idle", // idle, calling, connected, ended, failed
      isEndingCall: false,
      CaldialogVisible: false,
      currentCall: null, // 当前通话对象
      // 路由监听相关
      routeWatcher: null,
      lastRoutePath: this.$route.path,
      input: "今天身体还不错",
      radio: "2",
      taskname: "",
@@ -1184,8 +1196,12 @@
          value: "5",
        },
        {
          label: "其他情况不宜随访",
          label: "不宜随访被过滤",
          value: "6",
        },
        {
          label: "其他",
          value: "7",
        },
      ],
      tableDatatop: [], //题目表
@@ -1376,6 +1392,7 @@
      patid: null,
    };
  },
  computed: {
    callStatusText() {
      const statusMap = {
@@ -1411,8 +1428,44 @@
    this.getTaskservelist();
  },
mounted() {
    // 监听子组件的sipStatus属性变化
    if (this.$refs.callButton) {
      this.$watch(
        () => this.$refs.callButton.sipStatus,
        (newStatus) => {
          if (newStatus === '已注册') {
            this.isSipRegistering = false;
          } else if (newStatus === '注册失败' || newStatus === '未连接') {
            this.isSipRegistering = true;
          }
        },
        { immediate: true } // 立即执行一次以获取初始值
      );
    }
  },
  methods: {
    // 获取主题样式类
    getTopicClass(item) {
      // 根据状态值返回对应的样式类
      if (item.isabnormal == 1) {
        return "scriptTopic-isabnormal"; // 异常 - 红色
      } else if (item.isabnormal == 2) {
        return "scriptTopic-warning"; // 警告 - 黄色
      } else {
        return "scriptTopic-dev"; // 正常 - 默认样式
      }
    },
    // 获取选项样式类
    getOptionClass(items) {
      if (items.isabnormal == 1) {
        return "red-star"; // 异常 - 红色星号
      } else if (items.isabnormal == 2) {
        return "yellow-star"; // 警告 - 黄色星号
      }
      return ""; // 正常 - 无特殊样式
    },
    // 获取问卷数据
    getsearchrResults(id) {
      getsearchrResults({
@@ -1532,7 +1585,7 @@
      console.log(date);
      if (!date) {
        this.form.date1 = '';
        this.form.date1 = "";
        this.$refs.zcform.clearValidate(["date1"]);
        return;
      }
@@ -1542,7 +1595,7 @@
      if (selectedDate < now) {
        this.$message.warning("随访时间不能早于当前日期");
        this.form.date1 = '';
        this.form.date1 = "";
        this.$refs.zcform.validateField("date1"); // 触发验证
      }
    },
@@ -1612,14 +1665,18 @@
            return;
          }
        }
        var objs = item.svyLibTemplateTargetoptions.find(
        var objs = item.svyTaskTemplateTargetoptions.find(
          (items) => items.optioncontent == item.scriptResult
        );
        if (obj) {
          if (objs.isabnormal) {
            excep = 1;
        if (objs) {
          if (excep != 1 && objs.isabnormal) {
            excep = objs.isabnormal;
            this.selectedTag = objs.isabnormal;
          }
        }
        console.log(excep, "excep");
        let obj = {
          asrtext: null,
          patid: this.patid,
@@ -1744,22 +1801,34 @@
        this.$message.error("请输入正确的手机号码");
        return;
      }
      // 检查SIP是否已注册
      this.currentPhoneNumber = phone;
      // 呼叫判断
      // 是否景宁呼叫
      if (this.orgname == "景宁畲族自治县人民医院") {
        this.CaldialogVisible = true;
        return;
      }
      // 下方是中医院呼叫
      if (this.isSipRegistering) {
        this.$message.warning("系统正在初始化,请稍候...");
        return;
      }
      this.callType = type;
      this.callStatus = "calling";
      this.$nextTick(() => {
        this.$refs.callButton.startCall();
        // 监听通话状态变化
        this.$refs.callButton.$on("call-status-change", (status) => {
          this.handleCallStatusChange(status);
          // 监听注册状态变化
          if (status.type === "registered") {
            this.isSipRegistering = false;
          }
          if (status.type === "failed" || status.type === "disconnected") {
            this.isSipRegistering = true;
          }
        });
      });
    },
@@ -1798,7 +1867,8 @@
    },
    yuyingetdetail() {
      const dataToSubmit = JSON.parse(JSON.stringify(this.tableDatatop));
      console.log(dataToSubmit, "dataToSubmit");
      // return;
      dataToSubmit.forEach((item, index) => {
        // 对拷贝的数据进行操作,不影响原始的 scriptResult 数组
        item.scriptResult = item.scriptResult.join("&");
@@ -2035,10 +2105,34 @@
    // 调起再次发送
    sendAgain() {
      document.querySelector("#app").scrollTo(0, 0);
      // scrollTo(0, 0)
      this.formtidy();
      this.dialogFormVisible = true;
      getTaskservelist({
        patid: this.patid,
        visitCount: 2,
        leaveldeptcodes: [this.form.deptcode],
      }).then((res) => {
        if (res.rows[0].serviceSubtaskList.length) {
          if (
            res.rows[0].serviceSubtaskList[0].sendstate != 5 &&
            res.rows[0].serviceSubtaskList[0].sendstate != 6
          ) {
            this.$modal
              .confirm(
                '本患者在"' +
                  res.rows[0].serviceSubtaskList[0].deptname +
                  '"科室下已有再次随访服务进行中是否继续创建?'
              )
              .then(() => {
                document.querySelector("#app").scrollTo(0, 0);
                this.formtidy();
                this.dialogFormVisible = true;
              });
          }
        } else {
          document.querySelector("#app").scrollTo(0, 0);
          this.formtidy();
          this.dialogFormVisible = true;
        }
      });
    },
    // 查看详情
    Seedetails(row) {
@@ -2046,10 +2140,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 +2170,7 @@
          (item) => item.optioncontent == a
        );
      } else {
        var obj = this.tableDatatop[b].svyLibTemplateTargetoptions.find(
        var obj = this.tableDatatop[b].svyTaskTemplateTargetoptions.find(
          (item) => item.optioncontent == a
        );
      }
@@ -2087,13 +2181,31 @@
      }
      this.$forceUpdate();
    },
    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 中正常执行
      }
    },
    // 新增的切换选中/取消选中方法
    handleRadioToggle(questionItem, optionValue) {
    handleRadioToggle(questionItem, index, options, optionValue) {
      // 如果点击的是当前已选中的选项,则取消选中
      if (questionItem.scriptResult === optionValue) {
        questionItem.scriptResult = ""; // 清空选中值
        // 同时重置与选项相关的状态
        questionItem.isabnormal = false;
        // questionItem.isabnormal = false;
        questionItem.showAppendInput = false;
        // 注意:取消选中时,我们通常不希望触发题目跳转逻辑,所以直接返回
        // 如果需要,可以在这里添加取消选中后的特定逻辑,例如重置题目序列
@@ -2101,11 +2213,15 @@
        // 如果点击的是未选中的选项,则通过更改绑定值来触发原始的 handleOptionChange 方法
        // 这里只需要改变 v-model 绑定的值,change事件会自动触发
        questionItem.scriptResult = optionValue;
        this.handleOptionChange(optionValue, index, options, questionItem);
        // 后续的跳转等复杂逻辑会在 handleOptionChange 中正常执行
      }
    },
    // 在methods部分,修改handleOptionChange方法:
    handleOptionChange(selectedOption, questionIndex, options, a) {
      console.log(selectedOption, questionIndex, options, a, "888");
      if (document.activeElement) {
        document.activeElement.blur();
      }
@@ -2117,7 +2233,7 @@
      // 处理异常状态高亮
      this.tableDatatop[questionIndex].isabnormal =
        !!selectedOptionObj.isabnormal;
        selectedOptionObj.isabnormal;
      // 处理附加输入框显示
      this.tableDatatop[questionIndex].showAppendInput =
@@ -2193,19 +2309,18 @@
          hiddenByEnd: index === questionIndex + 1 ? false : item.hiddenByEnd,
        }));
      }
      2;
      this.$forceUpdate();
    },
    overdata() {
      this.tableDatatop.forEach((item, index) => {
        var obj = item.svyLibTemplateTargetoptions.find(
        var obj = item.svyTaskTemplateTargetoptions.find(
          (items) => items.optioncontent == item.scriptResult
        );
        if (obj) {
          if (obj.isabnormal) {
            this.tableDatatop[index].isabnormal = true;
          } else {
            this.tableDatatop[index].isabnormal = false;
            this.tableDatatop[index].isabnormal = obj.isabnormal;
          }
          this.$forceUpdate();
        }
@@ -2333,6 +2448,11 @@
  // },
  beforeRouteLeave(to, from, next) {
    this.$refs.callButton.cleanupResources();
    if (this.$refs.CallCenterLs) {
      console.log(1);
      this.$refs.CallCenterLs.handleSeatLogout();
    }
    next(); // 确保调用 nex
  },
  // beforeRouteUpdate() {
@@ -2357,15 +2477,18 @@
  .manual-action {
    flex: 1;
    min-width: 0;
    height: 100%; /* 确保高度继承 */
    height: 100%;
    /* 确保高度继承 */
  }
  .call-action {
    width: 60%;
    min-width: 0;
    height: 100%; /* 确保高度继承 */
    height: 100%;
    /* 确保高度继承 */
  }
}
.numeric-input {
  position: relative;
}
@@ -2382,6 +2505,7 @@
  padding: 2px 6px;
  border-radius: 4px;
}
.call-container {
  padding: 20px;
  background: #fff;
@@ -2411,11 +2535,13 @@
    margin-top: 20px;
  }
}
.merge-controls {
  background: #f5f7fa;
  border-radius: 4px;
  margin-left: 20px;
}
.Followuserinfo {
  margin: 10px 10px 0 10px;
  align-items: center;
@@ -2449,8 +2575,10 @@
  background: #ffff;
  border: 1px solid #dcdfe6;
  box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.12), 0 0 6px 0 rgba(0, 0, 0, 0.04);
  height: 100%; /* 确保高度继承 */
  min-height: 880px; /* 最小高度与随访内容一致 */
  height: 100%;
  /* 确保高度继承 */
  min-height: 880px;
  /* 最小高度与随访内容一致 */
  display: flex;
  flex-direction: column;
@@ -2470,11 +2598,15 @@
  .el-form {
    flex: 1;
    overflow-y: auto; /* 内容超过高度时显示滚动条 */
    max-height: calc(880px - 60px); /* 减去padding */
    padding-right: 10px; /* 防止滚动条遮挡内容 */
    overflow-y: auto;
    /* 内容超过高度时显示滚动条 */
    max-height: calc(880px - 60px);
    /* 减去padding */
    padding-right: 10px;
    /* 防止滚动条遮挡内容 */
  }
}
.append-input-container {
  margin-top: 15px;
  padding: 10px;
@@ -2482,6 +2614,7 @@
  border-radius: 4px;
  border: 1px solid #dcdfe6;
}
.borderdiv {
  min-height: 60vh;
  font-size: 20px;
@@ -2520,14 +2653,111 @@
    }
  }
}
.topic-dev[inert] {
  opacity: 0.5;
  pointer-events: none;
}
/* 挂断容器样式 */
.hangup-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 15px 0;
}
.hangup-btn {
  width: 120px;
  height: 40px;
  font-size: 14px;
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(244, 67, 54, 0.3);
  transition: all 0.3s ease;
}
.hangup-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(244, 67, 54, 0.4);
}
/* 通话计时器 */
.call-timer {
  font-size: 12px;
  color: #666;
  background: #f5f5f5;
  padding: 4px 12px;
  border-radius: 12px;
  font-family: "Courier New", monospace;
}
/* 状态提示容器 */
.call-status-container {
  margin: 10px 0;
}
.status-alert {
  border-radius: 8px;
  transition: all 0.3s ease;
}
.status-alert.status-calling {
  border-left: 4px solid #e6a23c;
}
.status-alert.status-connected {
  border-left: 4px solid #67c23a;
  animation: pulse 2s infinite;
}
.status-alert.status-ended {
  border-left: 4px solid #909399;
}
/* SIP注册提示 */
.sip-registering {
  margin: 10px 0;
}
.registering-alert {
  border-radius: 8px;
  background-color: #f4f4f5;
  border-left: 4px solid #909399;
}
/* 动画效果 */
@keyframes pulse {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
  100% {
    opacity: 1;
  }
}
/* 响应式设计 */
@media (max-width: 768px) {
  .hangup-container {
    margin: 10px 0;
  }
  .hangup-btn {
    width: 100%;
    max-width: 200px;
  }
  .status-alert {
    font-size: 12px;
  }
}
.CONTENT {
  padding: 10px;
  height: 100%;
  min-height: 660px; /* 设置最小高度 */
  min-height: 738px;
  /* 设置最小高度 */
  .title {
    font-size: 22px;
@@ -2542,8 +2772,10 @@
  padding: 30px;
  border: 1px solid #dcdfe6;
  box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.12), 0 0 6px 0 rgba(0, 0, 0, 0.04);
  max-height: 580px; /* 设置最大高度 */
  overflow-y: auto; /* 内容超过高度时显示滚动条 */
  max-height: 618px;
  /* 设置最大高度 */
  overflow-y: auto;
  /* 内容超过高度时显示滚动条 */
  .topic-dev {
    margin-bottom: 25px;
@@ -2592,6 +2824,18 @@
  }
}
/* 异常状态样式 - 红色 (保持不变) */
.scriptTopic-isabnormal {
  color: red;
}
/* 新增:警告状态样式 - 黄色 */
.scriptTopic-warning {
  color: #d4be00;
  /* 您指定的黄色 */
}
/* 异常选项样式 - 红色星号 (保持不变) */
.red-star {
  ::v-deep.el-radio__label {
    position: relative;
@@ -2605,25 +2849,45 @@
    right: -5px;
    top: 0;
  }
}
  ::v-deep.el-input-group__textarea {
    white-space: pre-wrap;
    word-break: break-all;
  }
  ::v-deep.el-checkbox__label {
/* 新增:警告选项样式 - 黄色星号 */
.yellow-star {
  ::v-deep.el-radio__label {
    position: relative;
    padding-right: 10px;
  }
  ::v-deep.el-checkbox__label::after {
  ::v-deep.el-radio__label::after {
    content: "*";
    color: red;
    color: #ffe202;
    /* 黄色星号 */
    position: absolute;
    right: -5px;
    top: 0;
    font-weight: bold;
  }
}
/* 共用样式保持不变 */
::v-deep.el-input-group__textarea {
  white-space: pre-wrap;
  word-break: break-all;
}
::v-deep.el-checkbox__label {
  position: relative;
  padding-right: 10px;
}
::v-deep.el-checkbox__label::after {
  content: "*";
  color: red;
  position: absolute;
  right: -5px;
  top: 0;
}
.tag-selector-container {
  display: flex;
  align-items: center;
@@ -2660,9 +2924,11 @@
.tag-normal {
  background-color: #7ff5e1;
}
.tag-abnormal {
  background-color: #f75c5c;
}
.tag-warning {
  background-color: #fbfb4a;
}
@@ -2672,6 +2938,7 @@
  color: #909399;
  cursor: pointer;
}
::v-deep.offside-value .el-radio__label {
  color: #fff;
}
@@ -2721,6 +2988,7 @@
  color: #080808 !important;
  cursor: not-allowed;
}
/* 原有的样式保持不变,添加以下响应式代码 */
.Followupdetailspage {
@@ -2732,12 +3000,13 @@
.action-container {
  display: flex;
  flex-direction: row; /* 默认横向排列 */
  flex-direction: row;
  /* 默认横向排列 */
  gap: 20px;
  margin: 0 10px 20px 10px;
  /* 当缩放比例大于100%或屏幕宽度较小时改为上下排列 */
  @media screen and (max-width: 1200px), (min-resolution: 1dppx) {
  @media screen and (min-resolution: 1.5dppx) {
    flex-direction: column;
    .call-action,
@@ -2875,7 +3144,8 @@
/* 确保内容在缩放时保持可读性 */
.headline {
  font-size: clamp(18px, 2vw, 24px); /* 使用clamp函数确保字体大小在合理范围内 */
  font-size: clamp(18px, 2vw, 24px);
  /* 使用clamp函数确保字体大小在合理范围内 */
}
/* 为移动设备优化滚动体验 */
@@ -2893,9 +3163,8 @@
}
/* 缩放检测样式 */
@media screen and (min-resolution: 1.1dppx),
  screen and (-webkit-min-device-pixel-ratio: 1.1),
  screen and (max-width: 1200px) {
@media screen and (min-resolution: 1.5dppx),
  screen and (-webkit-min-device-pixel-ratio: 1.5) {
  .action-container {
    flex-direction: column;
  }