临床数据配置添加默认值
continuous-integration/drone/push Build is passing Details

main
wangxiaoshuang 2025-06-24 11:19:25 +08:00
parent 1ad3047689
commit c1bcaa7e5d
2 changed files with 53 additions and 65 deletions

View File

@ -1,52 +1,30 @@
<template>
<div v-loading="loading" style="min-height: 500px;">
<el-form
v-if="isRender"
data-viewport-uid="lc"
ref="questions"
size="small"
:model="questionForm"
:disabled="openType === 'look'"
>
<el-form v-if="isRender" data-viewport-uid="lc" ref="questions" size="small" :model="questionForm"
:disabled="openType === 'look'">
<template>
<QuestionFormItem
class="father"
v-for="question of questions"
:key="question.Id"
:question="question"
:question-form="questionForm"
:trial-clinical-id="trialClinicalId"
@resetFormItemData="resetFormItemData"
@setFormItemData="setFormItemData"
/>
<QuestionFormItem class="father" v-for="question of questions" :key="question.Id" :question="question"
:question-form="questionForm" :trial-clinical-id="trialClinicalId" @resetFormItemData="resetFormItemData"
@setFormItemData="setFormItemData" />
</template>
</el-form>
<div class="base-dialog-footer" v-if="!isViewer && openType !== 'look' && [2, 3].includes(clinicalDataLevel)" style="text-align:right;margin-top:10px;">
<!-- 取消 -->
<el-button
size="small"
type="primary"
@click="close"
v-show="$route.path !== '/trials/trials-panel/visit/crc-upload'&&$route.path!=='/trials/trials-panel/visit/crc-question'"
>
{{ $t('common:button:cancel') }}
</el-button>
<!-- 保存 -->
<el-button size="small" type="primary" @click="submitClinicalForm">
{{ $t('common:button:save') }}
</el-button>
<div class="base-dialog-footer" v-if="!isViewer && openType !== 'look' && [2, 3].includes(clinicalDataLevel)"
style="text-align:right;margin-top:10px;">
<!-- 取消 -->
<el-button size="small" type="primary" @click="close"
v-show="$route.path !== '/trials/trials-panel/visit/crc-upload' && $route.path !== '/trials/trials-panel/visit/crc-question'">
{{ $t('common:button:cancel') }}
</el-button>
<!-- 保存 -->
<el-button size="small" type="primary" @click="submitClinicalForm">
{{ $t('common:button:save') }}
</el-button>
</div>
<el-dialog
v-if="signVisible"
:visible.sync="signVisible"
:close-on-click-modal="false"
width="600px"
append-to-body
custom-class="base-dialog-wrapper"
>
<el-dialog v-if="signVisible" :visible.sync="signVisible" :close-on-click-modal="false" width="600px" append-to-body
custom-class="base-dialog-wrapper">
<div slot="title">
<span style="font-size:18px;">{{ $t('common:dialogTitle:sign') }}</span>
<span style="font-size:12px;margin-left:5px">{{ `(${$t('common:label:sign')}${ currentUser })` }}</span>
<span style="font-size:12px;margin-left:5px">{{ `(${$t('common:label:sign')}${currentUser})` }}</span>
</div>
<SignForm ref="signForm" :sign-code-enum="signCode" @closeDialog="closeSignDialog" />
</el-dialog>
@ -106,7 +84,7 @@ export default {
},
data: {
type: Object,
default: () => {}
default: () => { }
},
trialClinicalId: {
type: String,
@ -166,7 +144,7 @@ export default {
let item = this.questionForm[v]
if (item instanceof Array) {
let TableQuestionAnswers = item.map(o => {
if (o instanceof Object) {
if (o instanceof Object) {
return Object.keys(o).map(x => {
return {
TableQuestionId: x,
@ -251,7 +229,7 @@ export default {
if (item instanceof Array) {
let isCheckBox = false
let TableQuestionAnswers = item.map(o => {
if (o instanceof Object) {
if (o instanceof Object) {
return Object.keys(o).map(x => {
return {
TableQuestionId: x,
@ -387,12 +365,12 @@ export default {
}
if (i.ClinicalQuestionType === 'table') {
this.$set(this.questionForm, i.Id, i.TableAnswer)
} else if (i.ClinicalQuestionType === 'checkbox') {
} else if (i.ClinicalQuestionType === 'checkbox') {
this.$set(this.questionForm, i.Id, i.Answer ? i.Answer.split(',') : [])
console.log(i.Answer ? i.Answer.split(',') : [])
console.log(this.questionForm)
} else if (i.ClinicalQuestionType === 'number') {
this.$set(this.questionForm, i.Id, i.Answer)
} else if (i.ClinicalQuestionType === 'number') {
this.$set(this.questionForm, i.Id, i.Answer || i.DefaultValue)
} else if (i.Childrens && i.Childrens.length > 0) {
this.setChild(i.Childrens)
}
@ -405,7 +383,7 @@ export default {
this.questionForm[v] = 0
} else if (qs.ClinicalQuestionType === 'checkbox') {
this.questionForm[v] = []
} else{
} else {
this.questionForm[v] = ''
}
},
@ -426,23 +404,26 @@ export default {
</script>
<style lang="scss" scoped>
::-webkit-scrollbar {
width: 7px;
height: 7px;
}
::-webkit-scrollbar-thumb {
border-radius: 10px;
background: #d0d0d0;
}
.tabContent{
height:300px;
width: 7px;
height: 7px;
}
::-webkit-scrollbar-thumb {
border-radius: 10px;
background: #d0d0d0;
}
.tabContent {
height: 300px;
overflow-y: auto;
}
.father:after{
.father:after {
content: "";
display: block;
height: 0;
clear:both;
clear: both;
visibility: hidden;
}
</style>

View File

@ -14,6 +14,11 @@
<el-form-item :label="$t('trials:readingUnit:qsList:title:qNameEn')" prop="QuestionEnName">
<el-input v-model="form.QuestionEnName" />
</el-form-item>
<!--默认值-->
<el-form-item :label="$t('trials:readingUnit:qsList:title:defaultValue')" prop="DefaultValue"
v-if="form.ClinicalQuestionType === 'number'">
<el-input v-model="form.DefaultValue" />
</el-form-item>
<el-form-item
v-if="form.ClinicalQuestionType === 'select' || form.ClinicalQuestionType === 'radio' || form.ClinicalQuestionType === 'checkbox'"
:label="$t('trials:qcCfg:table:typeValue')" prop="TypeValue">
@ -274,7 +279,8 @@ export default {
GroupId: null,
CustomCalculateMark: -1,
RelevanceId: '',
RelevanceValue: ''
RelevanceValue: '',
DefaultValue: ''
},
rules: {
ClinicalQuestionType: [
@ -326,8 +332,8 @@ export default {
watch: {
data: {
handler() {
if (this.data.ClinicalQuestionType) {
this.getClinicalCalculateQuestions(this.data.ClinicalQuestionType)
if (this.data.CustomCalculateMark) {
this.getClinicalCalculateQuestions(this.data.CustomCalculateMark)
}
},
deep: true,
@ -335,10 +341,10 @@ export default {
}
},
methods: {
getClinicalCalculateQuestions(type = null) {
getClinicalCalculateQuestions(CustomCalculateMark = null) {
getClinicalCalculateQuestions({
TrialClinicalId: this.clinicalId,
ClinicalQuestionType: type || 'time'
ClinicalQuestionType: [1, 2, 3, 4].includes(CustomCalculateMark) ? 'number' : 'time'
}).then(res => {
this.Questions = res.Result
})
@ -356,6 +362,7 @@ export default {
CustomCalculateMarkChange() {
this.isShow = false
console.log(this.form.CustomCalculateMark)
this.getClinicalCalculateQuestions(this.form.CustomCalculateMark)
if (this.form.CustomCalculateMark < 0) {
this.form.CalculateQuestions = []
return
@ -532,7 +539,7 @@ export default {
} else {
data.LesionType = null
}
this.getClinicalCalculateQuestions(val)
// this.getClinicalCalculateQuestions(val)
data.TypeValue = ''
data.ValueType = ''
data.Unit = ''