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(''); 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 = ""; shtml += ""; shtml += ""; for(var i = 1;i <= 31;i++){ shtml += ""; } shtml += ""; shtml += ""; for(var i = 1;i <= 12;i++){ shtml += ""; shtml += ""; 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 = "
"+ thtml +"
"; } shtml += "
"; } shtml += ""; } shtml += ""; shtml += "
"+ i +"
"+ i +"月"+ thtml +"
"; $(".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 +="
" + jsonFld[j].name + ":" + keyValue + "
"; } else{ if(jsonFld[j].code == "expectdate" || jsonFld[j].code =="actualdate") keyValue = fmtStringToDate(keyValue); } /* title +="
"+ jsonFld[j].name +":" + keyValue + "   
";*/ 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 +="
期:" + (rows[i].issue!=null?rows[i].issue:"") + "
"; showValue +="
册:" + (rows[i].issue!=null?rows[i].copies:"") +"
"; } html += "
"; html += "
"+ showValue +"
"; html += "
"; } 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="
"+ element.title +"
"; $('#'+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(''); 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(''); 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(''); 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'); }