WXL
2024-02-04 cf9259c2ebee0e82c32864a1ee91d96c403b9099
src/views/repositoryai/templateku/configurat/index.vue
@@ -2,14 +2,29 @@
  <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="Editprogress = 3"
                >随访模版预览</span
              >
            </template>
          </el-step>
        </el-steps>
      </div>
    </div>
@@ -29,55 +44,67 @@
          <el-row>
            <el-col :span="12">
              <el-form-item label="模版名称" prop="region">
                <div style="width: 30%">
                  <el-input v-model="ruleForm.name"></el-input>
                <div>
                  <el-input
                    v-model="ruleForm.templateName"
                    placeholder="请输入名称"
                  ></el-input>
                </div>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="随访模版分类" prop="region">
                <el-select
                  v-model="ruleForm.classify"
                  v-model="ruleForm.assortid"
                  size="medium"
                  multiple
                  filterable
                  placeholder="请选择分类"
                >
                  <el-option
                    class="ruleFormaa"
                    v-for="item in options"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                  <el-option-group
                    v-for="group in indexAssortlist"
                    :key="group.id"
                    :label="group.indexAssortName"
                  >
                  </el-option>
                    <el-option
                      v-for="item in group.ivrLibaTemplateAssortList"
                      :key="item.id"
                      :label="item.indexAssortName"
                      :value="item.id"
                    >
                    </el-option>
                  </el-option-group>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
          <el-form-item label="模版简介" prop="name">
          <el-form-item label="模版简介" prop="note">
            <div style="width: 50%">
              <el-input type="textarea" v-model="ruleForm.name"></el-input>
              <el-input
                type="textarea"
                placeholder="请输入简介"
                v-model="ruleForm.note"
              ></el-input>
            </div>
          </el-form-item>
          <el-row :gutter="20">
            <el-col :span="6">
              <el-form-item label="版本号" prop="name">
                <el-input v-model="currentVersion"></el-input> </el-form-item
            <el-col :span="10">
              <el-form-item label="版本号" prop="version">
                <el-input
                  v-model="ruleForm.version"
                  placeholder="默认1.0.1"
                ></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.classify"
                  v-model="ruleForm.usestate"
                  size="medium"
                  multiple
                  filterable
                  placeholder="请选择分类"
                  placeholder="请选择"
                >
                  <el-option
                    class="ruleFormaa"
                    v-for="item in options"
                    v-for="item in usable"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
@@ -86,57 +113,93 @@
                </el-select> </el-form-item
            ></el-col>
          </el-row>
          <el-form-item label="通知变量" prop="name">
            <el-row v-for="item in variablelist">
              <el-col :span="4">
                <el-input v-model="item.variable"></el-input>
              </el-col>
              <el-col :span="8" :offset="1">
                <el-input v-model="item.value"></el-input>
              </el-col>
              <el-col :span="4" :offset="1">
                <el-button
                  type="success"
                  icon="el-icon-plus"
                  circle
                  @click="addvariable(item)"
                ></el-button>
                <el-button
                  type="danger"
                  icon="el-icon-delete"
                  circle
                  @click="delvariable(item)"
                ></el-button>
              </el-col>
            </el-row>
          </el-form-item>
          <el-row :gutter="20">
            <el-col :span="10">
              <el-form-item label="语言" prop="name">
                <el-select
                  v-model="ruleForm.language"
                  size="medium"
                  filterable
                  placeholder="请选择语言"
                >
                  <el-option
                    class="ruleFormaa"
                    v-for="item in languagelist"
                    :key="item.label"
                    :label="item.label"
                    :value="item.label"
                  >
                  </el-option>
                </el-select> </el-form-item
            ></el-col>
            <el-col :span="12">
              <el-form-item label="播报优先" prop="playType">
                <el-select
                  v-model="ruleForm.playType"
                  size="medium"
                  filterable
                  placeholder="请选择语言"
                >
                  <el-option
                    class="ruleFormaa"
                    v-for="item in precedencetype"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                  >
                  </el-option>
                </el-select> </el-form-item
            ></el-col>
          </el-row>
          <el-form-item label="随访方式" prop="region">
            <el-select
              style="width: 500px"
              v-model="ruleForm.suitway"
              size="medium"
              multiple
              filterable
              placeholder="请选择分类(多选)"
            >
              <el-option
                class="ruleFormaa"
                v-for="item in mode"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              >
              </el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="标签" prop="desc">
            <div class="xinz-inf">
              <el-tag
                :key="tag"
                :key="tag.tagname"
                type="success"
                v-for="tag in dynamicTags"
                closable
                :disable-transitions="false"
                @close="handleClose(tag)"
                @close="handleClosetag(tag)"
              >
                {{ tag }}
                {{ tag.tagname }}
              </el-tag>
              <el-select
                v-model="inputValue"
                v-if="inputVisible"
                @change="handleInputConfirm"
                filterable
                  allow-create
                  default-first-option
                remote
                reserve-keyword
                default-first-option
                :remote-method="remoteMethodtag"
                :loading="loading"
                placeholder="请选择"
              >
                <el-option
                v-for="item in optionstag"
                  :key="item.tagname"
                    :label="item.tagname"
                    :value="item.tagname"
                  v-for="item in optionstag"
                  :key="item.tagid"
                  :label="item.tagname"
                  :value="item.tagname"
                >
                </el-option>
              </el-select>
@@ -149,112 +212,84 @@
              >
            </div>
          </el-form-item>
          <el-row :gutter="20">
            <el-col :span="6">
              <el-form-item label="语言" prop="name">
                <el-select
                  v-model="ruleForm.language"
                  size="medium"
                  filterable
                  placeholder="请选择分类"
                >
                  <el-option
                    class="ruleFormaa"
                    v-for="item in languagelist"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                  >
                  </el-option>
                </el-select> </el-form-item
            ></el-col>
            <el-col :span="9">
              <el-form-item label="播报优先" prop="region">
                <el-radio-group v-model="ruleForm.classify">
                  <el-radio :label="3">语言合成优先</el-radio>
                  <el-radio :label="6">语言文件优先</el-radio>
                </el-radio-group>
              </el-form-item></el-col
            >
          </el-row>
          <el-form-item label="随访方式" prop="region">
            <el-select
              style="width: 500px"
              v-model="ruleForm.way"
              size="medium"
              multiple
              filterable
              placeholder="请选择分类(多选)"
            >
              <el-option
                class="ruleFormaa"
                v-for="item in xjxsoptions"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              >
              </el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="适用疾病" prop="region">
            <el-select
              style="width: 500px"
              v-model="ruleForm.illness"
              size="medium"
              multiple
              filterable
              placeholder="请选择分类(多选)"
            >
              <el-option
                class="ruleFormaa"
                v-for="item in options"
                :key="item.value"
                :label="item.label"
                :value="item.value"
            <div class="xinz-inf">
              <el-tag
                :key="item.icd10name"
                type="warning"
                v-for="item in illnesslist"
                closable
                :disable-transitions="false"
                @close="handleCloseillness(item)"
              >
              </el-option>
            </el-select>
                {{ item.icd10name }}
              </el-tag>
              <el-select
                v-model="inputValueillness"
                v-if="inputVisibleillness"
                @change="illnessConfirm"
                :remote-method="remoteMethod"
                filterable
                remote
                allow-create
                default-first-option
                placeholder="请选择/查询"
                :loading="loading"
              >
                <el-option
                  v-for="item in optionsillness"
                  :key="item.icdid"
                  :label="item.icdname"
                  :value="item.icdid"
                >
                </el-option>
              </el-select>
              <el-button
                v-else
                class="button-new-tag"
                size="small"
                @click="inputVisibleillness = true"
                >+ 新增疾病</el-button
              >
            </div>
          </el-form-item>
          <el-form-item label="适用院区" prop="region">
            <el-select
              v-model="ruleForm.courtyard"
              v-model="ruleForm.campus"
              size="medium"
              multiple
              filterable
              placeholder="请选择分类"
            >
              <el-option
                class="ruleFormaa"
                v-for="item in options"
                :key="item.value"
                v-for="item in courtyardlist"
                :key="item.label"
                :label="item.label"
                :value="item.value"
                :value="item.label"
              >
              </el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="适用科室" prop="region">
            <el-select
              style="width: 500px"
              v-model="ruleForm.administrative"
              size="medium"
              multiple
              filterable
              placeholder="请选择分类(多选)"
            <el-cascader
              v-model="tempDetpRelevanceslist"
              :options="deptList"
              :props="props"
              :show-all-levels="false"
              clearable
            >
              <el-option
                class="ruleFormaa"
                v-for="item in options"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              >
              </el-option>
            </el-select>
              <template slot-scope="{ node, data }">
                <span>{{ data.deptName }}</span>
                <span v-if="!node.isLeaf"> ({{ data.children.length }}) </span>
              </template>
            </el-cascader>
          </el-form-item>
          <el-form-item label="通用库" prop="region">
            <el-select
              style="width: 500px"
              v-model="ruleForm.way"
              v-model="ruleForm.submoduleID"
              size="medium"
              multiple
              filterable
@@ -262,7 +297,7 @@
            >
              <el-option
                class="ruleFormaa"
                v-for="item in xjxsoptions"
                v-for="item in generallist"
                :key="item.value"
                :label="item.label"
                :value="item.value"
@@ -272,16 +307,16 @@
          </el-form-item>
          <el-row :gutter="20">
            <el-col :span="8">
              <el-form-item label="随访前处理" prop="name">
              <el-form-item label="随访前处理(是否需要)" prop="name">
                <el-select
                  v-model="ruleForm.languageq"
                  v-model="ruleForm.prefollowup"
                  size="medium"
                  filterable
                  placeholder="请选择分类"
                  placeholder="请选择"
                >
                  <el-option
                    class="ruleFormaa"
                    v-for="item in xjxsoptions"
                    v-for="item in prefollowuplist"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
@@ -290,16 +325,16 @@
                </el-select> </el-form-item
            ></el-col>
            <el-col :span="9">
              <el-form-item label="随访后处理" prop="region">
              <el-form-item label="随访后处理(是否需要)" prop="region">
                <el-select
                  v-model="ruleForm.languageh"
                  v-model="ruleForm.postfollowup"
                  size="medium"
                  filterable
                  placeholder="请选择分类"
                >
                  <el-option
                    class="ruleFormaa"
                    v-for="item in xjxsoptions"
                    v-for="item in postfollowuplist"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
@@ -309,14 +344,14 @@
            ></el-col>
          </el-row>
          <el-row :gutter="20">
            <el-col :span="8">
            <el-col :span="10">
              <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="8">
            <el-col :span="10">
              <el-form-item label="无匹配重复(次)" prop="region">
                <div style="width: 40%">
                  <el-input v-model="ruleForm.name"></el-input>
@@ -328,7 +363,7 @@
              >下一步</el-button
            >
            <el-button type="info" @click="closeFm('ruleForm')">关闭</el-button>
            <el-button @click="submitForm('ruleForm')"
            <el-button @click="Departmenttreatment('ruleForm')"
              >保存随访模版基础信息</el-button
            >
          </el-form-item>
@@ -343,32 +378,35 @@
            type="primary"
            icon="el-icon-plus"
            round
            @click="drawer = true"
            @click="getaddtopiclist"
            >添加题目</el-button
          >
        </div>
        <div class="presentation">
          <div class="presentation-left">
            <el-card class="box-card" style="min-height: 688px">
              <el-table v-loading="loading" :data="userList">
              <el-table
                v-loading="loading"
                :data="ruleForm.ivrLibaTemplateScriptVOList"
              >
                <el-table-column
                  label="编号"
                  align="center"
                  key="userid"
                  prop="userid"
                  key="guid"
                  prop="guid"
                />
                <el-table-column
                  label="标题"
                  align="center"
                  key="userName"
                  prop="userName"
                  key="questiontitle"
                  prop="questiontitle"
                  :show-overflow-tooltip="true"
                />
                <el-table-column
                  label="问题话术"
                  align="center"
                  key="verbaltrick"
                  prop="verbaltrick"
                  key="questionText"
                  prop="questionText"
                  :show-overflow-tooltip="true"
                />
@@ -389,7 +427,7 @@
                      type="danger"
                      icon="el-icon-delete"
                      circle
                      @click="deloption(scope.row)"
                      @click="handleDelete(scope.row)"
                    ></el-button>
                    <el-button
                      @click="syioption(scope.row)"
@@ -407,14 +445,6 @@
                </el-table-column>
              </el-table>
            </el-card>
            <pagination
              v-show="total > 0"
              :total="total"
              :page.sync="queryParams.pageNum"
              :limit.sync="queryParams.pageSize"
              @pagination="getList"
            />
          </div>
          <div class="presentation-right">
            <el-card class="box-card">
@@ -433,24 +463,41 @@
                </div>
                <el-form-item label="题目标题">
                  <el-input
                    v-model="topicobj.title"
                    placeholder="请输入标题"
                    v-model="topicobj.questiontitle"
                    placeholder="请从左侧列表选择"
                    :disabled="true"
                  ></el-input>
                </el-form-item>
                <el-row :gutter="10">
                  <el-col :span="12"
                    ><el-form-item label="是否必答">
                      <el-radio-group v-model="topicobj.resource">
                        <el-radio label="是"></el-radio>
                        <el-radio label="否"></el-radio>
                      </el-radio-group> </el-form-item
                    ><el-form-item label="是否必填">
                      <el-select
                        v-model="topicobj.ismandatory"
                        placeholder="请选择"
                      >
                        <el-option
                          v-for="item in required"
                          :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-radio-group v-model="topicobj.resourcea">
                        <el-radio label="是"></el-radio>
                        <el-radio label="否"></el-radio>
                      </el-radio-group> </el-form-item
                    ><el-form-item label="是否可用">
                      <el-select
                        v-model="topicobj.isavailable"
                        placeholder="请选择"
                      >
                        <el-option
                          v-for="item in usable"
                          :key="item.value"
                          :label="item.label"
                          :value="item.value"
                        >
                        </el-option>
                      </el-select> </el-form-item
                  ></el-col>
                </el-row>
                <div class="headline">
@@ -464,14 +511,17 @@
                    >
                  </div>
                </div>
                <div class="topicxq" v-for="item in 2">
                <!-- <div
                  class="topicxq"
                  v-for="item in topicobj.ivrLibaScriptTargetoptionList"
                >
                  <el-row :gutter="10">
                    <el-col :span="12"
                      ><el-form-item label="处理">
                      ><el-form-item label="选项名">
                        <el-input
                          type="text"
                          placeholder="(默认)无声"
                          v-model="queryParams.text"
                          placeholder="请输入"
                          v-model="item.targetvalue"
                          show-word-limit
                        >
                        </el-input> </el-form-item
@@ -480,8 +530,8 @@
                      ><el-form-item label="节点ID">
                        <el-input
                          type="text"
                          placeholder="请输入分值"
                          v-model="queryParams.text"
                          placeholder="请输入节点"
                          v-model="item.targetid"
                          show-word-limit
                        >
                        </el-input> </el-form-item
@@ -489,38 +539,37 @@
                  </el-row>
                  <el-row :gutter="10">
                    <el-col :span="12"
                      ><el-form-item label="选中提示">
                      ><el-form-item label="处理">
                        <el-input
                          type="text"
                          placeholder="请输入内容"
                          v-model="queryParams.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-form-item label="选中跳转(缺)">
                        <el-input
                          type="text"
                          placeholder="请输入题号"
                          v-model="queryParams.text"
                          placeholder="请输入题目节点"
                          v-model="item.jump"
                          show-word-limit
                        >
                        </el-input> </el-form-item
                    ></el-col>
                  </el-row>
                  <el-form-item label="语音文本">
                  <el-form-item label="匹配正则">
                    <el-input
                      style="width: 24vw"
                      type="textarea"
                      placeholder="请输入题号"
                      v-model="queryParams.text"
                      v-model="item.targetregex"
                      show-word-limit
                    >
                    </el-input>
                  </el-form-item>
                  <el-row :gutter="10">
                    <el-col :span="16">
                      <el-form-item label="语音文件">
@@ -541,9 +590,156 @@
                    >
                    <el-col :span="8">
                      <div style="text-align: right; padding-right: 10px">
                        <el-button type="danger" round>删除</el-button>
                        <el-button type="danger" @click="" round>删除</el-button>
                      </div>
                    </el-col>
                  </el-row>
                </div> -->
                <Regular
                  :TargetoptionList="topicobj.ivrLibaScriptTargetoptionList"
                  @deloption="deloption"
                  :controlsc="false"
                />
                <!-- 无匹配类型 -->
                <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>
                  <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 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-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 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-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>
              </el-form>
@@ -556,7 +752,9 @@
        >
        <el-button type="primary" @click="laststep()">上一步</el-button>
        <el-button type="info" @click="closeFm('ruleForm')">关闭</el-button>
        <el-button @click="Saveproblem('ruleForm')">保存题目数据</el-button>
        <el-button @click="Departmenttreatment('ruleForm')"
          >保存题目数据</el-button
        >
      </div>
      <!-- 随访模版预览 -->
      <div v-if="Editprogress == 3">
@@ -629,37 +827,20 @@
        >
          <el-form-item label="标题" prop="userName">
            <el-input
              v-model="queryParams.userName"
              v-model="queryParams.questiontitle"
              placeholder="请输入"
              clearable
              style="width: 200px"
              @keyup.enter.native="handleQuery"
              @keyup.enter.native="getaddtopiclist"
            />
          </el-form-item>
          <el-form-item label="主题" prop="sickness">
            <el-select
              v-model="ruleForm.classify"
              size="medium"
              multiple
              filterable
              placeholder="请选择分类"
            >
              <el-option
                class="ruleFormaa"
                v-for="item in options"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              >
              </el-option>
            </el-select>
          </el-form-item>
          <el-form-item>
            <el-button
              type="primary"
              icon="el-icon-search"
              size="medium"
              @click="handleQuery"
              @click="getaddtopiclist"
              >搜索</el-button
            >
            <el-button icon="el-icon-refresh" size="medium" @click="resetQuery"
@@ -671,15 +852,15 @@
          <el-table-column
            label="标题"
            align="center"
            key="userName"
            prop="userName"
            key="questiontitle"
            prop="questiontitle"
            width="100"
          />
          <el-table-column
            label="问题话术"
            align="center"
            key="verbaltrick"
            prop="verbaltrick"
            key="questionText"
            prop="questionText"
            width="200"
            :show-overflow-tooltip="true"
          />
@@ -690,10 +871,7 @@
            class-name="small-padding fixed-width"
          >
            <template slot-scope="scope">
              <el-button
                size="medium"
                type="text"
                @click="handleUpdate(scope.row)"
              <el-button size="medium" type="text" @click="addtopic(scope.row)"
                ><span class="button-textxg"
                  ><i class="el-icon-circle-plus-outline"></i>添加</span
                ></el-button
@@ -708,91 +886,96 @@
<script>
import { listtag } from "@/api/system/label";
import store from "@/store";
import { listDept } from "@/api/system/dept";
import Regular from "@/components/Regular"; //正则组件
import {
  getFollowupclassify,
  delFollowupclassify,
  addFollowupclassify,
  addtargetillness,
  getvFollowup,
  compileFollowup,
  getverbaltricklist,
  getverbaltrick,
  delFollowupinfo,
  Followupinfo,
  getFollowuplist,
  deltargetillness,
  getillnesslist,
  illnesslistget,
  getillness,
} from "@/api/AiCentre/index";
export default {
  name: "SpeechTemplates",
  components: { Regular },
  data() {
    return {
      sidecolumnrabs: "left", //方向
      Editprogress: 2, //编辑进度
      currentVersion: "1.2.3", //当前版本
      Editprogress: 1, //编辑进度
      loading: false, // 遮罩层
      drawer: false, //控制展开
      radio: "false", //单选题选中
      radios: [], //多选题选中
      radioas: "", //填空题答案
      dynamicTags: ["标签一", "标签二", "标签三"],
      inputVisible: false,
      labelInfovalue: [], //标签临时存储
      deptNamesvalue: [], //科室临时存储
      dynamicTags: [],
      indexAssortlist: [],
      inputValue: "",
      inputValueillness: "",
      topicobj: {},
      // 总条数
      total: 1,
      ruleForm: {
        name: "",
        region: "",
        date1: "",
        date2: "",
        delivery: false,
        type: [],
        resource: "",
        desc: "",
        templatevalue: "",
        data2: "",
      },
      id: "",
      ruleForm: {},
      rules: {},
      rulesa: {},
      optionstag:[],
      xjxsoptions: [
        {
          value: "选项1",
          label: "图文",
        },
        {
          value: "选项2",
          label: "视频",
        },
        {
          value: "选项3",
          label: "音频",
        },
      optionstag: [],
      prefollowuplist: [],
      postfollowuplist: [],
      generallist: [
        { value: "1", label: "随访通用库一" },
        { value: "2", label: "随访二库" },
      ],
      fileList: [
        {
          name: "food.jpeg",
          url: "https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100",
        },
      ],
      options: [
        {
          value: "选项1",
          label: "疾病随访模版",
        },
        {
          value: "选项2",
          label: "入院随访模版",
        },
        {
          value: "选项3",
          label: "手术随访模版",
        },
        {
          value: "选项4",
          label: "护理随访模版",
        },
      administrativelist: [
        { value: "1", label: "心外科" },
        { value: "2", label: "心内科" },
      ],
      languagelist: [
        {
          value: "1",
          label: "普通话",
        },
        {
          value: "2",
          label: "粤语",
        },
        {
          value: "3",
          label: "英文",
        },
      standbylist: [],
      themelist: [],
      languagelist: [],
      courtyardlist: [],
      precedencetype: [],
      usable: [],
      required: [],
      mode: [],
      inputVisible: false,
      inputVisibleillness: false,
      illnessVisible: false, //指标疾病弹框
      deptOptions: [],
      optionsillness: [],
      illnesslistapi: [],
      illnesslist: [],
      defaultProps: {
        children: "ivrLibaTemplateAssortList",
        label: "indexAssortName",
      },
      tempDetpRelevanceslist: [],
      delScriptVOList: [],
      optionIndex:'',
      variablelist: [
        { variatename: "姓名", variate: "${name}", default: 1 },
        { variatename: "电话", variate: "${phone}", default: 1 },
        { variatename: "病情", variate: "${illness}", default: 1 },
      ],
      deptList: [],
      props: { multiple: true, value: "deptId", label: "deptName" },
      variablelist: [
        {
          variable: "paitent",
@@ -846,24 +1029,120 @@
  created() {
    this.gettabList();
    this.getvFollowup();
    this.auxiliary();
    this.mode = store.getters.mode;
    this.usable = store.getters.usable;
    this.required = store.getters.required;
    this.languagelist = store.getters.languagelist;
    this.courtyardlist = store.getters.courtyardlist;
    this.precedencetype = store.getters.precedencetype;
  },
  methods: {
    getIndexInArray(arr, obj) {
      return arr.indexOf(obj);
    },
    processElement(element) {
      return { ...element, isoperation: 0 };
    },
    // 获取表单数据
    getvFollowup() {
      this.id = this.$route.query.id;
      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);
      });
      getillnesslist({
        pageNum: 1,
        pageSize: 100,
      }).then((response) => {
        this.optionsillness = response.rows;
      });
      getillness({ outid: this.id, type: 3 }).then((res) => {
        this.illnesslist = res.rows;
      });
      listDept(this.queryParams).then((response) => {
        this.deptList = this.handleTree(response.data, "deptId");
      });
    },
    // 附属数据表
    auxiliary() {
      // 分类
      getFollowupclassify({}).then((res) => {
        this.indexAssortlist = res.rows;
      });
      // 疾病列
    },
    submitForm(formName) {
      this.rules = this.rulesa;
      if (this.ruleForm.id) {
        this.ruleForm.isoperation = 2;
      } else {
        this.ruleForm.isoperation = 1;
      }
      this.ruleForm.labelInfo = JSON.stringify(this.dynamicTags);
      this.ruleForm.suitway = this.ruleForm.suitway.join(",");
      this.ruleForm.campus = this.ruleForm.campus.join(",");
      this.ruleForm.submoduleID = this.ruleForm.submoduleID.join(",");
      //   提交
      this.$refs[formName].validate((valid) => {
        if (valid) {
          alert("submit!");
        } else {
          console.log("error submit!!");
          return false;
      this.illnesslist.forEach((item, index) => {
        if (!item.id) {
          addtargetillness(item).then((res) => {});
        }
      });
      if (this.illnesslistapi.length) {
        deltargetillness(this.illnesslistapi.join(",")).then((res) => {});
      }
      compileFollowup(this.ruleForm).then((res) => {
        this.$modal.msgSuccess("编辑成功");
        this.$router.go(-1);
      });
    },
    // 科室处理
    Departmenttreatment() {
      this.ruleForm.deptNames = JSON.stringify(this.tempDetpRelevanceslist);
      this.ruleForm.ivrLibaTemplateScriptVOList =
        this.ruleForm.ivrLibaTemplateScriptVOList.concat(this.delScriptVOList);
      const result = this.tempDetpRelevanceslist.map(
        (subArr) => subArr[subArr.length - 1]
      );
      // id数组查数组对象
      result.forEach((item) => {
        const condition = this.ruleForm.tempDetpRelevances.some(
          (obj) => obj.deptId === item
        );
        if (!condition) {
          listDept({ deptId: item }).then((res) => {
            res.data[0].type = 2;
            this.ruleForm.tempDetpRelevances.push(res.data[0]);
          });
        }
      });
      console.log(this.ruleForm.tempDetpRelevances);
      // 数组对象查id数组
      this.ruleForm.tempDetpRelevances.forEach((item) => {
        const condition = result.some((obj) => obj === item.deptId);
        if (!condition) {
          const index = this.ruleForm.tempDetpRelevances.indexOf(item);
          this.ruleForm.tempDetpRelevances[index].delFlag = 1;
        }
      });
      console.log(this.ruleForm.tempDetpRelevances);
      setTimeout(() => {
        this.submitForm();
      }, 1000);
      // this.submitForm();
    },
    // 下一步
    nextstep() {
@@ -892,40 +1171,7 @@
          });
        });
    },
    // 保存题目信息
    Saveproblem() {},
    /** 查询题目列表 */
    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() {},
    // 新增变量
    addvariable() {
      this.variablelist.push({
        variable: "",
        value: "",
      });
    },
    // 删除变量
    delvariable(item) {
      const index = this.variablelist.indexOf(item);
      if (index !== -1) {
        this.variablelist.splice(index, 1); // 从索引位置删除一个元素
      } else {
        console.log("未找到该对象");
      }
    },
    // 控制文件
    handleChange(file, fileList) {
      this.fileList = fileList.slice(-3);
@@ -950,64 +1196,187 @@
        this.optionstag = response.rows;
      });
    },
    handleClose(tag) {
    handleClosetag(tag) {
      console.log(tag);
      console.log(this.dynamicTags.indexOf(tag));
      const lindex = this.dynamicTags.indexOf(tag);
      this.dynamicTags.splice(this.dynamicTags.indexOf(tag), 1);
      this.ruleForm.ivrLibaTemplateTagList[lindex].isoperation = 3;
    },
    handleInputConfirm() {
      let inputValue = this.inputValue;
      if (inputValue) {
        this.dynamicTags.push(inputValue);
      let tagvalue = {};
      let tagname = this.inputValue;
      if (tagname) {
        listtag({
          pageNum: 1,
          pageSize: 1000,
          tagcategoryid: "0",
          tagname: tagname,
        }).then((res) => {
          if (res.rows[0]) {
            tagvalue = res.rows[0];
            tagvalue.isoperation = 1;
          } else {
            tagvalue = {
              tagname: tagname,
              isoperation: 1,
            };
          }
          this.ruleForm.ivrLibaTemplateTagList.push(tagvalue);
          this.dynamicTags.push(tagvalue);
        });
      }
      this.inputVisible = false;
      this.inputValue = "";
    },
    remoteMethodtag(query) {
      if (query !== "") {
        this.loading = true;
        setTimeout(() => {
          this.loading = false;
          listtag({ tagname: query, tagcategoryid: "0" }).then((res) => {
            this.optionstag = res.rows;
          });
        }, 200);
      } else {
        this.optionstag = [];
      }
    },
    showInput() {
      this.inputVisible = true;
      // 自动获取焦点
      // this.$nextTick((_) => {
      //   this.$refs.saveTagInput.$refs.input.focus();
      // });
    },
    //测试表单 ---------------------------------
    //话术题目----------------
    addzbiao() {},
    handleUpdate() {},
    deloption(item) {
      const index = this.userList.indexOf(item);
      if (index !== -1) {
        this.userList.splice(index, 1); // 从索引位置删除一个元素
        this.sortFn();
    resetQuery() {
      this.queryParams = { pageNum: 1, pageSize: 10 };
      this.getaddtopiclist();
    },
    getaddtopiclist() {
      this.drawer = true;
      getverbaltricklist(this.queryParams).then((res) => {
        this.loading = false;
        this.userList = res.rows;
        this.total = res.total;
        console.log(this.userList);
      });
    },
    addtopic(row) {
      console.log(row);
      getverbaltrick({ id: row.id }).then((res) => {
        console.log(res, "详情");
        res.data.isoperation = 1;
        res.data.id = null;
        res.data.ivrLibaScriptTargetoptionList.forEach((item) => {
          item.isoperation = 1;
        });
        this.ruleForm.ivrLibaTemplateScriptVOList.push(res.data);
      });
    },
    handleDelete(row) {
      let index = this.ruleForm.ivrLibaTemplateScriptVOList.indexOf(row);
      this.ruleForm.ivrLibaTemplateScriptVOList.splice(
        this.ruleForm.ivrLibaTemplateScriptVOList.indexOf(row),
        1
      );
      row.isoperation = 3;
      this.delScriptVOList.push(row);
    },
    handleUpdate(row) {
      console.log(row);
      this.optionIndex = this.ruleForm.ivrLibaTemplateScriptVOList.indexOf(row);
      if (row.ivrLibaScriptTargetoptionList.length) {
        this.topicobj = row;
      } else {
        console.log("未找到该对象");
        getverbaltrick({ id: row.id }).then((res) => {
          this.topicobj = res.data;
          console.log(res.data, "topicobj");
        });
      }
    },
    syioption(row) {
      const index = this.getIndexInArray(this.userList, row);
      const item = this.userList.splice(index, 1)[0]; // 移除指定索引处的元素,并保存到item变量中
      this.userList.splice(index - 1, 0, item); // 将item插入到索引位置的前一位
      const index = this.getIndexInArray(
        this.ruleForm.ivrLibaTemplateScriptVOList,
        row
      );
      const item = this.ruleForm.ivrLibaTemplateScriptVOList.splice(
        index,
        1
      )[0]; // 移除指定索引处的元素,并保存到item变量中
      this.ruleForm.ivrLibaTemplateScriptVOList.splice(index - 1, 0, item); // 将item插入到索引位置的前一位
      this.sortFn();
    },
    xiayioption(row) {
      const index = this.getIndexInArray(this.userList, row);
      const item = this.userList.splice(index, 1)[0]; // 移除指定索引处的元素,并保存到item变量中
      this.userList.splice(index + 1, 0, item); // 将item插入到索引位置的前一位
      const index = this.getIndexInArray(
        this.ruleForm.ivrLibaTemplateScriptVOList,
        row
      );
      const item = this.ruleForm.ivrLibaTemplateScriptVOList.splice(
        index,
        1
      )[0]; // 移除指定索引处的元素,并保存到item变量中
      this.ruleForm.ivrLibaTemplateScriptVOList.splice(index + 1, 0, item); // 将item插入到索引位置的前一位
      this.sortFn();
    },
    sortFn() {
      this.userList = this.userList.map((item, index) => {
        return {
          userid: index + 1,
          userName: item.userName,
          verbaltrick: item.verbaltrick,
        };
      });
      console.log(this.userList);
      this.ruleForm.ivrLibaTemplateScriptVOList =
        this.ruleForm.ivrLibaTemplateScriptVOList.map((item, index) => {
          return Object.assign({}, item, { guid: (index + 1).toString() });
        });
      console.log(this.ruleForm.ivrLibaTemplateScriptVOList);
    },
    // -----------------------话术选项
    deloption() {},
    // 修改题目信息
    Submittopicobj() {
     this.ruleForm.ivrLibaTemplateScriptVOList[this.optionIndex]=this.topicobj;
     this.$modal.msgSuccess("暂存选项成功");
    },
    // ---------------------
    // 查询题库
    handleQuery() {},
    resetQuery() {},
    resetForm(formName) {
      this.$refs[formName].resetFields();
    },
    // 疾病-----------------------
    handleCloseillness(tag) {
      this.illnesslist.splice(this.illnesslist.indexOf(tag), 1);
      if (tag.id) {
        this.illnesslistapi.push(tag.id);
      }
    },
    remoteMethod(value) {
      console.log(value);
      const illnessqueryParams = {
        pageNum: 1,
        pageSize: 100,
        icdname: value,
      };
      this.loading = true;
      setTimeout(() => {
        this.loading = false;
        getillnesslist(illnessqueryParams).then((response) => {
          this.optionsillness = response.rows;
        });
      }, 200);
    },
    illnessConfirm(item) {
      let opeavalue = {};
      let tagname = this.inputValueillness;
      illnesslistget(item).then((res) => {
        opeavalue = res.data;
        opeavalue.outid = this.id;
        opeavalue.type = 3;
        opeavalue.icd10id = opeavalue.icdid;
        opeavalue.icd10name = opeavalue.icdname;
        opeavalue.icd10code = opeavalue.icdcode;
        if (tagname) {
          this.illnesslist.push(opeavalue);
        }
      });
      console.log(this.illnesslist);
      this.inputVisibleillness = false;
      this.inputValueillness = "";
    },
  },
};
@@ -1015,14 +1384,9 @@
<style lang="scss" scoped>
.Questionnairemanagement {
  display: flex;
  // display: flex;
}
.sidecolumn {
  width: 300px;
  min-height: 100vh;
  text-align: center;
  //   display: flex;
  //   margin-top: 20px;
  margin: 20px;
  margin-bottom: 0;
  padding: 30px;
@@ -1034,9 +1398,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;
@@ -1120,8 +1483,10 @@
  .presentation-right {
    width: 55%;
    max-height: 688px;
    padding: 0 20px;
    margin: 0 20px;
    font-size: 18px;
    -webkit-box-shadow: 0 2px 4px 0 rgba(32, 32, 32, 0.12),
      0 0 6px 0 rgba(58, 57, 57, 0.04);
    overflow: auto;
    .headline {
      display: flex;