Browse Source

查询界面

rainco 7 years ago
parent
commit
4d692059de

+ 246 - 0
frontend/saas-web/app/util/QueryUtil.js

@@ -0,0 +1,246 @@
+Ext.define('saas.util.QueryUtil', {
+
+    BaseUtil: Ext.create('saas.util.BaseUtil'),
+
+    // 请求页面组件接口模板
+    baseUrl: 'http://192.168.0.181:8560/api/ui/co_view/config?name={xtype}',
+    // 模板替换正则
+    urlRe: /(.*){xtype}(.*)/g,
+    
+    /**
+     * 获得form的字段配置
+     * @param form: form组件
+     */
+    setItems: function(form) {
+        var me = this;
+        debuggre;
+        Ext.each(form.items.items, function(f){
+            if(f.xtype=='core-query-queryformpanel'){
+
+            }else if(f.xtype=='core-query-gridpanel'){
+                
+            }
+
+        });
+        // xtype = form.xtype,
+        //     url = me.baseUrl.replace(me.urlRe, '$1' + xtype);
+        //     me.BaseUtil.request({url})
+        // .then(function(response) {
+        //     var res = Ext.decode(response.responseText);
+        //     if(res.success) {
+        //         var config = res.data, items = [];
+        //         if(config) {
+        //             items = config.items;
+        //             //_baseItems
+        //             // _BaseColumn: '',
+        //             // _RelativeColumn: '',
+        //             form.add(items);
+        //         }
+        //         form.fireEvent('afterSetItems', form, items);               
+        //     }
+        // })
+        // .catch(function(response) {
+        //     console.error(response);
+        // });
+    },
+     /**
+     * 获得form的字段查询条件
+     * @param form: form组件
+     * @returns Mode: 字段模式,默认MAIN 当f.fieldMode = "DETAIL",Mode->"DETAIL"
+     */
+    getStoreMode: function(form){
+        var Mode = "MAIN";
+        Ext.each(form.items.items, function(f){
+            if(!Ext.isEmpty(f.value)&&f.fieldMode == "DETAIL") {
+                Mode = "DETAIL";
+                break;
+            }
+        });
+        return Mode;
+    },
+      /**
+     * 获得form的字段查询条件
+     * @param form: form组件
+     */
+    getFormCondition: function(form){
+        var condition = "",
+        me = this;
+        Ext.each(form.items.items, function(f){
+				if((f.xtype == 'checkbox' || f.xtype == 'radio')&&f.logic){
+					if(f.value == true) {
+						if(condition == ''){
+							condition += "("+f.logic+")";
+						} else {
+							condition += ' AND (' + f.logic+')';
+						}
+					}
+				} else if(f.xtype == 'datefield' && f.value != null && f.value != '' ){
+					var v = Ext.Date.format(new Date(f.value), 'Y-m-d');
+					if(condition == ''){
+						condition += "to_char("+f.name+",'yyyy-MM-dd')='"+v+"'";
+					} else {
+						condition += " AND to_char("+f.name+",'yyyy-MM-dd')='"+v+"'";
+					}
+				} else if(f.xtype == 'datetimefield' && f.value != null){
+					var v = Ext.Date.format(new Date(f.value), 'Y-m-d H:i:s');
+					if(condition == ''){
+						condition += f.name + "=to_date('" + v + "', 'yyyy-MM-dd HH24:mi:ss')";
+					} else {
+						condition += ' AND ' + f.name + "=to_date('" + v + "', 'yyyy-MM-dd HH24:mi:ss')";
+					}
+				} else if(f.xtype == 'numberfield' && f.value != null && f.value != ''){
+					var endChar = '=';
+					if(condition == ''){
+						condition += f.name + endChar + f.value;
+					} else {
+						condition += ' AND ' + f.name + endChar + f.value;
+					}
+				} else if(f.xtype == 'combo' && f.value == '$ALL'){
+					if(f.store.data.length > 1) {
+						if(condition == ''){
+							condition += '(';
+						} else {
+							condition += ' AND (';
+						}
+						var _a = '';
+						f.store.each(function(d, idx){
+							if(d.data.value != '$ALL') {
+								if(_a == ''){
+									_a += f.name + "='" + d.data.value + "'";
+								} else {
+									_a += ' OR ' + f.name + "='" + d.data.value + "'";
+								}
+							}
+						});
+						condition += _a + ')';
+					}
+				}  else {
+                    if(!Ext.isEmpty(f.value)){
+                        if(me.contains(f.value.toString(), 'BETWEEN', true) && me.contains(f.value.toString(), 'AND', true)){
+                            if(condition == ''){
+                                condition += f.name + " " + f.value;
+                            } else {
+                                condition += ' AND (' + f.name + " " + f.value + ")";
+                            }
+                        } else if(me.contains(f.value.toString(), '||', true)){
+                            var str = '';
+                            Ext.each(f.value.split('||'), function(v){
+                                if(v != null && v != ''){
+                                    if(str == ''){
+                                        str += f.name + "='" + v + "'";
+                                    } else {
+                                        str += ' OR ' + f.name + "='" + v + "'";
+                                    }
+                                }
+                            });
+                            if(condition == ''){
+                                condition += "(" + str + ")";
+                            } else {
+                                condition += ' AND (' + str + ")";
+                            }
+                        } else if(f.value.toString().charAt(0) == '!'){ 
+                            if(condition == ''){
+                                condition += 'nvl(' + f.name + ",' ')<>'" + f.value.substr(1) + "'";
+                            } else {
+                                condition += ' AND (nvl(' + f.name + ",' ')<>'" + f.value.substr(1) + "')";
+                            }
+                        } else {
+                            if(f.value.toString().indexOf('%') >= 0) {
+                                if(condition == ''){
+                                    condition += f.name + " like '" + f.value + "'";
+                                } else {
+                                    condition += ' AND (' + f.name + " like '" + f.value + "')";
+                                }
+                            } else {
+                                if(condition == ''){
+                                    condition += '('+f.name + "='" + f.value + "')";
+                                } else {
+                                    condition += ' AND (' + f.name + "='" + f.value + "')";
+                                }
+                            }
+                        }
+                    }
+                    
+				}
+        });
+        return condition;
+    },
+    /**
+	 * string:原始字符串
+	 * substr:子字符串
+	 * isIgnoreCase:忽略大小写
+	 */
+    contains: function(string, substr, isIgnoreCase){
+		if (string == null || substr == null) return false;
+		if (isIgnoreCase === undefined || isIgnoreCase === true) {
+			string = string.toLowerCase();
+			substr = substr.toLowerCase();
+		}
+		return string.indexOf(substr) > -1;
+    },
+    /**
+     * 
+     */
+    queryData: function(grid,condition){
+        var me = this;
+        //判断是否加载数据
+        //      url = config.url,
+        //     params = config.params,
+        //     async = config.async || true,
+        //     method = config.method || 'GET',
+        //     timeout = config.timeout || 8000;
+            if(Ext.isEmpty(condition)){
+                condition ="1=1";
+            }
+            var params = { keyword: condition,number:1,size:15 };
+            var dataRes = {
+                url :grid.listUrl,
+                async:false,
+                params:params
+            };
+            me.BaseUtil.request(dataRes)
+            .then(function(response) {
+                var res = Ext.decode(response.responseText);
+                if(res.success) {
+                    var data = res.data;
+                    console.log(data);
+                     grid.getStore().loadData(data.list);
+                     grid.fireEvent('afterLoadData', grid, data.list);
+                }
+            })
+            .catch(function(response) {
+                console.log(response);
+                // something...
+            });
+    },
+    onQuery: function(parentForm,queryMoreForm){
+        var grid = parentForm.down('grid'),
+            condition = me.QueryUtil.getFormCondition(queryForm),
+            Mode = me.QueryUtil.getStoreMode(queryForm);
+        if(queryMoreForm){//更多查询
+            if(!Ext.isEmpty(condition)){
+                condition = " and ( "+me.QueryUtil.getStoreMode(queryMoreForm)+" ) ";
+            }else{
+                condition = me.QueryUtil.getStoreMode(queryMoreForm);
+            }
+            if(Mode=="MAIN"){
+                me.QueryUtil.getStoreMode(queryMoreForm);
+            }
+        }
+        console.log("condition:"+condition);
+        condition = " 1=1 ";
+        if(Mode=="MAIN"){
+            console.log("Mode:"+Mode+",查询当前列表");
+            me.queryData(grid,condition);
+        }else{
+            console.log("Mode:"+Mode+",查询当前关联列表");
+            //若明细字段含明细字段注意切换数据源 grid.reconfigure(store, columns);
+            //关联viewName = 关联viewName+"-RelativeGrid"
+            var viewName = parentForm.viewName+"-RelativeGrid";
+                console.log("grid:");
+                console.log(grid);
+                me.GridUtil.setColumns(grid,"http://192.168.0.181:8560/api/ui/co_view/config?name="+viewName);
+        }
+
+    }
+});

+ 27 - 0
frontend/saas-web/app/view/core/query/FormPanel.js

@@ -0,0 +1,27 @@
+Ext.define('saas.view.core.query.FormPanel', {
+    extend: 'Ext.form.Panel',
+    xtype: 'core-query-formpanel',
+
+    viewModel: 'core-query-formpanel',
+    
+     //工具类
+     BaseUtil: Ext.create('saas.util.BaseUtil'),
+     QueryUtil: Ext.create('saas.util.QueryUtil'),
+ 
+     //字段属性
+     _codeField: '',
+     _statusField: '',
+     _idField: '',
+    //基础属性 
+    layout: 'anchor',
+    autoScroll: true,
+    border: 1,
+    frame:true,
+    margin:'0',
+    initComponent: function() {
+        var me = this,
+        remoteConfig = me.remoteConfig;
+        remoteConfig && me.QueryUtil.setItems(me);
+        me.callParent(arguments);
+    }
+});

+ 4 - 0
frontend/saas-web/app/view/core/query/FormPanelModel.js

@@ -0,0 +1,4 @@
+Ext.define('saas.view.core.query.FormPanelModel', {
+    extend: 'Ext.app.ViewModel',
+    alias: 'viewmodel.core-query-formpanel'
+});

+ 81 - 0
frontend/saas-web/app/view/core/query/QueryFormPanel.js

@@ -0,0 +1,81 @@
+Ext.define('saas.view.core.query.QueryFormPanel', {
+    extend: 'Ext.form.Panel',
+    xtype: 'core-query-queryformpanel',
+
+    viewModel: 'core-query-queryformpanel',
+
+     //字段属性
+    _baseItems: [],
+    _codeField: '',
+    _statusField: '',
+    _idField: '',
+     
+    //基础属性
+    layout: 'column',
+    autoScroll: true,
+    anchor: '100% 30%',
+    buttonAlign : 'center',
+    bodyPadding: 5,
+    labelSeparator : ':',
+    defaults:{
+		xtype:'textfield',
+		columnWidth:0.33,
+		margin:'5 5 5 5'
+	},
+    fieldDefaults: {
+        margin: '0 5 5 0',
+        labelAlign: 'right',
+        labelWidth: 90,
+        columnWidth: 0.25,
+        blankText: '该字段不能为空'
+    },
+
+    dockedItems: [{
+        xtype: 'toolbar',
+        dock: 'bottom',
+        style: {
+            'border-bottom': '1px solid #35baf6 !important'
+        },
+        items: ['->',{
+            xtype: 'button',
+            text: '更多查询',
+            handler: me.moreQuery
+        }, {
+            xtype: 'button',
+            text: '查询',
+            handler: me.onQuery
+        },'->']
+    }],
+    
+    remoteConfig: false, // 是否需要从远端读取form配置
+    bindFields: [], // 已绑定字段(需要保存到数据库)
+    moreQuery: function(btn){
+        var win = Ext.getCmp('queryMoreWin');
+        if(!win){
+            win = Ext.create('Ext.window.Window', {
+            id:'queryMoreWin', 
+            modal:true,
+            height: '50%',
+            width: '50%',
+            title: '更多查询',
+            scrollable: true,
+            bodyPadding: 10,
+            constrain: true,
+            closable: true,
+            layout:'fit',
+            renderTo:Ext.getCmp('main-tab-panel').getActiveTab().getEl(),
+            items:[{
+                xtype:'core-query-querymoreformpanel',
+                viewName:btn.ownerCt.ownerCt.ownerCt.viewName+"-moreQuery",
+            }]
+        });
+    };
+        win.show();
+    },
+    onQuery: function(btn){
+        console.log("查询");
+        var me = this,
+            parentForm = btn.ownerCt.ownerCt.ownerCt;
+            parentForm.QueryUtil.onQuery(parentForm);
+    }
+});

+ 4 - 0
frontend/saas-web/app/view/core/query/QueryFormPanelModel.js

@@ -0,0 +1,4 @@
+Ext.define('saas.view.core.query.QueryFormPanelModel', {
+    extend: 'Ext.app.ViewModel',
+    alias: 'viewmodel.core-query-queryformpanel'
+});

+ 120 - 0
frontend/saas-web/app/view/core/query/QueryGridPanel.js

@@ -0,0 +1,120 @@
+Ext.define('saas.view.core.query.QueryGridPanel', {
+    extend: 'Ext.grid.Panel',
+    xtype: 'core-query-gridpanel',
+    
+    //工具类
+    GridUtil: Ext.create('saas.util.GridUtil'),
+    
+    //字段属性
+    _codeField: '',
+    _statusField: '',
+    _idField: '',
+    _BaseColumn: '',
+    _RelativeColumn: '',
+    //数据属性
+    listUrl:'http://192.168.0.181:8560/api/purchase/purchase/list',
+
+    //基础属性
+    border: 1,
+    anchor: '100% 70%',
+    loadMask: true,
+    frame:true,
+    showIndex: true,
+    columnWidth:1.0,
+    showRowNum:true,
+	autoQuery: true,
+    selModel:'checkboxmodel',
+    store: {
+        data: []
+    },
+   
+    initComponent: function() {
+        var me = this;
+        Ext.apply(me, {
+            dockedItems: [{
+                xtype: 'toolbar',
+                dock: 'top',
+                items: ['->',{
+                    text:'新增',
+                    handler:me.onAddMore
+                }, {
+                    text:'审核',
+                    handler: me.onAudit
+                }, {
+                    text:'打印',
+                    handler: me.onPrint
+                }, {
+                    text:'导出',
+                    handler: me.onExport
+                }, {
+                    text:'删除',
+                    handler: me.onDelete
+                }]
+            }],
+            bbar: {
+                xtype: 'pagingtoolbar',
+                displayInfo: true,
+                displayMsg: 'Displaying topics {0} - {1} of {2}',
+                emptyMsg: "暂无数据",
+            },
+            store: me.setStore()
+        });
+        me.listUrl && me.up('core-query-formpanel').QueryUtil.queryData(me);
+        me.callParent(arguments);
+    },
+
+    listeners: {
+        afterrender: function(grid) {
+            //没数据先暂时这样处理下
+            if(grid.store.count()==0){
+                grid.add10EmptyRow();
+            }
+        },
+        itemClick: function(tableView, record, item, index, e, eOpts) {
+            var grid = tableView.up('grid'),
+                store = grid.store,
+                count = store.getCount();
+                console.log("store");
+                console.log(store);
+        }
+    },
+    add10EmptyRow: function() {
+        var me = this,
+            store = me.getStore(),
+            selectedRecord = me.selModel.lastSelected,
+            datas = [];
+        Ext.Array.each(new Array(10), function() {
+            datas.push({});
+        })
+        store.insert(store.indexOf(selectedRecord) + 1, datas);
+    },
+    setStore:function(){
+        var me=this;
+        var store =  {
+                data: []
+            };
+        if(me.fields){
+            var store=Ext.create('Ext.data.Store',{
+                fields:me.fields,
+                autoLoad: true,
+                data :[]
+            });
+        }
+        return store;
+    },
+    onAddMore: function(btn) {
+        console.log("跳转到主从表");
+    },
+    onAudit: function(){
+        console.log("审核");
+    },
+    onPrint: function(){
+        console.log("打印");
+    },
+    onExport: function(){
+        console.log("导出");
+    },
+    onDelete: function() {
+        console.log("删除该行");
+    }
+});

+ 76 - 0
frontend/saas-web/app/view/core/query/QueryMoreFormPanel.js

@@ -0,0 +1,76 @@
+Ext.define('saas.view.core.query.QueryMoreFormPanel', {
+    extend: 'Ext.form.Panel',
+    xtype: 'core-query-querymoreformpanel',
+
+    viewModel: 'core-query-querymoreformpanel',
+    //字段属性
+    _codeField: '',
+    _statusField: '',
+    _idField: '',
+    _baseItems: '',
+    //基础属性
+    layout: 'column',
+    autoScroll: true,
+    buttonAlign : 'center',
+    bodyPadding: 5,
+    frame:true,
+    labelSeparator : ':',
+    defaults:{
+		xtype:'textfield',
+		columnWidth:0.33,
+		margin:'5 5 5 5'
+	},
+    fieldDefaults: {
+        margin: '0 5 5 0',
+        labelAlign: 'right',
+        labelWidth: 90,
+        columnWidth: 0.25,
+        blankText: '该字段不能为空'
+    },
+
+    dockedItems: [{
+        xtype: 'toolbar',
+        dock: 'bottom',
+        style: {
+            'border-bottom': '1px solid #35baf6 !important'
+        },
+        items: [{
+            xtype: 'button',
+            text: '重置',
+            handler: me.resetQuery
+        },'->',{
+            xtype: 'button',
+            text: '查询',
+            handler: me.onQueryMore
+        }, {
+            xtype: 'button',
+            text: '关闭',
+            handler: function(btn){
+                var win = Ext.getCmp('queryMoreWin');
+                win.close();
+				win.destroy();
+            }
+        }]
+    }],
+    
+    bindFields: [], // 已绑定字段(需要保存到数据库)
+    initComponent: function() {
+        var me = this;
+        console.log("viewName:"+me.viewName);
+        me.callParent(arguments);
+    },
+    resetQuery: function(btn){
+        console.log("重置窗口");
+        btn.ownerCt.ownerCt.reset();
+    },
+    onQueryMore: function(btn){
+        console.log("更多查询");
+        var me = this,
+            queryMoreForm = me.up('core-query-queryformpanel'),
+            parentForm = queryMoreForm.up('core-query-formpanel')
+            debugger;
+            console.log(parentForm);
+            parentForm.QueryUtil.onQuery(parentForm,queryMoreForm);
+    }
+    
+});

+ 4 - 0
frontend/saas-web/app/view/core/query/QueryMoreFormPanelModel.js

@@ -0,0 +1,4 @@
+Ext.define('saas.view.core.query.QueryMoreFormPanelModel', {
+    extend: 'Ext.app.ViewModel',
+    alias: 'viewmodel.core-query-querymoreformpanel'
+});

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

@@ -53,6 +53,12 @@ Ext.define('saas.view.main.MainModel', {
                                         viewType: 'test-myform-formpanel',
                                         leaf: true
                                     },
+                                    {
+                                        id: 'myquerytest',
+                                        text: '测试-采购单查询界面',
+                                        viewType: 'test-query-formpanel',
+                                        leaf: true
+                                    },
                                     {
                                         id: 'ghdd',
                                         text: '购货订单',

+ 10 - 0
frontend/saas-web/app/view/test/query/FormController.js

@@ -0,0 +1,10 @@
+Ext.define('saas.view.test.query.FormController', {
+    extend: 'saas.view.core.query.FormPanelController',
+    alias: 'controller.test-query-formcontroller',
+    init: function (view) {
+        var me = this;
+        this.control({
+        });
+
+    }
+});

+ 9 - 0
frontend/saas-web/app/view/test/query/FormModel.js

@@ -0,0 +1,9 @@
+Ext.define('saas.view.test.query.FormModel', {
+    extend: 'saas.view.core.query.FormPanelModel',
+    alias: 'viewmodel.test-query-formmodel',
+
+    // data: {
+    //     'core-query-gridpanel': []
+    // }
+
+});

+ 166 - 0
frontend/saas-web/app/view/test/query/FormPanel.js

@@ -0,0 +1,166 @@
+Ext.define('saas.view.test.query.FormPanel', {
+    extend: 'saas.view.core.query.FormPanel',
+    xtype: 'test-query-formpanel',
+
+    controller: 'test-query-formcontroller',
+    viewModel: 'test-query-formmodel',
+    viewName:'test-query-formpanel',
+
+    //字段属性
+    _codeField: 'pu_code',
+    _statusField: 'pu_statuscode',
+    _idField: 'pu_id',
+
+    items:[{
+        xtype: 'core-query-queryformpanel',
+        //_baseItems
+        items:[
+            {
+                xtype: 'hidden',
+                name: 'pu_id',
+                bind:'{pu_id}',
+                fieldLabel: 'ID',
+                allowBlank: true,
+                columnWidth: 0
+            },
+            {
+                xtype: 'dbfindtrigger',
+                name: 'pu_code',
+                bind:'{pu_code}',
+                fieldLabel: '单据编号',
+                allowBlank: true,
+                columnWidth: 0.25,
+                configUrl: resources/json/purchase/vendorColumnsDbfind.json,
+                dataUrl: resources/json/purchase/vendorDataDbfind.json
+            },
+            {
+                xtype: 'condatefield',
+                name: 'pu_date',
+                bind: '{pu_date}',
+                fieldLabel: '采购日期',
+                allowBlank: true,
+                columnWidth: 0.5
+            },
+            {
+                xtype: 'dbfindtrigger',
+                name: 'pu_vendcode',
+                bind: '{pu_vendcode}',
+                fieldLabel: '供应商编号',
+                allowBlank: true,
+                columnWidth: 0.25,
+                configUrl: resources/json/purchase/vendorColumnsDbfind.json,
+                dataUrl: resources/json/purchase/vendorDataDbfind.json
+            },
+            {
+                xtype: 'textfield',
+                name: 'pu_vendname',
+                bind: '{pu_vendname}',
+                fieldLabel: '供应商名称',
+                allowBlank: true,
+                columnWidth: 0.25
+            },
+            {
+                xtype: 'dbfindtrigger',
+                name: 'pd_prodcode',
+                bind: '{pd_prodcode}',
+                fieldLabel: '物料编号',
+                fieldMode: 'DETAIL',
+                allowBlank: true,
+                columnWidth: 0.25,
+                configUrl: resources/json/purchase/vendorColumnsDbfind.json,
+                dataUrl: resources/json/purchase/vendorDataDbfind.json
+            },
+            {
+                xtype: 'textfield',
+                name: 'pr_detail',
+                bind: '{pr_detail}',
+                fieldLabel: '物料名称',
+                allowBlank: true,
+                columnWidth: 0.25
+            },
+            {
+                xtype: 'remotecombo',
+                name:'pr_statuscode',
+                bind: '{pr_statuscode}',
+                fieldLabel: '审核状态',
+                allowBlank: true,
+                columnWidth: 0.25,
+                store: Ext.create('Ext.data.Store', {
+                    fields: ['pr_statuscode', 'pr_status'],
+                    queryMode: 'local',
+                    displayField: 'pr_status',
+                    valueField: 'pr_statuscode',
+                    data :[
+                        ["$ALL","全部"],
+                        ["=AUDITED" ,"已审核"],
+                        ["<>AUDITED","未审核"]
+                    ]
+                })
+            },
+            {
+                xtype: 'remotecombo',
+                name: 'pu_acceptstatuscode',
+                bind: '{pu_acceptstatuscode}',
+                fieldLabel: '入库状态',
+                allowBlank: true,
+                columnWidth: 0.25,
+                store: Ext.create('Ext.data.Store', {
+                    fields: ['pu_acceptstatuscode', 'pu_acceptstatus'],
+                    queryMode: 'local',
+                    displayField: 'pu_acceptstatus',
+                    valueField: 'pu_acceptstatuscode',
+                    data :[
+                        ["$ALL","全部"],
+                        ["=TURNOUT","已入库"],
+                        ["=NULL","未入库"],
+                        ["=PARTOUT","部分入库"]
+                    ]
+                })
+            }
+        ]
+    },{
+        xtype: 'core-query-gridpanel',
+        columns: [
+            {
+                text: '序号',
+                width: 80,
+                xtype: rownumberer
+            },
+            {
+                text: 'id',
+                dataIndex: 'pu_id',
+                width: 100,
+                xtype: 'numbercolumn'
+            },
+            {
+                text: '单据编号',
+                dataIndex: 'pu_code',
+                width: 120
+            },
+            {
+                text: '单据状态',
+                dataIndex: 'pu_status',
+                width: 120
+            }
+            //,
+            // {
+            //     text: 下单时间,
+            //     dataIndex: puDate,
+            //     width: 120,
+            //     xtype: datecolumn
+            // },
+            // {
+            //     text: 供应商名称,
+            //     dataIndex: puVendname,
+            //     width: 200
+            // },
+            // {
+            //     text: 含税金额,
+            //     dataIndex: puTaxtotal,
+            //     width: 120,
+            //     xtype: numbercolumn,
+            //     flex: 1
+            // }
+        ]
+    }]
+});

+ 77 - 0
frontend/saas-web/app/view/test/query/QueryFormPanel.js

@@ -0,0 +1,77 @@
+Ext.define('saas.view.test.query.QueryFormPanel', {
+    extend: 'Ext.form.Panel',
+    xtype: 'test-query-queryformpanel',
+
+    QueryUtil: Ext.create('saas.util.QueryUtil'),
+
+    viewModel: 'test-query-queryformpanel',
+    viewName:'',
+    layout: 'column',
+    autoScroll: true,
+    anchor: '100% 30%',
+    buttonAlign : 'center',
+    bodyPadding: 5,
+    labelSeparator : ':',
+    defaults:{
+		xtype:'textfield',
+		columnWidth:0.33,
+		margin:'5 5 5 5'
+	},
+    fieldDefaults: {
+        margin: '0 5 5 0',
+        labelAlign: 'right',
+        labelWidth: 90,
+        columnWidth: 0.25,
+        blankText: '该字段不能为空'
+    },
+
+    dockedItems: [{
+        xtype: 'toolbar',
+        dock: 'bottom',
+        style: {
+            'border-bottom': '1px solid #35baf6 !important'
+        },
+        items: ['->',{
+            xtype: 'button',
+            text: '更多查询',
+            handler: me.moreQuery
+        }, {
+            xtype: 'button',
+            text: '查询',
+            handler: me.onQuery
+        },'->']
+    }],
+    
+    remoteConfig: false, // 是否需要从远端读取form配置
+    bindFields: [], // 已绑定字段(需要保存到数据库)
+    moreQuery: function(btn){
+        var win = Ext.getCmp('queryMoreWin');
+        if(!win){
+            win = Ext.create('Ext.window.Window', {
+            id:'queryMoreWin', 
+            modal:true,
+            height: '50%',
+            width: '50%',
+            title: '更多查询',
+            scrollable: true,
+            bodyPadding: 10,
+            constrain: true,
+            closable: true,
+            layout:'fit',
+            renderTo:Ext.getCmp('main-tab-panel').getActiveTab().getEl(),
+            items:[{
+                xtype:'core-query-querymoreformpanel',
+                viewName:btn.ownerCt.ownerCt.ownerCt.viewName+"-moreQuery",
+                items:[]
+            }]
+        });
+    };
+        win.show();
+    },
+    onQuery: function(btn){
+        console.log("查询");
+        var me = this,
+            parentForm = btn.ownerCt.ownerCt.ownerCt;
+        me.QueryUtil.onQuery(parentForm);
+    }
+});