$(function(){initIndexCommbox();setCurPageGirdList();commonSetParaInit(null,"record");enterEvent("keyword",searchBibRecord);$("#bibDataGridList").datagrid({onSelect:onSelectbibDataGridList});$("#cirDataGridList").datagrid({fitColumns:true});$("#historyBorrowDataGridList").datagrid({fitColumns:true});$("#keyword").textbox("textbox").focus()});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",loadFilter:function(d){var e={};e.code="BARCODE";e.name="条码号";d.splice(0,0,e);return d},onLoadSuccess:function(){$(this).combobox("select","ISBN")}})},"json")}function setCurPageGirdList(){if(vType=="0"){setCurLoanGridHeight()}else{if(vType=="1"){setHistoryLoanGridHeight()}}}function onSelectbibDataGridList(a,b){if(vType=="0"){bindCurLoanDataGridList(b.id)}else{if(vType=="1"){bindHistoryLoanDataGridList(b.id)}}}function bindHistoryLoanDataGridList(a){var a=a;var b=base_path+"cir/cirlog/pageUnion.do";var c={};deleteGridData("historyBorrowDataGridList");c.rows=10;c.page=1;c.bibid=a;if(getValue("cirlogtype").length>0){c.logtype=getValue("cirlogtype")}if(getValue("cirlogbegdate").length>0&&getValue("cirlogenddate").length>0){c["limit[0].condition"]="logdate";c["limit[0].typeHandler"]="2";c["limit[0].value"]=getValue("cirlogbegdate").replace(new RegExp("-","g"),"");c["limit[0].secondValue"]=getValue("cirlogenddate").replace(new RegExp("-","g"),"")}$("#historyBorrowDataGridList").datagrid({url:b,queryParams:c,onLoadSuccess:function(d){},method:"post"})}function bindCurLoanDataGridList(a){var b=base_path+"hld/holding/listHoldingWithBibAndRdr.do";var c={};deleteGridData("cirDataGridList");c.rows=10;c.page=1;c.bibid=a;c.status="2";$("#cirDataGridList").datagrid({url:b,queryParams:c,onLoadSuccess:function(d){},method:"post"})}function setHistoryLoanGridHeight(){var a=$(window).height();var b=a-456;$(".curhistory-grid-div").css("height",b+"px");$("#historyBorrowDataGridList").datagrid("resize")}function setCurLoanGridHeight(){var a=$(window).height();var b=a-410;$(".curloan-grid-div").css("height",b+"px");$("#cirDataGridList").datagrid("resize")}function searchBibRecord(){var a=base_path+"lib/biblios/page.do";var b={};if(getValue("keyword").length==0){return openMessageDlg("检索值不能为空")}clearGridData("bibDataGridList,historyBorrowDataGridList,cirDataGridList");b.rows=10;b.page=1;b.condition=getValue("bibindex");b.value=getValue("keyword");$("#bibDataGridList").datagrid({url:a,queryParams:b,onLoadSuccess:function(c){if(c.total>0){$("#bibDataGridList").datagrid("selectRow",0)}else{return openMessageDlg("未找到合适的记录")}},method:"post"})};