• 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);
          });
      
    }
  • 相关阅读:
    javascript获得浏览器工作区域的大小
    javascript禁止输入数字
    Extjs之遍历Store内的数据
    Extjs之rowEditing编辑状态时列不对齐
    Extjs中numberfield小数位数设置
    【转】vscode常用快捷键整理
    【转】如何提高WEB的性能?
    【转】echarts 使用示例
    uni-app页面配置和跳转
    【转】.NetCore如何将特性和依赖注入有效结合
  • 原文地址:https://www.cnblogs.com/zuochanzi/p/13949653.html
Copyright © 2020-2023  润新知