WXL (wul)
10 天以前 20043e072aee67f1162a5d490c063cadc2e1dcde
src/views/followvisit/record/detailpage/index.vue
@@ -76,7 +76,8 @@
                  gettoken360(
                    scope.row.sfzh,
                    scope.row.drcode,
                    scope.row.drname
                    scope.row.drname,
                    scope.row.patid
                  )
                "
                ><span class="button-textsc">{{
@@ -261,10 +262,15 @@
      <!-- 随访内容 -->
      <div class="call-action">
        <div class="call-container">
          <!-- <div class="call-header">
            <h2>一键呼叫功能</h2>
          </div> -->
          <template-selector
          v-if="orgname=='南华大学附属第一医院'&&!Voicetype"
            v-model="form.templateid"
            :templateName="form.templatename"
            :service-type="form.serviceType"
            :is-editable="form.sendState !== 2"
            @select="handleTemplateSelect"
            @clear="handleTemplateClear"
          />
          <div class="headline">
            <div>随访内容</div>
          </div>
@@ -558,11 +564,7 @@
            <div class="header-actions">
              <!-- 基础操作按钮组 -->
              <div class="action-group basic-actions">
                <el-button
                  type="primary"
                  plain
                  @click="Editsingletasksonyic('')"
                >
                <el-button type="primary" plain @click="alterpatient('')">
                  保存基础信息
                </el-button>
@@ -580,7 +582,7 @@
                  type="primary"
                  round
                  @click="sendAgain"
                  v-if="form.isVisitAgain != 2"
                  v-if="(form.isVisitAgain != 2) & (visitAgain == 2)"
                >
                  再次随访
                </el-button>
@@ -755,12 +757,44 @@
                  />
                </div>
              </div>
              <el-form-item label="任务处理状态">
                <el-select
                  v-model="serviceStates"
                  placeholder="请选择状态"
                  clearable
                  style="width: 150px; margin-right: 10px"
                >
                  <el-option
                    v-for="item in serviceState"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                  />
                </el-select>
              </el-form-item>
              <!-- 随访内容/记录 -->
              <el-form-item
                :label="orgname == '丽水市中医院' ? '随访内容' : '随访记录'"
              >
                <el-input type="textarea" v-model="form.remark"></el-input>
                <!-- 快捷短语标签 -->
                <div style="margin-bottom: 8px">
                  <el-tag
                    v-for="(item, index) in dict.type.quickfollow_up"
                    :key="index"
                    style="margin-right: 8px; cursor: pointer"
                    @click="insertText(item.value)"
                  >
                    {{ item.value }}
                  </el-tag>
                </div>
                <!-- 文本域 -->
                <el-input
                  type="textarea"
                  :rows="4"
                  v-model="form.remark"
                  ref="textareaRef"
                  placeholder="可点击上方快捷标签或手动输入"
                ></el-input>
              </el-form-item>
              <!-- 随访情况 -->
@@ -1128,6 +1162,8 @@
  savequestiondetail,
  addPersonVoices,
  query360PatInfo,
  updateTemplate,
  query360PatInfonh,
  sendMsg,
} from "@/api/AiCentre/index";
import {
@@ -1136,13 +1172,16 @@
  listcontactinformation,
} from "@/api/patient/homepage";
import CallButton from "@/components/CallButton";
import TemplateSelector from "@/components/optionalModule";
import MergeAndModify from "./MergeAndModify.vue";
import CallCenterLs from "@/components/CallCenterLs";
import store from "@/store";
export default {
  components: {
    CallButton,
    MergeAndModify,
    CallCenterLs,
    TemplateSelector,
  },
  directives: {
    numericOnly: {
@@ -1205,7 +1244,13 @@
      },
    },
  },
  dicts: ["sys_normal_disable", "sys_user_sex", "sys_yujing", "sys_suggest"],
  dicts: [
    "sys_normal_disable",
    "quickfollow_up",
    "sys_user_sex",
    "sys_yujing",
    "sys_suggest",
  ],
  data() {
    const validatePhone = (rule, value, callback) => {
      if (!value) {
@@ -1220,6 +1265,7 @@
      }, 300);
    };
    return {
      visitAgain: 1,
      userid: "",
      currentPhoneNumber: "",
      callType: "", // 用于区分是哪个电话
@@ -1230,11 +1276,35 @@
      isEndingCall: false,
      CaldialogVisible: false,
      currentCall: null, // 当前通话对象
      serviceStates: 6,
      serviceState: [
        {
          value: 2,
          label: "待随访",
        },
        {
          value: 3,
          label: "表单已发送",
        },
        {
          value: 5,
          label: "发送失败",
        },
        {
          value: 6,
          label: "已完成",
        },
        {
          value: 4,
          label: "不执行",
        },
      ],
      // 新增功能数据
      showPatientInfo: true,
      showContinuationCareBtn: false, // 控制延续护理按钮显示
      // 路由监听相关
      routeWatcher: null,
      lastRoutePath: this.$route.path,
      input: "今天身体还不错",
      radio: "2",
@@ -1275,6 +1345,14 @@
          label: "其他",
          value: "7",
        },
      ],
      quickContents: [
        "病情稳定,继续当前治疗",
        "患者已死亡",
        "患者不需要随访",
        "按时服药,注意休息",
        "饮食清淡,忌辛辣",
        "预约下次复诊",
      ],
      tableDatatop: [], //题目表
      voiceDatatop: [], //题目表
@@ -1506,6 +1584,9 @@
    this.Voicetype = this.$route.query.Voicetype;
    this.visitCount = this.$route.query.visitCount;
    this.serviceType = this.$route.query.serviceType;
    this.visitAgain = store.getters.visitAgain;
    console.log(store.getters.visitAgain);
    this.orgname = localStorage.getItem("orgname");
    if (this.orgname == "省立同德翠苑院区") {
      this.showContinuationCareBtn = true;
@@ -1589,6 +1670,29 @@
      }
      return ""; // 正常 - 无特殊样式
    },
    insertText(text) {
      const textarea = this.$refs.textareaRef;
      console.log(textarea);
      if (!textarea) return;
      const target = textarea.$el.querySelector("textarea");
      const start = target.selectionStart;
      const end = target.selectionEnd;
      const original = this.form.remark;
      console.log(original, 11);
      // 在光标处插入,并更新光标位置
      this.form.remark =
        original.substring(0, start) + text + original.substring(end);
      // 保持焦点并移动光标到插入内容后
      this.$nextTick(() => {
        target.focus();
        const newPos = start + text.length;
        target.setSelectionRange(newPos, newPos);
      });
    },
    // 获取问卷数据
    getsearchrResults(id) {
      getsearchrResults({
@@ -1629,8 +1733,25 @@
      });
    },
    //患者360跳转
    gettoken360(sfzh, drcode, drname) {
      // this.$modal.msgWarning("360功能暂未开通");
    gettoken360(sfzh, drcode, drname, id) {
      const orgname = localStorage.getItem("orgname");
      if (orgname == "南华大学附属第一医院") {
        query360PatInfonh(id).then((res) => {
          if (res.data) {
            window.open(res.data, "_blank");
          } else {
            this.$modal.msgWarning("360查询无结果");
          }
        });
        return;
      } else if (
        orgname == "第一人民医院湖滨院区" ||
        orgname == "第一人民医院吴山院区"
      ) {
        let url = `http://192.200.81.189:9100/blj/view?BINGRENID=${id}&YONGHUID=DBA`;
        window.open(url, "_blank");
        return;
      }
      this.postData.YeWuXX.BingRenXX.ZhengJianHM = sfzh;
@@ -1806,10 +1927,7 @@
        // 处理 scriptResult,直接修改原始数据
        if (item.scriptType == 2 && item.scriptResult) {
          // 处理数组类型的 scriptResult
          if (
            Array.isArray(item.scriptResult) &&
            item.scriptResult.length > 0
          ) {
          if (Array.isArray(item.scriptResult)) {
            item.originalScriptResult = item.scriptResult; // 保存原始数组(可选)
            item.scriptResult = item.scriptResult.join("&"); // 转换为字符串
          }
@@ -1840,10 +1958,14 @@
      savequestiondetail(obj).then((res) => {
        if (res.code == 200) {
          this.$modal.msgSuccess("服务保存成功");
          this.Editsingletasksonyic(6);
          this.Editsingletasksonyic(this.serviceStates);
          const orgName = localStorage.getItem("orgname");
          if (this.form.isVisitAgain != 1 || orgName == "丽水市中医院") {
          if (
            this.form.isVisitAgain != 1 ||
            orgName == "丽水市中医院" ||
            this.visitAgain == 1
          ) {
            this.Torouter();
            return;
          }
@@ -1927,6 +2049,35 @@
          message: "请输入正确的电话号码(手机号或带区号的固定电话)",
        };
      }
    },
    handleTemplateSelect(templateData) {
      console.log("选择了模板:", templateData);
      // 处理模板选择逻辑
      let templateobj = templateData.templateData;
      templateobj.templateid = templateobj.svyid;
      templateobj.taskid = this.form.taskid;
      templateobj.isoperation = 1;
      templateobj.svyTaskTemplateScriptVOS = templateobj.svyTemplateLibScripts;
      templateobj.svyTaskTemplateScriptVOS.forEach((item) => {
        item.taskid = this.form.taskid;
        item.templateid = item.svyid;
        item.svyTaskTemplateTargetoptions = item.svyLibTemplateTargetoptions;
      });
      let obj = {
        subId: this.form.id,
        svyTaskTemplateVO: templateobj,
      };
      updateTemplate(obj).then((res) => {
        if (res.code) {
          location.reload();
          this.$modal.msgSuccess("模板修改成功");
        } else {
        }
      });
    },
    handleTemplateClear() {
      console.log("清除了模板选择");
    },
    // 使用示例
    isValidPhone(phone) {
@@ -2023,7 +2174,7 @@
        }
        item.patid = this.patid;
        item.templateid = item.templateID;
             if (item.nextScriptno == null) {
        if (item.nextScriptno == null) {
          item.nextScriptno = index == dataToSubmit.length - 1 ? 0 : index + 2;
        }
      });
@@ -2040,7 +2191,11 @@
      const orgName = localStorage.getItem("orgname");
      console.log(orgName, "orgName");
      if (this.form.isVisitAgain != 1 || orgName == "丽水市中医院") {
      if (
        this.form.isVisitAgain != 1 ||
        orgName == "丽水市中医院" ||
        this.visitAgain == 1
      ) {
        this.Torouter();
        return;
      }
@@ -2105,12 +2260,17 @@
          this.form = res.rows[0].serviceSubtaskList.find(
            (item) => item.id == this.id
          );
          console.log(this.form.templatename, "templatename");
          this.form.remark = this.form.remark || "";
          this.logsheetlist = res.rows[0].serviceSubtaskList;
          this.templateid = this.form.templateid;
          this.selectedTag = this.form.excep;
          const targetDate = new Date(this.form.visitTime); // 目标日期
          const now = new Date(); // 当前时间
          console.log(now, "当前时间");
          console.log(targetDate, "目标日期");
          if (now < targetDate && this.form.sendstate == 2) {
            this.$confirm("当前服务未到发送时间请谨慎修改", "提示", {
              confirmButtonText: "确定",
@@ -2205,6 +2365,15 @@
        }
      });
    },
    alterpatient(sendstate) {
      alterpatient(this.userform).then((res) => {
        if (res.code == 200) {
          this.$modal.msgSuccess("基础信息保存成功");
        } else {
          this.$modal.msgError("基础信息修改失败");
        }
      });
    },
    // 异常列渲染
    tableRowClassName({ row, rowIndex }) {
      if (row.id == this.id) {