From 6be49398a90a339a6c72ac9ea7a09fc368acda87 Mon Sep 17 00:00:00 2001 From: WXL <1785969728@qq.com> Date: 星期三, 30 四月 2025 15:48:08 +0800 Subject: [PATCH] 测试完成 --- src/views/knowledge/questionnaire/compilequer/index.vue | 50 ++++++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 44 insertions(+), 6 deletions(-) diff --git a/src/views/knowledge/questionnaire/compilequer/index.vue b/src/views/knowledge/questionnaire/compilequer/index.vue index 208b3a9..5a12bb0 100644 --- a/src/views/knowledge/questionnaire/compilequer/index.vue +++ b/src/views/knowledge/questionnaire/compilequer/index.vue @@ -310,7 +310,7 @@ >涓嬩竴姝�</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> @@ -635,8 +635,8 @@ > <el-radio-group v-model="item.score"> <el-radio :label="1">A</el-radio> - <el-radio :label="2">B</el-radio> - <el-radio :label="3">C</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 @@ -747,7 +747,7 @@ > <el-button type="primary" @click="laststep()">涓婁竴姝�</el-button> <el-button type="info" @click="closeFm('ruleForm')">鍏抽棴</el-button> - <el-button @click="Departmenttreatment('ruleForm')" + <el-button @click="toExamine('ruleForm')" >淇濆瓨闂鏁版嵁</el-button > </div> @@ -1147,8 +1147,8 @@ > <el-radio-group v-model="item.score"> <el-radio :label="1">A</el-radio> - <el-radio :label="2">B</el-radio> - <el-radio :label="3">C</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 @@ -1636,6 +1636,44 @@ }); } }, + // 棰樼洰鏍¢獙 + 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) => { -- Gitblit v1.9.3