var tspan = GetQueryString("TSpan"); var wfstate = GetQueryString("WFState"); //if (wfstate == null) // wfstate = 1; function Search_InitPage() { if (tspan == null || tspan == undefined) tspan = "3"; document.getElementById('offCanvasBtn').addEventListener('tap', function () { window.location.href = "./SearchCondtion.htm?TSpan=" + tspan + "&WFState=" + wfstate; }); document.getElementById("SearchKey").addEventListener("keypress", function (event) { if (event.keyCode == "13") { document.activeElement.blur(); //收起虚拟键盘 Search_InitPage(); //完成搜索事件 event.preventDefault(); // 阻止默认事件---阻止页面刷新 } }); //清空查询条件的事件 mui("#SearchKey")[0].addEventListener('focus', function () { mui(".mui-icon-clear")[0].addEventListener('tap', function () { Search_InitPage(); }); }) var _html = ""; var handler = new HttpHandler("BP.Cloud.HttpHandler.CCMobilePortal"); handler.AddPara("SearchKey", $("#SearchKey").val()); handler.AddPara("TSpan", tspan); handler.AddPara("WFState", wfstate); handler.AddPara("DTFrom",GetQueryString("DTFrom")); handler.AddPara("DTTo", GetQueryString("DTTo")); var data = handler.DoMethodReturnString("Search_Init"); if (data.indexOf("err@") != -1) { mui.alert(data); console.log(data); _html += "
"; _html += ""; _html += "数据查询有误"; _html += "
"; $("#datalist").html(_html); return; } data = JSON.parse(data); $("#EmpWorks_Count").html(data.Todolist_EmpWorks[0].EmpWorks); if (data.WF_GenerWorkFlows.length == 0) { _html += "
"; _html += ""; _html += "暂无数据"; _html += "
"; $("#datalist").html(_html); return; } $.each(data.WF_GenerWorkFlows, function (i, t) { _html += "
"; _html += "
" + t.FlowName + "
"; _html += "
"; _html += "
"; _html += "
"; _html += t.Title + "
"; _html += "
"; _html += "
"; _html += "
发起人:" + t.StarterName + "
"; _html += "
发起时间:" + t.RDT + "
"; _html += "
"; }); $("#datalist").html(_html); //绑定点击事件 var boxs = $(".box"); $.each(boxs, function (i, box) { var divId = $(box).attr("id"); //将ID值进行分解 var vals = divId.split('_'); //WorkID var oid = vals[0]; //流程编号 var fk_flow = vals[1]; //流程处理状态 var type = vals[2]; //节点编号 var fk_node = vals[3]; //fid var fid = vals[4]; $("#" + divId).on("tap", function () { var url = "../CCMobile/MyView.htm?FK_Flow=" + fk_flow + "&WorkID=" + oid + "&FK_Node=" + fk_node + "&FID=" + fid + "&MyViewFrom=search" + "&m=" + Math.random(); window.location.href = filterXSS(url); }); }); }