|
|
@@ -41,22 +41,22 @@ Page({ |
|
|
|
if(options.type == 'template'){ |
|
|
|
let list = []; |
|
|
|
let array = JSON.parse(options.applyOptions).approvalTemplateDetailList; |
|
|
|
console.log(JSON.parse(options.applyOptions)); |
|
|
|
let indexList ; |
|
|
|
UTIL.httpRequest(API.URL_GET_GETINFO, {method:'GET'}, { |
|
|
|
success: (res2) => { |
|
|
|
JSON.parse(options.applyOptions).approvalTemplateDetailList.map((rr,index )=> { |
|
|
|
console.log(rr); |
|
|
|
console.log(JSON.parse(options.applyOptions).approvalTemplateDetailList); |
|
|
|
console.log(rr.nickName == res2.user.nickName); |
|
|
|
console.log(index); |
|
|
|
if(rr.nickName == res2.user.nickName){ |
|
|
|
array.splice(index,1); |
|
|
|
indexList = index ; |
|
|
|
}else{ |
|
|
|
list.push(rr.userId+"") |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
array.splice(indexList,1) |
|
|
|
|
|
|
|
console.log(array); |
|
|
|
array.map((rrr,index)=>{ |
|
|
|
array.name = index+1 |
|
|
|
rrr.name = index+1 |
|
|
|
}) |
|
|
|
this.setData({ |
|
|
|
templateDetailList:array, |
|
|
@@ -242,15 +242,22 @@ Page({ |
|
|
|
success: (res) => { |
|
|
|
if (res.code == API.SUCCESS_CODE) { |
|
|
|
let list = []; |
|
|
|
res.data.map((rr,index) => { |
|
|
|
if(rr.nickName == res2.user.nickName){ |
|
|
|
res.data.splice(index,1); |
|
|
|
console.log(res); |
|
|
|
let index ; |
|
|
|
for (let i = 0; i < res.data.length; i++) { |
|
|
|
const element = res.data[i]; |
|
|
|
if(element.nickName == res2.user.nickName){ |
|
|
|
// res.data.splice(i,1); |
|
|
|
index = i ; |
|
|
|
}else{ |
|
|
|
list.push(element.userId+"") |
|
|
|
} |
|
|
|
list.push(rr.userId+"") |
|
|
|
}) |
|
|
|
} |
|
|
|
res.data.splice(index,1) |
|
|
|
res.data.map((rrr,index)=>{ |
|
|
|
rrr.name = index+1 |
|
|
|
}) |
|
|
|
console.log(list); |
|
|
|
this.setData({templateDetailList:res.data,result:list}); |
|
|
|
this.closeBox(); |
|
|
|
} |
|
|
|