artDialog打开Ajax提交的请求返还页面

方式一:

art.dialog.open(url,options),url是要请求的链接,若是需要传递参数,则需要url?a=xxx&b=yyy的形式传递;options中是对dialog属性的设置参数。此种方式打开的dialog是一个完整的iframe页面。

art.dialog.open('${ctx}/business/accept/distribute/'+id

+"?assignStatus=2"

+"&submit_pass="+$("#submit_pass").val()

+"&submit_deal="+$("#submit_deal").val()

+"&submit_opinion="+submit_opinion,{

title:'流程分配',

id:'distributeDialog',

lock:true,

width:'35%',

height:'30%'

});

方式二:

首先提交ajax请求,请求返还的页面作为dialog的content属性的内容,于是改dialog打开的就是请求需要打开的页面了。此种打开的dialog应该是一个div,而非一个完整的iframe页面。

$.ajax({

type:"get",

url:'${ctx}/business/accept/distribute/'+id,

data:{

assignStatus:'2',

nextUser:$("#nextUser").val(),

nextUserName:$("#nextUserName").val(),

submit_pass:$("#submit_pass").val(),

submit_deal:$("#submit_deal").val(),

submit_opinion:$("#submit_opinion").val()

},

async:false,

success:function(data){

vardialog=art.dialog({

title:'流程分配',

id:'distributeDialog',

content:data,

width:'40%',

height:'40%',

lock:true,

opacity:0.87,//透明度

init:function(){

}

});

}

});

方式三:

首先在主页面隐藏该内容,如:

<divid="dis_dialogid"style="display:none;">

<formid="distributeForm"method="post"action="${ctx}/business/accept/disSubmit">

<divclass="information-form">

<divclass="col-md-8ie8correct">

<labelclass="field-title"for="nextUserName">人工定义:</label>

<inputtype="text"name="nextUserName"id="nextUserName"value="${order.nextUserName}"onclick="uiBase.selectUser('nextUser');"required>

<inputtype="hidden"id="nextUser"name="nextUser"value="${order.nextUser}"/>

</div>

</div>

</form>

</div>

当点击某一部位触发事件时,显示该隐藏内容,触发事件的处理方式为:

vardialog10=art.dialog({

title:"流程分配",

padding:"10px",

content:document.getElementById("dis_dialogid"),

ok:function(){

if($("#distributeForm").valid()){

$.ajax({

type:"POST",

url:"${ctx}/business/accept/disSubmit",

data:{

id:$("#id").val(),

assignStatus:'2',

nextUser:$("#nextUser").val(),

nextUserName:$("#nextUserName").val(),

submit_deal:$("#submit_deal").val(),

submit_pass:$("#submit_pass").val(),

submit_opinion:$("#submit_opinion").val()

},

cache:false,

global:false,//屏蔽全局事件,防止启动BlockUI

success:function(data){

varresultJson=eval("("+data+")");

if(resultJson.result=="success"){

art.dialog({

title:'流程提交提示',

icon:'succeed',

lock:true,

content:'流程提交成功,1.5秒后会自动关闭……',

time:1.5

});

//uiBase.trigerParentTabFunc('$("form").submit()');

uiBase.closeCurrentTab();

}else{

art.dialog({

title:'流程提交提示',

icon:'error',

lock:true,

content:'流程提交失败,1.5秒后会自动关闭……',

time:1.5

});

}

}

});

returntrue;

}else{

returnfalse;

}

},

okVal:"提交",

cancel:function(){},

cancelVal:"返回",

id:"validate-artdialog"

});

相关推荐