WXL (wul)
3 天以前 09abeae851f72a25f105030e37c6a0c9f3189378
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" v-if="orgname != '省立同德翠苑院区'">
                        问卷短信推送
                      </el-button>
                    </span>
                  </div>
                  <div class="preview-left" v-if="!Voicetype">
                    <div
@@ -677,7 +684,7 @@
                  type="primary"
                  round
                  @click="sendAgain"
                  v-if="(form.isVisitAgain != 2) & (visitAgain == 2)"
                  v-if="(form.isVisitAgain == 1) & (visitAgain == 2)"
                >
                  再次随访
                </el-button>
@@ -922,6 +929,13 @@
                  >
                    暂不处理
                  </el-button>
                   <el-button
                    plain
                    type="success"
                    @click="Editsingletaskson('6')"
                  >
                    已面访
                  </el-button>
                  <el-button
                    plain
                    type="success"
@@ -939,7 +953,7 @@
                  <el-button plain type="info" @click="Editsingletaskson('5')">
                    人工随访
                  </el-button>
                  <el-button type="primary" round @click="sendAgainmsg">
                  <el-button type="primary" round @click="sendAgainmsg" v-if="orgname != '省立同德翠苑院区'">
                    短信发送
                  </el-button>
                </div>
@@ -1075,51 +1089,37 @@
      </div>
    </el-dialog>
    <el-dialog
      title="患者再次随访"
      v-dialogDrags
      :visible.sync="dialogFormVisible"
    >
      <el-form ref="zcform" :rules="zcrules" :model="form" label-width="80px">
  title="患者再次随访"
  v-dialogDrags
  :visible.sync="dialogFormVisible"
  width="700px"
>
  <el-form ref="zcform" :rules="zcrules" :model="form" label-width="80px">
    <!-- 基础服务信息 - 默认折叠 -->
    <el-collapse v-model="activeNames" @change="handleCollapseChange">
      <el-collapse-item title="基础服务信息" name="basic">
        <el-form-item label="任务名称">
          <el-input
            style="width: 400px"
            disabled
            v-model="form.taskName"
          ></el-input>
          <el-input style="width: 100%" disabled v-model="form.taskName"></el-input>
        </el-form-item>
        <el-form-item label="患者名称">
          <el-input
            style="width: 400px"
            disabled
            v-model="form.sendname"
          ></el-input>
          <el-input style="width: 100%" disabled 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: 100%" disabled v-model="form.age"></el-input>
        </el-form-item>
        <el-form-item label="科室">
          <el-input
            style="width: 400px"
            disabled
            v-model="form.deptname"
          ></el-input>
          <el-input style="width: 100%" disabled 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-input style="width: 100%" disabled v-model="form.leavehospitaldistrictname"></el-input>
        </el-form-item>
        <el-form-item label="出院时间">
          <el-input
            style="width: 400px"
            disabled
            v-model="form.endtime"
          ></el-input>
          <el-input style="width: 100%" disabled v-model="form.endtime"></el-input>
        </el-form-item>
        <div class="headline">上次随访</div>
        <el-divider></el-divider>
      </el-collapse-item>
      <!-- 上次随访信息 - 默认折叠 -->
      <el-collapse-item title="上次随访" name="last">
        <el-row>
          <el-col :span="12">
            <el-form-item label="随访方式">
@@ -1131,6 +1131,7 @@
                disabled
                placeholder="请选择随访方式"
                class="custom-disabled"
                style="width: 90%"
              >
                <el-option
                  v-for="item in options"
@@ -1152,11 +1153,11 @@
                align="right"
                v-model="form.date2"
                class="custom-disabled"
                style="width: 95%"
              ></el-date-picker>
            </el-form-item>
          </el-col>
        </el-row>
        <el-form-item label="随访记录">
          <el-input
            class="custom-disabled"
@@ -1165,8 +1166,10 @@
            v-model="form.remark2"
          ></el-input>
        </el-form-item>
        <div class="headline">下次随访</div>
        <el-divider></el-divider>
      </el-collapse-item>
      <!-- 下次随访信息 - 默认展开 -->
      <el-collapse-item title="下次随访" name="next">
        <el-row>
          <el-col :span="12">
            <el-form-item label="随访方式" prop="visitType">
@@ -1177,6 +1180,7 @@
                default-first-option
                @change="visitChange"
                placeholder="请选择随访方式(依出院时间计算)"
                style="width: 90%"
              >
                <el-option
                  v-for="item in options"
@@ -1197,6 +1201,7 @@
                align="right"
                v-model="form.date1"
                class="custom-disabled"
                style="width: 92%"
                value-format="yyyy-MM-dd hh:mm:ss"
                @change="checkFollowupDate"
              ></el-date-picker>
@@ -1209,18 +1214,17 @@
            <el-radio label="2">随访中心随访</el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item label="随访记录" :required="form.resource == '2'">
          <el-input type="textarea" v-model="form.remark"></el-input>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="warning" @click="dialogFormVisible = false"
          >取 消</el-button
        >
        <el-button type="primary" @click="setupsubtask">确认创建服务</el-button>
      </div>
    </el-dialog>
      </el-collapse-item>
    </el-collapse>
  </el-form>
  <div slot="footer" class="dialog-footer">
    <el-button type="warning" @click="dialogFormVisible = false">取 消</el-button>
    <el-button type="primary" @click="setupsubtask">确认创建服务</el-button>
  </div>
</el-dialog>
    <div class="main-content" v-if="orgname == '景宁畲族自治县人民医院'">
      <!-- <el-button @click="CaldialogVisible = true">打开弹框</el-button> -->
@@ -1253,6 +1257,7 @@
  updateTemplate,
  query360PatInfonh,
  sendMsg,
  smsSubTask,
  getconfigKey,
} from "@/api/AiCentre/index";
import {
@@ -1356,6 +1361,7 @@
    };
    return {
      visitAgain: 1,
      activeNames: ['next'], // 只展开"下次随访",其他都折叠
      userid: "",
      defaultKey: false, //是否可默认填报
      currentPhoneNumber: "",
@@ -1702,6 +1708,9 @@
        return "scriptTopic-dev"; // 正常 - 默认样式
      }
    },
    handleCollapseChange(val) {
    console.log('折叠面板状态变化:', val);
  },
    getconfigKey() {
      getconfigKey("default.value.icon").then((res) => {
        if (res.msg) {
@@ -1785,7 +1794,9 @@
              item.scriptResult = item.scriptResult;
            } else if (item.scriptResultId && item.scriptType == 2) {
              console.log(item.scriptResult, "item.scriptResult");
              item.scriptResult = item.scriptResult.split("&");
              item.scriptResult = item.scriptResult
                ? item.scriptResult.split("&")
                : [];
              item.isoption = 3;
            } else if (!item.scriptResultId && item.scriptType == 2) {
              item.scriptResult = [];
@@ -2025,37 +2036,38 @@
          this.Editsingletasksonyic(this.serviceStates);
          const orgName = localStorage.getItem("orgname");
          if (
            this.form.isVisitAgain != 1 ||
            orgName == "丽水市中医院" ||
            this.visitAgain == 1
          ) {
          if (this.form.isVisitAgain != 1 || this.visitAgain == 1) {
            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();
          //   });
          if (
            orgName == "景宁畲族自治县人民医院" ||
            orgName == "缙云第二人民医院"
          ) {
            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();
              });
          }
        }
      });
    },
@@ -2142,6 +2154,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)
@@ -2288,42 +2319,43 @@
      const orgName = localStorage.getItem("orgname");
      console.log(orgName, "orgName");
      if (
        this.form.isVisitAgain != 1 ||
        orgName == "丽水市中医院" ||
        this.visitAgain == 1
      ) {
        this.Torouter();
        return;
      }
      savequestiondetail(obj).then((res) => {
        if (res.code == 200) {
          this.$modal.msgSuccess("服务保存成功");
          this.Torouter();
          // this.Torouter();
          if (
            this.form.isVisitAgain != 1 ||
            orgName == "丽水市中医院" ||
            this.visitAgain == 1
          ) {
            console.log("c4");
          //   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();
            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();
            });
        }
      });
    },
@@ -2390,8 +2422,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 +2507,7 @@
      });
    },
    alterpatient(sendstate) {
      this.Editsingletasksonyic(this.serviceStates)
      this.Editsingletasksonyic(this.serviceStates);
      // alterpatient(this.userform).then((res) => {
      //   if (res.code == 200) {
      //     this.$modal.msgSuccess("基础信息保存成功");
@@ -2606,15 +2645,26 @@
      if (document.activeElement) {
        document.activeElement.blur();
      }
      let selectedOptionObj = null;
      if (this.Voicetype) {
        console.log('Voicetype');
      // 找到被选中的选项对象
      const selectedOptionObj = options.find(
        (item) => item.optioncontent == selectedOption
      );
        selectedOptionObj = options.find(
          (item) => item.targetvalue == selectedOption
        );
      } else {
        // 找到被选中的选项对象
        selectedOptionObj = options.find(
          (item) => item.optioncontent == selectedOption
        );
      }
      console.log(this.tableDatatop, "this.tableDatatop");
      console.log(selectedOptionObj, "selectedOptionObj");
      // 处理异常状态高亮
      this.tableDatatop[questionIndex].isabnormal =
        selectedOptionObj.isabnormal;
      // 处理附加输入框显示
      this.tableDatatop[questionIndex].showAppendInput =
@@ -2867,38 +2917,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);
  // },
@@ -3987,4 +4037,27 @@
  color: #66b1ff;
  transform: scale(1.1);
}
/* 调整折叠面板样式 */
.el-collapse {
  border-top: none;
}
.el-collapse-item__header {
  font-size: 16px;
  font-weight: bold;
  background-color: #f5f7fa;
  padding-left: 15px;
  border-radius: 4px;
  margin-bottom: 5px;
}
.el-collapse-item__wrap {
  border-bottom: none;
}
.el-collapse-item__content {
  padding: 20px 15px;
  background-color: #fff;
}
</style>