$(function(){setInitPageElementData();$("#hscode").textbox("textbox").focus();enterEvent("hscode",onFastCheckRecord);enterEvent("svolnum",loanBookOK)});function setInitPageElementData(){var c={key:"sysid",condition:"type",value:"1"};initPageDataSingleElement("sysid",c,null);setValue("year",getCurDateYMD().toString().substr(0,4));var a=$(window).height();var b=a-(86+340);$(".datagrid-div").css("height",b+"px");$("#handlerResult").panel("resize")}function onFastCheckRecord(){var a=getValue("hscode");if(a.length==0){return openMessageDlg("商品码不能为空")}if((a.length!=13&&a.length!=15)||a.toString().substr(0,3)!="977"){return openMessageDlg("无效的商品码")}if(a.length==15){checkByHSCodeFun(a)}else{if(a.length==13){$("#loanBookDlg").dialog("open")}}}function loanBookOK(){var b=getValue("svolnum");if(b.length==0){return openMessageDlg("期数不能为空")}var a=getValue("hscode");$("#loanBookDlg").dialog("close");checkByHSCodeFun(a+""+b)}function onOpenLoanBookDlg(){$("#svolnum").textbox("textbox").focus()}function checkByHSCodeFun(a){var b=base_path+"per/detailcheck/checkByHSCode.do?";var c={};c.hscode=a;c.sysid=getValue("sysid");c.year=getValue("year");$.post(b,c,function(d){$("#hscode").textbox("textbox").focus();if(d.status=="0"){dataToHtmlShowRecord(d)}else{setResultHtml(d)}},"json")}function dataToHtmlShowRecord(f){var g=f.rows[0];var e=g.bib_info;var d="";var b=[{code:"title",name:"题名"},{code:"author",name:"作者"},{code:"isbn",name:"ISSN"},{code:"orderno",name:"订购刊号"},{code:"unifiedno",name:"统一刊号"},{code:"price",name:"价格"},{code:"classno",name:"分类号"},{code:"subject",name:"主题词"},{code:"publish",name:"出版社"},{code:"publishaddress",name:"出版地"},{code:"publishdate",name:"出版年"},{code:"callno",name:"索书号"},{code:"content",name:"内容简介"}];for(var c=0;c"+b[c].name+":"+(e[b[c].code]==null?"":e[b[c].code])+""}$(".bib-result-data").html(d);var a=g.check_info;d="";var h=[{code:"copies",name:"记到册数"},{code:"volume",name:"记到卷"},{code:"issuenum",name:"期数"},{code:"issue",name:"记到期"},{code:"totalissue",name:"总期数"},{code:"year",name:"记到年"},{code:"price",name:"价格"},{code:"expectdate",name:"预计日期"},{code:"actualdate",name:"实际日期"},{code:"note",name:"备注"}];for(var c=0;c"+h[c].name+":"+(a[h[c].code]==null?"":a[h[c].code])+""}$(".check-result-data").html(d);setResultHtml(f)}function setResultHtml(c){var b=$(".result-html-data").html();var a=getValue("hscode");$(".result-html-data").html("
光笔记到:"+a+","+c.message+"
"+b)}function onCloseMessageFun(){$("#hscode").textbox("textbox").focus().select()};