WXL
2024-06-27 76c30727c77065c808b1c0fb3146080e423e5fe6
src/views/repositoryai/templateku/configurat/index.vue
@@ -2,14 +2,27 @@
  <div class="Questionnairemanagement">
    <!-- 左侧栏 -->
    <div class="sidecolumn">
      <div style="height: 400px">
        <el-steps direction="vertical" :active="Editprogress">
          <el-step title="基础信息"></el-step>
          <el-step title="随访模版题目"></el-step>
          <el-step
            title="随访模版预览"
            description="查看随访模版预览,可导出PDF"
          ></el-step>
      <div>
        <el-steps finish-status="success" :active="Editprogress" simple>
          <el-step>
            <template slot="title">
              <span style="cursor: pointer" @click="Editprogress = 1"
                >基础信息</span
              >
            </template>
          </el-step>
          <el-step>
            <template slot="title">
              <span style="cursor: pointer" @click="Editprogress = 2"
                >随访模版题目</span
              >
            </template>
          </el-step>
          <el-step description="查看随访模版预览,可导出PDF">
            <template slot="title">
              <span style="cursor: pointer" @click="preview">随访模版预览</span>
            </template>
          </el-step>
        </el-steps>
      </div>
    </div>
@@ -73,9 +86,10 @@
            </div>
          </el-form-item>
          <el-row :gutter="20">
            <el-col :span="10">
            <el-col :span="12">
              <el-form-item label="版本号" prop="version">
                <el-input
                  style="width: 220px"
                  v-model="ruleForm.version"
                  placeholder="默认1.0.1"
                ></el-input> </el-form-item
@@ -100,7 +114,7 @@
          </el-row>
          <el-row :gutter="20">
            <el-col :span="10">
            <el-col :span="12">
              <el-form-item label="语言" prop="name">
                <el-select
                  v-model="ruleForm.language"
@@ -241,6 +255,7 @@
          </el-form-item>
          <el-form-item label="适用院区" prop="region">
            <el-select
              style="width: 500px"
              v-model="ruleForm.campus"
              size="medium"
              multiple
@@ -259,6 +274,7 @@
          </el-form-item>
          <el-form-item label="适用科室" prop="region">
            <el-cascader
              style="width: 500px"
              v-model="tempDetpRelevanceslist"
              :options="deptList"
              :props="props"
@@ -283,73 +299,62 @@
              <el-option
                class="ruleFormaa"
                v-for="item in generallist"
                :key="item.value"
                :label="item.label"
                :value="item.value"
                :key="item.id"
                :label="item.extName"
                :value="item.id"
              >
              </el-option>
            </el-select>
          </el-form-item>
          <el-row :gutter="20">
            <el-col :span="8">
            <el-col :span="12">
              <el-form-item label="随访前处理" prop="name">
                <el-select
                  v-model="ruleForm.prefollowup"
                  size="medium"
                  filterable
                  placeholder="请选择"
                >
                  <el-option
                    class="ruleFormaa"
                    v-for="item in prefollowuplist"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                  >
                  </el-option>
                </el-select> </el-form-item
                <el-input
                  type="textarea"
                  show-word-limit
                  v-model="ruleForm.revisitBefore"
                ></el-input></el-form-item
            ></el-col>
            <el-col :span="9">
            <el-col :span="12">
              <el-form-item label="随访后处理" prop="region">
                <el-select
                  v-model="ruleForm.postfollowup"
                  size="medium"
                  filterable
                  placeholder="请选择分类"
                >
                  <el-option
                    class="ruleFormaa"
                    v-for="item in postfollowuplist"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                  >
                  </el-option>
                </el-select> </el-form-item
                <el-input
                  type="textarea"
                  show-word-limit
                  v-model="ruleForm.revisitAfter"
                ></el-input> </el-form-item
            ></el-col>
          </el-row>
          <el-row :gutter="20">
            <el-col :span="10">
            <el-col :span="8">
              <el-form-item label="静默时间(秒)" prop="name">
                <div style="width: 40%">
                  <el-input
                    v-model="ruleForm.name"
                    v-model="ruleForm.silencetime"
                  ></el-input></div></el-form-item
            ></el-col>
            <el-col :span="10">
            <el-col :span="8">
              <el-form-item label="静默次数" prop="name">
                <div style="width: 40%">
                  <el-input
                    v-model="ruleForm.noVoiceNum"
                  ></el-input></div></el-form-item
            ></el-col>
            <el-col :span="8">
              <el-form-item label="无匹配重复(次)" prop="region">
                <div style="width: 40%">
                  <el-input v-model="ruleForm.name"></el-input>
                  <el-input v-model="ruleForm.mateNum"></el-input>
                </div> </el-form-item
            ></el-col>
          </el-row>
          <el-form-item>
            <el-button type="success" @click="nextstep('ruleForm')"
            <el-button type="success" plain @click="nextstep('ruleForm')"
              >下一步</el-button
            >
            <el-button type="info" @click="closeFm('ruleForm')">关闭</el-button>
            <el-button @click="Departmenttreatment('ruleForm')"
              >保存随访模版基础信息</el-button
            <el-button
              type="success"
              @click="Departmenttreatment('ruleForm')"
              >{{ task ? "保存到任务模版" : "保存随访模版基础信息" }}</el-button
            >
          </el-form-item>
        </el-form>
@@ -377,8 +382,8 @@
                <el-table-column
                  label="编号"
                  align="center"
                  key="guid"
                  prop="guid"
                  key="targetid"
                  prop="targetid"
                />
                <el-table-column
                  label="标题"
@@ -450,6 +455,12 @@
                  <el-input
                    v-model="topicobj.questiontitle"
                    placeholder="请从左侧列表选择"
                  ></el-input>
                </el-form-item>
                <el-form-item label="问题节点">
                  <el-input
                    v-model="topicobj.targetid"
                    placeholder="请从左侧列表选择"
                    :disabled="true"
                  ></el-input>
                </el-form-item>
@@ -457,8 +468,8 @@
                  <el-col :span="12"
                    ><el-form-item label="是否必填">
                      <el-select
                        v-model="topicobj.ismandatory"
                        placeholder="请选择"
                        v-model="topicobj.isMust"
                        placeholder="默认必填"
                      >
                        <el-option
                          v-for="item in required"
@@ -470,13 +481,14 @@
                      </el-select> </el-form-item
                  ></el-col>
                  <el-col :span="12"
                    ><el-form-item label="是否可用">
                    ><el-form-item label="取值类型">
                      <el-select
                        v-model="topicobj.isavailable"
                        v-model="topicobj.valueType"
                        placeholder="请选择"
                        :disabled="true"
                      >
                        <el-option
                          v-for="item in usable"
                          v-for="item in valuetype"
                          :key="item.value"
                          :label="item.label"
                          :value="item.value"
@@ -485,297 +497,248 @@
                      </el-select> </el-form-item
                  ></el-col>
                </el-row>
                <div class="headline">
                  <div class="basics">选项设置</div>
                  <div class="headbottom">
                    <el-button
                      type="primary"
                      icon="el-icon-circle-plus-outline"
                      @click="addzbiao"
                      >添加指标</el-button
                    >
                  </div>
                </div>
                <div
                  class="topicxq"
                  v-for="item in topicobj.ivrLibaScriptTargetoptionList"
                  v-if="topicobj.valueType == 2 || topicobj.valueType == 3"
                >
                  <el-row :gutter="10">
                    <el-col :span="12"
                      ><el-form-item label="选项名">
                  <el-row>
                    <el-col :span="20">
                      <el-form-item label="收集内容">
                        <el-input
                          type="text"
                          placeholder="请输入"
                          v-model="item.targetvalue"
                          show-word-limit
                        >
                        </el-input> </el-form-item
                    ></el-col>
                    <el-col :span="12"
                      ><el-form-item label="节点ID">
                        <el-input
                          type="text"
                          placeholder="请输入节点"
                          v-model="item.targetid"
                          show-word-limit
                        >
                        </el-input> </el-form-item
                    ></el-col>
                  </el-row>
                  <el-row :gutter="10">
                    <el-col :span="12"
                      ><el-form-item label="处理">
                        <el-input
                          type="text"
                          placeholder="(默认)无声"
                          v-model="item.text"
                          maxlength="10"
                          show-word-limit
                        >
                        </el-input> </el-form-item
                    ></el-col>
                    <el-col :span="12"
                      ><el-form-item label="选中跳转(缺)">
                        <el-input
                          type="text"
                          placeholder="请输入题目节点"
                          v-model="item.jump"
                          show-word-limit
                        >
                        </el-input> </el-form-item
                    ></el-col>
                  </el-row>
                  <el-form-item label="匹配正则">
                    <el-input
                      style="width: 24vw"
                      type="textarea"
                      placeholder="请输入题号"
                      v-model="item.targetregex"
                      show-word-limit
                    >
                    </el-input>
                  </el-form-item>
                  <el-row :gutter="10">
                    <el-col :span="16">
                      <el-form-item label="语音文件">
                        <el-upload
                          class="upload-demo"
                          style="display: flex"
                          action="https://jsonplaceholder.typicode.com/posts/"
                          :on-change="handleChange"
                          :file-list="fileList"
                          :limit="1"
                          :on-exceed="handleExceed"
                        >
                          <el-button size="small" type="primary"
                            >点击上传</el-button
                          >
                        </el-upload>
                      </el-form-item></el-col
                    >
                    <el-col :span="8">
                      <div style="text-align: right; padding-right: 10px">
                        <el-button type="danger" round>删除</el-button>
                      </div>
                          style="width: 400px"
                          type="textarea"
                          v-model="topicobj.value"
                          placeholder="问题收集内容"
                        ></el-input>
                      </el-form-item>
                    </el-col>
                  </el-row>
                </div>
                <!-- 无匹配类型 -->
                <div class="topicxq">
                  <el-row :gutter="10">
                    <el-col :span="12"
                      ><el-form-item label="无匹配话术">
                        <el-input
                          type="text"
                          placeholder="请输入"
                          v-model="topicobj.nomatchtext"
                          show-word-limit
                        >
                        </el-input> </el-form-item
                    ></el-col>
                  </el-row>
                  <el-row :gutter="10">
                    <el-col :span="12"
                      ><el-form-item label="处理">
                        <el-input
                          type="text"
                          placeholder="(默认)无声"
                          v-model="topicobj.text"
                          maxlength="10"
                          show-word-limit
                        >
                        </el-input> </el-form-item
                    ></el-col>
                  </el-row>
                <div v-else>
                  <div class="headline">
                    <div class="basics">选项设置</div>
                    <!-- <div class="headbottom">
                      <el-button
                        type="primary"
                        icon="el-icon-circle-plus-outline"
                        @click="addzbiao"
                        >添加指标</el-button
                      >
                    </div> -->
                  </div>
                  <el-row :gutter="10">
                    <el-col :span="16">
                      <el-form-item label="语音文件">
                        <el-upload
                          class="upload-demo"
                          style="display: flex"
                          action="https://jsonplaceholder.typicode.com/posts/"
                          :on-change="handleChange"
                          :file-list="fileList"
                          :limit="1"
                          :on-exceed="handleExceed"
                        >
                          <el-button size="small" type="primary"
                            >点击上传</el-button
                  <Regular
                    :TargetoptionList="topicobj.ivrLibaScriptTargetoptionList"
                    @deloption="deloption"
                    :controlsc="false"
                  />
                  <!-- 无匹配类型 -->
                  <div class="topicxq">
                    <el-row :gutter="10">
                      <el-col :span="20"
                        ><el-form-item label="无匹配话术">
                          <el-input
                            type="textarea"
                            style="width: 400px"
                            placeholder="请输入"
                            v-model="topicobj.noMatchText"
                            show-word-limit
                          >
                        </el-upload>
                      </el-form-item></el-col
                    >
                  </el-row>
                </div>
                <div class="topicxq">
                  <el-row :gutter="10">
                    <el-col :span="12"
                      ><el-form-item label="听不清话术">
                        <el-input
                          type="text"
                          placeholder="请输入"
                          v-model="topicobj.noclearlytext"
                          show-word-limit
                        >
                        </el-input> </el-form-item
                    ></el-col>
                  </el-row>
                  <el-row :gutter="10">
                    <el-col :span="12"
                      ><el-form-item label="处理">
                        <el-input
                          type="text"
                          placeholder="(默认)无声"
                          v-model="topicobj.text"
                          maxlength="10"
                          show-word-limit
                        >
                        </el-input> </el-form-item
                    ></el-col>
                  </el-row>
                          </el-input> </el-form-item
                      ></el-col>
                    </el-row>
                    <!-- <el-row :gutter="10">
                      <el-col :span="12"
                        ><el-form-item label="处理">
                          <el-input
                            type="text"
                            placeholder="(默认)无声"
                            v-model="topicobj.text"
                            maxlength="10"
                            show-word-limit
                          >
                          </el-input> </el-form-item
                      ></el-col>
                    </el-row> -->
                  <el-row :gutter="10">
                    <el-col :span="16">
                      <el-form-item label="语音文件">
                        <el-upload
                          class="upload-demo"
                          style="display: flex"
                          action="https://jsonplaceholder.typicode.com/posts/"
                          :on-change="handleChange"
                          :file-list="fileList"
                          :limit="1"
                          :on-exceed="handleExceed"
                        >
                          <el-button size="small" type="primary"
                            >点击上传</el-button
                    <el-row :gutter="10">
                      <el-col :span="16">
                        <el-form-item label="语音文件">
                          <el-upload
                            class="upload-demo"
                            style="display: flex"
                            action="https://jsonplaceholder.typicode.com/posts/"
                            :on-change="handleChange"
                            :file-list="fileList"
                            :limit="1"
                            :on-exceed="handleExceed"
                          >
                        </el-upload>
                      </el-form-item></el-col
                    >
                  </el-row>
                </div>
                <div class="topicxq">
                  <el-row :gutter="10">
                    <el-col :span="12"
                      ><el-form-item label="静默话术">
                        <el-input
                          type="text"
                          placeholder="请输入"
                          v-model="topicobj.sliencetext"
                          show-word-limit
                        >
                        </el-input> </el-form-item
                    ></el-col>
                  </el-row>
                  <el-row :gutter="10">
                    <el-col :span="12"
                      ><el-form-item label="处理">
                        <el-input
                          type="text"
                          placeholder="(默认)无声"
                          v-model="topicobj.text"
                          maxlength="10"
                          show-word-limit
                        >
                        </el-input> </el-form-item
                    ></el-col>
                  </el-row>
                            <el-button size="small" type="primary"
                              >点击上传</el-button
                            >
                          </el-upload>
                        </el-form-item></el-col
                      >
                    </el-row>
                  </div>
                  <div class="topicxq">
                    <el-row :gutter="10">
                      <el-col :span="20"
                        ><el-form-item label="听不清话术">
                          <el-input
                            style="width: 400px"
                            type="textarea"
                            placeholder="请输入"
                            v-model="topicobj.noClearlyText"
                            show-word-limit
                          >
                          </el-input> </el-form-item
                      ></el-col>
                    </el-row>
                    <!-- <el-row :gutter="10">
                      <el-col :span="12"
                        ><el-form-item label="处理">
                          <el-input
                            type="text"
                            placeholder="(默认)无声"
                            v-model="topicobj.text"
                            maxlength="10"
                            show-word-limit
                          >
                          </el-input> </el-form-item
                      ></el-col>
                    </el-row> -->
                  <el-row :gutter="10">
                    <el-col :span="16">
                      <el-form-item label="语音文件">
                        <el-upload
                          class="upload-demo"
                          style="display: flex"
                          action="https://jsonplaceholder.typicode.com/posts/"
                          :on-change="handleChange"
                          :file-list="fileList"
                          :limit="1"
                          :on-exceed="handleExceed"
                        >
                          <el-button size="small" type="primary"
                            >点击上传</el-button
                    <el-row :gutter="10">
                      <el-col :span="16">
                        <el-form-item label="语音文件">
                          <el-upload
                            class="upload-demo"
                            style="display: flex"
                            action="https://jsonplaceholder.typicode.com/posts/"
                            :on-change="handleChange"
                            :file-list="fileList"
                            :limit="1"
                            :on-exceed="handleExceed"
                          >
                        </el-upload>
                      </el-form-item></el-col
                    >
                  </el-row>
                            <el-button size="small" type="primary"
                              >点击上传</el-button
                            >
                          </el-upload>
                        </el-form-item></el-col
                      >
                    </el-row>
                  </div>
                  <div class="topicxq">
                    <el-row :gutter="10">
                      <el-col :span="20"
                        ><el-form-item label="静默话术">
                          <el-input
                            type="textarea"
                            style="width: 400px"
                            placeholder="请输入"
                            v-model="topicobj.slienceText"
                            show-word-limit
                          >
                          </el-input> </el-form-item
                      ></el-col>
                    </el-row>
                    <!-- <el-row :gutter="10">
                      <el-col :span="12"
                        ><el-form-item label="处理">
                          <el-input
                            type="text"
                            placeholder="(默认)无声"
                            v-model="topicobj.text"
                            maxlength="10"
                            show-word-limit
                          >
                          </el-input> </el-form-item
                      ></el-col>
                    </el-row> -->
                    <el-row :gutter="10">
                      <el-col :span="16">
                        <el-form-item label="语音文件">
                          <el-upload
                            class="upload-demo"
                            style="display: flex"
                            action="https://jsonplaceholder.typicode.com/posts/"
                            :on-change="handleChange"
                            :file-list="fileList"
                            :limit="1"
                            :on-exceed="handleExceed"
                          >
                            <el-button size="small" type="primary"
                              >点击上传</el-button
                            >
                          </el-upload>
                        </el-form-item></el-col
                      >
                    </el-row>
                  </div>
                </div>
              </el-form>
            </el-card>
          </div>
        </div>
        <el-button type="success" @click="nextstep('ruleForm')"
          >下一步</el-button
        <el-button type="success" @click="Departmenttreatment('ruleForm')">{{
          task ? "保存到任务模版" : "保存题目数据"
        }}</el-button>
        <el-button type="primary" plain @click="laststep()">上一步</el-button>
        <el-button type="success" plain @click="preview('ruleForm')"
          >查看预览</el-button
        >
        <el-button type="primary" @click="laststep()">上一步</el-button>
        <el-button type="info" @click="closeFm('ruleForm')">关闭</el-button>
        <el-button @click="Departmenttreatment('ruleForm')"
          >保存题目数据</el-button
        >
      </div>
      <!-- 随访模版预览 -->
      <div v-if="Editprogress == 3">
        <div class="leftvlue-jbxx">随访模版预览</div>
        <div class="leftvlue-jbxx">随访模版问题预览</div>
        <el-divider></el-divider>
        <div class="preview-left">
          <!-- 单选 -->
          <div class="topic-dev" v-for="item in valssu" :key="item.aaa">
          <div
            class="topic-dev"
            v-for="(item, index) in valssu"
            :key="item.aaa"
          >
            <div class="dev-text">
              {{ item.idd }}、[单选]<span>{{ item.wssd }}</span>
              {{ index + 1 }}、[单选]<span>{{ item.questionText }}</span>
            </div>
            <div class="dev-xx">
              <el-radio-group v-model="radio">
                <el-radio
                  v-for="(items, index) in item.sdadd"
                  v-for="(items, index) in item.ivrLibaScriptTargetoptionList"
                  :key="index"
                  :label="index"
                  >{{ items }}</el-radio
                  >{{ items.targetvalue }}</el-radio
                >
              </el-radio-group>
            </div>
          </div>
          <!-- 多选 -->
          <div class="topic-dev" v-for="item in valssu" :key="item.aaa">
          <!-- <div
            class="topic-dev"
            v-for="(item, index) in valssu"
            :key="item.aaa"
          >
            <div class="dev-text">
              {{ item.idd }}、[多选]<span>{{ item.wssd }}</span>
              {{ index + 1 }}、[多选]<span>{{ item.questionText }}</span>
            </div>
            <div class="dev-xx">
              <el-checkbox-group v-model="radios">
                <el-checkbox
                  v-for="(items, index) in item.sdadd"
                  :key="index"
                  :label="index"
                  v-for="(items, indexs) in item.ivrLibaScriptTargetoptionList"
                  :key="indexs"
                  :label="indexs"
                >
                  {{ items }}
                  {{ items.targetvalue }}
                </el-checkbox>
              </el-checkbox-group>
            </div>
          </div>
          <!-- 填空 -->
          </div> -->
          <!-- 填空
          <div class="topic-dev" v-for="item in valssu" :key="item.aaa">
            <div class="dev-text">
              {{ item.idd }}、[填空]<span>{{ item.wssd }}</span>
@@ -784,11 +747,11 @@
              <el-input placeholder="请输入答案" v-model="radioas" clearable>
              </el-input>
            </div>
          </div>
          </div> -->
        </div>
        <el-button type="primary" plain @click="laststep()">上一步</el-button>
        <el-button type="warning" @click="measurement()">前往测试</el-button>
        <el-button type="info" @click="closeFm('ruleForm')">关闭</el-button>
        <el-button>导出为pdf</el-button>
        <el-button type="primary" @click="laststep()">上一步</el-button>
      </div>
    </div>
    <!-- 添加题目弹窗 -->
@@ -796,7 +759,7 @@
      title="添加题目"
      :visible.sync="drawer"
      custom-class="demo-drawer"
      width="50%"
      size="50%"
    >
      <div class="preview-left">
        <el-form
@@ -860,6 +823,12 @@
            </template>
          </el-table-column>
        </el-table>
        <pagination
          :total="total"
          :page.sync="queryParams.pageNum"
          :limit.sync="queryParams.pageSize"
          @pagination="getaddtopiclist"
        />
      </div>
    </el-drawer>
  </div>
@@ -869,6 +838,7 @@
import { listtag } from "@/api/system/label";
import store from "@/store";
import { listDept } from "@/api/system/dept";
import Regular from "@/components/Regular"; //正则组件
import {
  getFollowupclassify,
  delFollowupclassify,
@@ -881,12 +851,16 @@
  delFollowupinfo,
  Followupinfo,
  getFollowuplist,
  deltargetillness,
  getillnesslist,
  illnesslistget,
  getillness,
  getgenerallist,
} from "@/api/AiCentre/index";
export default {
  name: "SpeechTemplates",
  components: { Regular },
  data() {
    return {
      Editprogress: 1, //编辑进度
@@ -894,16 +868,27 @@
      drawer: false, //控制展开
      radios: [], //多选题选中
      radioas: "", //填空题答案
      task: null, //是否来自任务
      taskform: null, //任务信息
      labelInfovalue: [], //标签临时存储
      deptNamesvalue: [], //科室临时存储
      dynamicTags: [],
      indexAssortlist: [],
      inputValue: "",
      inputValueillness: "",
      topicobj: {},
      topicobj: {
        noMatchText: "",
        noClearlyText: "",
        slienceText: "",
      },
      total: 1,
      id: "",
      ruleForm: {},
      ruleForm: {
        templateName: "",
        ivrLibaTemplateTagList: [],
        ivrLibaTemplateScriptVOList: [],
        tempDetpRelevances: [],
      },
      rules: {},
      optionstag: [],
      prefollowuplist: [],
@@ -930,6 +915,7 @@
      precedencetype: [],
      usable: [],
      required: [],
      valuetype: [],
      mode: [],
      inputVisible: false,
      inputVisibleillness: false,
@@ -943,6 +929,8 @@
        label: "indexAssortName",
      },
      tempDetpRelevanceslist: [],
      delScriptVOList: [],
      optionIndex: "",
      variablelist: [
        { variatename: "姓名", variate: "${name}", default: 1 },
        { variatename: "电话", variate: "${phone}", default: 1 },
@@ -958,37 +946,11 @@
        },
      ],
      valssu: [
        {
          idd: 1,
          wssd: "你最近怎么样",
          sdadd: ["sss", "ssccss", "ssaas", "ss"],
        },
      ],
      valssu: [],
      radio: "",
      addvalue: "添加题目",
      // 题目表格数据
      userList: [
        {
          userid: "1",
          userName: "一号随访模版",
          verbaltrick: "一号随访模版",
        },
        {
          userid: "2",
          userName: "二号随访模版",
          verbaltrick: "一号随访模版",
        },
        {
          userid: "3",
          userName: "三号随访模版",
          verbaltrick: "一号随访模版",
        },
        {
          userid: "4",
          userName: "四号随访模版",
          verbaltrick: "一号随访模版",
        },
      ],
      userList: [],
      // 查询参数
      queryParams: {
        pageNum: 1,
@@ -1003,49 +965,76 @@
  },
  created() {
    this.RoutingDataProcessing();
    this.gettabList();
    this.getvFollowup();
    this.auxiliary();
    this.mode = store.getters.mode;
    this.usable = store.getters.usable;
    this.required = store.getters.required;
    this.valuetype = store.getters.valuetype;
    this.languagelist = store.getters.languagelist;
    this.courtyardlist = store.getters.courtyardlist;
    this.precedencetype = store.getters.precedencetype;
  },
  mounted() {},
  methods: {
    //公共方法--------------------
    getIndexInArray(arr, obj) {
      return arr.indexOf(obj);
    },
    processElement(element) {
      return { ...element, isoperation: 0 };
    },
    // 路由数据处理
    RoutingDataProcessing() {
      this.id = this.$route.query.id;
      this.task = this.$route.query.task;
      // console.log(this.task, "task");
      // if (this.task) {
      //   this.id = this.$route.query.id;
      // }
    },
    // 获取表单数据
    getvFollowup() {
      this.id = this.$route.query.id;
      if (this.id) {
        getvFollowup({ id: this.id }).then((res) => {
          if (res.code == 200) {
            console.log(2211);
            this.ruleForm = res.data;
            this.tempDetpRelevanceslist = JSON.parse(this.ruleForm.deptNames);
            this.ruleForm.suitway = this.ruleForm.suitway.split(",");
            this.ruleForm.campus = this.ruleForm.campus.split(",");
            this.ruleForm.submoduleID = this.ruleForm.submoduleID.split(",");
            this.ruleForm.submoduleID = this.ruleForm.submoduleID.map((res) => {
              return Number(res);
            });
            console.log(
              this.ruleForm.submoduleID,
              "this.ruleForm.submoduleID取"
            );
            this.dynamicTags = this.ruleForm.ivrLibaTemplateTagList;
      getvFollowup({ id: this.id }).then((res) => {
        this.ruleForm = res.data;
        this.tempDetpRelevanceslist = JSON.parse(this.ruleForm.deptNames);
        this.ruleForm.suitway = this.ruleForm.suitway.split(",");
        this.ruleForm.campus = this.ruleForm.campus.split(",");
        this.ruleForm.submoduleID = this.ruleForm.submoduleID.split(",");
        this.dynamicTags = this.ruleForm.ivrLibaTemplateTagList;
        this.dynamicTags = this.ruleForm.ivrLibaTemplateTagList.map(
          this.processElement
        );
        console.log(this.ruleForm.suitway);
      });
            this.dynamicTags = this.ruleForm.ivrLibaTemplateTagList.map(
              this.processElement
            );
            console.log(this.ruleForm.suitway);
          }
        });
      }
      getillnesslist({
        pageNum: 1,
        pageSize: 100,
      }).then((response) => {
        this.optionsillness = response.rows;
      });
      getillness({ outid: this.id, type: 3 }).then((res) => {
        this.illnesslist = res.rows;
      });
      if (this.id) {
        getillness({ outid: this.id, type: 3 }).then((res) => {
          this.illnesslist = res.rows;
        });
      }
      listDept(this.queryParams).then((response) => {
        this.deptList = this.handleTree(response.data, "deptId");
      });
@@ -1055,9 +1044,30 @@
      // 分类
      getFollowupclassify({}).then((res) => {
        this.indexAssortlist = res.rows;
        if (this.$route.query.assortid) {
          this.ruleForm.assortid = Number(this.$route.query.assortid);
        }
      });
      // 科室
      listDept(this.queryParams).then((response) => {
        this.deptList = this.handleTree(response.data, "deptId");
      });
      // 疾病
      getillnesslist({
        pageNum: 1,
        pageSize: 100,
      }).then((response) => {
        this.optionsillness = response.rows;
      });
      getgenerallist({
        pageNum: 1,
        pageSize: 100,
      }).then((res) => {
        this.generallist = res.rows;
      });
      // 疾病列
    },
    //
    submitForm(formName) {
      if (this.ruleForm.id) {
        this.ruleForm.isoperation = 2;
@@ -1070,8 +1080,30 @@
      this.ruleForm.submoduleID = this.ruleForm.submoduleID.join(",");
      //   提交
      this.ruleForm.ivrLibaTemplateScriptVOList.forEach((res) => {
        if (!res.isoperation) {
          res.isoperation = 2;
        }
        res.ivrLibaScriptTargetoptionList =
          res.ivrLibaScriptTargetoptionList.map((item) => {
            if (!item.isoperation) {
              item.isoperation = 2;
              item.templateID = this.ruleForm.id;
            }
            return item;
          });
      });
      compileFollowup(this.ruleForm).then((res) => {
        this.$modal.msgSuccess("编辑成功");
        this.confirmillness(res.data);
        this.$router.go(-1);
      });
    },
    confirmillness(guid) {
      this.illnesslist.forEach((item, index) => {
        if (guid) {
          item.outid = guid;
        }
        if (!item.id) {
          addtargetillness(item).then((res) => {});
        }
@@ -1079,15 +1111,14 @@
      if (this.illnesslistapi.length) {
        deltargetillness(this.illnesslistapi.join(",")).then((res) => {});
      }
      compileFollowup(this.ruleForm).then((res) => {
        this.$modal.msgSuccess("编辑成功");
        this.$router.go(-1);
      });
      this.illnessVisible = false;
      this.$modal.msgSuccess("编辑成功");
    },
    // 科室处理
    Departmenttreatment() {
      this.ruleForm.deptNames = JSON.stringify(this.tempDetpRelevanceslist);
      console.log(this.tempDetpRelevanceslist);
      this.ruleForm.ivrLibaTemplateScriptVOList =
        this.ruleForm.ivrLibaTemplateScriptVOList.concat(this.delScriptVOList);
      const result = this.tempDetpRelevanceslist.map(
        (subArr) => subArr[subArr.length - 1]
      );
@@ -1145,23 +1176,6 @@
          });
        });
    },
    /** 查询题目列表 */
    getList() {
      //   this.loading = true;
      listUser().then((response) => {
        console.log(response);
        // this.userList = response.data;
        // this.total = response.total;
        // this.loading = false;
        console.log(this.userList);
      });
      //   const { rows } = await listUser();
      //   console.log(rows);
      //   this.list = rows;
    },
    // 修改题目信息
    Submittopicobj() {},
    // 控制文件
    handleChange(file, fileList) {
@@ -1252,29 +1266,58 @@
      });
    },
    addtopic(row) {
      row.isoperation = 1;
      this.ruleForm.ivrLibaTemplateScriptVOList.push(row);
    },
    handleDelete(row) {
      this.ruleForm.ivrLibaTemplateScriptVOList.splice(
        this.ruleForm.ivrLibaTemplateScriptVOList.indexOf(row),
        1
      );
    },
    handleUpdate(row) {
      console.log(row.id);
      console.log(row);
      if (
        this.ruleForm.ivrLibaTemplateScriptVOList.some(
          (obj) => obj.questiontitle == row.questiontitle
        )
      ) {
        this.$modal.msgError("该题目已存在");
        return;
      }
      getverbaltrick({ id: row.id }).then((res) => {
        this.topicobj = res.data;
        console.log(res.data);
        console.log(res, "详情");
        res.data.isoperation = 1;
        res.data.pid = this.ruleForm.id;
        res.data.ivrLibaScriptTargetoptionList.forEach((item) => {
          item.isoperation = 1;
        });
        this.ruleForm.ivrLibaTemplateScriptVOList.push(res.data);
        this.sortFn();
        this.$modal.msgSuccess("添加成功");
      });
    },
    handleDelete(item) {
      const index = this.ruleForm.ivrLibaTemplateScriptVOList.indexOf(item);
      if (index !== -1) {
        this.ruleForm.ivrLibaTemplateScriptVOList.splice(index, 1); // 从索引位置删除一个元素
        this.sortFn();
    handleDelete(row) {
      this.$modal
        .confirm('是否确认删除问题:"' + row.questiontitle + '"?')
        .then(() => {
          this.ruleForm.ivrLibaTemplateScriptVOList.splice(
            this.ruleForm.ivrLibaTemplateScriptVOList.indexOf(row),
            1
          );
          row.isoperation = 3;
          this.delScriptVOList.push(row);
          this.$modal.msgSuccess("已删除,保存模版生效");
        })
        .catch(() => {});
    },
    handleUpdate(row) {
      console.log(row);
      this.optionIndex = this.ruleForm.ivrLibaTemplateScriptVOList.indexOf(row);
      if (row.ivrLibaScriptTargetoptionList.length) {
        console.log(11);
        this.topicobj = row;
        this.topicobj.valueType = row.valueType;
      } else {
        console.log("未找到该对象");
        getverbaltrick({ id: row.id }).then((res) => {
          if (res.data) {
            this.topicobj = res.data;
            console.log(res.data, "topicobj");
          } else {
            this.topicobj = row;
            console.log("没找到选项,请查看问题库是否正确配置");
          }
        });
      }
    },
    syioption(row) {
@@ -1301,18 +1344,30 @@
      this.ruleForm.ivrLibaTemplateScriptVOList.splice(index + 1, 0, item); // 将item插入到索引位置的前一位
      this.sortFn();
    },
    // 问题排序
    sortFn() {
      this.ruleForm.ivrLibaTemplateScriptVOList =
        this.ruleForm.ivrLibaTemplateScriptVOList.map((item, index) => {
          return {
            guid: index + 1,
            id: item.id,
            questiontitle: item.questiontitle,
            questionText: item.questionText,
          };
          return Object.assign({}, item, { targetid: (index + 1).toString() });
        });
      this.ruleForm.ivrLibaTemplateScriptVOList.forEach((question, index) => {
        question.ivrLibaScriptTargetoptionList =
          question.ivrLibaScriptTargetoptionList.map((option) => {
            option.nextQuestion = Number(question.targetid) + 1;
            return option;
          });
      });
      console.log(this.ruleForm.ivrLibaTemplateScriptVOList);
    },
    // -----------------------话术选项
    deloption() {},
    // 修改题目信息
    Submittopicobj() {
      this.ruleForm.ivrLibaTemplateScriptVOList[this.optionIndex] =
        this.topicobj;
      this.$modal.msgSuccess("暂存选项成功");
    },
    // ---------------------
    resetForm(formName) {
      this.$refs[formName].resetFields();
@@ -1359,18 +1414,23 @@
      this.inputVisibleillness = false;
      this.inputValueillness = "";
    },
    // 保存
    confirmillness() {
      this.illnesslist.forEach((item, index) => {
        if (!item.id) {
          addtargetillness(item).then((res) => {});
        }
      });
      if (this.illnesslistapi.length) {
        deltargetillness(this.illnesslistapi.join(",")).then((res) => {});
      }
      this.illnessVisible = false;
      this.$modal.msgSuccess("编辑成功");
    // 预览---------------
    preview() {
      console.log(this.ruleForm);
      this.valssu = this.ruleForm.ivrLibaTemplateScriptVOList;
      this.Editprogress = 3;
    },
    // 前往测试
    measurement() {
      this.$modal
        .confirm("即将前往模版测试页面,请确认模版数据已保存。")
        .then((res) => {
          this.$router.push({
            path: "/knowledge/templateku/configurat/measurement",
            query: { id: this.id, name: this.ruleForm.templateName },
          });
        })
        .catch(() => {});
    },
  },
};
@@ -1378,14 +1438,9 @@
<style lang="scss" scoped>
.Questionnairemanagement {
  display: flex;
  // display: flex;
}
.sidecolumn {
  width: 250px;
  min-height: 100vh;
  text-align: center;
  //   display: flex;
  //   margin-top: 20px;
  margin: 20px;
  margin-bottom: 0;
  padding: 30px;
@@ -1397,9 +1452,8 @@
.leftvlue {
  //   display: flex;
  //   flex: 1;
  width: 80%;
  margin-top: 20px;
  //   margin: 20px;
  // width: 80%;
  margin: 20px;
  padding: 30px;
  background: #ffff;
  border: 1px solid #dcdfe6;