Index: ssts-web/src/main/webapp/disinfectsystem/useRecord/useRecordView.js =================================================================== diff -u -r32872 -r33249 --- ssts-web/src/main/webapp/disinfectsystem/useRecord/useRecordView.js (.../useRecordView.js) (revision 32872) +++ ssts-web/src/main/webapp/disinfectsystem/useRecord/useRecordView.js (.../useRecordView.js) (revision 33249) @@ -6,54 +6,54 @@ var formSubmitResultSucc = "1"; var formSubmitResultFail = "-1"; -var setRecyclingStatusName = sstsConfig.monitorGoodsRecyclingStatusForUseRecord ?"设置已回收":"" +var setRecyclingStatusName = sstsConfig.monitorGoodsRecyclingStatusForUseRecord ? "设置已回收" : "" //添加使用记录 -function newUseRecord(){ - addAndEditUseRecord('', '',''); +function newUseRecord() { + addAndEditUseRecord('', '', ''); setTimeout("top.Ext.getCmp('hospitalNum').focus(true)", 500); } var departJsonStore = new Ext.data.Store({ - proxy : new Ext.data.HttpProxy({ - url : WWWROOT + '/disinfectSystem/baseData/supplyRoomConfigAction!getAllOrgUnitName.do?related=false', - method : 'POST' + proxy: new Ext.data.HttpProxy({ + url: WWWROOT + '/disinfectSystem/baseData/supplyRoomConfigAction!getAllOrgUnitName.do?related=false', + method: 'POST' }), - reader : new Ext.data.JsonReader({ - root : 'data' + reader: new Ext.data.JsonReader({ + root: 'data' }, - [{name : 'id',mapping : 'id'},{name : 'name',mapping : 'name'}]) + [{ name: 'id', mapping: 'id' }, { name: 'name', mapping: 'name' }]) }); departJsonStore.load(); /** * 批量设置状态为已回收 * @param ids */ -function batchSetRectgled(ids){ - var myMask = new Ext.LoadMask(Ext.getBody(), {msg:"正在修改状态...."}); +function batchSetRectgled(ids) { + var myMask = new Ext.LoadMask(Ext.getBody(), { msg: "正在修改状态...." }); myMask.show(); Ext.Ajax.request({ - url : WWWROOT + '/disinfectSystem/useRecordAction!batchSetRectgled.do', - method:'POST', - params : { - ids:ids - }, - success : function(response, options) { - var result = Ext.decode(response.responseText); - myMask.hide(); - if(result.message){ - showResult(result.message); - } - grid.dwrReload(); - }, - failure : function(response, options) { - myMask.hide(); - var result = Ext.decode(response.responseText); - if(result.message){ - showResult(result.message); - } - } - }); - + url: WWWROOT + '/disinfectSystem/useRecordAction!batchSetRectgled.do', + method: 'POST', + params: { + ids: ids + }, + success: function (response, options) { + var result = Ext.decode(response.responseText); + myMask.hide(); + if (result.message) { + showResult(result.message); + } + grid.dwrReload(); + }, + failure: function (response, options) { + myMask.hide(); + var result = Ext.decode(response.responseText); + if (result.message) { + showResult(result.message); + } + } + }); + } // 删除 @@ -64,10 +64,10 @@ return false; } var ids = null; - for ( var i = 0, len = records.length; i < len; i++) { + for (var i = 0, len = records.length; i < len; i++) { if (records[i].data['status'] != '未审核') { showResult('病人名称为“' + records[i].data['patientName'] + '”的使用记录' - + records[i].data['status'] + '不能删除'); + + records[i].data['status'] + '不能删除'); return false; } if (ids == null) { @@ -76,13 +76,13 @@ ids = ids + ';' + records[i].data['id']; } } - top.Ext.MessageBox.confirm("请确认","是否确定要删除选中的" + entityName + "信息?", - function(button, text) { + top.Ext.MessageBox.confirm("请确认", "是否确定要删除选中的" + entityName + "信息?", + function (button, text) { if ("yes" == button) { Ext.Ajax.request({ - url : WWWROOT+ '/disinfectSystem/useRecordAction!deleteUseRecord.do', - params : {ids : ids}, - success : function(response, options) { + url: WWWROOT + '/disinfectSystem/useRecordAction!deleteUseRecord.do', + params: { ids: ids }, + success: function (response, options) { var result = Ext.decode(response.responseText); var success = result.success; if (true != success && result.message) { @@ -92,7 +92,7 @@ grid.dwrReload(); } }, - failure : function(response, options) { + failure: function (response, options) { showResult('删除失败,服务器正忙,请稍候再试!'); } }); @@ -101,10 +101,10 @@ } var mask = null; -function getMask(){ - if(!mask){ +function getMask() { + if (!mask) { mask = new Ext.LoadMask(Ext.getBody(), { - msg : '正在处理打印请求,请稍候...' + msg: '正在处理打印请求,请稍候...' }); } return mask; @@ -117,51 +117,51 @@ return false; } var ids = null; - for ( var i = 0, len = records.length; i < len; i++) { + for (var i = 0, len = records.length; i < len; i++) { if (records[i].data['status'] != '已审核' && records[i].data['status'] != '已申请') { if (ids == null) { ids = records[i].data['id']; } else { ids = ids + ';' + records[i].data['id']; } - }else{ + } else { showResult("所选的记录已经审核,请选择未审核记录!"); return false; } } - - top.Ext.MessageBox.confirm("请确认","确定要审核所选的使用记录吗?", - function(button, text) { - if ("yes" == button) { -// var mask = new Ext.LoadMask(Ext.getBody(), -// {msg:'正在处理审核请求,请稍候...'} -// ); - getMask(); - mask.msg = '正在处理审核请求,请稍候...'; - mask.show(); - Ext.Ajax.request({ - url : WWWROOT+ '/disinfectSystem/useRecordAction!updateRecordStatus.do', - params : {ids : ids}, - success : function(response, options) { - mask.hide(); - var result = Ext.decode(response.responseText); - if(result.msg && result.msg.length!=0){ - showResult(result.msg); - }else{ - MsgTip.msg('提示', '审核成功!', true, 3); - grid.dwrReload(); + top.Ext.MessageBox.confirm("请确认", "确定要审核所选的使用记录吗?", + function (button, text) { + if ("yes" == button) { + + // var mask = new Ext.LoadMask(Ext.getBody(), + // {msg:'正在处理审核请求,请稍候...'} + // ); + getMask(); + mask.msg = '正在处理审核请求,请稍候...'; + mask.show(); + Ext.Ajax.request({ + url: WWWROOT + '/disinfectSystem/useRecordAction!updateRecordStatus.do', + params: { ids: ids }, + success: function (response, options) { + mask.hide(); + var result = Ext.decode(response.responseText); + if (result.msg && result.msg.length != 0) { + showResult(result.msg); + } else { + MsgTip.msg('提示', '审核成功!', true, 3); + grid.dwrReload(); + } + }, + failure: function (response, options) { + mask.hide(); + var result = Ext.decode(response.responseText); + MsgTip.msg('提示', result.cause, true, 3); } - }, - failure : function(response, options) { - mask.hide(); - var result = Ext.decode(response.responseText); - MsgTip.msg('提示', result.cause, true, 3); - } - }); - } - }); + }); + } + }); } @@ -184,45 +184,45 @@ } else { ids = ids + ';' + records[i].data['id']; } - }else{ + } else { showResult("所选的记录不是已审核状态,请选择已审核的记录!"); return false; } } - - - top.Ext.MessageBox.confirm("请确认","确定要返回成未审核状态吗?", function(button, text) { + + + top.Ext.MessageBox.confirm("请确认", "确定要返回成未审核状态吗?", function (button, text) { if ("yes" == button) { - -// var mask = new Ext.LoadMask(Ext.getBody(), -// {msg:'正在处理请求,请稍候...'} -// ); + + // var mask = new Ext.LoadMask(Ext.getBody(), + // {msg:'正在处理请求,请稍候...'} + // ); getMask(); mask.msg = '正在处理请求,请稍候...'; mask.show(); Ext.Ajax.request({ - url : WWWROOT+ '/disinfectSystem/useRecordAction!updateRecordStatus.do', - params : {ids : ids, type : 'becomeNotAudited'}, - success : function(response, options) { + url: WWWROOT + '/disinfectSystem/useRecordAction!updateRecordStatus.do', + params: { ids: ids, type: 'becomeNotAudited' }, + success: function (response, options) { mask.hide(); var result = Ext.decode(response.responseText); - if(!result.success){ + if (!result.success) { showResult("所选的记录不是已审核状态,请选择已审核的记录!"); - }else{ + } else { MsgTip.msg('提示', '所选的记录已成功返回成未审核状态!', true, 3); grid.dwrReload(); } }, - failure : function(response, options) { + failure: function (response, options) { mask.hide(); var result = Ext.decode(response.responseText); MsgTip.msg('提示', result.cause, true, 3); } }); } - + }); - + } /** @@ -232,27 +232,27 @@ function renderCallModifyFunction(v, p, record) { var data = record.data; return "" + v + ""; - + + data['status'] + "','" + data['recyclingStatus'] + "');return false;\">" + v + ""; + } function rendererColor(v, p, record) { var data = record.data; var result = ""; //点击使用记录列表的状态列,可以打开该条使用记录,即在状态列上增加打开该条使用记录的链接 if (audited == data['status']) { - result +="

" ; + result += "

"; result += ""; + result += data['status'] + "','" + data['recyclingStatus'] + "');return false;\">"; result += v + "

"; - }else if(unAudited == data['status']){ + } else if (unAudited == data['status']) { result += "

"; result += ""; + result += data['status'] + "','" + data['recyclingStatus'] + "');return false;\">"; result += v + "

"; } else { result += ""; + result += data['status'] + "','" + data['recyclingStatus'] + "');return false;\">"; result += v + ""; } return result; @@ -268,15 +268,15 @@ } var ids = null; var departMap = new Map(); - for ( var i = 0, len = records.length; i < len; i++) { + for (var i = 0, len = records.length; i < len; i++) { if (records[i].data['status'] != '已审核') { showResult('病人名称为“' + records[i].data['patientName'] - + '”的使用记录不能生成申请单,请确认使用记录已审核且未转化成申请单'); + + '”的使用记录不能生成申请单,请确认使用记录已审核且未转化成申请单'); return false; } - if((records[i].data['recyclingStatus'] == "已回收" || records[i].data['recyclingStatus'] == '部分回收') && sstsConfig.monitorGoodsRecyclingStatusForUseRecord){ + if ((records[i].data['recyclingStatus'] == "已回收" || records[i].data['recyclingStatus'] == '部分回收') && sstsConfig.monitorGoodsRecyclingStatusForUseRecord) { showResult('病人名称为[' + records[i].data['patientName'] - + ']的记录不能生成申请单,请确认该条记录为未回收状态或空'); + + ']的记录不能生成申请单,请确认该条记录为未回收状态或空'); return false; } if (ids == null) { @@ -286,24 +286,24 @@ } departMap.put(records[i].data['depart'], records[i].data['depart']); } - - if (departMap.size() > 1){ + + if (departMap.size() > 1) { top.Ext.MessageBox.alert("请确认", "所选择的使用记录的录入科室不一致,不能转换!"); return false; } var operatorStr = grid.getSelectionModel() - .getSelections()[0].data.operator; + .getSelections()[0].data.operator; var departStr = grid.getSelectionModel() - .getSelections()[0].data.depart; + .getSelections()[0].data.depart; var departCodingStr = grid.getSelectionModel() - .getSelections()[0].data.departCoding; - + .getSelections()[0].data.departCoding; + var confirmMessage = "是否确定要将选中的" + entityName + "信息生成申请单?"; - if(sstsConfig.auditAndConvertUseRecordConfirmMessage){ + if (sstsConfig.auditAndConvertUseRecordConfirmMessage) { confirmMessage = "手术是否已完成,不需要追加器械包?"; } - top.Ext.MessageBox.confirm("请确认",confirmMessage, - function(button, text) { + top.Ext.MessageBox.confirm("请确认", confirmMessage, + function (button, text) { if ("yes" == button) { convertUseRecordToApplication(null, ids, operatorStr, departStr, departCodingStr, null); } @@ -312,55 +312,55 @@ function convertUseRecordToApplication(button, ids, operatorStr, departStr, departCodingStr, win) { - if (button != null){ - button.disable(); // 防止重复点击 + if (button != null) { + button.disable(); // 防止重复点击 + } + + // var mask = new Ext.LoadMask(Ext.getBody(), + // {msg:'正在生成申请单,请稍候...'} + // ); + getMask(); + mask.msg = '正在生成申请单,请稍候...'; + mask.show(); + + Ext.Ajax.request({ + url: WWWROOT + + '/disinfectSystem/useRecordAction!createRecyclingApplicationByUseRecords.do', + params: { + ids: ids, + operator: operatorStr, + depart: departStr, + departCoding: departCodingStr, + applicationFormType: sstsConfig.applicationFormType + }, + success: function (response, options) { + mask.hide(); + var result = Ext.decode(response.responseText); + if (result.msg.length != 0) { + showResult(result.msg); + if (button != null) { + button.enable(); } - -// var mask = new Ext.LoadMask(Ext.getBody(), -// {msg:'正在生成申请单,请稍候...'} -// ); - getMask(); - mask.msg = '正在生成申请单,请稍候...'; - mask.show(); - - Ext.Ajax.request({ - url : WWWROOT - + '/disinfectSystem/useRecordAction!createRecyclingApplicationByUseRecords.do', - params : { - ids : ids, - operator : operatorStr, - depart : departStr, - departCoding : departCodingStr, - applicationFormType : sstsConfig.applicationFormType - }, - success : function(response, options) { - mask.hide(); - var result = Ext.decode(response.responseText); - if(result.msg.length!=0){ - showResult(result.msg); - if (button != null){ - button.enable(); - } - Ext.getCmp("formSubmitResult").setValue(formSubmitResultFail); - }else{ - showResult("申请成功!"); - Ext.getCmp("formSubmitResult").setValue(formSubmitResultSucc); - // 关闭使用记录的窗口,打开单张使用记录进行审核 - if (win != null){ - win.close(); - } - grid.dwrReload(); - } - }, - failure : function(response, options) { - mask.hide(); - Ext.getCmp("formSubmitResult").setValue(formSubmitResultFail); - if (button != null){ - button.enable(); - } - } - }); - + Ext.getCmp("formSubmitResult").setValue(formSubmitResultFail); + } else { + showResult("申请成功!"); + Ext.getCmp("formSubmitResult").setValue(formSubmitResultSucc); + // 关闭使用记录的窗口,打开单张使用记录进行审核 + if (win != null) { + win.close(); + } + grid.dwrReload(); + } + }, + failure: function (response, options) { + mask.hide(); + Ext.getCmp("formSubmitResult").setValue(formSubmitResultFail); + if (button != null) { + button.enable(); + } + } + }); + } // 审核并生成申请单按钮被点击 @@ -374,10 +374,10 @@ } var ids = null; var departMap = new Map(); - for ( var i = 0, len = records.length; i < len; i++) { + for (var i = 0, len = records.length; i < len; i++) { if (records[i].data['status'] == '已申请') { showResult('病人名称为“' + records[i].data['patientName'] - + '”的使用记录已经生成申请单,不能重复申请'); + + '”的使用记录已经生成申请单,不能重复申请'); return false; } if (ids == null) { @@ -387,31 +387,31 @@ } departMap.put(records[i].data['depart'], records[i].data['depart']); } - - if (departMap.size() > 1){ + + if (departMap.size() > 1) { top.Ext.MessageBox.alert("请确认", "所选择的使用记录的录入科室不一致,不能转换!"); return false; } - + var operatorStr = grid.getSelectionModel() .getSelections()[0].data.operator; var departStr = grid.getSelectionModel() .getSelections()[0].data.depart; var departCodingStr = grid.getSelectionModel() .getSelections()[0].data.departCoding; - + var confirmMessage = "是否确定要将选中的" + entityName + "信息生成申请单?"; - if(sstsConfig.auditAndConvertUseRecordConfirmMessage){ + if (sstsConfig.auditAndConvertUseRecordConfirmMessage) { confirmMessage = "手术是否已完成,不需要追加器械包?"; } - - top.Ext.MessageBox.confirm("请确认",confirmMessage, - function(button, text) { - if ("yes" == button) { - convertUseRecordToApplication(null, ids, operatorStr, departStr, departCodingStr, null); - - } - }); + + top.Ext.MessageBox.confirm("请确认", confirmMessage, + function (button, text) { + if ("yes" == button) { + convertUseRecordToApplication(null, ids, operatorStr, departStr, departCodingStr, null); + + } + }); } /** @@ -428,51 +428,51 @@ } var useRecordIdArray = []; var departJson = {}; - for ( var i = 0, len = records.length; i < len; i++) { + for (var i = 0, len = records.length; i < len; i++) { if (records[i].data['priorConvertStatus'] == '已转换') { showResult('病人名称为【' + records[i].data['patientName'] - + '】的使用记录已被优先转换申请单,不能重复优先转换申请单'); + + '】的使用记录已被优先转换申请单,不能重复优先转换申请单'); return false; } if (records[i].data['status'] == '已申请') { showResult('病人名称为【' + records[i].data['patientName'] - + '】的使用记录已经生成申请单,不能优先转换申请单'); + + '】的使用记录已经生成申请单,不能优先转换申请单'); return false; } useRecordIdArray.push(records[i].data['id']); departJson[records[i].data['depart']] = records[i].data['depart']; } - - if (departJson.length > 1){ + + if (departJson.length > 1) { top.Ext.MessageBox.alert("请确认", "所选择的使用记录的录入科室不一致,不能优先转换!"); return false; } - - top.Ext.MessageBox.confirm("请确认", "是否优先转换所选择的申请单", function(button, text) { + + top.Ext.MessageBox.confirm("请确认", "是否优先转换所选择的申请单", function (button, text) { if ("yes" == button) { - var myMask = new Ext.LoadMask(Ext.getBody(), {msg:"正在修改状态...."}); + var myMask = new Ext.LoadMask(Ext.getBody(), { msg: "正在修改状态...." }); myMask.show(); Ext.Ajax.request({ - url : WWWROOT + '/disinfectSystem/useRecordAction!priorConvertApplyGoods.do', - method:'POST', - params : { - ids:useRecordIdArray.join(",") - }, - success : function(response, options) { - myMask.hide(); - var result = Ext.decode(response.responseText); - if(result.message){ - showResult(result.message); - } - grid.dwrReload(); - }, - failure : function(response, options) { - myMask.hide(); - var result = Ext.decode(response.responseText); - if(result.message){ - showResult(result.message); - } - } + url: WWWROOT + '/disinfectSystem/useRecordAction!priorConvertApplyGoods.do', + method: 'POST', + params: { + ids: useRecordIdArray.join(",") + }, + success: function (response, options) { + myMask.hide(); + var result = Ext.decode(response.responseText); + if (result.message) { + showResult(result.message); + } + grid.dwrReload(); + }, + failure: function (response, options) { + myMask.hide(); + var result = Ext.decode(response.responseText); + if (result.message) { + showResult(result.message); + } + } }); } }); @@ -483,86 +483,86 @@ * */ -function getUseRecordRows(grid,printType){ - var records=grid.getSelectionModel().getSelections() - if(records.length==0){ - showResult("请选择需要打印的数据!"); - return false; - }else{ - var itemId = []; - for ( var i = 0, len = records.length; i < len; i++) { - itemId.push(records[i].data['id']) - } - Ext.Ajax.request({ - url: WWWROOT+'/disinfectSystem/useRecord/useRecordController/loadUseRecordListByIds.mhtml', - params: {useRecordIds: JSON.stringify(itemId)}, - success: function (response) { - var obj = JSON.parse(response.responseText); +function getUseRecordRows(grid, printType) { + var records = grid.getSelectionModel().getSelections() + if (records.length == 0) { + showResult("请选择需要打印的数据!"); + return false; + } else { + var itemId = []; + for (var i = 0, len = records.length; i < len; i++) { + itemId.push(records[i].data['id']) + } + Ext.Ajax.request({ + url: WWWROOT + '/disinfectSystem/useRecord/useRecordController/loadUseRecordListByIds.mhtml', + params: { useRecordIds: JSON.stringify(itemId) }, + success: function (response) { + var obj = JSON.parse(response.responseText); - if(obj.success){ - printUseRecordRows(obj,printType) - }else{ - showResult(obj.message); - } - }, - failure: function () { - Ext.Msg.alert("提示", "登陆失败,请与管理员联系!"); - } + if (obj.success) { + printUseRecordRows(obj, printType) + } else { + showResult(obj.message); + } + }, + failure: function () { + Ext.Msg.alert("提示", "登陆失败,请与管理员联系!"); + } }) } } -function printUseRecordRows(obj,printType){ +function printUseRecordRows(obj, printType) { - var objData =obj.rows; - for(var i=0;i住院号" + - ""+objData[i].hospitalNum+"" + - "病人" + - ""+objData[i].patientName+"" + - "巡回护士" + - ""+objData[i].circuitNurse+"" + - "" + - "" + - "手术间" + - ""+objData[i].operationRoom+"" + - "洗手护士" + - ""+objData[i].washHandNurse+"" + - "" + - "" + - "" - //各科室的器械包(一行抬头+多行数据(每个科室1行、需要遍历)) - if(tousseInstanceList && tousseInstanceList.length > 0){ - for(var j=0;j"+tousseInstanceList[j].tousseName+"" + - ""+tousseInstanceList[j].amount+"" + - "" - sum+=tousseInstanceList[j].amount - } - htmlTable+="" + - "合计" + - ""+sum+"" + - "" + var htmlTable = ""; + htmlTable += "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + //各科室的器械包(一行抬头+多行数据(每个科室1行、需要遍历)) + if (tousseInstanceList && tousseInstanceList.length > 0) { + for (var j = 0; j < tousseInstanceList.length; j++) { + htmlTable += "" + + "" + + "" + + "" + sum += tousseInstanceList[j].amount + } + htmlTable += "" + + "" + + "" + + "" } - htmlContent = "" + htmlTable + ""; - LODOP.ADD_PRINT_HTM(55,5,"99%","99%",htmlContent); + htmlContent = "" + htmlTable + ""; + LODOP.ADD_PRINT_HTM(55, 5, "99%", "99%", htmlContent); - if(printType == 0){//直接打印 - LODOP.PRINT(); - }else{//打印预览 - LODOP.SET_SHOW_MODE("HIDE_PAPER_BOARD",1); - LODOP.PREVIEW(); - } - } + if (printType == 0) {//直接打印 + LODOP.PRINT(); + } else {//打印预览 + LODOP.SET_SHOW_MODE("HIDE_PAPER_BOARD", 1); + LODOP.PREVIEW(); + } + } @@ -573,25 +573,25 @@ * @param useRecordId 使用记录id * @param recyclingStatus 回收状态 */ -function viewRecycling(useRecordId , recyclingStatus){ +function viewRecycling(useRecordId, recyclingStatus) { //alert(useRecordId + '=' + recyclingStatus); - if(!recyclingStatus){ + if (!recyclingStatus) { return ""; } - if(recyclingStatus == awaitRecycle){ + if (recyclingStatus == awaitRecycle) { /*top.Ext.MessageBox.confirm("请确认","该使用记录的回收状态为" + recyclingStatus + ",是否立即查询实时信息?", function(button, text) { if ("yes" == button) { showRecycling(useRecordId); var resultData = [ - {supplyRoomName:"供应室1名称",recyclingTime:"2019-08-14",rows:[{serialNumber:"2019-08-11",rows:[{tousseName:"包1名称","amount":2,"tallyAmount":2,"recyclingAmount":2},{tousseName:"包2名称","amount":3,"tallyAmount":4,"recyclingAmount":2},{tousseName:"包4名称","amount":6,"tallyAmount":4,"recyclingAmount":2}]},{serialNumber:"2019-08-12",rows:[{tousseName:"包1名称","amount":2,"tallyAmount":2,"recyclingAmount":2},{tousseName:"包3名称","amount":5,"amount":7,"recyclingAmount":2},{tousseName:"包6名称","amount":8,"amount":7,"recyclingAmount":2}]}]} - ,{supplyRoomName:"供应室2名称",recyclingTime:"2019-08-15",rows:[{serialNumber:"2019-08-11",rows:[{tousseName:"包1名称","amount":2,"tallyAmount":2,"recyclingAmount":2},{tousseName:"包2名称","amount":3,"tallyAmount":4,"recyclingAmount":2}]},{serialNumber:"2019-08-12",rows:[{tousseName:"包1名称","amount":2,"tallyAmount":2,"recyclingAmount":2},{tousseName:"包3名称","amount":5,"amount":7,"recyclingAmount":2}]}]} - ]; + {supplyRoomName:"供应室1名称",recyclingTime:"2019-08-14",rows:[{serialNumber:"2019-08-11",rows:[{tousseName:"包1名称","amount":2,"tallyAmount":2,"recyclingAmount":2},{tousseName:"包2名称","amount":3,"tallyAmount":4,"recyclingAmount":2},{tousseName:"包4名称","amount":6,"tallyAmount":4,"recyclingAmount":2}]},{serialNumber:"2019-08-12",rows:[{tousseName:"包1名称","amount":2,"tallyAmount":2,"recyclingAmount":2},{tousseName:"包3名称","amount":5,"amount":7,"recyclingAmount":2},{tousseName:"包6名称","amount":8,"amount":7,"recyclingAmount":2}]}]} + ,{supplyRoomName:"供应室2名称",recyclingTime:"2019-08-15",rows:[{serialNumber:"2019-08-11",rows:[{tousseName:"包1名称","amount":2,"tallyAmount":2,"recyclingAmount":2},{tousseName:"包2名称","amount":3,"tallyAmount":4,"recyclingAmount":2}]},{serialNumber:"2019-08-12",rows:[{tousseName:"包1名称","amount":2,"tallyAmount":2,"recyclingAmount":2},{tousseName:"包3名称","amount":5,"amount":7,"recyclingAmount":2}]}]} + ]; //displayRecyclingInfo(resultData); } });*/ showResult("该使用记录【" + recyclingStatus + "】"); - }else{ + } else { showRecycling(useRecordId); } } @@ -600,38 +600,38 @@ * 查询回收信息-SZSZLYY-31 使用记录监控回收状态功能优化 * @useRecordId 使用记录id */ -function showRecycling(useRecordId){ +function showRecycling(useRecordId) { Ext.Ajax.request({ - url : WWWROOT+ '/disinfectSystem/useRecordAction!showApplicationAndRecyclingItems.do', - params : {useRecordId : useRecordId}, - success : function(response, options) { - if(response.responseText == ''){ + url: WWWROOT + '/disinfectSystem/useRecordAction!showApplicationAndRecyclingItems.do', + params: { useRecordId: useRecordId }, + success: function (response, options) { + if (response.responseText == '') { showResult('无回收信息'); return; } var result = Ext.decode(response.responseText); var success = result.success; if (!success) { - if(result.message){ + if (result.message) { showResult(result.message); - }else{ + } else { showResult("查询结果失败,请稍后再试"); } } else { //显示回收信息(数据格式:[{supplyRoomName:"供应室1名称",recyclingTime:"最后回收时间",rows:[{serialNumber:"2019-08-11",rows:[{tousseName:"包1名称","applyAmount":2,"tallyAmount":2,"recyclingAmount":2},{tousseName:"包2名称","applyAmount":3,"tallyAmount":4,"recyclingAmount":2}]},{serialNumber:"2019-08-12",rows:[{tousseName:"包1名称","applyAmount":2,"tallyAmount":2,"recyclingAmount":2},{tousseName:"包3名称","applyAmount":5,"tallyAmount":7,"recyclingAmount":2}]}]},{supplyRoomName:"供应室2名称",recyclingTime:"最后回收时间",rows:[{serialNumber:"2019-08-11",rows:[{tousseName:"包1名称","applyAmount":2,"tallyAmount":2,"recyclingAmount":2},{tousseName:"包2名称","applyAmount":3,"tallyAmount":4,"recyclingAmount":2}]},{serialNumber:"2019-08-12",rows:[{tousseName:"包1名称","applyAmount":2,"tallyAmount":2,"recyclingAmount":2},{tousseName:"包3名称","applyAmount":5,"tallyAmount":7,"recyclingAmount":2}]}]}]) - if(result.rows && result.rows.length > 0 - || result.recycledTousses && result.recycledTousses.length > 0){ + if (result.rows && result.rows.length > 0 + || result.recycledTousses && result.recycledTousses.length > 0) { displayRecyclingInfo(result); - }else{ + } else { var noticeMessage = "无回收信息"; - if(result.data && - (result.data.manualSetRecyclingStatusUser - || result.data.manualSetRecyclingStatusTime)){ + if (result.data && + (result.data.manualSetRecyclingStatusUser + || result.data.manualSetRecyclingStatusTime)) { noticeMessage += ","; - if(result.data.manualSetRecyclingStatusTime){ + if (result.data.manualSetRecyclingStatusTime) { noticeMessage += " " + new Date(result.data.manualSetRecyclingStatusTime.time).format("Y-m-d H:i:s"); } - if(result.data.manualSetRecyclingStatusUser){ + if (result.data.manualSetRecyclingStatusUser) { noticeMessage += " " + result.data.manualSetRecyclingStatusUser; } noticeMessage += " 手工设置为已回收"; @@ -640,7 +640,7 @@ } } }, - failure : function(response, options) { + failure: function (response, options) { showResult('操作失败,服务器正忙,请稍候再试!'); } }); @@ -658,183 +658,187 @@ * @param recyclingData 返回的数据 * SZSZLYY-31 使用记录监控回收状态功能优化 */ -function displayRecyclingInfo(recyclingData){ +function displayRecyclingInfo(recyclingData) { var windowWidth = 850; var windowHeight = 550; - + var typeInvoicePlan = "invoicePlan"; var typeTousseItem = "tousseItem"; var typeTousseInstanceRoot = "tousseInstanceRoot"; var typeTousseInstance = "tousseInstance"; - var applicationItemsRd = new Ext.data.JsonReader( { - fields : [ - {name : 'tousseName'}, - {name : 'type'},//类型,分为invoicePlan、tousseItem、tousseInstanceRoot、tousseInstance - {name : 'amount'}, - {name : 'tallyAmount'}, - {name : 'recyclingAmount'}, + var applicationItemsRd = new Ext.data.JsonReader({ + fields: [ + { name: 'tousseName' }, + { name: 'type' },//类型,分为invoicePlan、tousseItem、tousseInstanceRoot、tousseInstance + { name: 'amount' }, + { name: 'tallyAmount' }, + { name: 'recyclingAmount' }, ] }); /** * 使用记录的申请及回收信息 */ var applicationItemsStore = new Ext.data.Store({ - reader : applicationItemsRd + reader: applicationItemsRd }); - + var tousseCm = [ - {header : "申请单/包名称/条码",dataIndex : 'tousseName',id:'tousseName',align:"left",width : 155,menuDisabled : true,renderer:function(v,i,r){ - var recordType = r.get("type"); - if(recordType == typeInvoicePlan || recordType == typeTousseInstanceRoot){ - v = "
" + v + "
"; - }else if(recordType == typeTousseItem || recordType == typeTousseInstance){ - v = "
    " + v + "
"; - } - return v; - }}, - {header : "申请数量",dataIndex : 'amount',align:"center",width : 70,menuDisabled : true}, - {header : "清点数量",dataIndex : 'tallyAmount',align:"center",width : 70,menuDisabled : true}, - {header : "回收数量",dataIndex : 'recyclingAmount',align:"center",width : 70,menuDisabled : true} - ]; + { + header: "申请单/包名称/条码", dataIndex: 'tousseName', id: 'tousseName', align: "left", width: 155, menuDisabled: true, renderer: function (v, i, r) { + var recordType = r.get("type"); + if (recordType == typeInvoicePlan || recordType == typeTousseInstanceRoot) { + v = "
" + v + "
"; + } else if (recordType == typeTousseItem || recordType == typeTousseInstance) { + v = "
    " + v + "
"; + } + return v; + } + }, + { header: "申请数量", dataIndex: 'amount', align: "center", width: 70, menuDisabled: true }, + { header: "清点数量", dataIndex: 'tallyAmount', align: "center", width: 70, menuDisabled: true }, + { header: "回收数量", dataIndex: 'recyclingAmount', align: "center", width: 70, menuDisabled: true } + ]; var recyclingPanel; //判断数量(如果大于1条,则使用标签面板;否则用普通面板即可)-后续完善(暂时只显示第一个供应室的) //if(recyclingData.length > 1){ - + //}else{ - recyclingPanel = new top.Ext.grid.GridPanel({ - id : 'recyclingPanel', - store : applicationItemsStore, - columns : tousseCm, - width:windowWidth-10, - height : windowHeight-68, - textAlign:"center", - autoScroll:true, - frame : false, - viewConfig: { - forceFit:true - }, - autoExpandColumn:"tousseName", - bodyStyle : 'border:1px solid #afd7af', - bbar : [{ - id:"lastRecyclingTime" - }] - }); - var lastRecyclingTime; - if(recyclingData.rows && recyclingData.rows.length > 0){ - for(var h = 0;h < recyclingData.rows.length;h++){ - var recyclingTime = recyclingData.rows[h].recyclingTime; - if(!lastRecyclingTime){ - lastRecyclingTime = recyclingTime; - }else if(lastRecyclingTime < recyclingTime){ - lastRecyclingTime = recyclingTime; - } - var recyclingDataRows = recyclingData.rows[h].rows; - for(var i = 0;i < recyclingDataRows.length;i++){ + recyclingPanel = new top.Ext.grid.GridPanel({ + id: 'recyclingPanel', + store: applicationItemsStore, + columns: tousseCm, + width: windowWidth - 10, + height: windowHeight - 68, + textAlign: "center", + autoScroll: true, + frame: false, + viewConfig: { + forceFit: true + }, + autoExpandColumn: "tousseName", + bodyStyle: 'border:1px solid #afd7af', + bbar: [{ + id: "lastRecyclingTime" + }] + }); + var lastRecyclingTime; + if (recyclingData.rows && recyclingData.rows.length > 0) { + for (var h = 0; h < recyclingData.rows.length; h++) { + var recyclingTime = recyclingData.rows[h].recyclingTime; + if (!lastRecyclingTime) { + lastRecyclingTime = recyclingTime; + } else if (lastRecyclingTime < recyclingTime) { + lastRecyclingTime = recyclingTime; + } + var recyclingDataRows = recyclingData.rows[h].rows; + for (var i = 0; i < recyclingDataRows.length; i++) { + applicationItemsStore.add(new top.Ext.data.Record({ + tousseName: "申请单流水号:" + recyclingDataRows[i].serialNumber, + type: typeInvoicePlan + })); + for (var j = 0; j < recyclingDataRows[i].rows.length; j++) { applicationItemsStore.add(new top.Ext.data.Record({ - tousseName:"申请单流水号:"+recyclingDataRows[i].serialNumber, - type:typeInvoicePlan + tousseName: recyclingDataRows[i].rows[j].tousseName, + amount: recyclingDataRows[i].rows[j].amount, + tallyAmount: recyclingDataRows[i].rows[j].tallyAmount, + recyclingAmount: recyclingDataRows[i].rows[j].recyclingAmount, + type: typeTousseItem })); - for(var j = 0;j < recyclingDataRows[i].rows.length;j++){ - applicationItemsStore.add(new top.Ext.data.Record({ - tousseName:recyclingDataRows[i].rows[j].tousseName, - amount:recyclingDataRows[i].rows[j].amount, - tallyAmount:recyclingDataRows[i].rows[j].tallyAmount, - recyclingAmount:recyclingDataRows[i].rows[j].recyclingAmount, - type:typeTousseItem - })); - } } } } - if(recyclingData.recycledTousses && recyclingData.recycledTousses.length > 0){ + } + if (recyclingData.recycledTousses && recyclingData.recycledTousses.length > 0) { + applicationItemsStore.add(new top.Ext.data.Record({ + tousseName: "已回收的器械包", + type: typeTousseInstanceRoot + })); + for (var h = 0; h < recyclingData.recycledTousses.length; h++) { + var tousseName = recyclingData.recycledTousses[h].tousseName + "" + recyclingData.recycledTousses[h].tousseBarcode; + if (recyclingData.recycledTousses[h].idcardBarcode) { + tousseName += "(标识牌条码:" + recyclingData.recycledTousses[h].idcardBarcode + ")"; + } applicationItemsStore.add(new top.Ext.data.Record({ - tousseName:"已回收的器械包", - type:typeTousseInstanceRoot + tousseName: tousseName, + recyclingAmount: 1, + type: typeTousseInstance })); - for(var h = 0;h < recyclingData.recycledTousses.length;h++){ - var tousseName = recyclingData.recycledTousses[h].tousseName + "" + recyclingData.recycledTousses[h].tousseBarcode; - if(recyclingData.recycledTousses[h].idcardBarcode){ - tousseName += "(标识牌条码:" + recyclingData.recycledTousses[h].idcardBarcode + ")"; - } - applicationItemsStore.add(new top.Ext.data.Record({ - tousseName:tousseName, - recyclingAmount:1, - type:typeTousseInstance - })); - } } + } //} - + var recyclingWin = new top.Ext.Window({ - title:"详细信息", - width:windowWidth, - modal:true, - height : windowHeight, - items:[recyclingPanel], - buttonAlign:"center", - buttons:[{text:"关闭",handler:function(){ - recyclingWin.close(); - }}] + title: "详细信息", + width: windowWidth, + modal: true, + height: windowHeight, + items: [recyclingPanel], + buttonAlign: "center", + buttons: [{ + text: "关闭", handler: function () { + recyclingWin.close(); + } + }] }); recyclingWin.show(); - + var displayMessage = ""; - if(recyclingData.data && - (recyclingData.data.manualSetRecyclingStatusUser - || recyclingData.data.manualSetRecyclingStatusTime)){ - if(recyclingData.data.manualSetRecyclingStatusTime){ + if (recyclingData.data && + (recyclingData.data.manualSetRecyclingStatusUser + || recyclingData.data.manualSetRecyclingStatusTime)) { + if (recyclingData.data.manualSetRecyclingStatusTime) { displayMessage += new Date(recyclingData.data.manualSetRecyclingStatusTime.time).format("Y-m-d H:i:s"); } - if(recyclingData.data.manualSetRecyclingStatusUser){ - if(displayMessage){ + if (recyclingData.data.manualSetRecyclingStatusUser) { + if (displayMessage) { displayMessage += " " + recyclingData.data.manualSetRecyclingStatusUser; - }else{ + } else { displayMessage = recyclingData.data.manualSetRecyclingStatusUser; } } displayMessage += " 手工设置为已回收"; } - if(displayMessage && lastRecyclingTime){ - displayMessage += ",最后回收时间:"+lastRecyclingTime; - }else if(lastRecyclingTime){ - displayMessage = "最后回收时间:"+lastRecyclingTime; + if (displayMessage && lastRecyclingTime) { + displayMessage += ",最后回收时间:" + lastRecyclingTime; + } else if (lastRecyclingTime) { + displayMessage = "最后回收时间:" + lastRecyclingTime; } top.Ext.getCmp('lastRecyclingTime').setText(displayMessage); } /*Annie-e*/ //DGSETYY-13:增加使用到回收超时提醒 -function getUnRecycleUseRecordAlarmWarning(){ +function getUnRecycleUseRecordAlarmWarning() { var params = ''; - if(fromDepartmentUseRecord){ + if (fromDepartmentUseRecord) { params += '?dataType=1'; } Ext.Ajax.request({ - url : WWWROOT+ '/system/systemWarningAction!getUnRecycleUseRecordAlarmWarning.do'+params, - success : function(response, options) { + url: WWWROOT + '/system/systemWarningAction!getUnRecycleUseRecordAlarmWarning.do' + params, + success: function (response, options) { var result = Ext.decode(response.responseText); var success = result.success; if (success && result.message) { showResult(result.message); } }, - failure : function(response, options) { + failure: function (response, options) { showResult('操作失败,服务器正忙,请稍候再试!'); } }); } -Ext.onReady(function() { +Ext.onReady(function () { Ext.QuickTips.init(); top.Ext.QuickTips.init(); - + top.Ext4.tip.QuickTipManager.init(); top.Ext4.apply(top.Ext4.tip.QuickTipManager.getQuickTip(), { - dismissDelay: 0, - showDelay: 0 + dismissDelay: 0, + showDelay: 0 }); //隐藏列名 var hiddenColumnsOfUseRecordListView = sstsConfig.hiddenColumnsOfUseRecordListView; @@ -855,106 +859,110 @@ var remarkColumnHeader = "备注"; var columns = [ - {header : patientNameColumnHeader,width : 70,dataIndex : 'patientName',hidden:fromDepartmentUseRecord || existsObjInArray(patientNameColumnHeader,hiddenColumnsOfUseRecordListView),renderer : renderCallModifyFunction}, - {header : statusColumnHeader,width : 50,dataIndex : 'status',hidden:existsObjInArray(statusColumnHeader,hiddenColumnsOfUseRecordListView),renderer : rendererColor}, - {header : '是否已推送',width : 78,dataIndex : 'finishPush',hidden:!sstsConfig.enableUseRecordTransportToThirdPartySystem}, - {header : '最后推送时间',width : 128,dataIndex : 'lastPushDateTime',hidden:!sstsConfig.enableUseRecordTransportToThirdPartySystem}, - {header : hospitalNumColumnHeader,width : 90,dataIndex : 'hospitalNum',hidden:fromDepartmentUseRecord || existsObjInArray(hospitalNumColumnHeader,hiddenColumnsOfUseRecordListView),renderer : renderCallModifyFunction}, - {header : treatmentNumColumnHeader,width : 90,dataIndex : 'treatmentNum',hidden:fromDepartmentUseRecord || existsObjInArray(treatmentNumColumnHeader,hiddenColumnsOfUseRecordListView),renderer : renderCallModifyFunction}, - {header : operationRoomColumnHeader,width : 90,dataIndex : 'operationRoom',hidden:fromDepartmentUseRecord || existsObjInArray(operationRoomColumnHeader,hiddenColumnsOfUseRecordListView),renderer : renderCallModifyFunction}, - {header : patientAgeColumnHeader,width : 40,dataIndex : 'patientAge',hidden:fromDepartmentUseRecord || existsObjInArray(patientAgeColumnHeader,hiddenColumnsOfUseRecordListView)}, - {header : patientIDCardColumnHeader,width : 120,dataIndex : 'patientIDCard',hidden:fromDepartmentUseRecord || existsObjInArray(patientIDCardColumnHeader,hiddenColumnsOfUseRecordListView)}, - {header : doctorNameColumnHeader,width : 70,dataIndex : 'doctorName',hidden:fromDepartmentUseRecord || existsObjInArray(doctorNameColumnHeader,hiddenColumnsOfUseRecordListView)}, - {header : operationColumnHeader,width : 150,dataIndex : 'operation',hidden:fromDepartmentUseRecord || existsObjInArray(operationColumnHeader,hiddenColumnsOfUseRecordListView)}, - {header : recyclingStatusColumnHeader,width : 150,dataIndex : 'recyclingStatus',hidden:fromDepartmentUseRecord || (sstsConfig.monitorGoodsRecyclingStatusForUseRecord ? false :true),renderer:function(v , p , rec){ - //SZSZLYY-31 使用记录监控回收状态功能优化 - if(v == awaitRecycle || v == partRecycle || v == recycled){ - return ''+v+''; - }else { - return v; + { header: patientNameColumnHeader, width: 70, dataIndex: 'patientName', hidden: fromDepartmentUseRecord || existsObjInArray(patientNameColumnHeader, hiddenColumnsOfUseRecordListView), renderer: renderCallModifyFunction }, + { header: statusColumnHeader, width: 50, dataIndex: 'status', hidden: existsObjInArray(statusColumnHeader, hiddenColumnsOfUseRecordListView), renderer: rendererColor }, + { header: '是否已推送', width: 78, dataIndex: 'finishPush', hidden: !sstsConfig.enableUseRecordTransportToThirdPartySystem }, + { header: '最后推送时间', width: 128, dataIndex: 'lastPushDateTime', hidden: !sstsConfig.enableUseRecordTransportToThirdPartySystem }, + { header: hospitalNumColumnHeader, width: 90, dataIndex: 'hospitalNum', hidden: fromDepartmentUseRecord || existsObjInArray(hospitalNumColumnHeader, hiddenColumnsOfUseRecordListView), renderer: renderCallModifyFunction }, + { header: treatmentNumColumnHeader, width: 90, dataIndex: 'treatmentNum', hidden: fromDepartmentUseRecord || existsObjInArray(treatmentNumColumnHeader, hiddenColumnsOfUseRecordListView), renderer: renderCallModifyFunction }, + { header: operationRoomColumnHeader, width: 90, dataIndex: 'operationRoom', hidden: fromDepartmentUseRecord || existsObjInArray(operationRoomColumnHeader, hiddenColumnsOfUseRecordListView), renderer: renderCallModifyFunction }, + { header: patientAgeColumnHeader, width: 40, dataIndex: 'patientAge', hidden: fromDepartmentUseRecord || existsObjInArray(patientAgeColumnHeader, hiddenColumnsOfUseRecordListView) }, + { header: patientIDCardColumnHeader, width: 120, dataIndex: 'patientIDCard', hidden: fromDepartmentUseRecord || existsObjInArray(patientIDCardColumnHeader, hiddenColumnsOfUseRecordListView) }, + { header: doctorNameColumnHeader, width: 70, dataIndex: 'doctorName', hidden: fromDepartmentUseRecord || existsObjInArray(doctorNameColumnHeader, hiddenColumnsOfUseRecordListView) }, + { header: operationColumnHeader, width: 150, dataIndex: 'operation', hidden: fromDepartmentUseRecord || existsObjInArray(operationColumnHeader, hiddenColumnsOfUseRecordListView) }, + { + header: recyclingStatusColumnHeader, width: 150, dataIndex: 'recyclingStatus', hidden: fromDepartmentUseRecord || (sstsConfig.monitorGoodsRecyclingStatusForUseRecord ? false : true), renderer: function (v, p, rec) { + //SZSZLYY-31 使用记录监控回收状态功能优化 + if (v == awaitRecycle || v == partRecycle || v == recycled) { + return '' + v + ''; + } else { + return v; + } } - }}, - {header : "优先转换状态",width : 150,dataIndex : 'priorConvertStatus',hidden:fromDepartmentUseRecord || (sstsConfig.enablePriorConvertApplyGoods ? false :true)}, - {header : operatorColumnHeader,width : 60,dataIndex : 'operator',hidden:existsObjInArray(operatorColumnHeader,hiddenColumnsOfUseRecordListView)}, - {header : departColumnHeader,width : 80,dataIndex : 'depart',hidden:existsObjInArray(departColumnHeader,hiddenColumnsOfUseRecordListView)}, - {header : '病人所在科室',width : 150,dataIndex : 'departNameOfpatient',sortable: false}, - {header : enteringDateColumnHeader,width : 120,dataIndex : 'enteringDate',hidden:existsObjInArray(enteringDateColumnHeader,hiddenColumnsOfUseRecordListView),renderer : function(v , p , rec){ - //DGSETYY-13:增加使用到回收超时提醒 - if (v == null) { - return ""; - } else { - var isUseToRecycleWarn = rec.data.isUseToRecycleWarn; - var status = rec.data.status; - if((isUseToRecycleWarn == 'true' || isUseToRecycleWarn == true) && status !== '已申请'){ - return ''+v.substring(0, 16)+''; - }else { - return v.substring(0, 16); + }, + { header: "优先转换状态", width: 150, dataIndex: 'priorConvertStatus', hidden: fromDepartmentUseRecord || (sstsConfig.enablePriorConvertApplyGoods ? false : true) }, + { header: operatorColumnHeader, width: 60, dataIndex: 'operator', hidden: existsObjInArray(operatorColumnHeader, hiddenColumnsOfUseRecordListView) }, + { header: departColumnHeader, width: 80, dataIndex: 'depart', hidden: existsObjInArray(departColumnHeader, hiddenColumnsOfUseRecordListView) }, + { header: '病人所在科室', width: 150, dataIndex: 'departNameOfpatient', sortable: false }, + { + header: enteringDateColumnHeader, width: 120, dataIndex: 'enteringDate', hidden: existsObjInArray(enteringDateColumnHeader, hiddenColumnsOfUseRecordListView), renderer: function (v, p, rec) { + //DGSETYY-13:增加使用到回收超时提醒 + if (v == null) { + return ""; + } else { + var isUseToRecycleWarn = rec.data.isUseToRecycleWarn; + var status = rec.data.status; + if ((isUseToRecycleWarn == 'true' || isUseToRecycleWarn == true) && status !== '已申请') { + return '' + v.substring(0, 16) + ''; + } else { + return v.substring(0, 16); + } } } - }}, - {header : applicationTimeColumnHeader,width : 120,dataIndex : 'applicationTime',hidden:fromDepartmentUseRecord || existsObjInArray(applicationTimeColumnHeader,hiddenColumnsOfUseRecordListView),renderer : myDateFormatByMinute}, - {header : remarkColumnHeader,width : 120,dataIndex : 'remark',id : 'autoWidth',hidden:existsObjInArray(remarkColumnHeader,hiddenColumnsOfUseRecordListView)} + }, + { header: applicationTimeColumnHeader, width: 120, dataIndex: 'applicationTime', hidden: fromDepartmentUseRecord || existsObjInArray(applicationTimeColumnHeader, hiddenColumnsOfUseRecordListView), renderer: myDateFormatByMinute }, + { header: remarkColumnHeader, width: 120, dataIndex: 'remark', id: 'autoWidth', hidden: existsObjInArray(remarkColumnHeader, hiddenColumnsOfUseRecordListView) } ]; var filters = new Ext.grid.GridFilters({ - filters : [ - {type : 'string',dataIndex : 'treatmentNum'}, - {type : 'string',dataIndex : 'hospitalNum'}, - {type : 'string',dataIndex : 'patientName'}, - {type : 'string',dataIndex : 'operationRoom'}, - {type : 'numeric',dataIndex : 'patientAge'}, - {type : 'string',dataIndex : 'patientIDCard'}, - {type : 'string',dataIndex : 'doctorName'}, - {type : 'string',dataIndex : 'operation'}, - {type : 'string',dataIndex : 'recyclingStatus'}, - {type : 'string',dataIndex : 'priorConvertStatus'}, - {type : 'string',dataIndex : 'operator'}, - {type : 'date',dataIndex : 'enteringDate'}, - {type : 'date',dataIndex : 'applicationTime'}, - {type : 'list',dataIndex : 'status',options : [ unAudited, audited,applied ],phpMode : true}, - {type : 'string',dataIndex : 'remark'}, - {type : 'string',dataIndex : 'depart'} + filters: [ + { type: 'string', dataIndex: 'treatmentNum' }, + { type: 'string', dataIndex: 'hospitalNum' }, + { type: 'string', dataIndex: 'patientName' }, + { type: 'string', dataIndex: 'operationRoom' }, + { type: 'numeric', dataIndex: 'patientAge' }, + { type: 'string', dataIndex: 'patientIDCard' }, + { type: 'string', dataIndex: 'doctorName' }, + { type: 'string', dataIndex: 'operation' }, + { type: 'string', dataIndex: 'recyclingStatus' }, + { type: 'string', dataIndex: 'priorConvertStatus' }, + { type: 'string', dataIndex: 'operator' }, + { type: 'date', dataIndex: 'enteringDate' }, + { type: 'date', dataIndex: 'applicationTime' }, + { type: 'list', dataIndex: 'status', options: [unAudited, audited, applied], phpMode: true }, + { type: 'string', dataIndex: 'remark' }, + { type: 'string', dataIndex: 'depart' } ] }); var readerDetail = [ - {name : 'id'}, - {name : 'treatmentNum'}, - {name : 'hospitalNum'}, - {name : 'patientName'}, - {name : 'operationRoom'}, - {name : 'patientAge'}, - {name : 'patientIDCard'}, - {name : 'doctorName'}, - {name : 'operation'}, - {name : 'departNameOfpatient'}, - {name : 'recyclingStatus'}, - {name : 'priorConvertStatus'}, - {name : 'depart'}, - {name : 'operator'}, - {name : 'enteringDate'}, - {name : 'applicationTime'}, - {name : 'status'}, - {name : 'isUseToRecycleWarn'}, - {name : 'finishPush'}, - {name : 'lastPushDateTime'}, - {name : 'remark'}, - {name : 'departCoding'} + { name: 'id' }, + { name: 'treatmentNum' }, + { name: 'hospitalNum' }, + { name: 'patientName' }, + { name: 'operationRoom' }, + { name: 'patientAge' }, + { name: 'patientIDCard' }, + { name: 'doctorName' }, + { name: 'operation' }, + { name: 'departNameOfpatient' }, + { name: 'recyclingStatus' }, + { name: 'priorConvertStatus' }, + { name: 'depart' }, + { name: 'operator' }, + { name: 'enteringDate' }, + { name: 'applicationTime' }, + { name: 'status' }, + { name: 'isUseToRecycleWarn' }, + { name: 'finishPush' }, + { name: 'lastPushDateTime' }, + { name: 'remark' }, + { name: 'departCoding' } ]; - var tbar = [ { - text : '添加', - hidden : fromDepartmentUseRecord ? SSTS_DepartmentUseRecord_Create : SSTS_UseRecord_Create, - iconCls : 'btn_ext_application_add', - handler : function() { + var tbar = [{ + text: '添加', + hidden: fromDepartmentUseRecord ? SSTS_DepartmentUseRecord_Create : SSTS_UseRecord_Create, + iconCls: 'btn_ext_application_add', + handler: function () { newUseRecord(); } }, '-', { - text : '修改', - hidden : fromDepartmentUseRecord ? SSTS_DepartmentUseRecord_Update : SSTS_UseRecord_Update, - iconCls : 'btn_ext_application_edit', - id : 'editTbar', - handler : function() { + text: '修改', + hidden: fromDepartmentUseRecord ? SSTS_DepartmentUseRecord_Update : SSTS_UseRecord_Update, + iconCls: 'btn_ext_application_edit', + id: 'editTbar', + handler: function () { var records = grid.getSelectionModel().getSelections(); if (records.length == 0) { showResult("请选择需要修改的使用记录信息!"); @@ -965,157 +973,157 @@ return false; } var d = records[0]; - addAndEditUseRecord(d.data['id'],d.data['status'],d.data['recyclingStatus']); + addAndEditUseRecord(d.data['id'], d.data['status'], d.data['recyclingStatus']); } }, '-', { - text : '删除', - hidden : fromDepartmentUseRecord ? SSTS_DepartmentUseRecord_Delete : SSTS_UseRecord_Delete, - iconCls : 'btn_ext_application_del', - handler : function() { + text: '删除', + hidden: fromDepartmentUseRecord ? SSTS_DepartmentUseRecord_Delete : SSTS_UseRecord_Delete, + iconCls: 'btn_ext_application_del', + handler: function () { deleteUseRecord(grid); } }, '-', { - text : '审核', - hidden : fromDepartmentUseRecord ? (SSTS_DepartmentUseRecord_Review || sstsConfig.useRecordAuditMode != 1) : (SSTS_UseRecord_Review || sstsConfig.useRecordAuditMode != 1), - iconCls : 'btn_ext_application_edit', - handler : function() { + text: '审核', + hidden: fromDepartmentUseRecord ? (SSTS_DepartmentUseRecord_Review || sstsConfig.useRecordAuditMode != 1) : (SSTS_UseRecord_Review || sstsConfig.useRecordAuditMode != 1), + iconCls: 'btn_ext_application_edit', + handler: function () { audit(grid); } }, '-', { - text : sstsConfig.useRecordAuditMode == 1 ? '优先转换申请单' : '审核并优先转换申请单', - hidden : fromDepartmentUseRecord ? SSTS_DepartmentUseRecord_PriorConvert : SSTS_UseRecord_PriorConvert, - iconCls : 'btn_ext_refresh', - handler : function() { + text: sstsConfig.useRecordAuditMode == 1 ? '优先转换申请单' : '审核并优先转换申请单', + hidden: fromDepartmentUseRecord ? SSTS_DepartmentUseRecord_PriorConvert : SSTS_UseRecord_PriorConvert, + iconCls: 'btn_ext_refresh', + handler: function () { priorConvertApplyGoods(grid); } }, '-', { - text : '返回', - iconCls : 'btn_ext_refresh', - hidden : sstsConfig.enableBecomeNotAuditedButton ? false : true, - handler : function() { + text: '返回', + iconCls: 'btn_ext_refresh', + hidden: sstsConfig.enableBecomeNotAuditedButton ? false : true, + handler: function () { becomeNotAudited(grid); } }, { - text : '生成申请单', - hidden : fromDepartmentUseRecord ? (SSTS_DepartmentUseRecord_Convert || sstsConfig.useRecordAuditMode != 1) : (SSTS_UseRecord_Convert || sstsConfig.useRecordAuditMode != 1), - iconCls : 'btn_ext_refresh', - handler : function() { + text: '生成申请单', + hidden: fromDepartmentUseRecord ? (SSTS_DepartmentUseRecord_Convert || sstsConfig.useRecordAuditMode != 1) : (SSTS_UseRecord_Convert || sstsConfig.useRecordAuditMode != 1), + iconCls: 'btn_ext_refresh', + handler: function () { convertButtonClicked(grid); } - },{ - text : setRecyclingStatusName, - hidden : sstsConfig.monitorGoodsRecyclingStatusForUseRecord ? false :true, - iconCls : 'btn_ext_application_edit', - handler : function() { - var selectionModel = grid.getSelectionModel(); - var selections = []; - var isReturn = false; - selectionModel.each(function(row){ - selections.push(row.data.id); - if("已回收"==row.data.recyclingStatus){ - showResult("病人名称为【"+row.data.patientName+"】的数据已经是已回收状态了!"); - isReturn = true; - return; - } - }); - if(isReturn){ - return; - } - var ids = selections.join(','); + }, { + text: setRecyclingStatusName, + hidden: sstsConfig.monitorGoodsRecyclingStatusForUseRecord ? false : true, + iconCls: 'btn_ext_application_edit', + handler: function () { + var selectionModel = grid.getSelectionModel(); + var selections = []; + var isReturn = false; + selectionModel.each(function (row) { + selections.push(row.data.id); + if ("已回收" == row.data.recyclingStatus) { + showResult("病人名称为【" + row.data.patientName + "】的数据已经是已回收状态了!"); + isReturn = true; + return; + } + }); + if (isReturn) { + return; + } + var ids = selections.join(','); batchSetRectgled(ids); } - + }, { - text : '审核并生成申请单', - hidden : fromDepartmentUseRecord ? (SSTS_DepartmentUseRecord_Convert || sstsConfig.useRecordAuditMode != 2) : (SSTS_UseRecord_Convert || sstsConfig.useRecordAuditMode != 2), - iconCls : 'btn_ext_refresh', - handler : function() { + text: '审核并生成申请单', + hidden: fromDepartmentUseRecord ? (SSTS_DepartmentUseRecord_Convert || sstsConfig.useRecordAuditMode != 2) : (SSTS_UseRecord_Convert || sstsConfig.useRecordAuditMode != 2), + iconCls: 'btn_ext_refresh', + handler: function () { auditAndConvertBtnClicked(grid); } - },{ - text : '合并转换申请单', - hidden : fromDepartmentUseRecord ? (SSTS_DepartmentUseRecord_MergeConvert || sstsConfig.enableMultiUseRecordMergeConvert != true) : (SSTS_UseRecord_MergeConvert || sstsConfig.enableMultiUseRecordMergeConvert != true), - iconCls : 'btn_ext_refresh', - handler : function() { + }, { + text: '合并转换申请单', + hidden: fromDepartmentUseRecord ? (SSTS_DepartmentUseRecord_MergeConvert || sstsConfig.enableMultiUseRecordMergeConvert != true) : (SSTS_UseRecord_MergeConvert || sstsConfig.enableMultiUseRecordMergeConvert != true), + iconCls: 'btn_ext_refresh', + handler: function () { openUseRecordMergeConvertWin(); } - },'-',{ - text : '打印', - hidden : fromDepartmentUseRecord ? (!sstsConfig.ControlUseRecordprint && !SSTS_DepartmentUseRecord_Create) : (!sstsConfig.ControlUseRecordprint && !SSTS_UseRecord_Create), - iconCls : 'icon_print', - handler : function() { - getUseRecordRows(grid,0) - } - },'-',{ - text : '导出', - hidden : fromDepartmentUseRecord, - iconCls : 'btn_ext_download', - handler : function() { + }, '-', { + text: '打印', + hidden: fromDepartmentUseRecord ? (!sstsConfig.ControlUseRecordprint && !SSTS_DepartmentUseRecord_Create) : (!sstsConfig.ControlUseRecordprint && !SSTS_UseRecord_Create), + iconCls: 'icon_print', + handler: function () { + getUseRecordRows(grid, 0) + } + }, '-', { + text: '导出', + hidden: fromDepartmentUseRecord, + iconCls: 'btn_ext_download', + handler: function () { var records = grid.getSelectionModel().getSelections(); if (records.length == 0) { showResult("请选择要导出的使用记录!"); return false; } var useRecordIds = ''; var message = ''; - for(var i=0;i 0){ - for(var i = 0;i < data.imageArray.length; i++){ - var imgUrl = WWWROOT +'/disinfectSystem/baseData/uploadImageAndVideoAction!getImageById.do?imageId='+ data.imageArray[i].id+'&original=true'; + if (data.imageArray.length > 0) { + for (var i = 0; i < data.imageArray.length; i++) { + var imgUrl = WWWROOT + '/disinfectSystem/baseData/uploadImageAndVideoAction!getImageById.do?imageId=' + data.imageArray[i].id + '&original=true'; imgArray.push(imgUrl); } - } - showImg(imgArray,barcode); + } + showImg(imgArray, barcode); } } }); } //显示图片 -function showImg(imgArray,barcode){ +function showImg(imgArray, barcode) { var page = 1; var totalPage = imgArray.length; var toolbarPage = new top.Ext.Toolbar.TextItem({ - text : '第1页' + text: '第1页' }); var toolbarTotalPage = new top.Ext.Toolbar.TextItem({ - text : '共'+totalPage+'页' + text: '共' + totalPage + '页' }); - + var imagePanel = new top.Ext.Panel({ - id : 'imagePanel', - layout : 'fit', - height : 440, - items : [{ - xtype : 'box', - id : 'browseImage', - fieldLabel : "预览图片", - autoEl : { - id : 'imageBrowse', - tag : 'img', - autoHeight:true, - src : Ext.BLANK_IMAGE_URL, - style : 'filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale);', - complete : 'off' - } + id: 'imagePanel', + layout: 'fit', + height: 440, + items: [{ + xtype: 'box', + id: 'browseImage', + fieldLabel: "预览图片", + autoEl: { + id: 'imageBrowse', + tag: 'img', + autoHeight: true, + src: Ext.BLANK_IMAGE_URL, + style: 'filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale);', + complete: 'off' + } }] }); var browseImage = imagePanel.findById('browseImage'); - var url = imgArray[page-1] || WWWROOT+'/images/default.jpg'; - browseImage.autoEl.src=url; + var url = imgArray[page - 1] || WWWROOT + '/images/default.jpg'; + browseImage.autoEl.src = url; var showTousseImage = new top.Ext.Panel({ - items : [{ - xtype : 'panel', - id : 'pageToolbar', - bbar : ['->',{ - xtype : 'button', - text : '<<', - tooltip :"上一页", - handler : function(){ - if (page - 1 <= 0) { - showResult('已是第一页'); - return; - } - page = page - 1; - var url = imgArray[page-1]; - var imageBrowse = top.Ext.get('imageBrowse'); - var image = imageBrowse.dom; - image.src = url;// 覆盖原来的图片 - var element = top.Ext.get(toolbarPage.el); - element.update('第' + page + '页'); - } + items: [{ + xtype: 'panel', + id: 'pageToolbar', + bbar: ['->', { + xtype: 'button', + text: '<<', + tooltip: "上一页", + handler: function () { + if (page - 1 <= 0) { + showResult('已是第一页'); + return; + } + page = page - 1; + var url = imgArray[page - 1]; + var imageBrowse = top.Ext.get('imageBrowse'); + var image = imageBrowse.dom; + image.src = url;// 覆盖原来的图片 + var element = top.Ext.get(toolbarPage.el); + element.update('第' + page + '页'); + } }, - toolbarPage, - toolbarTotalPage,{ - xtype : 'button', - text : '>>', - tooltip :"下一页", - handler : function() { - if (page + 1 > totalPage) { - showResult('已是最后一页'); - return; - } - page = page + 1; - var url = imgArray[page-1]; - var imageBrowse = top.Ext.get('imageBrowse'); - var image = imageBrowse.dom; - image.src = url;// 覆盖原来的图片 - var element = top.Ext.get(toolbarPage.el); - element.update('第' + page + '页'); - } - }] - },imagePanel] + toolbarPage, + toolbarTotalPage, { + xtype: 'button', + text: '>>', + tooltip: "下一页", + handler: function () { + if (page + 1 > totalPage) { + showResult('已是最后一页'); + return; + } + page = page + 1; + var url = imgArray[page - 1]; + var imageBrowse = top.Ext.get('imageBrowse'); + var image = imageBrowse.dom; + image.src = url;// 覆盖原来的图片 + var element = top.Ext.get(toolbarPage.el); + element.update('第' + page + '页'); + } + }] + }, imagePanel] }); var signGoodsWin = new top.Ext.Window({ - id : 'signGoodsWin', - title : '请根据下图核对包内材料,确认无误再点击录入使用记录!', + id: 'signGoodsWin', + title: '请根据下图核对包内材料,确认无误再点击录入使用记录!', resizable: false, - width : 800, - height : 500, - border : false, - modal : true, - plain : true, + width: 800, + height: 500, + border: false, + modal: true, + plain: true, stateful: false, - items : [showTousseImage], - buttonAlign : 'center', - buttons : [{ - text:"录入使用记录", - handler:function(){ - loadScanGoods(false,barcode); + items: [showTousseImage], + buttonAlign: 'center', + buttons: [{ + text: "录入使用记录", + handler: function () { + loadScanGoods(false, barcode); signGoodsWin.close(); - } - },{ - text:"取消录入", - handler:function(){ - signGoodsWin.close(); - } + } + }, { + text: "取消录入", + handler: function () { + signGoodsWin.close(); + } }] }); - + signGoodsWin.show(); } //GDSZYY-88:验证外来器械包的病人信息与使用记录中的病人信息是否一致 -function validPatientInfo(arr){ +function validPatientInfo(arr) { var hospitalNum = top.Ext.getCmp('hospitalNum').getValue() || ''; var treatmentNum = top.Ext.getCmp('treatmentNum').getValue() || ''; var patientName = top.Ext.getCmp('patientName').getValue() || ''; var nameArr = []; - if(arr){ - for(var i=0;i 0){ - showResult('请注意,以下外来器械包的病人信息与使用记录中的病人信息不一致:'+nameArr.join(",")+'!'); + if (nameArr.length > 0) { + showResult('请注意,以下外来器械包的病人信息与使用记录中的病人信息不一致:' + nameArr.join(",") + '!'); } } @@ -626,12 +626,12 @@ * 可以扫描的条码有器械包(类型有器械包、敷料包、消毒物品、外部代理灭菌、外来器械包及外来器械拆分小包、自定义器械包、聚合包)、一次性物品(普通物品与高值耗材) * 针对聚合包条码的扫描时还需判断是新增使用记录还是修改使用记录、需要传递使用记录的id */ -function loadScanGoods(isValid,barcode) { +function loadScanGoods(isValid, barcode) { var barcode = barcode || top.Ext.getCmp('tempBarcode').getValue(); top.Ext.getCmp('tempBarcode').setValue(''); if (barcode != '') { //对扫描的条码进行去前辍处理(如中大附一的扫描枪扫描我们的条码010035998,实际上有可能读到的信息为{z#xy*984},Q,010035998) - if(barcode.indexOf(",")){ + if (barcode.indexOf(",")) { var barcodeArray = barcode.split(","); barcode = barcodeArray[barcodeArray.length - 1]; } @@ -642,17 +642,17 @@ } Ext.Ajax.request({ - url : WWWROOT + '/disinfectSystem/useRecordAction!loadScanedGoods.do', - params : { - barcode : barcode, - useRecordId : currentUseRecordId, - scanedBarcodes : getTousseGridData() + url: WWWROOT + '/disinfectSystem/useRecordAction!loadScanedGoods.do', + params: { + barcode: barcode, + useRecordId: currentUseRecordId, + scanedBarcodes: getTousseGridData() }, - success : function(response, options) { + success: function (response, options) { var result = response.responseText; if (result) { var goodsInfo = Ext.util.JSON.decode(result); - if(goodsInfo.success != true){ + if (goodsInfo.success != true) { showResult(goodsInfo.message); return; } @@ -663,171 +663,171 @@ return; } - if(sstsConfig.mustViewPackingPhotoBeforeForeignTousseSignAndUse && isValid){ + if (sstsConfig.mustViewPackingPhotoBeforeForeignTousseSignAndUse && isValid) { loadTousseDefintionByBarcod(barcode); return } - if(goodsInfo.tousseType == "外来器械包" || goodsInfo.tousseType == '外来器械拆分小包'){ + if (goodsInfo.tousseType == "外来器械包" || goodsInfo.tousseType == '外来器械拆分小包') { var arr = [{ - newHospitalNumber:goodsInfo.hospitalNumber || '', - newClinicNumber:goodsInfo.clinicNumber || '', - newPatient:goodsInfo.patient || '', - showTousseName:goodsInfo.showTousseName + newHospitalNumber: goodsInfo.hospitalNumber || '', + newClinicNumber: goodsInfo.clinicNumber || '', + newPatient: goodsInfo.patient || '', + showTousseName: goodsInfo.showTousseName }] validPatientInfo(arr); } - if(goodsInfo.tousseType != '一次性物品' && goodsInfo.tousseType != '高值耗材'){ + if (goodsInfo.tousseType != '一次性物品' && goodsInfo.tousseType != '高值耗材') { var validTime = goodsInfo.validUntil; var currentTime = Ext.util.Format.date(new Date(), - 'Y-m-d'); - + 'Y-m-d'); + // 未签收的器械包不能登记使用记录 //江门市中心医院JMSZXYY-88,废弃notSignedItemsCanRegistUseRecord这个配置项 /* if(goodsInfo.status == hadShipped && sstsConfig.notSignedItemsCanRegistUseRecord == false){ showResult('该器械包未签收,不能被使用!'); return; } */ - + //if ((goodsInfo.status == hadShipped && sstsConfig.notSignedItemsCanRegistUseRecord != false)|| goodsInfo.status == hadSigned) { - if ((goodsInfo.status == hadShipped && goodsInfo.registUseRecordAfterSigned == '否')|| goodsInfo.status == hadSigned) { + if ((goodsInfo.status == hadShipped && goodsInfo.registUseRecordAfterSigned == '否') || goodsInfo.status == hadSigned) { if (validTime && !compareDate(currentTime, validTime)) { showResult('该器械包已过期!'); } else { - if(goodsInfo.idCardMsg && goodsInfo.idCardMsg != ""){//SSTS-139 使用记录增加标识牌使用次数提示 + if (goodsInfo.idCardMsg && goodsInfo.idCardMsg != "") {//SSTS-139 使用记录增加标识牌使用次数提示 showResult(goodsInfo.idCardMsg); } - - function addTousse(){ + + function addTousse() { var record = new addTousseInstance({ - id : goodsInfo.id, - barcode : goodsInfo.barcode, - amount : 1, - batchNo : '', - tousseDefinitionName : goodsInfo.tousseDefinitionName, - showTousseName : goodsInfo.showTousseName, - idCardUseAmount : goodsInfo.idCardUseAmount, - packageType : goodsInfo.packageType, - validUntil : validTime, - tousseType : goodsInfo.tousseType, - foreignTousseApp_id : goodsInfo.foreignTousseApp_id, - includeImplant : goodsInfo.includeImplant, - actualUsed : goodsInfo.actualUsed, - isRecycling : goodsInfo.isRecycling, - isConvertApplyGoods : goodsInfo.isConvertApplyGoods, - haveUnSupplementMaterials : goodsInfo.haveUnSupplementMaterials, - recyclingStatus : goodsInfo.recyclingStatus, - urgentLevel:goodsInfo.urgentLevel, - hospitalNumber:goodsInfo.hospitalNumber, - clinicNumber:goodsInfo.clinicNumber, - patient:goodsInfo.patient + id: goodsInfo.id, + barcode: goodsInfo.barcode, + amount: 1, + batchNo: '', + tousseDefinitionName: goodsInfo.tousseDefinitionName, + showTousseName: goodsInfo.showTousseName, + idCardUseAmount: goodsInfo.idCardUseAmount, + packageType: goodsInfo.packageType, + validUntil: validTime, + tousseType: goodsInfo.tousseType, + foreignTousseApp_id: goodsInfo.foreignTousseApp_id, + includeImplant: goodsInfo.includeImplant, + actualUsed: goodsInfo.actualUsed, + isRecycling: goodsInfo.isRecycling, + isConvertApplyGoods: goodsInfo.isConvertApplyGoods, + haveUnSupplementMaterials: goodsInfo.haveUnSupplementMaterials, + recyclingStatus: goodsInfo.recyclingStatus, + urgentLevel: goodsInfo.urgentLevel, + hospitalNumber: goodsInfo.hospitalNumber, + clinicNumber: goodsInfo.clinicNumber, + patient: goodsInfo.patient }); - useItemsStore.insert(0 , record); + useItemsStore.insert(0, record); useAmount++; top.Ext.getCmp('useAmount').setValue(useAmount); var msg = goodsInfo.showTousseName; - newAddAudioTips("useRecordAudio",msg,""); - + newAddAudioTips("useRecordAudio", msg, ""); + } - if(sstsConfig.olderTousseComfirmForUserecord && goodsInfo.older){ - if(confirm(goodsInfo.older.tousseName+"[条码:"+goodsInfo.older.barcode+"]更接近失效期,是否继续?")){ + if (sstsConfig.olderTousseComfirmForUserecord && goodsInfo.older) { + if (confirm(goodsInfo.older.tousseName + "[条码:" + goodsInfo.older.barcode + "]更接近失效期,是否继续?")) { addTousse(); } - }else{ + } else { addTousse(); //如果有返回聚合包内的子包数据时,追加到该聚合包之后 - if(goodsInfo.dataSubTousseArray && goodsInfo.dataSubTousseArray.length > 0){ - for(var i = 0;i < goodsInfo.dataSubTousseArray.length;i++){ + if (goodsInfo.dataSubTousseArray && goodsInfo.dataSubTousseArray.length > 0) { + for (var i = 0; i < goodsInfo.dataSubTousseArray.length; i++) { var subTousse = goodsInfo.dataSubTousseArray[i]; var record = new addTousseInstance({ - subTousseDefinitionId : subTousse.subTousseDefinitionId, - amount : subTousse.amount, - tousseDefinitionName : subTousse.showTousseName, - showTousseName : subTousse.showTousseName, - comboTousseInstanceId : subTousse.comboTousseInstanceId, - urgentLevel:subTousse.urgentLevel + subTousseDefinitionId: subTousse.subTousseDefinitionId, + amount: subTousse.amount, + tousseDefinitionName: subTousse.showTousseName, + showTousseName: subTousse.showTousseName, + comboTousseInstanceId: subTousse.comboTousseInstanceId, + urgentLevel: subTousse.urgentLevel }); - useItemsStore.insert(i+1 , record); + useItemsStore.insert(i + 1, record); } } } } } else { //if (sstsConfig.notSignedItemsCanRegistUseRecord == false){ - if (goodsInfo.registUseRecordAfterSigned == '是'){ + if (goodsInfo.registUseRecordAfterSigned == '是') { showResult('器械包状态为【' + goodsInfo.status + '】,只能登记已签收并且未被使用的器械包!'); } - else{ + else { showResult('器械包状态为【' + goodsInfo.status + '】,只能登记已发货并且未被使用的器械包!'); } } - }else if(goodsInfo.tousseType == '高值耗材'){ + } else if (goodsInfo.tousseType == '高值耗材') { //高值耗材(非一次性物品的高值耗材) var record = new addTousseInstance({ - id : goodsInfo.id, - barcode : goodsInfo.barcode, - tousseDefinitionName : '', - amount : 1, - batchNo : goodsInfo.batchNo, - showTousseName : goodsInfo.showTousseName, - idCardUseAmount : goodsInfo.idCardUseAmount, - packageType : '', - validUntil : goodsInfo.validUntil, - tousseType : goodsInfo.tousseType, - goodsType : goodsInfo.goodsType, - foreignTousseApp_id : '', - includeImplant : '否', - actualUsed:'是', - urgentLevel:goodsInfo.urgentLevel, - haveUnSupplementMaterials : false, - hospitalNumber:goodsInfo.hospitalNumber, - clinicNumber:goodsInfo.clinicNumber, - patient:goodsInfo.patient + id: goodsInfo.id, + barcode: goodsInfo.barcode, + tousseDefinitionName: '', + amount: 1, + batchNo: goodsInfo.batchNo, + showTousseName: goodsInfo.showTousseName, + idCardUseAmount: goodsInfo.idCardUseAmount, + packageType: '', + validUntil: goodsInfo.validUntil, + tousseType: goodsInfo.tousseType, + goodsType: goodsInfo.goodsType, + foreignTousseApp_id: '', + includeImplant: '否', + actualUsed: '是', + urgentLevel: goodsInfo.urgentLevel, + haveUnSupplementMaterials: false, + hospitalNumber: goodsInfo.hospitalNumber, + clinicNumber: goodsInfo.clinicNumber, + patient: goodsInfo.patient }); useItemsStore.add(record); useAmount++; top.Ext.getCmp('useAmount').setValue(useAmount); var msg = goodsInfo.showTousseName; - newAddAudioTips("useRecordAudio",msg,""); - }else if(goodsInfo.tousseType == '一次性物品'){ + newAddAudioTips("useRecordAudio", msg, ""); + } else if (goodsInfo.tousseType == '一次性物品') { //一次性物品 var record = new addTousseInstance({ - id : '', - barcode : goodsInfo.barcode, - tousseDefinitionName : '', - amount : 1, - batchNo : goodsInfo.batchNo, - showTousseName : goodsInfo.showTousseName, - idCardUseAmount : goodsInfo.idCardUseAmount, - packageType : '', - validUntil : goodsInfo.validUntil, - tousseType : goodsInfo.tousseType, - goodsType : goodsInfo.goodsType, - foreignTousseApp_id : '', - includeImplant : '否', - actualUsed:'是', - urgentLevel:goodsInfo.urgentLevel, - haveUnSupplementMaterials : false, - hospitalNumber:goodsInfo.hospitalNumber, - clinicNumber:goodsInfo.clinicNumber, - patient:goodsInfo.patient + id: '', + barcode: goodsInfo.barcode, + tousseDefinitionName: '', + amount: 1, + batchNo: goodsInfo.batchNo, + showTousseName: goodsInfo.showTousseName, + idCardUseAmount: goodsInfo.idCardUseAmount, + packageType: '', + validUntil: goodsInfo.validUntil, + tousseType: goodsInfo.tousseType, + goodsType: goodsInfo.goodsType, + foreignTousseApp_id: '', + includeImplant: '否', + actualUsed: '是', + urgentLevel: goodsInfo.urgentLevel, + haveUnSupplementMaterials: false, + hospitalNumber: goodsInfo.hospitalNumber, + clinicNumber: goodsInfo.clinicNumber, + patient: goodsInfo.patient }); useItemsStore.add(record); useAmount++; top.Ext.getCmp('useAmount').setValue(useAmount); var ttsName = goodsInfo.ttsName || ''; - var msg = (ttsName == '')?goodsInfo.showTousseName:ttsName; - newAddAudioTips("useRecordAudio",msg,""); + var msg = (ttsName == '') ? goodsInfo.showTousseName : ttsName; + newAddAudioTips("useRecordAudio", msg, ""); } } else { - if(sstsConfig.enableExpensiveGoods){ + if (sstsConfig.enableExpensiveGoods) { showResult('找不到该条码的器械包或一次性物品或高值耗材!'); - }else{ + } else { showResult('找不到该条码的器械包或一次性物品!'); } } }, - failure : function(response, options) { + failure: function (response, options) { showResult('加载出错!请稍候再试。'); } }); @@ -838,27 +838,27 @@ function loadPatientInfoByValAndType(jsonStr) { if (jsonStr != '') { DataSynchronizationTableManager.getPatientInfoByNumberAndType(jsonStr, { - callback:function(responseText){ + callback: function (responseText) { var result = JSON.parse(responseText); iskeypress = false; - if (result.success){ + if (result.success) { var patientInfo = result.patientInfo; - if(patientInfo){ + if (patientInfo) { showPatientInfo(patientInfo); - }else{ + } else { showResult('找不到该号码所对应的病人信息!'); validPatientInfo(); } } - else{ + else { showResult(result.msg); } - }, - timeout:45000, - errorHandler:function(msg){ - showResult('网络加载异常,请稍候重试!
 异常信息:' + msg); - } + }, + timeout: 45000, + errorHandler: function (msg) { + showResult('网络加载异常,请稍候重试!
 异常信息:' + msg); + } }); } } @@ -887,54 +887,54 @@ * operationTime:"" * } */ -function showPatientInfo(patientInfo){ - if(patientInfo){ - if(patientInfo.clinicNumber){ +function showPatientInfo(patientInfo) { + if (patientInfo) { + if (patientInfo.clinicNumber) { top.Ext.getCmp('treatmentNum').setValue(patientInfo.clinicNumber); } - if(patientInfo.hospitalNumber){ + if (patientInfo.hospitalNumber) { top.Ext.getCmp('hospitalNum').setValue(patientInfo.hospitalNumber); } - if(patientInfo.patientName){ + if (patientInfo.patientName) { top.Ext.getCmp('patientName').setValue(patientInfo.patientName); speaker.speak("病人:" + patientInfo.patientName); } - if(patientInfo.patientAge){ + if (patientInfo.patientAge) { top.Ext.getCmp('patientAge').setValue(patientInfo.patientAge); } - if(patientInfo.patientIDCard){ + if (patientInfo.patientIDCard) { top.Ext.getCmp('patientIDCard').setValue(patientInfo.patientIDCard); } - if(patientInfo.patientSex){ - if(patientInfo.patientSex == '男'){ + if (patientInfo.patientSex) { + if (patientInfo.patientSex == '男') { top.Ext.getCmp('patientSex').setValue('男'); - }else if(patientInfo.patientSex == '女'){ + } else if (patientInfo.patientSex == '女') { top.Ext.getCmp('patientSex').setValue('女'); - }else{ + } else { top.Ext.getCmp('patientSex').setValue(''); } } - if(patientInfo.bedNumber){ + if (patientInfo.bedNumber) { top.Ext.getCmp('bedNumber').setValue(patientInfo.bedNumber); } - if(patientInfo.doctorName){ + if (patientInfo.doctorName) { top.Ext.getCmp('doctorName').setValue(patientInfo.doctorName); } - if(patientInfo.anesthetist){ + if (patientInfo.anesthetist) { top.Ext.getCmp('anesthetist').setValue(patientInfo.anesthetist); } - if(patientInfo.anesthesiaMode){ + if (patientInfo.anesthesiaMode) { top.Ext.getCmp('anesthesiaMode').setValue(patientInfo.anesthesiaMode); } - if(patientInfo.operation){ + if (patientInfo.operation) { top.Ext.getCmp('operation').setValue(patientInfo.operation); } - if(patientInfo.patientArea){ + if (patientInfo.patientArea) { top.Ext.getCmp('patientArea').setValue(patientInfo.patientArea); } //病人所属科室 var ascriptionDepartment = patientInfo.ascriptionDepartment; - if(ascriptionDepartment){ + if (ascriptionDepartment) { top.Ext.getCmp('departNameOfpatient').setValue(''); //store的find方法不是精确匹配,模糊匹配会有问题,改用后面的each循环判断了 /*var ascriptionDepartmentIndex = departJsonStore.find("name",ascriptionDepartment,0,false,true); @@ -943,49 +943,49 @@ //设置病人所在科室的编码 top.Ext.getCmp('departCodeOfpatient').setValue(departJsonStore.getAt(ascriptionDepartmentIndex).get("id")); }*/ - departJsonStore.each(function(record){ + departJsonStore.each(function (record) { var nameOfDepartJsonStore = record.get("name"); - if(nameOfDepartJsonStore == ascriptionDepartment){ + if (nameOfDepartJsonStore == ascriptionDepartment) { top.Ext.getCmp('departNameOfpatient').setValue(ascriptionDepartment); //设置病人所在科室的编码 top.Ext.getCmp('departCodeOfpatient').setValue(record.get("id")); return false; } }); } - if(patientInfo.roomNumber){ + if (patientInfo.roomNumber) { top.Ext.getCmp('roomNumber').setValue(patientInfo.roomNumber); } - if(patientInfo.visitId){ + if (patientInfo.visitId) { top.Ext.getCmp('visitId').setValue(patientInfo.visitId); } - if(patientInfo.remark){ + if (patientInfo.remark) { top.Ext.getCmp('remark').setValue(patientInfo.remark); } - if(patientInfo.circuitNurse){ + if (patientInfo.circuitNurse) { top.Ext.getCmp('circuitNurse').setValue(patientInfo.circuitNurse); } - if(patientInfo.washHandNurse){ + if (patientInfo.washHandNurse) { top.Ext.getCmp('washHandNurse').setValue(patientInfo.washHandNurse); } - if(patientInfo.specialInfection){ + if (patientInfo.specialInfection) { top.Ext.getCmp('specialInfection').setValue(patientInfo.specialInfection); } - if(patientInfo.opRoomId){ + if (patientInfo.opRoomId) { top.Ext.getCmp('operationRoom').setValue(patientInfo.opRoomId); } - if(patientInfo.operationTime){ + if (patientInfo.operationTime) { var operationTime = patientInfo.operationTime; var hour = operationTime.split(':')[0]; var min = operationTime.split(':')[1]; - var resultTime = hour+':'+min; + var resultTime = hour + ':' + min; top.Ext.getCmp('operationTime').setValue(resultTime); } - if(patientInfo.operationScheduleId){ + if (patientInfo.operationScheduleId) { top.Ext.getCmp('operationScheduleId').setValue(patientInfo.operationScheduleId); } - if(sstsConfig.enableUseRecordFormExtensionFields && sstsConfig.enableUseRecordFormExtensionFields.contains('主刀医生核算科室')){ - if(patientInfo.doctorAccountDepartCode && patientInfo.doctorAccountDepart){ + if (sstsConfig.enableUseRecordFormExtensionFields && sstsConfig.enableUseRecordFormExtensionFields.contains('主刀医生核算科室')) { + if (patientInfo.doctorAccountDepartCode && patientInfo.doctorAccountDepart) { top.Ext.getCmp('doctorAccountDepartCode').setValue(patientInfo.doctorAccountDepartCode); top.Ext.getCmp('doctorAccountDepart').setRawValue(patientInfo.doctorAccountDepart); } @@ -997,10 +997,10 @@ // 获取扫描的物品所有条码 function getTousseGridData() { var tousseInstanceBarcodes = ""; - for ( var i = 0; i < useItemsStore.getCount(); i++) { + for (var i = 0; i < useItemsStore.getCount(); i++) { var barcode = useItemsStore.getAt(i).get('barcode'); //对于聚合包的子包的这种情况,则跳过,重新下一轮循环 - if(!barcode){ + if (!barcode) { continue; } if (tousseInstanceBarcodes == "") { @@ -1018,7 +1018,7 @@ var exist = false; if (currentBarcode == "") return exist; - for ( var i = 0; i < useItemsStore.getCount(); i++) { + for (var i = 0; i < useItemsStore.getCount(); i++) { var barcode = useItemsStore.getAt(i).get('barcode'); if (currentBarcode == barcode) { exist = true; @@ -1031,26 +1031,26 @@ // 检测器械包当前状态是否为已发货 function checkTousseInstanceIsHaveShipped(barcodes, id, callBack) { var pass = true; - Ext.Ajax.request( { - url : WWWROOT + '/disinfectSystem/tousseInstanceAction!checkTousseInstancesStatus.do', - params : { - tousseInstanceBarcodes : barcodes, - useRecordID : id + Ext.Ajax.request({ + url: WWWROOT + '/disinfectSystem/tousseInstanceAction!checkTousseInstancesStatus.do', + params: { + tousseInstanceBarcodes: barcodes, + useRecordID: id }, - success : function(response, options) { + success: function (response, options) { var result = Ext.decode(response.responseText); var success = result.success; if (false == success) { showResult('条码为:' + result.barcode + '的' + result.tousseType + '状态必须为' - + hadShipped + '。'); + + hadShipped + '。'); pass = false; } callBack(pass); }, - failure : function(response, options) { + failure: function (response, options) { showResult('检测条码状态出错!请稍候再试。'); pass = false; - callBack(pass); + callBack(pass); } }); } @@ -1063,7 +1063,7 @@ var count = tousseGridStore.getCount(); for (var i = 0; i < count; i++) { var record = tousseGridStore.getAt(i); - if(record.get('comboTousseInstanceId') == id || record.data.id == id){ + if (record.get('comboTousseInstanceId') == id || record.data.id == id) { needRemoveRecord.push(record); } } @@ -1073,8 +1073,8 @@ } function loadTousseImages(tousseName) { - if(tousseName.indexOf('_') != -1){ - tousseName = tousseName.substring(0,tousseName.lastIndexOf('_')); + if (tousseName.indexOf('_') != -1) { + tousseName = tousseName.substring(0, tousseName.lastIndexOf('_')); } showTousseImageWin(tousseName); } @@ -1093,192 +1093,192 @@ * @param includeReview 是否包含有审核 * @returns {success:Boolean,alreadyConfirmNotice:Boolean} */ -function checkForSave(btObj , includeReview){ +function checkForSave(btObj, includeReview) { //返回结果 var result = { - //是否通用验证,true表示通过 - success:false, - //是否已经确认过提示,如果为true,则后面调用的地方不需要再提示 - alreadyConfirmNotice:false + //是否通用验证,true表示通过 + success: false, + //是否已经确认过提示,如果为true,则后面调用的地方不需要再提示 + alreadyConfirmNotice: false }; //改成各元素单独验证的方式 /*if (!formObj.getForm().isValid()) { showResult('请正确填写表单各值'); return false; }*/ //如果不为科室使用记录时 - if(!fromDepartmentUseRecord){ - if(sstsConfig.notAllowBlankFieldsOnUseRecordPage && typeof sstsConfig.notAllowBlankFieldsOnUseRecordPage == 'object'){ - if(!hospitalNumAllowBlank && top.Ext.getCmp('hospitalNum').getValue() == ''){ + if (!fromDepartmentUseRecord) { + if (sstsConfig.notAllowBlankFieldsOnUseRecordPage && typeof sstsConfig.notAllowBlankFieldsOnUseRecordPage == 'object') { + if (!hospitalNumAllowBlank && top.Ext.getCmp('hospitalNum').getValue() == '') { btObj.enable(); top.Ext.getCmp('hospitalNum').focus(); showResult('住院号不能为空'); return result; } - if(!treatmentNumAllowBlank && top.Ext.getCmp('treatmentNum').getValue() == ''){ + if (!treatmentNumAllowBlank && top.Ext.getCmp('treatmentNum').getValue() == '') { btObj.enable(); top.Ext.getCmp('treatmentNum').focus(); showResult('诊疗号不能为空'); return result; } - if(!washHandNurseAllowBlank && top.Ext.getCmp('washHandNurse').getValue() == ''){ + if (!washHandNurseAllowBlank && top.Ext.getCmp('washHandNurse').getValue() == '') { btObj.enable(); top.Ext.getCmp('washHandNurse').focus(); showResult('洗手护士不能为空'); return result; } - if(!circuitNurseAllowBlank && top.Ext.getCmp('circuitNurse').getValue() == ''){ + if (!circuitNurseAllowBlank && top.Ext.getCmp('circuitNurse').getValue() == '') { btObj.enable(); top.Ext.getCmp('circuitNurse').focus(); - showResult(circuitNurseLabelName+'不能为空'); + showResult(circuitNurseLabelName + '不能为空'); return result; } - if(!operationRoomAllowBlank && top.Ext.getCmp('operationRoom').getValue() == ''){ + if (!operationRoomAllowBlank && top.Ext.getCmp('operationRoom').getValue() == '') { btObj.enable(); top.Ext.getCmp('operationRoom').focus(); showResult('手术间不能为空'); return result; } - if(!patientNameAllowBlank && top.Ext.getCmp('patientName').getValue() == ''){ + if (!patientNameAllowBlank && top.Ext.getCmp('patientName').getValue() == '') { btObj.enable(); top.Ext.getCmp('patientName').focus(); showResult('姓名不能为空'); return result; } - if(!patientAgeAllowBlank && top.Ext.getCmp('patientAge').getValue() == ''){ + if (!patientAgeAllowBlank && top.Ext.getCmp('patientAge').getValue() == '') { btObj.enable(); top.Ext.getCmp('patientAge').focus(); showResult('年龄不能为空'); return result; } - if(!patientSexAllowBlank && top.Ext.getCmp('patientSex').getValue() == ''){ + if (!patientSexAllowBlank && top.Ext.getCmp('patientSex').getValue() == '') { btObj.enable(); top.Ext.getCmp('patientSex').focus(); showResult('性别不能为空'); return result; } - if(!patientAreaAllowBlank && top.Ext.getCmp('patientArea').getValue() == ''){ + if (!patientAreaAllowBlank && top.Ext.getCmp('patientArea').getValue() == '') { btObj.enable(); top.Ext.getCmp('patientArea').focus(); showResult('病区不能为空'); return result; } - if(!departNameOfpatientAllowBlank && top.Ext.getCmp('departNameOfpatient').getValue() == ''){ + if (!departNameOfpatientAllowBlank && top.Ext.getCmp('departNameOfpatient').getValue() == '') { btObj.enable(); top.Ext.getCmp('departNameOfpatient').focus(); showResult('病人所在科室不能为空'); return result; } - if(!roomNumberAllowBlank && top.Ext.getCmp('roomNumber').getValue() == ''){ + if (!roomNumberAllowBlank && top.Ext.getCmp('roomNumber').getValue() == '') { btObj.enable(); top.Ext.getCmp('roomNumber').focus(); showResult('病室不能为空'); return result; } - if(!bedNumberAllowBlank && top.Ext.getCmp('bedNumber').getValue() == ''){ + if (!bedNumberAllowBlank && top.Ext.getCmp('bedNumber').getValue() == '') { btObj.enable(); top.Ext.getCmp('bedNumber').focus(); showResult('床位不能为空'); return result; } - if(!patientIDCardAllowBlank && top.Ext.getCmp('patientIDCard').getValue() == ''){ + if (!patientIDCardAllowBlank && top.Ext.getCmp('patientIDCard').getValue() == '') { btObj.enable(); top.Ext.getCmp('patientIDCard').focus(); showResult('身份证不能为空'); return result; } - if(!doctorNameAllowBlank && top.Ext.getCmp('doctorName').getValue() == ''){ + if (!doctorNameAllowBlank && top.Ext.getCmp('doctorName').getValue() == '') { btObj.enable(); top.Ext.getCmp('doctorName').focus(); showResult('手术医生不能为空'); return result; } - if(!surgeonAllowBlank && top.Ext.getCmp('surgeon').getValue() == ''){ + if (!surgeonAllowBlank && top.Ext.getCmp('surgeon').getValue() == '') { btObj.enable(); top.Ext.getCmp('surgeon').focus(); showResult('主刀医生不能为空'); return result; } - if(!anesthetistAllowBlank && top.Ext.getCmp('anesthetist').getValue() == ''){ + if (!anesthetistAllowBlank && top.Ext.getCmp('anesthetist').getValue() == '') { btObj.enable(); top.Ext.getCmp('anesthetist').focus(); showResult('麻醉医生不能为空'); return result; } - if(!anesthesiaModeAllowBlank && top.Ext.getCmp('anesthesiaMode').getValue() == ''){ + if (!anesthesiaModeAllowBlank && top.Ext.getCmp('anesthesiaMode').getValue() == '') { btObj.enable(); top.Ext.getCmp('anesthesiaMode').focus(); showResult('麻醉方式不能为空'); return result; } - if(!operationNameAllowBlank && top.Ext.getCmp('operation').getValue() == ''){ + if (!operationNameAllowBlank && top.Ext.getCmp('operation').getValue() == '') { btObj.enable(); top.Ext.getCmp('operation').focus(); showResult('手术名称不能为空'); return result; } - if(!operationScheduleIdAllowBlank && top.Ext.getCmp('operationScheduleId').getValue() == ''){ + if (!operationScheduleIdAllowBlank && top.Ext.getCmp('operationScheduleId').getValue() == '') { btObj.enable(); top.Ext.getCmp('operationScheduleId').focus(); showResult('手术单号不能为空'); return result; } - if(!operationTimeAllowBlank && top.Ext.getCmp('operationTime').getValue() == ''){ + if (!operationTimeAllowBlank && top.Ext.getCmp('operationTime').getValue() == '') { btObj.enable(); top.Ext.getCmp('operationTime').focus(); showResult('手术时间不能为空'); return result; } - if(!visitIdAllowBlank && top.Ext.getCmp('visitId').getValue() == ''){ + if (!visitIdAllowBlank && top.Ext.getCmp('visitId').getValue() == '') { btObj.enable(); top.Ext.getCmp('visitId').focus(); showResult('住院次数不能为空'); return result; } - if(!specialInfectionAllowBlank && top.Ext.getCmp('specialInfection').getValue() == ''){ + if (!specialInfectionAllowBlank && top.Ext.getCmp('specialInfection').getValue() == '') { btObj.enable(); top.Ext.getCmp('specialInfection').focus(); showResult('特殊感染类型不能为空'); return result; } - if(!doctorAccountDepartAllowBlank && top.Ext.getCmp('doctorAccountDepart').getValue() == ''){ + if (!doctorAccountDepartAllowBlank && top.Ext.getCmp('doctorAccountDepart').getValue() == '') { btObj.enable(); top.Ext.getCmp('doctorAccountDepart').focus(); showResult('主刀医生核算科室不能为空'); return result; } - if(!remarkAllowBlank && top.Ext.getCmp('remark').getValue() == ''){ + if (!remarkAllowBlank && top.Ext.getCmp('remark').getValue() == '') { btObj.enable(); top.Ext.getCmp('remark').focus(); showResult('备注不能为空'); return result; } - }else { - if(getBoolValueFromJs('sstsConfig.useRecordHospitalNumAllowBlank',true) == false && top.Ext.getCmp('hospitalNum').getValue() == '' && !sstsConfig.allowAllBlankExceptThreeSpecialFields){ + } else { + if (getBoolValueFromJs('sstsConfig.useRecordHospitalNumAllowBlank', true) == false && top.Ext.getCmp('hospitalNum').getValue() == '' && !sstsConfig.allowAllBlankExceptThreeSpecialFields) { btObj.enable(); top.Ext.getCmp('hospitalNum').focus(); showResult('住院号不能为空'); return result; } - if(getBoolValueFromJs('sstsConfig.useRecordWashHandNurseAllowBlank',false) == false && top.Ext.getCmp('washHandNurse').getValue() == '' && !sstsConfig.allowAllBlankExceptThreeSpecialFields){ + if (getBoolValueFromJs('sstsConfig.useRecordWashHandNurseAllowBlank', false) == false && top.Ext.getCmp('washHandNurse').getValue() == '' && !sstsConfig.allowAllBlankExceptThreeSpecialFields) { btObj.enable(); top.Ext.getCmp('washHandNurse').focus(); showResult('洗手护士不能为空'); return result; } - if(getBoolValueFromJs('sstsConfig.useRecordCircuitNurseAllowBlank',false) == false && top.Ext.getCmp('circuitNurse').getValue() == '' && !sstsConfig.allowAllBlankExceptThreeSpecialFields){ + if (getBoolValueFromJs('sstsConfig.useRecordCircuitNurseAllowBlank', false) == false && top.Ext.getCmp('circuitNurse').getValue() == '' && !sstsConfig.allowAllBlankExceptThreeSpecialFields) { btObj.enable(); top.Ext.getCmp('circuitNurse').focus(); showResult(circuitNurseLabelName + '不能为空'); return result; } - if(useRecordOperationRoomAllowBlank == false && top.Ext.getCmp('operationRoom').getValue() == '' && !sstsConfig.allowAllBlankExceptThreeSpecialFields){ + if (useRecordOperationRoomAllowBlank == false && top.Ext.getCmp('operationRoom').getValue() == '' && !sstsConfig.allowAllBlankExceptThreeSpecialFields) { btObj.enable(); top.Ext.getCmp('operationRoom').focus(); showResult('手术间不能为空'); return result; } - if(!sstsConfig.noInputTreatmentNumOrHospitalNum && top.Ext.getCmp('treatmentNum').getValue() == '' && top.Ext.getCmp('hospitalNum').getValue() == '' && top.Ext.getCmp('patientName').getValue() == '' && !sstsConfig.allowAllBlankExceptThreeSpecialFields){ + if (!sstsConfig.noInputTreatmentNumOrHospitalNum && top.Ext.getCmp('treatmentNum').getValue() == '' && top.Ext.getCmp('hospitalNum').getValue() == '' && top.Ext.getCmp('patientName').getValue() == '' && !sstsConfig.allowAllBlankExceptThreeSpecialFields) { btObj.enable(); showResult('请输入诊疗号或者住院号或者病人姓名'); return result; @@ -1291,50 +1291,50 @@ //定义聚合包的各子包使用数量{聚合包实例id:子包使用数量总和} var comboTousseUsedAmountJsonObject = {}; //如果有录入聚合包内子包,则判断有无录入使用数量 - for ( var i = 0; i < useItemsStore.getCount(); i++) { + for (var i = 0; i < useItemsStore.getCount(); i++) { var currentRecord = useItemsStore.getAt(i); //如果是聚合包 - if(currentRecord.get('tousseType') == '聚合包'){ + if (currentRecord.get('tousseType') == '聚合包') { var tousseInstanceId = currentRecord.get('id'); - if(!comboTousseUsedAmountJsonObject.hasOwnProperty(tousseInstanceId)){ + if (!comboTousseUsedAmountJsonObject.hasOwnProperty(tousseInstanceId)) { comboTousseUsedAmountJsonObject[tousseInstanceId] = null; } } var comboTousseInstanceId = currentRecord.get('comboTousseInstanceId'); //对于聚合包的子包的这种情况,则跳过,重新下一轮循环 - if(comboTousseInstanceId){ - if(!currentRecord.get('usedAmount') && currentRecord.get('usedAmount') !== 0){ + if (comboTousseInstanceId) { + if (!currentRecord.get('usedAmount') && currentRecord.get('usedAmount') !== 0) { btObj.enable(); - showResult('请输入'+ currentRecord.get('tousseDefinitionName') +'的使用数量'); + showResult('请输入' + currentRecord.get('tousseDefinitionName') + '的使用数量'); return result; } - if(currentRecord.get('usedAmount') > 0){ - if(comboTousseUsedAmountJsonObject.hasOwnProperty(comboTousseInstanceId) && !comboTousseUsedAmountJsonObject[comboTousseInstanceId]){ + if (currentRecord.get('usedAmount') > 0) { + if (comboTousseUsedAmountJsonObject.hasOwnProperty(comboTousseInstanceId) && !comboTousseUsedAmountJsonObject[comboTousseInstanceId]) { comboTousseUsedAmountJsonObject[comboTousseInstanceId] = currentRecord.get('usedAmount'); } } } } //如果启用了聚合包内子包数量修改功能,则进行验证的提示,否则不提示 - if(sstsConfig.comboTousseRegistUseRecordCanModifySubTousseAmount){ - for(var prop in comboTousseUsedAmountJsonObject){ - if(!comboTousseUsedAmountJsonObject[prop]){ + if (sstsConfig.comboTousseRegistUseRecordCanModifySubTousseAmount) { + for (var prop in comboTousseUsedAmountJsonObject) { + if (!comboTousseUsedAmountJsonObject[prop]) { btObj.enable(); showResult('聚合包的子包至少需要有一个子包使用数量大于0'); return result; } } } result.success = true; - }else{ - if(!fromDepartmentUseRecord){ - if(!validateUseRecordItemsWhenReviewing(btObj,includeReview)){ + } else { + if (!fromDepartmentUseRecord) { + if (!validateUseRecordItemsWhenReviewing(btObj, includeReview)) { return result; } btObj.disable(); var confirmResult = window.confirm("该使用记录没有登记使用的物品,要继续吗?"); btObj.enable(); - if(confirmResult){ + if (confirmResult) { result.success = true; result.alreadyConfirmNotice = true; } @@ -1346,7 +1346,7 @@ btObj.enable(); return false; });*/ - }else{ + } else { showResult('器械包列表信息不能为空'); btObj.enable(); return result; @@ -1358,11 +1358,11 @@ /** * 判断如果使用物品明细为空,且有包含审核(如审核、保存并审核、审核并转换申请单、保存审核并转换申请单等操作时,不一一列举)的操作,则进行提示 */ -function validateUseRecordItemsWhenReviewing(btObj , includeReview){ +function validateUseRecordItemsWhenReviewing(btObj, includeReview) { btObj.disable(); // 获取扫描的物品所有条码 var barcodes = getTousseGridData(); - if(!barcodes && includeReview){ + if (!barcodes && includeReview) { showResult("该使用记录没有登记使用的物品,不能进行审核和申请"); btObj.enable(); return false; @@ -1374,7 +1374,7 @@ /** * 关闭表单数据录入窗口,刷新grid列表 */ -function closeWinAndRefreshGrid(win){ +function closeWinAndRefreshGrid(win) { win.close(); grid.dwrReload(); } @@ -1389,30 +1389,30 @@ * @param callback 回调函数,此处的回调函数审核与审核并转换申请单的函数 * @returns {Boolean} */ -function submitUseRecordForm(btObj, win, id, createNew , includeReview , callback) { +function submitUseRecordForm(btObj, win, id, createNew, includeReview, callback) { btObj.disable(); - var result = checkForSave(btObj,includeReview); + var result = checkForSave(btObj, includeReview); if (result.success) { var barcodes = getTousseGridData(); // 保存时,检测当前所有器械包的状态是否为已发货 - checkTousseInstanceIsHaveShipped(barcodes,id,function callBack(pass){ + checkTousseInstanceIsHaveShipped(barcodes, id, function callBack(pass) { if (!pass) { btObj.enable(); return false; } - + btObj.disable(); //如果有回调函数 - if(callback){ - submitFormForSave(btObj, win, id, createNew , callback); - }else{ - if(result.alreadyConfirmNotice){ + if (callback) { + submitFormForSave(btObj, win, id, createNew, callback); + } else { + if (result.alreadyConfirmNotice) { submitFormForSaveAfterConfirm(btObj, win, id, createNew); - }else{ - top.Ext.MessageBox.confirm("请确认","是否提交"+entityName+"信息?",function(btn) { - if(btn=='yes') { + } else { + top.Ext.MessageBox.confirm("请确认", "是否提交" + entityName + "信息?", function (btn) { + if (btn == 'yes') { submitFormForSaveAfterConfirm(btObj, win, id, createNew); - }else{ + } else { btObj.enable(); return false; } @@ -1431,7 +1431,7 @@ * @param id 使用记录id,用于区分是新增还是修改 * @param createNew 是否新创建 */ -function submitFormForSaveAfterConfirm(btObj, win, id, createNew){ +function submitFormForSaveAfterConfirm(btObj, win, id, createNew) { if (sstsConfig.saveUseRecordPrompt && !id) { if (sstsConfig.useRecordAuditMode == 3) { alert('请点击"保存并审核生成申请单"按钮,否则无法发送供应室'); @@ -1452,66 +1452,66 @@ * @param createNew 是否新建,true表示新建 * @param callback 回调函数,此处的回调函数审核与审核并转换申请单的函数 */ -function submitFormForSave(btObj, win, id, createNew , callback){ +function submitFormForSave(btObj, win, id, createNew, callback) { top.Ext.getCmp('depart').enable(); - setFormParams(formObj.form, [ 'id', 'washHandNurse','circuitNurse', 'operationRoom','treatmentNum', - 'hospitalNum', 'patientName','patientAge', 'patientSex', 'roomNumber', - 'bedNumber', 'patientIDCard', 'doctorName', 'surgeon','operationName','specialInfection','operationTime','operationScheduleId', 'remark','departCodeOfpatient' ]); + setFormParams(formObj.form, ['id', 'washHandNurse', 'circuitNurse', 'operationRoom', 'treatmentNum', + 'hospitalNum', 'patientName', 'patientAge', 'patientSex', 'roomNumber', + 'bedNumber', 'patientIDCard', 'doctorName', 'surgeon', 'operationName', 'specialInfection', 'operationTime', 'operationScheduleId', 'remark', 'departCodeOfpatient']); // 设置表单上的item参数(因为struts2版本会对前台传过来日期的时分秒部分截掉,所以手术时间需要单独传) - if(top.Ext.getCmp('departNameOfpatient').getRawValue() == ''){ + if (top.Ext.getCmp('departNameOfpatient').getRawValue() == '') { top.Ext.getCmp('departCodeOfpatient').setValue(""); } var tousseInstanceMaterialErrorDamageItems = top.Ext.getCmp('tousseInstanceMaterialErrorDamageItems').getValue(); - if(tousseInstanceMaterialErrorDamageItems !== ''){ + if (tousseInstanceMaterialErrorDamageItems !== '') { tousseInstanceMaterialErrorDamageItems = JSON.parse(tousseInstanceMaterialErrorDamageItems); - for(var i=0;i 0){ + if (result.data && result.data.length > 0) { urgentLevelData.lowestGradeUrgentLevel = result.data[0]; - for(var i = 0;i < result.data.length;i++){ + for (var i = 0; i < result.data.length; i++) { var urgentLevelDataItem = result.data[i]; - if(!urgentLevelData.defaultUrgentLevel && urgentLevelDataItem.urgentDefaultValue == '是'){ + if (!urgentLevelData.defaultUrgentLevel && urgentLevelDataItem.urgentDefaultValue == '是') { urgentLevelData.defaultUrgentLevel = urgentLevelDataItem; } urgentLevelDataMap[urgentLevelDataItem.id] = urgentLevelDataItem; } } - addAndEditUseRecordAfterUrgentLevelDataLoaded(id, status,recyclingStatus); - }else{ - if(!result.message){ + addAndEditUseRecordAfterUrgentLevelDataLoaded(id, status, recyclingStatus); + } else { + if (!result.message) { showResult("加载加急级别失败."); } } }, - failure : function(response, options) { + failure: function (response, options) { showResult("加载加急级别失败."); } }); - }else{ - addAndEditUseRecordAfterUrgentLevelDataLoaded(id, status,recyclingStatus); + } else { + addAndEditUseRecordAfterUrgentLevelDataLoaded(id, status, recyclingStatus); } } @@ -1809,1488 +1809,1500 @@ * 审核状态 * @return */ -function addAndEditUseRecordAfterUrgentLevelDataLoaded(id, status,recyclingStatus) { +function addAndEditUseRecordAfterUrgentLevelDataLoaded(id, status, recyclingStatus) { currentUseRecordId = id; - useRecordOperationRoomAllowBlank = getBoolValueFromJs('sstsConfig.useRecordOperationRoomAllowBlank',true); + useRecordOperationRoomAllowBlank = getBoolValueFromJs('sstsConfig.useRecordOperationRoomAllowBlank', true); useItemsStore.removeAll(); useAmount = 0; var tbar; var saveBtn = { - text : '保存', - hidden : id ? (fromDepartmentUseRecord ? SSTS_DepartmentUseRecord_Update : SSTS_UseRecord_Update) : (fromDepartmentUseRecord ? SSTS_DepartmentUseRecord_Create : SSTS_UseRecord_Create), - handler : function() { - top.Ext.getCmp("audited").setValue(""); - submitUseRecordForm(this, useRecordWin, id, false, false); - } - }; + text: '保存', + hidden: id ? (fromDepartmentUseRecord ? SSTS_DepartmentUseRecord_Update : SSTS_UseRecord_Update) : (fromDepartmentUseRecord ? SSTS_DepartmentUseRecord_Create : SSTS_UseRecord_Create), + handler: function () { + top.Ext.getCmp("audited").setValue(""); + submitUseRecordForm(this, useRecordWin, id, false, false); + } + }; var saveAndNewBtn = { - text : '保存并新建', - hidden : id ? (fromDepartmentUseRecord ? SSTS_DepartmentUseRecord_Update : SSTS_UseRecord_Update) : (fromDepartmentUseRecord ? SSTS_DepartmentUseRecord_Create : SSTS_UseRecord_Create), - handler : function() { - top.Ext.getCmp("audited").setValue(""); - submitUseRecordForm(this, useRecordWin, id, true, false); - } - }; + text: '保存并新建', + hidden: id ? (fromDepartmentUseRecord ? SSTS_DepartmentUseRecord_Update : SSTS_UseRecord_Update) : (fromDepartmentUseRecord ? SSTS_DepartmentUseRecord_Create : SSTS_UseRecord_Create), + handler: function () { + top.Ext.getCmp("audited").setValue(""); + submitUseRecordForm(this, useRecordWin, id, true, false); + } + }; var reviewBtn = { - text : '审核', - hidden : fromDepartmentUseRecord ? (SSTS_DepartmentUseRecord_Review || sstsConfig.useRecordAuditMode != 1) : (SSTS_UseRecord_Review || sstsConfig.useRecordAuditMode != 1), - handler : function() { - top.Ext.getCmp("audited").setValue("true");// action里则会根据audited的值判断用户是点击申述还是保存按钮,true为审核 - submitUseRecordForm(this, useRecordWin, id, false , true, reviewUseRecordForm); - } - }; + text: '审核', + hidden: fromDepartmentUseRecord ? (SSTS_DepartmentUseRecord_Review || sstsConfig.useRecordAuditMode != 1) : (SSTS_UseRecord_Review || sstsConfig.useRecordAuditMode != 1), + handler: function () { + top.Ext.getCmp("audited").setValue("true");// action里则会根据audited的值判断用户是点击申述还是保存按钮,true为审核 + submitUseRecordForm(this, useRecordWin, id, false, true, reviewUseRecordForm); + } + }; var createApplicationBtn = { - text : '生成申请单', - hidden : fromDepartmentUseRecord ? (SSTS_DepartmentUseRecord_Convert || sstsConfig.useRecordAuditMode != 1) : (SSTS_UseRecord_Convert || sstsConfig.useRecordAuditMode != 1), - handler : function() { - if((recyclingStatus == "已回收" || recyclingStatus == "部分回收") && sstsConfig.monitorGoodsRecyclingStatusForUseRecord){ - showResult('不能生成申请单,请确认该条记录为未回收状态或空'); - return; - } - if(!validateUseRecordItemsWhenReviewing(this,true)){ - return; - } - var operatorStr = top.Ext.getCmp('operator').getValue(); - var departStr = top.Ext.getCmp('depart').getValue(); - var departCodingStr = top.Ext.getCmp('departCoding').getValue(); - var btn = this; - var confirmMessage = "确定要将本使用记录生成申请单吗?"; - if(sstsConfig.auditAndConvertUseRecordConfirmMessage){ - confirmMessage = "手术是否已完成,不需要追加器械包?"; - } - top.Ext.MessageBox.confirm("请确认",confirmMessage, - function(button, text) { - if ("yes" == button) { - convertUseRecordToApplication(btn, id, operatorStr, departStr, departCodingStr, useRecordWin); - } - }); - + text: '生成申请单', + hidden: fromDepartmentUseRecord ? (SSTS_DepartmentUseRecord_Convert || sstsConfig.useRecordAuditMode != 1) : (SSTS_UseRecord_Convert || sstsConfig.useRecordAuditMode != 1), + handler: function () { + if ((recyclingStatus == "已回收" || recyclingStatus == "部分回收") && sstsConfig.monitorGoodsRecyclingStatusForUseRecord) { + showResult('不能生成申请单,请确认该条记录为未回收状态或空'); + return; } + if (!validateUseRecordItemsWhenReviewing(this, true)) { + return; + } + var operatorStr = top.Ext.getCmp('operator').getValue(); + var departStr = top.Ext.getCmp('depart').getValue(); + var departCodingStr = top.Ext.getCmp('departCoding').getValue(); + var btn = this; + var confirmMessage = "确定要将本使用记录生成申请单吗?"; + if (sstsConfig.auditAndConvertUseRecordConfirmMessage) { + confirmMessage = "手术是否已完成,不需要追加器械包?"; + } + top.Ext.MessageBox.confirm("请确认", confirmMessage, + function (button, text) { + if ("yes" == button) { + convertUseRecordToApplication(btn, id, operatorStr, departStr, departCodingStr, useRecordWin); + } + }); + + } } - var reviewAndConvertBtn = { - text : '审核并生成申请单', - hidden : fromDepartmentUseRecord ? (SSTS_DepartmentUseRecord_Convert || sstsConfig.useRecordAuditMode != 2) : (SSTS_UseRecord_Convert || sstsConfig.useRecordAuditMode != 2), - handler : function() { - top.Ext.getCmp("audited").setValue("true");// action里则会根据audited的值判断用户是点击审核还是保存按钮,true为审核 - submitUseRecordForm(this, useRecordWin, id, false ,true , reviewAndConvertUseRecordForm); - } - }; - var saveAndReviewAndConvertBtn = { - text : '保存并审核生成申请单', - hidden : fromDepartmentUseRecord ? (SSTS_DepartmentUseRecord_Convert || sstsConfig.useRecordAuditMode != 3) : (SSTS_UseRecord_Convert || sstsConfig.useRecordAuditMode != 3), - handler : function() { - if(!validateUseRecordItemsWhenReviewing(this,true)){ - return; - } - top.Ext.getCmp("audited").setValue("true");// action里则会根据audited的值判断用户是点击审核还是保存按钮,true为审核 - saveAndReviewAndConvertUseRecordForm(this,useRecordWin,false); - } - }; + var reviewAndConvertBtn = { + text: '审核并生成申请单', + hidden: fromDepartmentUseRecord ? (SSTS_DepartmentUseRecord_Convert || sstsConfig.useRecordAuditMode != 2) : (SSTS_UseRecord_Convert || sstsConfig.useRecordAuditMode != 2), + handler: function () { + top.Ext.getCmp("audited").setValue("true");// action里则会根据audited的值判断用户是点击审核还是保存按钮,true为审核 + submitUseRecordForm(this, useRecordWin, id, false, true, reviewAndConvertUseRecordForm); + } + }; + var saveAndReviewAndConvertBtn = { + text: '保存并审核生成申请单', + hidden: fromDepartmentUseRecord ? (SSTS_DepartmentUseRecord_Convert || sstsConfig.useRecordAuditMode != 3) : (SSTS_UseRecord_Convert || sstsConfig.useRecordAuditMode != 3), + handler: function () { + if (!validateUseRecordItemsWhenReviewing(this, true)) { + return; + } + top.Ext.getCmp("audited").setValue("true");// action里则会根据audited的值判断用户是点击审核还是保存按钮,true为审核 + saveAndReviewAndConvertUseRecordForm(this, useRecordWin, false); + } + }; var saveAndReviewAndConvertAndNewBtn = { - text : '保存并审核生成申请单并新建', - hidden : fromDepartmentUseRecord ? (SSTS_DepartmentUseRecord_Convert || sstsConfig.useRecordAuditMode != 3) : (SSTS_UseRecord_Convert || sstsConfig.useRecordAuditMode != 3), - handler : function() { - if(!validateUseRecordItemsWhenReviewing(this,true)){ - return; - } - top.Ext.getCmp("audited").setValue("true");// action里则会根据audited的值判断用户是点击审核还是保存按钮,true为审核 - saveAndReviewAndConvertUseRecordForm(this,useRecordWin,true); - } + text: '保存并审核生成申请单并新建', + hidden: fromDepartmentUseRecord ? (SSTS_DepartmentUseRecord_Convert || sstsConfig.useRecordAuditMode != 3) : (SSTS_UseRecord_Convert || sstsConfig.useRecordAuditMode != 3), + handler: function () { + if (!validateUseRecordItemsWhenReviewing(this, true)) { + return; + } + top.Ext.getCmp("audited").setValue("true");// action里则会根据audited的值判断用户是点击审核还是保存按钮,true为审核 + saveAndReviewAndConvertUseRecordForm(this, useRecordWin, true); + } } var fastRecyclingBtn = { - text : '快速回收', - id:'quickRecycingID', - hidden : sstsConfig.disableUseRecordQuickRecycling, - handler : function() { - var records = top.Ext.getCmp('tousseInstanceGrid').getSelectionModel().getSelections(); - if(records.length == 0){ - showResult('请选择要快速回收的器械包。'); - return false; + text: '快速回收', + id: 'quickRecycingID', + hidden: sstsConfig.disableUseRecordQuickRecycling, + handler: function () { + var records = top.Ext.getCmp('tousseInstanceGrid').getSelectionModel().getSelections(); + if (records.length == 0) { + showResult('请选择要快速回收的器械包。'); + return false; + } + var barcodes = ""; + for (var i = 0; i < records.length; i++) { + var currentRecord = records[i]; + if (currentRecord.data.tousseType == '聚合包') { + alert(currentRecord.data.showTousseName + "是聚合包,不能进行快速回收"); + return; } - var barcodes = ""; - for(var i=0;i
住院号" + objData[i].hospitalNum + "病人" + objData[i].patientName + "巡回护士" + objData[i].circuitNurse + "
手术间" + objData[i].operationRoom + "洗手护士" + objData[i].washHandNurse + "
" + tousseInstanceList[j].tousseName + "" + tousseInstanceList[j].amount + "
合计" + sum + "
"; - for ( var i = 0; i < result.data.length; i++) { - var amount = parseInt(result.data[i].errorDamageAmount)+parseInt(result.data[i].unconfirmedAmount); + for (var i = 0; i < result.data.length; i++) { + var amount = parseInt(result.data[i].errorDamageAmount) + parseInt(result.data[i].unconfirmedAmount); tableContent += ""; + + result.data[i].name + + ""; } tableContent += "

材料名称

数量

 " - + result.data[i].name - + "" - + amount - + "
" + + amount + + "

"; - if(type == 'error'){ - record.set("htmlContentErrorArray",tableContent); - }else { - record.set("htmlContentDamageArray",tableContent); + if (type == 'error') { + record.set("htmlContentErrorArray", tableContent); + } else { + record.set("htmlContentDamageArray", tableContent); } target.setAttribute('data-qtip', tableContent); - target.setAttribute('data-qtitle', ' '+typeName+'材料列表:'); + target.setAttribute('data-qtitle', ' ' + typeName + '材料列表:'); } }, - failure : function(response, options) { + failure: function (response, options) { } }); } else { target.setAttribute('data-qtip', tableContent); - target.setAttribute('data-qtitle', ' '+typeName+'材料列表:'); + target.setAttribute('data-qtitle', ' ' + typeName + '材料列表:'); } } /** @@ -3454,249 +3466,252 @@ * @param tousseInstanceId 包实例id * @param tousseName 包实例名称 */ -function addErrorDamageMaterial(type , tousseInstanceId , tousseName,rowIndex){ +function addErrorDamageMaterial(type, tousseInstanceId, tousseName, rowIndex) { var typeName = "丢失"; - if(type == 'damage'){ + if (type == 'damage') { typeName = "报损"; } //器械包的材料丢失报损Record类 var addMaterialErroDamageRecord = Ext.data.Record.create([ - {name : 'materialId'}, - {name : 'name'}, - {name : 'amount'}, - {name : 'errorAmount'}, - {name : 'errorDamageAmount'}, - {name : 'unconfirmedAmount'} + { name: 'materialId' }, + { name: 'name' }, + { name: 'amount' }, + { name: 'errorAmount' }, + { name: 'errorDamageAmount' }, + { name: 'unconfirmedAmount' } ]); //表单表格面板 var materialErrorDamageFormPanel = new top.Ext.FormPanel({ - id : 'materialErrorDamageFormPanel', - frame : true, - labelSeparator : '', - bodyStyle : 'padding:5px 5px 0px 25px', - width : 800, - autoHeight : true, - autoScroll : true, - labelAlign : 'left', - items:[new top.Ext.grid.EditorGridPanel({ - id : 'materialErrorDamageGrid', - bodyStyle : 'border:1px solid #afd7af', - frame :false, + id: 'materialErrorDamageFormPanel', + frame: true, + labelSeparator: '', + bodyStyle: 'padding:5px 5px 0px 25px', + width: 800, + autoHeight: true, + autoScroll: true, + labelAlign: 'left', + items: [new top.Ext.grid.EditorGridPanel({ + id: 'materialErrorDamageGrid', + bodyStyle: 'border:1px solid #afd7af', + frame: false, viewConfig: { - forceFit:true, - getRowClass:function(record, rowIndex, rowParams, store){ - if((record.data.unconfirmedAmount+record.data.errorDamageAmount) > 0){ - if(typeName == '丢失'){ + forceFit: true, + getRowClass: function (record, rowIndex, rowParams, store) { + if ((record.data.unconfirmedAmount + record.data.errorDamageAmount) > 0) { + if (typeName == '丢失') { return "bgYellow"; - }else { + } else { return "bgBrown"; } - }else { + } else { return "bgWhite"; } } }, - store : new Ext.data.Store({ - proxy : new Ext.data.HttpProxy({ - url : WWWROOT + '/disinfectSystem/tousseInstanceAction!loadMaterialErrorDamageId.do', - method : 'POST' + store: new Ext.data.Store({ + proxy: new Ext.data.HttpProxy({ + url: WWWROOT + '/disinfectSystem/tousseInstanceAction!loadMaterialErrorDamageId.do', + method: 'POST' }), - reader : new Ext.data.JsonReader({ - fields : [ - {name : 'materialId'}, - {name : 'name'}, - {name : 'amount'}, - {name : 'unconfirmedAmount'}, - {name : 'errorDamageAmount'} - ] + reader: new Ext.data.JsonReader({ + fields: [ + { name: 'materialId' }, + { name: 'name' }, + { name: 'amount' }, + { name: 'unconfirmedAmount' }, + { name: 'errorDamageAmount' } + ] }) }), - cm : new top.Ext.grid.ColumnModel([new Ext.grid.RowNumberer(), - {header : "materialId",dataIndex : 'materialId',hidden : true}, - {header : "名称",dataIndex : 'name',width : 180,menuDisabled : true}, - /*{header : "规定数量",dataIndex : 'defineAmount',width : 80,menuDisabled : true}, - {header : "接收数量",dataIndex : 'actualAmount',width : 80,menuDisabled : true},*/ - {header : "数量",dataIndex : 'amount',width : 50,menuDisabled : true}, - {header : typeName + "数量",width : 50,menuDisabled : true, - editor : new top.Ext.form.NumberField({ - regex: /^\d+$/, - regexText:'只能输入数字', - width : 50, - allowBlank : true, - allowNegative : false,//不允许输入负数 - allowDecimals : false,//不允许输入小数 - listeners : { - blur : function(thiz){ - - } - } - }), - renderer:function(v,p,record){ - var errorDamageAmount = record.data.errorDamageAmount || 0; - var unconfirmedAmount = record.data.unconfirmedAmount || 0; - return parseInt(errorDamageAmount)+parseInt(unconfirmedAmount); + cm: new top.Ext.grid.ColumnModel([new Ext.grid.RowNumberer(), + { header: "materialId", dataIndex: 'materialId', hidden: true }, + { header: "名称", dataIndex: 'name', width: 180, menuDisabled: true }, + /*{header : "规定数量",dataIndex : 'defineAmount',width : 80,menuDisabled : true}, + {header : "接收数量",dataIndex : 'actualAmount',width : 80,menuDisabled : true},*/ + { header: "数量", dataIndex: 'amount', width: 50, menuDisabled: true }, + { + header: typeName + "数量", width: 50, menuDisabled: true, + editor: new top.Ext.form.NumberField({ + regex: /^\d+$/, + regexText: '只能输入数字', + width: 50, + allowBlank: true, + allowNegative: false,//不允许输入负数 + allowDecimals: false,//不允许输入小数 + listeners: { + blur: function (thiz) { + + } } - }, - {header : "操作",dataIndex : 'opAction',width : 60,menuDisabled : true,renderer:function(v,p,record){ - var str = ""; - str += " "; - return str; - }} - ]), - width :735, - height : 220, - clicksToEdit : 1,// 设置点击几次才可编辑 - selModel : new top.Ext.grid.RowSelectionModel({ - singleSelect : false + }), + renderer: function (v, p, record) { + var errorDamageAmount = record.data.errorDamageAmount || 0; + var unconfirmedAmount = record.data.unconfirmedAmount || 0; + return parseInt(errorDamageAmount) + parseInt(unconfirmedAmount); + } + }, + { + header: "操作", dataIndex: 'opAction', width: 60, menuDisabled: true, renderer: function (v, p, record) { + var str = ""; + str += " "; + return str; + } + } + ]), + width: 735, + height: 220, + clicksToEdit: 1,// 设置点击几次才可编辑 + selModel: new top.Ext.grid.RowSelectionModel({ + singleSelect: false }) - }),{ - xtype:'panel', - height:10 - },{ - xtype : "panel", - title : "", - layout : 'form', - width:735, - height : 70, - items : [{ - xtype : 'textarea', - fieldLabel : typeName + '原因说明', - height : 50, - id : 'materialErrorDamageRemark', - name : 'materialErrorDamageRemark', - width:750, - maxLength : 665, - allowBlank : true, - anchor : '100%', - listeners : { - render : function(c){ + }), { + xtype: 'panel', + height: 10 + }, { + xtype: "panel", + title: "", + layout: 'form', + width: 735, + height: 70, + items: [{ + xtype: 'textarea', + fieldLabel: typeName + '原因说明', + height: 50, + id: 'materialErrorDamageRemark', + name: 'materialErrorDamageRemark', + width: 750, + maxLength: 665, + allowBlank: true, + anchor: '100%', + listeners: { + render: function (c) { var timeoutHandler = null; //单击弹出窗口选反对或输入备注 - c.getEl().on('click',function(e,thiz){ + c.getEl().on('click', function (e, thiz) { clearTimeout(timeoutHandler); - - timeoutHandler = setTimeout(function(){ + + timeoutHandler = setTimeout(function () { //弹出窗口录入相关的备注信息(传当前备注文本域对象(用于接收编辑的值)、参数类型(用于过滤相关的备注选项)等) var optionArray = []; Ext.Ajax.request({ - url : WWWROOT + '/disinfectSystem/core/httpOptionAction!getHttpOptionsById.do', - params : {"optionId":errorDamageRemark}, - success : function(response, options) { + url: WWWROOT + '/disinfectSystem/core/httpOptionAction!getHttpOptionsById.do', + params: { "optionId": errorDamageRemark }, + success: function (response, options) { var result = Ext.decode(response.responseText); - if(result.success){ - if(result.data && result.data.length > 0){ - for(var i = 0;i < result.data.length;i++){ + if (result.success) { + if (result.data && result.data.length > 0) { + for (var i = 0; i < result.data.length; i++) { optionArray.push(result.data[i].value); } - openHttpOptionSelectExt2Window(top.Ext , c , optionArray , '请选择/输入' + typeName + '原因说明'); - }else{ + openHttpOptionSelectExt2Window(top.Ext, c, optionArray, '请选择/输入' + typeName + '原因说明'); + } else { showResult("系统未配置丢失报损常用备注,请直接输入备注"); } - }else{ - if(result.message){ + } else { + if (result.message) { showResult(result.message); } } - },failure:function(response){ + }, failure: function (response) { showResult("服务器正忙,请稍候再试!"); } }); - } , 300); + }, 300); }); //双击事件(屏蔽单击),进入编辑 - c.getEl().on('dblclick',function(e,thiz){ + c.getEl().on('dblclick', function (e, thiz) { clearTimeout(timeoutHandler); c.focus(); }); } } }] - }], - buttons : [{ - id : 'btnSave', - text : '保存', - handler : function() { + }], + buttons: [{ + id: 'btnSave', + text: '保存', + handler: function () { var currentErrorDamageData; var dataExists; var dataIndexInArray; - if(tousseInstanceMaterialErrorDamageArray.length > 0){ - for(var j = 0 ;j < tousseInstanceMaterialErrorDamageArray.length;j++){ + if (tousseInstanceMaterialErrorDamageArray.length > 0) { + for (var j = 0; j < tousseInstanceMaterialErrorDamageArray.length; j++) { var tousseInstanceMaterialErrorDamageData = tousseInstanceMaterialErrorDamageArray[j]; - if(tousseInstanceId == tousseInstanceMaterialErrorDamageData.id){ + if (tousseInstanceId == tousseInstanceMaterialErrorDamageData.id) { currentErrorDamageData = tousseInstanceMaterialErrorDamageData; dataExists = true; dataIndexInArray = j; break; } } } - - if(!currentErrorDamageData){ + + if (!currentErrorDamageData) { currentErrorDamageData = {}; currentErrorDamageData.id = tousseInstanceId; } - + //表格中录入的丢失报损数据 var jsonArray = []; var store = top.Ext.getCmp("materialErrorDamageGrid").getStore(); //验证提交的丢失(报损)数据,如果有录备注原因时,必须确保至少有录一条丢失/报损数量 - for(var i = 0;i < store.getCount();i++){ + for (var i = 0; i < store.getCount(); i++) { var record = store.getAt(i); var errorDamageAmount = record.data.errorDamageAmount || 0; var unconfirmedAmount = record.data.unconfirmedAmount || 0; var errorAmount = record.data.errorAmount || 0; - - jsonArray.push({materialId:record.data.materialId,errorAmount:errorAmount, name:record.data.name,errorDamageAmount:errorDamageAmount,unconfirmedAmount:unconfirmedAmount}); + + jsonArray.push({ materialId: record.data.materialId, errorAmount: errorAmount, name: record.data.name, errorDamageAmount: errorDamageAmount, unconfirmedAmount: unconfirmedAmount }); } //定义临时变量用于存储当前的材料相关的数量值,如果验证通过再设置到正式变量,否则不设置到正式变量 var tempErrorDamageData = {}; tempErrorDamageData.errorData = currentErrorDamageData.errorData; tempErrorDamageData.damageData = currentErrorDamageData.damageData; - if(type == 'error'){ + if (type == 'error') { tempErrorDamageData.errorData = jsonArray; - }else if(type == 'damage'){ + } else if (type == 'damage') { tempErrorDamageData.damageData = jsonArray; } //判断该包的材料丢失报损数量有无超过最大可丢失报损数量 - if(tousseCanErrorDamageMaxAmountArray.length > 0){ + if (tousseCanErrorDamageMaxAmountArray.length > 0) { for (var i = 0; i < tousseCanErrorDamageMaxAmountArray.length; i++) { var tousseCanErrorDamageMaxAmount = tousseCanErrorDamageMaxAmountArray[i]; - if(tousseCanErrorDamageMaxAmount.id == tousseInstanceId){ + if (tousseCanErrorDamageMaxAmount.id == tousseInstanceId) { //1.先验证单丢失的材料数量是否超过最大可丢失报损数量 - if(tempErrorDamageData.errorData && tempErrorDamageData.errorData.length > 0){ + if (tempErrorDamageData.errorData && tempErrorDamageData.errorData.length > 0) { for (var j = 0; j < tempErrorDamageData.errorData.length; j++) { var tempErrorData = tempErrorDamageData.errorData[j]; - if(tempErrorData.unconfirmedAmount > tousseCanErrorDamageMaxAmount["" + tempErrorData.materialId]){ - alert("【"+ tempErrorData.name +"】丢失数量已大于最大可丢失报损数量,请重新填写"); + if (tempErrorData.unconfirmedAmount > tousseCanErrorDamageMaxAmount["" + tempErrorData.materialId]) { + alert("【" + tempErrorData.name + "】丢失数量已大于最大可丢失报损数量,请重新填写"); return false; } } } //2.再验证单报损的材料数量是否超过最大可丢失报损数量 - if(tempErrorDamageData.damageData && tempErrorDamageData.damageData.length > 0){ + if (tempErrorDamageData.damageData && tempErrorDamageData.damageData.length > 0) { for (var j = 0; j < tempErrorDamageData.damageData.length; j++) { var tempDamageData = tempErrorDamageData.damageData[j]; - if(tempDamageData.unconfirmedAmount > tousseCanErrorDamageMaxAmount["" + tempDamageData.materialId]){ - alert("【"+ tempDamageData.name +"】报损数量已大于最大可丢失报损数量,请重新填写"); + if (tempDamageData.unconfirmedAmount > tousseCanErrorDamageMaxAmount["" + tempDamageData.materialId]) { + alert("【" + tempDamageData.name + "】报损数量已大于最大可丢失报损数量,请重新填写"); return false; } } } - + //3.最后验证丢失与报损的同一材料数量之和是否超过最大可丢失报损数量 - if(tempErrorDamageData.errorData && tempErrorDamageData.errorData.length > 0){ + if (tempErrorDamageData.errorData && tempErrorDamageData.errorData.length > 0) { for (var j = 0; j < tempErrorDamageData.errorData.length; j++) { var tempErrorData = tempErrorDamageData.errorData[j]; var tempMaterialId = tempErrorData.materialId var totalErrorAmount = tempErrorData.unconfirmedAmount; - - if(tempErrorDamageData.damageData && tempErrorDamageData.damageData.length > 0){ + + if (tempErrorDamageData.damageData && tempErrorDamageData.damageData.length > 0) { for (var k = 0; k < tempErrorDamageData.damageData.length; k++) { var tempDamageData = tempErrorDamageData.damageData[k]; - if(tempMaterialId == tempDamageData.materialId){ + if (tempMaterialId == tempDamageData.materialId) { totalErrorAmount = totalErrorAmount + tempDamageData.unconfirmedAmount; - if(totalErrorAmount > tousseCanErrorDamageMaxAmount["" + tempMaterialId]){ - alert("【"+ tempDamageData.name +"】丢失与报损数量之和已大于最大可丢失报损数量,请重新填写"); + if (totalErrorAmount > tousseCanErrorDamageMaxAmount["" + tempMaterialId]) { + alert("【" + tempDamageData.name + "】丢失与报损数量之和已大于最大可丢失报损数量,请重新填写"); return false; } break; @@ -3708,55 +3723,55 @@ } } } - - if(top.Ext.getCmp("materialErrorDamageRemark").getValue() && jsonArray.length == 0){ - alert("如果有录入"+ typeName +"原因,至少需要录入一条材料"+ typeName +"数据"); + + if (top.Ext.getCmp("materialErrorDamageRemark").getValue() && jsonArray.length == 0) { + alert("如果有录入" + typeName + "原因,至少需要录入一条材料" + typeName + "数据"); return false; } - if(type == 'error'){ + if (type == 'error') { currentErrorDamageData.errorRemark = top.Ext.getCmp("materialErrorDamageRemark").getValue(); currentErrorDamageData.errorData = jsonArray; - }else if(type == 'damage'){ + } else if (type == 'damage') { currentErrorDamageData.damageRemark = top.Ext.getCmp("materialErrorDamageRemark").getValue(); currentErrorDamageData.damageData = jsonArray; } - - if(!dataExists){ + + if (!dataExists) { tousseInstanceMaterialErrorDamageArray.push(currentErrorDamageData); } var tousseInstanceGrid = top.Ext.getCmp("tousseInstanceGrid"); - for(var i=0;i" - + (errorDamageAmount+unconfirmedAmount) + + (errorDamageAmount + unconfirmedAmount) + ""; } } tableContent += "
"; - if(type == 'error'){ - record.set("htmlContentErrorArray",tableContent); - }else { - record.set("htmlContentDamageArray",tableContent); + if (type == 'error') { + record.set("htmlContentErrorArray", tableContent); + } else { + record.set("htmlContentDamageArray", tableContent); } top.Ext.getCmp("tousseInstanceMaterialErrorDamageItems").setValue(Ext.encode(tousseInstanceMaterialErrorDamageArray)); materialErrorDamageWindow.close(); } - },{ - text : '取消', - handler : function() { + }, { + text: '取消', + handler: function () { materialErrorDamageWindow.close(); } }] @@ -3765,122 +3780,122 @@ var materialErrorDamageGrid = top.Ext.getCmp("materialErrorDamageGrid"); var materialErrorDamageGridCurrentRowNumber; var materialErrorDamageGridCurrentAmount; - materialErrorDamageGrid.on('rowclick',function(Grid, rowIdx, e){ + materialErrorDamageGrid.on('rowclick', function (Grid, rowIdx, e) { materialErrorDamageGridCurrentRowNumber = rowIdx; var store = materialErrorDamageGrid.store; var currentRowNum = materialErrorDamageGridCurrentRowNumber; //当前行号 var currentRowData = store.getAt(currentRowNum); materialErrorDamageGridCurrentAmount = currentRowData.data.amount; }); - materialErrorDamageGrid.on('afteredit',function(e){ + materialErrorDamageGrid.on('afteredit', function (e) { var store = materialErrorDamageGrid.store; var currentRowNum = materialErrorDamageGridCurrentRowNumber; //当前行号 var currentRowData = store.getAt(currentRowNum); var name = currentRowData.data.name; var amount = currentRowData.data.amount; var materialId = currentRowData.data.materialId; var errorAmount = currentRowData.data.errorAmount; - if(errorAmount > materialErrorDamageGridCurrentAmount){ - alert("【"+ name +"】"+ typeName +"已大于最大可丢失报损数量,请重新填写"); - currentRowData.set("errorAmount","0"); + if (errorAmount > materialErrorDamageGridCurrentAmount) { + alert("【" + name + "】" + typeName + "已大于最大可丢失报损数量,请重新填写"); + currentRowData.set("errorAmount", "0"); return false; } }); //丢失报损表格的丢失/报损数量验证代码 end - + var materialErrorDamageWindow = new top.Ext.Window({ - id : 'materialErrorDamageWindow', - layout : 'fit', - title : "【"+ tousseName +"】" + '材料'+ typeName +'信息', - width : 810, - modal : true, - autoHeight : true, - border :false, - plain : true, - items : [ materialErrorDamageFormPanel ] + id: 'materialErrorDamageWindow', + layout: 'fit', + title: "【" + tousseName + "】" + '材料' + typeName + '信息', + width: 810, + modal: true, + autoHeight: true, + border: false, + plain: true, + items: [materialErrorDamageFormPanel] }); materialErrorDamageWindow.show(); - + //记录每个包实例的最大可丢失/报损数量,格式为:[{id:包实例id1值,materialId1值:amount1值,materialId2值:amount2值},{id:包实例id2值,,materialId1值:amount1值,materialId2值:amount2值}] var tousseCanErrorDamageMaxAmountArray = []; materialErrorDamageFormPanel.getEl().mask("正在加载,请稍候..."); //通过dwr或ajax请求及同本地变量的计算生成列表数据显示 Ext.Ajax.request({ - url : WWWROOT + '/disinfectSystem/tousseInstanceAction!loadMaterialErrorDamageDataById.do', - params : { - id : tousseInstanceId, - type : type + url: WWWROOT + '/disinfectSystem/tousseInstanceAction!loadMaterialErrorDamageDataById.do', + params: { + id: tousseInstanceId, + type: type }, - success : function(response, options) { + success: function (response, options) { materialErrorDamageFormPanel.getEl().unmask(); //数据格式:{remark:"原因说明",[{name:"材料1",defineAmount:2,amount:2,errorAmount:1},{name:"材料2",defineAmount:1,amount:1,errorAmount:0},...{name:"材料3",defineAmount:4,amount:3,errorAmount:1}]} var result = Ext.decode(response.responseText); var currentErrorDamageData; - if(tousseInstanceMaterialErrorDamageArray.length > 0){ - for(var j = 0 ;j < tousseInstanceMaterialErrorDamageArray.length;j++){ + if (tousseInstanceMaterialErrorDamageArray.length > 0) { + for (var j = 0; j < tousseInstanceMaterialErrorDamageArray.length; j++) { var tousseInstanceMaterialErrorDamageData = tousseInstanceMaterialErrorDamageArray[j]; - if(tousseInstanceId == tousseInstanceMaterialErrorDamageData.id){ + if (tousseInstanceId == tousseInstanceMaterialErrorDamageData.id) { currentErrorDamageData = tousseInstanceMaterialErrorDamageData; break; } } } var remark; var currentErrorDamageDetailData; - if(type == 'error' && currentErrorDamageData && currentErrorDamageData.errorData){ + if (type == 'error' && currentErrorDamageData && currentErrorDamageData.errorData) { remark = currentErrorDamageData.errorRemark; currentErrorDamageDetailData = currentErrorDamageData.errorData; - }else if(type == 'damage' && currentErrorDamageData && currentErrorDamageData.damageData){ + } else if (type == 'damage' && currentErrorDamageData && currentErrorDamageData.damageData) { remark = currentErrorDamageData.damageRemark; currentErrorDamageDetailData = currentErrorDamageData.damageData; - }else{ + } else { remark = result.remark; } top.Ext.getCmp("materialErrorDamageRemark").setValue(remark); - if(result.data && result.data.length > 0){ + if (result.data && result.data.length > 0) { var store = top.Ext.getCmp("materialErrorDamageGrid").getStore(); - for(var i = 0 ;i < result.data.length;i++){ + for (var i = 0; i < result.data.length; i++) { var resultData = result.data[i]; var materialId = resultData.materialId; var errorAmount = resultData.errorAmount; var errorDamageAmount = resultData.errorDamageAmount; var unconfirmedAmount = resultData.unconfirmedAmount; - + //记录每个包实例的材料最大可丢失/报损数量 - if(tousseCanErrorDamageMaxAmountArray.length > 0){ + if (tousseCanErrorDamageMaxAmountArray.length > 0) { var foundData = false; for (var j = 0; j < tousseCanErrorDamageMaxAmountArray.length; j++) { var tousseCanErrorDamageMaxAmount = tousseCanErrorDamageMaxAmountArray[j]; - if(tousseInstanceId == tousseCanErrorDamageMaxAmount.id){ - for(var p in tousseCanErrorDamageMaxAmount){ - if(materialId == p){ + if (tousseInstanceId == tousseCanErrorDamageMaxAmount.id) { + for (var p in tousseCanErrorDamageMaxAmount) { + if (materialId == p) { tousseCanErrorDamageMaxAmount[p] = resultData.amount; foundData = true; break; } } } } - if(!foundData){ + if (!foundData) { var newTousseCanErrorDamageMaxAmount = {}; newTousseCanErrorDamageMaxAmount.id = tousseInstanceId; - newTousseCanErrorDamageMaxAmount[""+ materialId +""] = resultData.amount; + newTousseCanErrorDamageMaxAmount["" + materialId + ""] = resultData.amount; tousseCanErrorDamageMaxAmountArray.push(newTousseCanErrorDamageMaxAmount); } - }else{ + } else { var newTousseCanErrorDamageMaxAmount = {}; newTousseCanErrorDamageMaxAmount.id = tousseInstanceId; - newTousseCanErrorDamageMaxAmount[""+ materialId +""] = resultData.amount; + newTousseCanErrorDamageMaxAmount["" + materialId + ""] = resultData.amount; tousseCanErrorDamageMaxAmountArray.push(newTousseCanErrorDamageMaxAmount); } - if(currentErrorDamageDetailData){ - if(currentErrorDamageDetailData.length > 0){ + if (currentErrorDamageDetailData) { + if (currentErrorDamageDetailData.length > 0) { var existsErrorAmount = false; - for(var k = 0;k < currentErrorDamageDetailData.length ;k++){ - if(materialId == currentErrorDamageDetailData[k].materialId){ + for (var k = 0; k < currentErrorDamageDetailData.length; k++) { + if (materialId == currentErrorDamageDetailData[k].materialId) { errorAmount = currentErrorDamageDetailData[k].errorAmount; - if(currentErrorDamageDetailData[k].errorDamageAmount == undefined){ + if (currentErrorDamageDetailData[k].errorDamageAmount == undefined) { existsErrorAmount = true; break; } @@ -3890,33 +3905,33 @@ break; } } - }else { + } else { errorDamageAmount = 0; unconfirmedAmount = 0; errorAmount = 0; } - if(!existsErrorAmount){ + if (!existsErrorAmount) { errorAmount = ""; } } var storeData = new addMaterialErroDamageRecord({ - materialId : materialId, - name : resultData.name, - amount : resultData.amount, - errorDamageAmount:errorDamageAmount, - errorAmount : errorAmount, - unconfirmedAmount:unconfirmedAmount + materialId: materialId, + name: resultData.name, + amount: resultData.amount, + errorDamageAmount: errorDamageAmount, + errorAmount: errorAmount, + unconfirmedAmount: unconfirmedAmount }); store.add(storeData); } } }, - failure : function(response, options) { + failure: function (response, options) { materialErrorDamageFormPanel.getEl().unmask(); } }); - + } /** @@ -3925,27 +3940,27 @@ * @param materialId * @param name */ -function changeMaterialErrorAmount(type , materialId , name){ +function changeMaterialErrorAmount(type, materialId, name) { var store = top.Ext.getCmp("materialErrorDamageGrid").getStore(); - for(var i = 0 ;i < store.getCount();i++){ + for (var i = 0; i < store.getCount(); i++) { var record = store.getAt(i); - if(materialId == record.get("materialId")){ + if (materialId == record.get("materialId")) { var errorDamageAmount = parseInt(record.get("errorDamageAmount")) || 0; var unconfirmedAmount = parseInt(record.get("unconfirmedAmount")) || 0; var amount = record.get("amount"); - if(type == 'add'){ - if((errorDamageAmount+unconfirmedAmount) >= amount){ + if (type == 'add') { + if ((errorDamageAmount + unconfirmedAmount) >= amount) { showResult("误差数量已经达到原数量,不能再加"); - }else{ - record.set("unconfirmedAmount",unconfirmedAmount + 1); + } else { + record.set("unconfirmedAmount", unconfirmedAmount + 1); } - }else if(type == 'sub'){ - if((errorDamageAmount+unconfirmedAmount) == 0){ + } else if (type == 'sub') { + if ((errorDamageAmount + unconfirmedAmount) == 0) { showResult("误差数量已经为0,不能再减"); - }else if(unconfirmedAmount == 0){ + } else if (unconfirmedAmount == 0) { showResult("减少到的最小数量不能超过已有的丢失数量!"); - }else{ - record.set("unconfirmedAmount",unconfirmedAmount - 1); + } else { + record.set("unconfirmedAmount", unconfirmedAmount - 1); } } break;