var jsonFormatDesign={code:"I_HLDIMPORTDATA"};var holdId=0;var holdrow=undefined;var datafilename;$(function(){autoPanle();setInitPageElementData();$("#barcode").textbox("textbox").focus();$(".easyui-panel-resize").panel("resize");enterEvent("barcode",onHandlerRecord)});function autoPanle(){var a=$(window).height();var b=a-(126+340);$(".datagrid-div").css("height",b+"px");$("#holdDataGridList").datagrid("resize")}function setInitPageElementData(){var d=[{code:"tagdoctype",key:"doctype"},{code:"orglibcode",key:"curlibcode"}];commonSetParaInit(null,"record",null,d);var c={key:"libcode"};initPageDataSingleElement("taglibcode",c,null);var a={key:"curlocation"};initPageDataSingleElement("taglocation",a,null);var b=[{id:"taglocation",key:"curlocation",condition:"libcode",value:vLibcode},{id:"tagdoctype",key:"doctype",condition:"libcode",value:vLibcode}];initNextSelectCombobox("taglibcode",b)}function onHandlerRecord(){if(getValue("barcode").length==0){return openMessageDlg("条码号不能为空")}var a=getValue("barcode");if(a.length>=0){$(".bib-html-data").html("");deleteGridData("holdDataGridList");var b=base_path+"hld/holding/getCheckHoldBarcode.do";var c={};c.barcode=a;$.post(b,c,function(d){if(d.status=="0"){if(d.total>0){holdId=d.rows[0].id;holdrow=d.rows[0];bindDataGridListByBibId(d.rows[0].bibid,"hold");bindDataToBiBByBibId(d.rows[0].bibid);var e=["","","借出","预约/预借"];if(holdrow.status=="2"||holdrow.status=="3"){return openMessageDlg("条码处于["+e[parseInt(holdrow.status)]+"]状态,不能进行当前操作")}onHandlerMian(holdId)}else{return openMessageDlg("未找到合适的条码号")}}else{openMessageDlg(d.message)}},"json")}}function onHandlerMian(c){if(c>0){var a={};a.id=c;a.handletype="5";if(getValue("taglibcode").length>0){a.curlibcode=getValue("taglibcode")}if(getValue("taglocation").length>0){a.curlocation=getValue("taglocation")}if(getValue("tagdoctype").length>0){a.doctype=getValue("tagdoctype")}if(getValue("changelibcode")==0){a.libcode=getValue("taglibcode")}var b=base_path+"hld/holding/handleHolding.do";$.post(b,a,function(d){if(d.status=="0"){showHoldHandlerResult(d,a)}else{openMessageDlg(d.message)}},"json")}else{openMessageDlg("未找到馆藏记录号")}}function showHoldHandlerResult(d,a){var c="";var b="";var e=d.rows[0];c="馆际调拨";b=c+"成功"+getHoldOtherInfo(e,a);$(".hold-result-data").append("
"+b+"
")}function getHoldOtherInfo(c,a){var b="";if(a.curlibcode){b+=",文献馆由["+getCurLibcodeNameByCode(holdrow.curlibcode)+"]改为["+getCurLibcodeNameByCode(c.curlibcode)+"]"}if(a.curlocation){b+=",馆藏地点由["+getCurLocationNameByCode(holdrow.curlocation)+"]改为["+getCurLocationNameByCode(c.curlocation)+"]"}if(a.doctype){b+=",文献类型由["+getDocTypeNameByCode(holdrow.doctype)+"]改为["+getDocTypeNameByCode(c.doctype)+"]"}return b}function getCurLibcodeNameByCode(a){return onGridShowNameBycode("orglibcode",a)}function getCurLocationNameByCode(a){return onGridShowNameBycode("taglocation",a)}function getDocTypeNameByCode(a){return onGridShowNameBycode("tagdoctype",a)}function bindDataToBiBByBibId(c){var a=base_path+"lib/biblios/get.do";var b={};b.id=c;$.post(a,b,function(d){if(d.status=="0"){setBibHtmlShow(d)}else{$(".bib-html-data").html(d.message)}},"json")}function setBibHtmlShow(d){var e=d.rows[0];var c="";var b=[{code:"title",name:"题名"},{code:"author",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+":"+(e[b[a].code]==null?"":e[b[a].code])+""}$(".bib-html-data").html(c)}function bindDataGridListByBibId(a,c){if(a>0){var b=base_path+"hld/holding/page.do";var d={};d.bibid=a;d.rows=10;d.page=1;$("#"+c+"DataGridList").datagrid({url:b,queryParams:d,onLoadSuccess:function(e){},method:"post"})}else{deleteGridData(""+c+"DataGridList")}};