WXL (wul)
6 天以前 a5cba9ab040f6f97558046885dce3017f9bab7e9
src/views/followvisit/record/detailpage/index.vue
@@ -136,6 +136,18 @@
          >
          </el-table-column>
          <el-table-column
            label="应随访日期"
            width="146"
            align="center"
            key="visitTime"
            prop="visitTime"
            :render-header="Tooltipy"
          >
            <template slot-scope="scope">
              <span>{{ formatTime(scope.row.visitTime) }}</span>
            </template></el-table-column
          >
          <el-table-column
            v-if="orgname == '南华大学附属第一医院'"
            label="入院日期"
            width="200"
@@ -362,7 +374,19 @@
                  ><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
@@ -578,10 +602,10 @@
                    v-if="Voicetype"
                    type="primary"
                    @click="yuyingetdetail"
                    >保存服务详情</el-button
                    >保存问卷详情</el-button
                  >
                  <el-button v-else type="primary" @click="getdetail"
                    >保存服务详情</el-button
                    >保存问卷详情</el-button
                  >
                </div>
              </el-tab-pane>
@@ -677,7 +701,7 @@
                  type="primary"
                  round
                  @click="sendAgain"
                  v-if="(form.isVisitAgain != 2) & (visitAgain == 2)"
                  v-if="(form.isVisitAgain == 1) & (visitAgain == 2)"
                >
                  再次随访
                </el-button>
@@ -689,6 +713,7 @@
                  v-model="selectedTag"
                  placeholder="请选择异常状态"
                  clearable
                  @change="exceptionHandling"
                  style="width: 150px; margin-right: 10px"
                >
                  <el-option
@@ -925,6 +950,13 @@
                  <el-button
                    plain
                    type="success"
                    @click="Editsingletaskson('6')"
                  >
                    已面访
                  </el-button>
                  <el-button
                    plain
                    type="success"
                    @click="Editsingletaskson('2')"
                  >
                    病情稳定
@@ -939,7 +971,12 @@
                  <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>
@@ -1078,141 +1115,157 @@
      title="患者再次随访"
      v-dialogDrags
      :visible.sync="dialogFormVisible"
      width="700px"
    >
      <el-form ref="zcform" :rules="zcrules" :model="form" label-width="80px">
        <el-form-item label="任务名称">
          <el-input
            style="width: 400px"
            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-form-item>
        <el-form-item label="年龄">
          <el-input style="width: 400px" 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-form-item>
        <el-form-item label="病区">
          <el-input
            style="width: 400px"
            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-form-item>
        <div class="headline">上次随访</div>
        <el-divider></el-divider>
        <el-row>
          <el-col :span="12">
            <el-form-item label="随访方式">
              <el-select
                v-model="form.visitType2"
                filterable
                allow-create
                default-first-option
        <!-- 基础服务信息 - 默认折叠 -->
        <el-collapse v-model="activeNames" @change="handleCollapseChange">
          <el-collapse-item title="基础服务信息" name="basic">
            <el-form-item label="任务名称">
              <el-input
                style="width: 100%"
                disabled
                placeholder="请选择随访方式"
                class="custom-disabled"
              >
                <el-option
                  v-for="item in options"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                >
                </el-option>
              </el-select>
                v-model="form.taskName"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="随访时间">
              <el-date-picker
                type="date"
            <el-form-item label="患者名称">
              <el-input
                style="width: 100%"
                disabled
                placeholder="选择日期"
                :picker-options="pickerOptions"
                align="right"
                v-model="form.date2"
                class="custom-disabled"
              ></el-date-picker>
                v-model="form.sendname"
              ></el-input>
            </el-form-item>
          </el-col>
        </el-row>
            <el-form-item label="年龄">
              <el-input
                style="width: 100%"
                disabled
                v-model="form.age"
              ></el-input>
            </el-form-item>
            <el-form-item label="科室">
              <el-input
                style="width: 100%"
                disabled
                v-model="form.deptname"
              ></el-input>
            </el-form-item>
            <el-form-item label="病区">
              <el-input
                style="width: 100%"
                disabled
                v-model="form.leavehospitaldistrictname"
              ></el-input>
            </el-form-item>
            <el-form-item label="出院时间">
              <el-input
                style="width: 100%"
                disabled
                v-model="form.endtime"
              ></el-input>
            </el-form-item>
          </el-collapse-item>
        <el-form-item label="随访记录">
          <el-input
            class="custom-disabled"
            type="textarea"
            disabled
            v-model="form.remark2"
          ></el-input>
        </el-form-item>
        <div class="headline">下次随访</div>
        <el-divider></el-divider>
        <el-row>
          <el-col :span="12">
            <el-form-item label="随访方式" prop="visitType">
              <el-select
                v-model="form.visitType"
                filterable
                allow-create
                default-first-option
                @change="visitChange"
                placeholder="请选择随访方式(依出院时间计算)"
              >
                <el-option
                  v-for="item in options"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                >
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="随访时间" prop="date1">
              <el-date-picker
                type="date"
                placeholder="选择日期"
                :picker-options="pickerOptions"
                align="right"
                v-model="form.date1"
          <!-- 上次随访信息 - 默认折叠 -->
          <el-collapse-item title="上次随访" name="last">
            <el-row>
              <el-col :span="12">
                <el-form-item label="随访方式">
                  <el-select
                    v-model="form.visitType2"
                    filterable
                    allow-create
                    default-first-option
                    disabled
                    placeholder="请选择随访方式"
                    class="custom-disabled"
                    style="width: 90%"
                  >
                    <el-option
                      v-for="item in options"
                      :key="item.value"
                      :label="item.label"
                      :value="item.value"
                    >
                    </el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="随访时间">
                  <el-date-picker
                    type="date"
                    disabled
                    placeholder="选择日期"
                    :picker-options="pickerOptions"
                    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"
                value-format="yyyy-MM-dd hh:mm:ss"
                @change="checkFollowupDate"
              ></el-date-picker>
                type="textarea"
                disabled
                v-model="form.remark2"
              ></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <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-collapse-item>
        <el-form-item label="随访记录" :required="form.resource == '2'">
          <el-input type="textarea" v-model="form.remark"></el-input>
        </el-form-item>
          <!-- 下次随访信息 - 默认展开 -->
          <el-collapse-item title="下次随访" name="next">
            <el-row>
              <el-col :span="12">
                <el-form-item label="随访方式" prop="visitType">
                  <el-select
                    v-model="form.visitType"
                    filterable
                    allow-create
                    default-first-option
                    @change="visitChange"
                    placeholder="请选择随访方式(依出院时间计算)"
                    style="width: 90%"
                  >
                    <el-option
                      v-for="item in options"
                      :key="item.value"
                      :label="item.label"
                      :value="item.value"
                    >
                    </el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="随访时间" prop="date1">
                  <el-date-picker
                    type="date"
                    placeholder="选择日期"
                    :picker-options="pickerOptions"
                    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>
                </el-form-item>
              </el-col>
            </el-row>
            <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="随访记录" :required="form.resource == '2'">
              <el-input type="textarea" v-model="form.remark"></el-input>
            </el-form-item>
          </el-collapse-item>
        </el-collapse>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="warning" @click="dialogFormVisible = false"
@@ -1253,6 +1306,7 @@
  updateTemplate,
  query360PatInfonh,
  sendMsg,
  smsSubTask,
  getconfigKey,
} from "@/api/AiCentre/index";
import {
@@ -1356,6 +1410,7 @@
    };
    return {
      visitAgain: 1,
      activeNames: ["next"], // 只展开"下次随访",其他都折叠
      userid: "",
      defaultKey: false, //是否可默认填报
      currentPhoneNumber: "",
@@ -1566,6 +1621,10 @@
          value: "一年后",
          label: "一年后",
        },
        {
          value: "五年后",
          label: "五年后",
        },
      ],
      statusTimer: null,
      userform: {},
@@ -1629,7 +1688,15 @@
    console.log(store.getters.visitAgain);
    this.orgname = localStorage.getItem("orgname");
    if (this.orgname == "省立同德翠苑院区") {
    console.log(localStorage.getItem("orgname"));
    if (
      this.orgname == "省立同德翠苑院区" ||
      this.orgname == "省立同德之江院区" ||
      this.orgname == "省立同德闲林院区" ||
      this.orgname == "省立同德青山湖院区" ||
      this.orgname == "省立同德天目山路院区"
    ) {
      this.showContinuationCareBtn = true;
    }
@@ -1701,6 +1768,22 @@
      } else {
        return "scriptTopic-dev"; // 正常 - 默认样式
      }
    },
    handleCollapseChange(val) {
      console.log("折叠面板状态变化:", val);
    },
    Tooltipy(h, { column }) {
      return h(
        "el-tooltip",
        {
          props: {
            content: "任务配置多种补偿类型时,最新执行类型的应随访时间",
            placement: "top",
            effect: "dark",
          },
        },
        [h("span", column.label)]
      );
    },
    getconfigKey() {
      getconfigKey("default.value.icon").then((res) => {
@@ -1785,7 +1868,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 = [];
@@ -1877,6 +1962,8 @@
        followupDate.setMonth(dischargeDate.getMonth() + 6);
      } else if (value.includes("一年后") || value.includes("12个月后")) {
        followupDate.setFullYear(dischargeDate.getFullYear() + 1);
      } else if (value.includes("五年后")) {
        followupDate.setFullYear(dischargeDate.getFullYear() + 5);
      }
      if (followupDate < now) {
@@ -2025,37 +2112,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();
              });
          }
        }
      });
    },
@@ -2080,6 +2168,8 @@
            path: "/followvisit/discharge",
          });
        }
      } else {
        location.reload();
      }
    },
    // 电话============================
@@ -2142,6 +2232,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 +2397,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();
            });
        }
      });
    },
@@ -2359,6 +2469,8 @@
          this.form = res.rows[0].serviceSubtaskList.find(
            (item) => item.id == this.id
          );
          this.form.taskSituation = String(this.form.taskSituation);
          console.log(this.form.templatename, "templatename");
          this.form.remark = this.form.remark || "";
@@ -2390,8 +2502,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},您好!`,
      });
    },
    // 发送短信的方法
@@ -2416,7 +2535,12 @@
          this.$modal.msgError("发送失败");
        });
    },
    Editsingletaskson(son) {
    // 异常处理
    exceptionHandling(sid) {
      this.Editsingletaskson(1, sid);
    },
    // 存储意见自动存储
    Editsingletaskson(son, sid) {
      let objson = {};
      getTaskservelist({
        patid: this.patid,
@@ -2424,13 +2548,14 @@
      }).then((res) => {
        if (res.code == 200) {
          objson = res.rows[0].serviceSubtaskList[0];
          objson.suggest = son;
          objson.suggest = sid ? this.form.suggest : son;
          objson.excep = sid ? sid : 0;
          objson.remark = this.form.remark;
          objson.sendstate = this.serviceStates;
          objson.taskSituation = this.form.taskSituation;
          Editsingletaskson(objson).then((res) => {
            if (res.code) {
              this.$modal.msgSuccess("服务记录成功");
              this.$modal.msgSuccess("服务记录更新成功");
              this.getTaskservelist();
            }
          });
@@ -2468,7 +2593,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 +2731,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 +3003,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);
  // },
@@ -2928,7 +3064,7 @@
  .call-action {
    width: 60%;
    min-width: 0;
    height: 100%;
    // height: 100%;
    /* 确保高度继承 */
  }
}
@@ -3200,7 +3336,7 @@
.CONTENT {
  padding: 10px;
  height: 100%;
  min-height: 738px;
  // min-height: 938px;
  /* 设置最小高度 */
  .title {
@@ -3216,7 +3352,7 @@
  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: 716px;
  max-height: 916px;
  /* 设置最大高度 */
  overflow-y: auto;
  /* 内容超过高度时显示滚动条 */
@@ -3987,4 +4123,26 @@
  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>