WXL (wul)
4 天以前 574b449a39019a59dc90ecc19dda9f63d3aa9636
src/views/followvisit/record/detailpage/index.vue
@@ -127,10 +127,9 @@
              </el-tooltip>
            </template>
          </el-table-column>
                <el-table-column
          <el-table-column
            v-if="
              orgname == '景宁畲族自治县人民医院' ||
              orgname == '丽水市中医院'
              orgname == '景宁畲族自治县人民医院' || orgname == '丽水市中医院'
            "
            label="拨号状态"
            width="120"
@@ -305,8 +304,6 @@
            show-overflow-tooltip
          >
          </el-table-column>
          <el-table-column
            prop="bankcardno"
@@ -761,7 +758,13 @@
          <!-- 顶部操作区域 -->
          <div class="section-header">
            <h3><i class="el-icon-s-operation"></i> 人工处理</h3>
            <div class="header-actions">
              <div v-if="form.doctorOpinion2" class="last-opinion">
                <i class="el-icon-sunny"></i>
                <span class="last-opinion-label">上次的处理意见:</span>
                <span class="last-opinion-text">{{ form.doctorOpinion2 }}</span>
              </div>
              <!-- 基础操作按钮组 -->
              <div class="action-group basic-actions">
                <el-button type="primary" plain @click="alterpatient('')">
@@ -841,6 +844,8 @@
              </div>
            </div>
          </div>
          <!-- 表单区域 -->
          <div class="form-content">
@@ -1060,6 +1065,14 @@
                  </el-button>
                  <el-button plain type="info" @click="Editsingletaskson('5')">
                    人工随访
                  </el-button>
                  <el-button
                    plain
                    v-if="orgname != '缙云第二人民医院'"
                    type="primary"
                    @click="Editsingletaskson('7')"
                  >
                    回院复查复诊
                  </el-button>
                  <el-button
                    type="primary"
@@ -1321,6 +1334,15 @@
                v-model="form.remark2"
              ></el-input>
            </el-form-item>
            <el-form-item label="处理意见">
              <el-input
                class="custom-disabled"
                type="textarea"
                disabled
                v-model="form.doctorOpinion2"
                placeholder="无"
              ></el-input>
            </el-form-item>
          </el-collapse-item>
          <!-- 下次随访信息 - 默认展开 -->
@@ -1371,7 +1393,10 @@
              </el-col>
            </el-row>
            <el-form-item label="随访类型" prop="resource">
              <el-radio-group v-model="form.resource">
              <el-radio-group
                v-model="form.resource"
                @change="handleResourceChange"
              >
                <el-radio label="1">本病区随访</el-radio>
                <el-radio label="2">随访中心随访</el-radio>
              </el-radio-group>
@@ -1379,11 +1404,12 @@
            <el-form-item label="随访记录" :required="form.resource == '2'">
              <el-input type="textarea" v-model="form.remark"></el-input>
            </el-form-item>
            <el-form-item label="医生处理意见" prop="doctorOpinion">
              <el-input
                type="textarea"
                v-model="form.doctorOpinion"
              ></el-input>
            <el-form-item
              label="医生处理意见"
              prop="doctorOpinion"
              :required="isDoctorOpinionRequired"
            >
              <el-input type="textarea" v-model="form.doctorOpinion"></el-input>
            </el-form-item>
          </el-collapse-item>
        </el-collapse>
@@ -1439,6 +1465,7 @@
import {
  messagelistpatient,
  alterpatient,
  particularpatient,
  listcontactinformation,
} from "@/api/patient/homepage";
import CallButton from "@/components/CallButton";
@@ -1688,8 +1715,19 @@
            trigger: "change",
          },
        ],
        // 医生处理意见:仅「随访中心随访」+「丽水市中医院」时必填,其余情况不校验
        doctorOpinion: [
          { required: true, message: "请输入医生处理意见", trigger: "blur" },
          {
            validator: (rule, value, callback) => {
              const needRequired =
                this.form.resource == "2" && this.orgname === "丽水市中医院";
              if (needRequired && !String(value || "").trim()) {
                return callback(new Error("请输入医生处理意见"));
              }
              callback();
            },
            trigger: "blur",
          },
        ],
      },
      userrules: {
@@ -1809,7 +1847,8 @@
    unansweredQuestions() {
      return (this.tableDatatop || [])
        .map((item, i) => ({ index: i + 1, title: item.scriptContent || "未命名题目", raw: item }))
        .filter((q) => !this.hasOptionValue(q.raw));
        // astrict=1 表示该题因选项跳转被跳过(已隐藏),跳过题不算“未作答”
        .filter((q) => !q.raw.astrict && !this.hasOptionValue(q.raw));
    },
    callStatusText() {
      if (this.customCallStatus) {
@@ -1833,6 +1872,10 @@
        failed: "error",
      };
      return typeMap[this.callStatus];
    },
    // 医生处理意见是否必填:随访类型选「随访中心随访」且当前机构为丽水市中医院
    isDoctorOpinionRequired() {
      return this.form.resource == "2" && this.orgname === "丽水市中医院";
    },
    // 是否以问卷形式展示(非语音服务,或语音服务但无完整语音数据需手动填报)
    showQuestionnaireForm() {
@@ -1859,13 +1902,7 @@
    this.orgname = localStorage.getItem("orgname");
    console.log(localStorage.getItem("orgname"));
    if (
      this.orgname == "省立同德翠苑院区" ||
      this.orgname == "省立同德之江院区" ||
      this.orgname == "省立同德闲林院区" ||
      this.orgname == "省立同德青山湖院区" ||
      this.orgname == "省立同德天目山路院区"
    ) {
    if (this.isTongdeCampus) {
      this.showContinuationCareBtn = true;
    }
@@ -2008,6 +2045,35 @@
        const newPos = start + text.length;
        target.setSelectionRange(newPos, newPos);
      });
      // 快捷语包含“死亡”时,过滤排除该患者
      if (text && text.includes("死亡")) {
        this.filterDeathPatient(text);
      }
    },
    // 快捷语包含“死亡”时过滤排除患者(参考 discharge 页患者过滤)
    filterDeathPatient(text) {
      this.$modal
        .confirm(
          "该快捷语包含“死亡”,确认将该患者过滤排除吗?过滤后该患者所有进行中任务将全部停止,且无法匹配新的随访任务,请谨慎操作!"
        )
        .then(() => {
          particularpatient(this.patid).then((response) => {
            const patient = response.data;
            patient.isoperation = 2;
            patient.notrequiredFlag = 1;
            patient.notrequiredreason = text;
            patient.filterDrname = store.getters.nickName;
            alterpatient(patient).then((res) => {
              if (res.code == 200) {
                this.$modal.msgSuccess("患者过滤成功");
              } else {
                this.$modal.msgError("患者过滤失败");
              }
            });
          });
        })
        .catch(() => {});
    },
    // 获取问卷数据
    getsearchrResults(id) {
@@ -2047,6 +2113,8 @@
          });
          this.taskname = res.data.taskName;
          this.overdata();
          // 根据已保存答案回放选项跳转逻辑,恢复被跳过题目的隐藏状态
          this.restoreJumpState();
        }
      });
    },
@@ -2388,6 +2456,26 @@
        if (this.visitCount != 1) {
          this.$router.push({
            path: "/logisticsservice/again",
          });
        } else {
          this.$router.push({
            path: "/followvisit/discharge",
          });
        }
      } else if (this.form.serviceType == 3) {
        if (this.visitCount != 1) {
          this.$router.push({
            path: "/logisticsservice/OutpatientAgain",
          });
        } else {
          this.$router.push({
            path: "/followvisit/discharge",
          });
        }
      } else if (this.form.serviceType == 19) {
        if (this.visitCount != 1) {
          this.$router.push({
            path: "/logisticsservice/operationAgain",
          });
        } else {
          this.$router.push({
@@ -2762,7 +2850,8 @@
          console.log(this.form.templatename, "templatename");
          this.form.remark = this.form.remark || "";
          this.form.doctorOpinion = this.form.doctorOpinion || "";
          this.form.doctorOpinion2 = this.form.doctorOpinion || "";
          this.form.doctorOpinion = "";
          this.logsheetlist = res.rows[0].serviceSubtaskList;
          this.templateid = this.form.templateid;
          this.selectedTag = this.form.excep;
@@ -3196,6 +3285,71 @@
        }
      });
    },
    // 根据已保存答案回放“选项跳转”逻辑,恢复被跳过题目的隐藏状态(astrict)
    restoreJumpState() {
      const list = this.tableDatatop;
      if (!list || !list.length) return;
      // 先全部置为可见
      list.forEach((item) => {
        this.$set(item, "astrict", 0);
        this.$set(item, "hiddenByEnd", false);
      });
      for (let i = 0; i < list.length; ) {
        const q = list[i];
        let jumped = false;
        // 只有“单选 + 由选项配置跳转”且已作答的题目才可能产生跳转
        if (q.branchFlag == 1 && q.scriptType == 1 && this.hasOptionValue(q)) {
          const opt = (q.svyTaskTemplateTargetoptions || []).find(
            (o) => o.optioncontent == q.scriptResult
          );
          const next = opt ? opt.nextQuestion : null;
          if (next !== null && next !== undefined && next !== "") {
            const targetNum = Number(next);
            // 结束问答:隐藏后面所有题
            if (targetNum === 0) {
              for (let j = i + 1; j < list.length; j++) {
                this.$set(list[j], "astrict", 1);
                this.$set(list[j], "hiddenByEnd", true);
              }
              break;
            }
            const target = targetNum - 1; // 转 0-indexed
            if (target > i && target < list.length) {
              // 隐藏当前题和目标题之间的题
              for (let j = i + 1; j < target; j++) {
                this.$set(list[j], "astrict", 1);
                this.$set(list[j], "hiddenByEnd", false);
              }
              // 目标题保持可见
              this.$set(list[target], "astrict", 0);
              this.$set(list[target], "hiddenByEnd", false);
              i = target;
              jumped = true;
            }
          }
        }
        if (!jumped) {
          i++;
        }
      }
      this.$forceUpdate();
    },
    // 切换随访类型后,重置医生处理意见的校验状态(必填条件随类型变化)
    handleResourceChange() {
      this.$nextTick(() => {
        if (this.$refs.zcform) {
          this.$refs.zcform.clearValidate("doctorOpinion");
        }
      });
    },
    // 创建再次随访服务
    setupsubtask() {
      this.$refs["zcform"].validate((valid) => {
@@ -3211,6 +3365,10 @@
          this.form.remark =
            this.form.remark + "【" + this.getCurrentTime() + "】";
          let form = structuredClone(this.form);
          // 再次随访即“回院复查复诊”:处理意见置为 suggest=7
          if (String(form.suggest) !== "7") {
            form.suggest = "7";
          }
          form.visitTime = this.parseTime(form.date1);
          form.finishtime = "";
          if (form.resource) {
@@ -4248,6 +4406,41 @@
  }
}
/* 上次的处理意见 */
.last-opinion {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  padding: 8px 14px;
  background: linear-gradient(135deg, #ecfdf5 0%, #f0fdfa 100%);
  border: 1px solid #d1fae5;
  border-left: 4px solid #10b981;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(16, 185, 129, 0.08);
  line-height: 1.5;
  > i {
    font-size: 18px;
    color: #10b981;
    flex-shrink: 0;
  }
  .last-opinion-label {
    font-size: 13px;
    color: #059669;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .last-opinion-text {
    font-size: 14px;
    color: #334155;
    word-break: break-word;
    white-space: pre-wrap;
  }
}
/* 通话控制区域 */
.call-controls {
  margin: 15px 0;