Index: ssts-web/src/main/webapp/disinfectsystem/invoice/invoiceSignViewVersion2.js =================================================================== diff -u -r29300 -r35541 --- ssts-web/src/main/webapp/disinfectsystem/invoice/invoiceSignViewVersion2.js (.../invoiceSignViewVersion2.js) (revision 29300) +++ ssts-web/src/main/webapp/disinfectsystem/invoice/invoiceSignViewVersion2.js (.../invoiceSignViewVersion2.js) (revision 35541) @@ -22,8 +22,30 @@ grid.dwrReload(); } +function showImagePanel(objectId) { + var url = WWWROOT + '/disinfectSystem/baseData/showImageAction!getImage.do?objectId='+objectId+'&page=1&imageType='+encodeURIComponent("PDA端签收签名(横屏版)")+'&showSourceImg=true' + '&time=' + new Date().getTime(); + var imageBrowse = Ext.get('imageBrowse'); + var img = imageBrowse.dom; + img.src = url; + img.onload = function () { + if (img.width > img.height) { + img.style.height = '100%'; + img.style.width = 'auto'; + } else { + img.style.height = 'auto'; + img.style.width = '100%'; + } + img.style.display = 'block'; + }; +} + Ext.onReady(function() { Ext4.tip.QuickTipManager.init(); + var enableHandwrittenSignatureFunction = sstsConfig.enableHandwrittenSignatureFunction; + var height = document.body.clientHeight-60; + if(enableHandwrittenSignatureFunction){ + height = document.body.clientHeight - 360; + } var readerDetail = [ {name : 'id'}, {name : 'signUserName'}, @@ -81,14 +103,22 @@ }, [ {name : 'tousseName'}, {name : 'barcode'}, + {name : 'id'}, {name : 'amount'} ]) }); invoiceSignDetailStore.on("beforeload", function(thiz, options) { thiz.baseParams["signRecordId"] = invoiceSignRecordId; }); + invoiceSignDetailStore.on("load", function (store, recordArry, options) { + if(recordArry.length > 0){ + if(enableHandwrittenSignatureFunction){ + var id = recordArry[0].data.id + showImagePanel(id); + } + } + }); - var invoiceSignDetailStoreCm = new Ext.grid.ColumnModel([ {header : "物品名称",dataIndex : 'tousseName',width : 190}, {header : "器械包条码",dataIndex :'barcode',width : 80}, @@ -101,13 +131,21 @@ store : invoiceSignDetailStore, cm : invoiceSignDetailStoreCm, enableHdMenu : false, - width :423, - height :425, loadMask : true, + height:height, autoExpandColumn : 'amount', frame : false, enableKeyEvents: true, bodyStyle : 'border:1px solid #afd7af', + listeners: { + 'rowclick': function(grid, rowIndex, e) { + if(enableHandwrittenSignatureFunction){ + var id = invoiceSignDetailStore.getAt(rowIndex).data.id; + showImagePanel(id) + } + + } + }, viewConfig: { forceFit:true } @@ -172,7 +210,47 @@ xtype : 'panel', layout: 'fit', width: "33%", - items:centerGrid + height: document.body.clientHeight, + items:[{ + region:'vbox', + height: document.body.clientHeight, + items:[{ + flex:1, + height: height, + width:'100%', + items:centerGrid + },{ + flex:2, + width:'100%', + height:300, + hidden:!enableHandwrittenSignatureFunction, + items:[new Ext.Panel({ + title:'手写签名', + items: [{ + xtype: 'panel', + id: 'pageToolbar', + }, new Ext.Panel({ + id: 'imagePanel', + layout: 'fit', + height:270, + style:'text-align: center;', + items: [{ + xtype: 'box', + id: 'browseImage', + fieldLabel: "预览图片", + autoEl: { + id: 'imageBrowse', + tag: 'img', + autoHeight: true, + src: '', + style: 'filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale);display: none;margin:0 auto', + complete: 'off' + } + }] + })] + })] + }] + }] },{ region:'east', xtype : 'panel',