//根据不同的状态显示不同的按钮 修改 删除 查看 按钮
function ActionFormatter(value, row, index) {//赋予的参数
var myArray = new Array();
if(row.status == 0){ //暂存
myArray.push('<button οnclick="updateOrder(\'' + row.id + '\')" class="btn btn-info btn-sm rightSize detailBtn" data-toggle="modal" data-target="#myModal" type="button"> 修改</button> ');
myArray.push('<button οnclick="getOrder(\''+ row.id+'\')" class="btn btn-danger btn-sm rightSize packageBtn" type="button">查看 </button> ');
myArray.push('<button οnclick="delOrder(\''+ row.id+'\')" class="btn btn-danger btn-sm rightSize packageBtn" type="button">删除</button> ');
}else if(row.status == 1){ //待签收
myArray.push('<button οnclick="getOrder(\''+ row.id+'\')" class="btn btn-danger btn-sm rightSize packageBtn" type="button">查看 </button> ');
if(row.createBy != localStorage.getItem("userId")){
myArray.push('<button οnclick="signOrder(\''+ row.id+'\')" class="btn btn-danger btn-sm rightSize packageBtn" type="button">签收 </button> ');
}
}else if(row.status == 2){ //被驳回
myArray.push('<button οnclick="getOrder(\''+ row.id+'\')" class="btn btn-danger btn-sm rightSize packageBtn" type="button">查看 </button> ');
if(row.createBy == localStorage.getItem("userId")){
myArray.push('<button οnclick="updateOrder(\'' + row.id + '\')" class="btn btn-info btn-sm rightSize detailBtn" data-toggle="modal" data-target="#myModal" type="button"> 修改</button> ');
}
}else if(row.status == 3){ //拆分处理中
myArray.push('<button οnclick="getOrder(\''+ row.id+'\')" class="btn btn-danger btn-sm rightSize packageBtn" type="button">查看 </button> ');
if(row.createBy != localStorage.getItem("userId")){
myArray.push('<button οnclick="updateOrder(\'' + row.id + '\')" class="btn btn-info btn-sm rightSize detailBtn" data-toggle="modal" data-target="#myModal" type="button"> 修改</button> ');
}
}else if(row.status == 4){ //待确认
myArray.push('<button οnclick="getOrder(\''+ row.id+'\')" class="btn btn-danger btn-sm rightSize packageBtn" type="button">查看 </button> ');
if(row.createBy == localStorage.getItem("userId")){
myArray.push('<button οnclick="updateOrder(\'' + row.id + '\')" class="btn btn-info btn-sm rightSize detailBtn" data-toggle="modal" data-target="#myModal" type="button"> 修改</button> ');
}
}else if(row.status == 5){ //处理中
myArray.push('<button οnclick="getOrder(\''+ row.id+'\')" class="btn btn-danger btn-sm rightSize packageBtn" type="button">查看 </button> ');
if(row.createBy != localStorage.getItem("userId")){
myArray.push('<button οnclick="updateOrder(\'' + row.id + '\')" class="btn btn-info btn-sm rightSize detailBtn" data-toggle="modal" data-target="#myModal" type="button"> 修改</button> ');
}
}else if(row.status == 6){//待验收
myArray.push('<button οnclick="getOrder(\''+ row.id+'\')" class="btn btn-danger btn-sm rightSize packageBtn" type="button">查看 </button> ');
if(localStorage.getItem("role") == 'operation'){ //运维
myArray.push('<button οnclick="getOrder(\''+ row.id+'\')" class="btn btn-danger btn-sm rightSize packageBtn" type="button">验收 </button> ');
}
}else if(row.status == 7){ //完成处理
myArray.push('<button οnclick="getOrder(\''+ row.id+'\')" class="btn btn-danger btn-sm rightSize packageBtn" type="button">查看 </button> ');
if(row.createBy == localStorage.getItem("userId")){
myArray.push('<button οnclick="getOrder(\''+ row.id+'\')" class="btn btn-danger btn-sm rightSize packageBtn" type="button">关闭工单 </button> ');
}
}
return myArray.join('');
}
bootstrap列表查询时根据不同的状态显示不同的按钮
猜你喜欢
转载自blog.csdn.net/qq_42806727/article/details/90066014
今日推荐
周排行