WXL
2025-01-16 09a1bd58e04706d7e1d6e1543b990c08a4b8f97c
src/views/followvisit/record/detailpage/index.vue
@@ -26,7 +26,12 @@
        <el-table :data="logsheetlist" style="width: 100%">
          <el-table-column prop="sendname" align="center" label="姓名">
          </el-table-column>
          <el-table-column prop="sendstate" align="center" label="服务状态">
          <el-table-column
            prop="sendstate"
            align="center"
            width="200"
            label="服务状态"
          >
            <template slot-scope="scope">
              <div v-if="scope.row.sendstate == 1">
                <el-tag type="primary" :disable-transitions="false"
@@ -163,27 +168,39 @@
      </div>
    </div>
    <div class="Followuserinfo">
      <div>
        <div class="headline">
          <div>人工处理意见</div>
          <div>人工处理</div>
          <div style="margin-left: 30px;"><el-button type="warning"
                >一键呼叫</el-button
              ></div>
        </div>
        <div style="margin-left: 30px">
          <el-button type="warning" @click="Editsingletaskson('1')"
            >暂不处理</el-button
          >
          <el-button type="success" @click="Editsingletaskson('2')"
            >病情稳定</el-button
          >
          <el-button type="primary" @click="Editsingletaskson('3')"
            >通知就诊</el-button
          >
          <!-- <el-button type="danger" @click="Editsingletaskson('4')"
            >失访</el-button
          > -->
          <el-button type="info" @click="Editsingletaskson('5')"
            >人工随访</el-button
          >
        </div>
        <el-form ref="form" :model="form" label-width="80px">
          <el-form-item label="随访记录">
            <el-input type="textarea" v-model="form.remark"></el-input>
          </el-form-item>
          <el-form-item label="处理意见">
            <div>
              <el-button plain type="warning" @click="Editsingletaskson('1')"
                >暂不处理</el-button
              >
              <el-button plain type="success" @click="Editsingletaskson('2')"
                >病情稳定</el-button
              >
              <el-button plain type="primary" @click="Editsingletaskson('3')"
                >通知就诊</el-button
              >
              <!-- <el-button type="danger" @click="Editsingletaskson('4')"
    >失访</el-button
  > -->
              <el-button plain type="info" @click="Editsingletaskson('5')"
                >中心随访</el-button
              >
            </div>
          </el-form-item>
        </el-form>
      </div>
    </div>
    <div>
@@ -418,11 +435,12 @@
  getsearchrResults,
  getPersonVoices,
  getTaskservelist,
  getTaskparticty,
  getTaskFollowup,
  Editsingletaskson,
  serviceSubtaskDetailedit,
  serviceSubtaskDetailadd,
  updatePersonVoices,
  addPersonVoices,
} from "@/api/AiCentre/index";
export default {
  dicts: ["sys_normal_disable", "sys_user_sex", "sys_yujing", "sys_suggest"],
@@ -434,6 +452,8 @@
      taskname: "",
      activeName: "wj",
      voice: "",
      templateid: "",
      form: {},
      tableDatatop: [], //题目表
      voiceDatatop: [], //题目表
      Whetherall: false, //是否全部记录展示
@@ -455,11 +475,7 @@
    this.patid = this.$route.query.patid;
    this.Voicetype = this.$route.query.Voicetype;
    this.serviceType = this.$route.query.serviceType;
    if (this.Voicetype) {
      this.getPersonVoices();
    } else {
      this.getsearchrResults();
    }
    this.getTaskservelist(this.taskid);
  },
@@ -513,14 +529,34 @@
              item.scriptResult = [];
            }
          });
          if (!this.tableDatatop.length) {
            this.puttaskid(this.templateid);
          }
        }
      });
    },
    // 获取问卷完整数据比对
    puttaskid(id) {
      getTaskparticty(id).then((res) => {
      getTaskFollowup(id).then((res) => {
        if (res.code == 200) {
          this.tableDatatop = res.data.ivrTaskTemplateScriptVOList;
          this.tableDatatop.forEach((item) => {
            item.id = null;
            // 类型判断赋值
            if (item.ivrTaskScriptTargetoptionList) {
              item.targetvalue = 1;
              item.questiontext = item.scriptContent;
              item.targetvalue = item.ivrTaskScriptTargetoptionList
                .map((obj) => obj.targetvalue)
                .join("&");
            }
            if (item.targetvalue) {
              item.scriptResult = item.targetvalue.split("&");
            } else {
              item.scriptResult = [];
            }
          });
          console.log(this.tableDatatop, "this.tableDatatop");
        }
      });
    },
@@ -570,14 +606,30 @@
      this.Editsingletasksonyic(excep);
    },
    yuyingetdetail() {
      this.tableDatatop.forEach((item) => {
      this.tableDatatop.forEach((item, index) => {
        console.log(item.scriptResult, "scriptResult");
        item.scriptResult = item.scriptResult.join("&");
        item.templatequestionnum = index + 1;
        item.subId = this.id;
        item.taskid = this.taskid;
        item.asrtext = item.matchedtext;
        item.isoperation = 1;
        item.patid = this.patid;
        item.templateid = item.templateID;
      });
      updatePersonVoices(this.tableDatatop).then((res) => {
        if (res.code == 200) {
          this.$modal.msgSuccess("服务修改成功");
        }
      });
      if (this.tableDatatop[0].id) {
        updatePersonVoices(this.tableDatatop).then((res) => {
          if (res.code == 200) {
            this.$modal.msgSuccess("服务修改成功");
          }
        });
      } else {
        addPersonVoices(this.tableDatatop).then((res) => {
          if (res.code == 200) {
            this.$modal.msgSuccess("服务保存成功");
          }
        });
      }
    },
    // 获取患者记录
    getTaskservelist(taskid) {
@@ -592,8 +644,15 @@
        taskid: taskid,
      }).then((res) => {
        if (res.code == 200) {
          this.form = res.rows[0].serviceSubtaskList[0];
          console.log(this.form,'form3');
          this.logsheetlist = res.rows[0].serviceSubtaskList;
          this.puttaskid(this.logsheetlist[0].templateid)
          this.templateid = this.logsheetlist[0].templateid;
        }
        if (this.Voicetype) {
          this.getPersonVoices();
        } else {
          this.getsearchrResults();
        }
      });
    },
@@ -604,7 +663,7 @@
        taskid: this.taskid,
      }).then((res) => {
        if (res.code == 200) {
          objson = res.rows[0];
          objson = res.rows[0].serviceSubtaskList[0];
          objson.suggest = son;
          Editsingletaskson(objson).then((res) => {
            if (res.code) {
@@ -623,8 +682,6 @@
      }).then((res) => {
        if (res.code == 200) {
          objson = res.rows[0].serviceSubtaskList[0];
          console.log(objson, "obj");
          objson.excep = excep;
          Editsingletaskson(objson).then((res) => {
            if (res.code) {
@@ -646,9 +703,17 @@
        .catch(() => {});
    },
    handleOptionChange(a, b, c) {
      var obj = this.tableDatatop[b].svyLibTemplateTargetoptions.find(
        (item) => item.optioncontent == a
      );
      console.log(this.tableDatatop[b], "this.tableDatatop[b]");
      if (this.Voicetype) {
        var obj = this.tableDatatop[b].ivrTaskScriptTargetoptionList.find(
          (item) => item.optioncontent == a
        );
      } else {
        var obj = this.tableDatatop[b].svyLibTemplateTargetoptions.find(
          (item) => item.optioncontent == a
        );
      }
      if (obj.isabnormal) {
        this.tableDatatop[b].isabnormal = true;
      } else {