通过js批量提交后弹框

在一个报表页面有批量操作功能,选择任意条数据后点击审核按钮,弹出审核意见填写页面,填写完成后提交,代码:

function approveListProgram() {
        var ids = "";
        //获取所有已选择的复选按钮的id,拼接成字符串ids
        $('.frog-table', NavTab.getCurrentPanel()).find(
                'tbody input[type="checkbox"]').each(function() {
            if ($(this).prop("checked")) {
                var id = $(this).parents('tr:first').attr("rel");
                if (ids == "") {
                    ids = id;
                } else {
                    ids += "," + id;
                }
            }
        });
        if (ids == "") {
            Dialog.warn("未选中一条以上的数据");
            return;
        }
        //请求后台,指定弹框的宽高
        $.get('${ctx}/fcHydrantDetail/preApprove/'+ids,function(rtn){
              layer.open({
              type: 1,
              skin: 'layui-layer-rim', //加上边框
              area: ['500px', '350px'], //宽高
              content: rtn
            });
          });
    }

弹窗页面填写意见提交后当前弹框不自动关闭:

//使用layui关闭页面的方式
layer.closeAll();

在js里修改form表单的action:

// $("#approvefrom").action= "${ctx}/fcHydrantDetail/sendback/${ids}";这种方式不起作用
$("#approvefrom").attr("action", "${ctx}/fcHydrantDetail/sendback/${ids}");

猜你喜欢

转载自www.cnblogs.com/zeevy/p/12118401.html
今日推荐