var _rate;$(function(){if($("#setCheckCallNoForId").length>0){$("#setCheckCallNoForId").click(function(){setCheckCallNo("click")})}});var _bibPVG=function(){};_bibPVG.prototype.getDataByBatchno=function(d,c){var b=0;var a=base_path+"par/batchno/get.do";var e={};e.pk=d;$.post(a,e,function(f){if(f.status=="0"){var g=f.rows[0];if(g.bookseller){if(c){setValue(c,g.bookseller)}else{setValue("bookseller",g.bookseller)}}}},"json")};_bibPVG.prototype.enterEvent=function(b,a,e){if(null!=a&&undefined!=a){var c=$("#"+b);if(e){c=$("#"+e+b)}if(c[0]&&c[0].className){var d=c[0].className;if(d!=undefined&&d.indexOf("easyui-textbox")>-1){c.textbox("textbox").keydown(function(f){if(f.keyCode==13){a(b,e)}})}else{if(d.indexOf("easyui-numberbox")>=0){c.numberbox().next("span").find("input").keydown(function(f){if(f.keyCode==13){a(b,e)}})}}}}};_bibPVG.prototype.setPriceApp=function(d,c){for(var b in tooltipJson){var a=tooltipJson[b];if(a.code==d){var e=a.tipList;_bibPVG.prototype.getPriceResult(e,c)}}};_bibPVG.prototype.getValue=function(a){if(a.indexOf("rate")>-1){return _rate}else{if(a.indexOf("discount")>-1){var b=parseFloat(getValue(a)).toFixed(3);if(b<=0){return 1}return b}else{return getValue(a)}}};_bibPVG.prototype.setVPGNewApp=function(n,k){try{if(n.price){var g=/(\d{1,3})+(?:\.\d+)?/g;var l=n.price.match(g);var f=/[¥$CNYUSD]/g;var j=n.price.match(f);var b="";if(j){for(var d=0;d0){var c=$("#"+k+"ncy").combobox("getData");var a=false;for(var d=0;d-1){m+=parseInt(l[d])}}}}if(m>0){setValue(k+"volumes",m)}else{setValue(k+"volumes",1)}}}catch(h){}_bibPVG.prototype.getDataForPrice(k)};_bibPVG.prototype.getDataForPrice=function(b){var a=base_path+"par/rate/getRate.do";var c={};c.originalncy=getValue(b+"ncy");c.conversionncy=getValue(b+"orderncy");$.post(a,c,function(d){if(d.status=="0"){_rate=d.rows[0];_bibPVG.prototype.getPriceResult(initDataForPriceJson,b)}},"json")};_bibPVG.prototype.getPriceResult=function(d,b){if(!b){b=""}for(var a in d){var f=d[a].val;if(f){var c=f.resutl.split("|");var e=0;if(c.length==3){if(c[1]=="*"){e=_bibPVG.prototype.getValue(b+c[0])*_bibPVG.prototype.getValue(b+c[2])}if(c[1]=="/"){if(_bibPVG.prototype.getValue(b+c[2])!="0"){e=_bibPVG.prototype.getValue(b+c[0])/_bibPVG.prototype.getValue(b+c[2])}else{e=0}}}if(c.length==5){if(c[1]=="*"){e=_bibPVG.prototype.getValue(b+c[0])*_bibPVG.prototype.getValue(b+c[2])}if(c[1]=="/"){if(_bibPVG.prototype.getValue(b+c[2])!="0"){e=_bibPVG.prototype.getValue(b+c[0])/_bibPVG.prototype.getValue(b+c[2])}else{e=0}}if(c[3]=="*"){e=e*_bibPVG.prototype.getValue(b+c[4])}if(c[3]=="/"){if(_bibPVG.prototype.getValue(b+c[4])!="0"){e=e/_bibPVG.prototype.getValue(b+c[4])}else{e=0}}}setValue(b+f.tag,e)}}};_bibPVG.prototype.setVPG=function(n,k){try{if(n.price){var g=/(\d{1,3})+(?:\.\d+)?/g;var l=n.price.match(g);var f=/[¥$CNYUSD]/g;var j=n.price.match(f);var b="";if(j){for(var d=0;d0){var c=$("#ncy").combobox("getData");var a=false;for(var d=0;d-1){m+=parseInt(l[d])}}}}if(m>0){setValue(k+"volumes",m)}else{setValue(k+"volumes",1)}}}catch(h){}_bibPVG.prototype.rate(k)};_bibPVG.prototype.getRateApp=function(b){var a=base_path+"par/rate/getRate.do";var c={};c.originalncy=getValue(b+"ncy");c.conversionncy=getValue(b+"orderncy");$.post(a,c,function(d){if(d.status=="0"){_rate=d.rows[0]}},"json")};_bibPVG.prototype.rate=function(c){var d=getValue(c+"price");if(d>0){var b=0;var a=base_path+"par/rate/getRate.do";var e={};e.originalncy=getValue(c+"ncy");e.conversionncy=getValue(c+"orderncy");$.post(a,e,function(f){if(f.status=="0"){b=f.rows[0];if(d>0&&b>0){setValue(c+"orderprice",d*b);_bibPVG.prototype.rateResult(c)}}},"json")}};_bibPVG.prototype.rateResult=function(a){var b=getValue(a+"volumes");if(b>0){setValue(a+"ordertotalprice",getValue(a+"orderprice")*b)}else{setValue(a+"ordertotalprice",getValue(a+"orderprice"))}};_bibPVG.prototype.perRate=function(d,b){var e=getValue(d+"price");if(e>0){var g=getValue(d+"orderprice");if(g==0||b){var c=0;var a=base_path+"par/rate/getRate.do";var f={};f.originalncy=getValue(d+"ncy");f.conversionncy=getValue(d+"orderncy");$.post(a,f,function(i){if(i.status=="0"){c=i.rows[0];if(e>0&&c>0){setValue(d+"orderprice",e*c);var h=getValue(d+"issuenum");if(b){h=parseInt(b)}if(h>0){setValue(d+"ordertotalprice",getValue(d+"orderprice")*h);setValue(""+d+"totalprice",getValue(d+"orderprice")*h)}else{setValue(d+"ordertotalprice",getValue(d+"orderprice"));setValue(""+d+"totalprice",getValue(d+"orderprice")*h)}}_bibPVG.prototype.perRateResult()}},"json")}}};_bibPVG.prototype.perRateResult=function(){};_bibPVG.prototype.perYearPrice=function(c,a,b){$("#"+c+"").numberbox().next("span").find("input").focus(function(d){_bibPVG.prototype.setPerYearPrice(c,a,b)})};_bibPVG.prototype.setPerYearPrice=function(d,b,c){var a=getValue(b+"issuenum");if(c){setValue(d,getValue("price")*a)}else{setValue(d,getValue("orderprice")*a)}};_bibPVG.prototype.volumes=function(b){var a=getValue(b+"ordertotalprice");var c=getValue(b+"volumes");if(a>0&&c>0){setValue(b+"orderprice",a/c)}a=getValue(b+"totalprice");if(a>0&&c>0){setValue(b+"price",a/c)}};_bibPVG.prototype.rateFocus=function(b,a){$("#"+b+"").numberbox().next("span").find("input").focus(function(c){if($("#"+a+"issuenum").length>0){_bibPVG.prototype.perRate(a,getValue(a+"issuenum"))}else{_bibPVG.prototype.rate(a)}}).blur(function(c){if($("#"+a+"issuenum").length>0){_bibPVG.prototype.perRate(a,getValue(a+"issuenum"))}else{_bibPVG.prototype.rate(a)}});if($("#"+a+"issuenum").length>0){$("#"+b+"").numberbox().next("span").find("input").blur(function(c){_bibPVG.prototype.setPerYearPrice("yearprice","")}).focus(function(c){_bibPVG.prototype.setPerYearPrice("yearprice","")})}};_bibPVG.prototype.volumesFocus=function(b,a){$("#"+b+"").numberbox().next("span").find("input").focus(function(c){_bibPVG.prototype.volumes(a)}).blur(function(c){_bibPVG.prototype.volumes(a)})};_bibPVG.prototype.rateBlur=function(b,a){$("#"+b+"").numberbox().next("span").find("input").blur(function(c){if($("#"+a+"issuenum").length>0){_bibPVG.prototype.perRate(a,getValue(a+"issuenum"))}else{_bibPVG.prototype.rate(a)}}).focus(function(c){if($("#"+a+"issuenum").length>0){_bibPVG.prototype.perRate(a,getValue(a+"issuenum"))}else{_bibPVG.prototype.rate(a)}});if($("#"+a+"issuenum").length>0){$("#"+b+"").numberbox().next("span").find("input").blur(function(c){_bibPVG.prototype.setPerYearPrice("yearprice","")}).focus(function(c){_bibPVG.prototype.setPerYearPrice("yearprice","")})}};_bibPVG.prototype.volumesBlur=function(b,a){$("#"+b+"").numberbox().next("span").find("input").blur(function(c){_bibPVG.prototype.volumes(a)}).focus(function(c){_bibPVG.prototype.volumes(a)})};_bibPVG.prototype.getCallnoing=function(a,d,b){var c=base_path+"cat/titlenum/getCurCallno.do";var e={};e.classno=a.classno;e.bibid=!a.bibid?a.id:a.bibid;if(!e.classno){return}if($("#libcode").length>0){e.libcode=getValue("libcode")}else{if($("#checkbib_libcode").length>0){e.libcode=getValue("checkbib_libcode")}}if(!e.libcode){e.libcode=vLibcode}$.post(c,e,function(j){var h="1";var l=null;var i=j.rows[0];if(i.titnum){h=i.titnum}if(i.new_titnum){l=i.new_titnum}auto_callno=i.auto_callno;var k;var f;if(l&&l!=h&&b){if(j.total==0){setValue(d,a.classno+"/");_bibPVG.prototype.getCallnoCallBack(b)}else{var g="";k=i.classno+"/"+h;f=i.classno+"/"+l;g+="
原索书号【'+k+"】
";g+="
新索书号【'+f+"】
";$.messager.show({title:"请选择你要生成的索书号",msg:g,height:"200px",timeout:0,showType:null,style:{}});$(".get-callno-div").each(function(m){$(this).click(function(){$(".messager-body").window("close");setValue(d,$(this).attr("data"))})})}}else{if(j.status=="0"){if(j.total==0){setValue(d,a.classno+"/1")}else{tipNewCallno(l,a.classno,i);setValue(d,i.classno+"/"+h)}}else{if(j.status=="4002"){if(j.total==0){setValue(d,a.classno+"/1")}else{setValue(d,i.classno+"/"+h);tipNewCallno(l,a.classno,i)}}else{if(j.status=="4003"){_bibPVG.prototype.showPy(j,d,a)}else{openMessageDlg(j.message)}}}_bibPVG.prototype.getCallnoCallBack(b)}},"json")};_bibPVG.prototype.getCallno=function(rowBib,obj,event){if(obj=="checkbib_callno"){_bibPVG.prototype.getCallnoCom(rowBib,obj,event,cataConfigData)}else{var fn=eval(parent.getCataConfigData);if(typeof(fn)==="function"){var cataConfigData1=parent.getCataConfigData();_bibPVG.prototype.getCallnoCom(rowBib,obj,event,cataConfigData1)}else{_bibPVG.prototype.getCallnoing(rowBib,obj,event)}}};_bibPVG.prototype.getCallnoCom=function(a,f,e,d){if(d&&d.getCallnoForFld&&d.getCallnoForFld=="905"){var b=!a.bibid?a.id:a.bibid;var c=base_path+"lib/biblios/getMarcRecordForEdit.do";var g={};g.id=b;$.post(c,g,function(o){if(o.status=="0"){var n=o.rows;for(var l=0;l1){var c=q+"_"+b;l=h[0];m=""+r[b].ch+"";d+='
';d+="";for(var a=0;a"+h[a]+""}d+="
"}}}i+=l;k+=m}if(d.length>0){g+="";g+="";g+=k;g+="";g+=""+d+"";g+=""}$(".py-body-list").html(g);$("#pyDlg").dialog("open")};_bibPVG.prototype.savePy=function(){var a={};var i="pinyin";var b="";var k=_pyRows;var e="";for(var c=0;c1){var d=i+"_"+c;var g=$('input:radio[name="'+d+'"]:checked').val()}}}e+=g+" "}getAutPinyinCode(b,e);$("#pyDlg").dialog("close")};function getAutPinyinCode(c,b){var a=base_path+"par/common/getAutPinyinCode.do";var d={};d.request_type=123;d.author=c;d.pinyin=b;$.post(a,d,function(e){if(e.status=="0"){if(e.rows[0]){setValue(_pyObj,_pyRowBib.classno+"/"+e.rows[0])}else{setValue(_pyObj,_pyRowBib.classno+"/1")}getAutPinyinCodeCallBack()}else{openMessageDlg(e.message)}},"json")}function tipNewCallno(c,a,d){if(parseInt(d.titnum)==1&&d.find_flag=="false"){var b=base_path+"par/library/get.do";var e={};e.pk=vLibcode;$.post(b,e,function(h){if(h.status=="0"){var g=h.rows[0];var f=JSON.parse(g.paramjson);if(!f.suo_shu_hao_scxhsfts||f.suo_shu_hao_scxhsfts!="1"){$.messager.alert("消息提示","本次生成的索书号为新索书号【"+a+"/1】,请检查确认!")}}},"json")}}function getAutPinyinCodeCallBack(){}function setCheckCallNo(b){var a=base_path+"lib/biblios/get.do";var c={};c.id=_bibId;$.post(a,c,function(e){if(e.status=="0"){var d=e.rows[0];_bibPVG.prototype.getCallno(d,"callno",b)}else{openMessageDlg(e.message)}},"json")}_bibPVG.prototype.getLocationByClassno=function(a){if(a&&a=="1"){var b=base_path+"lib/biblios/get.do";var c={};c.id=_bibId;$.post(b,c,function(e){if(e.status=="0"){var d=e.rows[0];b=base_path+"par/defloc/getLoccodeByClassno.do";c={};c.classno=d.classno;if(!c.classno){return}c.libcode=vLibcode;$.post(b,c,function(g){if(g.status=="0"){var f=g.rows[0];if(f){setValue("location",f)}}else{}},"json")}},"json")}};_bibPVG.prototype.bulidCallno=function(b,c){var d={};var a=getValue(c);if(!a){return}if(a.length>0&&a.substr(a.length-1,1)=="/"){a=a.substr(0,a.length-1);d.bibid=getValue(b);d.classno=a;_bibPVG.prototype.getCallno(d,c)}else{openMessageDlg("格式为[分类号/]的才能分配索书号,例:A1/")}};var _AutoBarObj=function(){};_AutoBarObj.prototype.updateAutoBarByMaxBar=function(d,c,e){var a=mystorage.get("cat_autobar");if(e){a=e}var b=base_path+"hld/holding/updateCurAutoBarno.do";var f={};f.code=a;f.barno=d;$.post(b,f,function(g){if(g.status=="0"){if(c){c(g)}}else{openMessageDlg(g.message)}},"json")};_AutoBarObj.prototype.updateAutoAssetnoByMaxAssetno=function(d,f){var b=null;if(f){b=f}else{b=JSON.parse(_configData.rows[0].paramjson)}if(b.assetno){var a=b.assetno;var c=base_path+"hld/holding/updateCurAutoAssetno.do";var e={};e.code=a;e.assetno=d;$.post(c,e,function(g){if(g.status=="0"){console.log(g)}else{openMessageDlg(g.message)}},"json")}bv};var batchnoComBoxRows;var batchnoComStatus=false;_bibPVG.prototype.batchnoComBox=function(f,e,b,h,a){if($("#"+f).length>0){var g={page:"1",rows:"500"};var c=0;g["limit["+c+"].condition"]="status";g["limit["+c+"].typeHandler"]="0";g["limit["+c+"].value"]="0";c++;if(a){g["limit["+c+"].condition"]="libcode";g["limit["+c+"].typeHandler"]="0";g["limit["+c+"].value"]=a;c++}else{g["limit["+c+"].condition"]="libcode";g["limit["+c+"].typeHandler"]="3";g["limit["+c+"].value"]=getLibLimitForNoLimitLib();c++}g["limit["+c+"].condition"]="type";g["limit["+c+"].typeHandler"]="0";g["limit["+c+"].value"]=e;c++;g.orderBy=" libcode desc ";var d=base_path+"par/batchno/list.do";$.post(d,g,function(p){var o=[];batchnoComBoxRows=p.rows;for(var m=0;m0){setValue("discount",batchnoComBoxRows[q].discount)}break}}},onClick:function(j,i){batchnoComStatus=true}});_bibPVG.prototype.batchnoComBoxResult(f)},"json")}};_bibPVG.prototype.batchnoComBoxResult=function(a){};_bibPVG.prototype.getAssetnoBySubstr=function(a,b){if(b.length>0){if(a.assetnobegsubstrnum){b=b.substr(parseInt(a.assetnobegsubstrnum))}if(a.assetnoendsubstrnum){b=b.substr(0,b.length-parseInt(a.assetnoendsubstrnum))}}return b};