var eidtorGridObject=undefined;var eidtorGridIndex=undefined;var _perCheckObj=function(){};var _configData;var initJson;var _initdata;var autoSelect=true;var locToolbar=[{text:"新增",iconCls:"e-icon fa fa-plus",handler:function(){var a={};appendEidtorGridRow(a)}},"-",{text:"删除",iconCls:"e-icon fa fa-remove",handler:function(){removeitEidtorGridRow()}}];$(function(){_initdata=mystorage.get("per_init_data");_configData=mystorage.get("per_config");initJson=[{code:"finsources",key:"finsources"},{code:"mediatype",key:"mediatype"},{code:"binding",key:"binding"},{code:"docsources",key:"docsources"},{code:"ncy,orderncy",key:"ncy"},{code:"pertype",key:"pertype"},{code:"operid",key:"operid"},{code:"ordertype",key:"perordertype"},{code:"rerFrequencyNum",key:"rerFrequencyNum"},{code:"frequency",key:"frequency"},{code:"bookseller",key:"bookseller",condition:"libcode",value:vLibcode},{code:"libcode",key:"libcode",condition:"code",value:vLibcode}];$("#rerFrequencyNum").combobox({data:_initdata.rows[0].frequency,valueField:"code",textField:"frequency",onLoadSuccess:function(){}});$("#frequency").combobox({onSelect:function(a){if(a!=null&&!autoSelect){setValue("rerFrequencyNum",a.code);setValue("issuenum",$("#rerFrequencyNum").combobox("getText"));_bibPVG.prototype.perRate("",$("#rerFrequencyNum").combobox("getText"));_bibPVG.prototype.setPerYearPrice("yearprice","","price")}},onClick:function(b,a){autoSelect=false}});initJson.forEach(function(a,b,c){if(_initdata.rows[0][a.key]){_myPage.prototype.setData(_initdata.rows[0][a.key],a)}});$(".easyui-panel").panel("resize");_perCheckObj.prototype.search();_perCheckObj.prototype.initGrid();_bibPVG.prototype.perYearPrice("yearprice","","price")});_perCheckObj.prototype.initGrid=function(){eidtorGridObject=$("#location_eidtorgrid");eidtorGridObject.datagrid({iconCls:"e-icon fa fa-table",title:"订购分配",fit:true,toolbar:locToolbar,fitColumns:true,singleSelect:true,border:true,nowrap:false,striped:true,onClickRow:onClickEditorRow,columns:[[{field:"libcode",title:"分馆名称",width:"33%",formatter:onShowLibName,editor:{type:"combobox",options:{valueField:"code",textField:"name",panelHeight:"160px",required:true,editable:false,data:$("#libcode").combobox("getData"),onChange:function(d,c){if(d!=undefined&&d!=c){if(eidtorGridIndex!=undefined){var e=eidtorGridObject.datagrid("getEditor",{index:eidtorGridIndex,field:"location"});var a={key:"location",condition:"libcode",value:d};var b=base_path+"par/common/getInitData.do";$.post(b,a,function(f){try{$(e.target).combobox("loadData",f.rows)}catch(g){}},"json")}}}}}},{field:"location",title:"馆藏地点",width:"33%",formatter:onShowLocationNameByMyStorage,editor:{type:"combobox",options:{valueField:"code",textField:"name",panelHeight:"160px",groupField:"group",required:true,editable:false,data:_initdata.rows[0].location}}},{field:"copies",title:"数量",width:"34%",editor:{type:"numberbox",options:{required:true}}}]]})};_perCheckObj.prototype.search=function(){cleanJsonData("record");var a=base_path+"lib/biblios/get.do";var b={};if(parseInt(_id)>0){a=base_path+"per/check/get.do";b.pk=_id}else{if(parseInt(_bibId)>0){b.id=_bibId}}$.post(a,b,function(c){if(c.status=="0"){_perCheckObj.prototype.set(c)}else{openMessageDlg(c.message)}},"json")};_perCheckObj.prototype.set=function(b){var c=b.rows[0];if(parseInt(_id)>0){setJsonData(null,c);var a=c.allocation;if(a){_perCheckObj.prototype.setDataToEidtGird(a)}else{clearGridData("location_eidtorgrid")}$(".orderbib_tip").html("提示:请您确认当前总记到记录号【"+_id+"】")}else{clearGridData("location_eidtorgrid");_bibPVG.prototype.setVPG(b.rows[0],"");setTextShowStatus(false);setValue("orderno",c.orderno);_perCheckObj.prototype.setTextByConifg();$(".orderbib_tip").html("提示:请您确认当前要订购的书目记录号【"+_bibId+"】")}};_perCheckObj.prototype.setDataToEidtGird=function(e){clearGridData("location_eidtorgrid");if(e.length>0){var f=e.split(",");for(var d=0;d0){var d=f.code.split(",");for(var b=0;b0){for(var f=0;f0&&g!=d.copies){return openMessageDlg("分配数量合计必须和副本数相同!")}}d.allocation=h;var a=getValue("id");var e=base_path+"per/check/insert.do";if(a>0){e=base_path+"per/check/update.do"}onHnadlerSvaeBntScreen("saveOrderBibBnt",true);$.post(e,d,function(j){onHnadlerSvaeBntScreen("saveOrderBibBnt",false);if(j.status=="0"){var i=j.rows[0];parent.perCheckSaveResult(j,i.bibid)}else{openMessageDlg(j.message)}},"json")};function setTextShowStatus(a){}function onShowLocationNameByMyStorage(b,c){var d=_initdata.rows[0].location;if(b){for(var a=0;a