WXL (wul)
2 天以前 22bd207587899810e9afb4c1a53f0d5dae1e2ece
src/views/followvisit/record/detailpage/index.vue
@@ -628,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>
@@ -664,22 +664,47 @@
                  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>
@@ -1133,7 +1158,9 @@
      userid: "",
      currentPhoneNumber: "",
      callType: "", // 用于区分是哪个电话
      isSipRegistering: true, // SIP注册状态
      // 已有数据...
      customCallStatus: "", // 用于存储自定义状态文本
      callStatus: "idle", // idle, calling, connected, ended, failed
      isEndingCall: false,
      CaldialogVisible: false,
@@ -1173,8 +1200,12 @@
          value: "5",
        },
        {
          label: "其他情况不宜随访",
          label: "不宜随访被过滤",
          value: "6",
        },
        {
          label: "其他",
          value: "7",
        },
      ],
      tableDatatop: [], //题目表
@@ -1349,6 +1380,7 @@
          label: "一年后",
        },
      ],
      statusTimer: null,
      userform: {},
      smsDialogVisible: false, // 控制短信对话框显示
      smsContent: "", // 存储短信内容
@@ -1365,9 +1397,18 @@
      patid: null,
    };
  },
  // 在组件中添加销毁前的清理
  beforeUnmount() {
    if (this.statusTimer) {
      clearTimeout(this.statusTimer);
      this.statusTimer = null;
    }
  },
  computed: {
    callStatusText() {
      if (this.customCallStatus) {
        return this.customCallStatus;
      }
      const statusMap = {
        idle: "准备呼叫",
        calling: `正在呼叫 ${this.currentPhoneNumber}...`,
@@ -1401,12 +1442,35 @@
    this.getTaskservelist();
  },
  mounted() {
    // 监听子组件的sipStatus属性变化
    if (this.$refs.callButton) {
      this.$watch(
        () => this.$refs.callButton.sipStatus,
        (newStatus) => {
          if (this.statusTimer) {
            clearTimeout(this.statusTimer);
            this.statusTimer = null;
          }
          if (newStatus === "已注册") {
            this.statusTimer = setTimeout(() => {
              this.isSipRegistering = false;
              this.customCallStatus = ""; // 注册成功后清空自定义提示
              console.log("SIP注册成功,状态已更新");
            }, 2000);
            this.isSipRegistering = false;
          } else if (newStatus === "注册失败" || newStatus === "未连接") {
            this.isSipRegistering = true;
            this.customCallStatus = "呼叫中断,资源重新加载中请稍等3s重新。";
          }
        },
        { immediate: true } // 立即执行一次以获取初始值
      );
    }
  },
  methods: {
    // 获取主题样式类
    getTopicClass(item) {
      console.log(item.isabnormal,'111');
      // 根据状态值返回对应的样式类
      if (item.isabnormal == 1) {
        return "scriptTopic-isabnormal"; // 异常 - 红色
@@ -1542,8 +1606,6 @@
    },
    // 检查随访日期是否有效
    checkFollowupDate(date) {
      console.log(date);
      if (!date) {
        this.form.date1 = "";
        this.$refs.zcform.clearValidate(["date1"]);
@@ -1670,7 +1732,10 @@
            }
          });
          this.Editsingletasksonyic(6);
          if (this.visitCount != 1) {
            this.Torouter();
            return;
          }
          this.$modal
            .confirm(
              '任务保存成功是否针对患者:"' +
@@ -1692,33 +1757,36 @@
              this.dialogFormVisible = true;
            })
            .catch(() => {
              if (this.form.serviceType == 13) {
                if (this.visitCount != 1) {
                  this.$router.push({
                    path: "/logisticsservice/zbAgain",
                  });
                } else {
                  this.$router.push({
                    path: "/logisticsservice/record",
                  });
                }
              } else if (this.form.serviceType == 2) {
                if (this.visitCount != 1) {
                  this.$router.push({
                    path: "/logisticsservice/again",
                  });
                } else {
                  this.$router.push({
                    path: "/followvisit/discharge",
                  });
                }
              }
              this.Torouter();
            });
        })
        .catch((error) => {
          // 如果有任何一个异步操作失败,会进入这里
          console.error("发生错误:", error);
        });
    },
    Torouter() {
      if (this.form.serviceType == 13) {
        if (this.visitCount != 1) {
          this.$router.push({
            path: "/logisticsservice/zbAgain",
          });
        } else {
          this.$router.push({
            path: "/logisticsservice/record",
          });
        }
      } else if (this.form.serviceType == 2) {
        if (this.visitCount != 1) {
          this.$router.push({
            path: "/logisticsservice/again",
          });
        } else {
          this.$router.push({
            path: "/followvisit/discharge",
          });
        }
      }
    },
    // 电话============================
    // 验证电话号码格式并返回错误信息
@@ -1761,22 +1829,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;
          }
        });
      });
    },
@@ -1837,7 +1917,10 @@
        param2: this.patid,
        subId: this.id,
      };
      if (this.visitCount != 1) {
        this.Torouter();
        return;
      }
      addPersonVoices(obj).then((res) => {
        if (res.code == 200) {
          this.$modal.msgSuccess("服务保存成功");
@@ -1862,27 +1945,7 @@
              this.dialogFormVisible = true;
            })
            .catch(() => {
              if (this.form.serviceType == 13) {
                if (this.visitCount != 1) {
                  this.$router.push({
                    path: "/logisticsservice/zbAgain",
                  });
                } else {
                  this.$router.push({
                    path: "/logisticsservice/record",
                  });
                }
              } else if (form.serviceType == 2) {
                if (this.visitCount != 1) {
                  this.$router.push({
                    path: "/followvisit/again",
                  });
                } else {
                  this.$router.push({
                    path: "/followvisit/discharge",
                  });
                }
              }
              this.Torouter();
            });
        }
      });
@@ -2053,10 +2116,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) {
@@ -2232,7 +2319,8 @@
          astrict: index === questionIndex + 1 ? 0 : item.astrict,
          hiddenByEnd: index === questionIndex + 1 ? false : item.hiddenByEnd,
        }));
      }2
      }
      2;
      this.$forceUpdate();
    },
@@ -2400,15 +2488,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;
}
@@ -2425,6 +2516,7 @@
  padding: 2px 6px;
  border-radius: 4px;
}
.call-container {
  padding: 20px;
  background: #fff;
@@ -2454,11 +2546,13 @@
    margin-top: 20px;
  }
}
.merge-controls {
  background: #f5f7fa;
  border-radius: 4px;
  margin-left: 20px;
}
.Followuserinfo {
  margin: 10px 10px 0 10px;
  align-items: center;
@@ -2492,8 +2586,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;
@@ -2513,11 +2609,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;
@@ -2525,6 +2625,7 @@
  border-radius: 4px;
  border: 1px solid #dcdfe6;
}
.borderdiv {
  min-height: 60vh;
  font-size: 20px;
@@ -2563,14 +2664,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: 738px; /* 设置最小高度 */
  min-height: 738px;
  /* 设置最小高度 */
  .title {
    font-size: 22px;
@@ -2585,8 +2783,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: 618px; /* 设置最大高度 */
  overflow-y: auto; /* 内容超过高度时显示滚动条 */
  max-height: 618px;
  /* 设置最大高度 */
  overflow-y: auto;
  /* 内容超过高度时显示滚动条 */
  .topic-dev {
    margin-bottom: 25px;
@@ -2642,8 +2842,8 @@
/* 新增:警告状态样式 - 黄色 */
.scriptTopic-warning {
  color: #d4be00; /* 您指定的黄色 */
  color: #d4be00;
  /* 您指定的黄色 */
}
/* 异常选项样式 - 红色星号 (保持不变) */
@@ -2671,7 +2871,8 @@
  ::v-deep.el-radio__label::after {
    content: "*";
    color: #ffe202; /* 黄色星号 */
    color: #ffe202;
    /* 黄色星号 */
    position: absolute;
    right: -5px;
    top: 0;
@@ -2697,6 +2898,7 @@
  right: -5px;
  top: 0;
}
.tag-selector-container {
  display: flex;
  align-items: center;
@@ -2733,9 +2935,11 @@
.tag-normal {
  background-color: #7ff5e1;
}
.tag-abnormal {
  background-color: #f75c5c;
}
.tag-warning {
  background-color: #fbfb4a;
}
@@ -2745,6 +2949,7 @@
  color: #909399;
  cursor: pointer;
}
::v-deep.offside-value .el-radio__label {
  color: #fff;
}
@@ -2794,6 +2999,7 @@
  color: #080808 !important;
  cursor: not-allowed;
}
/* 原有的样式保持不变,添加以下响应式代码 */
.Followupdetailspage {
@@ -2805,7 +3011,8 @@
.action-container {
  display: flex;
  flex-direction: row; /* 默认横向排列 */
  flex-direction: row;
  /* 默认横向排列 */
  gap: 20px;
  margin: 0 10px 20px 10px;
@@ -2948,7 +3155,8 @@
/* 确保内容在缩放时保持可读性 */
.headline {
  font-size: clamp(18px, 2vw, 24px); /* 使用clamp函数确保字体大小在合理范围内 */
  font-size: clamp(18px, 2vw, 24px);
  /* 使用clamp函数确保字体大小在合理范围内 */
}
/* 为移动设备优化滚动体验 */