var cataConfigData;$(function(){_myInitCombox.prototype.batchno();if($("#orderbatchno").length>0){$("#libcodeSelect").combobox({onChange:function(d,c){_myInitCombox.prototype.batchno(d)}})}if($("#page_dgfptm").length>0){$("#page_dgfptm").combobox({onChange:function(d,c){if(d=="1"){if(getValue("page_spehld").length==0){return openMessageDlg("请选择虚拟条码区间!!!")}}}})}_myInitCombox.prototype.bibindex();_myInitCombox.prototype.autobar();_myInitCombox.prototype.billno();enterEvent("keyword",_myComBib.prototype.serach);_myPage.prototype.initData(initJson);_myPage.prototype.onLoadAllLibDataNoLimit({code:"showlibcode",key:"libcode"});_myComBib.prototype.initGrid();_setConfig.prototype.initParam();var b=[{id:"page_template",key:"template",condition:"sysid"}];initNextSelectCombobox("page_sysid",b);var a={code:"page_location",unionlist:[{code:"defdoctype",orgcode:"page_doctype"}]};_myPage.prototype.initUnionShowByLocation(a);initGridResize()});function initGridResize(){var b={};var a=base_path+"lib/biblios/get.do";b.pk=0;$("#acqDataGridList").datagrid({url:a,queryParams:b,onLoadSuccess:function(c){},method:"post"})}_myPage.prototype.onLoadSuccess=function(a,b){if(vType=="0"||vType=="cata"||vType=="order"||vType=="check"||vType=="tobookcheck"||vType=="com"){mystorage.set("cat_init_data",a)}else{if(vType=="1"){mystorage.set("per_init_data",a)}}_fmtGridDataRows=a;_myPage.prototype.getOperatorParam()};_myPage.prototype.initComboxByOperatorParm=function(f){if(f.showacqloccode){var b=_fmtGridDataRows.rows[0].location;var e=[];for(var c=0;c-1){e.push(b[c])}}$("#page_location").combobox("loadData",e);var g={};g["limit[0].condition"]="code";g["limit[0].typeHandler"]="3";g["limit[0].value"]=getSqlConditionLimitIn(f.showacqloccode);var a=base_path+"par/location/list.do";$.post(a,g,function(n){var m=n.rows;_myLocationData=m;var o=_fmtGridDataRows.rows[0].doctype;var l=[];for(var j=0;j0){var c={type:"0",page:"1",rows:"500"};if(b){c.libcode=b}var a=base_path+"par/batchno/page.do";$.post(a,c,function(g){var f=[];for(var e=0;e10){h="200px"}$("#orderbatchno").combobox({data:f,valueField:"code",textField:"name",panelHeight:h,loadFilter:function(i){var j={};j.code="";j.name="不限订购批号";i.splice(0,0,j);return i},onLoadSuccess:function(){$(this).combobox("select","")}})},"json")}};_myInitCombox.prototype.autobar=function(){if($("#page_autobar").length>0){var b={};b.libcode=vLibcode;var a=base_path+"par/autobar/page.do";$.post(a,b,function(c){var d="auto";if(c.rows.length>10){d="200px"}$("#page_autobar").combobox({data:c.rows,valueField:"code",textField:"name",panelHeight:d,loadFilter:function(e){var f={};f.code="";f.name="不限";e.splice(0,0,f);return e},onLoadSuccess:function(){$(this).combobox("select","")}});if($("#page_assetno").length>0){$("#page_assetno").combobox({data:c.rows,valueField:"code",textField:"name",panelHeight:d,onLoadSuccess:function(){$(this).combobox("select","")}})}if($("#page_spehld").length>0){$("#page_spehld").combobox({data:c.rows,valueField:"code",textField:"name",panelHeight:d,onLoadSuccess:function(){$(this).combobox("select","")}})}},"json")}};_myInitCombox.prototype.billno=function(){if($("#page_billno").length>0){var b={};b.libcode=vLibcode;var a=base_path+"acq/fine/page.do";$.post(a,b,function(c){var d="auto";if(c.rows.length>10){d="200px"}$("#page_billno").combobox({data:c.rows,valueField:"billno",textField:"billno",panelHeight:d,loadFilter:function(e){var f={};f.billno="";f.billno="不限";e.splice(0,0,f);return e},onLoadSuccess:function(){$(this).combobox("select","")}})},"json")}};_myInitCombox.prototype.bibindex=function(){if($("#bibindex").length>0){var c={key:"bibindex"};if(vType=="1"){c={key:"perindex"}}var a=base_path+"par/common/getInitData.do";$.post(a,c,function(g){var f=g.rows;if(vType=="0"){var e=[];for(var d=0;d0){var b=[{code:"0",name:"精确匹配"},{code:"1",name:"前方一致"}];$("#titlehandler").combobox({data:b,valueField:"code",textField:"name",panelHeight:"auto",onLoadSuccess:function(){$(this).combobox("select","1")}});$("#authorhandler").combobox({data:b,valueField:"code",textField:"name",panelHeight:"auto",onLoadSuccess:function(){$(this).combobox("select","1")}})}};var _myComBib=function(){};_myComBib.prototype.initGrid=function(){if(vType=="0"||vType=="cata"||vType=="order"||vType=="check"||vType=="tobookcheck"||vType=="com"){$("#acqDataGridList").datagrid("hideColumn","orderno");$("#acqDataGridList").datagrid("hideColumn","unifiedno")}else{if(vType=="1"){if(vPageNameFlag!="征订订购"){$("#acqDataGridList").datagrid("hideColumn","status")}var c=$("#acqDataGridList").datagrid("getColumnOption","title");c.title="刊名";var a=$("#acqDataGridList").datagrid("getColumnOption","isbn");a.title="ISSN号";if($("#rfidDataGridList").length>0){var b=$("#rfidDataGridList").datagrid("getColumnOption","isbn");b.title="ISSN号"}if($("#z3950DataGridList").length>0){var d=$("#z3950DataGridList").datagrid("getColumnOption","isbn");d.title="ISSN号"}$("#acqDataGridList").datagrid()}}};_myComBib.prototype.serach=function(b,a){if(isUpdateData){$.messager.confirm("提示消息","您有修改过的数据未保存,您确定要执行当前操作吗?",function(c){if(c){_myComBib.prototype.serachOk(b,a);isUpdateData=false}})}else{_myComBib.prototype.serachOk(b,a)}};_myComBib.prototype.serachOk=function(d,a){if($("#keyword").length>0){$("#keyword").textbox("textbox").focus().select()}if(!_setConfig.prototype.check()){return}var c=0;var f=$("#acqDataGridList").datagrid("getSelected");if(f){c=$("#acqDataGridList").datagrid("getRowIndex",f)}_comGridObj.prototype.clear();var e={};var b=base_path+"lib/biblios/page.do";if(vPageNameFlag=="征订订购"){b=base_path+"acq/collect/page.do";_subscribeOrderPageObj.prototype.getParam(e,d,a)}else{if(($("#keyword").length>0&&getValue("keyword").length==0)&&!a){if($("#bibindextitle").length>0&&!$(".add-condtion").is(":hidden")){if(getValue("keyword").length==0&&getValue("titlekey").length==0||getValue("authorkey").length==0){return openMessageDlg("组合检索至少有一项检索值不能为空!")}}else{return openMessageDlg("检索值不能为空")}}_myComBib.prototype.getParam(e,d,a)}if(a){c=0}$("#acqDataGridList").datagrid({url:b,queryParams:e,onLoadSuccess:function(g){if(g.status=="0"){if(g.total==1){c=0}if(g.total>0&&g.total>c){$("#acqDataGridList").datagrid("selectRow",c)}else{if(g.total>0){$("#acqDataGridList").datagrid("selectRow",c)}else{if(vPageNameFlag=="回溯建库"||vPageNameFlag=="征订订购"||vPageNameFlag=="期刊订购编目"){$("#tabsGrid").tabs("select",0)}else{$("#tabsGrid").tabs("select",1)}}}}else{if(g.status=="9006"){openMessageDlg(g.message)}}},method:"post"})};_myComBib.prototype.getParam=function(f,e,b,d){f.rows=10;f.page=1;f.orderBy=" id desc ";var c=0;if(vType=="cata"||vType=="order"||vType=="check"||vType=="tobookcheck"||vType=="com"){f["limit["+c+"].condition"]="status";f["limit["+c+"].value"]="0";c++}f["limit["+c+"].condition"]="sysid";f["limit["+c+"].value"]=getValue("page_sysid");c++;f.condition=getValue("bibindex");f.value=getValue("keyword");var g=$("#libcodeSelect");if(g.length>0&&getValue("libcodeSelect").length>0){f["limit["+c+"].condition"]="libcode";f["limit["+c+"].value"]=getValue("libcodeSelect");c++}if(!d){var a=$("#orderbatchno");if(a.length>0&&getValue("orderbatchno").length>0){f["limit["+c+"].condition"]="ORDBATCHNO";f["limit["+c+"].value"]=getValue("orderbatchno");c++}}else{if(vType=="cata"||vType=="order"||vType=="check"||vType=="tobookcheck"||vType=="com"){f["limit[0].value"]="1"}}if($("#titlekey").length>0){if(getValue("titlekey").length>0){f["limit["+c+"].condition"]=getValue("bibindextitle");f["limit["+c+"].typeHandler"]=getValue("titlehandler");f["limit["+c+"].value"]=getValue("titlekey");c++}if(getValue("authorkey").length>0){f["limit["+c+"].condition"]=getValue("bibindexauthor");f["limit["+c+"].typeHandler"]=getValue("authorhandler");f["limit["+c+"].value"]=getValue("authorkey");c++}}if(e){f.condition=e;f.value=b}};_myComBib.prototype.add=function(){if(isUpdateData){$.messager.confirm("提示消息","您有修改过的数据未保存,您确定要执行当前操作吗?",function(a){if(a){_myComBib.prototype.addOk();isUpdateData=false}})}else{_myComBib.prototype.addOk()}};_myComBib.prototype.addOk=function(){_linkbuttonObj.prototype.status(false);selectEditBibId=0;if(!_setConfig.prototype.check()){return}_comGridObj.prototype.clear();var b=getValue("page_template");if(b){var a=base_path+"par/template/getTemplate.do?pk="+b;var c={};$.post(a,c,function(f){if(f.status=="0"){if(f.total>0){var d=JSON.parse(f.rows[0].paramjson);var e=d.rows;_myComBib.prototype.setDataToEditBibGrid("editBibGrid",e);_myComBib.prototype.addAttrCtrlNO();if(vPageNameFlag=="期刊记到处理"||vPageNameFlag=="期刊装订处理"){$("#tabsLeftGrid").tabs("select",1)}}}else{openMessageDlg(f.message)}},"json")}};_myComBib.prototype.setDataToEditBibGrid=function(b,a){$("#"+b).datagrid({data:a,onLoadSuccess:function(c){$("#"+b).datagrid("resize");if(b=="centerDataGridDetail"){saveFldSelectCenterDataGridDetail()}},method:"post"})};function saveFldSelectCenterDataGridDetail(){var c=$("#centerDataGridDetail").datagrid("getRows");var a="HEA,"+getValue("page_savefld");for(var b=0;b0){$("#editBibGrid").datagrid("insertRow",{index:1,row:{field:"001",indicator:"",data:e.rows[0].currentctrlno}})}}else{openMessageDlg(e.message)}},"json")}}_linkbuttonObj.prototype.status(false)};_myComBib.prototype.save=function(a){if(!_setConfig.prototype.check()){return}accept();var g={};var c=base_path+"lib/biblios/saveMarcRecord.do";if(vPageNameFlag=="征订订购"){c=base_path+"acq/collect/saveMarcRecord.do";g.catacode=getValue("catacode");if(!g.catacode){return openMessageDlg("请选择征订订购目录")}}var n=$("#editBibGrid").datagrid("getRows");if(n.length>0){if(!a){if($("#page_choose").length>0&&getValue("page_choose")=="1"){_myComBib.prototype.pyfun(n);return}}var e=0;for(var j=0;j0){g.id=selectEditBibId;b="update"}g.sysid=getValue("page_sysid");if($("#page_choose").length>0){g.choose=getValue("page_choose")}$.post(c,g,function(i){if(i.status=="0"){openMessageDlg(i.message);isUpdateData=false;selectEditBibId=i.rows[0].id;_myComBib.prototype.handleAfterSerach(b)}else{openMessageDlg(i.message)}},"json")}};_myComBib.prototype.handleAfterSerach=function(a){if(a=="delete"){_detailData.prototype.set(0)}else{if((a=="add"||a=="update")&&selectEditBibId>0){_myComBib.prototype.serach("ID",selectEditBibId)}else{_myComBib.prototype.serach()}}};_myComBib.prototype.pyfun=function(l){var a=[{fld:"200",code:"a"},{fld:"7**",code:"a"}];var h=getValue("page_pyfld");var d=[];for(var e=0;e0){e.tone=getValue("page_tone");$.post(a,e,function(f){if(f.status=="0"&&f){c=f.rows}d[b].rows=c;b+=1;_myComBib.prototype.getPy(d,b)},"json")}else{d[b].rows=c;b+=1;_myComBib.prototype.getPy(d,b)}}else{_myComBib.prototype.showPy(d)}};var _pyConvertListData=undefined;_myComBib.prototype.showPy=function(d){var g="";_pyConvertListData=d;for(var f=0;f1){var c=q+"_"+f+"_"+b;m=h[0];n=""+r[b].ch+"";e+='
';e+="";for(var a=0;a"+h[a]+""}e+="
"}}}k+=m;l+=n}if(e.length>0){g+="";g+=""+q+"";g+="";g+=l;g+="";g+=""+e+"";g+=""}}if(g.length>0){$(".py-body-list").html(g);$("#pyDlg").dialog("open")}else{_myComBib.prototype.savePy()}};_myComBib.prototype.savePy=function(){var b={};var e=_pyConvertListData;_pyConvertListData=undefined;var a=[];for(var f=0;f1){var d=m+"_"+f+"_"+c;var k=$('input:radio[name="'+d+'"]:checked').val()}}}h+=k+" "}var n={};n.field=e[f].field;n.code=e[f].code;n.subval=e[f].subval;n.pyval=h;a.push(n)}_myComBib.prototype.save(a);$("#pyDlg").dialog("close")};_myComBib.prototype.trash=function(){var b=$("#acqDataGridList").datagrid("getSelected");if(!b){return openMessageDlg("请先选择一条书目信息,进行删除")}var a=$("#acqDataGridList").datagrid("getRowIndex",b);$.messager.confirm("提示消息","您确定要删除记录号为["+selectEditBibId+"]的书目数据吗?",function(d){if(d){var c=base_path+"lib/biblios/delete.do";if(vPageNameFlag=="征订订购"){c=base_path+"acq/collect/delete.do"}var e={};e.id=selectEditBibId;$.post(c,e,function(f){if(f.status=="0"){if(f.total>0&&f.total>a){$("#acqDataGridList").datagrid("deleteRow",a)}else{if(f.total>0){$("#acqDataGridList").datagrid("selectRow",0)}}_myComBib.prototype.handleAfterSerach("delete");openMessageDlg(f.message)}else{openMessageDlg(f.message)}},"json")}})};_myComBib.prototype.accept=function(){if(selectEditBibId>0){var c=$("#acqDataGridList").datagrid("getSelected");if(!c.classno){return openMessageDlg("你要进行审校操作书目信息没有分类号,请完善书目信息才能进行审校操作!")}var a=base_path+"lib/biblios/update.do";var b={};b.id=selectEditBibId;b.status="1";$.post(a,b,function(d){if(d.status=="0"){clearGridData("editBibGrid");$(".showBibGrid-tip").html("书目记录号【"+selectEditBibId+"】");_detailData.prototype.loadData(selectEditBibId,"centerDataGridDetail");selectEditBibId=0;_myComBib.prototype.serach();openMessageDlg(d.message)}else{openMessageDlg(d.message)}},"json")}};_myComBib.prototype.set=function(){$("#pageconfig_setpara_dlg").dialog("open")};_myComBib.prototype.addData=function(c){if(c&&c.length>0){for(var b=0;b0){var c=0;var f=$("#"+d+"DataGridList").datagrid("getSelected");if(f){c=$("#"+d+"DataGridList").datagrid("getRowIndex",f)}var b=base_path+"acq/"+d+"/page.do";if(a&&a==1){b=base_path+"per/"+d+"/page.do"}if(d=="hold"){b=base_path+"hld/holding/page.do"}var e={};e.bibid=g;e.rows=10;e.page=1;e.orderBy=" id desc ";$("#"+d+"DataGridList").datagrid({url:b,queryParams:e,onLoadSuccess:function(h){if(h.total>0&&h.total>c){$("#"+d+"DataGridList").datagrid("selectRow",c)}else{if(h.total>0){$("#"+d+"DataGridList").datagrid("selectRow",0)}}},method:"post"})}else{deleteGridData(""+d+"DataGridList")}};function callSetParaResult(a){_setConfig.prototype.callSet(a)}var _setConfig=function(){};_setConfig.prototype.initParam=function(){if(vPageNameFlag=="回溯建库"||vPageNameFlag=="期刊记到处理"){$(".order_batchno").hide();$(".check_batchno").hide();$(".bind_batchno").hide()}else{if(vPageNameFlag=="期刊装订处理"){$(".order_batchno").hide();$(".check_batchno").hide();$(".bind_batchno").show()}else{if(vPageNameFlag=="装订验收处理"){$(".order_batchno").hide();$(".check_batchno").show();$(".bind_batchno").hide()}else{if(vPageNameFlag=="征订订购"||vPageNameFlag=="期刊订购编目"){$(".order_batchno").show();$(".check_batchno").hide();$(".bind_batchno").hide()}else{if(vType=="cata"||vPageNameFlag=="数据检查"||vPageNameFlag=="数据查重"||vPageNameFlag=="书目数据维护"){var a=$("#config-tabs");a.tabs("close",1)}else{if(vType=="order"){$(".order_batchno").show();$(".check_batchno").hide()}else{if(vType=="check"){$(".order_batchno").hide();$(".check_batchno").show()}else{if(vType=="tobookcheck"){$(".order_batchno").hide();$(".check_batchno").show()}else{if(vType=="com"){$(".order_batchno").show();$(".check_batchno").show()}else{$(".order_batchno").show();$(".check_batchno").show();$(".bind_batchno").show()}}}}}}}}}};_setConfig.prototype.callSet=function(c){if(c.status=="0"){if(vType=="0"||vType=="cata"||vType=="order"||vType=="check"||vType=="tobookcheck"||vType=="com"){mystorage.set("cat_config",c)}else{if(vType=="1"){mystorage.set("per_config",c)}}var b=c.rows[0];var a=JSON.parse(b.paramjson);cataConfigData=a;if(a.sysid){setJsonData("page_",a);initEidtBiBModel(a.editmodel);if($("#page_booklableprinter").length>0){initPrinterCombox(a)}if(a.autobar){mystorage.set("cat_autobar",a.autobar)}else{mystorage.remove("cat_autobar")}if(a.holdlist){mystorage.set("cat_holdlist",a.holdlist)}else{mystorage.remove("cat_holdlist")}if(a.libcode){setValue("libcodeSelect",a.libcode)}else{setValue("libcodeSelect","")}if($("#catacode").length>0){_subscribeOrderPageObj.prototype.initComBox(a.sysid)}}}else{openMessageDlg("请您先点点击设置按钮,设置相关参数!")}};_setConfig.prototype.check=function(){if(getValue("page_sysid").length==0){openMessageDlg("请您先点点击设置按钮,设置分系统参数!");return false}if(getValue("page_ctrlno").length==0){openMessageDlg("请您先点点击设置按钮,设置控制区号参数!");return false}return true};var _detailData=function(){};_detailData.prototype.set=function(a){selectEditBibId=a;if(a==0){$(".showEditbib-tip").html("");clearGridData("editBibGrid")}else{$(".showEditbib-tip").html("书目记录号【"+selectEditBibId+"】");_detailData.prototype.loadData(selectEditBibId,"editBibGrid")}};_detailData.prototype.loadData=function(d,b){var a=base_path+"lib/biblios/getMarcRecordForEdit.do";if(vPageNameFlag=="征订订购"){a=base_path+"acq/collect/getMarcRecordForEdit.do"}var c={};c.id=d;$.post(a,c,function(f){if(f.status=="0"){var e=f.rows;_myComBib.prototype.setDataToEditBibGrid(b,e)}else{openMessageDlg(f.message)}},"json")};var _linkbuttonObj=function(){};_linkbuttonObj.prototype.status=function(b){if(b){noEditBibGridByCode=true;$("#saveBibRecord").linkbutton({disabled:true});$("#deleteBibRecord").linkbutton({disabled:true});$("#acceptBibRecord").linkbutton({disabled:true});$("#appendRecord").linkbutton({disabled:true});$("#insertRow").linkbutton({disabled:true});$("#removeit").linkbutton({disabled:true});$("#z3950DownLoadToCopyEditGrid").linkbutton({disabled:true});var a=$("#editBibGrid").datagrid("getPanel");a.panel("setTitle","不能修改非本馆或者非子馆的数据哦!")}else{noEditBibGridByCode=false;$("#saveBibRecord").linkbutton({disabled:false});$("#deleteBibRecord").linkbutton({disabled:false});$("#acceptBibRecord").linkbutton({disabled:false});$("#appendRecord").linkbutton({disabled:false});$("#insertRow").linkbutton({disabled:false});$("#removeit").linkbutton({disabled:false});$("#z3950DownLoadToCopyEditGrid").linkbutton({disabled:false});var a=$("#editBibGrid").datagrid("getPanel");a.panel("setTitle","编目数据")}};function initPrinterCombox(a){}function stylerFormatBibStatus(b,c,a){if(b=="0"){return}return"color:green;"}function colseIframeDlg(c,a,b){if(a&&b){if(a==0||a==2){setValue("page_order_batchno",b)}else{if(a==1||a==3){setValue("page_check_batchno",b)}else{if(a==4){setValue("page_bind_batchno",b)}}}}$("#"+c+"").dialog("close")}function setEditModelByParam(){var a="编目模版";parent.addTab(a,"parameter/cat_template.jsp","gear","6406","1");parent.refreshTab()}_myComBib.prototype.paste=function(){$("#pasteMarcDlg").dialog("open")};_myComBib.prototype.pasteResult=function(){var f=getValue("nclmarc");if(!f){return openMessageDlg("数据区值不能为空。")}selectEditBibId=0;f=JSON.stringify(f);var h=f.split("\\n");var b=[{field:"HEA",indicator:"",data:"nam a2200000 a 4500"}];var a=/^[0-9 ]+.?[0-9 ]*$/;for(var c=0;c=2){var g=j[0];if(g&&g.length>2){if(a.test(g)){var e={};e.field=g.substr(0,3);e.indicator=g.substr(3,2);if(j[1]){e.data=j[1].replace(new RegExp(/\|/g,"gm"),"$")}b.push(e)}}}}_myComBib.prototype.setDataToEditBibGrid("editBibGrid",b);setValue("nclmarc","");$("#pasteMarcDlg").dialog("close")};