修改老人评估问卷单选数据

This commit is contained in:
边枭-前端开发 2024-09-14 15:01:03 +08:00
parent df1d132246
commit 3b80ca482a
1 changed files with 20 additions and 14 deletions

View File

@ -6,17 +6,17 @@
<text>{{ parent.questionName }}</text>
<template v-if="secondArray[index] === '是否'">
<u-radio-group v-model="selectedValues[index]">
<u-radio :value="parent.value" size="large"></u-radio>
<u-radio :value="0" size="large"></u-radio>
<u-radio-group v-model="selectedValues[index]" @change="change">
<!-- <u-radio :value="parent.value" size="large" label="是"></u-radio> -->
<u-radio size="large" label="是" name="1"></u-radio>
<u-radio size="large" label="否" name="0"></u-radio>
</u-radio-group>
</template>
<template v-else>
<u-radio-group v-model="selectedValues[index]">
<u-radio v-for="child in secondArray[index]" :key="child.questionId" :value="child.value"
size="large">
{{ child.questionName }}
<u-radio v-for="child in secondArray[index]" :key="child.questionId" :name="child.value"
size="large" :label="child.questionName">
</u-radio>
</u-radio-group>
</template>
@ -100,21 +100,25 @@ onLoad((option) => {
questionnaireTemplateList.value = res.rows;
firstArray.value = res.rows.filter(item => item.parentQuestionid === null || item.parentQuestionid ===
'0');
secondArray.value = firstArray.value.map(parent => {
const children = res.rows.filter(item => item.parentQuestionid === parent.questionId);
if (parent.questionType === '2') {
return '是否';
} else {
return children;
}
});
selectedValues.value = new Array(firstArray.value.length).fill(null);
console.log(88888,secondArray.value,selectedValues.value, 888,firstArray.value)
console.log(1111,firstArray.value.map(parent => {
const children = res.rows.filter(item => item.parentQuestionid === parent.questionId);
if (parent.questionType === '2') {
return '是否';
} else {
return children;
}
});
selectedValues.value = new Array(firstArray.value.length).fill(null);
console.log(selectedValues.value, 888)
}))
//
total.value = res.total;
}).finally(() => {
@ -122,7 +126,9 @@ onLoad((option) => {
});
}
function change(e){
console.log('selectedValues[index]---',selectedValues.value,e)
}
function submitForm() {
if (isSubmitting.value) {
console.log('提交已被锁定,防止多次提交');