Index: ssts-web/src/main/webapp/dx-disinfectsystem/css/sterilization/sterilization.css =================================================================== diff -u -r24938 -r24948 --- ssts-web/src/main/webapp/dx-disinfectsystem/css/sterilization/sterilization.css (.../sterilization.css) (revision 24938) +++ ssts-web/src/main/webapp/dx-disinfectsystem/css/sterilization/sterilization.css (.../sterilization.css) (revision 24948) @@ -471,3 +471,24 @@ display: inline-block; padding: 0 5px; } +.cell-title { + font-weight: bold; +} + +.cell-effort-driven { + text-align: center; +} + +.toggle { + height: 9px; + width: 9px; + display: inline-block; +} + +.toggle.expand { + background: url(http://localhost:8080/dx-disinfectsystem/plugins/SlickGrid/images/expand.gif) no-repeat center center; +} + +.toggle.collapse { + background: url(http://localhost:8080/dx-disinfectsystem/plugins/SlickGrid/images/collapse.gif) no-repeat center center; +} \ No newline at end of file Index: ssts-web/src/main/webapp/dx-disinfectsystem/js/sterilization/sterilization1.js =================================================================== diff -u --- ssts-web/src/main/webapp/dx-disinfectsystem/js/sterilization/sterilization1.js (revision 0) +++ ssts-web/src/main/webapp/dx-disinfectsystem/js/sterilization/sterilization1.js (revision 24948) @@ -0,0 +1,1424 @@ +var grid,grid1,grid2,grid3,dataView1,dataView2,options1,options2,options3; +var visibleColumns1=[]; +var percentCompleteThreshold1 = 0; +var searchString = ""; +var columns=[],data=[],data1=[]; +var loadData = []; +//主页面 +function sterilizationHome() { + var checkboxSelector = new Slick.CheckboxSelectColumn({cssClass: "slick-cell-checkboxsel"}); + columns.push(checkboxSelector.getColumnDefinition()); + columns.push( + { + field: 'sterilizationUser', + name: '灭菌员', + formatter: function (value,row,index,columnDef,dataContext){ + return ''+dataContext.sterilizationUser+' ' + }, + align: 'center', + }, + { + field: 'startDateStr', + name: '开始时间', + align: 'center', + // formatter: operateFormatter //自定义方法,添加操作按钮 + }, + { + field: 'endDateStr', + name: '结束时间', + align: 'center', + }, + { + field: 'srSituationComfirmer', + name: '确认人', + align: 'center', + }, + { + field: 'sterilizationPurpose', + name: '灭菌目的', + align: 'center', + }, + { + field: 'sterilizerName', + name: '灭菌炉', + align: 'center', + }, + { + field: 'frequency', + name: '炉次', + align: 'center', + }, + { + field: 'status', + name: '灭菌状态', + align: 'center', + + }, + { + field: 'physicsResult', + name: '物理监测结果', + align: 'center', + }, + { + field: 'chemistryResult', + name: '化学监测结果', + align: 'center', + }, + { + field: 'sterilizationType', + name: '灭菌程序', + align: 'center', + }, + { + field: 'amount', + name: '灭菌数量', + align: 'center', + }, + { + field: 'parameter', + name: '灭菌参数', + align: 'center', + }, + { + field: 'remark', + name: '备注', + align: 'center', + }, + { + field: 'types', + name: '操作', + align: 'center', + formatter: function (value, row, index) { + return '重新灭菌 ' + }, + } + ) + + var options = { + enableCellNavigation: true, + enableColumnReorder: false, + forceFitColumns: true, + rowHeight:35, + }; + //自适应 + var DATAGRID_MIN_HEIGHT = 180; + var DATAGRID_MIN_WIDTH = 300; + var DATAGRID_BOTTOM_PADDING = 20; + function attachAutoResizeDataGrid(grid, gridId, gridContainerId) { + var gridDomElm = $('#' + gridId); + if (!gridDomElm || typeof gridDomElm.offset() === "undefined") { + return null; + } + resizeToFitBrowserWindow(grid, gridId, gridContainerId); + $(window).on("resize", function () { + resizeToFitBrowserWindow(grid, gridId, gridContainerId); + resizeToFitBrowserWindow(grid, gridId, gridContainerId); + }); + + } + function destroyAutoResize() { + $(window).trigger('resize').off('resize'); + } + function calculateGridNewDimensions(gridId, gridContainerId) { + var availableHeight = $(window).height() - $('#' + gridId).offset().top - DATAGRID_BOTTOM_PADDING-window.parent.$(".head-index").height()-window.parent.$(".content-index").height(); + var availableWidth = $('#' + gridContainerId).width(); + + var newHeight = availableHeight; + var newWidth = availableWidth; + + if (newHeight < DATAGRID_MIN_HEIGHT) { + newHeight = DATAGRID_MIN_HEIGHT; + } + if (newWidth < DATAGRID_MIN_WIDTH) { + newWidth = DATAGRID_MIN_WIDTH; + } + + return { + height: newHeight, + width: newWidth + }; + } + function resizeToFitBrowserWindow(grid, gridId, gridContainerId) { + var newSizes = calculateGridNewDimensions(gridId, gridContainerId); + if (newSizes) { + $('#' + gridId).height(newSizes.height); + $('#' + gridId).width(newSizes.width); + if (new RegExp('MSIE [6-8]').exec(navigator.userAgent) === null && grid) { + grid.resizeCanvas(); + } + } + } +//配置 + function isIEPreVer8() { var v = navigator.appVersion.match(/MSIE ([\d.]+)/i); return (v ? v[1] < 8 : false); } + var sortcol = "name"; + var sortdir = 1; + var percentCompleteThreshold = 0; + var searchString = ""; + function requiredFieldValidator(value) { + if (value == null || value == undefined || !value.length) { + return {valid: false, msg: "This is a required field"}; + } + else { + return {valid: true, msg: null}; + } + } + function myFilter(item, args) { + if (item["percentComplete"] < args.percentCompleteThreshold) { + return false; + } + + if (args.searchString != "" && item["name"].indexOf(args.searchString) == -1) { + return false; + } + + return true; + } + $(function () { + $.support.cors = true; + dataView = new Slick.Data.DataView({ inlineFilters: true }); + grid = new Slick.Grid("#HomeMyGrid", dataView, columns, options); + attachAutoResizeDataGrid(grid, "HomeMyGrid", "gridContainer"); + grid.setSelectionModel(new Slick.RowSelectionModel({selectActiveRow: false}));//单选 + grid.registerPlugin(checkboxSelector); + var mytranslation = { + pagelabel: "页", + currentpage: "当前页", + refresh: "刷新", + recordstatelabel: "显示", + currentrecords: "显示/隐藏当前记录状态", + perpage: "每页条数", + pageminus: "上一页", + pageplus: "下一页", + resultset_first: "第一页", + resultset_prev: "上一页", + resultset_next: "下一页", + resultset_last: "最后一页" + }; + var pagercontent =$("#pager"); + var url=WWWROOT+'/disinfectSystem/sterilization/sterilizationRecordController/findSterilizationRecordList.mhtml'; + var search='',searchFields='',order ='desc'; + function pageIng(remoteUrl,container,datagrid,pagerType,trans,params,order,search,searchFields){ + new Slick.Controls.EnhancementPager({ + container: container, + remoteUrl:remoteUrl, + datagrid: datagrid, + pagerType: pagerType, + trans: trans, //i18n support + params:params, + limt:25, + order:order, + search:search, + searchFields:searchFields, + }); + } + pageIng(url,pagercontent,grid,'',mytranslation,'',order,'',''); + dataView.beginUpdate(); + dataView.setItems(data); + dataView.setFilterArgs({ + percentCompleteThreshold: percentCompleteThreshold, + searchString: searchString + }); + dataView.setFilter(myFilter); + dataView.endUpdate(); + dataView.syncGridSelection(grid, true); + $("#gridContainer").resizable(); + + //事件 + grid.onSelectedRowsChanged.subscribe(function(e,args){ + var selectedRows = args.rows;//点击选中的数据 + if(selectedRows==''){ + $('.SelectckData').val(''); + $('.SelectckStatus').val(''); + $('.detailsId').val(''); + }else{ + var itemId = new Array(); + var GridData = grid.getData();//得到的数据 + for (var i = 0; i < selectedRows.length; i++) { + // console.log(GridData[selectedRows[i]]) + itemId.push(GridData[selectedRows[i]].id) + $('.SelectckData').val(JSON.stringify(itemId)); + $('.SelectckStatus').val(GridData[selectedRows[i]].status) + $('.detailsId').val(GridData[selectedRows[i]].id) + } + + } + }) + + + }); +} +$(function(){ + sterilizationHome(); +}) +//完成灭菌 +$('#completes').click(function(){ + if($('.SelectckData').val()==''){ + alert('至少选择一条灭菌的数据'); + return false; + }else{ + $('.SvaComplete').click(function(){ + if($('.SelectckStatus').val()==='灭菌完成'){ + alert('此条记录已经完成灭菌'); + return false; + }else{ + $.ajax({ + url:WWWROOT+'/disinfectSystem/sterilization/sterilizationRecordController/completeSterilizationGoods.mhtml', + type:'get', + dataType:'json', + data:{sterilizationRecordIds:$('.SelectckData').val()}, + success:function(data){ + if(data.success===true){ + window.location.href = window.location.href; + }else{ + alert(data.message) + } + } + }) + } + + }) + } +}) +//灭菌中断 +$('#interrupts').click(function(){ + if($('.SelectckData').val()==''){ + alert('至少选择一条灭菌的数据'); + return false; + }else{ + $('.SaveInterrupt').click(function(){ + $.ajax({ + url:WWWROOT+'/disinfectSystem/sterilization/sterilizationRecordController/interruptSterilizationRecord.mhtml', + type:'get', + dataType:'json', + data:{sterilizationRecordId:$('.SelectckData').val()}, + success:function(data){ + if(data.success===true){ + window.location.href = window.location.href; + }else{ + alert(data.message) + } + } + }) + + }) + } +}) +//删除灭菌 +$('#Deletings').click(function(){ + if($('.SelectckData').val()==''){ + alert('至少选择一条需要删除的数据'); + return false; + }else{ + $('.SaveDeletings').click(function(){ + $.ajax({ + url:WWWROOT+'/disinfectSystem/sterilization/sterilizationRecordController/deleteSterilizationRecord.mhtml', + type:'get', + dataType:'json', + data:{sterilizationRecordIds:$('.SelectckData').val()}, + success:function(data){ + if(data.success===true){ + window.location.href = window.location.href; + }else{ + alert(data.message) + } + } + }) + }) + + } +}) +//灭菌物品列表 + + +//父子表 +var indent = 0; +var parents = []; +var checkboxSelector; +var BasketData =[] +var columns1 = [ + {id: "barcode", name: "条码", minWidth:120,field: "barcode",formatter:TaskNameFormatter}, + {id: "name", name: "名称", minWidth:120,field: "name",}, + {id: "sterilingMode",minWidth:120, name: "灭菌方式", field: "sterilingMode", }, + {id: "amount", name: "数量", field: "amount"}, + {id: "type", name: "操作", minWidth:120,cssClass: "cell-effort-driven", field: "type"} +]; +var addCleanBasketgrid; +var addCleanBasketOption = { + enableCellNavigation: true, + enableColumnReorder: false, + forceFitColumns: true, + editable: true, + enableAddRow: false, + asyncEditorLoading: true, + topPanelHeight: 35, + autoEdit: false, + rowHeight:35, +}; +var searchString = ""; +function percentCompleteSort(a, b) { + return a["percentComplete"] - b["percentComplete"]; +} +function requiredFieldValidator(value) { + if(value == null || value == undefined || !value.length){ + return{ + valid: false, + msg: "This is a required field" + }; + } + else{ + return{ + valid: true, + msg: null + }; + } +} +function TaskNameFormatter(row, cell, value, columnDef, dataContext){ + //如果没有数据,就都返回 + if (value == null || value == undefined || dataContext === undefined) { return ""; } + + value = value.replace(/&/g,"&").replace(//g,">"); + //制造一个占位 + var spacer = ""; + + + //根据ID获取此行内容的索引值 + var idx = dataView1.getIdxById(dataContext.id); + if (loadData[idx + 1] && loadData[idx + 1].indent > loadData[idx].indent) { + + //如果data中对应的内容不为空,并且此行缩进大于上一行的缩进 + if (dataContext._collapsed) { + + return spacer + " "+value+"" ;//收缩 + } else { + return spacer + "  "+value+"";//展开 + } + } else { + return spacer + "  "+value+""; + } +} +function myFilter(item) { + if(item.parent != null){ + var parent = loadData[item.parent]; + while(parent){ + if(parent._collapsed){ + return false; + } + parent = data[parent.parent]; + } + } + return true; +} +function addCleanBaskets(data){ + loadData=[]; + indent = 0; + var tempId = 0; + for(var i=0;i 0) { + for(var j=0; j < childrens.length; j++){ + var k = (loadData[tempId] = {}); + k["id"] =(Math.random()*10000000); + k["indent"] = 1; + k["parent"] = parentId; + k["name"]=childrens[j].name; + k["barcode"]=childrens[j].barcode; + k["sterilingMode"]=childrens[j].sterilingMode; + k["amount"]=childrens[j].amount; + k["type"]=""; + tempId ++; + } + } + } + + } + dataView1.beginUpdate(); + dataView1.setItems(loadData); + dataView1.setFilter(myFilter); + dataView1.endUpdate(); +} +function addCleanAfterAjax(){ + dataView1 = new Slick.Data.DataView({ inlineFilters: true }); + + addCleanBasketgrid = new Slick.Grid("#sterilizationListTbale", dataView1, columns1, addCleanBasketOption); + + dataView1.onRowsChanged.subscribe(function (e, args) { + addCleanBasketgrid.invalidateRows(args.rows); + addCleanBasketgrid.render(); + }); + + dataView1.onRowCountChanged.subscribe(function (e, args) { + addCleanBasketgrid.updateRowCount(); + addCleanBasketgrid.render(); + }); + + addCleanBasketgrid.onCellChange.subscribe(function (e, args) { + dataView1.updateItem(args.item.id, args.item); + }); + + addCleanBasketgrid.onClick.subscribe(function (e, args) { + if($(e.target).hasClass("toggle")){ + var item = dataView1.getItem(args.row); + if(item){ + if(!item._collapsed){ + item._collapsed = true; + } + else{ + item._collapsed = false; + } + dataView1.updateItem(item.id, item); + } + e.stopImmediatePropagation(); + } + }); + //自适应 + //attachAutoResizeDataGrid(addCleanBasketgrid, "addCleanBasketGrid", "addCleanBasketContainer"); + +}; +//扫描条码 +$("#barCode").keydown(function(e){ + if(e.keyCode == 13){ + var addItem; + $.ajax({ + url:WWWROOT+'/disinfectSystem/sterilization/sterilizationRecordController/scanBarcode.mhtml', + type:"get", + dataType:'json', + data:{barcode:$(this).val()}, + success:function(data){ + if(data.success==true){ + addItem = data.rows[0]; + console.log(addItem) + if(data.barcodeType==='用户'){ + $('#sterilization').val(addItem.name); + $('#barCode').val(""); + return false + } + if(data.barcodeType==='灭菌架'){ + $('#sterilization').val(addItem.name); + $('#barCode').val("") + return false + } + if(data.barcodeType==='器械包'){ + BasketData.push(addItem); + addCleanBaskets(BasketData); + $("#addCleanGetCodeArr").val(JSON.stringify(BasketData)); + $('#barCode').val("") + addallTableDatas(); + return false + } + if(data.barcodeType==='灭菌篮筐'){ + BasketData.push(addItem); + addCleanBaskets(BasketData); + $("#addCleanGetCodeArr").val(JSON.stringify(BasketData)); + $('#barCode').val("") + addallTableDatas(); + return false + } + + + } else{ + alert(data.message); + return false; + } + + } + }); + addCleanAfterAjax(); + $("#addCleanGetCode").val(""); + } +}); +//父子表end +//默认加载表格 +$('#addHandle').click(function(){ + $('#sterilization').val(currentUserCode)//科室 + addCleanBasket(); + addallTableDatas() + // $("#addCleanGetCode").focus(); +}) +function addCleanBasket(){ + var mrdata = []; + var columns2 = [ + {id: "barcode", name: "条码", minWidth:120,field: "barcode",formatter:TaskNameFormatter}, + {id: "name", name: "名称", minWidth:120,field: "name",}, + {id: "sterilingMode",minWidth:120, name: "灭菌方式", field: "sterilingMode", }, + {id: "amount", name: "数量", field: "amount"}, + {id: "type", name: "操作", minWidth:120,cssClass: "cell-effort-driven", field: "type"} + ]; + options1 = { + enableCellNavigation: true, + enableColumnReorder: false + }; + grid1 = new Slick.Grid("#sterilizationListTbale", mrdata, columns2, options1); +} +function addCleanBasket1(){ + var mrdata = []; + var columns2 = [ + {id: "barcode", name: "条码", minWidth:120,field: "barcode",formatter:TaskNameFormatter}, + {id: "name", name: "名称", minWidth:120,field: "name",}, + {id: "sterilingMode",minWidth:120, name: "灭菌方式", field: "sterilingMode", }, + {id: "amount", name: "数量", field: "amount"}, + {id: "type", name: "操作", minWidth:120,cssClass: "cell-effort-driven", field: "type"} + ]; + options1 = { + enableCellNavigation: true, + enableColumnReorder: false + }; + grid1 = new Slick.Grid("#udsterilizationListTbale", mrdata, columns2, options1); +} +//统计数据 +function addallTableDatas(){ + var allTableDatas + if($('#addCleanGetCodeArr').val()===''){ + allTableDatas=[] + }else{ + allTableDatas= JSON.parse($('#addCleanGetCodeArr').val()); + } + var alltotle=[] ,allchildren=[],countResult={},countResults=[] ,countResultall; + if(allTableDatas==''){ + $('#addsterils_1').text('0'); + $('#addsterils_2').text('0'); + $('#addsterils_3').text('0'); + $('#addsterils_4').text('0'); + $('#addsterils_5').text('0'); + $('#addsterilslor').text('0'); + countResultall="没有数据" + $('#countResults').val(countResultall) + }else { + for(var i =0; i < allTableDatas.length; i++){ + var objs =allTableDatas[i] + if(allTableDatas[i].type===1){ + alltotle.push(allTableDatas[i].type) + for(var j=0;j"+datas[j].name+" "; + } + $('#sters').append(str) + }else{ + alert(data.message) + } + + } + + }) + $('#sters').change(function(){ + $.ajax({ + url:WWWROOT+'/disinfectSystem/sterilization/sterilizationRecordController/getMaxFrequency.mhtml', + dataType:'json', + type:'get', + async:false, + data:{sterilizerName:$('#sters').val()}, + success:function(data){ + if(data.success===true){ + $('#furnace').val(data.data.maxFrequency); + $('#furnace').attr('disabled','disabled'); + }else { + alert(data.message) + } + } + }) + $.ajax({ + url:WWWROOT+'/disinfectSystem/baseData/sterilisationController/getSterilizerType.mhtml', + type:'get', + dataType:'json', + async:false, + data:{sterilizerName:$('#sters').val()}, + success:function(data){ + var datas= data.rows; + if(data.success===true){ + var str = ""; + // str=" " + for(var i=0;i "; + }else{ + str +=" "; + } + + } + $("#procedure").html(str); + }else { + alert(data.message) + } + } + }) + }) + $('#procedure').change(function(){ + $('#form_input').text($(this).find("option:selected").attr("data-itme")) + + }) + $.ajax({ + url:WWWROOT+'/disinfectSystem/sterilization/sterilizationRecordController/getSterilizationPurposeList.mhtml', + type:'get', + dataType:'json', + success:function(data){ + var datas =data.rows; + if(data.success===true){ + for(var i=0;i"+datas[i].optionText+""); + $('#purpose').append(opt) + } + }else{ + alert(data.message) + } + + } + }) + +}) +// 添加灭菌 +$('#addTbale').on('click',function(){ + var sterilization =$('#sterilization').val(); + var sterilizationName =$('#sterilizationName').val(); + var furnace =$('#furnace').val(); + var sters =$('#sters').val() + var procedure =$('#procedure').val() + var purpose =$('#purpose').val() + var addstarttime =$('#addstarttime').val(); + var form_input =$('#form_input').html(); + var Sterilizingnote =$('#Sterilizingnote').val(); + var sterilingGoodsArray = [];//[{"containerBarcode":"01","children":["001","002"]}, {"containerBarcode":"02","children":["003","004"]} , {"tousseInstanceBarcode":"003"}] + var allTableData; + if($('#addCleanGetCodeArr').val()===''){ + allTableData=[]; + }else{ + allTableData=JSON.parse($('#addCleanGetCodeArr').val()); + } + + for(var i=0;i 0){ + obj.containerBarcode = data.barcode; + var tousseBarcodeArray = []; + for (var j = 0; j < data.children.length; j++) { + tousseBarcodeArray.push(data.children[j].barcode); + } + obj.children = tousseBarcodeArray; + sterilingGoodsArray.push(obj); + }else{ + obj.tousseInstanceBarcode = data.barcode; + sterilingGoodsArray.push(obj); + } + } + var sterilingGoodsArrays= JSON.stringify(sterilingGoodsArray) + console.log(sterilingGoodsArrays) + + if(sters==''||procedure==''||purpose==''){ + alert('请输入表单各值'); + }else{ + $.ajax({ + url:WWWROOT+'/disinfectSystem/sterilization/sterilizationRecordController/saveSterilizationRecord.mhtml', + type:'post', + dataType:'json', + async:false, + data:{id:'',recordId:'',barcodePositionInfo:'',sterilizationGoods:sterilingGoodsArrays,sterilizationUser:sterilization,sterilizationShelf:sterilizationName,sterilizerName:sters,srSituationComfirmer:'',frequency:furnace,cycleCounter:'',sterilizationType:procedure,sterilizationPurpose:purpose,startDate:addstarttime,endDate:'',parameter:form_input,remark:Sterilizingnote}, + success:function(data){ + if(data.success===true){ + $("#mymodal-data").modal('hide'); + window.location.href = window.location.href; + }else{ + alert(data.message) + } + + } + }) + } +}) +//修改灭菌信息 +function particularsGrid(obj){ + var dataView2; + var indent = 0; + var parents = []; + var checkboxSelector; + var BasketData =[] + var additemGood =[]; + var columns1 = [ + {id: "barcode", name: "条码", minWidth:120,field: "barcode",formatter:TaskNameFormatter}, + {id: "name", name: "名称", minWidth:120,field: "name",}, + {id: "sterilingMode",minWidth:120, name: "灭菌方式", field: "sterilingMode", }, + {id: "amount", name: "数量", field: "amount"}, + {id: "type", name: "操作", minWidth:120,cssClass: "cell-effort-driven", field: "type"} + ]; + var sterilizationGird; + var addCleanBasketOption = { + enableCellNavigation: true, + enableColumnReorder: false, + forceFitColumns: true, + editable: true, + enableAddRow: false, + asyncEditorLoading: true, + topPanelHeight: 35, + autoEdit: false, + rowHeight:35, + }; + var searchString = ""; + function percentCompleteSort(a, b) { + return a["percentComplete"] - b["percentComplete"]; + } + function requiredFieldValidator(value) { + if(value == null || value == undefined || !value.length){ + return{ + valid: false, + msg: "This is a required field" + }; + } + else{ + return{ + valid: true, + msg: null + }; + } + } + function TaskNameFormatter(row, cell, value, columnDef, dataContext){ + //如果没有数据,就都返回 + + if (value == null || value == undefined || dataContext === undefined) { return ""; } + + value = value.replace(/&/g,"&").replace(//g,">"); + //制造一个占位 + var spacer = ""; + + //根据ID获取此行内容的索引值 + var idx = dataView2.getIdxById(dataContext.id); + if (loadData[idx + 1] && loadData[idx + 1].indent > loadData[idx].indent) { + // console.log(loadData) + //如果data中对应的内容不为空,并且此行缩进大于上一行的缩进 + if (dataContext._collapsed) { + + return spacer + " "+value+"" ;//收缩 + } else { + return spacer + "  "+value+"";//展开 + } + } else { + return spacer + "  "+value+""; + } + } + function myFilter(item) { + if(item.parent != null){ + var parent = loadData[item.parent]; + while(parent){ + if(parent._collapsed){ + return false; + } + parent = loadData[parent.parent]; + } + } + return true; + } + function addCleanBaskets(data){ + if(data==''){ + loadData=[]; + return false; + } + // loadData=[]; + // console.log(data) + indent = 0; + var tempId = 0; + for(var i=0;i 0) { + for(var j=0; j < childrens.length; j++){ + var k = (loadData[tempId] = {}); + k["id"] =(Math.random()*10000000); + k["indent"] = 1; + k["parent"] = parentId; + k["name"]=childrens[j].name; + k["barcode"]=childrens[j].barcode; + k["sterilingMode"]=childrens[j].sterilingMode; + k["amount"]=childrens[j].amount; + k["type"]=""; + tempId ++; + } + } + } + + } + dataView2 = new Slick.Data.DataView({ inlineFilters: true }); + sterilizationGird = new Slick.Grid("#udsterilizationListTbale",dataView2, columns1, addCleanBasketOption); + dataView2.onRowsChanged.subscribe(function (e, args) { + sterilizationGird.invalidateRows(args.rows); + sterilizationGird.render(); + }); + dataView2.onRowCountChanged.subscribe(function (e, args) { + sterilizationGird.updateRowCount(); + sterilizationGird.render(); + }); + sterilizationGird.onCellChange.subscribe(function (e, args) { + dataView2.updateItem(args.item.id, args.item); + }); + sterilizationGird.onClick.subscribe(function (e, args) { + if($(e.target).hasClass("toggle")){ + var item = dataView2.getItem(args.row); + if(item){ + if(!item._collapsed){ + item._collapsed = true; + } + else{ + item._collapsed = false; + } + dataView2.updateItem(item.id, item); + } + e.stopImmediatePropagation(); + } + }); + // console.log(loadData) + dataView2.setItems(loadData); + dataView2.setFilter(myFilter); + sterilizationGird.render() + } + var addItem; + $.ajax({ + url:WWWROOT+'/disinfectSystem/sterilization/sterilizationRecordController/loadSterilizationGoods.mhtml', + type:"get", + dataType:'json', + data:{id:obj}, + success:function(data){ + if(data.success===true){ + if(data.rows.length<=0){ + addCleanBasket1(); + allTableDatas(); + return false; + }else{ + for(var i=0;i"+lie[j].name+" "; + } + if(lie[j].name===sterilizerName){ + str+=" "; + isExist=true; + } + + } + + if(isExist == false){ + str=" "; + } + $("#udsters").html(str); + } else{ + if(ajaxModalAlert.dialog13){ + return ajaxModalAlert.dialog13.show(); + } + ajaxModalAlert.dialog13 = jqueryAlert({ + 'icon':WWWROOT+'/dx-disinfectsystem/plugins/jqAlert/img/error.png', + 'content' : data.message, + 'closeTime' : 3000, + 'option':'absolute', + }) + } + } + }); + $.ajax({ + async:false, + contentType: "application/json;charset=utf-8", + url:WWWROOT+'/disinfectSystem/sterilization/sterilizationRecordController/getSterilizationPurposeList.mhtml', + type:'get', + dataType:'json', + success:function(data){ + var datas =data.rows; + var str =""; + var isExist =false; + if(data.success===true){ + for(var i=0;i"+datas[i].optionText+" "; + } + if(datas[i].optionText===sterilizationPurpose){ + str+=" "; + isExist=true; + } + } + if(isExist == false){ + str=" "; + } + $("#udpurpose").html(str); + }else{ + if(ajaxModalAlert1.dialog13){ + return ajaxModalAlert1.dialog13.show(); + } + ajaxModalAlert1.dialog13 = jqueryAlert({ + 'icon':WWWROOT+'/dx-disinfectsystem/plugins/jqAlert/img/error.png', + 'content' : data.message, + 'closeTime' : 3000, + 'option':'absolute', + }) + } + + } + }) + $('#udprocedure').html(''); + $('#udstarttime').val(datas.startDateStr); + $('#textareas').text(datas.parameter); + $('#udSterilizingnote').val(datas.remark); + $('#udPhysicalmonitoring').val(datas.physicsResult); + $('#udChemical').val(datas.chemistryResult); + $('#udBiological').val(datas.biologyResult); + $('#udPhysicalmonitoring').attr('disabled',true); + $('#udChemical').attr('disabled',true); + $('#udBiological').attr('disabled',true); + $('#udprocedures').val(datas.biologicalMonitoringStartDate); + $('#udpurposee').val(datas.biologicalMonitoringEndDate); + $('#udSurveyor').val(""); + $('#udSurveyors').val(datas.monitorUser); + $('#udMonitor').val(""); + $('#udMonitors').val(datas.monitorChecker); + + } + } + + }) +} +$('.Close').click(function(){ + $('.AllData').val('') +}) +//修改保存 +$('#conservation').on('click',function(){ + var deteilsId= $('.detailsId').val(); + var udsterilization =$('#udsterilization').val(); + var udsterilizationName =$('#udsterilizationName').val(); + var udfurnace =$('#udfurnace').val(); + var udsters =$('#udsters').val() + var sterilizerNames=$('#sterilizerNames').val(); + var sterilizermames =''; + if(udsters==''){ + sterilizermames =sterilizerNames; + }else { + sterilizermames =udsters; + } + var udprocedure =$('#udprocedure').val(); + var udpurpose =$('#udpurpose').val() + var sterilizationPurposes =$('#sterilizationPurposes').val(); + var sterilizationP =""; + if(udpurpose==''){ + sterilizationP=sterilizationPurposes; + }else{ + sterilizationP=udpurpose; + } + var udstarttime=$('#udstarttime').val(); + var textareas=$('#textareas').html(); + var udSterilizingnote=$('#udSterilizingnote').val(); + var sterilingGoodsArray = [];//[{"containerBarcode":"01","children":["001","002"]}, {"containerBarcode":"02","children":["003","004"]} , {"tousseInstanceBarcode":"003"}] + var allTableData; + if($('.deteilbarCod').val()===''){ + allTableData=[]; + }else{ + allTableData=JSON.parse($('.deteilbarCod').val()); + } + for(var i=0;i 0){ + objConservation.containerBarcode = data.barcode; + var tousseBarcodeArray = []; + for (var j = 0; j < data.children.length; j++) { + tousseBarcodeArray.push(data.children[j].barcode); + } + objConservation.children = tousseBarcodeArray; + sterilingGoodsArray.push(objConservation); + }else{ + objConservation.tousseInstanceBarcode = data.barcode; + sterilingGoodsArray.push(objConservation); + } + } + var sterilingGoodsArrays= JSON.stringify(sterilingGoodsArray) + $.ajax({ + url:WWWROOT+'/disinfectSystem/sterilization/sterilizationRecordController/saveSterilizationRecord.mhtml', + type:'post', + dataType:'json', + async:false, + data:{id:deteilsId, recordId:'',barcodePositionInfo:'',sterilizationUser:udsterilization,sterilizationShelf:udsterilizationName, + frequency:udfurnace,sterilizerName:sterilizermames,sterilizationType:udprocedure,sterilizationPurpose:sterilizationP,startDate:udstarttime,parameter:textareas, + remark:udSterilizingnote,sterilizationGoods:sterilingGoodsArrays,srSituationComfirmer:'',cycleCounter:5,endDate:''}, + success:function(data){ + if(data.success===true){ + $("#mymodal-data").modal('hide'); + window.location.href = window.location.href; + }else{ + alert(data.message) + } + } + }) + +}) +//修改时重新条用 灭菌目的 //灭菌炉列表 //灭菌程序关联 +$('#udsters').change(function(){ + var ududstersAlert={}; + $('#udprocedure').html(""); + $.ajax({ + url:WWWROOT+'/disinfectSystem/baseData/sterilisationController/getSterilizerType.mhtml', + type:'get', + dataType:'json', + data:{sterilizerName:$('#udsters').val()}, + success:function(data){ + var datas= data.rows; + if(data.success===true){ + var str = ""; + for(var i=0;i"+datas[i].sterilisation+" "; + } + $("#udprocedure").html(str); + }else { + if(ududstersAlert.dialog13){ + return ududstersAlert.dialog13.show(); + } + ududstersAlert.dialog13 = jqueryAlert({ + 'icon':WWWROOT+'/dx-disinfectsystem/plugins/jqAlert/img/error.png', + 'content' : data.message, + 'closeTime' : 3000, + 'option':'absolute', + }) + } + } + }) +}) +$('#udprocedure').change(function(){ + $('#textareas').text($(this).find("option:selected").attr("data-itme")) +}) +$('#updateHandle').click(function(){ + if($('.detailsId').val()===''){ + alert('请选择一条数据'); + return false; + }else{ + var obj =$('.detailsId').val(); + AjaxModal(obj); + particularsGrid(obj); + } + +}) + Index: ssts-web/src/main/webapp/dx-disinfectsystem/pages/disinfectsystem/sterilization/index.jsp =================================================================== diff -u -r24938 -r24948 --- ssts-web/src/main/webapp/dx-disinfectsystem/pages/disinfectsystem/sterilization/index.jsp (.../index.jsp) (revision 24938) +++ ssts-web/src/main/webapp/dx-disinfectsystem/pages/disinfectsystem/sterilization/index.jsp (.../index.jsp) (revision 24948) @@ -22,41 +22,21 @@ -
- + + + + + @@ -116,9 +96,6 @@
+ - - -