diff --git a/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeQuestionFormItem.vue b/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeQuestionFormItem.vue index 80f19e12..f9471673 100644 --- a/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeQuestionFormItem.vue +++ b/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeQuestionFormItem.vue @@ -67,7 +67,7 @@ :label="`${question.QuestionName}`" :prop="question.Id" :rules="[ - { required: (question.IsRequired === 0 || (question.IsRequired ===1 && question.RelevanceId && (question.RelevanceValueList.includes(questionForm[question.RelevanceId])))) && question.Type!=='group' && question.Type!=='summary', + { required: (question.IsRequired === 0 || (question.IsRequired ===1 && question.RelevanceId && (question.RelevanceValueList.includes(isNaN(parseFloat(questionForm[question.RelevanceId])) ? questionForm[question.RelevanceId] : questionForm[question.RelevanceId].toString())))) && question.Type!=='group' && question.Type!=='summary', message: $t('common:ruleMessage:specify'), trigger: ['blur', 'change']}, ]" :class="[question.Type==='group'?'mb':question.Type==='upload'?'uploadWrapper':'']" @@ -202,11 +202,23 @@ /> - + + + {{this.$t('common:button:upload')}} - - - - - - - - - - - - - - - - - - - - - - - - - 0) { @@ -554,7 +534,6 @@ export default { this.$set(this.QuestionsForm, obj.key, null) }, handleSave() { - console.log(this.QuestionsForm) this.$refs.tableQsForm.validate(valid => { if (!valid) return const loading = this.$loading({ fullscreen: true }) @@ -613,9 +592,7 @@ export default { }) }, save() { - console.log(this.$refs.tableQsForm, this.QuestionsForm) this.$refs['tableQsForm'].validate((valid) => { - console.log(valid) if (!valid) return if (this.addOrEdit.type === 'add') { this.AnswersList.push(this.QuestionsForm) @@ -723,6 +700,18 @@ export default { } num = Math.min(...dataArr); break; + case 13: + if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) { + dataArr.push(parseFloat(this.questionForm[o.TableQuestionId])) + } + num = dataArr.length === 0 ? 0 : dataArr.reduce((acc, curr) => acc && curr, 0) ? 1 : 0; + break; + case 14: + if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) { + dataArr.push(parseFloat(this.questionForm[o.TableQuestionId])) + } + num = dataArr.length === 0 ? 0 : dataArr.reduce((acc, curr) => acc || curr, 0) > 0 ? 1 : 0; + break; } } }) @@ -733,7 +722,12 @@ export default { if (rules.ValueType === 2) { num = num * 100 } - return num.toFixed(digitPlaces) + if (rules.CustomCalculateMark === 13 || rules.CustomCalculateMark === 14) { + return num + } else { + return num.toFixed(digitPlaces) + } + }, formItemNumberChange(questionId, isTable) { if (isTable) { diff --git a/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeQuestionsPreview.vue b/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeQuestionsPreview.vue index ceabb5a1..c30b8a6a 100644 --- a/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeQuestionsPreview.vue +++ b/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeQuestionsPreview.vue @@ -248,9 +248,7 @@ export default { }) answer = o ? o.label.trim() : null } - if (answer !== null) { - this.$set(this.questionForm, i.classId, answer) - } + this.$set(this.questionForm, i.classId, answer) } }) // if (this.classArr.length > 0) { diff --git a/src/views/trials/trials-panel/setting/reading-unit/components/QuestionFormItem.vue b/src/views/trials/trials-panel/setting/reading-unit/components/QuestionFormItem.vue index 2641fb03..6a94a862 100644 --- a/src/views/trials/trials-panel/setting/reading-unit/components/QuestionFormItem.vue +++ b/src/views/trials/trials-panel/setting/reading-unit/components/QuestionFormItem.vue @@ -39,7 +39,7 @@ v-if=" (question.ShowQuestion === 1 && !!~question.ParentTriggerValueList.indexOf( - questionForm[question.ParentId].toString() + questionForm[question.ParentId] )) || question.ShowQuestion === 0 " @@ -52,8 +52,8 @@ (question.IsRequired === 1 && question.RelevanceId && !!~question.RelevanceValueList.indexOf( - questionForm[question.RelevanceId].toString() - ))) && + isNaN(parseFloat(questionForm[question.RelevanceId])) ? questionForm[question.RelevanceId] : + questionForm[question.RelevanceId].toString()))) && question.Type !== 'group' && question.Type !== 'summary', message: this.$t('common:ruleMessage:specify'), @@ -625,6 +625,18 @@ export default { } num = Math.min(...dataArr); break; + case 13: + if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) { + dataArr.push(parseFloat(this.questionForm[o.TableQuestionId])) + } + num = dataArr.length === 0 ? 0 : dataArr.reduce((acc, curr) => acc && curr, 0) ? 1 : 0; + break; + case 14: + if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) { + dataArr.push(parseFloat(this.questionForm[o.TableQuestionId])) + } + num = dataArr.length === 0 ? 0 : dataArr.reduce((acc, curr) => acc || curr, 0) > 0 ? 1 : 0; + break; } } }); @@ -651,6 +663,7 @@ export default { var find = v.CalculateQuestionList.filter((o) => { return o.TableQuestionId === questionId; }); + // find的自动计算值number if (find) { var num = this.logic(v); @@ -782,7 +795,6 @@ export default { this.$emit("setFormItemData", obj); }, setTblFormItemData(obj) { - console.log('setTblFormItemData', this.classArr) this.$set(this.QuestionsForm, obj.key, obj.val) this.classArr.map(i=>{ if (i.triggerId === obj.key) { @@ -802,9 +814,7 @@ export default { }) answer = o ? o.label : null } - if (answer !== null) { - this.$set(this.QuestionsForm, i.classId, answer) - } + this.$set(this.QuestionsForm, i.classId, answer) } }) // if (this.classArr.length > 0) { diff --git a/src/views/trials/trials-panel/setting/reading-unit/components/QuestionsForm.vue b/src/views/trials/trials-panel/setting/reading-unit/components/QuestionsForm.vue index 737c672f..9b923645 100644 --- a/src/views/trials/trials-panel/setting/reading-unit/components/QuestionsForm.vue +++ b/src/views/trials/trials-panel/setting/reading-unit/components/QuestionsForm.vue @@ -169,7 +169,7 @@ @@ -203,7 +203,7 @@ @@ -310,8 +310,7 @@ @@ -470,7 +469,7 @@