Browse Source

操作日志按钮+报表按钮调整

rainco 7 years ago
parent
commit
1df3e8ff9d

+ 30 - 1
frontend/saas-web/app/view/core/form/FormPanel.js

@@ -47,7 +47,36 @@ Ext.define('saas.view.core.form.FormPanel', {
         auditBtnText: '审核',
         unAuditBtnText: '反审核',
     },
-
+    buttons:[{
+        text:'操作日志',
+        handler:function(btn){
+            console.log("btn:",btn);
+            var form = btn.up('form'),
+            mlKeyvalue = form.viewModel.get(form._idField)||0,
+            win = Ext.getCmp(form.xtype+mlKeyvalue);
+            console.log("mlKeyvalue:",mlKeyvalue);
+            if (!win) {
+                win = Ext.create('Ext.window.Window', {
+                    modal: true,
+                    id:form.xtype+mlKeyvalue,
+                    height: '80%',
+                    width: '80%',
+                    title: '操作日志('+form.viewModel.get(form._codeField)+')',
+                    scrollable: true,
+                    //bodyPadding: 10,
+                    constrain: true,
+                    closable: true,
+                    layout: 'fit',
+                    renderTo: Ext.getCmp('main-tab-panel').getActiveTab().down('form').getEl(),
+                    items: [{
+                        xtype: 'core-form-mseeageLog',
+                        mlKeyvalue:mlKeyvalue
+                    }]
+                });
+            };
+            win.show();
+        }
+    }],
     initComponent: function () {
         var me = this,
         auditTexts = me.auditTexts;

+ 233 - 0
frontend/saas-web/app/view/core/form/MseeageLog.js

@@ -0,0 +1,233 @@
+Ext.define('saas.view.core.form.MseeageLog', {
+    extend: 'Ext.grid.Panel',
+    xtype: 'core-form-mseeageLog',
+
+    autoScroll: true,
+    frame:true,
+    layout:'fit',
+    dataUrl:'/api/commons/messagelog/list',
+
+    tbar: [{
+        width: 150,
+        name: 'ml_man',
+        xtype: 'textfield',
+        emptyText : '操作人员'
+    },{
+        cls:'x-formpanel-btn-orange',
+        xtype:'button',
+        text:'查询',
+        listeners: {
+            click:function(b){
+                var grid = b.ownerCt.ownerCt;
+                var tbar = b.ownerCt;
+                grid.condition = '';
+                var items = [];
+                var fields = tbar.items.items.map(f => f.name);
+                Ext.each(fields, function(f, index){
+                    var field = tbar.down('[name='+f+']');
+                    if(field){
+                        items.push(field);
+                    }
+                });
+                grid.condition = grid.getCondition(items);
+                grid.store.loadPage(1);
+            }
+        }
+    },'->'],
+
+    //字段属性
+    columns : [{
+        text : "id", 
+        width : 0, 
+        dataIndex : "id", 
+        xtype : "numbercolumn",   
+    },{
+        text:'单据类型',
+        dataIndex : "ml_name",
+        width : 0, 
+    },{
+        text : "单据编号", 
+        width : 0, 
+        dataIndex : "ml_code"
+    },{
+        xtype:'datecolumn',
+        format:'Y-m-d H:i:s',
+        text : "操作时间", 
+        dataIndex : "createTime", 
+        width : 200.0, 
+    }, {
+        text : "操作人员", 
+        dataIndex : "ml_man", 
+        width : 200
+    },
+    {
+        text : "操作", 
+        dataIndex : "ml_content", 
+        width : 220.0, 
+    }, 
+    {
+        text : "结果", 
+        dataIndex : "ml_result", 
+        width : 120.0, 
+        flex:1
+    }],
+
+    initComponent: function() {
+        var me = this;
+        me.condition = [{
+            type: 'number',
+            field: 'ml_keyvalue',
+            operation: '=',
+            value: me.mlKeyvalue
+        }];
+        if(me.columns){
+            var fields = me.columns.map(column => column.dataIndex);
+            me.store = Ext.create('Ext.data.Store',{
+                fields:fields,
+                autoLoad: true,
+                pageSize: 11,
+                data: [],
+                proxy: {
+                    timeout:8000,
+                    type: 'ajax',
+                    url: me.dataUrl,
+                    actionMethods: {
+                        read: 'GET'
+                    },
+                    reader: {
+                        type: 'json',
+                        rootProperty: 'data.list',
+                        totalProperty: 'data.total',
+                    }
+                },
+                listeners: {
+                    beforeload: function (store, op) {
+                        var condition = me.condition;
+                        if (Ext.isEmpty(condition)) {
+                            condition = "";
+                        }
+                        
+                        Ext.apply(store.proxy.extraParams, {
+                            number: op._page,
+                            size: store.pageSize,
+                            condition: JSON.stringify(condition)
+                        });
+                    }
+                }
+            });
+
+            Ext.apply(me, {
+                dockedItems:[{
+                    xtype: 'pagingtoolbar',
+                    dock: 'bottom',
+                    displayInfo: true,
+                    store: me.store
+                }]
+            });
+        }
+        me.callParent(arguments);
+    },
+
+     /**
+     * 获得过滤条件
+     */
+    getCondition: function(items) {
+        var me = this,
+        conditions = [];
+        for(var i = 0; i < items.length; i++) {
+            var item = items[i];
+            var field = item.name,
+            func = item.getCondition,
+            value = item.value,
+            condition;
+
+            if(typeof func == 'function') {
+                condition = {
+                    type: 'condition',
+                    value: func(value)
+                }
+            }else {
+                var xtype = item.xtype || 'textfield',
+                type = item.fieldType || me.getDefaultFieldType(xtype),
+                operation = item.operation || me.getDefaultFieldOperation(xtype),
+                conditionValue = me.getConditionValue(xtype, value);
+    
+                if(!conditionValue) {
+                    continue;
+                }
+                condition = {
+                    type: type,
+                    field: field,
+                    operation: operation,
+                    value: conditionValue
+                }
+            }
+            conditions.push(condition);
+        };
+        return conditions;
+    },
+
+    getDefaultFieldType: function(xtype) {
+        var type;
+
+        if(Ext.Array.contains(['numberfield'], xtype)) {
+            type = 'number';
+        }else if(Ext.Array.contains(['datefield', 'condatefield'], xtype)) {
+            type = 'date';
+        }else if(Ext.Array.contains(['combobox', 'multicombo', 'combo', 'radiofield', 'radio'], xtype)) {
+            type = 'enum';
+        }else {
+            type = 'string';
+        }
+
+        return type;
+    },
+
+    getDefaultFieldOperation: function(xtype) {
+        var operation;
+
+        if(Ext.Array.contains(['numberfield'], xtype)) {
+            operation = '=';
+        }else if(Ext.Array.contains(['datefield'], xtype)) {
+            operation = '=';
+        }else if(Ext.Array.contains(['condatefield'], xtype)) {
+            operation = 'between';
+        }else if(Ext.Array.contains(['combobox', 'multicombo', 'combo'], xtype)) {
+            operation = 'in';
+        }else {
+            operation = 'like';
+        }
+
+        return operation;
+    },
+
+    /**
+     * 处理部分字段值
+     */
+    getConditionValue: function(xtype, value) {
+        var conditionValue;
+        if(xtype == 'datefield') {
+            conditionValue = Ext.Date.format(new Date(from), 'Y-m-d H:i:s');
+        }else if(xtype == 'condatefield') {
+            var from = value.from,
+            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(xtype == 'combobox' || xtype == 'combo') {
+            conditionValue = '\'' + value + '\'';
+        }else if(xtype == 'multicombo') {
+            conditionValue = value.map(function(v) {
+                return '\'' + v.value + '\'';
+            }).join(',');
+        }else {
+            conditionValue = value;
+        }
+
+        return conditionValue;
+    },
+
+    refresh:function(){
+        //debugger
+    }
+
+});

+ 87 - 10
frontend/saas-web/app/view/main/Main.js

@@ -45,16 +45,13 @@ Ext.define('saas.view.main.Main', {
                     reference: 'mainprofile',
                     arrowVisible: false,
                     ui: 'header',
+                    tooltip: '所属公司',
                     bind: {
-                        tooltip: '{company.name}',
                         text: '{company.name}'
                     },
                     menu: {
                         items: [{
                             xtype: 'menuseparator'
-                        }, {
-                            text: '退出',
-                            handler: 'onLogout'
                         }]
                     }
                 },
@@ -62,12 +59,58 @@ Ext.define('saas.view.main.Main', {
                 {
                     iconCls:'icon-usoftchina',
                     ui: 'header',
-                    tooltip: '优软云'
+                    tooltip: '优软云',
+                    handler:function(){
+					    window.open('http://www.usoftchina.com','_blank');
+                    }
                 },
                 {
                     iconCls:'x-fa fa-question',
                     ui: 'header',
-                    tooltip: '帮助'
+                    arrowVisible: false,
+                    //tooltip: '帮助',
+                    width:50, 
+                    listeners:{
+                        'mouseover':function(){
+                            this.showMenu(); 
+                        },
+                        'mouseout':function(btn,e){
+                            var cx = e.browserEvent.clientX, cy = e.browserEvent.clientY;
+                            var btnLayout = btn.el.dom.getBoundingClientRect();
+                            if(cx <= btnLayout.left || cx >= btnLayout.left+btnLayout.width || cy <= btnLayout.top) {
+                                btn.hideMenu();
+                            }
+                        },'mouseleave':function(enu){
+                            this.hide();
+                        } 
+                    },
+                    menu: {
+                        items: [{
+                            text: '新手导航',
+                            iconCls:'x-fa icon-userGuite',
+                            handler:function(){
+                               console.log("新手导航");
+                            }
+                        },{
+                            text: '用户手册',
+                            iconCls:'x-fa icon-userBook',
+                            handler:function(){
+                                console.log("用户手册");
+                            }
+                        },{
+                            text: '常见问题',
+                            iconCls:'x-fa icon-commonQuestion',
+                            handler:function(){
+                                console.log("常见问题");
+                            }
+                        },{
+                            text: '客服热线',
+                            iconCls:'x-fa icon-serviceOnline',
+                            handler:function(){
+                                console.log("客服热线");
+                            }
+                        }]
+                    }
                 },
                 {
                     ui: 'header',
@@ -77,13 +120,47 @@ Ext.define('saas.view.main.Main', {
                     }
                 },
                 {
-                    xtype: 'image',
+                    ui: 'header',
+                    arrowVisible: false,
                     cls: 'header-right-profile-image',
-                    height: 35,
-                    width: 35,
-                    bind: {
+                    height: 70,
+                    width: 70,
+                   /*  bind: {
                         src: '{avatarUrl}'
+                    }, */
+                    menu: {
+                        items: [ {  
+                            text: '账户中心',
+                            iconCls:'x-fa icon-accountCenter',
+                            handler:function(){
+                            console.log("账户中心");
+                            }
+                        },{  
+                            text: '意见反馈',
+                            iconCls:'x-fa icon-feedback',
+                            handler:function(){
+                            console.log("意见反馈");
+                            }
+                        }, {
+                            text: '退出',
+                            handler: 'onLogout'
+                        }]
+                    } ,
+                    listeners:{
+                        'mouseover':function(){
+                            this.showMenu(); 
+                        },
+                        'mouseout':function(btn,e){
+                            var cx = e.browserEvent.clientX, cy = e.browserEvent.clientY;
+                            var btnLayout = btn.el.dom.getBoundingClientRect();
+                            if(cx <= btnLayout.left || cx >= btnLayout.left+btnLayout.width || cy <= btnLayout.top) {
+                                btn.hideMenu();
+                            }
+                        },'mouseleave':function(enu){
+                            this.hide();
+                        } 
                     }
+                    
                 }
             ]
         },

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

@@ -92,6 +92,8 @@ $treelist-nav-ui: (
 
     .header-right-profile-image {
         border-radius: 20px;
+        background: url(../../../../resources/images/default/user-profile-default.png) 0 0 no-repeat;
+        background-position: center;
     }
 }
 .top-english-button {
@@ -155,7 +157,42 @@ $treelist-nav-ui: (
 }
 .icon-usoftchina{
     margin-top: 0px;
-	width: 16px;
-    height: 16px;
     background: url(../../../../resources/images/nav/usoftchina.png) 0 0 no-repeat; 
-}
+   
+}
+.icon-userGuite{
+    margin-top: 0px;
+    background: url(../../../../resources/images/nav/userGuite.png) 0 0 no-repeat;
+    background-size: 16px 16px;
+    background-position: center;
+}
+.icon-userBook{
+    margin-top: 0px;
+    background: url(../../../../resources/images/nav/userBook.png) 0 0 no-repeat; 
+    background-size: 16px 16px;
+    background-position: center;
+}
+.icon-commonQuestion{
+    margin-top: 0px;
+    background: url(../../../../resources/images/nav/commonQuestion.png) 0 0 no-repeat; 
+    background-size: 16px 16px;
+    background-position: center;
+}
+.icon-serviceOnline{
+    margin-top: 0px;
+    background: url(../../../../resources/images/nav/serviceOnline.png) 0 0 no-repeat; 
+    background-size: 16px 16px;
+    background-position: center;
+}
+.icon-accountCenter{
+    margin-top: 0px;
+    background: url(../../../../resources/images/nav/accountCenter.png) 0 0 no-repeat; 
+    background-size: 16px 16px;
+    background-position: center;
+}
+.icon-feedback{
+    margin-top: 0px;
+    background: url(../../../../resources/images/nav/feedback.png) 0 0 no-repeat; 
+    background-size: 16px 16px;
+    background-position: center;
+} 

+ 1 - 1
frontend/saas-web/app/view/money/report/AccountBalance.js

@@ -11,7 +11,7 @@ Ext.define('saas.view.money.report.AccountBalance', {
     listUrl: '/api/money/report/accountBalance',
     defaultCondition: null,
     reportTitle: '资金账户收支明细',
-    QueryWidth:0.1,
+    QueryWidth:0.2,
     //筛选:账户、日期(必填)
     searchItems: [ {
         xtype: 'dbfindtrigger',

+ 1 - 1
frontend/saas-web/app/view/money/report/PayDetail.js

@@ -10,7 +10,7 @@ Ext.define('saas.view.money.report.PayDetail', {
     listUrl: '/api/money/report/payDetail',
     defaultCondition: null,
     reportTitle: '应付账款明细表',
-    QueryWidth:0.1,
+    QueryWidth:0.2,
     //筛选:供应商、日期(必填)
     searchItems: [ {
         xtype: 'dbfindtrigger',

+ 1 - 1
frontend/saas-web/app/view/money/report/RecDetail.js

@@ -11,7 +11,7 @@ Ext.define('saas.view.money.report.RecDetail', {
     listUrl: '/api/money/report/recDetail',
     defaultCondition: null,
     reportTitle: '应收账款明细',
-    QueryWidth:0.1,
+    QueryWidth:0.2,
     //筛选:客户、日期(必填)
     searchItems: [ {
         xtype: 'dbfindtrigger',

+ 13 - 8
frontend/saas-web/app/view/money/report/VendorCheck.js

@@ -11,7 +11,7 @@ Ext.define('saas.view.money.report.VendorCheck', {
     listUrl: '/api/money/report/vendorCheck',
     defaultCondition: null,
     reportTitle: '供应商对账单',
-    QueryWidth:0.1,
+    QueryWidth:0.2,
     //筛选:供应商、日期(必填)
     searchItems: [ {
         xtype: 'dbfindtrigger',
@@ -33,30 +33,35 @@ Ext.define('saas.view.money.report.VendorCheck', {
         }, {
             text: '单号',
             dataIndex: 'pi_inoutno',
-            width: 200
+            width: 180
         }, {
             text: '单据类型',
             dataIndex: 'pi_class',
-            width: 200
+            width: 180
         }, {
             text: '单据日期',
             dataIndex: 'pi_date',
-            width: 200
+            xtype:'datecolumn',
+            format:'Y-m-d'
         }, {
             text: '序号',
             dataIndex: 'pd_pdno'
         },{
             text:'供应商编号',
-            dataIndex:'pi_vendcode'
+            dataIndex:'pi_vendcode',
+            width: 180
         },{
             text:'供应商名称',
-            dataIndex:'pi_vendname'
+            dataIndex:'pi_vendname',
+            width: 180
         },{
             text: '物料编号',
-            dataIndex: 'pr_code'
+            dataIndex: 'pr_code',
+            width: 180
         }, {
             text: '物料名称',
-            dataIndex: 'pr_detail'
+            dataIndex: 'pr_detail',
+            width: 180
         }, {
             text: '物料规格',
             dataIndex: 'pr_spec'

+ 10 - 6
frontend/saas-web/app/view/stock/report/ProdinoutCount.js

@@ -11,7 +11,7 @@ Ext.define('saas.view.stock.report.ProdinoutCount', {
     listUrl: '/api/storage/report/prodinoutCount',
     defaultCondition: null,
     reportTitle: '物料收发汇总表',
-    QueryWidth:0.1,
+    QueryWidth:0.4,
     //筛选:仓库、物料、物料类型、时间			
     searchItems: [{		
         xtype: 'dbfindtrigger',
@@ -30,7 +30,7 @@ Ext.define('saas.view.stock.report.ProdinoutCount', {
         fieldLabel: '单据日期',
         format: 'YYYYMM',
        // defaultValue: new Date(),
-        columnWidth: 0.4
+        columnWidth: 0.2
     }],
     reportColumns: [{
         text: '物料类型',
@@ -57,22 +57,26 @@ Ext.define('saas.view.stock.report.ProdinoutCount', {
         columns: [{
             text: '数量',
             dataIndex:'pwm_beginqty',
-            xtype: 'numbercolumn'
+            xtype: 'numbercolumn',
+            width:100
         },{
             text: '成本',
             dataIndex:'pwm_beginamount',
-            xtype: 'numbercolumn'
+            xtype: 'numbercolumn',
+            width:100
         }]
     }, {
         text: '入库合计',
         columns: [{
             text: '数量',
             dataIndex:'pwm_nowinqty',
-            xtype: 'numbercolumn'
+            xtype: 'numbercolumn',
+            width:100
         },{
             text: '成本',
             dataIndex:'pwm_nowinamount',
-            xtype: 'numbercolumn'
+            xtype: 'numbercolumn',
+            width:100
         }]
     }, {
         text: '出库合计',

BIN
frontend/saas-web/resources/images/nav/accountCenter.png


BIN
frontend/saas-web/resources/images/nav/feedback.png


BIN
frontend/saas-web/resources/images/nav/serviceOnline.png


BIN
frontend/saas-web/resources/images/nav/userBook.png


BIN
frontend/saas-web/resources/images/nav/userGuite.png