var pageGridObj;$(function(){var b=[{key:"rdrtype",condition:"libcode",value:vLibcode},{key:"libcode",condition:"code",value:vLibcode},{key:"rdrfld1",condition:"parentid",value:"1"},{key:"rdrfld2",condition:"parentid",value:"2"},{key:"rdrfld3",condition:"parentid",value:"3"},{key:"rdrfld4",condition:"parentid",value:"4"}];_myPage.prototype.initData(b);var a={key:"rdrfld0",condition:"parentid",value:"0"};initPageDataSingleElement("rdrfld0",a,showRdrFldName);_myPage.prototype.onLoadAllLibDataNoLimit({code:"showlibcode",key:"libcode"});_myInitCombox.prototype.autobar();pageGridObj=$("#rdrDataGridList");$("#rdrDataGridList").datagrid({onSelect:onSelectRdrDataGridList});$("#keyword").textbox("textbox").focus();$(".easyui-panel").panel("resize")});_myPage.prototype.onLoadSuccess=function(a,b){_fmtGridDataRows=a};var _myInitCombox=function(){};_myInitCombox.prototype.autobar=function(){if($("#autordr").length>0){var b={};b.libcode=vLibcode;var a=base_path+"par/autordr/page.do";$.post(a,b,function(c){$("#autordr").combobox({data:c.rows,valueField:"code",textField:"name",panelHeight:"auto",loadFilter:function(d){var e={};e.code="";e.name="不限";d.splice(0,0,e);return d},onLoadSuccess:function(){$(this).combobox("select","")}})},"json")}};function searchRecord(){var b=0;var d=pageGridObj.datagrid("getSelected");if(d){b=pageGridObj.datagrid("getRowIndex",d)}var a=base_path+"cir/webreader/page.do";var c={};cleanJsonData("record");clearGridData("rdrDataGridList");c.rows=10;c.page=1;if(getValue("keyword").length>0){c[""+getValue("index")+""]=getValue("keyword")}pageGridObj.datagrid({url:a,queryParams:c,onLoadSuccess:function(e){pageGridObj.datagrid("selectRow",b)},method:"post"})}function insertRecord(){cleanJsonData("record");clearGridData("rdrDataGridList");$("#keyword").textbox("textbox").focus()}function saveRecord(){var a=getJsonData(null,"record");if(!a){openMessageDlg("记录异常");return}if(!a.name){openMessageDlg("读者名称不能为空!");return}if(!a.libcode){openMessageDlg("读者所属馆不能为空!");return}if(!a.rdrtype){openMessageDlg("读者类型不能为空!");return}var c=getValue("id");var b=base_path+"cir/webreader/insert.do";if(c>0){b=base_path+"cir/webreader/update.do"}saveWebReaderRecord(b,a)}function saveWebReaderRecord(b,a){var c=getValue("id");$.post(b,a,function(d){if(d.status=="0"){openMessageDlg(d.message);if(c==0||c==""||c.length==0){setValue("index","id");setValue("keyword",d.rows[0].id);searchRecord()}else{searchRecord()}}else{openMessageDlg(d.message)}},"json")}function deleteRecord(){var a=pageGridObj.datagrid("getSelected");if(!a){return openMessageDlg("请先选择一条信息,进行删除")}openConfirmDlg("您确定要删除记录号为["+a.id+"]的数据吗?",null,deleteRecordResult,null)}function deleteRecordResult(){var c=pageGridObj.datagrid("getSelected");var a=base_path+"cir/webreader/delete.do";var b={};b.pk=c.id;$.post(a,b,function(d){if(d.status=="0"){searchRecord();openMessageDlg(d.message)}else{openMessageDlg(d.message)}},"json")}function onSelectRdrDataGridList(a,b){setJsonData(null,b)}function checkRecord(){if(getValue("autordr").length==0){openMessageDlg("请选择条码区间!");return}var c=pageGridObj.datagrid("getSelected");var a=base_path+"cir/reader/checkWebReader.do";var b={};b.rdrid=c.id;b.auto_rdrno_code=getValue("autordr");$.post(a,b,function(d){if(d.status=="0"){insertCirResultDataGridListRow(d);searchRecord();openMessageDlg(d.message)}else{openMessageDlg(d.message)}},"json")}function insertCirResultDataGridListRow(d){var c=d.rows[0];var a="";var b="";a+="读者姓名:"+c.name;a+=",读者证号:"+c.rdrno;a+=",入档日期:"+fmtStringToDate(c.createdate);a+=",启用日期:"+fmtStringToDate(c.startdate);a+=",终止日期:"+fmtStringToDate(c.enddate);var e={};e.note='