Index: ssts-web/src/main/webapp/disinfectsystem/washanddisinfectmanager/washanddisinfectrecord/washAndDisinfectForm.js =================================================================== diff -u -r36269 -r36571 --- ssts-web/src/main/webapp/disinfectsystem/washanddisinfectmanager/washanddisinfectrecord/washAndDisinfectForm.js (.../washAndDisinfectForm.js) (revision 36269) +++ ssts-web/src/main/webapp/disinfectsystem/washanddisinfectmanager/washanddisinfectrecord/washAndDisinfectForm.js (.../washAndDisinfectForm.js) (revision 36571) @@ -211,7 +211,80 @@ }) }); +//保存 +function saveFun(that, isAdd) { + var root = top.Ext.getCmp('basketTreePanel').getRootNode(); + isAddNew = isAdd; + if (materialStore.getCount() == 0 && root.childNodes.length == 0) { + top.Ext.MessageBox.confirm("请确认", "没有添加清洗的物品,继续清洗吗?", function (button, text) { + if ("yes" == button) { + if (sstsConfig.enableRinserConsumptiveMaterialConsumptionFunction) { + var totalAmount = top.Ext.getCmp('totalAmount').getValue(); + var consumptiveMaterialContainerId = top.Ext.getCmp('consumptiveMaterialContainerId').getValue(); + if (consumptiveMaterialContainerId !== '' && totalAmount == '') { + top.Ext.MessageBox.confirm("请确认", "当前设备绑定的清洗耗材容器没有配置清洗耗材,是否继续操作?", function (button, text) { + if ("yes" == button) { + that.disable(); + var success = save(); + if (!success) { + that.enable(); + } + } else { + return false; + } + }); + } else { + that.disable(); + var success = save(); + if (!success) { + that.enable(); + } + } + } else { + that.disable(); + var success = save(); + if (!success) { + that.enable(); + } + } + } else { + return false; + } + }); + } else { + if (sstsConfig.enableRinserConsumptiveMaterialConsumptionFunction) { + var totalAmount = top.Ext.getCmp('totalAmount').getValue(); + var consumptiveMaterialContainerId = top.Ext.getCmp('consumptiveMaterialContainerId').getValue(); + if (consumptiveMaterialContainerId !== '' && totalAmount == '') { + top.Ext.MessageBox.confirm("请确认", "当前设备绑定的清洗耗材容器没有配置清洗耗材,是否继续操作?", function (button, text) { + if ("yes" == button) { + that.disable(); + var success = save(); + if (!success) { + that.enable(); + } + } else { + return false; + } + }); + } else { + that.disable(); + var success = save(); + if (!success) { + that.enable(); + } + } + } else { + that.disable(); + var success = save(); + if (!success) { + that.enable(); + } + } + } +} + //根据条码加载材料 function loadMaterial(barcode, callBack, idCardBarcode, isRetrospectTousse) { if (typeof (barcode) == 'undefined' || barcode == '') { @@ -733,7 +806,7 @@ } -function loadRinserBindConsumptiveMaterialContainer(value,isShow){ +function loadRinserBindConsumptiveMaterialContainer(value, isShow) { Ext.Ajax.request({ url: WWWROOT + '/disinfectSystem/consumptiveMaterialContainerAction!loadRinserBindConsumptiveMaterialContainer.do', params: { @@ -745,12 +818,12 @@ var consumptiveMaterialVolumes = result.consumptiveMaterialVolumes || ''; top.Ext.getCmp('totalAmount').setValue(consumptiveMaterialVolumes); top.Ext.getCmp('consumptiveMaterialContainerId').setValue(result.consumptiveMaterialContainerId) - if(consumptiveMaterialVolumes !== '' && isShow == true){ + if (consumptiveMaterialVolumes !== '' && isShow == true) { top.Ext.getCmp('hiddenBox1').show(); - }else { + } else { top.Ext.getCmp('hiddenBox1').hide(); } - }else { + } else { top.Ext.getCmp('hiddenBox1').hide(); } }, @@ -761,7 +834,7 @@ }) } -function getCleanMethodConsumptionVolume(id){ +function getCleanMethodConsumptionVolume(id) { Ext.Ajax.request({ url: WWWROOT + '/disinfectSystem/baseData/cleanMethodAction!getCleanMethodConsumptionVolume.do', params: { @@ -771,13 +844,13 @@ var result = Ext.decode(response.responseText); if (result.success) { var consumptiveMaterialVolumes = result.consumptiveMaterialVolumes || ''; - if(consumptiveMaterialVolumes !== ''){ + if (consumptiveMaterialVolumes !== '') { top.Ext.getCmp('consumptiveMaterialVolumes').setValue(consumptiveMaterialVolumes); top.Ext.getCmp('hiddenBox2').show(); - }else { + } else { top.Ext.getCmp('hiddenBox2').hide(); } - }else { + } else { top.Ext.getCmp('hiddenBox2').hide(); } }, @@ -928,10 +1001,10 @@ // pendingWashAndDisinfectColumnTree.loader.load(pendingWashAndDisinfectColumnTree.root,function(){}); fieldsetHeight = (!!window.ActiveXObject || "ActiveXObject" in window || window.navigator.userAgent.indexOf("MSIE") >= 1) ? 185 : 210; - if(sstsConfig.enableRinserConsumptiveMaterialConsumptionFunction){ - if(fontSize == 12){ + if (sstsConfig.enableRinserConsumptiveMaterialConsumptionFunction) { + if (fontSize == 12) { fieldsetHeight += 40; - }else { + } else { fieldsetHeight += 60; } } @@ -1099,6 +1172,10 @@ var barcode = top.Ext.getCmp('inputText').getValue(); barcode = barcode.Trim(); if (barcode != null && barcode != "") { + if (barcode == '900000002') { + saveFun(this, true); + return + } BarcodeTableManager.getBarcodeTypeByBarcode(barcode, function (jsonStr) { var result = Ext.util.JSON.decode(jsonStr); var isRetrospectTousse = false; //是否是追溯的器械包 //逻辑反了,应该理解为:是否是不追溯的器械包。false代表要追溯,true代表不追溯 @@ -1216,8 +1293,8 @@ } }); DWREngine.setAsync(true); - if(sstsConfig.enableRinserConsumptiveMaterialConsumptionFunction){ - loadRinserBindConsumptiveMaterialContainer(value,true); + if (sstsConfig.enableRinserConsumptiveMaterialConsumptionFunction) { + loadRinserBindConsumptiveMaterialContainer(value, true); } // } } @@ -1278,7 +1355,7 @@ } }); var consumptiveMaterialContainerId = top.Ext.getCmp('consumptiveMaterialContainerId').getValue() || ''; - if(sstsConfig.enableRinserConsumptiveMaterialConsumptionFunction && consumptiveMaterialContainerId !== ''){ + if (sstsConfig.enableRinserConsumptiveMaterialConsumptionFunction && consumptiveMaterialContainerId !== '') { getCleanMethodConsumptionVolume(record.data.id); } } @@ -1327,43 +1404,43 @@ }, { columnWidth: 1, layout: 'form', - id:'hiddenBox1', + id: 'hiddenBox1', items: [{ - xtype:'hidden', - id:'consumptiveMaterialContainerId', - name:'consumptiveMaterialContainerId' - },{ + xtype: 'hidden', + id: 'consumptiveMaterialContainerId', + name: 'consumptiveMaterialContainerId' + }, { xtype: 'textfield', fieldLabel: "设备耗材余量", name: "totalAmount", id: "totalAmount", readOnly: true, - cls : 'fieldReadOnlyNoRemove', + cls: 'fieldReadOnlyNoRemove', anchor: '99%' }], - listeners:{ - render:function(){ - setTimeout(function(){ + listeners: { + render: function () { + setTimeout(function () { top.Ext.getCmp('hiddenBox1').hide(); }, 100); } } - },{ + }, { columnWidth: 1, layout: 'form', - id:'hiddenBox2', + id: 'hiddenBox2', items: [{ xtype: 'textfield', fieldLabel: "本次耗材消耗", name: "consumptiveMaterialVolumes", id: "consumptiveMaterialVolumes", readOnly: true, - cls : 'fieldReadOnlyNoRemove', + cls: 'fieldReadOnlyNoRemove', anchor: '99%' }], - listeners:{ - render:function(){ - setTimeout(function(){ + listeners: { + render: function () { + setTimeout(function () { top.Ext.getCmp('hiddenBox2').hide(); }, 100); } @@ -1521,152 +1598,14 @@ text: '保存', hidden: (isWashAgain ? true : false), handler: function () { - var root = top.Ext.getCmp('basketTreePanel').getRootNode(); - var that = this; - isAddNew = false; - if (materialStore.getCount() == 0 && root.childNodes.length == 0) { - top.Ext.MessageBox.confirm("请确认", "没有添加清洗的物品,继续清洗吗?", function (button, text) { - if ("yes" == button) { - if(sstsConfig.enableRinserConsumptiveMaterialConsumptionFunction){ - var totalAmount = top.Ext.getCmp('totalAmount').getValue(); - var consumptiveMaterialContainerId = top.Ext.getCmp('consumptiveMaterialContainerId').getValue(); - if(consumptiveMaterialContainerId !== '' && totalAmount == ''){ - top.Ext.MessageBox.confirm("请确认", "当前设备绑定的清洗耗材容器没有配置清洗耗材,是否继续操作?", function (button, text) { - if ("yes" == button) { - that.disable(); - var success = save(); - if (!success) { - that.enable(); - } - } else { - return false; - } - }); - }else { - that.disable(); - var success = save(); - if (!success) { - that.enable(); - } - } - }else { - that.disable(); - var success = save(); - if (!success) { - that.enable(); - } - } - } else { - return false; - } - }); - } else { - if(sstsConfig.enableRinserConsumptiveMaterialConsumptionFunction){ - var totalAmount = top.Ext.getCmp('totalAmount').getValue(); - var consumptiveMaterialContainerId = top.Ext.getCmp('consumptiveMaterialContainerId').getValue(); - if(consumptiveMaterialContainerId !== '' && totalAmount == ''){ - top.Ext.MessageBox.confirm("请确认", "当前设备绑定的清洗耗材容器没有配置清洗耗材,是否继续操作?", function (button, text) { - if ("yes" == button) { - that.disable(); - var success = save(); - if (!success) { - that.enable(); - } - } else { - return false; - } - }); - }else { - that.disable(); - var success = save(); - if (!success) { - that.enable(); - } - } - }else { - that.disable(); - var success = save(); - if (!success) { - that.enable(); - } - } - } + saveFun(this, false); } - },{ + }, { id: 'saveBtn', text: '保存并新建', hidden: (isWashAgain ? true : false), handler: function () { - var root = top.Ext.getCmp('basketTreePanel').getRootNode(); - var that = this; - isAddNew = true; - if (materialStore.getCount() == 0 && root.childNodes.length == 0) { - top.Ext.MessageBox.confirm("请确认", "没有添加清洗的物品,继续清洗吗?", function (button, text) { - if ("yes" == button) { - if(sstsConfig.enableRinserConsumptiveMaterialConsumptionFunction){ - var totalAmount = top.Ext.getCmp('totalAmount').getValue(); - var consumptiveMaterialContainerId = top.Ext.getCmp('consumptiveMaterialContainerId').getValue(); - if(consumptiveMaterialContainerId !== '' && totalAmount == ''){ - top.Ext.MessageBox.confirm("请确认", "当前设备绑定的清洗耗材容器没有配置清洗耗材,是否继续操作?", function (button, text) { - if ("yes" == button) { - that.disable(); - var success = save(); - if (!success) { - that.enable(); - } - } else { - return false; - } - }); - }else { - that.disable(); - var success = save(); - if (!success) { - that.enable(); - } - } - }else { - that.disable(); - var success = save(); - if (!success) { - that.enable(); - } - } - } else { - return false; - } - }); - } else { - if(sstsConfig.enableRinserConsumptiveMaterialConsumptionFunction){ - var totalAmount = top.Ext.getCmp('totalAmount').getValue(); - var consumptiveMaterialContainerId = top.Ext.getCmp('consumptiveMaterialContainerId').getValue(); - if(consumptiveMaterialContainerId !== '' && totalAmount == ''){ - top.Ext.MessageBox.confirm("请确认", "当前设备绑定的清洗耗材容器没有配置清洗耗材,是否继续操作?", function (button, text) { - if ("yes" == button) { - that.disable(); - var success = save(); - if (!success) { - that.enable(); - } - } else { - return false; - } - }); - }else { - that.disable(); - var success = save(); - if (!success) { - that.enable(); - } - } - }else { - that.disable(); - var success = save(); - if (!success) { - that.enable(); - } - } - } + saveFun(this, true); } }, { id: 'washAgainBtn', @@ -1810,10 +1749,10 @@ interruptStore.add(material); } } - if(sstsConfig.enableRinserConsumptiveMaterialConsumptionFunction){ - loadRinserBindConsumptiveMaterialContainer(rinserName,false); + if (sstsConfig.enableRinserConsumptiveMaterialConsumptionFunction) { + loadRinserBindConsumptiveMaterialContainer(rinserName, false); var cleanMethodConsumptionVolumeStr = action.result.data.cleanMethodConsumptionVolumeStr || ''; - if(cleanMethodConsumptionVolumeStr !== ''){ + if (cleanMethodConsumptionVolumeStr !== '') { top.Ext.getCmp('consumptiveMaterialVolumes').setValue(cleanMethodConsumptionVolumeStr); top.Ext.getCmp('hiddenBox2').show(); } @@ -2124,18 +2063,18 @@ success: function (form, action) { var validate = Ext.decode(action.result.success); if (validate) { - if(sstsConfig.enableRinserConsumptiveMaterialConsumptionFunction){ + if (sstsConfig.enableRinserConsumptiveMaterialConsumptionFunction) { var totalAmount = top.Ext.getCmp('totalAmount').getValue() || ''; var consumptiveMaterialContainerId = top.Ext.getCmp('consumptiveMaterialContainerId').getValue(); - if(consumptiveMaterialContainerId == '' && totalAmount == ''){ + if (consumptiveMaterialContainerId == '' && totalAmount == '') { showResult('该设备没有绑定清洗耗材容器'); } } Ext.getCmp('washSaveSubmitResult').setValue("1"); showResult(action.result.message); grid.dwrReload(); washAndDisinfectRecordWin.close(); - if(isAddNew){ + if (isAddNew) { addAndEditWashAndDisinfectRecord(0, false, false); } } else {