WXL (wul)
昨天 21051d356bb8589ad088abb52492fd2a1909ed9e
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"
                      >
@@ -301,7 +297,7 @@
                              v-for="(
                                items, indexs
                              ) in item.svyTaskTemplateTargetoptions"
                              :class="items.isabnormal ? 'red-star' : ''"
                              :class="getOptionClass(items)"
                              :key="indexs"
                              :label="items.optioncontent"
                              @click.native.prevent="
@@ -553,76 +549,96 @@
      <!-- 人工处理 -->
      <div class="manual-action">
        <div class="Followuserinfos">
          <div>
          <!-- 顶部操作区域 -->
          <div class="section-header">
            <h3><i class="el-icon-s-operation"></i> 人工处理</h3>
            <div class="header-actions">
              <!-- 基础操作按钮组 -->
              <div class="action-group basic-actions">
                <el-button
                  type="primary"
                  plain
                  @click="Editsingletasksonyic('')"
                >
                  保存基础信息
                </el-button>
                <!-- 新增:延续护理按钮 -->
                <el-button
                  type="success"
                  plain
                  @click="handleContinuationCare"
                  v-if="showContinuationCareBtn"
                >
                  延续护理
                </el-button>
                <el-button
                  type="primary"
                  round
                  @click="sendAgain"
                  v-if="form.isVisitAgain != 2"
                >
                  再次随访
                </el-button>
              </div>
              <!-- 异常状态选择器 -->
              <div class="action-group tag-selector">
                <el-select
                  v-model="selectedTag"
                  placeholder="请选择异常状态"
                  clearable
                  style="width: 150px; margin-right: 10px"
                >
                  <el-option
                    v-for="item in tagOptions"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                  >
                    <span style="display: flex; align-items: center">
                      <span
                        class="color-indicator"
                        :style="{ backgroundColor: item.color }"
                      ></span>
                      <span>{{ item.label }}</span>
                    </span>
                  </el-option>
                </el-select>
                <!-- 当前选择的颜色指示器 -->
                <div
                  v-if="selectedTag"
                  class="color-indicator selected-indicator"
                  :style="{ backgroundColor: getSelectedTagColor() }"
                ></div>
                <!-- 标记说明提示 -->
                <el-tooltip
                  v-if="selectedTag"
                  effect="light"
                  :content="getSelectedDescription()"
                  placement="top"
                >
                  <i class="el-icon-info tag-info-icon"></i>
                </el-tooltip>
              </div>
            </div>
          </div>
          <!-- 表单区域 -->
          <div class="form-content">
            <el-form
              ref="userform"
              :model="form"
              :rules="userrules"
              label-width="120px"
              label-width="100px"
            >
              <div class="headline">
                <div>人工处理</div>
                <div style="margin: 0 30px">
                  <el-button
                    type="primary"
                    plain
                    @click="Editsingletasksonyic('')"
                    >保存基础信息</el-button
                  >
                </div>
                <div>
                  <el-button
                    type="primary"
                    round
                    v-if="this.form.isVisitAgain != 2"
                    @click="sendAgain()"
                    >再次随访</el-button
                  >
                </div>
                <div class="tag-selector-container">
                  <el-select
                    v-model="selectedTag"
                    placeholder="请选择异常状态"
                    clearable
                    style="width: 150px; margin-right: 10px"
                  >
                    <el-option
                      v-for="item in tagOptions"
                      :key="item.value"
                      :label="item.label"
                      :value="item.value"
                    >
                      <span style="display: flex; align-items: center">
                        <span
                          class="color-indicator"
                          :style="{ backgroundColor: item.color }"
                        ></span>
                        <span>{{ item.label }}</span>
                      </span>
                    </el-option>
                  </el-select>
                  <!-- 当前选择的颜色指示器 -->
                  <div
                    v-if="selectedTag"
                    class="color-indicator selected-indicator"
                    :style="{ backgroundColor: getSelectedTagColor() }"
                  ></div>
                  <!-- 标记说明提示 -->
                  <el-tooltip
                    v-if="selectedTag"
                    effect="light"
                    :content="getSelectedDescription()"
                    placement="top"
                  >
                    <i class="el-icon-info tag-info-icon"></i>
                  </el-tooltip>
                </div>
              </div>
              <!-- 联系信息行 -->
              <el-row>
                <el-col :span="14"
                  ><el-form-item label="联系电话">
                <el-col :span="14">
                  <el-form-item label="联系电话">
                    <el-input
                      placeholder="联系电话缺失"
                      v-model="userform.telcode"
@@ -632,13 +648,16 @@
                        icon="el-icon-phone"
                        @click="handleCall(userform.telcode, 'tel')"
                        :disabled="!isValidPhone(userform.telcode)"
                      ></el-button
                    ></el-input> </el-form-item
                ></el-col>
                      ></el-button>
                    </el-input>
                  </el-form-item>
                </el-col>
              </el-row>
              <!-- 联系人信息行 -->
              <el-row>
                <el-col :span="14"
                  ><el-form-item label="联系人电话">
                <el-col :span="14">
                  <el-form-item label="联系人电话">
                    <el-input
                      placeholder="联系人电话缺失"
                      v-model="userform.relativetelcode"
@@ -650,17 +669,21 @@
                          handleCall(userform.relativetelcode, 'relative')
                        "
                        :disabled="!isValidPhone(userform.relativetelcode)"
                      ></el-button
                    ></el-input> </el-form-item
                ></el-col>
                <el-col :span="10"
                  ><el-form-item label="联系人关系">
                      ></el-button>
                    </el-input>
                  </el-form-item>
                </el-col>
                <el-col :span="9">
                  <el-form-item label="关系">
                    <el-input
                      placeholder="联系人关系缺失"
                      v-model="userform.relation"
                    ></el-input> </el-form-item
                ></el-col>
                    ></el-input>
                  </el-form-item>
                </el-col>
              </el-row>
              <!-- 通话控制区域 -->
              <div class="call-controls">
                <CallButton
                  ref="callButton"
@@ -668,32 +691,59 @@
                  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>
              <el-form-item label="随访内容" v-if="orgname == '丽水市中医院'">
                <el-input type="textarea" v-model="form.remark"></el-input>
              </el-form-item>
              <el-form-item label="随访记录" v-else>
              <!-- 随访内容/记录 -->
              <el-form-item
                :label="orgname == '丽水市中医院' ? '随访内容' : '随访记录'"
              >
                <el-input type="textarea" v-model="form.remark"></el-input>
              </el-form-item>
              <!-- 随访情况 -->
              <el-form-item label="随访情况" v-if="orgname == '丽水市中医院'">
                <el-radio-group v-model="form.taskSituation">
                  <el-radio
@@ -701,121 +751,136 @@
                    :label="city.value"
                    :value="city.value"
                    :key="city.value"
                    >{{ city.label }}</el-radio
                  >
                    {{ city.label }}
                  </el-radio>
                </el-radio-group>
              </el-form-item>
              <!-- 处理意见 -->
              <el-form-item label="处理意见">
                <div>
                <div class="opinion-buttons">
                  <el-button
                    plain
                    type="warning"
                    @click="Editsingletaskson('1')"
                    >暂不处理</el-button
                  >
                    暂不处理
                  </el-button>
                  <el-button
                    plain
                    type="success"
                    @click="Editsingletaskson('2')"
                    >病情稳定</el-button
                  >
                    病情稳定
                  </el-button>
                  <el-button
                    plain
                    type="primary"
                    @click="Editsingletaskson('3')"
                    >通知就诊</el-button
                  >
                  <el-button plain type="info" @click="Editsingletaskson('5')"
                    >中心随访</el-button
                  >
                  <el-button type="primary" round @click="sendAgainmsg"
                    >短信发送</el-button
                  >
                    通知就诊
                  </el-button>
                  <el-button plain type="info" @click="Editsingletaskson('5')">
                    人工随访
                  </el-button>
                  <el-button type="primary" round @click="sendAgainmsg">
                    短信发送
                  </el-button>
                </div>
              </el-form-item>
            </el-form>
          </div>
            <div class="detailed">
              <h3>患者档案信息</h3>
              <el-form ref="userform" :model="userform" label-width="100px">
                <el-row :gutter="20">
                  <el-col :span="12">
                    <el-form-item label="患者姓名" prop="name">
                      <el-input
                        v-model="userform.name"
                        placeholder="请输入姓名"
                        maxlength="30"
                      ></el-input> </el-form-item
                  ></el-col>
                </el-row>
                <el-row :gutter="20">
                  <el-col :span="12"
                    ><el-form-item label="性别" prop="telcode">
                      <el-select v-model="userform.sex" placeholder="请选择">
                        <el-option label="男" :value="1"> </el-option>
                        <el-option label="女" :value="2"> </el-option>
                      </el-select> </el-form-item
                  ></el-col>
                  <el-col :span="12">
                    <el-form-item label="年龄" prop="name">
                      <el-input
                        v-model="userform.age"
                        placeholder="请输入姓名"
                        maxlength="20"
                      ></el-input> </el-form-item
                  ></el-col>
                </el-row>
          <!-- 患者档案信息 -->
          <div class="detailed">
            <h3>患者档案信息</h3>
            <el-form ref="userform" :model="userform" label-width="100px">
              <el-row :gutter="20">
                <el-col :span="12">
                  <el-form-item label="患者姓名" prop="name">
                    <el-input
                      v-model="userform.name"
                      placeholder="请输入姓名"
                      maxlength="30"
                    ></el-input>
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row :gutter="20">
                <el-col :span="12">
                  <el-form-item label="性别" prop="sex">
                    <el-select v-model="userform.sex" placeholder="请选择">
                      <el-option label="男" :value="1"> </el-option>
                      <el-option label="女" :value="2"> </el-option>
                    </el-select>
                  </el-form-item>
                </el-col>
                <el-col :span="12">
                  <el-form-item label="年龄" prop="age">
                    <el-input
                      v-model="userform.age"
                      placeholder="请输入年龄"
                      maxlength="20"
                    ></el-input>
                  </el-form-item>
                </el-col>
              </el-row>
                <el-row :gutter="20">
                  <el-col :span="12"
                    ><el-form-item label="联系方式" prop="telcode">
                      <el-input
                        v-model="userform.telcode"
                        placeholder="请输入联系方式"
                        maxlength="20"
                      /> </el-form-item
                  ></el-col>
                  <el-col :span="12">
                    <el-form-item label="亲属联系方式" prop="name">
                      <el-input
                        v-model="userform.relativetelcode"
                        placeholder="请输入姓名"
                        maxlength="20"
                      ></el-input> </el-form-item
                  ></el-col>
                </el-row>
                <el-row :gutter="20">
                  <el-col :span="24">
                    <el-form-item label="诊断名称" prop="name">
                      <el-input
                        v-model="form.leavediagname"
                        placeholder="请输入诊断"
                        maxlength="50"
                      ></el-input> </el-form-item
                  ></el-col>
                </el-row>
                <el-row :gutter="20">
                  <el-col :span="24">
                    <el-form-item label="出生地" prop="birthplace">
                      <el-input
                        v-model="userform.birthplace"
                        placeholder="国、省、地市、区县、街道等详细信息"
                        maxlength="50"
                      /> </el-form-item
                  ></el-col>
                </el-row>
                <el-row :gutter="20">
                  <el-col :span="24"
                    ><el-form-item label="居住地" prop="placeOfResidence">
                      <el-input
                        v-model="userform.placeOfResidence"
                        placeholder="国、省、地市、区县、街道等详细信息"
                        maxlength="50"
                      /> </el-form-item
                  ></el-col>
                </el-row>
              </el-form>
            </div>
              <el-row :gutter="20">
                <el-col :span="12">
                  <el-form-item label="联系方式" prop="telcode">
                    <el-input
                      v-model="userform.telcode"
                      placeholder="请输入联系方式"
                      maxlength="20"
                    />
                  </el-form-item>
                </el-col>
                <el-col :span="12">
                  <el-form-item label="亲属联系方式" prop="relativetelcode">
                    <el-input
                      v-model="userform.relativetelcode"
                      placeholder="请输入亲属联系方式"
                      maxlength="20"
                    ></el-input>
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row :gutter="20">
                <el-col :span="24">
                  <el-form-item label="诊断名称" prop="leavediagname">
                    <el-input
                      v-model="form.leavediagname"
                      placeholder="请输入诊断"
                      maxlength="50"
                    ></el-input>
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row :gutter="20">
                <el-col :span="24">
                  <el-form-item label="出生地" prop="birthplace">
                    <el-input
                      v-model="userform.birthplace"
                      placeholder="国、省、地市、区县、街道等详细信息"
                      maxlength="50"
                    />
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row :gutter="20">
                <el-col :span="24">
                  <el-form-item label="居住地" prop="placeOfResidence">
                    <el-input
                      v-model="userform.placeOfResidence"
                      placeholder="国、省、地市、区县、街道等详细信息"
                      maxlength="50"
                    />
                  </el-form-item>
                </el-col>
              </el-row>
            </el-form>
          </div>
        </div>
      </div>
@@ -996,14 +1061,14 @@
            </el-form-item>
          </el-col>
        </el-row>
        <el-form-item label="随访方式" prop="resource">
        <el-form-item label="随访类型" prop="resource">
          <el-radio-group v-model="form.resource">
            <el-radio label="1">本病区随访</el-radio>
            <el-radio label="2">随访中心随访</el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item label="随访记录">
        <el-form-item label="随访记录" :required="form.resource == '2'">
          <el-input type="textarea" v-model="form.remark"></el-input>
        </el-form-item>
      </el-form>
@@ -1137,11 +1202,16 @@
      userid: "",
      currentPhoneNumber: "",
      callType: "", // 用于区分是哪个电话
      isSipRegistering: true, // SIP注册状态
      // 已有数据...
      customCallStatus: "", // 用于存储自定义状态文本
      callStatus: "idle", // idle, calling, connected, ended, failed
      isEndingCall: false,
      CaldialogVisible: false,
      currentCall: null, // 当前通话对象
      // 新增功能数据
      showPatientInfo: true,
      showContinuationCareBtn: false, // 控制延续护理按钮显示
      // 路由监听相关
      routeWatcher: null,
      lastRoutePath: this.$route.path,
@@ -1177,8 +1247,12 @@
          value: "5",
        },
        {
          label: "其他情况不宜随访",
          label: "不宜随访被过滤",
          value: "6",
        },
        {
          label: "其他",
          value: "7",
        },
      ],
      tableDatatop: [], //题目表
@@ -1353,6 +1427,7 @@
          label: "一年后",
        },
      ],
      statusTimer: null,
      userform: {},
      smsDialogVisible: false, // 控制短信对话框显示
      smsContent: "", // 存储短信内容
@@ -1369,9 +1444,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}...`,
@@ -1402,11 +1486,90 @@
    this.visitCount = this.$route.query.visitCount;
    this.serviceType = this.$route.query.serviceType;
    this.orgname = localStorage.getItem("orgname");
    if (this.orgname == "省立同德翠苑院区") {
      this.showContinuationCareBtn = true;
    }
    if (this.orgname == "缙云县中医医院") {
      this.options = [
        {
          value: "半个月后",
          label: "半个月后",
        },
        {
          value: "一个月后",
          label: "一个月后",
        },
        {
          value: "两个月后",
          label: "两个月后",
        },
        {
          value: "三个月后",
          label: "三个月后",
        },
        {
          value: "六个月后",
          label: "六个月后",
        },
        {
          value: "12个月后",
          label: "12个月后",
        },
      ];
    }
    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, "getTopicClass");
      // 根据状态值返回对应的样式类
      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({
@@ -1417,16 +1580,16 @@
      }).then((res) => {
        if (res.code === 200) {
          // 针对再次随访服务进行删除结果赋值
          if (this.again && res.data.upScriptResult) {
            res.data.upScriptResult.forEach((itemA) => {
              const itemB = res.data.scriptResult.find(
                (item) => item.scriptContent === itemA.scriptContent
              );
              if (itemB) {
                itemB.scriptResult = itemA.scriptResult;
              }
            });
          }
          // if (this.again && res.data.upScriptResult) {
          //   res.data.upScriptResult.forEach((itemA) => {
          //     const itemB = res.data.scriptResult.find(
          //       (item) => item.scriptContent === itemA.scriptContent
          //     );
          //     if (itemB) {
          //       itemB.scriptResult = itemA.scriptResult;
          //     }
          //   });
          // }
          this.tableDatatop = res.data.scriptResult;
          this.tableDatatop.forEach((item) => {
@@ -1496,15 +1659,17 @@
      // 根据选择的随访方式计算随访日期
      if (value.includes("七天后")) {
        followupDate.setDate(dischargeDate.getDate() + 7);
      } else if (value.includes("15天后")) {
      } else if (value.includes("15天后") || value.includes("半个月后")) {
        followupDate.setDate(dischargeDate.getDate() + 15);
      } else if (value.includes("一个月后")) {
        followupDate.setMonth(dischargeDate.getMonth() + 1);
      } else if (value.includes("两个月后")) {
        followupDate.setMonth(dischargeDate.getMonth() + 2);
      } else if (value.includes("三个月后")) {
        followupDate.setMonth(dischargeDate.getMonth() + 3);
      } else if (value.includes("六个月后")) {
        followupDate.setMonth(dischargeDate.getMonth() + 6);
      } else if (value.includes("一年后")) {
      } else if (value.includes("一年后") || value.includes("12个月后")) {
        followupDate.setFullYear(dischargeDate.getFullYear() + 1);
      }
@@ -1523,8 +1688,6 @@
    },
    // 检查随访日期是否有效
    checkFollowupDate(date) {
      console.log(date);
      if (!date) {
        this.form.date1 = "";
        this.$refs.zcform.clearValidate(["date1"]);
@@ -1609,11 +1772,15 @@
        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,
@@ -1622,6 +1789,7 @@
          scriptid: item.id,
          excep: excep,
          questiontext: item.scriptContent,
          categoryid: item.categoryid,
          answerps: item.answerps || null, // 添加附加信息
        };
        if (item.scriptType == 2 && item.scriptResult[0]) {
@@ -1647,7 +1815,13 @@
            }
          });
          this.Editsingletasksonyic(6);
          const orgName = localStorage.getItem("orgname");
          console.log(orgName, "orgName");
          if (this.form.isVisitAgain != 1 || orgName == "丽水市中医院") {
            this.Torouter();
            return;
          }
          this.$modal
            .confirm(
              '任务保存成功是否针对患者:"' +
@@ -1669,33 +1843,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",
          });
        }
      }
    },
    // 电话============================
    // 验证电话号码格式并返回错误信息
@@ -1738,22 +1915,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;
          }
        });
      });
    },
@@ -1792,7 +1981,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("&");
@@ -1813,7 +2003,13 @@
        param2: this.patid,
        subId: this.id,
      };
      const orgName = localStorage.getItem("orgname");
      console.log(orgName, "orgName");
      if (this.form.isVisitAgain != 1 || orgName == "丽水市中医院") {
        this.Torouter();
        return;
      }
      addPersonVoices(obj).then((res) => {
        if (res.code == 200) {
          this.$modal.msgSuccess("服务保存成功");
@@ -1838,27 +2034,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();
            });
        }
      });
@@ -2029,10 +2205,38 @@
    // 调起再次发送
    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;
          }
        } else {
          document.querySelector("#app").scrollTo(0, 0);
          this.formtidy();
          this.dialogFormVisible = true;
        }
      });
    },
    // 查看详情
    Seedetails(row) {
@@ -2089,7 +2293,7 @@
      if (questionItem.matchedtext == optionValue) {
        this.$set(questionItem, "matchedtext", "");
        // 同时重置与选项相关的状态
        questionItem.isabnormal = false;
        // questionItem.isabnormal = false;
        questionItem.showAppendInput = false;
        // 注意:取消选中时,我们通常不希望触发题目跳转逻辑,所以直接返回
        // 如果需要,可以在这里添加取消选中后的特定逻辑,例如重置题目序列
@@ -2101,13 +2305,11 @@
    },
    // 新增的切换选中/取消选中方法
    handleRadioToggle(questionItem, index, options, optionValue) {
      console.log(questionItem, optionValue, 999);
      // 如果点击的是当前已选中的选项,则取消选中
      if (questionItem.scriptResult === optionValue) {
        questionItem.scriptResult = ""; // 清空选中值
        // 同时重置与选项相关的状态
        questionItem.isabnormal = false;
        // questionItem.isabnormal = false;
        questionItem.showAppendInput = false;
        // 注意:取消选中时,我们通常不希望触发题目跳转逻辑,所以直接返回
        // 如果需要,可以在这里添加取消选中后的特定逻辑,例如重置题目序列
@@ -2135,7 +2337,7 @@
      // 处理异常状态高亮
      this.tableDatatop[questionIndex].isabnormal =
        !!selectedOptionObj.isabnormal;
        selectedOptionObj.isabnormal;
      // 处理附加输入框显示
      this.tableDatatop[questionIndex].showAppendInput =
@@ -2211,6 +2413,7 @@
          hiddenByEnd: index === questionIndex + 1 ? false : item.hiddenByEnd,
        }));
      }
      2;
      this.$forceUpdate();
    },
@@ -2221,9 +2424,7 @@
        );
        if (obj) {
          if (obj.isabnormal) {
            this.tableDatatop[index].isabnormal = true;
          } else {
            this.tableDatatop[index].isabnormal = false;
            this.tableDatatop[index].isabnormal = obj.isabnormal;
          }
          this.$forceUpdate();
        }
@@ -2235,6 +2436,10 @@
        if (valid) {
          if (this.form.date1 && new Date(this.form.date1) < new Date()) {
            this.$message.error("随访时间不能小于当前时间");
            return false;
          }
          if (this.form.resource == "2" && !this.form.remark) {
            this.$message.error("当前选择为随访中心随访需输入随访记录");
            return false;
          }
          this.form.remark =
@@ -2345,6 +2550,34 @@
      // 刷新数据
      this.getTaskservelist();
    },
    // 延续护理
    handleContinuationCare() {
      if (this.form.continueFlag != 2) {
        this.$modal.confirm("是否为本次服务创建延续护理?").then(() => {
          this.$router.push({
            path: "/followvisit/ContinueFordetails/",
            query: {
              taskid: this.taskid,
              patid: this.patid,
              id: this.id,
              Voicetype: this.Voicetype,
              visitCount: this.visitCount,
            },
          });
        });
      } else {
        this.$router.push({
          path: "/followvisit/ContinueFordetails/",
          query: {
            taskid: this.taskid,
            patid: this.patid,
            id: this.id,
            Voicetype: this.Voicetype,
            visitCount: this.visitCount,
          },
        });
      }
    },
  },
  // deactivated() {
  //   console.log(11);
@@ -2380,15 +2613,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;
}
@@ -2405,6 +2641,7 @@
  padding: 2px 6px;
  border-radius: 4px;
}
.call-container {
  padding: 20px;
  background: #fff;
@@ -2434,11 +2671,13 @@
    margin-top: 20px;
  }
}
.merge-controls {
  background: #f5f7fa;
  border-radius: 4px;
  margin-left: 20px;
}
.Followuserinfo {
  margin: 10px 10px 0 10px;
  align-items: center;
@@ -2472,8 +2711,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;
@@ -2493,11 +2734,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;
@@ -2505,6 +2750,7 @@
  border-radius: 4px;
  border: 1px solid #dcdfe6;
}
.borderdiv {
  min-height: 60vh;
  font-size: 20px;
@@ -2543,14 +2789,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;
@@ -2565,8 +2908,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: 716px;
  /* 设置最大高度 */
  overflow-y: auto;
  /* 内容超过高度时显示滚动条 */
  .topic-dev {
    margin-bottom: 25px;
@@ -2615,6 +2960,18 @@
  }
}
/* 异常状态样式 - 红色 (保持不变) */
.scriptTopic-isabnormal {
  color: red;
}
/* 新增:警告状态样式 - 黄色 */
.scriptTopic-warning {
  color: #d4be00;
  /* 您指定的黄色 */
}
/* 异常选项样式 - 红色星号 (保持不变) */
.red-star {
  ::v-deep.el-radio__label {
    position: relative;
@@ -2628,25 +2985,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;
@@ -2683,9 +3060,11 @@
.tag-normal {
  background-color: #7ff5e1;
}
.tag-abnormal {
  background-color: #f75c5c;
}
.tag-warning {
  background-color: #fbfb4a;
}
@@ -2695,6 +3074,7 @@
  color: #909399;
  cursor: pointer;
}
::v-deep.offside-value .el-radio__label {
  color: #fff;
}
@@ -2744,6 +3124,7 @@
  color: #080808 !important;
  cursor: not-allowed;
}
/* 原有的样式保持不变,添加以下响应式代码 */
.Followupdetailspage {
@@ -2755,12 +3136,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,
@@ -2898,7 +3280,8 @@
/* 确保内容在缩放时保持可读性 */
.headline {
  font-size: clamp(18px, 2vw, 24px); /* 使用clamp函数确保字体大小在合理范围内 */
  font-size: clamp(18px, 2vw, 24px);
  /* 使用clamp函数确保字体大小在合理范围内 */
}
/* 为移动设备优化滚动体验 */
@@ -2916,9 +3299,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;
  }
@@ -2934,4 +3316,366 @@
    margin-bottom: 20px;
  }
}
/* 人工处理部分样式 */
.manual-action {
  flex: 1;
  min-width: 0;
  height: 100%;
  overflow: hidden;
  .Followuserinfos {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
    height: 100%;
    overflow-y: auto;
  }
}
/* 头部区域 */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 15px;
  border-bottom: 2px solid #f0f0f0;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 15px;
  h3 {
    margin: 0;
    color: #409eff;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    i {
      font-size: 20px;
    }
  }
  .header-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    .action-group {
      display: flex;
      align-items: center;
      gap: 10px;
    }
  }
}
/* 基础操作按钮 */
.basic-actions {
  .el-button {
    min-width: 100px;
  }
}
/* 异常状态选择器 */
.tag-selector {
  display: flex;
  align-items: center;
  gap: 10px;
  .current-tag {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #f8f9fa;
    border: 1px solid;
    border-radius: 4px;
    font-size: 12px;
    transition: all 0.3s;
    &:hover {
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
  }
}
.color-indicator {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  margin-right: 8px;
  display: inline-block;
}
.selected-indicator {
  margin-left: 10px;
  width: 20px;
  height: 20px;
}
.tag-info-icon {
  margin-left: 10px;
  color: #909399;
  cursor: pointer;
  font-size: 16px;
}
/* 表单区域 */
.form-content {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  .el-form {
    .el-row {
      margin: 0 -10px;
    }
    .el-col {
      padding: 0 10px;
    }
  }
}
/* 通话控制区域 */
.call-controls {
  margin: 15px 0;
  .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-registering {
    margin: 10px 0;
  }
  .registering-alert {
    border-radius: 8px;
    background-color: #f4f4f5;
    border-left: 4px solid #909399;
  }
}
/* 处理意见按钮组 */
.opinion-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  .el-button {
    flex: 1;
    min-width: 120px;
  }
}
/* 患者档案信息 */
.detailed {
  width: 100%;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  background-color: #ddf0f8;
  border: 1px solid #b3e0f2;
  h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 16px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    &:before {
      content: "";
      display: block;
      width: 4px;
      height: 16px;
      background: #409eff;
      border-radius: 2px;
    }
  }
  .el-form {
    .el-row {
      margin: 0 -10px;
    }
    .el-col {
      padding: 0 10px;
      margin-bottom: 15px;
    }
  }
}
/* 动画效果 */
@keyframes pulse {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
  100% {
    opacity: 1;
  }
}
/* 响应式设计 */
@media screen and (max-width: 1200px) {
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }
  .header-actions {
    width: 100%;
    justify-content: space-between;
  }
  .opinion-buttons {
    .el-button {
      min-width: calc(50% - 8px);
    }
  }
}
@media screen and (max-width: 768px) {
  .Followuserinfos {
    padding: 15px;
  }
  .form-content,
  .detailed {
    padding: 15px;
  }
  .header-actions {
    flex-direction: column;
    align-items: stretch;
    .action-group {
      flex-direction: column;
      align-items: stretch;
      .el-select {
        width: 100%;
        margin-right: 0;
      }
    }
  }
  .opinion-buttons {
    flex-direction: column;
    .el-button {
      width: 100%;
    }
  }
  .detailed {
    .el-form {
      .el-col {
        width: 100%;
      }
    }
  }
}
/* 滚动条美化 */
.Followuserinfos {
  &::-webkit-scrollbar {
    width: 6px;
  }
  &::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
  }
  &::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
    &:hover {
      background: #a8a8a8;
    }
  }
}
/* 按钮图标优化 */
.el-icon-phone {
  transition: all 0.3s;
}
.el-button[disabled] .el-icon-phone {
  color: #c0c4cc;
}
.el-button:not([disabled]) .el-icon-phone {
  color: #409eff;
}
.el-button:not([disabled]):hover .el-icon-phone {
  color: #66b1ff;
  transform: scale(1.1);
}
</style>