var _subOrderBibObj=function(){};var _configData;var initJson;var _initdata;$(function(){_initdata=mystorage.get("cat_init_data");_configData=mystorage.get("cat_config");_subOrderBibObj.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}];initJson.forEach(function(a,b,c){if(_initdata.rows[0][a.key]){_myPage.prototype.setData(_initdata.rows[0][a.key],a)}});_subOrderBibObj.prototype.search();$("#acceptFileResultDlg").dialog({onClose:function(){colseParentDlg()}});_bibPVG.prototype.rateFocus("orderprice","");_bibPVG.prototype.volumesFocus("volumes","");$(".easyui-panel").panel("resize")});_subOrderBibObj.prototype.batchno=function(){if($("#batchno").length>0){var b={type:"0",page:"1",rows:"500"};var a=base_path+"par/batchno/page.do";$.post(a,b,function(h){var g=[];for(var e=0;e0){b=base_path+"acq/order/get.do";c.pk=_id}else{if(parseInt(_bibId)>0){c.id=_bibId}}if(_type=="1"&&parseInt(_bibId)==0){setTextShowStatus(true);_subOrderBibObj.prototype.setTextByConifg();var a=mystorage.get("acq_suborder_checkedItems");$(".orderbib_tip").html("提示:请您确认当前要订购的数量,共选中【"+a.length+"】条记录")}else{$.post(b,c,function(d){if(d.status=="0"){_subOrderBibObj.prototype.set(d)}else{openMessageDlg(d.message)}},"json")}};_subOrderBibObj.prototype.set=function(b){var c=b.rows[0];if(parseInt(_id)>0){setJsonData(null,c);$(".orderbib_tip").html("提示:请您确认当前订购记录号【"+_id+"】")}else{_bibPVG.prototype.setVPG(b.rows[0],"");setValue("order_ids",c.id);_subOrderBibObj.prototype.setTextByConifg();setValue("catacode",c.catacode);if(_type=="0"){setTextShowStatus(false);$(".orderbib_tip").html("提示:请您确认当前要订购的书目记录号【"+_bibId+"】")}else{setTextShowStatus(true);var a=mystorage.get("acq_suborder_checkedItems");$(".orderbib_tip").html("提示:请您确认当前要订购的数量,共选中【"+a.length+"】条记录")}}};_subOrderBibObj.prototype.setTextByConifg=function(){var a=JSON.parse(_configData.rows[0].paramjson);for(var d=0;d0){var e=g.code.split(",");for(var c=0;c0){e=base_path+"acq/order/update.do"}d.page=1;d.rows=1;$.post(e,d,function(f){if(f.status=="0"){parent.subOrderSaveResult(f,d)}else{openMessageDlg(f.message)}},"json")}else{if(c){onBacthMianFun(c,d)}else{var a=mystorage.get("acq_suborder_checkedItems");d.order_ids=a.join(",");if(d.order_type=="0"&&a.length==0){openMessageDlg("你没有选中需要订购的书目记录!");return}$.messager.confirm("提示消息","您确定要做批订购处理操作吗?",function(f){if(f){onBacthMianFun(c,d)}})}}};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){$.messager.progress({title:"批订购处理",msg:"正在处理数据,请稍等..."})}if(a){c=a}else{c.rows=200;c.page=1;successcount=0}var b=base_path+"acq/collect/orderCollectbibs.do";$.post(b,c,function(d){$.messager.progress("close");if(d.status=="0"){var e=d.rows[0];if(e){errorfile=e.errorfile;successcount+=parseInt(e.successcount);if(e.nextpage&&e.nextpage>0){$.messager.progress({title:"批订购处理",msg:"请等待处理完成 ..."});c.page=e.nextpage;_subOrderBibObj.prototype.save(c)}else{$(".handlecount").html("已处理["+successcount+"]条数据");$(".successcount").html("成功["+successcount+"]条");$(".errorcount").html("失败[0]条");$("#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 setTextShowStatus(a){if(a){$("#price").numberbox("disable");$("#orderprice").numberbox("disable");$("#ordertotalprice").numberbox("disable");$("#totalprice").numberbox("disable");$("#volumes").textbox("disable");$("#volinfo").textbox("disable")}else{$("#price").numberbox("enable");$("#orderprice").numberbox("enable");$("#ordertotalprice").numberbox("enable");$("#totalprice").numberbox("enable");$("#volumes").textbox("enable");$("#volinfo").textbox("enable")}}function subscribeorderReLoadData(a,c,b){_bibId=a;_id=c;_type=b;_subOrderBibObj.prototype.search()}function colseParentDlg(){parent.colseIframeDlg("subscribeorder_dlg",null,null)};