var onCloseCallFunName=undefined;var VPAGEFIN="circulation";$(function(){var a=[{key:"rdrtype",condition:"libcode",value:vLibcode},{code:"libcode,curlibcode",key:"libcode",condition:"code",value:vLibcode},{code:"rdrstatus",key:"rdrstatus"},{code:"page_sysid",key:"sysid"},{code:"page_z3950",key:"z3950",condition:"libcode",value:vLibcode},];_myPage.prototype.initData(a);$("#cirDataGridList").datagrid({onSelect:onSelectCirDataGridList,onDblClickRow:onDblClickCirDataGridListRow,rowStyler:rowCirOverdueStyler});$("#acqDataGridList").datagrid({onSelect:onSelectAcqDataGridList,onDblClickRow:onDblClickAcqFun});enterEvent("keyword",searchRdrRecord);enterEvent("barcode",serachBibOk);enterEvent("destoryMoney",destoryBook);enterEvent("curlostRate",lostBook);circurlationHandler(vType);initServiceSelect("4");initIndexCommbox();$(".easyui-panel").panel("resize");$("#page_dataSource").combobox({onChange:function(c,b){if(c=="z3950"){$(".z3950tr").hide()}else{$(".z3950tr").hide()}}})});_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);setValue("bibindex",a.bookSearchWay);setJsonData("page_",a);if(a.order_batchno){setValue("batchno",a.order_batchno)}if(a.order_batchno){setValue("dataSource",a.dataSource)}setWebSocket(a)}}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){return d},onLoadSuccess:function(){$(this).combobox("select","ISBN")}});$("#page_bookSearchWay").combobox({data:c.rows,valueField:"code",textField:"name",onLoadSuccess:function(){$(this).combobox("select","ISBN")}})},"json")}function serachBibOk(){$("#tabsGrid").tabs("select",1);var b=0;var e=$("#acqDataGridList").datagrid("getSelected");if(e){b=$("#acqDataGridList").datagrid("getRowIndex",e)}deleteGridData("acqDataGridList");var d={};if(getValue("barcode").length==0){return openMessageDlg("检索值不能为空")}d.rows=10;d.page=1;d.condition=getValue("bibindex");d.value=getValue("barcode");var a=base_path+"lib/biblios/page.do";var c=getValue("dataSource");if(c=="lib_acq_collectbib"){a=base_path+"acq/collect/page.do"}if(c=="rfiddata"){a=base_path+"cat/rfid/query.do";if(d.condition!="ISBN"){return openMessageDlg("检索条件只能选择ISBN")}}if(c=="z3950"){a=base_path+"cat/z3950/query.do";d.condition=getValue("bibindex");if(d.condition!="ISBN"&&d.condition!="TITLE"&&d.condition!="AUTHOR"&&d.condition!="SUBJECT"){d.condition="ANY"}}if(c=="z3950"||c=="rfiddata"){if(getValue("page_sysid").length>0){d.sysid=getValue("page_sysid")}}else{if(getValue("page_sysid").length>0){d["limit[0].condition"]="sysid";d["limit[0].value"]=getValue("page_sysid")}}$("#acqDataGridList").datagrid("hideColumn","orderno");$("#acqDataGridList").datagrid("hideColumn","unifiedno");$("#acqDataGridList").datagrid({url:a,queryParams:d,onLoadSuccess:function(f){if(f.total>0){$("#acqDataGridList").datagrid("selectRow",b)}else{openCirMessageDlg(f.message,getFocusHoldins)}},method:"post"})}function rowCirOverdueStyler(a,b){if(b.returndate0){setValue("curloan",parseInt(getValue("curloan"))-1)}}else{openCirMessageDlg(e.message,getFocusHoldins)}},"json")}}function barRenewBook(){if(getValue("barcode").length==0){return openCirMessageDlg("条码号不能为空",getFocusHoldins)}renewBookRecordResult()}function renewBookRecordResult(a){var b=base_path+"cir/speloan/renew.do";var d={};var c=$("#cirDataGridList").datagrid("getSelected");if(c){d.id=c.id;$.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/speloan/damage.do";var b={};b.id=c.id;b.money=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")}}function lostBookRecordResult(){var a=$("#cirDataGridList").datagrid("getSelected");setValue("lostBibPrice",a.price);setValue("curlostRate","");$("#lostHandlerDlg").window("open")}function onOpenLostDlg(){$("#curlostRate").textbox("textbox").focus()}function lostBook(){var c=$("#cirDataGridList").datagrid("getSelected");var a=base_path+"cir/speloan/lost.do";var b={};b.id=c.id;b.money=getValue("curlostRate");$.post(a,b,function(d){if(d.status=="0"){$("#lostHandlerDlg").window("close");var e=d.rows[0];updateDataGirdList(e)}else{openCirMessageDlg(d.message,getFocusHoldins)}},"json")}function updateDataGirdList(a){getCirDataGridList(a.rdrid);setValue("index","rdrno");setValue("keyword",a.rdrno);searchRdrRecord(a);insertCirResultDataGridListRow(a)}function getCirDataGridList(b){var a=base_path+"cir/speloan/pageCurLoan.do";var c={};clearGridData("cirDataGridList");c.rows=10;c.page=1;c.rdrid=b;c.location=getValue("service");$("#cirDataGridList").datagrid({url:a,queryParams:c,onLoadSuccess:function(d){if(d.total>0){setValue("curloan",d.total)}},method:"post"})}function getFocusByPara(){var b=getValue("page_barcodetordrno");if(b>0){var a=parseInt(b);setTimeout(getFocusBarcodeToRdrno,a)}}function getFocusBarcodeToRdrno(){circurlationHandler("借出")}function focusToTextByType(a){$("#keyword").next().show();$("#index").next().show();$("#barcode").next().hide();$("#addNewBook").hide();$(".loan-barcode-tip").hide();$("#keyword").textbox("textbox").focus().select()}function getFocusBarCode(){if(vType=="loan"){$("#barcode").next().show();$(".loan-barcode-tip").show();$("#addNewBook").show();$("#barcode").textbox("textbox").focus().select()}}function getFocusHoldins(){$("#barcode").textbox("textbox").focus().select()}function getFocusReader(){$("#keyword").textbox("textbox").focus().select();$("#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 setPara(){onSerachRdrBarcode();$("#pageconfig_setpara_dlg").window("open")}function onSerachRdrBarcode(){clearGridData("rdrBarcodeDataGridList,holdBarcodeDataGridList");var a=base_path+"par/common/getInitData.do?key=barformat&type=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&type=type&value=0";var b={};$("#holdBarcodeDataGridList").datagrid({url:a,queryParams:b,onLoadSuccess:function(c){},method:"post"})}function verifyRequiredFields(){var b=false;var a=$('[verify="fld-null"]');a.each(function(c,d){var e=d.id;if(!getValue(e)){b=true;return false}});return b};