Index: ssts-web/src/main/webapp/dx-disinfectsystem/js/sterilization/sterilization.js =================================================================== diff -u --- ssts-web/src/main/webapp/dx-disinfectsystem/js/sterilization/sterilization.js (revision 0) +++ ssts-web/src/main/webapp/dx-disinfectsystem/js/sterilization/sterilization.js (revision 24404) @@ -0,0 +1,1275 @@ +$(window).resize(function () { + $("#table").bootstrapTable('resetView'); + $("#Goods-table").bootstrapTable('resetView'); + $("#modalTables").bootstrapTable('resetView'); +}); +//主页面表格 +var columnArray=[ + { + checkbox: true, + field:'ids', + },{ + field: 'sterilizationUser', + title: '灭菌员', + formatter: function (value,row,index){ + return ''+row.sterilizationUser+' ' + }, + align:'center', + }, { + field: 'startDate', + title: '开始时间', + align:'center', + // formatter: operateFormatter //自定义方法,添加操作按钮 + }, { + field: 'endDate', + title: '结束时间', + align:'center', + }, + { + field: 'srSituationComfirmer', + title: '确认人', + align:'center', + }, + { + field: 'sterilizationPurpose', + title: '灭菌目的', + align:'center', + }, + { + field: 'sterilizerName', + title: '灭菌炉', + align:'center', + }, + { + field: 'frequency', + title: '炉次', + align:'center', + }, + { + field: 'status', + title: '灭菌状态', + align:'center', + + }, + { + field: 'physicsResult', + title: '物理监测结果', + align:'center', + }, + { + field: 'chemistryResult', + title: '化学监测结果', + align:'center', + }, + { + field: 'sterilizationType', + title: '灭菌程序', + align:'center', + }, + { + field: 'amount', + title: '灭菌数量', + align:'center', + }, + { + field: 'parameter', + title: '灭菌参数', + align:'center', + }, { + field: 'remark', + title: '备注', + align:'center', + }, + { + field: 'types', + title: '操作', + align:'center', + formatter: function (value,row,index){ + return '重新灭菌 ' + }, + }, +] +var InitTable =function(url){ + //先销毁表格 + $('#table').bootstrapTable("destroy"); + //添加表格 + $('#table').bootstrapTable({ + url:url, + method:'post',//请求方式 + search:true,//是否搜索 + pagination: true,//是否分页 + pageSize: 20,//单页记录数 + pageList: [5, 10, 20, 50],//分页步进值 + sidePagination: "server",//服务端分页 + contentType: "application/x-www-form-urlencoded",//请求数据内容格式 默认是 application/json 自己根据格式自行服务端处理 + dataType: "json",//期待返回数据类型 + queryParamsType: "limit",//查询参数组织方式 + onColumnSwitch:onColumnSwitch, + queryParams :queryParams, + searchOnEnterKey: "true",//回车搜索 + showRefresh: "true",//刷新按钮 + showColumns: true,//列选择按钮 + minimumCountColumns: 2, //最少允许的列数 + clickToSelect: true, //是否启用点击选中行 + uniqueId: "ID", //每一行的唯一标识,一般为主键列 + cardView: false, //是否显示详细视图 + detailView: false, //是否显示父子表 + showExport: true, + exportDataType: "selected", //导出checkbox选中的行数 + paginationLoop: false, //是否无限循环 + columns: columnArray, + }); + return InitTable; +} +//jq过滤事件 +var addArray= new Array(); +var array=[]; +function onColumnSwitch(field,checked){ + var str ={'Name':field,'states':checked} + addArray.push(str); + Array.prototype.indexOf = function(val) { + for (var i = 0; i < this.length; i++) { + if (this[i] == val) return i; + } + return -1; + }; + Array.prototype.remove = function(val) { + var index = this.indexOf(val); + if (index > -1) { + this.splice(index, 1); + } + }; + + for(var i=0;i').find('table'); + var html = ""; + html += ""; + html += ""; + html += ""; + html += ""; + html += ""; + html += ""; + html += ""; + html += ""; + html += ""; + html += ""; + html += ""; + html += ""; + $detail.html(html); + } + }); +}); +//中断记录列表add +$('#Interruptrecord').bootstrapTable({ + striped: true, //是否显示行间隔色 + cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*) + height: 200, //行高,如果没有设置height属性,表格自动根据记录条数觉得表格高度 + uniqueId: "id", //每一行的唯一标识,一般为主键列 + detailView: false, //是否显示父子表 + removeByUniqueId:1, + columns: [ + { + field: 'tiaoma', + title: '操作人' + }, { + field: 'name', + title: '中断时间', + // formatter: operateFormatter //自定义方法,添加操作按钮 + }, { + field: 'fangshi', + title: '中断完成时间' + }, + { + field: 'total', + title: '中断类型' + }, + { + field: 'zuoz', + title: '质量监测记录' + } + ], + data: [{tiaoma: '010004105',name: '灭菌筐02灭菌筐02灭菌筐02',fangshi: '高温',total:'1',zuoz:'1'}, + {tiaoma: '010004105',name: '灭菌筐02',fangshi: '高温',total:'1',zuoz:'1'}, + {tiaoma: '010004105',name: '灭菌筐02',fangshi: '高温',total:'1',zuoz:'1'}, + {tiaoma: '010004105',name: '灭菌筐02',fangshi: '高温',total:'1',zuoz:'1'}, + {tiaoma: '010004105',name: '灭菌筐02',fangshi: '高温',total:'1',zuoz:'1'}, + {tiaoma: '010004105',name: '灭菌筐02',fangshi: '高温',total:'1',zuoz:'1'}, + {tiaoma: '010004105',name: '灭菌筐02',fangshi: '高温',total:'1',zuoz:'1'}, + {tiaoma: '010004105',name: '灭菌筐02',fangshi: '高温',total:'1',zuoz:'1'}, + {tiaoma: '010004105',name: '灭菌筐02',fangshi: '高温',total:'1',zuoz:'1'} + ], +}); +// add 卸载物品统计列表 +$('#uninstall').bootstrapTable({ + striped: true, //是否显示行间隔色 + cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*) + sortOrder: "asc", //排序方式 + height: 620, //行高,如果没有设置height属性,表格自动根据记录条数觉得表格高度 + uniqueId: "id", //每一行的唯一标识,一般为主键列 + // showToggle:true, //是否显示详细视图和列表视图的切换按钮 + // cardView: false, //是否显示详细视图 + detailView: false, //是否显示父子表 + removeByUniqueId:1, + columns: [ + { + field: 'tiaoma', + title: '条码' + }, { + field: 'name', + title: '名称', + // formatter: operateFormatter //自定义方法,添加操作按钮 + }, { + field: 'fangshi', + title: '科室' + }, + { + field: 'total', + title: '数量' + } + ], + data: [{tiaoma: '010004105',name: '灭菌筐02灭菌筐02灭菌筐02',fangshi: '高温',total:'1'}, + {tiaoma: '010004105',name: '灭菌筐02',fangshi: '高温',total:'1'}, + {tiaoma: '010004105',name: '灭菌筐02',fangshi: '高温',total:'1'}, + {tiaoma: '010004105',name: '灭菌筐02',fangshi: '高温',total:'1'}, + {tiaoma: '010004105',name: '灭菌筐02',fangshi: '高温',total:'1'}, + {tiaoma: '010004105',name: '灭菌筐02',fangshi: '高温',total:'1'}, + {tiaoma: '010004105',name: '灭菌筐02',fangshi: '高温',total:'1'}, + {tiaoma: '010004105',name: '灭菌筐02',fangshi: '高温',total:'1'}, + {tiaoma: '010004105',name: '灭菌筐02',fangshi: '高温',total:'1'} + ], +}); + +//中断记录列表details +// Interruptrecord +$('#udInterruptrecord').bootstrapTable({ + striped: true, //是否显示行间隔色 + cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*) + sortOrder: "asc", //排序方式 + height: 200, //行高,如果没有设置height属性,表格自动根据记录条数觉得表格高度 + uniqueId: "id", //每一行的唯一标识,一般为主键列 + detailView: false, //是否显示父子表 + removeByUniqueId:1, + columns: [ + { + field: 'tiaoma', + title: '操作人' + }, { + field: 'name', + title: '中断时间', + // formatter: operateFormatter //自定义方法,添加操作按钮 + }, { + field: 'fangshi', + title: '中断完成时间' + }, + { + field: 'total', + title: '中断类型' + }, + { + field: 'zuoz', + title: '质量监测记录' + } + ], + +}); +//今天审核的待灭菌物品 details +$(function(){ + $.ajax({ + url:'http://rap2api.taobao.org/app/mock/85153/disinfectSystem/tousseInstanceController/getTodayPendingSterilizationTousseAndBasket.mhtml', + type:'get', + dataType:'json', + async:true, + success:function(data){ + var datas =data.rows; + if(data.success===true){ + $("#udsterilized").bootstrapTable("load", datas) + } + + }, + error:function(){ + alert('错误') + } + }) +}) +$(function() { + //先销毁表格,在初始化 + $(function() { + var oTableInit = new Object(); + var oInit = new Object(); + $('#udsterilized').bootstrapTable({ + detailView: true, //父子表 + striped: true, //是否显示行间隔色 + sortOrder: "asc", //排序方式 + pageNumber: 1, //初始化加载第一页,默认第一页 + height: 480, + columns: [{ + field: 'barcode', + title: '条码', + align: 'center', + }, { + field: 'name', + title: '名称', + align: 'left', + + }, { + field: 'name', + title: '灭菌方式', + align: 'center', + + }, { + field: 'amount', + title: '数量', + align: 'center', + + },{ + field: 'loads', + title: '载入', + align: 'center', + },{ + field: 'reviewTime', + title: '审核时间', + align: 'center', + },{ + field: 'isUrgentTousse', + title: '加急', + align: 'center', + },{ + field: 'types', + title: '操作', + align: 'center', + } + ], + + onExpandRow: function(index, row, $detail) { + oTableInit.InitSubTable(index, row, $detail); + + } + + }); + oTableInit.InitSubTable=function (index,row,$detail){ + var cur_table = $detail.html('
李秀211233dsjaaa耐酸水泥砂浆21122222
').find('table'); + var html = ""; + html += ""; + $.ajax({ + url:'data/tousseInstanceController!getTodayPendingSterilizationTousseAndBasket.json', + type:'post', + async:false, + dataType:'json', + success:function(data){ + var datas =data.data[index].children; + for (var i=0;i"; + html += ""; + html += ""; + html += ""; + html += ""; + html += ""; + html += ""; + html += ""; + html += ""; + } + html += ""; + $detail.html(html); + } + + } + + }) + + } + }); +}); +// 卸载物品统计列表details +$(function(){ + $.ajax({ + url:'http://rap2api.taobao.org/app/mock/85153/disinfectSystem/sterilization/tousseInstanceController/getSterileUnloadTousseBySterileRecordId.mhtml', + dataType:'json', + type:'get', + async:false, + success:function(data){ + var datas=data.rows; + $("#uduninstall").bootstrapTable("load", datas) + } + }) +}) +$('#uduninstall').bootstrapTable({ + + striped: true, //是否显示行间隔色 + cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*) + sortOrder: "asc", //排序方式 + height: 620, //行高,如果没有设置height属性,表格自动根据记录条数觉得表格高度 + uniqueId: "id", //每一行的唯一标识,一般为主键列 + // detailView: false, //是否显示父子表 + removeByUniqueId:1, + columns: [ + { + field: 'barcode', + title: '条码' + }, { + field: 'name', + title: '名称', + // formatter: operateFormatter //自定义方法,添加操作按钮 + }, { + field: 'depart', + title: '科室' + }, + { + field: 'amount', + title: '数量' + } + ], +}); +//灭菌物品统计 details +$('#udsterilizationListTotal').bootstrapTable({ + striped: true, //是否显示行间隔色 + cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*) + sortOrder: "asc", //排序方式 + height: 200, //行高,如果没有设置height属性,表格自动根据记录条数觉得表格高度 + uniqueId: "id", //每一行的唯一标识,一般为主键列 + removeByUniqueId:1, + columns: [ + { + field: 'tiaoma', + title: '条码' + }, { + field: 'name', + title: '名称', + // formatter: operateFormatter //自定义方法,添加操作按钮 + }, { + field: 'fangshi', + title: '灭菌方式' + }, + { + field: 'total', + title: '数量' + }, + { + field: 'zuoz', + title: '操作' + } + ], + data: [{tiaoma: '010004105',name: '灭菌筐02灭菌筐02灭菌筐02',fangshi: '高温',total:'1',zuoz:'1'}, + {tiaoma: '010004105',name: '灭菌筐02',fangshi: '高温',total:'1',zuoz:'1'}, + {tiaoma: '010004105',name: '灭菌筐02',fangshi: '高温',total:'1',zuoz:'1'}, + {tiaoma: '010004105',name: '灭菌筐02',fangshi: '高温',total:'1',zuoz:'1'}, + {tiaoma: '010004105',name: '灭菌筐02',fangshi: '高温',total:'1',zuoz:'1'}, + {tiaoma: '010004105',name: '灭菌筐02',fangshi: '高温',total:'1',zuoz:'1'}, + {tiaoma: '010004105',name: '灭菌筐02',fangshi: '高温',total:'1',zuoz:'1'}, + {tiaoma: '010004105',name: '灭菌筐02',fangshi: '高温',total:'1',zuoz:'1'}, + {tiaoma: '010004105',name: '灭菌筐02',fangshi: '高温',total:'1',zuoz:'1'} + ], +}); + +//时间插件 +$('#startTime').datetimepicker('setDate', new Date()); +$("#terminaltime").datetimepicker({ + language: 'zh-CN', + weekStart: 1, + todayBtn: 1,//显示为今天的按钮,0无1有 + autoclose: 1,//单击时间后日历框是否自动关闭,1关闭,0不关闭 + todayHighlight: 1,//今天高亮显示 + startView: 2,//展示的样式,1小时,2日 + minView: 2,//选取到的时间,2天,1小时 + forceParse: 0 +}); +$('#starttime').datetimepicker({ + language: 'zh-CN', + weekStart: 1, + todayBtn: 1,//显示为今天的按钮,0无1有 + autoclose: 1,//单击时间后日历框是否自动关闭,1关闭,0不关闭 + todayHighlight: 1,//今天高亮显示 + startView: 2,//展示的样式,1小时,2日 + minView: 2,//选取到的时间,2天,1小时 + forceParse: 0 +}); +//灭菌物品列表 details +$(function(){ + var oTableInit = new Object(); + var oInit = new Object(); + $('#udsterilizationListTbale').bootstrapTable({ + detailView: true, //父子表 + striped: true, //是否显示行间隔色 + sortOrder: "asc", //排序方式 + pageNumber: 1, //初始化加载第一页,默认第一页 + height: 200, + columns: [ + { + field: 'barcode', + title: '条码', + align: 'center', + }, { + field: 'name', + title: '名称', + align: 'left', + + }, { + field: 'sterilingMode', + title: '灭菌方式', + align: 'center', + + }, { + field: 'amount', + title: '数量', + align: 'center', + + },{ + field: 'types', + title: '操作', + align: 'center', + formatter:function(index,row,value){ + return '删除' + } + + } + ], + + onExpandRow: function(index, row, $detail) { + oTableInit.InitSubTable(index, row, $detail); + + } + + }); + oTableInit.InitSubTable=function (index,row,$detail){ + if(row.type==1){ + var rowChildren =row.children; + console.log(rowChildren) + var cur_table = $detail.html('
"+datas[i].name+""+datas[i].typeForSterilizationStatistics+""+datas[i].amount+""+datas[i].reviewTime+"--
').find('table'); + var html = ""; + html += ""; + for(var i=0;i" + + "" + + "" + + "" + + "" + + "" + + ""; + } + html +="
" + rowChildren[i].barcode + "" + rowChildren[i].name + "" + rowChildren[i].sterilingMode + "" + rowChildren[i].amount + "
"; + $detail.html(html); // 关键地方 + }else{ + var html = ""; + html += ""; + html += ""; + html += ""; + html += ""; + html +="
没有更多数据
"; + $detail.html(html); // 关键地方 + } + + } + +}) +function loadSterilizationGoods(obj){ + $.ajax({ + url:'./data/json.json?id='+obj, + type:'get', + dataType:'json', + async:false, + success:function(data){ + var datas =data.rows; + if(data.success==true){ + $('#udsterilizationListTbale').bootstrapTable('load',datas) + } + } + }) +} + +//ajax 修改 deteils +function AjaxModal(obj){ + var str=""; + $.ajax({ + url:'./data/loadSterilizationRecord.json?id='+obj, + type:'get', + async:true, + dataType:'json', + success:function(data){ + if(data.success===true){ + var datas=data.data; + var str= + '
  • '+ + '
    '+ + ''+ + '
    '+ + '
    '+ + ''+ + '
    '+ + '
  • '+ + '
  • '+ + '
    '+ + ''+ + '
    '+ + '
    '+ + ''+ + '
    '+ + '
  • '+ + '
  • '+ + '
    '+ + ''+ + '
    '+ + '
    '+ + ''+ + '
    '+ + '
  • '+ + '
  • '+ + '
    '+ + ''+ + '
    '+ + '
    '+ + ''+ + '
    '+ + '
  • '+ + '
  • '+ + '
    '+ + ''+ + '
    '+ + '
  • '+ + '
  • '+ + '
    '+ + ''+ + '
    '+ + '
  • '+ + '
  • '+ + '
    '+ + ''+ + '
    '+ + '
  • ' + $('#sterilizationList_ul').html(str) + + var sterilizationList='
  • '+ + '
    '+ + ''+ + '
    '+ + '
    '+ + ''+ + '
    '+ + '
  • '+ + '
  • '+ + '
    '+ + ''+ + '
    '+ + '
    '+ + ''+ + '
    '+ + '
  • '+ + '
  • '+ + '
    '+ + ''+ + '
    '+ + '
    '+ + ''+ + '
    '+ + '
  • '+ + '
  • '+ + '
    '+ + ''+ + '
    '+ + '
    '+ + ''+ + '
    '+ + '
  • '+ + '
  • '+ + '
    '+ + ''+ + '
    '+ + '
    '+ + ''+ + '
    '+ + '
  • ' + $('#sterilizationList_li').html(sterilizationList); + // var totlas ='' + } + + + } + + }) +} +function ClickName (obj){ + if(obj!==''){ + AjaxModal(obj); + // 灭菌物品列表 + loadSterilizationGoods(obj) + }else { + alert('选择一行') + } +} +//完成灭菌 +$("#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 (); + 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:'http://rap2api.taobao.org/app/mock/85153/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; + } + } + }) + }) + } +}) +//灭菌失败 +$('#fails').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 (); + return false; + } + if(rows.length==2){ + $('#Alert').html('x 最多选择一条灭菌记录!') + $ ('#Alert').show ().delay (1500).fadeOut (); + return false; + }else { + $('#failOk').on('click',function(){ + var arrays = new Array();// 声明一个数组 + $(rows).each(function () {// 通过获得别选中的来进行遍历 + arrays.push(this.id);// cid为获得到的整条数据中的一列 + }); + var idcards =JSON.stringify(arrays) + $.ajax({ + url:'http://rap2api.taobao.org/app/mock/85153/disinfectSystem/sterilization/sterilizationRecordController/failureSterilizationRecord.mhtml?sterilizationRecordId='+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; + } + } + }) + }) + } +}) +//灭菌中断 +$('#interrupts').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 (); + return false; + } + if(rows.length==2){ + $('#Alert').html('x 最多选择一条操作记录!') + $ ('#Alert').show ().delay (1500).fadeOut (); + return false; + }else { + $('#interruptsOk').on('click',function(){ + var arrays = new Array();// 声明一个数组 + $(rows).each(function () {// 通过获得别选中的来进行遍历 + arrays.push(this.id);// cid为获得到的整条数据中的一列 + }); + var idcards =JSON.stringify(arrays) + $.ajax({ + url:'http://rap2api.taobao.org/app/mock/85153/disinfectSystem/sterilization/sterilizationRecordController/interruptSterilizationRecord.mhtml?sterilizationRecordId='+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; + } + } + }) + }) + } +}) +//删除灭菌记录 +$("#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 (); + 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:'http://rap2api.taobao.org/app/mock/85153/disinfectSystem/sterilization/sterilizationRecordController/deleteSterilizationRecord.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; + } + } + }) + }) + } +}) +//灭菌目的 //灭菌炉列表 //灭菌程序关联 +$(function(){ + $.ajax({ + // url:'./data/getSterilizationPurposeList.json', + url:'http://rap2api.taobao.org/app/mock/85153/disinfectSystem/sterilization/sterilizationRecordController/getSterilizationPurposeList.mhtml', + type:'get', + dataType:'json', + success:function(data){ + if(data.success===true){ + for(var i =0;i"+data.rows[i]['optionText']+""); + $('#purpose').append(opt) + } + } + } + }) + $.ajax({ + async:false, + url:"http://rap2api.taobao.org/app/mock/85153/disinfectSystem/baseData/sterilizerController/getAllSterilizer.mhtml?sterilerGroup=111&includeNone=yes", + dataType:"json", + success:function(data){ + var lie=data.rows; + if(data.success===true){ + var str = ""; + str=" " + for(var i=0;i"+lie[i]['name']+" "; + } + $("#sters").html(str); + }else { + $('#Alert').html('x '+data.message+'!') + $ ('#Alert').show ().delay (1500).fadeOut (); + return false; + } + } + }); + $.ajax({ + url:'http://rap2api.taobao.org/app/mock/85153/disinfectSystem/baseData/sterilisationController/getSterilizerType.mhtml?sterilizerName='+$('#sters').val(), + dataType:'json', + type:'get', + async:false, + success:function(data){ + var list=data.rows; + if(data.success===true){ + var str = ""; + str=" " + for(var i=0;i"+list[i]['sterilisation']+" "; + } + $("#procedure").html(str); + }else { + alert(data.message) + } + } + }) + $('#sters').change(function(){ + $('.Option').hide(); + $.ajax({ + url:'http://rap2api.taobao.org/app/mock/85153/disinfectSystem/sterilization/sterilizationRecordController/getMaxFrequency.mhtml?sterilizerName='+$('#sters').val(), + dataType:'json', + type:'get', + async:false, + success:function(data){ + if(data.success===true){ + $('#furnace').val(data.data.nextCycleCounter) + $('#furnace').attr('disabled','disabled') + }else{ + alert(data.message) + } + } + }) + $.ajax({ + url:'http://rap2api.taobao.org/app/mock/85153/disinfectSystem/baseData/sterilisationController/getSterilizerType.mhtml?sterilizerName='+$('#sters').val(), + dataType:'json', + type:'get', + async:false, + success:function(data){ + var list=data.rows; + if(data.success===true){ + var str = ""; + str=" " + for(var i=0;i"+list[i]['sterilisation']+" "; + } + $("#procedure").html(str); + }else { + alert(data.message) + } + } + }) + }) + + $('#procedure').change(function(){ + $('.procedure').hide(); + $.ajax({ + url:'http://rap2api.taobao.org/app/mock/85153/disinfectSystem/baseData/sterilisationController/getSterilizerType.mhtml?sterilizerName='+$('#sters').val(), + type:'get', + dataType:'json', + async:false, + success:function(data){ + var datas=data.rows; + for(var i=0;i').find('table'); + var html = ""; + html += ""; + for(var i=0;i" + + "" + + "" + + "" + + "" + + "" + + ""; + } + html +="
    " + rowChildren[i].barcode + "" + rowChildren[i].name + "" + rowChildren[i].sterilingMode + "" + rowChildren[i].amount + "
    "; + $detail.html(html); // 关键地方 + + }; +}) +// 添加灭菌 +$('#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 = $('#sterilizationListTbale').bootstrapTable('getData'); + 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) + $.ajax({ + url:'http://rap2api.taobao.org/app/mock/85153/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'); + } + } + }) + +})