WXL (wul)
昨天 d3c60e18b95b50751f8088fa2d23cd8ff7f173bc
src/views/followvisit/record/detailpage/index.vue
@@ -362,7 +362,14 @@
                  ><i class="el-icon-notebook-1"></i> 问卷随访结果</span
                >
                <div class="CONTENT">
                  <div class="title">{{ taskname ? taskname : "问卷" }}</div>
                  <div class="title">
                    {{ taskname ? taskname : "问卷" }}
                    <span style="margin-left: 50px">
                      <el-button type="primary" round @click="smsSubTask">
                        问卷短信推送
                      </el-button>
                    </span>
                  </div>
                  <div class="preview-left" v-if="!Voicetype">
                    <div
@@ -1253,6 +1260,7 @@
  updateTemplate,
  query360PatInfonh,
  sendMsg,
  smsSubTask,
  getconfigKey,
} from "@/api/AiCentre/index";
import {
@@ -2143,6 +2151,25 @@
    handleTemplateClear() {
      console.log("清除了模板选择");
    },
    smsSubTask() {
      this.$modal
        .confirm("是否向患者通过短信推送文件内容?")
        .then(() => {
          console.log(11, this.id);
          smsSubTask(this.id).then((res) => {
            console.log(11);
            if (res.code) {
              this.$modal.msgSuccess("文件已通过短信推送给患者");
            } else {
            }
          });
        })
        .catch((err) => {
          console.log(err);
        });
    },
    handleConfirmReplace() {
      // 遍历所有题目(tableDatatop)
      this.tableDatatop.forEach((item) => {
@@ -2390,8 +2417,15 @@
    },
    // 调起短信发送对话框
    sendAgainmsg() {
      this.smsDialogVisible = true;
      // 可以在这里初始化 smsContent,例如 this.smsContent = '';
      // this.smsDialogVisible = true;
      this.$store.dispatch("sms/openSmsDialog", {
        name: this.form.sendname,
        age: this.form.age,
        phone: this.userform.telcode,
        deptName: this.form.deptname,
        wardName: this.form.leavehospitaldistrictname,
        smsTemplate: `尊敬的${this.form.sendname},您好!`,
      });
    },
    // 发送短信的方法
@@ -2468,7 +2502,7 @@
      });
    },
    alterpatient(sendstate) {
      this.Editsingletasksonyic(this.serviceStates)
      this.Editsingletasksonyic(this.serviceStates);
      // alterpatient(this.userform).then((res) => {
      //   if (res.code == 200) {
      //     this.$modal.msgSuccess("基础信息保存成功");
@@ -2867,38 +2901,38 @@
  //   console.log(11);
  // },
  beforeRouteLeave(to, from, next) {
  const callButton = this.$refs.callButton;
    const callButton = this.$refs.callButton;
  // 如果存在呼叫组件且正在通话中
  if (callButton && callButton.isCalling) {
    this.$confirm('当前正在通话中,确定要离开此页面吗?', '提示', {
      confirmButtonText: '挂断并离开',
      cancelButtonText: '继续通话',
      type: 'warning'
    })
      .then(() => {
        // 用户确认离开,主动挂断并清理
        callButton.cleanupResources();
        if (this.$refs.CallCenterLs) {
          this.$refs.CallCenterLs.handleSeatLogout();
        }
        next();
    // 如果存在呼叫组件且正在通话中
    if (callButton && callButton.isCalling) {
      this.$confirm("当前正在通话中,确定要离开此页面吗?", "提示", {
        confirmButtonText: "挂断并离开",
        cancelButtonText: "继续通话",
        type: "warning",
      })
      .catch(() => {
        // 用户取消,阻止路由跳转
        next(false);
      });
  } else {
    // 未通话或呼叫组件不存在,正常清理
    if (callButton) {
      callButton.cleanupResources();
        .then(() => {
          // 用户确认离开,主动挂断并清理
          callButton.cleanupResources();
          if (this.$refs.CallCenterLs) {
            this.$refs.CallCenterLs.handleSeatLogout();
          }
          next();
        })
        .catch(() => {
          // 用户取消,阻止路由跳转
          next(false);
        });
    } else {
      // 未通话或呼叫组件不存在,正常清理
      if (callButton) {
        callButton.cleanupResources();
      }
      if (this.$refs.CallCenterLs) {
        this.$refs.CallCenterLs.handleSeatLogout();
      }
      next();
    }
    if (this.$refs.CallCenterLs) {
      this.$refs.CallCenterLs.handleSeatLogout();
    }
    next();
  }
}
  },
  // beforeRouteUpdate() {
  //   console.log(33);
  // },