var onCloseCallFunName=undefined;var VPAGEFIN="circulation";var mytimeout=60*1000;var handleStatau=true;var hldFlds=[{code:"barcode",name:"条码号"},{code:"title",name:"题名"},{code:"author",name:"作者"},{code:"isbn",name:"ISBN"},{code:"callno",name:"索书号"},{code:"bellib",name:"所属馆"},{code:"curlib",name:"所在馆"},{code:"bellocal",name:"所属地点"},{code:"curlocal",name:"所在地点"},{code:"price",name:"价格"},{code:"publish",name:"出版社"},{code:"attachment",name:"附件"},{code:"currency",name:"币种"},{code:"status",name:"流通状态"},{code:"mediatype",name:"图书类型"},{code:"data",name:"预留字段"},{code:"uid",name:"图书硬件号"},];var cirContorller=function(){};_myPage.prototype.initPageByParam();_myPage.prototype.initPageByParam=function(){cirContorller.prototype.init();cirContorller.prototype.bind()};cirContorller.prototype.bind=function(){enterEvent("keyword",searchRdrRecord);enterEvent("barcode",searchHoldRecord);circurlationHandler(vType);$("#cirDataGridList").datagrid({onClickRow:onClickEditorRow,})};function searchDataByType(a){handleStatau=false;cleanJsonData("record");$("#cirDataGridList").datagrid("loadData",[]);$(".book-list").html("");if(a=="rdr"){vCirHandlerTip="读者";$(".loan-box").show();$("#barcode").next().hide();$(".loan-barcode-tip").hide();$("#keyword").textbox("textbox").focus().select()}else{vCirHandlerTip="馆藏";$(".loan-box").hide();getFocusBarCode()}$(".cir-handler-title").html(vCirHandlerTip.substr(0,1));$("#cirAppTitle").panel("setTitle",vCirHandlerTip+"查询")}function onClickEditorRow(a,b){if(vType=="cardrenew"){$("#barcode").next().show();$(".loan-barcode-tip").show();setValue("barcode",b.barcode);$("#barcode").textbox("textbox").focus()}}function circurlationHandler(a){handleStatau=true;vType=a;cleanJsonData("record");$("#cirDataGridList").datagrid("loadData",[]);$(".book-list").html("");var b;if(a=="loan"){b="借出";$(".loan-box").show();$("#barcode").next().hide();$(".loan-barcode-tip").hide();$("#keyword").textbox("textbox").focus().select()}else{if(a=="return"){b="还回";$(".loan-box").hide();getFocusBarCode()}else{if(a=="cardrenew"){b="续借";$(".loan-box").show();$("#barcode").next().hide();$(".loan-barcode-tip").hide();$("#keyword").textbox("textbox").focus().select()}}}$(".cir-handler-title").html(b.substr(0,1));$("#cirAppTitle").panel("setTitle",b+"处理")}function getFocusBarCode(){$("#barcode").next().show();$(".loan-barcode-tip").show();$("#barcode").textbox("textbox").focus().select()}cirContorller.prototype.init=function(){$(".showSplit").hide();$("#photourl").attr("src","images/bg.png");var a=$(window).height();var c=$(".loan-table-input").width();var d=a-40;$(".cir-circulation").css("height",d+"px");var b=$("#cirlayout").layout("panel","south");b.panel("resize",{height:(d-240)+"px"});$(".easyui-layout").layout("resize");getLayWHByResize("cirlayoutSouthApp");$(".easyui-panel").panel("resize")};function searchRdrRecord(c){var d={};cleanJsonData("record");$("#cirDataGridList").datagrid("loadData",[]);var b=serverAcsUrl+"reader/getBaseInfo";var a=getValue("keyword");if(!c){if(!a){return openMessageDlg("读者证号不能为空!")}d.rdrno=a}else{if(c=="cirReturn"){return}d.rdrno=a}$.messager.progress({title:"消息提示",msg:"正在处理数据,请稍等..."});$.ajax({type:"post",url:b,data:d,timeout:mytimeout,dataType:"json",error:function(e,g,f){$.messager.progress("close");openMessageDlg("连接异常,数据返回有误!")},success:function(e){$.messager.progress("close");if(e.status=="0"){var f=e.rows[0];setJsonData(null,f);if(handleStatau){getFocusBarCode()}if(parseFloat(f.feeamount)<=0){$("#feeamount").html(f.remark)}getHoldings(f)}else{openMessageDlg(e.message)}}})}function getHoldings(c){var a=c.loandata;if(a){var b=a.split(",");getHoldinfoByHolds(b,0)}}function getHoldinfoByHolds(b,a){if(b.length<=a){return}addCirGridData(b[a],a);a++;getHoldinfoByHolds(b,a)}function addCirGridData(f,b){var e="";e+="