var eidtorGridObject=undefined;var eidtorGridIndex=undefined;var callNoItemList;var barcodeItemList;var autoBarRows;var autoAssetnoRows;var holdToolbar=[{text:"删除",iconCls:"e-icon fa fa-remove",handler:function(){removeitEidtorGridRow()}},"-",{text:"根据副本数重新获取验收分配(只有自动生成条码时生效)",iconCls:"e-icon fa fa-th-list",handler:function(){autoBarcodeByCopies()}}];var _checkBibObj=function(){};var _configData;var initJson;var auto_callno=null;var _initdata;$(function(){getMyStorageItemData();_checkBibObj.prototype.batchno();initJson=[{code:"finsources",key:"finsources"},{code:"mediatype",key:"mediatype"},{code:"binding",key:"binding"},{code:"docsources",key:"docsources"},{code:"ncy,orderncy",key:"ncy"},{code:"operid",key:"operid"},{code:"bookseller",key:"bookseller",condition:"libcode",value:vLibcode},{code:"libcode",key:"libcode",condition:"code",value:vLibcode},{code:"location",key:"location",condition:"libcode",value:vLibcode},{code:"doctype",key:"doctype",condition:"libcode",value:vLibcode}];initJson.forEach(function(b,c,d){if(_initdata.rows[0][b.key]){_myPage.prototype.setData(_initdata.rows[0][b.key],b)}});$(".easyui-panel").panel("resize");_checkBibObj.prototype.search();enterEvent("barcode",_checkBibObj.prototype.addHoldRecord);_bibPVG.prototype.rateFocus("orderprice","");_bibPVG.prototype.volumesFocus("volumes","");var a={code:"location",unionlist:[{code:"defdoctype",orgcode:"doctype"}]};_myPage.prototype.initUnionShowByLocation(a);_myPage.prototype.initUnionLocationByLibcode()});_checkBibObj.prototype.batchno=function(){if($("#batchno").length>0){var b={type:"1",page:"1",rows:"500"};b.orderBy=" libcode desc ";var a=base_path+"par/batchno/page.do";$.post(a,b,function(h){var g=[];for(var e=0;e-1){e.push(b[c])}}$("#location").combobox("loadData",e);var g={};g["limit[0].condition"]="code";g["limit[0].typeHandler"]="3";g["limit[0].value"]=getSqlConditionLimitIn(f.showacqloccode);var a=base_path+"par/location/list.do";$.post(a,g,function(m){var r=m.rows;_myLocationData=r;var j=_initdata.rows[0].libcode;var p=[];for(var n=0;n0){a=base_path+"acq/check/get.do";b.pk=_id}if(parseInt(_orderid)>0){a=base_path+"acq/order/get.do";b.pk=_orderid}$.post(a,b,function(c){if(c.status=="0"){_checkBibObj.prototype.set(c)}else{openMessageDlg(c.message)}},"json")};_checkBibObj.prototype.setDataToHoldGrid=function(c){eidtorGridObject=$("#checkhold_eidtorgrid");var a=base_path+"hld/holding/page.do";var b={};b.checkid=c;b.rows=100;b.page=1;eidtorGridObject.datagrid({url:a,queryParams:b,onLoadSuccess:function(d){},method:"post"})};_checkBibObj.prototype.set=function(e){var k=JSON.parse(_configData.rows[0].paramjson);eidtorGridObject.datagrid("loadData",[]);var h=e.rows[0];if(parseInt(_id)>0){setJsonData(null,h);_checkBibObj.prototype.setDataToHoldGrid(h.id);$(".checkbib_tip").html("提示:请您确认当前验收记录号【"+_id+"】")}else{if(parseInt(_orderid)>0){h.id=0;h.orderid=_orderid;setJsonData(null,h);h.classno=mystorage.get("cat_classno");_bibPVG.prototype.getCallno(e.rows[0],"callno");if(k.check_batchno){setValue("batchno",k.check_batchno)}setValue("libcode",vLibcode);_checkBibObj.prototype.setHoldRecordByAutoBar();$(".checkbib_tip").html("提示:请您确认当前订购记录号【"+_orderid+"】")}else{_bibPVG.prototype.setVPG(e.rows[0],"");_bibPVG.prototype.getCallno(e.rows[0],"callno");for(var f=0;f0){var g=b.code.split(",");for(var d=0;d-1){l.push(m[f])}}if(h&&$(h.target)){$(h.target).combobox("loadData",l);$(h.target).combobox("setValue",l[0].code)}}}}}}}},{field:"curlocation",title:"馆藏地点",width:"20%",formatter:onShowLocationName,editor:{type:"combobox",options:{valueField:"code",textField:"name",panelHeight:"200px",groupField:"group",required:true,editable:false,data:$("#location").combobox("getData"),onChange:function(f,d){if(f!=undefined&&f!=d){if(eidtorGridIndex!=undefined){if(a){var b=eidtorGridObject.datagrid("getEditor",{index:eidtorGridIndex,field:"doctype"});for(var c=0;c<_myLocationData.length;c++){if(_myLocationData[c].code==f){var e=_myLocationData[c].defdoctype;$(b.target).combobox("setValue",e);break}}}}}}}}},{field:"doctype",title:"文献类型",width:"20%",formatter:onShowDocTypeName,editor:{type:"combobox",options:{valueField:"code",textField:"name",panelHeight:"200px",groupField:"group",required:true,editable:false,data:$("#doctype").combobox("getData")}}},{field:"barcode",title:"条码号",width:"20%",editor:{type:"text",options:{required:true}}},{field:"assetno",title:"资产号",width:"20%",editor:{type:"text"}}]]});_checkBibObj.prototype.searchResult()};_checkBibObj.prototype.addHoldRecord=function(){var b=JSON.parse(_configData.rows[0].paramjson);var g={};g.libcode=getValue("libcode");g.curlocation=getValue("location");g.doctype=getValue("doctype");g.barcode=getValue("barcode");if(b.autobartoassetno=="1"){g.assetno=g.barcode}if(g.barcode.length==0){return openMessageDlg("条码号不能为空!")}var a=eidtorGridObject.datagrid("getRows");for(var f=0;f-1){var e=g.barcode.split("-");var d=e[1];var c=e[0];_checkBibObj.prototype.setHoldRecord(g,d,c,0)}else{_checkBibObj.prototype.setHoldRecordIsExit(g)}$("#barcode").textbox("textbox").focus().select()};_checkBibObj.prototype.setHoldRecordIsExit=function(c){var b={};b.barcode=c.barcode;b.loantime="999";var a=base_path+"hld/holding/getCheckHoldBarcode.do";$.post(a,b,function(d){if(d.status=="0"){if(d.total>0){openMessageDlg("此条码号已存在!")}else{appendEidtorGridRow(c)}}else{openMessageDlg(d.message)}},"json")};_checkBibObj.prototype.setHoldRecord=function(g,e,c,b){var a=JSON.parse(_configData.rows[0].paramjson);if(parseInt(b)>=parseInt(e)){return}if(parseInt(e)>getValue("copies")){return openMessageDlg("分配的条码不能大于验收的副本数!")}if(parseInt(e)>0){var d=base_path+"hld/holding/getCheckHoldBarcode.do";var f={};f.barcode=c;f.loantime="999";$.post(d,f,function(i){if(i.status=="0"){if(i.total==0){var h={};h.libcode=g.libcode;h.curlocation=g.curlocation;h.doctype=g.doctype;h.barcode=c;if(a.autobartoassetno=="1"){h.assetno=h.barcode}appendEidtorGridRow(h);b=b+1}c=addOne(c);_checkBibObj.prototype.setHoldRecord(g,e,c,b)}else{openMessageDlg(i.message)}},"json")}};function appendRestulFun(){var c=eidtorGridObject.datagrid("getRows");var a=JSON.parse(_configData.rows[0].paramjson);if(a.assetno&&a.autobartoassetno=="0"){autoAssetnoRows=undefined;var b=base_path+"hld/holding/getNextAssetno.do";var d={};d.code=a.assetno;d.count=c.length;$.post(b,d,function(f){if(f.status=="0"){eidtorGridObject.datagrid("loadData",[]);autoAssetnoRows=f.rows;for(var e=0;e0){var l=JSON.parse(o);var h=[];var g=0;for(var n=0;n