var fieldComBoxData=[{code:"libcode",name:"文献所属馆",param:[{key:"libcode",condition:"code",value:vLibcode}]},{code:"curlibcode",name:"文献所在馆",param:[{key:"curlibcode",condition:"code",value:vLibcode}]},{code:"doctype",name:"文献类型",param:[{key:"doctype",condition:"libcode",value:vLibcode}]},{code:"location",name:"文献所属地点",param:[{key:"location",condition:"libcode",value:vLibcode}]},{code:"curlocation",name:"文献所在地点",param:[{key:"curlocation",condition:"libcode",value:vLibcode}]},{code:"status",name:"馆藏状态",param:[{key:"hldstatus"}]},{code:"senddate",name:"入档日期",data:[{code:"20180101",name:"日期格式"}]},{code:"callno",name:"索书号"},{code:"volumeinfo",name:"卷册说明"}];var jsonGridColumns=[{field:"field",title:"字段名称",width:"120",formatter:onShowJosnComBoxData,editor:{type:"combobox",options:{valueField:"code",textField:"name",panelHeight:"200",required:true,editable:false,groupField:"group",data:fieldComBoxData,loadFilter:function(c){var b=[];for(var a=0;a0){var b="";for(var a=0;a'+c[a].code+"|"+c[a].name+""}$(".otherFormatDesignPanelBody").html(b)}}function onInitEidtorGridDefaultValue(a){var b=eidtorGridObject.datagrid("getEditor",{index:eidtorGridIndex,field:"defvalue"});$(b.target).textbox("setValue",a)}function initFormatDesignGrid(){eidtorGridObject=$("#setFldHandlerGrid");eidtorGridObject.datagrid({iconCls:"e-icon fa fa-cog",fit:true,title:"设置要处理的字段",fitColumns:true,singleSelect:true,border:false,nowrap:false,striped:true,toolbar:toolbar,onClickRow:onClickEditorRow,columns:[jsonGridColumns]})}function onPerviewData(c){$("#showPerviewOrgMarcData").html("");$("#showPerviewTagMarcData").html("");var a=getCurPageRecord();if(!a){return openMessageDlg("请设置你要进行批处理的条件")}if(a){if(c){curPerviewIndex=c}else{curPerviewIndex=1}a.index=curPerviewIndex;var b=base_path+"com/handlebatch/previewHolding.do";$.post(b,a,function(d){if(d.status=="0"){setDataToPageShowPerview(d)}else{if(d.status=="9003"){maxPerviewNum="max";openMessageDlg(d.message)}else{if(d.total>0){curPerviewIndex=d.total+1}openMessageDlg(d.message)}}},"json")}}function getCurPageRecord(){var b=getJsonDataByTypeHandler();if(!b){return openMessageDlg("请设置你要进行批处理的条件")}var c=getSqlConditionInByLibcode();if(c.length>0){b["limit[20].condition"]="libcode";b["limit[20].typeHandler"]="3";b["limit[20].value"]=c}b.opertype=getValue("opertype");if(b.opertype=="0"){acceptEidtorGrid();var a=eidtorGridObject.datagrid("getRows");if(a.length==0){return openMessageDlg("请设置你要批处理的字段")}for(var d=0;d";for(var d=0;d"+g[d].name+":"+f[g[d].field]+""}}$("#showPerviewOrgMarcData").html(e);if(j.newrecord){var h=j.newrecord;e="
"+curPerviewIndex+"
";for(var d=0;d"+g[d].name+":"+h[g[d].field]+""}$("#showPerviewTagMarcData").html(e)}}}function onPerviewNextData(){if(maxPerviewNum){return openMessageDlg("已经是最后一条记录了")}if(curPerviewIndex<500){onPerviewData(curPerviewIndex+1)}else{openMessageDlg("只能预览前500条")}}function onPerviewPrevData(){if(curPerviewIndex>1){onPerviewData(curPerviewIndex-1);maxPerviewNum=undefined}else{openMessageDlg("已经是第一条了")}}function onHandlerBacth(a){var b=getCurPageRecord();if(!b){return openMessageDlg("请设置你要进行批处理的条件")}if(a){onBacthMianFun(a,b)}else{$.messager.confirm("提示消息","您确定要做批处理操作吗?",function(c){if(c){onBacthMianFun(a,b)}})}}function checkErrorFile(){var c=base_path+"com/webuploader/download.do?filename="+errorfile;var b=window.open(c)}function onBacthMianFun(a,c){$(".error-msg-result").html("");if(!a){errorcount=0;handlecount=0;successcount=0;$.messager.progress({title:"数据批处理",msg:"正在处理数据,请稍等..."})}if(a){c=a}else{c.rows=200;c.page=1}var b=base_path+"com/handlebatch/executeHolding.do";$.post(b,c,function(d){$.messager.progress("close");if(d.status=="0"){var e=d.rows[0];if(e){errorfile=e.errorfile;errorcount+=e.errorcount;handlecount+=e.handlecount;successcount+=e.successcount;if(e.nextpage&&e.nextpage>0){$.messager.progress({title:"数据批处理",msg:"已处理["+handlecount+"]条数据,成功["+successcount+"]条,失败["+errorcount+"]条,请等待处理完成 ..."});c.page=e.nextpage;onHandlerBacth(c)}else{$(".handlecount").html("已处理["+handlecount+"]条数据");$(".successcount").html("成功["+successcount+"]条");$(".errorcount").html("失败["+errorcount+"]条");$("#checkerrorfile").show();$("#acceptFileResultDlg").dialog("open")}}else{openMessageDlg(d.message)}}else{openMessageDlg(d.message)}},"json").error(function(){$(".error-msg-result").html("处理数据中途错误,请查看错误文件!");$(".handlecount").html("已处理["+handlecount+"]条数据");$(".successcount").html("成功["+successcount+"]条");$(".errorcount").html("失败["+errorcount+"]条");$("#checkerrorfile").show();$("#acceptFileResultDlg").dialog("open");$.messager.progress("close")})}function setCurImportDataGridHeight(b){var a=$(window).height();var c=a-b;$(".import-data-div").css("height",c+"px");$("#perviewlayout").layout("resize");$(".acceptTextTip").hide()};