Index: ssts-web/src/main/webapp/disinfectsystem/basedatamanager/tousse/tousseForm.js =================================================================== diff -u -r23793 -r23882 --- ssts-web/src/main/webapp/disinfectsystem/basedatamanager/tousse/tousseForm.js (.../tousseForm.js) (revision 23793) +++ ssts-web/src/main/webapp/disinfectsystem/basedatamanager/tousse/tousseForm.js (.../tousseForm.js) (revision 23882) @@ -104,6 +104,55 @@ openModalWindow(WWWROOT+"/disinfectsystem/basedatamanager/tousse/watchVideo.jsp?"+url, "观看配包教学视频", "600", "400"); } +function sortFun_sequence_asc(r1,r2){ + var sequence1Str = r1.get('sequence'); + var sequence2Str = r2.get('sequence'); + if(isUndefinedOrNullOrEmpty(sequence1Str) && isUndefinedOrNullOrEmpty(sequence2Str)){ + return 0; + }else if(isUndefinedOrNullOrEmpty(sequence1Str)){ + return -1; + }else if(isUndefinedOrNullOrEmpty(sequence2Str)){ + return 1; + } + var sequence1 = Number(sequence1Str); + var sequence2 = Number(sequence2Str); + + return sequence1 - sequence2; +} +function reorderMaterialGrid(){ + var store = top.Ext.getCmp('configGrid').getStore(); + var records = []; + for (var i = 0; i < store.getCount(); i++) { + var record = store.getAt(i); + records.push(record); + } + records.sort(sortFun_sequence_asc); + store.removeAll(); + store.add(records); +} +function moveMaterial(){ + var rows = top.Ext.getCmp('configGrid').getSelectionModel().getSelections();// 返回值为 Record 数组 + if (rows.length != 1) { + showResult('请选择材料!'); + } + var record = rows[0]; + top.Ext.MessageBox.prompt("提示","请输入序号",function(bu, txt){ + if(bu == 'ok'){ + if(!isDigital(txt)){ + showResult('请输入大于0的数字!'); + return false; + } + var num = Number(txt); + if(num <= 0){ + showResult('请输入大于0的数字!'); + return false; + } + moveMaterialByLineNumber(num); + }else{ + return false; + } + }); +} function newRow(){ var n = top.Ext.getCmp('configGrid').getStore().getCount();// 获得总行数 var p = new materialDefinitionConfig({ @@ -125,6 +174,22 @@ record.set('sequence',i+1); } } +function moveMaterialByLineNumber(lineNumber) { + var rows = top.Ext.getCmp('configGrid').getSelectionModel().getSelections();// 返回值为所点击的行 + var configStore = top.Ext.getCmp('configGrid').getStore(); + var indexInsertTo = lineNumber-1; + if (rows) { + for ( var i = 0; i < rows.length; i++) { + var index = configStore.indexOf(rows[i]); + if (index != -1) { + configStore.remove(rows[i]); + var maxIndex = configStore.getCount(); + configStore.insert(Math.min(maxIndex,indexInsertTo), rows[i]); + } + } + } + setMaterialSequence(); +} function moveTopMaterial() { var rows = top.Ext.getCmp('configGrid').getSelectionModel().getSelections();// 返回值为所点击的行 var configStore = top.Ext.getCmp('configGrid').getStore(); @@ -137,6 +202,7 @@ } } } + setMaterialSequence(); } function moveUpMaterial() { @@ -151,6 +217,7 @@ } } } + setMaterialSequence(); } function moveDownMaterial() { @@ -166,6 +233,7 @@ } } } + setMaterialSequence(); } function moveBottomMaterial() { @@ -181,6 +249,7 @@ } } } + setMaterialSequence(); } function setFieldsHide(hidden){ if(hidden){ @@ -513,7 +582,7 @@ }, { id : 'countShow', header : "数量", - width : 40, + width : 30, dataIndex : 'countShow', editor : new top.Ext.form.NumberField( { allowBlank : false, @@ -558,9 +627,40 @@ { id:'isImplant', header:"是否植入物", - width : 70, + width : 35, dataIndex:'isImplant' },{ + id : 'sequence', + header : "排序", + width : 30, + dataIndex : 'sequence' +// editor : new top.Ext.form.NumberField( { +// allowBlank : false, +// minValue:1, +// listeners:{ +// specialKey : function(field,event){ +// var eventKey = event.getKey(); +// if(eventKey == 13){ +// field.getValue(); +// } +// }, +// focus : function(field){ +// +// }, +// change : function(field,newV,oldV){ +// var ncount = parseInt(newV); +// if(ncount > 0){ +// field.setValue(newV); +// }else{ +// field.setValue(oldV); +// } +//// alert(oldV+','+newV) +// },blur : function (field){ +// field.getValue(); +// } +// } +// }) + },{ id : 'moveItem', header:'移动', width : 100, @@ -611,7 +711,7 @@ name : 'configGrid', store : configStore, cm : materialCm, - height:300, + height:600, // width : 358, frame : false, bodyStyle : 'border:1px solid #afd7af', @@ -658,6 +758,19 @@ text : '材料种类:', id : 'materialType' // style : 'margin-top:1px' + },{ + text : '刷新', +// hidden: true, + iconCls : 'btn_ext_add', + handler : function() { +// reorderMaterialGrid(); + } + },{ + text : '移动', + iconCls : 'btn_ext_add', + handler : function() { + moveMaterial(); + } }], listeners: { beforeedit: function(obj){ @@ -671,6 +784,8 @@ } } }); + + var colWidth = 0.33; formObj = new top.Ext.FormPanel({ id : 'tousseDefinitionForm', frame : true, @@ -679,9 +794,10 @@ fileUpload : true, bodyStyle : 'padding:5px 5px 0px 5px;', width: 900, + columnWidth: 0.6, labelWidth : 90, autoScroll : true, - height : 600, + height : top.screen.height > 800 ? 610 : 450, items : [{ xtype : 'hidden', name : 'id', @@ -741,7 +857,7 @@ layout : 'column', autoHeight : true, items : [{ - columnWidth : .25, + columnWidth : colWidth, layout : 'form', labelWidth : fontSize == 12 ? 90 : 100, labelAlign:"right", @@ -761,7 +877,7 @@ } }] },{ - columnWidth : .25, + columnWidth : colWidth, layout : 'form', items:[{ xtype : 'combo', @@ -842,7 +958,7 @@ anchor : '100%' }] }, { - columnWidth : .25, + columnWidth : colWidth, layout : 'form', labelWidth : fontSize == 12 ? 90 : 100, labelAlign:"right", @@ -865,7 +981,7 @@ anchor : '100%' }] }, { - columnWidth : .25, + columnWidth : colWidth, layout : 'form', labelWidth : fontSize == 12 ? 90 : 120, labelAlign:"right", @@ -889,7 +1005,7 @@ anchor : '100%' }] },{ - columnWidth : .25, + columnWidth : colWidth, layout : 'form', labelWidth : fontSize == 12 ? 90 : 100, labelAlign:"right", @@ -929,7 +1045,7 @@ } }] },{ - columnWidth : .25, + columnWidth : colWidth, layout : 'form', labelAlign:"right", items:[{ @@ -954,7 +1070,7 @@ } }] }, { - columnWidth : .25, + columnWidth : colWidth, layout : 'form', labelAlign:"right", labelWidth : fontSize == 12 ? 90 : 100, @@ -973,7 +1089,7 @@ allowBlank : false }] },{ - columnWidth : .25, + columnWidth : colWidth, layout : 'form', labelWidth : fontSize == 12 ? 90 : 100, labelAlign:"right", @@ -996,7 +1112,7 @@ }] },{ - columnWidth : .25, + columnWidth : colWidth, layout : 'form', labelWidth : fontSize == 12 ? 90 : 120, labelAlign:"right", @@ -1021,7 +1137,7 @@ anchor : '100%' }] }, { - columnWidth : .25, + columnWidth : colWidth, layout : 'form', labelWidth : fontSize == 12 ? 90 : 100, labelAlign:"right", @@ -1035,7 +1151,7 @@ anchor : '100%' }] }, { - columnWidth : .25, + columnWidth : colWidth, layout : 'form', items:[{ xtype : 'textfield', @@ -1048,7 +1164,7 @@ anchor : '100%' }] }, { - columnWidth : .25, + columnWidth : colWidth, layout : 'form', labelWidth : fontSize == 12 ? 90 : 100, labelAlign:"right", @@ -1071,7 +1187,7 @@ } }] },{ - columnWidth : .25, + columnWidth : colWidth, layout : 'form', hidden : !sstsConfig.enableDiscountPrice, items:[{ @@ -1093,7 +1209,7 @@ } }] },{ - columnWidth : .25, + columnWidth : colWidth, layout : 'form', labelWidth : fontSize == 12 ? 90 : 120, labelAlign:"right", @@ -1115,7 +1231,7 @@ } }] }, { - columnWidth : .25, + columnWidth : colWidth, layout : 'form', labelWidth : fontSize == 12 ? 90 : 100, labelAlign:"right", @@ -1137,7 +1253,7 @@ } }] }, { - columnWidth : .25, + columnWidth : colWidth, layout : 'form', items:[{ xtype : 'combo', @@ -1158,7 +1274,7 @@ anchor : '100%' }] }, { - columnWidth : .25, + columnWidth : colWidth, layout : 'form', labelWidth : fontSize == 12 ? 90 : 100, labelAlign:"right", @@ -1177,7 +1293,7 @@ anchor : '100%' }] }, { - columnWidth : .25, + columnWidth : colWidth, layout : 'form', labelWidth : fontSize == 12 ? 90 : 120, labelAlign:"right", @@ -1197,7 +1313,7 @@ anchor : '100%' }] }, { - columnWidth : .25, + columnWidth : colWidth, layout : 'form', labelWidth : fontSize == 12 ? 90 : 100, labelAlign:"right", @@ -1210,7 +1326,7 @@ anchor : '100%' }] },{ - columnWidth : .25, + columnWidth : colWidth, layout : 'form', items:[{ xtype : 'combo', @@ -1228,7 +1344,7 @@ anchor : '100%' }] }, { - columnWidth : .25, + columnWidth : colWidth, layout : 'form', labelWidth : fontSize == 12 ? 90 : 100, labelAlign:"right", @@ -1252,7 +1368,7 @@ anchor : '100%' }] }, { - columnWidth : .25, + columnWidth : colWidth, layout : 'form', labelWidth : fontSize == 12 ? 90 : 120, labelAlign:"right", @@ -1296,7 +1412,7 @@ } }] }, { - columnWidth : .25, + columnWidth : colWidth, layout : 'form', labelWidth : fontSize == 12 ? 90 : 100, labelAlign:"right", @@ -1342,7 +1458,7 @@ } }] },{ - columnWidth : .25, + columnWidth : colWidth, layout : 'form', labelWidth : fontSize == 12 ? 120 : 160, labelAlign:"right", @@ -1366,7 +1482,7 @@ anchor : '100%' }] },{ - columnWidth : .25, + columnWidth : colWidth, layout : 'form', labelWidth : fontSize == 12 ? 90 : 100, labelAlign:"right", @@ -1390,7 +1506,7 @@ anchor : '100%' }] },{ - columnWidth : .25, + columnWidth : colWidth, layout : 'form', labelWidth : fontSize == 12 ? 90 : 120, labelAlign:"right", @@ -1405,7 +1521,7 @@ anchor : '100%' }] }, { - columnWidth : .25, + columnWidth : colWidth, layout : 'form', labelWidth : fontSize == 12 ? 90 : 100, labelAlign:"right", @@ -1443,7 +1559,7 @@ }] }, { - columnWidth : .25, + columnWidth : colWidth, layout : 'form', items:[{ xtype : 'combo', @@ -1476,7 +1592,7 @@ }] },{ - columnWidth : .25, + columnWidth : colWidth, layout : 'form', labelWidth : fontSize == 12 ? 120 : 160, items:[{ @@ -1500,7 +1616,7 @@ }] },{ - columnWidth : .25, + columnWidth : colWidth, layout : 'form', labelWidth : fontSize == 12 ? 90 : 100, labelAlign:"right", @@ -1523,7 +1639,7 @@ }] },{ - columnWidth : .25, + columnWidth : colWidth, layout : 'form', hidden : !sstsConfig.enableIsInvoice, items:[{ @@ -1546,7 +1662,7 @@ }] }, { - columnWidth : .25, + columnWidth : colWidth, layout : 'form', hidden : sstsConfig && sstsConfig.enableTousseDefinitionIsPecPackConfig ? false : true, items:[{ @@ -1567,7 +1683,7 @@ anchor : '100%' }] },{ - columnWidth : .25, + columnWidth : colWidth, layout : 'form', id:"scanAmount", labelWidth : fontSize == 12 ? 90 : 120, @@ -1587,7 +1703,7 @@ }] },{ - columnWidth : .25, + columnWidth : colWidth, layout : 'form', labelWidth : fontSize == 12 ? 90 : 100, labelAlign:"right", @@ -1612,7 +1728,7 @@ },{ - columnWidth : .25, + columnWidth : colWidth, layout : 'form', items:[{ xtype : 'combo', @@ -1635,7 +1751,7 @@ }] },{ - columnWidth : .25, + columnWidth : colWidth, layout : 'form', items:[{ xtype : 'combo', @@ -1656,7 +1772,7 @@ anchor : '100%' }] },{ - columnWidth : .25, + columnWidth : colWidth, layout : 'form', id:"unitField", labelWidth : fontSize == 12 ? 90 : 100, @@ -1670,7 +1786,7 @@ anchor : '100%' }] },{ - columnWidth : .25, + columnWidth : colWidth, layout : 'form', hidden : hiddenEndBarcode, labelWidth : fontSize == 12 ? 90 : 120, @@ -1685,7 +1801,7 @@ anchor : '100%' }] },{ - columnWidth : .25, + columnWidth : colWidth, layout : 'form', labelWidth : fontSize == 12 ? 90 : 100, labelAlign:"right", @@ -1717,7 +1833,7 @@ } }] },{ - columnWidth : .25, + columnWidth : colWidth, layout : 'form', items:[{ xtype : 'combo', @@ -1734,7 +1850,7 @@ anchor : '100%' }] },{ - columnWidth : .25, + columnWidth : colWidth, layout : 'form', labelWidth : fontSize == 12 ? 90 : 100, labelAlign:"right", @@ -1748,7 +1864,7 @@ anchor : '100%' }] },{ - columnWidth : .25, + columnWidth : colWidth, layout : 'form', labelWidth : fontSize == 12 ? 90 : 120, labelAlign:"right", @@ -1760,7 +1876,7 @@ anchor : '100%' }] },{ - columnWidth : .25, + columnWidth : colWidth, layout : 'form', labelWidth : fontSize == 12 ? 90 : 120, labelAlign:"right", @@ -1785,7 +1901,7 @@ }] },{ - columnWidth : .25, + columnWidth : colWidth, layout : 'form', labelWidth : fontSize == 12 ? 90 : 100, labelAlign:"right", @@ -1820,7 +1936,7 @@ } }] }, { - columnWidth : .25, + columnWidth : colWidth, layout : 'form', labelWidth : fontSize == 12 ? 90 : 100, labelAlign:"right", @@ -1845,7 +1961,7 @@ anchor : '100%' }] }, { - columnWidth : .25, + columnWidth : colWidth, hidden : true,//由于新增了打印科室来源属性,所以该属性隐藏 layout : 'form', items:[{ @@ -1868,7 +1984,7 @@ anchor : '100%' }] },{ - columnWidth : .25, + columnWidth : colWidth, layout : 'form', labelWidth : fontSize == 12 ? 90 : 100, labelAlign:"right", @@ -1892,7 +2008,7 @@ anchor : '100%' }] },{ - columnWidth : .25, + columnWidth : colWidth, layout : 'form', hidden : !sstsConfig.isShowTousseDefinitionPrintMaterials, labelWidth : fontSize == 12 ? 90 : 100, @@ -1917,7 +2033,7 @@ anchor : '100%' }] },{ - columnWidth : .25, + columnWidth : colWidth, layout : 'form', labelWidth : fontSize == 12 ? 90 : 120, labelAlign:"right", @@ -1941,7 +2057,7 @@ } }] },{ - columnWidth : .25, + columnWidth : colWidth, layout : 'form', labelWidth : fontSize == 12 ? 90 : 100, labelAlign:"right", @@ -1963,7 +2079,7 @@ } }] },{ - columnWidth : .25, + columnWidth : colWidth, layout : 'form', labelWidth : fontSize == 12 ? 90 : 100, labelAlign:"right", @@ -1985,7 +2101,7 @@ } }] },{ - columnWidth : .25, + columnWidth : colWidth, layout : 'form', labelWidth : fontSize == 12 ? 90 : 100, labelAlign:"right", @@ -1999,7 +2115,7 @@ anchor : '100%' }] },{ - columnWidth : .25, + columnWidth : colWidth, layout : 'form', labelWidth : fontSize == 12 ? 90 : 120, labelAlign:"right", @@ -2022,7 +2138,7 @@ anchor : '100%' }] },{ - columnWidth : .25, + columnWidth : colWidth, layout : 'form', labelWidth : fontSize == 12 ? 90 : 100, labelAlign:"right", @@ -2046,7 +2162,7 @@ anchor : '100%' }] },{ - columnWidth : .25, + columnWidth : colWidth, layout : 'form', labelWidth : fontSize == 12 ? 90 : 120, labelAlign:"right", @@ -2089,7 +2205,7 @@ } }] },{ - columnWidth : .25, + columnWidth : colWidth, layout : 'form', labelWidth : fontSize == 12 ? 90 : 120, labelAlign:"right", @@ -2112,7 +2228,7 @@ anchor : '100%' }] },{ - columnWidth : .25, + columnWidth : colWidth, layout : 'form', labelWidth : fontSize == 12 ? 90 : 100, labelAlign:"right", @@ -2201,12 +2317,8 @@ }] }] }, { - columnWidth : 0.5, + columnWidth : 0.9, layout : 'form', - items : [materialsPanel] - }, { - columnWidth : 0.5, - layout : 'form', bodyStyle : 'border:1px solid #afd7af', height:300, labelWidth : 60, @@ -2215,15 +2327,15 @@ ] }] }], - buttons : [{ + buttons : [{ id : 'saveBtn', text : '保存', handler : function(){ save2(null,this); } }, { xtype:'button', - text:"另存为新的器械包", + text:"另存为", id:"saveAsTousse", listeners:{ click:function(thiz){ @@ -2250,34 +2362,58 @@ printTDBarcode(id); } }, { - text : '器械包图片管理', + text : '器械包图片', id : 'uploadFile', hidden:id == 0?true:false, handler : function(){ uploadToussePackingImageFile(imageTypeTousse,id); } }, { - text : '说明书管理', + text : '说明书', id : 'uploadFile', hidden:id == 0?true:false, handler : function(){ uploadToussePackingImageFile(imageTypeSpecification,id); } - }, { - text : '装配教学图片管理', + },{ + text : '装配教学图片', id : 'uploadToussePackingImageFile', hidden:id == 0?true:false, handler : function(){ uploadToussePackingImageFile(imageTypeToussePacking,id); } }, { - text : '配包教学视频上传', + text : '配包教学视频', id : 'uploadVedio', hidden:hasVideo || id==0, handler : function(){ uploadVideoWindow(videoType); } }] +// listeners: { +// render : function() { +// var tbar2 = new top.Ext.Toolbar ({ +// items : [{ +// text : '装配教学图片管理', +// id : 'uploadToussePackingImageFile', +// hidden:id == 0?true:false, +// handler : function(){ +// uploadToussePackingImageFile(imageTypeToussePacking,id); +// } +// }, { +// text : '配包教学视频上传', +// id : 'uploadVedio', +// hidden:hasVideo || id==0, +// handler : function(){ +// uploadVideoWindow(videoType); +// } +// } +// ] +// }); +// var c = top.Ext.getCmp('tousseDefinitionForm'); +// tbar2.render(this.bbar); +// } +// } }); var tabs; @@ -2290,9 +2426,14 @@ deferredRender :false, items:[{ id : 'abc', - layout : 'fit', + layout : 'column', title: '基本信息', - items:[formObj] +// autoScroll : true, + items:[formObj,{ + columnWidth: 0.4, + layout : 'fit', + items:[materialsPanel] + }] },{ id : 'signBoardID', layout : 'fit', @@ -2306,12 +2447,21 @@ id : 'tousseWin', layout : 'fit', title : '器械包信息', - width : fontSize == 12 ? 900 : 1000, + width : fontSize == 12 ? 1200 : 1300, border : false, modal : true, height : top.screen.height > 800 ? 660 : 500, plain : true, - items : [tabs ? tabs : formObj] + items : [tabs ? tabs : { + id : 'abc', + layout : 'column', + title: '基本信息', + items:[formObj,{ + columnWidth: 0.4, + layout : 'fit', + items:[materialsPanel] + }] + }] }); tousseWin.show(); @@ -2362,6 +2512,7 @@ count : mi.count, countShow : mi.count, price : materialDefinition.disinfectionPrice, + sequence: mi.sequence, isImplant:isImplant }); var m = new materialConfig({ Index: ssts-web/src/main/webapp/disinfectsystem/basedatamanager/tousse/tousseView.jsp =================================================================== diff -u -r23578 -r23882 --- ssts-web/src/main/webapp/disinfectsystem/basedatamanager/tousse/tousseView.jsp (.../tousseView.jsp) (revision 23578) +++ ssts-web/src/main/webapp/disinfectsystem/basedatamanager/tousse/tousseView.jsp (.../tousseView.jsp) (revision 23882) @@ -121,6 +121,7 @@ +