Browse Source

代码提交

hy 7 years ago
parent
commit
6473f5fe38

+ 1 - 0
frontend/saas-web/app/view/core/base/GridPanel.js

@@ -217,6 +217,7 @@ Ext.define('saas.view.core.base.GridPanel', {
             return Ext.Array.insert(columns,0,[{
                 xtype:'actioncolumn',
                 width:70,
+                dataIndex:'actioncolumn',
                 text:'操作',
                 items: [{
                     tooltip: '编辑',

+ 1 - 1
frontend/saas-web/app/view/document/kind/KindModel.js

@@ -234,7 +234,7 @@ Ext.define('saas.view.document.kind.KindModel', {
                 }
             }
         },
-        productunit: {
+        productunit: {    
             fields:[
                 {name: 'id', type: 'int'},
                 {name: 'pu_name',  type: 'string'}

+ 240 - 0
frontend/saas-web/app/view/sys/maxnumbers/DataList.js

@@ -0,0 +1,240 @@
+/**
+ * Created by zhouy on 2018/10/18.
+ */
+Ext.define('saas.view.sys.maxnumbers.DataList', {
+    extend: 'Ext.grid.Panel',
+    xtype: 'sys-maxnumbers-datalist',
+    autoScroll: true,
+    frame:true,
+    layout:'fit',
+    dataUrl:'http://192.168.253.31:8920/number/list',
+    saveUrl:'http://192.168.253.31:8920/number/save',
+    deleteUrl:'http://192.168.253.31:8920/number/delete/',
+
+    tbar: [{
+        cls:'x-formpanel-btn-orange',
+        xtype:'button',
+        text:'查询',
+        listeners: {
+            click: 'onQuery'
+        }
+    },'->',{
+        cls:'x-formpanel-btn-blue',
+        xtype:'button',
+        text:'新增',
+        listeners: {
+            click: 'onAdd'
+        }
+    }],
+
+    columns : [{
+        text : "id", 
+        width : 0, 
+        dataIndex : "id", 
+        xtype : "numbercolumn", 
+    },{
+        text : "单据caller", 
+        width : 200.0, 
+        dataIndex : "mn_caller", 
+        xtype : "", 
+    }, 
+    {
+        text : "单据前缀", 
+        dataIndex : "mn_leadcode", 
+        width : 120.0, 
+        xtype : "", 
+    }, 
+    {
+        text : "单据规则", 
+        dataIndex : "mn_rule", 
+        width : 220.0, 
+        xtype : "", 
+    },{
+        text : "规则长度", 
+        dataIndex : "mn_number", 
+        width : 120.0, 
+        xtype : "", 
+    }],
+
+    dbSearchFields: [],
+    condition:'',
+
+    initComponent: function() {
+        var me = this;
+        if(me.columns){
+            var fields = me.columns.map(column => column.dataIndex);
+            me.columns = me.insertFirstColumn(me.columns);
+            me.store = Ext.create('Ext.data.Store',{
+                fields:fields,
+                autoLoad: true,
+                pageSize: 10,
+                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,
+                    emptyMsg: "暂无数据",
+                    store: me.store,
+                    displayMsg: '显示{0}到{1}条数据,共有{2}条',
+                    beforePageText: "当前第",
+                    afterPageText: "页,共{0}页"
+                }]
+            });
+        }
+        me.callParent(arguments);
+    },
+
+    onVastDeal:function(url,type){
+        var form = this.ownerCt;
+        var grid = this;
+        var data = grid.getGridSelected(type);
+        if(!data){
+            showToast('请勾选符合条件的行进行操作。');
+            return false;
+        }
+        if(data&&data.length>0){
+            var params = JSON.stringify({baseDTOs:data});
+            form.BaseUtil.request({
+                    url: url,
+                    params: params,
+                    method: 'POST',
+                    async:false
+                })
+                .then(function() {
+                    showToast('操作成功');
+                    grid.store.load();
+                })
+                .catch(function(response) {
+                    showToast('操作失败');
+                });
+        }else{
+            showToast('请勾选至少一条明细。');
+        }
+    },
+
+    listeners:{
+        itemClick: function(view,record,a,index,c) {
+            var classList = c.target.classList.value;
+            var form = view.ownerCt.ownerCt;
+            if(classList.indexOf('fa-pencil')>-1){
+                var config = {};
+                config.initId = record.get('id');
+                openTab(form._formXtype, '修改'+form._title, form._formXtype+config.initId, config);
+            }else if(classList.indexOf('fa-trash-o')>-1){
+                //删除
+                var id = record.get('id');
+                if(id){
+                    form.BaseUtil.request({
+                        url: form._deleteUrl+id,
+                        method: 'POST',
+                    })
+                    .then(function(localJson) {
+                        if(localJson.success){
+                            //解析参数
+                            showToast('删除成功');
+                            view.ownerCt.store.load();
+                        }
+                    })
+                    .catch(function() {
+                        showToast('删除失败');
+                    });
+                }
+            }
+        }
+    },
+
+    getCondition: function(f,conditionExpression){
+        var condition = '';
+        if((f.xtype == 'checkbox' || f.xtype == 'radio')&&f.logic){
+            
+        }else if(f.xtype=='textfield'&&f.value!=''){
+            condition=conditionExpression.replace(new RegExp("\\{0}","g"), f.value);
+        }
+        if(condition.length>0){
+            condition+= ' AND ';
+        }
+        return condition;
+    },
+
+    insertFirstColumn:function(columns){
+        var me=this;
+        if(columns.length>0 && columns[0].xtype!='actioncolumn'){
+            return Ext.Array.insert(columns,0,[{
+                xtype:'actioncolumn',
+                width:70,
+                dataIndex:'actioncolumn',
+                text:'操作',
+                items: [{
+                    tooltip: '编辑',
+                    iconCls: 'x-fa fa-pencil fa-fw',
+                    scope:this
+                },{
+                    text:'删除',
+                    iconCls:'x-fa fa-trash-o fa-fw',
+                    tooltip: '删除',
+                    scope:this
+                }]
+            }]);
+        }
+        return columns;
+    },
+
+    getGridSelected:function(type){
+        var isErrorSelect = false;
+        var checkField = this.statusCodeField;
+        var me = this,
+        items = me.selModel.getSelection(),
+        data = new Array() ;
+        Ext.each(items, function(item, index){
+            if(!Ext.isEmpty(item.data[me.idField])){
+                var o = new Object();
+                if(me.idField){
+                    o['id'] = item.data[me.idField];
+                }
+                if(me.codeField){
+                    o['code'] = item.data[me.codeField];
+                }
+                if(type&&type==item.data[checkField]){
+                    isErrorSelect = true
+                }
+                data.push(o);
+            }
+        });
+        if(isErrorSelect){
+            return false;
+        }
+		return data;
+    }
+
+})
+
+

+ 121 - 0
frontend/saas-web/app/view/sys/messagelog/DataList.js

@@ -0,0 +1,121 @@
+Ext.define('saas.view.sys.messagelog.DataList', {
+    extend: 'Ext.grid.Panel',
+    xtype: 'sys-messagelog-datalist',
+
+    autoScroll: true,
+    frame:true,
+    layout:'fit',
+    dataUrl:'http://192.168.253.58:8920/messagelog/list',
+    saveUrl:'/api/common/number/save',
+    deleteUrl:'/api/common/number/delete/',
+
+    tbar: [{
+        cls:'x-formpanel-btn-orange',
+        xtype:'button',
+        text:'查询',
+        listeners: {
+            click: 'onQuery'
+        }
+    },'->'],
+
+    //字段属性
+    columns : [{
+        text : "id", 
+        width : 0, 
+        dataIndex : "id", 
+        xtype : "numbercolumn",   
+    },{
+        text : "单据编号", 
+        width : 200.0, 
+        dataIndex : "ml_code", 
+    }, 
+    {
+        text : "操作", 
+        dataIndex : "ml_content", 
+        width : 220.0, 
+    }, 
+    {
+        text : "结果", 
+        dataIndex : "ml_result", 
+        width : 120.0, 
+    }, 
+    {
+        text : "处理人", 
+        dataIndex : "ml_man", 
+        width : 200, 
+    }],
+
+    dbSearchFields: [],
+    condition:'',
+
+    initComponent: function() {
+        var me = this;
+        if(me.columns){
+            var fields = me.columns.map(column => column.dataIndex);
+            me.store = Ext.create('Ext.data.Store',{
+                fields:fields,
+                autoLoad: true,
+                pageSize: 10,
+                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,
+                    emptyMsg: "暂无数据",
+                    store: me.store,
+                    displayMsg: '显示{0}到{1}条数据,共有{2}条',
+                    beforePageText: "当前第",
+                    afterPageText: "页,共{0}页"
+                }]
+            });
+        }
+        me.callParent(arguments);
+    },
+
+    getCondition: function(f,conditionExpression){
+        var condition = '';
+        if((f.xtype == 'checkbox' || f.xtype == 'radio')&&f.logic){
+            
+        }else if(f.xtype=='textfield'&&f.value!=''){
+            condition=conditionExpression.replace(new RegExp("\\{0}","g"), f.value);
+        }
+        if(condition.length>0){
+            condition+= ' AND ';
+        }
+        return condition;
+    },
+
+    refresh:function(){
+        //debugger
+    }
+
+});

+ 23 - 0
frontend/saas-web/resources/json/navigation.json

@@ -246,4 +246,27 @@
             "leaf": true
         }]
     }]
+},{
+    "text": "设置",
+    "iconCls": "x-fa fa-cog",
+    "items": [{
+        "text": "系统设置",
+        "items": [{
+            "id":"sys-messagelog-datalist",
+            "text": "操作日志",
+            "viewType": "sys-messagelog-datalist",
+            "leaf": true
+        }, {
+            "id":"sys-messagelog-datalist",
+            "text": "单据编码规则",
+            "viewType": "sys-maxnumbers-datalist",
+            "leaf": true
+        }, {
+            "id":"product-list-formpanel",
+            "text": "结账/反结账",
+            "viewType": "document-product-basepanel",
+            "addType":"document-product-formpanel",
+            "leaf": true
+        }]
+    }]
 }]