修改总分

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 v-if="item.questionType == 'FILL_IN_THE_BLANKS'"
>填空题</span >填空题</span
> >
<span v-if="item.questionType == 'FEEDBACK_BLANKS_SUBJECT'"
>反馈填空题</span
>
<span v-if="item.questionType == 'COMBINATION_SCORING_SUBJECT'" <span v-if="item.questionType == 'COMBINATION_SCORING_SUBJECT'"
>组合打分题</span >组合打分题</span
> >
@ -203,7 +207,8 @@
<div <div
v-if=" v-if="
item.questionType == 'FILL_IN_THE_BLANKS' || item.questionType == 'FILL_IN_THE_BLANKS' ||
item.questionType == 'COMBINATION_BLANKS_SUBJECT' item.questionType == 'COMBINATION_BLANKS_SUBJECT' ||
item.questionType == 'FEEDBACK_BLANKS_SUBJECT'
" "
class="tk" class="tk"
> >
@ -569,10 +574,12 @@ export default {
e.questionType == "COMBINATION_MULTIPLE_SUBJECT" || e.questionType == "COMBINATION_MULTIPLE_SUBJECT" ||
e.questionType == "COMBINATION_SCORING_SUBJECT" e.questionType == "COMBINATION_SCORING_SUBJECT"
) { ) {
e.whetherScore = "1"; if(e.whetherScore==true){
} else { e.whetherScore = "1";
}else{
e.whetherScore = "0"; e.whetherScore = "0";
} }
}
e.questionSubjectOptionList.forEach((el) => { e.questionSubjectOptionList.forEach((el) => {
el.questionNumber = e.questionNumber; el.questionNumber = e.questionNumber;
if ( if (
@ -589,13 +596,13 @@ export default {
/** 提交按钮 */ /** 提交按钮 */
submit() { submit() {
// return
if (this.$route.query.taskNodeType == "QUESTIONNAIRE_SCALE") { if (this.$route.query.taskNodeType == "QUESTIONNAIRE_SCALE") {
// .=. // .=.
this.$delete(this.questiondata, "updateBy"); this.$delete(this.questiondata, "updateBy");
this.$delete(this.questiondata, "updateTime"); this.$delete(this.questiondata, "updateTime");
var score = 0; var score = 0;
// //
var lengthScore=this.questiondata.questionSubjectList.filter(f=> f.whetherScore == '0')
this.questiondata.questionSubjectList.forEach((e) => { this.questiondata.questionSubjectList.forEach((e) => {
if (e.questionSubjectOptionList?.length > 0) { if (e.questionSubjectOptionList?.length > 0) {
e.questionSubjectOptionList.forEach((el) => { e.questionSubjectOptionList.forEach((el) => {
@ -607,12 +614,17 @@ export default {
e.questionType == "COMBINATION_MULTIPLE_SUBJECT" || e.questionType == "COMBINATION_MULTIPLE_SUBJECT" ||
e.questionType == "COMBINATION_SCORING_SUBJECT" e.questionType == "COMBINATION_SCORING_SUBJECT"
) { ) {
if (el.optionChooseSign == "0") { if (el.optionChooseSign == "0" && e.whetherScore == '1') {
score += el.optionScore; score += el.optionScore;
} }
} }
}); });
if(lengthScore.length==this.questiondata.questionSubjectList.length){
this.questiondata.totalScore = '';
}else{
this.questiondata.totalScore = score; this.questiondata.totalScore = score;
}
} }
}); });
this.questiondata.subjectResultDTOList = this.questiondata.subjectResultDTOList =
@ -649,6 +661,7 @@ export default {
// this.$delete(this.obj, 'totalScore',) // this.$delete(this.obj, 'totalScore',)
} }
// //
// return
if (this.$route.query.taskNodeType == "QUESTIONNAIRE_SCALE") { if (this.$route.query.taskNodeType == "QUESTIONNAIRE_SCALE") {
this.$refs["questiondata"].validate((valid) => { this.$refs["questiondata"].validate((valid) => {
if (valid) { if (valid) {

View File

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