删除按钮
<u-button type="primary" size="mini" shape="circle" style='margin-left:20rpx;' @click="deleteBut(select)"> 删除</u-button >
在内容前加入checked小框
<checkbox-group style='display: flex; justify-content: flex-end;' @change='checkboxChange(item)'>
<checkbox style="transform:scale(0.7); display: flex; justify-content: flex-end;" checked="{{item.isChecked}}" value='item.hrdCandidateId' :disabled="item.isNoWarehouse=='是'" >
</checkbox>
</checkbox-group>
图片:
checkboxChange: function(e) {
e.isChecked=!e.isChecked
this.select = e;
// this.ids=[];
// this.InterviewData.forEach((v,i)=>{
// if(v.isChecked==e.isChecked){
// i.isChecked=false
// }
// })
// console.log( this.select , e.isChecked,e,'oooooo')
// var that=this
// var this_checked = e.id
// var parameterList = this.InterviewData//获取Json数组
// for (var i = 0; i < parameterList.length;i++){
// if (parameterList[i].id == this_checked){
// parameterList[i].checked = true;//当前点击的位置为true即选中
// }
// else{
// parameterList[i].checked = false;//其他的位置为false
// }
// }
},
//删除
deleteBut(select){
if(select==''){
this.$refs.uToast.show({
title: '请选择数据',
type: 'error',
})
}else{
this.ids=[];
this.InterviewData.forEach((v,i)=>{
if(v.isChecked){
this.ids.push(v.id)
}
})
//删除接口
this.$u.api.SynchronizeRemoveHrdCandidate({
loginUserNumber: uni.getStorageSync('InforObj').idCard, // 员工登录idCard
ids:this.ids
}).then(res => {
if (res.data.length === 0) {
this.$refs.uToast.show({
title: '删除成功',
type: 'success',
})
//刷新页面
this.SynchronizeFindHrdInternalRecommendationAPI()
}else {
this.$refs.uToast.show({
title: res.data[0].desc,
type: 'error',
})
}
})
}
},