$(function(){jsonData=eval("("+jsonData+")");var url=base_path+"lib/design/get.do";var param={};param.pk=jsonData.keycode;if(jsonData.keycode.indexOf("E_READERLOANTOP")>-1||jsonData.keycode.indexOf("E_BIBLOANTOP")>-1){$(".bar-chart").show()}$.post(url,param,function(data){if(data.status=="0"){if(jsonData.lxdy){lxdyForLabelDataBox(data)}else{onPerviewLabelDataBox(data)}}else{alert(data.message)}},"json")});function onPerviewLabelDataBox(d){var g={};var c=base_path+"lib/"+vType+"/execute.do";g=jsonData;if(jsonData.supplementbookmarkflag&&jsonData.supplementbookmarkflag=="bookmark"){c=base_path+"lib/export/queryLabelByFile.do"}if(jsonData.supplementbookmarkflag&&jsonData.supplementbookmarkflag=="callnomarck"){c=base_path+"com/webuploader/perviewTextData.do"}if(jsonData.jatype&&jsonData.jatype=="order"){g["limit[0].value"]=getOrderSql(g["limit[0].value"])}if(jsonData.jatype&&jsonData.jatype=="check"){g["limit[1].value"]=getChcekSql(g["limit[1].value"])}if(jsonData.bookmacth){g.tablelimit=getSqlTableLimit(jsonData.bookmacth)}if(jsonData.clbookmacth){g.tablelimit=getSqlTableLimit(jsonData.clbookmacth)}if(jsonData.checkid&&(jsonData.keycode.indexOf("S_HLDCLASSCOUNT")>-1||jsonData.keycode.indexOf("S_CURHLDCLASSCOUNT")>-1)){g["limit["+jsonData.condtionIndex+"].condition"]="lib_holdings.checkid";g["limit["+jsonData.condtionIndex+"].typeHandler"]="3";g["limit["+jsonData.condtionIndex+"].value"]="("+getHoldChcekSql(jsonData.checkid)+")"}if(jsonData.batchno&&(jsonData.keycode.indexOf("S_HLDCLASSCOUNT")>-1||jsonData.keycode.indexOf("E_HOLDINGSCOUNTLIST")>-1||jsonData.keycode.indexOf("E_HOLDINGSLIST")>-1||jsonData.keycode.indexOf("E_BIBLOANTOP")>-1)){g["limit["+jsonData.batchnocondtionIndex+"].condition"]="lib_holdings.checkid";g["limit["+jsonData.batchnocondtionIndex+"].typeHandler"]="3";g["limit["+jsonData.batchnocondtionIndex+"].value"]="("+getHoldChcekSqlForBatchno(jsonData.batchno,jsonData.batchnoTypeHandler)+")"}if(jsonData.export_beg_batchno&&(jsonData.keycode.indexOf("S_HLDCLASSCOUNT")>-1||jsonData.keycode.indexOf("E_HOLDINGSCOUNTLIST")>-1||jsonData.keycode.indexOf("E_HOLDINGSLIST")>-1||jsonData.keycode.indexOf("E_BIBLOANTOP")>-1)){g["limit["+jsonData.batchnoBegcondtionIndex+"].condition"]="lib_holdings.checkid";g["limit["+jsonData.batchnoBegcondtionIndex+"].typeHandler"]="3";g["limit["+jsonData.batchnoBegcondtionIndex+"].value"]="("+getHoldChcekSqlForBatchno(jsonData.export_beg_batchno,jsonData.batchnoBegTypeHandler)+")"}if(jsonData.export_end_batchno&&(jsonData.keycode.indexOf("S_HLDCLASSCOUNT")>-1||jsonData.keycode.indexOf("E_HOLDINGSCOUNTLIST")>-1||jsonData.keycode.indexOf("E_HOLDINGSLIST")>-1||jsonData.keycode.indexOf("E_BIBLOANTOP")>-1)){g["limit["+jsonData.batchnoEndcondtionIndex+"].condition"]="lib_holdings.checkid";g["limit["+jsonData.batchnoEndcondtionIndex+"].typeHandler"]="3";g["limit["+jsonData.batchnoEndcondtionIndex+"].value"]="("+getHoldChcekSqlForBatchno(jsonData.export_end_batchno,jsonData.batchnoEndTypeHandler)+")"}if(jsonData.bindbatchno&&(jsonData.keycode.indexOf("S_HLDCLASSCOUNT")>-1||jsonData.keycode.indexOf("E_HOLDINGSCOUNTLIST")>-1||jsonData.keycode.indexOf("E_HOLDINGSLIST")>-1)){g["limit["+jsonData.bindbatchnocondtionIndex+"].condition"]="lib_holdings.bindid";g["limit["+jsonData.bindbatchnocondtionIndex+"].typeHandler"]="3";g["limit["+jsonData.bindbatchnocondtionIndex+"].value"]="("+getHoldChcekSqlForBindBatchno(jsonData.bindbatchno,jsonData.batchnoTypeHandler)+")"}if(jsonData.export_beg_bindbatchno&&(jsonData.keycode.indexOf("S_HLDCLASSCOUNT")>-1||jsonData.keycode.indexOf("E_HOLDINGSCOUNTLIST")>-1||jsonData.keycode.indexOf("E_HOLDINGSLIST")>-1)){g["limit["+jsonData.bindbatchnoBegcondtionIndex+"].condition"]="lib_holdings.bindid";g["limit["+jsonData.bindbatchnoBegcondtionIndex+"].typeHandler"]="3";g["limit["+jsonData.bindbatchnoBegcondtionIndex+"].value"]="("+getHoldChcekSqlForBindBatchno(jsonData.export_beg_bindbatchno,jsonData.bindbatchnoBegTypeHandler)+")"}if(jsonData.export_end_bindbatchno&&(jsonData.keycode.indexOf("S_HLDCLASSCOUNT")>-1||jsonData.keycode.indexOf("E_HOLDINGSCOUNTLIST")>-1||jsonData.keycode.indexOf("E_HOLDINGSLIST")>-1)){g["limit["+jsonData.bindbatchnoEndcondtionIndex+"].condition"]="lib_holdings.bindid";g["limit["+jsonData.bindbatchnoEndcondtionIndex+"].typeHandler"]="3";g["limit["+jsonData.bindbatchnoEndcondtionIndex+"].value"]="("+getHoldChcekSqlForBindBatchno(jsonData.export_end_bindbatchno,jsonData.bindbatchnoEndTypeHandler)+")"}if(jsonData.qkbatchno&&(jsonData.keycode.indexOf("S_HLDCLASSCOUNT")>-1)){g["limit["+jsonData.qkbatchnocondtionIndex+"].condition"]="lib_holdings.checkid";g["limit["+jsonData.qkbatchnocondtionIndex+"].typeHandler"]="3";g["limit["+jsonData.qkbatchnocondtionIndex+"].value"]="("+getHoldChcekSqlForQKBatchno(jsonData.qkbatchno,jsonData.batchnoTypeHandler)+")"}if(jsonData.export_beg_qkbatchno&&(jsonData.keycode.indexOf("S_HLDCLASSCOUNT")>-1)){g["limit["+jsonData.batchnoBegcondtionIndex+"].condition"]="lib_holdings.checkid";g["limit["+jsonData.batchnoBegcondtionIndex+"].typeHandler"]="3";g["limit["+jsonData.batchnoBegcondtionIndex+"].value"]="("+getHoldChcekSqlForQKBatchno(jsonData.export_beg_qkbatchno,jsonData.batchnoBegTypeHandler)+")"}if(jsonData.export_end_qkbatchno&&(jsonData.keycode.indexOf("S_HLDCLASSCOUNT")>-1)){g["limit["+jsonData.batchnoEndcondtionIndex+"].condition"]="lib_holdings.checkid";g["limit["+jsonData.batchnoEndcondtionIndex+"].typeHandler"]="3";g["limit["+jsonData.batchnoEndcondtionIndex+"].value"]="("+getHoldChcekSqlForQKBatchno(jsonData.export_end_qkbatchno,jsonData.batchnoEndTypeHandler)+")"}if(jsonData.ysazlocation&&(jsonData.keycode.indexOf("E_ACQBEFORECHECKLIST")>-1)){g["limit["+jsonData.condtionIndex+"].condition"]=" lib_acq_check.id ";g["limit["+jsonData.condtionIndex+"].typeHandler"]="3";var b=getSqlTableLimit(jsonData.ysazlocation);var a="";if(b.length>0){a="select checkid from lib_holdings where curlocation in ("+b+")"}g["limit["+jsonData.condtionIndex+"].value"]="("+a+")"}if(jsonData.sqlLimit&&(jsonData.keycode.indexOf("E_NLIBCIRDATALIST")>-1||jsonData.keycode.indexOf("S_RDRNLIBCIRDATACOUNT")>-1)){var f=" lib_cir_log.libcode = '"+vLibcode+"'";var e=jsonData.sqlLimit;if(e=="1"){f=" lib_cir_log.libcode !=lib_cir_reader.libcode "}if(e=="2"){f=" lib_cir_log.libcode !=lib_holdings.libcode "}if(e=="3"){f=" ( lib_cir_reader.libcode!=lib_cir_log.libcode or lib_holdings.libcode!=lib_cir_log.libcode )"}g["limit["+jsonData.sqlLimitIndex+"].condition"]="libcode";g["limit["+jsonData.sqlLimitIndex+"].typeHandler"]="13";g["limit["+jsonData.sqlLimitIndex+"].value"]=f;g["limit["+jsonData.sqlLimitIndex+"].valueflag"]="1"}if(jsonData.barcodeintervalflag){getBarcodeSectionData(jsonData,d)}else{if(jsonData.printPerCheckList){$(".lold-div").hide();setLabelDisplayArea(d,jsonData.rows)}else{$.post(c,g,function(m){if(m.status=="0"){$(".lold-div").hide();if(jsonData.supplementbookmarkflag&&jsonData.supplementbookmarkflag=="callnomarck"){var k=[];var l=m.rows;if(l.length>0){for(var j=0;j0){a="select bibid from lib_holdings where curlocation in ("+b+")"}return a}function lxdyForLabelDataBox(a){var b={};b.rows=mystorage.get("ling-xing-da-yin");$(".lold-div").hide();setLabelDisplayArea(a,b)}function getJSBookMacthSql(d){var a="";if(d.length>0){a="(select replace(isbn,'-','') isbn from lib_bibliography join lib_acq_order on lib_bibliography.id = lib_acq_order.bibid where batchno in ('";var b=d.split(",");for(var c=0;c0){a+=b[c]+"','"}}a+="'))"}return a}function getCLBookMacthSql(d){var a="";if(d.length>0){a="(select replace(isbn,'-','') isbn from lib_acq_bookmatch where batchno in ('";var b=d.split(",");for(var c=0;c0){a+=b[c]+"','"}}a+="'))"}return a}function getHoldChcekSqlForQKBatchno(c,b){var a="";if(c.length>0){a="select id from lib_per_check where ";if(b=="0"){a+=" batchno = '"+c+"'"}else{if(b=="1"){a+=" batchno like '"+c+"%'"}else{if(b=="7"){a+=" batchno >= '"+c+"'"}else{if(b=="5"){a+=" batchno <= '"+c+"'"}}}}}return a}function getHoldChcekSqlForBindBatchno(c,b){var a="";if(c.length>0){a="select id from lib_per_bind where ";if(b=="0"){a+=" batchno = '"+c+"'"}else{if(b=="1"){a+=" batchno like '"+c+"%'"}else{if(b=="7"){a+=" batchno >= '"+c+"'"}else{if(b=="5"){a+=" batchno <= '"+c+"'"}}}}}return a}function getHoldChcekSqlForBatchno(c,b){var a="";if(c.length>0){a="select id from lib_acq_check where ";if(b=="0"){a+=" batchno = '"+c+"'"}else{if(b=="1"){a+=" batchno like '"+c+"%'"}else{if(b=="7"){a+=" batchno >= '"+c+"'"}else{if(b=="5"){a+=" batchno <= '"+c+"'"}}}}}return a}function getHoldChcekSql(d){var a="";if(d.length>0){a="select id from lib_acq_check where batchno in ('";var b=d.split(",");for(var c=0;c0){a+=b[c]+"','"}}a+="')"}return a}function getChcekSql(d){var a="";if(d.length>0){a="select bibid from lib_acq_check where batchno in ('";var b=d.split(",");for(var c=0;c0){a+=b[c]+"','"}}a+="')"}return a}function getOrderSql(d){var a="";if(d.length>0){a="select bibid from lib_acq_order where batchno in ('";var b=d.split(",");for(var c=0;c0){a+=b[c]+"','"}}a+="')"}return a}function getBarcodeSectionData(b,a){var c=[];if(b.begkeyb){$(".lold-div").hide();var d={};d.rows=j;setLabelDisplayArea(g,d);return}else{paramjson=JSON.parse(g.rows[0].paramjson);var f=paramjson.grid;var h={};for(var e=0;e0){var f=e.length;var a=parseInt(e)+1;var c=a.toString();f=Math.min(f,c.length);return b.substring(0,b.length-f)+c}else{return null}}function onPrintPerview(){$(".labelDisplayArea").jqprint()}function onCloseWin(){window.opener=null;window.open("","_self");window.close()}function leftMenuController(a){}function _w_table_rowspan(a,b){_w_table_firsttd="";_w_table_currenttd="";_w_table_SpanNum=0;if(b==2){_w_table_Obj=$(a+" tr td:nth-child("+b+")");_w_table_Obj2=$(a+" tr td:nth-child(1)")}else{_w_table_Obj=$(a+" tr td:nth-child("+b+")")}_w_table_Obj.each(function(c){if(c==0){_w_table_firsttd=$(this);_w_table_SpanNum=1}else{_w_table_currenttd=$(this);if(b==2){if(_w_table_firsttd.text()==_w_table_currenttd.text()&&_w_table_Obj2[c-1].textContent==_w_table_Obj2[c].textContent){_w_table_SpanNum++;_w_table_currenttd.hide();_w_table_firsttd.attr("rowSpan",_w_table_SpanNum)}else{_w_table_firsttd=$(this);_w_table_SpanNum=1}}else{if(_w_table_firsttd.text()==_w_table_currenttd.text()){_w_table_SpanNum++;_w_table_currenttd.hide();_w_table_firsttd.attr("rowSpan",_w_table_SpanNum)}else{_w_table_firsttd=$(this);_w_table_SpanNum=1}}}})}function _w_table_colspan(b,a,c){if(c==void 0){c=0}_w_table_firsttd="";_w_table_currenttd="";_w_table_SpanNum=0;$(b+" tr:nth-child("+a+")").each(function(d){_w_table_Obj=$(this).children();_w_table_Obj.each(function(e){if(e==0){_w_table_firsttd=$(this);_w_table_SpanNum=1}else{if((c>0)&&(e>c)){return""}else{_w_table_currenttd=$(this);if(_w_table_firsttd.text()==_w_table_currenttd.text()){_w_table_SpanNum++;_w_table_currenttd.hide();_w_table_firsttd.attr("colSpan",_w_table_SpanNum)}else{_w_table_firsttd=$(this);_w_table_SpanNum=1}}}})})};