Browse Source

代码提交

hy 7 years ago
parent
commit
af44297579

+ 1 - 1
frontend/saas-web/app/util/FormUtil.js

@@ -96,7 +96,7 @@ Ext.define('saas.util.FormUtil', {
                     var o = {
                         main: d.main
                     };
-                    if(d.items) {
+                    if(d.hasOwnProperty('items')&&d.items) {
                         o.detail0 = d.items;
                     }else {
                         var idx = 1;

+ 40 - 18
frontend/saas-web/app/view/core/baseform/GridPanel.js

@@ -5,12 +5,19 @@ Ext.define('saas.view.core.baseform.GridPanel', {
     dataUrl: '',
     dbSearchFields: [],
     condition:'',
-    frame:true,
+
+    selModel: {
+        checkOnly:true,
+        type:'checkboxmodel',
+        mode : "MULTI" ,
+        ignoreRightMouseSelection : false
+	},
 
     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,
@@ -108,24 +115,17 @@ Ext.define('saas.view.core.baseform.GridPanel', {
         me.callParent(arguments);
     },
 
-    loadData: function(grid, url) {
-        this.BaseUtil.request({url})
-        .then(function(response) {
-            var data = Ext.decode(response.responseText);
-                grid.getStore().loadData(data.data);
-                grid.fireEvent('afterLoadData', grid, data.data);
-                grid.setLoading(false);
-        })
-        .catch(function(response) {
-            // something...
-        });
-    },
-
     listeners:{
-        afterrender:function(grid){
-            if(grid.dataUrl){
-                grid.setLoading(true);
-                grid.loadData(grid, grid.dataUrl);
+        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+'('+config.initId+')', form._formXtype+config.initId, config);
+            }else if(classList.indexOf('fa-trash-o')>-1){
+                //删除
+                debugger
             }
         }
     },
@@ -141,5 +141,27 @@ Ext.define('saas.view.core.baseform.GridPanel', {
             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,
+                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;
     }
 });

+ 101 - 36
frontend/saas-web/app/view/core/dbfind/DbfindGridPanel.js

@@ -32,12 +32,12 @@ Ext.define('saas.view.core.dbfind.DbfindGridPanel', {
                     beforeload: function (store, op) {
                         var condition = me.condition;
                         if (Ext.isEmpty(condition)) {
-                            condition = " 1=1 ";
+                            condition = '';
                         }
                         Ext.apply(store.proxy.extraParams, {
                             number: op._page,
                             size: store.pageSize,
-                            keyword: condition
+                            condition: JSON.stringify(condition)
                         });
                     }
                 }
@@ -51,17 +51,13 @@ Ext.define('saas.view.core.dbfind.DbfindGridPanel', {
                         xtype:'button',
                         text:'查询',
                         handler:function(b){
-                            var grid = me;
+                            var grid = me,items=[];
                             grid.condition = '';
-                            var fields = grid.dbSearchFields;
-                            Ext.Array.each(fields,function(f) {
+                            Ext.Array.each(grid.dbSearchFields,function(f) {
                                 var field = b.ownerCt.down('[name='+f.name+']')
-                                var c = grid.getCondition(field,f.conditionExpression);
-                                grid.condition+=c;
+                                items.push(field);
                             });
-                            if(grid.condition.length>0){
-                                grid.condition = grid.condition.substring(0,grid.condition.length-5);
-                            }
+                            grid.condition = grid.getCondition(items);
                             grid.store.loadPage(1);
                         }
                     },'->',{
@@ -83,24 +79,7 @@ Ext.define('saas.view.core.dbfind.DbfindGridPanel', {
         me.callParent(arguments);
     },
 
-    loadData: function(grid, url) {
-        this.BaseUtil.request({url})
-        .then(function(response) {
-            var data = Ext.decode(response.responseText);
-                grid.getStore().loadData(data.data);
-                grid.fireEvent('afterLoadData', grid, data.data);
-        })
-        .catch(function(response) {
-            // something...
-        });
-    },
-
     listeners:{
-        afterrender:function(grid){
-            if(grid.dataUrl){
-                grid.loadData(grid, grid.dataUrl);
-            }
-        },
         itemClick: function(view,record) {
             var me = this;
             var dbfinds = me.dbfinds;
@@ -135,16 +114,102 @@ Ext.define('saas.view.core.dbfind.DbfindGridPanel', {
         }
     },
 
-    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);
+    /**
+     * 获得过滤条件
+     */
+    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';
         }
-        if(condition.length>0){
-            condition+= ' AND ';
+
+        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 h:i:s') + ',' + Ext.Date.format(new Date(to), 'Y-m-d h:i:s');
+        }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 condition;
+
+        return conditionValue;
     }
 });

+ 6 - 2
frontend/saas-web/app/view/core/dbfind/DbfindTrigger.js

@@ -98,8 +98,12 @@ Ext.define('saas.view.core.dbfind.DbfindTrigger', {
     onTriggerClick:function(f){
         //判断dbfindtrigger归属
         f.judge(f);//form
-        var panel = f.up('core-tab-panel');
-        var panelEl = panel.getEl();
+        var panel = f.up('core-tab-panel'),panelEl;
+        if(f.ownerCt.ownerCt.id.indexOf('window-')>-1){
+            panelEl = f.ownerCt.ownerCt.getEl()
+        }else{
+            panelEl = panel.getEl()
+        }
         var box = panelEl.getBox();
         var height = box.height;
         var width = box.width;

+ 95 - 65
frontend/saas-web/app/view/core/dbfind/MultiDbfindGridPanel.js

@@ -80,17 +80,13 @@ Ext.define('saas.view.core.dbfind.MultiDbfindGridPanel', {
                         xtype:'button',
                         text:'查询',
                         handler:function(b){
-                            var grid = me;
+                            var grid = me,items=[];
                             grid.condition = '';
-                            var fields = grid.dbSearchFields;
-                            Ext.Array.each(fields,function(f) {
+                            Ext.Array.each(grid.dbSearchFields,function(f) {
                                 var field = b.ownerCt.down('[name='+f.name+']')
-                                var c = grid.getCondition(field,f.conditionExpression);
-                                grid.condition+=c;
+                                items.push(field);
                             });
-                            if(grid.condition.length>0){
-                                grid.condition = grid.condition.substring(0,grid.condition.length-5);
-                            }
+                            grid.condition = grid.getCondition(items);
                             grid.store.loadPage(1);
                         }
                     },'->',{
@@ -255,68 +251,102 @@ Ext.define('saas.view.core.dbfind.MultiDbfindGridPanel', {
         me.callParent(arguments);
     },
 
-    loadData: function(grid, url) {
-        this.BaseUtil.request({url})
-        .then(function(response) {
-            var data = Ext.decode(response.responseText);
-                grid.getStore().loadData(data.data);
-                grid.fireEvent('afterLoadData', grid, data.data);
-        })
-        .catch(function(response) {
-            // something...
-        });
-    },
+     /**
+     * 获得过滤条件
+     */
+    getCondition: function(items) {
+        var me = this,
+        conditions = [];
 
-    listeners:{
-        afterrender:function(grid){
-            if(grid.dataUrl){
-                grid.loadData(grid, grid.dataUrl);
+        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
+                }
             }
-        }//,
-        // itemClick: function(view,record) {
-        //     var me = this;
-        //     var dbfinds = me.dbfinds;
-        //     if(dbfinds&&dbfinds.length>0){
-        //         if(me.belong=='grid'){
-        //             for (let index = 0; index < dbfinds.length; index++) {
-        //                 var item = dbfinds[index];
-        //                 var rec = me.dbfindtrigger.column.ownerCt.ownerCt.selModel.getLastSelected();
-        //                 if(rec){
-        //                     var nowRec = me.dbfindtrigger.column.ownerCt.ownerCt.store.getData().getByKey(rec.id);
-        //                     nowRec.set(item.to,record.get(item.from));
-        //                     //me.column.getEditor().setValue(record.get(item.from));
-        //                 }
-        //             }
-        //         }else if(me.belong=='form'){
-        //             for (let index = 0; index < dbfinds.length; index++) {
-        //                 var item = dbfinds[index];
-        //                 var field = me.ownerCt.belong.down('[name='+item.to+']');
-        //                 if(field){
-        //                     var val = record.get(item.from);
-        //                     if(field.xtype=='dbfindtrigger'){
-        //                         field.setValue(val);
-        //                         field.lastTriggerValue=val;
-        //                     }else{
-        //                         field.setValue(val);
-        //                     }    
-        //                 }
-        //             }
-        //         }
-        //     }
-        //     me.ownerCt.close();
-        // }
+            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;
     },
 
-    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);
+    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';
         }
-        if(condition.length>0){
-            condition+= ' AND ';
+
+        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 h:i:s') + ',' + Ext.Date.format(new Date(to), 'Y-m-d h:i:s');
+        }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 condition;
+
+        return conditionValue;
     }
 });

+ 6 - 2
frontend/saas-web/app/view/core/dbfind/MultiDbfindTrigger.js

@@ -104,8 +104,12 @@ Ext.define('saas.view.core.dbfind.MultiDbfindTrigger', {
     onTriggerClick:function(f){
         //判断dbfindtrigger归属
         f.judge(f);
-        var panel = f.up('core-tab-panel');
-        var panelEl = panel.getEl();
+        var panel = f.up('core-tab-panel'),panelEl;
+        if(f.ownerCt.ownerCt.id.indexOf('window-')>-1){
+            panelEl = f.ownerCt.ownerCt.getEl();
+        }else{
+            panelEl = panel.getEl()
+        }
         var box = panelEl.getBox();
         var height = box.height;
         var width = box.width;

+ 4 - 2
frontend/saas-web/app/view/core/form/FormPanel.js

@@ -40,7 +40,7 @@ Ext.define('saas.view.core.form.FormPanel', {
         me.initViewModel();
         me.FormUtil.setItems(me);
 
-        Ext.apply(me, {
+        Ext.applyIf(me, {
             dockedItems: [{
                 xtype: 'toolbar',
                 dock: 'top',
@@ -152,7 +152,9 @@ Ext.define('saas.view.core.form.FormPanel', {
             detail = viewData['detail' + i],
             store = detail.detailStore;
 
-            store.loadData(detailData);
+            if(detailData){
+                store.loadData(detailData);
+            }
         }
     },
 

+ 0 - 124
frontend/saas-web/app/view/document/customer/FormPanel.js

@@ -1,124 +0,0 @@
-Ext.define('saas.view.document.customer.FormPanel', {
-    extend: 'saas.view.core.baseform.FormPanel',
-    xtype: 'document-customer-formpanel',
-    controller: 'document-customer-formpanel',
-    viewModel: 'document-customer-formpanel',
-
-    //工具类
-    FormUtil: Ext.create('saas.util.FormUtil'),
-    BaseUtil: Ext.create('saas.util.BaseUtil'),
-
-    //基础属性
-    layout: 'fit',
-    autoScroll: true,
-    border: 1,
-
-    fieldDefaults: {
-        margin: '0 5 5 0',
-        labelAlign: 'right',
-        labelWidth: 90,
-        blankText: '该字段不能为空'
-    },
-
-    //字段属性
-    _title:'客户管理',
-    _dataUrl:'http://192.168.253.228:9480/customer/list',
-    _saveUrl:'http://192.168.253.228:8800/api/document/vendor/save',
-    _deleteUrl:'http://192.168.253.228:8800/api/document/vendor/delete',
-
-    initComponent: function () {
-        var me = this;
-        Ext.apply(me, {
-            items: [{
-                name : "vendorGrid", 
-                xtype : "core-baseform-gridpanel", 
-                layout:'fit',
-                margin:'',
-                dataUrl:me._dataUrl,
-                columns : [
-                    {
-                        text : "序号", 
-                        dataIndex : "pd_detno", 
-                        width : 100, 
-                        xtype : "numbercolumn",
-                        align : 'center',
-                        format:'0',
-                        summaryType: 'count',
-                        summaryRenderer: function(value, summaryData, dataIndex) {
-                            return Ext.String.format('合计: {0}条', value);
-                        },
-                    }, 
-                    {
-                        editor : {
-                            displayField : "display", 
-                            editable : true, 
-                            format : "", 
-                            hideTrigger : false, 
-                            maxLength : 100.0, 
-                            minValue : null, 
-                            positiveNum : false, 
-                            queryMode : "local", 
-                            store : null, 
-                            valueField : "value", 
-                            xtype : "multidbfindtrigger"
-                        }, 
-                        text : "物料编号", 
-                        width : 200.0, 
-                        dataIndex : "pd_prodcode", 
-                        xtype : "", 
-                        items : null
-                    }, 
-                    {
-                        text : "单位", 
-                        editor : {
-                            xtype : "textfield"
-                        },
-                        dataIndex : "pd_unit", 
-                        width : 120.0, 
-                        xtype : "", 
-                        items : null
-                    }, 
-                    {
-                        text : "数量", 
-                        dataIndex : "pd_yqty", 
-                        editor : {
-                            xtype : "numberfield"
-                        },
-                        width : 120.0, 
-                        xtype : "numbercolumn", 
-                        format:'0',
-                        items : null,
-                        summaryType: 'sum'
-                    }, 
-                    {
-                        text : "单价", 
-                        editor : {
-                            xtype : "numberfield"
-                        },
-                        format:'0,000.00',
-                        dataIndex : "pd_price", 
-                        width : 120.0, 
-                        xtype : "numbercolumn",
-                        items : null,
-                        summaryType: 'sum'
-                    }, 
-                    {
-                        text : "总额", 
-                        dataIndex : "pd_total", 
-                        width : 120.0, 
-                        xtype : "numbercolumn",
-                        summaryType: 'sum'
-                    }, 
-                    {
-                        text : "税额", 
-                        dataIndex : "pd_taxtotal", 
-                        flex : 1.0, 
-                        xtype : "numbercolumn",
-                        summaryType: 'sum'
-                    }
-                ]
-            }]
-        });
-        me.callParent(arguments);
-    }
-});

+ 0 - 4
frontend/saas-web/app/view/document/customer/FormPanelModel.js

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

+ 83 - 0
frontend/saas-web/app/view/document/customer/list/FormPanel.js

@@ -0,0 +1,83 @@
+Ext.define('saas.view.document.customer.list.FormPanel', {
+    extend: 'saas.view.core.baseform.FormPanel',
+    xtype: 'customer-list-formpanel',
+    controller: 'customer-list-formpanel',
+    viewModel: 'customer-list-formpanel',
+
+    //工具类
+    FormUtil: Ext.create('saas.util.FormUtil'),
+    BaseUtil: Ext.create('saas.util.BaseUtil'),
+
+    //基础属性
+    layout: 'fit',
+    autoScroll: true,
+    border: 1,
+
+    fieldDefaults: {
+        margin: '0 5 5 0',
+        labelAlign: 'right',
+        labelWidth: 90,
+        blankText: '该字段不能为空'
+    },
+
+    //字段属性
+    _formXtype:'customer-panel-formpanel',
+    _title:'客户资料',
+    _dataUrl:'http://192.168.253.228:9480/customer/list',
+    _saveUrl:'http://192.168.253.228:8800/api/document/vendor/save',
+    _deleteUrl:'http://192.168.253.228:8800/api/document/vendor/delete',
+
+    initComponent: function () {
+        var me = this;
+        Ext.apply(me, {
+            items: [{
+                name : "customerGrid", 
+                xtype : "core-baseform-gridpanel", 
+                layout:'fit',
+                dataUrl:me._dataUrl,
+                columns : [{
+                    text : "客户id", 
+                    width : 0, 
+                    dataIndex : "id", 
+                    xtype : "numbercolumn", 
+                },{
+                    text : "客户编号", 
+                    width : 200.0, 
+                    dataIndex : "cu_code", 
+                    xtype : "", 
+                }, 
+                {
+                    text : "客户名称", 
+                    dataIndex : "cu_name", 
+                    width : 120.0, 
+                    xtype : "", 
+                }, 
+                {
+                    text : "客户状态", 
+                    dataIndex : "cu_status", 
+                    width : 120.0, 
+                    xtype : ""
+                }, 
+                {
+                    text : "客户UU", 
+                    dataIndex : "cu_uu", 
+                    width : 120.0, 
+                    xtype : "",
+                }, 
+                {
+                    text : "默认客户地址", 
+                    dataIndex : "ca_address", 
+                    width : 120.0, 
+                    xtype : "",
+                }, 
+                {
+                    text : "默认客户联系人", 
+                    dataIndex : "cc_name", 
+                    flex : 1.0, 
+                    xtype : "",
+                }]
+            }]
+        });
+        me.callParent(arguments);
+    }
+});

+ 2 - 2
frontend/saas-web/app/view/document/customer/FormPanelController.js → frontend/saas-web/app/view/document/customer/list/FormPanelController.js

@@ -1,8 +1,8 @@
-Ext.define('saas.view.document.customer.FormPanelController', {
+Ext.define('saas.view.document.customer.list.FormPanelController', {
     extend: 'saas.view.core.baseform.FormPanelController',
     BaseUtil: Ext.create('saas.util.BaseUtil'),
     FormUtil: Ext.create('saas.util.FormUtil'),
-    alias: 'controller.document-customer-formpanel',
+    alias: 'controller.customer-list-formpanel',
     init: function (form) {
         var me = this;
         this.control({

+ 4 - 0
frontend/saas-web/app/view/document/customer/list/FormPanelModel.js

@@ -0,0 +1,4 @@
+Ext.define('saas.view.document.customer.list.FormPanelModel', {
+    extend: 'saas.view.core.baseform.FormPanelModel',
+    alias: 'viewmodel.customer-list-formpanel'
+});

+ 202 - 0
frontend/saas-web/app/view/document/customer/panel/FormController.js

@@ -0,0 +1,202 @@
+Ext.define('saas.view.document.customer.panel.FormController', {
+    extend: 'saas.view.core.form.FormPanelController',
+    alias: 'controller.customer-panel-formpanel',
+    init: function (form) {
+        var me = this;
+        this.control({
+            /**放大镜新增demo*/
+            "field[name=combo]":{
+                beforerender:function(f){
+                    f.addHandler=me.addCombo;
+
+                }
+            },
+            //主表单选放大镜模板
+            'dbfindtrigger[name=pu_vendcode]':{
+                beforerender:function(f){
+                    Ext.apply(f,{
+                        //数据接口
+                        dataUrl:'http://192.168.253.41:9480/api/document/vendor/getVendorsByCondition',
+                        //赋值 
+                        dbfinds:[{
+                            from:'ve_code',to:'pu_vendcode'
+                        },{
+                            from:'ve_name',to:'pu_vendname'
+                        }],
+                        //联想设置
+                        dbtpls:[{
+                            field:'ve_code',width:100
+                        },{
+                            field:'ve_name',width:100
+                        }],
+                        //联想查询条件
+                        dbCondition:"CONCAT(ve_code, ve_name) like '{0}%'",
+                        //放大镜窗口字段
+                        dbSearchFields:[{
+                            xtype : "textfield", 
+                            name : "ve_name", 
+                            conditionExpression:"ve_name like '{0}%'",//传入后台条件  替换占位符
+                            fieldLabel : "供应商名称", 
+                            columnWidth : 0.25
+                        }],
+                        //放大镜窗口列表
+                        dbColumns:[{
+                            "text": "供应商ID",
+                            "flex": 0,
+                            "dataIndex": "ve_id",
+                            "width": 0,
+                            "xtype": "",
+                            "items": null
+                        },{
+                            "text": "供应商编号",
+                            "flex": 1,
+                            "dataIndex": "ve_code",
+                            "width": 100,
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            "text": "供应商名称",
+                            "flex": 1,
+                            "dataIndex": "ve_name",
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            "text": "供应商类型",
+                            "flex": 0,
+                            "dataIndex": "ve_type",
+                            "width": 200,
+                            "xtype": "",
+                            "items": null
+                        }]
+                    }) ;   
+
+                }
+            },
+            //从表单选放大镜赋值关系 以及 tpl模板
+            'dbfindtrigger[name=pd_prodcode]':{
+                beforerender:function(f){
+                    Ext.apply(f,{
+                        //数据接口
+                        dataUrl:'http://192.168.253.41:9480/api/document/product/getProductsByCondition',
+                        //放大镜赋值设置
+                        dbfinds:[{
+                            from:'pr_code',to:'pd_prodcode'
+                        },{
+                            from:'pr_unit',to:'pd_unit'
+                        }],
+                        //联想查询条件
+                        dbCondition:"CONCAT(pr_code, pr_detail) like '{0}%'",
+                        //联想设置
+                        dbtpls:[{
+                            field:'pr_code',width:100
+                        },{
+                            field:'pr_detail',width:100
+                        }],
+                        //窗口字段设置
+                        dbSearchFields:[{
+                            emptyText:'输入物料编号或物料名称',
+                            xtype : "textfield", 
+                            name : "search", 
+                            conditionExpression:"CONCAT(pr_code, pr_detail) like '{0}%'",
+                            allowBlank : true, 
+                            columnWidth : 0.25
+                        }],
+                        //窗口列设置
+                        dbColumns:[{
+                            "text": "物料ID",
+                            "flex": 0,
+                            "dataIndex": "pr_id",
+                            "width": 0,
+                            "xtype": "",
+                            "items": null
+                        },{
+                            "text": "物料编号",
+                            "flex": 1,
+                            "dataIndex": "pr_code",
+                            "width": 100,
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            "text": "物料名称",
+                            "flex": 1,
+                            "dataIndex": "pr_detail",
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            "text": "物料规格",
+                            "flex": 0,
+                            "dataIndex": "pr_spec",
+                            "width": 200,
+                            "xtype": "",
+                            "items": null
+                        }]
+                    }) ;   
+
+                }
+            },
+            //从表多选放大镜赋值关系 以及 tpl模板
+            'multidbfindtrigger[name=pd_prodcode]':{
+                beforerender:function(f){
+                    Ext.apply(f,{
+                        //数据接口
+                        dataUrl:'http://192.168.253.41:9480/api/document/product/getProductsByCondition',
+                        //放大镜赋值设置
+                        dbfinds:[{
+                            from:'pr_code',to:'pd_prodcode'
+                        },{
+                            from:'pr_unit',to:'pd_unit'
+                        }],
+                        //联想查询条件
+                        dbCondition:"CONCAT(pr_code, pr_detail) like '{0}%'",
+                        //联想设置
+                        dbtpls:[{
+                            field:'pr_code',width:100
+                        },{
+                            field:'pr_detail',width:100
+                        }],
+                        //窗口字段设置
+                        dbSearchFields:[{
+                            emptyText:'输入物料编号或物料名称',
+                            xtype : "textfield", 
+                            name : "search", 
+                            conditionExpression:"CONCAT(pr_code, pr_detail) like '{0}%'",
+                            allowBlank : true, 
+                            columnWidth : 0.25
+                        }],
+                        //窗口列设置
+                        dbColumns:[{
+                            "text": "物料ID",
+                            "flex": 0,
+                            "dataIndex": "pr_id",
+                            "width": 0,
+                            "xtype": "",
+                            "items": null
+                        },{
+                            "text": "物料编号",
+                            "flex": 1,
+                            "dataIndex": "pr_code",
+                            "width": 100,
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            "text": "物料名称",
+                            "flex": 1,
+                            "dataIndex": "pr_detail",
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            "text": "物料规格",
+                            "flex": 0,
+                            "dataIndex": "pr_spec",
+                            "width": 200,
+                            "xtype": "",
+                            "items": null
+                        }]
+                    }) ;   
+
+                }
+            }
+        });
+
+    }
+});

+ 6 - 0
frontend/saas-web/app/view/document/customer/panel/FormModel.js

@@ -0,0 +1,6 @@
+Ext.define('saas.view.document.customer.panel.FormModel', {
+    extend: 'saas.view.core.form.FormPanelModel',
+    alias: 'viewmodel.customer-panel-formpanel',
+
+    
+});

+ 128 - 0
frontend/saas-web/app/view/document/customer/panel/FormPanel.js

@@ -0,0 +1,128 @@
+Ext.define('saas.view.document.customer.panel.FormPanel', {
+    extend: 'saas.view.core.form.FormPanel',
+    xtype: 'customer-panel-formpanel',
+
+    controller: 'customer-panel-formpanel',
+    viewModel: 'customer-panel-formpanel',
+    
+    caller:'Purchase',
+
+    //字段属性
+    _title:'客户资料',
+    _idField: 'id',
+    _codeField: 'cu_code',
+    _statusField: 'cu_status',
+    _statusCodeField: 'cu_statuscode',
+    _readUrl:'http://192.168.253.228:9480/customer/read/',
+    _saveUrl:'http://192.168.253.228:8800/purchase/save',
+    _auditUrl:'http://192.168.253.228:8800/purchase/audit',
+    _deleteUrl:'http://192.168.253.228:8800/purchase/delete/',
+    _deleteDetailUrl:'http://192.168.253.228:8800/purchase/deleteItem/',
+    initId:0,
+
+    defaultItems: [{
+        xtype: 'hidden',
+        name: 'id',
+        fieldLabel: 'id',
+        allowBlank: true,
+        columnWidth: 0.25
+    },{
+        xtype: 'textfield',
+        name: 'cu_name',
+        fieldLabel: '客户名称',
+        allowBlank: false,
+        columnWidth: 0.25
+    },{
+        xtype: 'textfield',
+        name: 'cu_code',
+        fieldLabel: '客户编号',
+        allowBlank: true,
+        columnWidth: 0.25
+    },{
+        xtype: 'textfield',
+        name: 'cu_status',
+        fieldLabel: '状态',
+        allowBlank: true,
+        columnWidth: 0.25
+    },{
+        xtype: 'hidden',
+        name: 'cu_statuscode',
+        fieldLabel: '状态码',
+        allowBlank: true,
+        columnWidth: 0.25
+    },{
+        xtype: 'textfield',
+        name: 'cu_type',
+        fieldLabel: '客户种类',
+        allowBlank: true,
+        columnWidth: 0.25
+    },{
+        format : "Y-m-d", 
+        xtype : "datefield", 
+        name : "createTime", 
+        bind : "{createTime}", 
+        fieldLabel : "创建时间", 
+        allowBlank : true, 
+        columnWidth : 0.25
+    }, {
+        format : "Y-m-d",
+        xtype : "datefield", 
+        name : "updateTime", 
+        bind : "{updateTime}", 
+        fieldLabel : "更新时间", 
+        allowBlank : true, 
+        columnWidth : 0.25
+    }, {
+        xtype : "detailGridField", 
+        _detnoColumn:  'ca_detno',
+        columns : [
+            {
+                text : "序号", 
+                dataIndex : "ca_detno", 
+                width : 100, 
+                xtype : "numbercolumn",
+                align : 'center',
+                format:'0',
+                summaryType: 'count',
+                summaryRenderer: function(value, summaryData, dataIndex) {
+                    return Ext.String.format('合计: {0}条', value);
+                },
+            }, 
+            {
+                editor : {
+                    displayField : "display", 
+                    editable : true, 
+                    format : "", 
+                    hideTrigger : false, 
+                    maxLength : 100.0, 
+                    minValue : null, 
+                    positiveNum : false, 
+                    queryMode : "local", 
+                    valueField : "value", 
+                    xtype : "combo",
+                    store:{
+                        fields: ['display', 'value'],
+                        data : [
+                            {"display":"是", "value":1},
+                            {"display":"否", "value":0}
+                        ]
+                    }
+                }, 
+                text : "客户地址", 
+                width : 200.0, 
+                dataIndex : "ca_address", 
+                xtype : "", 
+                items : null
+            }, 
+            {
+                text : "是否默认地址", 
+                editor : {
+                    xtype : "combo"
+                },
+                dataIndex : "ca_default", 
+                width : 120.0, 
+                xtype : "", 
+                items : null
+            }]
+    }]
+});

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

@@ -12,7 +12,6 @@ Ext.define('saas.view.document.kind.KindController', {
         if(view.defaultType!=''){
             defaultKind = view.defaultType  //其他单表界面
             vm.setData({'dataKind':{'value':defaultKind}});
-            debugger
         }else{
             defaultKind=vm.getData()['dataKind'].value  //类别合并界面
         }

+ 3 - 4
frontend/saas-web/app/view/purchase/purchase/FormPanel.js

@@ -53,15 +53,14 @@ Ext.define('saas.view.purchase.purchase.FormPanel', {
         allowBlank : true, 
         columnWidth : 0.0
     }, {
-        xtype : "textfield", 
+        xtype : "dbfindtrigger", 
         name : "pu_vendcode", 
         bind : "{pu_vendcode}", 
         fieldLabel : "供应商编号", 
-        hidden:true,
         allowBlank : true, 
-        columnWidth : 0, 
+        columnWidth : 0.25, 
     }, {
-        xtype : "dbfindtrigger", 
+        xtype : "textfield", 
         name : "pu_vendname", 
         bind : "{pu_vendname}", 
         fieldLabel : "供应商名称", 

+ 97 - 40
frontend/saas-web/app/view/purchase/purchase/FormPanelController.js

@@ -4,29 +4,36 @@ Ext.define('saas.view.purchase.purchase.FormPanelController', {
     init: function (form) {
         var me = this;
         this.control({
-            /**放大镜新增demo*/
-            "field[name=combo]":{
-                beforerender:function(f){
-                    f.addHandler=me.addCombo;
-                }
-            },
-            //放大镜赋值关系 以及 tpl模板
+            //主表单选放大镜模板
             'dbfindtrigger[name=pu_vendcode]':{
                 beforerender:function(f){
                     Ext.apply(f,{
-                        dataUrl:basePath+'document/vendor/getVendorsByCondition',
+                        //数据接口
+                        dataUrl:'http://192.168.253.41:9480/vendor/getVendorsByCondition',
+                        //赋值 
                         dbfinds:[{
                             from:'ve_code',to:'pu_vendcode'
                         },{
                             from:'ve_name',to:'pu_vendname'
                         }],
+                        //联想设置
                         dbtpls:[{
                             field:'ve_code',width:100
                         },{
                             field:'ve_name',width:100
                         }],
+                        //联想查询条件
+                        dbCondition:"CONCAT(ve_code, ve_name) like '{0}%'",
+                        //放大镜窗口字段
+                        dbSearchFields:[{
+                            xtype : "textfield", 
+                            name : "ve_name", 
+                            conditionExpression:"ve_name like '{0}%'",//传入后台条件  替换占位符
+                            fieldLabel : "供应商名称", 
+                            columnWidth : 0.25
+                        }],
+                        //放大镜窗口列表
                         dbColumns:[{
-                            conditionCode:'ve_id',
                             "text": "供应商ID",
                             "flex": 0,
                             "dataIndex": "ve_id",
@@ -34,7 +41,6 @@ Ext.define('saas.view.purchase.purchase.FormPanelController', {
                             "xtype": "",
                             "items": null
                         },{
-                            conditionCode:'ve_code',
                             "text": "供应商编号",
                             "flex": 1,
                             "dataIndex": "ve_code",
@@ -42,14 +48,12 @@ Ext.define('saas.view.purchase.purchase.FormPanelController', {
                             "xtype": "",
                             "items": null
                         }, {
-                            conditionCode:'ve_name',
                             "text": "供应商名称",
                             "flex": 1,
                             "dataIndex": "ve_name",
                             "xtype": "",
                             "items": null
                         }, {
-                            conditionCode:'ve_type',
                             "text": "供应商类型",
                             "flex": 0,
                             "dataIndex": "ve_type",
@@ -61,20 +65,36 @@ Ext.define('saas.view.purchase.purchase.FormPanelController', {
 
                 }
             },
-            //放大镜赋值关系 以及 tpl模板
+            //从表单选放大镜赋值关系 以及 tpl模板
             'dbfindtrigger[name=pd_prodcode]':{
                 beforerender:function(f){
                     Ext.apply(f,{
-                        conditionCode:'pr_code',
-                        dataUrl:basePath+'document/product/getProductsByCondition',
+                        //数据接口
+                        dataUrl:'http://192.168.253.41:9480/product/getProductsByCondition',
+                        //放大镜赋值设置
                         dbfinds:[{
                             from:'pr_code',to:'pd_prodcode'
+                        },{
+                            from:'pr_unit',to:'pd_unit'
                         }],
+                        //联想查询条件
+                        dbCondition:"CONCAT(pr_code, pr_detail) like '{0}%'",
+                        //联想设置
                         dbtpls:[{
                             field:'pr_code',width:100
                         },{
                             field:'pr_detail',width:100
                         }],
+                        //窗口字段设置
+                        dbSearchFields:[{
+                            emptyText:'输入物料编号或物料名称',
+                            xtype : "textfield", 
+                            name : "search", 
+                            conditionExpression:"CONCAT(pr_code, pr_detail) like '{0}%'",
+                            allowBlank : true, 
+                            columnWidth : 0.25
+                        }],
+                        //窗口列设置
                         dbColumns:[{
                             "text": "物料ID",
                             "flex": 0,
@@ -106,33 +126,70 @@ Ext.define('saas.view.purchase.purchase.FormPanelController', {
                     }) ;   
 
                 }
-            }
-        });
+            },
+            //从表多选放大镜赋值关系 以及 tpl模板
+            'multidbfindtrigger[name=pd_prodcode]':{
+                beforerender:function(f){
+                    Ext.apply(f,{
+                        //数据接口
+                        dataUrl:'http://192.168.253.41:9480/product/getProductsByCondition',
+                        //放大镜赋值设置
+                        dbfinds:[{
+                            from:'pr_code',to:'pd_prodcode'
+                        },{
+                            from:'pr_unit',to:'pd_unit'
+                        }],
+                        //联想查询条件
+                        dbCondition:"CONCAT(pr_code, pr_detail) like '{0}%'",
+                        //联想设置
+                        dbtpls:[{
+                            field:'pr_code',width:100
+                        },{
+                            field:'pr_detail',width:100
+                        }],
+                        //窗口字段设置
+                        dbSearchFields:[{
+                            emptyText:'输入物料编号或物料名称',
+                            xtype : "textfield", 
+                            name : "search", 
+                            conditionExpression:"CONCAT(pr_code, pr_detail) like '{0}%'",
+                            allowBlank : true, 
+                            columnWidth : 0.25
+                        }],
+                        //窗口列设置
+                        dbColumns:[{
+                            "text": "物料ID",
+                            "flex": 0,
+                            "dataIndex": "pr_id",
+                            "width": 0,
+                            "xtype": "",
+                            "items": null
+                        },{
+                            "text": "物料编号",
+                            "flex": 1,
+                            "dataIndex": "pr_code",
+                            "width": 100,
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            "text": "物料名称",
+                            "flex": 1,
+                            "dataIndex": "pr_detail",
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            "text": "物料规格",
+                            "flex": 0,
+                            "dataIndex": "pr_spec",
+                            "width": 200,
+                            "xtype": "",
+                            "items": null
+                        }]
+                    }) ;   
 
-    },
-    addCombo:function(){
-        var combo=this.ownerCmp;
-        Ext.create('Ext.window.Window',{
-            layout:'vbox',
-            bodyPadding: 15,
-            width:500,
-            items:[{
-                fieldLabel:'实际值',
-                xtype:'textfield'
-            },{
-                fieldLabel:'显示值',
-                xtype:'textfield'
-            }],
-            buttons:[{
-                text:'确认',
-                handler:function(b){
-                    combo.setValue('ok');
-                    b.up('window').close();
                 }
-            }],
-            renderTo:this.ownerCmp.ownerCt.getEl()
-        }).show();
-
+            }
+        });
     },
 
     turnIn: function() {

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

@@ -161,7 +161,7 @@
         "text": "基础资料",
         "items": [{
             "text": "客户资料",
-            "viewType": "document-customer-formpanel",
+            "viewType": "customer-list-formpanel",
             "leaf": true
         }, {
             "text": "供应商管理",