text: (function(a){a.fn.TreeView=function(c){var d='<div id="MyTree3" class="tree tree-solid-line">'+'<div class="tree-folder" style="display: none;">'+'<div class="tree-folder-header">'+'<i class="fa fa-folder"></i>'+'<div class="tree-folder-name"></div>'+"</div>"+'<div class="tree-folder-content">'+"</div>"+'<div class="tree-loader" style="display: none;"></div>'+"</div>"+'<div class="tree-item" style="display: none;">'+'<i class="tree-dot"></i>'+'<div class="tree-item-name"></div>'+"</div>"+"</div>";this.empty();var e=a(utils.replaceTpl(d,c)).appendTo(this);var f={click:function(g){}};e.opts=a.extend(f,c);function b(g){e.tree({dataSource:e.opts.data,multiSelect:true,loadingHTML:'<div class="tree-loading"><i class="fa fa-rotate-right fa-spin"></i></div>'})}b();return e};a.fn.table=function(b){var d='<table class="table table-bordered table-hover table-striped"></table>';this.empty();var e=a(utils.replaceTpl(d,b)).appendTo(this);var f={click:function(g){}};e.opts=a.extend(f,b);function c(l){var j='<thead class="bordered-darkorange"></thead>';var m=a(j).appendTo(e);var n=a('<tr role="row"></tr>').appendTo(m);for(var k=0;k<e.opts.columns.length;k++){var h=e.opts.columns[k];var g=a('<th class="sorting_desc">'+h.title+"</th>").appendTo(n);if(h.sortable){}}}e.loadData=function(o){var p=e.opts.columns;for(var k=0;k<o.length;k++){var m=o[k];var l=a("<tr></tr>").appendTo(e);for(var h=0;h<p.length;h++){var g=p[h];var n=a('<td class="'+g.cls+'">'+m[g.field]+"</td>").appendTo(l);if(g.formatter){n.html(g.formatter())}if(g.cellClick){n.on("click",m,g.cellClick)}}l.on("click",m,e.opts.clickRow);l.on("dblclick",m,e.opts.dblClickRow)}};c(e);return e};a.fn.widget=function(c){var b='<div class="widget">'+'<div class="widget-header bordered-bottom bordered-yellow">'+'<span class="widget-caption">{title}</span>'+'<div class="widget-buttons"></div>'+"</div>"+'<div class="widget-body no-padding"></div>'+"</div>";var d='<a href="javascript:void(0);" data-toggle="maximize"><i class="fa fa-expand"></i></a>'+'<a href="javascript:void(0);" data-toggle="collapse"><i class="fa fa-minus"></i></a>'+'<a href="javascript:void(0);" data-toggle="dispose"><i class="fa fa-times"></i></a>';this.empty();var e=a(utils.replaceTpl(b,c)).appendTo(this);var f={click:function(g){alert(9)}};e.opts=a.extend(f,c);e.tool=e.find(".widget-buttons");e.body=e.find(".widget-body");if(e.opts.toolbar){a(utils.replaceTpl(d,c)).appendTo(e.tool)}return e}})(jQuery);(function(a){a.fn.baidu=function(c){var b='<div class="input-group input-group">'+'<input type="text" placeholder="{name}..." class="form-control" />'+'<span class="input-group-addon">{title}</span>'+"</div>";this.empty();if(!c.name){c.name="搜索"}var d=a(utils.replaceTpl(b,c)).appendTo(this);d.find("input").css("border","solid 2px #B61D1D");d.find("span").css("font-size",16).css("background","#B61D1D").css("border","solid 2px #B61D1D").css("color","#fff").css("cursor","pointer");var e={click:function(f){alert(9)}};d.opts=a.extend(e,c);d.find("input").bind("keydown",null,function(f){if(f.keyCode==13){d.opts.click({text:this.value})}});d.find("i").bind("click",null,function(){var f=d.find("input").val();d.opts.click({text:f})});return d};a.fn.DateTime=function(c){var b='<div class="input-group input-group-sm">'+'<input type="text" placeholder="{name}..." class="form-control" />'+'<span class="input-group-addon"><i class="glyphicon {icon}"></i></span>'+"</div>";if(!c.name){c.name="请输入时间"}c.icon=c.icon||"glyphicon-th";var d=a(utils.replaceTpl(b,c)).appendTo(this);var e={click:function(f){alert(9)}};d.opts=a.extend(e,c);d.find("input").bind("keydown",null,function(f){if(f.keyCode==13){d.opts.click({text:this.value})}}).bind("focus",null,function(f){if(d.opts.icon=="glyphicon-ok"){d.opts.click({text:this.value})}});d.find("i").bind("click",null,function(){var f=d.find("input").val();d.opts.click({text:f})});return d};a.fn.DateTimeZone=function(d){var c='<div class="input-group input-group-sm">'+'<span class="input-group-addon">{startTitle}</span>'+'<input type="text" class="form-control input-sm" placeholder="请输入开始时间">'+'<span class="input-group-addon">{endTitle}</span><input type="text" class="form-control input-sm" placeholder="请输入结束时间"></div>';this.empty();var f={click:function(g){}};var e=this;e.opts=a.extend(f,d);e.sDate=a(utils.replaceTpl(c,e.opts)).appendTo(e);e.sDate.find("input").datetimepicker({format:"yyyy-mm-dd hh:ii:ss",language:"zh-CN",initialDate:new Date()});function b(h){var g=a(this).val();if(utils.isEmptyObject(g)){g=utils.now();e.setValue(h.data.index,g)}}e.sDate.find("input:eq(0)").bind("blur",{index:0},b);e.sDate.find("input:eq(1)").bind("blur",{index:1},b);e.setValue=function(g,h){return e.find("input:eq("+g+")").val(h)};e.getValue=function(g){return e.find("input:eq("+g+")").val()};return e};a.fn.shopBar=function(c,d){var b='<div style="margin-top:10px;">'+'<div style="width:103px;" class="input-group input-group-sm">'+'<span class="input-group-addon"><i class="glyphicon glyphicon-minus"></i></span>'+'<input type="text"  placeholder="{pageSize}" class="form-control" />'+'<span class="input-group-addon"><i class="glyphicon glyphicon-plus"></i></span>'+"</div></div>";this.find(".navbar-right").remove();this.empty();var e=a(utils.replaceTpl(b,d)).appendTo(this);var f={click:function(g){}};e.opts=a.extend(f,c);e.find("input").val(d.pageIndex);e.find(".input-group-addon:eq(0)").bind("click",null,function(g){if(d.pageIndex>1){d.pageIndex=d.pageIndex-1;e.find("input").val(d.pageIndex);c.pageclick(d.pageIndex,d.pageSize,d.type)}});e.find(".input-group-addon:eq(1)").bind("click",null,function(g){if(d.pageIndex<d.pageCount){d.pageIndex=d.pageIndex+1;e.find("input").val(d.pageIndex);c.pageclick(d.pageIndex,d.pageSize,d.type)}});e.find("input").bind("keydown",null,function(g){if(g.keyCode==13){d.pageSize=this.value;c.pageclick(d.pageIndex,d.pageSize,d.type)}});e.getValue=function(){return e.find("input").val()};return e};a.fn.Path=function(d){var h={click:function(i){}};this.empty();var f=this;f.opts=a.extend(h,d);var c='<ol class="breadcrumb" style="background:white;margin-bottom:0px;padding:8px 0px;"></ol>';var b='<li><a href="javascript:void(0);">{title}</a></li>';f.ol=a(c).appendTo(f);function g(j){var k=j.data;a(this).nextAll().remove();f.find("li").removeClass("active");var i=a(this).addClass("active");f.opts.click(j)}function e(l){for(var k=0;k<l.length;k++){var j=a(utils.replaceTpl(b,l[k])).appendTo(f.ol);j.bind("click",l[k],g)}}e(f.opts.data);return f};a.fn.Footer=function(d){var g={click:function(h){}};this.empty();var f=this;f.opts=a.extend(g,d);var c='<div class="footer">'+'<a class="btn btn-default">新增</a>'+'<ul class="dropdown-menu"></ul>'+'<a class="btn btn-primary" data-dismiss="modal">选择</a>'+'<a class="btn btn-default" data-dismiss="modal">取消</a>'+"</div>";f.footer=a(c).appendTo(f);f.footer.find(".btn").width(60);f.footer.find(".btn:eq(0)").css("margin-right",180).css("margin-left",20);f.footer.find(".btn:eq(1)").css("margin-right",15);var b=f.footer.find("ul");b.width(80);function e(k){for(var h=0,i;i=k[h++];){a('<li><a href="javascript:void(0);"><span class="glyphicon glyphicon-'+i.icon+'"></span>'+i.text+"</a></li>").appendTo(b).bind("click",i,i.click)}}e(f.opts.data);return f};a.fn.TipTemplate=function(b){var g={click:function(i){}};this.empty();var f=this;f.opts=a.extend(g,b);function h(j){var i='<div style="text-align:left; color:red; text-decoration:underline; font-size:14px;">{cnname}</div>';return utils.replaceTpl(i,j)}function d(k){var i=a("<fieldset></fieldset>");if(!k.editable){i.prop("disabled","false")}var j=null;if(k.tpl){j=a(utils.replaceTpl(k.tpl,k)).appendTo(i);return j}j=i.load(k.html,function(l){k.click()});return j}function e(i,j){i.popover({trigger:"manual",placement:f.opts.placement,title:h(j),html:true,content:d(j),animation:true}).on("shown.bs.popover",function(l){a(this).next().css("max-width","none");var k="top";switch(f.opts.placement){case"top":k="left";break;case"right":k="top";break;case"bottom":k="left";break;case"left":k="top";break}a(this).next().find(".arrow").css(k,f.opts.arrow)});i.popover("show")}function c(k){for(var j=0;j<k.length;j++){e(f,k[j])}}c(f.opts.data);return f}})(jQuery);(function(a){a.fn.Tranc=function(e){var c=[];var f=e.data||e;for(var d=0;d<f.length;d++){f[d].text=f[d][e.text];f[d].nodes=[];if(f[d][e.pid]==e.root){c.push(f[d]);f.splice(d,1);d=-1}}function b(l,k){for(var h=0;h<k.length;h++){for(var g=0;g<l.length;g++){if(l[g][e.pid]==k[h][e.id]){k[h].nodes.push(l[g]);l.splice(g,1);g=-1}}b(l,k[h].nodes)}}b(f,c);return c}})(jQuery);(function(a){a.fn.alert=function(c){var g={click:function(i){}};this.empty();var e=this;e.opts=a.extend(g,c);var b="<div >"+"{msg}</div>";var e=a(utils.replaceTpl(b,e.opts)).appendTo(a("#iwf-alert"));e.addClass("iwf-alert");e.css("left",document.body.clientWidth/2-90);if(e.opts.success){e.addClass("alert alert-success")}else{e.addClass("alert alert-danger")}var d=setTimeout(function(){f()},5000);function f(){h()}function h(){e.hide(4000);e.remove();clearInterval(d)}return e}})(jQuery);(function(a){a.fn.listNav=function(c){var b='<ul class="nav nav-pills nav-stacked"></ul>',j='<li key="{b}"><a href="javascript:void(0);"><i class="{icon} {color}"></i>{title}</a></li>';var g=a(b).appendTo(this);var h={click:function(i){}};g.opts=a.extend(h,c);function f(i){g.opts.click(i.data)}for(var d=0,e;e=g.opts.data[d++];){a(utils.replaceTpl(j,e)).appendTo(g).bind("click",e,f)}g.flash=function(i){var l="li[key='"+i.b+"']";var k=g.find(l).addClass("active");if(k.length>0){k.siblings().removeClass("active")}else{g.children().removeClass("active")}};return g}})(jQuery);(function(a){a.fn.ProgressBar=function(c){var b='<div class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">'+'<div class="modal-dialog"><div class="modal-content">'+'<div class="modal-body">'+'<div class="progress progress-striped active">'+'<div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 100%;">数据加载中......'+"</div>"+"</div>"+"</div></div></div></div>";var d=a(utils.replaceTpl(b,c)).appendTo(this);if(c.width){d.find(".modal-dialog").width(c.width)}if(c.height){d.find(".modal-dialog").height(c.height)}d.modal({backdrop:false});var e={};d.opts=a.extend(e,c);return d}})(jQuery);(function(a){a.fn.Template=function(d){var c='<div class="content">'+'<div class="modal-header">'+'<button type="submit" class="btn btn-primary">确定</button>'+'<button type="submit" class="btn btn-default" data-dismiss="modal">取消</button>'+"</div>"+'<div class="modal-body" style="border-bottom:solid 1px #DDD;">'+"</div>"+'<div class="modal-header">'+'<button  type="submit" class="btn btn-primary">确定</button>'+'<button  type="submit" class="btn btn-default" data-dismiss="modal">取消</button>'+"</div></div>";this.empty();this.addClass("todrop");var e=a(utils.replaceTpl(c,d)).appendTo(this);e.find("button").width(100);e.find(".btn-default").css("margin-left",12);if(d.width){e.find(".modal-dialog").width(d.width)}if(d.height){e.find(".modal-dialog").height(d.height)}function b(g){e.opts.click(g);e.parent().removeClass("todrop");e.remove()}e.find(".btn-primary").bind("click",{ok:true},b);e.find(".btn-default").bind("click",{ok:false},b);var f={};e.opts=a.extend(f,d);e.body=e.find(".modal-body");if(e.opts.html){e.body.load(e.opts.html,function(g){e.opts.load(e.body)})}if(e.opts.tpl){e.body=a(e.opts.tpl).appendTo(e.body);e.opts.load(e.body)}return e};a.fn.Form=function(d){var c='<div class="content">'+'<div class="col-lg-12 col-lg-offset-0">'+'<div class="form-horizontal" action="">'+'<div class="modal-header" style="padding: 8px 0px;background:transparent;">'+'<p class="iwfFormTitle2">{title}</p>'+"</div>"+'<div class="modal-body" style="border-bottom:solid 1px #DDD;">'+"</div>"+'<div class="modal-header" style="text-align: center;background:transparent;border-bottom: none;">'+'<button class="btn btn-primary">确定</button>'+'<a  class="btn btn-default" data-dismiss="modal">取消</a>'+"</div></div>";this.empty();var e=a(utils.replaceTpl(c,d)).appendTo(this);e.find(".btn").width(100);e.find(".btn-default").css("margin-left",12);if(d.width){e.find(".modal-dialog").width(d.width)}if(d.height){e.find(".modal-dialog").height(d.height)}e.isFirst=false;function b(h){e.parent().removeClass("todrop");if(!h.data.ok){e.opts.click(h);e.remove()}else{e.isFirst=false;e.opts.click(h)}}function g(j){var i=e.find("form");var h=iwfTool.validator(i);h.on("error.field.bv",function(l,k){l.preventDefault();return}).on("success.form.bv",function(k){k.preventDefault();if(!e.isFirst){e.isFirst=true;e.opts.click(j)}})}e.find(".btn-primary").bind("click",{ok:true},b);e.find(".btn-default").bind("click",{ok:false},b);var f={};e.opts=a.extend(f,d);e.body=e.find(".modal-body");if(e.opts.html){e.body.load(e.opts.html,function(h){e.opts.load(e.body)})}if(e.opts.tpl){e.body=a(e.opts.tpl).appendTo(e.body);e.opts.load(e.body)}return e}})(jQuery);(function(a){a.fn.Dialog=function(d){var c='<div class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">'+'<div class="modal-dialog"><div class="modal-content"><div class="modal-header">'+'<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>'+'<h4 class="modal-title">{title}</h4></div><div class="modal-body"></div><div class="modal-footer">'+'<button type="submit" id="btnYes" class="btn btn-primary">确定</button>'+'<a type="button" id="btnNo" class="btn btn-default" data-dismiss="modal">取消</a>'+"</div></div></div></div>";var e=a(utils.replaceTpl(c,d)).appendTo(this);if(d.width){e.find(".modal-dialog").width(d.width)}if(d.height){e.find(".modal-dialog").height(d.height)}e.modal({backdrop:false});function b(g){e.opts.click(g);if(!e.opts.validate){e.remove()}}e.find("#btnYes").bind("click",{ok:true},b);e.find("#btnNo").bind("click",{ok:false},b);e.find(".close").bind("click",{ok:false},b);var f={};e.opts=a.extend(f,d);e.body=e.find(".modal-body").css("padding-top",0);if(e.opts.html){e.body.load(e.opts.html,function(g){e.opts.load(e.body)})}if(e.opts.tpl){e.body=a(e.opts.tpl).appendTo(e.body);e.opts.load(e.body)}return e}})(jQuery);(function(a){a.fn.SplitDialog=function(d){var c='<div class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">'+'<div class="modal-dialog"><div class="modal-content"><div class="modal-header">'+'<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>'+'<h4 class="modal-title">{title}</h4></div><div class="modal-body">{layout}</div><div class="modal-footer">'+'<button type="button" class="btn btn-primary">确定</button>'+'<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>'+"</div></div></div></div>";var e=a(utils.replaceTpl(c,d)).appendTo(this);if(d.width){e.find(".modal-dialog").width(d.width)}if(d.height){e.find(".modal-dialog").height(d.height)}e.modal({backdrop:false});function b(g){e.opts.click(g);e.remove()}e.find(".btn-primary").bind("click",{ok:true},b);e.find(".btn-default").bind("click",{ok:false},b);e.find(".close").bind("click",{ok:false},b);var f={};e.opts=a.extend(f,d);if(e.opts.html){e.find(e.opts.htmlBody).load(e.opts.html,function(g){e.opts.load(g)})}if(e.opts.tpl){a(e.opts.tpl).appendTo(e.find(e.opts.htmlBody));if(!e.otps.html){e.opts.load(e.opts.htmlBody)}}return e}})(jQuery);(function(a){a.fn.sTree=function(e){var h={click:function(i){alert(9)}};var f=this;f.opts=a.extend(h,e);f.guid=utils.guid();var c=f.opts.data;f.Init=function(p){this.empty();for(var m=0,n;n=p.list[m++];){var l=a('<ul class="list-group"></ul>').appendTo(this);l.css("padding",0);l.css("margin","0 -15px");var j=d(this,p.items,n);n.count=j.length;n.items=j;var k='<li data-toggle="collapse" data-parent="#accordion" class="list-group-item" href="#'+f.guid+n[f.opts.field.Id]+'"><i class="glyphicon glyphicon-'+f.opts.icon[0][0]+'" ></i>  {'+f.opts.field.Name+"}</li>";if(f.opts.showCount){k='<li data-toggle="collapse" data-parent="#accordion" class="list-group-item" href="#'+f.guid+n[f.opts.field.Id]+'"><i class="glyphicon glyphicon-'+f.opts.icon[0][0]+'" ></i>  {'+f.opts.field.Name+"} "+n.count+"</li>"}if(f.opts.icon.length==2){k='<li data-toggle="collapse" data-parent="#accordion" class="list-group-item" href="#'+f.guid+n[f.opts.field.Id]+'"><span class="glyphicon glyphicon-'+f.opts.icon[0][0]+'" ></span><i class="glyphicon glyphicon-'+f.opts.icon[1][0]+'" ></i>  {'+f.opts.field.Name+"}</li>";if(f.opts.showCount){k='<li data-toggle="collapse" data-parent="#accordion" class="list-group-item" href="#'+f.guid+n[f.opts.field.Id]+'"><span class="glyphicon glyphicon-'+f.opts.icon[0][0]+'" ></span><i class="glyphicon glyphicon-'+f.opts.icon[1][0]+'" ></i>  {'+f.opts.field.Name+"} "+n.count+"</li>"}}var o=a(utils.replaceTpl(k,n)).appendTo(l);o.bind("click",n,b)}};f.Init(c);function d(k,s,j){var l=a('<ul id="'+f.guid+j[f.opts.field.Id]+'" class="panel-collapse collapse"></ul>').appendTo(k);l.css("padding",0);l.css("margin","0 -15px");var o='<li href="javascript:void(0);" class="list-group-item"><span style="margin-left:20px;"></span><i class="glyphicon glyphicon-'+f.opts.sicon[0][0]+'" ></i>  {'+f.opts.field.SName+"}</li>";if(f.opts.sicon.length==2){o='<li href="javascript:void(0);" class="list-group-item"><span class="glyphicon glyphicon-'+f.opts.sicon[0][0]+'" style="margin-left:20px;"></span><i class="glyphicon glyphicon-'+f.opts.sicon[1][0]+'" ></i>  {'+f.opts.field.SName+"}</li>"}var q=[];for(var n=0,m;m=s[n++];){if(m[f.opts.field.Pid]==j[f.opts.field.Id]){var r=a(utils.replaceTpl(o,m)).appendTo(l);m.pNode=j;r.bind("click",m,g);q.push(m)}}return q}function b(j){var k=j.data;if(f.opts.icon.length==2){a(this).find("span").toggleClass("glyphicon-"+f.opts.icon[0][1]);a(this).find("i").toggleClass("glyphicon-"+f.opts.icon[1][1]);a(this).find("span").toggleClass("glyphicon-"+f.opts.icon[0][0]);a(this).find("i").toggleClass("glyphicon-"+f.opts.icon[1][0])}else{a(this).find("i").toggleClass("glyphicon-"+f.opts.icon[0][0]);a(this).find("i").toggleClass("glyphicon-"+f.opts.icon[0][1])}f.find("li").removeClass("active");var i=a(this).addClass("active");f.opts.click(j)}function g(j){var k=j.data;if(f.opts.sicon.length==2){a(this).find("span").toggleClass("glyphicon-"+f.opts.sicon[0][0]);a(this).find("i").toggleClass("glyphicon-"+f.opts.sicon[1][0]);a(this).find("span").toggleClass("glyphicon-"+f.opts.sicon[0][1]);a(this).find("i").toggleClass("glyphicon-"+f.opts.sicon[1][1])}else{a(this).find("i").toggleClass("glyphicon-"+f.opts.sicon[0][0]);a(this).find("i").toggleClass("glyphicon-"+f.opts.sicon[0][1])}f.find("li").removeClass("active");var i=a(this).addClass("active");f.opts.sclick(j)}f.flesh=function(i){f.Init(i)};return f}})(jQuery);(function(a){a.fn.SearchBox=function(c){var b='<div class="input-group input-group-sm">'+'<input type="text" placeholder="{name}..." class="form-control" />'+'<div class="input-group-btn">'+'<a class="btn btn-default" href="javascript:void(0);" title="模糊查询"><i class="glyphicon {icon}"></i></a>'+'<a class="btn btn-default  dropdown-toggle" data-toggle="dropdown" href="javascript:void(0);" title="更多条件查询" style="border-left-width:1px !important;"><span class="fa fa-angle-down"></span></a>'+"</div>"+"</div>";this.empty();var e=this;if(!c.name){c.name="搜索"}c.icon=c.icon||"glyphicon-search";var d=a(utils.replaceTpl(b,c)).appendTo(e);d.parent().css("padding-left",0).css("padding-right",0);var f={click:function(g){alert(9)}};d.opts=a.extend(f,c);d.find("input").on("keydown",null,function(g){if(g.keyCode==13){d.opts.click({text:this.value});console.log("......not search...")}else{}}).bind("focus",null,function(g){if(d.opts.icon=="glyphicon-ok"){d.opts.click({text:this.value})}}).bind("blur",null,function(g){if(d.opts.blur){d.opts.blur({text:this.value})}}).on("input propertychange",function(){d.opts.click({text:this.value})});d.find("span").bind("click",null,function(){var g=d.find("input").val();d.opts.click({text:g})});d.opts.showAd=false;d.find("a:eq(1)").bind("click",null,function(){d.find("span").toggleClass("fa-angle-up").toggleClass("fa-angle-down");if(d.opts.showAd){d.opts.adEl.remove();d.opts.showAd=false}else{d.opts.showAd=true;d.opts.adEl=a('<div style="width: 100%;float: left;"/>').appendTo(e.parent());d.opts.adEl.load(d.opts.html,function(g){var g=d.find("input").val();d.opts.load({text:g,el:d.opts.adEl})})}});d.setValue=function(g){d.find("input").val(g)};d.getValue=function(){return d.find("input").val()};d.setFocus=function(){d.find("input").focus()};d.setSelect=function(){d.find("input").select()};return d};a.fn.iBox=function(c){var b='<div class="input-group input-group-sm">';c.layout=c.layout||"left";if(c.layout=="left"){b+='<span class="input-group-addon"><i class="glyphicon {icon}"></i></span>';b+='<input type="text" placeholder="{name}..." class="form-control" />'}else{b+='<input type="text" placeholder="{name}..." class="form-control" />';b+='<span class="input-group-addon"><i class="glyphicon {icon}"></i></span>'}b+="</div>";if(!c.name){c.name="搜索"}c.icon=c.icon||"glyphicon-search";var d=a(utils.replaceTpl(b,c)).appendTo(this);var e={click:function(f){alert(9)}};d.opts=a.extend(e,c);d.find("input").bind("keydown",null,function(f){if(f.keyCode==13){d.opts.click({text:this.value})}}).bind("focus",null,function(f){if(d.opts.icon=="glyphicon-ok"){d.opts.click({text:this.value})}}).on("input propertychange",function(){d.opts.click({text:this.value})});d.find("span").bind("click",null,function(){var f=d.find("input").val();d.opts.click({text:f})});d.setValue=function(f){d.find("input").val(f)};d.getValue=function(){return d.find("input").val()};d.setFocus=function(){d.find("input").focus()};d.setSelect=function(){d.find("input").select()};return d};a.fn.CheckRadioBox=function(c){var b='<div class="input-group input-group-sm">';c.layout=c.layout||"left";if(c.layout=="left"){b+='<span class="input-group-addon"><i class="glyphicon {icon}"></i></span>';b+='<input type="text" placeholder="{name}..." class="form-control" />'}else{b+='<input type="text" placeholder="{name}..." class="form-control" />';b+='<span class="input-group-addon"><i class="glyphicon {icon}"></i></span>'}b+="</div>";if(!c.name){c.name="搜索"}c.icon=c.icon||"glyphicon-search";var d=a(utils.replaceTpl(b,c)).appendTo(this);var e={click:function(f){alert(9)}};d.opts=a.extend(e,c);d.find("input").bind("keydown",null,function(f){if(f.keyCode==13){d.opts.click({text:this.value})}}).bind("focus",null,function(f){if(d.opts.icon=="glyphicon-ok"){d.opts.click({text:this.value})}}).on("input propertychange",function(){d.opts.click({text:this.value})});d.find("span").bind("click",null,function(){var f=d.find("input").val();d.opts.click({text:f})});return d}})(jQuery);(function(a){a.fn.ComboBox=function(c){var b='<div class="input-group input-group-sm">'+'<input type="text" placeholder="{name}..." class="form-control" />'+'<span class="input-group-addon"><i class="glyphicon glyphicon-search"></i></span>'+"</div>";var f='<div class="input-group input-group-sm">'+'<input type="text" placeholder="{name}" class="form-control">'+'<div class="input-group-btn">'+'<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" tabindex="-1">'+'<span class="caret"></span>'+"</button>"+'<ul class="dropdown-menu pull-right" style="height:200px;overflow-y:auto;">'+"</ul>"+"</div>"+"</div>";this.empty();if(!c.name){c.name="搜索"}var d=a(utils.replaceTpl(f,c)).appendTo(this);var e={click:function(g){}};d.opts=a.extend(e,c);d.find("input").bind("keydown",null,function(g){if(g.keyCode==13){d.opts.click({text:this.value})}}).bind("blur",null,function(g){if(d.opts.blur){d.opts.blur({text:this.value})}});d.getValue=function(k){if(d.selectItem){return d.selectItem[k]}else{var g=d.find("input").val();for(var h=0,j;j=d.opts.data[h++];){if(j[d.opts.field]==g){return j[k]}}}};d.setValue=function(g){d.find("input").val(g)};d.setFocus=function(){d.find("input").focus()};d.setSelect=function(){d.find("input").select()};d.Liclick=function(g){d.find("input").val(g.data[d.opts.field]);d.selectItem=g.data;d.opts.click({text:g.data[d.opts.field]})};d.render=function(j){d.ul=d.find("ul");d.ul.empty();var k='<li><a href="javascript:void(0);">{'+d.opts.field+"}</a></li>";for(var g=0,h;h=j[g++];){d.li=a(utils.replaceTpl(k,h)).appendTo(d.ul);d.li.bind("click",h,d.Liclick)}};d.fresh=function(g){d.render(g)};d.render(d.opts.data);return d};a.fn.ComboBoxGrid=function(c){var b='<div class="input-group input-group-sm">'+'<input type="text" placeholder="{name}..." class="form-control" />'+'<span class="input-group-addon"><i class="glyphicon glyphicon-search"></i></span>'+"</div>";var f='<div class="input-group input-group-sm">'+'<span title="勾选从客户历史中查找" class="input-group-addon"><i class="glyphicon glyphicon-'+c.icon[0]+'"></i></span>'+'<input type="text" placeholder="{name}" class="form-control">'+'<div class="input-group-btn">'+'<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" tabindex="-1">'+'<span class="caret"></span>'+"</button>"+'<ul class="dropdown-menu pull-right" style="max-height:200px;overflow-y:auto;">'+"</ul>"+"</div>"+"</div>";this.empty();if(!c.name){c.name="搜索"}if(!c.layout){c.layout="left"}var d=a(utils.replaceTpl(f,c)).appendTo(this);var e={click:function(g){}};d.isChecked=false;d.opts=a.extend(e,c);d.find("button").bind("click",function(){if(d.opts.data.length==0||utils.isEmptyObject(d.find("input:eq(0)").val())){d.opts.load({text:""})}});d.find("input:eq(0)").bind("keydown",null,function(g){if(g.keyCode==13){d.opts.load({text:this.value});d.find("button").click()}else{if(g.keyCode==40){d.ul.find("li:eq(0)").addClass(".active")}else{if(g.keyCode==38){d.ul.find("li:eq(1)").addClass(".active")}}}}).bind("focus",function(g){});d.find("i:eq(0)").bind("click",null,function(){a(this).toggleClass("glyphicon-"+d.opts.icon[0]);a(this).toggleClass("glyphicon-"+d.opts.icon[1]);d.isChecked=!d.isChecked;d.opts.iClick()});d.getValue=function(k){if(d.selectItem){return d.selectItem[k]}else{var g=d.find("input").val();for(var h=0,j;j=d.opts.data[h++];){if(j[d.opts.field]==g){return j[k]}}}};d.setValue=function(g){d.find("input").val(g)};d.Liclick=function(g){d.find("input:eq(0)").val(g.data[d.opts.column[1]]);d.selectItem=g.data;d.opts.click({id:g.data[d.opts.column[0]]})};d.render=function(j){d.opts.data=j;d.ul=d.find("ul:eq(0)");d.ul.empty();var k='<li><a href="javascript:void(0);">';for(var g=0,h;h=d.opts.column[g++];){k+='<span class="ul-table-col">{'+h+"}</span>"}k+="</a></li>";for(var g=0,h;h=j[g++];){d.li=a(utils.replaceTpl(k,h)).appendTo(d.ul);d.li.find("a").bind("click",h,d.Liclick)}a('<li class="divider"></li>').appendTo(d.ul);d.renderTool()};d.renderTool=function(g){d.tool=a('<div name="ul-table-tools" style="height:40px;width:96%;min-width:300px;" ></div>').appendTo(d.find("ul"));d.tool.empty();d.tool.find("i").bind("click",function(h){alert(0)})};d.focus=function(){d.find("input").focus()};d.setSelect=function(g){d.find("input").select()};d.fresh=function(g){d.opts.data=g;d.render(g)};d.render(d.opts.data);return d}})(jQuery);(function(a){a.fn.Tree=function(k){var b={click:function(l){alert(9)}};var h=this;h.opts=a.extend(b,k);h.guid=utils.guid();var i=h.opts.data;this.empty();var e=a('<ul class="list-group"></ul>').appendTo(h);e.css("padding",0).css("margin",0);var j=h.opts.icon[1][0];h.CreateTree=function(q,o,m,l){for(var s=0;s<q.length;s++){var r=q[s];j=r.checked?h.opts.icon[1][1]:h.opts.icon[1][0];var t='<li class="list-group-item" ><i class="glyphicon glyphicon-'+j+'" ></i>  {'+h.opts.field.Name+"}</li>";var n='<li class="list-group-item" ><span class="glyphicon glyphicon-'+h.opts.icon[0][0]+'" ></span><i class="glyphicon glyphicon-'+j+'" ></i>  {'+h.opts.field.Name+"}</li>";var u=null;if(r.nodes.length>0){u=a(utils.replaceTpl(n,r)).appendTo(o);u.find("span").css("margin-left",l*14+l*5).css("margin-right",5);u.find("i").css("margin-left",0).css("margin-right",5);h.CreateTree(r.nodes,o,m,l+1)}else{u=a(utils.replaceTpl(t,r)).appendTo(o);u.find("i").css("margin-left",(l)*14+l*5).css("margin-right",5)}u.attr("level",l);u.attr("collapse",h.opts.collapse?1:0);u.attr("nodeid",r[h.opts.field.Id]);if(!h.opts.collapse||l==0){u.show()}else{u.hide()}u.find("span").bind("click",r,d);u.bind("click",r,g)}};function f(l,m){var n=l.data;if(h.opts.icon.length==2){a(m).toggleClass("glyphicon-"+h.opts.icon[0][1]);a(m).toggleClass("glyphicon-"+h.opts.icon[0][0])}}function d(o){o.stopPropagation();f(o,this);var p=o.data;var n=0;var l=a(this).parent();n=h.GetNode(p,n);var q=l.attr("collapse");q=Number(q);if(!q){for(var m=0;m<n;m++){l=l.next();l.hide()}}else{h.GetNodeLi(p,n,l,!q)}a(this).parent().attr("collapse",!q?1:0)}function g(m){var n=m.data;if(h.opts.icon.length==2){a(this).find("i").toggleClass("glyphicon-"+h.opts.icon[1][0]);a(this).find("i").toggleClass("glyphicon-"+h.opts.icon[1][1])}else{a(this).find("i").toggleClass("glyphicon-"+h.opts.icon[0][0]);a(this).find("i").toggleClass("glyphicon-"+h.opts.icon[0][1])}h.find("li").removeClass("active");var l=a(this).addClass("active");h.opts.click(m)}h.GetNodeLi=function(p,o,m,q){o=o+p.nodes.length;for(var l=0;l<p.nodes.length;l++){var s=p.nodes[l];m=e.find("[nodeid="+s[h.opts.field.Id]+"]");var r=m.attr("collapse");r=Number(r);if(q){m.hide();if(s.nodes.length>0){o=h.GetNodeLi(s,o,m,r)}}else{m.show();if(s.nodes.length>0&&!r){o=h.GetNodeLi(s,o,m,r)}}}return o};h.GetNode=function(o,m){m=m+o.nodes.length;for(var l=0;l<o.nodes.length;l++){var p=o.nodes[l];if(p.nodes.length>0){m=h.GetNode(p,m)}}return m};function c(m){var n=m.data;if(h.opts.sicon.length==2){a(this).find("span").toggleClass("glyphicon-"+h.opts.sicon[0][0]);a(this).find("i").toggleClass("glyphicon-"+h.opts.sicon[1][0]);a(this).find("span").toggleClass("glyphicon-"+h.opts.sicon[0][1]);a(this).find("i").toggleClass("glyphicon-"+h.opts.sicon[1][1])}else{a(this).find("i").toggleClass("glyphicon-"+h.opts.sicon[0][0]);a(this).find("i").toggleClass("glyphicon-"+h.opts.sicon[0][1])}h.find("li").removeClass("active");var l=a(this).addClass("active");h.opts.sclick(m)}h.getSelectedNodes=function(){var p=e.children();var m=[];var o="glyphicon-"+h.opts.icon[1][1];for(var n=0;n<p.length;n++){var l=a(p[n]);if(l.find("i").hasClass(o)){m.push(l.attr("nodeid"))}}return m};h.getUnSelectedNodes=function(){};h.CreateTree(i,e,"",0);h.flesh=function(l){e.empty();h.CreateTree(l,e,"",0)};return h}})(jQuery);(function(a){a.fn.Tool=function(c){var h={click:function(i){}};this.empty();var g=this;g.opts=a.extend(h,c);var b='<i class="icon-{icon}" title="{title}"></i><a href="javascript:void(0);"></a>';g.append("[ ");for(var e=0,f;f=g.opts.list[e++];){var d=a(utils.replaceTpl(b,f)).appendTo(g);d.bind("click",g.opts.data,f.click)}g.append(" ]");return g}})(jQuery);(function(a){a.fn.ToolBar=function(p){var c={click:function(i){}};this.empty();var l=a('<form class="navbar-form navbar-left"></form>').appendTo(this);l.css("padding-left",0);l.opts=a.extend(c,p);var h=l.opts;var b=null;for(var g=0;g<h.data.length;g++){var o=h.data[g];var n=a('<div class="btn-group btn-group-sm"></div>').appendTo(l);if(o.type){if(o.type=="split"){b=a('<div class="btn-group  btn-group-sm"></div>').appendTo(l);b=null;continue}}if(o.text||o.title){if(b==null){b=n}var f=null;if(utils.isEmptyObject(o.cls)){o.cls="btn btn-blue"}f=a('<button type="button" class="'+o.cls+'" title="'+o.title+'"><i class="icon-'+o.icon+'"></i>'+o.text+"</button>");if(o.click){f.bind("click",o,o.click)}if(o.menu){var m=a('<div class="btn-group btn-group-sm"></div>').appendTo(b);f.appendTo(m);f.attr("data-toggle","dropdown");a('<span class="caret"></span>').appendTo(f);var k=a('<ul class="dropdown-menu dropdown-whitesmoke"></ul>').appendTo(m);for(var d=0,e;e=o.menu[d++];){a('<li><a href="javascript:void(0);"><span class="glyphicon glyphicon-'+e.icon+'"></span>'+e.text+"</a></li>").appendTo(k).bind("click",e,e.click)}}else{f.appendTo(b)}}}return l}})(jQuery);(function(a){a.fn.PageBar=function(c,d){var b='<div class="navbar-form navbar-right" style="margin-right: -15px;">'+'<div style="line-height:18px;float:left;padding-top:6px;">每页 <span style="color:red;">{pageSize}  </span>条 共 <span style="color:red;"> {total} </span> 条  <span style="color:red;">{pageIndex}/{pageCount}</span>页  </div>'+'<div style="width:103px;" class="input-group input-group-sm">'+'<span class="input-group-addon"><i class="glyphicon glyphicon-arrow-left"></i></span>'+'<input type="text"  placeholder="{pageSize}" class="form-control" />'+'<span class="input-group-addon"><i class="glyphicon glyphicon-arrow-right"></i></span>'+"</div></div>";this.find(".navbar-right").remove();var e=a(utils.replaceTpl(b,d)).appendTo(this);var f={click:function(g){}};e.opts=a.extend(f,c);e.find(".input-group-addon:eq(0)").bind("click",null,function(g){if(d.pageIndex>1){d.pageIndex=d.pageIndex-1;c.pageclick(d.pageIndex,d.pageSize)}});e.find(".input-group-addon:eq(1)").bind("click",null,function(g){if(d.pageIndex<d.pageCount){d.pageIndex=d.pageIndex+1;c.pageclick(d.pageIndex,d.pageSize)}});e.find("input").bind("keydown",null,function(g){if(g.keyCode==13){d.pageSize=this.value;c.pageclick(d.pageIndex,d.pageSize)}});return e}})(jQuery);(function(a){a.fn.Grid=function(o,c){this.empty();var n=this;var d={click:function(i){}};n.opts=a.extend(d,o);var l=n.opts;n=a("<table></table>").appendTo(this);n.addClass("table table-hover");var k=a('<thead style="border:solid 1px #ccc;"></thead>').appendTo(n);var m=a("<tr></tr>").appendTo(k);for(var h=0;h<l.columns.length;h++){var b=a("<td></td>").appendTo(m);b.html(l.columns[h].title);if(l.columns[h].click){b.find("input").bind("click",n,function(){n.find("td:eq(0)").find("input")[0].checked=!n.find("td:eq(0)").find("input")[0].checked})}}n.find("tbody").empty();var g=a("<tbody></tbody>").appendTo(n);l.GetSelectRow(n,c.data);for(var h=0;h<c.data.length;h++){var m=a("<tr></tr>").appendTo(g).bind("click",c.data[h],l.rowclick);for(var f=0;f<l.columns.length;f++){var e=a("<td></td>").appendTo(m);e.css("border-top","dashed 1px #ccc");e.css("border-bottom","dashed 1px #ccc");e.html(utils.replaceTpl(l.columns[f].text,c.data[h]))}}return n}})(jQuery);(function(a){a.fn.GroupGridView=function(m,c){var j=this;var g={click:function(n){}};j.opts=a.extend(g,m);j.rowCheck=[];j.rowSel=[];var i=j.opts;function f(){var o=j.opts;var n=o.columns.length;if(n<12){if(12%n==0){j.n=n/12}else{j.n=1}d(j.n)}else{j.n=1;d(j.n)}l(c,j.n)}f();function d(r){j.empty();var p=a('<div class="row"></div>').appendTo(j);p.addClass("iwf-grid-title");for(var o=0;o<i.columns.length;o++){var q=a("<div ></div>").appendTo(p);q.addClass("col-lg-"+r);q.css("padding",0);q.html(i.columns[o].title);if(i.columns[o].click){q.width(40);q.css("padding-left",10);q.find("input").bind("click",j,function(){j.selectedAllRow(this.checked)})}}}function b(n){a(this).parent().css("background-color","#F7F7F7")}function e(n){a(this).parent().css("background-color","transparent")}function k(p){var q=false;for(var n=0;n<j.rowSel.length;n++){var o=j.rowSel[n];if(o.index==p.data){q=true;break}}if(!q){j.rowSel.push({index:p.data,ds:c[p.data]})}}function l(s,t){for(var q=0;q<s.data.length;q++){var r=a('<div class="row iwf-grid-row"></div>').appendTo(j).bind("click",s.data[q],i.rowclick);for(var o=0;o<i.columns.length;o++){var p=a("<div ></div>").appendTo(r);if(o==0){p.width(40);p.css("padding-left",10);j.rowCheck.push(p)}p.addClass("iwf-grid-el");p.addClass("col-md-"+t);p.bind("click",q,k);p.bind("dblclick",s.data[q],k);p.html(utils.replaceTpl(i.columns[o].text,s.data[q]))}r.find("input").bind("click",r,h)}}function h(n){var o=a(this);if(o[0].checked){n.data.addClass("iwf-grid-row-selected")}else{n.data.removeClass("iwf-grid-row-selected")}}j.selectedAllRow=function(p){for(var n=0;n<j.rowCheck.length;n++){var o=j.rowCheck[n];o.find("input").prop("checked",p);if(p){o.parent().addClass("iwf-grid-row-selected")}else{o.parent().removeClass("iwf-grid-row-selected")}}};j.getSelectedRows=function(){var p=[];for(var n=0;n<j.rowCheck.length;n++){var o=j.rowCheck[n];if(o.find("input")[0].checked){p.push(c.data[n])}}return p};j.fresh=function(n){l(n,j.n)};return j}})(jQuery);(function(a){a.fn.GroupList=function(c){var b='<ul class="nav nav-tabs"></ul>',e='<li class="active"><a href="#{idkey}" data-toggle="collapse"><i class="glyphicon glyphicon-{icon}"></i>{title}</a></li>',h='<div class="panel-collapse collapse in" id="{idkey}"></div>';var d=this;var g={click:function(i){}};d.opts=a.extend(g,c);d.render=function(){d.empty();d.ul=[],d.li=[],d.c=[];for(var l=0;l<d.opts.cfg.length;l++){var n=d.opts.cfg[l];d.ul[l]=a(b).appendTo(d);d.li[l]=a(utils.replaceTpl(e,n)).appendTo(d.ul[l]);if(l==0){d.li[l].find("a").css("color","red").css("cursor","pointer")}d.c[l]=a(utils.replaceTpl(h,n)).appendTo(d)}for(var k=0,m;m=d.opts.data[k++];){d.addRow(m)}};d.addRow=function(k){var j=k[d.opts.datefield];var l=new Date();var i=null;if(d.DateDiff_Day(l,j,3)){i=a(utils.replaceTpl(d.opts.tpl,k)).appendTo(d.c[0])}else{i=a(utils.replaceTpl(d.opts.tpl,k)).appendTo(d.c[1])}i.bind("click",k,d.opts.rowclick);return i};function f(k,j){var i=parseInt((j-k)/(1000*60*60));return i}d.y2k=function(i){return(i<1000)?i+1900:i};d.DateDiff_Day=function(q,p,r){q=new Date();p=new Date(p.replace(/-/g,"/"));var l=q.getYear()-p.getYear();var j=q.getMonth()-p.getMonth();var m=q.getDate()-p.getDate();var o=new Date();o.setDate(o.getDate()-r);var n=false;var i=Date.UTC(d.y2k(q.getYear()),q.getMonth(),q.getDate(),0,0,0)-Date.UTC(d.y2k(p.getYear()),p.getMonth(),p.getDate(),0,0,0);var k=i/1000/60/60/24;if(k>r){n=true}return n};d.fresh=function(i){d.opts.data=i;d.render()};d.render();return d}})(jQuery);(function(a){a.fn.BlockList=function(k){var f={click:function(l){}};var i=this;i.opts=a.extend(f,k);var e='<div class="row Goods-item" style="">'+'<div class="col-md-12" style="line-height:30px;">'+'<div style="float:left;"><i class="icon-gift icon-blue"></i> <a href="javascript:void(0);">{cnname}</a></div></div>'+'<ul class="list-group"></ul>'+'<div class="col-md-12" style="line-height:30px;">'+'<div class="col-md-2" ><span class="case_num">套餐数量：0</span></div>'+'<div class="col-md-2" ><span class="case_org_price">原价总计：0</span></div>'+'<div class="col-md-2" ><span class="case_discount">折扣：0</span></div>'+'<div class="col-md-3" ><span class="case_price">套餐优惠价：{price}</span></div></div>'+"</div>";var c='<li class="col-md-12" style="list-style-type:none;padding:0px;">'+'<div class="col-md-1" style="padding-right:0px;height:100px;"> <a href="#" class="thumbnail"><image src="{src}" style="width:80px;height:80px;"  /></a></div>'+'<div class="col-md-11" style="line-height:30px;"><a href="javascript:void(0);">{cnname}</a></div>'+'<div class="col-md-3">销售价格：{salePrice} 元</div><div class="col-md-3">数       量：{num} ({unit})</div>'+'<div class="col-md-3">小计：{total} 元</div><div class="col-md-1">评价</div>'+"</li>";var b='<div class="row Goods-item" style="">'+'<div class="col-md-12" style="line-height:30px;">'+'<div style="float:left;"><i class="icon-file-alt icon-blue"></i> <a href="javascript:void(0);">{cnname}</a></div></div>'+'<div class="col-md-1" style="padding-right:0px;height:100px;"> <a href="#" class="thumbnail"><image src="{src}" style="width:80px;height:80px;"  /></a></div>'+'<div class="col-md-3">销售价格：<span style="color:red;">{salePrice} </span>元</div><div class="col-md-3">数       量：{num} ({unit})</div>'+'<div class="col-md-3">小计：{total} 元</div><div class="col-md-1">评价</div>'+'<div class="col-md-3">进货价格：{purchasePrice} 元</div><div class="col-md-3">自定义价：{definedPrice} 元</div><div class="col-md-1"></div>'+'<div class="col-md-1"></div><div class="col-md-1"></div><div class="col-md-1"></div><div class="col-md-1"></div>'+"</div>";var j='<div class="row case-item">'+'<div class="col-md-12" style="font-weight:bold;min-height:30px;">'+'<div style="float:left;"><i class="icon-file-alt icon-blue"></i> <a  href="javascript:void(0);">{cnname}</a></div>'+'<div class="case-bar" style="float:left;margin-left:20px;"></div>'+"</div>"+'<div class="col-md-2">业务名称</div>'+'<div class="col-md-4">{casecnname}</div>'+'<div class="col-md-2">当前任务</div>'+'<div class="col-md-4"><span style="color:red;">{ActName}</span></div>'+'<div class="col-md-2">主办人</div>'+'<div class="col-md-4">{UserName}</div>'+'<div class="col-md-2">当前任务</div>'+'<div class="col-md-4"><span style="color:red;">{ActName}</span></div>'+'<div class="col-md-2">创建人</div>'+'<div class="col-md-4">{CreatorName}</div>'+'<div class="col-md-2">归属流程</div>'+'<div class="col-md-4">{FlowName}</div>'+'<div class="col-md-2">接收时间</div>'+'<div class="col-md-4">{receDate}</div>'+'<div class="col-md-2">到期时间</div>'+'<div class="col-md-4">{expireDate}</div>'+"</div>";var g='<div class="row" style="height:22px;"><div class="col-lg-1" id="shopBar"></div><div class="col-lg-5"><a id="backBtn" class="btn btn-success" style="width:150px;margin-left:20px;margin-top:10px;margin-bottom:10px;">立刻购买</a><a id="backBtn" class="btn btn-success" style="width:150px;margin-left:20px;margin-top:10px;margin-bottom:10px;">加入购物车</a></div>'+'<div class="col-lg-6"> </div></div>';var h='<div class="panel panel-default">'+'<div class="panel-heading">'+'<h3 class="panel-title"><i style="margin-right:8px;" level={id} class="glyphicon glyphicon-{select}"></i><a level="link1" title="点击查看订单详细" class="order-link" >{crmname}</a>  {createtime}<div class="tool_bar" style="float:right;" id="orderTool"></div></h3>'+"</div>"+'<div class="panel-body">'+'</div><div class="modal-footer"></div>'+"</div>";i.empty();i.render=function(){i.ul=[],i.li=[],i.c=[];for(var t=0;t<i.opts.data.length;t++){var l='<a level="link2" class="btn btn-link" style="width:50px;float:left;margin-left:20px;">'+i.opts.aTitle[0]+'</a><span><strong>合计:0元<strong></span><a level="link3" class="btn btn-success" style="width:150px;margin-left:20px;">'+i.opts.aTitle[1]+'</a><a level="link4" class="btn btn-success" style="width:150px;margin-left:20px;">'+i.opts.aTitle[2]+"</a>";var y=i.opts.data[t];y.order.select="unchecked";y.order.crmname=y.customer.cnname;i.ul[t]=a(utils.replaceTpl(h,y.order)).appendTo(i);i.ul[t].find(".panel-title i").bind("click",y.order,i.checkClick);var u=0,w=0;var v=i.ul[t].find(".panel-body");for(var r=0,s;s=y.gsparts[r++];){s.goods.purchasePrice=s.goods.units[s.type].purchasePrice;s.goods.salePrice=s.goods.units[s.type].salePrice;s.goods.unit=s.goods.units[s.type].cnname;s.goods.num=s.num;s.goods.definedPrice=s.definedPrice;if(s.isDefined==1){s.goods.total=s.goods.definedPrice*s.goods.num}else{s.goods.total=s.goods.salePrice*s.goods.num}u+=s.goods.total;i.li[t]=a(utils.replaceTpl(b,s.goods)).appendTo(v)}for(var q=0;q<y.epparts.length;q++){var o=y.epparts[q];i.c[t]=a(utils.replaceTpl(e,o.epackage)).appendTo(v);var x=i.c[t].find("ul");var w=0;for(var p=0,s;s=o.epackage.items[p++];){s.goods.purchasePrice=s.goods.units[s.type].purchasePrice;s.goods.salePrice=s.goods.units[s.type].salePrice;s.goods.unit=s.goods.units[s.type].cnname;s.goods.num=s.num;s.goods.total=s.goods.salePrice*s.goods.num;w+=s.goods.total;a(utils.replaceTpl(c,s.goods)).appendTo(x)}u+=(o.epackage.salePrice*o.num)*o.epackage.discount;i.c[t].find(".case_num").html("<strong>套餐数量:"+o.num+" 份</strong>");i.c[t].find(".case_org_price").html("<strong>原价合计:"+iwfTool.toFixed(w,2)+" 元</strong>");i.c[t].find(".case_discount").html("<strong>折扣:"+o.epackage.discount+" 折</strong>");i.c[t].find(".case_price").html("<strong>套餐"+o.epackage.discount+"折优惠价:"+o.epackage.salePrice+" 元</strong>")}y.order.count=iwfTool.toFixed(u+w,2);if(y.order.status==1){l='<a level="link2" class="btn btn-link" style="width:50px;float:left;margin-left:20px;">'+i.opts.aTitle[0]+'</a><span><strong>合计:0元<strong></span><a level="link4" class="btn btn-success" style="width:150px;margin-left:20px;">'+i.opts.aTitle[2]+"</a>"}a(l).appendTo(i.ul[t].find(".modal-footer"));i.ul[t].find(".modal-footer a:eq(0)").html(y.order.status==1?"订单状态：已完结":"订单状态：待支付");i.ul[t].find(".tool_bar").Tool({list:i.opts.list,data:y.order});i.ul[t].find(".modal-footer a").bind("click",{order:y.order,count:u},i.opts.btnLinkClick);i.ul[t].find(".modal-footer span").html("<strong>合计:"+iwfTool.toFixed(u,2)+"元</strong>");i.ul[t].find(".order-link").bind("click",{order:y.order,count:u},i.opts.btnLinkClick)}};i.dataRows=[];i.checkClick=function(o){var m=o.data;a(this).toggleClass("glyphicon glyphicon-unchecked");a(this).toggleClass("glyphicon glyphicon-ok");var l=-1;for(var n=0;n<i.dataRows.length;n++){if(m.id==i.dataRows[n].id){l=n;break}}if(a(this).hasClass(".glyphicon-unchecked")){i.dataRows.push(m)}else{i.dataRows.splice(l,1)}};i.selectedAll=function(l){for(var m=0;m<i.ul.length;m++){var n=i.ul[m].find(".panel-title i:eq(0)");if(l){n.removeClass("glyphicon glyphicon-unchecked");n.removeClass("glyphicon glyphicon-ok");n.addClass("glyphicon glyphicon-ok")}else{n.removeClass("glyphicon glyphicon-ok");n.removeClass("glyphicon glyphicon-unchecked");n.addClass("glyphicon glyphicon-unchecked")}}};i.getSelected=function(){var m=[];for(var l=0;l<i.ul.length;l++){if(i.ul[l].find(".panel-title i:eq(0)").hasClass("glyphicon-ok")){m.push(i.opts.data[l])}}return m};i.addRow=function(o){var m=o[i.opts.mainField].createtime;var p=new Date();var l=null;if(i.DateDiff_Day(p,m,3)){l=a(utils.replaceTpl(i.opts.tplItem,o)).appendTo(i.c[0])}else{l=a(utils.replaceTpl(i.opts.tplItem,o)).appendTo(i.c[1])}l.bind("click",o,i.opts.rowclick);return l};function d(n,m){var l=parseInt((m-n)/(1000*60*60));return l}i.y2k=function(l){return(l<1000)?l+1900:l};i.DateDiff_Day=function(t,s,u){t=new Date();s=new Date(s.replace(/-/g,"/"));var o=t.getYear()-s.getYear();var m=t.getMonth()-s.getMonth();var p=t.getDate()-s.getDate();var r=new Date();r.setDate(r.getDate()-u);var q=false;var l=Date.UTC(i.y2k(t.getYear()),t.getMonth(),t.getDate(),0,0,0)-Date.UTC(i.y2k(s.getYear()),s.getMonth(),s.getDate(),0,0,0);var n=l/1000/60/60/24;if(n>u){q=true}return q};i.fresh=function(l){i.opts.data=l;i.render()};i.render();return i};a.fn.PurchaseBlockList=function(k){var f={click:function(l){}};var i=this;i.opts=a.extend(f,k);var e='<div class="row Goods-item" style="">'+'<div class="col-md-12" style="line-height:30px;">'+'<div style="float:left;"><i class="icon-gift icon-blue"></i> <a href="javascript:void(0);">{cnname}</a></div></div>'+'<ul class="list-group"></ul>'+'<div class="col-md-12" style="line-height:30px;">'+'<div class="col-md-2" ><span class="case_num">套餐数量：0</span></div>'+'<div class="col-md-2" ><span class="case_org_price">原价总计：0</span></div>'+'<div class="col-md-2" ><span class="case_discount">折扣：0</span></div>'+'<div class="col-md-3" ><span class="case_price">套餐优惠价：{price}</span></div></div>'+"</div>";var c='<li class="col-md-12" style="list-style-type:none;padding:0px;">'+'<div class="col-md-1" style="padding-right:0px;height:100px;"> <a href="#" class="thumbnail"><image src="{src}" style="width:80px;height:80px;"  /></a></div>'+'<div class="col-md-11" style="line-height:30px;"><a href="javascript:void(0);">{cnname}</a></div>'+'<div class="col-md-2">销售价格：</div><div class="col-md-1">{salePrice} 元</div><div class="col-md-1">数量：</div><div class="col-md-2">{num} ({unit})</div>'+'<div class="col-md-1">小计：</div><div class="col-md-1">{total} 元</div><div class="col-md-1"></div><div class="col-md-1">评价</div>'+"</li>";var b='<div class="row Goods-item" style="">'+'<div class="col-md-12" style="line-height:30px;">'+'<div style="float:left;"><i class="icon-file-alt icon-blue"></i> <a href="javascript:void(0);">{cnname}</a></div></div>'+'<div class="col-md-1" style="padding-right:0px;height:100px;"> <a href="#" class="thumbnail"><image src="{src}" style="width:80px;height:80px;"  /></a></div>'+'<div class="col-md-3">销售价格：{salePrice} 元</div><div class="col-md-3">数       量：{num} ({unit})</div>'+'<div class="col-md-3">小计：{total} 元</div><div class="col-md-1">评价</div>'+'<div class="col-md-3">进货价格：<span style="color:red;">{purchasePrice} </span>元</div><div class="col-md-3">自定义价：{definedPrice} 元</div><div class="col-md-2"></div>'+'<div class="col-md-1"></div><div class="col-md-1"></div><div class="col-md-1"></div><div class="col-md-1"></div>'+"</div>";var j='<div class="row case-item">'+'<div class="col-md-12" style="font-weight:bold;min-height:30px;">'+'<div style="float:left;"><i class="icon-file-alt icon-blue"></i> <a  href="javascript:void(0);">{cnname}</a></div>'+'<div class="case-bar" style="float:left;margin-left:20px;"></div>'+"</div>"+'<div class="col-md-2">业务名称</div>'+'<div class="col-md-4">{casecnname}</div>'+'<div class="col-md-2">当前任务</div>'+'<div class="col-md-4"><span style="color:red;">{ActName}</span></div>'+'<div class="col-md-2">主办人</div>'+'<div class="col-md-4">{UserName}</div>'+'<div class="col-md-2">当前任务</div>'+'<div class="col-md-4"><span style="color:red;">{ActName}</span></div>'+'<div class="col-md-2">创建人</div>'+'<div class="col-md-4">{CreatorName}</div>'+'<div class="col-md-2">归属流程</div>'+'<div class="col-md-4">{FlowName}</div>'+'<div class="col-md-2">接收时间</div>'+'<div class="col-md-4">{receDate}</div>'+'<div class="col-md-2">到期时间</div>'+'<div class="col-md-4">{expireDate}</div>'+"</div>";var g='<div class="row" style="height:22px;"><div class="col-lg-1" id="shopBar"></div><div class="col-lg-5"><a id="backBtn" class="btn btn-success" style="width:150px;margin-left:20px;margin-top:10px;margin-bottom:10px;">立刻购买</a><a id="backBtn" class="btn btn-success" style="width:150px;margin-left:20px;margin-top:10px;margin-bottom:10px;">加入购物车</a></div>'+'<div class="col-lg-6"> </div></div>';var h='<div class="panel panel-default">'+'<div class="panel-heading">'+'<h3 class="panel-title"><i style="margin-right:8px;" level={id} class="glyphicon glyphicon-{select}"></i><a level="link1" title="点击查看订单详细" class="order-link" >{crmname}</a>  {createtime}<div class="tool_bar" style="float:right;" id="orderTool"></div></h3>'+"</div>"+'<div class="panel-body">'+'</div><div class="modal-footer"></div>'+"</div>";i.empty();i.render=function(){i.ul=[],i.li=[],i.c=[];for(var t=0;t<i.opts.data.length;t++){var l='<a level="link2" class="btn btn-link" style="width:50px;float:left;margin-left:20px;">'+i.opts.aTitle[0]+'</a><span><strong>合计:0元<strong></span><a level="link3" class="btn btn-success" style="width:150px;margin-left:20px;">'+i.opts.aTitle[1]+'</a><a level="link4" class="btn btn-success" style="width:150px;margin-left:20px;">'+i.opts.aTitle[2]+"</a>";var y=i.opts.data[t];y.order.select="unchecked";y.order.crmname=y.supplier.cnname;i.ul[t]=a(utils.replaceTpl(h,y.order)).appendTo(i);i.ul[t].find(".panel-title i").bind("click",y.order,i.checkClick);var u=0;var w=0;var v=i.ul[t].find(".panel-body");for(var r=0,s;s=y.gsparts[r++];){s.goods.purchasePrice=s.goods.units[s.type].purchasePrice;s.goods.salePrice=s.goods.units[s.type].salePrice;s.goods.unit=s.goods.units[s.type].cnname;s.goods.num=s.num;s.goods.definedPrice=s.definedPrice;if(s.isDefined==1){s.goods.total=s.goods.definedPrice*s.goods.num}else{s.goods.total=s.goods.purchasePrice*s.goods.num}u+=s.goods.total;i.li[t]=a(utils.replaceTpl(b,s.goods)).appendTo(v)}for(var q=0;q<y.epparts.length;q++){var o=y.epparts[q];i.c[t]=a(utils.replaceTpl(e,o.epackage)).appendTo(v);var x=i.c[t].find("ul");for(var p=0,s;s=o.epackage.items[p++];){s.goods.purchasePrice=s.goods.units[s.type].purchasePrice;s.goods.salePrice=s.goods.units[s.type].salePrice;s.goods.unit=s.goods.units[s.type].cnname;s.goods.num=s.num;s.goods.total=s.goods.salePrice*s.goods.num;w+=s.goods.total;a(utils.replaceTpl(c,s.goods)).appendTo(x)}u+=(o.epackage.salePrice*o.num)*o.epackage.discount;i.c[t].find(".case_num").html("<strong>套餐数量:"+o.num+" 份</strong>");i.c[t].find(".case_org_price").html("<strong>原价合计:"+iwfTool.toFixed(w,2)+" 元</strong>");i.c[t].find(".case_discount").html("<strong>折扣:"+o.epackage.discount+" 折</strong>");i.c[t].find(".case_price").html("<strong>套餐"+o.epackage.discount+"折优惠价:"+o.epackage.salePrice+" 元</strong>")}y.order.count=iwfTool.toFixed(u+w,2);if(y.order.status==1){l='<a level="link2" class="btn btn-link" style="width:50px;float:left;margin-left:20px;">'+i.opts.aTitle[0]+'</a><span><strong>合计:0元<strong></span><a level="link4" class="btn btn-success" style="width:150px;margin-left:20px;">'+i.opts.aTitle[2]+"</a>"}a(l).appendTo(i.ul[t].find(".modal-footer"));i.ul[t].find(".modal-footer a:eq(0)").html(y.order.status==1?"订单状态：已完结":"订单状态：待支付");i.ul[t].find(".tool_bar").Tool({list:i.opts.list,data:y.order});i.ul[t].find(".modal-footer a").bind("click",{order:y.order,count:u},i.opts.btnLinkClick);i.ul[t].find(".modal-footer span").html("<strong>合计:"+iwfTool.toFixed(u,2)+"元</strong>");i.ul[t].find(".order-link").bind("click",{order:y.order,count:u},i.opts.btnLinkClick)}};i.dataRows=[];i.checkClick=function(o){var m=o.data;a(this).toggleClass("glyphicon glyphicon-unchecked");a(this).toggleClass("glyphicon glyphicon-ok");var l=-1;for(var n=0;n<i.dataRows.length;n++){if(m.id==i.dataRows[n].id){l=n;break}}if(a(this).hasClass(".glyphicon-unchecked")){i.dataRows.push(m)}else{i.dataRows.splice(l,1)}};i.selectedAll=function(l){for(var m=0;m<i.ul.length;m++){var n=i.ul[m].find(".panel-title i:eq(0)");if(l){n.removeClass("glyphicon glyphicon-unchecked");n.removeClass("glyphicon glyphicon-ok");n.addClass("glyphicon glyphicon-ok")}else{n.removeClass("glyphicon glyphicon-ok");n.removeClass("glyphicon glyphicon-unchecked");n.addClass("glyphicon glyphicon-unchecked")}}};i.getSelected=function(){var m=[];for(var l=0;l<i.ul.length;l++){if(i.ul[l].find(".panel-title i:eq(0)").hasClass("glyphicon-ok")){m.push(i.opts.data[l])}}return m};i.addRow=function(o){var m=o[i.opts.mainField].createtime;var p=new Date();var l=null;if(i.DateDiff_Day(p,m,3)){l=a(utils.replaceTpl(i.opts.tplItem,o)).appendTo(i.c[0])}else{l=a(utils.replaceTpl(i.opts.tplItem,o)).appendTo(i.c[1])}l.bind("click",o,i.opts.rowclick);return l};function d(n,m){var l=parseInt((m-n)/(1000*60*60));return l}i.y2k=function(l){return(l<1000)?l+1900:l};i.DateDiff_Day=function(t,s,u){t=new Date();s=new Date(s.replace(/-/g,"/"));var o=t.getYear()-s.getYear();var m=t.getMonth()-s.getMonth();var p=t.getDate()-s.getDate();var r=new Date();r.setDate(r.getDate()-u);var q=false;var l=Date.UTC(i.y2k(t.getYear()),t.getMonth(),t.getDate(),0,0,0)-Date.UTC(i.y2k(s.getYear()),s.getMonth(),s.getDate(),0,0,0);var n=l/1000/60/60/24;if(n>u){q=true}return q};i.fresh=function(l){i.opts.data=l;i.render()};i.render();return i};a.fn.PackageList=function(b){var f={click:function(h){}};var c=this;c.opts=a.extend(f,b);var e='<div class="row Goods-item" style="">'+'<div class="col-md-12" style="line-height:30px;">'+'<div style="float:left;"><i class="icon-gift icon-blue"></i> <a href="javascript:void(0);">{cnname}</a></div></div>'+'<ul class="list-group"></ul>'+'<div class="col-md-2" style="line-height:30px;"><span class="case_org_price">原价总计：0</span></div><div class="col-md-3" style="line-height:30px;"><span class="case_price">套餐优惠价：{price}</span></div><div class="col-md-1" id="shopBar"></div><div class="col-md-1"> </div><ol id="" class="col-md-5"><a level="link3" class="btn btn-success" style="width:150px;margin-left:20px;margin-top:10px;margin-bottom:10px;">立刻购买</a><a level="link4" class="btn btn-success" style="width:150px;margin-left:20px;margin-top:10px;margin-bottom:10px;">加入购物车</a></ol>'+"</div>";var g='<li class="col-md-12" style="list-style-type:none;padding:0px;">'+'<div class="col-md-1" style="padding-right:0px;height:100px;"> <a href="#" class="thumbnail"><image src="{src}" style="width:80px;height:80px;"  /></a></div>'+'<div class="col-md-11" style="line-height:30px;"><a href="javascript:void(0);">{cnname}</a></div>'+'<div class="col-md-3">销售价格：{salePrice} 元</div><div class="col-md-3">数       量：{num} ({unit})</div>'+'<div class="col-md-3">小计：{total} 元</div><div class="col-md-1">评价</div>'+"</li>";c.empty();c.render=function(){c.ul=[],c.li=[],c.c=[];for(var n=0;n<c.opts.data.length;n++){var j='<a level="link2" class="btn btn-link" style="width:50px;float:left;margin-left:20px;">'+c.opts.aTitle[0]+'</a><span><strong>合计:0元<strong></span><a level="link3" class="btn btn-success" style="width:150px;margin-left:20px;">'+c.opts.aTitle[1]+'</a><a level="link4" class="btn btn-success" style="width:150px;margin-left:20px;">'+c.opts.aTitle[2]+"</a>";var r=c.opts.data[n];var p={total:0,pageSize:1,pageCount:100,pageIndex:1,pageclick:function(i,m){}};c.c[n]=a(utils.replaceTpl(e,r)).appendTo(c);var h=c.c[n].find("#shopBar").shopBar(p,p);c.c[n].find("ol a:eq(0)").bind("click",{ok:true,rows:[r],el:h,unitid:0},c.opts.btnLinkClick);c.c[n].find("ol a:eq(1)").bind("click",{ok:false,rows:[r],el:h,unitid:0},c.opts.btnLinkClick);var s=c.c[n].find("ul");var q=0,o=0;for(var k=0;k<r.items.length;k++){var l=r.items[k];l.goods.purchasePrice=l.goods.units[l.type].purchasePrice;l.goods.salePrice=l.goods.units[l.type].salePrice;l.goods.unit=l.goods.units[l.type].cnname;l.goods.num=l.num;l.goods.total=l.goods.salePrice*l.goods.num;q+=l.goods.total;a(utils.replaceTpl(g,l.goods)).appendTo(s);o+=(r.salePrice*l.num)*r.discount;c.c[n].find(".case_org_price").html("<strong>套餐原价:"+iwfTool.toFixed(q,2)+" 元</strong>");c.c[n].find(".case_price").html("<strong>套餐"+r.discount+"折优惠价:"+r.salePrice+" 元</strong>")}}};c.dataRows=[];c.checkClick=function(l){var j=l.data;a(this).toggleClass("glyphicon glyphicon-unchecked");a(this).toggleClass("glyphicon glyphicon-ok");var h=-1;for(var k=0;k<c.dataRows.length;k++){if(j.id==c.dataRows[k].id){h=k;break}}if(a(this).hasClass(".glyphicon-unchecked")){c.dataRows.push(j)}else{c.dataRows.splice(h,1)}};c.getSelected=function(){var j=[];for(var h=0;h<c.ul.length;h++){if(c.ul[h].find(".panel-title i:eq(0)").hasClass("glyphicon-ok")){j.push(c.opts.data[h])}}return j};c.addRow=function(j){var i=j[c.opts.mainField].createtime;var k=new Date();var h=null;if(c.DateDiff_Day(k,i,3)){h=a(utils.replaceTpl(c.opts.tplItem,j)).appendTo(c.c[0])}else{h=a(utils.replaceTpl(c.opts.tplItem,j)).appendTo(c.c[1])}h.bind("click",j,c.opts.rowclick);return h};function d(j,i){var h=parseInt((i-j)/(1000*60*60));return h}c.y2k=function(h){return(h<1000)?h+1900:h};c.DateDiff_Day=function(p,o,q){p=new Date();o=new Date(o.replace(/-/g,"/"));var k=p.getYear()-o.getYear();var i=p.getMonth()-o.getMonth();var l=p.getDate()-o.getDate();var n=new Date();n.setDate(n.getDate()-q);var m=false;var h=Date.UTC(c.y2k(p.getYear()),p.getMonth(),p.getDate(),0,0,0)-Date.UTC(c.y2k(o.getYear()),o.getMonth(),o.getDate(),0,0,0);var j=h/1000/60/60/24;if(j>q){m=true}return m};c.fresh=function(h){c.opts.data=h;c.render()};c.render();return c};a.fn.PackageListEdit=function(l){var g={click:function(m){}};var j=this;j.opts=a.extend(g,l);var j=this;j.opts=a.extend(g,l);var f='<div class="row Goods-item" style="">'+'<div class="col-md-12" style="line-height:30px;">'+'<div style="float:left;"><i class="icon-gift icon-blue"></i> <a href="javascript:void(0);">{cnname}</a></div></div>'+'<ul class="list-group"></ul>'+'<div class="col-md-12" style="line-height:30px;">'+'<div class="col-md-2" ><span class="case_num">套餐数量：0</span></div>'+'<div class="col-md-2" ><span class="case_org_price">原价总计：0</span></div>'+'<div class="col-md-2" ><span class="case_discount">折扣：0</span></div>'+'<div class="col-md-3" ><span class="case_price">套餐优惠价：{price}</span></div></div>'+"</div>";var d='<li class="col-md-12" style="list-style-type:none;padding:0px;">'+'<div class="col-md-1" style="padding-right:0px;height:100px;"> <a href="#" class="thumbnail"><image src="{src}" style="width:80px;height:80px;"  /></a></div>'+'<div class="col-md-11" style="line-height:30px;"><a href="javascript:void(0);">{cnname}</a></div>'+'<div class="col-md-2">销售价格：</div><div class="col-md-1">{salePrice} 元</div><div class="col-md-1">数量：</div><div class="col-md-2">{num} ({unit})</div>'+'<div class="col-md-1">小计：</div><div class="col-md-1">{total} 元</div><div class="col-md-1"></div><div class="col-md-1">评价</div>'+"</li>";var c='<div class="row Goods-item" style="">'+'<div class="col-md-12" style="line-height:30px;">'+'<div style="float:left;"><i class="icon-file-alt icon-blue"></i> <a href="javascript:void(0);">{cnname}</a></div><div class="tool_bar" style="float:right;"></div></div>'+'<div class="col-md-1" style="padding-right:0px;height:100px;"> <a href="#" class="thumbnail"><image src="{src}" style="width:80px;height:80px;"  /></a></div>'+'<div class="col-md-3">销售价格：{salePrice} 元</div><div class="col-md-3">数       量：{num} ({unit})</div>'+'<div class="col-md-3">小计：{total} 元</div><div class="col-md-1">评价</div>'+'<div class="col-md-3">进货价格：<span style="color:red;">{purchasePrice} </span>元</div><div class="col-md-3">自定义价：{definedPrice} 元</div><div class="col-md-2"></div>'+'<div class="col-md-1"></div><div class="col-md-1"></div><div class="col-md-1"></div><div class="col-md-1"></div>'+"</div>";var k='<div class="row case-item">'+'<div class="col-md-12" style="font-weight:bold;min-height:30px;">'+'<div style="float:left;"><i class="icon-file-alt icon-blue"></i> <a  href="javascript:void(0);">{cnname}</a></div>'+'<div class="case-bar" style="float:left;margin-left:20px;"></div>'+"</div>"+'<div class="col-md-2">业务名称</div>'+'<div class="col-md-4">{casecnname}</div>'+'<div class="col-md-2">当前任务</div>'+'<div class="col-md-4"><span style="color:red;">{ActName}</span></div>'+'<div class="col-md-2">主办人</div>'+'<div class="col-md-4">{UserName}</div>'+'<div class="col-md-2">当前任务</div>'+'<div class="col-md-4"><span style="color:red;">{ActName}</span></div>'+'<div class="col-md-2">创建人</div>'+'<div class="col-md-4">{CreatorName}</div>'+'<div class="col-md-2">归属流程</div>'+'<div class="col-md-4">{FlowName}</div>'+'<div class="col-md-2">接收时间</div>'+'<div class="col-md-4">{receDate}</div>'+'<div class="col-md-2">到期时间</div>'+'<div class="col-md-4">{expireDate}</div>'+"</div>";var b='<div class="col-md-2" style="line-height:30px;"><span class="case_org_price">套餐原价：0</span></div><div class="col-md-2" style="line-height:30px;"><span class="case_salePrice">现价：0</span></div><div class="col-md-3" style="line-height:30px;"><span class="case_price">套餐优惠价：{salePrice}</span></div><div class="col-md-1"> </div>';var h='<div class="row" style="height:22px;"><div class="col-lg-1" id="shopBar"></div><div class="col-lg-5"><a id="backBtn" class="btn btn-success" style="width:150px;margin-left:20px;margin-top:10px;margin-bottom:10px;">立刻购买</a><a id="backBtn" class="btn btn-success" style="width:150px;margin-left:20px;margin-top:10px;margin-bottom:10px;">加入购物车</a></div>'+'<div class="col-lg-6"> </div></div>';var i='<div class="panel panel-default">'+'<div class="panel-heading">'+'<h3 class="panel-title"><i style="margin-right:8px;" level={id} class="glyphicon glyphicon-{select}"></i><a level="link1" title="点击查看订单详细" class="order-link" >{cnname}：{autoid}</a>  {createtime}<div class="tool_bar" style="float:right;" id="orderTool"></div></h3>'+"</div>"+'<div class="panel-body">'+'</div><div class="modal-footer"></div>'+"</div>";j.empty();j.empty();j.render=function(){j.ul=[],j.li=[],j.c=[];for(var r=0;r<j.opts.data.length;r++){var q='<a level="link2" class="btn btn-link" style="width:50px;float:left;margin-left:20px;">'+j.opts.aTitle[0]+'</a><span><strong>合计:0元<strong></span><a level="link3" class="btn btn-success" style="width:150px;margin-left:20px;">'+j.opts.aTitle[1]+'</a><a level="link4" class="btn btn-success" style="width:150px;margin-left:20px;">'+j.opts.aTitle[2]+"</a>";var u=j.opts.data[r];u.select="unchecked";j.ul[r]=a(utils.replaceTpl(i,u)).appendTo(j);j.ul[r].find("i:eq(0)").bind("click",u,j.checkClick);j.ul[r].find("h3 .tool_bar").Tool({list:j.opts.list,data:u});var o=j.ul[r].find(".panel-body");var p=0,t=0;for(var n=0;n<u.items.length;n++){var s=u.items[n];s.goods.purchasePrice=s.goods.units[s.type].purchasePrice;s.goods.definedPrice="--";s.goods.salePrice=s.goods.units[s.type].salePrice;s.goods.unit=s.goods.units[s.type].cnname;s.goods.num=s.num;s.goods.total=s.goods.salePrice*s.goods.num;p+=s.goods.total;j.c[n]=a(utils.replaceTpl(c,s.goods));j.c[n].appendTo(o);t+=(u.salePrice*s.num)*u.discount;j.c[n].find(".tool_bar").Tool({list:j.opts.slist,data:{big:u,small:s.goods}})}j.footEl=j.ul[r].find(".modal-footer");a(utils.replaceTpl(b,u)).appendTo(j.footEl);j.footEl.find(".case_org_price").html("<strong>套餐原价:"+iwfTool.toFixed(p,2)+" 元</strong>");j.footEl.find(".case_salePrice").html("<strong>现价:"+iwfTool.toFixed(u.salePrice,2)+" 元</strong>");j.footEl.find(".case_price").html("<strong>套餐"+u.discount+"折优惠价:"+u.salePrice+" 元</strong>")}};j.dataRows=[];j.checkClick=function(p){var n=p.data;a(this).toggleClass("glyphicon glyphicon-unchecked");a(this).toggleClass("glyphicon glyphicon-ok");var m=-1;for(var o=0;o<j.dataRows.length;o++){if(n.id==j.dataRows[o].id){m=o;break}}if(a(this).hasClass(".glyphicon-unchecked")){j.dataRows.push(n)}else{j.dataRows.splice(m,1)}};j.getSelected=function(){var n=[];for(var m=0;m<j.ul.length;m++){if(j.ul[m].find(".panel-title i:eq(0)").hasClass("glyphicon-ok")){n.push(j.opts.data[m])}}return n};j.addRow=function(p){var o=p[j.opts.mainField].createtime;var q=new Date();var m=null;if(j.DateDiff_Day(q,o,3)){m=a(utils.replaceTpl(j.opts.tplItem,p)).appendTo(j.c[0])}else{m=a(utils.replaceTpl(j.opts.tplItem,p)).appendTo(j.c[1])}m.bind("click",p,j.opts.rowclick);return m};function e(o,n){var m=parseInt((n-o)/(1000*60*60));return m}j.y2k=function(m){return(m<1000)?m+1900:m};j.DateDiff_Day=function(u,t,v){u=new Date();t=new Date(t.replace(/-/g,"/"));var p=u.getYear()-t.getYear();var n=u.getMonth()-t.getMonth();var q=u.getDate()-t.getDate();var s=new Date();s.setDate(s.getDate()-v);var r=false;var m=Date.UTC(j.y2k(u.getYear()),u.getMonth(),u.getDate(),0,0,0)-Date.UTC(j.y2k(t.getYear()),t.getMonth(),t.getDate(),0,0,0);var o=m/1000/60/60/24;if(o>v){r=true}return r};j.fresh=function(m){j.opts.data=m;j.render()};j.render();return j}})(jQuery);(function(a){a.fn.TabItem=function(n){var f='<ul class="nav nav-tabs"></ul>',b='<li><a href="#{id}" data-toggle="tab">{title}</a></li>',l='<div id="my-tab-content" class="tab-content"></div>',j='<div class="tab-pane" id="{id}"></div>';var g=a(f).appendTo(this);g.c=a(l).appendTo(this);g.items=[];g.index=0;var c={click:function(i){}};g.opts=a.extend(c,n);function m(o){var p=o.data;g.find("li").removeClass("active");var i=g.find("li:eq(0)").addClass("active");g.c.find(".tab-pane").removeClass("active");g.c.find(".tab-pane:eq(0)").addClass("active");if(p.html){g.find(p.id).load(p.html,function(q){p.load(q)})}if(p.tpl){a(p.tpl).appendTo(g.find(".modal-body"));p.load(null)}g.index=p.index;p.click(p)}for(var d=0,k;k=g.opts.data[d++];){k.index=d-1;var e=a(utils.replaceTpl(b,k)).appendTo(g).bind("click",k,m);var h=a(utils.replaceTpl(j,k)).appendTo(g.c);if(d==1){e.addClass("active");h.addClass("active")}g.items.push(h)}g.fresh=function(){};return g};a.fn.iwfAutoComplete=function(k){var j=a(this);var h=j.wrap('<div style="position:relative;width:'+j.width()+'px;"></div>').parent();h.input=j;h.drop=a('<ul class="dropdown-menu" unselectable="on" style="left:-1px;width:'+(h.input.width()+3)+'px;min-height:30px;max-height:200px;overflow-x:hidden;overflow-y:scroll;display:none;"></ul>').appendTo(h);var f={cssOver:"iwf-over",cssDown:"iwf-down",cssSelect:"iwf-select",data:[]};var b=a.extend(f,k);h.input.bind("focusout",function(){h.drop.hide()});function i(l){h.input.val(l.data.text);h.selectItem=l.data.item;h.selectText=l.data.text;h.drop.hide();if(k.itemClick){k.itemClick(l,l.data.item)}}var c=function(){h.drop.children().remove();h.selectItem=null;h.selectText=null;var l=h.input.val();if(b.getData){b.getData(function(m){d(m,l)},l)}else{d(b.data,l)}};function d(m,l){a.each(m,function(n,q){var r="";if(utils.isString(q)){r=q}else{if(utils.isObject(q)){for(var o in q){r=q[o];break}}}if(r&&r.search(l)>-1){var p=a('<li style="white-space:nowrap;cursor: default;overflow:hidden;border: 1px solid transparent;" unselectable="on" title="'+r+'"><a href="javascript:void(0);">'+r+"</a></li>").appendTo(h.drop);p.bind("mousedown",{item:q,text:r},i)}});if(h.drop.children().length>0){h.drop.height(200);h.drop.show()}else{h.drop.hide()}}var e=function(){if(h.drop.is(":hidden")){c()}else{h.drop.hide()}};var g=function(){h.drop.hide()};h.val=function(l){if(l!=undefined){h.input.val(l)}else{return h.input.val()}};h.input.bind("keyup",c).bind("click",e);h.drop.bind("focusout",g);return h}})(jQuery);(function(a){a.fn.iwfGrid=function(o){var d={cssTitle:"iwf-grid-title",cssContent:"iwf-grid-content",cssSplit:"iwf-grid-split",cssRow:"iwf-grid-row",cssRowSelected:"iwf-grid-row-selected",cssCell:"iwf-grid-cell",cssLV1:"hide640",data:[],columns:[],linkclick:function(p,q){}};var b=a.extend(d,o);this.empty();var i=a(this),j,h;j=i.head=a('<div class="'+b.cssTitle+'"></div>').appendTo(i);j.css({"min-height":b.titleHeight||"32px"});h=i.content=a('<div class="'+b.cssContent+'"></div>').appendTo(i);var g={offsetX:0,tempX:0,isMove:false};i.bind("mousedown",function(p){if(p.button==2){g.tempX=p.clientX;g.isMove=true}}).bind("mousemove",function(p){if(g.isMove){g.offsetX+=p.clientX-g.tempX;g.tempX=p.clientX;if(g.offsetX>0){g.offsetX=0}j.css({"margin-left":g.offsetX+"px"});h.css({"margin-left":g.offsetX+"px"})}}).bind("mouseup",function(p){g.isMove=false});if(b.columns.length==0){var k;if(b.data.length>0&&b.data[0].childrens){k=b.data[0].childrens[0]}else{if(b.data.length>0){k=b.data[0]}}if(k){for(var m in k){b.columns.push({title:m,text:"{"+m+"}",width:"100px"})}}else{return}}function f(q){var p=q.data.children("."+b.cssRow);if(p.is(":hidden")){p.show()}else{p.hide()}}i.resize=function(p,q){if(h&&q){h.height(q-j.height())}};function l(p){p.data.data.tempChecked=this.checked;if(this.checked){p.data.row.addClass(b.cssRowSelected)}else{p.data.row.removeClass(b.cssRowSelected)}}function n(){h.find("input[type='checkbox']").prop("checked",this.checked).change()}function c(p){var q=p.data.row.find("input[type='checkbox']");if(q.length>0){h.find("."+b.cssRowSelected).find("input[type='checkbox']").prop("checked",false).change();q.prop("checked",true).change()}else{h.find("."+b.cssRowSelected).removeClass(b.cssRowSelected);p.data.row.addClass(b.cssRowSelected)}b.linkclick(this,p.data.data)}function e(p,q){a.each(p,function(r,s){var t=a('<div class="'+b.cssRow+'"></div>').appendTo(q);if(r%2!=0){t.addClass("iwf-grid-row-bg")}a.each(b.columns,function(x,v){if(!v.hidden){var A=utils.replaceTpl('<div style="width:'+v.width+';" class="'+b.cssCell+'">'+v.text+"</div>",s,b);var w=a(A).appendTo(t);if(x>1){var u=null;var y="";try{u=a(utils.replaceTpl(v.text,s,b));if(u.length==0){y=utils.replaceTpl(v.text,s,b)}else{y=u.text()}}catch(z){y=""}w.attr("title",y)}if(v.lv){w.addClass(b.cssLV1)}}});t.find("a").bind("click",{row:t,data:s},c);t.find("input[type='checkbox']").bind("change",{row:t,data:s},l)})}i.getSelected=function(){var p=[];a.each(b.data,function(q,r){if(r.childrens){a.each(r.childrens,function(s,t){if(t.tempChecked){p.push(t)}})}else{if(r.tempChecked){p.push(r)}}});return p};i.renderData=function(p){if(p){b.data=p}var q=b.data;h.children().remove();if(q.length>0&&q[0].childrens){a.each(q,function(r,s){var u=a("<div></div>").appendTo(h);var t=a('<div class="'+b.cssSplit+'"><div style="'+utils.getIcon16(24,4)+'display: inline-block;vertical-align:middle;"></div>'+' <div style="display: inline-block;vertical-align:middle;">'+s.text+" ("+s.count+")</div></div>").appendTo(u).bind("click",u,f);e(s.childrens,u);if(b.groupHidden){t.click()}})}else{if(q.length>0){e(q,h)}else{}}};i.render=function(p){j.children().remove();a.each(b.columns,function(r,q){if(!q.hidden){var s=a('<div style="width:'+q.width+';" class="'+b.cssCell+'">'+q.title+"</div>").appendTo(j);if(q.lv){s.addClass(b.cssLV1)}if(q.sortable){q.isDesc=false;if(o.sortIndex==r){switch(q.sorttype){case"desc":s.addClass("sorting_desc");break;case"asc":s.addClass("sorting_asc");break;default:s.addClass("sorting");break}}else{s.addClass("sorting")}s.bind("click",{idx:r,col:q},function(t){o.sortIndex=t.data.idx;if(a(this).hasClass("sorting")){b.columns[t.data.idx].sorttype="desc";b.sort(t.data.idx,t.data.col,false)}else{if(a(this).hasClass("sorting_desc")){b.columns[t.data.idx].sorttype="asc";b.sort(t.data.idx,t.data.col,true)}else{b.columns[t.data.idx].sorttype="desc";b.sort(t.data.idx,t.data.col,false)}}})}}});j.find("input[type='checkbox']").bind("change",n);i.renderData(p)};i.getData=function(){var q=b.data;return q};i.render();return i};a.fn.iTreeTable=function(j){var f={click:function(k){}};var b=a.extend(f,j);this.empty();var g=a(this);g.opts=b;g.opts.setting.view.showLine=false;g.opts.setting.view.addDiyDom=h;function i(l,k,m){g.zTree=a.fn.zTree.init(l,k,m);var o=' <li class="head"><a><div class="divTd" style="width:60%">类型名称</div><div class="divTd" style="width:20%">类型编码</div>'+'<div class="divTd" style="width:10%">是否有效</div><div class="divTd" style="width:10%">操作</div></a></li>';var n=l.find("li");if(n.length>0){d(n.eq(0))}else{l.append(o);l.append('<li ><div style="text-align: center;line-height: 30px;" >无符合条件数据</div></li>')}}function d(k){var m='<li class="head"><a></a></li>';var n=a(m).insertBefore(k);var t=n.find("a");var r=g.opts.config;var o='<div class="divTd" style="width:20%">{title}</div>';var q=0;for(var p=0;p<r.columns.length;p++){var l=r.columns[p];var s=a(utils.replaceTpl(o,l)).appendTo(t);s.css({width:l.width});q+=s.width();if(l.sortable){l.isDesc=false;if(j.config.sortIndex==p){switch(l.sorttype){case"desc":s.addClass("sorting_desc");break;case"asc":s.addClass("sorting_asc");break;default:s.addClass("sorting");break}}else{s.addClass("sorting")}s.bind("click",{idx:p,col:l},function(u){j.config.sortIndex=u.data.idx;if(a(this).hasClass("sorting")){r.columns[u.data.idx].sorttype="desc";r.sort(u.data.idx,u.data.col,false)}else{if(a(this).hasClass("sorting_desc")){r.columns[u.data.idx].sorttype="asc";r.sort(u.data.idx,u.data.col,true)}else{r.columns[u.data.idx].sorttype="desc";r.sort(u.data.idx,u.data.col,false)}}})}}}function h(p,t){var v=15;var r=g.find("#"+t.tId);var m=g.find("#"+t.tId+"_a");var q=g.find("#"+t.tId+"_switch");var l=g.find("#"+t.tId+"_ico");var n=g.find("#"+t.tId+"_span");m.attr("title","");var s=a('<div class="divTd swich fnt" style="width:60%"></div>');s.appendTo(m);s.css({width:g.opts.config.columns[0].width});var k=a(r).find("div").eq(0);q.remove();n.remove();l.remove();k.append(q);k.append(n);var o="<span style='height:1px;display: inline-block;width:"+(v*t.level)+"px'></span>";q.before(o);l.css("margin-top","11px");q.after(l);var u="";u+='<div class="divTd" style="width:20%">'+(t.typecode==null?"":t.typecode)+"</div>";u+='<div class="divTd" style="width:10%">'+(t.status=="1"?"有效":"无效")+"</div>";u+='<div class="divTd" style="width:10%">'+c(t)+"</div>";e(m,t)}function e(l,v){var n='<div class="divTd" style="width:20%">{text}</div>';var p=g.opts.config;for(var o=1;o<p.columns.length;o++){var m=p.columns[o];var u=utils.replaceTpl(n,m);var s=a(utils.replaceTpl(u,v,p)).appendTo(l);s.css({width:m.width});var k=utils.replaceTpl("{text}",m);var t=null;var r="";try{t=a(utils.replaceTpl(k,v,p));if(t.length==0){r=utils.replaceTpl(k,v,p)}else{r=t.text()}}catch(q){r=""}s.attr("title",r);s.find("a").bind("click",v,p.linkclick)}}function c(k){var l="";l+='<input type="button" class="ck" onclick="doEdit(\''+k.tId+"','"+k.id+'\')" value="编辑"/>';l+='<input type="button" class="ck" onclick="doDelete(\''+k.tId+"','"+k.id+"', '"+k.name+'\')" value="删除"/>';return l}i(g,g.opts.setting,g.opts.data);return g.zTree}})(jQuery);(function(a){a.fn.tipForm=function(n){var o='<div class="datetimepicker dropdown-menu"></div>';this.mouseover(function(b){n.flag=2}).mouseout(function(b){n.flag=0});this.bind("click",function(b){});a(document).mousedown(function(b){if(n.flag>0){}else{if(l!=null){l.remove()}l=null}});function p(){l.mouseout(function(b){n.flag=0});l.mouseover(function(){n.flag=2})}if(!n.name){n.name="搜索"}var k={click:function(b){alert(9)}};var l=null;function m(f){if(l){l.remove();l=null;return}else{l={}}l=a(utils.replaceTpl(o,n)).appendTo(a("body"));l.opts=a.extend(k,n);var b=f.offset().top;var c=f.offset().left;l.css("top",b+f.outerHeight()-3);l.css("left",c);l.css("display","block");l.css("z-index",99999);l.outerWidth(f.outerWidth());p();var e={rowclick:function(g){},columns:[{field:"id",title:"",width:40,align:"center"},{field:"key",title:"配置子类",width:80,align:"center"},{field:"name",title:"配置项父类",width:80,align:"center"}]};var d=[{id:2133,key:"test",name:"xiaobao"},{id:2133,key:"tesx",name:"xiaobao"},{id:2133,key:"tesxx",name:"xiaobao"},{id:2133,key:"testt",name:"xiaobao"}];j(n.data,l,n.conf);return l}function j(b,B,F){B.empty();var e=a('<div  style="overflow-y: scroll;"></div>').appendTo(B);var f=a('<table class="iwf-table-gray"></table>').appendTo(e);e.height(n.height);var G=a("<tr></tr>").appendTo(f);for(var I=0;I<F.columns.length;I++){var t=F.columns[I];if(I==0&&l.opts.multiple){var h=a('<td><input type="checkbox"/></td>').appendTo(G);h.find("input").bind("click",function(q){if(a(this).prop("checked")){f.find("tr").addClass("iwf-grid-row-selected");f.find("tr td input").prop("checked",true)}else{f.find("tr").removeClass("iwf-grid-row-selected");f.find("tr td input").prop("checked",false)}})}else{a("<td>"+t.title+"</td>").appendTo(G).width(t.width)}}l.rowCheck=[];for(var I=0;I<b.length;I++){var c=b[I];var D='<tr class="iwf-grid-row"></tr>';var E=a(D).appendTo(f);for(var g=0;g<F.columns.length;g++){var H=F.columns[g];if(g==0&&l.opts.multiple){var h=a('<td><input type="checkbox"/></td>').appendTo(E);h.find("input").bind("click",E,function(q){if(a(this).prop("checked")){q.data.addClass("iwf-grid-row-selected");a(this).prop("checked",true)}else{q.data.removeClass("iwf-grid-row-selected");a(this).prop("checked",false)}})}else{var d="<td>{"+H.field+"}</td>";a(utils.replaceTpl(d,c)).appendTo(E)}}if(!l.opts.multiple){E.bind("click",{ok:true,row:c},i)}else{E.bind("click",c,F.rowclick)}l.rowCheck.push(E)}if(l.opts.multiple){var C=a('<div style="border-top: solid 1px #DDD;padding-top: 5px;"><a class="btn btn-primary">确定</a><a class="btn btn-default">取消</a></div>').appendTo(B);C.find("a").css("border",0).css("margin-left",40).css("margin-right",20);C.find(".btn-primary").bind("click",{ok:true},i);C.find(".btn-default").bind("click",{ok:false},i)}}function i(b){n.click(b);l.remove()}m(this);l.getSelected=function(){var b=[];for(var d=0;d<l.rowCheck.length;d++){var c=l.rowCheck[d];if(c.find("input")[0].checked){b.push(n.data[d])}}return b};return l};a.fn.dropTree=function(m){var n='<div class="datetimepicker dropdown-menu"></div>';this.mouseover(function(b){m.flag=2}).mouseout(function(b){m.flag=0});this.bind("click",function(b){});a(document).mousedown(function(b){if(m.flag>0){}else{if(k!=null){k.remove()}k=null}});function h(){k.mouseout(function(b){m.flag=0});k.mouseover(function(){m.flag=2})}if(!m.name){m.name="搜索"}var j={click:function(b){alert(9)}};var k=null;function l(d){if(k){k.remove();k=null;return}else{k={}}k.opts=a.extend(j,m);k=a(utils.replaceTpl(n,m)).appendTo(a("body"));var b=d.offset().top;var c=d.offset().left;k.css("top",b+d.outerHeight()-3);k.css("left",c);k.css("display","block");k.css("z-index",99999);k.outerWidth(d.outerWidth());h();i(m.data,k,m.setting)}function i(d,b,c){b.empty();var e=a('<ul class="ztree" style="overflow-y: scroll;"></ul>').appendTo(b);e.height(m.height);var f=a.fn.zTree.init(e,c,d);var o=a('<div style="border-top: solid 1px #DDD;padding-top: 5px;"><a class="btn btn-primary">确定</a><a class="btn btn-default">取消</a></div>').appendTo(b);o.find("a").css("border",0).css("margin-left",40).css("margin-right",20);k.zTree=f;function g(p){m.click(p);k.remove()}o.find(".btn-primary").bind("click",{ok:true},g);o.find(".btn-default").bind("click",{ok:false},g)}l(this);return k};a.fn.Dialog=function(j){var f='<div class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">'+'<div class="modal-dialog"><div class="modal-content"><div class="modal-header">'+'<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>'+'<h4 class="modal-title">{title}</h4></div><div class="modal-body"></div><div class="modal-footer">'+'<button type="submit" id="btnYes" class="btn btn-primary">确定</button>'+'<a type="button" id="btnNo" class="btn btn-default" data-dismiss="modal">取消</a>'+"</div></div></div></div>";var i=a(utils.replaceTpl(f,j)).appendTo(this);if(j.width){i.find(".modal-dialog").width(j.width)}if(j.height){i.find(".modal-dialog").height(j.height)}i.modal({backdrop:false});function g(b){i.opts.click(b);if(!i.opts.validate){i.remove()}}i.find("#btnYes").bind("click",{ok:true},g);i.find("#btnNo").bind("click",{ok:false},g);i.find(".close").bind("click",{ok:false},g);var h={};i.opts=a.extend(h,j);i.body=i.find(".modal-body").css("padding-top",0);if(i.opts.html){i.body.load(i.opts.html,function(b){i.opts.load(i.body)})}if(i.opts.tpl){i.body=a(i.opts.tpl).appendTo(i.body);i.opts.load(i.body)}return i}})(jQuery);