Compare commits

..

No commits in common. "8f46819b9a8a1a00a92932dcee27456cac3d1955" and "b209c6566b509e294dcf1b6457e4dc544bd0dc85" have entirely different histories.

1 changed files with 24 additions and 36 deletions

View File

@ -22,15 +22,12 @@
<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>
@ -46,7 +43,6 @@
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>
@ -95,7 +91,29 @@ export default {
async submit() {
this.loading = true
try {
let params = this.filterQuestions(this.exportInfo.QuestionList)
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 res = await setTrialQuestionExportResult(params)
if (res.IsSuccess) {
this.$message.success(this.$t('common:message:savedSuccessfully'))
@ -106,36 +124,6 @@ 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