From c456faee40062bc3d8e5cc57983dfacafa43ac36 Mon Sep 17 00:00:00 2001 From: shidongli Date: Thu, 19 Dec 2024 17:32:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=80=BB=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/manage/components/Taskprocess.vue | 25 ++++++++++++++++----- src/views/system/followup/index.vue | 20 ++++++++--------- 2 files changed, 29 insertions(+), 16 deletions(-) diff --git a/src/views/manage/components/Taskprocess.vue b/src/views/manage/components/Taskprocess.vue index 95443d0..6aab3cd 100644 --- a/src/views/manage/components/Taskprocess.vue +++ b/src/views/manage/components/Taskprocess.vue @@ -153,6 +153,10 @@ (填空题) + (反馈填空题) + (组合打分题) @@ -203,7 +207,8 @@
@@ -569,10 +574,12 @@ export default { e.questionType == "COMBINATION_MULTIPLE_SUBJECT" || e.questionType == "COMBINATION_SCORING_SUBJECT" ) { - e.whetherScore = "1"; - } else { + if(e.whetherScore==true){ + e.whetherScore = "1"; + }else{ e.whetherScore = "0"; - } + } + } e.questionSubjectOptionList.forEach((el) => { el.questionNumber = e.questionNumber; if ( @@ -589,13 +596,13 @@ export default { /** 提交按钮 */ submit() { - // return if (this.$route.query.taskNodeType == "QUESTIONNAIRE_SCALE") { // 对象.新名字=对象.原数组 this.$delete(this.questiondata, "updateBy"); this.$delete(this.questiondata, "updateTime"); var score = 0; // 单选、多选、打分分值 + var lengthScore=this.questiondata.questionSubjectList.filter(f=> f.whetherScore == '0') this.questiondata.questionSubjectList.forEach((e) => { if (e.questionSubjectOptionList?.length > 0) { e.questionSubjectOptionList.forEach((el) => { @@ -607,12 +614,17 @@ export default { e.questionType == "COMBINATION_MULTIPLE_SUBJECT" || e.questionType == "COMBINATION_SCORING_SUBJECT" ) { - if (el.optionChooseSign == "0") { + if (el.optionChooseSign == "0" && e.whetherScore == '1') { score += el.optionScore; } } + }); + if(lengthScore.length==this.questiondata.questionSubjectList.length){ + this.questiondata.totalScore = ''; + }else{ this.questiondata.totalScore = score; + } } }); this.questiondata.subjectResultDTOList = @@ -649,6 +661,7 @@ export default { // this.$delete(this.obj, 'totalScore',) } // 问卷 + // return if (this.$route.query.taskNodeType == "QUESTIONNAIRE_SCALE") { this.$refs["questiondata"].validate((valid) => { if (valid) { diff --git a/src/views/system/followup/index.vue b/src/views/system/followup/index.vue index 63b4205..617ccb8 100644 --- a/src/views/system/followup/index.vue +++ b/src/views/system/followup/index.vue @@ -585,7 +585,7 @@
-
总分:{{ totalScoredata }}分
+
总分:{{ questiondata.totalScore }}分
{ this.questiondata = res.data; this.questiondata.subjectResultList.forEach((e) => { - if(e.whetherScore==1){ - e.optionResults.forEach((el) => { - if(el.optionChooseSign=="0"){ - this.totalScoredata += el.optionScore - } - }) - } + // if(e.whetherScore==1){ + // e.optionResults.forEach((el) => { + // if(el.optionChooseSign=="0"){ + // this.totalScoredata += el.optionScore + // } + // }) + // } e.optionResults.forEach((el) => { if ( (el.optionChooseSign == "0" &&