Edit D:\rfid\libsystem\page\parameter\js\cir_cirrule.js
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(c<b){return -1}else{if(c>b){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;f<h.length;f++){if(h[f].parentcode){setTreeData(b,h[f],e,h[f].liblevel,f)}else{b.push({id:h[f].code,text:h[f].name,children:getChildrenData(h[f].code,e)});rowNum=0}}$("#location").tree({data:b})},"json")},"json")}function MoRenDiDian(b){if($("#mo_ren_di_dian").length>0){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;f<h.length;f++){for(var e=0;e<textArr.length;e++){var l=textArr[e];if(h[f].group==l){g.push(h[f]);break}}}$("#mo_ren_di_dian").combobox("loadData",g);if(updateRows){setTreeChecked(updateRows.location+",");var d=JSON.parse(updateRows.paramjson);setValue("mo_ren_di_dian",d.mo_ren_di_dian)}},"json")}}function setTreeData(m,n,g,l,h){if(h==undefined&&!m){return}var k=0;if(m.length==0&&h==0){rowNum=parseInt(l)-1;m.push({id:n.code,text:n.name,children:getChildrenData(n.code,g)});textArr.push(n.name)}else{if(l&&parseInt(l)>3){var a=n.completecode.split(",");var f=m;var b=[];for(var e=0;e<a.length-1;e++){for(var d=0;d<f.length;d++){if(f[d].id==a[e]){f=f[d].children;b.push(d);if((parseInt(l)-1)==(b.length+rowNum)){pushTreeChildren(b,m,n,g)}break}}}}else{for(var d=0;d<m.length;d++){if(m[d].id==n.parentcode){k=d;m[d].children.push({id:n.code,text:n.name,children:getChildrenData(n.code,g)});textArr.push(n.name);break}else{var c=m[k].children;setTreeData(c,n,g)}}}}}function pushTreeChildren(e,d,b,c){for(var a=0;a<e.length;a++){d=d[e[a]].children;if(a==e.length-1){d.push({id:b.code,text:b.name,children:getChildrenData(b.code,c)});textArr.push(b.name)}}}function getChildrenData(b,d){var c=[];for(var a=0;a<d.length;a++){if(d[a].libcode==b){c.push({id:d[a].code,text:d[a].name,children:[]})}}return c}function saveRecord(){var a=getJsonData(null,"record");if(!a){openMessageDlg("??????");return}if(verifyRequiredFields()){openMessageDlg("??????????????");return}a.location=getTreeChecked();if(a.showacqloccode){var c=$("#showacqloccode").datagrid("getChecked");if(c.length>20){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<b.length;c++){if(a.indexOf(","+b[c].id+",")>=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<a.length;b++){if(c!=""){c+=","}c+=a[b].id}return c}function cancelCodeDisabled(){var b=$('[get-code="true"]');if(b.length!=0){$("#code").textbox("textbox").attr("disabled",false)}var a=$('[update-readonly="true"]');if(a.length!=0){a.each(function(e,f){$("#"+f.id).textbox("textbox").attr("disabled",false)})}var c=$("#location").tree("getChildren");for(var d=0;d<c.length;d++){$("#location").tree("uncheck",c[d].target)}};
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de