var initJson;var checkdetailId;var checkdetailIdx;var checkdetailData;var eidtorAutoBindGridObject=undefined;var eidtorAutoBindGridIndex=undefined;$(function(){initJson=[{code:"page_sysid",key:"sysid",condition:"type",value:vType,linkage:[{code:"page_template",key:"template",condition:"sysid"}]},{code:"page_ctrlno",key:"ctrlno",condition:"libcode",value:vLibcode},{code:"page_z3950",key:"z3950",condition:"libcode",value:vLibcode},{code:"page_editmodel",key:"editmodel"},{code:"page_finsources",key:"finsources"},{code:"page_mediatype",key:"mediatype"},{code:"page_binding",key:"binding"},{code:"page_docsources",key:"docsources"},{code:"page_ncy",key:"ncy"},{code:"page_bookseller",key:"bookseller",condition:"libcode",value:vLibcode},{code:"page_location",key:"location",condition:"libcode",value:vLibcode},{code:"page_doctype",key:"doctype",condition:"libcode",value:vLibcode},{code:"page_pertype",key:"pertype"},{code:"acqstatus",key:"acqstatus"},{code:"operid",key:"operid"},{code:"libcodeSelect",key:"libcode",condition:"code",value:vLibcode},{code:"frequency",key:"frequency",fmt:"entity"},{code:"ordertype",key:"perordertype"},{code:"status",key:"percheckstatus"}];$("#acqDataGridList").datagrid("showColumn","status");$(".print-content-list").show();_comGridObj.prototype.events()});var _comGridObj=function(){};_comGridObj.prototype.clear=function(){$(".checkdetail-boxs").html("");clearGridData("editBibGrid,acqDataGridList,orderDataGridList,bindDataGridList,checkDataGridList,holdDataGridList");$("#tabsGrid").tabs("select",0)};_comGridObj.prototype.events=function(){$("#acqDataGridList").datagrid({border:false,rowStyler:rowStylerIsUpdateByLibcode,onSelect:_acqGridObj.prototype.select});$("#tabsRightGrid").tabs({onSelect:_tabsGridObj.prototype.select});$("#holdDataGridList").datagrid({border:false,rowStyler:rowStylerIsUpdateByLibcode});$("#editBibGrid").datagrid({border:false,title:""});$("#checkDataGridList").datagrid({border:false,rowStyler:rowStylerIsUpdateByLibcode,onDblClickRow:_checkPerGridObj.prototype.update,onSelect:_checkPerGridObj.prototype.select});$("#orderDataGridList").datagrid({border:false});$("#bindDataGridList").datagrid({border:false,rowStyler:rowStylerIsUpdateByLibcode,onSelect:_perBindGridObj.prototype.select,onDblClickRow:_perBindGridObj.prototype.update});$(".easyui-panel").panel("resize")};var _acqGridObj=function(){};_acqGridObj.prototype.select=function(a,b){$(".checkdetail-boxs").html("");if(!isUpdateByLibcode(b.libcode)){_linkbuttonObj.prototype.status(true)}else{_linkbuttonObj.prototype.status(false)}_comGridObj.prototype.loadData(b.id,"order",1);_comGridObj.prototype.loadData(b.id,"check",1);_comGridObj.prototype.loadData(b.id,"bind",1);_comGridObj.prototype.loadData(b.id,"hold");_detailData.prototype.set(b.id)};var _tabsGridObj=function(){};_tabsGridObj.prototype.select=function(b,a){if(a==2){$("#deleteBindPer").show()}else{$("#deleteBindPer").hide()}};var _checkPerGridObj=function(){};_checkPerGridObj.prototype.add=function(c){var b=0;var e=0;var a="新增总记到";if(!c){if(getValue("page_orderyear").length==0){return openMessageDlg("请点击页面设置,在其他参数页面中设置订购年")}var d=$("#acqDataGridList").datagrid("getSelected");if(!d){return openMessageDlg("请先选择一条期刊数据,进行订购")}b=d.id}else{a="修改总记到";b=c.bibid;e=c.id}if($(".percheckFrame").html()==""){$(".percheckFrame").html('')}else{percheckFrame.percheckReLoadData(b,e)}$("#percheck_dlg").dialog("setTitle",a);$("#percheck_dlg").dialog("open")};_checkPerGridObj.prototype.select=function(a,b){$(".checkdetail-boxs").html("");_checkPerDetailObj.prototype.bindTable(b.id)};_checkPerGridObj.prototype.update=function(b,a){if(!b){a=$("#checkDataGridList").datagrid("getSelected")}if(isUpdateByLibcode(a.libcode)){_checkPerGridObj.prototype.add(a)}else{return openMessageDlg("不能修改非本馆数据")}};_checkPerGridObj.prototype.trash=function(){var a=$("#checkDataGridList").datagrid("getSelected");if(isUpdateByLibcode(a.libcode)){if(!a){return openMessageDlg("请先选择一条记到信息,进行删除")}openConfirmDlg("您确定要删除记录号为["+a.id+"]的总记到数据吗?",null,_checkPerGridObj.prototype.trashResult,null)}else{return openMessageDlg("不能删除非本馆数据")}};_checkPerGridObj.prototype.trashResult=function(){var c=$("#checkDataGridList").datagrid("getSelected");var b={};b.pk=c.id;var a=base_path+"per/check/delete.do";$.post(a,b,function(d){if(d.status=="0"){openMessageDlg(d.message,5000);$(".checkdetail-boxs").html("");_comGridObj.prototype.loadData(c.bibid,"check",1)}else{openMessageDlg(d.message)}},"json")};function perCheckSaveResult(b,a){openMessageDlg(b.message,5000);_comGridObj.prototype.loadData(a,"check",1);$("#percheck_dlg").dialog("close");$("#tabsRightGrid").tabs("select",0)}var _checkPerDetailObj=function(){};function checkPerDetailSaveResult(b,a){openMessageDlg(b.message,5000);$(".checkdetail-boxs").html("");_checkPerDetailObj.prototype.bindTable(a);$("#percheckdetail_dlg").dialog("close");$("#tabsRightGrid").tabs("select",0);_checkPerDetailObj.prototype.openPrintDlg()}_checkPerDetailObj.prototype.openPrintDlg=function(){var a=getValue("page_booklablefmt");if(a){var b=mystorage.get("perCheckItemList");if(b){mystorage.set("perCheckBarcodeItemList",b);$("#printer-confirm-dlg").dialog("open");$(".printer-confirm-body").html("以下列表是您的记到虚拟馆藏列表!");$("#printerDataGridList").datagrid("loadData",b)}}};_checkPerDetailObj.prototype.bindTable=function(c){onHnadlerSvaeBntScreen(null,true);var a=base_path+"per/detailcheck/page.do";var b={};b.checkid=c;b.rows=1000;b.page=1;$.post(a,b,function(d){onHnadlerSvaeBntScreen(null,false);if(d.status=="0"){_checkPerDetailObj.prototype.checkDetailBoxs(d)}else{openMessageDlg(d.message)}},"json")};function getDays(f,c,h){var a=new Array(31,28,31,30,31,30,31,31,30,31,30,31);var b=new Date(f,c-1,h);var g=b.getDate();var e=b.getMonth();var f=b.getFullYear();var j=0;for(var d=0;d1&&(f%4==0&&f%100!=0)||f%400==0){j+=1}return j}function daysInMonth(b,a){return new Date(a,b,0).getDate()}_checkPerDetailObj.prototype.checkDetailBoxs=function(f){var h="";var p=f.rows;checkdetailData=p;if(f.rows.length==365||f.rows.length==366){var o=$("#checkDataGridList").datagrid("getSelected");var b=new Date();var l=b.getFullYear();var k=b.getMonth()+1;var a=b.getDate();if(o.year){l=o.year}var g="";g+="";g+='';for(var e=1;e<=31;e++){g+='"}g+="";g+="";for(var e=1;e<=12;e++){g+='';g+="";var m=daysInMonth(e,l);for(var d=1;d<=m;d++){var n=(getDays(l,e,d)-1);var c=getDetailInfo(p,n,1);if(k==e&&a==d){c='
'+c+"
"}g+="
"}g+=""}g+="";g+="
'+e+"
"+e+"月"+c+"
";$(".checkdetail-boxs").html(g);$("#appendPrevRecord").hide();$("#appendNextRecord").hide();$("#checkToComBineRecord").hide();bindEventFun();location.href="#help-"+k}else{for(var e=0;e'+m[d].name+":"+c+""}else{if(m[d].code=="expectdate"||m[d].code=="actualdate"){c=fmtStringToDate(c)}}l+=m[d].name+":"+c+"\n"}var b=getColorBysStatus(n[e].status);var a=n[e].id;var h="cur"+e;if(k){h+=" day-detail";g="";g+='
期:'+(n[e].issue!=null?n[e].issue:"");+"
";g+='
册:'+(n[e].issue!=null?n[e].copies:"");+"
"}f+='
';f+="
"+g+"
";f+="
";return f}function getColorBysStatus(a){var c="";var d=[{code:"0",color:"cell-weidao"},{code:"1",color:"cell-zhengchang"},{code:"2",color:"cell-weidaoqi"},{code:"3",color:"cell-cuique"},{code:"4",color:"cell-zhuangding"},{code:"5",color:"cell-tingding"},{code:"6",color:"cell-yanqi"},{code:"9",color:"cell-qita"},];for(var b=0;b1){return openMessageDlg("您只能选中一个记到格,进行操作!")}var h=c.bibid;var i="";var a=0;if(c.id){a=c.id}var e=c.checkid;var f=c.sortfld;if(c.flag){i=c.flag}var k=$("#checkDataGridList").datagrid("getSelected");var b=k.copies;if($(".percheckdetailFrame").html()==""){$(".percheckdetailFrame").html('')}else{percheckdetailFrame.percheckdetailReLoadData(e,h,a,f,i,b)}$("#percheckdetail_dlg").dialog("setTitle",j);$("#percheckdetail_dlg").dialog("open")};_checkDetailEvent.prototype.appendPrevRecord=function(){_checkDetailEvent.prototype.getSortFldNum("0")};_checkDetailEvent.prototype.appendNextRecord=function(){_checkDetailEvent.prototype.getSortFldNum("1")};_checkDetailEvent.prototype.checkDetailRecord=function(){var b=checkdetailData[checkdetailIdx];var a="详细记到";_checkDetailEvent.prototype.openDlg(b,a)};_checkDetailEvent.prototype.checkToMarkRecord=function(){var c=$("#checkDataGridList").datagrid("getSelected");var a=checkdetailData[checkdetailIdx];if(!a){return openMessageDlg("请先选择一条详细记到信息,进行详细记到操作!")}a.copies=parseInt(a.copies)+1;if(a.status=="0"&&a.status=="2"){if(a.copies>=c.copies){a.status="1"}}var d=checkdetailIdx;var b=base_path+"per/detailcheck/update.do";$.post(b,a,function(e){if(e.status=="0"){_checkDetailEvent.prototype.addPrintList(e.rows[0].id);_checkPerDetailObj.prototype.bindTable(e.rows[0].checkid);$("#checkdetail_dlg").dialog("close")}else{openMessageDlg(e.message)}},"json")};_checkDetailEvent.prototype.addPrintList=function(c){var a=base_path+"per/detailcheck/listBarcode.do";var b={};b.id=c;$.post(a,b,function(e){if(e.status=="0"){var d=e.rows;_checkDetailEvent.prototype.addPrintListByGetRows(d)}},"json")};_checkDetailEvent.prototype.addPrintListByGetRows=function(f){var e=mystorage.get("perCheckItemList");if(!e){e=[]}var a=f;for(var d=0;d0){var c=false;for(var b=0;b0){var d=j[h-1];a=parseInt((parseInt(f)+parseInt(d.sortfld))/2);e.id=j[h].id;e.flag="add"}}}else{if(g=="1"){if(h==(j.length-1)){a=parseInt((parseInt(f)*3)/2)}else{if(h<(j.length-1)){var d=j[h+1];a=parseInt((parseInt(f)+parseInt(d.sortfld))/2);e.id=j[h].id;e.flag="add"}}}}e.sortfld=a;_checkDetailEvent.prototype.openDlg(e,b)}};var _bindPerGridObj=function(){};_bindPerGridObj.prototype.add=function(e){var f=$("#acqDataGridList").datagrid("getSelected");var a={};a.bibid=f.id;if(getValue("page_bind_batchno").length==0){return openMessageDlg("请在设置-其他参数中设置装订批号")}var b=base_path+"per/bind/bindManual.do";var g={};if(getValue("bindcopies")>0){g.copies=getValue("bindcopies")}if(getValue("bindfee")>0){g.bindfee=getValue("bindfee")}if(getValue("bindcount")>0){g.bindcount=getValue("bindcount")}var f=$("#checkDataGridList").datagrid("getSelected");if(e=="1"){b=base_path+"per/bind/bindAuto.do";if(!f){return openMessageDlg("请先选择一条总记到信息,进行自动装订")}g.checkid=f.id}else{var d="";var c=$(".cell-box-selected");c.each(function(h,i){d+=i.id+","});d=d.substr(0,d.length-1);g.ids=d;if(d.toString().length==0){return openMessageDlg("请先选择至少一条详细记到信息,进行新增装订")}}a.url=b;a.param=g;mystorage.set("per_bind_iframe_param",a);if($(".perbindFrame").html()==""){$(".perbindFrame").html('')}else{perbindFrame.perbindReLoadData()}$("#perbind_dlg").dialog("setTitle","期刊装订");$("#perbind_dlg").dialog("open")};function perBindSaveResult(c,a){openMessageDlg(c.message,5000);var b=$("#acqDataGridList").datagrid("getSelected");_comGridObj.prototype.loadData(b.id,"bind",1);var d=$("#checkDataGridList").datagrid("getSelected");_checkPerDetailObj.prototype.bindTable(d.id);$("#tabsRightGrid").tabs("select",2);$("#perbind_dlg").dialog("close")}var _perBindGridObj=function(){};_perBindGridObj.prototype.select=function(a,b){if(!isUpdateByLibcode(b.libcode)){$("#deleteBindPer").linkbutton({disabled:true})}else{$("#deleteBindPer").linkbutton({disabled:false})}};_perBindGridObj.prototype.add=function(c){var b=0;var e=0;if(!c){if(getValue("page_check_batchno").length==0){return openMessageDlg("请点击页面设置,在其他参数页面中设置验收批号")}var d=$("#acqDataGridList").datagrid("getSelected");if(!d){return openMessageDlg("请先选择一条期刊数据,进行订购")}if(!d.classno){return openMessageDlg("你要进行装订验收的书目信息没有分类号,请完善书目信息才能进行装订验收!")}b=d.id}else{b=c.bibid;e=c.id}var a="装订验收";if($(".perbindhandlerFrame").html()==""){$(".perbindhandlerFrame").html('')}else{perbindhandlerFrame.perbindhandlerReLoadData(b,e)}$("#perbindhandler_dlg").dialog("setTitle",a);$("#perbindhandler_dlg").dialog("open")};_perBindGridObj.prototype.update=function(b,a){if(a){a=$("#bindDataGridList").datagrid("getSelected")}if(isUpdateByLibcode(a.libcode)){_perBindGridObj.prototype.add(a)}};_perBindGridObj.prototype.trash=function(){var a=$("#bindDataGridList").datagrid("getSelected");if(!a){return openMessageDlg("请先选择一条记到信息,进行删除")}openConfirmDlg("您确定要删除记录号为["+a.id+"]的数据吗?",null,_perBindGridObj.prototype.trashResult,null)};_perBindGridObj.prototype.trashResult=function(){var c=$("#bindDataGridList").datagrid("getSelected");var b={};b.pk=c.id;var a=base_path+"per/bind/delete.do";$.post(a,b,function(d){if(d.status=="0"){openMessageDlg(d.message,5000);_comGridObj.prototype.loadData(c.bibid,"bind",1)}else{openMessageDlg(d.message)}},"json")};function perBindHandlerSaveResult(b,a){openMessageDlg(b.message,5000);_comGridObj.prototype.loadData(a,"bind",1);_comGridObj.prototype.loadData(a,"hold");$("#perbindhandler_dlg").dialog("close");$("#tabsGrid").tabs("select",1)}function printerBookLable(){var b=mystorage.get("perCheckItemList");if(b){var d={};d.rows=b;var a=getValue("page_booklablefmt");if(a.length==0){return openMessageDlg("请在设置-其他参数-设置书标格式!")}var c={};c.keycode=a;c.printPerCheckList="section";c.rows=d;mystorage.remove("perCheckItemList");$("#printer-confirm-dlg").dialog("close");openPostWindow("../export/exportlabelresult.jsp",c)}};