Edit D:\rfid\libsystem\page\circulation\js\cirspeloan.js
var onCloseCallFunName=undefined;var VPAGEFIN="circulation";var frequencyRows;var objfocus;var initJson;$(function(){initJson=[{key:"rdrtype",condition:"libcode",value:vLibcode},{code:"page_libcode,libcode,curlibcode",key:"libcode",condition:"code",value:vLibcode},{code:"rdrstatus",key:"rdrstatus"},{code:"page_sysid",key:"sysid"},{code:"finsearchfintype",key:"fintype"},{code:"finsearchrectype",key:"rectype"},{code:"finsearchpayway",key:"payway"}];_myPage.prototype.initData(initJson);$("#cirDataGridList").datagrid({onSelect:onSelectCirDataGridList,onDblClickRow:onDblClickCirDataGridListRow,rowStyler:rowCirOverdueStyler});$("#acqDataGridList").datagrid({onSelect:onSelectAcqDataGridList,onDblClickRow:onDblClickAcqFun});enterEvent("keyword",searchRdrRecord);enterEvent("barcode",serachBibOk);enterEvent("destoryMoney",destoryBook);enterEvent("curlostRate",lostBook);circurlationHandler(vType);initServiceSelect("1");initIndexCommbox();$(".easyui-panel").panel("resize");enterEvent("syear",getFocusToVolnum);enterEvent("svolnum",loanBookOK)});function getFrequencyList(){var a=base_path+"par/common/getInitData.do";var b={fmt:"entity",key:"frequency"};$.post(a,b,function(c){if(c.total>0){console.log(c);frequencyRows=c.rows}},"json")}function getFocusToVolnum(){$("#svolnum").numberbox("textbox").focus()}_myPage.prototype.onLoadSuccess=function(a,b){getPageConfig("page_type",callSetParaResult);_fmtGridDataRows=a};function callSetParaResult(c){if(c.status=="0"){var b=c.rows[0];var a=JSON.parse(b.paramjson);setValue("index",a.rdrSearchWay);setValue("bibindex",a.bookSearchWay);setJsonData("page_",a);setWebSocket(a)}}function initIndexCommbox(){var b={key:"bibindex"};var a=base_path+"par/common/getInitData.do";$.post(a,b,function(c){$("#bibindex").combobox({data:c.rows,valueField:"code",textField:"name",loadFilter:function(d){var e={};e={};e.code="SPM";e.name="?????";d.splice(0,0,e);e={};e.code="SEPBAR";e.name="??????";d.splice(0,0,e);return d},onLoadSuccess:function(){$(this).combobox("select","ISBN")}});$("#page_bookSearchWay").combobox({data:c.rows,valueField:"code",textField:"name",onLoadSuccess:function(){$(this).combobox("select","ISBN")}})},"json")}function barReturnApp(){var a=base_path+"cir/speloan/return.do";var b={};b.loankey=getValue("barcode");$.post(a,b,function(c){if(c.status=="0"){var d=c.rows[0];updateDataGirdList(d);if(parseInt(getValue("curloan"))>0){setValue("curloan",parseInt(getValue("curloan"))-1)}}else{openCirMessageDlg(c.message,getFocusHoldins)}},"json")}function serachBibOk(){var e={};if(getValue("barcode").length==0){return openMessageDlg("????????????")}if(vType=="barreturn"){barReturnApp()}else{$("#tabsGrid").tabs("select",1);var c=0;var d=$("#acqDataGridList").datagrid("getSelected");if(d){c=$("#acqDataGridList").datagrid("getRowIndex",d)}var b=base_path+"lib/biblios/page.do";deleteGridData("acqDataGridList");e.rows=10;e.page=1;e.condition=getValue("bibindex");e.value=getValue("barcode");if(getValue("page_sysid").length>0){e["limit[0].condition"]="sysid";e["limit[0].value"]=getValue("page_sysid")}if(e.condition=="SPM"){if((e.value.length!=13&&e.value.length!=15)||e.value.toString().substr(0,3)!="977"){return openCirMessageDlg("?????????",getFocusHoldins)}e.condition="ISBN"}if(getValue("page_libcode").length>0){e["limit[1].condition"]="libcode";e["limit[1].typeHandler"]="3";e["limit[1].value"]=getSqlConditionLimitIn(getValue("page_libcode"))}if(e.value.indexOf("|")>0){var a=e.value.split("|");if(a&&a.length>0){e.value=a[0]}}if(e.condition=="SEPBAR"){e={};b=base_path+"/cir/speloan/getBookInfoByVBar.do";e.vbarcode=getValue("barcode")}$("#acqDataGridList").datagrid({url:b,queryParams:e,onLoadSuccess:function(f){if(f.total==1){if(getValue("bibindex")=="SEPBAR"){$("#acqDataGridList").datagrid("selectRow",0);d=$("#acqDataGridList").datagrid("getSelected");loanBookOK(e.vbarcode,d)}else{$("#acqDataGridList").datagrid("selectRow",0);d=$("#acqDataGridList").datagrid("getSelected");speLoanOpenDlgFun(d,"svolnum")}}else{if(f.total>0){$("#acqDataGridList").datagrid("selectRow",c)}else{openCirMessageDlg("??????????????!",getFocusHoldins)}}},method:"post"})}}function rowCirOverdueStyler(a,b){if(b.returndate<getCurDateYMD()){return"color:red;"}}function onSelectCirDataGridList(a,b){setJsonData(null,b);if(vType=="return"||vType=="barrenew"){$("#barcode").textbox("textbox").focus()}}function onSelectAcqDataGridList(a,b){setJsonData(null,b)}function onDblClickCirDataGridListRow(a,b){if(vType=="return"){openConfirmDlg("???????????????????,????????????",null,returnBookRecordResult,null)}else{if(vType=="cardrenew"){openConfirmDlg("???????????????????,?????????????",null,renewBookRecordResult,null)}else{if(vType=="destory"){openConfirmDlg("???????????????????,????????????",null,destoryBookRecordResult,null)}else{if(vType=="lost"){openConfirmDlg("???????????????????,????????????",null,lostBookRecordResult,null)}}}}}function circurlationHandler(a){$(".returndate-div").hide();vType=a;var c;var b;if(a=="loan"){c="??";b="???"}else{if(a=="return"||a=="barreturn"){c="??";b="???"}else{if(a=="cardrenew"){c="??";b="???????"}else{if(a=="barrenew"){c="??";b="???????"}else{if(a=="destory"){c="??";b="???"}else{if(a=="lost"){c="??";b="???"}else{if(a=="close"){c="??";b="??????"}}}}}}}$(".cir-handler-tip").html(b+"???");$(".cir-handler-title").html(c);focusToTextByType(a)}function searchRdrRecordResult(a){var b=a.rows[0];setJsonData(null,b);setValue("rdrstatus",b.status);setValue("rdrid",b.id);getCirDataGridList(b.id)}function getComCirDataGridList(b){var a=base_path+"hld/holding/listHoldingWithBib.do";var c={};clearGridData("cirComDataGridList");c.rows=10;c.page=1;c.rdrid=b;$("#cirComDataGridList").datagrid({url:a,queryParams:c,onLoadSuccess:function(e){var d=$("#tabsGrid").tabs("getTab",2);updateTabsTitle(d,"??????????",e)},method:"post"})}function updateTabsTitle(a,c,b){if(b.total>0){c=""+c+'(<span style="color:red;">'+b.total+"</span>)"}$("#tabsGrid").tabs("update",{tab:a,options:{title:c}})}function searchHoldRecord(){var a=base_path+"hld/holding/getHoldingWithBib.do";var b={};if(getValue("barcode").length==0){return openCirMessageDlg("???????????",getFocusHoldins)}b.barcode=getValue("barcode");$.post(a,b,function(c){if(c.status=="0"){var d=c.rows[0];setJsonData(null,d);cirHandlerApp()}else{openCirMessageDlg(c.message,getFocusHoldins)}},"json")}function cirHandlerApp(){if(vType=="loan"){loanBook()}}function onDblClickAcqFun(a,b){if(getValue("bibindex")!="SEPBAR"){$.messager.confirm("??????","???????????????????????",function(c){if(c){speLoanOpenDlgFun(b,"syear")}})}}function speLoanOpenDlgFun(d,b){objfocus=b;setValue("syear","");setValue("svolnum","");var c={};c.condition=getValue("bibindex");c.value=getValue("barcode");if(c.condition=="SPM"&&(c.value.length==13||c.value.length==15)){if(c.value.length==13){setValue("syear","20"+c.value.substring(10,12))}if(c.value.length==15){setValue("syear","20"+c.value.substring(10,12));setValue("svolnum",c.value.substring(13,15))}}else{if(c.value.indexOf("|")>0){var a=c.value.split("|");if(a&&a.length>1){setValue("syear",a[1])}if(a&&a.length>2){setValue("svolnum",a[2])}}else{setValue("syear",getCurDateYMD().substring(0,4));getBibOrderInfo(d)}}$("#loanBookDlg").dialog("open")}function getBibOrderInfo(c){var b={};b.bibid=c.id;var a=base_path+"per/order/page.do";$.post(a,b,function(e){if(e.status=="0"){var f=e.rows[0];if(f){setValue("syear",f.orderyear);if(f.issuenum){var d=getVolnumByFrequency(f.issuenum);setValue("svolnum",d)}}}else{openMessageDlg(e.message)}},"json")}function getVolnumByFrequency(b){var a=new Date();var c=a.getMonth()+1;if(b=="1"){return b}if(b=="2"){if(c>6){return 1}return 2}if(b=="4"){if(c>9){return 4}if(c>6){return 3}if(c>3){return 2}return 1}if(b=="6"){return Math.floor(c/2)}if(b=="12"){return c+1}if(b=="24"){return c*2}if(b=="36"){return c*3}if(b=="52"){return getWeek()}if(b=="365"||b=="366"){return getDays()}return 1}function getWeek(){var b,a,c=new Date();c.setDate(c.getDate()+4-(c.getDay()||7));b=c.getTime();c.setMonth(0);c.setDate(1);a=Math.floor(Math.round((b-c)/86400000)/7)+1;return a}function getDays(){var a,c,b=new Date();b.setDate(b.getDate()+4-(b.getDay()||7));a=b.getTime();b.setMonth(0);b.setDate(1);c=Math.floor(Math.round((a-b)/86400000))+1;return c}function onOpenLoanBookDlg(){if(objfocus&&objfocus=="svolnum"){$("#svolnum").textbox("textbox").focus()}else{$("#syear").numberbox("textbox").focus()}}function loanBookOK(b,e){var c=base_path+"cir/speloan/loan.do";var d={};if(getValue("rdrno").length==0){return openCirMessageDlg("?????????????",getFocusReader)}d.rdrno=getValue("rdrno");d.bibid=getValue("id");d.loankey=getValue("barcode");d.location=getValue("service");if(!b){if(d.loankey.indexOf("|")>0){var a=d.loankey.split("|");if(a&&a.length>0){d.loankey=a[0]}}if(getValue("syear").length>0){d.loankey=d.loankey+"|"+getValue("syear")}if(getValue("svolnum").length>0){d.loankey=d.loankey+"|"+getValue("svolnum")}}else{d.bibid=e.bibid}$.post(c,d,function(f){if(f.status=="0"){$("#loanBookDlg").dialog("close");$("#tabsGrid").tabs("select",0);var g=f.rows[0];updateDataGirdList(g);setValue("curloan",parseInt(getValue("curloan"))+1)}else{openCirMessageDlg(f.message,getFocusHoldins)}},"json")}function loanBook(){var a=base_path+"cir/speloan/loan.do";var b={};if(getValue("rdrno").length==0){return openCirMessageDlg("?????????????",getFocusReader)}b.rdrno=getValue("rdrno");b.bibid=getValue("bibid");b.location=getValue("service");$.post(a,b,function(c){if(c.status=="0"){var d=c.rows[0];updateDataGirdList(d);setValue("curloan",parseInt(getValue("curloan"))+1)}else{openCirMessageDlg(c.message,getFocusHoldins)}},"json")}function returnBookRecordResult(b){var a=base_path+"cir/speloan/return.do";var d={};var c=$("#cirDataGridList").datagrid("getSelected");if(c){d.id=c.id;$.post(a,d,function(e){if(e.status=="0"){var f=e.rows[0];updateDataGirdList(f);if(parseInt(getValue("curloan"))>0){setValue("curloan",parseInt(getValue("curloan"))-1)}}else{openCirMessageDlg(e.message,getFocusHoldins)}},"json")}}function barRenewBook(){if(getValue("barcode").length==0){return openCirMessageDlg("???????????",getFocusHoldins)}renewBookRecordResult()}function renewBookRecordResult(a){var b=base_path+"cir/speloan/renew.do";var d={};var c=$("#cirDataGridList").datagrid("getSelected");if(c){d.id=c.id;$.post(b,d,function(e){if(e.status=="0"){var f=e.rows[0];updateDataGirdList(f)}else{openCirMessageDlg(e.message,getFocusHoldins)}},"json")}}function destoryBookRecordResult(){var a=$("#cirDataGridList").datagrid("getSelected");setValue("bibPrice",a.price);setValue("destoryMoney","");$("#destoryHandlerDlg").window("open")}function onOpenDestoryDlg(){$("#destoryMoney").textbox("textbox").focus()}function destoryBook(){if(getValue("destoryMoney")>0){var c=$("#cirDataGridList").datagrid("getSelected");var a=base_path+"cir/speloan/damage.do";var b={};b.id=c.id;b.money=getValue("destoryMoney");$.post(a,b,function(d){if(d.status=="0"){$("#destoryHandlerDlg").window("close");var e=d.rows[0];updateDataGirdList(e)}else{openCirMessageDlg(d.message,getFocusHoldins)}},"json")}else{openMessageDlg("??????????????????0")}}function lostBookRecordResult(){var a=$("#cirDataGridList").datagrid("getSelected");setValue("lostBibPrice",a.price);setValue("curlostRate","");$("#lostHandlerDlg").window("open")}function onOpenLostDlg(){$("#curlostRate").textbox("textbox").focus()}function lostBook(){if(parseFloat(getValue("service"))>0){var c=$("#cirDataGridList").datagrid("getSelected");var a=base_path+"cir/speloan/lost.do";var b={};b.id=c.id;b.money=getValue("curlostRate");$.post(a,b,function(d){if(d.status=="0"){$("#lostHandlerDlg").window("close");var e=d.rows[0];updateDataGirdList(e)}else{openCirMessageDlg(d.message,getFocusHoldins)}},"json")}else{openMessageDlg("??????????????????????????????????????????????????")}}function updateDataGirdList(a){getCirDataGridList(a.rdrid);setValue("index","rdrno");setValue("keyword",a.rdrno);searchRdrRecord(a);insertCirResultDataGridListRow(a)}function getCirDataGridList(b){getComCirDataGridList(b);getSepCirDataGridList(b);var a=base_path+"cir/speloan/pageCurLoan.do";var c={};setValue("curloan","0");clearGridData("cirDataGridList");c.rows=10;c.page=1;c.rdrid=b;c.location=getValue("service");$("#cirDataGridList").datagrid({url:a,queryParams:c,onLoadSuccess:function(e){var d=$("#tabsGrid").tabs("getTab",0);updateTabsTitle(d,"???????",e);if(e.total>0){setValue("curloan",e.total)}},method:"post"})}function getSepCirDataGridList(b){createSepGridList();var a=base_path+"cir/speloan/pageCurLoan.do";a=base_path+"cir/speloan/listUnion.do";var c={};clearGridData("sepDataGridList");c.rows=10;c.page=1;c["limit[0].condition"]="rdrid";c["limit[0].typeHandler"]="0";c["limit[0].value"]=b;c["limit[1].condition"]="location";c["limit[1].typeHandler"]="8";c["limit[1].value"]=getValue("service");$("#sepDataGridList").datagrid({url:a,queryParams:c,onLoadSuccess:function(e){var d=$("#tabsGrid").tabs("getTab",3);updateTabsTitle(d,"?????????",e)},method:"post"})}function createSepGridList(){var b=[{field:"libcode",title:"????????",formatter:onShowLibName,width:80},{field:"loankey",title:"??????",width:100},{field:"loandate",title:"??????",formatter:onShowFmtDate,width:80},{field:"loantime",title:"??????",formatter:onShowFmtDate,width:80},{field:"returndate",title:"??????",formatter:onShowLibName,width:80},{field:"renewnum",title:"???????",width:60},{field:"title",title:"???",width:200},{field:"isbn",title:"???????",width:80},{field:"author",title:"ISBN??",width:100},{field:"price",title:"???",width:60}];var a=$("#sepDataGridList");if(!a.attr("class")){a.datagrid({iconCls:"e-icon fa fa-table",title:"",fit:true,fitColumns:true,singleSelect:true,border:false,nowrap:false,pagination:true,striped:true,onClickRow:onClickEditorRow,columns:[b]})}}function getFocusByPara(){var b=getValue("page_barcodetordrno");if(b>0){var a=parseInt(b);setTimeout(getFocusBarcodeToRdrno,a)}}function getFocusBarcodeToRdrno(){circurlationHandler("???")}function focusToTextByType(a){$("#keyword").next().show();$("#index").next().show();$("#barcode").next().hide();$(".loan-barcode-tip").hide();$("#keyword").textbox("textbox").focus().select();$("#bibindex").combobox({disabled:false});if(a=="barreturn"){$("#keyword").next().hide();$("#index").next().hide();$("#barcode").next().show();$(".loan-barcode-tip").show();setValue("bibindex","SEPBAR");$("#barcode").textbox("textbox").focus().select();$("#bibindex").combobox("disable")}}function getFocusBarCode(){if(vType=="loan"){$("#barcode").next().show();$(".loan-barcode-tip").show();$("#barcode").textbox("textbox").focus().select()}}function getFocusHoldins(){$("#barcode").textbox("textbox").focus().select()}function getFocusReader(){$("#keyword").textbox("textbox").focus().select();$("#barcode").next().hide();$(".loan-barcode-tip").hide()}function openCirMessageDlg(b,a){$("#circulationTipDlg").dialog("open");$(".circulation-message-body").html(b);$(".iKnow-close").focus();onCloseCallFunName=a}function onCloseCirTipDlg(){if(onCloseCallFunName){onCloseCallFunName()}}function iKnow(){$("#circulationTipDlg").dialog("close")}function setPara(){onSerachRdrBarcode();$("#pageconfig_setpara_dlg").window("open")}function onSerachRdrBarcode(){clearGridData("rdrBarcodeDataGridList,holdBarcodeDataGridList");var a=base_path+"par/common/getInitData.do?key=barformat&type=type&value=1";var b={};$("#rdrBarcodeDataGridList").datagrid({url:a,queryParams:b,onLoadSuccess:function(c){},method:"post"});a=base_path+"par/common/getInitData.do?key=barformat&type=type&value=0";var b={};$("#holdBarcodeDataGridList").datagrid({url:a,queryParams:b,onLoadSuccess:function(c){},method:"post"})};
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de