Browse Source

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

chenw 7 years ago
parent
commit
3b653dc670

+ 3 - 0
frontend/saas-web/app/view/core/form/field/DetailGridField.js

@@ -234,6 +234,8 @@ Ext.define('saas.view.core.form.field.DetailGridField', {
             }
         });
 
+        // 不写该方法合计列会错位,这里触发afterEdit事件用来刷新grid
+        store.getAt(0) ? store.afterEdit(store.getAt(0), ['']) : null;
         me.fireEvent('validChange');
         return r;
     },
@@ -282,6 +284,7 @@ Ext.define('saas.view.core.form.field.DetailGridField', {
             store.remove(selectedRecord);
             me.fireEvent('validChange');
         }
+        // 不写该方法合计列会错位,这里触发afterEdit事件用来刷新grid
         store.getAt(0) ? store.afterEdit(store.getAt(0), ['']) : null;
     },
 

+ 1 - 0
frontend/saas-web/app/view/home/Home.js

@@ -4,6 +4,7 @@ Ext.define('saas.view.home.Home', {
     id: 'home',
 
     requires: [
+        'Ext.layout.container.Border',
         'Ext.ux.layout.ResponsiveColumn'
     ],
 

+ 46 - 26
frontend/saas-web/app/view/home/charts/KeyData.js

@@ -19,13 +19,13 @@ Ext.define('saas.view.home.charts.KeyData', {
                             '<div class="x-icon x-icon-{icon}"></div>',
                         '</tpl>',
                         '<div class="x-text',
-                            // '<tpl if="!showIcon">',
-                            //     ' x-text-small',
-                            // '</tpl>',
+                            '<tpl if="!showIcon">',
+                                ' x-text-small',
+                            '</tpl>',
                         '">',
-                            // '<tpl if="!showIcon">',
-                            //     '<div class="x-icon-small x-icon-{icon}"></div>',
-                            // '</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>',
@@ -91,11 +91,11 @@ Ext.define('saas.view.home.charts.KeyData', {
                     r.set('value', d);
                 });
             },
-            // updateShowIcon: function(show) {
-            //     this.each(function(r) {
-            //         r.set('showIcon', show);
-            //     });
-            // }
+            updateShowIcon: function(show) {
+                this.each(function(r) {
+                    r.set('showIcon', show);
+                });
+            }
         });
         var view = Ext.create('Ext.view.View', {
             store: store,
@@ -104,6 +104,26 @@ Ext.define('saas.view.home.charts.KeyData', {
             listeners: {
                 itemclick: function(th, record, item, index, e, eOpts) {
                     saas.util.BaseUtil.openTab(record.get('viewType'), record.get('title'), record.get('id'));
+                },
+                itemmouseenter: function(th, record, item, index, e, eOpts) {
+                    var tip = th.tip;
+                    if(!tip) {
+                        var tip = Ext.create('Ext.tip.ToolTip', {
+                            target: th.el,
+                            title: record.get('label'),
+                            html: record.get('value'),
+                            showOnTap: true,
+                            trackMouse: true
+                        });
+                        th.tip = tip;
+                        tip.showAt(e.getXY());
+                    }
+                },
+                itemmouseleave: function(th, record, item, index, e, eOpts) {
+                    var tip = th.tip;
+                    if(tip) {
+                        th.tip = Ext.destroy(th.tip);
+                    }
                 }
             }
         });
@@ -118,15 +138,15 @@ Ext.define('saas.view.home.charts.KeyData', {
     },
 
     listeners: {
-        // afterlayout: function() {
-        //     var me = this,
-        //     box = me.getBox(),
-        //     view = me.view,
-        //     width = box.width,
-        //     store = view.store;
-
-        //     store.updateShowIcon(width >= 450);
-        // },
+        afterlayout: function() {
+            var me = this,
+            box = me.getBox(),
+            view = me.view,
+            width = box.width,
+            store = view.store;
+
+            store.updateShowIcon(width >= 450);
+        },
     },
 
     updateValue: function(datas) {
@@ -137,11 +157,11 @@ Ext.define('saas.view.home.charts.KeyData', {
         store.updateValue(datas);
     },
 
-    // updateShowIcon: function(showIcon) {
-    //     var me = this,
-    //     view = me.view,
-    //     store = view.store;
+    updateShowIcon: function(showIcon) {
+        var me = this,
+        view = me.view,
+        store = view.store;
 
-    //     store.updateShowIcon(showIcon);
-    // }
+        store.updateShowIcon(showIcon);
+    }
 });

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

@@ -35,6 +35,7 @@
                     background-position: center;
 
                     &-small {
+                        opacity: 0.7;
                         width: 36px;
                         height: 36px;
                         position: relative;
@@ -79,17 +80,25 @@
                         align-items: flex-start;
                         font-size: 16px;
                         color: #1E2429;
+                        text-overflow: ellipsis;
+                        overflow: hidden;
                     }
 
                     &-small {
                         display: block;
 
                         .x-key {
+                            text-align: end;
                             display: block;
                             padding-left: 54px;
                             margin-top: -17px;
                             margin-bottom: 14px;
                         }
+
+                        .x-value {
+                            display: block;
+                            text-align: end;
+                        }
                     }
                 }
             }

+ 1 - 1
frontend/saas-web/app/view/home/infoCardList/Payment.js

@@ -10,7 +10,7 @@ Ext.define('saas.view.home.infoCardList.Payment', {
     codeField: 'pi_inoutno',
     // detailTitle: '采购验收单',
     // detailXType: 'purchase-purchasein-formpanel',
-    condition: 'pi_class in (\'采购验收单\',\'采购验退单\') and prodinout.companyId=#{companyId} and TO_DAYS(pi_date+ifnull(ve_promisedays,0))-TO_DAYS(now()) <= 7 and exists (select 1 from subledger where sl_code=pi_inoutno and sl_kind=pi_class and subledger.companyId=#{companyId} and ifnull(sl_namount,0)<>0)',
+    condition: 'pi_class in (\'采购验收单\',\'采购验退单\') and prodinout.companyId=#{companyId} and ( TO_DAYS(pi_date) + ifnull(ve_promisedays,0)-TO_DAYS(now()) ) <= 7 and exists (select 1 from subledger where sl_code=pi_inoutno and sl_kind=pi_class and subledger.companyId=#{companyId} and ifnull(sl_namount,0)<>0)',
     listColumns: [{
         text: 'id',
         dataIndex: 'pu_id',

+ 1 - 1
frontend/saas-web/app/view/home/infoCardList/Recment.js

@@ -10,7 +10,7 @@ Ext.define('saas.view.home.infoCardList.Recment', {
     codeField: 'pi_inoutno',
     // detailTitle: '出货单',
     // detailXType: 'sale-saleout-formpanel',
-    condition: 'pi_class in (\'出货单\',\'销售退货单\') and prodinout.companyId=#{companyId} and TO_DAYS(pi_date+ifnull(cu_promisedays,0))-TO_DAYS(now()) <= 7 and exists (select 1 from subledger where sl_code=pi_inoutno and sl_kind=pi_class and subledger.companyId=#{companyId} and ifnull(sl_namount,0)<>0)',
+    condition: 'pi_class in (\'出货单\',\'销售退货单\') and prodinout.companyId=#{companyId} and (TO_DAYS(pi_date) + ifnull(cu_promisedays,0) - TO_DAYS(now())) <= 7 and exists (select 1 from subledger where sl_code=pi_inoutno and sl_kind=pi_class and subledger.companyId=#{companyId} and ifnull(sl_namount,0)<>0)',
     listColumns: [{
         text: 'id',
         dataIndex: 'id',

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

@@ -12,7 +12,7 @@ Ext.define('saas.view.stock.report.DataList', {
     // listUrl: 'http://192.168.253.41:8560/api/document/product/ReserveCost',
     defaultCondition: null,
     reportTitle: '物料库存数量金额表',
-    QueryWidth: 0.4,
+    QueryWidth: 0.65,
     printAble: false,
     exportAble: true,
     queryMode: 'MAIN',
@@ -30,6 +30,7 @@ Ext.define('saas.view.stock.report.DataList', {
         xtype: 'textfield',
         emptyText: '仓库编号/名称',
         columnWidth: 0.25,
+        hidden: true,
         getCondition: function (v) {
             return "(upper(wh_code) like '%" + v.toUpperCase() + "%' or upper(wh_description) like '%" + v.toUpperCase() + "%')";
         }

+ 16 - 10
frontend/saas-web/app/view/stock/report/DataListController.js

@@ -7,22 +7,28 @@ Ext.define('saas.view.stock.report.DataListController', {
         reportPanel = me.getView(),
         form = reportPanel.down('form'),
         grid = reportPanel.down('grid'),
-        store = grid.store;
+        store = grid.store,
+        columns = [];
         
-        // var whCodeField = form.getForm().findField('wh_code');
-        // whCodeField.setValue('');
-        // whCodeField.setHidden(!newValue);
+        var whCodeField = form.getForm().findField('wh_code');
+        var con = form.items.items[3];
+
+        whCodeField.setValue('');
+        whCodeField.setHidden(!newValue);
 
         if(newValue) {
+            con.columnWidth = 0.4;
             reportPanel.queryMode = 'DETAIL';
-            store.load(function() {
-                grid.reconfigure(store, reportPanel.reportColumns2);
-            });
+            columns = reportPanel.reportColumns2;
         }else {
+            con.columnWidth = 0.65;
             reportPanel.queryMode = 'MAIN';
-            store.load(function() {
-                grid.reconfigure(store, reportPanel.reportColumns);
-            });
+            columns = reportPanel.reportColumns;
         }
+        
+        form.updateLayout();
+        store.load(function() {
+            grid.reconfigure(store, columns);
+        });
     }
 });