临床数据配置添加默认值
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
1ad3047689
commit
c1bcaa7e5d
|
@ -1,52 +1,30 @@
|
||||||
<template>
|
<template>
|
||||||
<div v-loading="loading" style="min-height: 500px;">
|
<div v-loading="loading" style="min-height: 500px;">
|
||||||
<el-form
|
<el-form v-if="isRender" data-viewport-uid="lc" ref="questions" size="small" :model="questionForm"
|
||||||
v-if="isRender"
|
:disabled="openType === 'look'">
|
||||||
data-viewport-uid="lc"
|
|
||||||
ref="questions"
|
|
||||||
size="small"
|
|
||||||
:model="questionForm"
|
|
||||||
:disabled="openType === 'look'"
|
|
||||||
>
|
|
||||||
<template>
|
<template>
|
||||||
<QuestionFormItem
|
<QuestionFormItem class="father" v-for="question of questions" :key="question.Id" :question="question"
|
||||||
class="father"
|
:question-form="questionForm" :trial-clinical-id="trialClinicalId" @resetFormItemData="resetFormItemData"
|
||||||
v-for="question of questions"
|
@setFormItemData="setFormItemData" />
|
||||||
:key="question.Id"
|
|
||||||
:question="question"
|
|
||||||
:question-form="questionForm"
|
|
||||||
:trial-clinical-id="trialClinicalId"
|
|
||||||
@resetFormItemData="resetFormItemData"
|
|
||||||
@setFormItemData="setFormItemData"
|
|
||||||
/>
|
|
||||||
</template>
|
</template>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div class="base-dialog-footer" v-if="!isViewer && openType !== 'look' && [2, 3].includes(clinicalDataLevel)" style="text-align:right;margin-top:10px;">
|
<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"
|
<el-button size="small" type="primary" @click="close"
|
||||||
type="primary"
|
v-show="$route.path !== '/trials/trials-panel/visit/crc-upload' && $route.path !== '/trials/trials-panel/visit/crc-question'">
|
||||||
@click="close"
|
{{ $t('common:button:cancel') }}
|
||||||
v-show="$route.path !== '/trials/trials-panel/visit/crc-upload'&&$route.path!=='/trials/trials-panel/visit/crc-question'"
|
</el-button>
|
||||||
>
|
<!-- 保存 -->
|
||||||
{{ $t('common:button:cancel') }}
|
<el-button size="small" type="primary" @click="submitClinicalForm">
|
||||||
</el-button>
|
{{ $t('common:button:save') }}
|
||||||
<!-- 保存 -->
|
</el-button>
|
||||||
<el-button size="small" type="primary" @click="submitClinicalForm">
|
|
||||||
{{ $t('common:button:save') }}
|
|
||||||
</el-button>
|
|
||||||
</div>
|
</div>
|
||||||
<el-dialog
|
<el-dialog v-if="signVisible" :visible.sync="signVisible" :close-on-click-modal="false" width="600px" append-to-body
|
||||||
v-if="signVisible"
|
custom-class="base-dialog-wrapper">
|
||||||
:visible.sync="signVisible"
|
|
||||||
:close-on-click-modal="false"
|
|
||||||
width="600px"
|
|
||||||
append-to-body
|
|
||||||
custom-class="base-dialog-wrapper"
|
|
||||||
>
|
|
||||||
<div slot="title">
|
<div slot="title">
|
||||||
<span style="font-size:18px;">{{ $t('common:dialogTitle:sign') }}</span>
|
<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>
|
</div>
|
||||||
<SignForm ref="signForm" :sign-code-enum="signCode" @closeDialog="closeSignDialog" />
|
<SignForm ref="signForm" :sign-code-enum="signCode" @closeDialog="closeSignDialog" />
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
@ -106,7 +84,7 @@ export default {
|
||||||
},
|
},
|
||||||
data: {
|
data: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: () => {}
|
default: () => { }
|
||||||
},
|
},
|
||||||
trialClinicalId: {
|
trialClinicalId: {
|
||||||
type: String,
|
type: String,
|
||||||
|
@ -166,7 +144,7 @@ export default {
|
||||||
let item = this.questionForm[v]
|
let item = this.questionForm[v]
|
||||||
if (item instanceof Array) {
|
if (item instanceof Array) {
|
||||||
let TableQuestionAnswers = item.map(o => {
|
let TableQuestionAnswers = item.map(o => {
|
||||||
if (o instanceof Object) {
|
if (o instanceof Object) {
|
||||||
return Object.keys(o).map(x => {
|
return Object.keys(o).map(x => {
|
||||||
return {
|
return {
|
||||||
TableQuestionId: x,
|
TableQuestionId: x,
|
||||||
|
@ -251,7 +229,7 @@ export default {
|
||||||
if (item instanceof Array) {
|
if (item instanceof Array) {
|
||||||
let isCheckBox = false
|
let isCheckBox = false
|
||||||
let TableQuestionAnswers = item.map(o => {
|
let TableQuestionAnswers = item.map(o => {
|
||||||
if (o instanceof Object) {
|
if (o instanceof Object) {
|
||||||
return Object.keys(o).map(x => {
|
return Object.keys(o).map(x => {
|
||||||
return {
|
return {
|
||||||
TableQuestionId: x,
|
TableQuestionId: x,
|
||||||
|
@ -387,12 +365,12 @@ export default {
|
||||||
}
|
}
|
||||||
if (i.ClinicalQuestionType === 'table') {
|
if (i.ClinicalQuestionType === 'table') {
|
||||||
this.$set(this.questionForm, i.Id, i.TableAnswer)
|
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(',') : [])
|
this.$set(this.questionForm, i.Id, i.Answer ? i.Answer.split(',') : [])
|
||||||
console.log(i.Answer ? i.Answer.split(',') : [])
|
console.log(i.Answer ? i.Answer.split(',') : [])
|
||||||
console.log(this.questionForm)
|
console.log(this.questionForm)
|
||||||
} else if (i.ClinicalQuestionType === 'number') {
|
} else if (i.ClinicalQuestionType === 'number') {
|
||||||
this.$set(this.questionForm, i.Id, i.Answer)
|
this.$set(this.questionForm, i.Id, i.Answer || i.DefaultValue)
|
||||||
} else if (i.Childrens && i.Childrens.length > 0) {
|
} else if (i.Childrens && i.Childrens.length > 0) {
|
||||||
this.setChild(i.Childrens)
|
this.setChild(i.Childrens)
|
||||||
}
|
}
|
||||||
|
@ -405,7 +383,7 @@ export default {
|
||||||
this.questionForm[v] = 0
|
this.questionForm[v] = 0
|
||||||
} else if (qs.ClinicalQuestionType === 'checkbox') {
|
} else if (qs.ClinicalQuestionType === 'checkbox') {
|
||||||
this.questionForm[v] = []
|
this.questionForm[v] = []
|
||||||
} else{
|
} else {
|
||||||
this.questionForm[v] = ''
|
this.questionForm[v] = ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -426,23 +404,26 @@ export default {
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
::-webkit-scrollbar {
|
::-webkit-scrollbar {
|
||||||
width: 7px;
|
width: 7px;
|
||||||
height: 7px;
|
height: 7px;
|
||||||
}
|
}
|
||||||
::-webkit-scrollbar-thumb {
|
|
||||||
border-radius: 10px;
|
::-webkit-scrollbar-thumb {
|
||||||
background: #d0d0d0;
|
border-radius: 10px;
|
||||||
}
|
background: #d0d0d0;
|
||||||
.tabContent{
|
}
|
||||||
height:300px;
|
|
||||||
|
.tabContent {
|
||||||
|
height: 300px;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
|
|
||||||
}
|
}
|
||||||
.father:after{
|
|
||||||
|
.father:after {
|
||||||
content: "";
|
content: "";
|
||||||
display: block;
|
display: block;
|
||||||
height: 0;
|
height: 0;
|
||||||
clear:both;
|
clear: both;
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -14,6 +14,11 @@
|
||||||
<el-form-item :label="$t('trials:readingUnit:qsList:title:qNameEn')" prop="QuestionEnName">
|
<el-form-item :label="$t('trials:readingUnit:qsList:title:qNameEn')" prop="QuestionEnName">
|
||||||
<el-input v-model="form.QuestionEnName" />
|
<el-input v-model="form.QuestionEnName" />
|
||||||
</el-form-item>
|
</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
|
<el-form-item
|
||||||
v-if="form.ClinicalQuestionType === 'select' || form.ClinicalQuestionType === 'radio' || form.ClinicalQuestionType === 'checkbox'"
|
v-if="form.ClinicalQuestionType === 'select' || form.ClinicalQuestionType === 'radio' || form.ClinicalQuestionType === 'checkbox'"
|
||||||
:label="$t('trials:qcCfg:table:typeValue')" prop="TypeValue">
|
:label="$t('trials:qcCfg:table:typeValue')" prop="TypeValue">
|
||||||
|
@ -274,7 +279,8 @@ export default {
|
||||||
GroupId: null,
|
GroupId: null,
|
||||||
CustomCalculateMark: -1,
|
CustomCalculateMark: -1,
|
||||||
RelevanceId: '',
|
RelevanceId: '',
|
||||||
RelevanceValue: ''
|
RelevanceValue: '',
|
||||||
|
DefaultValue: ''
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
ClinicalQuestionType: [
|
ClinicalQuestionType: [
|
||||||
|
@ -326,8 +332,8 @@ export default {
|
||||||
watch: {
|
watch: {
|
||||||
data: {
|
data: {
|
||||||
handler() {
|
handler() {
|
||||||
if (this.data.ClinicalQuestionType) {
|
if (this.data.CustomCalculateMark) {
|
||||||
this.getClinicalCalculateQuestions(this.data.ClinicalQuestionType)
|
this.getClinicalCalculateQuestions(this.data.CustomCalculateMark)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
deep: true,
|
deep: true,
|
||||||
|
@ -335,10 +341,10 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getClinicalCalculateQuestions(type = null) {
|
getClinicalCalculateQuestions(CustomCalculateMark = null) {
|
||||||
getClinicalCalculateQuestions({
|
getClinicalCalculateQuestions({
|
||||||
TrialClinicalId: this.clinicalId,
|
TrialClinicalId: this.clinicalId,
|
||||||
ClinicalQuestionType: type || 'time'
|
ClinicalQuestionType: [1, 2, 3, 4].includes(CustomCalculateMark) ? 'number' : 'time'
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
this.Questions = res.Result
|
this.Questions = res.Result
|
||||||
})
|
})
|
||||||
|
@ -356,6 +362,7 @@ export default {
|
||||||
CustomCalculateMarkChange() {
|
CustomCalculateMarkChange() {
|
||||||
this.isShow = false
|
this.isShow = false
|
||||||
console.log(this.form.CustomCalculateMark)
|
console.log(this.form.CustomCalculateMark)
|
||||||
|
this.getClinicalCalculateQuestions(this.form.CustomCalculateMark)
|
||||||
if (this.form.CustomCalculateMark < 0) {
|
if (this.form.CustomCalculateMark < 0) {
|
||||||
this.form.CalculateQuestions = []
|
this.form.CalculateQuestions = []
|
||||||
return
|
return
|
||||||
|
@ -532,7 +539,7 @@ export default {
|
||||||
} else {
|
} else {
|
||||||
data.LesionType = null
|
data.LesionType = null
|
||||||
}
|
}
|
||||||
this.getClinicalCalculateQuestions(val)
|
// this.getClinicalCalculateQuestions(val)
|
||||||
data.TypeValue = ''
|
data.TypeValue = ''
|
||||||
data.ValueType = ''
|
data.ValueType = ''
|
||||||
data.Unit = ''
|
data.Unit = ''
|
||||||
|
|
Loading…
Reference in New Issue