导表配置更改
parent
f1c72c66e8
commit
6e66dd8bbe
|
@ -22,12 +22,15 @@
|
|||
<el-table-column
|
||||
v-for="item in exportInfo.DicList"
|
||||
:key="item.Code"
|
||||
:label="$i18n.locale === 'zh' ? item.ValueCN : item.Value">
|
||||
:label="$i18n.locale === 'zh' ? item.ValueCN : item.Value"
|
||||
|
||||
>
|
||||
<template v-slot="scope">
|
||||
<el-checkbox
|
||||
@change="() => changeState(scope, item.Code)"
|
||||
:checked="getCheckState(scope, item.Code)"
|
||||
:disabled="getDisabledState(scope.row, item)"
|
||||
v-show="!scope.row.IsGroup || !scope.row.HasChildren"
|
||||
>
|
||||
</el-checkbox>
|
||||
</template>
|
||||
|
@ -43,6 +46,7 @@
|
|||
v-model="scope.row.CDISCCode"
|
||||
size="mini"
|
||||
:disabled="scope.row.HasChildren || scope.row.IsTableQuestion"
|
||||
v-show="!scope.row.IsGroup || !scope.row.HasChildren"
|
||||
>
|
||||
</el-input>
|
||||
</template>
|
||||
|
@ -91,29 +95,7 @@ export default {
|
|||
async submit() {
|
||||
this.loading = true
|
||||
try {
|
||||
let params= {
|
||||
questionList: [],
|
||||
tableQuestionList: []
|
||||
}
|
||||
params.questionList = this.exportInfo.QuestionList.map(i => {
|
||||
return {
|
||||
questionId: i.QuestionId,
|
||||
tableQuestionId: i.TableQuestionId,
|
||||
exportResult: i.ExportResult,
|
||||
CDISCCode: i.CDISCCode
|
||||
}
|
||||
})
|
||||
this.exportInfo.QuestionList.forEach(i => {
|
||||
let childlist = i.Children.map(k => {
|
||||
return {
|
||||
questionId: i.QuestionId,
|
||||
tableQuestionId: k.TableQuestionId,
|
||||
exportResult: k.ExportResult,
|
||||
CDISCCode: k.CDISCCode
|
||||
}
|
||||
})
|
||||
params.tableQuestionList = params.tableQuestionList.concat(childlist)
|
||||
})
|
||||
let params = this.filterQuestions(this.exportInfo.QuestionList)
|
||||
let res = await setTrialQuestionExportResult(params)
|
||||
if (res.IsSuccess) {
|
||||
this.$message.success(this.$t('common:message:savedSuccessfully'))
|
||||
|
@ -124,6 +106,36 @@ export default {
|
|||
console.log(e)
|
||||
}
|
||||
},
|
||||
filterQuestions(arr) {
|
||||
let params= {
|
||||
questionList: [],
|
||||
tableQuestionList: []
|
||||
}
|
||||
for (let i of arr) {
|
||||
if (!i.IsGroup && !i.IsTableQuestion) {
|
||||
params.questionList.push({
|
||||
questionId: i.QuestionId,
|
||||
tableQuestionId: i.TableQuestionId,
|
||||
exportResult: i.ExportResult,
|
||||
CDISCCode: i.CDISCCode
|
||||
})
|
||||
}
|
||||
if (i.TableQuestionId) {
|
||||
params.tableQuestionList.push({
|
||||
questionId: i.QuestionId,
|
||||
tableQuestionId: i.TableQuestionId,
|
||||
exportResult: i.ExportResult,
|
||||
CDISCCode: i.CDISCCode
|
||||
})
|
||||
}
|
||||
if (i.Children && i.Children.length > 0) {
|
||||
const childResults = this.filterQuestions(i.Children)
|
||||
params.questionList = params.questionList.concat(childResults.questionList)
|
||||
params.tableQuestionList = params.tableQuestionList.concat(childResults.tableQuestionList)
|
||||
}
|
||||
}
|
||||
return params;
|
||||
},
|
||||
// 获取状态
|
||||
getCheckState(item, code) {
|
||||
return item.row.ExportResult.indexOf(code) > -1
|
||||
|
|
Loading…
Reference in New Issue