var marcFlagType="0";var z3950Page;var z3950Rows;$(function(){$("#centerOrderBibRecord").hide();$("#centerOrderCheckBibRecord").hide();$("#centerCheckBibRecord").hide();$("#searchZ3950MarcGird").hide();$("#z3950DownLoadToAddEditGrid").hide();$("#z3950DataGridList").datagrid({onSelect:onSelectz3950DataGridList})});function onSelectz3950DataGridList(a,b){marcFlagType="0";if(vPageNameFlag!="回溯建库"){if(vPageNameFlag=="期刊订购编目"){_myComBib.prototype.setDataToEditBibGrid("editBibGrid",b.marcrows);$("#z3950DownLoadToAddEditGrid").show()}else{$("#centerDataGridDetail").datagrid("loadData",b.marcrows);saveFldSelectCenterDataGridDetail();$("#centerDataGridDetail").datagrid("getPanel").panel("setTitle","z3950简单marc数据");$("#centerOrderBibRecord").hide();$("#centerOrderCheckBibRecord").hide();$("#centerCheckBibRecord").hide();$("#searchZ3950MarcGird").show();$("#z3950DownLoadToAddEditGrid").show();$(".showBibGrid-tip").html("")}}}function z3950SearchByCondtion(c,b){$("#keyword").textbox("textbox").focus().select();var a=base_path+"cat/z3950/query.do";var d={};if(getValue("keyword").length==0){return openMessageDlg("检索值不能为空")}deleteGridData("z3950DataGridList");setFirstPage("#z3950DataGridList");if(!c){c=1}if(!b){b=10}z3950Page=c;z3950Rows=b;d.rows=z3950Rows;d.page=z3950Page;d.condition=getValue("bibindex");if(d.condition!="ISBN"&&d.condition!="TITLE"&&d.condition!="AUTHOR"&&d.condition!="SUBJECT"){d.condition="ANY"}d.value=getValue("keyword");d.sysid=getValue("page_sysid");$("#z3950DataGridList").datagrid({url:a,queryParams:d,onLoadSuccess:function(e){if(e.status=="0"){if(vPageNameFlag=="回溯建库"){$("#tabsGrid").tabs("select",2)}else{if(vPageNameFlag=="期刊订购编目"){marcFlagType=0;$("#tabsGrid").tabs("select",3)}else{$("#tabsGrid").tabs("select",5)}}$("#z3950DataGridList").datagrid("selectRow",0)}else{openMessageDlg(e.message)}},method:"post"})}function setFirstPage(b){var c=$(b).datagrid("options");var a=$(b).datagrid("getPager");c.pageNumber=1;c.pageSize=c.pageSize;a.pagination("refresh",{pageNumber:1,pageSize:c.pageSize})}function searchZ3950MarcGird(b){marcFlagType="1";var d=$("#z3950DataGridList").datagrid("getSelected");if(!d){return openMessageDlg("请先选择一条书目信息")}var a=base_path+"cat/z3950/download.do";var c={};c.condition=getValue("bibindex");if(c.condition!="ISBN"&&c.condition!="TITLE"&&c.condition!="AUTHOR"&&c.condition!="SUBJECT"){c.condition="ANY"}c.value=getValue("keyword");c.sysid=getValue("page_sysid");c.index=d.z39index;c.code=d.z39code;onHnadlerSvaeBntScreen(null,true);$.post(a,c,function(e){onHnadlerSvaeBntScreen(null,false);if(e.status=="0"){if(e.total>0){if(vPageNameFlag=="回溯建库"){_myComBib.prototype.addData(e.rows)}else{if(vPageNameFlag=="期刊订购编目"){_myComBib.prototype.setDataToEditBibGrid("editBibGrid",e.rows)}else{$("#centerDataGridDetail").datagrid("loadData",e.rows);saveFldSelectCenterDataGridDetail()}}if(b){z3950DownLoadToAddEditGrid()}}}else{openMessageDlg(e.message)}},"json")}function z3950DownLoadToAddEditGrid(){if(marcFlagType==0){searchZ3950MarcGird("1")}else{if($("#centerDataGridDetail").length>0){selectEditBibId=0;selectCenterBibId=0;clearGridData("editBibGrid,acqDataGridList,centerDataGridList,orderDataGridList,checkDataGridList,holdDataGridList");var c=$("#centerDataGridDetail").datagrid("getRows");if(c.length>0){for(var b=0;b1){z3950Page-=1;z3950SearchByCondtion(z3950Page,z3950Rows)}else{return openMessageDlg("已经是第一组了!")}}function nextGroupData(){z3950Page+=1;z3950SearchByCondtion(z3950Page,z3950Rows)};