Prechádzať zdrojové kódy

Merge remote-tracking branch 'origin/dev' into dev

heqinwei 7 rokov pred
rodič
commit
11a5fd6130
24 zmenil súbory, kde vykonal 776 pridanie a 326 odobranie
  1. 2 2
      applications/commons/commons-server/src/main/resources/mapper/HomePageMapper.xml
  2. 6 16
      base-servers/auth/auth-server/src/main/java/com/usoftchina/saas/auth/controller/AuthController.java
  3. 7 0
      frontend/saas-web/app/Application.scss
  4. 272 266
      frontend/saas-web/app/view/core/report/ReportPanel.js
  5. 5 3
      frontend/saas-web/app/view/home/Home.js
  6. 82 21
      frontend/saas-web/app/view/home/HomeModel.js
  7. 147 0
      frontend/saas-web/app/view/home/charts/KeyData.js
  8. 111 0
      frontend/saas-web/app/view/home/charts/KeyData.scss
  9. 1 1
      frontend/saas-web/app/view/home/charts/MonthPurchase.js
  10. 2 2
      frontend/saas-web/app/view/main/Main.scss
  11. 2 2
      frontend/saas-web/app/view/main/MainController.js
  12. 1 1
      frontend/saas-web/app/view/main/MainModel.js
  13. 15 0
      frontend/saas-web/app/view/money/report/TotalPayDetail.js
  14. 15 0
      frontend/saas-web/app/view/money/report/TotalRecDetail.js
  15. 35 2
      frontend/saas-web/app/view/stock/report/DataList.js
  16. 2 0
      frontend/saas-web/app/view/stock/report/Prodiodetail.js
  17. 5 4
      frontend/saas-web/ext/packages/ux/src/feature/MySummary.js
  18. 2 2
      frontend/saas-web/ext/packages/ux/src/feature/MySummary.scss
  19. 60 0
      frontend/saas-web/overrides/ux/TabCloseMenu.js
  20. BIN
      frontend/saas-web/resources/images/home/balanceTotal.png
  21. BIN
      frontend/saas-web/resources/images/home/payTotal.png
  22. BIN
      frontend/saas-web/resources/images/home/receiveTotal.png
  23. BIN
      frontend/saas-web/resources/images/home/storageTotal.png
  24. 4 4
      frontend/saas-web/resources/json/navigation.json

+ 2 - 2
applications/commons/commons-server/src/main/resources/mapper/HomePageMapper.xml

@@ -67,11 +67,11 @@
     <select id="getSaleData" parameterType="long" resultType="string">
       select concat('[',five,',',other,']') from ((
 
-    select GROUP_CONCAT(concat('{"x":"',si_custname,'","y":',IFNULL(round(si_amount/10000,2),0),'}')) five from (
+    select GROUP_CONCAT(concat('{"x":"',si_custname,'","y":',IFNULL(round(si_amount/10000,2),0),',"z":"',si_custshortname,'"}')) five from (
     select * from statsinfo where companyid=#{componyId} and si_yearmonth=DATE_FORMAT(now(),'%Y%m') and si_type='SALE' ORDER BY si_amount desc limit 0,5
     ) c)d,(
 
-    select concat('{"x":"其它","y":',ifnull(round((all_sum - five_sum)/10000,2),0),'}') other from ( (select sum(si_amount) all_sum from statsinfo  where companyid=#{componyId} and si_yearmonth=DATE_FORMAT(now(),'%Y%m') and si_type='SALE')a,
+    select concat('{"x":"其它","y":',ifnull(round((all_sum - five_sum)/10000,2),0),',"z":"其它"}') other from ( (select sum(si_amount) all_sum from statsinfo  where companyid=#{componyId} and si_yearmonth=DATE_FORMAT(now(),'%Y%m') and si_type='SALE')a,
     ( select sum(si_amount) five_sum from (select si_amount from statsinfo where companyid=#{componyId} and si_yearmonth=DATE_FORMAT(now(),'%Y%m') and si_type='SALE' ORDER BY si_amount desc limit 0,5)f)b))e)
     </select>
 

+ 6 - 16
base-servers/auth/auth-server/src/main/java/com/usoftchina/saas/auth/controller/AuthController.java

@@ -219,8 +219,8 @@ public class AuthController {
      * @param info
      * @return
      */
-    @GetMapping("/sso/callback/{clientId}")
-    public void ssoCallback(HttpServletRequest request, HttpServletResponse response,
+    @GetMapping(value = "/sso/callback/{clientId}", produces = {"application/javascript"})
+    public String ssoCallback(HttpServletRequest request, HttpServletResponse response,
                             @PathVariable(required = false) String clientId, CookieInfo info, String callback) throws IOException{
         if (null != info && null != info.getMobile()) {
             AccountDTO accountDTO = null;
@@ -232,7 +232,7 @@ public class AuthController {
                 } else {
                     logger.error(result.getMessage());
                     ServletUtils.writeJsonPMessage(response, callback, false);
-                    return;
+                    return "successCallback({success:'0'})";
                 }
             } else {
                 accountDTO = result.getData();
@@ -243,7 +243,7 @@ public class AuthController {
                     if (!updateResult.isSuccess()) {
                         logger.error(updateResult.getMessage());
                         ServletUtils.writeJsonPMessage(response, callback, false);
-                        return;
+                        return "successCallback({success:'0'})";
                     }
                 }
             }
@@ -253,18 +253,6 @@ public class AuthController {
             authorizeLogService.save(AuthorizeLog.from(request)
                     .setAccountId(accountDTO.getId())
                     .setAppId(appId).build());
-            //将cookies
-            Cookie[] cookies = request.getCookies();
-            Cookie ssoCookies = null;
-            for (Cookie cookie : cookies) {
-                if (cookieConfig.getName().equals(cookie.getName())) {
-                    ssoCookies = cookie;
-                    break;
-                }
-            }
-            if (null != ssoCookies) {
-                response.addCookie(ssoCookies);
-            }
             // 将登录信息推送到客户端
             if (!StringUtils.isEmpty(clientId)) {
                 Long companyId = null;
@@ -276,9 +264,11 @@ public class AuthController {
                 TokenDTO tokenDTO = BeanMapper.map(jwtToken, TokenDTO.class);
                 socketMessageApi.sendToClient(clientId, "/sso/callback",
                         JsonUtils.toJsonString(new AuthDTO(tokenDTO, accountDTO)));
+                return "successCallback({success:'1'})";
             }
             ServletUtils.writeJsonPMessage(response, callback, true);
         }
+        return "successCallback({success:'0'})";
     }
 
     /**

+ 7 - 0
frontend/saas-web/app/Application.scss

@@ -484,4 +484,11 @@ div::-webkit-scrollbar-track {
 /** tab **/
 .x-tab-default.x-tab-active .x-tab-close-btn {
   color: #34BAF6;
+}
+
+/** tabclosemenu **/
+.x-menu.x-tab-close-menu {
+  & > div > div > div.x-box-inner.x-box-scroller-body-vertical.x-scroller > div > div > a > span {
+    margin-left: 28px;
+  }
 }

+ 272 - 266
frontend/saas-web/app/view/core/report/ReportPanel.js

@@ -13,7 +13,7 @@ Ext.define('saas.view.core.report.ReportPanel', {
 
     layout: 'vbox',
     autoScroll: true,
-    bodyBorder:false,
+    bodyBorder: false,
     bodyPadding: 5,
 
     groupField: null, // 分组字段
@@ -21,162 +21,124 @@ Ext.define('saas.view.core.report.ReportPanel', {
     defaultCondition: null, // 默认查询条件
     searchItems: [], // 查询字段
     reportTitle: '报表',
-    autoLoad:true,
+    autoLoad: true,
     allowPaging: true,
     printAble: true,
     exportAble: true,
+    showMySummary: true,
     queryMode: 'DETAIL',
 
-    initComponent: function() {
+    initComponent: function () {
         var me = this;
         var printAble = me.printAble;
         var exportAble = me.exportAble;
         var store = me.initStore();
         columnWidth: 0.25,
-        Ext.apply(me, {
-            items: [{
-                xtype: 'form',
-                width: '100%',
-                layout: 'column',
-                defaults:{
-                    margin: '0 5 5 0',
-                    labelAlign: 'right',
-                    labelWidth: 90,
-                    columnWidth: 0.25,
-                },
-                items: me.initSearchItems().concat([{
-                    xtype: 'container',
-                    columnWidth: me.QueryWidth || 0.5,
-                    items: [{
-                        xtype: 'button',
-                        text: '查询',
-                        handler: 'onQuery',
-                        formBind:true
-                    },{
-                        xtype:'button',
-                        text:'打印',
-                        hidden: !printAble,
-                        style: {
-                            float: 'right'
-                        },
-                        handler: 'exportTo',
-                        cfg: {
-                            type: 'html',
-                            includeGroups: true,
-                            includeSummary: true,
-                            isPrint:true
-                        }
-                    },{
-                        xtype: 'button',
-                        style: {
-                            float: 'right'
-                        },
-                        text: '导出',
-                        hidden: !exportAble,
-                        menu: {
-                            defaults: {
-                                handler: 'exportTo'
+            Ext.apply(me, {
+                items: [{
+                    xtype: 'form',
+                    width: '100%',
+                    layout: 'column',
+                    defaults: {
+                        margin: '0 5 5 0',
+                        labelAlign: 'right',
+                        labelWidth: 90,
+                        columnWidth: 0.25,
+                    },
+                    items: me.initSearchItems().concat([{
+                        xtype: 'container',
+                        columnWidth: me.QueryWidth || 0.5,
+                        items: [{
+                            xtype: 'button',
+                            text: '查询',
+                            handler: 'onQuery',
+                            formBind: true
+                        }, {
+                            xtype: 'button',
+                            text: '打印',
+                            hidden: !printAble,
+                            style: {
+                                float: 'right'
                             },
-                            items: [{
-                                text: 'Excel xlsx',
-                                cfg: {
-                                    type: 'excel07',
-                                    ext: 'xlsx'
-                                }
-                            }, {
-                                text: 'Excel xlsx (包含分组合计)',
-                                cfg: {
-                                    type: 'excel07',
-                                    ext: 'xlsx',
-                                    includeGroups: true,
-                                    includeSummary: true
-                                }
-                            }, {
-                            //     text: 'Excel xml',
-                            //     cfg: {
-                            //         type: 'excel03',
-                            //         ext: 'xml'
-                            //     }
-                            // }, {
-                            //     text: 'Excel xml (包含分组合计)',
-                            //     cfg: {
-                            //         type: 'excel03',
-                            //         ext: 'xml',
-                            //         includeGroups: true,
-                            //         includeSummary: true
-                            //     }
-                            // }, {
-                                text: 'CSV',
-                                cfg: {
-                                    type: 'csv'
-                                }
-                            }, {
-                                text: 'CSV (包含分组合计)',
-                                cfg: {
-                                    type: 'csv',
-                                    includeGroups: true,
-                                    includeSummary: true
-                                }
-                            //     text: 'TSV',
-                            //     cfg: {
-                            //         type: 'tsv',
-                            //         ext: 'csv'
-                            //     }
-                            // }, {
-                            //     text: 'HTML',
-                            //     cfg: {
-                            //         type: 'html'
-                            //     }
-                            // }, {
-                            //     text: 'HTML (包含分组合计)',
-                            //     cfg: {
-                            //         type: 'html',
-                            //         includeGroups: true,
-                            //         includeSummary: true
-                            //     }
-                            }]
-                        }
-                    }]
-                }])
-            }, {
-                xtype: 'grid',
-                width: '100%',
-                cls: 'x-report-grid',
-                flex: 1,
-                border: 0,
-                sortableColumns: false,
-                enableColumnHide: false,
-                rowLines: false,
-                plugins: [{
-                    ptype: 'gridexporter',
-                }, {
-                    ptype: 'menuclipboard'
-                }],
-                features: [{
-                    ftype: 'groupingsummary',
-                    hideGroupedHeader: false,
-                    enableGroupingMenu: false,
-                    collapsible: false
+                            handler: 'exportTo',
+                            cfg: {
+                                type: 'html',
+                                includeGroups: true,
+                                includeSummary: true,
+                                isPrint: true
+                            }
+                        }, {
+                            xtype: 'button',
+                            style: {
+                                float: 'right'
+                            },
+                            text: '导出',
+                            hidden: !exportAble,
+                            menu: {
+                                defaults: {
+                                    handler: 'exportTo'
+                                },
+                                items: [{
+                                    text: 'Excel xlsx',
+                                    cfg: {
+                                        type: 'excel07',
+                                        ext: 'xlsx'
+                                    }
+                                }, {
+                                    text: 'Excel xlsx (包含分组合计)',
+                                    cfg: {
+                                        type: 'excel07',
+                                        ext: 'xlsx',
+                                        includeGroups: true,
+                                        includeSummary: true
+                                    }
+                                }, {
+                                    text: 'CSV',
+                                    cfg: {
+                                        type: 'csv'
+                                    }
+                                }, {
+                                    text: 'CSV (包含分组合计)',
+                                    cfg: {
+                                        type: 'csv',
+                                        includeGroups: true,
+                                        includeSummary: true
+                                    }
+                                }]
+                            }
+                        }]
+                    }])
                 }, {
-                    ftype: 'mysummary',
-                    dock: 'bottom'
-                }],
-                store: store,
-                columns: me.initColumns(),
-                dockedItems: [me.allowPaging ? {
-                    xtype: 'pagingtoolbar',
-                    dock: 'bottom',
-                    displayInfo: true,
-                    store: store
-                } : null],
-            }]
-        });
+                    xtype: 'grid',
+                    width: '100%',
+                    cls: 'x-report-grid',
+                    flex: 1,
+                    border: 0,
+                    sortableColumns: false,
+                    enableColumnHide: false,
+                    rowLines: false,
+                    plugins: [{
+                        ptype: 'gridexporter',
+                    }, {
+                        ptype: 'menuclipboard'
+                    }],
+                    features: me.initFeatures(),
+                    store: store,
+                    columns: me.initColumns(),
+                    dockedItems: [me.allowPaging ? {
+                        xtype: 'pagingtoolbar',
+                        dock: 'bottom',
+                        displayInfo: true,
+                        store: store
+                    } : null],
+                }]
+            });
 
         me.callParent(arguments);
     },
 
     listeners: {
-        boxready: function(p) {
+        boxready: function (p) {
             var allowPaging = p.allowPaging;
             var grid = p.down('grid');
             var store = grid.getStore();
@@ -189,14 +151,34 @@ Ext.define('saas.view.core.report.ReportPanel', {
         }
     },
 
-    getListGrid: function() {
+    getListGrid: function () {
         var me = this,
-        grid = me.items.items[1];
+            grid = me.items.items[1];
 
         return grid;
     },
 
-    initStore: function() {
+    initFeatures: function () {
+        var me = this;
+        var f = [{
+            ftype: 'groupingsummary',
+            hideGroupedHeader: false,
+            enableGroupingMenu: false,
+            collapsible: false
+        }];
+
+        if (me.showMySummary) {
+            f.push({
+                ftype: 'mysummary',
+                dock: 'bottom',
+                hidden: !me.showMySummary
+            });
+        }
+
+        return f;
+    },
+
+    initStore: function () {
         var me = this;
         var store = Ext.create('Ext.data.Store', {
             fields: me.getFields(),
@@ -207,57 +189,61 @@ Ext.define('saas.view.core.report.ReportPanel', {
             proxy: {
                 type: 'ajax',
                 url: me.listUrl,
-                timeout: 8000,
+                timeout: 30000,
                 actionMethods: {
                     read: 'GET'
                 },
                 reader: {
                     type: 'json',
                     // rootProperty: 'data.list',
-                    rootProperty: function(data) {
+                    rootProperty: function (data) {
                         try {
                             var grid = me.items.items[1],
-                            columns = grid.columns,
-                            summaryData = data.data ? (data.data.calculate || []) : [];
-    
-                            Ext.Array.each(columns, function(c) {
+                                store = grid.store,
+                                columns = grid.columns,
+                                summaryData = data.data ? (data.data.calculate || []) : [],
+                                datas = data.data ? (data.data.list ? data.data.list.list : []) : [];
+
+                            Ext.Array.each(columns, function (c) {
                                 var type = c.summaryType,
-                                name = c.dataIndex;
-    
-                                var d = Ext.Array.findBy(summaryData, function(s) {
+                                    name = c.dataIndex;
+
+                                var d = Ext.Array.findBy(summaryData, function (s) {
                                     return s.hasOwnProperty(name);
                                 })
-                                if(type && d) {
-                                    if(type == 'count') {
+                                if (type && d) {
+                                    if (type == 'count') {
                                         c.summaryValue = Ext.util.Format.number(d[name], c.format || '0');
-                                    }else if(typeof c.summaryRenderer == 'function') {
+                                    } else if (typeof c.summaryRenderer == 'function') {
                                         c.summaryValue = c.summaryRenderer(d[name]);
-                                    }else if(typeof c.renderer == 'function') {
+                                    } else if (typeof c.renderer == 'function') {
                                         c.summaryValue = c.renderer(d[name]);
-                                    }else {
+                                    } else {
                                         c.summaryValue = Ext.util.Format.number(d[name], c.format || '0.00');
                                     }
-                                }else {
-                                    c.summaryValue = 0;
+                                } else if(type && !d) {
+                                    c.summaryValue = me.getSummaryValue(datas, c);
+                                } else {
+                                    c.summaryValue = null;
                                 }
                             });
-                            return data.data ? (data.data.list ? data.data.list.list : []) : [];
-                        }catch(e) {
+                            return datas;
+                        } catch (e) {
                             saas.util.BaseUtil.showErrorToast(e.message);
                         }
                     },
                     totalProperty: 'data.list.total',
                 },
                 listeners: {
-                    exception: function(proxy, response, operation, eOpts) {
-                        if(operation.success) {
-                            if(response.timedout) {
+                    exception: function (proxy, response, operation, eOpts) {
+                        if (operation.success) {
+                            if (response.timedout) {
                                 saas.util.BaseUtil.showErrorToast('请求超时');
                             }
-                        }else {
-                            if(response.timedout) {
+                        } else {
+                            if (response.timedout) {
                                 saas.util.BaseUtil.showErrorToast('请求超时');
-                            }else{
+                            } else {
                                 saas.util.BaseUtil.showErrorToast('查询失败:' + response.responseJson.message);
                             }
                         }
@@ -267,10 +253,10 @@ Ext.define('saas.view.core.report.ReportPanel', {
             listeners: {
                 beforeload: function (store, op) {
                     var condition = me.getConditions(),
-                    defaultCondition = me.defaultCondition,
-                    summarys = me.summarys;
-    
-                    if(defaultCondition) {
+                        defaultCondition = me.defaultCondition,
+                        summarys = me.summarys;
+
+                    if (defaultCondition) {
                         condition.push({
                             type: 'condition',
                             value: defaultCondition
@@ -278,19 +264,19 @@ Ext.define('saas.view.core.report.ReportPanel', {
                     }
 
                     var params = me.applyParams({
-                        number: store.exportNumber?store.exportNumber:op._page,
-                        size: store.exportPageSize?store.exportPageSize:store.pageSize,
+                        number: store.exportNumber ? store.exportNumber : op._page,
+                        size: store.exportPageSize ? store.exportPageSize : store.pageSize,
                         mode: me.queryMode || 'DETAIL',
                         condition: JSON.stringify(condition),
                         calculateFields: JSON.stringify(summarys)
                     });
                     Ext.apply(store.proxy.extraParams, params);
-    
+
                 }
             }
         });
 
-        if(me.groupField) {
+        if (me.groupField) {
             store.setGrouper({
                 property: me.groupField
             });
@@ -299,26 +285,26 @@ Ext.define('saas.view.core.report.ReportPanel', {
         return store;
     },
 
-    getFields: function() {
+    getFields: function () {
         var me = this;
-        return me.reportColumns.filter(function(c) {
+        return me.reportColumns.filter(function (c) {
             return !!c.dataIndex;
-        }).map(function(c) {
+        }).map(function (c) {
             return c.dataIndex;
         });
     },
 
-    initColumns: function() {
+    initColumns: function () {
         var me = this,
-        columns = me.reportColumns,
-        summarys = [];
+            columns = me.reportColumns,
+            summarys = [];
 
-        Ext.Array.each(columns, function(c) {
+        Ext.Array.each(columns, function (c) {
             c.columns || Ext.applyIf(c, {
                 width: 110
             });
 
-            if(c.xtype == 'datecolumn') {
+            if (c.xtype == 'datecolumn') {
                 Ext.applyIf(c, {
                     // 这两个都要写上,才能控制到不同类型的导出格式,原因不明- -!
                     format: 'Y-m-d',
@@ -330,14 +316,14 @@ Ext.define('saas.view.core.report.ReportPanel', {
                         return Ext.Date.format(new Date(value), 'Y-m-d');
                     },
                     // 下面这个方法不写会造成日期列求和,原因不明- -!
-                    exportSummaryRenderer: function(v) {
+                    exportSummaryRenderer: function (v) {
                         return v;
                     }
                 })
-            }else if(c.xtype == 'numbercolumn') {
+            } else if (c.xtype == 'numbercolumn') {
                 Ext.applyIf(c, {
                     align: 'end', // 数字右对齐
-                    renderer : function(v) {
+                    renderer: function (v) {
                         var arr = (v + '.').split('.');
                         var xr = (new Array(arr[1].length)).fill('0');
                         var format = '0.' + xr.join();
@@ -346,7 +332,7 @@ Ext.define('saas.view.core.report.ReportPanel', {
                 });
             }
 
-            if(c.summaryType) {
+            if (c.summaryType) {
                 me.initSummaryType(c);
                 summarys.push({
                     field: c.dataIndex,
@@ -360,64 +346,64 @@ Ext.define('saas.view.core.report.ReportPanel', {
         return columns;
     },
 
-    initSummaryType: function(column) {
+    initSummaryType: function (column) {
         var summaryType = column.summaryType;
-        if(Ext.isString(summaryType)) {
+        if (Ext.isString(summaryType)) {
             column.summaryTypeName = summaryType;
         }
-        if(summaryType == 'sum') {
+        if (summaryType == 'sum') {
             column._summaryType = 'sum';
             // 原生的求和方法使用的是Store.sum,在数据存在null时计算结果为NaN,这里重写一下
-            column.summaryType = function(records, values) {
+            column.summaryType = function (records, values) {
                 return Ext.Array.sum(values);
             }
         }
     },
 
-    initSearchItems: function() {
+    initSearchItems: function () {
         var me = this,
-        queryItems = [],
-        items = me.searchItems,
-        viewModel = me.getViewModel();
+            queryItems = [],
+            items = me.searchItems,
+            viewModel = me.getViewModel();
 
-        Ext.Array.each(items, function(item) {
+        Ext.Array.each(items, function (item) {
             var bind = item.bind,
-            name = item.name,
-            ignore = item.ignore,
-            defaultValue = item.defaultValue;
+                name = item.name,
+                ignore = item.ignore,
+                defaultValue = item.defaultValue;
 
-            if(item.allowBlank==false){
+            if (item.allowBlank == false) {
                 // TODO 需要判断类型
                 item.beforeLabelTextTpl = "<font color=\"red\" style=\"position:relative; top:2px;right:2px; font-weight: bolder;\">*</font>";
             }
 
-            if(!ignore) {
+            if (!ignore) {
                 queryItems.push(name);
             }
 
-            if(item.xtype == 'numberfield') {
+            if (item.xtype == 'numberfield') {
                 Ext.applyIf(item, {
                     hideTrigger: true, // 隐藏trigger
                     mouseWheelEnabled: false // 取消滚轮事件
                 });
             }
             // 设置model绑定
-            if(bind) {
-                if(!Ext.isString(bind)) {
+            if (bind) {
+                if (!Ext.isString(bind)) {
                     bind = name;
                     Ext.apply(bind, {
                         value: '{form.' + bind + '}'
                     });
-                }else {
+                } else {
                     bind = name;
                     item.bind = '{form.' + bind + '}';
                 }
-            }else {
+            } else {
                 bind = name;
                 item.bind = '{form.' + bind + '}';
             }
             // 设置默认值
-            if(defaultValue) {
+            if (defaultValue) {
                 viewModel.set('form.' + bind, defaultValue);
             }
 
@@ -425,11 +411,11 @@ Ext.define('saas.view.core.report.ReportPanel', {
             item.listeners = item.listeners || {};
             Ext.applyIf(item.listeners, {
                 keydown: {
-                    fn: function(th, e, eOpts) {
-                        if(e.keyCode == 13) {
-                            if(!th.fireEvent('beforequery', th)) {
+                    fn: function (th, e, eOpts) {
+                        if (e.keyCode == 13) {
+                            if (!th.fireEvent('beforequery', th)) {
                                 return;
-                            }else {
+                            } else {
                                 var p = this.up('core-report-reportpanel');
                                 p.getController().onQuery()
                             }
@@ -444,42 +430,60 @@ Ext.define('saas.view.core.report.ReportPanel', {
         return items;
     },
 
-    getConditions: function() {
+    getSummaryValue: function(datas, c) {
+        var dataIndex = c.dataIndex,
+        type = c.summaryType,
+        values = datas.map(function(d) {
+            return d[c.dataIndex];
+        }),
+        sum = Ext.Array.sum(values);
+        if (type == 'count') {
+            return Ext.util.Format.number(values.length, '0');
+        } else if (typeof c.summaryRenderer == 'function') {
+            return c.summaryRenderer(sum);
+        } else if (typeof c.renderer == 'function') {
+            return c.renderer(sum);
+        } else {
+            return Ext.util.Format.number(sum, c.format || '0.00');
+        }
+    },
+
+    getConditions: function () {
         var me = this,
-        form = me.down('form'),
-        formItems = form.items.items,
-        viewModel = me.getViewModel(),
-        viewModelData = viewModel.getData(),
-        formData = viewModelData['form'] || {},
-        queryItems = me.queryItems,
-        condition,
-        conditions = [];
-
-        for(var i = 0; i < queryItems.length; i++) {
+            form = me.down('form'),
+            formItems = form.items.items,
+            viewModel = me.getViewModel(),
+            viewModelData = viewModel.getData(),
+            formData = viewModelData['form'] || {},
+            queryItems = me.queryItems,
+            condition,
+            conditions = [];
+
+        for (var i = 0; i < queryItems.length; i++) {
             var n = queryItems[i];
-            var item = Ext.Array.findBy(formItems, function(i) {
+            var item = Ext.Array.findBy(formItems, function (i) {
                 return i.name == n;
             });
             var field = item.name,
-            func = item.getCondition,
-            value = formData[n],
-            condition;
+                func = item.getCondition,
+                value = formData[n],
+                condition;
 
-            if(!value) {
+            if (!value) {
                 continue;
             }
 
-            if(typeof func == 'function') {
+            if (typeof func == 'function') {
                 condition = {
                     type: 'condition',
                     value: func(value)
                 }
-            }else {
+            } else {
                 type = item.fieldType || me.getDefaultFieldType(item),
-                operation = item.operation || me.getDefaultFieldOperation(item),
-                conditionValue = me.getConditionValue(item, value);
-    
-                if(!conditionValue) {
+                    operation = item.operation || me.getDefaultFieldOperation(item),
+                    conditionValue = me.getConditionValue(item, value);
+
+                if (!conditionValue) {
                     continue;
                 }
                 condition = {
@@ -495,24 +499,24 @@ Ext.define('saas.view.core.report.ReportPanel', {
         return me.myGetConditions(conditions);
     },
 
-    myGetConditions: function(conditions) {
+    myGetConditions: function (conditions) {
         return conditions;
     },
 
-    getDefaultFieldType: function(field) {
+    getDefaultFieldType: function (field) {
         var me = this,
-        xtypes = field.getXTypes().split('/'),
-        type;
+            xtypes = field.getXTypes().split('/'),
+            type;
 
-        if(me.isContainsAny(xtypes, ['numberfield'])) {
+        if (me.isContainsAny(xtypes, ['numberfield'])) {
             type = 'number';
-        }else if(me.isContainsAny(xtypes, ['datefield', 'condatefield', 'conmonthfield'])) {
+        } else if (me.isContainsAny(xtypes, ['datefield', 'condatefield', 'conmonthfield'])) {
             type = 'date';
-        }else if(me.isContainsAny(xtypes, ['dbfindtrigger'])) {
+        } else if (me.isContainsAny(xtypes, ['dbfindtrigger'])) {
             type = 'string';
-        }else if(me.isContainsAny(xtypes, ['combobox', 'multicombo', 'combo', 'radiofield', 'radio'])) {
+        } else if (me.isContainsAny(xtypes, ['combobox', 'multicombo', 'combo', 'radiofield', 'radio'])) {
             type = 'enum';
-        }else {
+        } else {
             type = 'string';
         }
 
@@ -522,28 +526,30 @@ Ext.define('saas.view.core.report.ReportPanel', {
     /**
      * 只要arr1和arr2中存在相同项即返回真
      */
-    isContainsAny: function(arr1, arr2) {
-        for(var i = 0; i < arr2.length; i++) {
+    isContainsAny: function (arr1, arr2) {
+        for (var i = 0; i < arr2.length; i++) {
             var a2 = arr2[i];
-            if(!!arr1.find(function(a1) {return a1==a2})) {
+            if (!!arr1.find(function (a1) {
+                    return a1 == a2
+                })) {
                 return true;
             }
         }
         return false;
     },
 
-    getDefaultFieldOperation: function(field) {
+    getDefaultFieldOperation: function (field) {
         var me = this,
-        xtypes = field.getXTypes().split('/'),
-        operation;
+            xtypes = field.getXTypes().split('/'),
+            operation;
 
-        if(me.isContainsAny(xtypes, ['numberfield', 'datefield', 'dbfindtrigger'])) {
+        if (me.isContainsAny(xtypes, ['numberfield', 'datefield', 'dbfindtrigger'])) {
             operation = '=';
-        }else if(me.isContainsAny(xtypes, ['condatefield', 'conmonthfield'])) {
+        } else if (me.isContainsAny(xtypes, ['condatefield', 'conmonthfield'])) {
             operation = 'between';
-        }else if(me.isContainsAny(xtypes, ['multidbfindtrigger', 'combobox', 'multicombo', 'combo'])) {
+        } else if (me.isContainsAny(xtypes, ['multidbfindtrigger', 'combobox', 'multicombo', 'combo'])) {
             operation = 'in';
-        }else {
+        } else {
             operation = 'like';
         }
 
@@ -553,38 +559,38 @@ Ext.define('saas.view.core.report.ReportPanel', {
     /**
      * 处理部分字段值
      */
-    getConditionValue: function(field, value) {
+    getConditionValue: function (field, value) {
         var me = this,
-        xtypes = field.getXTypes().split('/'),
-        conditionValue;
-        if(me.isContainsAny(xtypes, ['datefield'])) {
+            xtypes = field.getXTypes().split('/'),
+            conditionValue;
+        if (me.isContainsAny(xtypes, ['datefield'])) {
             conditionValue = Ext.Date.format(new Date(from), 'Y-m-d H:i:s');
-        }else if(me.isContainsAny(xtypes, ['conmonthfield'])) {
+        } else if (me.isContainsAny(xtypes, ['conmonthfield'])) {
             var from = value.from,
-            to = value.to;
+                to = value.to;
 
             conditionValue = from + ',' + to;
-        }else if(me.isContainsAny(xtypes, ['condatefield'])) {
+        } else if (me.isContainsAny(xtypes, ['condatefield'])) {
             var from = value.from,
-            to = value.to;
+                to = value.to;
 
             conditionValue = Ext.Date.format(new Date(from), 'Y-m-d 00:00:00') + ',' + Ext.Date.format(new Date(to), 'Y-m-d 23:59:59');
-        }else if(me.isContainsAny(xtypes, ['dbfindtrigger'])) {
+        } else if (me.isContainsAny(xtypes, ['dbfindtrigger'])) {
             conditionValue = value;
-        }else if(me.isContainsAny(xtypes, ['combobox', 'combo'])) {
+        } else if (me.isContainsAny(xtypes, ['combobox', 'combo'])) {
             conditionValue = '\'' + value + '\'';
-        }else if(me.isContainsAny(xtypes, ['multicombo'])) {
-            conditionValue = value.map ? value.map(function(v) {
+        } else if (me.isContainsAny(xtypes, ['multicombo'])) {
+            conditionValue = value.map ? value.map(function (v) {
                 return '\'' + v.value + '\'';
             }).join(',') : '';
-        }else {
+        } else {
             conditionValue = value;
         }
 
         return conditionValue;
     },
 
-    applyParams: function(p) {
+    applyParams: function (p) {
         return p;
     }
 });

+ 5 - 3
frontend/saas-web/app/view/home/Home.js

@@ -50,7 +50,7 @@ Ext.define('saas.view.home.Home', {
         }, {
             xtype: 'month-purchase',
         }, {
-            xtype: 'month-io',
+            xtype: 'key-data',
         }]
     }, {
         xtype: 'panel',
@@ -65,10 +65,12 @@ Ext.define('saas.view.home.Home', {
             userCls: 'big-33 small-50',
         },
         items: [{
-            xtype: 'sale-trend',
+            xtype: 'month-io',
         }, {
-            xtype: 'purchase-trend'
+            xtype: 'sale-trend',
         }, {
+        //     xtype: 'purchase-trend'
+        // }, {
             xtype: 'stock-amount'
         }]
     }],

+ 82 - 21
frontend/saas-web/app/view/home/HomeModel.js

@@ -29,16 +29,19 @@ Ext.define('saas.view.home.HomeModel', {
                 },
                 listeners: {
                     exception: function(proxy, response, operation, eOpts) {
-                        Ext.getCmp('infocard').setLoading(false);
+                        var p = Ext.getCmp('infocard');
+                        p && p.setLoading(false);
                     }
                 }
             },
             listeners: {
                 beforeload: function() {
-                    Ext.getCmp('infocard').setLoading(true);
+                    var p = Ext.getCmp('infocard');
+                        p && p.setLoading(true);
                 },
                 load: function(s, d) {
-                    Ext.getCmp('infocard').setLoading(false);
+                    var p = Ext.getCmp('infocard');
+                        p && p.setLoading(false);
 
                     if(!d) return;
                     var res = d[0].data.data || {};
@@ -65,16 +68,19 @@ Ext.define('saas.view.home.HomeModel', {
                 },
                 listeners: {
                     exception: function(proxy, response, operation, eOpts) {
-                        Ext.getCmp('month_sale').setLoading(false);
+                        var p = Ext.getCmp('infocard');
+                        p && p.setLoading(false);
                     }
                 }
             },
             listeners: {
                 beforeload: function() {
-                    Ext.getCmp('month_sale').setLoading(true);
+                    var p = Ext.getCmp('infocard');
+                        p && p.setLoading(true);
                 },
                 load: function(s, d) {
-                    Ext.getCmp('month_sale').setLoading(false);
+                    var p = Ext.getCmp('infocard');
+                        p && p.setLoading(false);
                     var sum = Ext.util.Format.number(s.sum('y'), '0.00') || 0;
                     Ext.getCmp('home').getViewModel().set('month_sale_amount', sum)
                 }
@@ -98,16 +104,19 @@ Ext.define('saas.view.home.HomeModel', {
                 },
                 listeners: {
                     exception: function(proxy, response, operation, eOpts) {
-                        Ext.getCmp('month-purchase').setLoading(false);
+                        var p = Ext.getCmp('month_purchase');
+                        p && p.setLoading(false);
                     }
                 }
             },
             listeners: {
                 beforeload: function() {
-                    Ext.getCmp('month-purchase').setLoading(true);
+                    var p = Ext.getCmp('month_purchase');
+                        p && p.setLoading(true);
                 },
                 load: function(s, d) {
-                    Ext.getCmp('month-purchase').setLoading(false);
+                    var p = Ext.getCmp('month_purchase');
+                        p && p.setLoading(false);
                     var sum = Ext.util.Format.number(s.sum('y'), '0.00') || 0;
                     Ext.getCmp('home').getViewModel().set('month_purchase_amount', sum+'')
                 }
@@ -131,16 +140,19 @@ Ext.define('saas.view.home.HomeModel', {
                 },
                 listeners: {
                     exception: function(proxy, response, operation, eOpts) {
-                        Ext.getCmp('month_io').setLoading(false);
+                        var p = Ext.getCmp('month_io');
+                        p && p.setLoading(false);
                     }
                 }
             },
             listeners: {
                 beforeload: function() {
-                    Ext.getCmp('month_io').setLoading(true);
+                    var p = Ext.getCmp('month_io');
+                    p && p.setLoading(true);
                 },
                 load: function(s, d) {
-                    Ext.getCmp('month_io').setLoading(false);
+                    var p = Ext.getCmp('month_io');
+                    p && p.setLoading(false);
                     s.each(function(r) {
                         var sum = Ext.util.Format.number(r.get('main') + r.get('other'), '0.00') || 0;
                         if(r.get('x') == '收入') {
@@ -170,7 +182,8 @@ Ext.define('saas.view.home.HomeModel', {
                 },
                 listeners: {
                     exception: function(proxy, response, operation, eOpts) {
-                        Ext.getCmp('sale_trend').setLoading(false);
+                        var p = Ext.getCmp('sale_trend');
+                        p && p.setLoading(false);
                     }
                 }
             },
@@ -179,10 +192,12 @@ Ext.define('saas.view.home.HomeModel', {
             ],
             listeners: {
                 beforeload: function() {
-                    Ext.getCmp('sale_trend').setLoading(true);
+                    var p = Ext.getCmp('sale_trend');
+                        p && p.setLoading(true);
                 },
                 load: function(s, d) {
-                    Ext.getCmp('sale_trend').setLoading(false);
+                    var p = Ext.getCmp('sale_trend');
+                        p && p.setLoading(false);
                 }
             } 
         },
@@ -204,7 +219,8 @@ Ext.define('saas.view.home.HomeModel', {
                 },
                 listeners: {
                     exception: function(proxy, response, operation, eOpts) {
-                        Ext.getCmp('purchase_trend').setLoading(false);
+                        var p = Ext.getCmp('purchase_trend');
+                        p && p.setLoading(false);
                     }
                 }
             },
@@ -213,10 +229,12 @@ Ext.define('saas.view.home.HomeModel', {
             ],
             listeners: {
                 beforeload: function() {
-                    Ext.getCmp('purchase_trend').setLoading(true);
+                    var p = Ext.getCmp('purchase_trend');
+                        p && p.setLoading(true);
                 },
                 load: function(s, d) {
-                    Ext.getCmp('purchase_trend').setLoading(false);
+                    var p = Ext.getCmp('purchase_trend');
+                        p && p.setLoading(false);
                 }
             } 
         },
@@ -238,7 +256,8 @@ Ext.define('saas.view.home.HomeModel', {
                 },
                 listeners: {
                     exception: function(proxy, response, operation, eOpts) {
-                        Ext.getCmp('stock_amount').setLoading(false);
+                        var p = Ext.getCmp('stock_amount');
+                        p && p.setLoading(false);
                     }
                 }
             },
@@ -247,10 +266,52 @@ Ext.define('saas.view.home.HomeModel', {
             ],
             listeners: {
                 beforeload: function() {
-                    Ext.getCmp('stock_amount').setLoading(true);
+                    var p = Ext.getCmp('stock_amount');
+                    p && p.setLoading(true);
                 },
                 load: function(s, d) {
-                    Ext.getCmp('stock_amount').setLoading(false);
+                    var p = Ext.getCmp('stock_amount');
+                    p && p.setLoading(false);
+                }
+            } 
+        },
+
+        key_data: {
+            fields: ['name', 'value'],
+            autoLoad: true,
+            proxy: {
+                type: 'ajax',
+                // url: 'http://192.168.253.58:8920/homePage/keyData',
+                url: '/api/commons/homePage/keyData',
+                timeout: 8000,
+                actionMethods: {
+                    read: 'GET'
+                },
+                reader: {
+                    type: 'json',
+                    rootProperty: 'data',
+                },
+                listeners: {
+                    exception: function(proxy, response, operation, eOpts) {
+                        var p = Ext.getCmp('key_data');
+                        p && p.setLoading(false);
+                    }
+                }
+            },
+            listeners: {
+                beforeload: function() {
+                    var p = Ext.getCmp('key_data');
+                        p && p.setLoading(true);
+                },
+                load: function(s, d) {
+                    var p = Ext.getCmp('key_data');
+                        p && p.setLoading(false),
+                        data = s.getAt(0) ? s.getAt(0).data : null;
+                    if(data) {
+                        delete data.id;
+                        p.updateValue(data);
+                        // Ext.getCmp('home').getViewModel().set('keydata', data);
+                    }
                 }
             } 
         },

+ 147 - 0
frontend/saas-web/app/view/home/charts/KeyData.js

@@ -0,0 +1,147 @@
+Ext.define('saas.view.home.charts.KeyData', {
+    extend: 'Ext.panel.Panel',
+
+    xtype: 'key-data',
+    id: 'key_data',
+    cls: 'quick-graph-panel',
+
+    title: '关键数据',
+
+    layout: 'fit',
+    height: 300,
+
+    cardTpl: [
+        '<div class="x-container">',
+            '<tpl for=".">',
+                '<div class="x-box x-box-{color}">',
+                    '<div class="x-box-content">',
+                        '<tpl if="showIcon">',
+                            '<div class="x-icon x-icon-{icon}"></div>',
+                        '</tpl>',
+                        '<div class="x-text',
+                            // '<tpl if="!showIcon">',
+                            //     ' x-text-small',
+                            // '</tpl>',
+                        '">',
+                            // '<tpl if="!showIcon">',
+                            //     '<div class="x-icon-small x-icon-{icon}"></div>',
+                            // '</tpl>',
+                            '<div class="x-key"><span>{label}</span></div>',
+                            '<div class="x-value"><span>{value}</span></div>',
+                        '</div>',
+                    '</div>',
+                '</div>',
+            '</tpl>',
+        '</div>'
+    ],
+
+    cards: [{
+        color: 'green',
+        showIcon: true,
+        icon: 'storageTotal',
+        name: 'storageTotal',
+        label: '库存总额',
+        value: '0',
+        viewType: 'stock-report-datalist',
+        title: '物料库存数量金额表查询',
+        id: 'stock-report-datalist',
+    }, {
+        color: 'yellow',
+        showIcon: true,
+        icon: 'receiveTotal',
+        name: 'receiveTotal',
+        label: '应收总额',
+        value: '0',
+        viewType: 'monry-report-totalrecdetail',
+        title: '应收总账查询',
+        id: 'monry-report-totalrecdetail',
+    }, {
+        color: 'red',
+        showIcon: true,
+        icon: 'payTotal',
+        name: 'payTotal',
+        label: '应付总额',
+        value: '0',
+        viewType: 'monry-report-totalpaydetail',
+        title: '应付总账查询',
+        id: 'monry-report-totalpaydetail',
+    }, {
+        color: 'blue',
+        showIcon: true,
+        icon: 'balanceTotal',
+        name: 'balanceTotal',
+        label: '账户余额',
+        value: '0',
+        viewType: 'document-bankinformation-datalist',
+        title: '资金账户查询',
+        id: 'document-bankinformation-datalist',
+    }],
+
+    initComponent: function () {
+        var me = this;
+
+        var store = Ext.create('Ext.data.Store', {
+            fields: ['color', 'showIcon', 'icon', 'label', 'value'],
+            data: me.cards,
+            updateValue: function(datas) {
+                this.each(function(r, index) {
+                    // var v = datas[r.get('name')];
+                    // var d = saas.util.BaseUtil.formatAmount(v);
+                    var d = Ext.util.Format.number(datas[r.get('name')], '0,000.00');
+                    r.set('value', d);
+                });
+            },
+            // updateShowIcon: function(show) {
+            //     this.each(function(r) {
+            //         r.set('showIcon', show);
+            //     });
+            // }
+        });
+        var view = Ext.create('Ext.view.View', {
+            store: store,
+            tpl: new Ext.XTemplate(me.cardTpl),
+            itemSelector: 'div.x-box',
+            listeners: {
+                itemclick: function(th, record, item, index, e, eOpts) {
+                    saas.util.BaseUtil.openTab(record.get('viewType'), record.get('title'), record.get('id'));
+                }
+            }
+        });
+
+        Ext.apply(me, {
+            items: [view]
+        });
+
+        me.view = view;
+
+        me.callParent(arguments);
+    },
+
+    listeners: {
+        // afterlayout: function() {
+        //     var me = this,
+        //     box = me.getBox(),
+        //     view = me.view,
+        //     width = box.width,
+        //     store = view.store;
+
+        //     store.updateShowIcon(width >= 450);
+        // },
+    },
+
+    updateValue: function(datas) {
+        var me = this,
+        view = me.view,
+        store = view.store;
+
+        store.updateValue(datas);
+    },
+
+    // updateShowIcon: function(showIcon) {
+    //     var me = this,
+    //     view = me.view,
+    //     store = view.store;
+
+    //     store.updateShowIcon(showIcon);
+    // }
+});

+ 111 - 0
frontend/saas-web/app/view/home/charts/KeyData.scss

@@ -0,0 +1,111 @@
+#key_data {
+    .key_data-body {
+        padding: 0;
+    }
+    .x-container {
+        height: 100%;
+        display: flex;
+        flex-wrap: wrap;
+
+        .x-box {
+            width: calc(50% - 16px);
+            border-width: 5px 1px 1px;
+            border-style: solid;
+            border-color: #1EC09F;
+            cursor: pointer;
+
+            &:nth-of-type(odd) {
+                margin: 8px 8px 8px 0;
+            }
+
+            &:nth-of-type(even) {
+                margin: 8px 0 8px 8px;
+            }
+
+            .x-box-content {
+                display: flex;
+                height: 100%;
+                padding: 16px;
+
+                .x-icon {
+                    flex: 4;
+                    max-width: 48px;
+                    background-repeat: no-repeat;
+                    background-size: contain;
+                    background-position: center;
+
+                    &-small {
+                        width: 36px;
+                        height: 36px;
+                        position: relative;
+                        background-repeat: no-repeat;
+                        background-size: contain; 
+                    }
+
+                    &-storageTotal {
+                        background-image: url(/resources/images/home/storageTotal.png);
+                    }
+                    &-receiveTotal {
+                        background-image: url(/resources/images/home/receiveTotal.png);
+                    }
+                    &-payTotal {
+                        background-image: url(/resources/images/home/payTotal.png);
+                    }
+                    &-balanceTotal {
+                        background-image: url(/resources/images/home/balanceTotal.png);
+                    }
+                }
+
+                .x-text {
+                    flex: 6;
+                    display: flex;
+                    color: #485465;
+                    flex-direction: column;
+                    align-items: flex-end;
+                    overflow: hidden;
+
+                    .x-key {
+                        flex: 1;
+                        display: flex;
+                        align-items: flex-end;
+                        margin-bottom: 5px;
+                        font-size: 14px;
+                        color: #485465;
+                    }
+                
+                    .x-value {
+                        flex: 1;
+                        display: flex;
+                        align-items: flex-start;
+                        font-size: 16px;
+                        color: #1E2429;
+                    }
+
+                    &-small {
+                        display: block;
+
+                        .x-key {
+                            display: block;
+                            padding-left: 54px;
+                            margin-top: -17px;
+                            margin-bottom: 14px;
+                        }
+                    }
+                }
+            }
+        }
+
+        .x-box-green {
+            border-color: #1EC09F;
+        }
+        .x-box-yellow {
+            border-color: #FDC200;
+        }
+        .x-box-red {
+            border-color: #FB6A83;
+        }
+        .x-box-blue {
+            border-color: #62A3DF;
+        }
+    }
+}

+ 1 - 1
frontend/saas-web/app/view/home/charts/MonthPurchase.js

@@ -2,7 +2,7 @@ Ext.define('saas.view.home.charts.MonthPurchase', {
     extend: 'saas.view.core.chart.ChartBase',
     xtype: 'month-purchase',
 
-    id: 'month-purchase',
+    id: 'month_purchase',
 
     bind: {
         title: '本月采购额(万元):{month_purchase_amount}'

+ 2 - 2
frontend/saas-web/app/view/main/Main.scss

@@ -69,7 +69,7 @@ $treelist-nav-ui: (
             width: 32px;
             height: 32px;
             top: 16px;
-            left: 42px;
+            left: 28px;
             position: relative;
         }
 
@@ -80,7 +80,7 @@ $treelist-nav-ui: (
             text-align: left;
             top: 30px;
             position: absolute;
-            left: 76px;
+            left: 64px;
         }
     }
 }

+ 2 - 2
frontend/saas-web/app/view/main/MainController.js

@@ -35,13 +35,13 @@ Ext.define('saas.view.main.MainController', {
         navigationList = refs.navigationTreeList,
         navCollapsed = !navigationList.navCollapsed,
         new_width = navCollapsed ? viewModel.get('smallNavWidth') : viewModel.get('navWidth'),
-        newLogoImgStyle = navCollapsed ? { width: 36, height: 36, top: 12, left: 12 } : { width: 32, height: 32, top: 16, left: 42 },
+        newLogoImgStyle = navCollapsed ? { width: 36, height: 36, top: 12, left: 12 } : { width: 32, height: 32, top: 16, left: 28 },
         newLogoTextStyle = navCollapsed ? {
             5: { opacity: 0 },
             10: { opacity: 0 },
             100: { opacity: 0, display: 'none' }
         } : {
-            25: { opacity: 0 },
+            10: { opacity: 0 },
             50: { opacity: 1 }
         },
         newNavIconStyle = navCollapsed ? { marginLeft: 6, fontSize: 28 } : { marginLeft: 22, fontSize: 24 },

+ 1 - 1
frontend/saas-web/app/view/main/MainModel.js

@@ -7,7 +7,7 @@ Ext.define('saas.view.main.MainModel', {
     alias: 'viewmodel.main',
 
     data: {
-        navWidth: 180,
+        navWidth: 160,
         smallNavWidth: 64,
     }
 });

+ 15 - 0
frontend/saas-web/app/view/money/report/TotalPayDetail.js

@@ -61,5 +61,20 @@ Ext.define('saas.view.money.report.TotalPayDetail', {
         dataIndex: 'vm_endamount',
         xtype: 'numbercolumn',
         width: 150,
+        renderer : function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+            var format = '0,000.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        },
+        summaryType: 'sum',
+        summaryRenderer: function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+            var format = '0,000.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        }
+    }, {
+        flex: 1
     }]
 });

+ 15 - 0
frontend/saas-web/app/view/money/report/TotalRecDetail.js

@@ -60,5 +60,20 @@ Ext.define('saas.view.money.report.TotalRecDetail', {
         dataIndex: 'cm_endamount',
         xtype: 'numbercolumn',
         width: 150,
+        renderer : function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+            var format = '0,000.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        },
+        summaryType: 'sum',
+        summaryRenderer: function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+            var format = '0,000.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        }
+    }, {
+        flex: 1
     }]
 });

+ 35 - 2
frontend/saas-web/app/view/stock/report/DataList.js

@@ -15,6 +15,7 @@ Ext.define('saas.view.stock.report.DataList', {
     QueryWidth: 0.4,
     printAble: false,
     exportAble: true,
+    queryMode: 'MAIN',
 
     searchItems: [{
         name: 'pr_code',
@@ -33,11 +34,11 @@ Ext.define('saas.view.stock.report.DataList', {
             return "(upper(wh_code) like '%" + v.toUpperCase() + "%' or upper(wh_description) like '%" + v.toUpperCase() + "%')";
         }
     }, {
+        xtype: 'checkboxfield',
         name: 'toggle',
-        xtype: 'checkbox',
         fieldLabel: '分仓库存',
         columnWidth: 0.1,
-        labelAlign: 'left',
+        labelAlign: 'right',
         labelWidth: 70,
         ignore: true,
         listeners: {
@@ -104,6 +105,31 @@ Ext.define('saas.view.stock.report.DataList', {
             var format = '0.' + xr.join();
             return Ext.util.Format.number(v, format);
         },
+        summaryType: 'sum',
+        summaryRenderer: function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+            var format = '0.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        }
+    }, {
+        text: "金额",
+        xtype: 'numbercolumn',
+        dataIndex: "rc_amount",
+        width: 150,
+        renderer: function (v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+            var format = '0.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        },
+        summaryType: 'sum',
+        summaryRenderer: function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+            var format = '0.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        }
     }],
 
     reportColumns: [{
@@ -145,6 +171,13 @@ Ext.define('saas.view.stock.report.DataList', {
             var format = '0.' + xr.join();
             return Ext.util.Format.number(v, format);
         },
+        summaryType: 'sum',
+        summaryRenderer: function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+            var format = '0.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        }
     }, {
         flex: 1
     }],

+ 2 - 0
frontend/saas-web/app/view/stock/report/Prodiodetail.js

@@ -12,6 +12,8 @@ Ext.define('saas.view.stock.report.Prodiodetail', {
     defaultCondition: null,
     reportTitle: '物料出入库明细表',
     QueryWidth:0.2,
+    showMySummary: false,
+
     //筛选:单据类型、物料、日期
     searchItems: [ {		
         xtype: 'textfield',

+ 5 - 4
frontend/saas-web/ext/packages/ux/src/feature/MySummary.js

@@ -30,12 +30,11 @@ Ext.define('Ext.ux.feature.MySummary', {
         me.callParent([grid]);
 
         grid.store.on('load', function() {
-            this.fireEvent('mysummarychange', grid);
+            this.fireEvent('mysummarychange', this);
         }, grid);
 
-        grid.on({
-            mysummarychange: me.refreshData,
-            scope: me
+        grid.on('mysummarychange', function() {
+            me.refreshData(grid); 
         });
 
         grid.on({
@@ -118,6 +117,8 @@ Ext.define('Ext.ux.feature.MySummary', {
 
         if(summarys.length == 0) {
             me.showSummaryRow = false;
+        }else {
+            me.showSummaryRow = true;
         }
 
         return summarys;

+ 2 - 2
frontend/saas-web/ext/packages/ux/src/feature/MySummary.scss

@@ -1,5 +1,5 @@
-.x-docked-mysummary {
-    border-color: #d0d0d0;
+div.x-component.x-docked-mysummary {
+    border-color: #999 !important;
     border-style: solid;
     background: #fff!important;
 

+ 60 - 0
frontend/saas-web/overrides/ux/TabCloseMenu.js

@@ -0,0 +1,60 @@
+Ext.define('saas.override.ux.TabCloseMenu', {
+    override: 'Ext.ux.TabCloseMenu',
+
+    cls: 'x-tab-close-menu',
+
+    createMenu : function() {
+        var me = this;
+ 
+        if (!me.menu) {
+            var items = [{
+                itemId: 'close',
+                text: me.closeTabText,
+                scope: me,
+                handler: me.onClose
+            }];
+ 
+            if (me.showCloseAll || me.showCloseOthers) {
+                items.push('-');
+            }
+ 
+            if (me.showCloseOthers) {
+                items.push({
+                    itemId: 'closeOthers',
+                    text: me.closeOthersTabsText,
+                    scope: me,
+                    handler: me.onCloseOthers
+                });
+            }
+ 
+            if (me.showCloseAll) {
+                items.push({
+                    itemId: 'closeAll',
+                    text: me.closeAllTabsText,
+                    scope: me,
+                    handler: me.onCloseAll
+                });
+            }
+ 
+            if (me.extraItemsHead) {
+                items = me.extraItemsHead.concat(items);
+            }
+ 
+            if (me.extraItemsTail) {
+                items = items.concat(me.extraItemsTail);
+            }
+ 
+            me.menu = Ext.create('Ext.menu.Menu', {
+                cls: me.cls,
+                items: items,
+                listeners: {
+                    hide: me.onHideMenu,
+                    scope: me
+                }
+            });
+        }
+ 
+        return me.menu;
+    },
+
+});

BIN
frontend/saas-web/resources/images/home/balanceTotal.png


BIN
frontend/saas-web/resources/images/home/payTotal.png


BIN
frontend/saas-web/resources/images/home/receiveTotal.png


BIN
frontend/saas-web/resources/images/home/storageTotal.png


+ 4 - 4
frontend/saas-web/resources/json/navigation.json

@@ -169,14 +169,14 @@
             "id": "monry-report-totalrecdetail",
             "viewType":"monry-report-totalrecdetail"
         }, {
-            "text": "应付总账",
-            "id": "monry-report-totalpaydetail",
-            "viewType":"monry-report-totalpaydetail"
-        },{
             "text": "应收账款明细表",
             "id": "monry-report-recdetail",
             "viewType":"monry-report-recdetail"
         }, {
+            "text": "应付总账",
+            "id": "monry-report-totalpaydetail",
+            "viewType":"monry-report-totalpaydetail"
+        },{
             "text": "应付账款明细表",
             "id": "monry-report-paydetail",
             "viewType":"monry-report-paydetail"