var _subOrderBibObj=function(){};var _configData;var initJson;var _initdata;var ncyAutoSelect=false;$(function(){_initdata=mystorage.get("cat_init_data");_configData=mystorage.get("cat_config");_bibPVG.prototype.batchnoComBox("batchno",0,"bookseller");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(e,f,g){if(_initdata.rows[0][e.key]){_myPage.prototype.setData(_initdata.rows[0][e.key],e)}});$(".easyui-panel").panel("resize");_subOrderBibObj.prototype.search();for(var d in tooltipJson){var b=tooltipJson[d];var c="
";$("#"+b.code+"Tooltip").tooltip({content:c});_bibPVG.prototype.enterEvent(b.code,_bibPVG.prototype.setPriceApp)}$("#ncy,#orderncy").combobox({onChange:function(f,e){if(ncyAutoSelect){_bibPVG.prototype.getDataForPrice("");ncyAutoSelect=false}else{_bibPVG.prototype.getRateApp("")}},onClick:function(f,e){ncyAutoSelect=true}});$("#acceptFileResultDlg").dialog({onClose:function(){colseParentDlg()}})});_bibPVG.prototype.batchnoComBoxResult=function(){var a=JSON.parse(_configData.rows[0].paramjson);if(a.order_batchno){setValue("batchno",a.order_batchno)}};_subOrderBibObj.prototype.search=function(){$(".acceptTextTip").hide();if(_type=="0"){$(".order-type-div").hide();$(".orderbib-rule-tip").hide()}else{$(".order-type-div").show();$(".orderbib-rule-tip").show()}cleanJsonData("record");var d=base_path+"acq/collect/get.do";var h={};if(parseInt(_id)>0){d=base_path+"acq/order/get.do";h.pk=_id}else{if(parseInt(_bibId)>0){h.id=_bibId}}if(_type=="1"){setTextShowStatus(true);_subOrderBibObj.prototype.setTextByConifg();var a=mystorage.get("acq_suborder_checkedItems");if(a.length>0){$(".orderbib_tip").html("提示:请您确认当前要订购的数量,共选中【"+a.length+"】条记录")}else{$(".orderbib_tip").html("")}var g=mystorage.get("acq_suborder_catacode");setValue("catacode",g);var b=JSON.parse(_configData.rows[0].paramjson);if(b.jgfpfb){var f=JSON.parse(b.jgfpfb);var e="";e+='';e+="";e+="最小价格 | ";e+="最大价格 | ";e+="复本数 | ";e+="
";for(var c=0;c";e+=""+f[c].minprice+" | ";e+=""+f[c].maxprice+" | ";e+=""+f[c].jgfpcopies+" | ";e+=""}e+="
";$(".show-price-copies").tooltip({position:"bottom",content:e});if(b.order_batchno){setValue("batchno",b.order_batchno)}}}else{$.post(d,h,function(i){if(i.status=="0"){_subOrderBibObj.prototype.set(i)}else{openMessageDlg(i.message)}},"json")}};_subOrderBibObj.prototype.set=function(c){var b=JSON.parse(_configData.rows[0].paramjson);if(b.discount){setValue("discount",b.discount)}var d=c.rows[0];if(parseInt(_id)>0){setJsonData(null,d);$(".orderbib_tip").html("提示:请您确认当前订购记录号【"+_id+"】")}else{setValue("order_ids",d.id);_subOrderBibObj.prototype.setTextByConifg();setValue("catacode",d.catacode);_bibPVG.prototype.setVPGNewApp(c.rows[0],"");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(b,e){$(".error-msg-result").html("");if(!b){$.messager.progress({title:"批订购处理",msg:"正在处理数据,请稍等..."});errorcount=0;handlecount=0;successcount=0}if(b){e=b}else{e.rows=200;e.page=1;successcount=0}if(e.order_type=="3"||e.order_type=="4"||e.order_type=="5"){var a=mystorage.get("ser_sub_order_con");if(a){if(a.orderBy){e.orderBy=a.orderBy}if(a.value){e.condition=a.condition;e.value=a.value}for(var c=0;c<4;c++){if(a["limit["+c+"].value"]){e["limit["+c+"].condition"]=a["limit["+c+"].condition"];e["limit["+c+"].value"]=a["limit["+c+"].value"]}}}}var d=base_path+"acq/collect/orderCollectbibs.do";$.post(d,e,function(f){$.messager.progress("close");if(f.status=="0"){var g=f.rows[0];if(g){errorcount+=parseInt(g.errorcount);handlecount+=parseInt(g.handlecount);errorfile=g.errorfile;successcount+=parseInt(g.successcount);if(g.nextpage&&g.nextpage>0){$.messager.progress({title:"批订购处理",msg:"已处理["+handlecount+"]条数据,成功["+successcount+"]条,失败["+errorcount+"]条,请等待处理完成 ..."});e.page=g.nextpage;_subOrderBibObj.prototype.save(e)}else{$(".handlecount").html("已处理["+handlecount+"]条书目数据");$(".successcount").html("成功["+successcount+"]条");$(".errorcount").html("失败["+errorcount+"]条");$("#checkerrorfile").show();$("#acceptFileResultDlg").dialog("open")}}else{openMessageDlg(f.message)}}else{openMessageDlg(f.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){$(".pdg-input").hide()}else{$(".pdg-input").show()}}function subscribeorderReLoadData(a,c,b){_bibId=a;_id=c;_type=b;_initdata=mystorage.get("cat_init_data");_configData=mystorage.get("cat_config");_subOrderBibObj.prototype.search()}function colseParentDlg(){parent.colseIframeDlg("subscribeorder_dlg",null,null)};