Index: ssts-web/src/main/webapp/disinfectsystem/qualitymonitoring/qualitymonitoringInstanceForm.js =================================================================== diff -u -r35411 -r36610 --- ssts-web/src/main/webapp/disinfectsystem/qualitymonitoring/qualitymonitoringInstanceForm.js (.../qualitymonitoringInstanceForm.js) (revision 35411) +++ ssts-web/src/main/webapp/disinfectsystem/qualitymonitoring/qualitymonitoringInstanceForm.js (.../qualitymonitoringInstanceForm.js) (revision 36610) @@ -31,51 +31,51 @@ var currentOrgUnitName = currentOrgUnitName || ''; var currentOrgUnitCoding = currentOrgUnitCoding || ''; var newTousseItems = [] -if(top.Ext.getCmp("tousseInfoFieldSet")){ +if (top.Ext.getCmp("tousseInfoFieldSet")) { var getWidth = top.Ext.getCmp("tousseInfoFieldSet").items.items[0].el.dom.clientWidth; } function cancelQualityMonitoring() { closeQMWindow(); } -function closeQMWindow(){ - if(recycleQM == true){ +function closeQMWindow() { + if (recycleQM == true) { // 回收页面进来 closeQMLayer(); - }else{ + } else { qualityMonitoringWin.close(); } } -function triggerItemAction(valueTriggerItemIds,action){ - if(valueTriggerItemIds != null && valueTriggerItemIds != ""){ +function triggerItemAction(valueTriggerItemIds, action) { + if (valueTriggerItemIds != null && valueTriggerItemIds != "") { var itemIdArray = valueTriggerItemIds.split(","); - if(itemIdArray.length > 0){ - for(var n = 0 ; n < itemIdArray.length ; n++){ + if (itemIdArray.length > 0) { + for (var n = 0; n < itemIdArray.length; n++) { var triggerItemId = itemIdArray[n]; - if(triggerItemId != null && triggerItemId != ""){ + if (triggerItemId != null && triggerItemId != "") { var hideElement = top.Ext.getCmp("hideElement" + triggerItemId); - if(hideElement){ - if("show" == action){ + if (hideElement) { + if ("show" == action) { hideElement.show(); - }else{ + } else { var xtype = hideElement.getXType(); - if(xtype == 'fieldset'){ - var length = hideElement.items.each(function(fsItem){ + if (xtype == 'fieldset') { + var length = hideElement.items.each(function (fsItem) { var itemType = fsItem.getXType(); - if(itemType == "panel"){ - fsItem.items.each(function(item,index,length){ + if (itemType == "panel") { + fsItem.items.each(function (item, index, length) { item.setValue(false); - }); - }else if(itemType == "hidden"){ + }); + } else if (itemType == "hidden") { fsItem.setValue(""); } }); - }else if(xtype == 'panel'){ - hideElement.items.each(function(item,index,length){ + } else if (xtype == 'panel') { + hideElement.items.each(function (item, index, length) { item.setValue(""); - }); + }); } hideElement.hide(); } @@ -97,262 +97,262 @@ * @param isTriggerItem 触发项 * @returns */ -function createQualityMonitoringItemElement(type,id,name,allowBlank,options,value,isTriggerItem){ +function createQualityMonitoringItemElement(type, id, name, allowBlank, options, value, isTriggerItem) { var hideElement = false; - if('是' == isTriggerItem && (value == null || value == "")){ - setTimeout(function() { - top.Ext.getCmp('hideElement'+id).hide(); + if ('是' == isTriggerItem && (value == null || value == "")) { + setTimeout(function () { + top.Ext.getCmp('hideElement' + id).hide(); }, 100); } - if(type == '文本'){ + if (type == '文本') { return { - columnWidth : .5, - layout : 'form', - labelWidth : 90, - hidden:hideElement, - id:'hideElement'+id, - items : [{ - xtype : 'textfield', - fieldLabel : name, - maxLength : '30', - id : 'configItemOption'+id, - name : 'configItemOption'+id, - allowBlank : allowBlank, - value : value, - anchor : '95%' + columnWidth: .5, + layout: 'form', + labelWidth: 90, + hidden: hideElement, + id: 'hideElement' + id, + items: [{ + xtype: 'textfield', + fieldLabel: name, + maxLength: '30', + id: 'configItemOption' + id, + name: 'configItemOption' + id, + allowBlank: allowBlank, + value: value, + anchor: '95%' }] }; - }else if(type == '文本框'){ + } else if (type == '文本框') { return { - columnWidth : .9, - layout : 'form', - labelWidth : 90, - hidden:hideElement, - id:'hideElement'+id, - items : [{ - xtype : 'textarea', - fieldLabel : name, - maxLength : '300', - id : 'configItemOption'+id, - name : 'configItemOption'+id, - allowBlank : allowBlank, - value : value, - anchor : '95%' + columnWidth: .9, + layout: 'form', + labelWidth: 90, + hidden: hideElement, + id: 'hideElement' + id, + items: [{ + xtype: 'textarea', + fieldLabel: name, + maxLength: '300', + id: 'configItemOption' + id, + name: 'configItemOption' + id, + allowBlank: allowBlank, + value: value, + anchor: '95%' }] }; - - }else if(type == '数字'){ + + } else if (type == '数字') { return { - columnWidth : .5, - layout : 'form', - labelWidth : 90, - hidden:hideElement, - id:'hideElement'+id, - items : [{ - xtype : 'numberfield', - fieldLabel : name, - id : 'configItemOption'+id, - name : 'configItemOption'+id, - allowBlank : allowBlank, - allowDecimals : true, - value : value, - maxLength:8, - anchor : '95%' + columnWidth: .5, + layout: 'form', + labelWidth: 90, + hidden: hideElement, + id: 'hideElement' + id, + items: [{ + xtype: 'numberfield', + fieldLabel: name, + id: 'configItemOption' + id, + name: 'configItemOption' + id, + allowBlank: allowBlank, + allowDecimals: true, + value: value, + maxLength: 8, + anchor: '95%' }] }; - }else if(type == '时间'){ + } else if (type == '时间') { return { - columnWidth : .5, - layout : 'form', - labelWidth : 90, - hidden:hideElement, - id:'hideElement'+id, - items : [{ - xtype : 'datefieldWithMin', - fieldLabel : name, - id : 'configItemOption'+id, - name : 'configItemOption'+id, - format : 'Y-m-d H:i', - value : value, - editable : false, - allowBlank : allowBlank, - anchor : '95%' + columnWidth: .5, + layout: 'form', + labelWidth: 90, + hidden: hideElement, + id: 'hideElement' + id, + items: [{ + xtype: 'datefieldWithMin', + fieldLabel: name, + id: 'configItemOption' + id, + name: 'configItemOption' + id, + format: 'Y-m-d H:i', + value: value, + editable: false, + allowBlank: allowBlank, + anchor: '95%' }] }; - }else if(type == '时间段'){ - if(value == null || value == ''){ + } else if (type == '时间段') { + if (value == null || value == '') { value = '00:00'; } return { - columnWidth : .5, - layout : 'form', - labelWidth : 90, - hidden:hideElement, - id:'hideElement'+id, - items : [{ - xtype : 'textfield', - fieldLabel : name, - maxLength : '16', - id : 'configItemOption'+id, - name : 'configItemOption'+id, - regex : /^\d*:\d\d$/, - regexText : '请按照"小时:分钟"的格式填写', - allowBlank : allowBlank, - value : value, - anchor : '95%' + columnWidth: .5, + layout: 'form', + labelWidth: 90, + hidden: hideElement, + id: 'hideElement' + id, + items: [{ + xtype: 'textfield', + fieldLabel: name, + maxLength: '16', + id: 'configItemOption' + id, + name: 'configItemOption' + id, + regex: /^\d*:\d\d$/, + regexText: '请按照"小时:分钟"的格式填写', + allowBlank: allowBlank, + value: value, + anchor: '95%' }] }; - }else if(type == '日期'){ + } else if (type == '日期') { return { - columnWidth : .5, - layout : 'form', - labelWidth : 90, - hidden:hideElement, - id:'hideElement'+id, - items : [{ - xtype : 'datefieldWithMin', - fieldLabel : name, - id : 'configItemOption'+id, - name : 'configItemOption'+id, - format : 'Y-m-d', - value : value, - editable : false, - allowBlank : allowBlank, - anchor : '95%' + columnWidth: .5, + layout: 'form', + labelWidth: 90, + hidden: hideElement, + id: 'hideElement' + id, + items: [{ + xtype: 'datefieldWithMin', + fieldLabel: name, + id: 'configItemOption' + id, + name: 'configItemOption' + id, + format: 'Y-m-d', + value: value, + editable: false, + allowBlank: allowBlank, + anchor: '95%' }] }; - }else if(type == '单选'){ + } else if (type == '单选') { var optionsArrays = new Array(); - if(options != ""){ + if (options != "") { var optionsJson = JSON.parse(options); var hideTriggerItemIdsValue = ""; - for(var j = 0 ; j < optionsJson.length ; j++){ + for (var j = 0; j < optionsJson.length; j++) { var optionsArray = new Array(); optionsArray.push(optionsJson[j].name); optionsArray.push(optionsJson[j].valueTriggerItemIds); optionsArrays.push(optionsArray); - if(value == optionsJson[j].name){ + if (value == optionsJson[j].name) { hideTriggerItemIdsValue = optionsJson[j].valueTriggerItemIds; } } } return { - columnWidth : .5, - layout : 'form', - labelWidth : 90, - style:'margin-top:10px', - hidden:hideElement, - id:'hideElement'+id, - items : [{ - xtype:'hidden', - id:'triggerItemIds' + id, - name:'triggerItemIds' + id, - value : hideTriggerItemIdsValue - },{ - xtype : 'combo', - fieldLabel : name, - id : 'configItemOption'+id, - name : 'configItemOption'+id, - valueField : 'value', - displayField : 'value', - allowBlank : allowBlank, - editable : false, + columnWidth: .5, + layout: 'form', + labelWidth: 90, + style: 'margin-top:10px', + hidden: hideElement, + id: 'hideElement' + id, + items: [{ + xtype: 'hidden', + id: 'triggerItemIds' + id, + name: 'triggerItemIds' + id, + value: hideTriggerItemIdsValue + }, { + xtype: 'combo', + fieldLabel: name, + id: 'configItemOption' + id, + name: 'configItemOption' + id, + valueField: 'value', + displayField: 'value', + allowBlank: allowBlank, + editable: false, listWidth: 400, - store : new top.Ext.data.SimpleStore({ - fields : [ 'value', 'valueTriggerItemIds'], - data : optionsArrays + store: new top.Ext.data.SimpleStore({ + fields: ['value', 'valueTriggerItemIds'], + data: optionsArrays }), - forceSelection : true, - value : value, - mode : 'local', - triggerAction : 'all', - anchor : '100%', - listeners:{ - select : function(combo, record, index) { + forceSelection: true, + value: value, + mode: 'local', + triggerAction: 'all', + anchor: '100%', + listeners: { + select: function (combo, record, index) { var valueTriggerItemIds = record.get("valueTriggerItemIds"); var oldTriggerItemIds = top.Ext.getCmp("triggerItemIds" + id).getValue(); - triggerItemAction(oldTriggerItemIds,"hide"); - triggerItemAction(valueTriggerItemIds,"show"); + triggerItemAction(oldTriggerItemIds, "hide"); + triggerItemAction(valueTriggerItemIds, "show"); top.Ext.getCmp("triggerItemIds" + id).setValue(valueTriggerItemIds); } } }] }; - }else if(type == '多选'){ - if(value == null || value == ''){ + } else if (type == '多选') { + if (value == null || value == '') { value = ''; } var optionsArray = new Array(); optionsArray.push({ - id : 'configItemOption'+id, - name : 'configItemOption'+id, - xtype : 'hidden', - hidden : allowBlank, - value : value + id: 'configItemOption' + id, + name: 'configItemOption' + id, + xtype: 'hidden', + hidden: allowBlank, + value: value }); - if(options != ""){ + if (options != "") { var optionsJson = JSON.parse(options); - for(var j = 0 ; j < optionsJson.length ; j++){ + for (var j = 0; j < optionsJson.length; j++) { var checked = false; - if(value != null && value.indexOf(JSON.stringify(optionsJson[j])) != -1){ + if (value != null && value.indexOf(JSON.stringify(optionsJson[j])) != -1) { checked = true; } optionsArray.push({ - layout : 'form', - columnWidth : 0.5, - labelWidth : 200, - style:'margin-top:10px', - items:[{ - name : 'cconfigItemOption'+id, - fieldLabel : optionsJson[j].name, - xtype : 'checkbox', - checked : checked, - columnWidth : .5, - inputValue : JSON.stringify(optionsJson[j]), - listeners : { - check : function(thiz, checked){ + layout: 'form', + columnWidth: 0.5, + labelWidth: 200, + style: 'margin-top:10px', + items: [{ + name: 'cconfigItemOption' + id, + fieldLabel: optionsJson[j].name, + xtype: 'checkbox', + checked: checked, + columnWidth: .5, + inputValue: JSON.stringify(optionsJson[j]), + listeners: { + check: function (thiz, checked) { var elementId = thiz.getName().substring(1); var elementObj = top.Ext.getCmp(elementId); - if(elementObj != undefined && elementObj != null){ + if (elementObj != undefined && elementObj != null) { var oldElementValue = elementObj.getValue(); var checkedValue = JSON.parse(thiz.getRawValue()); - if(checked){ - if(oldElementValue.indexOf(thiz.getRawValue()) == -1){ + if (checked) { + if (oldElementValue.indexOf(thiz.getRawValue()) == -1) { oldElementValue += ","; oldElementValue += thiz.getRawValue() elementObj.setValue(oldElementValue); } - if(checkedValue != null){ + if (checkedValue != null) { var valueTriggerItemIds = checkedValue.valueTriggerItemIds; - triggerItemAction(valueTriggerItemIds,"show"); + triggerItemAction(valueTriggerItemIds, "show"); } - }else{ - var newValue = oldElementValue.replace("," + thiz.getRawValue(),''); + } else { + var newValue = oldElementValue.replace("," + thiz.getRawValue(), ''); elementObj.setValue(newValue); - - if(checkedValue != null){ + + if (checkedValue != null) { var valueTriggerItemIds = checkedValue.valueTriggerItemIds; - triggerItemAction(valueTriggerItemIds,"hide"); + triggerItemAction(valueTriggerItemIds, "hide"); } } } - } + } } }] }); } } return { - columnWidth : 1, - xtype : "fieldset", + columnWidth: 1, + xtype: "fieldset", title: name, - cls:(textSize("12px","宋体",name).width > 835)?'fieldset-element':'', + cls: (textSize("12px", "宋体", name).width > 835) ? 'fieldset-element' : '', allowBlank: allowBlank, - id:'hideElement'+id, - layout : 'column', - hidden:hideElement, - autoHeight : true, - items : optionsArray + id: 'hideElement' + id, + layout: 'column', + hidden: hideElement, + autoHeight: true, + items: optionsArray }; } } @@ -361,21 +361,21 @@ * isAdd 是本来就有,还是点添加按钮产生的 * amount 点击添加按钮的次数 */ -function createQualityMonitoringElementSterName(value,isAdd,amount){ +function createQualityMonitoringElementSterName(value, isAdd, amount) { return { - columnWidth : .5, - layout : 'form', - labelWidth : 90, - items : [{ - xtype : 'textfield', - fieldLabel : '炉号', - maxLength : '30', - id : isAdd ? 'configItemOptionSterName'+'_'+amount :'configItemOptionSterName', - name : 'configItemOptionSterName', - allowBlank : true, - disabled : true, - value : value, - anchor : '95%' + columnWidth: .5, + layout: 'form', + labelWidth: 90, + items: [{ + xtype: 'textfield', + fieldLabel: '炉号', + maxLength: '30', + id: isAdd ? 'configItemOptionSterName' + '_' + amount : 'configItemOptionSterName', + name: 'configItemOptionSterName', + allowBlank: true, + disabled: true, + value: value, + anchor: '95%' }] }; } @@ -384,21 +384,21 @@ * @param value * @returns */ -function createQualityMonitoringElementSterFre(value,isAdd,amount){ +function createQualityMonitoringElementSterFre(value, isAdd, amount) { return { - columnWidth : .5, - layout : 'form', - labelWidth : 90, - items : [{ - xtype : 'textfield', - fieldLabel : '炉次', - maxLength : '30', - id : isAdd ? 'configItemOptionSterFre'+'_'+amount :'configItemOptionSterFre', - name : 'configItemOptionSterFre', - allowBlank : true, + columnWidth: .5, + layout: 'form', + labelWidth: 90, + items: [{ + xtype: 'textfield', + fieldLabel: '炉次', + maxLength: '30', + id: isAdd ? 'configItemOptionSterFre' + '_' + amount : 'configItemOptionSterFre', + name: 'configItemOptionSterFre', + allowBlank: true, disabled: true, - value : value, - anchor : '95%' + value: value, + anchor: '95%' }] }; } @@ -407,97 +407,97 @@ * 获取所有选择重新装配的器械包条码(用逗号分隔). * @returns {String} */ -function getScanRepacingTiBarcodes(){ +function getScanRepacingTiBarcodes() { tiBarcodes = ""; var tousseName = top.Ext.getCmp('tousseName').getRawValue(); var isRepacking = top.Ext.getCmp('isRepacking').getValue(); - if(tousseName != null && tousseName != "" && isRepacking == "是"){ + if (tousseName != null && tousseName != "" && isRepacking == "是") { var barcode = top.Ext.getCmp('barcode').getValue(); - tiBarcodes += barcode ; + tiBarcodes += barcode; } var addTousseInstanceAmount = tousseItemCount; - for(var i =1; i <= addTousseInstanceAmount; i++){ - var tousseBarcode = top.Ext.getCmp('tempBarcodeHidden'+i+"_"+1).getValue(); + for (var i = 1; i <= addTousseInstanceAmount; i++) { + var tousseBarcode = top.Ext.getCmp('tempBarcodeHidden' + i + "_" + 1).getValue(); //var tousseBarcode = top.Ext.getCmp('tempBarcode'+i+"_"+1).getValue(); - var tousseName = top.Ext.getCmp('tempBarcode'+i+"_"+3).getValue(); - var tousseAmount = top.Ext.getCmp('tempBarcode'+i+"_"+6).getValue(); - var tousseRePacking = top.Ext.getCmp('tempBarcode'+i+"_"+8).getValue(); - if((tousseName != null && tousseName != "") && (tousseAmount != null && tousseAmount != "") && tousseRePacking == "是"){ - if(tiBarcodes != null && tiBarcodes != ""){ - tiBarcodes += "," + tousseBarcode ; - }else{ - tiBarcodes += tousseBarcode ; + var tousseName = top.Ext.getCmp('tempBarcode' + i + "_" + 3).getValue(); + var tousseAmount = top.Ext.getCmp('tempBarcode' + i + "_" + 6).getValue(); + var tousseRePacking = top.Ext.getCmp('tempBarcode' + i + "_" + 8).getValue(); + if ((tousseName != null && tousseName != "") && (tousseAmount != null && tousseAmount != "") && tousseRePacking == "是") { + if (tiBarcodes != null && tiBarcodes != "") { + tiBarcodes += "," + tousseBarcode; + } else { + tiBarcodes += tousseBarcode; } - + } } return tiBarcodes; } -function submitFormNew2(tousseAndMaterialAll,saveAndCreate){ +function submitFormNew2(tousseAndMaterialAll, saveAndCreate) { //1、启用责任人文本框,如果有灭菌状态 top.Ext.getCmp('responsiblePerson').setDisabled(false); var sterilizationStatus = ''; - if(typeof(sterilizerStatus) != 'undefined' && sterilizerStatus != null && sterilizerStatus != ""){ + if (typeof (sterilizerStatus) != 'undefined' && sterilizerStatus != null && sterilizerStatus != "") { sterilizationStatus = sterilizerStatus; } var washStatus = ''; - if(typeof(washAndDisinfectStatus) != 'undefined' && washAndDisinfectStatus != null && washAndDisinfectStatus != ""){ + if (typeof (washAndDisinfectStatus) != 'undefined' && washAndDisinfectStatus != null && washAndDisinfectStatus != "") { washStatus = washAndDisinfectStatus; } //2、提交 setQmSubmitResult(0); top.Ext.getCmp('addQualityMonitoringForm').form.submit({ - url : WWWROOT + '/disinfectSystem/qualityMonitoringInstanceAction!bathSaveQualityMonitoringInstance.do', - params : { - tousseMaterialInstanceInfo:tousseAndMaterialAll,//器械包和材料信息 - sterilizationStatus:sterilizationStatus, //灭菌状态 - washStatus:washStatus, - qualityMonitoringSterilizationID : qualityMonitoringSterilizationID, //灭菌记录id - qualityMonitoringWRRecordID : qualityMonitoringWRRecordID //清洗记录id - }, - method : 'POST', - waitMsg : '正在保存数据,请稍候', - waitTitle : '提交表单', - success : function(form, action) { + url: WWWROOT + '/disinfectSystem/qualityMonitoringInstanceAction!bathSaveQualityMonitoringInstance.do', + params: { + tousseMaterialInstanceInfo: tousseAndMaterialAll,//器械包和材料信息 + sterilizationStatus: sterilizationStatus, //灭菌状态 + washStatus: washStatus, + qualityMonitoringSterilizationID: qualityMonitoringSterilizationID, //灭菌记录id + qualityMonitoringWRRecordID: qualityMonitoringWRRecordID //清洗记录id + }, + method: 'POST', + waitMsg: '正在保存数据,请稍候', + waitTitle: '提交表单', + success: function (form, action) { var result = top.Ext.decode(action.response.responseText); - if(!result.success){ + if (!result.success) { showResultQM(result.message); } showResultQM(result.message); setQmSubmitResult(1); - if(saveAndCreate){ + if (saveAndCreate) { tempFormDefintionId = top.Ext.getCmp("formDefinitionId").getValue(); tempFormDefinitionName = top.Ext.getCmp("name").getValue(); closeQMWindow(); qualityMonitoringSterilizationID = 0; qualityMonitoringWRRecordID = 0; materialCountRecords = null; materialMsg = null; - if(recycleQM == true){ + if (recycleQM == true) { addQMAgain(); - }else{ - addQualityMonitoring("",tempFormDefintionId,tempFormDefinitionName);/* */ - if(typeof(grid) != 'undefined' && grid != null){ + } else { + addQualityMonitoring("", tempFormDefintionId, tempFormDefinitionName);/* */ + if (typeof (grid) != 'undefined' && grid != null) { grid.getStore().reload(); } } - }else{ + } else { closeQMWindow(); - if(recycleQM == false){ - if(typeof(grid) != 'undefined' && grid != null){ + if (recycleQM == false) { + if (typeof (grid) != 'undefined' && grid != null) { grid.getStore().reload(); } } } }, - failure : function(form, action) { - if(action.response != null && action.response.responseText != null){ + failure: function (form, action) { + if (action.response != null && action.response.responseText != null) { var result = top.Ext.decode(action.response.responseText); showResultQM(result.message); - }else{ + } else { alert('failure = ' + action.failureType); } setQmSubmitResult(-1); @@ -509,31 +509,31 @@ * 设置“qmSubmitResult”的值(1、0或者空=提交前 2、1=提交成功 3、-1=提交失败). * @param value */ -function setQmSubmitResult(value){ - if(!isUndefinedOrNullOrEmpty(top.Ext.getCmp('qmSubmitResult'))){ +function setQmSubmitResult(value) { + if (!isUndefinedOrNullOrEmpty(top.Ext.getCmp('qmSubmitResult'))) { top.Ext.getCmp('qmSubmitResult').setValue(value); } } -function showAllTousseOfSterileCheckBox(show){ - if(!isUndefinedOrNullOrEmpty(qualityMonitoringSterilizationID) && show){ +function showAllTousseOfSterileCheckBox(show) { + if (!isUndefinedOrNullOrEmpty(qualityMonitoringSterilizationID) && show) { top.Ext.getCmp('allTousseOfSterile').setVisible(true); top.Ext.getCmp('allTousseOfSterile').getEl().up('.x-form-item').setDisplayed(true); - }else{ + } else { top.Ext.getCmp('allTousseOfSterile').setVisible(false); top.Ext.getCmp('allTousseOfSterile').getEl().up('.x-form-item').setDisplayed(false); } } -function selectEmptyDo(){ +function selectEmptyDo() { top.Ext.getCmp('scope').setValue("无"); top.Ext.getCmp('optionAmount').setValue(''); top.Ext.getCmp('sterilizationRecordInfo').setVisible(false); top.Ext.getCmp('tousseInfoFieldSet').setVisible(true); hideFirstTousse(); showFirstMaterial(); - top.Ext.getCmp('recycleC').setVisible(false); + top.Ext.getCmp('recycleC').setVisible(false); top.Ext.getCmp('repackingC').setVisible(false); - top.Ext.getCmp('disabledBarcodeC').setVisible(false); + top.Ext.getCmp('disabledBarcodeC').setVisible(false); showAllTousseOfSterileCheckBox(true); top.Ext.getCmp('addBtnAll').setVisible(true); //top.Ext.getCmp('addExtractCheckTousse').setVisible(false); @@ -545,7 +545,7 @@ top.Ext.getCmp('tousseInfoFieldSet').setVisible(false); top.Ext.getCmp("insertBasket").hide(); top.Ext.getCmp("containerNameItem").hide(); - top.Ext.getCmp('containerName').setVisible(false); + top.Ext.getCmp('containerName').setVisible(false); top.Ext.getCmp('containerName').getEl().up('.x-form-item').setDisplayed(false); top.Ext.getCmp('addQualityMonitoringForm').remove('itemsFieldSet'); hideExtractCheckMaterial(); @@ -557,126 +557,126 @@ * @param formId 监测项id * @param configName 监测项名称 */ -function addQualityMonitoringItem(formId,configName){ +function addQualityMonitoringItem(formId, configName) { // 质量监测添加‘无’这个项. - if(configName == '无'){ + if (configName == '无') { selectEmptyDo(); return; } top.Ext.Ajax.request({ - url : WWWROOT + '/disinfectSystem/formDefinitionAction!loadFormDefinition.do', - params : {id : formId}, - success : function(response,options){ + url: WWWROOT + '/disinfectSystem/formDefinitionAction!loadFormDefinition.do', + params: { id: formId }, + success: function (response, options) { var result = top.Ext.decode(response.responseText); - if(result.success){ + if (result.success) { top.Ext.getCmp('scope').setValue(result.data.scope); - if(result.data.scope == '无'){ + if (result.data.scope == '无') { //FSSDERMYY-18:隐藏器械包信息 top.Ext.getCmp('tousseInfoFieldSet').setVisible(false); } top.Ext.getCmp('optionAmount').setValue(''); var baseInfoPanel = top.Ext.getCmp('baseInfoPanel'); - if("是" == result.data.isInsertBasket){ + if ("是" == result.data.isInsertBasket) { top.Ext.getCmp("insertBasket").show(); top.Ext.getCmp("containerNameItem").show(); - - top.Ext.getCmp('containerName').setVisible(true); - top.Ext.getCmp('containerName').getEl().up('.x-form-item').setDisplayed(true); - }else{ + + top.Ext.getCmp('containerName').setVisible(true); + top.Ext.getCmp('containerName').getEl().up('.x-form-item').setDisplayed(true); + } else { top.Ext.getCmp("insertBasket").hide(); top.Ext.getCmp("containerNameItem").hide(); - - top.Ext.getCmp('containerName').setVisible(false); - top.Ext.getCmp('containerName').getEl().up('.x-form-item').setDisplayed(false); + + top.Ext.getCmp('containerName').setVisible(false); + top.Ext.getCmp('containerName').getEl().up('.x-form-item').setDisplayed(false); } top.Ext.getCmp('responsibilityPart').setValue(result.data.responsibilityPart); //东莞中医院DGZYY-161 - if(result.data.responsibilityPart == "回收清点" && result.data.recordRecycleInformation == "是"){//责任环节选择的为回收清点,并且录入回收信为是 + if (result.data.responsibilityPart == "回收清点" && result.data.recordRecycleInformation == "是") {//责任环节选择的为回收清点,并且录入回收信为是 showRecyclingInventoryItem();//显示回收清点对应的 hideCleanAndDisinfectionItem();//隐藏清洗消毒点对应的 hideSterilizationItem();//隐藏灭菌管理对应的 - }else if(result.data.responsibilityPart == "清洗消毒" && result.data.recordRinseInformation == "是"){//责任环节选择的为清洗消毒,监测项的录入清洗信息为是 + } else if (result.data.responsibilityPart == "清洗消毒" && result.data.recordRinseInformation == "是") {//责任环节选择的为清洗消毒,监测项的录入清洗信息为是 showCleanAndDisinfectionItem();//显示清洗消毒对应的 hideRecyclingInventoryItem();//隐藏回收清点对应的 hideSterilizationItem();//隐藏灭菌管理对应的 - }else if(result.data.responsibilityPart == "灭菌管理" && result.data.recordSterilizatioInformation == "是"){//监测项的录入灭菌信息为是,并且责任环节选择的为灭菌管理 + } else if (result.data.responsibilityPart == "灭菌管理" && result.data.recordSterilizatioInformation == "是") {//监测项的录入灭菌信息为是,并且责任环节选择的为灭菌管理 showSterilizationItem(); hideRecyclingInventoryItem();//隐藏回收清点对应的 hideCleanAndDisinfectionItem();//隐藏清洗消毒点对应的 - }else{ + } else { hideRecyclingInventoryItem();//隐藏回收清点对应的 hideCleanAndDisinfectionItem();//隐藏清洗消毒点对应的 hideSterilizationItem();//隐藏灭菌管理对应的 } - + var items = new Array(); // 如果显示炉次炉号,添加表单 - if(result.data.showSterilizerNumFrequency == '是'){ - items.push(createQualityMonitoringElementSterName('',false,"")); - items.push(createQualityMonitoringElementSterFre('',false,"")); + if (result.data.showSterilizerNumFrequency == '是') { + items.push(createQualityMonitoringElementSterName('', false, "")); + items.push(createQualityMonitoringElementSterFre('', false, "")); } - for(var i = 0 ; i< result.data.items.length ; i++){ + for (var i = 0; i < result.data.items.length; i++) { var item = result.data.items[i]; - if(top.Ext.getCmp('optionAmount').getValue() == null || top.Ext.getCmp('optionAmount').getValue() == ''){ + if (top.Ext.getCmp('optionAmount').getValue() == null || top.Ext.getCmp('optionAmount').getValue() == '') { top.Ext.getCmp('optionAmount').setValue(item.id); - }else{ - top.Ext.getCmp('optionAmount').setValue(top.Ext.getCmp('optionAmount').getValue()+';'+item.id); + } else { + top.Ext.getCmp('optionAmount').setValue(top.Ext.getCmp('optionAmount').getValue() + ';' + item.id); } - var allowBlank = result.data.items[i].requirement == '必填'?false:true; - items.push(createQualityMonitoringItemElement(item.type,item.id,item.name,allowBlank,item.optionsJson,null,item.isTriggerItem)); - if(result.data.items[i].type == '多选'){ + var allowBlank = result.data.items[i].requirement == '必填' ? false : true; + items.push(createQualityMonitoringItemElement(item.type, item.id, item.name, allowBlank, item.optionsJson, null, item.isTriggerItem)); + if (result.data.items[i].type == '多选') { items.push({ - columnWidth : 1, - xtype : "label", - html : ' ', - anchor : '95%' + columnWidth: 1, + xtype: "label", + html: ' ', + anchor: '95%' }); } } - + top.Ext.getCmp('addQualityMonitoringForm').remove('itemsFieldSet'); - if(items.length > 0){ + if (items.length > 0) { top.Ext.getCmp('addQualityMonitoringForm').add({ - id : 'itemsFieldSet', - xtype:"fieldset", - labelAlign :'left', - title:"监测项", - layout:'column', - autoHeight:true, - items:items + id: 'itemsFieldSet', + xtype: "fieldset", + labelAlign: 'left', + title: "监测项", + layout: 'column', + autoHeight: true, + items: items }); } top.Ext.getCmp('addQualityMonitoringForm').doLayout(); - if(top.Ext.getCmp('itemsFieldSet')){ + if (top.Ext.getCmp('itemsFieldSet')) { top.Ext.getCmp('itemsFieldSet').doLayout(); } top.Ext.getCmp('material').setValue(""); top.Ext.getCmp('materialAmount').setValue(""); - if(materialItemCount > 0){ - for(var j=0;j<=tousseItemCount;j++){ - for(var i=1;i<=materialItemCount;i++){ - if(top.Ext.getCmp('material'+j+'_'+i)){ - top.Ext.getCmp('material'+j+'_'+i).setValue(""); + if (materialItemCount > 0) { + for (var j = 0; j <= tousseItemCount; j++) { + for (var i = 1; i <= materialItemCount; i++) { + if (top.Ext.getCmp('material' + j + '_' + i)) { + top.Ext.getCmp('material' + j + '_' + i).setValue(""); } - top.Ext.getCmp('materialAmount'+i).setValue(""); + top.Ext.getCmp('materialAmount' + i).setValue(""); } - if(top.Ext.getCmp('tempBarcode'+j+'_3')){ - top.Ext.getCmp('tempBarcode'+j+'_3').setValue(""); - top.Ext.getCmp('tousseDefinitionId'+j).setValue(''); + if (top.Ext.getCmp('tempBarcode' + j + '_3')) { + top.Ext.getCmp('tempBarcode' + j + '_3').setValue(""); + top.Ext.getCmp('tousseDefinitionId' + j).setValue(''); } } } top.Ext.getCmp('tousseDefinitionId').setValue(''); - if(materialDefinitionStore){ + if (materialDefinitionStore) { materialDefinitionStore.reload(); } //top.Ext.getCmp('inspectType').setValue(result.data.scope); - top.Ext.getCmp('disabledBarcodeC').setVisible(false); + top.Ext.getCmp('disabledBarcodeC').setVisible(false); top.Ext.getCmp('disabledBarcode').disable(); - top.Ext.getCmp('isDiscard').setValue(''); - - if(result.data.scope == "器械包"){ + top.Ext.getCmp('isDiscard').setValue(''); + + if (result.data.scope == "器械包") { top.Ext.getCmp('sterilizationRecordInfo').setVisible(false); top.Ext.getCmp('tousseInfoFieldSet').setVisible(true); // 隐藏第一个材料和添加的材料信息 @@ -687,12 +687,12 @@ hideMaterialOrTousseOrTousseMaterial(); // 显示器械包输入框 showFirstTousse(); - if((qualityMonitoringWRRecordID > 0 && (sstsConfig.hasOwnProperty('haveRinserPosition')) && sstsConfig.haveRinserPosition)){ + if ((qualityMonitoringWRRecordID > 0 && (sstsConfig.hasOwnProperty('haveRinserPosition')) && sstsConfig.haveRinserPosition)) { hideBasketBarcodeAndPosition(); } - top.Ext.getCmp('recycleC').setVisible(true); + top.Ext.getCmp('recycleC').setVisible(true); top.Ext.getCmp('repackingC').setVisible(true); - top.Ext.getCmp('disabledBarcodeC').setVisible(true); + top.Ext.getCmp('disabledBarcodeC').setVisible(true); showAllTousseOfSterileCheckBox(true); top.Ext.getCmp('addBtnAll').setVisible(true); //top.Ext.getCmp('addExtractCheckTousse').setVisible(true); @@ -702,20 +702,20 @@ //隐藏监测项 hideInspectItem(); resetRecycleAndRepackingValue(); - }else if(result.data.scope == "材料"){ + } else if (result.data.scope == "材料") { top.Ext.getCmp('sterilizationRecordInfo').setVisible(false); top.Ext.getCmp('tousseInfoFieldSet').setVisible(true); hideFirstTousse(); //hideMaterialOrTousseOrTousseMaterial(); hideExtractCheckTousse();//要 showFirstMaterial(); - hideMaterialOrTousseOrTousseMaterial(); + hideMaterialOrTousseOrTousseMaterial(); top.Ext.getCmp('recycleC').setVisible(false); top.Ext.getCmp('repackingC').setVisible(false); - top.Ext.getCmp('disabledBarcodeC').setVisible(false); + top.Ext.getCmp('disabledBarcodeC').setVisible(false); showAllTousseOfSterileCheckBox(false); - -// top.Ext.getCmp('material').getEl().up('.x-form-item').setDisplayed(true); + + // top.Ext.getCmp('material').getEl().up('.x-form-item').setDisplayed(true); //showExtractCheckMaterial(); top.Ext.getCmp('addBtnAll').setVisible(true); //top.Ext.getCmp('addExtractCheckTousse').setVisible(false); @@ -725,12 +725,12 @@ //隐藏监测项 hideInspectItem(); //当前选择的监测项的监测范围是“器械包”,如果重新选择的监测项的监测范围是“材料”,之前已输入的抽检器械包名称不用显示; - if(result.data.scope == "器械包"){ + if (result.data.scope == "器械包") { //隐藏器械包信息块包 hideExtractCheckTousseWrapper(); hideMaterialOrTousseOrTousseMaterial(); } - }else if(result.data.scope == "灭菌炉记录"){ + } else if (result.data.scope == "灭菌炉记录") { top.Ext.getCmp('sterilizationRecordInfo').setVisible(true); // 如果监测范围为灭菌炉记录,隐藏器械包信息 top.Ext.getCmp('tousseInfoFieldSet').setVisible(false); @@ -748,7 +748,7 @@ //隐藏监测项 hideInspectItem(); resetRecycleAndRepackingValue(); - }else if(result.data.scope == "材料和器械包"){ + } else if (result.data.scope == "材料和器械包") { top.Ext.getCmp('sterilizationRecordInfo').setVisible(false); top.Ext.getCmp('tousseInfoFieldSet').setVisible(true); //showExtractCheckTousseAndMaterialWrapper(); @@ -759,13 +759,13 @@ hideExtractCheckMaterialWrapper(); hideExtractCheckTousse();//要 hideExtractCheckTousseWrapper(); - if((qualityMonitoringWRRecordID > 0 && (sstsConfig.hasOwnProperty('haveRinserPosition')) && sstsConfig.haveRinserPosition)){ + if ((qualityMonitoringWRRecordID > 0 && (sstsConfig.hasOwnProperty('haveRinserPosition')) && sstsConfig.haveRinserPosition)) { showBasketBarcodeAndPosition(); - } -// top.Ext.getCmp('material').getEl().up('.x-form-item').setDisplayed(true); - top.Ext.getCmp('recycleC').setVisible(true); + } + // top.Ext.getCmp('material').getEl().up('.x-form-item').setDisplayed(true); + top.Ext.getCmp('recycleC').setVisible(true); top.Ext.getCmp('repackingC').setVisible(true); - top.Ext.getCmp('disabledBarcodeC').setVisible(true); + top.Ext.getCmp('disabledBarcodeC').setVisible(true); showAllTousseOfSterileCheckBox(true); top.Ext.getCmp('addBtnAll').setVisible(true); //top.Ext.getCmp('addExtractCheckTousse').setVisible(true); @@ -776,15 +776,15 @@ //隐藏监测项 hideInspectItem(); resetRecycleAndRepackingValue(); - }else if(result.data.scope == "无"){ + } else if (result.data.scope == "无") { top.Ext.getCmp('sterilizationRecordInfo').setVisible(false); top.Ext.getCmp('tousseInfoFieldSet').setVisible(true); hideFirstTousse(); showFirstMaterial(); -// top.Ext.getCmp('material').getEl().up('.x-form-item').setDisplayed(true); - top.Ext.getCmp('recycleC').setVisible(false); + // top.Ext.getCmp('material').getEl().up('.x-form-item').setDisplayed(true); + top.Ext.getCmp('recycleC').setVisible(false); top.Ext.getCmp('repackingC').setVisible(false); - top.Ext.getCmp('disabledBarcodeC').setVisible(false); + top.Ext.getCmp('disabledBarcodeC').setVisible(false); showAllTousseOfSterileCheckBox(true); top.Ext.getCmp('addBtnAll').setVisible(true); //top.Ext.getCmp('addExtractCheckTousse').setVisible(false); @@ -797,61 +797,61 @@ // 新建质量监测单,数量默认为1 var tAmount = top.Ext.getCmp('tousseAmount').getValue(); var mAmount = top.Ext.getCmp('materialAmount').getValue(); - if(isUndefinedOrNullOrEmpty(tAmount) || tAmount <= 0){ + if (isUndefinedOrNullOrEmpty(tAmount) || tAmount <= 0) { // 没有值,设置默认值为1 top.Ext.getCmp('tousseAmount').setValue(1); } - if(isUndefinedOrNullOrEmpty(mAmount) || mAmount <= 0){ + if (isUndefinedOrNullOrEmpty(mAmount) || mAmount <= 0) { // 没有值,设置默认值为1 top.Ext.getCmp('materialAmount').setValue(1); } top.Ext.getCmp('handleDepart').setValue(result.data.handleDepart); tousseItemCount = 0; } }, - failure : function(response, options) { + failure: function (response, options) { showResultQM('系统加载出错,请稍候再试'); } }); } // 装配页面进来,添加材料和数量 -function addMaterialAndAmount(){ - if(materialCountRecords != null && materialCountRecords != 'undefined' && materialCountRecords.length > 0){ +function addMaterialAndAmount() { + if (materialCountRecords != null && materialCountRecords != 'undefined' && materialCountRecords.length > 0) { var maerialName = top.Ext.getCmp('material').getValue(); - if( !isUndefinedOrNullOrEmpty(maerialName) ){ + if (!isUndefinedOrNullOrEmpty(maerialName)) { // 如果已经打开了,再选择其他的监测项,不再添加材料数据 - return ; + return; } - - for(var i = 0 ; i < materialCountRecords.length ; i++){ + + for (var i = 0; i < materialCountRecords.length; i++) { var materialName = materialCountRecords[i].data["name"]; - if( i == 0 ){ + if (i == 0) { // 第一条记录 top.Ext.getCmp('material').setValue(materialName); - }else{ - addExtractCheckMaterial(false,materialName,1,"","","","","","","","",""); + } else { + addExtractCheckMaterial(false, materialName, 1, "", "", "", "", "", "", "", "", ""); } } } } //回收页面进来,添加材料和数量 -function addMaterialMsg(){ - if(materialMsg != null && materialMsg != 'undefined' && materialMsg.length > 0){ +function addMaterialMsg() { + if (materialMsg != null && materialMsg != 'undefined' && materialMsg.length > 0) { var maerialName = top.Ext.getCmp('material').getValue(); - if( !isUndefinedOrNullOrEmpty(maerialName) ){ + if (!isUndefinedOrNullOrEmpty(maerialName)) { // 如果已经打开了,再选择其他的监测项,不再添加材料数据 - return ; + return; } - for(var i = 0 ; i < materialMsg.length ; i++){ + for (var i = 0; i < materialMsg.length; i++) { var materialName = materialMsg[i].materialName; var count = materialMsg[i].amount; - if( i == 0 ){ + if (i == 0) { // 第一条记录 top.Ext.getCmp('material').setValue(materialName); top.Ext.getCmp('materialAmount').setValue(count); - }else{ - addExtractCheckMaterial(false,materialName,count,"","","","","","","","",""); + } else { + addExtractCheckMaterial(false, materialName, count, "", "", "", "", "", "", "", "", ""); } } } @@ -861,9 +861,9 @@ * 判断是否整炉. * @returns {Boolean} */ -function allTousseOfSterileChecked(){ +function allTousseOfSterileChecked() { var isAll = top.Ext.getCmp('isAllTousseOfSterile').getValue(); //是否整炉 - if(isAll == '是'){ + if (isAll == '是') { return true; } return false; @@ -872,19 +872,19 @@ /** * 控制“重新回收”和“重新装配”的复选框的是否可用. */ -function updateControlStatus(){ - if(allTousseOfSterileChecked()){ +function updateControlStatus() { + if (allTousseOfSterileChecked()) { enableRecycleAndRepacking(); - }else{ + } else { var tousseType = top.Ext.getCmp('tousseType').getValue(); var tousseInstanceId = top.Ext.getCmp('tousseInstanceId').getValue(); var toussedefRecycling = top.Ext.getCmp('tousseDefRecycling').getValue(); - + if (isUndefinedOrNullOrEmpty(tousseInstanceId)) { disableRecycleAndRepacking(); - } else if (tousseType==PACKAGE_TYPE_FOREIGN - || tousseType==PACKAGE_TYPE_SPLIT - || tousseType == '敷料包' || toussedefRecycling == '否') { + } else if (tousseType == PACKAGE_TYPE_FOREIGN + || tousseType == PACKAGE_TYPE_SPLIT + || tousseType == '敷料包' || toussedefRecycling == '否') { disableRecycleCanRepacking(); } else { enableRecycleAndRepacking(); @@ -895,26 +895,26 @@ /* *ZJJSRM-30勾选是否整炉后,器械包条码和器械包名称设置为禁止输入状态 */ -function updateDisaplay(isCheck){ - if(isCheck){ +function updateDisaplay(isCheck) { + if (isCheck) { top.Ext.getCmp('tempBarcode').disable(); top.Ext.getCmp('tousseName').disable(); top.Ext.getCmp('addExtractCheckTousseBtnC').setVisible(false); disabledExtractCheckTousse(); - if(!isUndefinedOrNullOrEmpty(qualityMonitoringSterilizationID) && parseInt(qualityMonitoringSterilizationID) !== 0){ + if (!isUndefinedOrNullOrEmpty(qualityMonitoringSterilizationID) && parseInt(qualityMonitoringSterilizationID) !== 0) { top.Ext.Ajax.request({ - url : WWWROOT + '/disinfectSystem/qualityMonitoringInstanceAction!getGoodsAmountBySterilizationRecord.do', - params : {sterilizationRecordId : qualityMonitoringSterilizationID}, - success : function(response,options){ + url: WWWROOT + '/disinfectSystem/qualityMonitoringInstanceAction!getGoodsAmountBySterilizationRecord.do', + params: { sterilizationRecordId: qualityMonitoringSterilizationID }, + success: function (response, options) { var result = top.Ext.decode(response.responseText); - if(result.success){ + if (result.success) { top.Ext.getCmp('tousseAmount').setValue(result.data.goodsAmount || 0); top.Ext.getCmp('tousseName').setValue(result.data.tousseName); } } }) } - }else { + } else { top.Ext.getCmp('tempBarcode').enable(); top.Ext.getCmp('tousseName').enable(); top.Ext.getCmp('addExtractCheckTousseBtnC').setVisible(true); @@ -925,7 +925,7 @@ /** * 将“重新回收”和“重新装配”及“是否整炉”设置为未选中状态. */ -function resetRecycleAndRepackingValue(){ +function resetRecycleAndRepackingValue() { top.Ext.getCmp('isRecycle').setValue(''); top.Ext.getCmp('isRepacking').setValue(''); top.Ext.getCmp('isDiscard').setValue(''); @@ -939,7 +939,7 @@ /** * 禁用“重新回收”和“重新装配”的复选框. */ -function disableRecycleAndRepacking(){ +function disableRecycleAndRepacking() { top.Ext.getCmp('isRecycle').setValue(''); top.Ext.getCmp('isRepacking').setValue(''); top.Ext.getCmp('isDiscard').setValue(''); @@ -954,36 +954,36 @@ /** * 不能重新回收,可以重新装配. */ -function disableRecycleCanRepacking(){ +function disableRecycleCanRepacking() { top.Ext.getCmp('isRecycle').setValue(''); top.Ext.getCmp('isRepacking').setValue(''); top.Ext.getCmp('recycle').disable(); - top.Ext.getCmp('repacking').enable(); + top.Ext.getCmp('repacking').enable(); top.Ext.getCmp('recycle').setValue(false); top.Ext.getCmp('repacking').setValue(false); } /** * 启用“重新回收”和“重新装配”的复选框. */ -function enableRecycleAndRepacking(){ +function enableRecycleAndRepacking() { top.Ext.getCmp('recycle').enable(); top.Ext.getCmp('repacking').enable(); } //SZSDSRMYY-76:获取条码的备注 -function getBarcodeRemark(result){ - if(result.remark !== ''){ - var remark = '【' + result.tousseName + '('+ result.barcode +'):' + result.remark + '】'; +function getBarcodeRemark(result) { + if (result.remark !== '') { + var remark = '【' + result.tousseName + '(' + result.barcode + '):' + result.remark + '】'; var oldRemark = top.Ext.getCmp('remark').getValue(); - if(oldRemark == ''){ + if (oldRemark == '') { var resultRemark = '装配备注:' + remark; top.Ext.getCmp('remark').setValue(resultRemark); - }else { - if(oldRemark.indexOf('装配备注:') == -1){ + } else { + if (oldRemark.indexOf('装配备注:') == -1) { var resultRemark = '装配备注:' + remark; top.Ext.getCmp('remark').setValue(oldRemark + resultRemark); - }else { + } else { top.Ext.getCmp('remark').setValue(oldRemark + remark); } } @@ -996,121 +996,121 @@ * @param qmDefinitionId 监测项定义id * @param materialDefinitionStore 抽检器械的store */ -function getTousseInstanceNameAndResponsiblePerson(tempBarcode, qmDefinitionId, materialDefinitionStore,isScan){ - if(tempBarcode){ +function getTousseInstanceNameAndResponsiblePerson(tempBarcode, qmDefinitionId, materialDefinitionStore, isScan) { + if (tempBarcode) { top.Ext.Ajax.request({ - url : WWWROOT + '/disinfectSystem/qualityMonitoringDefinitionAction!getTousseInstanceNameAndResponsiblePerson.do', - params : {barcode : tempBarcode,qmDefinitionId : qmDefinitionId}, - success : function(response,options){ + url: WWWROOT + '/disinfectSystem/qualityMonitoringDefinitionAction!getTousseInstanceNameAndResponsiblePerson.do', + params: { barcode: tempBarcode, qmDefinitionId: qmDefinitionId }, + success: function (response, options) { var result = top.Ext.decode(response.responseText); - if(result.success){ + if (result.success) { //1、设置“器械包名称”、“器械包实例条码”、“器械包实例id”、“器械包类型”、“是否需要回收”、“责任人” - if(tempBarcode != null && tempBarcode != ''){ - if(isScan == true){ - var isScanned = tousseBarcodeIsScanned(tousseAndMaterialWrapperCount,tempBarcode); - if(isScanned){ + if (tempBarcode != null && tempBarcode != '') { + if (isScan == true) { + var isScanned = tousseBarcodeIsScanned(tousseAndMaterialWrapperCount, tempBarcode); + if (isScanned) { //field.setValue(""); return; } } top.Ext.getCmp('tousseName').setValue(result.tousseName + "(" + tempBarcode + ")"); - }else{ + } else { top.Ext.getCmp('tousseName').setValue(result.tousseName); } top.Ext.getCmp('barcode').setValue(tempBarcode); top.Ext.getCmp('tousseInstanceId').setValue(result.tousseInstanceId); top.Ext.getCmp('tousseType').setValue(result.tousseType); top.Ext.getCmp('tousseDefRecycling').setValue(result.isRecycle); - if((result.responsiblePerson || '') !== ''){ + if ((result.responsiblePerson || '') !== '') { top.Ext.getCmp('responsiblePerson').setValue(result.responsiblePerson); } - + //2、如果有炉号炉次,则需要设值 - if(!isUndefinedOrNullOrEmpty(top.Ext.getCmp('configItemOptionSterName'))){ + if (!isUndefinedOrNullOrEmpty(top.Ext.getCmp('configItemOptionSterName'))) { top.Ext.getCmp('configItemOptionSterName').setValue(result.sterilizerName); top.Ext.getCmp('configItemOptionSterFre').setValue(result.sterileFrequency); } - - + + //3、设值包定义id,并且材料要与此包定义关联 - if(result.tousseDefinitionId){ + if (result.tousseDefinitionId) { top.Ext.getCmp('tousseDefinitionId').setValue(result.tousseDefinitionId); - if(materialDefinitionStore){ + if (materialDefinitionStore) { materialDefinitionStore.reload(); } - }else if(materialDefinitionStore){ + } else if (materialDefinitionStore) { top.Ext.getCmp('tousseDefinitionId').setValue(''); } - if(isScan){ + if (isScan) { getBarcodeRemark(result); } - + //4、控制“重新回收”和“重新装配”的复选框的是否可用. updateControlStatus(); top.Ext.getCmp('disabledBarcode').enable(); top.Ext.getCmp('disabledBarcode').setValue(false); top.Ext.getCmp('isDiscard').setValue(''); - }else{ - if(result.message){ + } else { + if (result.message) { showResultQM(result.message); - }else{ + } else { showResultQM("找不到该条码所对应的器械包实例"); } } }, - failure : function(response, options) { + failure: function (response, options) { var result = top.Ext.decode(response.responseText); - if(result.message){ + if (result.message) { showResultQM(result.message); - }else{ + } else { showResultQM('系统加载出错,请稍候再试'); } } }); } } -function getPostionByBasketBarcode(tempBarcode,positionId){ - if(tempBarcode){ +function getPostionByBasketBarcode(tempBarcode, positionId) { + if (tempBarcode) { top.Ext.Ajax.request({ - url : WWWROOT + '/disinfectSystem/qualityMonitoringDefinitionAction!getPostionMsg.do', - params : {barcode : tempBarcode,qualityMonitoringWRRecordID : qualityMonitoringWRRecordID}, - success : function(response,options){ + url: WWWROOT + '/disinfectSystem/qualityMonitoringDefinitionAction!getPostionMsg.do', + params: { barcode: tempBarcode, qualityMonitoringWRRecordID: qualityMonitoringWRRecordID }, + success: function (response, options) { var result = top.Ext.decode(response.responseText); - if(result.success){ - if(result.positionMsg){ + if (result.success) { + if (result.positionMsg) { top.Ext.getCmp(positionId).setValue(result.positionMsg); } - }else{ - if(result.message){ + } else { + if (result.message) { showResultQM(result.message); - }else{ + } else { showResultQM("找不到该条码所对应的篮筐实例"); } } }, - failure : function(response, options) { + failure: function (response, options) { var result = top.Ext.decode(response.responseText); - if(result == null || result.message == null){ + if (result == null || result.message == null) { showResultQM('系统加载出错,请稍候再试'); - }else{ + } else { showResultQM(result.message); } } }); } } -function getShowBtn(addExtractClick,btnShowOrHide){ - if(addExtractClick == true || btnShowOrHide == true){ +function getShowBtn(addExtractClick, btnShowOrHide) { + if (addExtractClick == true || btnShowOrHide == true) { return true; - }else{ + } else { return false; } } -function addMaterialItems(id,showBtn,items,items5,items1,items2,items3,items4){ +function addMaterialItems(id, showBtn, items, items5, items1, items2, items3, items4) { top.Ext.getCmp(id).add(items); - if(showBtn){ + if (showBtn) { top.Ext.getCmp(id).add(items5); } top.Ext.getCmp(id).add(items1); @@ -1129,380 +1129,380 @@ amountChild 当前在信息块里面是第几个 isLoad 是否是加载 */ -function addExtractCheckMaterial(isOpenRecord,mateialName,count,basketPosition,orderNumber,isWrapper,isTousseAndMaterial,amount,tosseAndMaterialId,btnShowOrHide,amountChild,isLoad,tousseItemCount,tousseDefinitionId){ +function addExtractCheckMaterial(isOpenRecord, mateialName, count, basketPosition, orderNumber, isWrapper, isTousseAndMaterial, amount, tosseAndMaterialId, btnShowOrHide, amountChild, isLoad, tousseItemCount, tousseDefinitionId) { materialItemCount++; var tousseAndMaterial = top.Ext.getCmp('tosseAndMaterial'); var mCount = 1; - if(count != null && count != 'undefined'){ + if (count != null && count != 'undefined') { mCount = count; } - + var rememberNum = tousseAndMaterialWrapperCount;//记住当前在哪一个器械包信息块 var rememberChildCurNum = materialItemCount; //记住当前在信息块里面是第几个 - + var items = new Array(); var items1 = new Array(); var items2 = new Array(); var items3 = new Array(); var items5 = new Array(); materialDefinitionAddStore = new top.Ext.data.Store({ - proxy : new top.Ext.data.HttpProxy({ - url : WWWROOT + '/disinfectSystem/baseData/materialDefinitionAction!getMaterialDefinitionDataIncludeForeignMD.do?selectType=material', - method : 'POST' + proxy: new top.Ext.data.HttpProxy({ + url: WWWROOT + '/disinfectSystem/baseData/materialDefinitionAction!getMaterialDefinitionDataIncludeForeignMD.do?selectType=material', + method: 'POST' }), - reader : new top.Ext.data.JsonReader({ - totalProperty : 'totalCount', - root : 'data' + reader: new top.Ext.data.JsonReader({ + totalProperty: 'totalCount', + root: 'data' }, [ - {name : 'id',mapping : 'id'}, - {name : 'spelling',mapping : 'spelling'}, - {name : 'name',mapping : 'name'}, - {name : 'count',mapping : 'count'} + { name: 'id', mapping: 'id' }, + { name: 'spelling', mapping: 'spelling' }, + { name: 'name', mapping: 'name' }, + { name: 'count', mapping: 'count' } ]), - listeners : { - beforeload : function(thiz, options){ - if(tousseDefinitionId){ + listeners: { + beforeload: function (thiz, options) { + if (tousseDefinitionId) { thiz.baseParams['tousseDefinitionId'] = tousseDefinitionId; - }else { - if(tousseItemCount == 0){ - thiz.baseParams['tousseDefinitionId'] = top.Ext.getCmp('tousseDefinitionId').getValue(); - }else if(tousseItemCount !== undefined){ - thiz.baseParams['tousseDefinitionId'] = top.Ext.getCmp('tousseDefinitionId'+tousseItemCount).getValue(); + } else { + if (tousseItemCount == 0) { + thiz.baseParams['tousseDefinitionId'] = top.Ext.getCmp('tousseDefinitionId').getValue(); + } else if (tousseItemCount !== undefined) { + thiz.baseParams['tousseDefinitionId'] = top.Ext.getCmp('tousseDefinitionId' + tousseItemCount).getValue(); } } - } + } } }); items = { - layout : 'form', - id : 'materialC'+materialItemCount, - columnWidth : .36, - labelWidth : 90, - height:setH, - items : [{ - xtype : 'combo', - id : 'material'+tousseItemCount+'_'+materialItemCount, - name : 'material'+tousseItemCount+'_'+materialItemCount, - fieldLabel : '抽检器械', - queryParam : 'spell', - minChars : 0, - valueField : 'id', - displayField : 'name', - store : materialDefinitionAddStore, - value : mateialName, - forceSelection : true, - lazyInit : true, - triggerAction : 'all', - hideTrigger : true, - typeAhead : false, - anchor : '95%', - listeners : { - select : function(combo, record, index) { - combo.setValue(record.data.name); - } + layout: 'form', + id: 'materialC' + materialItemCount, + columnWidth: .36, + labelWidth: 90, + height: setH, + items: [{ + xtype: 'combo', + id: 'material' + tousseItemCount + '_' + materialItemCount, + name: 'material' + tousseItemCount + '_' + materialItemCount, + fieldLabel: '抽检器械', + queryParam: 'spell', + minChars: 0, + valueField: 'id', + displayField: 'name', + store: materialDefinitionAddStore, + value: mateialName, + forceSelection: true, + lazyInit: true, + triggerAction: 'all', + hideTrigger: true, + typeAhead: false, + anchor: '95%', + listeners: { + select: function (combo, record, index) { + combo.setValue(record.data.name); } - }] - }; - - if(addExtractClick == true || btnShowOrHide == true){ + } + }] + }; + + if (addExtractClick == true || btnShowOrHide == true) { items5 = { - layout : 'form', - columnWidth:.04, - labelWidth : 90, - height:setH, - id:"addExtractCheckMaterialBtnC"+materialItemCount,//materialItemCount这里必须取这个,不然id会重复 - items : [{ - xtype:'button', - tooltip : '添加抽检器械', - iconCls : 'btn_ext_add', - handler : function(){ + layout: 'form', + columnWidth: .04, + labelWidth: 90, + height: setH, + id: "addExtractCheckMaterialBtnC" + materialItemCount,//materialItemCount这里必须取这个,不然id会重复 + items: [{ + xtype: 'button', + tooltip: '添加抽检器械', + iconCls: 'btn_ext_add', + handler: function () { widthSet = true; var amountClick = rememberNum; var rememberChildCurNum2 = rememberChildCurNum; var isTousseAndMaterialVal = ""; - if(isTousseAndMaterial){ + if (isTousseAndMaterial) { isTousseAndMaterialVal = true; } - addExtractCheckMaterial("","",1,"","",true,isTousseAndMaterialVal,amountClick,"","",rememberChildCurNum2,"",tousseItemCount); + addExtractCheckMaterial("", "", 1, "", "", true, isTousseAndMaterialVal, amountClick, "", "", rememberChildCurNum2, "", tousseItemCount); widthSet = false; } }] }; } - + var columnW = 0.32; var labelW = 91; var positionlabelW = 123; - if(widthSet == true){ + if (widthSet == true) { columnW = 0.36; - if(recycleQM == true){ + if (recycleQM == true) { labelW = 129; - }else{ + } else { labelW = 124; } - - }else if(isLoad == true){ + + } else if (isLoad == true) { positionlabelW = 92; } - + items1 = { - layout : 'form', - id : 'materialAmountC'+materialItemCount, - columnWidth :columnW, - labelWidth : labelW, - height:setH, - items : [{ - xtype : 'numberfield', - allowDecimals : false, - name : 'materialAmount'+materialItemCount, - id : 'materialAmount'+materialItemCount, - fieldLabel : "器械数量", - value : mCount, - allowBlank : true, - blankText : '数量不能为空', - anchor : '95%' - }] - }; + layout: 'form', + id: 'materialAmountC' + materialItemCount, + columnWidth: columnW, + labelWidth: labelW, + height: setH, + items: [{ + xtype: 'numberfield', + allowDecimals: false, + name: 'materialAmount' + materialItemCount, + id: 'materialAmount' + materialItemCount, + fieldLabel: "器械数量", + value: mCount, + allowBlank: true, + blankText: '数量不能为空', + anchor: '95%' + }] + }; items2 = { - layout : 'form', - hidden : !(qualityMonitoringWRRecordID > 0 && (sstsConfig.hasOwnProperty('haveRinserPosition')) && sstsConfig.haveRinserPosition), - id : 'basketBarcodeC'+materialItemCount, - columnWidth : .36, - labelWidth : 90, - height:setH, - items : [{ - xtype : 'textfield', - name : 'basketBarcode'+materialItemCount, - id : 'basketBarcode'+materialItemCount, - fieldLabel : "篮筐条码", - anchor : '95%', - listeners : { - specialkey : function(field,e){ - if(e.getKey() == 13){ - var idName = field.getId().replace("basketBarcode","position"); - getPostionByBasketBarcode(field.getValue(),idName); - field.setValue(''); - } + layout: 'form', + hidden: !(qualityMonitoringWRRecordID > 0 && (sstsConfig.hasOwnProperty('haveRinserPosition')) && sstsConfig.haveRinserPosition), + id: 'basketBarcodeC' + materialItemCount, + columnWidth: .36, + labelWidth: 90, + height: setH, + items: [{ + xtype: 'textfield', + name: 'basketBarcode' + materialItemCount, + id: 'basketBarcode' + materialItemCount, + fieldLabel: "篮筐条码", + anchor: '95%', + listeners: { + specialkey: function (field, e) { + if (e.getKey() == 13) { + var idName = field.getId().replace("basketBarcode", "position"); + getPostionByBasketBarcode(field.getValue(), idName); + field.setValue(''); } } - }] - }; - + } + }] + }; + items3 = { - layout : 'form', - hidden : !(qualityMonitoringWRRecordID > 0 && (sstsConfig.hasOwnProperty('haveRinserPosition')) && sstsConfig.haveRinserPosition), - id : 'positionC'+materialItemCount, - columnWidth : .36, - labelWidth : positionlabelW, - height:setH, - items : [{ - xtype : 'textfield', - name : 'position'+materialItemCount, - id : 'position'+materialItemCount, - editable : false, - fieldLabel : "位置", - anchor : '95%' - }] - }; + layout: 'form', + hidden: !(qualityMonitoringWRRecordID > 0 && (sstsConfig.hasOwnProperty('haveRinserPosition')) && sstsConfig.haveRinserPosition), + id: 'positionC' + materialItemCount, + columnWidth: .36, + labelWidth: positionlabelW, + height: setH, + items: [{ + xtype: 'textfield', + name: 'position' + materialItemCount, + id: 'position' + materialItemCount, + editable: false, + fieldLabel: "位置", + anchor: '95%' + }] + }; var items4 = new Array(); items4 = { - xtype : 'hidden', - name : 'materialOrder'+materialItemCount, - id : 'materialOrder'+materialItemCount + xtype: 'hidden', + name: 'materialOrder' + materialItemCount, + id: 'materialOrder' + materialItemCount }; - if(isWrapper){//整块 + if (isWrapper) {//整块 var setLayoutVal; var setLayoutList; var tosseAndMaterialVal; - if(isTousseAndMaterial){//器械包和材料 - if(amount){//里面点击器械包条码添加的器械包和材料 - if(tousseAndMaterialWrapperCount > 0){ - for(var i=1;i 0) { + for (var i = 1; i < tousseAndMaterialWrapperCount + 1; i++) { + if (amount == i) {//找到对应的器械包信息块添加 + if (amountChild) { + for (var j = 1; j < materialItemCount + 1; j++) { + if (amountChild == j) { + var showBtn = getShowBtn(addExtractClick, btnShowOrHide); + addMaterialItems('tosseAndMaterialList' + j + '_TMP', showBtn, items, items5, items1, items2, items3, items4); + top.Ext.getCmp('tosseAndMaterialList' + j + '_TMP').doLayout(); top.Ext.getCmp('addQualityMonitoringForm').doLayout(); } } - }else{ + } else { var tosseAndMaterialList = { - layout : 'column', - columnWidth : 1, - labelWidth : 90, - id: 'tosseAndMaterialList'+materialItemCount+'_TMP' + layout: 'column', + columnWidth: 1, + labelWidth: 90, + id: 'tosseAndMaterialList' + materialItemCount + '_TMP' }; - - top.Ext.getCmp('tosseAndMaterial'+i+'_TMP').add(tosseAndMaterialList); - var showBtn = getShowBtn(addExtractClick,btnShowOrHide); - addMaterialItems('tosseAndMaterialList'+materialItemCount+'_TMP',showBtn,items,items5,items1,items2,items3,items4); + + top.Ext.getCmp('tosseAndMaterial' + i + '_TMP').add(tosseAndMaterialList); + var showBtn = getShowBtn(addExtractClick, btnShowOrHide); + addMaterialItems('tosseAndMaterialList' + materialItemCount + '_TMP', showBtn, items, items5, items1, items2, items3, items4); } } - + } } - - }else{//外面整块 - if(!addExtractClick){ - top.Ext.getCmp('tosseAndMaterialList'+amountChild+'_TMP').add(items); - top.Ext.getCmp('tosseAndMaterialList'+amountChild+'_TMP').add(items1); - }else{ + + } else {//外面整块 + if (!addExtractClick) { + top.Ext.getCmp('tosseAndMaterialList' + amountChild + '_TMP').add(items); + top.Ext.getCmp('tosseAndMaterialList' + amountChild + '_TMP').add(items1); + } else { var tosseAndMaterialList = { - layout : 'column', - columnWidth : 1, - labelWidth : 90, - id: 'tosseAndMaterialList'+materialItemCount+'_TMP' + layout: 'column', + columnWidth: 1, + labelWidth: 90, + id: 'tosseAndMaterialList' + materialItemCount + '_TMP' }; - + top.Ext.getCmp(tosseAndMaterialId).add(tosseAndMaterialList); - var showBtn = getShowBtn(addExtractClick,btnShowOrHide); - addMaterialItems('tosseAndMaterialList'+materialItemCount+'_TMP',showBtn,items,items5,items1,items2,items3,items4); - } + var showBtn = getShowBtn(addExtractClick, btnShowOrHide); + addMaterialItems('tosseAndMaterialList' + materialItemCount + '_TMP', showBtn, items, items5, items1, items2, items3, items4); + } } - - }else{//材料 - if(amount){ - if(tousseAndMaterialWrapperCount > 0){ - for(var i=1;i 0) { + for (var i = 1; i < tousseAndMaterialWrapperCount + 1; i++) { + if (amount == i) {//找到对应的器械包信息块添加 + var showBtn = getShowBtn(addExtractClick, btnShowOrHide); + addMaterialItems('tosseAndMaterial' + i + '_MP', showBtn, items, items5, items1, items2, items3, items4); + top.Ext.getCmp('addQualityMonitoringForm').doLayout(); } - + } } - - }else{ + + } else { top.Ext.getCmp('addQualityMonitoringForm').add({ - id :'tousseInfoFieldSet'+tousseAndMaterialWrapperCount+'_MP', - xtype:"fieldset", - labelAlign :'left', - title:"器械包信息", - autoHeight:true, - items:[{ - layout : 'column', - columnWidth : .5, - labelWidth : 90, - id:'setLayout'+tousseAndMaterialWrapperCount+'_MP' + id: 'tousseInfoFieldSet' + tousseAndMaterialWrapperCount + '_MP', + xtype: "fieldset", + labelAlign: 'left', + title: "器械包信息", + autoHeight: true, + items: [{ + layout: 'column', + columnWidth: .5, + labelWidth: 90, + id: 'setLayout' + tousseAndMaterialWrapperCount + '_MP' }] }); var tosseAndMaterialWrapper2 = { - layout : 'column', - columnWidth : 1, - labelWidth : 90, - id: 'tosseAndMaterial'+tousseAndMaterialWrapperCount+'_MP' + layout: 'column', + columnWidth: 1, + labelWidth: 90, + id: 'tosseAndMaterial' + tousseAndMaterialWrapperCount + '_MP' }; - setLayoutVal = 'setLayout'+tousseAndMaterialWrapperCount+'_MP'; + setLayoutVal = 'setLayout' + tousseAndMaterialWrapperCount + '_MP'; setLayoutList = tosseAndMaterialWrapper2; - tosseAndMaterialVal = 'tosseAndMaterial'+tousseAndMaterialWrapperCount+'_MP'; + tosseAndMaterialVal = 'tosseAndMaterial' + tousseAndMaterialWrapperCount + '_MP'; top.Ext.getCmp(setLayoutVal).add(setLayoutList); - var showBtn = getShowBtn(addExtractClick,btnShowOrHide); - addMaterialItems(tosseAndMaterialVal,showBtn,items,items5,items1,items2,items3,items4); + var showBtn = getShowBtn(addExtractClick, btnShowOrHide); + addMaterialItems(tosseAndMaterialVal, showBtn, items, items5, items1, items2, items3, items4); } - } - }else{ - if(amountChild == 001){//第一个 - var showBtn = getShowBtn(addExtractClick,btnShowOrHide); - addMaterialItems("materialWrapper",showBtn,items,items5,items1,items2,items3,items4); + } + } else { + if (amountChild == 001) {//第一个 + var showBtn = getShowBtn(addExtractClick, btnShowOrHide); + addMaterialItems("materialWrapper", showBtn, items, items5, items1, items2, items3, items4); top.Ext.getCmp("materialWrapper").doLayout(); - }else{ + } else { var tosseAndMaterialList = { - layout : 'column', - columnWidth : 1, - labelWidth : 90, - id: 'tosseAndMaterialList'+materialItemCount+'_TMP' + layout: 'column', + columnWidth: 1, + labelWidth: 90, + id: 'tosseAndMaterialList' + materialItemCount + '_TMP' }; - + tousseAndMaterial.add(tosseAndMaterialList); - var showBtn = getShowBtn(addExtractClick,btnShowOrHide); - addMaterialItems('tosseAndMaterialList'+materialItemCount+'_TMP',showBtn,items,items5,items1,items2,items3,items4); - + var showBtn = getShowBtn(addExtractClick, btnShowOrHide); + addMaterialItems('tosseAndMaterialList' + materialItemCount + '_TMP', showBtn, items, items5, items1, items2, items3, items4); + } } - + tousseAndMaterial.doLayout(); // 顺序包括器械包和材料都排进去 var curOrder = materialItemCount + tousseItemCount + 2; - if(top.Ext.getCmp('materialOrder'+materialItemCount)){ - top.Ext.getCmp('materialOrder'+materialItemCount).setValue(curOrder); + if (top.Ext.getCmp('materialOrder' + materialItemCount)) { + top.Ext.getCmp('materialOrder' + materialItemCount).setValue(curOrder); } - if(basketPosition != null && basketPosition != ''){//篮筐位置 - if(top.Ext.getCmp('position'+materialItemCount)){ - top.Ext.getCmp('position'+materialItemCount).setValue(basketPosition); + if (basketPosition != null && basketPosition != '') {//篮筐位置 + if (top.Ext.getCmp('position' + materialItemCount)) { + top.Ext.getCmp('position' + materialItemCount).setValue(basketPosition); } } - if(orderNumber != null && orderNumber > 0){ - if(top.Ext.getCmp('materialOrder'+materialItemCount)){ - top.Ext.getCmp('materialOrder'+materialItemCount).setValue(orderNumber); + if (orderNumber != null && orderNumber > 0) { + if (top.Ext.getCmp('materialOrder' + materialItemCount)) { + top.Ext.getCmp('materialOrder' + materialItemCount).setValue(orderNumber); } } - if(isOpenRecord == true && mateialName != null && mateialName != ''){ + if (isOpenRecord == true && mateialName != null && mateialName != '') { //打开记录,不允许修改 - top.Ext.getCmp('material'+tousseItemCount+'_'+materialItemCount).disable(); - top.Ext.getCmp('materialAmount'+materialItemCount).disable(); - top.Ext.getCmp('basketBarcode'+materialItemCount).disable(); - top.Ext.getCmp('position'+materialItemCount).disable(); + top.Ext.getCmp('material' + tousseItemCount + '_' + materialItemCount).disable(); + top.Ext.getCmp('materialAmount' + materialItemCount).disable(); + top.Ext.getCmp('basketBarcode' + materialItemCount).disable(); + top.Ext.getCmp('position' + materialItemCount).disable(); } } // 隐藏第一个器械包信息,包括器械包条码,数量 -function hideFirstTousse(){ +function hideFirstTousse() { top.Ext.getCmp('tousseBarcodeC').setVisible(false); top.Ext.getCmp('tousseNameC').setVisible(false); top.Ext.getCmp('tousseAmountC').setVisible(false); top.Ext.getCmp('addExtractCheckTousseBtnC').setVisible(false); } //显示第一个器械包信息,包括器械包条码,数量 -function showFirstTousse(){ +function showFirstTousse() { top.Ext.getCmp('tousseBarcodeC').setVisible(true); - top.Ext.getCmp('tousseNameC').setVisible(true); - if(top.Ext.getCmp('barcode').getValue() != ""){ + top.Ext.getCmp('tousseNameC').setVisible(true); + if (top.Ext.getCmp('barcode').getValue() != "") { top.Ext.getCmp('barcode').setValue(""); } - - if(top.Ext.getCmp('tousseInstanceId').getValue() != ""){ + + if (top.Ext.getCmp('tousseInstanceId').getValue() != "") { top.Ext.getCmp('tousseInstanceId').setValue(""); } - if(top.Ext.getCmp('tousseType').getValue() != ""){ + if (top.Ext.getCmp('tousseType').getValue() != "") { top.Ext.getCmp('tousseType').setValue(""); } - if(top.Ext.getCmp('tousseDefRecycling').getValue() != ""){ + if (top.Ext.getCmp('tousseDefRecycling').getValue() != "") { top.Ext.getCmp('tousseDefRecycling').setValue(""); } - if(newTousseItems.length > 0){ + if (newTousseItems.length > 0) { top.Ext.getCmp('tousseDefinitionId').setValue(newTousseItems[0].tousseID); top.Ext.getCmp('tousseName').setValue(newTousseItems[0].tousseName); var responsibilityPart = top.Ext.getCmp('responsibilityPart').getValue(); - if(responsibilityPart == '装配管理'){ + if (responsibilityPart == '装配管理') { top.Ext.getCmp('responsiblePerson').setValue(newTousseItems[0].data['operator']); top.Ext.getCmp('tousseDefinitionId').setValue(newTousseItems[0].data['tousseDefinition.id']); var barcode = newTousseItems[0].data['barcode'] || '' - if(barcode == ''){ + if (barcode == '') { top.Ext.getCmp('tousseName').setValue(newTousseItems[0].data['tousseDefinition.name']); - }else { - getTousseInstanceNameAndResponsiblePerson(barcode, newTousseItems[0].data['tousseDefinition.id'], materialDefinitionStore,true); + } else { + getTousseInstanceNameAndResponsiblePerson(barcode, newTousseItems[0].data['tousseDefinition.id'], materialDefinitionStore, true); } } newTousseItems = []; - }else { - if(top.Ext.getCmp('tousseDefinitionId').getValue() != ""){ + } else { + if (top.Ext.getCmp('tousseDefinitionId').getValue() != "") { top.Ext.getCmp('tousseDefinitionId').setValue(""); } - - if(top.Ext.getCmp('tousseName').getValue() != ""){ + + if (top.Ext.getCmp('tousseName').getValue() != "") { top.Ext.getCmp('tousseName').setValue(""); } } - + //2、如果有炉号炉次,则需要设值 - if(!isUndefinedOrNullOrEmpty(top.Ext.getCmp('configItemOptionSterName'))){ + if (!isUndefinedOrNullOrEmpty(top.Ext.getCmp('configItemOptionSterName'))) { top.Ext.getCmp('configItemOptionSterName').setValue(""); top.Ext.getCmp('configItemOptionSterFre').setValue(""); } @@ -1512,182 +1512,182 @@ } //隐藏第一个材料信息,包括器械包条码,数量 -function hideFirstMaterial(){ +function hideFirstMaterial() { top.Ext.getCmp('materialC').setVisible(false); top.Ext.getCmp('materialAmountC').setVisible(false); top.Ext.getCmp('addExtractCheckMaterialBtnC').setVisible(false); } //显示第一个材料信息,包括器械包条码,数量 -function showFirstMaterial(){ +function showFirstMaterial() { top.Ext.getCmp('materialC').setVisible(true); top.Ext.getCmp('materialAmountC').setVisible(true); top.Ext.getCmp('addExtractCheckMaterialBtnC').setVisible(true); } -function hideExtractCheckMaterial(){ - if(materialItemCount > 0){ - for(var m =1;m 0) { + for (var m = 1; m < materialItemCount + 1; m++) { + if (top.Ext.getCmp("materialC" + m)) { + top.Ext.getCmp("materialC" + m).setVisible(false); + top.Ext.getCmp('materialAmountC' + m).setVisible(false); + if (top.Ext.getCmp('addExtractCheckMaterialBtnC' + m)) {//隐藏添加按钮 + top.Ext.getCmp('addExtractCheckMaterialBtnC' + m).setVisible(false); } } } } } //隐藏第一个下面增加的器械包 -function hideExtractCheckTousse(){ - if(tousseItemCount > 0){ - for(var i=1;i 0) { + for (var i = 1; i < tousseItemCount + 1; i++) { + if (top.Ext.getCmp('tousseBarcodeC' + i + "_" + 2)) { + top.Ext.getCmp('tousseBarcodeC' + i + "_" + 2).setVisible(false); + top.Ext.getCmp('tousseBarcodeC' + i + "_" + 4).setVisible(false); + top.Ext.getCmp('tousseBarcodeC' + i + "_" + 12).setVisible(false); + top.Ext.getCmp('tousseBarcodeC' + i + "_" + 1).setVisible(false); + top.Ext.getCmp('tousseBarcodeC' + i + "_" + 3).setVisible(false); + top.Ext.getCmp('tousseBarcodeC' + i + "_" + 6).setVisible(false); + if (top.Ext.getCmp('addExtractCheckTousseBtnC' + i)) {//隐藏添加按钮 + top.Ext.getCmp('addExtractCheckTousseBtnC' + i).setVisible(false); + top.Ext.getCmp('tosseAndMaterial').remove('addExtractCheckTousseBtnC' + i); } - top.Ext.getCmp('tosseAndMaterial').remove('tousseBarcodeC'+i+"_"+2); - top.Ext.getCmp('tosseAndMaterial').remove('tousseBarcodeC'+i+"_"+4); - top.Ext.getCmp('tosseAndMaterial').remove('tousseBarcodeC'+i+"_"+12); - top.Ext.getCmp('tosseAndMaterial').remove('tousseBarcodeC'+i+"_"+1); - top.Ext.getCmp('tosseAndMaterial').remove('tousseBarcodeC'+i+"_"+3); - top.Ext.getCmp('tosseAndMaterial').remove('tousseBarcodeC'+i+"_"+6); - top.Ext.getCmp('tosseAndMaterial').remove('tempBarcode'+i+"_"+5); - top.Ext.getCmp('tosseAndMaterial').remove('tempBarcode'+i+"_"+7); - top.Ext.getCmp('tosseAndMaterial').remove('tempBarcode'+i+"_"+8); - top.Ext.getCmp('tosseAndMaterial').remove('tempBarcode'+i+"_"+13); - top.Ext.getCmp('tosseAndMaterial').remove('tousseOrder'+i); - top.Ext.getCmp('tosseAndMaterial').remove('tempBarcodeHidden'+i+"_"+1); + top.Ext.getCmp('tosseAndMaterial').remove('tousseBarcodeC' + i + "_" + 2); + top.Ext.getCmp('tosseAndMaterial').remove('tousseBarcodeC' + i + "_" + 4); + top.Ext.getCmp('tosseAndMaterial').remove('tousseBarcodeC' + i + "_" + 12); + top.Ext.getCmp('tosseAndMaterial').remove('tousseBarcodeC' + i + "_" + 1); + top.Ext.getCmp('tosseAndMaterial').remove('tousseBarcodeC' + i + "_" + 3); + top.Ext.getCmp('tosseAndMaterial').remove('tousseBarcodeC' + i + "_" + 6); + top.Ext.getCmp('tosseAndMaterial').remove('tempBarcode' + i + "_" + 5); + top.Ext.getCmp('tosseAndMaterial').remove('tempBarcode' + i + "_" + 7); + top.Ext.getCmp('tosseAndMaterial').remove('tempBarcode' + i + "_" + 8); + top.Ext.getCmp('tosseAndMaterial').remove('tempBarcode' + i + "_" + 13); + top.Ext.getCmp('tosseAndMaterial').remove('tousseOrder' + i); + top.Ext.getCmp('tosseAndMaterial').remove('tempBarcodeHidden' + i + "_" + 1); } } } } //禁用器械包条码和器械包名称 -function disabledExtractCheckTousse(){ - if(tousseItemCount > 0){ - for(var i=1;i 0) { + for (var i = 1; i < tousseItemCount + 1; i++) { + top.Ext.getCmp('tempBarcode' + i + "_" + 1).disable(); + top.Ext.getCmp('tempBarcode' + i + "_" + 3).disable(); + top.Ext.getCmp('tempBarcode' + i + "_" + 6).disable(); } } } //启用器械包条码和器械包名称 -function enableExtractCheckTousse(){ - if(tousseItemCount > 0){ - for(var i=1;i 0) { + for (var i = 1; i < tousseItemCount + 1; i++) { + top.Ext.getCmp('tempBarcode' + i + "_" + 1).enable(); + top.Ext.getCmp('tempBarcode' + i + "_" + 3).enable(); + top.Ext.getCmp('tempBarcode' + i + "_" + 6).enable(); } } } //隐藏器械包信息块材料 -function hideExtractCheckMaterialWrapper(){ - if(tousseAndMaterialWrapperCount > 0){ - for(var i=1;i 0) { + for (var i = 1; i < tousseAndMaterialWrapperCount + 1; i++) { + if (top.Ext.getCmp('tousseInfoFieldSet' + i + '_MP')) { + top.Ext.getCmp('tousseInfoFieldSet' + i + '_MP').setVisible(false); + top.Ext.getCmp('setLayout' + i + '_MP').setVisible(false); + top.Ext.getCmp('addQualityMonitoringForm').remove('tousseInfoFieldSet' + i + '_MP'); + top.Ext.getCmp('addQualityMonitoringForm').remove('setLayout' + i + '_MP'); hideExtractCheckMaterial(); } - + } } } //隐藏器械包信息块器械包 -function hideExtractCheckTousseWrapper(){ - if(tousseAndMaterialWrapperCount > 0){ - for(var i=1;i 0) { + for (var i = 1; i < tousseAndMaterialWrapperCount + 1; i++) { + if (top.Ext.getCmp('tousseInfoFieldSet' + i + '_TP')) { + top.Ext.getCmp('tousseInfoFieldSet' + i + '_TP').setVisible(false); + top.Ext.getCmp('setLayout' + i + '_TP').setVisible(false); } } } } //隐藏器械包信息块材料和包 -function hideExtractCheckTousseAndMaterialWrapper(){ - if(tousseAndMaterialWrapperCount > 0){ - for(var i=1;i 0) { + for (var i = 1; i < tousseAndMaterialWrapperCount + 1; i++) { + if (top.Ext.getCmp('tousseInfoFieldSet' + i + '_TMP')) { + top.Ext.getCmp('tousseInfoFieldSet' + i + '_TMP').setVisible(false); + top.Ext.getCmp('setLayout' + i + '_TMP').setVisible(false); + top.Ext.getCmp('tosseAndMaterial' + i + '_TMP').setVisible(false); } } } - + } //隐藏器械包信息块的材料,包,材料和包 -function hideMaterialOrTousseOrTousseMaterial(){ - if(tousseAndMaterialWrapperCount > 0){ - for(var i=1;i 0) { + for (var i = 1; i < tousseAndMaterialWrapperCount + 1; i++) { //如果是材料 - if(top.Ext.getCmp('tousseInfoFieldSet'+i+'_MP')){ - top.Ext.getCmp('tousseInfoFieldSet'+i+'_MP').setVisible(false); - top.Ext.getCmp('setLayout'+i+'_MP').setVisible(false); + if (top.Ext.getCmp('tousseInfoFieldSet' + i + '_MP')) { + top.Ext.getCmp('tousseInfoFieldSet' + i + '_MP').setVisible(false); + top.Ext.getCmp('setLayout' + i + '_MP').setVisible(false); hideExtractCheckMaterial(); - }else if(top.Ext.getCmp('tousseInfoFieldSet'+i+'_TP')){//如果是包 - top.Ext.getCmp('tousseInfoFieldSet'+i+'_TP').setVisible(false); - top.Ext.getCmp('setLayout'+i+'_TP').setVisible(false); - top.Ext.getCmp('addQualityMonitoringForm').remove('tousseInfoFieldSet'+i+'_TP'); - top.Ext.getCmp('addQualityMonitoringForm').remove('tousseInfoFieldSet'+i+'_TP'); - top.Ext.getCmp('addQualityMonitoringForm').remove('setLayout'+i+'_TP'); + } else if (top.Ext.getCmp('tousseInfoFieldSet' + i + '_TP')) {//如果是包 + top.Ext.getCmp('tousseInfoFieldSet' + i + '_TP').setVisible(false); + top.Ext.getCmp('setLayout' + i + '_TP').setVisible(false); + top.Ext.getCmp('addQualityMonitoringForm').remove('tousseInfoFieldSet' + i + '_TP'); + top.Ext.getCmp('addQualityMonitoringForm').remove('tousseInfoFieldSet' + i + '_TP'); + top.Ext.getCmp('addQualityMonitoringForm').remove('setLayout' + i + '_TP'); //hideExtractCheckTousse(); - }else if(top.Ext.getCmp('tousseInfoFieldSet'+i+'_TMP')){//材料和包 - top.Ext.getCmp('tousseInfoFieldSet'+i+'_TMP').setVisible(false); - top.Ext.getCmp('setLayout'+i+'_TMP').setVisible(false); - top.Ext.getCmp('tosseAndMaterial'+i+'_TMP').setVisible(false); - top.Ext.getCmp('addQualityMonitoringForm').remove('tousseInfoFieldSet'+i+'_TMP'); - top.Ext.getCmp('addQualityMonitoringForm').remove('setLayout'+i+'_TMP'); - top.Ext.getCmp('addQualityMonitoringForm').remove('tosseAndMaterial'+i+'_TMP'); + } else if (top.Ext.getCmp('tousseInfoFieldSet' + i + '_TMP')) {//材料和包 + top.Ext.getCmp('tousseInfoFieldSet' + i + '_TMP').setVisible(false); + top.Ext.getCmp('setLayout' + i + '_TMP').setVisible(false); + top.Ext.getCmp('tosseAndMaterial' + i + '_TMP').setVisible(false); + top.Ext.getCmp('addQualityMonitoringForm').remove('tousseInfoFieldSet' + i + '_TMP'); + top.Ext.getCmp('addQualityMonitoringForm').remove('setLayout' + i + '_TMP'); + top.Ext.getCmp('addQualityMonitoringForm').remove('tosseAndMaterial' + i + '_TMP'); } } } } //显示器械包信息块材料和包 -function showExtractCheckTousseAndMaterialWrapper(){ - if(tousseAndMaterialWrapperCount > 0){ - for(var i=1;i 0){ - for(var j=1;j 0) { + for (var i = 1; i < tousseAndMaterialWrapperCount + 1; i++) { + if (top.Ext.getCmp('tousseInfoFieldSet' + i + '_TMP')) { + top.Ext.getCmp('tousseInfoFieldSet' + i + '_TMP').setVisible(true); + top.Ext.getCmp('setLayout' + i + '_TMP').setVisible(true); + top.Ext.getCmp('tosseAndMaterial' + i + '_TMP').setVisible(true); + if (tousseItemCount > 0) { + for (var j = 1; j < tousseItemCount + 1; j++) { + top.Ext.getCmp('tousseBarcodeC' + j + "_" + 2).setVisible(true); + top.Ext.getCmp('tousseBarcodeC' + j + "_" + 4).setVisible(true); + top.Ext.getCmp('tousseBarcodeC' + j + "_" + 1).setVisible(true); + top.Ext.getCmp('tousseBarcodeC' + j + "_" + 3).setVisible(true); + top.Ext.getCmp('tousseBarcodeC' + j + "_" + 6).setVisible(true); + if (top.Ext.getCmp('addExtractCheckTousseBtnC' + j)) { + top.Ext.getCmp('addExtractCheckTousseBtnC' + j).setVisible(true); } } } - if(materialItemCount > 0){ - for(var k=1;k 0) { + for (var k = 1; k < materialItemCount + 1; k++) { + top.Ext.getCmp("materialC" + k).setVisible(true); + top.Ext.getCmp('materialAmountC' + k).setVisible(true); + if (top.Ext.getCmp('addExtractCheckMaterialBtnC' + k)) {//显示添加按钮 + top.Ext.getCmp('addExtractCheckMaterialBtnC' + k).setVisible(true); } } } @@ -1697,47 +1697,47 @@ } //隐藏监测项 -function hideInspectItem(){ - if(tousseAndMaterialWrapperCount > 0){ - for(var i=1;i 0) { + for (var i = 1; i < tousseAndMaterialWrapperCount + 1; i++) { + if (top.Ext.getCmp('itemsFieldSet' + '_' + i)) { + top.Ext.getCmp('itemsFieldSet' + '_' + i).setVisible(false); + top.Ext.getCmp('addQualityMonitoringForm').remove('itemsFieldSet' + '_' + i); } } } } //隐藏篮框条码和位置 -function hideBasketBarcodeAndPosition(){ - if(materialItemCount > 0){ - for(var k=1;k 0) { + for (var k = 1; k < materialItemCount + 1; k++) { + top.Ext.getCmp("basketBarcodeC" + k).setVisible(false); + top.Ext.getCmp('positionC' + k).setVisible(false); } } } //隐藏篮框条码和位置 -function showBasketBarcodeAndPosition(){ - if(materialItemCount > 0){ - for(var k=1;k 0) { + for (var k = 1; k < materialItemCount + 1; k++) { + top.Ext.getCmp("basketBarcodeC" + k).setVisible(true); + top.Ext.getCmp('positionC' + k).setVisible(true); } } } -function addTousseItems(id,addTousseClick,items1,items2,items3,items10,items4,items5,items6,items7,items8,items9,items11,items12,items13){ +function addTousseItems(id, addTousseClick, items1, items2, items3, items10, items4, items5, items6, items7, items8, items9, items11, items12, items13) { top.Ext.getCmp(id).add(items1); top.Ext.getCmp(id).add(items2); top.Ext.getCmp(id).add(items12); top.Ext.getCmp(id).add(items13); top.Ext.getCmp(id).add(items3); - if(addTousseClick){ + if (addTousseClick) { top.Ext.getCmp(id).add(items10); - } + } top.Ext.getCmp(id).add(items4); top.Ext.getCmp(id).add(items5); top.Ext.getCmp(id).add(items6); @@ -1748,57 +1748,57 @@ } //获取下一个器械包条码的焦点 -function getNextFocus(field){ - var ownerCts = field.ownerCt.ownerCt;//当前点击元素的父元素 +function getNextFocus(field) { + var ownerCts = field.ownerCt.ownerCt;//当前点击元素的父元素 var itemsTousse = ownerCts.items.items; var arr = []; //先获取写死的第一个 - if(top.Ext.getCmp("tosseAndMaterial")){ - if(top.Ext.getCmp("scope").getValue() == "材料和器械包"){ + if (top.Ext.getCmp("tosseAndMaterial")) { + if (top.Ext.getCmp("scope").getValue() == "材料和器械包") { var firstItems = top.Ext.getCmp('tosseAndMaterial').items.items; - for(var y = 0; y < firstItems.length;y++){ + for (var y = 0; y < firstItems.length; y++) { var firstParentId = firstItems[y].id; - if(firstParentId.indexOf("tousseBarcodeC") != -1){//找到器械包条码的input - if(firstItems[y].items.items[0].fieldLabel == "器械包条码"){ + if (firstParentId.indexOf("tousseBarcodeC") != -1) {//找到器械包条码的input + if (firstItems[y].items.items[0].fieldLabel == "器械包条码") { arr.push(firstItems[y].items.items[0].id);//拿到所有的器械包条码的id } } } - }else if(top.Ext.getCmp("scope").getValue() == "器械包"){ + } else if (top.Ext.getCmp("scope").getValue() == "器械包") { var firstItems = top.Ext.getCmp('tosseAndMaterial').items.items; - for(var y = 0; y < firstItems.length;y++){ + for (var y = 0; y < firstItems.length; y++) { var firstParentId = firstItems[y].id; - if(firstParentId.indexOf("tousseBarcodeC") != -1){//找到器械包条码的input - if(firstItems[y].items.items[0].fieldLabel == "器械包条码"){ + if (firstParentId.indexOf("tousseBarcodeC") != -1) {//找到器械包条码的input + if (firstItems[y].items.items[0].fieldLabel == "器械包条码") { arr.push(firstItems[y].items.items[0].id);//拿到所有的器械包条码的id } } } } } - + //获取其他全部块的器械包条码的id - if(tousseAndMaterialWrapperCount > 0){ - for(var k = 1;k <= tousseAndMaterialWrapperCount;k++){//先找到每一个块 - if(top.Ext.getCmp("scope").getValue() == "材料和器械包"){ - if(top.Ext.getCmp('tousseInfoFieldSet'+ k +'_TMP')){ - var tousseAndMaterialWrpperItems = top.Ext.getCmp('tosseAndMaterial'+k+'_TMP').items.items; - for(var z = 0; z < tousseAndMaterialWrpperItems.length;z++){ + if (tousseAndMaterialWrapperCount > 0) { + for (var k = 1; k <= tousseAndMaterialWrapperCount; k++) {//先找到每一个块 + if (top.Ext.getCmp("scope").getValue() == "材料和器械包") { + if (top.Ext.getCmp('tousseInfoFieldSet' + k + '_TMP')) { + var tousseAndMaterialWrpperItems = top.Ext.getCmp('tosseAndMaterial' + k + '_TMP').items.items; + for (var z = 0; z < tousseAndMaterialWrpperItems.length; z++) { var otherParentId = tousseAndMaterialWrpperItems[z].id; - if(otherParentId.indexOf("tousseBarcodeC") != -1){//找到器械包条码的input - if(tousseAndMaterialWrpperItems[z].items.items[0].fieldLabel == "器械包条码"){ + if (otherParentId.indexOf("tousseBarcodeC") != -1) {//找到器械包条码的input + if (tousseAndMaterialWrpperItems[z].items.items[0].fieldLabel == "器械包条码") { arr.push(tousseAndMaterialWrpperItems[z].items.items[0].id);//拿到所有的器械包条码的id } } } } - }else if(top.Ext.getCmp("scope").getValue() == "器械包"){ - if(top.Ext.getCmp('tosseAndMaterial'+k+'_TP')){ - var tousseWrpperItems = top.Ext.getCmp('tosseAndMaterial'+k+'_TP').items.items; - for(var j = 0; j < tousseWrpperItems.length;j++){ + } else if (top.Ext.getCmp("scope").getValue() == "器械包") { + if (top.Ext.getCmp('tosseAndMaterial' + k + '_TP')) { + var tousseWrpperItems = top.Ext.getCmp('tosseAndMaterial' + k + '_TP').items.items; + for (var j = 0; j < tousseWrpperItems.length; j++) { var otherParentId = tousseWrpperItems[j].id; - if(otherParentId.indexOf("tousseBarcodeC") != -1){//找到器械包条码的input - if(tousseWrpperItems[j].items.items[0].fieldLabel == "器械包条码"){ + if (otherParentId.indexOf("tousseBarcodeC") != -1) {//找到器械包条码的input + if (tousseWrpperItems[j].items.items[0].fieldLabel == "器械包条码") { arr.push(tousseWrpperItems[j].items.items[0].id);//拿到所有的器械包条码的id } } @@ -1807,11 +1807,11 @@ } } } - - for(var t = 0; t < arr.length;t++){ - if(field.id == arr[t]){//如果所有的器械包条码的id和当前输入的这个相等,那么就让当前的下一个获取焦点 - var nextField = arr[t+1];//下一个 - if(top.Ext.getCmp(nextField)){ + + for (var t = 0; t < arr.length; t++) { + if (field.id == arr[t]) {//如果所有的器械包条码的id和当前输入的这个相等,那么就让当前的下一个获取焦点 + var nextField = arr[t + 1];//下一个 + if (top.Ext.getCmp(nextField)) { top.Ext.getCmp(nextField).focus(false, 100);//获取下一个焦点 break; } @@ -1824,520 +1824,520 @@ tousseAndMaterialWrapperCount 增加的块的个数 curBarcode 当前扫的条码 */ -function tousseBarcodeIsScanned(tousseAndMaterialWrapperCount,curBarcode){ +function tousseBarcodeIsScanned(tousseAndMaterialWrapperCount, curBarcode) { var isScanned = false;//是否已经扫描 var addNum = tousseAndMaterialWrapperCount;//获取添加的块数量 var scannedBarcodeArr = null; //先获取写死的第一个 - if(top.Ext.getCmp("scope").getValue() == "材料和器械包" || top.Ext.getCmp("scope").getValue() == "器械包"){ + if (top.Ext.getCmp("scope").getValue() == "材料和器械包" || top.Ext.getCmp("scope").getValue() == "器械包") { var barcode = top.Ext.getCmp('barcode').getValue(); - if(barcode !=""){ + if (barcode != "") { scannedBarcodeArr = barcode.split(","); } - + //获取第一块添加的 var firstArr = []; var firstItems = top.Ext.getCmp('tosseAndMaterial').items.items; - for(var y = 0; y < firstItems.length;y++){ + for (var y = 0; y < firstItems.length; y++) { var firstParentId = firstItems[y].id; - if(firstParentId.indexOf("tempBarcodeHidden") != -1){ + if (firstParentId.indexOf("tempBarcodeHidden") != -1) { firstArr.push(firstItems[y].id); } } - + var firstBarcode = null; - if(firstArr.length > 0){ - for(var f = 0;f < firstArr.length;f++){ - if(firstBarcode == null){ - firstBarcode= top.Ext.getCmp(firstArr[f]).getValue(); - if(scannedBarcodeArr == null){ + if (firstArr.length > 0) { + for (var f = 0; f < firstArr.length; f++) { + if (firstBarcode == null) { + firstBarcode = top.Ext.getCmp(firstArr[f]).getValue(); + if (scannedBarcodeArr == null) { scannedBarcodeArr = firstBarcode.split(","); - }else{ + } else { scannedBarcodeArr = scannedBarcodeArr.concat(firstBarcode.split(",")); } - }else{ - firstBarcode = firstBarcode + ","+top.Ext.getCmp(firstArr[f]).getValue(); - if(scannedBarcodeArr == null){ + } else { + firstBarcode = firstBarcode + "," + top.Ext.getCmp(firstArr[f]).getValue(); + if (scannedBarcodeArr == null) { scannedBarcodeArr = firstBarcode.split(","); - }else{ + } else { scannedBarcodeArr = scannedBarcodeArr.concat(firstBarcode.split(",")); } } - + } } - - if(addNum > 0){//增加的每块 - for(var k = 1;k <= addNum;k++){//先找到每一个块 + + if (addNum > 0) {//增加的每块 + for (var k = 1; k <= addNum; k++) {//先找到每一个块 var wrapper; var scannedBarcode; - if(top.Ext.getCmp("scope").getValue() == "材料和器械包"){ - if(top.Ext.getCmp('tousseInfoFieldSet'+ k +'_TMP')){ - var wrapperParent = top.Ext.getCmp('tousseInfoFieldSet'+ k +'_TMP');//最外层 //包和材料 - wrapper = top.Ext.getCmp('tosseAndMaterial'+k+'_TMP').items.items; - scannedBarcode = getTousseBarcode(wrapper); - if(scannedBarcodeArr == null){ + if (top.Ext.getCmp("scope").getValue() == "材料和器械包") { + if (top.Ext.getCmp('tousseInfoFieldSet' + k + '_TMP')) { + var wrapperParent = top.Ext.getCmp('tousseInfoFieldSet' + k + '_TMP');//最外层 //包和材料 + wrapper = top.Ext.getCmp('tosseAndMaterial' + k + '_TMP').items.items; + scannedBarcode = getTousseBarcode(wrapper); + if (scannedBarcodeArr == null) { scannedBarcodeArr = scannedBarcode.split(","); - }else{ + } else { scannedBarcodeArr = scannedBarcodeArr.concat(scannedBarcode.split(",")); } } - }else if(top.Ext.getCmp("scope").getValue() == "器械包"){ - if(top.Ext.getCmp('tosseAndMaterial'+k+'_TP')){ - wrapper = top.Ext.getCmp('tosseAndMaterial'+k+'_TP').items.items; - scannedBarcode = getTousseBarcode(wrapper); - if(scannedBarcodeArr == null){ + } else if (top.Ext.getCmp("scope").getValue() == "器械包") { + if (top.Ext.getCmp('tosseAndMaterial' + k + '_TP')) { + wrapper = top.Ext.getCmp('tosseAndMaterial' + k + '_TP').items.items; + scannedBarcode = getTousseBarcode(wrapper); + if (scannedBarcodeArr == null) { scannedBarcodeArr = scannedBarcode.split(","); - }else{ + } else { scannedBarcodeArr = scannedBarcodeArr.concat(scannedBarcode.split(",")); } } - + } } } - if(scannedBarcodeArr && scannedBarcodeArr.length > 0){ + if (scannedBarcodeArr && scannedBarcodeArr.length > 0) { var uniqueScannedBarcode = unique(scannedBarcodeArr); - for(var q = 0;q 0){ - for(var i=1;i<=materialItemCount;i++){ - if(top.Ext.getCmp('material'+index+'_'+i)){ - top.Ext.getCmp('material'+index+'_'+i).store.reload(); - } + } + getNextFocus(field); + field.setValue(""); + var index = field.id.split('_')[0].replace('tempBarcode', ''); + if (top.Ext.getCmp('tousseDefinitionId' + index)) { + top.Ext.getCmp('tousseDefinitionId' + index).setValue(result.tousseDefinitionId); + } + //重新加载包内的材料 + if (materialItemCount > 0) { + for (var i = 1; i <= materialItemCount; i++) { + if (top.Ext.getCmp('material' + index + '_' + i)) { + top.Ext.getCmp('material' + index + '_' + i).store.reload(); } } } } - }, - anchor : '95%' - }] - }; - - if(addTousseClick){ + } + }, + anchor: '95%' + }] + }; + + if (addTousseClick) { items10 = { - layout : 'form', - columnWidth:.04, - labelWidth : 90, - height:setH, - id:"addExtractCheckTousseBtnC"+tousseAndMaterialWrapperCount, - items : [{ - xtype:'button', - tooltip : '添加抽检器械包', - iconCls : 'btn_ext_add', - id:'addButton', - handler : function(field,e){ + layout: 'form', + columnWidth: .04, + labelWidth: 90, + height: setH, + id: "addExtractCheckTousseBtnC" + tousseAndMaterialWrapperCount, + items: [{ + xtype: 'button', + tooltip: '添加抽检器械包', + iconCls: 'btn_ext_add', + id: 'addButton', + handler: function (field, e) { widthSetTousse = true; var rememberNum2 = rememberNum; var isTousseAndMaterialVal = ""; - if(isTousseAndMaterial){ + if (isTousseAndMaterial) { isTousseAndMaterialVal = true; } - - addExtractCheckTousse("","","","","","","","",true,isTousseAndMaterialVal,rememberNum2,"",""); - widthSetTousse = false; + + addExtractCheckTousse("", "", "", "", "", "", "", "", true, isTousseAndMaterialVal, rememberNum2, "", ""); + widthSetTousse = false; var addBtn = ""; - if(top.Ext.getCmp("scope").getValue() == "材料和器械包"){ + if (top.Ext.getCmp("scope").getValue() == "材料和器械包") { widthSetTousse = false; widthSet = false; addBtn = true; - addExtractCheckMaterial("","",1,"","",true,isTousseAndMaterialVal,rememberNum2,"",addBtn,"","",tousseItemCount); + addExtractCheckMaterial("", "", 1, "", "", true, isTousseAndMaterialVal, rememberNum2, "", addBtn, "", "", tousseItemCount); widthSetTousse = false; } - + top.Ext.getCmp('addQualityMonitoringForm').doLayout(); - + } }] }; } - + var columnW = 0.4; var labelW = 90; - if(widthSetTousse == true){ - if(recycleQM == true){ + if (widthSetTousse == true) { + if (recycleQM == true) { columnW = 0.439; labelW = 129; - }else{ + } else { columnW = 0.44; - labelW = 123; + labelW = 123; } - }else if(widthSetTousse == false ){ - if(addTousseClick == true){ + } else if (widthSetTousse == false) { + if (addTousseClick == true) { columnW = 0.4; labelW = 90; - }else{ + } else { columnW = 0.44; labelW = 123; - if(isLoad){ + if (isLoad) { columnW = 0.4; labelW = 90; } - } - }else if(isLoad == true){ + } + } else if (isLoad == true) { columnW = 0.44; labelW = 126; } items4 = { - layout : 'form', - id : 'tousseBarcodeC'+tousseItemCount+"_"+3, - labelWidth : labelW, - columnWidth : columnW, - height:setH, - items : [{ - xtype : 'combo', - id : 'tempBarcode'+tousseItemCount+"_"+3, - name : 'tempBarcode'+tousseItemCount+"_"+3, - fieldLabel : '器械包名称', - queryParam : 'spell', - minChars : 0, - valueField : 'name', - displayField : 'name', - store : tousseDefinitionStore, - forceSelection : true, - lazyInit : true, - triggerAction : 'all', - hideTrigger : true, - typeAhead : false, - anchor : '95%', - listeners : { - select : function(combo, record,index) { - combo.setValue(record.data.name); - var z = combo.id.split('_')[0].replace('tempBarcode',''); - top.Ext.getCmp('tousseDefinitionId'+z).setValue(record.data.id); - }, - blur : function(field){ - var index = field.id.split('_')[0].replace('tempBarcode',''); - if(!top.Ext.getCmp('tempBarcode'+index+'_3').getRawValue()){ - top.Ext.getCmp('tousseDefinitionId'+index).setValue(''); - } - //重新加载包内的材料 - if(materialItemCount > 0){ - for(var i=1;i<=materialItemCount;i++){ - if(top.Ext.getCmp('material'+index+'_'+i)){ - top.Ext.getCmp('material'+index+'_'+i).store.reload(); - } + layout: 'form', + id: 'tousseBarcodeC' + tousseItemCount + "_" + 3, + labelWidth: labelW, + columnWidth: columnW, + height: setH, + items: [{ + xtype: 'combo', + id: 'tempBarcode' + tousseItemCount + "_" + 3, + name: 'tempBarcode' + tousseItemCount + "_" + 3, + fieldLabel: '器械包名称', + queryParam: 'spell', + minChars: 0, + valueField: 'name', + displayField: 'name', + store: tousseDefinitionStore, + forceSelection: true, + lazyInit: true, + triggerAction: 'all', + hideTrigger: true, + typeAhead: false, + anchor: '95%', + listeners: { + select: function (combo, record, index) { + combo.setValue(record.data.name); + var z = combo.id.split('_')[0].replace('tempBarcode', ''); + top.Ext.getCmp('tousseDefinitionId' + z).setValue(record.data.id); + }, + blur: function (field) { + var index = field.id.split('_')[0].replace('tempBarcode', ''); + if (!top.Ext.getCmp('tempBarcode' + index + '_3').getRawValue()) { + top.Ext.getCmp('tousseDefinitionId' + index).setValue(''); + } + //重新加载包内的材料 + if (materialItemCount > 0) { + for (var i = 1; i <= materialItemCount; i++) { + if (top.Ext.getCmp('material' + index + '_' + i)) { + top.Ext.getCmp('material' + index + '_' + i).store.reload(); } } } } - },{ - xtype:'hidden', - fieldLabel : '器械包ID', - id:'tousseDefinitionId'+tousseItemCount, - name:'tousseDefinitionId'+tousseItemCount - }] + } + }, { + xtype: 'hidden', + fieldLabel: '器械包ID', + id: 'tousseDefinitionId' + tousseItemCount, + name: 'tousseDefinitionId' + tousseItemCount + }] }; var items5 = new Array(); items5 = { - layout : 'form', - id : 'tousseBarcodeC'+tousseItemCount+"_"+6, - labelWidth : 90, - columnWidth : .2, - height:setH, - items : [{ - xtype : 'textfield', - name : 'tempBarcode'+tousseItemCount+"_"+6, - id : 'tempBarcode'+tousseItemCount+"_"+6, - fieldLabel : "器械包数量", - value : 1, - anchor : '95%' - }] + layout: 'form', + id: 'tousseBarcodeC' + tousseItemCount + "_" + 6, + labelWidth: 90, + columnWidth: .2, + height: setH, + items: [{ + xtype: 'textfield', + name: 'tempBarcode' + tousseItemCount + "_" + 6, + id: 'tempBarcode' + tousseItemCount + "_" + 6, + fieldLabel: "器械包数量", + value: 1, + anchor: '95%' + }] }; // 包实例id var items6 = new Array(); items6 = { - id : 'tempBarcode'+tousseItemCount+"_"+5, - name : 'tempBarcode'+tousseItemCount+"_"+5, - xtype : 'hidden' + id: 'tempBarcode' + tousseItemCount + "_" + 5, + name: 'tempBarcode' + tousseItemCount + "_" + 5, + xtype: 'hidden' }; - + // 重新回收的值 var items7 = new Array(); items7 = { - xtype : 'hidden', - name : 'tempBarcode'+tousseItemCount+"_"+7, - id : 'tempBarcode'+tousseItemCount+"_"+7 + xtype: 'hidden', + name: 'tempBarcode' + tousseItemCount + "_" + 7, + id: 'tempBarcode' + tousseItemCount + "_" + 7 }; //重新装配的值 var items8 = new Array(); items8 = { - xtype : 'hidden', - name : 'tempBarcode'+tousseItemCount+"_"+8, - id : 'tempBarcode'+tousseItemCount+"_"+8 + xtype: 'hidden', + name: 'tempBarcode' + tousseItemCount + "_" + 8, + id: 'tempBarcode' + tousseItemCount + "_" + 8 }; //废弃条码的值 var items13 = new Array(); items13 = { - xtype : 'hidden', - name : 'tempBarcode'+tousseItemCount+"_"+13, - id : 'tempBarcode'+tousseItemCount+"_"+13 + xtype: 'hidden', + name: 'tempBarcode' + tousseItemCount + "_" + 13, + id: 'tempBarcode' + tousseItemCount + "_" + 13 }; var items9 = new Array(); items9 = { - xtype : 'hidden', - name : 'tousseOrder'+tousseItemCount, - id : 'tousseOrder'+tousseItemCount + xtype: 'hidden', + name: 'tousseOrder' + tousseItemCount, + id: 'tousseOrder' + tousseItemCount }; //器械包条码 var items11 = new Array(); items11 = { - xtype : 'hidden', - name : 'tempBarcodeHidden'+tousseItemCount+"_"+1, - id : 'tempBarcodeHidden'+tousseItemCount+"_"+1 + xtype: 'hidden', + name: 'tempBarcodeHidden' + tousseItemCount + "_" + 1, + id: 'tempBarcodeHidden' + tousseItemCount + "_" + 1 }; - - if(isWrapper){//器械包信息整块 + + if (isWrapper) {//器械包信息整块 var setLayoutVal; var setLayoutList; var tosseAndMaterialVal; - if(isTousseAndMaterial){//监测项是器械包和材料 - if(amount){//点击器械包条码后的添加按钮添加的器械包和材料,就是添加里面 - if(tousseAndMaterialWrapperCount > 0){ - for(var i=1;i 0) { + for (var i = 1; i < tousseAndMaterialWrapperCount + 1; i++) { + if (amount == i) {//找到对应的器械包信息块添加 + addTousseItems('tosseAndMaterial' + i + '_TMP', addTousseClick, items1, items2, items3, items10, items4, items5, items6, items7, items8, items9, items11, items12, items13); + top.Ext.getCmp('addQualityMonitoringForm').doLayout(); } - + } } - - }else{//外面的器械包信息整块器械包和材料,就是添加外面的整块 - addTousseItems(tosseAndMaterialId,addTousseClick,items1,items2,items3,items10,items4,items5,items6,items7,items8,items9,items11,items12,items13); + + } else {//外面的器械包信息整块器械包和材料,就是添加外面的整块 + addTousseItems(tosseAndMaterialId, addTousseClick, items1, items2, items3, items10, items4, items5, items6, items7, items8, items9, items11, items12, items13); } - - - }else{//监测项是包 - if(amount){ - if(tousseAndMaterialWrapperCount > 0){ - for(var i=1;i 0) { + for (var i = 1; i < tousseAndMaterialWrapperCount + 1; i++) { + if (amount == i) {//找到对应的器械包信息块添加 + addTousseItems('tosseAndMaterial' + i + '_TP', addTousseClick, items1, items2, items3, items10, items4, items5, items6, items7, items8, items9, items11, items12, items13); } - + } } - }else{ + } else { top.Ext.getCmp('addQualityMonitoringForm').add({ - id : 'tousseInfoFieldSet'+tousseAndMaterialWrapperCount+'_TP', - xtype:"fieldset", - labelAlign :'left', - title:"器械包信息"+tousseAndMaterialWrapperCount, - autoHeight:true, - items:[{ - layout : 'column', - columnWidth : .5, - labelWidth : 90, - width:recycleQM ? getWidth : "", - id:'setLayout'+tousseAndMaterialWrapperCount+'_TP' + id: 'tousseInfoFieldSet' + tousseAndMaterialWrapperCount + '_TP', + xtype: "fieldset", + labelAlign: 'left', + title: "器械包信息" + tousseAndMaterialWrapperCount, + autoHeight: true, + items: [{ + layout: 'column', + columnWidth: .5, + labelWidth: 90, + width: recycleQM ? getWidth : "", + id: 'setLayout' + tousseAndMaterialWrapperCount + '_TP' }] - }); + }); var tosseAndMaterialWrapper1 = { - layout : 'column', - columnWidth : 1, - labelWidth : 90, - id: 'tosseAndMaterial'+tousseAndMaterialWrapperCount+'_TP' + layout: 'column', + columnWidth: 1, + labelWidth: 90, + id: 'tosseAndMaterial' + tousseAndMaterialWrapperCount + '_TP' }; - setLayoutVal = 'setLayout'+tousseAndMaterialWrapperCount+'_TP'; + setLayoutVal = 'setLayout' + tousseAndMaterialWrapperCount + '_TP'; setLayoutList = tosseAndMaterialWrapper1; - tosseAndMaterialVal = 'tosseAndMaterial'+tousseAndMaterialWrapperCount+'_TP'; + tosseAndMaterialVal = 'tosseAndMaterial' + tousseAndMaterialWrapperCount + '_TP'; top.Ext.getCmp(setLayoutVal).add(setLayoutList); - top.Ext.getCmp('setLayout'+tousseAndMaterialWrapperCount+'_TP').doLayout(); - addTousseItems(tosseAndMaterialVal,addTousseClick,items1,items2,items3,items10,items4,items5,items6,items7,items8,items9,items11,items12,items13); - top.Ext.getCmp('tousseInfoFieldSet'+tousseAndMaterialWrapperCount+'_TP').doLayout(); + top.Ext.getCmp('setLayout' + tousseAndMaterialWrapperCount + '_TP').doLayout(); + addTousseItems(tosseAndMaterialVal, addTousseClick, items1, items2, items3, items10, items4, items5, items6, items7, items8, items9, items11, items12, items13); + top.Ext.getCmp('tousseInfoFieldSet' + tousseAndMaterialWrapperCount + '_TP').doLayout(); top.Ext.getCmp('addQualityMonitoringForm').doLayout(); } } - - }else{//原来的添加器械包 + + } else {//原来的添加器械包 tosseAndMaterial.add(items1); tosseAndMaterial.add(items2); tosseAndMaterial.add(items12); @@ -2353,65 +2353,65 @@ } tosseAndMaterial.doLayout(); - if(!showInput){ - top.Ext.getCmp('tempBarcode'+tousseItemCount+"_"+2).disable(); - top.Ext.getCmp('tempBarcode'+tousseItemCount+"_"+4).disable(); - top.Ext.getCmp('tempBarcode'+tousseItemCount+"_"+12).disable(); + if (!showInput) { + top.Ext.getCmp('tempBarcode' + tousseItemCount + "_" + 2).disable(); + top.Ext.getCmp('tempBarcode' + tousseItemCount + "_" + 4).disable(); + top.Ext.getCmp('tempBarcode' + tousseItemCount + "_" + 12).disable(); } // 重新回收和重新装配,都默认为否 - top.Ext.getCmp('tempBarcode'+tousseItemCount+"_"+7).setValue('否'); - top.Ext.getCmp('tempBarcode'+tousseItemCount+"_"+8).setValue('否'); - top.Ext.getCmp('tempBarcode'+tousseItemCount+"_"+13).setValue('否'); + top.Ext.getCmp('tempBarcode' + tousseItemCount + "_" + 7).setValue('否'); + top.Ext.getCmp('tempBarcode' + tousseItemCount + "_" + 8).setValue('否'); + top.Ext.getCmp('tempBarcode' + tousseItemCount + "_" + 13).setValue('否'); // 顺序包括器械包和材料都排进去 var curOrder = materialItemCount + tousseItemCount + 2; - top.Ext.getCmp('tousseOrder'+tousseItemCount).setValue(curOrder); + top.Ext.getCmp('tousseOrder' + tousseItemCount).setValue(curOrder); // tousseName,tousseBarcode,tousseInstanceId,tAmount,orderNumber - if(tousseName != null && tousseName != ''){ + if (tousseName != null && tousseName != '') { // 打开一条记录 var nameAndBarcode = tousseName; /* if(tousseBarcode != null && tousseBarcode != ''){ nameAndBarcode += "(" + tousseBarcode + ")"; } */ - top.Ext.getCmp('tempBarcode'+tousseItemCount+"_"+1).setValue(tousseBarcode); - top.Ext.getCmp('tempBarcode'+tousseItemCount+"_"+3).setValue(nameAndBarcode); - top.Ext.getCmp('tempBarcode'+tousseItemCount+"_"+5).setValue(tousseInstanceId); - top.Ext.getCmp('tempBarcode'+tousseItemCount+"_"+6).setValue(tAmount); - top.Ext.getCmp('tousseOrder'+tousseItemCount).setValue(orderNumber); - top.Ext.getCmp('tempBarcodeHidden'+tousseItemCount+"_"+1).setValue(tousseBarcode); + top.Ext.getCmp('tempBarcode' + tousseItemCount + "_" + 1).setValue(tousseBarcode); + top.Ext.getCmp('tempBarcode' + tousseItemCount + "_" + 3).setValue(nameAndBarcode); + top.Ext.getCmp('tempBarcode' + tousseItemCount + "_" + 5).setValue(tousseInstanceId); + top.Ext.getCmp('tempBarcode' + tousseItemCount + "_" + 6).setValue(tAmount); + top.Ext.getCmp('tousseOrder' + tousseItemCount).setValue(orderNumber); + top.Ext.getCmp('tempBarcodeHidden' + tousseItemCount + "_" + 1).setValue(tousseBarcode); // 重新回收和重新装配的值 ,isRecycle,isRePacking - if('是'==isRecycle){ - top.Ext.getCmp('tempBarcode'+tousseItemCount+"_"+7).setValue(isRecycle); - top.Ext.getCmp('tempBarcode'+tousseItemCount+"_"+8).setValue('否'); - top.Ext.getCmp('tempBarcode'+tousseItemCount+"_"+13).setValue('否'); - - top.Ext.getCmp('tempBarcode'+tousseItemCount+"_"+2).setValue(true); - top.Ext.getCmp('tempBarcode'+tousseItemCount+"_"+4).setValue(false); - top.Ext.getCmp('tempBarcode'+tousseItemCount+"_"+12).setValue(false); - }else if('是'==isRePacking){ - top.Ext.getCmp('tempBarcode'+tousseItemCount+"_"+7).setValue('否'); - top.Ext.getCmp('tempBarcode'+tousseItemCount+"_"+8).setValue(isRePacking); - top.Ext.getCmp('tempBarcode'+tousseItemCount+"_"+13).setValue('否'); - - top.Ext.getCmp('tempBarcode'+tousseItemCount+"_"+2).setValue(false); - top.Ext.getCmp('tempBarcode'+tousseItemCount+"_"+4).setValue(true); - top.Ext.getCmp('tempBarcode'+tousseItemCount+"_"+12).setValue(false); - }else if('是'==isDiscard){//重新装配 - top.Ext.getCmp('tempBarcode'+tousseItemCount+"_"+7).setValue('否'); - top.Ext.getCmp('tempBarcode'+tousseItemCount+"_"+8).setValue('否'); - top.Ext.getCmp('tempBarcode'+tousseItemCount+"_"+13).setValue(isDiscard); - - top.Ext.getCmp('tempBarcode'+tousseItemCount+"_"+2).setValue(false); - top.Ext.getCmp('tempBarcode'+tousseItemCount+"_"+4).setValue(false); - top.Ext.getCmp('tempBarcode'+tousseItemCount+"_"+12).setValue(true); + if ('是' == isRecycle) { + top.Ext.getCmp('tempBarcode' + tousseItemCount + "_" + 7).setValue(isRecycle); + top.Ext.getCmp('tempBarcode' + tousseItemCount + "_" + 8).setValue('否'); + top.Ext.getCmp('tempBarcode' + tousseItemCount + "_" + 13).setValue('否'); + + top.Ext.getCmp('tempBarcode' + tousseItemCount + "_" + 2).setValue(true); + top.Ext.getCmp('tempBarcode' + tousseItemCount + "_" + 4).setValue(false); + top.Ext.getCmp('tempBarcode' + tousseItemCount + "_" + 12).setValue(false); + } else if ('是' == isRePacking) { + top.Ext.getCmp('tempBarcode' + tousseItemCount + "_" + 7).setValue('否'); + top.Ext.getCmp('tempBarcode' + tousseItemCount + "_" + 8).setValue(isRePacking); + top.Ext.getCmp('tempBarcode' + tousseItemCount + "_" + 13).setValue('否'); + + top.Ext.getCmp('tempBarcode' + tousseItemCount + "_" + 2).setValue(false); + top.Ext.getCmp('tempBarcode' + tousseItemCount + "_" + 4).setValue(true); + top.Ext.getCmp('tempBarcode' + tousseItemCount + "_" + 12).setValue(false); + } else if ('是' == isDiscard) {//重新装配 + top.Ext.getCmp('tempBarcode' + tousseItemCount + "_" + 7).setValue('否'); + top.Ext.getCmp('tempBarcode' + tousseItemCount + "_" + 8).setValue('否'); + top.Ext.getCmp('tempBarcode' + tousseItemCount + "_" + 13).setValue(isDiscard); + + top.Ext.getCmp('tempBarcode' + tousseItemCount + "_" + 2).setValue(false); + top.Ext.getCmp('tempBarcode' + tousseItemCount + "_" + 4).setValue(false); + top.Ext.getCmp('tempBarcode' + tousseItemCount + "_" + 12).setValue(true); } // 禁用 重新回收 重新装配 器械包条码 器械包名称 数量 - if(!showInput){ - top.Ext.getCmp('tempBarcode'+tousseItemCount+"_"+1).disable(); - top.Ext.getCmp('tempBarcode'+tousseItemCount+"_"+2).disable(); - top.Ext.getCmp('tempBarcode'+tousseItemCount+"_"+3).disable(); - top.Ext.getCmp('tempBarcode'+tousseItemCount+"_"+4).disable(); - top.Ext.getCmp('tempBarcode'+tousseItemCount+"_"+6).disable(); - top.Ext.getCmp('tempBarcode'+tousseItemCount+"_"+12).disable(); + if (!showInput) { + top.Ext.getCmp('tempBarcode' + tousseItemCount + "_" + 1).disable(); + top.Ext.getCmp('tempBarcode' + tousseItemCount + "_" + 2).disable(); + top.Ext.getCmp('tempBarcode' + tousseItemCount + "_" + 3).disable(); + top.Ext.getCmp('tempBarcode' + tousseItemCount + "_" + 4).disable(); + top.Ext.getCmp('tempBarcode' + tousseItemCount + "_" + 6).disable(); + top.Ext.getCmp('tempBarcode' + tousseItemCount + "_" + 12).disable(); } } } @@ -2420,14 +2420,14 @@ * @param barcode 包实例条码 * @returns */ -function getTousseInstanceMsg(barcode){ - if(barcode){ - var result ; +function getTousseInstanceMsg(barcode) { + if (barcode) { + var result; DWREngine.setAsync(false); - TousseInstanceTableManager.getTousseInstanceMsgByBarcode(barcode,function(responseText){ + TousseInstanceTableManager.getTousseInstanceMsgByBarcode(barcode, function (responseText) { result = top.Ext.decode(responseText); - if(result.success){ - }else{ + if (result.success) { + } else { result = null; showResultQM("找不到该条码所对应的器械包实例"); } @@ -2444,65 +2444,65 @@ * @param {清洗记录的ID} washRecordId * @param {选中的器械包数组} tousseItems */ -function addQualityMonitoringByResponPart(responPartName,washRecordId,tousseItems) { - addQualityMonitoring('','','',washRecordId,tousseItems); +function addQualityMonitoringByResponPart(responPartName, washRecordId, tousseItems) { + addQualityMonitoring('', '', '', washRecordId, tousseItems); otherPartAddQM = true; - if('全部环节' == responPartName){ + if ('全部环节' == responPartName) { formDefinitionStore.baseParams.responsiblePerson = ""; - }else{ + } else { formDefinitionStore.baseParams.responsiblePerson = responPartName; } formDefinitionStore.load(); - setTimeout(function(){ + setTimeout(function () { // 置空监测项 - if(responPartName == '全部环节'){ + if (responPartName == '全部环节') { top.Ext.getCmp('formName').setValue(""); top.Ext.getCmp("formDefinitionId").setValue(""); top.Ext.getCmp("name").setValue(""); - }else if(responPartName == '其他环节'){ + } else if (responPartName == '其他环节') { var arr = [] - setTimeout(function(){ + setTimeout(function () { var scope; - if(top.Ext.getCmp('scope')){ + if (top.Ext.getCmp('scope')) { scope = top.Ext.getCmp('scope').getValue(); } - if(scope == '器械包'){ - for(var i=0;i 0){ - for(var i=0;i 0) { + for (var i = 0; i < tousseItems.length; i++) { var result = getTousseInstanceMsg(tousseItems[i].data.barcode); arr.push({ - barcode:tousseItems[i].data.barcode, - tousseInstanceId:tousseItems[i].data.id, - tousseDefinitionId:result.tousseDefinitionId, - tousseName:tousseItems[i].data.tousseDefinitionName + '('+tousseItems[i].data.barcode+')', - amount:tousseItems[i].data.amount, - orderNumber:(i+1), - isRecycle:'否', - isRePacking:'否', - isDiscard:'否', - scope:scope, - showInput:true + barcode: tousseItems[i].data.barcode, + tousseInstanceId: tousseItems[i].data.id, + tousseDefinitionId: result.tousseDefinitionId, + tousseName: tousseItems[i].data.tousseDefinitionName + '(' + tousseItems[i].data.barcode + ')', + amount: tousseItems[i].data.amount, + orderNumber: (i + 1), + isRecycle: '否', + isRePacking: '否', + isDiscard: '否', + scope: scope, + showInput: true }); } - loadMateriaAndTousselMsg({},arr); + loadMateriaAndTousselMsg({}, arr); enableRecycleAndRepacking(); top.Ext.getCmp('disabledBarcode').enable(); } @@ -2517,40 +2517,40 @@ * 获取责任环节的combo. * @param id 质量监测实例id */ -function getResponsibilityPartContent(id){ +function getResponsibilityPartContent(id) { return { - layout : 'form', - columnWidth : .5, - labelWidth : (recycleQM && top.screen.width > 1280) ? 182 : labelWidthLeft, - height:setH, - items : [{ - xtype : 'combo', - fieldLabel : "责任环节", - valueField : 'value', - displayField : 'value', - store : new top.Ext.data.SimpleStore({ - fields : [ 'value' ], - data : [[moduleNameArr[0]],[moduleNameArr[1]],[moduleNameArr[2]],[moduleNameArr[3]],[moduleNameArr[4]],[moduleNameArr[5]],[moduleNameArr[8]],[moduleNameArr[9]],['全部环节']] + layout: 'form', + columnWidth: .5, + labelWidth: (recycleQM && top.screen.width > 1280) ? 182 : labelWidthLeft, + height: setH, + items: [{ + xtype: 'combo', + fieldLabel: "责任环节", + valueField: 'value', + displayField: 'value', + store: new top.Ext.data.SimpleStore({ + fields: ['value'], + data: [[moduleNameArr[0]], [moduleNameArr[1]], [moduleNameArr[2]], [moduleNameArr[3]], [moduleNameArr[4]], [moduleNameArr[5]], [moduleNameArr[8]], [moduleNameArr[9]], ['全部环节']] }), - value : '', - triggerAction : 'all', - editable : false, - forceSelection : false, - mode : 'local', - name : "responsibilityPart", - id : "responsibilityPart", - listeners : { - beforequery:function(queryEvent){ + value: '', + triggerAction: 'all', + editable: false, + forceSelection: false, + mode: 'local', + name: "responsibilityPart", + id: "responsibilityPart", + listeners: { + beforequery: function (queryEvent) { - if(id != "" && id != 0){ + if (id != "" && id != 0) { return false; } }, - select : function(combo,record,index){ + select: function (combo, record, index) { responPartName = combo.getValue(); - if('全部环节' == responPartName){ + if ('全部环节' == responPartName) { formDefinitionStore.baseParams.responsiblePerson = ""; - }else{ + } else { formDefinitionStore.baseParams.responsiblePerson = responPartName; } formDefinitionStore.load(); @@ -2560,25 +2560,25 @@ top.Ext.getCmp("name").setValue(""); } }, - anchor : '95%' + anchor: '95%' }] }; } // 监测项带出责任环节的配置 -function getResponsibilityPartContent1(){ +function getResponsibilityPartContent1() { return { - layout : 'form', - columnWidth : .5, - labelWidth : 90, - items : [{ - xtype : 'textfield', - anchor : '95%', - disabled : true, - fieldLabel : "责任环节", - editable : false, - name : "responsibilityPart", - id : "responsibilityPart", - anchor : '95%' + layout: 'form', + columnWidth: .5, + labelWidth: 90, + items: [{ + xtype: 'textfield', + anchor: '95%', + disabled: true, + fieldLabel: "责任环节", + editable: false, + name: "responsibilityPart", + id: "responsibilityPart", + anchor: '95%' }] }; } @@ -2589,153 +2589,153 @@ * formVal 监测项名称 */ -function addQualityMonitoringAndTousselMsg(formId,formVal){ +function addQualityMonitoringAndTousselMsg(formId, formVal) { tousseAndMaterialWrapperCount++; // 质量监测添加‘无’这个项. - if(formVal == '无'){ + if (formVal == '无') { addExtractCheckMaterial(); return; } top.Ext.Ajax.request({ - url : WWWROOT + '/disinfectSystem/formDefinitionAction!loadFormDefinitionWithRepeateItem.do',//后台接口可能需要重写,需要返回监测项的类型和重复填写的监测项信息 - params : { - id : formId, - clickAmount:tousseAndMaterialWrapperCount + url: WWWROOT + '/disinfectSystem/formDefinitionAction!loadFormDefinitionWithRepeateItem.do',//后台接口可能需要重写,需要返回监测项的类型和重复填写的监测项信息 + params: { + id: formId, + clickAmount: tousseAndMaterialWrapperCount }, - success : function(response,options){ + success: function (response, options) { var result = top.Ext.decode(response.responseText); - if(result.success){ - if(result.data.scope == "器械包"){ - addTousseClick = true; - addExtractCheckTousse("","","","","","","","",true,"","","",""); + if (result.success) { + if (result.data.scope == "器械包") { + addTousseClick = true; + addExtractCheckTousse("", "", "", "", "", "", "", "", true, "", "", "", ""); addTousseClick = false; - }else if(result.data.scope== "材料"){ + } else if (result.data.scope == "材料") { addExtractClick = true; - addExtractCheckMaterial("","",1,"","",true,"","","","","","",tousseItemCount); - addExtractClick = false; + addExtractCheckMaterial("", "", 1, "", "", true, "", "", "", "", "", "", tousseItemCount); + addExtractClick = false; }/* else if(result.data.scope == "灭菌炉记录"){ showResultQM('监测项为灭菌炉记录不能添加器械和器械包!'); - } */else if(result.data.scope == "材料和器械包"){ + } */else if (result.data.scope == "材料和器械包") { widthSet = ""; - addTousseClick = true; + addTousseClick = true; addExtractClick = true; top.Ext.getCmp('addQualityMonitoringForm').add({ - id : 'tousseInfoFieldSet'+tousseAndMaterialWrapperCount+'_TMP', - xtype:"fieldset", - labelAlign :'left', - title:"器械包信息", - autoHeight:true, - items:[{ - layout : 'column', - columnWidth : .5, - labelWidth : 90, - width:recycleQM ? getWidth : "", - id:'setLayout'+tousseAndMaterialWrapperCount+'_TMP' + id: 'tousseInfoFieldSet' + tousseAndMaterialWrapperCount + '_TMP', + xtype: "fieldset", + labelAlign: 'left', + title: "器械包信息", + autoHeight: true, + items: [{ + layout: 'column', + columnWidth: .5, + labelWidth: 90, + width: recycleQM ? getWidth : "", + id: 'setLayout' + tousseAndMaterialWrapperCount + '_TMP' }] }); tosseAndMaterialWrapper = { - layout : 'column', - columnWidth : 1, - labelWidth : 90, - id: 'tosseAndMaterial'+tousseAndMaterialWrapperCount+'_TMP' + layout: 'column', + columnWidth: 1, + labelWidth: 90, + id: 'tosseAndMaterial' + tousseAndMaterialWrapperCount + '_TMP' }; - - var setLayoutVal = 'setLayout'+tousseAndMaterialWrapperCount+'_TMP'; + + var setLayoutVal = 'setLayout' + tousseAndMaterialWrapperCount + '_TMP'; var setLayoutList = tosseAndMaterialWrapper; - var tosseAndMaterialId = 'tosseAndMaterial'+tousseAndMaterialWrapperCount+'_TMP'; - + var tosseAndMaterialId = 'tosseAndMaterial' + tousseAndMaterialWrapperCount + '_TMP'; + top.Ext.getCmp(setLayoutVal).add(setLayoutList); - top.Ext.getCmp('setLayout'+tousseAndMaterialWrapperCount+'_TMP').doLayout(); - addExtractCheckTousse("","","","","","","","",true,true,"",tosseAndMaterialId,""); + top.Ext.getCmp('setLayout' + tousseAndMaterialWrapperCount + '_TMP').doLayout(); + addExtractCheckTousse("", "", "", "", "", "", "", "", true, true, "", tosseAndMaterialId, ""); addTousseClick = false; - addExtractCheckMaterial("","",1,"","",true,true,"",tosseAndMaterialId,"","","",tousseItemCount); + addExtractCheckMaterial("", "", 1, "", "", true, true, "", tosseAndMaterialId, "", "", "", tousseItemCount); addExtractClick = false; top.Ext.getCmp('addQualityMonitoringForm').doLayout(); - - }else if(result.data.scope == "无"){ + + } else if (result.data.scope == "无") { addExtractClick = true; - addExtractCheckMaterial("","",1,"","",true,"","","","","","",tousseItemCount); - addExtractClick = false; + addExtractCheckMaterial("", "", 1, "", "", true, "", "", "", "", "", "", tousseItemCount); + addExtractClick = false; } - - if(result.data.items.length > 0){ + + if (result.data.items.length > 0) { var items = new Array(); // 如果显示炉次炉号,添加表单 - if(result.data.showSterilizerNumFrequency == '是'){ - items.push(createQualityMonitoringElementSterName('',true,tousseAndMaterialWrapperCount)); - items.push(createQualityMonitoringElementSterFre('',true,tousseAndMaterialWrapperCount)); + if (result.data.showSterilizerNumFrequency == '是') { + items.push(createQualityMonitoringElementSterName('', true, tousseAndMaterialWrapperCount)); + items.push(createQualityMonitoringElementSterFre('', true, tousseAndMaterialWrapperCount)); } - for(var i = 0 ; i< result.data.items.length ; i++){ + for (var i = 0; i < result.data.items.length; i++) { var item = result.data.items[i]; - if(top.Ext.getCmp('optionAmount').getValue() == null || top.Ext.getCmp('optionAmount').getValue() == ''){ + if (top.Ext.getCmp('optionAmount').getValue() == null || top.Ext.getCmp('optionAmount').getValue() == '') { top.Ext.getCmp('optionAmount').setValue(item.id); - }else{ - top.Ext.getCmp('optionAmount').setValue(top.Ext.getCmp('optionAmount').getValue()+';'+item.id); + } else { + top.Ext.getCmp('optionAmount').setValue(top.Ext.getCmp('optionAmount').getValue() + ';' + item.id); } - var allowBlank = result.data.items[i].requirement == '必填'?false:true; - items.push(createQualityMonitoringItemElement(item.type,item.id,item.name,allowBlank,item.optionsJson,null,item.isTriggerItem)); - if(result.data.items[i].type == '多选'){ + var allowBlank = result.data.items[i].requirement == '必填' ? false : true; + items.push(createQualityMonitoringItemElement(item.type, item.id, item.name, allowBlank, item.optionsJson, null, item.isTriggerItem)); + if (result.data.items[i].type == '多选') { items.push({ - columnWidth : 1, - xtype : "label", - html : ' ', - anchor : '95%' + columnWidth: 1, + xtype: "label", + html: ' ', + anchor: '95%' }); } } - - if(items.length > 0){ + + if (items.length > 0) { top.Ext.getCmp('addQualityMonitoringForm').add({ - id :'itemsFieldSet'+"_"+tousseAndMaterialWrapperCount, - xtype:"fieldset", - labelAlign :'left', - title:"监测项", - layout:'column', - autoHeight:true, - width:recycleQM ? getWidth : "", - items:items + id: 'itemsFieldSet' + "_" + tousseAndMaterialWrapperCount, + xtype: "fieldset", + labelAlign: 'left', + title: "监测项", + layout: 'column', + autoHeight: true, + width: recycleQM ? getWidth : "", + items: items }); } } - - top.Ext.getCmp('addQualityMonitoringForm').doLayout(); - if(top.Ext.getCmp('itemsFieldSet'+"_"+tousseAndMaterialWrapperCount)){ - top.Ext.getCmp('itemsFieldSet'+"_"+tousseAndMaterialWrapperCount).doLayout(); + + top.Ext.getCmp('addQualityMonitoringForm').doLayout(); + if (top.Ext.getCmp('itemsFieldSet' + "_" + tousseAndMaterialWrapperCount)) { + top.Ext.getCmp('itemsFieldSet' + "_" + tousseAndMaterialWrapperCount).doLayout(); } - - if(top.Ext.getCmp('tousseInfoFieldSet')){ + + if (top.Ext.getCmp('tousseInfoFieldSet')) { top.Ext.getCmp('tousseInfoFieldSet').doLayout(); } } }, - failure : function(response, options) { + failure: function (response, options) { showResultQM('系统加载出错,请稍候再试'); } }); } -function showRecyclingInventoryItem(){ +function showRecyclingInventoryItem() { top.Ext.getCmp("idCardAndTousseBarcodeWrapper").show(); top.Ext.getCmp("tousseNameBasicsWrapper").show() - top.Ext.getCmp("recyclePersonWrapper").show(); + top.Ext.getCmp("recyclePersonWrapper").show(); top.Ext.getCmp("recycleDepartmentsWrapper").show(); top.Ext.getCmp("operationRoomWrapper").show(); - top.Ext.getCmp("nurseWrapper").show(); + top.Ext.getCmp("nurseWrapper").show(); top.Ext.getCmp("recycleTimeWrapper").show(); } -function hideRecyclingInventoryItem(){ +function hideRecyclingInventoryItem() { top.Ext.getCmp("idCardAndTousseBarcodeWrapper").hide(); top.Ext.getCmp("tousseNameBasicsWrapper").hide(); - top.Ext.getCmp("recyclePersonWrapper").hide(); + top.Ext.getCmp("recyclePersonWrapper").hide(); top.Ext.getCmp("recycleDepartmentsWrapper").hide(); top.Ext.getCmp("operationRoomWrapper").hide(); - top.Ext.getCmp("nurseWrapper").hide(); + top.Ext.getCmp("nurseWrapper").hide(); top.Ext.getCmp("recycleTimeWrapper").hide(); } -function showCleanAndDisinfectionItem(){ +function showCleanAndDisinfectionItem() { top.Ext.getCmp("rinseBasketsBarcodeWrapper").show();//显示清洗篮筐条码和名称 top.Ext.getCmp("rinseBasketsNameWrapper").show(); top.Ext.getCmp("cleaningMachinePositionWrapper").show(); @@ -2746,7 +2746,7 @@ top.Ext.getCmp("cleaningEndTimeWrapper").show(); } -function hideCleanAndDisinfectionItem(){ +function hideCleanAndDisinfectionItem() { top.Ext.getCmp("rinseBasketsBarcodeWrapper").hide();//显示清洗篮筐条码和名称 top.Ext.getCmp("rinseBasketsNameWrapper").hide(); top.Ext.getCmp("cleaningMachinePositionWrapper").hide(); @@ -2757,21 +2757,21 @@ top.Ext.getCmp("cleaningEndTimeWrapper").hide(); } -function showSterilizationItem(){ +function showSterilizationItem() { top.Ext.getCmp("tousseBarcodeWrapper").show(); top.Ext.getCmp("sterilizationNameWrapper").show(); - top.Ext.getCmp("sterilizationProgramNameWrapper").show(); + top.Ext.getCmp("sterilizationProgramNameWrapper").show(); top.Ext.getCmp("heatWrapper").show(); top.Ext.getCmp("sterilizationStartTimeWrapper").show(); top.Ext.getCmp("sterilizationEndTimeWrapper").show(); } -function hideSterilizationItem(){ +function hideSterilizationItem() { top.Ext.getCmp("tousseBarcodeWrapper").hide(); top.Ext.getCmp("sterilizationNameWrapper").hide(); - top.Ext.getCmp("sterilizationProgramNameWrapper").hide(); + top.Ext.getCmp("sterilizationProgramNameWrapper").hide(); top.Ext.getCmp("heatWrapper").hide(); - top.Ext.getCmp("sterilizationStartTimeWrapper").hide(); + top.Ext.getCmp("sterilizationStartTimeWrapper").hide(); top.Ext.getCmp("sterilizationEndTimeWrapper").hide(); } @@ -2782,75 +2782,75 @@ * @returns */ -function getInspectItemContent(id){ +function getInspectItemContent(id) { return { - layout : 'form', - columnWidth : .5, - labelWidth : (recycleQM && top.screen.width > 1280) ? 182 : labelWidthLeft, - height:setH, - items : [{ + layout: 'form', + columnWidth: .5, + labelWidth: (recycleQM && top.screen.width > 1280) ? 182 : labelWidthLeft, + height: setH, + items: [{ layout: 'column', - columnWidth:1, + columnWidth: 1, //height:25, - items:[{ - layout : 'form', + items: [{ + layout: 'form', columnWidth: .88, - items:[{ - xtype : 'combo', - id : 'formName', - name : 'formName', - queryParam : 'spell', - fieldLabel : '监测项', - minChars : 0, - valueField : 'id', - displayField : 'name', - anchor : '95%', - store : formDefinitionStore, - lazyInit : true, - forceSelection : true, - triggerAction : 'all', - hideTrigger : false, - typeAhead : false, - allowBlank : false, - listeners : { - beforequery:function(queryEvent){ - if(id != "" && id != 0){ + items: [{ + xtype: 'combo', + id: 'formName', + name: 'formName', + queryParam: 'spell', + fieldLabel: '监测项', + minChars: 0, + valueField: 'id', + displayField: 'name', + anchor: '95%', + store: formDefinitionStore, + lazyInit: true, + forceSelection: true, + triggerAction: 'all', + hideTrigger: false, + typeAhead: false, + allowBlank: false, + listeners: { + beforequery: function (queryEvent) { + if (id != "" && id != 0) { return false; } }, - beforeselect : function(combo, record, index) { - if(record.data.name != combo.getValue()){ - if(top.Ext.getCmp('barcode').getValue()){ - getTousseInstanceNameAndResponsiblePerson(top.Ext.getCmp('barcode').getValue(), combo.getValue(), null,false); + beforeselect: function (combo, record, index) { + if (record.data.name != combo.getValue()) { + if (top.Ext.getCmp('barcode').getValue()) { + getTousseInstanceNameAndResponsiblePerson(top.Ext.getCmp('barcode').getValue(), combo.getValue(), null, false); } } }, - select : function(combo,record,index){ - // tousseAndMaterialWrapperCount = 0; + select: function (combo, record, index) { + // tousseAndMaterialWrapperCount = 0; top.Ext.getCmp("formDefinitionId").setValue(combo.getValue()); top.Ext.getCmp("name").setValue(combo.getRawValue()); - addQualityMonitoringItem(combo.getValue(),combo.getRawValue()); + addQualityMonitoringItem(combo.getValue(), combo.getRawValue()); } } }] - - }, - { - layout : 'form', - columnWidth:.12, - id:"addBtnAll", - items : [{ - xtype:'button', - tooltip : '添加监测元素信息', - iconCls : 'btn_ext_add', - handler : function(){ + + }, + { + layout: 'form', + columnWidth: .12, + id: "addBtnAll", + items: [{ + xtype: 'button', + tooltip: '添加监测元素信息', + iconCls: 'btn_ext_add', + handler: function () { var formId = top.Ext.getCmp("formDefinitionId").getValue(); var formVal = top.Ext.getCmp("name").getValue(); - if(formVal== ""){ + if (formVal == "") { showResultQM("监测项为空时不能添加监测元素信息!"); return; } - addQualityMonitoringAndTousselMsg(formId,formVal); + addQualityMonitoringAndTousselMsg(formId, formVal); } }] }] @@ -2866,46 +2866,46 @@ * @param {清洗记录的ID} washRecordId * @param {选中的器械包数组} tousseItems */ -function addQualityMonitoring(id,formDefinitionId,formDefinitionName,washRecordId,tousseItems) { - if(id==null||id=='undentified'){ - id=""; +function addQualityMonitoring(id, formDefinitionId, formDefinitionName, washRecordId, tousseItems) { + if (id == null || id == 'undentified') { + id = ""; } - materialItemCount=0; - tousseItemCount=0; - tousseAndMaterialWrapperCount=0; - if(id==undefined || id == "" || id < 0){ + materialItemCount = 0; + tousseItemCount = 0; + tousseAndMaterialWrapperCount = 0; + if (id == undefined || id == "" || id < 0) { disableShowImageButton = true; - }else{ + } else { disableShowImageButton = false; } formPanel = getFormPanelContent(id); qualityMonitoringWin = new top.Ext.Window({ - id : 'qualityMonitoringWin', - layout : 'fit', - title : '质量监测信息', - width : 900, - modal : true, - autoHeight : true, - border : false, - plain : true, - draggable:false, - items : [ formPanel ] + id: 'qualityMonitoringWin', + layout: 'fit', + title: '质量监测信息', + width: 900, + modal: true, + autoHeight: true, + border: false, + plain: true, + draggable: false, + items: [formPanel] }); qualityMonitoringWin.show(); - if(id != null && id != ''){ + if (id != null && id != '') { top.Ext.getCmp('formName').addClass("fieldReadOnlyNoRemove"); top.Ext.getCmp('responsibilityPart').addClass("fieldReadOnlyNoRemove"); top.Ext.Ajax.request({ - url : WWWROOT + '/disinfectSystem/qualityMonitoringInstanceAction!loadQualityMonitoringInstance.do', - params : {id : id}, - success : function(response,options){ + url: WWWROOT + '/disinfectSystem/qualityMonitoringInstanceAction!loadQualityMonitoringInstance.do', + params: { id: id }, + success: function (response, options) { var result = top.Ext.decode(response.responseText); - if(result.success){ - if(result.data.status == '已审核'){ + if (result.success) { + if (result.data.status == '已审核') { top.Ext.getCmp('saveAndCreateBtn').hide(); top.Ext.getCmp('saveBtn').hide(); - }else { + } else { top.Ext.getCmp('saveAndCreateBtn').show(); top.Ext.getCmp('saveBtn').show(); } @@ -2919,48 +2919,48 @@ //top.Ext.getCmp('sterilizerFre').setValue(result.data.sterilizerFrequency);//DGZYY-161不要了 top.Ext.getCmp('errorDamageQmKey').setValue(result.data.errorDamageQmKey); //top.Ext.getCmp('inspectType').setValue(result.data.scope); - if(result.data.name == "无"){ + if (result.data.name == "无") { top.Ext.getCmp("formDefinitionId").setValue(0); - }else{ + } else { top.Ext.getCmp("formDefinitionId").setValue(result.data.formDefinition.id); top.Ext.getCmp('handleDepart').setValue(result.data.formDefinition.handleDepart); } - if(result.data.scope == '无'){ + if (result.data.scope == '无') { //FSSDERMYY-18:隐藏器械包信息 top.Ext.getCmp('tousseInfoFieldSet').setVisible(false); } top.Ext.getCmp('responsibilityPart').setValue(result.data.responsibilityPart); - top.Ext.getCmp('dateTime').setValue(top.Ext.util.Format.date(new Date(result.data.dateTime.time),"Y-m-d H:i")); - + top.Ext.getCmp('dateTime').setValue(top.Ext.util.Format.date(new Date(result.data.dateTime.time), "Y-m-d H:i")); + top.Ext.getCmp('scope').setValue(result.data.scope); top.Ext.getCmp('responsiblePerson').setValue(result.data.responsiblePerson); top.Ext.getCmp('createUserName').setValue(result.data.createUserName); top.Ext.getCmp('tousseDefinitionId').setValue(result.data.tousseDefinitionId); top.Ext.getCmp('orgUnitCoding').setValue(result.data.orgUnitCoding); top.Ext.getCmp('orgUnit').setValue(result.data.orgUnit); - + qualityMonitoringWRRecordID = result.data.washAndDisinfectRecordId; qualityMonitoringSterilizationID = result.data.sterilizationRecordId; - if('是'==result.data.isAllTousseOfSterile){ + if ('是' == result.data.isAllTousseOfSterile) { top.Ext.getCmp('isAllTousseOfSterile').setValue(result.data.isAllTousseOfSterile); top.Ext.getCmp('allTousseOfSterile').setValue(true); } - - if(result.data.responsibilityPart == "回收清点" && result.data.recordRecycleInformation == "是"){//要显示对应的输入框并赋值 + + if (result.data.responsibilityPart == "回收清点" && result.data.recordRecycleInformation == "是") {//要显示对应的输入框并赋值 showRecyclingInventoryItem();//显示回收清点对应的 top.Ext.getCmp("idCardAndTousseBarcode").setValue(result.data.scanTousseInstance.tousseInstanceBarcode); top.Ext.getCmp('tousseNameBasics').setValue(result.data.scanTousseInstance.tousseInstanceName); top.Ext.getCmp("scanTousseInstance_id").setValue(result.data.scanTousseInstance.tousseInstanceId); - if(result.data.scanTousseInstance.recyclingRecordJSON != undefined){ + if (result.data.scanTousseInstance.recyclingRecordJSON != undefined) { top.Ext.getCmp("recyclePerson").setValue(result.data.scanTousseInstance.recyclingRecordJSON.reUser); top.Ext.getCmp("recycleDepartments").setValue(result.data.scanTousseInstance.recyclingRecordJSON.reDept); top.Ext.getCmp("operationRoom").setValue(result.data.scanTousseInstance.recyclingRecordJSON.lastUseRecordOperationRoom); top.Ext.getCmp("nurse").setValue(result.data.scanTousseInstance.recyclingRecordJSON.lastUseRecordCircuitNurse); top.Ext.getCmp("recycleTime").setValue(result.data.scanTousseInstance.recyclingRecordJSON.reTime); } - - }else if(result.data.responsibilityPart == "清洗消毒" && result.data.recordRinseInformation == "是"){//要显示对应的输入框并赋值 + + } else if (result.data.responsibilityPart == "清洗消毒" && result.data.recordRinseInformation == "是") {//要显示对应的输入框并赋值 showCleanAndDisinfectionItem(); top.Ext.getCmp("rinseBasketsName").setValue(result.data.scanWashAndDisinfectRecord.washBasketName); top.Ext.getCmp("cleaningMachinePosition").setValue(result.data.scanWashAndDisinfectRecord.position); @@ -2970,64 +2970,64 @@ top.Ext.getCmp("cleaningStartTime").setValue(result.data.scanWashAndDisinfectRecord.startDate); top.Ext.getCmp("cleaningEndTime").setValue(result.data.scanWashAndDisinfectRecord.endDate); top.Ext.getCmp("scanWashRecord_id").setValue(result.data.scanWashAndDisinfectRecord.washRecordID); - } else if(result.data.responsibilityPart == "灭菌管理" && result.data.recordSterilizatioInformation == "是"){//要显示对应的输入框并赋值 - showSterilizationItem(); + } else if (result.data.responsibilityPart == "灭菌管理" && result.data.recordSterilizatioInformation == "是") {//要显示对应的输入框并赋值 + showSterilizationItem(); top.Ext.getCmp('tousseBarcode').setValue(result.data.scanTousseInstance.tousseInstanceBarcode); top.Ext.getCmp("scanTousseInstance_id").setValue(result.data.scanTousseInstance.tousseInstanceId); - if(result.data.scanTousseInstance.sterilizationRecordJSON != undefined){ + if (result.data.scanTousseInstance.sterilizationRecordJSON != undefined) { top.Ext.getCmp("sterilizationName").setValue(result.data.scanTousseInstance.sterilizationRecordJSON.sterilizerName); - top.Ext.getCmp("sterilizationProgramName").setValue(result.data.scanTousseInstance.sterilizationRecordJSON.sterilizationType); - top.Ext.getCmp("heat").setValue(result.data.scanTousseInstance.sterilizationRecordJSON.frequency); + top.Ext.getCmp("sterilizationProgramName").setValue(result.data.scanTousseInstance.sterilizationRecordJSON.sterilizationType); + top.Ext.getCmp("heat").setValue(result.data.scanTousseInstance.sterilizationRecordJSON.frequency); top.Ext.getCmp("sterilizationStartTime").setValue(result.data.scanTousseInstance.sterilizationRecordJSON.startDate); top.Ext.getCmp("sterilizationEndTime").setValue(result.data.scanTousseInstance.sterilizationRecordJSON.endDate); } } - - if(result.data.basketName!=null && result.data.basketName != ""){ + + if (result.data.basketName != null && result.data.basketName != "") { top.Ext.getCmp('containerName').setValue(result.data.basketName); - }else{ + } else { top.Ext.getCmp("insertBasket").hide(); top.Ext.getCmp("containerNameItem").hide(); - top.Ext.getCmp('containerName').setVisible(false); - top.Ext.getCmp('containerName').getEl().up('.x-form-item').setDisplayed(false); + top.Ext.getCmp('containerName').setVisible(false); + top.Ext.getCmp('containerName').getEl().up('.x-form-item').setDisplayed(false); } materialDefinitionStore.baseParams['spell'] = ""; materialDefinitionStore.reload(); - - if(qualityMonitoringWRRecordID > 0 && (sstsConfig.hasOwnProperty('haveRinserPosition')) && sstsConfig.haveRinserPosition){ - top.Ext.getCmp('basketBarcodeC').setVisible(true); + + if (qualityMonitoringWRRecordID > 0 && (sstsConfig.hasOwnProperty('haveRinserPosition')) && sstsConfig.haveRinserPosition) { + top.Ext.getCmp('basketBarcodeC').setVisible(true); top.Ext.getCmp('positionC').setVisible(true); - }else{ + } else { top.Ext.getCmp('basketBarcodeC').setVisible(false); top.Ext.getCmp('positionC').setVisible(false); } - - if("材料" == result.data.scope){ + + if ("材料" == result.data.scope) { hideFirstTousse(); showFirstMaterial(); - top.Ext.getCmp('recycleC').setVisible(false); + top.Ext.getCmp('recycleC').setVisible(false); top.Ext.getCmp('repackingC').setVisible(false); - top.Ext.getCmp('disabledBarcodeC').setVisible(false); + top.Ext.getCmp('disabledBarcodeC').setVisible(false); top.Ext.getCmp('allTousseOfSterile').setVisible(false); top.Ext.getCmp('allTousseOfSterile').getEl().up('.x-form-item').setDisplayed(false); //top.Ext.getCmp('addExtractCheckTousse').setVisible(false); loadMaterialMsg(result.data.qualityMonitoringGoodsList); - }else if("器械包" == result.data.scope){ + } else if ("器械包" == result.data.scope) { hideFirstMaterial(); showFirstTousse(); - loadTousseMsg(result.data,result.data.qualityMonitoringGoodsList); - }else if("材料和器械包" == result.data.scope){ + loadTousseMsg(result.data, result.data.qualityMonitoringGoodsList); + } else if ("材料和器械包" == result.data.scope) { showFirstTousse(); showFirstMaterial(); - loadMateriaAndTousselMsg(result.data,result.data.qualityMonitoringGoodsList); + loadMateriaAndTousselMsg(result.data, result.data.qualityMonitoringGoodsList); } - if(result.data.name == "无" || result.data.scope == '无'){ + if (result.data.name == "无" || result.data.scope == '无') { // 监测项名称,监测范围是无时,加载材料,隐藏器械包 hideFirstTousse(); showFirstMaterial(); - top.Ext.getCmp('recycleC').setVisible(false); + top.Ext.getCmp('recycleC').setVisible(false); top.Ext.getCmp('repackingC').setVisible(false); - top.Ext.getCmp('disabledBarcodeC').setVisible(false); + top.Ext.getCmp('disabledBarcodeC').setVisible(false); top.Ext.getCmp('allTousseOfSterile').setVisible(false); top.Ext.getCmp('allTousseOfSterile').getEl().up('.x-form-item').setDisplayed(false); //top.Ext.getCmp('addExtractCheckTousse').setVisible(false); @@ -3045,52 +3045,52 @@ top.Ext.getCmp('optionAmount').setValue(''); var items = new Array(); // 如果显示炉次炉号,添加表单 - if(result.showSterNameAndFre == '是'){ - items.push(createQualityMonitoringElementSterName(result.data.sterilizerName,"","")); - items.push(createQualityMonitoringElementSterFre(result.data.sterilizerFrequency,"","")); + if (result.showSterNameAndFre == '是') { + items.push(createQualityMonitoringElementSterName(result.data.sterilizerName, "", "")); + items.push(createQualityMonitoringElementSterFre(result.data.sterilizerFrequency, "", "")); } - if(result.data.scope == "灭菌炉记录"){ + if (result.data.scope == "灭菌炉记录") { top.Ext.getCmp('sterilizationRecordInfo').setVisible(true); // 如果监测范围为灭菌炉记录,隐藏器械包信息 top.Ext.getCmp('tousseInfoFieldSet').setVisible(false); - }else{ + } else { top.Ext.getCmp('sterilizationRecordInfo').setVisible(false); } - - for(var i = 0 ;i < result.data.items.length ;i++){ + + for (var i = 0; i < result.data.items.length; i++) { var item = result.data.items[i].definitionItem; - if(top.Ext.getCmp('optionAmount').getValue() == null || top.Ext.getCmp('optionAmount').getValue() == ''){ + if (top.Ext.getCmp('optionAmount').getValue() == null || top.Ext.getCmp('optionAmount').getValue() == '') { top.Ext.getCmp('optionAmount').setValue(item.id); - }else{ - top.Ext.getCmp('optionAmount').setValue(top.Ext.getCmp('optionAmount').getValue()+';'+item.id); + } else { + top.Ext.getCmp('optionAmount').setValue(top.Ext.getCmp('optionAmount').getValue() + ';' + item.id); } - var allowBlank = item.requirement == '必填' ? false:true; - items.push(createQualityMonitoringItemElement(item.type,item.id,item.name,allowBlank,item.optionsJson,result.data.items[i].showAnswer,item.isTriggerItem)); - if(item.type == '多选'){ + var allowBlank = item.requirement == '必填' ? false : true; + items.push(createQualityMonitoringItemElement(item.type, item.id, item.name, allowBlank, item.optionsJson, result.data.items[i].showAnswer, item.isTriggerItem)); + if (item.type == '多选') { items.push({ - columnWidth : 1, - xtype : "label", - html : ' ', - anchor : '95%' + columnWidth: 1, + xtype: "label", + html: ' ', + anchor: '95%' }); } } - + top.Ext.getCmp('addQualityMonitoringForm').remove('itemsFieldSet'); - if(items.length > 0){ + if (items.length > 0) { top.Ext.getCmp('addQualityMonitoringForm').add({ - id : 'itemsFieldSet', - xtype:"fieldset", - labelWidth :400, - labelAlign :'left', - title:"监测项", - layout:'column', - autoHeight:true, - items:items + id: 'itemsFieldSet', + xtype: "fieldset", + labelWidth: 400, + labelAlign: 'left', + title: "监测项", + layout: 'column', + autoHeight: true, + items: items }); } top.Ext.getCmp('addQualityMonitoringForm').doLayout(); - if(top.Ext.getCmp('itemsFieldSet')){ + if (top.Ext.getCmp('itemsFieldSet')) { top.Ext.getCmp('itemsFieldSet').doLayout(); } //打开已有质量监测记录,器械包条码,器械包名称,重新回收和重新装配都禁用掉,不能再修改 @@ -3105,53 +3105,53 @@ top.Ext.getCmp('basketBarcode').disable(); top.Ext.getCmp('position').disable(); top.Ext.getCmp('allTousseOfSterile').disable(); - }else{ + } else { showResultQM("找不到该条码所对应的器械包实例"); } }, - failure : function(response, options) { + failure: function (response, options) { showResultQM('系统加载出错,请稍候再试'); } }); - }else{ - if(qualityMonitoringWRRecordID > 0 && (sstsConfig.hasOwnProperty('haveRinserPosition')) && sstsConfig.haveRinserPosition){ - top.Ext.getCmp('basketBarcodeC').setVisible(true); + } else { + if (qualityMonitoringWRRecordID > 0 && (sstsConfig.hasOwnProperty('haveRinserPosition')) && sstsConfig.haveRinserPosition) { + top.Ext.getCmp('basketBarcodeC').setVisible(true); top.Ext.getCmp('positionC').setVisible(true); - }else{ + } else { top.Ext.getCmp('basketBarcodeC').setVisible(false); top.Ext.getCmp('positionC').setVisible(false); } setStartDate(top.Ext, 'yyyy/MM/dd HH:mm', 'dateTime'); //(设置抽检时间,取服务器时间 cjr) disableRecycleAndRepacking(); var resonPart = top.Ext.getCmp('responsibilityPart').getValue(); - if(resonPart != null && resonPart != '') { - if(resonPart == '全部环节'){ + if (resonPart != null && resonPart != '') { + if (resonPart == '全部环节') { formDefinitionStore.baseParams.responsiblePerson = ""; - }else{ + } else { formDefinitionStore.baseParams.responsiblePerson = resonPart; } - }else{ + } else { top.Ext.getCmp('responsibilityPart').setValue('全部环节'); formDefinitionStore.baseParams.responsiblePerson = ""; } - if( !isUndefinedOrNullOrEmpty(formDefinitionId) && !isUndefinedOrNullOrEmpty(formDefinitionName) ){ + if (!isUndefinedOrNullOrEmpty(formDefinitionId) && !isUndefinedOrNullOrEmpty(formDefinitionName)) { top.Ext.getCmp('formName').setValue(formDefinitionName); - addQualityMonitoringItem(formDefinitionId,formDefinitionName); + addQualityMonitoringItem(formDefinitionId, formDefinitionName); top.Ext.getCmp("formDefinitionId").setValue(formDefinitionId); top.Ext.getCmp("name").setValue(formDefinitionName); - }else{ + } else { formDefinitionStore.load(); } } - if(washRecordId){ + if (washRecordId) { top.Ext.Ajax.request({ - url : WWWROOT + '/disinfectSystem/qualityMonitoringInstanceAction!loadWashRecordInfoById.do', - params : { - washRecordId : washRecordId + url: WWWROOT + '/disinfectSystem/qualityMonitoringInstanceAction!loadWashRecordInfoById.do', + params: { + washRecordId: washRecordId }, - success : function(response,options){ + success: function (response, options) { var result = top.Ext.decode(response.responseText); - if(result.success == true){ + if (result.success == true) { var record = result.data; top.Ext.getCmp('rinseBasketsName').setValue(record.washBasketName); top.Ext.getCmp('cleaningMachinePosition').setValue(record.position); @@ -3162,61 +3162,61 @@ top.Ext.getCmp('cleaningEndTime').setValue(record.endDate); top.Ext.getCmp('scanWashRecord_id').setValue(record.washRecordID); top.Ext.getCmp('responsiblePerson').setValue(record.personInCharge); - }else{ + } else { showResultQM(result.message); } } }); } - setTimeout(function(){ + setTimeout(function () { var scope; - if(top.Ext.getCmp('scope')){ + if (top.Ext.getCmp('scope')) { scope = top.Ext.getCmp('scope').getValue(); } - if(scope == '器械包' || scope == '材料和器械包'){ - if(tousseItems && tousseItems.length > 0){ + if (scope == '器械包' || scope == '材料和器械包') { + if (tousseItems && tousseItems.length > 0) { newTousseItems = tousseItems; } } }, 500); } -function uploadWindowA(imageType,id){ - var onUploadComplete = function(dialog){ - disableShowImageButton = false; - dialog.hide(); - }; - //文件上传成功后的回调函数 - var onUploadSuccess = function(dialog, filename, resp_data, record){ - disableShowImageButton = false; - dialog.hide(); - }; -// //文件上传失败后的回调函数 - var onUploadFailed = function(dialog, filename, resp_data, record){ +function uploadWindowA(imageType, id) { + var onUploadComplete = function (dialog) { + disableShowImageButton = false; + dialog.hide(); + }; + //文件上传成功后的回调函数 + var onUploadSuccess = function (dialog, filename, resp_data, record) { + disableShowImageButton = false; + dialog.hide(); + }; + // //文件上传失败后的回调函数 + var onUploadFailed = function (dialog, filename, resp_data, record) { showResultQM(resp_data.message);//resp_data是json格式的数据 - disableShowImageButton = true; - }; - var dialog = new top.top.Ext.ux.UploadDialog.Dialog({ - title: "上传" + imageType, - url:WWWROOT + '/disinfectSystem/baseData/uploadImageFileAction!uploadImage.do?imageType='+encodeURI(imageType)+'&objectId='+id , //这里我用struts2做后台处理 - post_var_name:'uploadFiles',//这里是自己定义的,默认的名字叫file - width : 450, - height : 300, - minWidth : 450, - minHeight : 300, - draggable : true , - resizable : true , - constraintoviewport: true , - permitted_extensions:['JPG','jpg','jpeg','JPEG','GIF','gif','png','PNG'], - modal: true , - reset_on_hide: false , - allow_close_on_upload: false , //关闭上传窗口是否仍然上传文件 - upload_autostart: false - }); - dialog.show(); - dialog.on('uploadsuccess',onUploadSuccess); //定义上传成功回调函数 - dialog.on('uploadfailed',onUploadFailed); //定义上传失败回调函数 -// dialog.on('uploadcomplete',onUploadComplete); //定义上传完成回调函数 + disableShowImageButton = true; + }; + var dialog = new top.top.Ext.ux.UploadDialog.Dialog({ + title: "上传" + imageType, + url: WWWROOT + '/disinfectSystem/baseData/uploadImageFileAction!uploadImage.do?imageType=' + encodeURI(imageType) + '&objectId=' + id, //这里我用struts2做后台处理 + post_var_name: 'uploadFiles',//这里是自己定义的,默认的名字叫file + width: 450, + height: 300, + minWidth: 450, + minHeight: 300, + draggable: true, + resizable: true, + constraintoviewport: true, + permitted_extensions: ['JPG', 'jpg', 'jpeg', 'JPEG', 'GIF', 'gif', 'png', 'PNG'], + modal: true, + reset_on_hide: false, + allow_close_on_upload: false, //关闭上传窗口是否仍然上传文件 + upload_autostart: false + }); + dialog.show(); + dialog.on('uploadsuccess', onUploadSuccess); //定义上传成功回调函数 + dialog.on('uploadfailed', onUploadFailed); //定义上传失败回调函数 + // dialog.on('uploadcomplete',onUploadComplete); //定义上传完成回调函数 } @@ -3235,53 +3235,53 @@ return arr; } -function getTousseBarcode(wrapper){ +function getTousseBarcode(wrapper) { var arrBarcode = null; var tousseArrHidden2 = []; - for(var j = 0; j < wrapper.length;j++){ + for (var j = 0; j < wrapper.length; j++) { var parentId = wrapper[j].id; - if(wrapper[j].items == undefined){ + if (wrapper[j].items == undefined) { var tousseRecycleOrRePacking = top.Ext.getCmp(parentId).getValue(); tousseArrHidden2.push(tousseRecycleOrRePacking); - if(top.Ext.getCmp("scope").getValue() == "器械包" && tousseArrHidden2.length == 5){ - if(arrBarcode == null){ + if (top.Ext.getCmp("scope").getValue() == "器械包" && tousseArrHidden2.length == 5) { + if (arrBarcode == null) { arrBarcode = tousseArrHidden2[4]; - }else{ - if(tousseArrHidden2[4] != ""){ + } else { + if (tousseArrHidden2[4] != "") { //arrBarcode = arrBarcode.concat(tousseArrHidden[4]); - arrBarcode = arrBarcode + ","+tousseArrHidden2[4]; + arrBarcode = arrBarcode + "," + tousseArrHidden2[4]; } - + } tousseArrHidden2 = []; } - }else if(parentId.indexOf("tosseAndMaterialList") != -1 ){//是抽检器械 - if(arrBarcode == null){ + } else if (parentId.indexOf("tosseAndMaterialList") != -1) {//是抽检器械 + if (arrBarcode == null) { arrBarcode = tousseArrHidden2[4]; - }else{ - if(tousseArrHidden2[4] != ""){ + } else { + if (tousseArrHidden2[4] != "") { //arrBarcode = arrBarcode.concat(tousseArrHidden[4]); - arrBarcode = arrBarcode + ","+tousseArrHidden2[4]; + arrBarcode = arrBarcode + "," + tousseArrHidden2[4]; } - + } tousseArrHidden2 = []; - }else{ + } else { continue; } } return arrBarcode; } -function setTousseArgument(wrapper){ +function setTousseArgument(wrapper) { var tousseBagsList = {}; var tousseArrHidden = []; var tousseBags = []; - for(var j = 0; j < wrapper.length;j++){ + for (var j = 0; j < wrapper.length; j++) { var parentId = wrapper[j].id; - if(parentId.indexOf("addExtractCheckTousseBtn") != -1){//如果是添加按钮,不用做什么 - - }else if(parentId.indexOf("tosseAndMaterialList") != -1 ){//是抽检器械,往下找items + if (parentId.indexOf("addExtractCheckTousseBtn") != -1) {//如果是添加按钮,不用做什么 + + } else if (parentId.indexOf("tosseAndMaterialList") != -1) {//是抽检器械,往下找items tousseBagsList.tousseInstanceId = tousseArrHidden[0]; tousseBagsList.tousseRecycle = tousseArrHidden[1]; tousseBagsList.tousseRePacking = tousseArrHidden[2]; @@ -3291,141 +3291,141 @@ var materialArrHidden = []; //抽检器械数据 var materiaItems = wrapper[j].items.items; - for(var m = 0; m < materiaItems.length; m++){ + for (var m = 0; m < materiaItems.length; m++) { var materiaItemsId = materiaItems[m].id; //不是按钮或者不是位置,位置不传是看原先的代码没有传 - if(materiaItemsId.indexOf("addExtractCheckMaterialBtnC") == -1 && materiaItemsId.indexOf("basketBarcodeC") == -1 ){ - if(materiaItems[m].items == undefined){ + if (materiaItemsId.indexOf("addExtractCheckMaterialBtnC") == -1 && materiaItemsId.indexOf("basketBarcodeC") == -1) { + if (materiaItems[m].items == undefined) { materialArrHidden.push(top.Ext.getCmp(materiaItemsId).getValue()); - }else{ - if(materiaItems[m].items.items[0].fieldLabel == "抽检器械" && m > 1){ - + } else { + if (materiaItems[m].items.items[0].fieldLabel == "抽检器械" && m > 1) { + materialInfos.push({ - "material":materialArrHidden[0], - "amount":materialArrHidden[1], - "position":materialArrHidden[2], - "order":materialArrHidden[3] + "material": materialArrHidden[0], + "amount": materialArrHidden[1], + "position": materialArrHidden[2], + "order": materialArrHidden[3] }) materialArrHidden = []; } materialArrHidden.push(materiaItems[m].items.items[0].el.dom.value); } } } - + materialInfos.push({ - "material":materialArrHidden[0], - "amount":materialArrHidden[1], - "position":materialArrHidden[2], - "order":materialArrHidden[3] + "material": materialArrHidden[0], + "amount": materialArrHidden[1], + "position": materialArrHidden[2], + "order": materialArrHidden[3] }) materialArrHidden = []; - + tousseBagsList.materialInfos = materialInfos; tousseBags.push(tousseBagsList); tousseArrHidden = []; - tousseBagsList = {}; - }else if(wrapper[j].items == undefined){//隐藏域的情况 + tousseBagsList = {}; + } else if (wrapper[j].items == undefined) {//隐藏域的情况 var tousseRecycleOrRePacking = top.Ext.getCmp(parentId).getValue(); var index = parentId.split('_')[1]; - if(index == '5'){ + if (index == '5') { tousseArrHidden[0] = tousseRecycleOrRePacking; - }else if(index == '7'){ + } else if (index == '7') { tousseArrHidden[1] = tousseRecycleOrRePacking; - }else if(index == '8'){ + } else if (index == '8') { tousseArrHidden[2] = tousseRecycleOrRePacking; - }else if(index == undefined || index == 'undefined'){ + } else if (index == undefined || index == 'undefined') { tousseArrHidden[3] = tousseRecycleOrRePacking; - }else if(index == '1'){ + } else if (index == '1') { tousseArrHidden[4] = tousseRecycleOrRePacking; - }else if(index == '13'){ + } else if (index == '13') { tousseArrHidden[5] = tousseRecycleOrRePacking; } - if(top.Ext.getCmp("scope").getValue() == "器械包" && tousseArrHidden.length == 6){ + if (top.Ext.getCmp("scope").getValue() == "器械包" && tousseArrHidden.length == 6) { tousseBagsList.tousseInstanceId = tousseArrHidden[0]; tousseBagsList.tousseRecycle = tousseArrHidden[1]; tousseBagsList.tousseRePacking = tousseArrHidden[2]; - tousseBagsList.order = tousseArrHidden[3]; + tousseBagsList.order = tousseArrHidden[3]; tousseBagsList.tousseBarcode = tousseArrHidden[4];//器械包条码隐藏域值 tousseBagsList.tousseDiscard = tousseArrHidden[5]; tousseBags.push(tousseBagsList); tousseArrHidden = []; tousseBagsList = {}; - }else if(top.Ext.getCmp("scope").getValue() == "材料和器械包"){ + } else if (top.Ext.getCmp("scope").getValue() == "材料和器械包") { tousseBagsList.tousseDiscard = tousseArrHidden[5]; } - }else if(wrapper[j].items.items[0].fieldLabel == "重新回收" || wrapper[j].items.items[0].fieldLabel == "重新装配"){ + } else if (wrapper[j].items.items[0].fieldLabel == "重新回收" || wrapper[j].items.items[0].fieldLabel == "重新装配") { continue; - }else{//器械包名称,器械包数量 + } else {//器械包名称,器械包数量 var tousseBarcode = wrapper[j].items.items[0].el.dom.value; - if(wrapper[j].items.items[0].fieldLabel == "器械包条码"){ + if (wrapper[j].items.items[0].fieldLabel == "器械包条码") { //tousseBagsList.tousseBarcode = tousseBarcode;已经被清空了 - }else if(wrapper[j].items.items[0].fieldLabel == "器械包名称"){ + } else if (wrapper[j].items.items[0].fieldLabel == "器械包名称") { tousseBagsList.tousseName = tousseBarcode; - tousseBagsList.tousseDefinitionId = wrapper[j].items.items[1].el.dom.value; - }else if(wrapper[j].items.items[0].fieldLabel == "器械包数量"){ + tousseBagsList.tousseDefinitionId = wrapper[j].items.items[1].el.dom.value; + } else if (wrapper[j].items.items[0].fieldLabel == "器械包数量") { tousseBagsList.tousseAmount = tousseBarcode; } - } + } } return tousseBags; } -function setMaterialArgument(materialWrapper){ - var materialWrapperHidden = []; - var materialInfos = []; - var tousseBags2 = []; - for(var p = 0; p < materialWrapper.length;p ++){ +function setMaterialArgument(materialWrapper) { + var materialWrapperHidden = []; + var materialInfos = []; + var tousseBags2 = []; + for (var p = 0; p < materialWrapper.length; p++) { var materialParentId = materialWrapper[p].id; - if(materialParentId.indexOf("addExtractCheckMaterialBtnC") == -1 && materialParentId.indexOf("basketBarcodeC") == -1){//除开添加按钮 - if(materialWrapper[p].items == undefined){ - materialWrapperHidden.push(top.Ext.getCmp(materialParentId).getValue()); + if (materialParentId.indexOf("addExtractCheckMaterialBtnC") == -1 && materialParentId.indexOf("basketBarcodeC") == -1) {//除开添加按钮 + if (materialWrapper[p].items == undefined) { + materialWrapperHidden.push(top.Ext.getCmp(materialParentId).getValue()); - var tempMaterialInfo = { - "material":materialWrapperHidden[0], - "amount":materialWrapperHidden[1], - "position":materialWrapperHidden[2], - "order":materialWrapperHidden[3] - }; - materialInfos.push(tempMaterialInfo); - var materialInfosObj = {}; - materialInfosObj.materialInfos = materialInfos; - tousseBags2.push(materialInfosObj); - materialWrapperHidden = []; - materialInfos = []; - - }else{ - materialWrapperHidden.push(materialWrapper[p].items.items[0].el.dom.value); + var tempMaterialInfo = { + "material": materialWrapperHidden[0], + "amount": materialWrapperHidden[1], + "position": materialWrapperHidden[2], + "order": materialWrapperHidden[3] + }; + materialInfos.push(tempMaterialInfo); + var materialInfosObj = {}; + materialInfosObj.materialInfos = materialInfos; + tousseBags2.push(materialInfosObj); + materialWrapperHidden = []; + materialInfos = []; + + } else { + materialWrapperHidden.push(materialWrapper[p].items.items[0].el.dom.value); } } } - return tousseBags2; + return tousseBags2; } -function setConfigItemOptionArgument(wrapperItemsFieldSet){ +function setConfigItemOptionArgument(wrapperItemsFieldSet) { var configItemOption = {}; var configItemOptionArr = []; - for(var x = 0; x < wrapperItemsFieldSet.length; x++){ - if((wrapperItemsFieldSet[x].xtype) != "label"){ + for (var x = 0; x < wrapperItemsFieldSet.length; x++) { + if ((wrapperItemsFieldSet[x].xtype) != "label") { var configItemKey; var configItemVal; - if(((wrapperItemsFieldSet[x].items.items[0].id)).indexOf("triggerItemIds") != -1){ + if (((wrapperItemsFieldSet[x].items.items[0].id)).indexOf("triggerItemIds") != -1) { configItemKey = wrapperItemsFieldSet[x].items.items[1].id; configItemVal = top.Ext.getCmp(configItemKey).getValue(); - }else if((wrapperItemsFieldSet[x].items.items[0].xtype) == "datefieldWithMin"){ + } else if ((wrapperItemsFieldSet[x].items.items[0].xtype) == "datefieldWithMin") { configItemKey = wrapperItemsFieldSet[x].items.items[0].id; configItemVal = wrapperItemsFieldSet[x].items.items[0].value; - }else{ + } else { configItemKey = wrapperItemsFieldSet[x].items.items[0].id; configItemVal = top.Ext.getCmp(configItemKey).getValue(); - + } configItemOption[configItemKey] = configItemVal; } } - + configItemOptionArr.push(configItemOption); return configItemOptionArr; } @@ -3437,31 +3437,31 @@ * @param saveAndCreate 是否为“保存并新建”操作 * @returns {Boolean} */ -function saveQualityMonitoringNew(thiz,materialDefinitionStore,saveAndCreate) { +function saveQualityMonitoringNew(thiz, materialDefinitionStore, saveAndCreate) { //1、验证所有的监测细则的填写是否合法 var optionAmount = top.Ext.getCmp('optionAmount').getValue(); //监测细则的表单元素id集合(用分号分隔) if (optionAmount) { var optionAmountArr = optionAmount.split(';'); - for(var i = 0 ; i < optionAmountArr.length ; i++){ + for (var i = 0; i < optionAmountArr.length; i++) { var itemId = optionAmountArr[i]; - if(!top.Ext.getCmp('hideElement'+itemId).hidden){ - if(!top.Ext.getCmp('configItemOption'+itemId).isValid()){ + if (!top.Ext.getCmp('hideElement' + itemId).hidden) { + if (!top.Ext.getCmp('configItemOption' + itemId).isValid()) { showResultQM("请正确填写表单各值。"); return false; } - }else{ - if(!top.Ext.getCmp('hideElement'+itemId).hidden && top.Ext.getCmp('configItemOption'+itemId).getValue() == '#@'){ + } else { + if (!top.Ext.getCmp('hideElement' + itemId).hidden && top.Ext.getCmp('configItemOption' + itemId).getValue() == '#@') { showResultQM("请正确填写表单各值。"); return false; } } - + //如果是多选,并且必填,需要单独校验 var extElement = top.Ext.getCmp('hideElement' + itemId); if (extElement.getXType() == 'fieldset' && !extElement.allowBlank) { var checkboxArr = extElement.findByType('checkbox'); var checked = false; - for (var int = 0; int < checkboxArr.length; int ++) { + for (var int = 0; int < checkboxArr.length; int++) { if (checkboxArr[int].checked) { checked = checkboxArr[int].checked; continue; @@ -3474,17 +3474,17 @@ } } } - + //2、验证是否选择监测项 - var inspecItemName = top.Ext.getCmp("formName") ; - if(inspecItemName == null || inspecItemName.getValue() == ''){ + var inspecItemName = top.Ext.getCmp("formName"); + if (inspecItemName == null || inspecItemName.getValue() == '') { showResultQM("请选择监测项!"); return false; } //登记人不能为空 var createUserName = top.Ext.getCmp("createUserName").getValue(); - if(createUserName == ''){ + if (createUserName == '') { showResultQM("登记人不能为空!"); return false; } @@ -3494,53 +3494,53 @@ var material = top.Ext.getCmp('material').getValue(); //第一组的材料名称 var inspectName = top.Ext.getCmp('formName').getRawValue(); //监测项 var scope = top.Ext.getCmp('scope').getValue(); //监测范围 - if(!allTousseOfSterileChecked()){ - if(inspectName != '无' && scope != '无' && scope != '灭菌炉记录'){ + if (!allTousseOfSterileChecked()) { + if (inspectName != '无' && scope != '无' && scope != '灭菌炉记录') { // 质量检测项为'无',强制登记器械包信息 - if(!material && !tousseName){ + if (!material && !tousseName) { showResultQM("请录入抽验器械或器械包名称"); return false; } } } - - + + //7、如果有显示“清洗篮筐名称”则需要填写 - var container = top.Ext.getCmp("containerName") ; - if(container != null && container.isVisible() && container.getValue() == ""){ + var container = top.Ext.getCmp("containerName"); + if (container != null && container.isVisible() && container.getValue() == "") { showResultQM("请扫描回收篮筐条码!"); return false; } - + var tousseAndMaterialAll = {}; var tousseInstanceInfos = []; var tousseAndMaterialWrapperCountNum = tousseAndMaterialWrapperCount;//获取添加的块数量 - + //针对第一个块,过滤出需要的数据 - if(top.Ext.getCmp("tosseAndMaterial")){ + if (top.Ext.getCmp("tosseAndMaterial")) { var tosseAndMaterialFirstWrapper = top.Ext.getCmp("tosseAndMaterial").items.items;//获取默认显示的第一个器械包信息,就是第一个块 - for(var n = 0; n < tosseAndMaterialFirstWrapper.length; n++){ + for (var n = 0; n < tosseAndMaterialFirstWrapper.length; n++) { var firstId = tosseAndMaterialFirstWrapper[n].id; - if(firstId == "tousseBarcodeC" /* || firstId == "addExtractCheckTousseBtnC" || firstId == "tousseNameC" || firstId == "tousseAmountC" */ ){ + if (firstId == "tousseBarcodeC" /* || firstId == "addExtractCheckTousseBtnC" || firstId == "tousseNameC" || firstId == "tousseAmountC" */) { tosseAndMaterialFirstWrapper.splice(0, 4);//先删除前面写死的器械包信息,器械包条码,按钮,器械包名称,数量 } - - if(tosseAndMaterialFirstWrapper[0].id == "materialWrapper"){ + + if (tosseAndMaterialFirstWrapper[0].id == "materialWrapper") { var firstAddMaterial = tosseAndMaterialFirstWrapper[0].items.items; - for(var w = 0;w < firstAddMaterial.length;w++){ - if(firstAddMaterial[w].id == "materialC" /* || firstId == "addExtractCheckMaterialBtnC" || firstId == "materialAmountC" */){ + for (var w = 0; w < firstAddMaterial.length; w++) { + if (firstAddMaterial[w].id == "materialC" /* || firstId == "addExtractCheckMaterialBtnC" || firstId == "materialAmountC" */) { firstAddMaterial.splice(0, 5);//是材料的话,把材料里面的写死删除,抽检器械,按钮,数量 } } //tosseAndMaterialFirstWrapper.splice(0, 5);////删除前面写死的器械包和数量等 - + tosseAndMaterialFirstWrapper.splice(0, 1);//再删除材料,写死的篮筐条码,位置 break; } - + } } - + //获取第一块材料写死的数据 var firstAddMaterialArr = []; var firstMaterialInfos = []; @@ -3549,306 +3549,306 @@ var position = ""; //6、如果是重新打开的记录,不再校验材料和包的关系 var qid = top.Ext.getCmp('id').getValue(); - if(isUndefinedOrNullOrEmpty(qid)){ - if(material){ + if (isUndefinedOrNullOrEmpty(qid)) { + if (material) { amount = top.Ext.getCmp('materialAmount').getValue(); - if(!amount || amount < 0){ - showResultQM('输入的“'+material+'”的数量且不能小于1'); + if (!amount || amount < 0) { + showResultQM('输入的“' + material + '”的数量且不能小于1'); return false; } position = top.Ext.getCmp("position").getValue(); - if(tousseName){ + if (tousseName) { var tousseDefinitionId = top.Ext.getCmp('tousseDefinitionId').getValue(); var isContain = false; // 判断材料是否在包里面 DWREngine.setAsync(false); - TousseInstanceTableManager.isTiContainsMaterial(tousseDefinitionId,material,function(responseText){ + TousseInstanceTableManager.isTiContainsMaterial(tousseDefinitionId, material, function (responseText) { result = top.Ext.decode(responseText); isContain = result.isContain; }); DWREngine.setAsync(true); - if(isContain == false){ - showResultQM('器械包' + tousseName +'中找不到材料“'+material+'”'); - top.Ext.getCmp('material').setValue(''); + if (isContain == false) { + showResultQM('器械包' + tousseName + '中找不到材料“' + material + '”'); + top.Ext.getCmp('material').setValue(''); top.Ext.getCmp('materialAmount').setValue(); return false; } } } - }else{ - if(material){ + } else { + if (material) { amount = top.Ext.getCmp('materialAmount').getValue(); position = top.Ext.getCmp("position").getValue(); - }else{ + } else { material = ""; } } - + firstMaterialInfos.push({ - "material":material, - "amount":amount, - "position":position, - "order":"" + "material": material, + "amount": amount, + "position": position, + "order": "" }); - + //获取第一块器械包写死的数据 var firstTousseBagsList = {}; //if(top.Ext.getCmp("scope").getValue() != "材料" || top.Ext.getCmp("scope").getValue() != "无" || top.Ext.getCmp("scope").getValue() != "灭菌炉记录"){ - if(top.Ext.getCmp("scope").getValue() == "材料和器械包" || top.Ext.getCmp("scope").getValue() == "器械包"){ + if (top.Ext.getCmp("scope").getValue() == "材料和器械包" || top.Ext.getCmp("scope").getValue() == "器械包") { var tousseName = top.Ext.getCmp('tousseName').getRawValue(); var barcode = top.Ext.getCmp('barcode').getValue(); var tousseInstanceId = top.Ext.getCmp('tousseInstanceId').getValue(); var tousseDefinitionId = top.Ext.getCmp('tousseDefinitionId').getValue(); var amount = top.Ext.getCmp('tousseAmount').getValue(); var isRecycle = top.Ext.getCmp('isRecycle').getValue(); - var isRepacking = top.Ext.getCmp('isRepacking').getValue(); - var isDiscard = top.Ext.getCmp('isDiscard').getValue(); - + var isRepacking = top.Ext.getCmp('isRepacking').getValue(); + var isDiscard = top.Ext.getCmp('isDiscard').getValue(); + firstTousseBagsList.tousseBarcode = barcode; firstTousseBagsList.tousseName = tousseName; firstTousseBagsList.tousseAmount = amount; firstTousseBagsList.tousseInstanceId = tousseInstanceId; firstTousseBagsList.tousseDefinitionId = tousseDefinitionId; firstTousseBagsList.tousseRecycle = isRecycle; firstTousseBagsList.tousseRePacking = isRepacking; - firstTousseBagsList.tousseDiscard = (isDiscard == '')?'否':isDiscard; + firstTousseBagsList.tousseDiscard = (isDiscard == '') ? '否' : isDiscard; firstTousseBagsList.order = ""; } - - + + var getTousseArgument2; - if(top.Ext.getCmp("scope").getValue() == "材料和器械包" || top.Ext.getCmp("scope").getValue() == "材料" || top.Ext.getCmp("scope").getValue() == "无"){ - if(firstAddMaterial != undefined){//点击第一个抽检器械按钮增加在第一个下面的 - for(var v = 0; v < firstAddMaterial.length; v++){ - if((firstAddMaterial[v].id).indexOf("basketBarcodeC") == -1){//除了篮筐条码 - if(firstAddMaterial[v].items == undefined){ + if (top.Ext.getCmp("scope").getValue() == "材料和器械包" || top.Ext.getCmp("scope").getValue() == "材料" || top.Ext.getCmp("scope").getValue() == "无") { + if (firstAddMaterial != undefined) {//点击第一个抽检器械按钮增加在第一个下面的 + for (var v = 0; v < firstAddMaterial.length; v++) { + if ((firstAddMaterial[v].id).indexOf("basketBarcodeC") == -1) {//除了篮筐条码 + if (firstAddMaterial[v].items == undefined) { firstAddMaterialArr.push(top.Ext.getCmp(firstAddMaterial[v].id).getValue()); - if(firstAddMaterialArr.length > 0){ + if (firstAddMaterialArr.length > 0) { firstMaterialInfos.push({ - "material":firstAddMaterialArr[0], - "amount":firstAddMaterialArr[1], - "position":firstAddMaterialArr[2], - "order":firstAddMaterialArr[3] + "material": firstAddMaterialArr[0], + "amount": firstAddMaterialArr[1], + "position": firstAddMaterialArr[2], + "order": firstAddMaterialArr[3] }); - firstAddMaterialArr = []; + firstAddMaterialArr = []; } - }else{ + } else { firstAddMaterialArr.push(firstAddMaterial[v].items.items[0].el.dom.value); } - + } } } - + firstTousseBagsList.materialInfos = firstMaterialInfos; - } - + } + getTousseArgument2 = setTousseArgument(tosseAndMaterialFirstWrapper); getTousseArgument2.unshift(firstTousseBagsList); //获取第一个监测项 var configItemOptionFirst; - if(top.Ext.getCmp('itemsFieldSet')){ + if (top.Ext.getCmp('itemsFieldSet')) { var firstItemsFieldSet = top.Ext.getCmp('itemsFieldSet').items.items; var getFirstConfigItemOptionArgument = setConfigItemOptionArgument(firstItemsFieldSet); configItemOptionFirst = getFirstConfigItemOptionArgument[0]; } - if(top.Ext.getCmp("scope").getValue() == "灭菌炉记录"){//只有监测项传值,没有器械包和抽检器械 + if (top.Ext.getCmp("scope").getValue() == "灭菌炉记录") {//只有监测项传值,没有器械包和抽检器械 tousseInstanceInfos.push({ - "configItemOption":configItemOptionFirst + "configItemOption": configItemOptionFirst }); - }else{ + } else { tousseInstanceInfos.push({ - "tousseBags":getTousseArgument2, - "configItemOption":configItemOptionFirst + "tousseBags": getTousseArgument2, + "configItemOption": configItemOptionFirst }); } - + //获取增加的块 - if(tousseAndMaterialWrapperCountNum > 0){//增加的块 - for(var k = 1;k <= tousseAndMaterialWrapperCountNum;k++){//先找到每一个块 + if (tousseAndMaterialWrapperCountNum > 0) {//增加的块 + for (var k = 1; k <= tousseAndMaterialWrapperCountNum; k++) {//先找到每一个块 var wrapper; var getTousseArgument; var configItemOption; - if(top.Ext.getCmp("scope").getValue() == "材料和器械包"){ - if(top.Ext.getCmp('tousseInfoFieldSet'+ k +'_TMP')){ - var wrapperParent = top.Ext.getCmp('tousseInfoFieldSet'+ k +'_TMP');//最外层 //包和材料 - wrapper = top.Ext.getCmp('tosseAndMaterial'+k+'_TMP').items.items; + if (top.Ext.getCmp("scope").getValue() == "材料和器械包") { + if (top.Ext.getCmp('tousseInfoFieldSet' + k + '_TMP')) { + var wrapperParent = top.Ext.getCmp('tousseInfoFieldSet' + k + '_TMP');//最外层 //包和材料 + wrapper = top.Ext.getCmp('tosseAndMaterial' + k + '_TMP').items.items; getTousseArgument = setTousseArgument(wrapper); //监测项 - if(top.Ext.getCmp('itemsFieldSet_'+ k)){ - var wrapperItemsFieldSet = top.Ext.getCmp('itemsFieldSet_'+ k).items.items; + if (top.Ext.getCmp('itemsFieldSet_' + k)) { + var wrapperItemsFieldSet = top.Ext.getCmp('itemsFieldSet_' + k).items.items; var getConfigItemOptionArgument = setConfigItemOptionArgument(wrapperItemsFieldSet); configItemOption = getConfigItemOptionArgument[0]; } tousseInstanceInfos.push({ - "tousseBags":getTousseArgument, - "configItemOption":configItemOption + "tousseBags": getTousseArgument, + "configItemOption": configItemOption }); } - }else if(top.Ext.getCmp("scope").getValue() == "器械包"){ - if(top.Ext.getCmp('tosseAndMaterial'+k+'_TP')){ - wrapper = top.Ext.getCmp('tosseAndMaterial'+k+'_TP').items.items; + } else if (top.Ext.getCmp("scope").getValue() == "器械包") { + if (top.Ext.getCmp('tosseAndMaterial' + k + '_TP')) { + wrapper = top.Ext.getCmp('tosseAndMaterial' + k + '_TP').items.items; getTousseArgument = setTousseArgument(wrapper); //监测项 - if(top.Ext.getCmp('itemsFieldSet_'+ k)){ - var wrapperItemsFieldSet = top.Ext.getCmp('itemsFieldSet_'+ k).items.items; + if (top.Ext.getCmp('itemsFieldSet_' + k)) { + var wrapperItemsFieldSet = top.Ext.getCmp('itemsFieldSet_' + k).items.items; var getConfigItemOptionArgument = setConfigItemOptionArgument(wrapperItemsFieldSet); configItemOption = getConfigItemOptionArgument[0]; } tousseInstanceInfos.push({ - "tousseBags":getTousseArgument, - "configItemOption":configItemOption + "tousseBags": getTousseArgument, + "configItemOption": configItemOption }); } - - }else if(top.Ext.getCmp("scope").getValue() == "材料" || top.Ext.getCmp("scope").getValue() == "无"){ - if(top.Ext.getCmp('tosseAndMaterial'+k+'_MP')){ - var materialWrapper = top.Ext.getCmp('tosseAndMaterial'+k+'_MP').items.items; - var getMaterialArgument = setMaterialArgument(materialWrapper); + + } else if (top.Ext.getCmp("scope").getValue() == "材料" || top.Ext.getCmp("scope").getValue() == "无") { + if (top.Ext.getCmp('tosseAndMaterial' + k + '_MP')) { + var materialWrapper = top.Ext.getCmp('tosseAndMaterial' + k + '_MP').items.items; + var getMaterialArgument = setMaterialArgument(materialWrapper); getTousseArgument = getMaterialArgument; //监测项 - if(top.Ext.getCmp('itemsFieldSet_'+ k)){ - var wrapperItemsFieldSet = top.Ext.getCmp('itemsFieldSet_'+ k).items.items; + if (top.Ext.getCmp('itemsFieldSet_' + k)) { + var wrapperItemsFieldSet = top.Ext.getCmp('itemsFieldSet_' + k).items.items; var getConfigItemOptionArgument = setConfigItemOptionArgument(wrapperItemsFieldSet); configItemOption = getConfigItemOptionArgument[0]; } tousseInstanceInfos.push({ - "tousseBags":getTousseArgument, - "configItemOption":configItemOption + "tousseBags": getTousseArgument, + "configItemOption": configItemOption }); } - }else if(top.Ext.getCmp("scope").getValue() == "灭菌炉记录"){ + } else if (top.Ext.getCmp("scope").getValue() == "灭菌炉记录") { //监测项 - if(top.Ext.getCmp('itemsFieldSet_'+ k)){ - var wrapperItemsFieldSet = top.Ext.getCmp('itemsFieldSet_'+ k).items.items; + if (top.Ext.getCmp('itemsFieldSet_' + k)) { + var wrapperItemsFieldSet = top.Ext.getCmp('itemsFieldSet_' + k).items.items; var getConfigItemOptionArgument = setConfigItemOptionArgument(wrapperItemsFieldSet); configItemOption = getConfigItemOptionArgument[0]; } tousseInstanceInfos.push({ - "configItemOption":configItemOption + "configItemOption": configItemOption }); } } } tousseAndMaterialAll.tousseInstanceInfos = tousseInstanceInfos; //传参tousseAndMaterialAll - checkIsTousseInstanceRepackingAndSubmitFormNew(thiz,JSON.stringify(tousseAndMaterialAll),saveAndCreate); + checkIsTousseInstanceRepackingAndSubmitFormNew(thiz, JSON.stringify(tousseAndMaterialAll), saveAndCreate); } -function loadResponPersonByBarcode(barcode,domId){ - if(isUndefinedOrNullOrEmpty(barcode)){ +function loadResponPersonByBarcode(barcode, domId) { + if (isUndefinedOrNullOrEmpty(barcode)) { showResultQM('条码不能为空!'); - return ; + return; } - UserTableManager.getUserByBarcode(barcode,function(responseText){ - if(!isUndefinedOrNullOrEmpty(responseText)){ - var result = top.Ext.decode(responseText); - if(domId == 'responsiblePerson'){ - if(!result.success){ + UserTableManager.getUserByBarcode(barcode, function (responseText) { + if (!isUndefinedOrNullOrEmpty(responseText)) { + var result = top.Ext.decode(responseText); + if (domId == 'responsiblePerson') { + if (!result.success) { showResultQM(result.message || "请输入正确的人员条码!"); return; } - if((result.fullName || '') !== ''){ + if ((result.fullName || '') !== '') { top.Ext.getCmp('responsiblePerson').disable(); } - }else { - if(!result.success){ - if(result.isNotSameOrgUnit){ + } else { + if (!result.success) { + if (result.isNotSameOrgUnit) { showResultQM(result.message || "登记人需为当前科室用户!"); - }else { + } else { showResultQM(result.message || "请输入正确的人员条码!"); } return; } } top.Ext.getCmp(domId).setValue(result.fullName); - }else{ - showResultQM('找不到该条码所对应的人员信息'); - } - }); + } else { + showResultQM('找不到该条码所对应的人员信息'); + } + }); } //扫描标识牌/器械包条码 -function loadRecyclePersonByBarcode(barcode){ - if(isUndefinedOrNullOrEmpty(barcode)){ +function loadRecyclePersonByBarcode(barcode) { + if (isUndefinedOrNullOrEmpty(barcode)) { showResultQM('条码不能为空!'); - return ; + return; } - + top.Ext.Ajax.request({ - url : WWWROOT + '/disinfectSystem/qualityMonitoringInstanceAction!scanBarcodeForTousseInfo.do', - params : { - barcode : barcode + url: WWWROOT + '/disinfectSystem/qualityMonitoringInstanceAction!scanBarcodeForTousseInfo.do', + params: { + barcode: barcode }, - success : function(response,options){ + success: function (response, options) { var result = top.Ext.decode(response.responseText); - if(result.success == true){//赋值 + if (result.success == true) {//赋值 top.Ext.getCmp("tousseNameBasics").setValue(result.data.tousseInstanceName); top.Ext.getCmp("scanTousseInstance_id").setValue(result.data.tousseInstanceId); - top.Ext.getCmp("recyclePerson").setValue(result.data.recyclingRecordJSON.reUser); + top.Ext.getCmp("recyclePerson").setValue(result.data.recyclingRecordJSON.reUser); top.Ext.getCmp("recycleDepartments").setValue(result.data.recyclingRecordJSON.reDept); top.Ext.getCmp("operationRoom").setValue(result.data.recyclingRecordJSON.lastUseRecordOperationRoom); top.Ext.getCmp("nurse").setValue(result.data.recyclingRecordJSON.lastUseRecordCircuitNurse); top.Ext.getCmp("recycleTime").setValue(result.data.recyclingRecordJSON.reTime); - if((result.data.tousseInstanceName || '') !== ''){ + if ((result.data.tousseInstanceName || '') !== '') { top.Ext.getCmp("tousseNameBasics").disable(); } - if((result.data.recyclingRecordJSON.reUser || '') !== ''){ + if ((result.data.recyclingRecordJSON.reUser || '') !== '') { top.Ext.getCmp("recyclePerson").disable(); } - if((result.data.recyclingRecordJSON.reDept || '') !== ''){ + if ((result.data.recyclingRecordJSON.reDept || '') !== '') { top.Ext.getCmp("recycleDepartments").disable(); } - if((result.data.recyclingRecordJSON.lastUseRecordOperationRoom || '') !== ''){ + if ((result.data.recyclingRecordJSON.lastUseRecordOperationRoom || '') !== '') { top.Ext.getCmp("operationRoom").disable(); } - if((result.data.recyclingRecordJSON.lastUseRecordCircuitNurse || '') !== ''){ + if ((result.data.recyclingRecordJSON.lastUseRecordCircuitNurse || '') !== '') { top.Ext.getCmp("nurse").disable(); } - if((result.data.recyclingRecordJSON.reTime || '') !== ''){ + if ((result.data.recyclingRecordJSON.reTime || '') !== '') { top.Ext.getCmp("recycleTime").disable(); } - }else{ + } else { showResultQM(result.message); top.Ext.getCmp("tousseNameBasics").setValue(""); - top.Ext.getCmp("recyclePerson").setValue(""); + top.Ext.getCmp("recyclePerson").setValue(""); top.Ext.getCmp("recycleDepartments").setValue(""); top.Ext.getCmp("operationRoom").setValue(""); top.Ext.getCmp("nurse").setValue(""); top.Ext.getCmp("scanTousseInstance_id").setValue(""); top.Ext.getCmp("recycleTime").setValue(""); } }, - failure : function(response, options) { + failure: function (response, options) { //showResultQM("该条码不是标识牌/器械包条码,请扫描标识牌/器械包条码"); } }); } - -function loadSterilizationByBarcode(barcode){ - if(isUndefinedOrNullOrEmpty(barcode)){ + +function loadSterilizationByBarcode(barcode) { + if (isUndefinedOrNullOrEmpty(barcode)) { showResultQM('条码不能为空!'); - return ; + return; } - + top.Ext.Ajax.request({ - url : WWWROOT + '/disinfectSystem/qualityMonitoringInstanceAction!scanBarcodeForTousseInfo.do', - params : { - barcode : barcode + url: WWWROOT + '/disinfectSystem/qualityMonitoringInstanceAction!scanBarcodeForTousseInfo.do', + params: { + barcode: barcode }, - success : function(response,options){ + success: function (response, options) { var result = top.Ext.decode(response.responseText); - if(result.success == true){//赋值 + if (result.success == true) {//赋值 top.Ext.getCmp("sterilizationName").setValue(result.data.sterilizationRecordJSON.sterilizerName); top.Ext.getCmp("scanTousseInstance_id").setValue(result.data.tousseInstanceId); - top.Ext.getCmp("sterilizationProgramName").setValue(result.data.sterilizationRecordJSON.sterilizationType); + top.Ext.getCmp("sterilizationProgramName").setValue(result.data.sterilizationRecordJSON.sterilizationType); top.Ext.getCmp("heat").setValue(result.data.sterilizationRecordJSON.frequency); top.Ext.getCmp("sterilizationStartTime").setValue(result.data.sterilizationRecordJSON.startDate); top.Ext.getCmp("sterilizationEndTime").setValue(result.data.sterilizationRecordJSON.endDate); - }else{ + } else { showResultQM(result.message); top.Ext.getCmp("sterilizationName").setValue(""); top.Ext.getCmp("sterilizationProgramName").setValue(""); @@ -3858,35 +3858,35 @@ top.Ext.getCmp("scanTousseInstance_id").setValue(""); } }, - failure : function(response, options) { - + failure: function (response, options) { + } }); } -function checkIsUniqueWithBarcodeAndInspectItemAndSubmitForm(thiz,id,barcode,formDefinitionId,materialInfo,saveAndCreate){ - if(barcode && formDefinitionId){ +function checkIsUniqueWithBarcodeAndInspectItemAndSubmitForm(thiz, id, barcode, formDefinitionId, materialInfo, saveAndCreate) { + if (barcode && formDefinitionId) { top.Ext.Ajax.request({ - url : WWWROOT + '/disinfectSystem/qualityMonitoringInstanceAction!checkIsUniqueWithBarcodeAndInspectItem.do', - params : { - id : id, - barcode : barcode, - formDefinitionId : formDefinitionId + url: WWWROOT + '/disinfectSystem/qualityMonitoringInstanceAction!checkIsUniqueWithBarcodeAndInspectItem.do', + params: { + id: id, + barcode: barcode, + formDefinitionId: formDefinitionId }, - success : function(response,options){ + success: function (response, options) { var result = top.Ext.decode(response.responseText); - if(!result.isUnique){ + if (!result.isUnique) { showResultQM("当前器械包所对应的检测项已存在"); thiz.enable(); return false; } - submitForm2(materialInfo,saveAndCreate); + submitForm2(materialInfo, saveAndCreate); }, - failure : function(response, options) { + failure: function (response, options) { showResultQM('系统加载出错,请稍候再试'); } }); - }else{ - submitForm2(materialInfo,saveAndCreate); + } else { + submitForm2(materialInfo, saveAndCreate); } } @@ -3897,46 +3897,46 @@ * @param saveAndCreate 是否为“保存并新建”操作 */ -function checkIsTousseInstanceRepackingAndSubmitForm(thiz,materialInfo,saveAndCreate){ +function checkIsTousseInstanceRepackingAndSubmitForm(thiz, materialInfo, saveAndCreate) { var barcodes = getScanRepacingTiBarcodes(); top.Ext.Ajax.request({ - url : WWWROOT + '/disinfectSystem/qualityMonitoringInstanceAction!checkIsTousseInstanceRepacking.do', - params : { - barcodes : barcodes + url: WWWROOT + '/disinfectSystem/qualityMonitoringInstanceAction!checkIsTousseInstanceRepacking.do', + params: { + barcodes: barcodes }, - success : function(response,options){ + success: function (response, options) { var result = top.Ext.decode(response.responseText); - if(result.haveRepacking){ + if (result.haveRepacking) { showResultQM(result.message); thiz.enable(); return false; } - submitForm2(materialInfo,saveAndCreate); + submitForm2(materialInfo, saveAndCreate); }, - failure : function(response, options) { + failure: function (response, options) { showResultQM('系统加载出错,请稍候再试'); } }); } -function checkIsTousseInstanceRepackingAndSubmitFormNew(thiz,tousseAndMaterialAll,saveAndCreate){ +function checkIsTousseInstanceRepackingAndSubmitFormNew(thiz, tousseAndMaterialAll, saveAndCreate) { var barcodes = getScanRepacingTiBarcodes(); top.Ext.Ajax.request({ - url : WWWROOT + '/disinfectSystem/qualityMonitoringInstanceAction!checkIsTousseInstanceRepacking.do', - params : { - barcodes : barcodes + url: WWWROOT + '/disinfectSystem/qualityMonitoringInstanceAction!checkIsTousseInstanceRepacking.do', + params: { + barcodes: barcodes }, - success : function(response,options){ + success: function (response, options) { var result = top.Ext.decode(response.responseText); - if(result.haveRepacking){ + if (result.haveRepacking) { showResultQM(result.message); thiz.enable(); return false; } - submitFormNew2(tousseAndMaterialAll,saveAndCreate); + submitFormNew2(tousseAndMaterialAll, saveAndCreate); }, - failure : function(response, options) { + failure: function (response, options) { showResultQM('系统加载出错,请稍候再试'); } }); @@ -3945,13 +3945,13 @@ // 监测范围是器械包,加载器械包 -function loadTousseMsg(qualityMonitoringInstance, qualityMonitoringGoodsList){ +function loadTousseMsg(qualityMonitoringInstance, qualityMonitoringGoodsList) { setIsRecycleAndIsRepackingForWholeFurnace(qualityMonitoringInstance); - if(qualityMonitoringGoodsList == null || qualityMonitoringGoodsList == '' || qualityMonitoringGoodsList.length == 0){ - return ; + if (qualityMonitoringGoodsList == null || qualityMonitoringGoodsList == '' || qualityMonitoringGoodsList.length == 0) { + return; } - for(var i = 0 ;i < qualityMonitoringGoodsList.length ;i++){ - if(i == 0){ + for (var i = 0; i < qualityMonitoringGoodsList.length; i++) { + if (i == 0) { var barcode = qualityMonitoringGoodsList[i].barcode; var tousseInstanceId = qualityMonitoringGoodsList[i].tousseInstanceId; var tousseName = qualityMonitoringGoodsList[i].tousseName; @@ -3960,36 +3960,36 @@ top.Ext.getCmp('tempBarcode').setValue(barcode); top.Ext.getCmp('tousseName').setValue(tousseName); top.Ext.getCmp('tousseAmount').setValue(amount); - if('是'==qualityMonitoringGoodsList[i].isRecycle){ + if ('是' == qualityMonitoringGoodsList[i].isRecycle) { top.Ext.getCmp('isRecycle').setValue(qualityMonitoringGoodsList[i].isRecycle); top.Ext.getCmp('isRepacking').setValue('否'); top.Ext.getCmp('isDiscard').setValue('否'); top.Ext.getCmp('recycle').setValue(true); top.Ext.getCmp('repacking').setValue(false); top.Ext.getCmp('disabledBarcode').setValue(false); - }else if('是'==qualityMonitoringGoodsList[i].isRepacking){ + } else if ('是' == qualityMonitoringGoodsList[i].isRepacking) { top.Ext.getCmp('isRecycle').setValue('否'); top.Ext.getCmp('isRepacking').setValue(qualityMonitoringGoodsList[i].isRepacking); top.Ext.getCmp('isDiscard').setValue('否'); top.Ext.getCmp('recycle').setValue(false); top.Ext.getCmp('repacking').setValue(true); top.Ext.getCmp('disabledBarcode').setValue(false); - }else if('是'==qualityMonitoringGoodsList[i].isDiscard){ + } else if ('是' == qualityMonitoringGoodsList[i].isDiscard) { top.Ext.getCmp('isRecycle').setValue('否'); top.Ext.getCmp('isRepacking').setValue('否'); top.Ext.getCmp('isDiscard').setValue(qualityMonitoringGoodsList[i].isDiscard); top.Ext.getCmp('recycle').setValue(false); top.Ext.getCmp('repacking').setValue(false); top.Ext.getCmp('disabledBarcode').setValue(true); - }else{ + } else { top.Ext.getCmp('isRecycle').setValue('否'); top.Ext.getCmp('isRepacking').setValue('否'); top.Ext.getCmp('isDiscard').setValue('否'); top.Ext.getCmp('recycle').setValue(false); - top.Ext.getCmp('repacking').setValue(false); + top.Ext.getCmp('repacking').setValue(false); top.Ext.getCmp('disabledBarcode').setValue(false); } - }else{ + } else { var barcode = qualityMonitoringGoodsList[i].barcode; var tousseInstanceId = qualityMonitoringGoodsList[i].tousseInstanceId; var tousseName = qualityMonitoringGoodsList[i].tousseName; @@ -4000,35 +4000,35 @@ var isDiscard = qualityMonitoringGoodsList[i].isDiscard; var showInput = qualityMonitoringGoodsList[i].showInput; var scope = qualityMonitoringGoodsList[i].scope; - if(!showInput){ - addExtractCheckTousse(tousseName,barcode,tousseInstanceId,amount,orderNumber,isRecycle,isRePacking,isDiscard,"","","","",true); - }else if(scope == '器械包' || scope == '材料和器械包'){ - addExtractCheckTousse(tousseName,barcode,tousseInstanceId,amount,orderNumber,isRecycle,isRePacking,isDiscard,"","","","",true,showInput); + if (!showInput) { + addExtractCheckTousse(tousseName, barcode, tousseInstanceId, amount, orderNumber, isRecycle, isRePacking, isDiscard, "", "", "", "", true); + } else if (scope == '器械包' || scope == '材料和器械包') { + addExtractCheckTousse(tousseName, barcode, tousseInstanceId, amount, orderNumber, isRecycle, isRePacking, isDiscard, "", "", "", "", true, showInput); } } } } //监测范围是材料,加载材料信息 -function loadMaterialMsg(qualityMonitoringGoodsList){ - if(qualityMonitoringGoodsList == null || qualityMonitoringGoodsList == '' || qualityMonitoringGoodsList.length == 0){ - return ; +function loadMaterialMsg(qualityMonitoringGoodsList) { + if (qualityMonitoringGoodsList == null || qualityMonitoringGoodsList == '' || qualityMonitoringGoodsList.length == 0) { + return; } - for(var i = 0 ;i < qualityMonitoringGoodsList.length ;i++){ - if(i == 0){ + for (var i = 0; i < qualityMonitoringGoodsList.length; i++) { + if (i == 0) { var mateialName = qualityMonitoringGoodsList[i].material; var amount = qualityMonitoringGoodsList[i].amount; var position = qualityMonitoringGoodsList[i].position; top.Ext.getCmp('material').setValue(mateialName); top.Ext.getCmp('materialAmount').setValue(amount); top.Ext.getCmp('position').setValue(position); - }else{ + } else { var mateialName = qualityMonitoringGoodsList[i].material; var amount = qualityMonitoringGoodsList[i].amount; var orderNumber = qualityMonitoringGoodsList[i].orderNumber; var position = qualityMonitoringGoodsList[i].position; // 添加抽检器械和数量 - addExtractCheckMaterial(true,mateialName,amount,position,orderNumber,"","","","","","",true,tousseItemCount); + addExtractCheckMaterial(true, mateialName, amount, position, orderNumber, "", "", "", "", "", "", true, tousseItemCount); } } } @@ -4039,19 +4039,19 @@ */ function setIsRecycleAndIsRepackingForWholeFurnace(qualityMonitoringInstance) { if (qualityMonitoringInstance.isAllTousseOfSterile == '是') { //是整炉 - if('是'==qualityMonitoringInstance.isRecycle){ + if ('是' == qualityMonitoringInstance.isRecycle) { top.Ext.getCmp('isRecycle').setValue(qualityMonitoringInstance.isRecycle); top.Ext.getCmp('isRepacking').setValue('否'); - + top.Ext.getCmp('recycle').setValue(true); top.Ext.getCmp('repacking').setValue(false); - }else if('是'==qualityMonitoringInstance.isRepacking){ + } else if ('是' == qualityMonitoringInstance.isRepacking) { top.Ext.getCmp('isRecycle').setValue('否'); top.Ext.getCmp('isRepacking').setValue(qualityMonitoringInstance.isRepacking); - + top.Ext.getCmp('recycle').setValue(false); top.Ext.getCmp('repacking').setValue(true); - }else{ + } else { top.Ext.getCmp('isRecycle').setValue('否'); top.Ext.getCmp('isRepacking').setValue('否'); top.Ext.getCmp('recycle').setValue(false); @@ -4062,16 +4062,16 @@ //监测范围是器械包和材料,加载器械包和材料信息 -function loadMateriaAndTousselMsg(qualityMonitoringInstance, qualityMonitoringGoodsList){ +function loadMateriaAndTousselMsg(qualityMonitoringInstance, qualityMonitoringGoodsList) { setIsRecycleAndIsRepackingForWholeFurnace(qualityMonitoringInstance); - if(qualityMonitoringGoodsList == null || qualityMonitoringGoodsList == '' || qualityMonitoringGoodsList.length == 0){ - return ; + if (qualityMonitoringGoodsList == null || qualityMonitoringGoodsList == '' || qualityMonitoringGoodsList.length == 0) { + return; } - for(var i = 0 ;i < qualityMonitoringGoodsList.length ;i++){ - var orderNumber = qualityMonitoringGoodsList[i].orderNumber; - if(orderNumber == 1){ + for (var i = 0; i < qualityMonitoringGoodsList.length; i++) { + var orderNumber = qualityMonitoringGoodsList[i].orderNumber; + if (orderNumber == 1) { var tousseName = qualityMonitoringGoodsList[i].tousseName; - if(tousseName){ + if (tousseName) { // 第一个是器械包 var barcode = qualityMonitoringGoodsList[i].barcode; var tousseInstanceId = qualityMonitoringGoodsList[i].tousseInstanceId; @@ -4080,55 +4080,55 @@ top.Ext.getCmp('tempBarcode').setValue(barcode); top.Ext.getCmp('tousseName').setValue(tousseName); top.Ext.getCmp('tousseAmount').setValue(amount); - if('是'==qualityMonitoringGoodsList[i].isRecycle){ + if ('是' == qualityMonitoringGoodsList[i].isRecycle) { top.Ext.getCmp('isRecycle').setValue(qualityMonitoringGoodsList[i].isRecycle); top.Ext.getCmp('isRepacking').setValue('否'); top.Ext.getCmp('isDiscard').setValue('否'); - + top.Ext.getCmp('recycle').setValue(true); top.Ext.getCmp('repacking').setValue(false); top.Ext.getCmp('disabledBarcode').setValue(false); - }else if('是'==qualityMonitoringGoodsList[i].isRepacking){ + } else if ('是' == qualityMonitoringGoodsList[i].isRepacking) { top.Ext.getCmp('isRecycle').setValue('否'); top.Ext.getCmp('isRepacking').setValue(qualityMonitoringGoodsList[i].isRepacking); top.Ext.getCmp('isDiscard').setValue('否'); - + top.Ext.getCmp('recycle').setValue(false); top.Ext.getCmp('repacking').setValue(true); top.Ext.getCmp('disabledBarcode').setValue(false); - }else if('是'==qualityMonitoringGoodsList[i].isDiscard){ + } else if ('是' == qualityMonitoringGoodsList[i].isDiscard) { top.Ext.getCmp('isRecycle').setValue('否'); top.Ext.getCmp('isRepacking').setValue('否'); top.Ext.getCmp('isDiscard').setValue(qualityMonitoringGoodsList[i].isDiscard); - + top.Ext.getCmp('recycle').setValue(false); top.Ext.getCmp('repacking').setValue(false); top.Ext.getCmp('disabledBarcode').setValue(true); - }else{ + } else { top.Ext.getCmp('isRecycle').setValue('否'); top.Ext.getCmp('isRepacking').setValue('否'); top.Ext.getCmp('isDiscard').setValue('否'); top.Ext.getCmp('recycle').setValue(false); top.Ext.getCmp('repacking').setValue(false); top.Ext.getCmp('disabledBarcode').setValue(false); } - }else{ + } else { var mateialName = qualityMonitoringGoodsList[i].material; var amount = qualityMonitoringGoodsList[i].amount; var position = qualityMonitoringGoodsList[i].position; top.Ext.getCmp('material').setValue(mateialName); top.Ext.getCmp('materialAmount').setValue(amount); top.Ext.getCmp('position').setValue(position); } - - }else if(orderNumber == 2){ + + } else if (orderNumber == 2) { var mateialName = qualityMonitoringGoodsList[i].material; var tousseName = qualityMonitoringGoodsList[i].tousseName; var amount = qualityMonitoringGoodsList[i].amount; var position = qualityMonitoringGoodsList[i].position; - if(top.Ext.getCmp('material').getValue() != "" && mateialName != null && mateialName != ''){ - addExtractCheckMaterial(true,mateialName,amount,position,orderNumber,"","","","","","",true,tousseItemCount); - }else if(top.Ext.getCmp('tousseName').getValue() != "" && tousseName != null && tousseName != ''){ + if (top.Ext.getCmp('material').getValue() != "" && mateialName != null && mateialName != '') { + addExtractCheckMaterial(true, mateialName, amount, position, orderNumber, "", "", "", "", "", "", true, tousseItemCount); + } else if (top.Ext.getCmp('tousseName').getValue() != "" && tousseName != null && tousseName != '') { var barcode = qualityMonitoringGoodsList[i].barcode; var tousseInstanceId = qualityMonitoringGoodsList[i].tousseInstanceId; var amount = qualityMonitoringGoodsList[i].amount; @@ -4139,23 +4139,23 @@ var showInput = qualityMonitoringGoodsList[i].showInput; var scope = qualityMonitoringGoodsList[i].scope; var tousseDefinitionId = qualityMonitoringGoodsList[i].tousseDefinitionId; - if(!showInput){ - addExtractCheckTousse(tousseName,barcode,tousseInstanceId,amount,orderNumber,isRecycle,isRePacking,isDiscard,"","","","",true); - }else if(scope == '器械包' || scope == '材料和器械包'){ - addExtractCheckTousse(tousseName,barcode,tousseInstanceId,amount,orderNumber,isRecycle,isRePacking,isDiscard,"","","","",true,showInput); + if (!showInput) { + addExtractCheckTousse(tousseName, barcode, tousseInstanceId, amount, orderNumber, isRecycle, isRePacking, isDiscard, "", "", "", "", true); + } else if (scope == '器械包' || scope == '材料和器械包') { + addExtractCheckTousse(tousseName, barcode, tousseInstanceId, amount, orderNumber, isRecycle, isRePacking, isDiscard, "", "", "", "", true, showInput); } - if(scope == '材料和器械包' && showInput == true){ - addExtractCheckMaterial("","",1,"","","",true,"","",true,"","",orderNumber,tousseDefinitionId); + if (scope == '材料和器械包' && showInput == true) { + addExtractCheckMaterial("", "", 1, "", "", "", true, "", "", true, "", "", orderNumber, tousseDefinitionId); } - }else{ + } else { top.Ext.getCmp('material').setValue(mateialName); top.Ext.getCmp('materialAmount').setValue(amount); top.Ext.getCmp('position').setValue(position); - } - }else { + } + } else { var tousseName = qualityMonitoringGoodsList[i].tousseName; var mateialName = qualityMonitoringGoodsList[i].material; - if(tousseName != null && tousseName != ''){ + if (tousseName != null && tousseName != '') { // 添加器械包 var barcode = qualityMonitoringGoodsList[i].barcode; var tousseInstanceId = qualityMonitoringGoodsList[i].tousseInstanceId; @@ -4167,20 +4167,20 @@ var showInput = qualityMonitoringGoodsList[i].showInput; var scope = qualityMonitoringGoodsList[i].scope; var tousseDefinitionId = qualityMonitoringGoodsList[i].tousseDefinitionId; - if(!showInput){ - addExtractCheckTousse(tousseName,barcode,tousseInstanceId,amount,orderNumber,isRecycle,isRePacking,isDiscard,"","","","",true); - }else if(scope == '器械包' || scope == '材料和器械包'){ - addExtractCheckTousse(tousseName,barcode,tousseInstanceId,amount,orderNumber,isRecycle,isRePacking,isDiscard,"","","","",true,showInput); + if (!showInput) { + addExtractCheckTousse(tousseName, barcode, tousseInstanceId, amount, orderNumber, isRecycle, isRePacking, isDiscard, "", "", "", "", true); + } else if (scope == '器械包' || scope == '材料和器械包') { + addExtractCheckTousse(tousseName, barcode, tousseInstanceId, amount, orderNumber, isRecycle, isRePacking, isDiscard, "", "", "", "", true, showInput); } - if(scope == '材料和器械包' && showInput == true){ - addExtractCheckMaterial("","",1,"","","",true,"","",true,"","",orderNumber,tousseDefinitionId); + if (scope == '材料和器械包' && showInput == true) { + addExtractCheckMaterial("", "", 1, "", "", "", true, "", "", true, "", "", orderNumber, tousseDefinitionId); } - }else if(mateialName != null && mateialName != ''){ + } else if (mateialName != null && mateialName != '') { var amount = qualityMonitoringGoodsList[i].amount; var orderNumber = qualityMonitoringGoodsList[i].orderNumber; var position = qualityMonitoringGoodsList[i].position; // 添加抽检器械和数量 - addExtractCheckMaterial(true,mateialName,amount,position,orderNumber,"","","","","","",true,tousseItemCount); + addExtractCheckMaterial(true, mateialName, amount, position, orderNumber, "", "", "", "", "", "", true, tousseItemCount); } } } @@ -4189,132 +4189,131 @@ /** * 初始化Store. */ -function initStore(){ +function initStore() { materialDefinitionStore = new top.Ext.data.Store({ - proxy : new top.Ext.data.HttpProxy({ - url : WWWROOT + '/disinfectSystem/baseData/materialDefinitionAction!getMaterialDefinitionDataIncludeForeignMD.do?selectType=material', - method : 'POST' + proxy: new top.Ext.data.HttpProxy({ + url: WWWROOT + '/disinfectSystem/baseData/materialDefinitionAction!getMaterialDefinitionDataIncludeForeignMD.do?selectType=material', + method: 'POST' }), - reader : new top.Ext.data.JsonReader({ - totalProperty : 'totalCount', - root : 'data' + reader: new top.Ext.data.JsonReader({ + totalProperty: 'totalCount', + root: 'data' }, [ - {name : 'id',mapping : 'id'}, - {name : 'spelling',mapping : 'spelling'}, - {name : 'name',mapping : 'name'}, - {name : 'count',mapping : 'count'} + { name: 'id', mapping: 'id' }, + { name: 'spelling', mapping: 'spelling' }, + { name: 'name', mapping: 'name' }, + { name: 'count', mapping: 'count' } ]), - listeners : { - beforeload : function(thiz, options){ - thiz.baseParams['tousseDefinitionId'] = top.Ext.getCmp('tousseDefinitionId').getValue(); - } + listeners: { + beforeload: function (thiz, options) { + thiz.baseParams['tousseDefinitionId'] = top.Ext.getCmp('tousseDefinitionId').getValue(); + } } }); - + tousseDefinitionStore = new top.Ext.data.Store({ - proxy : new top.Ext.data.HttpProxy({ - url : WWWROOT + '/disinfectSystem/baseData/tousseDefinitionAction!getTousseAndDiposableGoodsData.do?type='+encodeURI('器械包和外来器械包'), - method : 'POST' + proxy: new top.Ext.data.HttpProxy({ + url: WWWROOT + '/disinfectSystem/baseData/tousseDefinitionAction!getTousseAndDiposableGoodsData.do?type=' + encodeURI('器械包和外来器械包'), + method: 'POST' }), - reader : new top.Ext.data.JsonReader({ - totalProperty : 'totalCount', - root : 'data' + reader: new top.Ext.data.JsonReader({ + totalProperty: 'totalCount', + root: 'data' }, [ - {name : 'id',mapping : 'id'}, - {name : 'spelling',mapping : 'spelling'}, - {name : 'name',mapping : 'name'}, - {name : 'displayName',mapping : 'displayName'}, - {name : 'amount',mapping : 'amount'}] + { name: 'id', mapping: 'id' }, + { name: 'spelling', mapping: 'spelling' }, + { name: 'name', mapping: 'name' }, + { name: 'displayName', mapping: 'displayName' }, + { name: 'amount', mapping: 'amount' }] ) }); - + formDefinitionStore = new top.Ext.data.Store({ - proxy : new top.Ext.data.HttpProxy({ - url : WWWROOT + '/disinfectSystem/qualityMonitoringDefinitionAction!loadLastDeployFormDefinitionGroupByFormName.do', - method : 'POST' + proxy: new top.Ext.data.HttpProxy({ + url: WWWROOT + '/disinfectSystem/qualityMonitoringDefinitionAction!loadLastDeployFormDefinitionGroupByFormName.do', + method: 'POST' }), - baseParams:{formType : qmFormType}, - reader : new top.Ext.data.JsonReader({ - root : 'data' - },[ - {name : 'id'}, - {name : 'name'} - ] + baseParams: { formType: qmFormType }, + reader: new top.Ext.data.JsonReader({ + root: 'data' + }, [ + { name: 'id' }, + { name: 'name' } + ] ), - listeners:{ - load:function(store,records) { - if( otherPartAddQM == true ){ - if(records.length>0) { - if(top.Ext.getCmp('responsibilityPart').getValue() == '装配管理'){ - var formName = ''; - var formDefinitionId = ''; - for(var i=0;i 0) { + if (top.Ext.getCmp('responsibilityPart').getValue() == '装配管理') { + var formName = ''; + var formDefinitionId = ''; + for (var i = 0; i < records.length; i++) { + if (records[i].data.name == '包装不合格') { + formName = records[i].data.name; + formDefinitionId = records[i].data.id; } - if(formName !== ''){ - top.Ext.getCmp('formName').setValue(formName); - addQualityMonitoringItem(formDefinitionId,formName); - top.Ext.getCmp("formDefinitionId").setValue(formDefinitionId); - top.Ext.getCmp("name").setValue(formName); - } - }else { - top.Ext.getCmp('formName').setValue(records[0].data.name); - addQualityMonitoringItem(records[0].data.id,records[0].data.name); - top.Ext.getCmp("formDefinitionId").setValue(records[0].data.id); - top.Ext.getCmp("name").setValue(records[0].data.name); } - }else{ - // 没有找到监测项 - top.Ext.getCmp('formName').setValue(''); + if (formName !== '') { + top.Ext.getCmp('formName').setValue(formName); + addQualityMonitoringItem(formDefinitionId, formName); + top.Ext.getCmp("formDefinitionId").setValue(formDefinitionId); + top.Ext.getCmp("name").setValue(formName); + } + } else { + top.Ext.getCmp('formName').setValue(records[0].data.name); + addQualityMonitoringItem(records[0].data.id, records[0].data.name); + top.Ext.getCmp("formDefinitionId").setValue(records[0].data.id); + top.Ext.getCmp("name").setValue(records[0].data.name); } + } else { + // 没有找到监测项 + top.Ext.getCmp('formName').setValue(''); } - // 加载监测项对所选的项赋初值,只是从其他环节进来执行一次. - otherPartAddQM = false; } + // 加载监测项对所选的项赋初值,只是从其他环节进来执行一次. + otherPartAddQM = false; } + } }); - + frequencyStore = new top.Ext.data.Store({ - proxy : new top.Ext.data.HttpProxy({ - url : WWWROOT + '/disinfectSystem/sterilization/sterilizationRecordAction!getFrequency.do?', - method : 'POST' + proxy: new top.Ext.data.HttpProxy({ + url: WWWROOT + '/disinfectSystem/sterilization/sterilizationRecordAction!getFrequency.do?', + method: 'POST' }), - baseParams:{sterilizerDate : ""}, - reader : new top.Ext.data.JsonReader({ - root : 'data' - },[ - {name : 'value'}, - ] + baseParams: { sterilizerDate: "" }, + reader: new top.Ext.data.JsonReader({ + root: 'data' + }, [ + { name: 'value' }, + ] ) }); } //测试是否为有效的条码,9到11位 -function isValidBarcode(text){ - var re = /^([0-9]{9,11})$/; - if(re.test(text)){ - return true; - } - else{ - return false; - } +function isValidBarcode(text) { + var re = /^([0-9]{9,11})$/; + if (re.test(text)) { + return true; + } + else { + return false; + } } // 测试是否为工号,长度大于1位,小于等于6位,并且仅允许数字和字母 -function isValidStaffNumber(text){ - if (text.length < 1 || text.length > 6){ +function isValidStaffNumber(text) { + if (text.length < 1 || text.length > 6) { return false; } var letterNumber = /^[0-9a-zA-Z]+$/; var atLeastOneNumber = /.*[0-9].*/; - if(text.match(letterNumber) && text.match(atLeastOneNumber)){ + if (text.match(letterNumber) && text.match(atLeastOneNumber)) { return true; } - else - { + else { return false; } } @@ -4325,14 +4324,14 @@ * @returns {top.Ext.FormPanel} * 材料丢失或报损添加质量监测后进入 */ -function getFormPanelContent(id){ +function getFormPanelContent(id) { initStore(); - if(recycleQM == true){ - + if (recycleQM == true) { + disableShowImageButton = true; } var labelWidthPosition = 123; - if(id != null && id != ''){ + if (id != null && id != '') { labelWidthPosition = 91; } var userReader = new top.Ext.data.JsonReader({ @@ -4342,7 +4341,7 @@ { name: 'orgUnitName' } ] }); - // 查找某科室的人员的store + // 查找某科室的人员的store var departUsersStore = new top.Ext.data.Store({ proxy: new top.Ext.data.HttpProxy({ url: WWWROOT + '/systemmanage/user/userAction!loadUsersBySearchString.do', @@ -4353,689 +4352,691 @@ var varibaleContent1; var varibaleContent2; // 责任环节带出监测项 - if(sstsConfig.hasOwnProperty('responsibilityPartBringInspectItem') && sstsConfig.responsibilityPartBringInspectItem){ + if (sstsConfig.hasOwnProperty('responsibilityPartBringInspectItem') && sstsConfig.responsibilityPartBringInspectItem) { varibaleContent1 = getResponsibilityPartContent(id); varibaleContent2 = getInspectItemContent(id); - }else{ + } else { varibaleContent1 = getInspectItemContent(id); varibaleContent2 = getResponsibilityPartContent(id); } formPanel = new top.Ext.FormPanel({ - id : 'addQualityMonitoringForm', - frame : true, - labelSeparator : ':', - bodyStyle : 'padding:5px 5px 0px 5px', - width : 630, - height : 500, - labelAlign : 'right', - buttonAlign : 'center', + id: 'addQualityMonitoringForm', + frame: true, + labelSeparator: ':', + bodyStyle: 'padding:5px 5px 0px 5px', + width: 630, + height: 500, + labelAlign: 'right', + buttonAlign: 'center', //autoScroll : true, - bodyStyle : 'overflow-x:hidden; overflow-y:scroll', - items : [{ - id:'baseInfoPanel', - layout : 'column', - xtype:"fieldset", //定义类别为fieldset - title:"基本信息", - autoHeight:true, - items : [ - {xtype: 'hidden',name: 'id',id: 'id'}, //质量监测实例id - {xtype: 'hidden',name: 'tousseInstanceId',id: 'tousseInstanceId'}, //第一个包实例id - {xtype: 'hidden',name: 'tousseDefinitionId',id: 'tousseDefinitionId'}, //第一个包定义id - {xtype: 'hidden',name: 'tousseType',id: 'tousseType'}, //第一个器械包类型 - {xtype: 'hidden',name: 'barcode',id: 'barcode'}, //第一个器械包条码 - {xtype: 'hidden',name: 'isRecycle',id: 'isRecycle'}, //第一个是否重新回收 - {xtype: 'hidden',name: 'isRepacking',id: 'isRepacking'}, //第一个是否重新装配 - {xtype: 'hidden',name: 'isDiscard',id: 'isDiscard'}, //第一个是否废弃条码 - {xtype: 'hidden',name: 'scope',id: 'scope'}, //监测范围 - {xtype: 'hidden',name: 'type',id: 'type',value : parm_s_type}, //监测类型:“质量监测” - {xtype: 'hidden',name: 'name',id: 'name'}, //质量监测实例名称 - {xtype: 'hidden',name: 'optionAmount',id: 'optionAmount'}, //监测项元素id集合(用分号分隔) - {xtype: 'hidden',name: 'uploadImgIds',id: 'uploadImgIds'}, - {xtype: 'hidden',name: 'containerBarcode',id: 'containerBarcode'}, - {xtype: 'hidden',name: 'tousseDefRecycling',id: 'tousseDefRecycling'}, //第一个器械包是否需要回收 - {xtype: 'hidden',name: 'formDefinitionId',id: 'formDefinitionId'}, //质量监测定义id - {xtype: 'hidden',name: 'isAllTousseOfSterile',id: 'isAllTousseOfSterile'}, //是否整炉 - {xtype: 'hidden',name: 'errorDamageQmKey',id: 'errorDamageQmKey'}, - //{xtype: 'hidden',name: 'inspectType',id: 'inspectType'}, //记住上一次的监测项类型 - {xtype: 'hidden',name: 'scanWashRecord_id',id: 'scanWashRecord_id'}, //清洗记录的id - {xtype: 'hidden',name: 'scanTousseInstance_id',id: 'scanTousseInstance_id'}, //回收或灭菌扫描条码的id - varibaleContent1, - varibaleContent2, - { - layout : 'form', - columnWidth : .5, - labelWidth : (recycleQM && top.screen.width > 1280) ? 182 : labelWidthLeft, - height:setH, - items : [{ - xtype : 'datefieldWithMin', - fieldLabel : '抽检时间', - id : 'dateTime', - name : 'dateTime', -// value : new Date(), - editable : false, - format : 'Y-m-d H:i', - altFormats:'Y-m-d|Y-n-j|y-n-j|y-m-j|y-m-d|y-n-d|Y-n-d|Y-m-j|Ymd|Ynj|ynj|ymj|ymd|ynd|Ynd|Ymj|Y/m/d|Y/n/j|y/n/j|y/m/j|y/m/d|y/n/d|Y/n/d|Y/m/j', - allowBlank : false, - anchor : '95%' - }] - }, { - layout : 'form', - columnWidth : .5, - labelWidth : (recycleQM && top.screen.width > 1280) ? 182 : labelWidthLeft, - height:setH, - items : [{ - xtype : 'combo', - fieldLabel : '登记人', - id : 'createUserName', - name : 'createUserName', - queryParam : 'spell', - minChars : 0, - displayField : 'fullName', - store : departUsersStore, - forceSelection : false, - lazyInit : true, - triggerAction : 'all', - hideTrigger : false, - typeAhead : false, - allowBlank : false, - anchor : '95%', - value : userName, - listeners:{ - specialkey : function(field,e){ - if(e.getKey() == 13){ - var createUserNameBox = top.Ext.getCmp('createUserName'); - var text = createUserNameBox.getValue(); - if (isValidBarcode(text)) { - loadResponPersonByBarcode(text, 'createUserName'); - } else if (isValidStaffNumber(text)) { - UserTableManager.getUserByLoginName(text, function (responseText) { - if(!isUndefinedOrNullOrEmpty(responseText)){ - var result = top.Ext.decode(responseText); - if(result.isBelongsToCurrentLoginUserOrgs == false){ - showResultQM("登记人需为当前科室用户!"); - return + bodyStyle: 'overflow-x:hidden; overflow-y:scroll', + items: [{ + id: 'baseInfoPanel', + layout: 'column', + xtype: "fieldset", //定义类别为fieldset + title: "基本信息", + autoHeight: true, + items: [ + { xtype: 'hidden', name: 'id', id: 'id' }, //质量监测实例id + { xtype: 'hidden', name: 'tousseInstanceId', id: 'tousseInstanceId' }, //第一个包实例id + { xtype: 'hidden', name: 'tousseDefinitionId', id: 'tousseDefinitionId' }, //第一个包定义id + { xtype: 'hidden', name: 'tousseType', id: 'tousseType' }, //第一个器械包类型 + { xtype: 'hidden', name: 'barcode', id: 'barcode' }, //第一个器械包条码 + { xtype: 'hidden', name: 'isRecycle', id: 'isRecycle' }, //第一个是否重新回收 + { xtype: 'hidden', name: 'isRepacking', id: 'isRepacking' }, //第一个是否重新装配 + { xtype: 'hidden', name: 'isDiscard', id: 'isDiscard' }, //第一个是否废弃条码 + { xtype: 'hidden', name: 'scope', id: 'scope' }, //监测范围 + { xtype: 'hidden', name: 'type', id: 'type', value: parm_s_type }, //监测类型:“质量监测” + { xtype: 'hidden', name: 'name', id: 'name' }, //质量监测实例名称 + { xtype: 'hidden', name: 'optionAmount', id: 'optionAmount' }, //监测项元素id集合(用分号分隔) + { xtype: 'hidden', name: 'uploadImgIds', id: 'uploadImgIds' }, + { xtype: 'hidden', name: 'containerBarcode', id: 'containerBarcode' }, + { xtype: 'hidden', name: 'tousseDefRecycling', id: 'tousseDefRecycling' }, //第一个器械包是否需要回收 + { xtype: 'hidden', name: 'formDefinitionId', id: 'formDefinitionId' }, //质量监测定义id + { xtype: 'hidden', name: 'isAllTousseOfSterile', id: 'isAllTousseOfSterile' }, //是否整炉 + { xtype: 'hidden', name: 'errorDamageQmKey', id: 'errorDamageQmKey' }, + //{xtype: 'hidden',name: 'inspectType',id: 'inspectType'}, //记住上一次的监测项类型 + { xtype: 'hidden', name: 'scanWashRecord_id', id: 'scanWashRecord_id' }, //清洗记录的id + { xtype: 'hidden', name: 'scanTousseInstance_id', id: 'scanTousseInstance_id' }, //回收或灭菌扫描条码的id + varibaleContent1, + varibaleContent2, + { + layout: 'form', + columnWidth: .5, + labelWidth: (recycleQM && top.screen.width > 1280) ? 182 : labelWidthLeft, + height: setH, + items: [{ + xtype: 'datefieldWithMin', + fieldLabel: '抽检时间', + id: 'dateTime', + name: 'dateTime', + // value : new Date(), + editable: false, + format: 'Y-m-d H:i', + altFormats: 'Y-m-d|Y-n-j|y-n-j|y-m-j|y-m-d|y-n-d|Y-n-d|Y-m-j|Ymd|Ynj|ynj|ymj|ymd|ynd|Ynd|Ymj|Y/m/d|Y/n/j|y/n/j|y/m/j|y/m/d|y/n/d|Y/n/d|Y/m/j', + allowBlank: false, + anchor: '95%' + }] + }, { + layout: 'form', + columnWidth: .5, + labelWidth: (recycleQM && top.screen.width > 1280) ? 182 : labelWidthLeft, + height: setH, + items: [{ + xtype: 'combo', + fieldLabel: '登记人', + id: 'createUserName', + name: 'createUserName', + queryParam: 'spell', + minChars: 0, + displayField: 'fullName', + store: departUsersStore, + forceSelection: false, + lazyInit: true, + triggerAction: 'all', + hideTrigger: false, + typeAhead: false, + allowBlank: false, + anchor: '95%', + value: userName, + listeners: { + specialkey: function (field, e) { + if (e.getKey() == 13) { + var createUserNameBox = top.Ext.getCmp('createUserName'); + var text = createUserNameBox.getValue(); + if (isValidBarcode(text)) { + loadResponPersonByBarcode(text, 'createUserName'); + } else if (isValidStaffNumber(text)) { + UserTableManager.getUserByLoginName(text, function (responseText) { + if (!isUndefinedOrNullOrEmpty(responseText)) { + var result = top.Ext.decode(responseText); + if (result.isBelongsToCurrentLoginUserOrgs == false) { + showResultQM("登记人需为当前科室用户!"); + return + } + top.Ext.getCmp('createUserName').setValue(result.fullName); + } else { + showResultQM('找不到该工号对应的人员信息'); } - top.Ext.getCmp('createUserName').setValue(result.fullName); - }else{ - showResultQM('找不到该工号对应的人员信息'); - } - }); - }else { - showResult('该工号或条码不存在!'); + }); + } else { + showResult('该工号或条码不存在!'); + } } } } - } - }] - }, { - layout : 'form', - columnWidth : .5, - labelWidth : (recycleQM && top.screen.width > 1280) ? 182 : labelWidthLeft, - height:setH, - items : [{ - xtype : 'textfield', - fieldLabel : "录入科室", - name : "orgUnit", - id : "orgUnit", - disabled:true, - anchor : '95%', - value:currentOrgUnitName - }] - },{ - xtype:'hidden', - id:'orgUnitCoding', - name:'orgUnitCoding', - value:currentOrgUnitCoding - },{ - layout : 'form', - columnWidth : .5, - labelWidth : (recycleQM && top.screen.width > 1280) ? 182 : labelWidthLeft, - height:setH, - items:[{ - xtype : 'textfield', - fieldLabel : "处理科室", - id : "handleDepart", - disabled:true, - anchor : '95%' - }] - },{ - layout : 'form', - columnWidth : .5, - labelWidth : (recycleQM && top.screen.width > 1280) ? 182 : labelWidthLeft, - height:setH, - items : [{ - xtype : 'textfield', - name : 'responsiblePersonBarcode', - id : 'responsiblePersonBarcode', - fieldLabel : "扫描责任人条码", - listeners : { - specialkey : function(field,e){ - if(e.getKey() == 13){ - var barcodeValue = field.getValue(); - top.Ext.getCmp("responsiblePersonBarcode").setValue(''); - loadResponPersonByBarcode(barcodeValue,'responsiblePerson'); + }] + }, { + layout: 'form', + columnWidth: .5, + labelWidth: (recycleQM && top.screen.width > 1280) ? 182 : labelWidthLeft, + height: setH, + items: [{ + xtype: 'textfield', + fieldLabel: "录入科室", + name: "orgUnit", + id: "orgUnit", + disabled: true, + anchor: '95%', + value: currentOrgUnitName + }] + }, { + xtype: 'hidden', + id: 'orgUnitCoding', + name: 'orgUnitCoding', + value: currentOrgUnitCoding + }, { + layout: 'form', + columnWidth: .5, + labelWidth: (recycleQM && top.screen.width > 1280) ? 182 : labelWidthLeft, + height: setH, + items: [{ + xtype: 'textfield', + fieldLabel: "处理科室", + id: "handleDepart", + disabled: true, + anchor: '95%' + }] + }, { + layout: 'form', + columnWidth: .5, + labelWidth: (recycleQM && top.screen.width > 1280) ? 182 : labelWidthLeft, + height: setH, + items: [{ + xtype: 'textfield', + name: 'responsiblePersonBarcode', + id: 'responsiblePersonBarcode', + fieldLabel: "扫描责任人条码", + listeners: { + specialkey: function (field, e) { + if (e.getKey() == 13) { + var barcodeValue = field.getValue(); + top.Ext.getCmp("responsiblePersonBarcode").setValue(''); + loadResponPersonByBarcode(barcodeValue, 'responsiblePerson'); + } } - } - }, - anchor : '95%' - }] - },{ - layout : 'form', - columnWidth : .5, - labelWidth : (recycleQM && top.screen.width > 1280) ? 182 : labelWidthLeft, - height:setH, - items : [{ - xtype : 'textfield', - name : 'responsiblePerson', - id : 'responsiblePerson', - fieldLabel : "责任人", - disabled:true, - anchor : '95%' - }] - },{ - id:'insertBasket', - name:'insertBasket', - layout : 'form', - columnWidth : .5, - labelWidth : (recycleQM && top.screen.width > 1280) ? 182 : labelWidthLeft, - height:setH, - items : [{ - xtype : 'textfield', - name : 'scanBarcode', - id : 'scanBarcode', - fieldLabel : "重新回收篮筐条码", - listeners : { - specialkey : function(field,e){ - if(e.getKey() == 13){ - var barcodeValue = field.getValue(); - top.Ext.getCmp("scanBarcode").setValue(''); - ContainerTableManager.getBasketByBarcodeAndProcedures(barcodeValue,basketAllowProcedure,function(jsonStr){ - var obj = top.Ext.util.JSON.decode(jsonStr); - if(obj.success){ - top.Ext.getCmp('containerName').setValue(obj.containerName); - if(obj.containerName !== ''){ - top.Ext.getCmp('containerName').disable(); + }, + anchor: '95%' + }] + }, { + layout: 'form', + columnWidth: .5, + labelWidth: (recycleQM && top.screen.width > 1280) ? 182 : labelWidthLeft, + height: setH, + items: [{ + xtype: 'textfield', + name: 'responsiblePerson', + id: 'responsiblePerson', + fieldLabel: "责任人", + disabled: true, + anchor: '95%' + }] + }, { + id: 'insertBasket', + name: 'insertBasket', + layout: 'form', + columnWidth: .5, + labelWidth: (recycleQM && top.screen.width > 1280) ? 182 : labelWidthLeft, + height: setH, + items: [{ + xtype: 'textfield', + name: 'scanBarcode', + id: 'scanBarcode', + fieldLabel: "重新回收篮筐条码", + listeners: { + specialkey: function (field, e) { + if (e.getKey() == 13) { + var barcodeValue = field.getValue(); + top.Ext.getCmp("scanBarcode").setValue(''); + ContainerTableManager.getBasketByBarcodeAndProcedures(barcodeValue, basketAllowProcedure, function (jsonStr) { + var obj = top.Ext.util.JSON.decode(jsonStr); + if (obj.success) { + top.Ext.getCmp('containerName').setValue(obj.containerName); + if (obj.containerName !== '') { + top.Ext.getCmp('containerName').disable(); + } + } else { + showResultQM(obj.message); } - }else{ - showResultQM(obj.message); - } - top.Ext.getCmp("containerBarcode").setValue(barcodeValue); - }); + top.Ext.getCmp("containerBarcode").setValue(barcodeValue); + }); + } } - } - }, - anchor : '95%' - }] - },{ - id:'containerNameItem', - name:'containerNameItem', - layout : 'form', - columnWidth : .5, - height:setH, - labelWidth : (recycleQM && top.screen.width > 1280) ? 182 : labelWidthLeft, - items : [{ - xtype : 'textfield', - name : 'containerName', - id : 'containerName', - fieldLabel : "重新回收篮筐名称", - disabled:true, - allowBlank:true, - anchor : '95%' - }] - },{ - id:'rinseBasketsBarcodeWrapper', - name:'rinseBasketsBarcodeWrapper', - layout : 'form', - columnWidth : .5, - labelWidth : (recycleQM && top.screen.width > 1280) ? 182 : labelWidthLeft, - height:setH, - hidden:true, - items : [{ - xtype : 'textfield', - name : 'rinseBasketsBarcode', - id : 'rinseBasketsBarcode', - fieldLabel : "清洗篮筐条码", - listeners : { - specialkey : function(field,e){ - if(e.getKey() == 13){ - var barcodeValue = field.getValue(); - top.Ext.getCmp("rinseBasketsBarcode").setValue(''); - top.Ext.Ajax.request( { - url : WWWROOT + '/disinfectSystem/qualityMonitoringInstanceAction!scanBarcodeForWashRecord.do', - params : {basketBarcode : barcodeValue}, - success : function(response, options) { - var result = top.Ext.decode(response.responseText); - if(result.success == false){ - showResult(result.message); - }else{ - if(result.data.length > 1){ - loadScanBarcodeMsg('rinseBasketsName','cleaningMachinePosition','cleaningMachineDate','cleaningMachineName','cleaningMachineProgramName','cleaningStartTime','cleaningEndTime','scanWashRecord_id',barcodeValue); - }else if(result.data.length == 1){ - var record = result.data[0]; - top.Ext.getCmp('rinseBasketsName').setValue(record.washBasketName); - top.Ext.getCmp('cleaningMachinePosition').setValue(record.position); - top.Ext.getCmp('cleaningMachineDate').setValue(record.washDate); - top.Ext.getCmp('cleaningMachineName').setValue(record.disinfectIdentification); - top.Ext.getCmp('cleaningMachineProgramName').setValue(record.disinfectProgram); - top.Ext.getCmp('cleaningStartTime').setValue(record.startDate); - top.Ext.getCmp('cleaningEndTime').setValue(record.endDate); - top.Ext.getCmp('scanWashRecord_id').setValue(record.washRecordID); - top.Ext.getCmp('responsiblePerson').setValue(record.personInCharge); - top.Ext.getCmp('tousseDefinitionId').setValue(record.tousseDefinitionId || ''); - top.Ext.getCmp('tousseName').setValue(record.tousseName || ''); - materialDefinitionStore.load() + }, + anchor: '95%' + }] + }, { + id: 'containerNameItem', + name: 'containerNameItem', + layout: 'form', + columnWidth: .5, + height: setH, + labelWidth: (recycleQM && top.screen.width > 1280) ? 182 : labelWidthLeft, + items: [{ + xtype: 'textfield', + name: 'containerName', + id: 'containerName', + fieldLabel: "重新回收篮筐名称", + disabled: true, + allowBlank: true, + anchor: '95%' + }] + }, { + id: 'rinseBasketsBarcodeWrapper', + name: 'rinseBasketsBarcodeWrapper', + layout: 'form', + columnWidth: .5, + labelWidth: (recycleQM && top.screen.width > 1280) ? 182 : labelWidthLeft, + height: setH, + hidden: true, + items: [{ + xtype: 'textfield', + name: 'rinseBasketsBarcode', + id: 'rinseBasketsBarcode', + fieldLabel: "清洗篮筐条码", + listeners: { + specialkey: function (field, e) { + if (e.getKey() == 13) { + var barcodeValue = field.getValue(); + top.Ext.getCmp("rinseBasketsBarcode").setValue(''); + top.Ext.Ajax.request({ + url: WWWROOT + '/disinfectSystem/qualityMonitoringInstanceAction!scanBarcodeForWashRecord.do', + params: { basketBarcode: barcodeValue }, + success: function (response, options) { + var result = top.Ext.decode(response.responseText); + if (result.success == false) { + showResult(result.message); + } else { + if (result.data.length > 1) { + loadScanBarcodeMsg('rinseBasketsName', 'cleaningMachinePosition', 'cleaningMachineDate', 'cleaningMachineName', 'cleaningMachineProgramName', 'cleaningStartTime', 'cleaningEndTime', 'scanWashRecord_id', barcodeValue); + } else if (result.data.length == 1) { + var record = result.data[0]; + top.Ext.getCmp('rinseBasketsName').setValue(record.washBasketName); + top.Ext.getCmp('cleaningMachinePosition').setValue(record.position); + top.Ext.getCmp('cleaningMachineDate').setValue(record.washDate); + top.Ext.getCmp('cleaningMachineName').setValue(record.disinfectIdentification); + top.Ext.getCmp('cleaningMachineProgramName').setValue(record.disinfectProgram); + top.Ext.getCmp('cleaningStartTime').setValue(record.startDate); + top.Ext.getCmp('cleaningEndTime').setValue(record.endDate); + top.Ext.getCmp('scanWashRecord_id').setValue(record.washRecordID); + top.Ext.getCmp('responsiblePerson').setValue(record.personInCharge); + top.Ext.getCmp('tousseDefinitionId').setValue(record.tousseDefinitionId || ''); + top.Ext.getCmp('tousseName').setValue(record.tousseName || ''); + materialDefinitionStore.load() + } } + }, + failure: function (response, options) { + } - }, - failure : function(response, options) { - - } - }); - + }); + + } } - } - }, - anchor : '95%' - }] - },{ - id:'rinseBasketsNameWrapper', - name:'rinseBasketsNameWrapper', - layout : 'form', - columnWidth : .5, - height:setH, - labelWidth : (recycleQM && top.screen.width > 1280) ? 182 : labelWidthLeft, - hidden:true, - items : [{ - xtype : 'textfield', - name : 'rinseBasketsName', - id : 'rinseBasketsName', - fieldLabel : "清洗篮筐名称", - disabled:true, - allowBlank:true, - anchor : '95%' - }] - },{ - id:'cleaningMachinePositionWrapper', - name:'cleaningMachinePositionWrapper', - layout : 'form', - columnWidth : .5, - hidden:true, - height:setH, - labelWidth : (recycleQM && top.screen.width > 1280) ? 182 : labelWidthLeft, - items : [{ - xtype : 'textfield', - name : 'cleaningMachinePosition', - id : 'cleaningMachinePosition', - fieldLabel : "位置", - disabled:true, - anchor : '95%' - }] - },{ - id:'cleaningMachineDateWrapper', - name:'cleaningMachineDateWrapper', - layout : 'form', - columnWidth : .5, - height:setH, - labelWidth : (recycleQM && top.screen.width > 1280) ? 182 : labelWidthLeft, - hidden:true, - items : [{ - xtype : 'textfield', - name : 'cleaningMachineDate', - id : 'cleaningMachineDate', - fieldLabel : "日期", - disabled:true, - anchor : '95%' - }] - },{ - id:'cleaningMachineNameWrapper', - name:'cleaningMachineNameWrapper', - layout : 'form', - columnWidth : .5, - height:setH, - labelWidth : (recycleQM && top.screen.width > 1280) ? 182 : labelWidthLeft, - hidden:true, - items : [{ - xtype : 'textfield', - name : 'cleaningMachineName', - id : 'cleaningMachineName', - fieldLabel : "清洗机名称", - disabled:true, - anchor : '95%' - }] - },{ - id:'cleaningMachineProgramNameWrapper', - name:'cleaningMachineProgramNameWrapper', - layout : 'form', - columnWidth : .5, - height:setH, - labelWidth : (recycleQM && top.screen.width > 1280) ? 182 : labelWidthLeft, - hidden:true, - items : [{ - xtype : 'textfield', - name : 'cleaningMachineProgramName', - id : 'cleaningMachineProgramName', - fieldLabel : "清洗机程序名称", - disabled:true, - anchor : '95%' - }] - },{ - id:'cleaningStartTimeWrapper', - name:'cleaningStartTimeWrapper', - layout : 'form', - columnWidth : .5, - height:setH, - labelWidth : (recycleQM && top.screen.width > 1280) ? 182 : labelWidthLeft, - hidden:true, - items : [{ - xtype : 'textfield', - name : 'cleaningStartTime', - id : 'cleaningStartTime', - fieldLabel : "清洗机开始时间", - disabled:true, - anchor : '95%' - }] - },{ - id:'cleaningEndTimeWrapper', - name:'cleaningEndTimeWrapper', - layout : 'form', - columnWidth : .5, - height:setH, - labelWidth : (recycleQM && top.screen.width > 1280) ? 182 : labelWidthLeft, - hidden:true, - items : [{ - xtype : 'textfield', - name : 'cleaningEndTime', - id : 'cleaningEndTime', - fieldLabel : "清洗机结束时间", - disabled:true, - anchor : '95%' - }] - } ,{ - layout : 'form', - columnWidth : .5, - labelWidth : recycleQM ? 182 : labelWidthLeft, - hidden:true, - height:setH, - id:"idCardAndTousseBarcodeWrapper", - items : [{ - xtype : 'textfield', - name : 'idCardAndTousseBarcode', - id : 'idCardAndTousseBarcode', - fieldLabel : "扫描标识牌/器械包条码", - listeners : { - specialkey : function(field,e){ - if(e.getKey() == 13){ - var barcodeValue = field.getValue(); - top.Ext.getCmp("idCardAndTousseBarcode").setValue(''); - loadRecyclePersonByBarcode(barcodeValue); + }, + anchor: '95%' + }] + }, { + id: 'rinseBasketsNameWrapper', + name: 'rinseBasketsNameWrapper', + layout: 'form', + columnWidth: .5, + height: setH, + labelWidth: (recycleQM && top.screen.width > 1280) ? 182 : labelWidthLeft, + hidden: true, + items: [{ + xtype: 'textfield', + name: 'rinseBasketsName', + id: 'rinseBasketsName', + fieldLabel: "清洗篮筐名称", + disabled: true, + allowBlank: true, + anchor: '95%' + }] + }, { + id: 'cleaningMachinePositionWrapper', + name: 'cleaningMachinePositionWrapper', + layout: 'form', + columnWidth: .5, + hidden: true, + height: setH, + labelWidth: (recycleQM && top.screen.width > 1280) ? 182 : labelWidthLeft, + items: [{ + xtype: 'textfield', + name: 'cleaningMachinePosition', + id: 'cleaningMachinePosition', + fieldLabel: "位置", + disabled: true, + anchor: '95%' + }] + }, { + id: 'cleaningMachineDateWrapper', + name: 'cleaningMachineDateWrapper', + layout: 'form', + columnWidth: .5, + height: setH, + labelWidth: (recycleQM && top.screen.width > 1280) ? 182 : labelWidthLeft, + hidden: true, + items: [{ + xtype: 'textfield', + name: 'cleaningMachineDate', + id: 'cleaningMachineDate', + fieldLabel: "日期", + disabled: true, + anchor: '95%' + }] + }, { + id: 'cleaningMachineNameWrapper', + name: 'cleaningMachineNameWrapper', + layout: 'form', + columnWidth: .5, + height: setH, + labelWidth: (recycleQM && top.screen.width > 1280) ? 182 : labelWidthLeft, + hidden: true, + items: [{ + xtype: 'textfield', + name: 'cleaningMachineName', + id: 'cleaningMachineName', + fieldLabel: "清洗机名称", + disabled: true, + anchor: '95%' + }] + }, { + id: 'cleaningMachineProgramNameWrapper', + name: 'cleaningMachineProgramNameWrapper', + layout: 'form', + columnWidth: .5, + height: setH, + labelWidth: (recycleQM && top.screen.width > 1280) ? 182 : labelWidthLeft, + hidden: true, + items: [{ + xtype: 'textfield', + name: 'cleaningMachineProgramName', + id: 'cleaningMachineProgramName', + fieldLabel: "清洗机程序名称", + disabled: true, + anchor: '95%' + }] + }, { + id: 'cleaningStartTimeWrapper', + name: 'cleaningStartTimeWrapper', + layout: 'form', + columnWidth: .5, + height: setH, + labelWidth: (recycleQM && top.screen.width > 1280) ? 182 : labelWidthLeft, + hidden: true, + items: [{ + xtype: 'textfield', + name: 'cleaningStartTime', + id: 'cleaningStartTime', + fieldLabel: "清洗机开始时间", + disabled: true, + anchor: '95%' + }] + }, { + id: 'cleaningEndTimeWrapper', + name: 'cleaningEndTimeWrapper', + layout: 'form', + columnWidth: .5, + height: setH, + labelWidth: (recycleQM && top.screen.width > 1280) ? 182 : labelWidthLeft, + hidden: true, + items: [{ + xtype: 'textfield', + name: 'cleaningEndTime', + id: 'cleaningEndTime', + fieldLabel: "清洗机结束时间", + disabled: true, + anchor: '95%' + }] + }, { + layout: 'form', + columnWidth: .5, + labelWidth: recycleQM ? 182 : labelWidthLeft, + hidden: true, + height: setH, + id: "idCardAndTousseBarcodeWrapper", + items: [{ + xtype: 'textfield', + name: 'idCardAndTousseBarcode', + id: 'idCardAndTousseBarcode', + fieldLabel: "扫描标识牌/器械包条码", + listeners: { + specialkey: function (field, e) { + if (e.getKey() == 13) { + var barcodeValue = field.getValue(); + top.Ext.getCmp("idCardAndTousseBarcode").setValue(''); + loadRecyclePersonByBarcode(barcodeValue); + } } - } - }, - anchor : '95%' - }] - },{ - layout : 'form', - columnWidth : .5, - labelWidth : (recycleQM && top.screen.width > 1280) ? 182 : labelWidthLeft, - hidden:true, - height:setH, - id:"tousseNameBasicsWrapper", - items : [{ - xtype : 'textfield', - name : 'tousseNameBasics', - id : 'tousseNameBasics', - fieldLabel : "器械包名称", - disabled:true, - anchor : '95%' - }] - },{ - layout : 'form', - columnWidth : .5, - labelWidth : (recycleQM && top.screen.width > 1280) ? 182 : labelWidthLeft, - hidden:true, - height:setH, - id:"recyclePersonWrapper", - items : [{ - xtype : 'textfield', - name : 'recyclePerson', - id : 'recyclePerson', - fieldLabel : "回收员", - disabled:true, - anchor : '95%' - }] - } ,{ - layout : 'form', - columnWidth : .5, - labelWidth : (recycleQM && top.screen.width > 1280) ? 182 : labelWidthLeft, - hidden:true, - height:setH, - id:"recycleDepartmentsWrapper", - items : [{ - xtype : 'textfield', - name : 'recycleDepartments', - id : 'recycleDepartments', - fieldLabel : "回收科室", - disabled:true, - anchor : '95%' - }] - },{ - layout : 'form', - columnWidth : .5, - labelWidth : (recycleQM && top.screen.width > 1280) ? 182 : labelWidthLeft, - hidden:true, - height:setH, - id:"operationRoomWrapper", - items : [{ - xtype : 'textfield', - name : 'operationRoom', - id : 'operationRoom', - fieldLabel : "手术间", - disabled:true, - anchor : '95%' - }] - },{ - layout : 'form', - columnWidth : .5, - labelWidth : (recycleQM && top.screen.width > 1280) ? 182 : labelWidthLeft, - hidden:true, - height:setH, - id:"nurseWrapper", - items : [{ - xtype : 'textfield', - name : 'nurse', - id : 'nurse', - fieldLabel : "巡回护士", - disabled:true, - anchor : '95%' - }] - },{ - layout : 'form', - columnWidth : .5, - labelWidth : (recycleQM && top.screen.width > 1280) ? 182 : labelWidthLeft, - hidden:true, - height:setH, - id:"recycleTimeWrapper", - items : [{ - xtype : 'datefieldWithMin', - fieldLabel : '回收时间', - id : 'recycleTime', - name : 'recycleTime', -// value : new Date(), - editable : false, - height:setH, - disabled:true, - format : 'Y-m-d H:i', - altFormats:'Y-m-d|Y-n-j|y-n-j|y-m-j|y-m-d|y-n-d|Y-n-d|Y-m-j|Ymd|Ynj|ynj|ymj|ymd|ynd|Ynd|Ymj|Y/m/d|Y/n/j|y/n/j|y/m/j|y/m/d|y/n/d|Y/n/d|Y/m/j', - anchor : '95%' - }] - },{ - layout : 'form', - columnWidth : .5, - labelWidth : (recycleQM && top.screen.width > 1280) ? 182 : labelWidthLeft, - hidden:true, - height:setH, - id:"tousseBarcodeWrapper", - items : [{ - xtype : 'textfield', - name : 'tousseBarcode', - id : 'tousseBarcode', - fieldLabel : "器械包条码", - listeners : { - specialkey : function(field,e){ - if(e.getKey() == 13){ - var barcodeValue = field.getValue(); - top.Ext.getCmp("tousseBarcode").setValue(''); - //后台接口赋值 - loadSterilizationByBarcode(barcodeValue); + }, + anchor: '95%' + }] + }, { + layout: 'form', + columnWidth: .5, + labelWidth: (recycleQM && top.screen.width > 1280) ? 182 : labelWidthLeft, + hidden: true, + height: setH, + id: "tousseNameBasicsWrapper", + items: [{ + xtype: 'textfield', + name: 'tousseNameBasics', + id: 'tousseNameBasics', + fieldLabel: "器械包名称", + disabled: true, + anchor: '95%' + }] + }, { + layout: 'form', + columnWidth: .5, + labelWidth: (recycleQM && top.screen.width > 1280) ? 182 : labelWidthLeft, + hidden: true, + height: setH, + id: "recyclePersonWrapper", + items: [{ + xtype: 'textfield', + name: 'recyclePerson', + id: 'recyclePerson', + fieldLabel: "回收员", + disabled: true, + anchor: '95%' + }] + }, { + layout: 'form', + columnWidth: .5, + labelWidth: (recycleQM && top.screen.width > 1280) ? 182 : labelWidthLeft, + hidden: true, + height: setH, + id: "recycleDepartmentsWrapper", + items: [{ + xtype: 'textfield', + name: 'recycleDepartments', + id: 'recycleDepartments', + fieldLabel: "回收科室", + disabled: true, + anchor: '95%' + }] + }, { + layout: 'form', + columnWidth: .5, + labelWidth: (recycleQM && top.screen.width > 1280) ? 182 : labelWidthLeft, + hidden: true, + height: setH, + id: "operationRoomWrapper", + items: [{ + xtype: 'textfield', + name: 'operationRoom', + id: 'operationRoom', + fieldLabel: "手术间", + disabled: true, + anchor: '95%' + }] + }, { + layout: 'form', + columnWidth: .5, + labelWidth: (recycleQM && top.screen.width > 1280) ? 182 : labelWidthLeft, + hidden: true, + height: setH, + id: "nurseWrapper", + items: [{ + xtype: 'textfield', + name: 'nurse', + id: 'nurse', + fieldLabel: "巡回护士", + disabled: true, + anchor: '95%' + }] + }, { + layout: 'form', + columnWidth: .5, + labelWidth: (recycleQM && top.screen.width > 1280) ? 182 : labelWidthLeft, + hidden: true, + height: setH, + id: "recycleTimeWrapper", + items: [{ + xtype: 'datefieldWithMin', + fieldLabel: '回收时间', + id: 'recycleTime', + name: 'recycleTime', + // value : new Date(), + editable: false, + height: setH, + disabled: true, + format: 'Y-m-d H:i', + altFormats: 'Y-m-d|Y-n-j|y-n-j|y-m-j|y-m-d|y-n-d|Y-n-d|Y-m-j|Ymd|Ynj|ynj|ymj|ymd|ynd|Ynd|Ymj|Y/m/d|Y/n/j|y/n/j|y/m/j|y/m/d|y/n/d|Y/n/d|Y/m/j', + anchor: '95%' + }] + }, { + layout: 'form', + columnWidth: .5, + labelWidth: (recycleQM && top.screen.width > 1280) ? 182 : labelWidthLeft, + hidden: true, + height: setH, + id: "tousseBarcodeWrapper", + items: [{ + xtype: 'textfield', + name: 'tousseBarcode', + id: 'tousseBarcode', + fieldLabel: "器械包条码", + listeners: { + specialkey: function (field, e) { + if (e.getKey() == 13) { + var barcodeValue = field.getValue(); + top.Ext.getCmp("tousseBarcode").setValue(''); + //后台接口赋值 + loadSterilizationByBarcode(barcodeValue); + } } - } - }, - anchor : '95%' - }] - } ,{ - layout : 'form', - columnWidth : .5, - labelWidth : (recycleQM && top.screen.width > 1280) ? 182 : labelWidthLeft, - hidden:true, - height:setH, - id:"sterilizationNameWrapper", - items : [{ - xtype : 'textfield', - name : 'sterilizationName', - id : 'sterilizationName', - fieldLabel : "灭菌炉名称", - disabled:true, - anchor : '95%' - }] - },{ - layout : 'form', - columnWidth : .5, - labelWidth : (recycleQM && top.screen.width > 1280) ? 182 : labelWidthLeft, - hidden:true, - height:setH, - id:"sterilizationProgramNameWrapper", - items : [{ - xtype : 'textfield', - name : 'sterilizationProgramName', - id : 'sterilizationProgramName', - fieldLabel : "灭菌程序名称", - disabled:true, - anchor : '95%' - }] - },{ - layout : 'form', - columnWidth : .5, - labelWidth : (recycleQM && top.screen.width > 1280) ? 182 : labelWidthLeft, - hidden:true, - height:setH, - id:"heatWrapper", - items : [{ - xtype : 'textfield', - name : 'heat', - id : 'heat', - fieldLabel : "炉次", - disabled:true, - anchor : '95%' - }] - },{ - layout : 'form', - columnWidth : .5, - labelWidth : (recycleQM && top.screen.width > 1280) ? 182 : labelWidthLeft, - hidden:true, - height:setH, - id:"sterilizationStartTimeWrapper", - items : [{ - xtype : 'textfield', - name : 'sterilizationStartTime', - id : 'sterilizationStartTime', - fieldLabel : "灭菌开始时间", - disabled:true, - anchor : '95%' - }] - } ,{ - layout : 'form', - columnWidth : .5, - labelWidth : (recycleQM && top.screen.width > 1280) ? 182 : labelWidthLeft, - hidden:true, - height:setH, - id:"sterilizationEndTimeWrapper", - items : [{ - xtype : 'textfield', - name : 'sterilizationEndTime', - id : 'sterilizationEndTime', - fieldLabel : "灭菌结束时间", - disabled:true, - anchor : '95%' - }] - },{ - layout : 'form', - columnWidth : 1, - labelWidth : (recycleQM && top.screen.width > 1280) ? 182 : labelWidthLeft, - items : [ { - xtype : 'textarea', - name : 'remark', - id : 'remark', - width : 150, - height : 50, - fieldLabel : "备注", - anchor : '97%' - }] - },{ - layout : 'column', - columnWidth : 1, - labelWidth : (recycleQM && top.screen.width > 1280) ? 182 : labelWidthLeft, - height:setH, - items : [ - { - layout : 'form', - columnWidth : 0.8, - labelWidth : (recycleQM && top.screen.width > 1280) ? 182 : labelWidthLeft, - items : [ - { - xtype : 'textfield', - name : 'uploadImage', - id : 'uploadImage', - fieldLabel : "上传图片", - anchor : '100%' - } - ] - }, - { - layout : 'form', - columnWidth : 0.08, - labelWidth : (recycleQM && top.screen.width > 1280) ? 182 : labelWidthLeft, - items : [ - { xtype:'button', - text : '上传', - handler : function(){ - if(id == null || id == ''){ - showResultQM("请先保存后再上传图片!"); - }else{ - uploadWindowA(imageType_qualitymonitoring,id); - } + }, + anchor: '95%' + }] + }, { + layout: 'form', + columnWidth: .5, + labelWidth: (recycleQM && top.screen.width > 1280) ? 182 : labelWidthLeft, + hidden: true, + height: setH, + id: "sterilizationNameWrapper", + items: [{ + xtype: 'textfield', + name: 'sterilizationName', + id: 'sterilizationName', + fieldLabel: "灭菌炉名称", + disabled: true, + anchor: '95%' + }] + }, { + layout: 'form', + columnWidth: .5, + labelWidth: (recycleQM && top.screen.width > 1280) ? 182 : labelWidthLeft, + hidden: true, + height: setH, + id: "sterilizationProgramNameWrapper", + items: [{ + xtype: 'textfield', + name: 'sterilizationProgramName', + id: 'sterilizationProgramName', + fieldLabel: "灭菌程序名称", + disabled: true, + anchor: '95%' + }] + }, { + layout: 'form', + columnWidth: .5, + labelWidth: (recycleQM && top.screen.width > 1280) ? 182 : labelWidthLeft, + hidden: true, + height: setH, + id: "heatWrapper", + items: [{ + xtype: 'textfield', + name: 'heat', + id: 'heat', + fieldLabel: "炉次", + disabled: true, + anchor: '95%' + }] + }, { + layout: 'form', + columnWidth: .5, + labelWidth: (recycleQM && top.screen.width > 1280) ? 182 : labelWidthLeft, + hidden: true, + height: setH, + id: "sterilizationStartTimeWrapper", + items: [{ + xtype: 'textfield', + name: 'sterilizationStartTime', + id: 'sterilizationStartTime', + fieldLabel: "灭菌开始时间", + disabled: true, + anchor: '95%' + }] + }, { + layout: 'form', + columnWidth: .5, + labelWidth: (recycleQM && top.screen.width > 1280) ? 182 : labelWidthLeft, + hidden: true, + height: setH, + id: "sterilizationEndTimeWrapper", + items: [{ + xtype: 'textfield', + name: 'sterilizationEndTime', + id: 'sterilizationEndTime', + fieldLabel: "灭菌结束时间", + disabled: true, + anchor: '95%' + }] + }, { + layout: 'form', + columnWidth: 1, + labelWidth: (recycleQM && top.screen.width > 1280) ? 182 : labelWidthLeft, + items: [{ + xtype: 'textarea', + name: 'remark', + id: 'remark', + width: 150, + height: 50, + fieldLabel: "备注", + anchor: '97%' + }] + }, { + layout: 'column', + columnWidth: 1, + labelWidth: (recycleQM && top.screen.width > 1280) ? 182 : labelWidthLeft, + height: setH, + items: [ + { + layout: 'form', + columnWidth: 0.8, + labelWidth: (recycleQM && top.screen.width > 1280) ? 182 : labelWidthLeft, + items: [ + { + xtype: 'textfield', + name: 'uploadImage', + id: 'uploadImage', + fieldLabel: "上传图片", + anchor: '100%' + } + ] + }, + { + layout: 'form', + columnWidth: 0.08, + labelWidth: (recycleQM && top.screen.width > 1280) ? 182 : labelWidthLeft, + items: [ + { + xtype: 'button', + text: '上传', + handler: function () { + if (id == null || id == '') { + showResultQM("请先保存后再上传图片!"); + } else { + uploadWindowA(imageType_qualitymonitoring, id); } } - ] - }, - { - layout : 'form', - columnWidth : 0.12, - labelWidth : (recycleQM && top.screen.width > 1280) ? 182 : labelWidthLeft, - items : [ - { xtype:'button', - text : '预览', - disabled:disableShowImageButton, - iconCls : 'btn_ext_application_search', - handler : function(){ - top.showUploadImagesForWin(id,'质量监测图片'); - } + } + ] + }, + { + layout: 'form', + columnWidth: 0.12, + labelWidth: (recycleQM && top.screen.width > 1280) ? 182 : labelWidthLeft, + items: [ + { + xtype: 'button', + text: '预览', + disabled: disableShowImageButton, + iconCls: 'btn_ext_application_search', + handler: function () { + top.showUploadImagesForWin(id, '质量监测图片'); } - ] - } - ] - }] + } + ] + } + ] + }] }], - buttons : [/* { + buttons: [/* { id : 'addExtractCheckTousse', text : '添加抽检器械包', handler : function(){ @@ -5048,52 +5049,52 @@ addExtractCheckMaterial(); } }, */{ - id : 'saveBtn', - text : '   保存    ', - handler : function(){ - //saveQualityMonitoring(this,materialDefinitionStore,false); - saveQualityMonitoringNew(this,materialDefinitionStore,false); - } - },{ - id : 'saveAndCreateBtn', - text : '保存并新建', - handler : function(){ - saveQualityMonitoringNew(this,materialDefinitionStore,true); - } - }, { - text : '   取消    ', - id : 'saveAndNewBtn', - handler : cancelQualityMonitoring - }] + id: 'saveBtn', + text: '   保存    ', + handler: function () { + //saveQualityMonitoring(this,materialDefinitionStore,false); + saveQualityMonitoringNew(this, materialDefinitionStore, false); + } + }, { + id: 'saveAndCreateBtn', + text: '保存并新建', + handler: function () { + saveQualityMonitoringNew(this, materialDefinitionStore, true); + } + }, { + text: '   取消    ', + id: 'saveAndNewBtn', + handler: cancelQualityMonitoring + }] }); formPanel.add({ - id : 'tousseInfoFieldSet', - xtype:"fieldset", - labelAlign :'left', - title:"器械包信息", -// layout:'column', - autoHeight:true, - items:[{ - layout : 'column', - columnWidth : .5, - labelWidth : 90, - id:'tousseInfoSetLayout', - items : [{ - layout : 'form', - columnWidth : 1, - labelWidth : 90, - items : [{ - id : 'allTousseOfSterile', - name : 'allTousseOfSterile', - fieldLabel : '是否整炉', - xtype : 'checkbox', - inputValue : '是否整炉', - listeners:{ - check:function( thiz, checked ){ - if(top.Ext.getCmp('allTousseOfSterile').hidden == false){ - if(checked){ + id: 'tousseInfoFieldSet', + xtype: "fieldset", + labelAlign: 'left', + title: "器械包信息", + // layout:'column', + autoHeight: true, + items: [{ + layout: 'column', + columnWidth: .5, + labelWidth: 90, + id: 'tousseInfoSetLayout', + items: [{ + layout: 'form', + columnWidth: 1, + labelWidth: 90, + items: [{ + id: 'allTousseOfSterile', + name: 'allTousseOfSterile', + fieldLabel: '是否整炉', + xtype: 'checkbox', + inputValue: '是否整炉', + listeners: { + check: function (thiz, checked) { + if (top.Ext.getCmp('allTousseOfSterile').hidden == false) { + if (checked) { top.Ext.getCmp('isAllTousseOfSterile').setValue('是'); - }else{ + } else { top.Ext.getCmp('isAllTousseOfSterile').setValue('否'); } updateControlStatus(); @@ -5102,325 +5103,325 @@ } } }] - },{ - layout : 'form', - columnWidth : .3, - id : 'recycleC', - labelWidth : 90, - items : [{ - id : 'recycle', - name : 'recycle', - fieldLabel : '重新回收', - xtype : 'checkbox', - inputValue : '重新回收', - listeners:{ - check:function( thiz, checked ){ - if(checked){ + }, { + layout: 'form', + columnWidth: .3, + id: 'recycleC', + labelWidth: 90, + items: [{ + id: 'recycle', + name: 'recycle', + fieldLabel: '重新回收', + xtype: 'checkbox', + inputValue: '重新回收', + listeners: { + check: function (thiz, checked) { + if (checked) { top.Ext.getCmp('isRecycle').setValue('是'); top.Ext.getCmp('disabledBarcode').setValue(false); top.Ext.getCmp('repacking').setValue(false); - }else{ + } else { top.Ext.getCmp('isRecycle').setValue('否'); } } } }] - },{ - layout : 'form', - columnWidth : .3, - id : 'repackingC', - labelWidth : 90, - items : [{ - id : 'repacking', - name : 'repacking', - fieldLabel : '重新装配', - xtype : 'checkbox', - inputValue : '重新装配', - listeners:{ - check:function( thiz, checked ){ - if(checked){ + }, { + layout: 'form', + columnWidth: .3, + id: 'repackingC', + labelWidth: 90, + items: [{ + id: 'repacking', + name: 'repacking', + fieldLabel: '重新装配', + xtype: 'checkbox', + inputValue: '重新装配', + listeners: { + check: function (thiz, checked) { + if (checked) { top.Ext.getCmp('isRepacking').setValue('是'); top.Ext.getCmp('disabledBarcode').setValue(false); top.Ext.getCmp('recycle').setValue(false); - }else{ + } else { top.Ext.getCmp('isRepacking').setValue('否'); } } } }] - - },{ - layout : 'form', - columnWidth : .3, - id : 'disabledBarcodeC', - labelWidth : 90, - items : [{ - id : 'disabledBarcode', - name : 'disabledBarcode', - fieldLabel : '废弃条码', - xtype : 'checkbox', - inputValue : '废弃条码', - listeners:{ - check:function( thiz, checked ){ - if(checked){ + + }, { + layout: 'form', + columnWidth: .3, + id: 'disabledBarcodeC', + labelWidth: 90, + items: [{ + id: 'disabledBarcode', + name: 'disabledBarcode', + fieldLabel: '废弃条码', + xtype: 'checkbox', + inputValue: '废弃条码', + listeners: { + check: function (thiz, checked) { + if (checked) { top.Ext.getCmp('isDiscard').setValue('是'); top.Ext.getCmp('recycle').setValue(false); top.Ext.getCmp('repacking').setValue(false); - }else{ + } else { top.Ext.getCmp('isDiscard').setValue('否'); } } } }] - - },{ - layout : 'column', - columnWidth : 1, - labelWidth : 90, + + }, { + layout: 'column', + columnWidth: 1, + labelWidth: 90, id: 'tosseAndMaterial', - items : [{ - layout : 'form', - id : 'tousseBarcodeC', - labelWidth : 90, - columnWidth : .36, - height:28, - items : [{ - xtype : 'textfield', - name : 'tempBarcode', - id : 'tempBarcode', - fieldLabel : "器械包条码", - listeners : { - specialkey : function(field,e){ - if(e.getKey() == 13){ - getTousseInstanceNameAndResponsiblePerson(field.getValue(), top.Ext.getCmp('formDefinitionId').getValue(), materialDefinitionStore,true); + items: [{ + layout: 'form', + id: 'tousseBarcodeC', + labelWidth: 90, + columnWidth: .36, + height: 28, + items: [{ + xtype: 'textfield', + name: 'tempBarcode', + id: 'tempBarcode', + fieldLabel: "器械包条码", + listeners: { + specialkey: function (field, e) { + if (e.getKey() == 13) { + getTousseInstanceNameAndResponsiblePerson(field.getValue(), top.Ext.getCmp('formDefinitionId').getValue(), materialDefinitionStore, true); getNextFocus(field); field.setValue(''); } } }, - anchor : '95%' + anchor: '95%' }] - },{ - layout : 'form', - columnWidth:.04, - labelWidth : 90, - id:"addExtractCheckTousseBtnC", - height:setH, - items : [{ - xtype:'button', - tooltip : '添加抽检器械包', - iconCls : 'btn_ext_add', - handler : function(){ + }, { + layout: 'form', + columnWidth: .04, + labelWidth: 90, + id: "addExtractCheckTousseBtnC", + height: setH, + items: [{ + xtype: 'button', + tooltip: '添加抽检器械包', + iconCls: 'btn_ext_add', + handler: function () { widthSetTousse = true; widthSet = false; addExtractCheckTousse(); widthSetTousse = false; var scope = top.Ext.getCmp("scope").getValue(); - if(top.Ext.getCmp("scope").getValue() == "材料和器械包"){//如果监测范围是材料和包的话 + if (top.Ext.getCmp("scope").getValue() == "材料和器械包") {//如果监测范围是材料和包的话 //widthSet = true; - addExtractCheckMaterial("","",1,"","","",true,"","",true,"","",tousseItemCount); + addExtractCheckMaterial("", "", 1, "", "", "", true, "", "", true, "", "", tousseItemCount); //widthSet = false; } - + } }] - },{ - layout : 'form', - id : 'tousseNameC', - labelWidth : 90, - columnWidth : .4, - height:setH, - items : [{ - xtype : 'combo', - id : 'tousseName', - name : 'tousseName', - fieldLabel : '器械包名称', - queryParam : 'spell', - minChars : 0, - valueField : 'name', - displayField : 'name', - store : tousseDefinitionStore, - forceSelection : true, - lazyInit : true, - triggerAction : 'all', - hideTrigger : true, - typeAhead : false, - anchor : '95%', - listeners : { - select : function(combo, record, index) { + }, { + layout: 'form', + id: 'tousseNameC', + labelWidth: 90, + columnWidth: .4, + height: setH, + items: [{ + xtype: 'combo', + id: 'tousseName', + name: 'tousseName', + fieldLabel: '器械包名称', + queryParam: 'spell', + minChars: 0, + valueField: 'name', + displayField: 'name', + store: tousseDefinitionStore, + forceSelection: true, + lazyInit: true, + triggerAction: 'all', + hideTrigger: true, + typeAhead: false, + anchor: '95%', + listeners: { + select: function (combo, record, index) { combo.setValue(record.data.name); top.Ext.getCmp('tousseDefinitionId').setValue(record.data.id); //加载责任人 }, - blur : function(field){ - if(!top.Ext.getCmp('tousseName').getRawValue()){ + blur: function (field) { + if (!top.Ext.getCmp('tousseName').getRawValue()) { top.Ext.getCmp('tousseDefinitionId').setValue(''); } //重新加载包内的材料 materialDefinitionStore.reload(); - if(materialItemCount > 0){ - for(var i=1;i<=materialItemCount;i++){ - if(top.Ext.getCmp('material0'+'_'+i)){ - top.Ext.getCmp('material0'+'_'+i).store.reload(); + if (materialItemCount > 0) { + for (var i = 1; i <= materialItemCount; i++) { + if (top.Ext.getCmp('material0' + '_' + i)) { + top.Ext.getCmp('material0' + '_' + i).store.reload(); } } } } } }] - },{ - layout : 'form', - id : 'tousseAmountC', - labelWidth : 90, - columnWidth : .2, - items : [{ - xtype : 'numberfield', - allowDecimals : false, - name : 'tousseAmount', - id : 'tousseAmount', - fieldLabel : "器械包数量", - allowBlank : true, - blankText : '数量不能为空', - anchor : '95%' + }, { + layout: 'form', + id: 'tousseAmountC', + labelWidth: 90, + columnWidth: .2, + items: [{ + xtype: 'numberfield', + allowDecimals: false, + name: 'tousseAmount', + id: 'tousseAmount', + fieldLabel: "器械包数量", + allowBlank: true, + blankText: '数量不能为空', + anchor: '95%' }] - },{ - layout : 'column', - columnWidth : 1, - labelWidth : 90, + }, { + layout: 'column', + columnWidth: 1, + labelWidth: 90, id: 'materialWrapper', - items:[{ - layout : 'form', - id : 'materialC', - columnWidth : .36, - height:setH, - labelWidth : 90, - items : [{ - xtype : 'combo', - id : 'material', - name : 'material', - fieldLabel : '抽检器械', - queryParam : 'spell', - minChars : 0, - valueField : 'id', - displayField : 'name', - store : materialDefinitionStore, - forceSelection : true, - lazyInit : true, - triggerAction : 'all', - hideTrigger : true, - typeAhead : false, - anchor : '95%', - listeners : { - select : function(combo, record, index) { + items: [{ + layout: 'form', + id: 'materialC', + columnWidth: .36, + height: setH, + labelWidth: 90, + items: [{ + xtype: 'combo', + id: 'material', + name: 'material', + fieldLabel: '抽检器械', + queryParam: 'spell', + minChars: 0, + valueField: 'id', + displayField: 'name', + store: materialDefinitionStore, + forceSelection: true, + lazyInit: true, + triggerAction: 'all', + hideTrigger: true, + typeAhead: false, + anchor: '95%', + listeners: { + select: function (combo, record, index) { combo.setValue(record.data.name); } } }] - },{ - layout : 'form', - columnWidth:.04, - labelWidth : 90, - height:setH, - id:"addExtractCheckMaterialBtnC", - items : [{ - xtype:'button', - tooltip : '添加抽检器械', - iconCls : 'btn_ext_add', - handler : function(){ - var firstChildNum = ""; - widthSet = true; - if(top.Ext.getCmp("scope").getValue() == "材料和器械包"){//如果监测范围是材料和包的话 - firstChildNum = 001;//这里是自己写死的,因为这个本身是第一个 - + }, { + layout: 'form', + columnWidth: .04, + labelWidth: 90, + height: setH, + id: "addExtractCheckMaterialBtnC", + items: [{ + xtype: 'button', + tooltip: '添加抽检器械', + iconCls: 'btn_ext_add', + handler: function () { + var firstChildNum = ""; + widthSet = true; + if (top.Ext.getCmp("scope").getValue() == "材料和器械包") {//如果监测范围是材料和包的话 + firstChildNum = 001;//这里是自己写死的,因为这个本身是第一个 + + } + addExtractCheckMaterial("", "", 1, "", "", "", "", "", "", "", firstChildNum, "", 0); + widthSet = false; } - addExtractCheckMaterial("","",1,"","","","","","","",firstChildNum,"",0); - widthSet = false; - } - }] - },{ - layout : 'form', - id : 'materialAmountC', - columnWidth : 0.32, - labelWidth :91, - height:setH, - items : [{ - xtype : 'numberfield', - allowDecimals : false, - name : 'materialAmount', - id : 'materialAmount', - fieldLabel : "器械数量", - allowBlank : true, - blankText : '数量不能为空', - anchor : '95%' - }] - },{ - layout : 'form', - //hidden : !(qualityMonitoringWRRecordID > 0 && (sstsConfig.hasOwnProperty('haveRinserPosition')) && sstsConfig.haveRinserPosition), - id : 'basketBarcodeC', - columnWidth : .36, - labelWidth : 90, - items : [{ - xtype : 'textfield', - name : 'basketBarcode', - id : 'basketBarcode', - fieldLabel : "篮筐条码", - anchor : '95%', - listeners : { - specialkey : function(field,e){ - if(e.getKey() == 13){ - var idName = field.getId().replace("basketBarcode","position"); - getPostionByBasketBarcode(field.getValue(),idName); - field.setValue(''); + }] + }, { + layout: 'form', + id: 'materialAmountC', + columnWidth: 0.32, + labelWidth: 91, + height: setH, + items: [{ + xtype: 'numberfield', + allowDecimals: false, + name: 'materialAmount', + id: 'materialAmount', + fieldLabel: "器械数量", + allowBlank: true, + blankText: '数量不能为空', + anchor: '95%' + }] + }, { + layout: 'form', + //hidden : !(qualityMonitoringWRRecordID > 0 && (sstsConfig.hasOwnProperty('haveRinserPosition')) && sstsConfig.haveRinserPosition), + id: 'basketBarcodeC', + columnWidth: .36, + labelWidth: 90, + items: [{ + xtype: 'textfield', + name: 'basketBarcode', + id: 'basketBarcode', + fieldLabel: "篮筐条码", + anchor: '95%', + listeners: { + specialkey: function (field, e) { + if (e.getKey() == 13) { + var idName = field.getId().replace("basketBarcode", "position"); + getPostionByBasketBarcode(field.getValue(), idName); + field.setValue(''); + } } } - } + }] + }, { + layout: 'form', + //hidden : !(qualityMonitoringWRRecordID > 0 && (sstsConfig.hasOwnProperty('haveRinserPosition')) && sstsConfig.haveRinserPosition), + id: 'positionC', + columnWidth: .36, + labelWidth: labelWidthPosition, + items: [{ + xtype: 'textfield', + name: 'position', + id: 'position', + editable: false, + fieldLabel: "位置", + anchor: '95%' + }] }] - },{ - layout : 'form', - //hidden : !(qualityMonitoringWRRecordID > 0 && (sstsConfig.hasOwnProperty('haveRinserPosition')) && sstsConfig.haveRinserPosition), - id : 'positionC', - columnWidth : .36, - labelWidth :labelWidthPosition, - items : [{ - xtype : 'textfield', - name : 'position', - id : 'position', - editable : false, - fieldLabel : "位置", - anchor : '95%' - }] }] - }] - }] - }] + }] + }] }); formPanel.add({ - id : 'sterilizationRecordInfo', - xtype:"fieldset", - labelAlign :'left', - title:"灭菌记录信息", - autoHeight:true, - items:[{ - layout : 'column', - columnWidth : .5, - labelWidth : 90, - id:'setLayout', - items : [{ - layout : 'form', - columnWidth : .5, - labelWidth : 90, - items : [{ - xtype : 'datefieldWithMin', - fieldLabel : '灭菌日期', - id : 'srDateTime', - name : 'srDateTime', - editable : false, - format : 'Y-m-d', - altFormats:'Y-m-d|Y-n-j|y-n-j|y-m-j|y-m-d|y-n-d|Y-n-d|Y-m-j|Ymd|Ynj|ynj|ymj|ymd|ynd|Ynd|Ymj|Y/m/d|Y/n/j|y/n/j|y/m/j|y/m/d|y/n/d|Y/n/d|Y/m/j', - allowBlank : true, - anchor : '95%', - listeners : { - select : function() { + id: 'sterilizationRecordInfo', + xtype: "fieldset", + labelAlign: 'left', + title: "灭菌记录信息", + autoHeight: true, + items: [{ + layout: 'column', + columnWidth: .5, + labelWidth: 90, + id: 'setLayout', + items: [{ + layout: 'form', + columnWidth: .5, + labelWidth: 90, + items: [{ + xtype: 'datefieldWithMin', + fieldLabel: '灭菌日期', + id: 'srDateTime', + name: 'srDateTime', + editable: false, + format: 'Y-m-d', + altFormats: 'Y-m-d|Y-n-j|y-n-j|y-m-j|y-m-d|y-n-d|Y-n-d|Y-m-j|Ymd|Ynj|ynj|ymj|ymd|ynd|Ynd|Ymj|Y/m/d|Y/n/j|y/n/j|y/m/j|y/m/d|y/n/d|Y/n/d|Y/m/j', + allowBlank: true, + anchor: '95%', + listeners: { + select: function () { // this.value 2017-2-2 //top.Ext.getCmp('sterilizerFre').setValue(""); //frequencyStore.baseParams.sterilizerDate = this.value; @@ -5486,60 +5487,60 @@ anchor : '95%' }] } */] - }] + }] }); return formPanel; } -function recycleAddQualityMonitoringDo(errorDamageQmKey,tousseName,recyclingUser,depart,circuitNurse,operationRoom){ +function recycleAddQualityMonitoringDo(errorDamageQmKey, tousseName, recyclingUser, depart, circuitNurse, operationRoom) { setStartDate(top.Ext, 'yyyy/MM/dd HH:mm', 'dateTime'); //(设置抽检时间,取服务器时间 cjr) disableRecycleAndRepacking(); var responPartName = "回收清点"; top.Ext.getCmp('responsibilityPart').setValue(responPartName); - if(sstsConfig.hasOwnProperty('responsibilityPartNotLimitInspect') && sstsConfig.responsibilityPartNotLimitInspect){ + if (sstsConfig.hasOwnProperty('responsibilityPartNotLimitInspect') && sstsConfig.responsibilityPartNotLimitInspect) { formDefinitionStore.baseParams.responsiblePerson = responPartName; //formDefinitionStore.baseParams.isNotLimitInspect = "是"; formDefinitionStore.load(); - }else{ + } else { formDefinitionStore.baseParams.responsiblePerson = responPartName; formDefinitionStore.load(); } - if(!isUndefinedOrNullOrEmpty(errorDamageQmKey)){ + if (!isUndefinedOrNullOrEmpty(errorDamageQmKey)) { top.Ext.getCmp("errorDamageQmKey").setValue(errorDamageQmKey); - }else{ + } else { top.Ext.getCmp("errorDamageQmKey").setValue(""); } - if((tousseName || '') !== ''){ + if ((tousseName || '') !== '') { top.Ext.getCmp("tousseNameBasics").setValue(tousseName); top.Ext.getCmp("tousseNameBasics").disable(); } - if((recyclingUser || '') !== ''){ + if ((recyclingUser || '') !== '') { top.Ext.getCmp("recyclePerson").setValue(recyclingUser); top.Ext.getCmp("recyclePerson").disable(); } - if((depart || '') !== ''){ + if ((depart || '') !== '') { top.Ext.getCmp("recycleDepartments").setValue(depart); top.Ext.getCmp("recycleDepartments").disable(); } - if((userName || '') !== ''){ + if ((userName || '') !== '') { top.Ext.getCmp("responsiblePerson").setValue(userName); top.Ext.getCmp("responsiblePerson").disable(); } - if((circuitNurse || '') !== ''){ + if ((circuitNurse || '') !== '') { top.Ext.getCmp("nurse").setValue(circuitNurse); top.Ext.getCmp("nurse").disable(); } - if((operationRoom || '') !== ''){ + if ((operationRoom || '') !== '') { top.Ext.getCmp("operationRoom").setValue(operationRoom); top.Ext.getCmp("operationRoom").disable(); } -// formDefinitionStore.baseParams.responsiblePerson = "回收清点"; -// formDefinitionStore.load(); + // formDefinitionStore.baseParams.responsiblePerson = "回收清点"; + // formDefinitionStore.load(); } -function showResultQM(msg){ - if(recycleQM == true){ +function showResultQM(msg) { + if (recycleQM == true) { showResultCurPage(msg); - }else{ + } else { showResult(msg); } }