Index: ssts-web/src/main/webapp/dx-disinfectsystem/plugins/jqAlert/js/alert.js =================================================================== diff -u -r24586 -r24593 --- ssts-web/src/main/webapp/dx-disinfectsystem/plugins/jqAlert/js/alert.js (.../alert.js) (revision 24586) +++ ssts-web/src/main/webapp/dx-disinfectsystem/plugins/jqAlert/js/alert.js (.../alert.js) (revision 24593) @@ -135,8 +135,12 @@ $container.css({ 'position' : option.position, 'left' : $(window).width()/2, - 'top' : $(window).height()/2 + $(window).scrollTop(), + 'top' : $(window).height()/2 + ($(window).scrollTop()-200), 'z-index' : zIndex, + // 'position' : option.position, + // 'left' : '50%', + // 'top' : '50%', + // 'z-index' : zIndex, }); }; @@ -312,7 +316,7 @@ if(option.position == 'absolute'){ $container.css({ - 'top' : $(window).height()/2 + $(window).scrollTop(), + 'top':$(window).height()/2 + ($(window).scrollTop()-200), }) }; }else{ Index: ssts-web/src/main/webapp/dx-disinfectsystem/js/sterilization/sterilization.js =================================================================== diff -u -r24586 -r24593 --- ssts-web/src/main/webapp/dx-disinfectsystem/js/sterilization/sterilization.js (.../sterilization.js) (revision 24586) +++ ssts-web/src/main/webapp/dx-disinfectsystem/js/sterilization/sterilization.js (.../sterilization.js) (revision 24593) @@ -381,12 +381,19 @@ var datas =data.rows; if(data.success===true){ $("#udsterilized").bootstrapTable("load", datas) + }else{ + if(M.dialog13){ + return M.dialog13.show(); + } + M.dialog13 = jqueryAlert({ + 'icon':WWWROOT+'/dx-disinfectsystem/plugins/jqAlert/img/error.png', + 'content' : data.message, + 'closeTime' : 3000, + 'option':'absolute', + }) } - }, - // error:function(){ - // alert('错误') - // } + } }) }) $(function() { @@ -489,8 +496,20 @@ type:'get', async:false, success:function(data){ - var datas=data.rows; - $("#uduninstall").bootstrapTable("load", datas) + if(data.success===true){ + var datas=data.rows; + $("#uduninstall").bootstrapTable("load", datas) + }else { + if(M.dialog13){ + return M.dialog13.show(); + } + M.dialog13 = jqueryAlert({ + 'icon':WWWROOT+'/dx-disinfectsystem/plugins/jqAlert/img/error.png', + 'content' : data.message, + 'closeTime' : 3000, + 'option':'absolute', + }) + } } }) }) @@ -599,6 +618,16 @@ // console.log(datas) if(data.success===true){ $('#udsterilizationListTbale').bootstrapTable('load',datas) + }else{ + if(M.dialog13){ + return M.dialog13.show(); + } + M.dialog13 = jqueryAlert({ + 'icon':WWWROOT+'/dx-disinfectsystem/plugins/jqAlert/img/error.png', + 'content' : data.message, + 'closeTime' : 3000, + 'option':'absolute', + }) } } }) @@ -610,10 +639,11 @@ return false; }else{ $.ajax({ - url:WWWROOT+'/disinfectSystem/sterilization/sterilizationRecordController/scanBarcode.mhtml?barcode='+$(this).val(), + url:WWWROOT+'/disinfectSystem/sterilization/sterilizationRecordController/scanBarcode.mhtml', type:'get', dataType:'json', async:false, + data:{barcode:$(this).val()}, success:function(data){ var datas =data.rows; console.log() @@ -624,7 +654,7 @@ allTableDatas(); } if(data.barcodeType==='用户'){ - $('#sterilization').val(datas[0]['name']); + $('#sterilization').val(datas[0].name); $('#udbarCode').val("") } if(data.barcodeType==='灭菌篮筐'){ @@ -633,12 +663,20 @@ allTableDatas(); } if(data.barcodeType==='灭菌架'){ - $('#sterilization').val(datas[0]['name']); + $('#sterilization').val(datas[0].name); $('#udbarCode').val("") } } else{ - alert(data.message) + if(M.dialog13){ + return M.dialog13.show(); + } + M.dialog13 = jqueryAlert({ + 'icon':WWWROOT+'/dx-disinfectsystem/plugins/jqAlert/img/error.png', + 'content' : data.message, + 'closeTime' : 3000, + 'option':'absolute', + }) } } }) @@ -757,8 +795,16 @@ str=" "; } $("#udsters").html(str); - - + } else{ + if(M.dialog13){ + return M.dialog13.show(); + } + M.dialog13 = jqueryAlert({ + 'icon':WWWROOT+'/dx-disinfectsystem/plugins/jqAlert/img/error.png', + 'content' : data.message, + 'closeTime' : 3000, + 'option':'absolute', + }) } } }); @@ -774,11 +820,11 @@ var isExist =false; if(data.success===true){ for(var i=0;i"+datas[i]['optionText']+" "; + if(datas[i].optionText.indexOf(sterilizationPurpose)==-1){ + str +=" "; } - if(datas[i]['optionText']===sterilizationPurpose){ - str+=" "; + if(datas[i].optionText===sterilizationPurpose){ + str+=" "; isExist=true; } } @@ -787,7 +833,15 @@ } $("#udpurpose").html(str); }else{ - alert(data.message) + if(M.dialog13){ + return M.dialog13.show(); + } + M.dialog13 = jqueryAlert({ + 'icon':WWWROOT+'/dx-disinfectsystem/plugins/jqAlert/img/error.png', + 'content' : data.message, + 'closeTime' : 3000, + 'option':'absolute', + }) } } @@ -824,7 +878,15 @@ allTableDatas(); }else { - alert('选择一行') + if(M.dialog13){ + return M.dialog13.show(); + } + M.dialog13 = jqueryAlert({ + 'icon':WWWROOT+'/dx-disinfectsystem/plugins/jqAlert/img/error.png', + 'content' : '选择一行', + 'closeTime' : 3000, + 'option':'absolute', + }) } } //修改时重新条用 灭菌目的 //灭菌炉列表 //灭菌程序关联 @@ -841,11 +903,19 @@ if(data.success===true){ var str = ""; for(var i=0;i"+datas[i]["sterilisation"]+" "; + str +=" "; } $("#udprocedure").html(str); }else { - alert(data.message) + if(M.dialog13){ + return M.dialog13.show(); + } + M.dialog13 = jqueryAlert({ + 'icon':WWWROOT+'/dx-disinfectsystem/plugins/jqAlert/img/error.png', + 'content' : data.message, + 'closeTime' : 3000, + 'option':'absolute', + }) } } }) @@ -899,9 +969,29 @@ } var sterilingGoodsArrays= JSON.stringify(sterilingGoodsArray) if(sterilingGoodsArrays === '[]'){ - $('.SaveAlert').attr('id','SaveAlert') - $('#SaveOK').click(function(){ - SaveConservation(); + if(M.dialog3){ + return M.dialog3.show(); + } + M.dialog3 = jqueryAlert({ + 'modal' : true, + 'contentTextAlign' : 'left', + 'animateType': 'scale', + 'bodyScroll' : 'true', + 'title' : '请确认', + 'content' : '没有添加灭菌的物品,继续灭菌吗?', + 'position':'absolute', + 'width' : '250', + 'height' : '150', + 'buttons' :{ + '确定' : function(){ + SaveConservation(); + M.dialog3.close(); + + }, + '取消' : function(){ + M.dialog3.close(); + } + } }) }else{ SaveConservation(); @@ -920,44 +1010,97 @@ $("#mymodal-data").modal('hide'); window.location.href = window.location.href; }else{ - alert(data.message) + if(M.dialog13){ + return M.dialog13.show(); + } + M.dialog13 = jqueryAlert({ + 'icon':WWWROOT+'/dx-disinfectsystem/plugins/jqAlert/img/error.png', + 'content' : data.message, + 'closeTime' : 3000, + 'option':'absolute', + }) } - } }) } }) //完成灭菌 $("#completes").on("click", function () { var rows = $("#table").bootstrapTable('getSelections'); - console.log(rows); - if (rows.length ==0) {// rows 主要是为了判断是否选中,下面的else内容才是主要 - $('#Alert').html('x 请选择需要修改的使用记录信息!') - $ ('#Alert').show ().delay (1500).fadeOut (); + if(rows.length ==0){ + complete(); return false; - } else { - $('#DeleteSj').on('click',function(){ - var arrays = new Array();// 声明一个数组 - $(rows).each(function () {// 通过获得别选中的来进行遍历 - arrays.push(this.id);// cid为获得到的整条数据中的一列 - }); - var idcards =JSON.stringify(arrays) - $.ajax({ - url:WWWROOT+'/disinfectSystem/sterilization/sterilizationRecordController/completeSterilizationGoods.mhtml?sterilizationRecordIds='+idcards, - type:'get', - dataType:'json', - success:function(data){ - if(data.success===true){ - window.location.href = window.location.href; - }else{ - $('#Alert').html('x '+data.message+'!') - $ ('#Alert').show ().delay (1500).fadeOut (); - return false; - } - } - }) - }) + }else{ + if(rows[0].status==='灭菌完成'){ + if(M.dialog13){ + return M.dialog13.show(); + } + M.dialog13 = jqueryAlert({ + 'icon':WWWROOT+'/dx-disinfectsystem/plugins/jqAlert/img/error.png', + 'content' : '不能重复提交灭菌记录', + 'closeTime' : 2000, + }) + }else{ + if(M.dialog9){ + return M.dialog9.show(); + } + M.dialog9 = jqueryAlert({ + 'contentTextAlign' : 'center', + 'width' : '200', + 'height' : '120', + 'title' : '请确认', + 'content' : '确定灭菌完成吗?', + 'modal' : true, + 'position':'absolute', + 'buttons' : { + '确定' : function(){ + M.dialog9.close(); + var arrays = new Array();// 声明一个数组 + $(rows).each(function () {// 通过获得别选中的来进行遍历 + arrays.push(this.id);// cid为获得到的整条数据中的一列 + }); + var idcards =JSON.stringify(arrays) + $.ajax({ + url:WWWROOT+'/disinfectSystem/sterilization/sterilizationRecordController/completeSterilizationGoods.mhtml', + type:'get', + dataType:'json', + data:{sterilizationRecordIds:idcards}, + success:function(data){ + if(data.success===true){ + window.location.href = window.location.href; + }else{ + if(M.dialog13){ + return M.dialog13.show(); + } + M.dialog13 = jqueryAlert({ + 'icon':WWWROOT+'/dx-disinfectsystem/plugins/jqAlert/img/error.png', + 'content' : data.message, + 'closeTime' : 3000, + 'option':'absolute', + }) + return false; + } + } + }) + }, + '取消' : function(){ + M.dialog9.close(); + } + } + }) + } } + + function complete(){ + if(M.dialog13){ + return M.dialog13.show(); + } + M.dialog13 = jqueryAlert({ + 'icon':WWWROOT+'/dx-disinfectsystem/plugins/jqAlert/img/warning.png', + 'content' : '请选择需要完成灭菌的记录信息!', + 'closeTime' : 3000, + }) + } }) //灭菌失败 $('#fails').on('click',function(){ @@ -1036,35 +1179,68 @@ //删除灭菌记录 $("#Deletings").on("click", function () { var rows = $("#table").bootstrapTable('getSelections'); - console.log(rows); - if (rows.length ==0) {// rows 主要是为了判断是否选中,下面的else内容才是主要 - $('#Alert').html('x 请选择需要删除的使用记录信息!') - $ ('#Alert').show ().delay (1500).fadeOut (); + if(rows.length==0){ + Deletings(); return false; - } else { - $('#DeletingOk').on('click',function(){ - var arrays = new Array();// 声明一个数组 - $(rows).each(function () {// 通过获得别选中的来进行遍历 - arrays.push(this.id);// cid为获得到的整条数据中的一列 - }); - var idcards =JSON.stringify(arrays) - $.ajax({ - url:WWWROOT+'/disinfectSystem/sterilization/sterilizationRecordController/deleteSterilizationRecord.mhtml', - type:'get', - dataType:'json', - data:{sterilizationRecordIds:idcards}, - success:function(data){ - if(data.success===true){ - window.location.href = window.location.href; - }else{ - $('#Alert').html('x '+data.message+'!') - $ ('#Alert').show ().delay (1500).fadeOut (); - return false; - } + }else{ + if(M.dialog9){ + return M.dialog9.show(); + } + M.dialog9 = jqueryAlert({ + 'contentTextAlign' : 'center', + 'width' : '200', + 'height' : '120', + 'title' : '请确认', + 'content' : '确定删除这些记录吗?', + 'modal' : true, + 'position':'absolute', + 'buttons' : { + '确定' : function(){ + M.dialog9.close(); + var arrays = new Array();// 声明一个数组 + $(rows).each(function () {// 通过获得别选中的来进行遍历 + arrays.push(this.id);// cid为获得到的整条数据中的一列 + }); + var idcards =JSON.stringify(arrays) + $.ajax({ + url:WWWROOT+'/disinfectSystem/sterilization/sterilizationRecordController/deleteSterilizationRecord.mhtml', + type:'get', + dataType:'json', + data:{sterilizationRecordIds:idcards}, + success:function(data){ + if(data.success===true){ + window.location.href = window.location.href; + }else{ + if(M.dialog13){ + return M.dialog13.show(); + } + M.dialog13 = jqueryAlert({ + 'icon':WWWROOT+'/dx-disinfectsystem/plugins/jqAlert/img/error.png', + 'content' : data.message, + 'closeTime' : 3000, + 'option':'absolute', + }) + return false; + } + } + }) + }, + '取消' : function(){ + M.dialog9.close(); } - }) + } }) } + function Deletings(){ + if(M.dialog13){ + return M.dialog13.show(); + } + M.dialog13 = jqueryAlert({ + 'icon':WWWROOT+'/dx-disinfectsystem/plugins/jqAlert/img/warning.png', + 'content' : '请选择需要删除的记录信息!', + 'closeTime' : 3000, + }) + } }) //灭菌目的 //灭菌炉列表 //灭菌程序关联 $(function(){ @@ -1084,7 +1260,7 @@ var str = ""; str=" " for(var j=0;j"+datas[j]['name']+" "; + str +=" "; } $('#sters').append(str) } @@ -1102,7 +1278,15 @@ $('#furnace').val(data.data.maxFrequency); $('#furnace').attr('disabled','disabled'); }else { - alert(data.message) + if(M.dialog13){ + return M.dialog13.show(); + } + M.dialog13 = jqueryAlert({ + 'icon':WWWROOT+'/dx-disinfectsystem/plugins/jqAlert/img/error.png', + 'content' : data.message, + 'closeTime' : 3000, + 'option':'absolute', + }) } } }) @@ -1118,16 +1302,24 @@ var str = ""; // str=" " for(var i=0;i "; + if(datas[i].sterilisation==='无'){ + str +=" "; }else{ - str +=" "; + str +=" "; } } $("#procedure").html(str); }else { - alert(data.message) + if(M.dialog13){ + return M.dialog13.show(); + } + M.dialog13 = jqueryAlert({ + 'icon':WWWROOT+'/dx-disinfectsystem/plugins/jqAlert/img/error.png', + 'content' : data.message, + 'closeTime' : 3000, + 'option':'absolute', + }) } } }) @@ -1144,11 +1336,19 @@ var datas =data.rows; if(data.success===true){ for(var i=0;i"+datas[i]['optionText']+""); + var opt = $(""); $('#purpose').append(opt) } }else{ - alert(data.message) + if(M.dialog13){ + return M.dialog13.show(); + } + M.dialog13 = jqueryAlert({ + 'icon':WWWROOT+'/dx-disinfectsystem/plugins/jqAlert/img/error.png', + 'content' : data.message, + 'closeTime' : 3000, + 'option':'absolute', + }) } } @@ -1193,6 +1393,16 @@ $('#sterilization').val(datas[0]['name']); $('#barCode').val("") } + }else{ + if(M.dialog13){ + return M.dialog13.show(); + } + M.dialog13 = jqueryAlert({ + 'icon':WWWROOT+'/dx-disinfectsystem/plugins/jqAlert/img/error.png', + 'content' : data.message, + 'closeTime' : 3000, + 'option':'absolute', + }) } } }) @@ -1339,30 +1549,48 @@ $("#mymodal-data").modal('hide'); window.location.href = window.location.href; }else{ - alert(data.message) + if(M.dialog13){ + return M.dialog13.show(); + } + M.dialog13 = jqueryAlert({ + 'icon':WWWROOT+'/dx-disinfectsystem/plugins/jqAlert/img/error.png', + 'content' : data.message, + 'closeTime' : 3000, + 'option':'absolute', + }) } } }) } - - }) //修改每一行的数据 $('#updateHandle').click(function(){ - var $table=$('#table'); - var selectContent = $table.bootstrapTable('getSelections')[0]; - if(typeof(selectContent) == 'undefined') { - $('#Alert').html('x 请选择需要修改的使用记录信息!') - $ ('#Alert').show ().delay (1500).fadeOut (); + var rows = $("#table").bootstrapTable('getSelections'); + if (rows.length ==0) {// rows 主要是为了判断是否选中,下面的else内容才是主要 + Alert(); return false; - }else{ - var obj =selectContent.id; - AjaxModal(obj); - loadSterilizationGoods(obj); - $('#deteils').val(obj); - allTableDatas(); + }else { + var arrays + $(rows).each(function () {// 通过获得别选中的来进行遍历 + arrays=(this.id);// cid为获得到的整条数据中的一列 + }); + var obj =arrays + AjaxModal(obj); + loadSterilizationGoods(obj); + $('#deteils').val(obj); + allTableDatas(); } + function Alert(){ + if(M.dialog13){ + return M.dialog13.show(); + } + M.dialog13 = jqueryAlert({ + 'icon':WWWROOT+'/dx-disinfectsystem/plugins/jqAlert/img/warning.png', + 'content' : '请选择需要修改的使用记录信息!', + 'closeTime' : 3000, + }) + } }) //详情灭菌物品列表 删除 灭菌物品统计 function onmover(od){ @@ -1468,20 +1696,20 @@ allchildren.push(objs.children[j]) //获取children的数据进行统计 var objChildren =objs.children[j] - if(countResult[objChildren["name"]]){ - countResult[objChildren["name"]]=countResult[objChildren["name"]] + 1; + if(countResult[objChildren.name]){ + countResult[objChildren.name]=countResult[objChildren.name] + 1; }else{ - countResult[objChildren["name"]]=1; + countResult[objChildren.name]=1; } } }else{ if(objs.type===2){ allchildren.push(objs.type) - if(countResult[objs['name']]){ - countResult[objs['name']]=countResult[objs['name']]+1; + if(countResult[objs.name]){ + countResult[objs.name]=countResult[objs.name]+1; }else{ - countResult[objs['name']]=1; + countResult[objs.name]=1; } } @@ -1510,17 +1738,5 @@ -//alert -$('#DatatimesBtn').click(function(){ - if(M.dialog1){ - return M.dialog1.show(); - } - M.dialog1 = jqueryAlert({ - 'content' : 'hello 程序员...', - 'closeTime' : 3000, - 'option':'absolute', - }) -}) - Index: ssts-web/src/main/webapp/dx-disinfectsystem/pages/disinfectsystem/sterilization/index.jsp =================================================================== diff -u -r24586 -r24593 --- ssts-web/src/main/webapp/dx-disinfectsystem/pages/disinfectsystem/sterilization/index.jsp (.../index.jsp) (revision 24586) +++ ssts-web/src/main/webapp/dx-disinfectsystem/pages/disinfectsystem/sterilization/index.jsp (.../index.jsp) (revision 24593) @@ -306,19 +306,17 @@ -