function xxaa(ItemID, type, UserID_Violate,table ) { var info = ""; if (type == 'S') { info = "ss交易为【xvb违约】么?"; } else if (type == 'B') { info = "ss定该交易为【cbd违约】么?"; } else { info = "sss交易无人违约么?取消交易"; } layer.confirm('<span style="position: relative;top: -70px;display: inline-block;margin-right: 20px;">备注</span> <textarea rows="5" cols="35" id="as_ReasonY"></textarea>', { title: info, btn: ['通过', '取消'] },function(index){ //调用后台 $.ajax({ type : 'POST', url : 'xxxx', dataType : 'json', data: {"CoinsTradeID": ItemID, "type": type, "UserID_Violate": UserID_Violate, "remark": $("#as_ReasonY").val() }, success:function(data){ if(data.res=="ok"){ layer.alert('操作成功!', function(index){ layer.close(index); table.reload('testReload', { where: { status:$('#TradeStatus').val() ,startDate:startDate ,endDate:endDate ,fc_SellerName:$('#fc_SellerName').val() ,fc_BuyerName:$('#fc_BuyerName').val() } }); }); }else{ layer.alert(data.res, function(index){ layer.close(index); table.reload('testReload', { where: { status:$('#TradeStatus').val() ,startDate:startDate ,endDate:endDate ,fc_SellerName:$('#fc_SellerName').val() ,fc_BuyerName:$('#fc_BuyerName').val() } }); }); } }, error:function(e){ console.log(e); } }); //obj.del(); layer.close(index); }); }