Edit D:\rfid\apache-tomcat-8.5.32\webapps\libsystem\page\periodical\js\per_check.js
var initJson; var checkdetailId; var checkdetailIdx; var checkdetailData; var eidtorAutoBindGridObject = undefined; var eidtorAutoBindGridIndex = undefined; var perCheckController = function() {}; var gridShowColumnPageId = "5201"; $(function(){ //????? ???????? combox perCheckController.prototype.init(); //?????? perCheckController.prototype.bind(); $(window).on('scroll', () => { var wintop = $(window).scrollTop(); // ???????????? // var ScrollBottom = $("body").height() - $(window).height() - $(window).scrollTop(); if (wintop > 362) { $(".my-days-thead .my-th-w").css({ "width":$('.my-float-h').width(), "min-width":$('.my-float-h').width(), "max-width":$('.my-float-h').width() }); $(".my-days-thead").addClass("check-days-thead"); } else { $(".my-days-thead").removeClass("check-days-thead"); } }); }); function initEditGridViewByTabsLeftGrid(){ bibController.prototype.initEditGridView(); } var tabsRightGridController = function(){} function onLoadBySouth(){ perCheckController.prototype.initOtherGridBySouth(); $('#tabsRightGrid').tabs({ onSelect : tabsRightGridController.prototype.tabsGridSelect }); if(vFlag == 0){ $(".check-tools").show(); } } tabsRightGridController.prototype.tabsGridSelect = function(title,index){ tabsRightGridController.prototype.tools(title,index); } tabsRightGridController.prototype.tools = function(title,index){ $(".check-tools").hide(); $(".bind-tools").hide(); $(".hold-tools").hide(); if(index == 0 && vFlag == 0){ $(".check-tools").show(); } if(index == 2 && vFlag == 1){ $(".bind-tools").show(); } if(index == 3){ $(".hold-tools").show(); } $('#tabsGrid').tabs('resize'); } /** * ?????? */ perCheckController.prototype.bind = function(){ $('#tabsLeftGrid').tabs({ onSelect : tabsLeftGridController.prototype.tabsGridSelect }); enterEvent("barcode",addXNBarcodeToCheck); } perCheckController.prototype.trash = function(){ var row = $("#bindDataGridList").datagrid('getSelected'); if(!row){ return openMessageDlg('?????????¤?????????,??????'); } $.messager.confirm('??????', '???????????????['+row.id+']??????????????', function(r){ if (r){ var param = {}; param.pk = row.id; var url = base_path + 'per/bind/delete.do'; $.post(url, param, function(data) { if (data.status == "0") { openMessageDlg(data.message,5000); bibGlobalController.prototype.loadGridData(row.bibid,"bind",vType,"tabsRightGrid",2,"??????"); }else{ openMessageDlg(data.message); } }, 'json'); } }); } var tabsLeftGridController = function(){} tabsLeftGridController.prototype.tabsGridSelect = function(title,index){ if(index == 1){ var rowData = $("#acqDataGridList").datagrid('getSelected'); if(rowData){ if($("#editBibGrid").attr("class")){ bibController.prototype.setDataByGirdSelect(rowData.id); }else{ setTimeout(function(){bibController.prototype.setDataByGirdSelect(rowData.id);}, 500); } _linkbuttonObj.prototype.status(null,rowData); } } } perCheckController.prototype.init = function(){ //??? ?????? initJson=[ {"code":"page_sysid","key": "sysid","condition": "type","value": vType,"linkage":[ {"code":"page_template","key": "template","condition": "sysid","callfun":"templateApp","callfun":"templateApp"} ]}, //????????????linkage????? {"code":"page_ctrlno","key": "ctrlno","condition": "libcode","value": vLibcode}, //????? {"code":"page_z3950","key": "z3950","condition": "libcode","value": vLibcode}, //z3950 {"code":"page_editmodel","key": "editmodel"}, //editmodel {"code":"page_finsources","key": "finsources"}, //finsources {"code":"page_mediatype","key": "mediatype"}, //mediatype {"code":"page_binding","key": "binding"}, //mediatype {"code":"page_docsources","key": "docsources"}, //mediatype {"code":"page_ncy","key": "ncy"}, //mediatype {"code":"page_bookseller","key": "bookseller","condition": "libcode","value":vLibcode}, //???????? {"code":"page_location,location","key": "location","condition": "libcode","value": vLibcode}, //?????? {"code":"page_doctype,doctype","key": "doctype","condition": "libcode","value": vLibcode}, //?????? {"code":"page_pertype","key": "pertype"}, {"code":"acqstatus","key": "acqstatus"}, {"code":"operid","key": "operid"}, {"code":"libcodeSelect","key": "libcode","condition": "code","value": vLibcode}, //??? {"code":"frequency","key": "frequency","fmt":"entity"}, {"code":"ordertype","key": "perordertype"}, {"code":"status","key": "percheckstatus"} ]; _myPage.prototype.getLoadData(initJson); perCheckController.prototype.initAcqGrid(); otherLayResizeToMy(); } _myPage.prototype.getLoadSuccess = function(data,param){ mystorage.set("per_init_data", data); _fmtGridDataRows = data; perComSearch.prototype.init(); } perCheckController.prototype.initAcqGrid = function(){ var acqGridObject = $("#acqDataGridList"); if (!acqGridObject.attr("class")) { acqGridObject.datagrid({ singleSelect : true, fit : true, fitColumns : true, pagination : true, striped : true, border:false, rowStyler : rowStylerIsUpdateByLibcode, onSelect : perCheckController.prototype.acqSelect, onDblClickRow:perCheckController.prototype.onDblClickRow, onHeaderContextMenu : function(e, field) { e.preventDefault(); if (!bindTableMenu) { createColumnMenu(acqGridObject); } bindTableMenu.menu('show', { left : e.pageX, top : e.pageY }); }, columns : [bibGridColumns] }); $('#acqDataGridList').datagrid('showColumn','orderno'); $('#acqDataGridList').datagrid('showColumn','unifiedno'); $('#acqDataGridList').datagrid('showColumn','hxqk'); var title=$('#acqDataGridList').datagrid('getColumnOption','title'); title.title='???'; var isbn=$('#acqDataGridList').datagrid('getColumnOption','isbn'); isbn.title='ISSN??'; loadGridShowColumnApp("acqDataGridList"); } } perCheckController.prototype.acqSelect = function(index, rowData){ if(!isUpdateByLibcode(rowData.libcode)) { _linkbuttonObj.prototype.status(true,rowData); }else{ _linkbuttonObj.prototype.status(false,rowData); } bibGlobalController.prototype.loadGridData(rowData.id,"check",vType,"tabsRightGrid",0,"?????"); bibGlobalController.prototype.loadGridData(rowData.id,"order",vType,"tabsRightGrid",1,"???"); bibGlobalController.prototype.loadGridData(rowData.id,"bind",vType,"tabsRightGrid",2,"??????"); bibGlobalController.prototype.loadGridData(rowData.id,"hold",vType,"tabsRightGrid",3,"???"); } perCheckController.prototype.onDblClickRow = function(rowIndex,rowData){ $('#tabsLeftGrid').tabs("select", 1); if($("#editBibGrid").attr("class")){ bibController.prototype.setDataByGirdSelect(rowData.id); }else{ setTimeout(function(){bibController.prototype.setDataByGirdSelect(rowData.id);}, 500); } _linkbuttonObj.prototype.status(null,rowData); } perCheckController.prototype.initOtherGridBySouth = function(){ var orderObject = $("#orderDataGridList"); if (!orderObject.attr("class")) { orderObject.datagrid({ iconCls : 'e-icon fa fa-table', title : '', singleSelect : true, fit : true, fitColumns : true, pagination : true, border:false, striped : true, rowStyler:rowStylerIsUpdateByLibcode, columns : [ perOrderGridColumns ] }); } var checkObject = $("#checkDataGridList"); if (!checkObject.attr("class")) { checkObject.datagrid({ iconCls : 'e-icon fa fa-table', title : '', singleSelect : true, fit : true, fitColumns : true, pagination : true, border:false, striped : true, rowStyler:rowStylerIsUpdateByLibcode, onDblClickRow:_checkPerGridObj.prototype.update, onSelect:_checkPerGridObj.prototype.select, columns : [ perCheckGridColumns ] }); } var bindObject = $("#bindDataGridList"); if (!bindObject.attr("class")) { bindObject.datagrid({ iconCls : 'e-icon fa fa-table', title : '', singleSelect : true, fit : true, fitColumns : true, pagination : true, border:false, striped : true, rowStyler:rowStylerIsUpdateByLibcode, columns : [ bindGridColumns ] }); } var holdObject = $("#holdDataGridList"); if (!holdObject.attr("class")) { holdObject.datagrid({ iconCls : 'e-icon fa fa-table', title : '', singleSelect : true, fit : true, fitColumns : true, pagination : true, border:false, striped : true, rowStyler:rowStylerIsUpdateByLibcode, columns : [ holdGridColumns ] }); } } //????? beg var _checkPerGridObj = function(){}; _checkPerGridObj.prototype.add = function(rowData){ var bibId = 0; var id = 0; var setTitle = "????????"; if(!rowData){ if(!cataConfigData || !cataConfigData.orderyear){ return openMessageDlg("???????????,????????????????????"); } var row=$("#acqDataGridList").datagrid('getSelected'); if(!row){ return openMessageDlg('????????????????,??????'); } bibId = row.id; }else{ setTitle = "????????"; bibId = rowData.bibid; id = rowData.id; } if($(".percheckFrame").html() == "") $(".percheckFrame").html('<iframe id="percheckFrame" name="percheckFrame" frameborder="0" src="../iframe/iframe_per_check.jsp?bibId='+ bibId +'&id='+id+'" class="percheck-iframe-content"></iframe>'); else percheckFrame.percheckReLoadData(bibId,id); $("#percheck_dlg").dialog('setTitle',setTitle); $("#percheck_dlg").dialog('open'); } _checkPerGridObj.prototype.select = function(index,rowData){ $(".checkdetail-boxs").html(""); _checkPerDetailObj.prototype.bindTable(rowData.id); } _checkPerGridObj.prototype.update = function(rowIndex,rowData){ if(!rowIndex){ rowData = $("#checkDataGridList").datagrid('getSelected'); } if(!rowData){ return openMessageDlg('??????????????????,??????'); } if(isUpdateByLibcode(rowData.libcode)) { _checkPerGridObj.prototype.add(rowData); }else{ return openMessageDlg('??????????????'); } } _checkPerGridObj.prototype.trash = function(){ var row = $("#checkDataGridList").datagrid('getSelected'); if(!row){ return openMessageDlg('??????????????????,??????'); } if(isUpdateByLibcode(row.libcode)) { if(!row){ return openMessageDlg('??????????????????,??????'); } openConfirmDlg("???????????????["+row.id+"]?????????????",null,_checkPerGridObj.prototype.trashResult,null) }else{ return openMessageDlg('??????????????'); } } _checkPerGridObj.prototype.trashResult = function(){ var row = $("#checkDataGridList").datagrid('getSelected'); var param = {}; param.pk = row.id; var url = base_path + 'per/check/delete.do'; $.post(url, param, function(data) { if (data.status == "0") { openMessageDlg(data.message,5000); $(".checkdetail-boxs").html(""); bibGlobalController.prototype.loadGridData(row.bibid,"check",vType,"tabsRightGrid",0,"?????"); }else{ openMessageDlg(data.message); } }, 'json'); } function perCheckSaveResult(data,bibid){ openMessageDlg(data.message,5000); bibGlobalController.prototype.loadGridData(bibid,"check",vType,"tabsRightGrid",0,"?????"); $('#percheck_dlg').dialog('close'); $("#tabsRightGrid").tabs("select",0); } //????? end //?????? beg var _checkPerDetailObj = function(){}; function checkPerDetailSaveResult(data,checkid){ openMessageDlg(data.message,5000); $(".checkdetail-boxs").html(""); _checkPerDetailObj.prototype.bindTable(checkid); $('#percheckdetail_dlg').dialog('close'); $("#tabsRightGrid").tabs("select",0); _checkPerDetailObj.prototype.openPrintDlg(); } _checkPerDetailObj.prototype.openPrintDlg = function(){ var keycode = cataConfigData.booklablefmt; if(keycode){ var perCheckItemList = mystorage.get("perCheckItemList"); if(perCheckItemList){ mystorage.set("perCheckBarcodeItemList",perCheckItemList); $('#printer-confirm-dlg').dialog('open'); $('.printer-confirm-body').html("????????????????????????"); $("#printerDataGridList").datagrid("loadData",perCheckItemList); } } } _checkPerDetailObj.prototype.bindTable = function(id,checkDetailId){ onHnadlerSvaeBntScreen(null,true); var url = base_path+'per/detailcheck/page.do'; var param = {}; param.checkid=id; param.rows=1000; param.page=1; $.post(url, param, function(data) { onHnadlerSvaeBntScreen(null,false); if (data.status == "0") { _checkPerDetailObj.prototype.checkDetailBoxs(data,checkDetailId); }else{ openMessageDlg(data.message); } }, 'json'); } function getDays(year,mm,dd) { var dateArr = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31); var date = new Date(year,mm-1,dd); var day = date.getDate(); var month = date.getMonth(); //getMonth()???0???? var year = date.getFullYear(); var result = 0; for (var i = 0; i < month; i++) { result += dateArr[i]; } result += day; //????????? if (month > 1 && (year % 4 == 0 && year % 100 != 0) || year % 400 == 0) { result += 1; } return result; } function daysInMonth(month,year) { return new Date(year, month, 0).getDate(); } _checkPerDetailObj.prototype.checkDetailBoxs=function(data,checkDetailId){ var html =""; var rows = data.rows; checkdetailData = rows; if(data.rows.length == 365 || data.rows.length == 366){ var row = $("#checkDataGridList").datagrid('getSelected'); var date = new Date(); var year = date.getFullYear(); var month = date.getMonth()+1; var curDay = date.getDate(); if(row.year){ year = row.year; } var shtml = "<table class='check-days-detail'>"; shtml += "<thead class='my-days-thead'><tr>"; shtml += "<th style=\"max-width: 26px;min-width: 26px;width: 26px;\"></th>"; for(var i = 1;i <= 31;i++){ shtml += "<th class='my-th-w' style=\"width: 3.2%;\">"+ i +"</th>"; } shtml += "</tr></thead>"; shtml += "<tbody>"; for(var i = 1;i <= 12;i++){ shtml += "<tr id=\"help-"+ i +"\" name=\"help-"+ i +"\">"; shtml += "<td style=\"max-width: 26px;min-width: 26px;width: 26px;\">"+ i +"??</td>"; var days = daysInMonth(i,year) for(var j = 1; j <= days;j++){ var curDays = (getDays(year,i,j)-1); var thtml = getDetailInfo(rows,curDays,1) if(month == i && curDay == j){ thtml = "<div class=\"cur-date-select\">"+ thtml +"<div>"; } shtml += "<td class='my-float-h'>"+ thtml +"</td>"; } shtml += "</tr>"; } shtml += "</tbody>"; shtml += "</table>"; $(".checkdetail-boxs").html(shtml); $("#appendPrevRecord").hide(); $("#appendNextRecord").hide(); $("#checkToComBineRecord").hide(); bindEventFun(checkDetailId); if(!checkDetailId){ location.href = '#help-'+month; } }else{ for(var i = 0; i < rows.length;i++){ if(cataConfigData.ycyjdjl && cataConfigData.ycyjdjl == "1" && rows[i].status == "1" && vFlag == 0){ }else{ html += getDetailInfo(rows,i) } } $(".checkdetail-boxs").html(html); $("#appendPrevRecord").show(); $("#appendNextRecord").show(); $("#checkToComBineRecord").show(); bindEventFun(checkDetailId); } } function getDetailInfo(rows,i,type){ var html =""; if(rows[i]){ var jsonFld = [ {"code":"issue","name":"?????"}, {"code":"volume","name":"?????"}, {"code":"copies","name":"??????"}, {"code":"totalissue","name":"?????"}, {"code":"expectdate","name":"??????","title":"true"}, {"code":"actualdate","name":"??????","title":"true"}, {"code":"price","name":"???","title":"true"}, {"code":"note","name":"???","title":"true"} ]; var showValue = ""; var title = ""; for(var j = 0;j < jsonFld.length;j++){ var keyValue = (rows[i][jsonFld[j].code]!=null?rows[i][jsonFld[j].code]:""); if(!jsonFld[j].title){ showValue +="<div class=\"cell-row\">" + jsonFld[j].name + ":" + keyValue + "</div>"; } else{ if(jsonFld[j].code == "expectdate" || jsonFld[j].code =="actualdate") keyValue = fmtStringToDate(keyValue); } /* title +="<div class='div-book-record'><strong>"+ jsonFld[j].name +"</strong>:" + keyValue + " </div>";*/ title +=jsonFld[j].name + ":" + keyValue +"\n"; } var color = getColorBysStatus(rows[i].status); var id = rows[i].id; var dayStyle = "cur"+i; if(type){ dayStyle += " day-detail"; showValue = ""; showValue +="<div class=\"cell-row\">??:" + (rows[i].issue!=null?rows[i].issue:"") + "</div>"; showValue +="<div class=\"cell-row\">??:" + (rows[i].issue!=null?rows[i].copies:"") +"</div>"; } html += "<div id=\""+ id +"\" index=\"" + i + "\" onclick=\"onClickCellCheckDetail('"+ id +"','" + i + "')\" " + " onmouseout=\"onMouseOutCellCheckDetail('"+ id +"')\" onmouseover=\"onMouseOverCellCheckDetail('"+ id +"')\"" + " class=\"cell-check-detail "+ color +" "+ dayStyle +"\" ondblclick=\"onDbClickCellCheckDetail('"+ id +"','" + i + "')\" title=\"" + title + "\">"; html += "<div>"+ showValue +"</div>"; html += "</div>"; } return html; } function getColorBysStatus(status){ var color = ""; var statusColor = [ {"code":"0","color":"cell-weidao"}, {"code":"1","color":"cell-zhengchang"}, {"code":"2","color":"cell-weidaoqi"}, {"code":"3","color":"cell-cuique"}, {"code":"4","color":"cell-zhuangding"}, {"code":"5","color":"cell-tingding"}, {"code":"6","color":"cell-yanqi"}, {"code":"9","color":"cell-qita"}, ]; for(var k = 0 ; k < statusColor.length; k ++){ if(status == statusColor[k].code) { color = statusColor[k].color; break; } } return color; } function onMouseOutCellCheckDetail(id){ var cellbox = $("#" + id); cellbox.removeClass("cell-box-over"); } function onMouseOverCellCheckDetail(id){ var cellbox = $("#" + id); cellbox.addClass("cell-box-over"); } function onClickCellCheckDetail(id,index,status){ checkdetailId = id; checkdetailIdx = index; var cellbox = $("#" + id); if (cellbox.hasClass("cell-box-selected")) { if(!status) cellbox.removeClass("cell-box-selected"); } else { cellbox.addClass("cell-box-selected"); cellbox.removeClass("cell-box-over"); } } function onDbClickCellCheckDetail(id,index){ var rowData = $("#checkDataGridList").datagrid('getSelected'); if(isUpdateByLibcode(rowData.libcode)) { if(vFlag == 0){ checkdetailId = id; checkdetailIdx = index; _checkDetailEvent.prototype.checkToMarkRecord(); } } } function bindEventFun(id){ var rowData = $("#checkDataGridList").datagrid('getSelected'); if(isUpdateByLibcode(rowData.libcode)) { if(vFlag == 0){ $(".cell-check-detail").bind('contextmenu',function(e){ onClickCellCheckDetail(e.currentTarget.id,e.currentTarget.attributes["index"].value,true); e.preventDefault(); $('#checkDetailMenu').menu('show', { left: e.pageX, top: e.pageY }); }); } } if(id){ var cellbox = $("#" + id); if (cellbox.hasClass("cell-box-selected")) { } else { cellbox.addClass("cell-box-selected"); cellbox.removeClass("cell-box-over"); } } /* $(".cell-check-detail").each(function(index, element){ var html="<div style=\"padding: 5px;background-color: #0081c2;\">"+ element.title +"</div>"; $('#'+element.id).tooltip({ position: "left", content: html }); });*/ } function ikownDlg(){ /* var html = $(".global-message-body").html(); if(html.indexOf("????????????")>-1){ $('#barcode').textbox('textbox').focus().select(); } */ if(vFlag == "0"){ if(!$("#addBarcodeDlg").parent().is(":hidden")){ $('#barcode').textbox('textbox').focus().select(); } } $('#global-message-dlg').dialog('close'); } //??? ???????????? var _checkDetailEvent = function(){}; _checkDetailEvent.prototype.openDlg = function(rowData,title){ var count = 0; var getIds = $(".cell-box-selected"); getIds.each(function(index, element){ count++; }); if(count>1){ return openMessageDlg('????????????????,????????'); } var bibId = rowData.bibid; var flag = ""; var id = 0; if(rowData.id) id = rowData.id; var checkId = rowData.checkid; var sortfld = rowData.sortfld; if(rowData.flag) flag = rowData.flag; var row=$("#checkDataGridList").datagrid('getSelected'); var copies = row.copies; if($(".percheckdetailFrame").html() == "") $(".percheckdetailFrame").html('<iframe id="percheckdetailFrame" name="percheckdetailFrame" frameborder="0" src="../iframe/iframe_per_checkdetail.jsp?checkId='+ checkId +'&bibId='+ bibId +'&id='+id+'&sortfld='+ sortfld +'&flag='+flag+'&copies='+ copies +'" class="percheckdetail-iframe-content"></iframe>'); else percheckdetailFrame.percheckdetailReLoadData(checkId,bibId,id,sortfld,flag,copies); $("#percheckdetail_dlg").dialog('setTitle',title); $("#percheckdetail_dlg").dialog('open'); } //?????? _checkDetailEvent.prototype.appendPrevRecord = function(){ _checkDetailEvent.prototype.getSortFldNum("0"); } //?????? _checkDetailEvent.prototype.appendNextRecord = function(){ _checkDetailEvent.prototype.getSortFldNum("1"); } //?????? _checkDetailEvent.prototype.checkDetailRecord = function(){ var rowData = checkdetailData[checkdetailIdx]; var setTitle = "??????"; _checkDetailEvent.prototype.openDlg(rowData,setTitle); } function speBarcodeToCheck(){ var count = 0; var getIds = $(".cell-box-selected"); getIds.each(function(index, element){ count++; }); if(count == 0){ return openMessageDlg('?????????????,????????'); } if(count>1){ return openMessageDlg('????????????????,????????'); } var barcode = getValue("spebarcode"); if(barcode.length == 0){ return openMessageDlg('????????????'); } var index = 0 ; var id = 0; if(getIds["0"].attributes.index){ index = getIds["0"].attributes.index.value; } id = getIds["0"].id; var rowData = $("#checkDataGridList").datagrid('getSelected'); if(isUpdateByLibcode(rowData.libcode)) { if(vFlag == 0){ checkdetailId = id; checkdetailIdx = index; _checkDetailEvent.prototype.checkToMarkRecord(barcode,id); } } } function addXNBarcode(){ var count = 0; var getIds = $(".cell-box-selected"); getIds.each(function(index, element){ count++; }); if(count == 0){ return openMessageDlg('?????????????,????????'); } if(count>1){ return openMessageDlg('????????????????,????????'); } if(getIds["0"].attributes.index){ checkdetailIdx = getIds["0"].attributes.index.value; } var id = 0; var rowData = checkdetailData[checkdetailIdx]; id = getIds["0"].id; getXNBarcodeGridDataList(id); $('#addBarcodeDlg').dialog('open'); } function addXNBarcodeToCheck(){ var count = 0; var getIds = $(".cell-box-selected"); getIds.each(function(index, element){ count++; }); if(count == 0){ return openMessageDlg('?????????????,????????'); } if(count>1){ return openMessageDlg('????????????????,????????'); } var barcode = getValue("barcode"); if(barcode.length == 0){ return openMessageDlg('????????????'); } var index = 0 ; var id = 0; if(getIds["0"].attributes.index){ index = getIds["0"].attributes.index.value; } id = getIds["0"].id; var rowData = $("#checkDataGridList").datagrid('getSelected'); if(isUpdateByLibcode(rowData.libcode)) { if(vFlag == 0){ checkdetailId = id; checkdetailIdx = index; _checkDetailEvent.prototype.checkToMarkRecord(barcode,id); } } } function deleteXNBarcode(){ var rowData = $("#xnBarcodeDataGridList").datagrid("getSelected"); if(rowData){ $.messager.confirm('??????', '??????????????????', function(r){ if (r){ var pk = rowData.id; var url = base_path + 'hld/holding/delete.do'; var param = { 'pk' : pk }; $.post(url, param, function(data) { openMessageDlg(data.message); if (data.status == "0") { getXNBarcodeGridDataList(rowData.pdcheckid); } }, 'json'); } }); } } function onOpenAddBarcodeDlg(){ if(cataConfigData && cataConfigData.location){ setValue("location",cataConfigData.location); } if(cataConfigData && cataConfigData.doctype){ setValue("doctype",cataConfigData.doctype); } $('#barcode').textbox('textbox').focus().select(); } function getXNBarcodeGridDataList(id){ var url = base_path + 'hld/holding/list.do'; var param = {}; if (parseInt(id) > 0) { /* param.pdcheckid = id;*/ param['limit[0].condition']='pdcheckid'; param['limit[0].value'] = id; $("#xnBarcodeDataGridList").datagrid({ url: url, queryParams:param, onLoadSuccess: function(data){ $('#barcode').textbox('textbox').focus().select(); }, method:"post" }); } } //??? _checkDetailEvent.prototype.checkToMarkRecord = function(barcode,id){ var checkDataRow=$("#checkDataGridList").datagrid('getSelected'); var record = getCheckdetailDataRecord(checkdetailIdx); if(!record){ return openMessageDlg('?????????¤?????????,??????????????'); } record.copies = parseInt(record.copies) + 1; if(record.status == "0" && record.status == "2"){ if(record.copies >= checkDataRow.copies){ record.status = "1"; } } if(barcode){ record.barcode = barcode; record.shelfno = checkDataRow.shelfno; record.location = getValue("location"); record.doctype = getValue("doctype"); } if(cataConfigData && cataConfigData.per_check_batchno){ record.bacthno = cataConfigData.per_check_batchno; } var getCurRowIndex =checkdetailIdx; var url = base_path + 'per/detailcheck/check.do'; $.post(url, record, function(data) { if (data.status == "0") { _checkDetailEvent.prototype.addPrintList(data.rows[0].id); _checkPerDetailObj.prototype.bindTable(data.rows[0].checkid,id); if(barcode){ getXNBarcodeGridDataList(id); } $('#checkdetail_dlg').dialog('close'); }else{ openMessageDlg(data.message); } }, 'json'); } function getCheckdetailDataRecord(index){ var record = {}; record = JSON.parse(JSON.stringify(checkdetailData[index])); return record; } _checkDetailEvent.prototype.addPrintList = function(id){ var url = base_path + 'per/detailcheck/listBarcode.do'; var param = {}; param.id = id; $.post(url, param, function(data) { if (data.status == "0") { var rows = data.rows; _checkDetailEvent.prototype.addPrintListByGetRows(rows); } }, 'json'); } _checkDetailEvent.prototype.addPrintListByGetRows = function(rows){ var perCheckItemList = mystorage.get("perCheckItemList"); if(!perCheckItemList){ perCheckItemList = []; } var getRows = rows; for(var i = 0; i< getRows.length;i++){ if(perCheckItemList.length>0){ var isPush = false; for(var j = 0;j < perCheckItemList.length;j++){ if(perCheckItemList[j].barcode == getRows[i].barcode){ isPush = true; break; } } if(!isPush){ perCheckItemList.push({"barcode":getRows[i].barcode,"volinfo":getRows[i].volinfo}); } }else{ perCheckItemList.push({"barcode":getRows[i].barcode,"volinfo":getRows[i].volinfo}); } } mystorage.set("perCheckItemList",perCheckItemList); _checkPerDetailObj.prototype.openPrintDlg(); } //??? _checkDetailEvent.prototype.checkToComBineRecord = function(){ var ids =""; var getIds = $(".cell-box-selected"); getIds.each(function(index, element){ ids +=element.id + ","; }); ids = ids.substr(0, ids.length-1); var record = {}; record.ids = ids; var url = base_path + 'per/detailcheck/combine.do'; $.post(url, record, function(data) { if (data.status == "0") { _checkPerDetailObj.prototype.bindTable(data.rows[0].checkid); openMessageDlg(data.message,5000); }else{ openMessageDlg(data.message); } }, 'json'); } //?????? _checkDetailEvent.prototype.deleteCheckDetailRecord = function(){ var row = checkdetailData[checkdetailIdx]; if(!row){ return openMessageDlg('?????????¤?????????,??????'); } openConfirmDlg("???????????????["+row.id+"]?????????????",null,_checkDetailEvent.prototype.deleteCheckDetailRecordResult,null); } _checkDetailEvent.prototype.deleteCheckDetailRecordResult = function(){ var row = checkdetailData[checkdetailIdx]; var param = {}; param.pk = row.id; var url = base_path + 'per/detailcheck/delete.do'; $.post(url, param, function(data) { if (data.status == "0") { openMessageDlg(data.message,5000); _checkPerDetailObj.prototype.bindTable(row.checkid); }else{ openMessageDlg(data.message); } }, 'json'); } _checkDetailEvent.prototype.clearCheckDetailRecord= function(){ var checkDataRow=$("#checkDataGridList").datagrid('getSelected'); var record = checkdetailData[checkdetailIdx]; if(!record){ return openMessageDlg('?????????¤?????????,??????????????'); } record.copies = 0; record.status = "0"; record.actualdate = "0"; var getCurRowIndex =checkdetailIdx; var url = base_path + 'per/detailcheck/update.do'; $.post(url, record, function(data) { if (data.status == "0") { _checkPerDetailObj.prototype.bindTable(data.rows[0].checkid); $('#checkdetail_dlg').dialog('close'); }else{ openMessageDlg(data.message); } }, 'json'); } _checkDetailEvent.prototype.getSortFldNum = function(type){ var setTitle = "??????"; var row=$("#checkDataGridList").datagrid('getSelected'); var getRows = checkdetailData; var dataRow = {}; dataRow.checkid = row.id; dataRow.bibid = row.bibid; if(!row){ return openMessageDlg('??????????????????,??????'); } var rowData = checkdetailData[checkdetailIdx]; if(!rowData){ dataRow.sortfld = 1000; _checkDetailEvent.prototype.openDlg(dataRow,setTitle); }else{ var curSortFldNum = rowData.sortfld; var getCurRowIndex = parseInt(checkdetailIdx); var setSolrFldNum = 0; if(type == "0"){ //??? if(getCurRowIndex == 0){ setSolrFldNum = parseInt((parseInt(curSortFldNum))/2); }else if(getCurRowIndex > 0){ var getRow = getRows[getCurRowIndex-1]; setSolrFldNum = parseInt((parseInt(curSortFldNum) + parseInt(getRow.sortfld))/2); dataRow.id = getRows[getCurRowIndex].id; dataRow.flag = "add"; } }else if(type == "1"){ //??? if(getCurRowIndex == (getRows.length - 1)){ setSolrFldNum = parseInt((parseInt(curSortFldNum)*3)/2); }else if(getCurRowIndex < (getRows.length - 1)){ var getRow = getRows[getCurRowIndex+1]; setSolrFldNum = parseInt((parseInt(curSortFldNum) + parseInt(getRow.sortfld))/2); dataRow.id = getRows[getCurRowIndex].id; dataRow.flag = "add"; } } dataRow.sortfld = setSolrFldNum; _checkDetailEvent.prototype.openDlg(dataRow,setTitle); } } //?????? end //?????? beg var _bindPerGridObj = function(){}; _bindPerGridObj.prototype.add = function(type){ var rowData=$("#acqDataGridList").datagrid('getSelected'); var myJsonRecord = {}; myJsonRecord.bibid = rowData.id; if(!cataConfigData || !cataConfigData.bind_batchno){ return openMessageDlg('??????-?????????????????'); } var url = base_path+'per/bind/bindManual.do'; var param = {}; if(getValue("bindcopies") > 0 ){ param.copies = getValue("bindcopies"); } if(getValue("bindfee") > 0 ){ param.bindfee = getValue("bindfee"); } if(getValue("bindcount") > 0 ){ param.bindcount = getValue("bindcount"); } if(getValue("bindno") > 0 ){ param.bindno = getValue("bindno"); } var rowData=$("#checkDataGridList").datagrid('getSelected'); if(type == "1"){ url = base_path+'per/bind/bindAuto.do'; if(!rowData){ return openMessageDlg('??????????????????,?????????'); } param.checkid = rowData.id; }else{ var ids =""; var getIds = $(".cell-box-selected"); getIds.each(function(index, element){ ids +=element.id + ","; }); ids = ids.substr(0, ids.length-1); param.ids = ids; if(ids.toString().length== 0){ return openMessageDlg('????????????¤?????????,?????????'); } } myJsonRecord.url = url; myJsonRecord.param = param; mystorage.set("per_bind_iframe_param",myJsonRecord); if($(".perbindFrame").html() == "") $(".perbindFrame").html('<iframe id="perbindFrame" name="perbindFrame" frameborder="0" src="../iframe/iframe_per_bind.jsp" class="perbind-iframe-content"></iframe>'); else perbindFrame.perbindReLoadData(); $("#perbind_dlg").dialog('setTitle',"??????"); $("#perbind_dlg").dialog('open'); } function perBindSaveResult(data,bibid){ openMessageDlg(data.message,5000); var rowData = $("#acqDataGridList").datagrid('getSelected'); bibGlobalController.prototype.loadGridData(rowData.id,"bind",vType,"tabsRightGrid",2,"??????"); var row = $("#checkDataGridList").datagrid('getSelected'); _checkPerDetailObj.prototype.bindTable(row.id); $("#tabsRightGrid").tabs("select",2); $("#perbind_dlg").dialog('close'); } //?????? end //?????? beg var _perBindGridObj = function(){}; _perBindGridObj.prototype.select = function(index,rowData){ if(!isUpdateByLibcode(rowData.libcode)) { $('#deleteBindPer').linkbutton({ disabled:true }); }else{ $('#deleteBindPer').linkbutton({ disabled:false }); } }; _perBindGridObj.prototype.add = function(rowData){ var bibId = 0; var id = 0; if(!rowData){ if(!cataConfigData || !cataConfigData.check_batchno){ return openMessageDlg("???????????,?????????????????????"); } var row=$("#acqDataGridList").datagrid('getSelected'); if(!row){ return openMessageDlg('????????????????,??????'); } if(!row.classno) return openMessageDlg('???????????????????????????,???????????????????????!'); bibId = row.id; }else{ bibId = rowData.bibid; id = rowData.id; } var setTitle = "??????"; if($(".perbindhandlerFrame").html() == "") $(".perbindhandlerFrame").html('<iframe id="perbindhandlerFrame" name="perbindhandlerFrame" frameborder="0" src="../iframe/iframe_per_bindhandler.jsp?bibId='+ bibId +'&id='+id+'" style="width:780px;height:480px;border-top:1px solid #D4D4D4;"></iframe>'); else perbindhandlerFrame.perbindhandlerReLoadData(bibId,id); $("#perbindhandler_dlg").dialog('setTitle',setTitle); $("#perbindhandler_dlg").dialog('open'); } _perBindGridObj.prototype.update = function(rowIndex,rowData){ if(rowData){ rowData = $("#bindDataGridList").datagrid('getSelected'); } if(isUpdateByLibcode(rowData.libcode)){ _perBindGridObj.prototype.add(rowData); } } _perBindGridObj.prototype.trash = function(){ var row = $("#bindDataGridList").datagrid('getSelected'); if(!row){ return openMessageDlg('?????????¤??????,??????'); } openConfirmDlg("???????????????["+row.id+"]????????",null,_perBindGridObj.prototype.trashResult,null) } _perBindGridObj.prototype.trashResult = function(){ var row = $("#bindDataGridList").datagrid('getSelected'); var param = {}; param.pk = row.id; var url = base_path + 'per/bind/delete.do'; $.post(url, param, function(data) { if (data.status == "0") { openMessageDlg(data.message,5000); bibGlobalController.prototype.loadGridData(row.bibid,"bind",vType,"tabsRightGrid",2,"??????"); }else{ openMessageDlg(data.message); } }, 'json'); } function perBindHandlerSaveResult(data,bibid){ openMessageDlg(data.message,5000); bibGlobalController.prototype.loadGridData(bibid,"bind",vType,"tabsRightGrid",2,"??????"); bibGlobalController.prototype.loadGridData(bibid,"hold",vType,"tabsRightGrid",3,"???"); $('#perbindhandler_dlg').dialog('close'); $("#tabsRightGrid").tabs("select",2); } //?????? end function printerBookLable(){ var perCheckItemList = mystorage.get("perCheckItemList"); if(perCheckItemList){ var data = {}; data.rows = perCheckItemList; var keycode = cataConfigData.booklablefmt; if(keycode.length == 0){ return openMessageDlg('??????-??????-???????????'); } var jsonData = {}; jsonData.keycode = keycode; jsonData.printPerCheckList = "section"; jsonData.rows = data; mystorage.remove("perCheckItemList"); $('#printer-confirm-dlg').dialog('close'); openPostWindow('../export/exportlabelresult.jsp',jsonData); } } perCheckController.prototype.clear = function(){ $(".checkdetail-boxs").html(""); if($("#editBibGrid").attr("class")){ clearGridData("editBibGrid"); } clearGridData("acqDataGridList,orderDataGridList,bindDataGridList,checkDataGridList,holdDataGridList"); $("#tabsLeftGrid").tabs("select",0); } /** * ??? */ bibController.prototype.set = function() { $('#pageconfig_setpara_dlg').dialog({ onLoad:function(){ perParamContorller.prototype.init(); var tabs = $("#config-tabs"); tabs.tabs("select", 1).tabs("resize"); //.tabs("disableTab", 0) $(".per_check_batchno").show(); $(".order_batchno").hide(); $(".check_batchno").hide(); $(".bind_batchno").hide(); $(".print-book-fmt").hide(); if(vFlag != 0){ $(".bind_batchno").show(); } } }).dialog('open'); } bibController.prototype.clear = function(type){ perCheckController.prototype.clear(); } bibController.prototype.addOkBefore = function(){ perCheckController.prototype.clear(); $("#tabsLeftGrid").tabs("select", 1); } bibController.prototype.addOkAfter = function(rows){ setTimeout(function(){ $('#editBibGrid').datagrid('loadData',rows); bibController.prototype.addAttrCtrlNO(); }, 300); } bibController.prototype.pasteBefore = function(){ $("#tabsLeftGrid").tabs("select", 1); if($("#editBibGrid").attr("class")){ $('#pasteMarcDlg').dialog('open'); }else{ setTimeout(function(){$('#pasteMarcDlg').dialog('open');}, 500); } } bibController.prototype.searchPostAfter = function(data,vSelectIndex){ updataGridBibFlag(data,"acqDataGridList"); $("#tabsLeftGrid").tabs("select",0); bibGlobalController.prototype.onLoadGridSuccess("acqDataGridList",data,vSelectIndex); } _setConfig.prototype.otherAPP = function(paramjson){ var otherParam =[ {"code":"location","key": "location","condition": "libcode","value": vLibcode}, //?????? {"code":"doctype","key": "doctype","condition": "libcode","value": vLibcode}, //?????? ]; _myPage.prototype.onLoadData(_fmtGridDataRows,initJson); if($("#orderbatchno").length>0){ setValue("orderbatchno",paramjson.orderbatchno); } } perParamContorller.prototype.initOpenDlg = function(){ var data = $("#orderbatchno").combobox('getData'); $('#page_orderbatchno').combobox({ data : data, valueField : 'code', textField : 'name', groupField:'group' }); setValue("page_orderbatchno",cataConfigData.orderbatchno); } function otherLayResizeToMy(){ $('.easyui-panel').panel('resize'); $('#perCheckLayOut').layout('resize'); }
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de