var _cataHoldObj=function(){};var _configData;var initJson;var auto_callno;var _updateMaxBarcode;$(function(){var a=mystorage.get("cat_init_data");_configData=mystorage.get("cat_config");if(_type=="1"){a=mystorage.get("per_init_data");_configData=mystorage.get("per_config")}initJson=[{code:"doctype",key:"doctype"},{code:"location",key:"location"},{code:"bindtype",key:"binding"},{code:"docsources",key:"docsources"},{code:"mediatype",key:"mediatype"},{code:"operid",key:"operid"},{code:"libcode",key:"libcode",condition:"code",value:vLibcode}];initJson.forEach(function(b,c,d){if(a.rows[0][b.key]){_myPage.prototype.setData(a.rows[0][b.key],b)}});$("#barcode").textbox("textbox").blur(function(b){_cataHoldObj.prototype.addHoldRecord()});$(".easyui-panel").panel("resize");_cataHoldObj.prototype.search()});_cataHoldObj.prototype.search=function(){cleanJsonData("record");var a=base_path+"lib/biblios/get.do";var b={};if(_id>0){a=base_path+"hld/holding/get.do";b.pk=_id}else{if(_bibId>0){b.id=_bibId}}$.post(a,b,function(c){if(c.status=="0"){_cataHoldObj.prototype.set(c)}else{openMessageDlg(c.message)}},"json")};_cataHoldObj.prototype.save=function(){var b=getJsonData(null,"record");if(!b){openMessageDlg("记录异常");return}if(!b.barcode){openMessageDlg("条码不能为空!");return}if(!b.price){openMessageDlg("价格不能为空!");return}if(!b.callno){openMessageDlg("索书号不能为空!");return}var c=base_path+"hld/holding/saveHolding.do";if(auto_callno){b.auto_callno=auto_callno}var a=JSON.parse(_configData.rows[0].paramjson);b.sysid=a.sysid;$.post(c,b,function(d){if(d.status=="0"){if(_updateMaxBarcode&&_id==0){_AutoBarObj.prototype.updateAutoBarByMaxBar(_updateMaxBarcode,cataHoldSaveResultCallBack)}else{cataHoldSaveResultCallBack(d,b)}}else{openMessageDlg(d.message)}},"json")};function cataHoldSaveResultCallBack(b,a){if(_bibId&&!a){var a={};a.bibid=_bibId}parent.cataHoldSaveResult(b,a.bibid)}_cataHoldObj.prototype.set=function(e){var h=e.rows[0];if(parseInt(_id)>0){setJsonData(null,h);$(".orderbib_tip").html("提示:请您确认当前馆藏记录号【"+_id+"】")}else{_cataHoldObj.prototype.setHoldRecordByAutoBar();var k=JSON.parse(_configData.rows[0].paramjson);for(var f=0;f0){var g=b.code.split(",");for(var d=0;d0){if(_id==0){openMessageDlg("条码号已["+getValue("barcode")+"]存在,请重新输入!")}}}else{openMessageDlg(c.message)}},"json")};function cataholdReLoadData(c,a,b){_id=c;_bibId=a;_type=b;closeMessageDlg();_cataHoldObj.prototype.search()}function ikownDlg(){$("#global-message-dlg").dialog("close");$("#barcode").textbox("textbox").focus().select()}function colseParentDlg(){parent.colseIframeDlg("catahold_dlg",null,null)};