Edit D:\rfid\apache-tomcat-8.5.32\webapps\libsystem\page\iframe\js\iframe_per_subscribeorderper.js
var eidtorGridObject=undefined;var eidtorGridIndex=undefined;var _orderPerObj=function(){};var _configData;var initJson;var _initdata;var autoSelect=true;var locToolbar=[{text:"???",iconCls:"e-icon fa fa-plus",handler:function(){var a={};appendEidtorGridRow(a)}},"-",{text:"???",iconCls:"e-icon fa fa-remove",handler:function(){removeitEidtorGridRow()}}];$(function(){_orderPerObj.prototype.batchno();_initdata=mystorage.get("per_init_data");_configData=mystorage.get("per_config");_frequency=mystorage.get("order_per_frequency");initJson=[{code:"finsources",key:"finsources"},{code:"binding",key:"binding"},{code:"docsources",key:"docsources"},{code:"ncy,orderncy",key:"ncy"},{code:"frequency",key:"frequency"},{code:"mediatype",key:"mediatype"},{code:"pertype",key:"pertype"},{code:"ordertype",key:"perordertype"},{code:"operid",key:"operid"},{code:"location",key:"location",condition:"libcode",value:vLibcode},{code:"bookseller",key:"bookseller",condition:"libcode",value:vLibcode},{code:"libcode",key:"libcode",condition:"code",value:vLibcode}];$("#rerFrequencyNum").combobox({data:_initdata.rows[0].frequency,valueField:"code",textField:"frequency",onLoadSuccess:function(){}});$("#frequency").combobox({onSelect:function(a){if(a!=null&&!autoSelect){setValue("rerFrequencyNum",a.code);setValue("issuenum",$("#rerFrequencyNum").combobox("getText"));_bibPVG.prototype.perRate("",$("#rerFrequencyNum").combobox("getText"))}},onClick:function(b,a){autoSelect=false}});initJson.forEach(function(a,b,c){if(_initdata.rows[0][a.key]){_myPage.prototype.setData(_initdata.rows[0][a.key],a)}});$(".easyui-panel").panel("resize");_orderPerObj.prototype.search();_orderPerObj.prototype.initGrid();$("#ncy").combobox({onChange:function(b,a){_bibPVG.prototype.rate("")},onClick:function(b,a){autoSelect=false}});$("#orderncy").combobox({onChange:function(b,a){_bibPVG.prototype.rate("")},onClick:function(b,a){autoSelect=false}});enterEvent("issuenum",onissuenumPriceEnterFun);enterEvent("price",onPriceEnterFun);enterEvent("orderprice",onOrderPriceEnterFun);enterEvent("yearprice",onyearpriceEnterFun)});_bibPVG.prototype.rateResult=function(a){onOrderPriceEnterFun()};function onyearpriceEnterFun(){var a=getValue("issuenum");if(a>0){setValue("orderprice",parseFloat(getValue("yearprice")/a).toFixed(2))}else{setValue("orderprice",getValue("yearprice"))}}function onPriceEnterFun(){_bibPVG.prototype.rate("")}function onissuenumPriceEnterFun(){_bibPVG.prototype.rate("")}function onOrderPriceEnterFun(){var a=getValue("issuenum");if(a>0){setValue("yearprice",parseFloat(getValue("orderprice")*a).toFixed(2))}else{setValue("yearprice",getValue("orderprice"))}}_bibPVG.prototype.perRateResult=function(){_bibPVG.prototype.setPerYearPrice("yearprice","")};_orderPerObj.prototype.batchno=function(){if($("#batchno").length>0){var b={type:"2",page:"1",rows:"500"};var a=base_path+"par/batchno/page.do";$.post(a,b,function(h){var g=[];for(var e=0;e<h.rows.length;e++){var f=_initdata.rows[0].libcode;for(var c=0;c<f.length;c++){if(f[c].code==h.rows[e].libcode){var d={code:""+h.rows[e].code+"",name:""+h.rows[e].code+"",group:""+f[c].name+""};g.push(d);break}}}$("#batchno").combobox({data:g,valueField:"code",textField:"name",groupField:"group",panelHeight:"200px"})},"json")}};_orderPerObj.prototype.initGrid=function(){eidtorGridObject=$("#location_eidtorgrid");eidtorGridObject.datagrid({iconCls:"e-icon fa fa-table",title:"??????",fit:true,toolbar:locToolbar,fitColumns:true,singleSelect:true,border:true,nowrap:false,striped:true,onClickRow:onClickEditorRow,columns:[[{field:"libcode",title:globalLibName+"???",width:"30%",formatter:onShowLibName,editor:{type:"combobox",options:{valueField:"code",textField:"name",panelHeight:"160px",required:true,editable:false,data:$("#libcode").combobox("getData"),onChange:function(d,c){if(d!=undefined&&d!=c){if(eidtorGridIndex!=undefined){var e=eidtorGridObject.datagrid("getEditor",{index:eidtorGridIndex,field:"location"});var a={key:"location",condition:"libcode",value:d};var b=base_path+"par/common/getInitData.do";$.post(b,a,function(f){try{$(e.target).combobox("loadData",f.rows)}catch(g){}},"json")}}}}}},{field:"location",title:"??????",width:"30%",formatter:onShowLocationNameByMyStorage,editor:{type:"combobox",options:{valueField:"code",textField:"name",panelHeight:"160px",groupField:"group",required:true,editable:false,data:_initdata.rows[0].location}}},{field:"copies",title:"???",width:"15%",editor:{type:"numberbox",options:{required:true}}},{field:"shelfno",title:"?????",width:"25%",editor:{type:"textbox",}}]]})};_orderPerObj.prototype.search=function(){cleanJsonData("record");var a=base_path+"acq/collect/get.do";if(_urlflag=="1"){a=base_path+"lib/biblios/get.do"}var b={};if(parseInt(_id)>0){a=base_path+"per/order/get.do";b.pk=_id}else{if(parseInt(_bibId)>0){b.id=_bibId}}$.post(a,b,function(c){if(c.status=="0"){_orderPerObj.prototype.set(c)}else{openMessageDlg(c.message)}},"json")};_orderPerObj.prototype.set=function(e){var d=mystorage.get("acq_order_per_handler_type");var f=e.rows[0];if(parseInt(_id)>0){autoSelect=true;setJsonData(null,f);var c=f.allocation;if(c){_orderPerObj.prototype.setDataToEidtGird(c)}else{clearGridData("location_eidtorgrid")}$(".orderbib_tip").html("???:???????????????????"+_id+"??")}else{if(_bibId>0&&_type!=0&&d){autoSelect=true;d.id=null;setJsonData(null,d);var c=d.allocation;if(c){_orderPerObj.prototype.setDataToEidtGird(c)}else{clearGridData("location_eidtorgrid")}setValue("ordertype",_type);if(_type=="1"){var a=JSON.parse(_configData.rows[0].paramjson);setComTextVal(a)}setValue("id",_id);$(".orderbib_tip").html("???:?????????????????????????"+_bibId+"??")}else{clearGridData("location_eidtorgrid");_bibPVG.prototype.setVPG(e.rows[0],"");setTextShowStatus(false);setValue("orderno",f.orderno);_orderPerObj.prototype.setTextByConifg();setValue("ordertype","0");setValue("id",_id);autoSelect=false;for(var b=0;b<_initdata.rows[0].frequency.length;b++){if(_initdata.rows[0].frequency[b].name==_frequency){setValue("frequency",_initdata.rows[0].frequency[b].code);break}}$(".orderbib_tip").html("???:?????????????????????????"+_bibId+"??")}}bulidShelfno()};function setComTextVal(a){if(a.order_batchno){setValue("batchno",a.order_batchno);_bibPVG.prototype.getDataByBatchno(a.order_batchno)}if(a.orderyear){setValue("orderyear",a.orderyear)}var b=getCurDateYMD();setValue("paydate",b);setValue("orderdate",b)}function bulidShelfno(){var b=base_path+"per/shelfno/page.do";var a={};a.bibid=_bibId;if(getValue("libcode")){a.libcode=getValue("libcode")}$.post(b,a,function(c){if(c.status=="0"){var d=c.rows[0];if(d){setValue("shelfno",d.shelfno)}else{setValue("shelfno","")}}else{openMessageDlg(c.message)}},"json")}_orderPerObj.prototype.setDataToEidtGird=function(e){clearGridData("location_eidtorgrid");if(e.length>0){var f=JSON.parse(e);for(var d=0;d<f.length;d++){var c={};var b=f[d];var a={};a.libcode=b.libcode;a.location=b.location;a.copies=b.copies;a.shelfno=b.shelfno;appendEidtorGridRow(a)}}};_orderPerObj.prototype.setTextByConifg=function(){var k=JSON.parse(_configData.rows[0].paramjson);for(var d=0;d<initJson.length;d++){var b=initJson[d];if(b.code){if(b.code.indexOf(",")>0){var g=b.code.split(",");for(var c=0;c<g.length;c++){var a=g[c];if(k[a]){setValue(a,k[a])}}}else{if(k[b.code]){setValue(b.code,k[b.code])}}}}if(k.ncy){setValue("orderncy",k.ncy)}if(k.copies){setValue("copies",k.copies)}if(k.setOrderCopies){var e=k.setOrderCopies;if(e&&e.length>0){var h=JSON.parse(e);for(var d=0;d<h.length;d++){var f=h[d];appendEidtorGridRow(f)}}}setValue("libcode",vLibcode);setValue("bibid",_bibId);setComTextVal(k)};_orderPerObj.prototype.save=function(d){acceptEidtorGrid();var g=getJsonData(null,"record");if(!g){openMessageDlg("??????");return}if(!g.copies){openMessageDlg("???????????0??");return}if(parseFloat(g.orderprice)<=0){openMessageDlg("??????????????");return}var p=eidtorGridObject.datagrid("getRows");var h=0;var k="";var a=[];if(p.length>0){for(var f=0;f<p.length;f++){h+=parseInt(p[f].copies);var l={};l.libcode=p[f].libcode;l.location=p[f].location;l.copies=p[f].copies;l.shelfno=p[f].shelfno;a.push(l)}var m;m=new Object();var f;for(f=0;f<p.length;f++){var o=p[f]["location"];if(m[o]==undefined){m[o]=1}else{m[o]+=1}}var n=0;for(var j in m){var c=parseInt(m[j]);if(c>n){n=c}}if(n>1){openMessageDlg("??????,?????????????????????");return}}g.allocation=JSON.stringify(a);if(h>0&&h!=g.copies){$.messager.confirm("??????","????????????????????????????????",function(b){if(b){setValue("copies",h);g.copies=h;_orderPerObj.prototype.saveResult(g)}})}else{_orderPerObj.prototype.saveResult(g)}};_orderPerObj.prototype.saveResult=function(b){var a=getValue("id");var c=base_path+"per/order/insert.do";if(a>0){c=base_path+"per/order/update.do"}onHnadlerSvaeBntScreen("saveOrderBibBnt",true);$.post(c,b,function(e){onHnadlerSvaeBntScreen("saveOrderBibBnt",false);if(e.status=="0"){var d=e.rows[0];parent.orderPerSaveResult(e,d.bibid)}else{openMessageDlg(e.message)}},"json")};function setTextShowStatus(a){}function onShowLocationNameByMyStorage(b,c){var d=_initdata.rows[0].location;if(b){for(var a=0;a<d.length;a++){if(b==d[a].code){return d[a].name}}return b}else{return b}}function orderPerReLoadData(a,e,b,d,c){autoSelect=true;eidtorGridIndex=undefined;_bibId=a;_id=e;_type=b;_urlflag=d;_frequency=c;_initdata=mystorage.get("per_init_data");_configData=mystorage.get("per_config");_orderPerObj.prototype.search()}function colseParentDlg(){parent.colseIframeDlg("suborderper_dlg",null,null)};
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de