Index: ssts-web/src/main/webapp/disinfectsystem/qualitymonitoring/qualitymonitoringInstanceForm.js =================================================================== diff -u -r25865 -r27705 --- ssts-web/src/main/webapp/disinfectsystem/qualitymonitoring/qualitymonitoringInstanceForm.js (.../qualitymonitoringInstanceForm.js) (revision 25865) +++ ssts-web/src/main/webapp/disinfectsystem/qualitymonitoring/qualitymonitoringInstanceForm.js (.../qualitymonitoringInstanceForm.js) (revision 27705) @@ -1,1162 +1,1633 @@ -var qualityMonitoringWin = null; -//是否禁用“预览”按钮 -var disableShowImageButton = false; -//抽检器械的store -var materialDefinitionStore; -// 添加抽检器械的材料store -var materialDefinitionAddStore; -var tousseDefinitionStore; -var materialItemCount = 0; -var tousseItemCount = 0; -var formPanel; -var qualityMonitoringSterilizationID; -var qualityMonitoringWRRecordID = 0; -var responPartName = ''; -//监测项的combo -var formDefinitionStore; -var frequencyStore; -var materialCountRecords; -var materialMsg = null; -var tousseInstanceInfo = ""; -var recycleQM = false; -var otherPartAddQM = false; - -function cancelQualityMonitoring() { - closeQMWindow(); -} - -function closeQMWindow(){ - if(recycleQM == true){ - // 回收页面进来 - closeQMLayer(); - }else{ - qualityMonitoringWin.close(); - } -} - -function triggerItemAction(valueTriggerItemIds,action){ - if(valueTriggerItemIds != null && valueTriggerItemIds != ""){ - var itemIdArray = valueTriggerItemIds.split(","); - if(itemIdArray.length > 0){ - for(var n = 0 ; n < itemIdArray.length ; n++){ - var triggerItemId = itemIdArray[n]; - if(triggerItemId != null && triggerItemId != ""){ - if("show" == action){ - Ext.getCmp("hideElement" + triggerItemId).show(); - }else{ - var xtype = Ext.getCmp("hideElement" + triggerItemId).getXType(); - if(xtype == 'fieldset'){ - var length = Ext.getCmp("hideElement" + triggerItemId).items.each(function(fsItem){ - var itemType = fsItem.getXType(); - if(itemType == "panel"){ - fsItem.items.each(function(item,index,length){ - item.setValue(false); - }); - }else if(itemType == "hidden"){ - fsItem.setValue(""); - } - }); - }else if(xtype == 'panel'){ - var panel = Ext.getCmp("hideElement" + triggerItemId); - panel.items.each(function(item,index,length){ - item.setValue(""); - }); - } - Ext.getCmp("hideElement" + triggerItemId).hide(); - } - } - } - } - } -} - -/** - * 创建监测项的表单元素. - * @param type 表单元素的类型 - * @param id 监测项元素id - * @param name 监测项元素名称 - * @param allowBlank 是否允许为空 - * @param options 单选或者多选的配置项 - * @param value 默认值 - * @param isTriggerItem 触发项 - * @returns - */ -function createQualityMonitoringItemElement(type,id,name,allowBlank,options,value,isTriggerItem){ - var hideElement = false; - if('是' == isTriggerItem && (value == null || value == "")){ - hideElement = true; - } - 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%' - }] - }; - }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%' - }] - }; - - }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, - anchor : '95%' - }] - }; - }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, - readOnly : true, - editable : false, - allowBlank : allowBlank, - anchor : '95%' - }] - }; - }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%' - }] - }; - }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, - readOnly : true, - editable : false, - allowBlank : allowBlank, - anchor : '95%' - }] - }; - }else if(type == '单选'){ - var optionsArrays = new Array(); - if(options != ""){ - var optionsJson = JSON.parse(options); - var hideTriggerItemIdsValue = ""; - 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){ - 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, - listWidth: 400, - store : new Ext.data.SimpleStore({ - fields : [ 'value', 'valueTriggerItemIds'], - data : optionsArrays - }), - forceSelection : true, - value : value, - mode : 'local', - triggerAction : 'all', - anchor : '100%', - listeners:{ - select : function(combo, record, index) { - var valueTriggerItemIds = record.get("valueTriggerItemIds"); - var oldTriggerItemIds = Ext.getCmp("triggerItemIds" + id).getValue(); - triggerItemAction(oldTriggerItemIds,"hide"); - triggerItemAction(valueTriggerItemIds,"show"); - Ext.getCmp("triggerItemIds" + id).setValue(valueTriggerItemIds); - } - } - }] - }; - }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 - }); - if(options != ""){ - var optionsJson = JSON.parse(options); - for(var j = 0 ; j < optionsJson.length ; j++){ - var checked = false; - 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){ - var elementId = thiz.getName().substring(1); - var elementObj = Ext.getCmp(elementId); - if(elementObj != undefined && elementObj != null){ - var oldElementValue = elementObj.getValue(); - var checkedValue = JSON.parse(thiz.getRawValue()); - if(checked){ - if(oldElementValue.indexOf(thiz.getRawValue()) == -1){ - oldElementValue += ","; - oldElementValue += thiz.getRawValue() - elementObj.setValue(oldElementValue); - } - if(checkedValue != null){ - var valueTriggerItemIds = checkedValue.valueTriggerItemIds; - triggerItemAction(valueTriggerItemIds,"show"); - } - }else{ - var newValue = oldElementValue.replace("," + thiz.getRawValue(),''); - elementObj.setValue(newValue); - - if(checkedValue != null){ - var valueTriggerItemIds = checkedValue.valueTriggerItemIds; - triggerItemAction(valueTriggerItemIds,"hide"); - } - } - } - } - } - }] - }); - } - } - return { - columnWidth : 1, - xtype : "fieldset", - title: name, - allowBlank: allowBlank, - id:'hideElement'+id, - layout : 'column', - hidden:hideElement, - autoHeight : true, - items : optionsArray - }; - } -} -/** +var qualityMonitoringWin = null; +//是否禁用“预览”按钮 +var disableShowImageButton = false; +//抽检器械的store +var materialDefinitionStore; +// 添加抽检器械的材料store +var materialDefinitionAddStore; +var tousseDefinitionStore; +var materialItemCount = 0; +var tousseItemCount = 0; +var tousseWrapperCount = 0; +var tousseAndMaterialWrapperCount = 0; +var formPanel; +var qualityMonitoringSterilizationID; +var qualityMonitoringWRRecordID = 0; +var responPartName = ''; +//监测项的combo +var formDefinitionStore; +var frequencyStore; +var materialCountRecords; +var materialMsg = null; +var tousseInstanceInfo = ""; +var recycleQM = false; +var otherPartAddQM = false; +var setH = 28; +var widthSet; //控制样式 +var widthSetTousse;//控制样式 +var addExtractClick;//抽检器械后面添加按钮的显示与隐藏 +var addTousseClick;//器械包条码后面添加按钮的显示与隐藏 +var positionlabelWFlag = false; //控制样式 +function cancelQualityMonitoring() { + closeQMWindow(); +} + +function closeQMWindow(){ + if(recycleQM == true){ + // 回收页面进来 + closeQMLayer(); + }else{ + qualityMonitoringWin.close(); + } +} + +function triggerItemAction(valueTriggerItemIds,action){ + if(valueTriggerItemIds != null && valueTriggerItemIds != ""){ + var itemIdArray = valueTriggerItemIds.split(","); + if(itemIdArray.length > 0){ + for(var n = 0 ; n < itemIdArray.length ; n++){ + var triggerItemId = itemIdArray[n]; + if(triggerItemId != null && triggerItemId != ""){ + if("show" == action){ + Ext.getCmp("hideElement" + triggerItemId).show(); + }else{ + var xtype = Ext.getCmp("hideElement" + triggerItemId).getXType(); + if(xtype == 'fieldset'){ + var length = Ext.getCmp("hideElement" + triggerItemId).items.each(function(fsItem){ + var itemType = fsItem.getXType(); + if(itemType == "panel"){ + fsItem.items.each(function(item,index,length){ + item.setValue(false); + }); + }else if(itemType == "hidden"){ + fsItem.setValue(""); + } + }); + }else if(xtype == 'panel'){ + var panel = Ext.getCmp("hideElement" + triggerItemId); + panel.items.each(function(item,index,length){ + item.setValue(""); + }); + } + Ext.getCmp("hideElement" + triggerItemId).hide(); + } + } + } + } + } +} + +/** + * 创建监测项的表单元素. + * @param type 表单元素的类型 + * @param id 监测项元素id + * @param name 监测项元素名称 + * @param allowBlank 是否允许为空 + * @param options 单选或者多选的配置项 + * @param value 默认值 + * @param isTriggerItem 触发项 + * @returns + */ +function createQualityMonitoringItemElement(type,id,name,allowBlank,options,value,isTriggerItem){ + var hideElement = false; + if('是' == isTriggerItem && (value == null || value == "")){ + hideElement = true; + } + 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%' + }] + }; + }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%' + }] + }; + + }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, + anchor : '95%' + }] + }; + }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, + readOnly : true, + editable : false, + allowBlank : allowBlank, + anchor : '95%' + }] + }; + }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%' + }] + }; + }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, + readOnly : true, + editable : false, + allowBlank : allowBlank, + anchor : '95%' + }] + }; + }else if(type == '单选'){ + var optionsArrays = new Array(); + if(options != ""){ + var optionsJson = JSON.parse(options); + var hideTriggerItemIdsValue = ""; + 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){ + 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, + listWidth: 400, + store : new Ext.data.SimpleStore({ + fields : [ 'value', 'valueTriggerItemIds'], + data : optionsArrays + }), + forceSelection : true, + value : value, + mode : 'local', + triggerAction : 'all', + anchor : '100%', + listeners:{ + select : function(combo, record, index) { + var valueTriggerItemIds = record.get("valueTriggerItemIds"); + var oldTriggerItemIds = Ext.getCmp("triggerItemIds" + id).getValue(); + triggerItemAction(oldTriggerItemIds,"hide"); + triggerItemAction(valueTriggerItemIds,"show"); + Ext.getCmp("triggerItemIds" + id).setValue(valueTriggerItemIds); + } + } + }] + }; + }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 + }); + if(options != ""){ + var optionsJson = JSON.parse(options); + for(var j = 0 ; j < optionsJson.length ; j++){ + var checked = false; + 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){ + var elementId = thiz.getName().substring(1); + var elementObj = Ext.getCmp(elementId); + if(elementObj != undefined && elementObj != null){ + var oldElementValue = elementObj.getValue(); + var checkedValue = JSON.parse(thiz.getRawValue()); + if(checked){ + if(oldElementValue.indexOf(thiz.getRawValue()) == -1){ + oldElementValue += ","; + oldElementValue += thiz.getRawValue() + elementObj.setValue(oldElementValue); + } + if(checkedValue != null){ + var valueTriggerItemIds = checkedValue.valueTriggerItemIds; + triggerItemAction(valueTriggerItemIds,"show"); + } + }else{ + var newValue = oldElementValue.replace("," + thiz.getRawValue(),''); + elementObj.setValue(newValue); + + if(checkedValue != null){ + var valueTriggerItemIds = checkedValue.valueTriggerItemIds; + triggerItemAction(valueTriggerItemIds,"hide"); + } + } + } + } + } + }] + }); + } + } + return { + columnWidth : 1, + xtype : "fieldset", + title: name, + allowBlank: allowBlank, + id:'hideElement'+id, + layout : 'column', + hidden:hideElement, + autoHeight : true, + items : optionsArray + }; + } +} +/** * 返回炉次显示框 - */ -function createQualityMonitoringElementSterName(value){ - return { - columnWidth : .5, - layout : 'form', - labelWidth : 90, - items : [{ - xtype : 'textfield', - fieldLabel : '炉次', - maxLength : '30', - id : 'configItemOptionSterName', - name : 'configItemOptionSterName', - allowBlank : true, - readOnly : true, - value : value, - anchor : '95%' - }] - }; -} -/** - * 返回炉号显示框 - * @param value - * @returns - */ -function createQualityMonitoringElementSterFre(value){ - return { - columnWidth : .5, - layout : 'form', - labelWidth : 90, - items : [{ - xtype : 'textfield', - fieldLabel : '炉号', - maxLength : '30', - id : 'configItemOptionSterFre', - name : 'configItemOptionSterFre', - allowBlank : true, - readOnly: true, - value : value, - anchor : '95%' - }] - }; -} + * 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, + readOnly : true, + value : value, + anchor : '95%' + }] + }; +} +/** + * 返回炉号显示框 + * @param value + * @returns + */ +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, + readOnly: true, + value : value, + anchor : '95%' + }] + }; +} + +/** + * 获取所有选择重新装配的器械包条码(用逗号分隔). + * @returns {String} + */ +function getScanRepacingTiBarcodes(){ + tiBarcodes = ""; + var tousseName = Ext.getCmp('tousseName').getRawValue(); + var isRepacking = Ext.getCmp('isRepacking').getValue(); + if(tousseName != null && tousseName != "" && isRepacking == "是"){ + var barcode = Ext.getCmp('barcode').getValue(); + tiBarcodes += barcode ; + } + var addTousseInstanceAmount = tousseItemCount; + for(var i =1; i <= addTousseInstanceAmount; i++){ + var tousseBarcode = Ext.getCmp('tempBarcode'+i+"_"+1).getValue(); + var tousseName = Ext.getCmp('tempBarcode'+i+"_"+3).getValue(); + var tousseAmount = Ext.getCmp('tempBarcode'+i+"_"+6).getValue(); + var tousseRePacking = 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; +} + -/** - * 获取所有选择重新装配的器械包条码(用逗号分隔). - * @returns {String} - */ -function getScanRepacingTiBarcodes(){ - tiBarcodes = ""; - var tousseName = Ext.getCmp('tousseName').getRawValue(); - var isRepacking = Ext.getCmp('isRepacking').getValue(); - if(tousseName != null && tousseName != "" && isRepacking == "是"){ - var barcode = Ext.getCmp('barcode').getValue(); - tiBarcodes += barcode ; - } - var addTousseInstanceAmount = tousseItemCount; - for(var i =1; i <= addTousseInstanceAmount; i++){ - var tousseBarcode = Ext.getCmp('tempBarcode'+i+"_"+1).getValue(); - var tousseName = Ext.getCmp('tempBarcode'+i+"_"+3).getValue(); - var tousseAmount = Ext.getCmp('tempBarcode'+i+"_"+6).getValue(); - var tousseRePacking = 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; -} - -/** - * - * @param materialInfo 材料信息 - * @param saveAndCreate 是否为“保存并新建”操作 - */ -function submitForm2(materialInfo,saveAndCreate){ - //1、启用责任人文本框,如果有灭菌状态 - Ext.getCmp('responsiblePerson').setDisabled(false); - var sterilizationStatus = ''; - if(typeof(sterilizerStatus) != 'undefined' && sterilizerStatus != null && sterilizerStatus != ""){ - sterilizationStatus = sterilizerStatus; - } - - //2、把第一个器械包的信息增加到tousseInstanceInfo的前面 - var tousseName = Ext.getCmp('tousseName').getRawValue(); - if(tousseName != null && tousseName != ""){ - var barcode = Ext.getCmp('barcode').getValue(); - var tousseInstanceId = Ext.getCmp('tousseInstanceId').getValue(); - var amount = Ext.getCmp('tousseAmount').getValue(); - var isRecycle = Ext.getCmp('isRecycle').getValue(); - var isRepacking = Ext.getCmp('isRepacking').getValue(); - var info = barcode + "@" + tousseInstanceId + "@" + tousseName + "@" + amount + "@" + isRecycle+ "@" + isRepacking+ "@" + 1 +";"; - tousseInstanceInfo = info + tousseInstanceInfo; - } - //3、提交 - setQmSubmitResult(0); - Ext.getCmp('addQualityMonitoringForm').form.submit({ - url : WWWROOT + '/disinfectSystem/qualityMonitoringInstanceAction!saveQualityMonitoringInstance.do', +function submitFormNew2(tousseAndMaterialAll,saveAndCreate){ + //1、启用责任人文本框,如果有灭菌状态 + Ext.getCmp('responsiblePerson').setDisabled(false); + var sterilizationStatus = ''; + if(typeof(sterilizerStatus) != 'undefined' && sterilizerStatus != null && sterilizerStatus != ""){ + sterilizationStatus = sterilizerStatus; + } + + //2、提交 + setQmSubmitResult(0); + Ext.getCmp('addQualityMonitoringForm').form.submit({ + url : WWWROOT + '/disinfectSystem/qualityMonitoringInstanceAction!bathSaveQualityMonitoringInstance.do', params : { - tousseInstanceInfo : tousseInstanceInfo, //器械包信息 - materialInfo : materialInfo, //材料信息 - sterilizationStatus:sterilizationStatus, //灭菌状态 - qualityMonitoringSterilizationID : qualityMonitoringSterilizationID, //灭菌记录id - qualityMonitoringWRRecordID : qualityMonitoringWRRecordID //清洗记录id - }, - method : 'POST', - waitMsg : '正在保存数据,请稍候', - waitTitle : '提交表单', - success : function(form, action) { - var result = Ext.decode(action.response.responseText); - showResultQM(result.message); - setQmSubmitResult(1); - if(saveAndCreate){ - tempFormDefintionId = Ext.getCmp("formDefinitionId").getValue(); - tempFormDefinitionName = Ext.getCmp("name").getValue(); - closeQMWindow(); - qualityMonitoringSterilizationID = 0; - qualityMonitoringWRRecordID = 0; - materialCountRecords = null; - materialMsg = null; - if(recycleQM == true){ - addQMAgain(); - }else{ - addQualityMonitoring("",tempFormDefintionId,tempFormDefinitionName);/* */ - if(typeof(grid) != 'undefined' && grid != null){ - grid.getStore().reload(); - } - } - }else{ - closeQMWindow(); - if(recycleQM == false){ - if(typeof(grid) != 'undefined' && grid != null){ - grid.getStore().reload(); - } - } - } - }, - failure : function(form, action) { - if(action.response != null && action.response.responseText != null){ - var result = Ext.decode(action.response.responseText); - showResultQM(result.message); - }else{ - alert('failure = ' + action.failureType); - } - setQmSubmitResult(-1); - closeQMWindow(); - } - }); + tousseMaterialInstanceInfo:tousseAndMaterialAll,//器械包和材料信息 + sterilizationStatus:sterilizationStatus, //灭菌状态 + qualityMonitoringSterilizationID : qualityMonitoringSterilizationID, //灭菌记录id + qualityMonitoringWRRecordID : qualityMonitoringWRRecordID //清洗记录id + }, + method : 'POST', + waitMsg : '正在保存数据,请稍候', + waitTitle : '提交表单', + success : function(form, action) { + var result = Ext.decode(action.response.responseText); + showResultQM(result.message); + setQmSubmitResult(1); + if(saveAndCreate){ + tempFormDefintionId = Ext.getCmp("formDefinitionId").getValue(); + tempFormDefinitionName = Ext.getCmp("name").getValue(); + closeQMWindow(); + qualityMonitoringSterilizationID = 0; + qualityMonitoringWRRecordID = 0; + materialCountRecords = null; + materialMsg = null; + if(recycleQM == true){ + addQMAgain(); + }else{ + addQualityMonitoring("",tempFormDefintionId,tempFormDefinitionName);/* */ + if(typeof(grid) != 'undefined' && grid != null){ + grid.getStore().reload(); + } + } + }else{ + closeQMWindow(); + if(recycleQM == false){ + if(typeof(grid) != 'undefined' && grid != null){ + grid.getStore().reload(); + } + } + } + }, + failure : function(form, action) { + if(action.response != null && action.response.responseText != null){ + var result = Ext.decode(action.response.responseText); + showResultQM(result.message); + }else{ + alert('failure = ' + action.failureType); + } + setQmSubmitResult(-1); + closeQMWindow(); + } + }); } - -/** - * 设置“qmSubmitResult”的值(1、0或者空=提交前 2、1=提交成功 3、-1=提交失败). - * @param value - */ -function setQmSubmitResult(value){ - if(!isUndefinedOrNullOrEmpty(Ext.getCmp('qmSubmitResult'))){ - Ext.getCmp('qmSubmitResult').setValue(value); - } -} -function showAllTousseOfSterileCheckBox(show){ - if(!isUndefinedOrNullOrEmpty(qualityMonitoringSterilizationID) && show){ - Ext.getCmp('allTousseOfSterile').setVisible(true); - Ext.getCmp('allTousseOfSterile').getEl().up('.x-form-item').setDisplayed(true); - }else{ - Ext.getCmp('allTousseOfSterile').setVisible(false); - Ext.getCmp('allTousseOfSterile').getEl().up('.x-form-item').setDisplayed(false); - } -} - -function selectEmptyDo(){ - Ext.getCmp('scope').setValue("无"); - Ext.getCmp('optionAmount').setValue(''); - Ext.getCmp('sterilizationRecordInfo').setVisible(false); - Ext.getCmp('tousseInfoFieldSet').setVisible(true); - hideFirstTousse(); - showFirstMaterial(); - Ext.getCmp('recycleC').setVisible(false); - Ext.getCmp('repackingC').setVisible(false); + +/** + * 设置“qmSubmitResult”的值(1、0或者空=提交前 2、1=提交成功 3、-1=提交失败). + * @param value + */ +function setQmSubmitResult(value){ + if(!isUndefinedOrNullOrEmpty(Ext.getCmp('qmSubmitResult'))){ + Ext.getCmp('qmSubmitResult').setValue(value); + } +} +function showAllTousseOfSterileCheckBox(show){ + if(!isUndefinedOrNullOrEmpty(qualityMonitoringSterilizationID) && show){ + Ext.getCmp('allTousseOfSterile').setVisible(true); + Ext.getCmp('allTousseOfSterile').getEl().up('.x-form-item').setDisplayed(true); + }else{ + Ext.getCmp('allTousseOfSterile').setVisible(false); + Ext.getCmp('allTousseOfSterile').getEl().up('.x-form-item').setDisplayed(false); + } +} + +function selectEmptyDo(){ + Ext.getCmp('scope').setValue("无"); + Ext.getCmp('optionAmount').setValue(''); + Ext.getCmp('sterilizationRecordInfo').setVisible(false); + Ext.getCmp('tousseInfoFieldSet').setVisible(true); + hideFirstTousse(); + showFirstMaterial(); + Ext.getCmp('recycleC').setVisible(false); + Ext.getCmp('repackingC').setVisible(false); showAllTousseOfSterileCheckBox(true); - Ext.getCmp('addExtractCheckTousse').setVisible(false); - Ext.getCmp('addExtractCheckMaterial').setVisible(true); - Ext.getCmp('sterilizationRecordInfo').setVisible(false); - if(sstsConfig.hasOwnProperty('isInspectScopeHideTousseMsg') && sstsConfig.isInspectScopeHideTousseMsg){ - // 隐藏器械包信息 - Ext.getCmp('tousseInfoFieldSet').setVisible(false); - } - Ext.getCmp("insertBasket").hide(); - Ext.getCmp("containerNameItem").hide(); - Ext.getCmp('containerName').setVisible(false); - Ext.getCmp('containerName').getEl().up('.x-form-item').setDisplayed(false); - Ext.getCmp('addQualityMonitoringForm').remove('itemsFieldSet'); - hideExtractCheckMaterial(); - Ext.getCmp('addQualityMonitoringForm').doLayout(); -} - -/** - * 构建监测细则的fieldset. - * @param formId 监测项id - * @param configName 监测项名称 - */ -function addQualityMonitoringItem(formId,configName){ - // 质量监测添加‘无’这个项. - if(configName == '无'){ - selectEmptyDo(); - return; - } - Ext.Ajax.request({ - url : WWWROOT + '/disinfectSystem/formDefinitionAction!loadFormDefinition.do', - params : {id : formId}, - success : function(response,options){ - var result = Ext.decode(response.responseText); - if(result.success){ - Ext.getCmp('scope').setValue(result.data.scope); - if(sstsConfig.hasOwnProperty('isInspectScopeHideTousseMsg') && sstsConfig.isInspectScopeHideTousseMsg){ - if("无" == result.data.scope){ - // 如果监测范围为无,隐藏器械包信息 - Ext.getCmp('tousseInfoFieldSet').setVisible(false); - } - } - Ext.getCmp('optionAmount').setValue(''); - var baseInfoPanel = Ext.getCmp('baseInfoPanel'); - if("是" == result.data.isInsertBasket){ - Ext.getCmp("insertBasket").show(); - Ext.getCmp("containerNameItem").show(); - - Ext.getCmp('containerName').setVisible(true); - Ext.getCmp('containerName').getEl().up('.x-form-item').setDisplayed(true); + Ext.getCmp('addBtnAll').setVisible(true); + //Ext.getCmp('addExtractCheckTousse').setVisible(false); + //Ext.getCmp('addExtractCheckMaterial').setVisible(true); + Ext.getCmp('addExtractCheckMaterialBtnC').setVisible(true); + Ext.getCmp('addExtractCheckTousseBtnC').setVisible(false); + Ext.getCmp('sterilizationRecordInfo').setVisible(false); + if(sstsConfig.hasOwnProperty('isInspectScopeHideTousseMsg') && sstsConfig.isInspectScopeHideTousseMsg){ + // 隐藏器械包信息 + Ext.getCmp('tousseInfoFieldSet').setVisible(false); + } + Ext.getCmp("insertBasket").hide(); + Ext.getCmp("containerNameItem").hide(); + Ext.getCmp('containerName').setVisible(false); + Ext.getCmp('containerName').getEl().up('.x-form-item').setDisplayed(false); + Ext.getCmp('addQualityMonitoringForm').remove('itemsFieldSet'); + hideExtractCheckMaterial(); + Ext.getCmp('addQualityMonitoringForm').doLayout(); +} + +/** + * 构建监测细则的fieldset. + * @param formId 监测项id + * @param configName 监测项名称 + */ +function addQualityMonitoringItem(formId,configName){ + // 质量监测添加‘无’这个项. + if(configName == '无'){ + selectEmptyDo(); + return; + } + Ext.Ajax.request({ + url : WWWROOT + '/disinfectSystem/formDefinitionAction!loadFormDefinition.do', + params : {id : formId}, + success : function(response,options){ + var result = Ext.decode(response.responseText); + if(result.success){ + Ext.getCmp('scope').setValue(result.data.scope); + if(sstsConfig.hasOwnProperty('isInspectScopeHideTousseMsg') && sstsConfig.isInspectScopeHideTousseMsg){ + if("无" == result.data.scope){ + // 如果监测范围为无,隐藏器械包信息 + Ext.getCmp('tousseInfoFieldSet').setVisible(false); + } + } + Ext.getCmp('optionAmount').setValue(''); + var baseInfoPanel = Ext.getCmp('baseInfoPanel'); + if("是" == result.data.isInsertBasket){ + Ext.getCmp("insertBasket").show(); + Ext.getCmp("containerNameItem").show(); + + Ext.getCmp('containerName').setVisible(true); + Ext.getCmp('containerName').getEl().up('.x-form-item').setDisplayed(true); + }else{ + Ext.getCmp("insertBasket").hide(); + Ext.getCmp("containerNameItem").hide(); + + Ext.getCmp('containerName').setVisible(false); + Ext.getCmp('containerName').getEl().up('.x-form-item').setDisplayed(false); + } + Ext.getCmp('responsibilityPart').setValue(result.data.responsibilityPart); + //东莞中医院DGZYY-161 + if(result.data.responsibilityPart == "回收清点" && result.data.recordRecycleInformation == "是"){//责任环节选择的为回收清点,并且录入回收信为是 + showRecyclingInventoryItem();//显示回收清点对应的 + hideCleanAndDisinfectionItem();//隐藏清洗消毒点对应的 + hideSterilizationItem();//隐藏灭菌管理对应的 + }else if(result.data.responsibilityPart == "清洗消毒" && result.data.recordRinseInformation == "是"){//责任环节选择的为清洗消毒,监测项的录入清洗信息为是 + showCleanAndDisinfectionItem();//显示清洗消毒对应的 + hideRecyclingInventoryItem();//隐藏回收清点对应的 + hideSterilizationItem();//隐藏灭菌管理对应的 + }else if(result.data.responsibilityPart == "灭菌管理" && result.data.recordSterilizatioInformation == "是"){//监测项的录入灭菌信息为是,并且责任环节选择的为灭菌管理 + showSterilizationItem(); + hideRecyclingInventoryItem();//隐藏回收清点对应的 + hideCleanAndDisinfectionItem();//隐藏清洗消毒点对应的 }else{ - Ext.getCmp("insertBasket").hide(); - Ext.getCmp("containerNameItem").hide(); - - Ext.getCmp('containerName').setVisible(false); - Ext.getCmp('containerName').getEl().up('.x-form-item').setDisplayed(false); + hideRecyclingInventoryItem();//隐藏回收清点对应的 + hideCleanAndDisinfectionItem();//隐藏清洗消毒点对应的 + hideSterilizationItem();//隐藏灭菌管理对应的 } - Ext.getCmp('responsibilityPart').setValue(result.data.responsibilityPart); - var items = new Array(); - // 如果显示炉次炉号,添加表单 - if(result.data.showSterilizerNumFrequency == '是'){ - items.push(createQualityMonitoringElementSterName('')); - items.push(createQualityMonitoringElementSterFre('')); - } - for(var i = 0 ; i< result.data.items.length ; i++){ - var item = result.data.items[i]; - if(Ext.getCmp('optionAmount').getValue() == null || Ext.getCmp('optionAmount').getValue() == ''){ - Ext.getCmp('optionAmount').setValue(item.id); - }else{ - Ext.getCmp('optionAmount').setValue(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 == '多选'){ - items.push({ - columnWidth : 1, - xtype : "label", - html : ' ', - anchor : '95%' - }); - } - } - - Ext.getCmp('addQualityMonitoringForm').remove('itemsFieldSet'); - if(items.length > 0){ - Ext.getCmp('addQualityMonitoringForm').add({ - id : 'itemsFieldSet', - xtype:"fieldset", - labelAlign :'left', - title:"监测项", - layout:'column', - autoHeight:true, - items:items - }); - } - Ext.getCmp('addQualityMonitoringForm').doLayout(); - if(Ext.getCmp('itemsFieldSet')){ - Ext.getCmp('itemsFieldSet').doLayout(); - } -// cccbbb - if(result.data.scope == "器械包"){ - Ext.getCmp('sterilizationRecordInfo').setVisible(false); - Ext.getCmp('tousseInfoFieldSet').setVisible(true); - // 隐藏第一个材料和添加的材料信息 - hideFirstMaterial(); - hideExtractCheckMaterial(); - // 显示器械包输入框 - showFirstTousse(); - - Ext.getCmp('recycleC').setVisible(true); - Ext.getCmp('repackingC').setVisible(true); + + var items = new Array(); + // 如果显示炉次炉号,添加表单 + if(result.data.showSterilizerNumFrequency == '是'){ + items.push(createQualityMonitoringElementSterName('',false,"")); + items.push(createQualityMonitoringElementSterFre('',false,"")); + } + for(var i = 0 ; i< result.data.items.length ; i++){ + var item = result.data.items[i]; + if(Ext.getCmp('optionAmount').getValue() == null || Ext.getCmp('optionAmount').getValue() == ''){ + Ext.getCmp('optionAmount').setValue(item.id); + }else{ + Ext.getCmp('optionAmount').setValue(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 == '多选'){ + items.push({ + columnWidth : 1, + xtype : "label", + html : ' ', + anchor : '95%' + }); + } + } + + Ext.getCmp('addQualityMonitoringForm').remove('itemsFieldSet'); + if(items.length > 0){ + Ext.getCmp('addQualityMonitoringForm').add({ + id : 'itemsFieldSet', + xtype:"fieldset", + labelAlign :'left', + title:"监测项", + layout:'column', + autoHeight:true, + items:items + }); + } + Ext.getCmp('addQualityMonitoringForm').doLayout(); + if(Ext.getCmp('itemsFieldSet')){ + Ext.getCmp('itemsFieldSet').doLayout(); + } + + //Ext.getCmp('inspectType').setValue(result.data.scope); + + if(result.data.scope == "器械包"){ + Ext.getCmp('sterilizationRecordInfo').setVisible(false); + Ext.getCmp('tousseInfoFieldSet').setVisible(true); + // 隐藏第一个材料和添加的材料信息 + hideFirstMaterial(); + hideExtractCheckMaterial();//要 隐藏的添加的 + //隐藏器械包信息块材料 + hideExtractCheckMaterialWrapper(); + hideMaterialOrTousseOrTousseMaterial(); + // 显示器械包输入框 + showFirstTousse(); + if((qualityMonitoringWRRecordID > 0 && (sstsConfig.hasOwnProperty('haveRinserPosition')) && sstsConfig.haveRinserPosition)){ + hideBasketBarcodeAndPosition(); + } + Ext.getCmp('recycleC').setVisible(true); + Ext.getCmp('repackingC').setVisible(true); showAllTousseOfSterileCheckBox(true); - Ext.getCmp('addExtractCheckTousse').setVisible(true); - Ext.getCmp('addExtractCheckMaterial').setVisible(false); - // 清除材料数据 - Ext.getCmp('material').setValue(""); - Ext.getCmp('materialAmount').setValue(""); - }else if(result.data.scope == "材料"){ - Ext.getCmp('sterilizationRecordInfo').setVisible(false); - Ext.getCmp('tousseInfoFieldSet').setVisible(true); - hideFirstTousse(); + Ext.getCmp('addBtnAll').setVisible(true); + //Ext.getCmp('addExtractCheckTousse').setVisible(true); + //Ext.getCmp('addExtractCheckMaterial').setVisible(false); + // 清除材料数据 + Ext.getCmp('material').setValue(""); + Ext.getCmp('materialAmount').setValue(""); + //隐藏监测项 + hideInspectItem(); + }else if(result.data.scope == "材料"){ + Ext.getCmp('sterilizationRecordInfo').setVisible(false); + Ext.getCmp('tousseInfoFieldSet').setVisible(true); + hideFirstTousse(); + //hideMaterialOrTousseOrTousseMaterial(); + hideExtractCheckTousse();//要 showFirstMaterial(); - Ext.getCmp('recycleC').setVisible(false); - Ext.getCmp('repackingC').setVisible(false); - showAllTousseOfSterileCheckBox(false); -// Ext.getCmp('material').getEl().up('.x-form-item').setDisplayed(true); + hideMaterialOrTousseOrTousseMaterial(); + Ext.getCmp('recycleC').setVisible(false); + Ext.getCmp('repackingC').setVisible(false); + showAllTousseOfSterileCheckBox(false); + +// Ext.getCmp('material').getEl().up('.x-form-item').setDisplayed(true); //showExtractCheckMaterial(); - Ext.getCmp('addExtractCheckTousse').setVisible(false); - Ext.getCmp('addExtractCheckMaterial').setVisible(true); - addMaterialAndAmount(); - addMaterialMsg(); - }else if(result.data.scope == "灭菌炉记录"){ - Ext.getCmp('sterilizationRecordInfo').setVisible(true); - // 如果监测范围为灭菌炉记录,隐藏器械包信息 + Ext.getCmp('addBtnAll').setVisible(true); + //Ext.getCmp('addExtractCheckTousse').setVisible(false); + //Ext.getCmp('addExtractCheckMaterial').setVisible(true); + addMaterialAndAmount(); + addMaterialMsg(); + //隐藏监测项 + hideInspectItem(); + //当前选择的监测项的监测范围是“器械包”,如果重新选择的监测项的监测范围是“材料”,之前已输入的抽检器械包名称不用显示; + /* if(inspectType == "器械包"){ + //隐藏器械包信息块包 + hideExtractCheckTousseWrapper(); + hideMaterialOrTousseOrTousseMaterial(); + } */ + }else if(result.data.scope == "灭菌炉记录"){ + Ext.getCmp('sterilizationRecordInfo').setVisible(true); + // 如果监测范围为灭菌炉记录,隐藏器械包信息 Ext.getCmp('tousseInfoFieldSet').setVisible(false); - Ext.getCmp('addExtractCheckTousse').setVisible(false); - Ext.getCmp('addExtractCheckMaterial').setVisible(false); - hideExtractCheckMaterial(); - }else if(result.data.scope == "材料和器械包"){ - Ext.getCmp('sterilizationRecordInfo').setVisible(false); - Ext.getCmp('tousseInfoFieldSet').setVisible(true); - showFirstTousse(); + Ext.getCmp('addBtnAll').setVisible(false); + //Ext.getCmp('addExtractCheckTousse').setVisible(false); + //Ext.getCmp('addExtractCheckMaterial').setVisible(false); + hideExtractCheckMaterial(); + //隐藏器械包信息块材料 + hideExtractCheckMaterialWrapper(); + //隐藏器械包信息块包 + hideExtractCheckTousseWrapper(); + //隐藏器械包信息块材料和包 + hideExtractCheckTousseAndMaterialWrapper(); + hideMaterialOrTousseOrTousseMaterial(); + //隐藏监测项 + hideInspectItem(); + }else if(result.data.scope == "材料和器械包"){ + Ext.getCmp('sterilizationRecordInfo').setVisible(false); + Ext.getCmp('tousseInfoFieldSet').setVisible(true); + //showExtractCheckTousseAndMaterialWrapper(); + showFirstTousse(); showFirstMaterial(); -// Ext.getCmp('material').getEl().up('.x-form-item').setDisplayed(true); - Ext.getCmp('recycleC').setVisible(true); - Ext.getCmp('repackingC').setVisible(true); + hideExtractCheckMaterial();//要 + //隐藏器械包信息块材料 + hideExtractCheckMaterialWrapper(); + hideExtractCheckTousse();//要 + hideExtractCheckTousseWrapper(); + if((qualityMonitoringWRRecordID > 0 && (sstsConfig.hasOwnProperty('haveRinserPosition')) && sstsConfig.haveRinserPosition)){ + showBasketBarcodeAndPosition(); + } +// Ext.getCmp('material').getEl().up('.x-form-item').setDisplayed(true); + Ext.getCmp('recycleC').setVisible(true); + Ext.getCmp('repackingC').setVisible(true); showAllTousseOfSterileCheckBox(true); - Ext.getCmp('addExtractCheckTousse').setVisible(true); - Ext.getCmp('addExtractCheckMaterial').setVisible(true); - // 添加抽检器械和数量 - addMaterialAndAmount(); - addMaterialMsg(); - }else if(result.data.scope == "无"){ - Ext.getCmp('sterilizationRecordInfo').setVisible(false); - Ext.getCmp('tousseInfoFieldSet').setVisible(true); - hideFirstTousse(); - showFirstMaterial(); -// Ext.getCmp('material').getEl().up('.x-form-item').setDisplayed(true); - Ext.getCmp('recycleC').setVisible(true); - Ext.getCmp('repackingC').setVisible(true); + Ext.getCmp('addBtnAll').setVisible(true); + //Ext.getCmp('addExtractCheckTousse').setVisible(true); + //Ext.getCmp('addExtractCheckMaterial').setVisible(true); + // 添加抽检器械和数量 + addMaterialAndAmount(); + addMaterialMsg(); + //隐藏监测项 + hideInspectItem(); + }else if(result.data.scope == "无"){ + Ext.getCmp('sterilizationRecordInfo').setVisible(false); + Ext.getCmp('tousseInfoFieldSet').setVisible(true); + hideFirstTousse(); + showFirstMaterial(); +// Ext.getCmp('material').getEl().up('.x-form-item').setDisplayed(true); + Ext.getCmp('recycleC').setVisible(true); + Ext.getCmp('repackingC').setVisible(true); showAllTousseOfSterileCheckBox(true); - Ext.getCmp('addExtractCheckTousse').setVisible(false); - Ext.getCmp('addExtractCheckMaterial').setVisible(true); - Ext.getCmp('sterilizationRecordInfo').setVisible(false); - if(sstsConfig.hasOwnProperty('isInspectScopeHideTousseMsg') && sstsConfig.isInspectScopeHideTousseMsg){ - // 隐藏器械包信息 - Ext.getCmp('tousseInfoFieldSet').setVisible(false); - } - hideExtractCheckMaterial(); - } - // 新建质量监测单,数量默认为1 - var tAmount = Ext.getCmp('tousseAmount').getValue(); - var mAmount = Ext.getCmp('materialAmount').getValue(); - if(isUndefinedOrNullOrEmpty(tAmount) || tAmount <= 0){ - // 没有值,设置默认值为1 - Ext.getCmp('tousseAmount').setValue(1); - } - if(isUndefinedOrNullOrEmpty(mAmount) || mAmount <= 0){ - // 没有值,设置默认值为1 - Ext.getCmp('materialAmount').setValue(1); - } - resetRecycleAndRepackingValue(); - } - }, - failure : function(response, options) { - showResultQM('系统加载出错,请稍候再试'); - } - }); + Ext.getCmp('addBtnAll').setVisible(true); + //Ext.getCmp('addExtractCheckTousse').setVisible(false); + //Ext.getCmp('addExtractCheckMaterial').setVisible(true); + Ext.getCmp('sterilizationRecordInfo').setVisible(false); + if(sstsConfig.hasOwnProperty('isInspectScopeHideTousseMsg') && sstsConfig.isInspectScopeHideTousseMsg){ + // 隐藏器械包信息 + Ext.getCmp('tousseInfoFieldSet').setVisible(false); + } + hideExtractCheckMaterial(); + } + // 新建质量监测单,数量默认为1 + var tAmount = Ext.getCmp('tousseAmount').getValue(); + var mAmount = Ext.getCmp('materialAmount').getValue(); + if(isUndefinedOrNullOrEmpty(tAmount) || tAmount <= 0){ + // 没有值,设置默认值为1 + Ext.getCmp('tousseAmount').setValue(1); + } + if(isUndefinedOrNullOrEmpty(mAmount) || mAmount <= 0){ + // 没有值,设置默认值为1 + Ext.getCmp('materialAmount').setValue(1); + } + resetRecycleAndRepackingValue(); + } + }, + failure : function(response, options) { + showResultQM('系统加载出错,请稍候再试'); + } + }); +} +// 装配页面进来,添加材料和数量 +function addMaterialAndAmount(){ + if(materialCountRecords != null && materialCountRecords != 'undefined' && materialCountRecords.length > 0){ + var maerialName = Ext.getCmp('material').getValue(); + if( !isUndefinedOrNullOrEmpty(maerialName) ){ + // 如果已经打开了,再选择其他的监测项,不再添加材料数据 + return ; + } + + for(var i = 0 ; i < materialCountRecords.length ; i++){ + var materialName = materialCountRecords[i].data["name"]; + var count = materialCountRecords[i].data['count']; + if( i == 0 ){ + // 第一条记录 + Ext.getCmp('material').setValue(materialName); + Ext.getCmp('materialAmount').setValue(count); + }else{ + addExtractCheckMaterial(false,materialName,count,"","","","","","","","",""); + } + } + } +} + +//回收页面进来,添加材料和数量 +function addMaterialMsg(){ + if(materialMsg != null && materialMsg != 'undefined' && materialMsg.length > 0){ + var maerialName = Ext.getCmp('material').getValue(); + if( !isUndefinedOrNullOrEmpty(maerialName) ){ + // 如果已经打开了,再选择其他的监测项,不再添加材料数据 + return ; + } + for(var i = 0 ; i < materialMsg.length ; i++){ + var materialName = materialMsg[i].materialName; + var count = materialMsg[i].amount; + if( i == 0 ){ + // 第一条记录 + Ext.getCmp('material').setValue(materialName); + Ext.getCmp('materialAmount').setValue(count); + }else{ + addExtractCheckMaterial(false,materialName,count,"","","","","","","","",""); + } + } + } +} + +/** + * 判断是否整炉. + * @returns {Boolean} + */ +function allTousseOfSterileChecked(){ + var isAll = Ext.getCmp('isAllTousseOfSterile').getValue(); //是否整炉 + if(isAll == '是'){ + return true; + } + return false; +} + +/** + * 控制“重新回收”和“重新装配”的复选框的是否可用. + */ +function updateControlStatus(){ + if(allTousseOfSterileChecked()){ + enableRecycleAndRepacking(); + }else{ + var tousseType = Ext.getCmp('tousseType').getValue(); + var tousseInstanceId = Ext.getCmp('tousseInstanceId').getValue(); + var toussedefRecycling = Ext.getCmp('tousseDefRecycling').getValue(); + + if (isUndefinedOrNullOrEmpty(tousseInstanceId)) { + disableRecycleAndRepacking(); + } else if (tousseType==PACKAGE_TYPE_FOREIGN + || tousseType==PACKAGE_TYPE_SPLIT + || tousseType == '敷料包' || toussedefRecycling == '否') { + disableRecycleCanRepacking(); + } else { + enableRecycleAndRepacking(); + } + } +} + +/** + * 将“重新回收”和“重新装配”及“是否整炉”设置为未选中状态. + */ +function resetRecycleAndRepackingValue(){ + Ext.getCmp('isRecycle').setValue(''); + Ext.getCmp('isRepacking').setValue(''); + Ext.getCmp('isAllTousseOfSterile').setValue(''); + Ext.getCmp('recycle').setValue(false); + Ext.getCmp('repacking').setValue(false); + Ext.getCmp('allTousseOfSterile').setValue(false); +} + +/** + * 禁用“重新回收”和“重新装配”的复选框. + */ +function disableRecycleAndRepacking(){ + Ext.getCmp('isRecycle').setValue(''); + Ext.getCmp('isRepacking').setValue(''); + Ext.getCmp('recycle').disable(); + Ext.getCmp('repacking').disable(); + Ext.getCmp('recycle').setValue(false); + Ext.getCmp('repacking').setValue(false); +} + +/** + * 不能重新回收,可以重新装配. + */ +function disableRecycleCanRepacking(){ + Ext.getCmp('isRecycle').setValue(''); + Ext.getCmp('isRepacking').setValue(''); + Ext.getCmp('recycle').disable(); + Ext.getCmp('repacking').enable(); + Ext.getCmp('recycle').setValue(false); + Ext.getCmp('repacking').setValue(false); +} + +/** + * 启用“重新回收”和“重新装配”的复选框. + */ +function enableRecycleAndRepacking(){ + Ext.getCmp('recycle').enable(); + Ext.getCmp('repacking').enable(); +} + +/** + * 根据“器械包条码”以及“监测项定义id”,获取器械包名字以及监测环节的责任人. + * @param tempBarcode 器械包条码 + * @param qmDefinitionId 监测项定义id + * @param materialDefinitionStore 抽检器械的store + */ +function getTousseInstanceNameAndResponsiblePerson(tempBarcode, qmDefinitionId, materialDefinitionStore){ + if(tempBarcode){ + Ext.Ajax.request({ + url : WWWROOT + '/disinfectSystem/qualityMonitoringDefinitionAction!getTousseInstanceNameAndResponsiblePerson.do', + params : {barcode : tempBarcode,qmDefinitionId : qmDefinitionId}, + success : function(response,options){ + var result = Ext.decode(response.responseText); + if(result.success){ + //1、设置“器械包名称”、“器械包实例条码”、“器械包实例id”、“器械包类型”、“是否需要回收”、“责任人” + if(tempBarcode != null && tempBarcode != ''){ + Ext.getCmp('tousseName').setValue(result.tousseName + "(" + tempBarcode + ")"); + }else{ + Ext.getCmp('tousseName').setValue(result.tousseName); + } + Ext.getCmp('barcode').setValue(tempBarcode); + Ext.getCmp('tousseInstanceId').setValue(result.tousseInstanceId); + Ext.getCmp('tousseType').setValue(result.tousseType); + Ext.getCmp('tousseDefRecycling').setValue(result.isRecycle); + Ext.getCmp('responsiblePerson').setValue(result.responsiblePerson); + + //2、如果有炉号炉次,则需要设值 + if(!isUndefinedOrNullOrEmpty(Ext.getCmp('configItemOptionSterName'))){ + Ext.getCmp('configItemOptionSterName').setValue(result.sterileFrequency); + Ext.getCmp('configItemOptionSterFre').setValue(result.sterilizerName); + } + + + //3、设值包定义id,并且材料要与此包定义关联 + if(result.tousseDefinitionId){ + Ext.getCmp('tousseDefinitionId').setValue(result.tousseDefinitionId); + if(materialDefinitionStore){ + materialDefinitionStore.reload(); + } + }else if(materialDefinitionStore){ + Ext.getCmp('tousseDefinitionId').setValue(''); + } + + //4、控制“重新回收”和“重新装配”的复选框的是否可用. + updateControlStatus(); + }else{ + if(result.message){ + showResultQM(result.message); + }else{ + showResultQM("找不到该条码所对应的器械包实例"); + } + } + }, + failure : function(response, options) { + var result = Ext.decode(response.responseText); + if(result.message){ + showResultQM(result.message); + }else{ + showResultQM('系统加载出错,请稍候再试'); + } + } + }); + } +} +function getPostionByBasketBarcode(tempBarcode,positionId){ + if(tempBarcode){ + Ext.Ajax.request({ + url : WWWROOT + '/disinfectSystem/qualityMonitoringDefinitionAction!getPostionMsg.do', + params : {barcode : tempBarcode,qualityMonitoringWRRecordID : qualityMonitoringWRRecordID}, + success : function(response,options){ + var result = Ext.decode(response.responseText); + if(result.success){ + if(result.positionMsg){ + Ext.getCmp(positionId).setValue(result.positionMsg); + } + }else{ + if(result.message){ + showResultQM(result.message); + }else{ + showResultQM("找不到该条码所对应的篮筐实例"); + } + } + }, + failure : function(response, options) { + var result = Ext.decode(response.responseText); + if(result == null || result.message == null){ + showResultQM('系统加载出错,请稍候再试'); + }else{ + showResultQM(result.message); + } + } + }); + } +} + +function getShowBtn(addExtractClick,btnShowOrHide){ + if(addExtractClick == true || btnShowOrHide == true){ + return true; + }else{ + return false; + } +} + +function addMaterialItems(id,showBtn,items,items5,items1,items2,items3,items4){ + Ext.getCmp(id).add(items); + if(showBtn){ + Ext.getCmp(id).add(items5); + } + Ext.getCmp(id).add(items1); + Ext.getCmp(id).add(items2); + Ext.getCmp(id).add(items3); + Ext.getCmp(id).add(items4); +} + +/* + 添加抽检器械和数量 + isWrapper 是否是监测项后面的按钮 + isTousseAndMaterial 监测是否是器械包和材料 true是,false不是 + amount 当前点击的是哪一个器械包信息块的编号 + tosseAndMaterialId 材料和器械包的id + btnShowOrHide 如果监测项是材料和器械包的话要在抽检器械后面显示添加按钮 + amountChild 当前在信息块里面是第几个 + isLoad 是否是加载 + */ +function addExtractCheckMaterial(isOpenRecord,mateialName,count,basketPosition,orderNumber,isWrapper,isTousseAndMaterial,amount,tosseAndMaterialId,btnShowOrHide,amountChild,isLoad){ + materialItemCount++; + var tousseAndMaterial = Ext.getCmp('tosseAndMaterial'); + var mCount = 1; + 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(); + items = { + layout : 'form', + id : 'materialC'+materialItemCount, + columnWidth : .36, + labelWidth : 90, + height:setH, + items : [{ + xtype : 'combo', + id : 'material'+materialItemCount, + name : 'material'+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){ + items5 = { + 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){ + isTousseAndMaterialVal = true; + } + addExtractCheckMaterial("","",1,"","",true,isTousseAndMaterialVal,amountClick,"","",rememberChildCurNum2,""); + widthSet = false; + } + }] + }; + } + + var columnW = 0.32; + var labelW = 91; + var positionlabelW = 116; + if(widthSet == true){ + columnW = 0.36; + labelW = 117; + }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%' + }] + }; + 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(''); + } + } + } + }] + }; + + 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%' + }] + }; + var items4 = new Array(); + items4 = { + xtype : 'hidden', + name : 'materialOrder'+materialItemCount, + id : 'materialOrder'+materialItemCount + }; + + 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 0){ + Ext.getCmp('materialOrder'+materialItemCount).setValue(orderNumber); + } + if(isOpenRecord == true && mateialName != null && mateialName != ''){ + //打开记录,不允许修改 + Ext.getCmp('material'+materialItemCount).disable(); + Ext.getCmp('materialAmount'+materialItemCount).disable(); + Ext.getCmp('basketBarcode'+materialItemCount).disable(); + Ext.getCmp('position'+materialItemCount).disable(); + } +} + +// 隐藏第一个器械包信息,包括器械包条码,数量 +function hideFirstTousse(){ + Ext.getCmp('tousseBarcodeC').setVisible(false); + Ext.getCmp('tousseNameC').setVisible(false); + Ext.getCmp('tousseAmountC').setVisible(false); + Ext.getCmp('addExtractCheckTousseBtnC').setVisible(false); } -// 装配页面进来,添加材料和数量 -function addMaterialAndAmount(){ - if(materialCountRecords != null && materialCountRecords != 'undefined' && materialCountRecords.length > 0){ - var maerialName = Ext.getCmp('material').getValue(); - if( !isUndefinedOrNullOrEmpty(maerialName) ){ - // 如果已经打开了,再选择其他的监测项,不再添加材料数据 - return ; - } + +//显示第一个器械包信息,包括器械包条码,数量 +function showFirstTousse(){ + Ext.getCmp('tousseBarcodeC').setVisible(true); + Ext.getCmp('tousseNameC').setVisible(true); + if(Ext.getCmp('barcode').getValue() != ""){ + Ext.getCmp('barcode').setValue(""); + } - for(var i = 0 ; i < materialCountRecords.length ; i++){ - var materialName = materialCountRecords[i].data["name"]; - var count = materialCountRecords[i].data['count']; - if( i == 0 ){ - // 第一条记录 - Ext.getCmp('material').setValue(materialName); - Ext.getCmp('materialAmount').setValue(count); - }else{ - addExtractCheckMaterial(false,materialName,count); - } - } + if(Ext.getCmp('tousseInstanceId').getValue() != ""){ + Ext.getCmp('tousseInstanceId').setValue(""); } -} - -//回收页面进来,添加材料和数量 -function addMaterialMsg(){ - if(materialMsg != null && materialMsg != 'undefined' && materialMsg.length > 0){ - var maerialName = Ext.getCmp('material').getValue(); - if( !isUndefinedOrNullOrEmpty(maerialName) ){ - // 如果已经打开了,再选择其他的监测项,不再添加材料数据 - return ; - } - for(var i = 0 ; i < materialMsg.length ; i++){ - var materialName = materialMsg[i].materialName; - var count = materialMsg[i].amount; - if( i == 0 ){ - // 第一条记录 - Ext.getCmp('material').setValue(materialName); - Ext.getCmp('materialAmount').setValue(count); - }else{ - addExtractCheckMaterial(false,materialName,count); - } - } + if(Ext.getCmp('tousseType').getValue() != ""){ + Ext.getCmp('tousseType').setValue(""); } -} - -/** - * 判断是否整炉. - * @returns {Boolean} - */ -function allTousseOfSterileChecked(){ - var isAll = Ext.getCmp('isAllTousseOfSterile').getValue(); //是否整炉 - if(isAll == '是'){ - return true; + if(Ext.getCmp('tousseDefRecycling').getValue() != ""){ + Ext.getCmp('tousseDefRecycling').setValue(""); } - return false; -} - -/** - * 控制“重新回收”和“重新装配”的复选框的是否可用. - */ -function updateControlStatus(){ - if(allTousseOfSterileChecked()){ - enableRecycleAndRepacking(); - }else{ - var tousseType = Ext.getCmp('tousseType').getValue(); - var tousseInstanceId = Ext.getCmp('tousseInstanceId').getValue(); - var toussedefRecycling = Ext.getCmp('tousseDefRecycling').getValue(); - - if (isUndefinedOrNullOrEmpty(tousseInstanceId)) { - disableRecycleAndRepacking(); - } else if (tousseType==PACKAGE_TYPE_FOREIGN - || tousseType==PACKAGE_TYPE_SPLIT - || tousseType == '敷料包' || toussedefRecycling == '否') { - disableRecycleCanRepacking(); - } else { - enableRecycleAndRepacking(); - } + if(Ext.getCmp('responsiblePerson').getValue() != ""){ + Ext.getCmp('responsiblePerson').setValue(""); } -} - -/** - * 将“重新回收”和“重新装配”及“是否整炉”设置为未选中状态. - */ -function resetRecycleAndRepackingValue(){ - Ext.getCmp('isRecycle').setValue(''); - Ext.getCmp('isRepacking').setValue(''); - Ext.getCmp('isAllTousseOfSterile').setValue(''); - Ext.getCmp('recycle').setValue(false); - Ext.getCmp('repacking').setValue(false); - Ext.getCmp('allTousseOfSterile').setValue(false); -} - -/** - * 禁用“重新回收”和“重新装配”的复选框. - */ -function disableRecycleAndRepacking(){ - Ext.getCmp('isRecycle').setValue(''); - Ext.getCmp('isRepacking').setValue(''); - Ext.getCmp('recycle').disable(); - Ext.getCmp('repacking').disable(); - - Ext.getCmp('recycle').setValue(false); - Ext.getCmp('repacking').setValue(false); -} - -/** - * 不能重新回收,可以重新装配. - */ -function disableRecycleCanRepacking(){ - Ext.getCmp('isRecycle').setValue(''); - Ext.getCmp('isRepacking').setValue(''); - Ext.getCmp('recycle').disable(); - Ext.getCmp('repacking').enable(); - - Ext.getCmp('recycle').setValue(false); - Ext.getCmp('repacking').setValue(false); -} - -/** - * 启用“重新回收”和“重新装配”的复选框. - */ -function enableRecycleAndRepacking(){ - Ext.getCmp('recycle').enable(); - Ext.getCmp('repacking').enable(); -} - -/** - * 根据“器械包条码”以及“监测项定义id”,获取器械包名字以及监测环节的责任人. - * @param tempBarcode 器械包条码 - * @param qmDefinitionId 监测项定义id - * @param materialDefinitionStore 抽检器械的store - */ -function getTousseInstanceNameAndResponsiblePerson(tempBarcode, qmDefinitionId, materialDefinitionStore){ - if(tempBarcode){ - Ext.Ajax.request({ - url : WWWROOT + '/disinfectSystem/qualityMonitoringDefinitionAction!getTousseInstanceNameAndResponsiblePerson.do', - params : {barcode : tempBarcode,qmDefinitionId : qmDefinitionId}, - success : function(response,options){ - var result = Ext.decode(response.responseText); - if(result.success){ - //1、设置“器械包名称”、“器械包实例条码”、“器械包实例id”、“器械包类型”、“是否需要回收”、“责任人” - if(tempBarcode != null && tempBarcode != ''){ - Ext.getCmp('tousseName').setValue(result.tousseName + "(" + tempBarcode + ")"); - }else{ - Ext.getCmp('tousseName').setValue(result.tousseName); - } - Ext.getCmp('barcode').setValue(tempBarcode); - Ext.getCmp('tousseInstanceId').setValue(result.tousseInstanceId); - Ext.getCmp('tousseType').setValue(result.tousseType); - Ext.getCmp('tousseDefRecycling').setValue(result.isRecycle); - Ext.getCmp('responsiblePerson').setValue(result.responsiblePerson); - - //2、如果有炉号炉次,则需要设值 - if(!isUndefinedOrNullOrEmpty(Ext.getCmp('configItemOptionSterName'))){ - Ext.getCmp('configItemOptionSterName').setValue(result.sterilizerName); - Ext.getCmp('configItemOptionSterFre').setValue(result.sterileFrequency); - } - - //3、设值包定义id,并且材料要与此包定义关联 - if(result.tousseDefinitionId){ - Ext.getCmp('tousseDefinitionId').setValue(result.tousseDefinitionId); - if(materialDefinitionStore){ - materialDefinitionStore.reload(); - } - }else if(materialDefinitionStore){ - Ext.getCmp('tousseDefinitionId').setValue(''); - } - - //4、控制“重新回收”和“重新装配”的复选框的是否可用. - updateControlStatus(); - }else{ - if(result.message){ - showResultQM(result.message); - }else{ - showResultQM("找不到该条码所对应的器械包实例"); - } - } - }, - failure : function(response, options) { - var result = Ext.decode(response.responseText); - if(result.message){ - showResultQM(result.message); - }else{ - showResultQM('系统加载出错,请稍候再试'); - } - } - }); + if(Ext.getCmp('tousseDefinitionId').getValue() != ""){ + Ext.getCmp('tousseDefinitionId').setValue(""); } -} -function getPostionByBasketBarcode(tempBarcode,positionId){ - if(tempBarcode){ - Ext.Ajax.request({ - url : WWWROOT + '/disinfectSystem/qualityMonitoringDefinitionAction!getPostionMsg.do', - params : {barcode : tempBarcode,qualityMonitoringWRRecordID : qualityMonitoringWRRecordID}, - success : function(response,options){ - var result = Ext.decode(response.responseText); - if(result.success){ - if(result.positionMsg){ - Ext.getCmp(positionId).setValue(result.positionMsg); - } - }else{ - if(result.message){ - showResultQM(result.message); - }else{ - showResultQM("找不到该条码所对应的篮筐实例"); - } - } - }, - failure : function(response, options) { - var result = Ext.decode(response.responseText); - if(result == null || result.message == null){ - showResultQM('系统加载出错,请稍候再试'); - }else{ - showResultQM(result.message); - } - } - }); - } -} -// 添加抽检器械和数量 -function addExtractCheckMaterial(isOpenRecord,mateialName,count,basketPosition,orderNumber){ - materialItemCount++; - var tousseAndMaterial = Ext.getCmp('tosseAndMaterial'); - var mCount = 1; - if(count != null && count != 'undefined'){ - mCount = count; - } - var items = new Array(); - var items1 = new Array(); - var items2 = new Array(); - var items3 = new Array(); - items = { - layout : 'form', - id : 'materialC'+materialItemCount, - columnWidth : .5, - labelWidth : 90, - items : [{ - xtype : 'combo', - id : 'material'+materialItemCount, - name : 'material'+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); - } - } - }] - }; - items1 = { - layout : 'form', - id : 'materialAmountC'+materialItemCount, - columnWidth : .5, - labelWidth : 90, - 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 : .5, - labelWidth : 90, - 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 : .5, - labelWidth : 90, - 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 - }; - tousseAndMaterial.add(items); - tousseAndMaterial.add(items1); - tousseAndMaterial.add(items2); - tousseAndMaterial.add(items3); - tousseAndMaterial.add(items4); - tousseAndMaterial.doLayout(); - // 顺序包括器械包和材料都排进去 - var curOrder = materialItemCount + tousseItemCount + 2; - Ext.getCmp('materialOrder'+materialItemCount).setValue(curOrder); - if(basketPosition != null && basketPosition != ''){ - Ext.getCmp('position'+materialItemCount).setValue(basketPosition); + if(Ext.getCmp('tousseName').getValue() != ""){ + Ext.getCmp('tousseName').setValue(""); } - if(orderNumber != null && orderNumber > 0){ - Ext.getCmp('materialOrder'+materialItemCount).setValue(orderNumber); - } - if(isOpenRecord == true && mateialName != null && mateialName != ''){ - //打开记录,不允许修改 - Ext.getCmp('material'+materialItemCount).disable(); - Ext.getCmp('materialAmount'+materialItemCount).disable(); - Ext.getCmp('basketBarcode'+materialItemCount).disable(); - Ext.getCmp('position'+materialItemCount).disable(); - } -} -// 隐藏第一个器械包信息,包括器械包条码,数量 -function hideFirstTousse(){ - Ext.getCmp('tousseBarcodeC').setVisible(false); - Ext.getCmp('tousseNameC').setVisible(false); - Ext.getCmp('tousseAmountC').setVisible(false); -} -//显示第一个器械包信息,包括器械包条码,数量 -function showFirstTousse(){ - Ext.getCmp('tousseBarcodeC').setVisible(true); - Ext.getCmp('tousseNameC').setVisible(true); - Ext.getCmp('tousseAmountC').setVisible(true); -} - -//隐藏第一个材料信息,包括器械包条码,数量 -function hideFirstMaterial(){ - Ext.getCmp('materialC').setVisible(false); - Ext.getCmp('materialAmountC').setVisible(false); -} -//显示第一个材料信息,包括器械包条码,数量 -function showFirstMaterial(){ + + //2、如果有炉号炉次,则需要设值 + if(!isUndefinedOrNullOrEmpty(Ext.getCmp('configItemOptionSterName'))){ + Ext.getCmp('configItemOptionSterName').setValue(""); + Ext.getCmp('configItemOptionSterFre').setValue(""); + } + Ext.getCmp('tousseAmountC').setVisible(true); + //Ext.getCmp('addExtractCheckMaterialBtnC').setVisible(true); + Ext.getCmp('addExtractCheckTousseBtnC').setVisible(true); +} + +//隐藏第一个材料信息,包括器械包条码,数量 +function hideFirstMaterial(){ + Ext.getCmp('materialC').setVisible(false); + Ext.getCmp('materialAmountC').setVisible(false); + Ext.getCmp('addExtractCheckMaterialBtnC').setVisible(false); +} +//显示第一个材料信息,包括器械包条码,数量 +function showFirstMaterial(){ Ext.getCmp('materialC').setVisible(true); - Ext.getCmp('materialAmountC').setVisible(true); -} - -function hideExtractCheckMaterial(){ - if(materialItemCount > 0){ - for(var i=1;i 0){ + for(var m =1;m 0){ + for(var i=1;i 0){ + for(var i=1;i 0){ + for(var i=1;i 0){ + for(var i=1;i 0){ + for(var i=1;i 0){ + for(var i=1;i 0){ + for(var j=1;j 0){ + for(var k=1;k 0){ + for(var i=1;i 0){ + for(var k=1;k 0){ + for(var k=1;k 0){ + for(var i=1;i 0){ + for(var i=1;i 0){ var items = new Array(); // 如果显示炉次炉号,添加表单 - if(result.showSterNameAndFre == '是'){ - items.push(createQualityMonitoringElementSterName(result.data.sterilizerName)); - items.push(createQualityMonitoringElementSterFre(result.data.sterilizerFrequency)); + if(result.data.showSterilizerNumFrequency == '是'){ + items.push(createQualityMonitoringElementSterName('',true,tousseAndMaterialWrapperCount)); + items.push(createQualityMonitoringElementSterFre('',true,tousseAndMaterialWrapperCount)); } - if(result.data.scope == "灭菌炉记录"){ - Ext.getCmp('sterilizationRecordInfo').setVisible(true); - // 如果监测范围为灭菌炉记录,隐藏器械包信息 - Ext.getCmp('tousseInfoFieldSet').setVisible(false); - }else{ - Ext.getCmp('sterilizationRecordInfo').setVisible(false); - } - for(var i = 0 ;i < result.data.items.length ;i++){ - var item = result.data.items[i].definitionItem; + for(var i = 0 ; i< result.data.items.length ; i++){ + var item = result.data.items[i]; if(Ext.getCmp('optionAmount').getValue() == null || Ext.getCmp('optionAmount').getValue() == ''){ Ext.getCmp('optionAmount').setValue(item.id); }else{ Ext.getCmp('optionAmount').setValue(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 = 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", @@ -1597,114 +2116,623 @@ } } - Ext.getCmp('addQualityMonitoringForm').remove('itemsFieldSet'); if(items.length > 0){ Ext.getCmp('addQualityMonitoringForm').add({ - id : 'itemsFieldSet', + id :'itemsFieldSet'+"_"+tousseAndMaterialWrapperCount, xtype:"fieldset", - labelWidth :400, labelAlign :'left', title:"监测项", layout:'column', autoHeight:true, items:items }); } - Ext.getCmp('addQualityMonitoringForm').doLayout(); - if(Ext.getCmp('itemsFieldSet')){ - Ext.getCmp('itemsFieldSet').doLayout(); + } + + Ext.getCmp('addQualityMonitoringForm').doLayout(); + if(Ext.getCmp('tousseInfoFieldSet')){ + Ext.getCmp('tousseInfoFieldSet').doLayout(); + } + } + }, + failure : function(response, options) { + showResultQM('系统加载出错,请稍候再试'); + } + }); +} + + +function showRecyclingInventoryItem(){ + Ext.getCmp("idCardAndTousseBarcodeWrapper").show(); + Ext.getCmp("tousseNameBasicsWrapper").show() + Ext.getCmp("recyclePersonWrapper").show(); + Ext.getCmp("recycleDepartmentsWrapper").show(); + Ext.getCmp("operationRoomWrapper").show(); + Ext.getCmp("nurseWrapper").show(); + Ext.getCmp("recycleTimeWrapper").show(); +} + +function hideRecyclingInventoryItem(){ + Ext.getCmp("idCardAndTousseBarcodeWrapper").hide(); + Ext.getCmp("tousseNameBasicsWrapper").hide(); + Ext.getCmp("recyclePersonWrapper").hide(); + Ext.getCmp("recycleDepartmentsWrapper").hide(); + Ext.getCmp("operationRoomWrapper").hide(); + Ext.getCmp("nurseWrapper").hide(); + Ext.getCmp("recycleTimeWrapper").hide(); +} + +function showCleanAndDisinfectionItem(){ + Ext.getCmp("rinseBasketsBarcodeWrapper").show();//显示清洗篮筐条码和名称 + Ext.getCmp("rinseBasketsNameWrapper").show(); + Ext.getCmp("cleaningMachinePositionWrapper").show(); + Ext.getCmp("cleaningMachineDateWrapper").show(); + Ext.getCmp("cleaningMachineNameWrapper").show(); + Ext.getCmp("cleaningMachineProgramNameWrapper").show(); + Ext.getCmp("cleaningStartTimeWrapper").show(); + Ext.getCmp("cleaningEndTimeWrapper").show(); +} + +function hideCleanAndDisinfectionItem(){ + Ext.getCmp("rinseBasketsBarcodeWrapper").hide();//显示清洗篮筐条码和名称 + Ext.getCmp("rinseBasketsNameWrapper").hide(); + Ext.getCmp("cleaningMachinePositionWrapper").hide(); + Ext.getCmp("cleaningMachineDateWrapper").hide(); + Ext.getCmp("cleaningMachineNameWrapper").hide(); + Ext.getCmp("cleaningMachineProgramNameWrapper").hide(); + Ext.getCmp("cleaningStartTimeWrapper").hide(); + Ext.getCmp("cleaningEndTimeWrapper").hide(); +} + +function showSterilizationItem(){ + Ext.getCmp("tousseBarcodeWrapper").show(); + Ext.getCmp("sterilizationNameWrapper").show(); + Ext.getCmp("sterilizationProgramNameWrapper").show(); + Ext.getCmp("heatWrapper").show(); + Ext.getCmp("sterilizationStartTimeWrapper").show(); + Ext.getCmp("sterilizationEndTimeWrapper").show(); +} + +function hideSterilizationItem(){ + Ext.getCmp("tousseBarcodeWrapper").hide(); + Ext.getCmp("sterilizationNameWrapper").hide(); + Ext.getCmp("sterilizationProgramNameWrapper").hide(); + Ext.getCmp("heatWrapper").hide(); + Ext.getCmp("sterilizationStartTimeWrapper").hide(); + Ext.getCmp("sterilizationEndTimeWrapper").hide(); +} + +var tosseAndMaterialWrapper; +/** + * 获取监测项的combo. + * @param id 质量监测实例id + * @returns + */ + +function getInspectItemContent(id){ + return { + layout : 'form', + columnWidth : .5, + labelWidth : 90, + height:setH, + items : [{ + layout: 'column', + columnWidth:1, + //height:25, + 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){ + return false; + } + }, + beforeselect : function(combo, record, index) { + if(record.data.name != combo.getValue()){ + if(Ext.getCmp('barcode').getValue()){ + getTousseInstanceNameAndResponsiblePerson(Ext.getCmp('barcode').getValue(), combo.getValue(), null); + } + } + }, + select : function(combo,record,index){ + // tousseAndMaterialWrapperCount = 0; + Ext.getCmp("formDefinitionId").setValue(combo.getValue()); + Ext.getCmp("name").setValue(combo.getRawValue()); + addQualityMonitoringItem(combo.getValue(),combo.getRawValue()); + + + } + } + }] + + }, + { + layout : 'form', + columnWidth:.12, + id:"addBtnAll", + items : [{ + xtype:'button', + tooltip : '添加监测元素信息', + iconCls : 'btn_ext_add', + handler : function(){ + var formId = Ext.getCmp("formDefinitionId").getValue(); + var formVal = Ext.getCmp("name").getValue(); + if(formVal== ""){ + showResultQM("监测项为空时不能添加监测元素信息!"); + return; + } + addQualityMonitoringAndTousselMsg(formId,formVal); + } + }] + }] + }] + }; +} + +/** + * 添加或者修改质量监测实例(各个生产环节填写的质量监测也是会调用这里的). + * @param id 质量监测实例id + * @param formDefinitionId 质量监测定义id + * @param formDefinitionName 质量监测定义名称 + */ +function addQualityMonitoring(id,formDefinitionId,formDefinitionName) { + if(id==null||id=='undentified'){ + id=""; + } + materialItemCount=0; + tousseItemCount=0; + tousseAndMaterialWrapperCount=0; + if(id==undefined || id == "" || id < 0){ + disableShowImageButton = true; + }else{ + disableShowImageButton = false; + } + formPanel = getFormPanelContent(id); + qualityMonitoringWin = new Ext.Window({ + id : 'qualityMonitoringWin', + layout : 'fit', + title : '质量监测信息', + width : 730, + modal : true, + autoHeight : true, + border : false, + plain : true, + draggable:false, + items : [ formPanel ] + }); + qualityMonitoringWin.show(); + if(id != null && id != ''){ + Ext.getCmp('formName').addClass("fieldReadOnlyNoRemove"); + Ext.getCmp('responsibilityPart').addClass("fieldReadOnlyNoRemove"); + Ext.Ajax.request({ + url : WWWROOT + '/disinfectSystem/qualityMonitoringInstanceAction!loadQualityMonitoringInstance.do', + params : {id : id}, + success : function(response,options){ + var result = Ext.decode(response.responseText); + if(result.success){ + Ext.getCmp('id').setValue(result.data.id); + Ext.getCmp('formName').setValue(result.data.name); + Ext.getCmp('formName').setEditable(false); + Ext.getCmp('name').setValue(result.data.name); + Ext.getCmp('type').setValue(result.data.type); + Ext.getCmp('srDateTime').setValue(result.data.sterilizerDate); + //Ext.getCmp('sterilizerName').setValue(result.data.sterilizerName);//DGZYY-161不要了 + //Ext.getCmp('sterilizerFre').setValue(result.data.sterilizerFrequency);//DGZYY-161不要了 + Ext.getCmp('errorDamageQmKey').setValue(result.data.errorDamageQmKey); + //Ext.getCmp('inspectType').setValue(result.data.scope); + if(result.data.name == "无"){ + Ext.getCmp("formDefinitionId").setValue(0); + }else{ + Ext.getCmp("formDefinitionId").setValue(result.data.formDefinition.id); + } + if(sstsConfig.hasOwnProperty('isInspectScopeHideTousseMsg') && sstsConfig.isInspectScopeHideTousseMsg){ + if("无" == result.data.scope){ + // 如果监测范围为无,隐藏器械包信息 + Ext.getCmp('tousseInfoFieldSet').setVisible(false); + } + } + Ext.getCmp('responsibilityPart').setValue(result.data.responsibilityPart); + Ext.getCmp('dateTime').setValue(Ext.util.Format.date(new Date(result.data.dateTime.time),"Y-m-d H:i")); + + Ext.getCmp('scope').setValue(result.data.scope); + Ext.getCmp('responsiblePerson').setValue(result.data.responsiblePerson); + Ext.getCmp('createUserName').setValue(result.data.createUserName); + Ext.getCmp('tousseDefinitionId').setValue(result.data.tousseDefinitionId); + + qualityMonitoringWRRecordID = result.data.washAndDisinfectRecordId; + qualityMonitoringSterilizationID = result.data.sterilizationRecordId; + if('是'==result.data.isAllTousseOfSterile){ + Ext.getCmp('isAllTousseOfSterile').setValue(result.data.isAllTousseOfSterile); + Ext.getCmp('allTousseOfSterile').setValue(true); + } + + if(result.data.responsibilityPart == "回收清点" && result.data.recordRecycleInformation == "是"){//要显示对应的输入框并赋值 + showRecyclingInventoryItem();//显示回收清点对应的 + Ext.getCmp("idCardAndTousseBarcode").setValue(result.data.scanTousseInstance.tousseInstanceBarcode); + Ext.getCmp('tousseNameBasics').setValue(result.data.scanTousseInstance.tousseInstanceName); + Ext.getCmp("scanTousseInstance_id").setValue(result.data.scanTousseInstance.tousseInstanceId); + if(result.data.scanTousseInstance.recyclingRecordJSON != undefined){ + Ext.getCmp("recyclePerson").setValue(result.data.scanTousseInstance.recyclingRecordJSON.reUser); + Ext.getCmp("recycleDepartments").setValue(result.data.scanTousseInstance.recyclingRecordJSON.reDept); + Ext.getCmp("operationRoom").setValue(result.data.scanTousseInstance.recyclingRecordJSON.lastUseRecordOperationRoom); + Ext.getCmp("nurse").setValue(result.data.scanTousseInstance.recyclingRecordJSON.lastUseRecordCircuitNurse); + Ext.getCmp("recycleTime").setValue(result.data.scanTousseInstance.recyclingRecordJSON.reTime); + } + + }else if(result.data.responsibilityPart == "清洗消毒" && result.data.recordRinseInformation == "是"){//要显示对应的输入框并赋值 + showCleanAndDisinfectionItem(); + Ext.getCmp("rinseBasketsName").setValue(result.data.scanWashAndDisinfectRecord.washBasketName); + Ext.getCmp("cleaningMachinePosition").setValue(result.data.scanWashAndDisinfectRecord.position); + Ext.getCmp("cleaningMachineDate").setValue(result.data.scanWashAndDisinfectRecord.washDate); + Ext.getCmp("cleaningMachineName").setValue(result.data.scanWashAndDisinfectRecord.disinfectIdentification); + Ext.getCmp("cleaningMachineProgramName").setValue(result.data.scanWashAndDisinfectRecord.disinfectProgram); + Ext.getCmp("cleaningStartTime").setValue(result.data.scanWashAndDisinfectRecord.startDate); + Ext.getCmp("cleaningEndTime").setValue(result.data.scanWashAndDisinfectRecord.endDate); + Ext.getCmp("scanWashRecord_id").setValue(result.data.scanWashAndDisinfectRecord.washRecordID); + } else if(result.data.responsibilityPart == "灭菌管理" && result.data.recordSterilizatioInformation == "是"){//要显示对应的输入框并赋值 + showSterilizationItem(); + Ext.getCmp('tousseBarcode').setValue(result.data.scanTousseInstance.tousseInstanceBarcode); + Ext.getCmp("scanTousseInstance_id").setValue(result.data.scanTousseInstance.tousseInstanceId); + if(result.data.scanTousseInstance.sterilizationRecordJSON != undefined){ + Ext.getCmp("sterilizationName").setValue(result.data.scanTousseInstance.sterilizationRecordJSON.sterilizerName); + Ext.getCmp("sterilizationProgramName").setValue(result.data.scanTousseInstance.sterilizationRecordJSON.sterilizationType); + Ext.getCmp("heat").setValue(result.data.scanTousseInstance.sterilizationRecordJSON.frequency); + Ext.getCmp("sterilizationStartTime").setValue(result.data.scanTousseInstance.sterilizationRecordJSON.startDate); + Ext.getCmp("sterilizationEndTime").setValue(result.data.scanTousseInstance.sterilizationRecordJSON.endDate); + } } - //打开已有质量监测记录,器械包条码,器械包名称,重新回收和重新装配都禁用掉,不能再修改 - Ext.getCmp('recycle').disable(); - Ext.getCmp('repacking').disable(); - Ext.getCmp('tempBarcode').disable(); - Ext.getCmp('tousseName').disable(); - Ext.getCmp('tousseAmount').disable(); - Ext.getCmp('material').disable(); - Ext.getCmp('materialAmount').disable(); - Ext.getCmp('basketBarcode').disable(); - Ext.getCmp('position').disable(); - Ext.getCmp('allTousseOfSterile').disable(); - }else{ - showResultQM("找不到该条码所对应的器械包实例"); - } - }, - failure : function(response, options) { - showResultQM('系统加载出错,请稍候再试'); - } - }); - }else{ - setStartDate(Ext, 'yyyy/MM/dd HH:mm', 'dateTime'); //(设置抽检时间,取服务器时间 cjr) - disableRecycleAndRepacking(); - var resonPart = Ext.getCmp('responsibilityPart').getValue(); - if(resonPart != null && resonPart != '') { - if(resonPart == '全部环节'){ - formDefinitionStore.baseParams.responsiblePerson = ""; + + if(result.data.basketName!=null && result.data.basketName != ""){ + Ext.getCmp('containerName').setValue(result.data.basketName); + }else{ + Ext.getCmp("insertBasket").hide(); + Ext.getCmp("containerNameItem").hide(); + Ext.getCmp('containerName').setVisible(false); + Ext.getCmp('containerName').getEl().up('.x-form-item').setDisplayed(false); + } + materialDefinitionStore.baseParams['spell'] = ""; + materialDefinitionStore.reload(); + + if("材料" == result.data.scope){ + hideFirstTousse(); + showFirstMaterial(); + Ext.getCmp('recycleC').setVisible(false); + Ext.getCmp('repackingC').setVisible(false); + Ext.getCmp('allTousseOfSterile').setVisible(false); + Ext.getCmp('allTousseOfSterile').getEl().up('.x-form-item').setDisplayed(false); + //Ext.getCmp('addExtractCheckTousse').setVisible(false); + loadMaterialMsg(result.data.qualityMonitoringGoodsList); + }else if("器械包" == result.data.scope){ + hideFirstMaterial(); + showFirstTousse(); + loadTousseMsg(result.data,result.data.qualityMonitoringGoodsList); + }else if("材料和器械包" == result.data.scope){ + showFirstTousse(); + showFirstMaterial(); + loadMateriaAndTousselMsg(result.data,result.data.qualityMonitoringGoodsList); + } + if(result.data.name == "无" || result.data.scope == '无'){ + // 监测项名称,监测范围是无时,加载材料,隐藏器械包 + hideFirstTousse(); + showFirstMaterial(); + Ext.getCmp('recycleC').setVisible(false); + Ext.getCmp('repackingC').setVisible(false); + Ext.getCmp('allTousseOfSterile').setVisible(false); + Ext.getCmp('allTousseOfSterile').getEl().up('.x-form-item').setDisplayed(false); + //Ext.getCmp('addExtractCheckTousse').setVisible(false); + loadMaterialMsg(result.data.qualityMonitoringGoodsList); + } + // 重新打开,不能再加器械包和材料 + Ext.getCmp('addBtnAll').setVisible(false) + Ext.getCmp('addExtractCheckMaterialBtnC').setVisible(false); + Ext.getCmp('addExtractCheckTousseBtnC').setVisible(false); + //Ext.getCmp('addExtractCheckTousse').setVisible(false); + //Ext.getCmp('addExtractCheckMaterial').setVisible(false); + // 不能选是否整炉 + showAllTousseOfSterileCheckBox(false); + Ext.getCmp('remark').setValue(result.data.remark); + Ext.getCmp('optionAmount').setValue(''); + var items = new Array(); + // 如果显示炉次炉号,添加表单 + if(result.showSterNameAndFre == '是'){ + items.push(createQualityMonitoringElementSterName(result.data.sterilizerFrequency,"","")); + items.push(createQualityMonitoringElementSterFre(result.data.sterilizerName,"","")); + } + if(result.data.scope == "灭菌炉记录"){ + Ext.getCmp('sterilizationRecordInfo').setVisible(true); + // 如果监测范围为灭菌炉记录,隐藏器械包信息 + Ext.getCmp('tousseInfoFieldSet').setVisible(false); + }else{ + Ext.getCmp('sterilizationRecordInfo').setVisible(false); + } + + for(var i = 0 ;i < result.data.items.length ;i++){ + var item = result.data.items[i].definitionItem; + if(Ext.getCmp('optionAmount').getValue() == null || Ext.getCmp('optionAmount').getValue() == ''){ + Ext.getCmp('optionAmount').setValue(item.id); + }else{ + Ext.getCmp('optionAmount').setValue(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 == '多选'){ + items.push({ + columnWidth : 1, + xtype : "label", + html : ' ', + anchor : '95%' + }); + } + } + + Ext.getCmp('addQualityMonitoringForm').remove('itemsFieldSet'); + if(items.length > 0){ + Ext.getCmp('addQualityMonitoringForm').add({ + id : 'itemsFieldSet', + xtype:"fieldset", + labelWidth :400, + labelAlign :'left', + title:"监测项", + layout:'column', + autoHeight:true, + items:items + }); + } + Ext.getCmp('addQualityMonitoringForm').doLayout(); + if(Ext.getCmp('itemsFieldSet')){ + Ext.getCmp('itemsFieldSet').doLayout(); + } + //打开已有质量监测记录,器械包条码,器械包名称,重新回收和重新装配都禁用掉,不能再修改 + Ext.getCmp('recycle').disable(); + Ext.getCmp('repacking').disable(); + Ext.getCmp('tempBarcode').disable(); + Ext.getCmp('tousseName').disable(); + Ext.getCmp('tousseAmount').disable(); + Ext.getCmp('material').disable(); + Ext.getCmp('materialAmount').disable(); + Ext.getCmp('basketBarcode').disable(); + Ext.getCmp('position').disable(); + Ext.getCmp('allTousseOfSterile').disable(); + }else{ + showResultQM("找不到该条码所对应的器械包实例"); + } + }, + failure : function(response, options) { + showResultQM('系统加载出错,请稍候再试'); + } + }); + }else{ + setStartDate(Ext, 'yyyy/MM/dd HH:mm', 'dateTime'); //(设置抽检时间,取服务器时间 cjr) + disableRecycleAndRepacking(); + var resonPart = Ext.getCmp('responsibilityPart').getValue(); + if(resonPart != null && resonPart != '') { + if(resonPart == '全部环节'){ + formDefinitionStore.baseParams.responsiblePerson = ""; + }else{ + formDefinitionStore.baseParams.responsiblePerson = resonPart; + } + }else{ + Ext.getCmp('responsibilityPart').setValue('全部环节'); + formDefinitionStore.baseParams.responsiblePerson = ""; + } + if( !isUndefinedOrNullOrEmpty(formDefinitionId) && !isUndefinedOrNullOrEmpty(formDefinitionName) ){ + Ext.getCmp('formName').setValue(formDefinitionName); + addQualityMonitoringItem(formDefinitionId,formDefinitionName); + Ext.getCmp("formDefinitionId").setValue(formDefinitionId); + Ext.getCmp("name").setValue(formDefinitionName); + }else{ + formDefinitionStore.load(); + } + } + +} + +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.Ext.ux.UploadDialog.Dialog({ + title: "上传" + imageType, + url:WWWROOT + '/disinfectSystem/baseData/uploadImageFileAction!uploadImage.do?imageType='+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); //定义上传完成回调函数 + + +} + + +function setTousseArgument(wrapper){ + var tousseBagsList = {}; + var tousseArrHidden = []; + var tousseBags = []; + 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 + tousseBagsList.tousseInstanceId = tousseArrHidden[0]; + tousseBagsList.tousseRecycle = tousseArrHidden[1]; + tousseBagsList.tousseRePacking = tousseArrHidden[2]; + tousseBagsList.order = tousseArrHidden[3]; + var materialInfos = []; + var materialArrHidden = []; + //抽检器械数据 + var materiaItems = wrapper[j].items.items; + 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){ + materialArrHidden.push(Ext.getCmp(materiaItemsId).getValue()); + }else{ + if(materiaItems[m].items.items[0].fieldLabel == "抽检器械" && m > 1){ + + materialInfos.push({ + "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] + }) + materialArrHidden = []; + + tousseBagsList.materialInfos = materialInfos; + tousseBags.push(tousseBagsList); + tousseArrHidden = []; + tousseBagsList = {}; + }else if(wrapper[j].items == undefined){//隐藏域的情况 + var tousseRecycleOrRePacking = Ext.getCmp(parentId).getValue(); + tousseArrHidden.push(tousseRecycleOrRePacking); + if(Ext.getCmp("scope").getValue() == "器械包" && tousseArrHidden.length == 4){ + tousseBagsList.tousseInstanceId = tousseArrHidden[0]; + tousseBagsList.tousseRecycle = tousseArrHidden[1]; + tousseBagsList.tousseRePacking = tousseArrHidden[2]; + tousseBagsList.order = tousseArrHidden[3]; + tousseBags.push(tousseBagsList); + tousseArrHidden = []; + tousseBagsList = {}; + } + }else if(wrapper[j].items.items[0].fieldLabel == "重新回收" || wrapper[j].items.items[0].fieldLabel == "重新装配"){ + continue; + }else{//器械包名称,器械包数量 + var tousseBarcode = wrapper[j].items.items[0].el.dom.value; + if(wrapper[j].items.items[0].fieldLabel == "器械包条码"){ + tousseBagsList.tousseBarcode = tousseBarcode; + }else if(wrapper[j].items.items[0].fieldLabel == "器械包名称"){ + tousseBagsList.tousseName = tousseBarcode; + }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 ++){ + var materialParentId = materialWrapper[p].id; + if(materialParentId.indexOf("addExtractCheckMaterialBtnC") == -1 && materialParentId.indexOf("basketBarcodeC") == -1){//除开添加按钮 + if(materialWrapper[p].items == undefined){ + materialWrapperHidden.push(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); + } + } + } + return tousseBags2; +} + + +function setConfigItemOptionArgument(wrapperItemsFieldSet){ + var configItemOption = {}; + var configItemOptionArr = []; + 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){ + configItemKey = wrapperItemsFieldSet[x].items.items[1].id; + configItemVal = Ext.getCmp(configItemKey).getValue(); + }else if((wrapperItemsFieldSet[x].items.items[0].xtype) == "datefieldWithMin"){ + configItemKey = wrapperItemsFieldSet[x].items.items[0].id; + configItemVal = wrapperItemsFieldSet[x].items.items[0].value; }else{ - formDefinitionStore.baseParams.responsiblePerson = resonPart; + configItemKey = wrapperItemsFieldSet[x].items.items[0].id; + configItemVal = Ext.getCmp(configItemKey).getValue(); + } - }else{ - Ext.getCmp('responsibilityPart').setValue('全部环节'); - formDefinitionStore.baseParams.responsiblePerson = ""; + configItemOption[configItemKey] = configItemVal; } - if( !isUndefinedOrNullOrEmpty(formDefinitionId) && !isUndefinedOrNullOrEmpty(formDefinitionName) ){ - Ext.getCmp('formName').setValue(formDefinitionName); - addQualityMonitoringItem(formDefinitionId,formDefinitionName); - Ext.getCmp("formDefinitionId").setValue(formDefinitionId); - Ext.getCmp("name").setValue(formDefinitionName); - }else{ - formDefinitionStore.load(); - } } - + + configItemOptionArr.push(configItemOption); + return configItemOptionArr; } - -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.Ext.ux.UploadDialog.Dialog({ - title: "上传" + imageType, - url:WWWROOT + '/disinfectSystem/baseData/uploadImageFileAction!uploadImage.do?imageType='+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); //定义上传完成回调函数 -} - -/** - * 保存质量监测实例. - * @param thiz 按钮对象 - * @param materialDefinitionStore 抽检器械的store - * @param saveAndCreate 是否为“保存并新建”操作 - * @returns {Boolean} - */ -function saveQualityMonitoring(thiz,materialDefinitionStore,saveAndCreate) { + +/** + * 保存质量监测实例. + * @param thiz 按钮对象 + * @param materialDefinitionStore 抽检器械的store + * @param saveAndCreate 是否为“保存并新建”操作 + * @returns {Boolean} + */ +function saveQualityMonitoringNew(thiz,materialDefinitionStore,saveAndCreate) { //1、验证所有的监测细则的填写是否合法 var optionAmount = Ext.getCmp('optionAmount').getValue(); //监测细则的表单元素id集合(用分号分隔) if (optionAmount) { @@ -1749,39 +2777,6 @@ return false; } - //3、组织材料信息(点击“添加抽检器械”按钮添加的器械) - var materialInfo = ""; - var materialLength = materialItemCount; //(Ext.getCmp('setLeft').items.length-3)/2; - for(var i = 1 ; i <= materialLength ; i++){ - var isVisiable = Ext.getCmp("materialC"+i).isVisible(); - if(isVisiable == false){ - continue; - } - var material = Ext.getCmp("material"+i).getValue(); - var amount = Ext.getCmp("materialAmount"+i).getValue(); - var position = Ext.getCmp("position"+i).getValue(); - var order = Ext.getCmp("materialOrder"+i).getValue(); - if((material != null && material != "") && (amount != null && amount != "")){ - materialInfo += material + "@" + amount + "@" + position + "@" + order + ";"; - } - } - - //4、组织器械包信息(点击“添加抽检器械包”按钮添加的器械包) - tousseInstanceInfo = ""; - var addTousseInstanceAmount = tousseItemCount; - for(var i =1; i <= addTousseInstanceAmount; i++){ - var tousseBarcode = Ext.getCmp('tempBarcode'+i+"_"+1).getValue(); - var tousseName = Ext.getCmp('tempBarcode'+i+"_"+3).getValue(); - var tousseAmount = Ext.getCmp('tempBarcode'+i+"_"+6).getValue(); - var tousseInstanceId = Ext.getCmp('tempBarcode'+i+"_"+5).getValue(); - var tousseRecycle = Ext.getCmp('tempBarcode'+i+"_"+7).getValue(); - var tousseRePacking = Ext.getCmp('tempBarcode'+i+"_"+8).getValue(); - var order = Ext.getCmp('tousseOrder'+i).getValue(); - if((tousseName != null && tousseName != "") && (tousseAmount != null && tousseAmount != "")){ - tousseInstanceInfo += tousseBarcode + "@" + tousseInstanceId + "@" + tousseName + "@" + tousseAmount + "@" + tousseRecycle+ "@" + tousseRePacking+ "@" + order +";"; - } - } - //5、如果是(整炉 or 监测项=无 or 监测范围=无 or 监测范围=灭菌炉记录)则可以不用填写器械包信息,否则强制要登记器械包信息 var barcode = Ext.getCmp('barcode').getValue(); //第一组的器械包条码 var tousseName = Ext.getCmp('tousseName').getRawValue(); //第一组的器械包名称 @@ -1798,17 +2793,59 @@ } } + + //7、如果有显示“清洗篮筐名称”则需要填写 + var container = Ext.getCmp("containerName") ; + if(container != null && container.isVisible() && container.getValue() == ""){ + showResultQM("请扫描回收篮筐条码!"); + return false; + } + + var tousseAndMaterialAll = {}; + var tousseInstanceInfos = []; + var tousseAndMaterialWrapperCountNum = tousseAndMaterialWrapperCount;//获取添加的块数量 + + //针对第一个块,过滤出需要的数据 + if(Ext.getCmp("tosseAndMaterial")){ + var tosseAndMaterialFirstWrapper = Ext.getCmp("tosseAndMaterial").items.items;//获取默认显示的第一个器械包信息,就是第一个块 + for(var n = 0; n < tosseAndMaterialFirstWrapper.length; n++){ + var firstId = tosseAndMaterialFirstWrapper[n].id; + if(firstId == "tousseBarcodeC" /* || firstId == "addExtractCheckTousseBtnC" || firstId == "tousseNameC" || firstId == "tousseAmountC" */ ){ + tosseAndMaterialFirstWrapper.splice(0, 4);//先删除前面写死的器械包信息,器械包条码,按钮,器械包名称,数量 + } + + 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" */){ + firstAddMaterial.splice(0, 5);//是材料的话,把材料里面的写死删除,抽检器械,按钮,数量 + } + } + //tosseAndMaterialFirstWrapper.splice(0, 5);////删除前面写死的器械包和数量等 + + tosseAndMaterialFirstWrapper.splice(0, 1);//再删除材料,写死的篮筐条码,位置 + break; + } + + } + } + + //获取第一块材料写死的数据 + var firstAddMaterialArr = []; + var firstMaterialInfos = []; + var material = Ext.getCmp('material').getValue(); + var amount = ""; + var position = ""; //6、如果是重新打开的记录,不再校验材料和包的关系 var qid = Ext.getCmp('id').getValue(); if(isUndefinedOrNullOrEmpty(qid)){ if(material){ - var amount = Ext.getCmp('materialAmount').getValue(); + amount = Ext.getCmp('materialAmount').getValue(); if(!amount || amount < 0){ showResultQM('输入的“'+material+'”的数量且不能小于1'); return false; } - var position = Ext.getCmp("position").getValue(); - materialInfo += material +"@"+ amount + "@" + position + "@" + 2 + ";"; + position = Ext.getCmp("position").getValue(); if(tousseName){ var tousseDefinitionId = Ext.getCmp('tousseDefinitionId').getValue(); var isContain = false; @@ -1829,982 +2866,1630 @@ } }else{ if(material){ - var amount = Ext.getCmp('materialAmount').getValue(); - var position = Ext.getCmp("position").getValue(); - materialInfo += material +"@"+ amount + "@" + position + "@" + 2 + ";"; + amount = Ext.getCmp('materialAmount').getValue(); + position = Ext.getCmp("position").getValue(); + }else{ + material = ""; } } - //7、如果有显示“清洗篮筐名称”则需要填写 - var container = Ext.getCmp("containerName") ; - if(container != null && container.isVisible() && container.getValue() == ""){ - showResultQM("请扫描篮筐条码!"); - return false; + firstMaterialInfos.push({ + "material":material, + "amount":amount, + "position":position, + "order":"" + }); + + //获取第一块器械包写死的数据 + var firstTousseBagsList = {}; + if(Ext.getCmp("scope").getValue() != "材料"){ + var tousseName = Ext.getCmp('tousseName').getRawValue(); + var barcode = Ext.getCmp('barcode').getValue(); + var tousseInstanceId = Ext.getCmp('tousseInstanceId').getValue(); + var amount = Ext.getCmp('tousseAmount').getValue(); + var isRecycle = Ext.getCmp('isRecycle').getValue(); + var isRepacking = Ext.getCmp('isRepacking').getValue(); + + //if(tousseName != null && tousseName != ""){ + firstTousseBagsList.tousseBarcode = barcode; + firstTousseBagsList.tousseName = tousseName; + firstTousseBagsList.tousseAmount = amount; + firstTousseBagsList.tousseInstanceId = tousseInstanceId; + firstTousseBagsList.tousseRecycle = isRecycle; + firstTousseBagsList.tousseRePacking = isRepacking; + firstTousseBagsList.order = ""; + //} } - checkIsTousseInstanceRepackingAndSubmitForm(thiz,materialInfo,saveAndCreate); -} - -function loadResponPersonByBarcode(barcode){ - if(isUndefinedOrNullOrEmpty(barcode)){ - showResultQM('条码不能为空!'); - return ; - } - UserTableManager.getUserByBarcode(barcode,function(responseText){ - if(!isUndefinedOrNullOrEmpty(responseText)){ - var result = Ext.decode(responseText); - if(!result.success){ - showResultQM("请输入正确的人员条码!"); - return; - } - Ext.getCmp('responsiblePerson').setValue(result.fullName); - }else{ - showResultQM('找不到该条码所对应的人员信息'); - } - }); -} - -function checkIsUniqueWithBarcodeAndInspectItemAndSubmitForm(thiz,id,barcode,formDefinitionId,materialInfo,saveAndCreate){ - if(barcode && formDefinitionId){ - Ext.Ajax.request({ - url : WWWROOT + '/disinfectSystem/qualityMonitoringInstanceAction!checkIsUniqueWithBarcodeAndInspectItem.do', - params : { - id : id, - barcode : barcode, - formDefinitionId : formDefinitionId - }, - success : function(response,options){ - var result = Ext.decode(response.responseText); - if(!result.isUnique){ - showResultQM("当前器械包所对应的检测项已存在"); - thiz.enable(); - return false; + + + var getTousseArgument2; + if(Ext.getCmp("scope").getValue() == "材料和器械包" || 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(Ext.getCmp(firstAddMaterial[v].id).getValue()); + }else{ + firstAddMaterialArr.push(firstAddMaterial[v].items.items[0].el.dom.value); + } + } - submitForm2(materialInfo,saveAndCreate); - }, - failure : function(response, options) { - showResultQM('系统加载出错,请稍候再试'); } - }); - }else{ - submitForm2(materialInfo,saveAndCreate); - } -} - -/** - * 校验是否有包实例已经重新装配过,如果已经装配过则不允许再次装配了,如果校验通过则提交. - * @param thiz 按钮对象 - * @param materialInfo 材料信息 - * @param saveAndCreate 是否为“保存并新建”操作 - */ -function checkIsTousseInstanceRepackingAndSubmitForm(thiz,materialInfo,saveAndCreate){ - var barcodes = getScanRepacingTiBarcodes(); - Ext.Ajax.request({ - url : WWWROOT + '/disinfectSystem/qualityMonitoringInstanceAction!checkIsTousseInstanceRepacking.do', - params : { - barcodes : barcodes - }, - success : function(response,options){ - var result = Ext.decode(response.responseText); - if(result.haveRepacking){ - showResultQM("扫描的器械包已经重新装配!"); - thiz.enable(); - return false; + if(firstAddMaterialArr.length > 0){ + firstMaterialInfos.push({ + "material":firstAddMaterialArr[0], + "amount":firstAddMaterialArr[1], + "position":firstAddMaterialArr[2], + "order":firstAddMaterialArr[3] + }); } - submitForm2(materialInfo,saveAndCreate); - }, - failure : function(response, options) { - showResultQM('系统加载出错,请稍候再试'); } - }); -} -// 监测范围是器械包,加载器械包 -function loadTousseMsg(qualityMonitoringInstance, qualityMonitoringGoodsList){ - setIsRecycleAndIsRepackingForWholeFurnace(qualityMonitoringInstance); - if(qualityMonitoringGoodsList == null || qualityMonitoringGoodsList == '' || qualityMonitoringGoodsList.length == 0){ - return ; + + firstTousseBagsList.materialInfos = firstMaterialInfos; + } + + getTousseArgument2 = setTousseArgument(tosseAndMaterialFirstWrapper); + getTousseArgument2.unshift(firstTousseBagsList); + + //获取第一个监测项 + var configItemOptionFirst; + if(Ext.getCmp('itemsFieldSet')){ + var firstItemsFieldSet = Ext.getCmp('itemsFieldSet').items.items; + var getFirstConfigItemOptionArgument = setConfigItemOptionArgument(firstItemsFieldSet); + configItemOptionFirst = getFirstConfigItemOptionArgument[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; - var amount = qualityMonitoringGoodsList[i].amount; - Ext.getCmp('tousseInstanceId').setValue(tousseInstanceId); - Ext.getCmp('tempBarcode').setValue(barcode); - Ext.getCmp('tousseName').setValue(tousseName); - Ext.getCmp('tousseAmount').setValue(amount); - if('是'==qualityMonitoringGoodsList[i].isRecycle){ - Ext.getCmp('isRecycle').setValue(qualityMonitoringGoodsList[i].isRecycle); - Ext.getCmp('isRepacking').setValue('否'); + tousseInstanceInfos.push({ + "tousseBags":getTousseArgument2, + "configItemOption":configItemOptionFirst + }); + + //获取增加的块 + if(tousseAndMaterialWrapperCountNum > 0){//增加的块 这里的判断条件有问题 + for(var k = 1;k <= tousseAndMaterialWrapperCountNum;k++){//先找到每一个块 + var wrapper; + var getTousseArgument; + var configItemOption; + if(Ext.getCmp("scope").getValue() == "材料和器械包"){ + if(Ext.getCmp('tousseInfoFieldSet'+ k +'_TMP')){ + var wrapperParent = Ext.getCmp('tousseInfoFieldSet'+ k +'_TMP');//最外层 //包和材料 + wrapper = Ext.getCmp('tosseAndMaterial'+k+'_TMP').items.items; + getTousseArgument = setTousseArgument(wrapper); + //监测项 + if(Ext.getCmp('itemsFieldSet_'+ k)){ + var wrapperItemsFieldSet = Ext.getCmp('itemsFieldSet_'+ k).items.items; + var getConfigItemOptionArgument = setConfigItemOptionArgument(wrapperItemsFieldSet); + configItemOption = getConfigItemOptionArgument[0]; + } + tousseInstanceInfos.push({ + "tousseBags":getTousseArgument, + "configItemOption":configItemOption + }); + } + }else if(Ext.getCmp("scope").getValue() == "器械包"){ + if(Ext.getCmp('tosseAndMaterial'+k+'_TP')){ + wrapper = Ext.getCmp('tosseAndMaterial'+k+'_TP').items.items; + getTousseArgument = setTousseArgument(wrapper); + //监测项 + if(Ext.getCmp('itemsFieldSet_'+ k)){ + var wrapperItemsFieldSet = Ext.getCmp('itemsFieldSet_'+ k).items.items; + var getConfigItemOptionArgument = setConfigItemOptionArgument(wrapperItemsFieldSet); + configItemOption = getConfigItemOptionArgument[0]; + } + tousseInstanceInfos.push({ + "tousseBags":getTousseArgument, + "configItemOption":configItemOption + }); + } - Ext.getCmp('recycle').setValue(true); - Ext.getCmp('repacking').setValue(false); - }else if('是'==qualityMonitoringGoodsList[i].isRepacking){ - Ext.getCmp('isRecycle').setValue('否'); - Ext.getCmp('isRepacking').setValue(qualityMonitoringGoodsList[i].isRepacking); - - Ext.getCmp('recycle').setValue(false); - Ext.getCmp('repacking').setValue(true); - }else{ - Ext.getCmp('isRecycle').setValue('否'); - Ext.getCmp('isRepacking').setValue('否'); - - Ext.getCmp('recycle').setValue(false); - Ext.getCmp('repacking').setValue(false); - } - }else{ - var barcode = qualityMonitoringGoodsList[i].barcode; - var tousseInstanceId = qualityMonitoringGoodsList[i].tousseInstanceId; - var tousseName = qualityMonitoringGoodsList[i].tousseName; - var amount = qualityMonitoringGoodsList[i].amount; - var orderNumber = qualityMonitoringGoodsList[i].orderNumber; - var isRecycle = qualityMonitoringGoodsList[i].isRecycle; - var isRePacking = qualityMonitoringGoodsList[i].isRepacking; - addExtractCheckTousse(tousseName,barcode,tousseInstanceId,amount,orderNumber,isRecycle,isRePacking); + }else if(Ext.getCmp("scope").getValue() == "材料"){ + if(Ext.getCmp('tosseAndMaterial'+k+'_MP')){ + var materialWrapper = Ext.getCmp('tosseAndMaterial'+k+'_MP').items.items; + var getMaterialArgument = setMaterialArgument(materialWrapper); + getTousseArgument = getMaterialArgument; + //监测项 + if(Ext.getCmp('itemsFieldSet_'+ k)){ + var wrapperItemsFieldSet = Ext.getCmp('itemsFieldSet_'+ k).items.items; + var getConfigItemOptionArgument = setConfigItemOptionArgument(wrapperItemsFieldSet); + configItemOption = getConfigItemOptionArgument[0]; + } + tousseInstanceInfos.push({ + "tousseBags":getTousseArgument, + "configItemOption":configItemOption + }); + } + } } } -} -//监测范围是材料,加载材料信息 -function loadMaterialMsg(qualityMonitoringGoodsList){ - if(qualityMonitoringGoodsList == null || qualityMonitoringGoodsList == '' || qualityMonitoringGoodsList.length == 0){ - return ; + tousseAndMaterialAll.tousseInstanceInfos = tousseInstanceInfos; + //传参tousseAndMaterialAll + checkIsTousseInstanceRepackingAndSubmitFormNew(thiz,JSON.stringify(tousseAndMaterialAll),saveAndCreate); +} + +function loadResponPersonByBarcode(barcode){ + if(isUndefinedOrNullOrEmpty(barcode)){ + showResultQM('条码不能为空!'); + return ; + } + UserTableManager.getUserByBarcode(barcode,function(responseText){ + if(!isUndefinedOrNullOrEmpty(responseText)){ + var result = Ext.decode(responseText); + if(!result.success){ + showResultQM("请输入正确的人员条码!"); + return; + } + Ext.getCmp('responsiblePerson').setValue(result.fullName); + }else{ + showResultQM('找不到该条码所对应的人员信息'); + } + }); +} + +//扫描标识牌/器械包条码 +function loadRecyclePersonByBarcode(barcode){ + if(isUndefinedOrNullOrEmpty(barcode)){ + showResultQM('条码不能为空!'); + return ; } - 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; - Ext.getCmp('material').setValue(mateialName); - Ext.getCmp('materialAmount').setValue(amount); - Ext.getCmp('position').setValue(position); - }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); - } + + Ext.Ajax.request({ + url : WWWROOT + '/disinfectSystem/qualityMonitoringInstanceAction!scanBarcodeForTousseInfo.do', + params : { + barcode : barcode + }, + success : function(response,options){ + var result = Ext.decode(response.responseText); + if(result.success == true){//赋值 + Ext.getCmp("tousseNameBasics").setValue(result.data.tousseInstanceName); + Ext.getCmp("scanTousseInstance_id").setValue(result.data.tousseInstanceId); + Ext.getCmp("recyclePerson").setValue(result.data.recyclingRecordJSON.reUser); + Ext.getCmp("recycleDepartments").setValue(result.data.recyclingRecordJSON.reDept); + Ext.getCmp("operationRoom").setValue(result.data.recyclingRecordJSON.lastUseRecordOperationRoom); + Ext.getCmp("nurse").setValue(result.data.recyclingRecordJSON.lastUseRecordCircuitNurse);; + Ext.getCmp("recycleTime").setValue(result.data.recyclingRecordJSON.reTime); + }else{ + showResultQM(result.message); + Ext.getCmp("tousseNameBasics").setValue(""); + Ext.getCmp("recyclePerson").setValue(""); + Ext.getCmp("recycleDepartments").setValue(""); + Ext.getCmp("operationRoom").setValue(""); + Ext.getCmp("nurse").setValue(""); + Ext.getCmp("scanTousseInstance_id").setValue(""); + Ext.getCmp("recycleTime").setValue(""); + } + }, + failure : function(response, options) { + //showResultQM("该条码不是标识牌/器械包条码,请扫描标识牌/器械包条码"); + } + }); +} + + +function loadSterilizationByBarcode(barcode){ + if(isUndefinedOrNullOrEmpty(barcode)){ + showResultQM('条码不能为空!'); + return ; } -} - -/** - * 整炉的时候设置“重新回收”和“重新装配”两个选项. - * @param qualityMonitoringInstance 质量监测记录对象 + + Ext.Ajax.request({ + url : WWWROOT + '/disinfectSystem/qualityMonitoringInstanceAction!scanBarcodeForTousseInfo.do', + params : { + barcode : barcode + }, + success : function(response,options){ + var result = Ext.decode(response.responseText); + if(result.success == true){//赋值 + Ext.getCmp("sterilizationName").setValue(result.data.sterilizationRecordJSON.sterilizerName); + Ext.getCmp("scanTousseInstance_id").setValue(result.data.tousseInstanceId); + Ext.getCmp("sterilizationProgramName").setValue(result.data.sterilizationRecordJSON.sterilizationType); + Ext.getCmp("heat").setValue(result.data.sterilizationRecordJSON.frequency); + Ext.getCmp("sterilizationStartTime").setValue(result.data.sterilizationRecordJSON.startDate); + Ext.getCmp("sterilizationEndTime").setValue(result.data.sterilizationRecordJSON.endDate); + }else{ + showResultQM(result.message); + Ext.getCmp("sterilizationName").setValue(""); + Ext.getCmp("sterilizationProgramName").setValue(""); + Ext.getCmp("heat").setValue(""); + Ext.getCmp("sterilizationStartTime").setValue(""); + Ext.getCmp("sterilizationEndTime").setValue(""); + Ext.getCmp("scanTousseInstance_id").setValue(""); + } + }, + failure : function(response, options) { + + } + }); +} +function checkIsUniqueWithBarcodeAndInspectItemAndSubmitForm(thiz,id,barcode,formDefinitionId,materialInfo,saveAndCreate){ + if(barcode && formDefinitionId){ + Ext.Ajax.request({ + url : WWWROOT + '/disinfectSystem/qualityMonitoringInstanceAction!checkIsUniqueWithBarcodeAndInspectItem.do', + params : { + id : id, + barcode : barcode, + formDefinitionId : formDefinitionId + }, + success : function(response,options){ + var result = Ext.decode(response.responseText); + if(!result.isUnique){ + showResultQM("当前器械包所对应的检测项已存在"); + thiz.enable(); + return false; + } + submitForm2(materialInfo,saveAndCreate); + }, + failure : function(response, options) { + showResultQM('系统加载出错,请稍候再试'); + } + }); + }else{ + submitForm2(materialInfo,saveAndCreate); + } +} + +/** + * 校验是否有包实例已经重新装配过,如果已经装配过则不允许再次装配了,如果校验通过则提交. + * @param thiz 按钮对象 + * @param materialInfo 材料信息 + * @param saveAndCreate 是否为“保存并新建”操作 */ -function setIsRecycleAndIsRepackingForWholeFurnace(qualityMonitoringInstance) { - if (qualityMonitoringInstance.isAllTousseOfSterile == '是') { //是整炉 - if('是'==qualityMonitoringInstance.isRecycle){ - Ext.getCmp('isRecycle').setValue(qualityMonitoringInstance.isRecycle); - Ext.getCmp('isRepacking').setValue('否'); - - Ext.getCmp('recycle').setValue(true); - Ext.getCmp('repacking').setValue(false); - }else if('是'==qualityMonitoringInstance.isRepacking){ - Ext.getCmp('isRecycle').setValue('否'); - Ext.getCmp('isRepacking').setValue(qualityMonitoringInstance.isRepacking); - - Ext.getCmp('recycle').setValue(false); - Ext.getCmp('repacking').setValue(true); - }else{ - Ext.getCmp('isRecycle').setValue('否'); - Ext.getCmp('isRepacking').setValue('否'); - Ext.getCmp('recycle').setValue(false); - Ext.getCmp('repacking').setValue(false); - } - } + +function checkIsTousseInstanceRepackingAndSubmitForm(thiz,materialInfo,saveAndCreate){ + var barcodes = getScanRepacingTiBarcodes(); + Ext.Ajax.request({ + url : WWWROOT + '/disinfectSystem/qualityMonitoringInstanceAction!checkIsTousseInstanceRepacking.do', + params : { + barcodes : barcodes + }, + success : function(response,options){ + var result = Ext.decode(response.responseText); + if(result.haveRepacking){ + showResultQM("扫描的器械包已经重新装配!"); + thiz.enable(); + return false; + } + submitForm2(materialInfo,saveAndCreate); + }, + failure : function(response, options) { + showResultQM('系统加载出错,请稍候再试'); + } + }); } -//监测范围是器械包和材料,加载器械包和材料信息 -function loadMateriaAndTousselMsg(qualityMonitoringInstance, qualityMonitoringGoodsList){ - setIsRecycleAndIsRepackingForWholeFurnace(qualityMonitoringInstance); - - if(qualityMonitoringGoodsList == null || qualityMonitoringGoodsList == '' || qualityMonitoringGoodsList.length == 0){ - return ; - } - for(var i = 0 ;i < qualityMonitoringGoodsList.length ;i++){ - var orderNumber = qualityMonitoringGoodsList[i].orderNumber; - if(orderNumber == 1){ - // 第一个是器械包 - var barcode = qualityMonitoringGoodsList[i].barcode; - var tousseInstanceId = qualityMonitoringGoodsList[i].tousseInstanceId; - var tousseName = qualityMonitoringGoodsList[i].tousseName; - var amount = qualityMonitoringGoodsList[i].amount; - Ext.getCmp('tousseInstanceId').setValue(tousseInstanceId); - Ext.getCmp('tempBarcode').setValue(barcode); - Ext.getCmp('tousseName').setValue(tousseName); - Ext.getCmp('tousseAmount').setValue(amount); - if('是'==qualityMonitoringGoodsList[i].isRecycle){ - Ext.getCmp('isRecycle').setValue(qualityMonitoringGoodsList[i].isRecycle); - Ext.getCmp('isRepacking').setValue('否'); - - Ext.getCmp('recycle').setValue(true); - Ext.getCmp('repacking').setValue(false); - }else if('是'==qualityMonitoringGoodsList[i].isRepacking){ - Ext.getCmp('isRecycle').setValue('否'); - Ext.getCmp('isRepacking').setValue(qualityMonitoringGoodsList[i].isRepacking); - - Ext.getCmp('recycle').setValue(false); - Ext.getCmp('repacking').setValue(true); - }else{ - Ext.getCmp('isRecycle').setValue('否'); - Ext.getCmp('isRepacking').setValue('否'); - Ext.getCmp('recycle').setValue(false); - Ext.getCmp('repacking').setValue(false); - } - }else if(orderNumber == 2){ - var mateialName = qualityMonitoringGoodsList[i].material; - var amount = qualityMonitoringGoodsList[i].amount; - var position = qualityMonitoringGoodsList[i].position; - Ext.getCmp('material').setValue(mateialName); - Ext.getCmp('materialAmount').setValue(amount); - Ext.getCmp('position').setValue(position); - }else { - var tousseName = qualityMonitoringGoodsList[i].tousseName; - var mateialName = qualityMonitoringGoodsList[i].material; - if(tousseName != null && tousseName != ''){ - // 添加器械包 - var barcode = qualityMonitoringGoodsList[i].barcode; - var tousseInstanceId = qualityMonitoringGoodsList[i].tousseInstanceId; - var amount = qualityMonitoringGoodsList[i].amount; - var orderNumber = qualityMonitoringGoodsList[i].orderNumber; - var isRecycle = qualityMonitoringGoodsList[i].isRecycle; - var isRePacking = qualityMonitoringGoodsList[i].isRepacking; - addExtractCheckTousse(tousseName,barcode,tousseInstanceId,amount,orderNumber,isRecycle,isRePacking); - }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); - } - } - } +function checkIsTousseInstanceRepackingAndSubmitFormNew(thiz,tousseAndMaterialAll,saveAndCreate){ + var barcodes = getScanRepacingTiBarcodes(); + Ext.Ajax.request({ + url : WWWROOT + '/disinfectSystem/qualityMonitoringInstanceAction!checkIsTousseInstanceRepacking.do', + params : { + barcodes : barcodes + }, + success : function(response,options){ + var result = Ext.decode(response.responseText); + if(result.haveRepacking){ + showResultQM("扫描的器械包已经重新装配!"); + thiz.enable(); + return false; + } + submitFormNew2(tousseAndMaterialAll,saveAndCreate); + }, + failure : function(response, options) { + showResultQM('系统加载出错,请稍候再试'); + } + }); } -/** - * 初始化Store. - */ -function initStore(){ - materialDefinitionStore = new Ext.data.Store({ - proxy : new Ext.data.HttpProxy({ - url : WWWROOT + '/disinfectSystem/baseData/materialDefinitionAction!getMaterialDefinitionDataIncludeForeignMD.do?selectType=material', - method : 'POST' - }), - reader : new Ext.data.JsonReader({ - totalProperty : 'totalCount', - root : 'data' - }, [ - {name : 'id',mapping : 'id'}, - {name : 'spelling',mapping : 'spelling'}, - {name : 'name',mapping : 'name'}, - {name : 'count',mapping : 'count'} - ]), - listeners : { - beforeload : function(thiz, options){ - thiz.baseParams['tousseDefinitionId'] = Ext.getCmp('tousseDefinitionId').getValue(); - } - } - }); - materialDefinitionAddStore = new Ext.data.Store({ - proxy : new Ext.data.HttpProxy({ - url : WWWROOT + '/disinfectSystem/baseData/materialDefinitionAction!getMaterialDefinitionDataIncludeForeignMD.do?selectType=material', - method : 'POST' - }), - reader : new Ext.data.JsonReader({ - totalProperty : 'totalCount', - root : 'data' - }, [ - {name : 'id',mapping : 'id'}, - {name : 'spelling',mapping : 'spelling'}, - {name : 'name',mapping : 'name'}, - {name : 'count',mapping : 'count'} - ]) - }); - tousseDefinitionStore = new Ext.data.Store({ - proxy : new Ext.data.HttpProxy({ - url : WWWROOT + '/disinfectSystem/baseData/tousseDefinitionAction!getTousseAndDiposableGoodsData.do?type='+encodeURI('器械包和外来器械包'), - method : 'POST' - }), - reader : new 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'}] - ) - }); - - formDefinitionStore = new Ext.data.Store({ - proxy : new Ext.data.HttpProxy({ - url : WWWROOT + '/disinfectSystem/qualityMonitoringDefinitionAction!loadLastDeployFormDefinitionGroupByFormName.do', - method : 'POST' - }), - baseParams:{formType : qmFormType}, - reader : new Ext.data.JsonReader({ - root : 'data' - },[ - {name : 'id'}, - {name : 'name'} - ] - ), - listeners:{ - load:function(store,records) { - if( otherPartAddQM == true ){ - if(records.length>0) { - Ext.getCmp('formName').setValue(records[0].data.name); - addQualityMonitoringItem(records[0].data.id,records[0].data.name); - Ext.getCmp("formDefinitionId").setValue(records[0].data.id); - Ext.getCmp("name").setValue(records[0].data.name); - }else{ - // 没有找到监测项 - Ext.getCmp('formName').setValue(''); - } - } - // 加载监测项对所选的项赋初值,只是从其他环节进来执行一次. - otherPartAddQM = false; - } - } - }); - - frequencyStore = new Ext.data.Store({ - proxy : new Ext.data.HttpProxy({ - url : WWWROOT + '/disinfectSystem/sterilization/sterilizationRecordAction!getFrequency.do?', - method : 'POST' - }), - baseParams:{sterilizerDate : ""}, - reader : new Ext.data.JsonReader({ - root : 'data' - },[ - {name : 'value'}, - ] - ) - }); -} -/** - * 创建质量监测实例的表单. - * @param id 质量监测实例id - * @returns {Ext.FormPanel} - */ -function getFormPanelContent(id){ - initStore(); - if(recycleQM == true){ - disableShowImageButton = true; - } - var varibaleContent1; - var varibaleContent2; - // 责任环节带出监测项 - if(sstsConfig.hasOwnProperty('responsibilityPartBringInspectItem') && sstsConfig.responsibilityPartBringInspectItem){ - varibaleContent1 = getResponsibilityPartContent(id); - varibaleContent2 = getInspectItemContent(id); - }else{ - varibaleContent1 = getInspectItemContent(id); - varibaleContent2 = getResponsibilityPartContent(id); - } - formPanel = new Ext.FormPanel({ - 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: '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'}, - - varibaleContent1, - varibaleContent2, - { - layout : 'form', - columnWidth : .5, - labelWidth : 90, - 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 : 90, - items : [{ - xtype : 'textfield', - name : 'createUserName', - id : 'createUserName', - fieldLabel : "登记人", - anchor : '95%', - readOnly : true, - value : userName - }] - },{ - layout : 'form', - columnWidth : .5, - labelWidth : 90, - items : [{ - xtype : 'textfield', - name : 'responsiblePersonBarcode', - id : 'responsiblePersonBarcode', - fieldLabel : "扫描责任人条码", - listeners : { - specialkey : function(field,e){ - if(e.getKey() == 13){ - var barcodeValue = field.getValue(); - Ext.getCmp("responsiblePersonBarcode").setValue(''); - loadResponPersonByBarcode(barcodeValue); - } - } - }, - anchor : '95%' - }] - },{ - layout : 'form', - columnWidth : .5, - labelWidth : 90, - items : [{ - xtype : 'textfield', - name : 'responsiblePerson', - id : 'responsiblePerson', - fieldLabel : "责任人", - anchor : '95%' - }] - },{ - id:'insertBasket', - name:'insertBasket', - layout : 'form', - columnWidth : .5, - labelWidth : 90, - items : [{ - xtype : 'textfield', - name : 'scanBarcode', - id : 'scanBarcode', - fieldLabel : "清洗篮筐条码", - listeners : { - specialkey : function(field,e){ - if(e.getKey() == 13){ - var barcodeValue = field.getValue(); - Ext.getCmp("scanBarcode").setValue(''); - ContainerTableManager.getBasketByBarcodeAndProcedures(barcodeValue,basketAllowProcedure,function(jsonStr){ - var obj = Ext.util.JSON.decode(jsonStr); - if(obj.success){ - Ext.getCmp('containerName').setValue(obj.containerName); - }else{ - showResultQM(obj.message); - } - Ext.getCmp("containerBarcode").setValue(barcodeValue); - }); - } - } - }, - anchor : '95%' - }] - },{ - id:'containerNameItem', - name:'containerNameItem', - layout : 'form', - columnWidth : .5, - labelWidth : 90, - items : [{ - xtype : 'textfield', - name : 'containerName', - id : 'containerName', - fieldLabel : "清洗篮筐名称", - readOnly:true, - allowBlank:true, - anchor : '95%' - }] - },{ - layout : 'form', - columnWidth : 1, - labelWidth : 90, - items : [ { - xtype : 'textarea', - name : 'remark', - id : 'remark', - width : 150, - height : 50, - fieldLabel : "备注", - anchor : '97%' - }] - },{ - layout : 'column', - columnWidth : 1, - labelWidth : 90, - items : [ - { - layout : 'form', - columnWidth : 0.8, - labelWidth : 90, - items : [ - { - xtype : 'textfield', - name : 'uploadImage', - id : 'uploadImage', - fieldLabel : "上传图片", - anchor : '100%' - } - ] - }, - { - layout : 'form', - columnWidth : 0.08, - labelWidth : 90, - items : [ - { xtype:'button', - text : '上传', - handler : function(){ - if(id == null || id == ''){ - showResultQM("请先保存后再上传图片!"); - }else{ - uploadWindowA(imageType_qualitymonitoring,id); - } + +// 监测范围是器械包,加载器械包 +function loadTousseMsg(qualityMonitoringInstance, qualityMonitoringGoodsList){ + setIsRecycleAndIsRepackingForWholeFurnace(qualityMonitoringInstance); + if(qualityMonitoringGoodsList == null || qualityMonitoringGoodsList == '' || qualityMonitoringGoodsList.length == 0){ + return ; + } + 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; + var amount = qualityMonitoringGoodsList[i].amount; + Ext.getCmp('tousseInstanceId').setValue(tousseInstanceId); + Ext.getCmp('tempBarcode').setValue(barcode); + Ext.getCmp('tousseName').setValue(tousseName); + Ext.getCmp('tousseAmount').setValue(amount); + if('是'==qualityMonitoringGoodsList[i].isRecycle){ + Ext.getCmp('isRecycle').setValue(qualityMonitoringGoodsList[i].isRecycle); + Ext.getCmp('isRepacking').setValue('否'); + Ext.getCmp('recycle').setValue(true); + Ext.getCmp('repacking').setValue(false); + }else if('是'==qualityMonitoringGoodsList[i].isRepacking){ + Ext.getCmp('isRecycle').setValue('否'); + Ext.getCmp('isRepacking').setValue(qualityMonitoringGoodsList[i].isRepacking); + Ext.getCmp('recycle').setValue(false); + Ext.getCmp('repacking').setValue(true); + }else{ + Ext.getCmp('isRecycle').setValue('否'); + Ext.getCmp('isRepacking').setValue('否'); + Ext.getCmp('recycle').setValue(false); + Ext.getCmp('repacking').setValue(false); + } + }else{ + var barcode = qualityMonitoringGoodsList[i].barcode; + var tousseInstanceId = qualityMonitoringGoodsList[i].tousseInstanceId; + var tousseName = qualityMonitoringGoodsList[i].tousseName; + var amount = qualityMonitoringGoodsList[i].amount; + var orderNumber = qualityMonitoringGoodsList[i].orderNumber; + var isRecycle = qualityMonitoringGoodsList[i].isRecycle; + var isRePacking = qualityMonitoringGoodsList[i].isRepacking; + addExtractCheckTousse(tousseName,barcode,tousseInstanceId,amount,orderNumber,isRecycle,isRePacking,"","","","",true); + } + } +} + +//监测范围是材料,加载材料信息 +function loadMaterialMsg(qualityMonitoringGoodsList){ + if(qualityMonitoringGoodsList == null || qualityMonitoringGoodsList == '' || qualityMonitoringGoodsList.length == 0){ + return ; + } + 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; + Ext.getCmp('material').setValue(mateialName); + Ext.getCmp('materialAmount').setValue(amount); + Ext.getCmp('position').setValue(position); + positionlabelWFlag = true; + }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); + } + } +} + +/** + * 整炉的时候设置“重新回收”和“重新装配”两个选项. + * @param qualityMonitoringInstance 质量监测记录对象 + */ +function setIsRecycleAndIsRepackingForWholeFurnace(qualityMonitoringInstance) { + if (qualityMonitoringInstance.isAllTousseOfSterile == '是') { //是整炉 + if('是'==qualityMonitoringInstance.isRecycle){ + Ext.getCmp('isRecycle').setValue(qualityMonitoringInstance.isRecycle); + Ext.getCmp('isRepacking').setValue('否'); + + Ext.getCmp('recycle').setValue(true); + Ext.getCmp('repacking').setValue(false); + }else if('是'==qualityMonitoringInstance.isRepacking){ + Ext.getCmp('isRecycle').setValue('否'); + Ext.getCmp('isRepacking').setValue(qualityMonitoringInstance.isRepacking); + + Ext.getCmp('recycle').setValue(false); + Ext.getCmp('repacking').setValue(true); + }else{ + Ext.getCmp('isRecycle').setValue('否'); + Ext.getCmp('isRepacking').setValue('否'); + Ext.getCmp('recycle').setValue(false); + Ext.getCmp('repacking').setValue(false); + } + } +} + + +//监测范围是器械包和材料,加载器械包和材料信息 +function loadMateriaAndTousselMsg(qualityMonitoringInstance, qualityMonitoringGoodsList){ + setIsRecycleAndIsRepackingForWholeFurnace(qualityMonitoringInstance); + + if(qualityMonitoringGoodsList == null || qualityMonitoringGoodsList == '' || qualityMonitoringGoodsList.length == 0){ + return ; + } + for(var i = 0 ;i < qualityMonitoringGoodsList.length ;i++){ + var orderNumber = qualityMonitoringGoodsList[i].orderNumber; + if(orderNumber == 1){ + // 第一个是器械包 + var barcode = qualityMonitoringGoodsList[i].barcode; + var tousseInstanceId = qualityMonitoringGoodsList[i].tousseInstanceId; + var tousseName = qualityMonitoringGoodsList[i].tousseName; + var amount = qualityMonitoringGoodsList[i].amount; + Ext.getCmp('tousseInstanceId').setValue(tousseInstanceId); + Ext.getCmp('tempBarcode').setValue(barcode); + Ext.getCmp('tousseName').setValue(tousseName); + Ext.getCmp('tousseAmount').setValue(amount); + if('是'==qualityMonitoringGoodsList[i].isRecycle){ + Ext.getCmp('isRecycle').setValue(qualityMonitoringGoodsList[i].isRecycle); + Ext.getCmp('isRepacking').setValue('否'); + + Ext.getCmp('recycle').setValue(true); + Ext.getCmp('repacking').setValue(false); + }else if('是'==qualityMonitoringGoodsList[i].isRepacking){ + Ext.getCmp('isRecycle').setValue('否'); + Ext.getCmp('isRepacking').setValue(qualityMonitoringGoodsList[i].isRepacking); + + Ext.getCmp('recycle').setValue(false); + Ext.getCmp('repacking').setValue(true); + }else{ + Ext.getCmp('isRecycle').setValue('否'); + Ext.getCmp('isRepacking').setValue('否'); + Ext.getCmp('recycle').setValue(false); + Ext.getCmp('repacking').setValue(false); + } + }else if(orderNumber == 2){ + var mateialName = qualityMonitoringGoodsList[i].material; + var amount = qualityMonitoringGoodsList[i].amount; + var position = qualityMonitoringGoodsList[i].position; + Ext.getCmp('material').setValue(mateialName); + Ext.getCmp('materialAmount').setValue(amount); + Ext.getCmp('position').setValue(position); + positionlabelWFlag = true; + }else { + var tousseName = qualityMonitoringGoodsList[i].tousseName; + var mateialName = qualityMonitoringGoodsList[i].material; + if(tousseName != null && tousseName != ''){ + // 添加器械包 + var barcode = qualityMonitoringGoodsList[i].barcode; + var tousseInstanceId = qualityMonitoringGoodsList[i].tousseInstanceId; + var amount = qualityMonitoringGoodsList[i].amount; + var orderNumber = qualityMonitoringGoodsList[i].orderNumber; + var isRecycle = qualityMonitoringGoodsList[i].isRecycle; + var isRePacking = qualityMonitoringGoodsList[i].isRepacking; + addExtractCheckTousse(tousseName,barcode,tousseInstanceId,amount,orderNumber,isRecycle,isRePacking,"","","","",true); + }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); + } + } + } +} + +/** + * 初始化Store. + */ +function initStore(){ + materialDefinitionStore = new Ext.data.Store({ + proxy : new Ext.data.HttpProxy({ + url : WWWROOT + '/disinfectSystem/baseData/materialDefinitionAction!getMaterialDefinitionDataIncludeForeignMD.do?selectType=material', + method : 'POST' + }), + reader : new Ext.data.JsonReader({ + totalProperty : 'totalCount', + root : 'data' + }, [ + {name : 'id',mapping : 'id'}, + {name : 'spelling',mapping : 'spelling'}, + {name : 'name',mapping : 'name'}, + {name : 'count',mapping : 'count'} + ]), + listeners : { + beforeload : function(thiz, options){ + thiz.baseParams['tousseDefinitionId'] = Ext.getCmp('tousseDefinitionId').getValue(); + } + } + }); + materialDefinitionAddStore = new Ext.data.Store({ + proxy : new Ext.data.HttpProxy({ + url : WWWROOT + '/disinfectSystem/baseData/materialDefinitionAction!getMaterialDefinitionDataIncludeForeignMD.do?selectType=material', + method : 'POST' + }), + reader : new Ext.data.JsonReader({ + totalProperty : 'totalCount', + root : 'data' + }, [ + {name : 'id',mapping : 'id'}, + {name : 'spelling',mapping : 'spelling'}, + {name : 'name',mapping : 'name'}, + {name : 'count',mapping : 'count'} + ]) + }); + tousseDefinitionStore = new Ext.data.Store({ + proxy : new Ext.data.HttpProxy({ + url : WWWROOT + '/disinfectSystem/baseData/tousseDefinitionAction!getTousseAndDiposableGoodsData.do?type='+encodeURI('器械包和外来器械包'), + method : 'POST' + }), + reader : new 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'}] + ) + }); + + formDefinitionStore = new Ext.data.Store({ + proxy : new Ext.data.HttpProxy({ + url : WWWROOT + '/disinfectSystem/qualityMonitoringDefinitionAction!loadLastDeployFormDefinitionGroupByFormName.do', + method : 'POST' + }), + baseParams:{formType : qmFormType}, + reader : new Ext.data.JsonReader({ + root : 'data' + },[ + {name : 'id'}, + {name : 'name'} + ] + ), + listeners:{ + load:function(store,records) { + if( otherPartAddQM == true ){ + if(records.length>0) { + Ext.getCmp('formName').setValue(records[0].data.name); + addQualityMonitoringItem(records[0].data.id,records[0].data.name); + Ext.getCmp("formDefinitionId").setValue(records[0].data.id); + Ext.getCmp("name").setValue(records[0].data.name); + }else{ + // 没有找到监测项 + Ext.getCmp('formName').setValue(''); + } + } + // 加载监测项对所选的项赋初值,只是从其他环节进来执行一次. + otherPartAddQM = false; + } + } + }); + + frequencyStore = new Ext.data.Store({ + proxy : new Ext.data.HttpProxy({ + url : WWWROOT + '/disinfectSystem/sterilization/sterilizationRecordAction!getFrequency.do?', + method : 'POST' + }), + baseParams:{sterilizerDate : ""}, + reader : new Ext.data.JsonReader({ + root : 'data' + },[ + {name : 'value'}, + ] + ) + }); +} + +/** + * 创建质量监测实例的表单. + * @param id 质量监测实例id + * @returns {Ext.FormPanel} + */ +function getFormPanelContent(id){ + initStore(); + if(recycleQM == true){ + disableShowImageButton = true; + } + var varibaleContent1; + var varibaleContent2; + // 责任环节带出监测项 + if(sstsConfig.hasOwnProperty('responsibilityPartBringInspectItem') && sstsConfig.responsibilityPartBringInspectItem){ + varibaleContent1 = getResponsibilityPartContent(id); + varibaleContent2 = getInspectItemContent(id); + }else{ + varibaleContent1 = getInspectItemContent(id); + varibaleContent2 = getResponsibilityPartContent(id); + } + formPanel = new Ext.FormPanel({ + 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: '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 : 90, + 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 : 90, + height:setH, + items : [{ + xtype : 'textfield', + name : 'createUserName', + id : 'createUserName', + fieldLabel : "登记人", + anchor : '95%', + readOnly : true, + value : userName + }] + },{ + layout : 'form', + columnWidth : .5, + labelWidth : 90, + height:setH, + items : [{ + xtype : 'textfield', + name : 'responsiblePersonBarcode', + id : 'responsiblePersonBarcode', + fieldLabel : "扫描责任人条码", + listeners : { + specialkey : function(field,e){ + if(e.getKey() == 13){ + var barcodeValue = field.getValue(); + Ext.getCmp("responsiblePersonBarcode").setValue(''); + loadResponPersonByBarcode(barcodeValue); + } + } + }, + anchor : '95%' + }] + },{ + layout : 'form', + columnWidth : .5, + labelWidth : 90, + height:setH, + items : [{ + xtype : 'textfield', + name : 'responsiblePerson', + id : 'responsiblePerson', + fieldLabel : "责任人", + anchor : '95%' + }] + },{ + id:'insertBasket', + name:'insertBasket', + layout : 'form', + columnWidth : .5, + labelWidth : 90, + height:setH, + items : [{ + xtype : 'textfield', + name : 'scanBarcode', + id : 'scanBarcode', + fieldLabel : "回收篮筐条码", + listeners : { + specialkey : function(field,e){ + if(e.getKey() == 13){ + var barcodeValue = field.getValue(); + Ext.getCmp("scanBarcode").setValue(''); + ContainerTableManager.getBasketByBarcodeAndProcedures(barcodeValue,basketAllowProcedure,function(jsonStr){ + var obj = Ext.util.JSON.decode(jsonStr); + if(obj.success){ + Ext.getCmp('containerName').setValue(obj.containerName); + }else{ + showResultQM(obj.message); + } + Ext.getCmp("containerBarcode").setValue(barcodeValue); + }); + } + } + }, + anchor : '95%' + }] + },{ + id:'containerNameItem', + name:'containerNameItem', + layout : 'form', + columnWidth : .5, + height:setH, + labelWidth : 90, + items : [{ + xtype : 'textfield', + name : 'containerName', + id : 'containerName', + fieldLabel : "回收篮筐名称", + readOnly:true, + allowBlank:true, + anchor : '95%' + }] + },{ + id:'rinseBasketsBarcodeWrapper', + name:'rinseBasketsBarcodeWrapper', + layout : 'form', + columnWidth : .5, + labelWidth : 90, + 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(); + Ext.getCmp("rinseBasketsBarcode").setValue(''); + Ext.Ajax.request( { + url : WWWROOT + '/disinfectSystem/qualityMonitoringInstanceAction!scanBasketBarcodeForWashRecord.do', + params : {basketBarcode : barcodeValue}, + success : function(response, options) { + var result = Ext.decode(response.responseText); + if(result.success == false){ + showResult(result.message); + }else{ + loadScanBarcodeMsg('rinseBasketsName','cleaningMachinePosition','cleaningMachineDate','cleaningMachineName','cleaningMachineProgramName','cleaningStartTime','cleaningEndTime','scanWashRecord_id',barcodeValue); } + }, + failure : function(response, options) { + } - ] - }, - { - layout : 'form', - columnWidth : 0.12, - labelWidth : 90, - items : [ - { xtype:'button', - text : '预览', - disabled:disableShowImageButton, - iconCls : 'btn_ext_application_search', - handler : function(){ - showUploadImageWin(id); - } - } - ] - } - ] - }] - }], - buttons : [{ - id : 'addExtractCheckTousse', - text : '添加抽检器械包', - handler : function(){ - addExtractCheckTousse(); - } - },{ - id : 'addExtractCheckMaterial', - text : '添加抽检器械', - handler : function(){ - addExtractCheckMaterial(); - } - },{ - id : 'saveBtn', - text : '   保存    ', - handler : function(){ - saveQualityMonitoring(this,materialDefinitionStore,false); - } - },{ - id : 'saveAndCreateBtn', - text : '保存并新建', - handler : function(){ - saveQualityMonitoring(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:'setLayout', - items : [{ - layout : 'form', - columnWidth : 1, + }); + + } + } + }, + anchor : '95%' + }] + },{ + id:'rinseBasketsNameWrapper', + name:'rinseBasketsNameWrapper', + layout : 'form', + columnWidth : .5, + height:setH, labelWidth : 90, - items : [{ - id : 'allTousseOfSterile', - name : 'allTousseOfSterile', - fieldLabel : '是否整炉', - xtype : 'checkbox', - inputValue : '是否整炉', - listeners:{ - check:function( thiz, checked ){ - if(checked){ - Ext.getCmp('isAllTousseOfSterile').setValue('是'); - }else{ - Ext.getCmp('isAllTousseOfSterile').setValue('否'); - } - updateControlStatus(); - } - } - }] - },{ - layout : 'form', - columnWidth : .5, - id : 'recycleC', - labelWidth : 90, - items : [{ - id : 'recycle', - name : 'recycle', - fieldLabel : '重新回收', - xtype : 'checkbox', - inputValue : '重新回收', - listeners:{ - check:function( thiz, checked ){ - if(checked){ - Ext.getCmp('isRecycle').setValue('是'); - Ext.getCmp('repacking').setValue(false); - }else{ - Ext.getCmp('isRecycle').setValue('否'); - } - } - } - }] - },{ - layout : 'form', - columnWidth : .5, - id : 'repackingC', - labelWidth : 90, - items : [{ - id : 'repacking', - name : 'repacking', - fieldLabel : '重新装配', - xtype : 'checkbox', - inputValue : '重新装配', - listeners:{ - check:function( thiz, checked ){ - if(checked){ - Ext.getCmp('isRepacking').setValue('是'); - Ext.getCmp('recycle').setValue(false); - }else{ - Ext.getCmp('isRepacking').setValue('否'); - } - } - } - }] - - },{ - layout : 'column', - columnWidth : 1, - labelWidth : 90, - id: 'tosseAndMaterial', - items : [{ - layout : 'form', - id : 'tousseBarcodeC', - labelWidth : 90, - columnWidth : .5, - items : [{ - xtype : 'textfield', - name : 'tempBarcode', - id : 'tempBarcode', - fieldLabel : "器械包条码", - listeners : { - specialkey : function(field,e){ - if(e.getKey() == 13){ - getTousseInstanceNameAndResponsiblePerson(field.getValue(), Ext.getCmp('formDefinitionId').getValue(), materialDefinitionStore); - field.setValue(''); - } - } - }, - anchor : '95%' - }] - },{ - layout : 'form', - id : 'tousseNameC', - labelWidth : 90, - columnWidth : .5, - 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); - Ext.getCmp('tousseDefinitionId').setValue(record.data.id); - //加载责任人 - - }, - blur : function(field){ - if(!Ext.getCmp('tousseName').getRawValue()){ - Ext.getCmp('tousseDefinitionId').setValue(''); - } - //重新加载包内的材料 - materialDefinitionStore.reload(); - } - } - }] - },{ - layout : 'form', - id : 'tousseAmountC', - labelWidth : 90, - columnWidth : .51, - items : [{ - xtype : 'numberfield', - allowDecimals : false, - name : 'tousseAmount', - id : 'tousseAmount', - fieldLabel : "器械包数量", - allowBlank : true, - blankText : '数量不能为空', - anchor : '95%' - }] - },{ - layout : 'form', - id : 'materialC', - columnWidth : .5, - 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', - id : 'materialAmountC', - columnWidth : .5, - labelWidth : 90, - 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 : .5, - 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 : .5, - labelWidth : 90, - 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() { - // this.value 2017-2-2 - Ext.getCmp('sterilizerFre').setValue(""); - frequencyStore.baseParams.sterilizerDate = this.value; - var name = Ext.getCmp('sterilizerName').getValue(); - frequencyStore.baseParams.sterilizerName = name; - frequencyStore.load(); - } - } - }] - },{ - layout : 'form', - columnWidth : .5, - labelWidth : 90, - items : [{ - xtype : 'combo', - id : 'sterilizerName', - name : 'sterilizerName', - fieldLabel : '灭菌炉号', - queryParam : 'spell', - minChars : 0, - valueField : 'name', - displayField : 'name', - store : new Ext.data.SimpleStore({ - fields : [ 'name' ], - url : WWWROOT + '/disinfectSystem/baseData/sterilizerAction!getAllSterilizer.do?' - }), - forceSelection : true, - lazyInit : true, - triggerAction : 'all', - hideTrigger : false, - typeAhead : false, - anchor : '95%', - listeners : { - select : function(combo, record, index) { - // record.data.name 选择的值 - Ext.getCmp('sterilizerFre').setValue(""); - frequencyStore.baseParams.sterilizerName = record.data.name; - var date = Ext.getCmp('srDateTime').getRawValue(); - frequencyStore.baseParams.sterilizerDate = date; - frequencyStore.load(); - } - } - }] - },{ - layout : 'form', - columnWidth : .5, - labelWidth : 90, - items : [{ - xtype : 'combo', - id : 'sterilizerFre', - name : 'sterilizerFre', - fieldLabel : '炉次', - queryParam : 'spell', - minChars : 0, - valueField : 'value', - displayField : 'value', - store : frequencyStore, - forceSelection : true, - lazyInit : true, - triggerAction : 'all', - hideTrigger : false, - typeAhead : false, - anchor : '95%' - }] - }] - }] - }); - return formPanel; -} -function recycleAddQualityMonitoringDo(errorDamageQmKey){ - setStartDate(Ext, 'yyyy/MM/dd HH:mm', 'dateTime'); //(设置抽检时间,取服务器时间 cjr) - disableRecycleAndRepacking(); - var responPartName = "回收清点"; - Ext.getCmp('responsibilityPart').setValue(responPartName); - if(sstsConfig.hasOwnProperty('responsibilityPartNotLimitInspect') && sstsConfig.responsibilityPartNotLimitInspect){ - formDefinitionStore.baseParams.responsiblePerson = responPartName; - //formDefinitionStore.baseParams.isNotLimitInspect = "是"; - formDefinitionStore.load(); - }else{ - formDefinitionStore.baseParams.responsiblePerson = responPartName; - formDefinitionStore.load(); - } - if(!isUndefinedOrNullOrEmpty(errorDamageQmKey)){ - Ext.getCmp("errorDamageQmKey").setValue(errorDamageQmKey); - }else{ - Ext.getCmp("errorDamageQmKey").setValue(""); - } -// formDefinitionStore.baseParams.responsiblePerson = "回收清点"; -// formDefinitionStore.load(); -} - -function showResultQM(msg){ - if(recycleQM == true){ - showResultCurPage(msg); - }else{ - showResult(msg); - } -} + hidden:true, + items : [{ + xtype : 'textfield', + name : 'rinseBasketsName', + id : 'rinseBasketsName', + fieldLabel : "清洗篮筐名称", + readOnly:true, + allowBlank:true, + anchor : '95%' + }] + },{ + id:'cleaningMachinePositionWrapper', + name:'cleaningMachinePositionWrapper', + layout : 'form', + columnWidth : .5, + hidden:true, + height:setH, + labelWidth : 90, + items : [{ + xtype : 'textfield', + name : 'cleaningMachinePosition', + id : 'cleaningMachinePosition', + fieldLabel : "位置", + //readOnly:true, + anchor : '95%' + }] + },{ + id:'cleaningMachineDateWrapper', + name:'cleaningMachineDateWrapper', + layout : 'form', + columnWidth : .5, + height:setH, + labelWidth : 90, + hidden:true, + items : [{ + xtype : 'textfield', + name : 'cleaningMachineDate', + id : 'cleaningMachineDate', + fieldLabel : "日期", + //readOnly:true, + anchor : '95%' + }] + },{ + id:'cleaningMachineNameWrapper', + name:'cleaningMachineNameWrapper', + layout : 'form', + columnWidth : .5, + height:setH, + labelWidth : 90, + hidden:true, + items : [{ + xtype : 'textfield', + name : 'cleaningMachineName', + id : 'cleaningMachineName', + fieldLabel : "清洗机名称", + //readOnly:true, + anchor : '95%' + }] + },{ + id:'cleaningMachineProgramNameWrapper', + name:'cleaningMachineProgramNameWrapper', + layout : 'form', + columnWidth : .5, + height:setH, + labelWidth : 90, + hidden:true, + items : [{ + xtype : 'textfield', + name : 'cleaningMachineProgramName', + id : 'cleaningMachineProgramName', + fieldLabel : "清洗机程序名称", + //readOnly:true, + anchor : '95%' + }] + },{ + id:'cleaningStartTimeWrapper', + name:'cleaningStartTimeWrapper', + layout : 'form', + columnWidth : .5, + height:setH, + labelWidth : 90, + hidden:true, + items : [{ + xtype : 'textfield', + name : 'cleaningStartTime', + id : 'cleaningStartTime', + fieldLabel : "清洗机开始时间", + //readOnly:true, + anchor : '95%' + }] + },{ + id:'cleaningEndTimeWrapper', + name:'cleaningEndTimeWrapper', + layout : 'form', + columnWidth : .5, + height:setH, + labelWidth : 90, + hidden:true, + items : [{ + xtype : 'textfield', + name : 'cleaningEndTime', + id : 'cleaningEndTime', + fieldLabel : "清洗机结束时间", + //readOnly:true, + anchor : '95%' + }] + } ,{ + layout : 'form', + columnWidth : .5, + labelWidth : 90, + 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(); + Ext.getCmp("idCardAndTousseBarcode").setValue(''); + loadRecyclePersonByBarcode(barcodeValue); + } + } + }, + anchor : '95%' + }] + },{ + layout : 'form', + columnWidth : .5, + labelWidth : 90, + hidden:true, + height:setH, + id:"tousseNameBasicsWrapper", + items : [{ + xtype : 'textfield', + name : 'tousseNameBasics', + id : 'tousseNameBasics', + fieldLabel : "器械包名称", + anchor : '95%' + }] + },{ + layout : 'form', + columnWidth : .5, + labelWidth : 90, + hidden:true, + height:setH, + id:"recyclePersonWrapper", + items : [{ + xtype : 'textfield', + name : 'recyclePerson', + id : 'recyclePerson', + fieldLabel : "回收员", + anchor : '95%' + }] + } ,{ + layout : 'form', + columnWidth : .5, + labelWidth : 90, + hidden:true, + height:setH, + id:"recycleDepartmentsWrapper", + items : [{ + xtype : 'textfield', + name : 'recycleDepartments', + id : 'recycleDepartments', + fieldLabel : "回收科室", + anchor : '95%' + }] + },{ + layout : 'form', + columnWidth : .5, + labelWidth : 90, + hidden:true, + height:setH, + id:"operationRoomWrapper", + items : [{ + xtype : 'textfield', + name : 'operationRoom', + id : 'operationRoom', + fieldLabel : "手术间", + anchor : '95%' + }] + },{ + layout : 'form', + columnWidth : .5, + labelWidth : 90, + hidden:true, + height:setH, + id:"nurseWrapper", + items : [{ + xtype : 'textfield', + name : 'nurse', + id : 'nurse', + fieldLabel : "巡回护士", + anchor : '95%' + }] + },{ + layout : 'form', + columnWidth : .5, + labelWidth : 90, + hidden:true, + height:setH, + id:"recycleTimeWrapper", + items : [{ + xtype : 'datefieldWithMin', + fieldLabel : '回收时间', + id : 'recycleTime', + name : 'recycleTime', +// value : new Date(), + editable : false, + height:setH, + 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 : 90, + 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(); + Ext.getCmp("tousseBarcode").setValue(''); + //后台接口赋值 + loadSterilizationByBarcode(barcodeValue); + } + } + }, + anchor : '95%' + }] + } ,{ + layout : 'form', + columnWidth : .5, + labelWidth : 90, + hidden:true, + height:setH, + id:"sterilizationNameWrapper", + items : [{ + xtype : 'textfield', + name : 'sterilizationName', + id : 'sterilizationName', + fieldLabel : "灭菌炉名称", + anchor : '95%' + }] + },{ + layout : 'form', + columnWidth : .5, + labelWidth : 90, + hidden:true, + height:setH, + id:"sterilizationProgramNameWrapper", + items : [{ + xtype : 'textfield', + name : 'sterilizationProgramName', + id : 'sterilizationProgramName', + fieldLabel : "灭菌程序名称", + anchor : '95%' + }] + },{ + layout : 'form', + columnWidth : .5, + labelWidth : 90, + hidden:true, + height:setH, + id:"heatWrapper", + items : [{ + xtype : 'textfield', + name : 'heat', + id : 'heat', + fieldLabel : "炉次", + anchor : '95%' + }] + },{ + layout : 'form', + columnWidth : .5, + labelWidth : 90, + hidden:true, + height:setH, + id:"sterilizationStartTimeWrapper", + items : [{ + xtype : 'textfield', + name : 'sterilizationStartTime', + id : 'sterilizationStartTime', + fieldLabel : "灭菌开始时间", + anchor : '95%' + }] + } ,{ + layout : 'form', + columnWidth : .5, + labelWidth : 90, + hidden:true, + height:setH, + id:"sterilizationEndTimeWrapper", + items : [{ + xtype : 'textfield', + name : 'sterilizationEndTime', + id : 'sterilizationEndTime', + fieldLabel : "灭菌结束时间", + anchor : '95%' + }] + },{ + layout : 'form', + columnWidth : 1, + labelWidth : 90, + items : [ { + xtype : 'textarea', + name : 'remark', + id : 'remark', + width : 150, + height : 50, + fieldLabel : "备注", + anchor : '97%' + }] + },{ + layout : 'column', + columnWidth : 1, + labelWidth : 90, + height:setH, + items : [ + { + layout : 'form', + columnWidth : 0.8, + labelWidth : 90, + items : [ + { + xtype : 'textfield', + name : 'uploadImage', + id : 'uploadImage', + fieldLabel : "上传图片", + anchor : '100%' + } + ] + }, + { + layout : 'form', + columnWidth : 0.08, + labelWidth : 90, + items : [ + { xtype:'button', + text : '上传', + handler : function(){ + if(id == null || id == ''){ + showResultQM("请先保存后再上传图片!"); + }else{ + uploadWindowA(imageType_qualitymonitoring,id); + } + } + } + ] + }, + { + layout : 'form', + columnWidth : 0.12, + labelWidth : 90, + items : [ + { xtype:'button', + text : '预览', + disabled:disableShowImageButton, + iconCls : 'btn_ext_application_search', + handler : function(){ + showUploadImageWin(id); + } + } + ] + } + ] + }] + }], + buttons : [/* { + id : 'addExtractCheckTousse', + text : '添加抽检器械包', + handler : function(){ + addExtractCheckTousse(); + } + },{ + id : 'addExtractCheckMaterial', + text : '添加抽检器械', + handler : function(){ + 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 + }] + }); + 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(checked){ + Ext.getCmp('isAllTousseOfSterile').setValue('是'); + }else{ + Ext.getCmp('isAllTousseOfSterile').setValue('否'); + } + updateControlStatus(); + } + } + }] + },{ + layout : 'form', + columnWidth : .5, + id : 'recycleC', + labelWidth : 90, + items : [{ + id : 'recycle', + name : 'recycle', + fieldLabel : '重新回收', + xtype : 'checkbox', + inputValue : '重新回收', + listeners:{ + check:function( thiz, checked ){ + if(checked){ + Ext.getCmp('isRecycle').setValue('是'); + Ext.getCmp('repacking').setValue(false); + }else{ + Ext.getCmp('isRecycle').setValue('否'); + } + } + } + }] + },{ + layout : 'form', + columnWidth : .5, + id : 'repackingC', + labelWidth : 90, + items : [{ + id : 'repacking', + name : 'repacking', + fieldLabel : '重新装配', + xtype : 'checkbox', + inputValue : '重新装配', + listeners:{ + check:function( thiz, checked ){ + if(checked){ + Ext.getCmp('isRepacking').setValue('是'); + Ext.getCmp('recycle').setValue(false); + }else{ + Ext.getCmp('isRepacking').setValue('否'); + } + } + } + }] + + },{ + 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(), Ext.getCmp('formDefinitionId').getValue(), materialDefinitionStore); + field.setValue(''); + } + } + }, + anchor : '95%' + }] + },{ + 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 = Ext.getCmp("scope").getValue(); + if(Ext.getCmp("scope").getValue() == "材料和器械包"){//如果监测范围是材料和包的话 + //widthSet = true; + addExtractCheckMaterial("","",1,"","","",true,"","",true,"",""); + //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) { + combo.setValue(record.data.name); + Ext.getCmp('tousseDefinitionId').setValue(record.data.id); + //加载责任人 + }, + blur : function(field){ + if(!Ext.getCmp('tousseName').getRawValue()){ + Ext.getCmp('tousseDefinitionId').setValue(''); + } + //重新加载包内的材料 + materialDefinitionStore.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 : '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) { + 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(Ext.getCmp("scope").getValue() == "材料和器械包"){//如果监测范围是材料和包的话 + firstChildNum = 001;//这里是自己写死的,因为这个本身是第一个 + + } + addExtractCheckMaterial("","",1,"","","","","","","",firstChildNum,""); + 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', + hidden : !(qualityMonitoringWRRecordID > 0 && (sstsConfig.hasOwnProperty('haveRinserPosition')) && sstsConfig.haveRinserPosition), + id : 'positionC', + columnWidth : .36, + labelWidth : positionlabelWFlag ? 92: 116, + 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() { + // this.value 2017-2-2 + //Ext.getCmp('sterilizerFre').setValue(""); + //frequencyStore.baseParams.sterilizerDate = this.value; + //var name = Ext.getCmp('sterilizerName').getValue(); + //frequencyStore.baseParams.sterilizerName = name; + //frequencyStore.load(); + } + } + }] + }/* ,{ + layout : 'form', + columnWidth : .5, + labelWidth : 90, + items : [{ + xtype : 'combo', + id : 'sterilizerName', + name : 'sterilizerName', + fieldLabel : '灭菌炉号', + queryParam : 'spell', + minChars : 0, + valueField : 'name', + displayField : 'name', + store : new Ext.data.SimpleStore({ + fields : [ 'name' ], + url : WWWROOT + '/disinfectSystem/baseData/sterilizerAction!getAllSterilizer.do?' + }), + forceSelection : true, + lazyInit : true, + triggerAction : 'all', + hideTrigger : false, + typeAhead : false, + anchor : '95%', + listeners : { + select : function(combo, record, index) { + // record.data.name 选择的值 + Ext.getCmp('sterilizerFre').setValue(""); + frequencyStore.baseParams.sterilizerName = record.data.name; + var date = Ext.getCmp('srDateTime').getRawValue(); + frequencyStore.baseParams.sterilizerDate = date; + frequencyStore.load(); + } + } + }] + },{ + layout : 'form', + columnWidth : .5, + labelWidth : 90, + items : [{ + xtype : 'combo', + id : 'sterilizerFre', + name : 'sterilizerFre', + fieldLabel : '炉次', + queryParam : 'spell', + minChars : 0, + valueField : 'value', + displayField : 'value', + store : frequencyStore, + forceSelection : true, + lazyInit : true, + triggerAction : 'all', + hideTrigger : false, + typeAhead : false, + anchor : '95%' + }] + } */] + }] + }); + return formPanel; +} +function recycleAddQualityMonitoringDo(errorDamageQmKey){ + setStartDate(Ext, 'yyyy/MM/dd HH:mm', 'dateTime'); //(设置抽检时间,取服务器时间 cjr) + disableRecycleAndRepacking(); + var responPartName = "回收清点"; + Ext.getCmp('responsibilityPart').setValue(responPartName); + if(sstsConfig.hasOwnProperty('responsibilityPartNotLimitInspect') && sstsConfig.responsibilityPartNotLimitInspect){ + formDefinitionStore.baseParams.responsiblePerson = responPartName; + //formDefinitionStore.baseParams.isNotLimitInspect = "是"; + formDefinitionStore.load(); + }else{ + formDefinitionStore.baseParams.responsiblePerson = responPartName; + formDefinitionStore.load(); + } + if(!isUndefinedOrNullOrEmpty(errorDamageQmKey)){ + Ext.getCmp("errorDamageQmKey").setValue(errorDamageQmKey); + }else{ + Ext.getCmp("errorDamageQmKey").setValue(""); + } +// formDefinitionStore.baseParams.responsiblePerson = "回收清点"; +// formDefinitionStore.load(); +} + +function showResultQM(msg){ + if(recycleQM == true){ + showResultCurPage(msg); + }else{ + showResult(msg); + } +} Index: ssts-web/src/main/webapp/disinfectsystem/qualitymonitoring/qualitymonitoringInstanceView.jsp =================================================================== diff -u -r18756 -r27705 --- ssts-web/src/main/webapp/disinfectsystem/qualitymonitoring/qualitymonitoringInstanceView.jsp (.../qualitymonitoringInstanceView.jsp) (revision 18756) +++ ssts-web/src/main/webapp/disinfectsystem/qualitymonitoring/qualitymonitoringInstanceView.jsp (.../qualitymonitoringInstanceView.jsp) (revision 27705) @@ -14,6 +14,11 @@ 质量监测 + <%@ include file="/common/includeExtJsAndCss.jsp"%> @@ -37,7 +42,8 @@ - + + Index: ssts-web/src/main/webapp/disinfectsystem/washanddisinfectmanager/washanddisinfectrecord/washAndDisinfectView.jsp =================================================================== diff -u -r27541 -r27705 --- ssts-web/src/main/webapp/disinfectsystem/washanddisinfectmanager/washanddisinfectrecord/washAndDisinfectView.jsp (.../washAndDisinfectView.jsp) (revision 27541) +++ ssts-web/src/main/webapp/disinfectsystem/washanddisinfectmanager/washanddisinfectrecord/washAndDisinfectView.jsp (.../washAndDisinfectView.jsp) (revision 27705) @@ -39,6 +39,7 @@ + Index: ssts-web/src/main/webapp/disinfectsystem/qualitymonitoring/loadScanBarcodeMsg.js =================================================================== diff -u --- ssts-web/src/main/webapp/disinfectsystem/qualitymonitoring/loadScanBarcodeMsg.js (revision 0) +++ ssts-web/src/main/webapp/disinfectsystem/qualitymonitoring/loadScanBarcodeMsg.js (revision 27705) @@ -0,0 +1,157 @@ +var rinseRecordStore; +/** + * 调用的入口函数 + * rinseBasketsName 清洗篮筐名称 + * cleaningMachinePosition 位置 + * cleaningMachineDate 日期 + * cleaningMachineName 清洗机名称 + * cleaningMachineProgramName 清洗机程序名称 + * cleaningStartTime 清洗机开始时间 + * cleaningEndTime 清洗机结束时间 + * scanWashRecordId 清洗机记录id + * barcodeValue 清洗篮筐条码 + */ +function loadScanBarcodeMsg(rinseBasketsName,cleaningMachinePosition,cleaningMachineDate,cleaningMachineName,cleaningMachineProgramName,cleaningStartTime,cleaningEndTime,scanWashRecordId,barcodeValue){ + var formWindowRinseRecord; + //确定保存 + function saveSelect(rinseBasketsName,cleaningMachinePosition,cleaningMachineDate,cleaningMachineName,cleaningMachineProgramName,cleaningStartTime,cleaningEndTime,scanWashRecordId){ + var records = top.Ext.getCmp("select_rinseRecordGrid").getSelectionModel().getSelections(); + if(records.length == 0){ + showResult("请选择一条清洗记录!"); + return false; + } + if (records.length > 1) { + showResult("一次只能选择一条清洗记录!"); + return false; + } + + Ext.getCmp(rinseBasketsName).setValue(records[0].data.washBasketName); + Ext.getCmp(cleaningMachinePosition).setValue(records[0].data.position); + Ext.getCmp(cleaningMachineDate).setValue(records[0].data.washDate); + Ext.getCmp(cleaningMachineName).setValue(records[0].data.disinfectIdentification); + Ext.getCmp(cleaningMachineProgramName).setValue(records[0].data.disinfectProgram); + Ext.getCmp(cleaningStartTime).setValue(records[0].data.startDate); + Ext.getCmp(cleaningEndTime).setValue(records[0].data.endDate); + Ext.getCmp(scanWashRecordId).setValue(records[0].data.washRecordID); + formWindowRinseRecord.close(); + } + + + rinseRecordStore = new top.Ext.data.Store({ + proxy : new Ext.data.HttpProxy({ + url : WWWROOT + '/disinfectSystem/qualityMonitoringInstanceAction!scanBasketBarcodeForWashRecord.do', + method : 'POST' + }), + baseParams : {basketBarcode : barcodeValue}, + reader : new Ext.data.JsonReader({ + totalProperty : 'total', + root : 'data' + },[ + {name : 'operator',mapping : 'operator'}, + {name : 'disinfectIdentification',mapping : 'disinfectIdentification'},//清洗机名称 + {name : 'disinfectProgram',mapping : 'disinfectProgram'},//清洗程序名称 + {name : 'startDate',mapping : 'startDate'}, + {name : 'washDate',mapping : 'washDate'},//日期 + {name : 'washRecordID',mapping : 'washRecordID'}, + {name : 'washBasketName',mapping : 'washBasketName'},//清洗篮筐名称 + {name : 'position',mapping : 'position'}, + {name : 'endDate',mapping : 'endDate'} + + ]) + }); + rinseRecordStore.load(); + + + var smCheckbox = new top.Ext.grid.CheckboxSelectionModel({ + singleSelect : false, + checkOnly: true + }); + var cm = new top.Ext.grid.ColumnModel([ + smCheckbox, + { + header: "操作员", + width: 60, + dataIndex : 'operator' + }, { + header: "清洗机名称", + width: 120, + dataIndex : 'disinfectIdentification' + }, { + header: '清洗程序名称', + width: 120, + menuDisabled: true, + dataIndex: 'disinfectProgram' + }, { + header: '清洗开始时间', + width: 120, + menuDisabled: true, + dataIndex: 'startDate' + }]); + + var select_rinseRecordGridStoreFormObj = new top.Ext.FormPanel({ + id: 'departAndTaskGroupForm', + frame: true, + labelAlign: 'right', + labelSeparator: ':', + bodyStyle: 'padding:5px 5px 0px 5px', + autoWidth: true, + autoHeight: true, + autoScroll: true, + //height:300, + items: [{ + layout: 'column', + items: [{ + columnWidth: 1, + layout: 'form', + items: [ + new top.Ext.grid.GridPanel({ + id: 'select_rinseRecordGrid', + store: rinseRecordStore, + cm: cm, + width: 340, + height: 240, + isCheckboxSelectionModel: true, + frame: false, + viewConfig: { + forceFit: true + }, + bodyStyle: 'border:1px solid #afd7af', + anchor: '100%', + sm:smCheckbox, + selModel: new top.Ext.grid.RowSelectionModel({ + singleSelect: false, + checkOnly: true + }) + }) + ] + }] + }], + buttons: [{ + id: 'saveBtn2', + text: '确定', + handler: function () { + saveSelect(rinseBasketsName,cleaningMachinePosition,cleaningMachineDate,cleaningMachineName,cleaningMachineProgramName,cleaningStartTime,cleaningEndTime,scanWashRecordId); + } + }, { + id: 'cancleBtn2', + text: '取消', + handler: function () { + rinseRecordStore.removeAll(); + formWindowRinseRecord.close(); + } + }] + }); + + formWindowRinseRecord = new top.Ext.Window({ + id: 'formWindowDepartAndTaskGroupWin', + layout: 'fit', + title: '选择清洗记录', + width: 750, + modal: true, + autoHeight: true, + border: false, + plain: true, + items: [select_rinseRecordGridStoreFormObj] + }); + formWindowRinseRecord.show(); +} \ No newline at end of file Index: ssts-web/src/main/webapp/disinfectsystem/basedatamanager/qualitymonitoringConfig/qualityMonitoringDefinitionView.js =================================================================== diff -u -r27518 -r27705 --- ssts-web/src/main/webapp/disinfectsystem/basedatamanager/qualitymonitoringConfig/qualityMonitoringDefinitionView.js (.../qualityMonitoringDefinitionView.js) (revision 27518) +++ ssts-web/src/main/webapp/disinfectsystem/basedatamanager/qualitymonitoringConfig/qualityMonitoringDefinitionView.js (.../qualityMonitoringDefinitionView.js) (revision 27705) @@ -138,6 +138,7 @@ {name : 'name'}, {name : 'type'}, {name : 'requirement'}, + {name : 'repeatWrite'}, {name : 'options'}, {name : 'optionsJson'}, {name : 'isReportDisplay'} @@ -602,6 +603,47 @@ formWindow.show(); } + +function showOrHideRecordInformation(value){ + if(value == "回收清点"){ + top.Ext.getCmp('recordRecycleInformation_id').show(); + top.Ext.getCmp('recordRinseInformation_id').hide(); + top.Ext.getCmp('recordSterilizatioInformation_id').hide(); + top.Ext.getCmp('isInsertBasket').enable(); + showSterNameAndFre(); + }else if(value == "清洗消毒"){ + top.Ext.getCmp('recordRinseInformation_id').show(); + top.Ext.getCmp('recordRecycleInformation_id').hide(); + top.Ext.getCmp('recordSterilizatioInformation_id').hide(); + top.Ext.getCmp('isInsertBasket').enable(); + showSterNameAndFre(); + }else if(value == "灭菌管理"){ + top.Ext.getCmp('recordSterilizatioInformation_id').show(); + top.Ext.getCmp('recordRecycleInformation_id').hide(); + top.Ext.getCmp('recordRinseInformation_id').hide(); + top.Ext.getCmp('showSterNameAndFre_id').hide(); + top.Ext.getCmp('isInsertBasket').disable(); + hideSterNameAndFre(); + }else{ + top.Ext.getCmp('recordRecycleInformation_id').hide(); + top.Ext.getCmp('recordRinseInformation_id').hide(); + top.Ext.getCmp('recordSterilizatioInformation_id').hide(); + top.Ext.getCmp('isInsertBasket').enable(); + showSterNameAndFre(); + } +} + +//显示炉次炉号 +function showSterNameAndFre(){ + if(top.Ext.getCmp('scope').getValue() == "器械包" || top.Ext.getCmp('scope').getValue() == "材料和器械包"){ + top.Ext.getCmp('showSterNameAndFre_id').show(); + } +}; + +//隐藏炉次炉号 +function hideSterNameAndFre(){ + top.Ext.getCmp('showSterNameAndFre_id').hide(); +}; /** * 添加顶 * @param id @@ -670,7 +712,13 @@ forceSelection : true, mode : 'local', triggerAction : 'all', - anchor : '95%' + anchor : '95%', + listeners : { + select : function(combo,record,index){ + var value = combo.getValue(); + showOrHideRecordInformation(value); + } + } }] },{ columnWidth : .5, @@ -694,7 +742,11 @@ select : function(combo,record,index){ var value = combo.getValue(); if(value == "器械包" || value == "材料和器械包"){ - top.Ext.getCmp('showSterNameAndFre_id').show(); + if(top.Ext.getCmp('responsibilityPart').getValue() == "灭菌管理"){ + hideSterNameAndFre(); + }else{ + top.Ext.getCmp('showSterNameAndFre_id').show(); + } }else{ top.Ext.getCmp('showSterNameAndFre_id').hide(); } @@ -713,7 +765,7 @@ items:[{ xtype : 'combo', fieldLabel : "物品入筐", - name : "isInsertBasket", + name : "isInsertBasket", id : "isInsertBasket", valueField : 'value', displayField : 'value', @@ -744,6 +796,122 @@ anchor : '95%' }] },{ + columnWidth : .5, + layout : 'form', + labelWidth : 80, + hidden : false, + id:"recordRecycleInformation_id", + items:[{ + xtype : 'combo', + fieldLabel : "录入回收信息", + name : "recordRecycleInformation", + id : "recordRecycleInformation", + valueField : 'value', + displayField : 'value', + allowBlank : false, + editable : false, + store : new top.Ext.data.SimpleStore({ + fields : [ 'value' ], + data : [[insertBasketArr[0]],[insertBasketArr[1]]] + } + ), + value : insertBasketArr[1], + forceSelection : true, + mode : 'local', + triggerAction : 'all', + anchor : '95%' + }], + listeners:{ + render:function(){ + setTimeout(function(){ + var responsibilityPartVal = top.Ext.getCmp('responsibilityPart').getValue(); + if(responsibilityPartVal == "回收清点"){ + top.Ext.getCmp('recordRecycleInformation_id').show(); + }else{ + top.Ext.getCmp('recordRecycleInformation_id').hide(); + } + + }, 100); + } + } + },{ + columnWidth : .5, + layout : 'form', + labelWidth : 80, + hidden : false, + id:"recordRinseInformation_id", + items:[{ + xtype : 'combo', + fieldLabel : "录入清洗信息", + name : "recordRinseInformation", + id : "recordRinseInformation", + valueField : 'value', + displayField : 'value', + allowBlank : false, + editable : false, + store : new top.Ext.data.SimpleStore({ + fields : [ 'value' ], + data : [[insertBasketArr[0]],[insertBasketArr[1]]] + } + ), + value : insertBasketArr[1], + forceSelection : true, + mode : 'local', + triggerAction : 'all', + anchor : '95%' + }], + listeners:{ + render:function(){ + setTimeout(function(){ + var responsibilityPartVal = top.Ext.getCmp('responsibilityPart').getValue(); + if(responsibilityPartVal == "清洗消毒"){ + top.Ext.getCmp('recordRinseInformation_id').show(); + }else{ + top.Ext.getCmp('recordRinseInformation_id').hide(); + } + + }, 100); + } + } + },{ + columnWidth : .5, + layout : 'form', + labelWidth : 80, + hidden : false, + id:"recordSterilizatioInformation_id", + items:[{ + xtype : 'combo', + fieldLabel : "录入灭菌信息", + name : "recordSterilizatioInformation", + id : "recordSterilizatioInformation", + valueField : 'value', + displayField : 'value', + allowBlank : false, + editable : false, + store : new top.Ext.data.SimpleStore({ + fields : [ 'value' ], + data : [[insertBasketArr[0]],[insertBasketArr[1]]] + } + ), + value : insertBasketArr[1], + forceSelection : true, + mode : 'local', + triggerAction : 'all', + anchor : '95%', + listeners:{ + render:function(){ + setTimeout(function(){ + var responsibilityPartVal = top.Ext.getCmp('responsibilityPart').getValue(); + if(responsibilityPartVal == "灭菌管理"){ + top.Ext.getCmp('recordSterilizatioInformation_id').show(); + }else{ + top.Ext.getCmp('recordSterilizatioInformation_id').hide(); + } + }, 100); + } + } + }] + },{ columnWidth : .36, layout : 'form', labelWidth : 80, @@ -868,12 +1036,34 @@ mode : 'local', triggerAction : 'all' },{ + text : '重复填写:' + },{ + xtype : 'combo', + name : "repeatWrite", + id : "repeatWrite", + valueField : 'value', + displayField : 'value', + allowBlank : false, + width:40, + editable : false, + store : new top.Ext.data.SimpleStore({ + fields : [ 'value' ], + data : [['是'],['否']] + } + ), + value : '否', + forceSelection : true, + mode : 'local', + triggerAction : 'all' + },{ text : '添加', iconCls : 'btn_ext_add', handler : function() { var type = top.Ext.getCmp("type").getValue(); var name = top.Ext.getCmp("name").getValue(); var requirement = top.Ext.getCmp("requirement").getValue(); + var repeatWrite = top.Ext.getCmp("repeatWrite").getValue(); + name = name.trim(); if(type == ""){ showResult("元素类型不能为空!"); @@ -906,6 +1096,7 @@ name : name, type : type, requirement : requirement, + repeatWrite:repeatWrite, options : '', optionsJson : "", isReportDisplay : '是' @@ -919,7 +1110,7 @@ var formDefinitionWin = new top.Ext.Window( { id : 'formDefinitionWin', title : entityName + '信息', - width : 700, + width : 750, border : false, modal : true, heigth :800, @@ -936,7 +1127,7 @@ new top.Ext.grid.EditorGridPanel({ id : 'formDefinitionItemConfigPanel', title : entityName + '元素列表', - width : 685, + width : 740, height : 400, border : true, frame : false, @@ -953,6 +1144,7 @@ {name : 'name'}, {name : 'type'}, {name : 'requirement'}, + {name : 'repeatWrite'}, {name : 'optionsJson'}, {name : 'options'}, {name : 'isReportDisplay'} @@ -983,6 +1175,7 @@ triggerAction : 'all' }) }, + {header : "重复填写",width : 70,dataIndex : 'repeatWrite'}, {header : "参数值",width : 150,dataIndex : 'options'}, {header : "报表展现",width : 65,dataIndex : 'isReportDisplay',editor: new top.Ext.form.ComboBox({ valueField : 'value', @@ -1015,10 +1208,10 @@ var record = thiz.getStore().getAt(rowIndex); var type = record.get("type"); var params = record.get("optionsJson"); - if(columnIndex == 4){ + if(columnIndex == 5){ if(itemTypes[3] == type || itemTypes[4] == type){//单选,多选 setFormDefinitionOptionsWin(params,rowIndex); - }else if(itemTypes[5] == type || itemTypes[7] == type){//文本,文本框 + }else if(itemTypes[6] == type || itemTypes[8] == type){//文本,文本框 if("定期监测" == entityName){//只有定期监测才启用默认值 setFormDefinitionOptionsDefaultValueWin(params,rowIndex); } @@ -1046,8 +1239,9 @@ } }] }); - + formDefinitionWin.show(); + if(id != null && id != ""){ formPanel.form.load({ url : WWWROOT + '/disinfectSystem/formDefinitionAction!loadFormDefinition.do', @@ -1059,10 +1253,17 @@ if(action_deploy == formConfig.isDeploy){ top.Ext.getCmp("saveBtn").disable(); } + + var responsibilityPart = formConfig.responsibilityPart; var scope = formConfig.scope; if(scope == "器械包" || scope == "材料和器械包"){ - top.Ext.getCmp('showSterNameAndFre_id').show(); + if(responsibilityPart == "灭菌管理"){ + hideSterNameAndFre(); + }else{ + top.Ext.getCmp('showSterNameAndFre_id').show(); + } } + showOrHideRecordInformation(responsibilityPart); var items = formConfig.items; var store = top.Ext.getCmp('formDefinitionItemConfigPanel').getStore(); for(var i = 0;i < items.length; i++){ @@ -1071,6 +1272,7 @@ name : items[i].name, type : items[i].type, requirement : items[i].requirement, + repeatWrite :items[i].repeatWrite, options : items[i].optionsStr, optionsJson : items[i].optionsJson, isReportDisplay : items[i].isReportDisplay @@ -1132,6 +1334,7 @@ name : name, type : type, requirement : record.get('requirement'), + repeatWrite : record.get('repeatWrite'), options : record.get('optionsJson'), orderNumber : (i+1), isReportDisplay: record.get('isReportDisplay') @@ -1141,7 +1344,6 @@ showResult(submitFaildMsg); return false; } - formPanel.form.submit({ url : WWWROOT + '/disinfectSystem/qualityMonitoringDefinitionAction!saveQualityMonitoringDefinition.do', method : 'POST', Index: ssts-web/src/main/webapp/disinfectsystem/washanddisinfectmanager/washanddisinfectrecord/washAndDisinfectView.js =================================================================== diff -u -r27541 -r27705 --- ssts-web/src/main/webapp/disinfectsystem/washanddisinfectmanager/washanddisinfectrecord/washAndDisinfectView.js (.../washAndDisinfectView.js) (revision 27541) +++ ssts-web/src/main/webapp/disinfectsystem/washanddisinfectmanager/washanddisinfectrecord/washAndDisinfectView.js (.../washAndDisinfectView.js) (revision 27705) @@ -363,7 +363,7 @@ }; if(!SSTS_QualityRecord_Create){ tbar.push({ - text : '添加质量监测', + text : '质量监测', hidden:SSTS_QualityRecord_Create, iconCls : 'btn_ext_application_add', handler : function() { Index: ssts-web/src/main/webapp/disinfectsystem/packing/packingView.js =================================================================== diff -u -r27658 -r27705 --- ssts-web/src/main/webapp/disinfectsystem/packing/packingView.js (.../packingView.js) (revision 27658) +++ ssts-web/src/main/webapp/disinfectsystem/packing/packingView.js (.../packingView.js) (revision 27705) @@ -2282,7 +2282,7 @@ id:"diposableGoodsAmount" },'-',{ xtype:'button', - text : '添加质量监测', + text : '质量监测', hidden:SSTS_QualityRecord_Create, id:"addMaterialQualityMonitoring", handler: function(){ @@ -2395,7 +2395,7 @@ addAndEditRecyclingLostRecord('', LINKTYPE_PACKINGRECORD_ERROR); } },"-",{ - text : '添加质量监测', + text : '质量监测', hidden:SSTS_QualityRecord_Create, iconCls : 'btn_ext_application_add', handler : function() {