$(function(){autoPanle();$(".easyui-panel-resize").panel("resize");setInitPageElementData();$("#barcode").textbox("textbox").focus();enterEvent("barcode",searchHoldRecord);$("#reserveDataGridList").datagrid({onSelect:onSelectCirLogDataGridList})});function setInitPageElementData(){var a=[{code:"logtaglib",key:"curlibcode"},{code:"logtagloc",key:"curlocation"}];commonSetParaInit(null,"record",null,a)}function autoPanle(){var a=$(window).height();var b=a-(126+340);$(".datagrid-div").css("height",b+"px");$("#LogisticsDataGridList").datagrid("resize")}function searchHoldRecord(){var a=base_path+"hld/holding/getHoldingWithBib.do";var b={};if(getValue("barcode").length==0){return openMessageDlg("条码号不能为空")}b.barcode=getValue("barcode");$.post(a,b,function(c){if(c.status=="0"){var d=c.rows[0];setBibHtmlShow(d);getReserveDataGridList(d.bibid)}else{openMessageDlg(c.message)}},"json")}function onSendHandler(){var a=$("#reserveDataGridList").datagrid("getSelected");if(!a){return openMessageDlg("请先选择一条流通事物信息,进行操作!")}bulidCirInfoOk(a);$("#cirLogDlg").dialog("open")}function bulidCirInfoOk(d){$(".cirinfo-html-data").html("");var c="";c+="
-----------原数据----------
";var b=[{code:"barcode-cirinfo",name:"条码号"},{code:"curlibcode-cirinfo",name:"当前所在馆"},{code:"curlocation-cirinfo",name:"当前所在点"}];for(var a=0;a"+$("."+b[a].code).html()+""}c+="------------运送到---------
";c+="目标所在馆:"+$("#logtaglib").combobox("getText")+"
";c+="目标所在点:"+$("#logtagloc").combobox("getText")+"
";$(".cirinfo-html-data").html(c)}function onStartSend(){var a=base_path+"cir/logistics/insert.do";var c={};var b=$("#reserveDataGridList").datagrid("getSelected");if(!b){return openMessageDlg("请先选择一条流通事物信息,进行操作!")}c.resid=b.id;c.hldid=b.hldid;c.bibid=b.bibid;c.type="0";c.logdate=getCurDateYMD();c.logtime=getCurDateHMS();c.logno=(new Date()).valueOf();c.logcurlib=getValue("logcurlib"),c.logcurloc=getValue("logcurloc"),c.logbarcode=b.barcode;c.logtaglib=getValue("logtaglib");c.logtagloc=getValue("logtagloc");$.post(a,c,function(d){$("#cirLogDlg").dialog("close");if(d.status=="0"){getLogisticsPage(b.id)}else{openMessageDlg(d.message)}},"json")}function onSelectCirLogDataGridList(a,b){getLogisticsPage(b.id)}function getLogisticsPage(c){deleteGridData("LogisticsDataGridList");var a=base_path+"cir/logistics/page.do";var b={};b.resid=c;$("#LogisticsDataGridList").datagrid({url:a,queryParams:b,onLoadSuccess:function(d){},method:"post"})}function onLogisticsDelete(){var a=$("#LogisticsDataGridList").datagrid("getSelected");if(!a){return openMessageDlg("请先选择一条运送记录,进行操作!")}$.messager.confirm("提示消息","您确定要执行当前操作吗?",function(c){if(c){var b=base_path+"cir/logistics/delete.do";var d={};d.pk=a.id;$.post(b,d,function(e){if(e.status=="0"){getLogisticsPage(a.resid)}else{openMessageDlg(e.message)}},"json")}})}function setBibHtmlShow(d){var c="";var b=[{code:"title",name:"题名"},{code:"author",name:"作者"},{code:"barcode",name:"条码号"},{code:"curlibcode",name:"当前所在馆"},{code:"curlocation",name:"当前所在点"},{code:"isbn",name:"ISBN"},{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 a=0;a"+b[a].name+":"+(d[b[a].code]==null?"":d[b[a].code])+""}else{if(b[a].code=="curlibcode"){setValue("logcurlib",d[b[a].code]);c+=""+b[a].name+":"+onShowLibName(d[b[a].code])+"
"}else{if(b[a].code=="curlocation"){setValue("logcurloc",d[b[a].code]);c+=""+b[a].name+":"+onShowLocationName(d[b[a].code])+"
"}else{c+=""+b[a].name+":"+(d[b[a].code]==null?"":d[b[a].code])+"
"}}}}$(".bib-html-data").html(c)}function getReserveDataGridList(c){if(c>0){deleteGridData("reserveDataGridList");var a=base_path+"cir/reserve/unionPage.do";var b={};b.bibid=c;$("#reserveDataGridList").datagrid({url:a,queryParams:b,onLoadSuccess:function(d){},method:"post"})}else{deleteGridData("reserveDataGridList")}};