Pārlūkot izejas kodu

Merge branch 'dev' of ssh://10.10.100.21/source/saas-platform into dev

chenw 6 gadi atpakaļ
vecāks
revīzija
5d0c8f92e0

+ 38 - 105
applications/money/money-server/src/main/resources/mapper/ProfitdetailMapper.xml

@@ -20,125 +20,58 @@
   </sql>
 
   <select id="selectByCondition" parameterType="java.lang.Long" resultMap="BaseResultMap">
-   SELECT
-	a.pi_custcode,
-	a.pi_custname,
-	a.cu_type,
-	a.cu_sellername,
-	  IFNULL(a.saamount*a.pi_rate,0) as saamount,
-	  IFNULL(a.netamount*a.pi_rate,0) as netamount,
-	  IFNULL(a.costamount*a.pi_rate,0) as costamount,
-	  IFNULL(SUM(a.netamount*a.pi_rate - a.costamount*a.pi_rate),0) as profit,
-	  IFNULL((SUM(a.netamount*a.pi_rate - a.costamount*a.pi_rate)/IFNULL(a.netamount*a.pi_rate,SUM(a.netamount*a.pi_rate - a.costamount*a.pi_rate))),0) as profitpresent
-
-FROM
-	(
-		SELECT
-	        pi_rate,
-			pi_custcode,
-			pi_custname,
-	        cu_type,
-			cu_sellername,
-	  SUM(
-	  IFNULL(pd_sendprice,0) * (IFNULL(pd_outqty,0) - IFNULL(pd_inqty,0))
-	  ) AS saamount,
-	  SUM(
-	  IFNULL(pd_netprice,0) * (IFNULL(pd_outqty,0) - IFNULL(pd_inqty,0))
-	  ) AS netamount,
-	  SUM(
-	  IFNULL(pd_price,0) * (IFNULL(pd_outqty,0) - IFNULL(pd_inqty,0))
-	  ) AS costamount
-		FROM
-			prodinout,
-			prodiodetail,
-			customer
-    <where>
-      <if test="con != null">
-        ${con}
-      </if>
-      <if test="companyId != null">
-        and  prodinout.companyid = #{companyId}
-      </if>
-    </where>
-		and	pi_id = pd_piid
-		AND pi_custid = cu_id and pi_status = '已审核' and
-prodinout.companyid= prodiodetail.companyid
-		GROUP BY
-			pi_custcode,
-			pi_custname,
-	        cu_type,
-			cu_sellername,
-	        pi_rate
-	) a
-	  where saamount + netamount + costamount != 0
-	  GROUP BY
-	        a.pi_rate,
-			a.pi_custcode,
-			a.pi_custname,
-	        a.cu_type,
-			a.cu_sellername
-	  ORDER BY a.pi_custname asc,a.pi_custname desc
+	  select
+	      cu_type,
+		  pi_custid,
+		  pi_custcode,
+		  pi_custname,
+		  sum(pd_sendprice*pi_rate) as saamount,
+		  sum(pd_price) as costamount,
+	  	  sum(pd_sendprice*pi_rate)-sum(pd_price) as profit,
+		  (sum(pd_sendprice*pi_rate)-sum(pd_price) )/sum(pd_sendprice*pi_rate) as profitpresent
+	  from prodiodetail
+	  left join prodinout on pd_piid=pi_Id
+	  left join customer on cu_id = pi_custid
+	  <where>
+		  <if test="con != null">
+			  ${con}
+		  </if>
+		  <if test="companyId != null">
+			  and  prodinout.companyid = #{companyId}
+		  </if>
+		  and pi_class in('出货单','销售退货单')
+	  </where>
+	  group by pi_custid,pi_custcode,pi_custname,cu_type
+	  ORDER BY pi_custname asc
   </select>
 
 	<select id="selectCalculateFields" resultType="string">
 		SELECT ${fields}
-		FROM
-		(
-		SELECT
-		a.pi_custcode,
-		a.pi_custname,
-		a.cu_type,
-		a.cu_sellername,
-		IFNULL(a.saamount,0) as saamount,
-		IFNULL(a.netamount,0) as netamount,
-		IFNULL(a.costamount,0) as costamount,
-		IFNULL(SUM(a.netamount - a.costamount),0) as profit,
-		IFNULL((SUM(a.netamount - a.costamount)/IFNULL(a.netamount,SUM(a.netamount - a.costamount))),0) as profitpresent
-		FROM
-		(
-		SELECT
+		from(
+		select
+		cu_type,
+		pi_custid,
 		pi_custcode,
 		pi_custname,
-		cu_type,
-		cu_sellername,
-		SUM( (IFNULL( pd_sendprice, 0 ) * ( IFNULL( pd_outqty, 0 ) - IFNULL( pd_inqty, 0 ) )) * ifnull(cr_rate,1) ) AS saamount,
-		SUM(
-		IFNULL(pd_netprice,0) * (IFNULL(pd_outqty,0) - IFNULL(pd_inqty,0))
-		) AS netamount,
-		SUM(
-		IFNULL(pd_price,0) * (IFNULL(pd_outqty,0) - IFNULL(pd_inqty,0))
-		) AS costamount
-		FROM
-		prodinout,
-		prodiodetail,
-		customer,
-		currencys
+		sum(pd_sendprice*pi_rate) as saamount,
+		sum(pd_price) as costamount,
+		sum(pd_sendprice*pi_rate)-sum(pd_price) as profit,
+		(sum(pd_sendprice*pi_rate)-sum(pd_price) )/sum(pd_sendprice*pi_rate) as profitpresent
+		from prodiodetail
+		left join prodinout on pd_piid=pi_Id
+		left join customer on cu_id = pi_custid
 		<where>
 			<if test="con != null">
 				${con}
 			</if>
 			<if test="companyId != null">
-				and  prodinout.companyid = #{companyId}
+				and prodinout.companyid = #{companyId}
 			</if>
+			and pi_class in('出货单','销售退货单')
 		</where>
-		AND	pi_id = pd_piid
-		AND pi_custid = cu_id
-		AND pi_status = '已审核'
-		AND prodinout.companyid= prodiodetail.companyid
-		AND prodiodetail.companyid = prodinout.companyid
-		AND currencys.cr_name = prodinout.pi_currency
-		AND currencys.companyid = prodinout.companyid
-		GROUP BY
-		pi_custcode,
-		pi_custname,
-		cu_type,
-		cu_sellername
+		group by pi_custid,pi_custcode,pi_custname,cu_type
+		ORDER BY pi_custname asc
 		) a
-		GROUP BY
-		a.pi_custcode,
-		a.pi_custname,
-		a.cu_type,
-		a.cu_sellername)b
 	</select>
 
 </mapper>

+ 1 - 1
frontend/saas-web/app/model/report/PurchasePay.js

@@ -8,7 +8,7 @@ Ext.define('saas.model.report.PurchasePay', {
         { name: 'pbd_slcode', type: 'string' }, // 来源单号
         { name: 'pbd_slkind', type: 'string' }, // 业务类型
         { name: 'pi_nettotal', type: 'float' }, // 金额
-        { name: 'pd_total-pi_nettotal', type: 'float', // 税额
+        { name: 'pi_total-pi_nettotal', type: 'float', // 税额
             convert: function(v, rec) {
                 var t = (rec.get('pi_total') || 0.0) - (rec.get('pi_nettotal') || 0.0);
                 return Number(saas.util.BaseUtil.numberFormat(t, 2, false));

+ 6 - 1
frontend/saas-web/app/view/core/base/ImportWindow.js

@@ -8,6 +8,8 @@ Ext.define('saas.view.core.base.ImportWindow', {
         'Ext.container.ButtonGroup'
     ],
 
+    cls: 'import-window',
+
     bbar:['->',{
         hidden:true,
         name:'prev',
@@ -79,10 +81,11 @@ Ext.define('saas.view.core.base.ImportWindow', {
         handler:function(b){
             var form = b.ownerCt.ownerCt;
             var id = form.importId;
+            var importUploadPath = form.importUploadPath;
             if(id){
                 form.setLoading(true);
                 Ext.Ajax.request({
-                    url: '/api/document/'+form.ownerCt.caller.toLocaleLowerCase()+'/saveToFormal',//这里是填写需要跨域访问的URL
+                    url: importUploadPath || '/api/document/'+form.ownerCt.caller.toLocaleLowerCase()+'/saveToFormal',//这里是填写需要跨域访问的URL
                     method: 'post',
                     headers: {
                         'Access-Control-Allow-Origin': '*',
@@ -179,6 +182,7 @@ Ext.define('saas.view.core.base.ImportWindow', {
                             //获取模版
                             var serverOptions = Ext.manifest.server;
                             window.location.href = (serverOptions.basePath.https?serverOptions.basePath.https:serverOptions.basePath) + '/api/commons/excel/import/templet?caller='+caller;
+                            // window.open('http://10.1.80.36:8560' + '/api/commons/excel/import/templet?caller='+caller);
                         }
                     }
                 },{
@@ -251,6 +255,7 @@ Ext.define('saas.view.core.base.ImportWindow', {
                             form.setLoading(true);
                             Ext.Ajax.request({
                                 url: '/api/commons/excel/import/parse',//这里是填写需要跨域访问的URL
+                                // url: 'http://10.1.80.36:8560' + '/api/commons/excel/import/parse',//这里是填写需要跨域访问的URL
                                 cors: true,
                                 useDefaultXhrHeader: false,
                                 method: 'post',

+ 5 - 0
frontend/saas-web/app/view/core/base/ImportWindow.scss

@@ -0,0 +1,5 @@
+.x-window-dbfind {
+    .x-panel-bodyWrap .x-panel-body .x-box-inner {
+        background: #ffffff !important;
+    }
+}

+ 8 - 1
frontend/saas-web/app/view/core/query/QueryGridPanel.js

@@ -214,12 +214,19 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
                     bind: {
                         hidden: '{!auditEnable}'
                     }
+                },  {
+                    text: '导入',
+                    handler: 'onImport',
+                    hidden: true,
+                    bind: {
+                        hidden: '{!importEnable}'
+                    }
                 },  {
                     text: '导出',
                     handler: me.onExport,
                     hidden: true,
                     bind: {
-                        hidden: '{!importEnable}'
+                        hidden: '{!exportEnable}'
                     }
                 },{
                     text: '关闭',

+ 1 - 0
frontend/saas-web/app/view/core/query/QueryPanelController.js

@@ -45,6 +45,7 @@ Ext.define('saas.view.core.query.QueryPanelController', {
     onCloseClick:function(btn){
         this.queryWin = Ext.destroy(this.queryWin);
     },
+    onImport: Ext.emptyFn,
 
     onColSetting: function() {
         var me = this,

+ 2 - 1
frontend/saas-web/app/view/core/query/QueryPanelModel.js

@@ -7,7 +7,8 @@ Ext.define('saas.view.core.query.QueryPanelModel', {
         addEnable: true, // 显示新增按钮
         auditEnable: true, // 显示审核按钮
         printEnable: true, // 显示打印按钮
-        importEnable: true, // 显示导入按钮
+        importEnable: false, // 显示导入按钮
+        exportEnable: true, // 显示导出按钮
         closeEnable: true, // 显示关闭按钮
         deleteEnable: true, // 显示删除按钮
         deleteDisable:false, //删除按钮是否可使用

+ 3 - 2
frontend/saas-web/app/view/core/report/ReportPanel.js

@@ -26,6 +26,7 @@ Ext.define('saas.view.core.report.ReportPanel', {
     printAble: true,
     exportAble: true,
     showMySummary: true,
+    mySummaryConfig: {},
     queryMode: 'DETAIL',
    
     calculateProperty: 'data.calculate',
@@ -240,11 +241,11 @@ Ext.define('saas.view.core.report.ReportPanel', {
         }];
 
         if (me.showMySummary) {
-            f.push({
+            f.push(Ext.apply({
                 ftype: 'mysummary',
                 dock: 'bottom',
                 hidden: !me.showMySummary
-            });
+            }, me.mySummaryConfig));
         }
 
         return f;

+ 0 - 18
frontend/saas-web/app/view/money/report/ProfitDetail.js

@@ -49,24 +49,6 @@ Ext.define('saas.view.money.report.ProfitDetail', {
         text: '客户名称',
         dataIndex: 'pi_custname',
         width: 200,
-    }, {
-        text: '金额(元)',
-        dataIndex: 'netamount',
-        exportFormat: 'Amount',
-        xtype: 'numbercolumn',
-        width: 0,
-        renderer : function(v, m, r) {
-            return saas.util.BaseUtil.numberFormat(v, 2, true);
-        },
-    }, {
-        text: '税额(元)',
-        dataIndex: 'saamount-netamount',
-        exportFormat: 'Amount',
-        xtype: 'numbercolumn',
-        width: 0,
-        renderer : function(v, m, r) {
-            return saas.util.BaseUtil.numberFormat(v, 2, true);
-        },
     }, {
         text: '销售金额(元)',
         dataIndex: 'saamount',

+ 1 - 1
frontend/saas-web/app/view/money/verification/FormPanelController.js

@@ -343,7 +343,7 @@ Ext.define('saas.view.money.verification.FormPanelController', {
         codeField = form.getForm().findField(form._codeField),
         detailCount = form.detailCount,
         viewModel = me.getViewModel(),
-        codeModified = codeField && codeField.isDirty();
+        codeModified = !form.initId || (codeField && codeField.isDirty());
 
 
         //form里面数据

+ 85 - 3
frontend/saas-web/app/view/purchase/report/PurchasePay.js

@@ -61,11 +61,25 @@ Ext.define('saas.view.purchase.report.PurchasePay', {
         text: '税额(元)',
         xtype: 'numbercolumn',
         exportFormat: 'Amount',
-        dataIndex: 'pd_total-pi_nettotal',
+        dataIndex: 'pi_total-pi_nettotal',
         width: 120,
         renderer: function(v) {
             return saas.util.BaseUtil.numberFormat(v, 2, true);
         },
+        disableMySummary:true,
+        summaryType: 'sum',
+        summaryRenderer: function(v) {
+            return saas.util.BaseUtil.numberFormat(v, 2, true);
+        }
+    },{
+        hidden:true,
+        text: '税额(本位币)(元)',
+        dataIndex: '(pi_total-pi_nettotal)*pi_rate',
+        exportFormat: 'Amount',
+        xtype: 'numbercolumn',
+        width: 120,
+        summaryType: 'sum',
+        summaryLabel: '税额(本位币)'
     }, {
         text: '价税合计(元)',
         xtype: 'numbercolumn',
@@ -75,6 +89,11 @@ Ext.define('saas.view.purchase.report.PurchasePay', {
         renderer: function(v) {
             return saas.util.BaseUtil.numberFormat(v, 2, true);
         },
+        disableMySummary:true,
+        summaryType: 'sum',
+        summaryRenderer: function(v) {
+            return saas.util.BaseUtil.numberFormat(v, 2, true);
+        }
     }, {
         text: '付款金额(元)',
         dataIndex: 'pbd_nowbalance',
@@ -92,7 +111,7 @@ Ext.define('saas.view.purchase.report.PurchasePay', {
     },{
         hidden:true,
         text: '付款金额(本位币)(元)',
-        dataIndex: 'pbd_nowbalance_cr',
+        dataIndex: 'pbd_nowbalance*pi_rate',
         exportFormat: 'Amount',
         xtype: 'numbercolumn',
         width: 120,
@@ -119,6 +138,69 @@ Ext.define('saas.view.purchase.report.PurchasePay', {
         text: '备注',
         dataIndex: 'pb_remark',
         width: 250
-    }]
+    }],
 
+    // 自定义合计逻辑,直接使用后台返回的内容作为合计栏内容
+    mySummaryConfig: {
+        renderSummaryData: [],
+        mySummaryTpl: [
+            '<table class="x-grid-row-mysummary x-mmmmmmmmmmmm">',
+                '<tbody>',
+                    '<tr>',
+                        '<tpl for=".">',
+                        '<td class="x-grid-cell x-grid-td x-grid-cell-numbercolumn-1526 x-unselectable x-mysummary-item">',
+                            '<div class="x-grid-cell-inner x-mysummary-item-cell">{label}',
+                                '{str}',
+                            '</div>',
+                        '</td>',
+                        '</tpl>',
+                    '</tr>',
+                '</tbody>',
+            '</table>',
+        ],
+        initSummarys: function() {
+            var me = this,
+            summaryData = me.renderSummaryData;
+            
+            var summarys = [{
+                str: JSON.stringify(summaryData)
+            }];
+            this.summarys = summarys;
+            return summarys;
+        },
+        updateSummarys: function() {
+            var me = this,
+            summaryData = me.renderSummaryData;
+            var summarys = [{
+                str: JSON.stringify(summaryData)
+            }];
+            this.summarys = summarys;
+            return summarys;
+        },
+        applySummarys: function(response) {
+            var me = this,
+            grid = me.grid;
+            var _res = response,
+            _calculateProperty = grid.calculateProperty;
+
+            var _root = _calculateProperty.split('.')[0];
+            eval('var ' + _root + ' = _res[_root];');
+            try {
+                summaryData = [];
+                try {
+                    summaryData = eval(_calculateProperty);
+
+                    if(!Ext.isArray(summaryData)) {
+                        summaryData = [];
+                    }
+                }catch(e) {
+                    // don't care this...
+                }
+                me.renderSummaryData =summaryData;
+            } catch (e) {
+                console.error(e);
+                saas.util.BaseUtil.showErrorToast(e.message);
+            }
+        }
+    }
 });

+ 12 - 7
frontend/saas-web/app/view/sale/report/SaleRec.js

@@ -98,27 +98,32 @@ Ext.define('saas.view.sale.report.SaleRec', {
         summaryRenderer: function(v) {
             return saas.util.BaseUtil.numberFormat(v, 2, true);
         }
-    },{
-        hidden:true,
-        text: '价税合计(元)',
+    }, {
+        text: '收款金额(元)',
         xtype: 'numbercolumn',
         exportFormat: 'Amount',
-        dataIndex: 'pi_total*pi_rate',
+        dataIndex: 'rbd_nowbalance',
         renderer : function(v, m, r) {
             return saas.util.BaseUtil.numberFormat(v, 2, true);
         },
+        disableMySummary:true,
         summaryType: 'sum',
-        summaryLabel: '价税合计(本位币)',
         summaryRenderer: function(v) {
             return saas.util.BaseUtil.numberFormat(v, 2, true);
         }
-    }, {
+    },{
+        hidden:true,
         text: '收款金额(元)',
         xtype: 'numbercolumn',
         exportFormat: 'Amount',
-        dataIndex: 'rbd_nowbalance',
+        dataIndex: 'rbd_nowbalance*pi_rate',
         renderer : function(v, m, r) {
             return saas.util.BaseUtil.numberFormat(v, 2, true);
+        },
+        summaryType: 'sum',
+        summaryLabel: '收款金额(本位币)',
+        summaryRenderer: function(v) {
+            return saas.util.BaseUtil.numberFormat(v, 2, true);
         }
     }, {
         text: '币别',

+ 4 - 2
frontend/saas-web/app/view/sale/sale/QueryPanel.js

@@ -6,6 +6,9 @@ Ext.define('saas.view.sale.sale.QueryPanel', {
     viewModel: 'sale-sale-querypanel',
 
     viewName: 'sale-sale-querypanel',
+
+    caller: 'Sale',
+    importUploadPath: '/api/sale/sale/saveToFormal',
     
     initComponent: function() {
         var me = this;
@@ -154,8 +157,7 @@ Ext.define('saas.view.sale.sale.QueryPanel', {
                     text: '备注',
                     dataIndex: 'sa_remark',
                     width: 250
-                }
-            ],
+                }],
                 relativeColumn: [ {
                     text: 'id',
                     dataIndex: 'sa_id',

+ 27 - 0
frontend/saas-web/app/view/sale/sale/QueryPanelController.js

@@ -50,5 +50,32 @@ Ext.define('saas.view.sale.sale.QueryPanelController', {
             }
         });
 
+    },
+
+    onImport: function() {
+        var me = this;
+        var view = me.getView();
+        var panelEl = view.getEl();
+        var box = panelEl.getBox();
+        var height = box.height;
+        var width = box.width;
+
+        var win = view.add(Ext.create('saas.view.core.base.ImportWindow', {  
+            cls:'x-window-dbfind', 
+            belong:view,  
+            modal:true,
+            height: height * 0.8,
+            width: width * 0.8,
+            title: '导入',
+            scrollable: true,
+            bodyPadding: 10,
+            constrain: true,
+            closable: true,
+            layout:'fit',
+            caller: view.caller,
+            importUploadPath: view.importUploadPath,
+            renderTo:view.getEl()
+        }));
+        win.show();
     }
 });

+ 5 - 1
frontend/saas-web/app/view/sale/sale/QueryPanelModel.js

@@ -1,5 +1,9 @@
 Ext.define('saas.view.sale.sale.QueryPanelModel', {
     extend: 'saas.view.core.query.QueryPanelModel',
-    alias: 'viewmodel.sale-sale-querypanel'
+    alias: 'viewmodel.sale-sale-querypanel',
+
+    data: {
+        importEnable: true, // 显示导入按钮
+    }
 
 });

+ 84 - 75
frontend/saas-web/ext/packages/ux/src/feature/MySummary.js

@@ -10,6 +10,25 @@ Ext.define('Ext.ux.feature.MySummary', {
 
     showSummaryRow: true,
 
+    mySummaryTpl: [
+        '<table class="x-grid-row-mysummary">',
+            '<tbody>',
+                '<tr>',
+                    '<tpl for=".">',
+                    '<td class="x-grid-cell x-grid-td x-grid-cell-numbercolumn-1526 x-unselectable x-mysummary-item">',
+                        '<div class="x-grid-cell-inner x-mysummary-item-cell">{label}',
+                            '<tpl if="typeLabel">',
+                            '({typeLabel})',
+                            '</tpl>',
+                            ': {value}',
+                        '</div>',
+                    '</td>',
+                    '</tpl>',
+                '</tr>',
+            '</tbody>',
+        '</table>',
+    ],
+
     init: function(grid) {
         var me = this,
             view = me.view,
@@ -42,24 +61,7 @@ Ext.define('Ext.ux.feature.MySummary', {
                             '{%this.renderContent(out,values)%}',
                         '</div>'
                     ],
-                    tpl: [
-                        '<table class="x-grid-row-mysummary">',
-                            '<tbody>',
-                                '<tr>',
-                                    '<tpl for=".">',
-                                    '<td class="x-grid-cell x-grid-td x-grid-cell-numbercolumn-1526 x-unselectable x-mysummary-item">',
-                                        '<div class="x-grid-cell-inner x-mysummary-item-cell">{label}',
-                                            '<tpl if="typeLabel">',
-                                            '({typeLabel})',
-                                            '</tpl>',
-                                            ': {value}',
-                                        '</div>',
-                                    '</td>',
-                                    '</tpl>',
-                                '</tr>',
-                            '</tbody>',
-                        '</table>',
-                    ],
+                    tpl: me.mySummaryTpl,
                     data: me.getSummarys(),
                     height: 36,
                     scrollable: {
@@ -83,63 +85,7 @@ Ext.define('Ext.ux.feature.MySummary', {
         });
 
         store.on('load', function( s, records, successful, operation, eOpts) {
-            var _res = operation._response.responseJson,
-            _calculateProperty = grid.calculateProperty,
-            _rootProperty = grid.rootProperty;
-
-            var _root = _calculateProperty.split('.')[0];
-            eval('var ' + _root + ' = _res[_root];');
-            try {
-                var columns = grid.columns,
-                summaryData = [],
-                datas = [];
-                try {
-                    summaryData = eval(_calculateProperty);
-                    datas = eval(_rootProperty);
-
-                    if(!Ext.isArray(summaryData)) {
-                        summaryData = [];
-                    }
-                    if(!Ext.isArray(datas)) {
-                        datas = [];
-                    }
-                }catch(e) {
-                    // don't care this...
-                }
-                Ext.Array.each(columns, function (c) {
-                    var type = c._summaryType,
-                        name = c.dataIndex;
-
-                    var d = Ext.Array.findBy(summaryData, function (s) {
-                        return s.hasOwnProperty(name);
-                    })
-                    if (type && d) {
-                        if(typeof c.mySummaryRenderer == 'function') {
-                            c.summaryValue = c.mySummaryRenderer(grid, c, datas);
-                        }else if (type == 'count') {
-                            c.summaryValue = Ext.util.Format.number(d[name], c.format || '0');
-                        } else if (typeof c.summaryRenderer == 'function') {
-                            c.summaryValue = c.summaryRenderer(d[name]);
-                        } else if (typeof c.renderer == 'function') {
-                            c.summaryValue = c.renderer(d[name]);
-                        } else {
-                            c.summaryValue = Ext.util.Format.number(d[name], c.format || '0.00');
-                        }
-                    } else if(type && !d) {
-                        if(typeof c.mySummaryRenderer == 'function') {
-                            c.summaryValue = c.mySummaryRenderer(grid, c, datas);
-                        }else {
-                            c.summaryValue = me.applySummaryValue(datas, c);
-                        }
-                    } else {
-                        c.summaryValue = null;
-                    }
-                });
-                return datas;
-            } catch (e) {
-                console.error(e);
-                saas.util.BaseUtil.showErrorToast(e.message);
-            }
+            me.applySummarys(operation._response.responseJson);
         });
 
         me.bindStore(grid, store);
@@ -245,6 +191,69 @@ Ext.define('Ext.ux.feature.MySummary', {
         }
     },
 
+    // 处理后台返回的合计数据,默认将合计值赋予对应列
+    applySummarys: function(response) {
+        var me = this,
+        grid = me.grid;
+        var _res = response,
+        _calculateProperty = grid.calculateProperty,
+        _rootProperty = grid.rootProperty;
+
+        var _root = _calculateProperty.split('.')[0];
+        eval('var ' + _root + ' = _res[_root];');
+        try {
+            var columns = grid.columns,
+            summaryData = [],
+            datas = [];
+            try {
+                summaryData = eval(_calculateProperty);
+                datas = eval(_rootProperty);
+
+                if(!Ext.isArray(summaryData)) {
+                    summaryData = [];
+                }
+                if(!Ext.isArray(datas)) {
+                    datas = [];
+                }
+            }catch(e) {
+                // don't care this...
+            }
+            Ext.Array.each(columns, function (c) {
+                var type = c._summaryType,
+                    name = c.dataIndex;
+
+                var d = Ext.Array.findBy(summaryData, function (s) {
+                    return s.hasOwnProperty(name);
+                })
+                if (type && d) {
+                    if(typeof c.mySummaryRenderer == 'function') {
+                        c.summaryValue = c.mySummaryRenderer(grid, c, datas);
+                    }else if (type == 'count') {
+                        c.summaryValue = Ext.util.Format.number(d[name], c.format || '0');
+                    } else if (typeof c.summaryRenderer == 'function') {
+                        c.summaryValue = c.summaryRenderer(d[name]);
+                    } else if (typeof c.renderer == 'function') {
+                        c.summaryValue = c.renderer(d[name]);
+                    } else {
+                        c.summaryValue = Ext.util.Format.number(d[name], c.format || '0.00');
+                    }
+                } else if(type && !d) {
+                    if(typeof c.mySummaryRenderer == 'function') {
+                        c.summaryValue = c.mySummaryRenderer(grid, c, datas);
+                    }else {
+                        c.summaryValue = me.applySummaryValue(datas, c);
+                    }
+                } else {
+                    c.summaryValue = null;
+                }
+            });
+            return datas;
+        } catch (e) {
+            console.error(e);
+            saas.util.BaseUtil.showErrorToast(e.message);
+        }
+    },
+
     applySummaryValue: function(datas, c) {
         var dataIndex = c.dataIndex,
         type = c.summaryType,