WXL
2024-11-26 007d3884ad259883d7a5db6714876e46525ae717
src/views/followvisit/record/detailpage/index.vue
@@ -28,20 +28,30 @@
          </el-table-column>
          <el-table-column prop="sendstate" align="center" label="服务状态">
            <template slot-scope="scope">
            <div v-if="scope.row.sendstate == 1">
              <el-tag type="primary"
              :disable-transitions="false">被领取</el-tag></div>
            <div v-if="scope.row.sendstate == 2">
              <el-tag type="primary"
              :disable-transitions="false">待发送</el-tag>
              <div v-if="scope.row.sendstate == 1">
                <el-tag type="primary" :disable-transitions="false"
                  >被领取</el-tag
                >
              </div>
            <div v-if="scope.row.sendstate == 3"> <el-tag type="success"
              :disable-transitions="false">已发送未领取</el-tag></div>
            <div v-if="scope.row.sendstate == 4"> <el-tag type="info"
              :disable-transitions="false">不执行</el-tag></div>
            <div v-if="scope.row.sendstate == 5"> <el-tag type="danger"
              :disable-transitions="false">发送失败</el-tag></div>
          </template>
              <div v-if="scope.row.sendstate == 2">
                <el-tag type="primary" :disable-transitions="false"
                  >待发送</el-tag
                >
              </div>
              <div v-if="scope.row.sendstate == 3">
                <el-tag type="success" :disable-transitions="false"
                  >已发送未领取</el-tag
                >
              </div>
              <div v-if="scope.row.sendstate == 4">
                <el-tag type="info" :disable-transitions="false">不执行</el-tag>
              </div>
              <div v-if="scope.row.sendstate == 5">
                <el-tag type="danger" :disable-transitions="false"
                  >发送失败</el-tag
                >
              </div>
            </template>
          </el-table-column>
          <el-table-column
            prop="finishtime"
@@ -177,19 +187,20 @@
      </div>
    </div>
    <div>
      <el-tabs type="border-card">
        <el-tab-pane>
      <el-tabs v-model="activeName" type="border-card">
        <el-tab-pane name="wj">
          <span class="mulsz" slot="label"
            ><i class="el-icon-notebook-1"></i> 问卷随访结果</span
          >
          <div class="CONTENT">
            <div class="title">{{ taskname ? taskname : "问卷" }}</div>
            <div class="preview-left">
            <!-- 问卷任务展示 -->
            <div class="preview-left" v-if="!Voicetype">
              <!-- 单选 -->
              <div
                class="topic-dev"
                v-for="(item, index) in tableDatatop"
                :key="item.aaa"
                :key="item.id"
              >
                <div
                  :class="
@@ -280,30 +291,121 @@
                </div>
              </div>
            </div>
            <el-button type="primary" @click="getdetail">保存问卷</el-button>
            <!-- 语音问卷形式展示 -->
            <div class="preview-left" v-else>
              <!-- 单选 -->
              <div
                class="topic-dev"
                v-for="(item, index) in tableDatatop"
                :key="item.id"
              >
                <div v-if="item.targetvalue">
                  <div class="dev-text">
                    {{ index + 1 }}、[单选]<span>{{ item.questiontext }}</span>
                  </div>
                  <div class="dev-xx">
                    <el-radio-group
                      v-model="item.matchedtext"
                      @change="handleOptionChange($event, index, item)"
                    >
                      <el-radio
                        v-for="(items, index) in item.scriptResult"
                        :key="items"
                        :label="items"
                        >{{ items }}</el-radio
                      >
                    </el-radio-group>
                  </div>
                  <div v-show="item.prompt">
                    <el-alert :title="item.prompt" type="warning"> </el-alert>
                  </div>
                </div>
                <!-- 填空 -->
                <div class="scriptTopic-dev" :key="index" v-else>
                  <div class="dev-text">
                    {{ index + 1 }}、[问答]<span>{{ item.questiontext }}</span>
                  </div>
                  <div class="dev-xx">
                    <el-input
                      type="textarea"
                      :rows="2"
                      placeholder="请输入答案"
                      v-model="item.matchedtext"
                      clearable
                    >
                    </el-input>
                  </div>
                </div>
              </div>
            </div>
            <el-button v-if="Voicetype" type="primary" @click="yuyingetdetail"
              >保存服务详情</el-button
            >
            <el-button v-else type="primary" @click="getdetail"
              >保存服务详情</el-button
            >
          </div>
        </el-tab-pane>
        <el-tab-pane>
        <!-- 语音随访详情---------------------- -->
        <el-tab-pane name="yy">
          <span class="mulsz" slot="label"
            ><i class="el-icon-headset"></i> 语音随访详情</span
          >
          <div class="borderdiv">
            <div>
              <div class="leftside">
                <i class="el-icon-phone-outline"></i
                ><span>您今天身体情况怎么样</span>
              </div>
              <div class="offside">
                <i class="el-icon-user"></i>
                <div class="offside-value">
                  <el-input v-model="input"></el-input>
                  <el-radio v-model="radio" label="1">很棒</el-radio>
                  <el-radio v-model="radio" label="2">还可以</el-radio>
                  <el-radio v-model="radio" label="3">不太好</el-radio>
                  <el-radio v-model="radio" label="4">比较差</el-radio>
            <div class="title">{{ taskname ? taskname : "问卷" }}</div>
            <div
              style="
                display: flex;
                text-align: center;
                align-items: center;
                color: #59a0f0;
              "
            >
              完整语音:
              <mini-audio
                :audio-source="
                  voice ? voice : 'https://example.com/example.mp3'
                "
              ></mini-audio>
            </div>
            <div class="preview-left">
              <div v-for="item in voiceDatatop">
                <div class="leftside">
                  <i class="el-icon-phone-outline"></i
                  ><span>{{ item.questiontext }}</span>
                </div>
                <div class="offside">
                  <i class="el-icon-user"></i>
                  <div class="offside-value">
                    <el-input
                      type="textarea"
                      :autosize="{ minRows: 1 }"
                      v-model="item.asrtext"
                    ></el-input>
                    <!-- <el-radio v-model="radio" label="1">很棒</el-radio>
                    <el-radio v-model="radio" label="2">还可以</el-radio>
                    <el-radio v-model="radio" label="3">不太好</el-radio>
                    <el-radio v-model="radio" label="4">比较差</el-radio> -->
                    <div>
                      <mini-audio
                        :audio-source="
                          item.questionvoice
                            ? item.questionvoice
                            : 'https://example.com/example.mp3'
                        "
                      ></mini-audio>
                    </div>
                  </div>
                </div>
              </div>
            </div>
            <el-button v-if="Voicetype" type="primary" @click="yuyingetdetail"
              >保存随访详情</el-button
            >
            <el-button v-else type="primary" @click="getdetail"
              >保存随访详情</el-button
            >
          </div>
        </el-tab-pane>
      </el-tabs>
@@ -314,23 +416,30 @@
<script>
import {
  getsearchrResults,
  getPersonVoices,
  getTaskservelist,
  getTaskparticty,
  Editsingletaskson,
  serviceSubtaskDetailedit,
  serviceSubtaskDetailadd,
  updatePersonVoices,
} from "@/api/AiCentre/index";
export default {
  dicts: ["sys_normal_disable", "sys_user_sex", "sys_yujing", "sys_suggest"],
  data() {
    return {
      radio: "1",
      userid: "",
      input: "今天身体还不错",
      radio: "2",
      taskname: "",
      activeName: "wj",
      voice: "",
      tableDatatop: [], //题目表
      voiceDatatop: [], //题目表
      Whetherall: false, //是否全部记录展示
      Voicetype: 0, //是否为语音服务
      logsheetlist: [],
      topicobj: {},
      sendname: null,
      serviceType: null,
      id: null,
@@ -344,8 +453,13 @@
    this.id = this.$route.query.id;
    this.sendname = this.$route.query.sendname;
    this.patid = this.$route.query.patid;
    this.Voicetype = this.$route.query.Voicetype;
    this.serviceType = this.$route.query.serviceType;
    this.getsearchrResults();
    if (this.Voicetype) {
      this.getPersonVoices();
    } else {
      this.getsearchrResults();
    }
    this.getTaskservelist(this.taskid);
  },
@@ -356,7 +470,7 @@
        taskid: this.taskid,
        patid: this.patid,
        subId: this.id,
        isFinish:false,
        isFinish: false,
      }).then((res) => {
        if (res.code === 200) {
          this.tableDatatop = res.data.scriptResult.script;
@@ -371,6 +485,42 @@
          });
          this.taskname = res.data.taskName;
          this.overdata();
        }
      });
    },
    // 获取语音数据
    getPersonVoices() {
      let obj = {
        taskid: this.taskid,
        patid: this.patid,
        subId: this.id,
      };
      console.log(this.voiceDatatop, "111");
      getPersonVoices(obj).then((res) => {
        console.log("222");
        if (res.code == 200) {
          this.voiceDatatop = res.data.serviceSubtaskDetails;
          this.voice = res.data.voice;
          this.activeName = "yy";
          this.taskname = res.data.taskName;
          // 问卷展示数据处理
          this.tableDatatop = res.data.filteredDetails;
          this.tableDatatop.forEach((item) => {
            if (item.targetvalue) {
              item.scriptResult = item.targetvalue.split("&");
            } else {
              item.scriptResult = [];
            }
          });
        }
      });
    },
    // 获取问卷完整数据比对
    puttaskid(id) {
      getTaskparticty(id).then((res) => {
        if (res.code == 200) {
        }
      });
    },
@@ -419,6 +569,16 @@
      });
      this.Editsingletasksonyic(excep);
    },
    yuyingetdetail() {
      this.tableDatatop.forEach((item) => {
        item.scriptResult = item.scriptResult.join("&");
      });
      updatePersonVoices(this.tableDatatop).then((res) => {
        if (res.code == 200) {
          this.$modal.msgSuccess("服务修改成功");
        }
      });
    },
    // 获取患者记录
    getTaskservelist(taskid) {
      this.taskid = taskid;
@@ -433,6 +593,7 @@
      }).then((res) => {
        if (res.code == 200) {
          this.logsheetlist = res.rows[0].serviceSubtaskList;
          this.puttaskid(this.logsheetlist[0].templateid)
        }
      });
    },
@@ -462,7 +623,7 @@
      }).then((res) => {
        if (res.code == 200) {
          objson = res.rows[0].serviceSubtaskList[0];
          console.log(objson,'obj');
          console.log(objson, "obj");
          objson.excep = excep;
          Editsingletaskson(objson).then((res) => {
@@ -550,8 +711,14 @@
  min-height: 60vh;
  font-size: 20px;
  padding: 30px;
  .title {
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 20px;
    text-align: center;
  }
  .leftside {
    margin-bottom: 30px;
    margin: 30px 0;
    span {
      width: 400px;
      margin-left: 20px;
@@ -627,6 +794,10 @@
    right: -5px; /* 根据需要调整 */
    top: 0;
  }
  ::v-deep.el-input-group__textarea {
    white-space: pre-wrap; /* 保持空白符序列并正常换行 */
    word-break: break-all; /* 在长单词或URL地址内部进行换行 */
  }
  ::v-deep.el-checkbox__label {
    position: relative;
    padding-right: 10px; /* 根据需要调整 */