var rowsService;var noCard=false;var noBook=false;$(function(){initServiceSelect();initSetGirdHeight();var a=[{key:"rdrtype",condition:"libcode",value:vLibcode},{key:"libcode",condition:"code",value:vLibcode},{code:"rdrstatus",key:"rdrstatus"},];_myPage.prototype.initData(a);enterEvent("keyword",searchRdrRecord);enterEvent("barcode",serachBibOk);$(".easyui-panel").panel("resize");$("#service").combobox({onChange:function(c,b){if(c.length>0){showServiceInfo(c)}}});$("#acqDataGridList").datagrid({onSelect:onSelectAcqDataGridList,onDblClickRow:onDblClickAcqFun});initIndexCommbox();$("#keyword").textbox("textbox").focus()});function ikownDlg(){$("#global-message-dlg").dialog("close");$("#keyword").textbox("textbox").focus()}function onSelectAcqDataGridList(a,b){setValue("bibid",b.id);b.libcode=getValue("libcode");setJsonData(null,b)}function serachBibOk(){var c=getValue("page_otherbib");if(c=="1"){noBook=false;var b={};var a=base_path+"lib/biblios/page.do";if(getValue("barcode").length==0){return openMessageDlg("检索值不能为空")}b.rows=10;b.page=1;b.condition=getValue("bibindex");b.value=getValue("barcode");$.post(a,b,function(d){if(d.status=="0"&&d.total>0){searchLoanBibList()}else{$(".my-bib").html("");noBook=true;$.messager.confirm("提示消息","未找到图书,是否将输入的键值进行阅览登记?",function(e){if(e){if(noCard){var f=getValue("page_otherrdr");if(f=="1"){registerSpeReadNoCard()}}else{registerSpeReadFun()}}})}},"json")}else{searchLoanBibList()}}function searchLoanBibList(){var b=0;var d=$("#acqDataGridList").datagrid("getSelected");if(d){b=$("#acqDataGridList").datagrid("getRowIndex",d)}var c={};var a=base_path+"lib/biblios/page.do";deleteGridData("acqDataGridList");if(getValue("barcode").length==0){return openMessageDlg("检索值不能为空")}c.rows=10;c.page=1;c.condition=getValue("bibindex");c.value=getValue("barcode");$("#acqDataGridList").datagrid({url:a,queryParams:c,onLoadSuccess:function(e){if(e.total>0){$("#acqDataGridList").datagrid("getPanel").panel("setTitle","书目列表(提示:请选择一条书目信息,双击进行阅览登记!)");$("#acqDataGridList").datagrid("selectRow",b)}else{openMessageDlg("没有找到合适的数据!")}},method:"post"})}function onDblClickAcqFun(a,b){if(noCard){var c=getValue("page_otherrdr");if(c=="1"){registerSpeReadNoCard()}}else{registerSpeReadFun()}}function initIndexCommbox(){var b={key:"bibindex"};var a=base_path+"par/common/getInitData.do";$.post(a,b,function(c){$("#bibindex").combobox({data:c.rows,valueField:"code",textField:"name",onLoadSuccess:function(){$(this).combobox("select","ISBN")}})},"json")}_myPage.prototype.onLoadSuccess=function(a,b){getPageConfig("page_type",callSetParaResult);_fmtGridDataRows=a};function callSetParaResult(c){if(c.status=="0"){var b=c.rows[0];var a=JSON.parse(b.paramjson);setValue("index",a.rdrSearchWay);setJsonData("page_",a);setWebSocket(a)}}function searchRdrRecord(d,a){var e=getValue("page_otherrdr");if(e=="1"){noCard=false;setValue("rdrid","");var b=base_path+"cir/reader/getFirstReader.do";var c={};if(getValue("keyword").length==0){return openMessageDlg("检索值不能为空",getFocusReader)}if(d){c.rdrno=d.rdrno}else{if(a){c[a]=getValue("keyword")}else{c[""+getValue("index")+""]=getValue("keyword")}}$.post(b,c,function(f){if(f.status=="0"){checkReaderBeforeLoanByLoc(d,a)}else{noCard=true;$(".my-rdr").html("");$("#barcode").textbox("textbox").focus()}},"json")}else{checkReaderBeforeLoanByLoc(d,a)}}function checkReaderBeforeLoanByLoc(d,a){setValue("rdrid","");var b=base_path+"cir/speloan/checkReaderBeforeLoan.do";b=base_path+"cir/speloan/checkReaderBeforeLoanByLoc.do";var e=getValue("page_otherrdr");if(e=="1"){b=base_path+"cir/reader/getFirstReader.do"}var c={};c.optype="regist";if(getValue("keyword").length==0){return openMessageDlg("检索值不能为空",getFocusReader)}if(d){c.rdrno=d.rdrno}else{if(a){c[a]=getValue("keyword")}else{c[""+getValue("index")+""]=getValue("keyword")}}c.location=getValue("service");$.post(b,c,function(f){if(f.status=="0"){var g=f.rows[0];setJsonData(null,g);setValue("rdrid",g.id)}else{openMessageDlg(f.message)}},"json");$("#barcode").textbox("textbox").focus()}function registerSpeReadNoCard(){setValue("rdrid","");var a=base_path+"cir/speloan/checkReaderBeforeLoan.do";a=base_path+"cir/speloan/registerSpeReadNoCard.do";var b={};b.bibid=getValue("bibid");b.rdrflag=getValue("keyword");b.location=getValue("service");if(noBook){b.bibflag=getValue("barcode")}$.post(a,b,function(c){if(c.status=="0"){var d=c.rows[0];insertCirResultDataGridListRow(c,getValue("keyword"))}else{openMessageDlg(c.message)}},"json")}function registerSpeReadFun(){var a=base_path+"cir/speloan/registerSpeReadByLoc.do";var b={};b.id=getValue("rdrid");b.bibid=getValue("bibid");b.location=getValue("service");if(noBook){b.bibflag=getValue("barcode")}$.post(a,b,function(c){if(c.status=="0"){insertCirResultDataGridListRow(c)}else{openMessageDlg(c.message)}},"json")}function insertCirResultDataGridListRow(c,a){var b=Date.parse(new Date());var d={};d.note=getValue("name");d.libcode=getValue("libcode");d.info3=getValue("service");d.info4=getValue("rdrno");if(a){d.info4=a;d.libcode=vLibcode;d.note="未办证读者"}d.logstamp=b;d.title=getValue("title");d.clasno=getValue("clasno");d.isbn=getValue("isbn");if(noBook){d.title=getValue("barcode")}$("#spereadDataGridList").datagrid("insertRow",{index:0,row:d})}function searchCirLogRecord(){var a=base_path+"sys/oplog/listUnionBib.do";var b={};clearGridData("spereadDataGridList");b["limit[0].condition"]="logdate";b["limit[0].value"]=getCurDateYMD();b["limit[1].condition"]="logtype";b["limit[1].value"]="4013";b.orderBy=" lib_sys_oplog.id desc ";$("#spereadDataGridList").datagrid({url:a,queryParams:b,onLoadSuccess:function(c){},method:"post"})}function initSetGirdHeight(){var a=$(window).height();var b=a-580;$("#acqDataGridList").datagrid("resize",{height:b})}function showServiceInfo(c){for(var b=0;b0){$(this).combobox("select",g[0].code)}}})};