Commit eeb22045 authored by youjie's avatar youjie

意见调查

parent 41c4aff3
......@@ -109,12 +109,12 @@
}
function clickCheckbox(i,index,index2,ID) {
function clickCheckbox(i,index,ID) {
const checkbox = document.getElementById(`my_checkbox${i}`);
checkbox.click()
let findIndex = dataList[index].IsCheckS.findIndex(item=>item==ID)
if(findIndex==-1) {
dataList[index].IsCheckS.push(ID)
if(checkbox.checked) {
if(findIndex==-1)dataList[index].IsCheckS.push(ID)
}else{
dataList[index].IsCheckS = dataList[index].IsCheckS.filter(item=>item!=ID)
}
......@@ -265,9 +265,6 @@
if (res.resultCode === 1) {
let data = res.data
data.map(item => {
if (item.SurveyType === 2) {
item.IsCheckS = false
}
if (item.SurveyType === 3) {
item.IsCheckS = []
}
......@@ -277,6 +274,7 @@
})
dataListAll = data
dataList = data
// 外卖版
if(localStorage.TakeoutVersion==1){
getSurveyDetails()
}else{
......@@ -435,7 +433,7 @@
let MultipleList = []
if (item.SurveyOptionsList.length > 0) item.SurveyOptionsList.forEach((radio, index) => {
MultipleList.push(
`<div><input type="checkbox" value="${radio.ID}" name="my_checkbox${i+1}" id="my_checkbox${i+1}${index+1}"/><span onclick="clickCheckbox(${i+1}${index+1},${i},${index},${radio.ID})">${radio.OptionsName}</span></div>`
`<div><input type="checkbox" value="${radio.ID}" name="my_checkbox${i+1}" id="my_checkbox${i+1}${index+1}"/><span onclick="clickCheckbox(${i+1}${index+1},${i},${radio.ID})">${radio.OptionsName}</span></div>`
)
})
if (MultipleList.length > 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment