WXL (wul)
昨天 d3c60e18b95b50751f8088fa2d23cd8ff7f173bc
src/views/followvisit/record/detailpage/index.vue
@@ -107,6 +107,7 @@
                effect="dark"
                :content="scope.row.remark"
                placement="top-start"
                popper-class="statistics-tooltip"
              >
                <div v-if="scope.row.sendstateView == 1">
                  <el-tag type="primary" :disable-transitions="false"
@@ -114,22 +115,12 @@
                  >
                </div>
                <div v-if="scope.row.sendstateView == 2">
                  <el-tag type="primary" :disable-transitions="false"
                    >随访中</el-tag
                  >
                </div>
                <div v-if="scope.row.sendstateView == 3">
                  <el-tag type="warning" :disable-transitions="false"
                    >未完成</el-tag
                  >
                </div>
                <div v-if="scope.row.sendstateView == 4">
                  <el-tag type="success" :disable-transitions="false"
                    >已完成</el-tag
                  >
                </div>
                <div v-if="scope.row.sendstateView == 5">
                  <el-tag type="danger" :disable-transitions="false"
                <div v-if="scope.row.sendstateView == 3">
                  <el-tag type="warning" :disable-transitions="false"
                    >无需随访</el-tag
                  >
                </div>
@@ -144,7 +135,7 @@
            show-overflow-tooltip
          >
          </el-table-column>
            <el-table-column
          <el-table-column
            v-if="orgname == '南华大学附属第一医院'"
            label="入院日期"
            width="200"
@@ -182,7 +173,58 @@
            key="drname"
            prop="drname"
          />
          <el-table-column
            label="任务状态"
            align="center"
            key="sendstate"
            prop="sendstate"
            width="120"
          >
            <template slot-scope="scope">
              <el-tooltip
                class="item"
                effect="dark"
                :content="scope.row.remark"
                placement="top-start"
              >
                <div v-if="scope.row.sendstate == 1">
                  <el-tag type="primary" :disable-transitions="false"
                    >表单已领取</el-tag
                  >
                </div>
                <div v-if="scope.row.sendstate == 2">
                  <el-tag type="primary" :disable-transitions="false"
                    >待随访</el-tag
                  >
                </div>
                <div v-if="scope.row.sendstate == 3">
                  <el-tag type="success" :disable-transitions="false"
                    >表单已发送</el-tag
                  >
                </div>
                <div v-if="scope.row.sendstate == 4">
                  <el-tag type="info" :disable-transitions="false"
                    >不执行</el-tag
                  >
                </div>
                <div v-if="scope.row.sendstate == 5">
                  <el-tag type="danger" :disable-transitions="false"
                    >发送失败</el-tag
                  >
                </div>
                <div v-if="scope.row.sendstate == 6">
                  <el-tag type="success" :disable-transitions="false"
                    >已完成</el-tag
                  >
                </div>
                <div v-if="scope.row.sendstate == 7">
                  <el-tag type="danger" :disable-transitions="false"
                    >超时</el-tag
                  >
                </div>
              </el-tooltip>
            </template>
          </el-table-column>
          <el-table-column
            label="结果状态"
            align="center"
@@ -279,7 +321,12 @@
        <div class="call-container">
          <div
            style="display: flex"
            v-if="orgname == '南华大学附属第一医院' && !Voicetype"
            v-if="
              (orgname == '南华大学附属第一医院' ||
                orgname == '丽水市第二人民医院' ||
                orgname == '缙云县人民医院') &&
              !Voicetype
            "
          >
            <template-selector
              v-model="form.templateid"
@@ -315,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
@@ -998,34 +1052,21 @@
      <!-- 注意这里使用了 smsDialogVisible 以区分已有的 dialogFormVisible -->
      <el-form ref="smsForm" :model="form" label-width="80px">
        <el-form-item label="患者名称">
          <el-input
            style="width: 400px"
            disabled
            v-model="form.sendname"
          ></el-input>
          <el-input style="width: 400px" v-model="form.sendname"></el-input>
        </el-form-item>
        <el-form-item label="年龄">
          <el-input style="width: 400px" disabled v-model="form.age"></el-input>
          <el-input style="width: 400px" v-model="form.age"></el-input>
        </el-form-item>
        <el-form-item label="电话">
          <el-input
            style="width: 400px"
            disabled
            v-model="userform.telcode"
          ></el-input>
          <el-input style="width: 400px" v-model="userform.telcode"></el-input>
          <!-- 注意这里可能使用 userform.telcode -->
        </el-form-item>
        <el-form-item label="科室">
          <el-input
            style="width: 400px"
            disabled
            v-model="form.deptname"
          ></el-input>
          <el-input style="width: 400px" v-model="form.deptname"></el-input>
        </el-form-item>
        <el-form-item label="病区">
          <el-input
            style="width: 400px"
            disabled
            v-model="form.leavehospitaldistrictname"
          ></el-input>
        </el-form-item>
@@ -1219,6 +1260,7 @@
  updateTemplate,
  query360PatInfonh,
  sendMsg,
  smsSubTask,
  getconfigKey,
} from "@/api/AiCentre/index";
import {
@@ -1670,7 +1712,6 @@
    },
    getconfigKey() {
      getconfigKey("default.value.icon").then((res) => {
        if (res.msg) {
          if (
            this.getAssignArr(res.msg).includes(this.$store.state.user.name) ||
@@ -2000,29 +2041,29 @@
            this.Torouter();
            return;
          }
          this.$modal
            .confirm(
              '任务保存成功是否针对患者:"' +
                this.userform.name +
                '"再次随访?',
              "确认",
              {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                showCancelButton: true,
                dangerouslyUseHTMLString: true,
                confirmButtonClass: "custom-confirm-button", // 自定义确认按钮的类名
                cancelButtonClass: "custom-cancel-button", // 自定义取消按钮的类名
              }
            )
            .then(() => {
              document.querySelector("#app").scrollTo(0, 0);
              this.formtidy();
              this.dialogFormVisible = true;
            })
            .catch(() => {
              this.Torouter();
            });
          // this.$modal
          //   .confirm(
          //     '任务保存成功是否针对患者:"' +
          //       this.userform.name +
          //       '"再次随访?',
          //     "确认",
          //     {
          //       confirmButtonText: "确定",
          //       cancelButtonText: "取消",
          //       showCancelButton: true,
          //       dangerouslyUseHTMLString: true,
          //       confirmButtonClass: "custom-confirm-button", // 自定义确认按钮的类名
          //       cancelButtonClass: "custom-cancel-button", // 自定义取消按钮的类名
          //     }
          //   )
          //   .then(() => {
          //     document.querySelector("#app").scrollTo(0, 0);
          //     this.formtidy();
          //     this.dialogFormVisible = true;
          //   })
          //   .catch(() => {
          //     this.Torouter();
          //   });
        }
      });
    },
@@ -2109,6 +2150,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)
@@ -2266,29 +2326,31 @@
      savequestiondetail(obj).then((res) => {
        if (res.code == 200) {
          this.$modal.msgSuccess("服务保存成功");
          this.$modal
            .confirm(
              '任务保存成功是否针对患者:"' +
                this.userform.name +
                '"再次随访?',
              "确认",
              {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                showCancelButton: true,
                dangerouslyUseHTMLString: true,
                confirmButtonClass: "custom-confirm-button", // 自定义确认按钮的类名
                cancelButtonClass: "custom-cancel-button", // 自定义取消按钮的类名
              }
            )
            .then(() => {
              document.querySelector("#app").scrollTo(0, 0);
              this.formtidy();
              this.dialogFormVisible = true;
            })
            .catch(() => {
              this.Torouter();
            });
          this.Torouter();
          //   this.$modal
          //     .confirm(
          //       '任务保存成功是否针对患者:"' +
          //         this.userform.name +
          //         '"再次随访?',
          //       "确认",
          //       {
          //         confirmButtonText: "确定",
          //         cancelButtonText: "取消",
          //         showCancelButton: true,
          //         dangerouslyUseHTMLString: true,
          //         confirmButtonClass: "custom-confirm-button", // 自定义确认按钮的类名
          //         cancelButtonClass: "custom-cancel-button", // 自定义取消按钮的类名
          //       }
          //     )
          //     .then(() => {
          //       document.querySelector("#app").scrollTo(0, 0);
          //       this.formtidy();
          //       this.dialogFormVisible = true;
          //     })
          //     .catch(() => {
          //       this.Torouter();
          //     });
        }
      });
    },
@@ -2336,7 +2398,7 @@
          console.log(targetDate, "目标日期");
          if (now < targetDate && this.form.sendstate == 2) {
            this.$confirm("当前服务未到发送时间请谨慎修改", "提示", {
            this.$confirm("当前服务未到随访时间请谨慎修改", "提示", {
              confirmButtonText: "确定",
              cancelButtonText: "取消",
              type: "warning",
@@ -2355,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},您好!`,
      });
    },
    // 发送短信的方法
@@ -2391,6 +2460,7 @@
          objson = res.rows[0].serviceSubtaskList[0];
          objson.suggest = son;
          objson.remark = this.form.remark;
          objson.sendstate = this.serviceStates;
          objson.taskSituation = this.form.taskSituation;
          Editsingletaskson(objson).then((res) => {
            if (res.code) {
@@ -2432,13 +2502,14 @@
      });
    },
    alterpatient(sendstate) {
      alterpatient(this.userform).then((res) => {
        if (res.code == 200) {
          this.$modal.msgSuccess("基础信息保存成功");
        } else {
          this.$modal.msgError("基础信息修改失败");
        }
      });
      this.Editsingletasksonyic(this.serviceStates);
      // alterpatient(this.userform).then((res) => {
      //   if (res.code == 200) {
      //     this.$modal.msgSuccess("基础信息保存成功");
      //   } else {
      //     this.$modal.msgError("基础信息修改失败");
      //   }
      // });
    },
    // 异常列渲染
    tableRowClassName({ row, rowIndex }) {
@@ -2830,13 +2901,37 @@
  //   console.log(11);
  // },
  beforeRouteLeave(to, from, next) {
    this.$refs.callButton.cleanupResources();
    if (this.$refs.CallCenterLs) {
      console.log(1);
    const callButton = this.$refs.callButton;
      this.$refs.CallCenterLs.handleSeatLogout();
    // 如果存在呼叫组件且正在通话中
    if (callButton && callButton.isCalling) {
      this.$confirm("当前正在通话中,确定要离开此页面吗?", "提示", {
        confirmButtonText: "挂断并离开",
        cancelButtonText: "继续通话",
        type: "warning",
      })
        .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();
    }
    next(); // 确保调用 nex
  },
  // beforeRouteUpdate() {
  //   console.log(33);