zoukankan      html  css  js  c++  java
  • layui 操作后跳窗提醒,后台请求返回关闭跳窗一个方法

    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>&nbsp;<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);
          });
      
    }
  • 相关阅读:
    BSGS模板(互质与不互质) 洛谷P4195、P3846
    整除分块(数论分块)
    洛谷P3327 [SDOI2015]约数个数和——莫比乌斯反演
    模块二
    模块
    二分法 匿名函数
    3.26作业
    函数的递归调用
    yield表达式 三元表达式
    3.25作业
  • 原文地址:https://www.cnblogs.com/zuochanzi/p/13949653.html
Copyright © 2011-2022 走看看