Index: ssts-web/src/main/webapp/disinfectsystem/basedatamanager/tousse/comboTousseForm.js =================================================================== diff -u -r17174 -r17273 --- ssts-web/src/main/webapp/disinfectsystem/basedatamanager/tousse/comboTousseForm.js (.../comboTousseForm.js) (revision 17174) +++ ssts-web/src/main/webapp/disinfectsystem/basedatamanager/tousse/comboTousseForm.js (.../comboTousseForm.js) (revision 17273) @@ -235,7 +235,7 @@ }); } -function addAndEditTousse(id, isUploadVideo) { +function addAndEditComboTousse(id, isUploadVideo) { this.id = id; tousseDefinitionID = id; var hasVideo = false; Index: ssts-basedata/src/main/java/com/forgon/disinfectsystem/entity/basedatamanager/toussedefinition/TousseDefinition.java =================================================================== diff -u -r17028 -r17273 --- ssts-basedata/src/main/java/com/forgon/disinfectsystem/entity/basedatamanager/toussedefinition/TousseDefinition.java (.../TousseDefinition.java) (revision 17028) +++ ssts-basedata/src/main/java/com/forgon/disinfectsystem/entity/basedatamanager/toussedefinition/TousseDefinition.java (.../TousseDefinition.java) (revision 17273) @@ -628,6 +628,11 @@ return count; } + /** + * 获取本器械包定义上传的视频数量. + * @param objectDao + * @return + */ public int getVideosCount(ObjectDao objectDao) { String sql = " where po.tousseDefinition_id=" + id; Index: ssts-web/src/main/webapp/disinfectsystem/basedatamanager/tousse/tousseForm.js =================================================================== diff -u -r17066 -r17273 --- ssts-web/src/main/webapp/disinfectsystem/basedatamanager/tousse/tousseForm.js (.../tousseForm.js) (revision 17066) +++ ssts-web/src/main/webapp/disinfectsystem/basedatamanager/tousse/tousseForm.js (.../tousseForm.js) (revision 17273) @@ -180,6 +180,10 @@ } } +/** + * 设置标识牌信息页面的“标识牌标签”属性 + * @returns + */ function setIdCardPaperType2(){ var idCardPaperType = top.Ext.getCmp("idCardPaperType").getValue(); var idCardPaperType2 = top.Ext.getCmp("idCardPaperType2"); @@ -190,6 +194,8 @@ function addAndEditTousse(id,isUploadVideo) { this.id = id; tousseDefinitionID = id; + + //同步请求后台,判断此器械包是否已经上传过视频 var hasVideo = false; DWREngine.setAsync(false); TousseDefinitionTableManager.getUploadVideoCount(id,function(count){ @@ -198,6 +204,8 @@ } }); DWREngine.setAsync(true); + + //任务组combo的store var taskGroupJsonStore = new Ext.data.SimpleStore({ fields : [ 'taskGroupName' ], url : WWWROOT + '/disinfectSystem/baseData/tousseDefinitionAction!getTaskGroupName.do', @@ -211,6 +219,8 @@ } } }); + + //器械包分组combo的store var tousseGroupStore = new Ext.data.JsonStore({ fields : [ 'tousseGroupName','id' ], url : WWWROOT + '/disinfectSystem/baseData/tousseGroupAction!getAllTousseGroup.do', @@ -224,6 +234,8 @@ } } }); + + //标签纸类型combo的store var barcodePaperTypeStore = new Ext.data.JsonStore({ fields : [ 'name'], url : WWWROOT + '/disinfectSystem/labelTemplateAction!getAllBarcodePaperType.do', @@ -660,7 +672,6 @@ items:[{ xtype : 'combo', fieldLabel : '器械包类型', - //width:180, listWidth:200, id : 'tousseType', name : 'tousseType', @@ -679,53 +690,38 @@ triggerAction : 'all', listeners : { select : function(combo, record, index){ - if(record.data.value == '消毒物品'){ - top.Ext.getCmp('packageType').setValue('胶袋'); - top.Ext.getCmp('sterilingMethod').setValue('无'); - //如果器械包类型为消毒物品,则'是否灭菌'下拉框显示并默认赋值为'否' - top.Ext.getCmp('isSterile').enable(); - top.Ext.getCmp('isSterile').setValue('否'); - top.Ext.getCmp('isApplyEntireTousse').enable(); - - top.Ext.getCmp('isInvoice').disable(); - top.Ext.getCmp('isInvoice').setValue('是'); - - //是否回收设为是 - top.Ext.getCmp('isRecycling').enable(); - top.Ext.getCmp('isRecycling').setValue('是'); - - top.Ext.getCmp('autoOutStockForPacking').enable(); - }else if(record.data.value == '敷料包'){ - //是否回收设为否 - top.Ext.getCmp('isRecycling').disable(); + top.Ext.getCmp('isApplyEntireTousse').disable(); //禁用“是否整包申请”下拉框,并默认赋值为“是” + top.Ext.getCmp('isApplyEntireTousse').setValue('是'); + + top.Ext.getCmp('isSterile').disable(); //禁用“是否灭菌”下拉框,并默认赋值为“是” + top.Ext.getCmp('isSterile').setValue('是'); + + top.Ext.getCmp('isRecycling').enable(); //启用“是否回收”下拉框,并默认赋值为“是” + top.Ext.getCmp('isInvoice').enable(); //启用“是否发货”下拉框,并默认赋值为“是” + top.Ext.getCmp('autoOutStockForPacking').enable(); //启用“自动扣包内材料”下拉框 + + var tousseType = record.data.value; + if(tousseType == '敷料包'){ //敷料包 + top.Ext.getCmp('isRecycling').disable(); //禁用“是否回收”下拉框,并默认赋值为“否” top.Ext.getCmp('isRecycling').setValue('否'); - //是否灭菌禁用并默认赋值为'是' - top.Ext.getCmp('isSterile').disable(); - top.Ext.getCmp('isSterile').setValue('是'); - top.Ext.getCmp('isApplyEntireTousse').disable(); - top.Ext.getCmp('isInvoice').enable(); + }else if(tousseType == '消毒物品'){ //消毒物品 + top.Ext.getCmp('isApplyEntireTousse').enable(); //启用“是否整包申请”下拉框,并默认赋值为“否” + top.Ext.getCmp('isApplyEntireTousse').setValue('否'); - top.Ext.getCmp('autoOutStockForPacking').enable(); - }else{ - //是否回收设为是 - top.Ext.getCmp('isRecycling').enable(); - top.Ext.getCmp('isRecycling').setValue('是'); - //否则禁用并默认赋值为'是' - top.Ext.getCmp('isSterile').disable(); - top.Ext.getCmp('isSterile').setValue('是'); - top.Ext.getCmp('isApplyEntireTousse').disable(); + top.Ext.getCmp('packageType').setValue('胶袋'); //默认包装类型改为“胶袋” - top.Ext.getCmp('autoOutStockForPacking').enable(); - top.Ext.getCmp('isInvoice').enable(); + top.Ext.getCmp('isSterile').enable(); //启用“是否灭菌”下拉框,并默认赋值为“否” + top.Ext.getCmp('isSterile').setValue('否'); - if(record.data.value == '外部代理灭菌'){ - //材料扣库存设值为否,并禁用 - top.Ext.getCmp('autoOutStockForPacking').setValue('否'); - top.Ext.getCmp('autoOutStockForPacking').disable(); - - top.Ext.getCmp('isInvoice').disable(); - top.Ext.getCmp('isInvoice').setValue('是'); - } + top.Ext.getCmp('sterilingMethod').setValue('无'); //默认灭菌程序设为“无” + + top.Ext.getCmp('isInvoice').disable(); //禁用“是否发货”下拉框,并默认赋值为“是” + top.Ext.getCmp('isInvoice').setValue('是'); + }else if(tousseType == '外部代理灭菌'){ //外部代理灭菌 + top.Ext.getCmp('autoOutStockForPacking').disable(); //禁用“自动扣包内材料”下拉框,并默认赋值为“否” + top.Ext.getCmp('autoOutStockForPacking').setValue('否'); + top.Ext.getCmp('isInvoice').disable(); //禁用“是否发货”下拉框,并默认赋值为“是” + top.Ext.getCmp('isInvoice').setValue('是'); } } }, @@ -768,6 +764,7 @@ fields : [ 'value' ], data : [['是'],[ '否']] }), + value : '是', forceSelection : true, mode : 'local', triggerAction : 'all', @@ -886,8 +883,6 @@ name : "spelling", id : "spelling", anchor : '100%' -// , -// readOnly : true }] }, { columnWidth : .25, @@ -999,7 +994,8 @@ store : new Ext.data.SimpleStore( { fields : [ 'value'], data : packageSizeArray - }), + }), + value : defaultPackageSize, forceSelection : true, mode : 'local', triggerAction : 'all', @@ -1317,15 +1313,8 @@ editable : false, forceSelection : true, mode : 'local', - //value : '是', - //allowBlank : false, triggerAction : 'all', - anchor : '100%', - listeners : { - select : function (combo, record, index ){ - - } - } + anchor : '100%' }] },{ @@ -1339,22 +1328,16 @@ name : 'isInvoice', valueField : 'value', displayField : 'value', + value : '是', store : new Ext.data.SimpleStore( { fields : [ 'value'], data : [['是'],['否']] }), editable : false, forceSelection : true, mode : 'local', - //value : '是', - //allowBlank : false, triggerAction : 'all', - anchor : '100%', - listeners : { - select : function (combo, record, index ){ - - } - } + anchor : '100%' }] }, { @@ -1416,7 +1399,6 @@ allowBlank : false, triggerAction : 'all', anchor : '100%' - }] },{ @@ -1732,39 +1714,16 @@ }), editable : false, forceSelection : true, - //allowBlank : false, value : '否', mode : 'local', triggerAction : 'all', anchor : '100%' }] - },/*{ + },{ columnWidth : .25, layout : 'form', items:[{ xtype : 'combo', - fieldLabel : '是否有植入物', - id : 'includeImplantStr', - name : 'includeImplantStr', - valueField : 'value', - displayField : 'value', - store : new Ext.data.SimpleStore( { - fields : ['value'], - data : [['是'],['否']] - }), - editable : false, - forceSelection : true, - //allowBlank : false, - value : '否', - mode : 'local', - triggerAction : 'all', - anchor : '100%' - }] - },*/{ - columnWidth : .25, - layout : 'form', - items:[{ - xtype : 'combo', fieldLabel : '是否多层盒装', id : 'moreBoxPacked', name : 'moreBoxPacked', @@ -1833,7 +1792,6 @@ disabled : true, name : "vedioNamesForDisplay", id : "vedioNamesForDisplay", -// width:300, anchor : '100%', cls:'fieldReadOnlyNoRemove' }] @@ -1898,14 +1856,12 @@ }, { columnWidth : 0.5, layout : 'form', - // height : 300, items : [materialsPanel] }, { columnWidth : 0.5, layout : 'form', bodyStyle : 'border:1px solid #afd7af', height:300, - //width : 475, labelWidth : 60, items : [ showTousseImage @@ -1970,141 +1926,54 @@ }] }); - showIDCardListView();// 标识牌 - - var tabs = new top.Ext.TabPanel({ - activeTab : 0, - plain : false, - bufferResize : true, - deferredRender :false, - items:[{ - id : 'abc', - layout : 'fit', - title: '基本信息', - items:[formObj] - },{ - id : 'signBoardID', - layout : 'fit', - title: '标识牌', - items:[signBoardForm] - }] - }); - - if(id != 0){ - tousseWin = new top.Ext.Window({ - id : 'tousseWin', - layout : 'fit', - title : '器械包信息', - width : 900, - border : false, - modal : true, - height : 660, - plain : true, -// items : [formObj], - items : [tabs], - listeners :{ - 'activate' : function(f) { - if(id == 0){ - taskGroupJsonStore.load(); - packTypeStore.load(); - top.Ext.getCmp('packageSize').setValue(defaultPackageSize); - top.Ext.getCmp('isCleanedEntirely').setValue('是'); - - - } - } - } + var tabs; + if(id != 0 && !sstsConfig.disableIdCard){ //修改,并且启用标识牌功能 + showIDCardListView(); //创建标识牌信息页面 + tabs = new top.Ext.TabPanel({ + activeTab : 0, + plain : false, + bufferResize : true, + deferredRender :false, + items:[{ + id : 'abc', + layout : 'fit', + title: '基本信息', + items:[formObj] + },{ + id : 'signBoardID', + layout : 'fit', + title: '标识牌', + items:[signBoardForm] + }] }); - }else{ - - tousseWin = new top.Ext.Window({ - id : 'tousseWin', - layout : 'fit', - title : '器械包信息', - width : 900, - border : false, - modal : true, - height : 660, - plain : true, - items : [formObj], -// items : [tabs], - listeners :{ - 'activate' : function(f) { - if(id == 0){ - //taskGroupJsonStore.load();//新增器械包时任务组不加载 - packTypeStore.load(); - //大小及是否整包清洗之前未选择过时,才赋初始值 - if(top.Ext.getCmp('packageSize') && top.Ext.getCmp('packageSize').getValue() == ''){ - top.Ext.getCmp('packageSize').setValue(defaultPackageSize); - } - if(top.Ext.getCmp('isCleanedEntirely') && top.Ext.getCmp('isCleanedEntirely').getValue() == ''){ - top.Ext.getCmp('isCleanedEntirely').setValue('是'); - } - - - } - } - } - }); - } + + tousseWin = new top.Ext.Window({ + id : 'tousseWin', + layout : 'fit', + title : '器械包信息', + width : 900, + border : false, + modal : true, + height : 660, + plain : true, + items : [tabs ? tabs : formObj] + }); tousseWin.show(); - //初始化时判断器械包类型是否为消毒物品,如果为消毒物品,则'是否灭菌'下拉框显示并默认赋值为'否',否则禁用并默认赋值为'是' - if(top.Ext.getCmp('tousseType') == '消毒物品'){ - top.Ext.getCmp('isSterile').enable(); - top.Ext.getCmp('isSterile').setValue('否'); - top.Ext.getCmp('isApplyEntireTousse').enable(); - - top.Ext.getCmp('isInvoice').disable(); - top.Ext.getCmp('isInvoice').setValue('是'); - }else if(top.Ext.getCmp('tousseType') == '敷料包'){ - if(top.Ext.getCmp('isRecycling').getValue() == '是'){ - //如果是否回收为是的话允许修改,如果为否,则禁用 - top.Ext.getCmp('isRecycling').enable(); - top.Ext.getCmp('isRecycling').setValue('否'); - }else{ - //如果是否回收为是的话允许修改,如果为否,则禁用 - top.Ext.getCmp('isRecycling').disable(); - } - - top.Ext.getCmp('isSterile').disable(); - top.Ext.getCmp('isSterile').setValue('是'); - top.Ext.getCmp('isApplyEntireTousse').disable(); - top.Ext.getCmp('isInvoice').enable(); - }else{ - top.Ext.getCmp('isSterile').disable(); - top.Ext.getCmp('isSterile').setValue('是'); - top.Ext.getCmp('isApplyEntireTousse').disable(); - top.Ext.getCmp('isInvoice').enable(); - - if(top.Ext.getCmp('tousseType') == '外部代理灭菌'){ - //材料扣库存设值为否,并禁用 - top.Ext.getCmp('autoOutStockForPacking').setValue('否'); - top.Ext.getCmp('autoOutStockForPacking').disable(); - - top.Ext.getCmp('isInvoice').disable(); - top.Ext.getCmp('isInvoice').setValue('是'); - } - } - - if (sstsConfig.disableIdCard){ - // 隐藏标识牌tab - tabs.hideTabStripItem(1); - } - if(id != 0){ formObj.form.load({ url : WWWROOT + '/disinfectSystem/baseData/tousseDefinitionAction!loadTousseDefinition.do', method : 'GET', waitMsg : '正在加载数据,请稍候', + params : {id : id}, success : function(form, action) { setIdCardPaperType2(); var tousseDefinition = action.result.data; top.Ext.getCmp("orginalName").setValue(tousseDefinition.name); top.Ext.getCmp("orginalSpelling").setValue(tousseDefinition.spelling); - if(hasVideo){ + if(hasVideo){ //已经上传过视频 var videoName = tousseDefinition.uuid_vedioNames; if(videoName!=null){ videoName = videoName.split(';')[0]; @@ -2114,6 +1983,8 @@ top.Ext.getCmp('vedioNamesForDisplay').setValue(videoName); } } + + //初始化此包定义的所有材料 for(var i = 0 ;i < tousseDefinition.tousseDefinitionMaterials.length;i++){ var tousseDefinitionMaterial = tousseDefinition.tousseDefinitionMaterials[i]; if(tousseDefinitionMaterial.type == '器械'){ @@ -2146,7 +2017,9 @@ }); configStore.add(material); - signMaterilenStore.add(m); + if (signMaterilenStore) { + signMaterilenStore.add(m); + } }else{ var goodsName = tousseDefinitionMaterial.diposableGoods.name; var specification = tousseDefinitionMaterial.diposableGoods.specification; @@ -2164,135 +2037,112 @@ } } - + //如果器械包类型为消毒物品,则'是否灭菌'下拉框显示实际配置值,否则赋值为'是'并禁用 var tousseType = top.Ext.getCmp('tousseType').getValue(); - var isTraceable = top.Ext.getCmp('isTraceable').getValue(); - if('是' == isTraceable){ - //top.Ext.getCmp('printTDBarcode').hide(); + if(tousseType == '器械包'){ //器械包 + top.Ext.getCmp('isApplyEntireTousse').disable(); //禁用“是否整包申请”下拉框 + top.Ext.getCmp('isSterile').disable(); //禁用“是否灭菌”下拉框 + }else if(tousseType == '敷料包'){ //敷料包 + top.Ext.getCmp('isApplyEntireTousse').disable(); //禁用“是否整包申请”下拉框 + top.Ext.getCmp('isSterile').disable(); //禁用“是否灭菌”下拉框 + top.Ext.getCmp('isRecycling').disable(); //禁用“是否回收”下拉框 + }else if(tousseType == '消毒物品'){ //消毒物品 + top.Ext.getCmp('isInvoice').disable(); //禁用“是否发货”下拉框 + }else if(tousseType == '外部代理灭菌'){ //外部代理灭菌 + top.Ext.getCmp('isApplyEntireTousse').disable(); //禁用“是否整包申请”下拉框 + top.Ext.getCmp('autoOutStockForPacking').disable(); //禁用“自动扣包内材料”下拉框 + top.Ext.getCmp('isSterile').disable(); //禁用“是否灭菌”下拉框 + top.Ext.getCmp('isInvoice').disable(); //禁用“是否发货”下拉框,并默认赋值为“是” } - - //如果器械包类型为消毒物品,则'是否灭菌'下拉框显示实际配置值,否则赋值为'是'并禁用 - if(tousseType == '消毒物品'){ - top.Ext.getCmp('isSterile').enable(); - top.Ext.getCmp('isSterile').setValue(tousseDefinition.isSterile); - top.Ext.getCmp('isApplyEntireTousse').enable(); - - top.Ext.getCmp('isInvoice').disable(); - top.Ext.getCmp('isInvoice').setValue('是'); - }else{ - top.Ext.getCmp('isSterile').disable(); - top.Ext.getCmp('isSterile').setValue('是'); - top.Ext.getCmp('isApplyEntireTousse').disable(); - - top.Ext.getCmp('isInvoice').enable(); - if(tousseType == '外部代理灭菌'){ - top.Ext.getCmp('isInvoice').disable(); - top.Ext.getCmp('isInvoice').setValue('是'); - } - } setMaterialCountAndMaterialType(materialsPanel); - }, - failure : function(form, action) {}, - params : {id : id} - }); - } - - /** - * 设置材料数量和种类 - * @param panel 材料的panel - */ - function setMaterialCountAndMaterialType(panel) { - var mStore = panel.getStore(); - var materialCount = 0; - var materialType = 0; - mStore.each(function (record) { - // 只统计机械类型的数量和种类 - if ("器械" == record.get('type')){ - materialCount += record.get('count'); - materialType++; } - // console.info(record.get('name') + ":" + record.get('type') + "-" + record.get('count')); }); - top.Ext.getCmp('materialCount').setText('材料总件数:' + materialCount); - top.Ext.getCmp('materialType').setText('材料种类:' + materialType); + } else { + packTypeStore.load(); + top.Ext.getCmp('isApplyEntireTousse').disable(); //禁用“是否整包申请”下拉框,并默认赋值为“是” + top.Ext.getCmp('isApplyEntireTousse').setValue('是'); + top.Ext.getCmp('isSterile').disable(); //禁用“是否灭菌”下拉框,并默认赋值为“是” + top.Ext.getCmp('isSterile').setValue('是'); } - - function uploadVideoWindow(videoType){ - var dialog = new top.Ext.ux.UploadDialog.Dialog({ - title: "上传" + videoType+'(注意:最大上传文件大小为500M)', - //这里我用struts2做后台处理 - url:WWWROOT + '/disinfectSystem/baseData/videoFileAction!uploadVideo.do?videoType='+videoType+'&objectId='+id , - post_var_name:'uploadFiles',//这里是自己定义的,默认的名字叫file - width : 450, - height : 300, - minWidth : 450, - minHeight : 300, - draggable : true , - resizable : true , - constraintoviewport: true , - permitted_extensions:['f4v','mp4','flv'], - modal: true , - reset_on_hide: false , - allow_close_on_upload: false , //关闭上传窗口是否仍然上传文件 - upload_autostart: false - }); - //定义文件添加事件 - dialog.on('fileadd', function(){ - if(this.grid_panel.getStore().getCount() > 1){ - showResult('每次只能上传一个视频!'); - this.grid_panel.getSelectionModel().selectLastRow(); - var selections = this.grid_panel.getSelectionModel().getSelections(); - this.fsa.postEvent('remove-files', selections); - } - }); +} - //定义上传完成回调函数 - dialog.on('uploadsuccess',function(dialog,filename,resp_data){ - if(resp_data!=null && resp_data.success){ - if( resp_data.msg==""){ - showResult("文件上传成功!"); - dialog.hide(); - top.Ext.getCmp('uploadVedio').hide();//上传视频的按钮隐藏 - top.Ext.getCmp('uuid_vedioNames').setValue(resp_data.fileName); - top.Ext.getCmp('vedioNamesForDisplay').setValue(resp_data.fileNameForDisplay); - top.Ext.getCmp('videoPanel').show(); - top.Ext.getCmp('watchPanel').show(); - top.Ext.getCmp('downloadPanel').show(); - top.Ext.getCmp('deletePanel').show(); - - updateVideoUploadStatus(videoType, id); - grid.dwrReload(); - - }else{ - showResult("文件上传失败!"); - } + +/** + * 点击“配包教学视频上传”按钮执行的函数 + * @param videoType + * @returns + */ +function uploadVideoWindow(videoType){ + var dialog = new top.Ext.ux.UploadDialog.Dialog({ + title: "上传" + videoType+'(注意:最大上传文件大小为500M)', + //这里我用struts2做后台处理 + url:WWWROOT + '/disinfectSystem/baseData/videoFileAction!uploadVideo.do?videoType='+videoType+'&objectId='+id , + post_var_name:'uploadFiles',//这里是自己定义的,默认的名字叫file + width : 450, + height : 300, + minWidth : 450, + minHeight : 300, + draggable : true , + resizable : true , + constraintoviewport: true , + permitted_extensions:['f4v','mp4','flv'], + modal: true , + reset_on_hide: false , + allow_close_on_upload: false , //关闭上传窗口是否仍然上传文件 + upload_autostart: false + }); + //定义文件添加事件 + dialog.on('fileadd', function(){ + if(this.grid_panel.getStore().getCount() > 1){ + showResult('每次只能上传一个视频!'); + this.grid_panel.getSelectionModel().selectLastRow(); + var selections = this.grid_panel.getSelectionModel().getSelections(); + this.fsa.postEvent('remove-files', selections); + } + }); + + //定义上传完成回调函数 + dialog.on('uploadsuccess',function(dialog,filename,resp_data){ + if(resp_data!=null && resp_data.success){ + if( resp_data.msg==""){ + showResult("文件上传成功!"); + dialog.hide(); + top.Ext.getCmp('uploadVedio').hide();//上传视频的按钮隐藏 + top.Ext.getCmp('uuid_vedioNames').setValue(resp_data.fileName); + top.Ext.getCmp('vedioNamesForDisplay').setValue(resp_data.fileNameForDisplay); + top.Ext.getCmp('videoPanel').show(); + top.Ext.getCmp('watchPanel').show(); + top.Ext.getCmp('downloadPanel').show(); + top.Ext.getCmp('deletePanel').show(); + + updateVideoUploadStatus(videoType, id); + grid.dwrReload(); + + }else{ + showResult("文件上传失败!"); } - }); - dialog.show(); - } - function uploadWindow(imageType){ - 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('uploadcomplete',onUploadComplete); //定义上传完成回调函数 - } - + } + }); + dialog.show(); +} +/** + * 设置材料数量和种类 + * @param panel 材料的panel + */ +function setMaterialCountAndMaterialType(panel) { + var mStore = panel.getStore(); + var materialCount = 0; + var materialType = 0; + mStore.each(function (record) { + // 只统计机械类型的数量和种类 + if ("器械" == record.get('type')){ + materialCount += record.get('count'); + materialType++; + } + }); + top.Ext.getCmp('materialCount').setText('材料总件数:' + materialCount); + top.Ext.getCmp('materialType').setText('材料种类:' + materialType); } function validateAndSubmit2(TousseName){ @@ -2343,6 +2193,11 @@ top.Ext.getCmp('isPrint').enable(); top.Ext.getCmp('isTraceable').enable(); top.Ext.getCmp('isReview').enable(); + top.Ext.getCmp('isApplyEntireTousse').enable(); //启用“是否整包申请”下拉框 + top.Ext.getCmp('isRecycling').enable(); //启用“是否回收”下拉框 + top.Ext.getCmp('isSterile').enable(); //启用“是否灭菌”下拉框 + top.Ext.getCmp('isInvoice').enable(); //启用“是否发货”下拉框 + top.Ext.getCmp('autoOutStockForPacking').enable(); //启用“自动扣包内材料”下拉框 formObj.form.submit( { url : WWWROOT + '/disinfectSystem/baseData/tousseDefinitionAction!saveTousseDefinition.do', method : 'POST', @@ -2379,11 +2234,6 @@ thiz.enable(); return false; } - if(top.Ext.getCmp("tousseType").getValue() == "消毒物品" && top.Ext.getCmp("isApplyEntireTousse").getValue() == ""){ - showResult('请填写是否整包申请!'); - thiz.enable(); - return false; - } var materialsCount = configStore.getCount(); if (materialsCount <= 0 ){ @@ -2449,6 +2299,4 @@ } }); } -} - - +} \ No newline at end of file Index: ssts-tousse/src/main/java/com/forgon/disinfectsystem/tousse/toussedefinition/dwr/table/TousseDefinitionTableManager.java =================================================================== diff -u -r17250 -r17273 --- ssts-tousse/src/main/java/com/forgon/disinfectsystem/tousse/toussedefinition/dwr/table/TousseDefinitionTableManager.java (.../TousseDefinitionTableManager.java) (revision 17250) +++ ssts-tousse/src/main/java/com/forgon/disinfectsystem/tousse/toussedefinition/dwr/table/TousseDefinitionTableManager.java (.../TousseDefinitionTableManager.java) (revision 17273) @@ -297,7 +297,11 @@ return ""; } - + /** + * 获取指定id的器械包定义上传的视频数量. + * @param tousseDefinitionId 器械包id + * @return + */ public int getUploadVideoCount(String tousseDefinitionId) { int count = 0; TousseDefinition tousseDefinition = tousseDefinitionManager Index: ssts-tousse/src/main/java/com/forgon/disinfectsystem/tousse/toussedefinition/service/TousseDefinitionManager.java =================================================================== diff -u -r17019 -r17273 --- ssts-tousse/src/main/java/com/forgon/disinfectsystem/tousse/toussedefinition/service/TousseDefinitionManager.java (.../TousseDefinitionManager.java) (revision 17019) +++ ssts-tousse/src/main/java/com/forgon/disinfectsystem/tousse/toussedefinition/service/TousseDefinitionManager.java (.../TousseDefinitionManager.java) (revision 17273) @@ -26,6 +26,11 @@ public void saveOrUpdate(TousseDefinition tousseDefinition); + /** + * 根据id获取TousseDefinition对象. + * @param id + * @return + */ public TousseDefinition getTousseDefinitionById(String id); public TousseDefinition getTousseDefinitionById(Long id); Index: ssts-web/src/main/webapp/disinfectsystem/basedatamanager/tousse/comboTousse.js =================================================================== diff -u -r17250 -r17273 --- ssts-web/src/main/webapp/disinfectsystem/basedatamanager/tousse/comboTousse.js (.../comboTousse.js) (revision 17250) +++ ssts-web/src/main/webapp/disinfectsystem/basedatamanager/tousse/comboTousse.js (.../comboTousse.js) (revision 17273) @@ -116,16 +116,7 @@ return false; } id = records[0].data['id']; - addAndEditTousse(id, records[0].data['isUploadVideo']); - // var type = records[0].data['tousseType']; - // if (type == PACKAGE_TYPE_FOREIGN) { - // addAndEditForeignTousseDefinition(id); - // } else if (type == PACKAGE_TYPE_CUSTOM) { - // addAndEditCustomTousse(null, id, "00", refresh); - // } else { - // addAndEditTousse(id, records[0].data['isUploadVideo']); - // } - + addAndEditComboTousse(id, records[0].data['isUploadVideo']); }; /** @@ -243,7 +234,7 @@ hidden: SSTS_ComboTousse_add, iconCls: 'btn_ext_application_add', handler: function () { - addAndEditTousse(0, '否'); + addAndEditComboTousse(0, '否'); } }, '-', { text: '修改',