var setCheckLocationTitle="";var eidtorGridObject=undefined;var eidtorGridIndex=undefined;var libComBoxData;var locationComBoxData;var allocationType;$(function(){eidtorGridObject=$("#allocationeidtorgrid")});function setCheckLocation(f){allocationType=f;var e="";if(vCurPageFlag=="percheck"){if(f=="checkper"){if(getValue("checkper_copies").length==0){return openMessageDlg("请先设置副本数!")}e=getValue("checkper_allocation")}if(f=="checkdetail"){if(getValue("checkdetail_copies").length==0){return openMessageDlg("请先设置记到册数!")}e=getValue("checkdetail_allocation")}setCheckLocationTitle="记到分配"}else{if(vCurPageFlag=="per"){if(getValue("orderbib_copies").length==0){return openMessageDlg("请先设置副本数!")}setCheckLocationTitle="订购分配";e=getValue("orderbib_allocation")}}initAllocation();eidtorGridObject.datagrid("loadData",[]);if(e.length>0){var g=e.split(",");for(var d=0;d0){libComBoxData=$("#orderbib_libcode").combobox("getData")}a=$("#checkdetail_libcode");if(a.length>0){libComBoxData=$("#checkdetail_libcode").combobox("getData")}locationComBoxData=$("#page_location").combobox("getData");eidtorGridObject.datagrid({iconCls:"e-icon fa fa-table",title:"",fit:true,fitColumns:true,singleSelect:true,border:true,nowrap:false,striped:true,onClickRow:onClickEditorRow,columns:[[{field:"libcode",title:"分馆名称",width:"25%",formatter:onShowLibName,editor:{type:"combobox",options:{valueField:"code",textField:"name",panelHeight:"auto",required:true,data:libComBoxData,onChange:function(e,d){if(e!=undefined&&e!=d){if(eidtorGridIndex!=undefined){var f=eidtorGridObject.datagrid("getEditor",{index:eidtorGridIndex,field:"location"});var b={key:"location",condition:"libcode",value:e};var c=base_path+"par/common/getInitData.do";$.post(c,b,function(g){$(f.target).combobox("loadData",g.rows)},"json")}}}}}},{field:"location",title:"馆藏地点",width:"25%",formatter:onShowLocationName,editor:{type:"combobox",options:{valueField:"code",textField:"name",panelHeight:"auto",required:true,data:locationComBoxData}}},{field:"num",title:"数量",width:"25%",editor:{type:"numberbox",options:{required:true}}}]]})}function addAllocationRecord(){var a={};a.location=getValue("page_location");a.num="1";appendEidtorGridRow(a)}function handlerEidtorGrid(){}function saveAllocationRecord(){var d=allocationType;acceptEidtorGrid();var a=eidtorGridObject.datagrid("getRows");if(a.length==0){return openMessageDlg("请新增分配记录!")}var b=0;var e="";for(var c=0;c