var onCloseCallFunName=undefined;var VPAGEFIN="circulation";var wtrdrid=0;var initJson;var cirContorller=function(){};var opacLink;_myPage.prototype.initPageByParam=function(){cirContorller.prototype.init();cirContorller.prototype.bind()};cirContorller.prototype.bind=function(){enterEvent("keyword",searchRdrRecord);enterEvent("barcode",searchHoldRecord);circurlationHandler(vType);autoSearchInfo()};cirContorller.prototype.init=function(){getOpacConfig();$(".showSplit").hide();$("#photourl").attr("src","images/bg.png");cirContorller.prototype.initConfig();cirContorller.prototype.initView()};var xy_stop=false;function showXinYongCurTime(){var a=parseInt($("#xinYongInfoTime").html());if(a-1<0){$("#xinYongDlg").dialog("close")}else{$("#xinYongInfoTime").html((a-1));if(!xy_stop){setTimeout(showXinYongCurTime,1000)}}}function wtLoanBook(){$("#wtLoanBookDlg").dialog("open");setTimeout(function(){$("#wtCardRdrno").textbox("textbox").focus().select();$(".wt-rdr-info").html("");$(".wt-rdr-img").html("");wtrdrid=0},500);enterEvent("wtCardRdrno",searchWtReader)}function wtLoanBookOk(){$.messager.confirm("提示消息","您确定要进行委托借出处理吗?",function(a){if(a){$("#wtLoanBookDlg").dialog("close");circurlationHandler("loan");$(".cir-handler-tip").html("委托借出处理");$("#keyword").textbox("textbox").focus().select()}})}function searchWtReader(){$(".wt-rdr-info").html("");$(".wt-rdr-img").html("");var a=base_path+"cir/circulation/checkReaderBeforeLoan.do";var b={};b.rdrno=getValue("wtCardRdrno");if(!b.rdrno){return openCirMessageDlg("读者证号不能为空",function(){$("#wtCardRdrno").textbox("textbox").focus().select()})}$.ajax({type:"POST",url:a,data:b,dataType:"json",error:function(c,e,d){},success:function(f){if(f.status=="0"){var k=f.rows[0];wtrdrid=k.id;var e="";var d=[{code:"name",name:"姓名",color:"red"},{code:"rdrno",name:"证号"},{code:"libcode",name:"开户馆",color:"red"},{code:"rdrtype",name:"读者类型"},{code:"status",name:"读者状态"},{code:"maxloan",name:"可借数"},{code:"unit",name:"工作单位"}];for(var c=0;c"+d[c].name+":";var h=k[d[c].code];if(h){if(d[c].code=="status"){h=onShowRdrStatusNameByLength(h)}else{if(d[c].code=="libcode"){h=onShowLibName(h)}else{if(d[c].code=="rdrtype"){h=onShowRrdTypeName(h)}}}e+=h}else{}e+=""}$(".wt-rdr-info").html(e);var g=base_path+"lib/images/list.do";var j={};j["limit[0].condition"]="code";j["limit[0].value"]=k.id;j["limit[1].condition"]="type";j["limit[1].value"]="0";$.post(g,j,function(i){if(i.rows.length>0){$(".wt-rdr-img").html('')}else{$(".wt-rdr-img").html("
暂无照片
")}},"json")}else{return openCirMessageDlg(f.message,function(){$("#wtCardRdrno").textbox("textbox").focus().select()})}}})}function xinYongStop(){var a={};var b=base_path+"cir/reader/stopSrchZhima.do";$.post(b,a,function(c){},"json");$("#xinYongDlg").dialog("close");xy_stop=true}function xinYongLoan(){var a={};var b=base_path+"cir/reader/getZhimaQRCode.do";$.post(b,a,function(c){if(c.status=="0"){if(c.status=="0"){var d=c.rows[0];$("#qrcode").html("");$("#qrcode").qrcode({width:180,height:180,text:d.url});$("#xinYongInfo").html("请用支付宝在
30】秒内扫描二维码");$("#xinYongDlg").dialog("open");xy_stop=false;showXinYongCurTime();searchRdrRecord(null,"rdrno","out_trans_no="+d.out_trans_no)}}else{openMessageDlg(c.message)}},"json")}function getOpacConfig(){var a={type:"opac"};var b=base_path+"lib/config/page.do";$.post(b,a,function(e){if(e.status=="0"){if(e.status=="0"){var f=e.rows[0];var c=JSON.parse(f.paramjson);var d=window.location.href;if(d.indexOf(c.elibww)>-1){opacLink=c.opacww}else{if(d.indexOf(c.elibnw)>-1){opacLink=c.opacnw}}}}else{openMessageDlg(e.message)}},"json")}cirContorller.prototype.initConfig=function(){initJson=[{key:"rdrtype"},{code:"libcode,biblibcode,curlibcode,formatdesign_libcode",key:"libcode"},{code:"rdrstatus",key:"rdrstatus"},{code:"finsearchfintype",key:"fintype"},{code:"finsearchrectype",key:"rectype"},{code:"finsearchpayway",key:"payway"},{code:"formatdesign_operid",key:"operid"},];_myPage.prototype.getLoadData(initJson)};_myPage.prototype.getLoadSuccess=function(a,b){_fmtGridDataRows=a;getPageConfig("page_type",callSetParaResult,"cirLoanRetu")};cirContorller.prototype.initView=function(){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("cirlayoutSouth");$(".easyui-panel").panel("resize")};cirContorller.prototype.config=function(){var a="../circulation/com/cir_pageconfig.jsp";var b=$("#pageconfig_setpara_dlg").dialog({href:a,onLoad:function(){cirConfig.prototype.init()}}).dialog("open")};function noCardCheck(){$("#noCardDlg").dialog("open");toNoCardRdrno();enterEvent("noCardRdrno",toNoCardPwd);enterEvent("noCardPwd",checkNoCardRdr);setValue("noCardRdrno","");setValue("noCardPwd","")}function toNoCardRdrno(){$("#noCardRdrno").textbox("textbox").focus().select()}function toNoCardPwd(){$("#noCardPwd").textbox("textbox").focus().select()}function checkNoCardRdr(){var a=base_path+"cir/reader/noCardCir.do";var b={};b.rdrno=getValue("noCardRdrno");b.password=getValue("noCardPwd");if(!b.rdrno){return openCirMessageDlg("读者证号不能为空",toNoCardRdrno)}if(!b.password){return openCirMessageDlg("读者密码不能为空",toNoCardPwd)}$.post(a,b,function(c){if(c.status=="0"){$("#noCardDlg").dialog("close");setValue("keyword",c.rows[0].rdrno);searchRdrRecord(null,"rdrno")}else{openCirMessageDlg(c.message,toNoCardRdrno)}},"json")}function cirRdrList(){$("#cirRdrListDlg").dialog("open");var a=mystorage.get("cir_log_rdrlist");var c="
暂无操作记录
";if(a){c="";for(var b=a.length;b>0;b--){c+="
读者姓名:"+a[b-1].name+"
"}}$(".cirRdrListBox").html(c)}function cirRdrListOnClick(a){$("#cirRdrListDlg").dialog("close");setValue("keyword",a);searchRdrRecord(null,"rdrno")}function addCirRrdList(e){var f=e.rows[0];if(!f){return}var b=mystorage.get("cir_log_rdrlist");var a;if(!b){b=[];a={rdrno:f.rdrno,name:f.name,time:showCurTime()}}else{var d=false;for(var c=0;c"+d+"");var c=onShowLocationName(b.location);$("#biblocation").html("
"+c+"
");if(vType=="return"||vType=="barrenew"){getFocusHoldins()}}function onDblClickCirDataGridListRow(a,b){if(vType=="cardrenew"){openConfirmDlg("您确定要条码号为["+addStyleHtmlNoSplit(b.barcode)+"]的借出数据,进行续借操作吗?",null,renewBookRecordResult,null)}else{if(vType=="destory"){openConfirmDlg("您确定要条码号为["+addStyleHtmlNoSplit(b.barcode)+"]的借出数据,进行污损处理吗?",null,destoryBookRecordResult,null)}else{if(vType=="lost"){$(".lost-dlg-msg").html("您确定要条码号为["+addStyleHtmlNoSplit(b.barcode)+"]的借出数据,进行丢失处理吗?");$("#lostConfirmSelectDlg").dialog("open")}}}}function lostBookFinApp(){$(".lost-book-processfe").hide();$(".lost-book-fin").show();$(".lost-book-change").hide();$("#lostConfirmSelectDlg").dialog("close");lostBookRecordResult("fin")}function lostBookChangeApp(){$(".lost-book-fin").hide();$(".lost-book-change").show();$("#lostConfirmSelectDlg").dialog("close");lostBookRecordResult("barcode")}function circurlationHandler(a){$(".returndate-div").hide();$("#photourl").attr("src","images/bg.png");$(".cir-handler-title").show();$(".rdr-image").hide();$(".renew-table").hide();wtrdrid=0;vType=a;var c;var b;if(a=="loan"){c="借";b="借出";setValue("rdrid","");setValue("keyword","");cleanJsonData("record");$(".renew-table").show()}else{if(a=="return"){c="还";b="还回"}else{if(a=="cardrenew"){c="续";b="按证续借";$(".renew-table").show()}else{if(a=="barrenew"){c="续";b="按书续借"}else{if(a=="destory"){c="污";b="污损"}else{if(a=="lost"){c="丢";b="丢失"}else{if(a=="close"){c="闭";b="闭馆还书"}}}}}}}$(".cir-handler-tip").html(b+"处理");$(".cir-handler-title").html(c);focusToTextByType(a)}function searchRdrRecord(f,a,d){setValue("rdrid","");if(!f){$("#biblibcode").html("");$("#biblocation").html("");cleanJsonData("record")}var b=base_path+"cir/circulation/checkReaderBeforeLoan.do";var e={};if(vType=="cardrenew"){e.optype="renew"}if(!f){if(getValue("keyword").length==0){if(!a||!d){return}}if(a){if(d){e[a]=d}else{e[a]=getValue("keyword")}}else{if(getValue("keyword").length==18&&(cirConfigParamjson&&cirConfigParamjson.idcardsearch&&cirConfigParamjson.idcardsearch=="1")){var c=getValue("keyword").toString().substr(0,2);if(c!="28"){e.idcard=getValue("keyword")}else{e[""+getValue("index")+""]=getValue("keyword")}}else{e[""+getValue("index")+""]=getValue("keyword");if(getValue("index")=="name"){return getReaderListByName()}}}}else{b=base_path+"cir/reader/getFirstReader.do";e.id=f.rdrid}$.ajax({type:"POST",url:b,data:e,dataType:"json",error:function(g,i,h){},success:function(g){$("#xinYongDlg").dialog("close");$(".showSplit").show();var h=g.rows[0];finrdrtype=null;if(g.status=="3100"||(g.status=="0"&&h.debt&&h.debt>0)){finrdrtype=h.rdrtype;if(h.debt>0){if(vType=="loan"&&(cirConfigParamjson&&cirConfigParamjson.allloanfin&&cirConfigParamjson.allloanfin=="1")){$("#fin_debt_dlg").window("open");searchDepositGridList(h,"debt")}else{debtIsDiglogWin(h)}}searchRdrRecordResult(g)}else{if(g.status=="0"){getFocusBarCode();searchRdrRecordResult(g)}else{if(g.total>0){searchRdrRecordResult(g)}if(g.status!="3103"){openCirMessageDlg(g.message,getFocusReader)}}}if(g.total>0){getImageByCode(h.id,"0","photourl",null,"circulation");addCirRrdList(g)}}})}var returnDebt=false;function debtIsDiglogWin(d,b){if(vType!="return"||(vType=="return"&&(cirConfigParamjson&&cirConfigParamjson.handlerfin&&cirConfigParamjson.handlerfin=="0"))){if(vType=="return"&&(cirConfigParamjson&&cirConfigParamjson.allretrufin&&cirConfigParamjson.allretrufin=="1")){var a=base_path+"hld/holding/list.do";var c={};c["limit[0].condition"]="rdrid";c["limit[0].value"]=d.id;c["limit[1].condition"]="returndate";c["limit[1].typeHandler"]="4";c["limit[1].value"]=getCurDateYMD();$.post(a,c,function(e){if(e.status=="0"){if(e.rows.length==0){$("#fin_debt_dlg").window("open");searchDepositGridList(d,"debt")}}},"json")}else{var a=base_path+"par/readertype/get.do";var c={};c.pk=finrdrtype;$.post(a,c,function(g){if(g.status=="0"){var h=g.rows[0];var e=JSON.parse(h.paramjson);var f=parseFloat($("#debt").html());if(vType=="loan"&&e&&e.qian_kuan_ke_jie_e&&parseFloat(e.qian_kuan_ke_jie_e)>f){getFocusBarCode()}else{$("#fin_debt_dlg").window("open");searchDepositGridList(d,"debt")}}else{getFocusReader()}},"json")}}}function getNotReturnBookNum(b){var a=base_path+"hld/holding/list.do";var c={};c["limit[0].condition"]="rdrid";c["limit[0].value"]=b;c["limit[1].condition"]="returndate";c["limit[1].typeHandler"]="4";c["limit[1].value"]=getCurDateYMD();$.post(a,c,function(d){if(d.status=="0"){alert(d.rows.length)}},"json")}function getReaderListByName(){var a=base_path+"cir/reader/list.do";var b={};b["limit[0].condition"]=getValue("index");b["limit[0].value"]=getValue("keyword");$.post(a,b,function(c){if(c.status=="0"){if(c.total>1){$("#rdrDataGridList").datagrid("loadData",c.rows);$("#rdrListDlg").dialog("open")}else{if(c.total>0){var d=c.rows[0];searchRdrRecord(null,"id",d.id)}else{openCirMessageDlg("未找到合适的读者!",getFocusReader)}}}else{openCirMessageDlg("未找到合适的读者!",getFocusReader)}},"json")}function selectRdrByRdrList(a){var b;if(a){b=a}else{b=$("#rdrDataGridList").datagrid("getSelected");if(!b){return openMessageDlg("请选择一条读者信息!")}}searchRdrRecord(null,"id",b.id);$("#rdrListDlg").dialog("close")}function onDblClickRdrDataGridListRow(a,b){selectRdrByRdrList(b)}function searchRdrRecordResult(a){var b=a.rows[0];setJsonData(null,b);setValue("rdrstatus",b.status);setValue("rdrid",b.id);setValue("rdrlibcode",b.libcode);getCirDataGridList(b.id)}function searchHoldRecord(){var a=base_path+"hld/holding/getHoldingWithBib.do";var b={};if(getValue("barcode").length==0){return circurlationHandler("loan")}b.barcode=getValue("barcode");$.post(a,b,function(c){if(c.status=="0"){var d=c.rows[0];var f=onShowLibName(d.libcode);$("#biblibcode").html("
"+f+"
");var e=onShowLocationName(d.location);$("#biblocation").html("
"+e+"
");setJsonData(null,d);cirHandlerApp(d)}else{openCirMessageDlg(c.message,getFocusHoldins)}},"json")}function cirHandlerApp(b){if(vType=="loan"){if(b.attachment&&(cirConfigParamjson&&cirConfigParamjson.attach&&cirConfigParamjson.attach=="1")){attachmentLoanBook(b)}else{loanBook()}}else{if(vType=="return"){if((b.hldattach&&b.hldattach.indexOf("借出")>-1)&&(cirConfigParamjson&&cirConfigParamjson.attach&&cirConfigParamjson.attach=="1")){attachmentReturnBook(b)}else{returnBook(b)}}else{if(vType=="barrenew"){barRenewBook()}else{if(vType=="close"){var a=getValue("return_date");if(a.length==0){return openMessageDlg("请设置闭馆还书日期!")}returnBook(a)}}}}}function attachmentReturnBook(a){$(".attc-loan").hide();$(".attc-return").show();$(".attachment-tip").html("此读者借有图书附件,需要读者还回图书附件!");$(".attachment-content").html(a.attachment);$("#attachmentDlg").window("open")}function returnBookByAttachment(){$("#attachmentDlg").dialog("close");var d=$(".attachment-content").html();var b=base_path+"cir/circulation/return.do";var c={};var a=getValue("barcode");if(a.length==0){return openCirMessageDlg("条码号不能为空",getFocusHoldins)}c.barcode=a;$.post(b,c,function(e){if(e.status=="0"){if(d){updateHldAttach(a,d)}var f=e.rows[0];updateDataGirdList(f);if(parseInt(getValue("curloan"))>0){setValue("curloan",parseInt(getValue("curloan"))-1)}getFocusHoldins();if(f.status=="3"){openCirMessageDlg(e.message+",该书已经被预约,请下架放到预约处!")}}else{openCirMessageDlg(e.message,getFocusHoldins)}},"json")}function attachmentLoanBook(a){if(a.status=="2"){return openCirMessageDlg("此条码号已是借出状态",getFocusHoldins)}$(".attc-loan").show();$(".attc-return").hide();$(".attachment-tip").html("附件信息,询问读者是否需要借图书附件?");$(".attachment-content").html(a.attachment);$("#attachmentDlg").window("open")}function loanBookByAttachment(){$("#attachmentDlg").dialog("close");var a=$(".attachment-content").html();loanBook(a)}function loanBook(d){$("#attachmentDlg").dialog("close");var b=base_path+"cir/circulation/loan.do";var c={};if(getValue("rdrno").length==0){return openCirMessageDlg("读者证号不能为空",getFocusReader)}var a=getValue("barcode");c.rdrno=getValue("rdrno");c.barcode=a;$.messager.progress({title:"流通处理",msg:"正在处理数据,请稍等..."});if(wtrdrid>0){c.wtrdrid=wtrdrid}$.post(b,c,function(e){$.messager.progress("close");if(e.status=="0"){if(d){updateHldAttach(a,d)}var f=e.rows[0];updateDataGirdList(f);setValue("curloan",parseInt(getValue("curloan"))+1)}else{openCirMessageDlg(e.message,getFocusHoldins)}},"json")}function updateHldAttach(a,d){var b=base_path+"hld/holding/update.do";var c={};c.barcode=a;if(vType=="loan"){c.hldattach="<附件:"+d+",状态:借出>"}else{if(vType=="return"){c.hldattach="<附件:"+d+",状态:还回>"}}$.post(b,c,function(e){console.log(e)},"json")}function returnBook(b){var a=base_path+"cir/circulation/return.do";var c={};if(getValue("barcode").length==0){return openCirMessageDlg("条码号不能为空",getFocusHoldins)}if(b){c.return_date=b}c.barcode=getValue("barcode");$.messager.progress({title:"流通处理",msg:"正在处理数据,请稍等..."});$.post(a,c,function(d){$.messager.progress("close");if(d.status=="0"){var e=d.rows[0];updateDataGirdList(e);if(parseInt(getValue("curloan"))>0){setValue("curloan",parseInt(getValue("curloan"))-1)}if(e.rdrid){setValue("rdrid",e.rdrid)}getFocusHoldins();if(e.status=="3"){openCirMessageDlg(d.message+",该书已经被预约,请下架放到预约处!")}}else{openCirMessageDlg(d.message,getFocusHoldins)}},"json")}function barRenewBook(){if(getValue("barcode").length==0){return openCirMessageDlg("条码号不能为空",getFocusHoldins)}renewBookRecordResult(getValue("barcode"))}function renewBookRecordResult(a){var b=base_path+"cir/circulation/renew.do";var d={};if(a){d.barcode=a}else{var c=$("#cirDataGridList").datagrid("getSelected");d.barcode=c.barcode}$.post(b,d,function(e){if(e.status=="0"){var f=e.rows[0];updateDataGirdList(f)}else{openCirMessageDlg(e.message,getFocusHoldins)}},"json")}function destoryBookRecordResult(){var a=$("#cirDataGridList").datagrid("getSelected");setValue("bibPrice",a.price);setValue("destoryMoney","");$("#destoryHandlerDlg").window("open")}function onOpenDestoryDlg(){$("#destoryMoney").textbox("textbox").focus()}function destoryBook(){if(getValue("destoryMoney")>0){var c=$("#cirDataGridList").datagrid("getSelected");var a=base_path+"cir/circulation/damage.do";var b={};b.barcode=c.barcode;b.damageMoney=getValue("destoryMoney");$.post(a,b,function(d){if(d.status=="0"){$("#destoryHandlerDlg").window("close");var e=d.rows[0];updateDataGirdList(e)}else{openCirMessageDlg(d.message,getFocusHoldins)}},"json")}else{openMessageDlg("要设置的污损罚款必须大于0")}}var lostFlag;function lostBookRecordResult(a){setValue("bookprocessfee","");lostFlag=a;if(a=="fin"){var b=$("#cirDataGridList").datagrid("getSelected");setValue("lostBibPrice",b.price);setValue("curlostRate","");getLostFinRate()}else{}if(cirConfigParamjson&&cirConfigParamjson.bookprocessfee&&cirConfigParamjson.bookprocessfee>0){$(".show-gbf-text").html("丢失需要交工本费["+cirConfigParamjson.bookprocessfee+"]");$(".lost-book-processfe").show()}$("#lostHandlerDlg").window("open")}function getLostFinRate(){var c=$("#cirDataGridList").datagrid("getSelected");var a=base_path+"cir/circulation/getLoanRule.do";var b={};b.doctype=c.doctype;b.curlocation=c.curlocation;b.senddate=c.senddate;b.rdrtype=getValue("rdrtype");$.post(a,b,function(e){if(e.status=="0"){var f=e.rows[0];var d=JSON.parse(f.paramjson);setValue("lostMinRate",d.zui_xiao_fa_bei);setValue("lostMaxRate",d.zui_da_fa_bei);setValue("curlostRate",d.mo_ren_fa_bei)}else{openCirMessageDlg(e.message,getFocusHoldins)}},"json")}function onOpenLostDlg(){$("#curlostRate").textbox("textbox").focus()}function lostBook(){var f=$("#cirDataGridList").datagrid("getSelected");if(lostFlag=="fin"){var d=parseInt(parseFloat(getValue("curlostRate")).toFixed(2)*100);var c=parseInt(parseFloat(getValue("lostMinRate")).toFixed(2)*100);var b=parseInt(parseFloat(getValue("lostMaxRate")).toFixed(2)*100);if(d>=c&&d<=b){var a=base_path+"cir/circulation/lost.do";var e={};e.barcode=f.barcode;e.rate=getValue("curlostRate");if(cirConfigParamjson&&cirConfigParamjson.bookprocessfee&&cirConfigParamjson.bookprocessfee>0){e.bookprocessfee=cirConfigParamjson.bookprocessfee}$.post(a,e,function(g){if(g.status=="0"){$("#lostHandlerDlg").window("close");var h=g.rows[0];updateDataGirdList(h)}else{openCirMessageDlg(g.message,getFocusHoldins)}},"json")}else{openMessageDlg("要设置的罚款倍率必须大于等于最小罚款倍率并且小于等于最大罚款倍率")}}else{var a=base_path+"cir/circulation/lost.do";var e={};e.barcode=f.barcode;e.newbarcode=getValue("newbarcode");if(!e.newbarcode){openMessageDlg("新条码不能为空!");return}if(cirConfigParamjson&&cirConfigParamjson.bookprocessfee&&cirConfigParamjson.bookprocessfee>0){e.bookprocessfee=cirConfigParamjson.bookprocessfee}$.post(a,e,function(g){if(g.status=="0"){$("#lostHandlerDlg").window("close");var h=g.rows[0];updateDataGirdList(h)}else{openCirMessageDlg(g.message,getFocusHoldins)}},"json")}}function insertCirResultDataGridListRow(f,e,c){var d;if(!e){var a="";if(f.debt_1>0){a+="有图书过期["+f.overdays+"]天,共产生罚款["+f.debt_1+"]元。"}if(f.stopdate&&f.stopdate>0){a+="有图书过期["+f.overdays+"]天,停借到["+f.stopdate+"]。"}if(f.debt_2>0){a+="污损处理,共产生罚款["+f.debt_2+"]元。"}if(f.debt_3>0){a+="丢失处理,共产生罚款["+f.debt_3+"]元。"}if(f.debt_1>0||f.debt_2>0||f.debt_3>0){f.id=f.rdrid}var b="";if(f.opertype.indexOf("借出")>-1){b="color: #ee7621;";if(cirConfigParamjson&&cirConfigParamjson.musictip&&cirConfigParamjson.musictip=="1"){loanMusic()}}else{if(f.opertype.indexOf("还回")>-1){b="color: #00CD66;";if(cirConfigParamjson&&cirConfigParamjson.musictip&&cirConfigParamjson.musictip=="1"){if(f.over_bonus){overdueMusic()}else{returnMusic()}}}else{b="color: #ff66d5;"}}if($("#jifenchuli").length>0){if(f.bonus){a+="获得"+f.bonus+"分。"}if(f.over_bonus){a+="超期处罚"+f.over_bonus+"分。"}if(f.bonus_message){a+=""+f.bonus_message+""}}d="["+f.opertype+"]—{"+f.returndate+"(还)}"+a+"—{"+f.rdrno+":"+f.name+"}—{"+f.barcode+":"+f.callno+"—"+f.title+":"+f.author+"}"}else{b="color: #ff66d5;";d="[续借]-{"+c+":"+e.message+"}"}f.note='
'+d+"
";$("#cirResultDataGridList").datagrid("insertRow",{index:0,row:f})}function updateDataGirdList(a){searchRdrRecord(a);insertCirResultDataGridListRow(a);getFocusBarCode()}function getCirDataGridList(b){checkedItems=[];getSepCirDataGridList(b);var a=base_path+"hld/holding/listHoldingWithBib.do";var c={};clearGridData("cirDataGridList");c.rows=10;c.page=1;c.rdrid=b;c.orderBy=" (loandate*1000000+loantime) desc ";$("#cirDataGridList").datagrid({url:a,queryParams:c,onLoadSuccess:function(e){var d=$("#cir_tabsGrid").tabs("getTab",0);updateTabsTitle(d,"现借列表",e)},method:"post"})}function getSepCirDataGridList(b){createSepGridList();var a=base_path+"cir/speloan/pageCurLoan.do";var c={};clearGridData("sepDataGridList");c.rows=10;c.page=1;c.rdrid=b;$("#sepDataGridList").datagrid({url:a,queryParams:c,onLoadSuccess:function(e){var d=$("#cir_tabsGrid").tabs("getTab",1);updateTabsTitle(d,"其他借阅列表",e)},method:"post"})}function updateTabsTitle(a,c,b){if(b.total>0){c=""+c+'('+b.total+")"}$("#cir_tabsGrid").tabs("update",{tab:a,options:{title:c}})}function getFocusByPara(){if(cirConfigParamjson&&cirConfigParamjson.barcodetordrno){var b=cirConfigParamjson.barcodetordrno;if(b>0){var a=parseInt(b);setTimeout(getFocusBarcodeToRdrno,a)}}}function getFocusBarcodeToRdrno(){circurlationHandler("借出")}function focusToTextByType(a){if(a=="return"||a=="barrenew"||a=="close"){$("#index").next().hide();$("#keyword").next().hide();getFocusBarCode()}else{$("#keyword").next().show();$("#index").next().show();$("#barcode").next().hide();$(".loan-barcode-tip").hide();$("#keyword").textbox("textbox").focus().select()}}function getFocusBarCode(){if(vType=="return"||vType=="barrenew"||vType=="loan"||vType=="close"){$("#barcode").next().show();$(".loan-barcode-tip").show();getFocusHoldins();if(vType=="close"){$(".returndate-div").show()}}}function getFocusHoldins(){$("#barcode").textbox("textbox").focus().select();if(vType=="return"&&cirConfigParamjson&&(cirConfigParamjson.retubarcode=="0"||!cirConfigParamjson.retubarcode)){setValue("barcode","")}}function getFocusReader(){$("#keyword").textbox("textbox").focus().select();setValue("barcode","");$("#barcode").next().hide();$(".loan-barcode-tip").hide()}function openCirMessageDlg(b,a){$("#circulationTipDlg").dialog("open");$(".circulation-message-body").html(b);$(".iKnow-close").focus();onCloseCallFunName=a}function onCloseCirTipDlg(){if(onCloseCallFunName){onCloseCallFunName()}}function iKnow(){$("#circulationTipDlg").dialog("close")}function onsearchRdrBarcode(){clearGridData("rdrBarcodeDataGridList,holdBarcodeDataGridList");var a=base_path+"par/common/getInitData.do?key=barformat&condition=type&value=1";var b={};$("#rdrBarcodeDataGridList").datagrid({url:a,queryParams:b,onLoadSuccess:function(c){},method:"post"});a=base_path+"par/common/getInitData.do?key=barformat&condition=type&value=0";var b={};$("#holdBarcodeDataGridList").datagrid({url:a,queryParams:b,onLoadSuccess:function(c){},method:"post"})}function callSetParaResult(c){if(c.status=="0"){var b=c.rows[0];var a=JSON.parse(b.paramjson);setValue("index",a.initindex);setJsonData("page_",a);setWebSocket(a)}}function onJumpRdrPage(){if(getValue("keyword").length>0){mystorage.set("rdr_index",getValue("index"));mystorage.set("rdr_keyword",getValue("keyword"))}if(getValue("rdrid").length>0){mystorage.set("rdr_index","id");mystorage.set("rdr_keyword",getValue("rdrid"))}parent.addTab("读者数据管理","circulation/new_reader.jsp","vcard","4201","no")}function autoSearchInfo(){var b=mystorage.get("cir_keyword");var a=mystorage.get("cir_index");if(b){mystorage.set("cir_index",null);mystorage.set("cir_keyword",null);searchRdrRecord(null,"id",parseInt(b))}}function renewBookByReader(){var a=base_path+"cir/circulation/renewBooksByReader.do";var b={};b.rdrno=$("#rdrno").html();if(b.rdrno.length==0){return openCirMessageDlg("读者证号不能为空",getFocusReader)}$.messager.progress({title:"图书续借",msg:"正在处理数据,请稍等..."});$.post(a,b,function(e){$.messager.progress("close");if(e.status=="0"){var d=e.rows[0];getCirDataGridList(getValue("rdrid"));for(var c in d){var f=d[c];if(f.status=="0"){insertCirResultDataGridListRow(f.rows[0])}else{insertCirResultDataGridListRow(f.rows[0],f,c)}}}else{openCirMessageDlg(e.message,getFocusReader)}},"json")}function renewBookByBarcodes(){if(checkedItems.length==0){return openMessageDlg("请选择您要续借的记录。")}var a=base_path+"cir/circulation/renewBooks.do";var b={};b.barcodes=checkedItems.join(",");$.messager.progress({title:"图书续借",msg:"正在处理数据,请稍等..."});$.post(a,b,function(e){$.messager.progress("close");if(e.status=="0"){var d=e.rows[0];for(var c=0;c0){c["limit["+a+"].condition"]="logstamp";c["limit["+a+"].typeHandler"]="7";c["limit["+a+"].value"]=getValue("cirlogbegdate");a++}if(getValue("cirlogenddate").length>0){c["limit["+a+"].condition"]="logstamp";c["limit["+a+"].typeHandler"]="5";c["limit["+a+"].value"]=getValue("cirlogenddate");a++}if(getValue("cirlogtype").length>0){c["limit["+a+"].condition"]="logtype";c["limit["+a+"].typeHandler"]="0";c["limit["+a+"].value"]=getValue("cirlogtype");a++}else{c["limit["+a+"].condition"]="logtype";c["limit["+a+"].typeHandler"]="3";c["limit["+a+"].value"]="101,102,201,202,203";a++}c["limit["+a+"].condition"]="operid";c["limit["+a+"].typeHandler"]="1";c["limit["+a+"].value"]=vOperid;a++;c.orderBy=" LIB_CIR_LOG.logstamp desc ";$("#cirlogDataGridList").datagrid({url:b,queryParams:c,onLoadSuccess:function(d){},method:"post"})}function handlerFun(a){$("#keyword").textbox("textbox").focus().select();setValue("keyword",a.readvalue);if(cirConfigParamjson&&cirConfigParamjson.setsearchrdrno&&cirConfigParamjson.setsearchrdrno=="1"){searchRdrRecord(null,"rdrno")}else{searchRdrRecord(null,a.readfield)}};