var rowNum=0;var textArr=[];var updateRows;$(function(){initLocationTree(vLibcode)});var compare=function(a){return function(e,d){var c=e[a];var b=d[a];if(!isNaN(Number(c))&&!isNaN(Number(b))){c=Number(c);b=Number(b)}if(cb){return 1}else{return 0}}}};function initLocationTree(){var b=[];var c={key:"location",condition:"libcode",value:vLibcode};var a=base_path+"par/common/getInitData.do";c.fmt="entity";$.post(a,c,function(d){var e=d.rows;c={key:"libcode",condition:"code",value:vLibcode};a=base_path+"par/common/getInitData.do";c.fmt="entity";$.post(a,c,function(j){var g=0;var h=j.rows;console.log(h.sort(compare("liblevel")));for(var f=0;f0){var a=base_path+"par/common/getInitData.do";var c={key:"location",condition:"libcode",value:vLibcode};$.post(a,c,function(k){var h=k.rows;var g=[];for(var f=0;f3){var a=n.completecode.split(",");var f=m;var b=[];for(var e=0;e20){openMessageDlg("显示的馆藏地点条数不能超过20条!");return}}if(a.showrdrtype){var c=$("#showrdrtype").datagrid("getChecked");if(c.length>20){openMessageDlg("显示的读者类型条数不能超过20条!");return}}var b=controller_url+operation;$.post(b,a,function(d){openMessageDlg(d.message);if(d.status=="0"){closeWin(d);loadGridData(d)}},"json")}function updateRecord(e,c){if(!c){c=getRow()}if(isHigherLibcode(c.libcode)){$("#saveRecord").linkbutton({disabled:true});_myPage.prototype.reSetToComboxItem()}else{$("#saveRecord").linkbutton({disabled:false});_myPage.prototype.reSetToComboxItem(vLibcode)}operation="update.do";var b=getRowPK();if(!b){return}openWin(c);var a=controller_url+"get.do";var d={pk:b};$.post(a,d,function(g){var f=g.rows[0];setTreeChecked(f.location+",");setJsonData(null,f);updateRows=f;setCodeDisabled()},"json")}function setTreeChecked(a){a=","+a;var b=$("#location").tree("getChildren");for(var c=0;c=0&&a.indexOf(",")>=0){$("#location").tree("check",b[c].target)}else{$("#location").tree("uncheck",b[c].target)}}}function getTreeChecked(){var a=$("#location").tree("getChecked");var c="";for(var b=0;b