修改总分

This commit is contained in:
shidongli 2024-12-19 17:32:53 +08:00
parent 9716080532
commit c456faee40
2 changed files with 29 additions and 16 deletions

View File

@ -153,6 +153,10 @@
<span v-if="item.questionType == 'FILL_IN_THE_BLANKS'"
>填空题</span
>
<span v-if="item.questionType == 'FEEDBACK_BLANKS_SUBJECT'"
>反馈填空题</span
>
<span v-if="item.questionType == 'COMBINATION_SCORING_SUBJECT'"
>组合打分题</span
>
@ -203,7 +207,8 @@
<div
v-if="
item.questionType == 'FILL_IN_THE_BLANKS' ||
item.questionType == 'COMBINATION_BLANKS_SUBJECT'
item.questionType == 'COMBINATION_BLANKS_SUBJECT' ||
item.questionType == 'FEEDBACK_BLANKS_SUBJECT'
"
class="tk"
>
@ -569,9 +574,11 @@ 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;
@ -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) {

View File

@ -585,7 +585,7 @@
<el-dialog title="问卷查看" :visible.sync="questionshow" width="40%">
<div class="bottomheader">
<div class="right">
<div class="title" v-if="totalScoredata>0">总分{{ totalScoredata }}</div>
<div class="title" v-if="questiondata.totalScore || questiondata.totalScore ==0">总分{{ questiondata.totalScore }}</div>
<div
class="words"
v-for="(item, index) in questiondata.subjectResultList"
@ -840,7 +840,7 @@ export default {
// { required: true, message: "id", trigger: "blur" },
// ],
// },
totalScoredata:0,
// totalScoredata:0,
questionshow: false,
checkeddata: [],
formlist: [],
@ -867,17 +867,17 @@ export default {
},
methods: {
async questionlook(row) {
this.totalScoredata=0,
// this.totalScoredata=0,
await selectPatientQuestionSubmit(row.taskExecuteRecordId).then((res) => {
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" &&