function updateStatusBatch(type) {
var str= new Array();
var msg="";
var b=false;
//根据name取被选中的值
$("[name='checkbox']:checked").each(function(i){
str[i] = $(this).val();
//判断状态根据状态设定提示信息
if(type==2){
if($("#status"+str[i]).val()!=1){
msg="非待审核状态不能被审核!";
b=true;
};
}
if(type==1){
if($("#status"+str[i]).val()!=0){
msg="非无效状态不能被恢复!";
b=true;
};
}
if(type==0){
if($("#status"+str[i]).val()==0){
msg="无效状态不能被删除!";
b=true;
};
}
});
if(b){
alert(msg);
return;
}
if(str.length == 0){
alert("至少选择一条记录");
return;
}
if(confirm("确定执行此操作?"))
$.post("${pageContext.request.contextPath}/admin/ppstandard/statusbatch"
, {
ids:str.join(","),
_json : -1,
type : type
}, function(data) {
eval(data);
if (data.success) {
alert("操作成功")
location.reload();
}
if (data.failed) {
alert(data.failed);
}
}, "json");
else{
return;
}
}
//全选和取消全选
var checked = false;
function refreshTree(industryId){
$("#btcb").click(function(){
if(!checked){
$("[name='checkbox']").attr("checked",'true');//全选
checked = true;
}else{
$("[name='checkbox']").removeAttr("checked");//取消全选
checked=false;
}
});
}