Index: ssts-web/src/main/webapp/disinfectsystem/returnMaterialRecord/returnMaterialRecordForm.js =================================================================== diff -u -r18491 -r26062 --- ssts-web/src/main/webapp/disinfectsystem/returnMaterialRecord/returnMaterialRecordForm.js (.../returnMaterialRecordForm.js) (revision 18491) +++ ssts-web/src/main/webapp/disinfectsystem/returnMaterialRecord/returnMaterialRecordForm.js (.../returnMaterialRecordForm.js) (revision 26062) @@ -713,6 +713,27 @@ }], buttonAlign :'center', buttons : [{ + text : '打印', + handler : function() { + var title = ""; + var reIds = top.Ext.getCmp("id").getValue(); + Ext.Ajax.request({ + url : WWWROOT + '/disinfectSystem/returnMaterialRecordAction!printReturnMaterial.do', + params : {ids : reIds}, + async : false, + success : function(response, options) { + var operator = top.Ext.getCmp('operator').getValue(); + var depart = top.Ext.getCmp('depart').getValue(); + var totalMoney = top.Ext.getCmp('totalMoney').getValue(); + var remark = top.Ext.getCmp('remark').getValue(); + var res = JSON.parse(response.responseText); + var returnTime = res.data[0].returnTimeStr; + var returnGoodsItems = getReturnMaterialDetailGridDataToPrint(res.data[0].returnGoodsItems); + printReturnMaterialRecord(title,operator,returnTime,depart,totalMoney,remark,returnGoodsItems,0); + } + }); + } + },{ text : '保存', id : 'saveBtn', hidden:SSTS_ReturnGoodsRecord_Create && SSTS_ReturnGoodsRecord_Update, @@ -767,7 +788,21 @@ } }] }); - + //打印退货记录的数据处理 + function getReturnMaterialDetailGridDataToPrint(result) { + var goodsDetail = []; + for ( var i = 0; i < result.length; i++) { + var item = {}; + item.id = result[i].id; + item.materialName = result[i].materialName; + item.amount = result[i].amount; + item.price = result[i].price; + item.settlementPrice = result[i].settlementPrice; + goodsDetail.push(item); + } + return goodsDetail; + } + var win = new top.Ext.Window({ id : 'returnGoodsRecordWin', layout : 'fit',