Index: ssts-web/src/main/webapp/disinfectsystem/config/gdsy/config.js =================================================================== diff -u -r18295 -r18309 --- ssts-web/src/main/webapp/disinfectsystem/config/gdsy/config.js (.../config.js) (revision 18295) +++ ssts-web/src/main/webapp/disinfectsystem/config/gdsy/config.js (.../config.js) (revision 18309) @@ -183,6 +183,8 @@ // 科室申领供应室用户在申请单打印后是否允许编辑物品申请数量 allowEditApplyFormAfterPrint : true, //灭菌装载空闲刷新倒计时(单位:秒),未配置此参数的不在页面出现倒计时的提醒信息 - steriliLoadingFreeRefreshIntervalSecond : 10 + steriliLoadingFreeRefreshIntervalSecond : 10, + //是否显示一次性物品总价格 + showDisposableGoodTotalAmount : true } \ No newline at end of file Index: ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/goodsTemplateApplicationView.js =================================================================== diff -u -r18253 -r18309 --- ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/goodsTemplateApplicationView.js (.../goodsTemplateApplicationView.js) (revision 18253) +++ ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/goodsTemplateApplicationView.js (.../goodsTemplateApplicationView.js) (revision 18309) @@ -196,6 +196,28 @@ } } +/** + * 获取一次性物品总价格 + */ +function getDisposableGoodTotalAmount(store){ + var nodes = store.getRootNode().childNodes; + var totalPrice = 0; + top.Ext4.each(nodes, function (item) { + totalPrice = add(totalPrice, item.get("totalPrice")); + }); + return totalPrice; +} + +/** + * 设置一次性物品总价格 + */ +function setDisposableGoodTotalAmount(store) { + var totalPrice = getDisposableGoodTotalAmount(store); + var disposableGoodTotalAmount = top.Ext4.getCmp('disposableGoodTotalAmount'); + disposableGoodTotalAmount.setValue(Number(totalPrice).toFixed(2)); + disposableGoodTotalAmount.getEl().dom.style.marginTop = '2px'; +} + function formartNumber(v,p,record,rowIndex, columnIndex, store){ if (typeof(record) == 'undefined'){ @@ -624,7 +646,13 @@ type : 'json', root : 'children' } - } + }, + listeners: { + load: function(store, records, eOpts){ + //等右边的store加载完才能算出物品的总价格 + setDisposableGoodTotalAmount(store); + } + } }); //展示器械包信息renderer @@ -1058,6 +1086,9 @@ afterAddItem(); } } + + //添加物品后更新一次性物品的总价格 + setDisposableGoodTotalAmount(rightTemplateStore); } @@ -2002,6 +2033,9 @@ var node = nodesSelected[0]; updateDisinfectParentNode(node); } + //重新设置一次性物品的总价格 + setDisposableGoodTotalAmount(rightTemplateStore); + //var total = sumTotal(context.grid.getStore()); //o.grid.setTitle("器械包申请单(总计金额:"+roundValue(total)+")"); } @@ -2803,9 +2837,18 @@ id: 'unitInfoDisplayField', name: 'unitInfoDisplayField', value: '' - } - ] - }) + },{ + text: "合计金额:", + hidden: formType !== '一次性物品申请单' || !sstsConfig.showDisposableGoodTotalAmount + },{ + xtype: 'displayfield', + fieldLabel: '', + id: 'disposableGoodTotalAmount', + name: 'disposableGoodTotalAmount', + hidden: formType !== '一次性物品申请单' || !sstsConfig.showDisposableGoodTotalAmount, + value: '' + }] + }) ] } ],