|  |  | 
 |  |  |                 > | 
 |  |  |                   <el-option | 
 |  |  |                     class="ruleFormaa" | 
 |  |  |                     v-for="item in belongDepts" | 
 |  |  |                     :key="item.deptCode" | 
 |  |  |                     :label="item.deptName" | 
 |  |  |                     v-for="item in flatArray" | 
 |  |  |                     :key="item.id" | 
 |  |  |                     :label="item.label" | 
 |  |  |                     :value="item.deptCode" | 
 |  |  |                   > | 
 |  |  |                   </el-option> | 
 |  |  | 
 |  |  |                 > | 
 |  |  |                   <el-option | 
 |  |  |                     class="ruleFormaa" | 
 |  |  |                     v-for="item in belongWards" | 
 |  |  |                     :key="item.districtCode" | 
 |  |  |                     :label="item.districtName" | 
 |  |  |                     :value="item.districtCode" | 
 |  |  |                     v-for="item in flatArray" | 
 |  |  |                     :key="item.id" | 
 |  |  |                     :label="item.label" | 
 |  |  |                     :value="item.deptCode" | 
 |  |  |                   > | 
 |  |  |                   </el-option> | 
 |  |  |                 </el-select> </el-form-item | 
 |  |  | 
 |  |  |               >下一步</el-button | 
 |  |  |             > | 
 |  |  |             <el-button type="info" @click="closeFm('ruleForm')">关闭</el-button> | 
 |  |  |             <el-button @click="Departmenttreatment('ruleForm')" | 
 |  |  |             <el-button @click="toExamine('ruleForm')" | 
 |  |  |               >保存问卷基础信息</el-button | 
 |  |  |             > | 
 |  |  |           </el-form-item> | 
 |  |  | 
 |  |  |                   align="center" | 
 |  |  |                   key="nextScriptno" | 
 |  |  |                   prop="nextScriptno" | 
 |  |  |                   :show-overflow-tooltip="true" | 
 |  |  |                 > | 
 |  |  |                   <template slot-scope="scope"> | 
 |  |  |                     <span>{{ | 
 |  |  | 
 |  |  |                   <el-col :span="12"> | 
 |  |  |                     <el-form-item | 
 |  |  |                       label="问题分值" | 
 |  |  |                       v-if="topicobj.scoretype == 1" | 
 |  |  |                       v-if="ruleForm.scoreType == 1" | 
 |  |  |                     > | 
 |  |  |                       <el-input | 
 |  |  |                         v-model="topicobj.score" | 
 |  |  |                         placeholder="请输入题号" | 
 |  |  |                       ></el-input> | 
 |  |  |                     </el-form-item> | 
 |  |  |  | 
 |  |  |                     <el-form-item prop="valueType"> | 
 |  |  |                       <template #label> | 
 |  |  |                         结果类型 | 
 |  |  |                         <el-tooltip | 
 |  |  |                           class="item" | 
 |  |  |                           effect="light" | 
 |  |  |                           content="本类型为结果收集类型;选项用于指向性题目如是否等;文本适用复杂情况;数值用于收集数值型数据" | 
 |  |  |                           placement="top-start" | 
 |  |  |                         > | 
 |  |  |                           <i class="el-icon-warning-outline"></i> | 
 |  |  |                         </el-tooltip> | 
 |  |  |                         <!-- 在标签后插入红色星号 --> | 
 |  |  |                       </template> | 
 |  |  |                       <el-radio-group v-model="topicobj.valueType"> | 
 |  |  |                         <el-radio :label="1">选项</el-radio> | 
 |  |  |                         <el-radio :label="2">文本</el-radio> | 
 |  |  |                         <el-radio :label="3">数值</el-radio> | 
 |  |  |                       </el-radio-group> | 
 |  |  |                     </el-form-item> | 
 |  |  |                   </el-col> | 
 |  |  |                 </el-row> | 
 |  |  | 
 |  |  |                     </el-form-item></el-col | 
 |  |  |                   > | 
 |  |  |                   <el-col :span="12" | 
 |  |  |                     ><el-form-item label="是否可用"> | 
 |  |  |                       <el-radio-group v-model="topicobj.isenable"> | 
 |  |  |                     ><el-form-item label="是否隐藏"> | 
 |  |  |                       <el-radio-group v-model="topicobj.ishide"> | 
 |  |  |                         <el-radio | 
 |  |  |                           v-for="(item, index) in usable" | 
 |  |  |                           v-for="(item, index) in hides" | 
 |  |  |                           :label="item.value" | 
 |  |  |                           >{{ item.label }}</el-radio | 
 |  |  |                         > | 
 |  |  | 
 |  |  |                   v-if="topicobj.scriptType == 1" | 
 |  |  |                 > | 
 |  |  |                   <el-radio-group v-model="topicobj.branchFlag"> | 
 |  |  |                     <el-radio :label="1">是</el-radio> | 
 |  |  |                     <el-radio :label="0">否</el-radio> | 
 |  |  |                     <el-radio label="1">是</el-radio> | 
 |  |  |                     <el-radio label="0">否</el-radio> | 
 |  |  |                   </el-radio-group> | 
 |  |  |                 </el-form-item> | 
 |  |  |                 <el-form-item label="选中提示" v-if="topicobj.scriptType != 1"> | 
 |  |  | 
 |  |  |                     v-for="item in topicobj.svyLibTemplateTargetoptions" | 
 |  |  |                   > | 
 |  |  |                     <el-row :gutter="5"> | 
 |  |  |                       <el-col :span="16" | 
 |  |  |                       <el-col :span="12" | 
 |  |  |                         ><el-form-item label="选项名称"> | 
 |  |  |                           <el-input | 
 |  |  |                             type="text" | 
 |  |  | 
 |  |  |                           > | 
 |  |  |                           </el-input> </el-form-item | 
 |  |  |                       ></el-col> | 
 |  |  |                       <el-col :span="8"> | 
 |  |  |                       <el-col :span="12"> | 
 |  |  |                         <el-form-item | 
 |  |  |                           v-if="topicobj.scoretype == 1" | 
 |  |  |                           v-if="ruleForm.scoreType == 1" | 
 |  |  |                           label="选项分值" | 
 |  |  |                         > | 
 |  |  |                           <el-input | 
 |  |  | 
 |  |  |                           </el-input> | 
 |  |  |                         </el-form-item> | 
 |  |  |                         <el-form-item | 
 |  |  |                           v-else-if="topicobj.scoretype == 2" | 
 |  |  |                           v-else-if="ruleForm.scoreType == 2" | 
 |  |  |                           label="ABC等级" | 
 |  |  |                         > | 
 |  |  |                           <el-radio-group v-model="item.score"> | 
 |  |  |                             <el-radio label="A">A</el-radio> | 
 |  |  |                             <el-radio label="B">B</el-radio> | 
 |  |  |                             <el-radio label="C">C</el-radio> | 
 |  |  |                             <el-radio :label="1">A</el-radio> | 
 |  |  |                             <el-radio :label="2">B</el-radio> | 
 |  |  |                             <el-radio :label="3">C</el-radio> | 
 |  |  |                           </el-radio-group> | 
 |  |  |                         </el-form-item> | 
 |  |  |                         <el-form-item | 
 |  |  |                           v-else-if="topicobj.scoretype == 3" | 
 |  |  |                           v-else-if="ruleForm.scoreType == 3" | 
 |  |  |                           label="优良等级" | 
 |  |  |                         > | 
 |  |  |                           <el-radio-group v-model="item.score"> | 
 |  |  | 
 |  |  |                         <el-radio-group v-model="item.isabnormal"> | 
 |  |  |                           <el-radio :label="1">是</el-radio> | 
 |  |  |                           <el-radio :label="0">否</el-radio> | 
 |  |  |                         </el-radio-group> | 
 |  |  |                       </el-form-item> | 
 |  |  |                       <el-form-item label="是否选中收集附加信息"> | 
 |  |  |                         <el-radio-group v-model="item.appendflag"> | 
 |  |  |                           <el-radio label="1">是</el-radio> | 
 |  |  |                           <el-radio label="0">否</el-radio> | 
 |  |  |                         </el-radio-group> | 
 |  |  |                       </el-form-item> | 
 |  |  |                     </el-row> | 
 |  |  | 
 |  |  |                             <el-image | 
 |  |  |                               style="width: 100px; height: 100px" | 
 |  |  |                               :src="item.picturePath" | 
 |  |  |                               :preview-src-list="[...item.picturePath]" | 
 |  |  |                               :preview-src-list=" | 
 |  |  |                                 item.picturePath ? [item.picturePath] : [] | 
 |  |  |                               " | 
 |  |  |                             > | 
 |  |  |                             </el-image> | 
 |  |  |                           </div> | 
 |  |  | 
 |  |  |         > | 
 |  |  |         <el-button type="primary" @click="laststep()">上一步</el-button> | 
 |  |  |         <el-button type="info" @click="closeFm('ruleForm')">关闭</el-button> | 
 |  |  |         <el-button @click="Departmenttreatment('ruleForm')" | 
 |  |  |           >保存问题数据</el-button | 
 |  |  |         > | 
 |  |  |         <el-button @click="toExamine('ruleForm')">保存问题数据</el-button> | 
 |  |  |       </div> | 
 |  |  |       <!-- 问卷预览 --> | 
 |  |  |       <div v-if="Editprogress == 3"> | 
 |  |  | 
 |  |  |                     <el-col :span="12"> | 
 |  |  |                       <el-form-item label="评价类型"> | 
 |  |  |                         <el-select | 
 |  |  |                           v-model="indexform.scoretype" | 
 |  |  |                           v-model="indexform.scoreType" | 
 |  |  |                           placeholder="请选择分类" | 
 |  |  |                         > | 
 |  |  |                           <el-option | 
 |  |  | 
 |  |  |                       ></el-col> | 
 |  |  |                       <el-col :span="11"> | 
 |  |  |                         <el-form-item | 
 |  |  |                           v-if="indexform.scoretype == 1" | 
 |  |  |                           v-if="indexform.scoreType == 1" | 
 |  |  |                           label="分值" | 
 |  |  |                         > | 
 |  |  |                           <el-input | 
 |  |  | 
 |  |  |                           </el-input> | 
 |  |  |                         </el-form-item> | 
 |  |  |                         <el-form-item | 
 |  |  |                           v-else-if="indexform.scoretype == 2" | 
 |  |  |                           v-else-if="indexform.scoreType == 2" | 
 |  |  |                           label="ABC等级" | 
 |  |  |                         > | 
 |  |  |                           <el-radio-group v-model="item.score"> | 
 |  |  |                             <el-radio label="A">A</el-radio> | 
 |  |  |                             <el-radio label="B">B</el-radio> | 
 |  |  |                             <el-radio label="C">C</el-radio> | 
 |  |  |                             <el-radio :label="1">A</el-radio> | 
 |  |  |                             <el-radio :label="2">B</el-radio> | 
 |  |  |                             <el-radio :label="3">C</el-radio> | 
 |  |  |                           </el-radio-group> | 
 |  |  |                         </el-form-item> | 
 |  |  |                         <el-form-item | 
 |  |  |                           v-else-if="indexform.scoretype == 3" | 
 |  |  |                           v-else-if="indexform.scoreType == 3" | 
 |  |  |                           label="优良等级" | 
 |  |  |                         > | 
 |  |  |                           <el-radio-group v-model="item.score"> | 
 |  |  | 
 |  |  |  | 
 |  |  |                       <el-col | 
 |  |  |                         :span="2" | 
 |  |  |                         :offsset="indexform.scoretype == 4 ? 11 : 0" | 
 |  |  |                         :offsset="indexform.scoreType == 4 ? 11 : 0" | 
 |  |  |                       > | 
 |  |  |                         <el-button | 
 |  |  |                           type="danger" | 
 |  |  | 
 |  |  |                           <el-image | 
 |  |  |                             style="width: 100px; height: 100px" | 
 |  |  |                             :src="item.picturePath" | 
 |  |  |                             :preview-src-list="[...item.picturePath]" | 
 |  |  |                             :preview-src-list=" | 
 |  |  |                               item.picturePath ? [item.picturePath] : [] | 
 |  |  |                             " | 
 |  |  |                           > | 
 |  |  |                           </el-image> | 
 |  |  |                         </div> | 
 |  |  | 
 |  |  | } from "@/api/AiCentre/index"; | 
 |  |  | import OptionalForm from "@/components/OptionalForm"; //正则组件 | 
 |  |  | import { getToken } from "@/utils/auth"; | 
 |  |  | import { deptTreeSelect } from "@/api/system/user"; | 
 |  |  |  | 
 |  |  | export default { | 
 |  |  |   name: "Questionnaireinfo", | 
 |  |  | 
 |  |  |         svyTemplateLibScripts: [], | 
 |  |  |         tempDetpRelevances: [], | 
 |  |  |         svyLibTemplateTagList: [], | 
 |  |  |         suitway: [], | 
 |  |  |         scoreType: "4", | 
 |  |  |         isenable: "0", | 
 |  |  |         longTemp: "0", | 
 |  |  | 
 |  |  |       illnessVisible: false, //指标疾病弹框 | 
 |  |  |       Operateit: true, | 
 |  |  |       deptOptions: [], | 
 |  |  |       flatArray: [], | 
 |  |  |       optionsillness: [], | 
 |  |  |       delScriptVOList: [], | 
 |  |  |       illnesslistapi: [], | 
 |  |  | 
 |  |  |       usable: [ | 
 |  |  |         { value: "0", label: "可用" }, | 
 |  |  |         { value: "1", label: "停用" }, | 
 |  |  |       ], | 
 |  |  |       hides: [ | 
 |  |  |         { value: 0, label: "正常" }, | 
 |  |  |         { value: 1, label: "隐藏" }, | 
 |  |  |       ], | 
 |  |  |       longtype: [ | 
 |  |  |         { value: "0", label: "普通任务" }, | 
 |  |  | 
 |  |  |   created() { | 
 |  |  |     this.getissueinfo(); | 
 |  |  |     this.gettabList(); | 
 |  |  |     this.getDeptTree(); | 
 |  |  |     this.mode = store.getters.Askmode; | 
 |  |  |     this.languagelist = store.getters.languagelist; | 
 |  |  |     this.usable = store.getters.usable; | 
 |  |  | 
 |  |  |       }); | 
 |  |  |       this.tempDetpRelevanceslist = []; | 
 |  |  |       this.tempbelongWards = []; | 
 |  |  |  | 
 |  |  |       depthospgetsonlist(this.queryParamsdept).then((res) => { | 
 |  |  |         if (res.code == 200) { | 
 |  |  |           let arr = res.rows; | 
 |  |  |           arr.forEach((item) => { | 
 |  |  |             if (item.deptType == 1) { | 
 |  |  |               this.deptlist.push(item); | 
 |  |  |               this.tempDetpRelevanceslist.push(item.deptCode); | 
 |  |  |             } else if (item.deptType == 2) { | 
 |  |  |               this.hosplist.push(item); | 
 |  |  |               this.tempbelongWards.push(item.deptCode); | 
 |  |  |             } | 
 |  |  |           }); | 
 |  |  |         } | 
 |  |  |       if (this.queryParamsdept.tempid) { | 
 |  |  |         depthospgetsonlist(this.queryParamsdept).then((res) => { | 
 |  |  |           if (res.code == 200) { | 
 |  |  |             let arr = res.rows; | 
 |  |  |             arr.forEach((item) => { | 
 |  |  |               if (item.deptType == 1) { | 
 |  |  |                 this.deptlist.push(item); | 
 |  |  |                 this.tempDetpRelevanceslist.push(item.deptCode); | 
 |  |  |               } else if (item.deptType == 2) { | 
 |  |  |                 this.hosplist.push(item); | 
 |  |  |                 this.tempbelongWards.push(item.deptCode); | 
 |  |  |               } | 
 |  |  |             }); | 
 |  |  |           } | 
 |  |  |         }); | 
 |  |  |       } | 
 |  |  |     }, | 
 |  |  |     // 获取科室树 | 
 |  |  |     getDeptTree() { | 
 |  |  |       // 科室列表 | 
 |  |  |       deptTreeSelect().then((response) => { | 
 |  |  |         this.deptOptions = response.data; | 
 |  |  |         this.flatArray = this.flattenArray(response.data); | 
 |  |  |       }); | 
 |  |  |     }, | 
 |  |  |     flattenArray(multiArray) { | 
 |  |  |       let result = []; | 
 |  |  |  | 
 |  |  |       // 递归函数,用于将多级数组转换为一维数组,只包含最底层的元素 | 
 |  |  |       function flatten(element) { | 
 |  |  |         // 如果当前元素有子元素,继续递归 | 
 |  |  |         if (element.children && element.children.length > 0) { | 
 |  |  |           element.children.forEach((child) => flatten(child)); | 
 |  |  |         } else { | 
 |  |  |           // 克隆元素以避免修改原始数据 | 
 |  |  |           let item = JSON.parse(JSON.stringify(element)); | 
 |  |  |           result.push(item); // 将最底层的元素添加到结果数组 | 
 |  |  |         } | 
 |  |  |       } | 
 |  |  |  | 
 |  |  |       // 从顶层元素开始递归 | 
 |  |  |       multiArray.forEach((element) => flatten(element)); | 
 |  |  |       return result; // 返回只包含最底层元素的一维数组 | 
 |  |  |     }, | 
 |  |  |     submitForm(formName) { | 
 |  |  |       this.$modal.loading("正在修正保存数据,请稍候..."); | 
 |  |  | 
 |  |  |         this.ruleForm.categoryid = -1; | 
 |  |  |       } | 
 |  |  |       // 题目保存处理 | 
 |  |  |         //   提交 | 
 |  |  |         this.ruleForm.svyTemplateLibScripts.forEach((res) => { | 
 |  |  |       //   提交 | 
 |  |  |       this.ruleForm.svyTemplateLibScripts.forEach((res) => { | 
 |  |  |         if (!res.isoperation) { | 
 |  |  |           res.isoperation = 2; | 
 |  |  |         } | 
 |  |  |         res.ivrLibaScriptTargetoptionList = | 
 |  |  |           res.svyLibTemplateTargetoptions.map((item) => { | 
 |  |  |         res.ivrLibaScriptTargetoptionList = res.svyLibTemplateTargetoptions.map( | 
 |  |  |           (item) => { | 
 |  |  |             if (!item.isoperation) { | 
 |  |  |               item.isoperation = 2; | 
 |  |  |               item.templateID = this.ruleForm.id; | 
 |  |  |             } | 
 |  |  |             return item; | 
 |  |  |           }); | 
 |  |  |           } | 
 |  |  |         ); | 
 |  |  |       }); | 
 |  |  |       this.delScriptVOList.forEach((item)=>{ | 
 |  |  |           this.ruleForm.svyTemplateLibScripts.push(item) | 
 |  |  |         }) | 
 |  |  |       this.delScriptVOList.forEach((item) => { | 
 |  |  |         this.ruleForm.svyTemplateLibScripts.push(item); | 
 |  |  |       }); | 
 |  |  |       if (this.id) { | 
 |  |  |         this.ruleForm.isoperation = 2; | 
 |  |  |         this.ruleForm.tempDetpRelevances = null; | 
 |  |  | 
 |  |  |           this.confirmillness(); | 
 |  |  |           this.putbelongDepts(); | 
 |  |  |           this.$modal.closeLoading(); | 
 |  |  |           // this.$router.go(-1); | 
 |  |  |           window.location.reload(); | 
 |  |  |           this.$router.go(-1); | 
 |  |  |           // window.location.reload(); | 
 |  |  |         }); | 
 |  |  |       } else { | 
 |  |  |         this.ruleForm.isoperation = 1; | 
 |  |  | 
 |  |  |         }); | 
 |  |  |       } | 
 |  |  |     }, | 
 |  |  |     // 题目校验 | 
 |  |  |     toExamine() { | 
 |  |  |       // 遍历题目集合 | 
 |  |  |       for (let i = 0; i < this.ruleForm.svyTemplateLibScripts.length; i++) { | 
 |  |  |         const question = this.ruleForm.svyTemplateLibScripts[i]; | 
 |  |  |  | 
 |  |  |         // 如果 scriptType 为 4,则跳过当前题目 | 
 |  |  |         if (question.scriptType === 4) { | 
 |  |  |           continue; | 
 |  |  |         } | 
 |  |  |         // 获取当前题目的选项集合 | 
 |  |  |         const options = question.svyLibTemplateTargetoptions; | 
 |  |  |  | 
 |  |  |         // 创建一个 Set 来存储选项名称,用于检测重复 | 
 |  |  |         const optionNames = new Set(); | 
 |  |  |  | 
 |  |  |         // 遍历选项集合 | 
 |  |  |         for (let j = 0; j < options.length; j++) { | 
 |  |  |           const option = options[j]; | 
 |  |  |           const optionContent = option.optioncontent; | 
 |  |  |  | 
 |  |  |           // 如果选项名称已经存在于 Set 中,说明重复 | 
 |  |  |           if (optionNames.has(optionContent)) { | 
 |  |  |             this.$message.error( | 
 |  |  |               `题目 ${question.id} 的选项名称 "${optionContent}" 重复` | 
 |  |  |             ); | 
 |  |  |             return false; // 返回 false 表示校验失败 | 
 |  |  |           } | 
 |  |  |           // 将选项名称添加到 Set 中 | 
 |  |  |           optionNames.add(optionContent); | 
 |  |  |         } | 
 |  |  |       } | 
 |  |  |  | 
 |  |  |       // 如果所有题目都校验通过,返回 true | 
 |  |  |       console.log("所有题目校验通过,选项名称无重复"); | 
 |  |  |       this.Departmenttreatment(); | 
 |  |  |     }, | 
 |  |  |  | 
 |  |  |     // 科室/院区处理 | 
 |  |  |     Departmenttreatment() { | 
 |  |  |       this.tempDetpRelevanceslist.forEach((item) => { | 
 |  |  | 
 |  |  |     // 获取问题列表 | 
 |  |  |     getaddtopiclist() { | 
 |  |  |       this.drawer = true; | 
 |  |  |       this.queryParams.scoretype = this.ruleForm.scoreType; | 
 |  |  |       this.queryParams.scoreType = this.ruleForm.scoreType; | 
 |  |  |       getissuelist(this.queryParams).then((res) => { | 
 |  |  |         this.loading = false; | 
 |  |  |         this.userList = res.rows; | 
 |  |  | 
 |  |  |     }, | 
 |  |  |     // 保存科室/病区 | 
 |  |  |     putbelongDepts(id) { | 
 |  |  |       this.tempDetpRelevanceslistform.forEach((item) => { | 
 |  |  |         if (!item.tempid) item.tempid = id; | 
 |  |  |       }); | 
 |  |  |       this.tempbelongWardsform.forEach((item) => { | 
 |  |  |         if (!item.tempid) item.tempid = id; | 
 |  |  |       }); | 
 |  |  |       if (this.tempDetpRelevanceslistform.length > 0) { | 
 |  |  |         depthospgetson(this.tempDetpRelevanceslistform).then((res) => { | 
 |  |  |           if (res.code == 200) { | 
 |  |  | 
 |  |  |   display: flex; | 
 |  |  |   .presentation-left { | 
 |  |  |     width: 45%; | 
 |  |  |     // height: 500px; | 
 |  |  |     max-height: 80vh; | 
 |  |  |     padding: 0 20px; | 
 |  |  |     font-size: 18px; | 
 |  |  |     overflow: auto; | 
 |  |  |     .button-textxg { | 
 |  |  |       color: #024df0; | 
 |  |  |     } | 
 |  |  | 
 |  |  |   } | 
 |  |  |   .presentation-right { | 
 |  |  |     width: 55%; | 
 |  |  |     max-height: 688px; | 
 |  |  |     max-height: 80vh; | 
 |  |  |     padding: 0 20px; | 
 |  |  |     font-size: 18px; | 
 |  |  |     overflow: auto; |