修改老人评估问卷单选数据
This commit is contained in:
parent
df1d132246
commit
3b80ca482a
|
@ -6,17 +6,17 @@
|
||||||
<text>{{ parent.questionName }}</text>
|
<text>{{ parent.questionName }}</text>
|
||||||
|
|
||||||
<template v-if="secondArray[index] === '是否'">
|
<template v-if="secondArray[index] === '是否'">
|
||||||
<u-radio-group v-model="selectedValues[index]">
|
<u-radio-group v-model="selectedValues[index]" @change="change">
|
||||||
<u-radio :value="parent.value" size="large">是</u-radio>
|
<!-- <u-radio :value="parent.value" size="large" label="是"></u-radio> -->
|
||||||
<u-radio :value="0" size="large">否</u-radio>
|
<u-radio size="large" label="是" name="1"></u-radio>
|
||||||
|
<u-radio size="large" label="否" name="0"></u-radio>
|
||||||
</u-radio-group>
|
</u-radio-group>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<u-radio-group v-model="selectedValues[index]">
|
<u-radio-group v-model="selectedValues[index]">
|
||||||
<u-radio v-for="child in secondArray[index]" :key="child.questionId" :value="child.value"
|
<u-radio v-for="child in secondArray[index]" :key="child.questionId" :name="child.value"
|
||||||
size="large">
|
size="large" :label="child.questionName">
|
||||||
{{ child.questionName }}
|
|
||||||
</u-radio>
|
</u-radio>
|
||||||
</u-radio-group>
|
</u-radio-group>
|
||||||
</template>
|
</template>
|
||||||
|
@ -100,21 +100,25 @@ onLoad((option) => {
|
||||||
questionnaireTemplateList.value = res.rows;
|
questionnaireTemplateList.value = res.rows;
|
||||||
firstArray.value = res.rows.filter(item => item.parentQuestionid === null || item.parentQuestionid ===
|
firstArray.value = res.rows.filter(item => item.parentQuestionid === null || item.parentQuestionid ===
|
||||||
'0');
|
'0');
|
||||||
|
|
||||||
secondArray.value = firstArray.value.map(parent => {
|
secondArray.value = firstArray.value.map(parent => {
|
||||||
const children = res.rows.filter(item => item.parentQuestionid === parent.questionId);
|
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') {
|
if (parent.questionType === '2') {
|
||||||
return '是否';
|
return '是否';
|
||||||
} else {
|
} else {
|
||||||
return children;
|
return children;
|
||||||
}
|
}
|
||||||
});
|
}))
|
||||||
|
|
||||||
|
|
||||||
selectedValues.value = new Array(firstArray.value.length).fill(null);
|
|
||||||
|
|
||||||
console.log(selectedValues.value, 888)
|
|
||||||
// 更新总数
|
// 更新总数
|
||||||
total.value = res.total;
|
total.value = res.total;
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
|
@ -122,7 +126,9 @@ onLoad((option) => {
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
function change(e){
|
||||||
|
console.log('selectedValues[index]---',selectedValues.value,e)
|
||||||
|
}
|
||||||
function submitForm() {
|
function submitForm() {
|
||||||
if (isSubmitting.value) {
|
if (isSubmitting.value) {
|
||||||
console.log('提交已被锁定,防止多次提交');
|
console.log('提交已被锁定,防止多次提交');
|
||||||
|
|
Reference in New Issue