Browse Source

代码提交

hy 7 years ago
parent
commit
509844e060
23 changed files with 1088 additions and 339 deletions
  1. 13 0
      frontend/saas-web/app/model/document/vendorcontact.js
  2. 3 153
      frontend/saas-web/app/view/core/baseform/FormPanelController.js
  3. 89 5
      frontend/saas-web/app/view/core/baseform/GridPanel.js
  4. 1 1
      frontend/saas-web/app/view/core/form/FormPanelController.js
  5. 1 0
      frontend/saas-web/app/view/core/form/field/DetailGridField.js
  6. 41 3
      frontend/saas-web/app/view/document/customer/list/FormPanel.js
  7. 56 0
      frontend/saas-web/app/view/document/customer/panel/FormController.js
  8. 38 7
      frontend/saas-web/app/view/document/customer/panel/FormPanel.js
  9. 42 7
      frontend/saas-web/app/view/document/kind/ChildForm.js
  10. 45 11
      frontend/saas-web/app/view/document/kind/Kind.js
  11. 4 1
      frontend/saas-web/app/view/document/kind/KindController.js
  12. 49 12
      frontend/saas-web/app/view/document/kind/KindModel.js
  13. 25 0
      frontend/saas-web/app/view/document/other/BankInformation.js
  14. 0 124
      frontend/saas-web/app/view/document/vendor/FormPanel.js
  15. 0 4
      frontend/saas-web/app/view/document/vendor/FormPanelModel.js
  16. 116 0
      frontend/saas-web/app/view/document/vendor/list/FormPanel.js
  17. 2 2
      frontend/saas-web/app/view/document/vendor/list/FormPanelController.js
  18. 4 0
      frontend/saas-web/app/view/document/vendor/list/FormPanelModel.js
  19. 258 0
      frontend/saas-web/app/view/document/vendor/panel/FormController.js
  20. 6 0
      frontend/saas-web/app/view/document/vendor/panel/FormModel.js
  21. 283 0
      frontend/saas-web/app/view/document/vendor/panel/FormPanel.js
  22. 1 2
      frontend/saas-web/app/view/test/order/FormController.js
  23. 11 7
      frontend/saas-web/resources/json/navigation.json

+ 13 - 0
frontend/saas-web/app/model/document/vendorcontact.js

@@ -0,0 +1,13 @@
+Ext.define('saas.model.document.vendorcontact', {
+    extend: 'saas.model.Base',
+    fields: [
+        { name: 'id', type: 'int' },
+        { name: 'vc_detno', type: 'int' },
+        { name: 'vc_name', type: 'string' },
+        { name: 'vc_tel', type: 'string' },
+        { name: 'vc_qq', type: 'string' },
+        { name: 'vc_email', type: 'string' },
+        { name: 'vc_default', type: 'string' },
+        { name: 'vc_veid', type: 'int' }
+    ]
+});

+ 3 - 153
frontend/saas-web/app/view/core/baseform/FormPanelController.js

@@ -5,164 +5,14 @@ Ext.define('saas.view.core.baseform.FormPanelController', {
     BaseUtil: Ext.create('saas.util.BaseUtil'),
     FormUtil: Ext.create('saas.util.FormUtil'),
 
-    auditBtnClick: function() {
-        var me = this,
-        form = me.getView(),
-        statusCodeField = form._statusCodeField,
-        viewModel = me.getViewModel(),
-        status = viewModel.get(statusCodeField);
-
-        status == 'AUDITED' ? me.unAudit() : me.audit();
+    query: function() {
+        var grid = this.view.down('[name=baseGrid]');
+        grid.store.loadPage(1);
     },
 
     add: function(){
         var form = this.getView();
         var id = form.xtype + '_add';
         openTab(form.xtype,'新增' + form._title,id);
-    },
-    
-    delete: function(){
-        var me = this;
-        var form = this.getView();
-        var id = form.getForm().findField(form._idField);
-        var code = form.getForm().findField(form._codeField);
-        if(id&&id.value!=0){
-            me.BaseUtil.request({
-                url: form._deleteUrl+id.value,
-                method: 'GET',
-            })
-            .then(function(res) {
-                var localJson = new Ext.decode(res.responseText);
-                if(localJson.success){
-                    var mainTab = Ext.getCmp('main-tab-panel');
-                    mainTab.getActiveTab().close();
-                    //解析参数
-                    Ext.Msg.alert('提示','删除成功');
-                }
-            })
-            .catch(function() {
-                Ext.Msg.alert('提示','删除失败');
-            });
-        }
-    },
-
-    onSave: function() {
-        var me = this,
-        form = this.getView(),
-        viewModel = me.getViewModel(),
-        modelData = viewModel.getData(),
-        detailBindFields = modelData._detailBindFields;
-
-        if(form.getForm().wasDirty==false){
-            Ext.Msg.alert('提示','未修改数据,请修改后保存');
-            return false;
-        }
-        if(form.getForm().wasValid==false){
-            Ext.Msg.alert('提示','表单校验有误,请检查');
-            return false;
-        }
-        //form里面数据
-        var formData = form.getFormData();
-        
-        me.save(formData);
-    },
-
-    save:function(formData){
-        var me = this,
-        form = this.getView(),
-        viewModel = me.getViewModel(),
-        modelData = viewModel.getData(),
-        detailBindFields = modelData._detailBindFields;
-
-        var gridData = formData.detail?formData.detail:[];
-        var dirtyGridData = [];
-        if(gridData.length>0){
-            Ext.each(gridData, function(item,index){
-                var d = Object.assign({}, item.data),
-                dirty = item.dirty;
-                if(dirty){
-                    if((typeof d.id) != "number" && d.id.indexOf('-')>-1){
-                        d.id = 0;
-                    }
-                    for(k in d) {
-                        if(!Ext.Array.contains(detailBindFields, k)) {
-                            delete d[k];
-                        }
-                    }
-                    dirtyGridData.push(d);
-                }
-            });
-        }
-        var params = {
-            main:formData.main,
-            items:dirtyGridData
-        }
-        me.BaseUtil.request({
-            url: form._saveUrl,
-            params: JSON.stringify(params),
-            method: 'POST',
-        })
-        .then(function(res) {
-            var localJson = new Ext.decode(res.responseText);
-            if(localJson.success){
-                Ext.Msg.alert('提示','保存成功');
-                form.initId = localJson.data.id;
-                form.FormUtil.loadData(form);
-            }
-        })
-        .catch(function() {
-            Ext.Msg.alert('提示','保存失败');
-        });
-    },
-
-    audit: function(){
-        var me = this;
-        var form = this.getView();
-        if(form.getForm().wasDirty==false){
-            Ext.Msg.alert('提示','未修改数据,请修改后保存');
-            return false;
-        }
-        if(form.getForm().wasValid==false){
-            Ext.Msg.alert('提示','表单校验有误,请检查');
-            return false;
-        }
-        //form里面数据
-        var formData = form.getFormData();
-        var gridData = formData.detail?formData.detail:[];
-        var dirtyGridData = [];
-        if(gridData.length>0){
-            Ext.each(gridData, function(item,index){
-                if(item.dirty){
-                    if((typeof item.data.id) != "number" && item.data.id.indexOf('extMode')>-1){
-                        item.data.id = 0;
-                    }
-                    dirtyGridData.push(item.data)
-                }
-            });
-        }   
-        var params = {
-            main:formData.main,
-            items:dirtyGridData
-        }
-        me.BaseUtil.request({
-            url: form._auditUrl,
-            params: JSON.stringify(params),
-            method: 'POST',
-        })
-        .then(function(res) {
-            var localJson = new Ext.decode(res.responseText);
-            if(localJson.success){
-                Ext.Msg.alert('提示','审核成功');
-                form.initId = localJson.data.id;
-                form.FormUtil.loadData(form);
-            }
-        })
-        .catch(function() {
-            Ext.Msg.alert('提示','审核失败');
-        });
-    },
-    unAudit: function() {
-        console.log('反审核');
-        return;
     }
 });

+ 89 - 5
frontend/saas-web/app/view/core/baseform/GridPanel.js

@@ -24,6 +24,7 @@ Ext.define('saas.view.core.baseform.GridPanel', {
                 pageSize: 10,
                 data: [],
                 proxy: {
+                    timeout:8000,
                     type: 'ajax',
                     url: me.dataUrl,
                     actionMethods: {
@@ -54,10 +55,26 @@ Ext.define('saas.view.core.baseform.GridPanel', {
                 dockedItems:[{
                     xtype:'toolbar',
                     dock:'top',
+                    defaults: { // defaults 将会应用所有的子组件上,而不是父容器
+                        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();
+                                }
+                            }
+                        }
+                    },
                     items:['->',{
                         xtype:'button',
                         text:'新增',
                         handler:function(b){
+                            var form = b.ownerCt.ownerCt.ownerCt;
+                            openTab(form._formXtype, '新增' + form._title, form._formXtype+'_add'); 
                         }
                     }, {
                         text: '导入',
@@ -78,13 +95,17 @@ Ext.define('saas.view.core.baseform.GridPanel', {
                         }
                     },{
                         text: '禁用',
-                        handler: me.onCloseOrder,
+                        handler: function(){
+                            var form = this.ownerCt.ownerCt.ownerCt;
+                            me.onVastDeal(form._batchCloseUrl);
+                        },
                         menu: {
                             width: 80,
                             items: [{
                                 text:'启用',
                                 handler:function(){
-                                    me.onOpenOrder(this)
+                                    var form = this.ownerCt.ownerCmp.ownerCt.ownerCt.ownerCt;
+                                    me.onVastDeal(form._batchOpenUrl);
                                 }
                             }],
                             listeners: {
@@ -95,7 +116,10 @@ Ext.define('saas.view.core.baseform.GridPanel', {
                         }
                     }, {
                         text: '删除',
-                        handler: me.onDelete
+                        handler: function(){
+                            var form = this.ownerCt.ownerCt.ownerCt;
+                            me.onVastDeal(form._batchDeleteUrl);
+                        }
                     }, {
                         text: '刷新',
                         handler: me.onLoad
@@ -115,6 +139,30 @@ Ext.define('saas.view.core.baseform.GridPanel', {
         me.callParent(arguments);
     },
 
+    onVastDeal:function(url){
+        var form = this.ownerCt;
+        var grid = this;
+        var data = grid.getGridSelected();
+        if(data&&data.length>0){
+            var params = JSON.stringify({baseDTOs:data});
+            form.BaseUtil.request({
+                    url: url,
+                    params: params,
+                    method: 'POST',
+                    async:false
+                })
+                .then(function() {
+                    Ext.Msg.alert('提示','操作成功');
+                })
+                .catch(function(response) {
+                    Ext.Msg.alert('提示','操作失败');
+                });
+                grid.store.load();
+        }else{
+            Ext.Msg.alert('提示','请勾选至少一条明细。');
+        }
+    },
+
     listeners:{
         itemClick: function(view,record,a,index,c) {
             var classList = c.target.classList.value;
@@ -125,7 +173,24 @@ Ext.define('saas.view.core.baseform.GridPanel', {
                 openTab(form._formXtype, '修改'+form._title, form._formXtype+config.initId, config);
             }else if(classList.indexOf('fa-trash-o')>-1){
                 //删除
-                debugger
+                var id = record.get('id');
+                if(id){
+                    form.BaseUtil.request({
+                        url: form._deleteUrl+id,
+                        method: 'POST',
+                    })
+                    .then(function(res) {
+                        var localJson = new Ext.decode(res.responseText);
+                        if(localJson.success){
+                            //解析参数
+                            Ext.Msg.alert('提示','删除成功');
+                            view.ownerCt.store.load();
+                        }
+                    })
+                    .catch(function() {
+                        Ext.Msg.alert('提示','删除失败');
+                    });
+                }
             }
         }
     },
@@ -163,5 +228,24 @@ Ext.define('saas.view.core.baseform.GridPanel', {
             }]);
         }
         return columns;
-    }
+    },
+
+    getGridSelected:function(){
+        var me = this,
+            items = me.selModel.getSelection(),
+            data = new Array() ;
+            Ext.each(items, function(item, index){
+                if(!Ext.isEmpty(item.data[me.idField])&&!Ext.isEmpty(item.data[me.codeField])){
+                    var o = new Object();
+                    if(me.idField){
+                        o['id'] = item.data[me.idField];
+                    }
+                    if(me.codeField){
+                        o['code'] = item.data[me.codeField];
+                    }
+                    data.push(o);
+                }
+            });
+		return data;
+    } 
 });

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

@@ -29,7 +29,7 @@ Ext.define('saas.view.core.form.FormPanelController', {
         if(id&&id.value!=0){
             me.BaseUtil.request({
                 url: form._deleteUrl+id.value,
-                method: 'GET',
+                method: 'POST',
             })
             .then(function(res) {
                 var localJson = new Ext.decode(res.responseText);

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

@@ -142,6 +142,7 @@ Ext.define('saas.view.core.form.field.DetailGridField', {
             Ext.Ajax.request({
                 url: me._deleteDetailUrl+id,
                 params: '',
+                method: 'POST',
                 headers: {
                     'Access-Control-Allow-Origin': '*'
                 },

+ 41 - 3
frontend/saas-web/app/view/document/customer/list/FormPanel.js

@@ -20,18 +20,56 @@ Ext.define('saas.view.document.customer.list.FormPanel', {
         blankText: '该字段不能为空'
     },
 
+    searchField:[{
+        xtype : "remotecombo", 
+        storeUrl:"http://192.168.253.31:9480/customerkind/getCombo",
+        name : "cu_type", 
+        emptyText : "请选择客户类型", 
+        allowBlank : true, 
+        queryMode: 'local',
+        displayField: 'display',
+        valueField: 'value',
+        columnWidth : 0.25,
+        etc:{
+            customerkind:{
+                keyField:'id',
+                dataField:'ck_name',
+                reqUrl:'http://192.168.253.31:9480/customerkind/save',
+                delUrl:'http://192.168.253.31:9480/customerkind/delete'
+            }
+        },
+        addHandler:function(b){
+            var form = this.ownerCmp.ownerCt.ownerCt;
+            this.dialog = form.getController().getView().add({
+                xtype: 'document-kind-childwin',
+                bind: {
+                    title: '新增客户类型'
+                },
+                dataKind:'customerkind',
+                belong:this.ownerCmp.etc['customerkind'],
+                _parent:form,
+                record:null,
+                session: true
+            });
+            this.dialog.show();
+        }  
+    }],
+
     //字段属性
     _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',
+    _batchOpenUrl:'http://192.168.253.228:9480/customer/batchOpen',
+    _batchCloseUrl:'http://192.168.253.228:9480/customer/batchClose',
+    _batchDeleteUrl:'http://192.168.253.228:9480/customer/batchDelete',
 
     initComponent: function () {
         var me = this;
         Ext.apply(me, {
             items: [{
-                name : "customerGrid", 
+                idField: 'id',
+                codeField: 'cu_code',
+                name : "baseGrid", 
                 xtype : "core-baseform-gridpanel", 
                 layout:'fit',
                 dataUrl:me._dataUrl,

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

@@ -198,5 +198,61 @@ Ext.define('saas.view.document.customer.panel.FormController', {
             }
         });
 
+    },
+
+    auditBtnClick: function() {
+        var me = this,
+        form = me.getView(),
+        statusCodeField = form._statusCodeField,
+        viewModel = me.getViewModel(),
+        status = viewModel.data['form'][statusCodeField];
+        status == 'OPEN' ? me.unAudit() : me.audit();
+    },
+
+    audit: function(){
+        var me = this,
+        form = this.getView(),
+        viewModel = me.getViewModel();
+        
+        me.BaseUtil.request({
+            url: form._openUrl+'/'+viewModel.data['form'].id,
+            params: '',
+            method: 'POST',
+        })
+        .then(function(res) {
+            var localJson = new Ext.decode(res.responseText);
+            if(localJson.success){
+                Ext.Msg.alert('提示','启用成功');
+                form.initId = localJson.data.id;
+                form.FormUtil.loadData(form);
+                viewModel.set('base.editable', false);
+            }
+        })
+        .catch(function() {
+            Ext.Msg.alert('提示','启用失败');
+        });
+    },
+    unAudit: function() {
+        var me = this,
+        form = this.getView(),
+        viewModel = me.getViewModel();
+        
+        me.BaseUtil.request({
+            url: form._closeUrl+'/'+viewModel.data['form'].id,
+            params: '',
+            method: 'POST',
+        })
+        .then(function(res) {
+            var localJson = new Ext.decode(res.responseText);
+            if(localJson.success){
+                Ext.Msg.alert('提示','禁用成功');
+                form.initId = localJson.data.id;
+                form.FormUtil.loadData(form);
+                viewModel.set('base.editable', false);
+            }
+        })
+        .catch(function() {
+            Ext.Msg.alert('提示','禁用失败');
+        });
     }
 });

+ 38 - 7
frontend/saas-web/app/view/document/customer/panel/FormPanel.js

@@ -15,8 +15,9 @@ Ext.define('saas.view.document.customer.panel.FormPanel', {
     _statusCodeField: 'cu_statuscode',
     _readUrl:'http://192.168.253.228:9480/customer/read/',
     _saveUrl:'http://192.168.253.228:9480/customer/save',
-    _auditUrl:'http://192.168.253.228:8800/purchase/audit',
-    _deleteUrl:'http://192.168.253.228:8800/purchase/delete/',
+    _openUrl:'http://192.168.253.228:9480/customer/open',
+    _closeUrl:'http://192.168.253.228:9480/customer/close',
+    _deleteUrl:'http://192.168.253.228:9480/customer/delete/',
     initId:0,
 
     defaultItems: [{
@@ -60,7 +61,7 @@ Ext.define('saas.view.document.customer.panel.FormPanel', {
         valueField: 'value',
         columnWidth : 0.25,
         etc:{
-            vendorkind:{
+            customerkind:{
                 keyField:'id',
                 dataField:'ck_name',
                 reqUrl:'http://192.168.253.31:9480/customerkind/save',
@@ -74,7 +75,7 @@ Ext.define('saas.view.document.customer.panel.FormPanel', {
                 bind: {
                     title: '新增客户类型'
                 },
-                dataKind:'vendorkind',
+                dataKind:'customerkind',
                 belong:this.ownerCmp.etc['customerkind'],
                 _parent:form,
                 record:null,
@@ -148,7 +149,7 @@ Ext.define('saas.view.document.customer.panel.FormPanel', {
         xtype : "detailGridField", 
         _detnoColumn:  'cc_detno',
         storeModel:'saas.model.document.customercontact',
-        _deleteDetailUrl:'http://192.168.253.228:8800/purchase/deleteItem/',
+        _deleteDetailUrl:'http://192.168.253.228:9480/customer/deletecontact/',
         columns : [
             {
                 text : "序号", 
@@ -251,7 +252,7 @@ Ext.define('saas.view.document.customer.panel.FormPanel', {
         xtype : "detailGridField", 
         _detnoColumn:  'ca_detno',
         storeModel:'saas.model.document.customeraddress',
-        _deleteDetailUrl:'http://192.168.253.228:8800/purchase/deleteItem/',
+        _deleteDetailUrl:'http://192.168.253.228:9480/customer/deleteaddress/',
         columns : [
             {
                 text : "序号", 
@@ -347,5 +348,35 @@ Ext.define('saas.view.document.customer.panel.FormPanel', {
                     return v;
                 }
             }]
-    }]
+    }],
+
+    /**
+     * 一些初始化viewModel的方法
+     */
+    initViewModel: function() {
+        var me = this,
+        codeField = me._codeField,
+        statusField = me._statusField,
+        statusCodeField = me._statusCodeField,
+        viewModel = me.getViewModel();
+        
+        viewModel.set('form.' + codeField, '--------------');
+        viewModel.set('form.createTime', new Date());
+        viewModel.set('form.updateTime', new Date());
+
+        if(statusCodeField) {
+            var o = {};
+            o['auditBtnText'] = {
+                bind: '{form.' + statusCodeField + '}',
+                get: function(value) {
+                    viewModel.set('form.' + statusField, value == 'OPEN' ? '启用' : '禁用');
+                    return value == 'OPEN' ? '禁用' : '启用'
+                }
+            };
+            viewModel.setFormulas(o);
+            viewModel.set('form.' + statusCodeField, "OPEN");
+        }else {
+            viewModel.set('auditBtnText', "禁用");
+        }
+    }
 });

+ 42 - 7
frontend/saas-web/app/view/document/kind/ChildForm.js

@@ -6,11 +6,11 @@ Ext.define('KitchenSink.view.binding.ChildForm', {
     xtype: 'document-kind-childwin',
     layout: 'fit',
     modal: true,
-    width: 400,
+    width: 500,
     //工具类
     FormUtil: Ext.create('saas.util.FormUtil'),
     BaseUtil: Ext.create('saas.util.BaseUtil'),
-    height: 220,
+    height: 260,
     listeners:{
       show:function(w){
           if(w.record){
@@ -62,6 +62,32 @@ Ext.define('KitchenSink.view.binding.ChildForm', {
                 fieldLabel:'类型'
             }],
         },
+        bankinformation:{
+            items:[{
+                xtype:'hidden',
+                name:'id'
+            },{
+                xtype:'textfield',
+                name:'bk_bankname',
+                allowBlank:false,
+                fieldLabel:'账户名称'
+            },{
+                xtype:'textfield',
+                name:'bk_bankcode',
+                allowBlank:false,
+                fieldLabel:'账户编号'
+            },{
+                xtype:'numberfield',
+                name:'bk_beginamount',
+                allowBlank:false,
+                fieldLabel:'期初金额'
+            },{
+                xtype:'numberfield',
+                name:'bk_thisamount',
+                allowBlank:false,
+                fieldLabel:'当前金额'
+            }],
+        },
         productbrand:{
             items:[{
                 xtype:'hidden',
@@ -74,7 +100,15 @@ Ext.define('KitchenSink.view.binding.ChildForm', {
             }],
         },
         inoutkind:{
-
+            items:[{
+                xtype:'hidden',
+                name:'id'
+            },{
+                xtype:'textfield',
+                name:'ft_name',
+                allowBlank:false,
+                fieldLabel:'类型'
+            }]
         }
     },
     setFormItems:function() {
@@ -83,6 +117,7 @@ Ext.define('KitchenSink.view.binding.ChildForm', {
             xtype: 'form',
             bodyPadding: 10,
             border: false,
+            autoScroll:true,
             modelValidation: true,
             layout: {
                 type: 'vbox',
@@ -108,10 +143,10 @@ Ext.define('KitchenSink.view.binding.ChildForm', {
         var belong = this.belong;
         var form=this.down('form');
         var dataField = form.down('[name='+belong.dataField+']');
-        if(!dataField.value){
-             Ext.Msg.alert('提示','数据有误');
-            return false;
-        }
+        // if(!dataField.value){
+        //      Ext.Msg.alert('提示','数据有误');
+        //     return false;
+        // }
         var keyField = form.down('[name='+belong.keyField+']');
         //保存接口
         var params = {};

+ 45 - 11
frontend/saas-web/app/view/document/kind/Kind.js

@@ -68,8 +68,8 @@ Ext.define('saas.view.document.kind.Kind', {
             }],
             keyField:'id',
             dataField:'ck_name',
-            reqUrl:'http://192.168.253.41:9480/customerkind/save',
-            delUrl:'http://192.168.253.41:9480/customerkind/delete'
+            reqUrl:'http://192.168.253.31:9480/customerkind/save',
+            delUrl:'http://192.168.253.31:9480/customerkind/delete'
         },
         vendorkind:{
             columns: [{
@@ -79,8 +79,8 @@ Ext.define('saas.view.document.kind.Kind', {
             }],
             keyField:'id',
             dataField:'vk_name',
-            reqUrl:'http://192.168.253.41:9480/vendorkind/save',
-            delUrl:'http://192.168.253.41:9480/vendorkind/delete'
+            reqUrl:'http://192.168.253.31:9480/vendorkind/save',
+            delUrl:'http://192.168.253.31:9480/vendorkind/delete'
         },
         productkind:{
             columns: [{
@@ -90,27 +90,61 @@ Ext.define('saas.view.document.kind.Kind', {
             }],
             keyField:'id',
             dataField:'pt_name',
-            reqUrl:'http://192.168.253.41:9480/producttype/save',
-            delUrl:'http://192.168.253.41:9480/producttype/delete'
+            reqUrl:'http://192.168.253.31:9480/producttype/save',
+            delUrl:'http://192.168.253.31:9480/producttype/delete'
         },
         productbrand:{
             columns: [{
-                text: '物料类型',
+                text: '物料品牌',
                 dataIndex: 'pb_name',
                 flex: 1
             }],
             keyField:'id',
             dataField:'pb_name',
-            reqUrl:'http://192.168.253.41:9480/productbrand/save',
-            delUrl:'http://192.168.253.41:9480/productbrand/delete'
+            reqUrl:'http://192.168.253.31:9480/productbrand/save',
+            delUrl:'http://192.168.253.31:9480/productbrand/delete'
+        },
+        bankinformation:{
+            columns: [{
+                text: '账户编号',
+                dataIndex: 'bk_bankcode',
+                flex: 1
+            },{
+                text: '账户名称',
+                dataIndex: 'bk_bankname',
+                flex: 1
+            },{
+                xtype:'datecolumn',
+                text: '日期',
+                dataIndex: 'bk_date',
+                flex: 1
+            },{
+                text: '账户类型',
+                dataIndex: 'bk_type',
+                flex: 1
+            },{
+                text: '账户期初金额',
+                dataIndex: 'bk_beginamount',
+                flex: 1
+            },{
+                text: '账户期末余额',
+                dataIndex: 'bk_thisamount',
+                flex: 1
+            }],
+            keyField:'id',
+            reqUrl: 'http://192.168.253.129:9480/bankinformation/save',
+            delUrl: 'http://192.168.253.129:9480/bankinformation/delete'
         },
         inoutkind:{
             columns: [{
                 text: '收支类型',
-                dataIndex: 'io_kind',
+                dataIndex: 'ft_name',
                 flex: 1
             }],
-            keyField:'io_id'
+            keyField:'id',
+            dataField:'ft_name',
+            reqUrl: 'http://192.168.253.31:9480/fundinouttype/save',
+            delUrl: 'http://192.168.253.31:9480/fundinouttype/delete'
         }
     }
 })

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

@@ -16,7 +16,9 @@ Ext.define('saas.view.document.kind.KindController', {
             defaultKind=vm.getData()['dataKind'].value  //类别合并界面
         }
         var etc = view.etc[defaultKind];
-        grid.reconfigure(vm.getStore(defaultKind), me.insertActionColumn(etc.columns));
+        var store = vm.getStore(defaultKind);
+        store.load();
+        grid.reconfigure(store, me.insertActionColumn(etc.columns));
     },
     onKindToggle:function(container, button, pressed){
        var me = this,
@@ -95,6 +97,7 @@ Ext.define('saas.view.document.kind.KindController', {
         var view = this.getView();var me=this;
         this.isEdit = !!record;
         this.dialog = view.add({
+            autoScroll:true,
             xtype: 'document-kind-childwin',
             bind: {
                 title: record ? '修改{title}类型' : '新增{title}类型'

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

@@ -15,7 +15,7 @@ Ext.define('saas.view.document.kind.KindModel', {
             ],
             proxy: {
                 type: 'ajax',
-                url: 'http://192.168.253.41:9480/customerkind/getAll',
+                url: 'http://192.168.253.31:9480/customerkind/getAll',
                 actionMethods: {
                     read: 'GET'
                 },
@@ -25,7 +25,7 @@ Ext.define('saas.view.document.kind.KindModel', {
                 }
             },
             pageSize: null,
-            autoLoad: true
+            autoLoad: false
         },
         vendorkind:{
             fields:[
@@ -34,7 +34,7 @@ Ext.define('saas.view.document.kind.KindModel', {
             ],
             proxy: {
                 type: 'ajax',
-                url: 'http://192.168.253.41:9480/vendorkind/getAll',
+                url: 'http://192.168.253.31:9480/vendorkind/getAll',
                 actionMethods: {
                     read: 'GET'
                 },
@@ -44,7 +44,7 @@ Ext.define('saas.view.document.kind.KindModel', {
                 }
             },
             pageSize: null,
-            autoLoad: true
+            autoLoad: false
         },
         productkind:{
             fields:[
@@ -53,7 +53,7 @@ Ext.define('saas.view.document.kind.KindModel', {
             ],
             proxy: {
                 type: 'ajax',
-                url: 'http://192.168.253.41:9480/producttype/getAll',
+                url: 'http://192.168.253.31:9480/producttype/getAll',
                 actionMethods: {
                     read: 'GET'
                 },
@@ -63,7 +63,7 @@ Ext.define('saas.view.document.kind.KindModel', {
                 }
             },
             pageSize: null,
-            autoLoad: true
+            autoLoad: false
         },
         productbrand:{
             fields:[
@@ -72,7 +72,7 @@ Ext.define('saas.view.document.kind.KindModel', {
             ],
             proxy: {
                 type: 'ajax',
-                url: 'http://192.168.253.41:9480/productbrand/getAll',
+                url: 'http://192.168.253.31:9480/productbrand/getAll',
                 actionMethods: {
                     read: 'GET'
                 },
@@ -82,14 +82,51 @@ Ext.define('saas.view.document.kind.KindModel', {
                 }
             },
             pageSize: null,
-            autoLoad: true
+            autoLoad: false
         },
-        inoutkind:{
+        bankinformation:{
             fields:[
-                {name: 'io_id', type: 'int'},
-                {name: 'io_kind',  type: 'string'}
+                {name: 'id', type: 'int'},
+                {name: 'bk_bankname',  type: 'string'},
+                {name: 'bk_bankcode',  type: 'string'},
+                {name: 'bk_type',  type: 'string'},
+                {name: 'bk_beginamount',  type: 'float'},
+                {name: 'bk_thisamount',  type: 'float'},
+                {name: 'bk_date',  type: 'date'}
             ],
-            data:[]
+            proxy: {
+                type: 'ajax',
+                url: 'http://192.168.253.129:9480/bankinformation/getAll',
+                actionMethods: {
+                    read: 'GET'
+                },
+                reader: {
+                    type: 'json',
+                    rootProperty: 'data'
+                }
+            },
+            pageSize: null,
+            autoLoad: false
+        },
+        inoutkind:{ 
+        fields:[
+                {name: 'id', type: 'int'},
+                {name: 'ft_type',  type: 'string'},
+                {name: 'ft_name',  type: 'string'}
+            ],
+            proxy: {  
+                type: 'ajax',
+                url: 'http://192.168.253.31:9480/fundinouttype/getAll',
+                actionMethods: {
+                    read: 'GET'
+                },
+                reader: {
+                    type: 'json',
+                    rootProperty: 'data'
+                }
+            },
+            pageSize: null,
+            autoLoad: false
         },
     }
 });

+ 25 - 0
frontend/saas-web/app/view/document/other/BankInformation.js

@@ -0,0 +1,25 @@
+/**
+ * Created by zhouy on 2018/10/18.
+ */
+Ext.define('saas.view.document.other.BankInformation', {
+    extend: 'saas.view.document.kind.Kind',
+    xtype: 'other-bankinformation',
+    autoScroll: true,
+    layout:'fit',
+    defaultType:'bankinformation',
+    tbar: ['->',{
+        xtype:'button',
+        text:'新增',
+        listeners: {
+            click: 'onAdd'
+        }
+    },{
+        xtype:'button',
+        text:'刷新',
+        listeners: {
+            click: 'onRefresh'
+        }
+    }]
+})
+
+

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

@@ -1,124 +0,0 @@
-Ext.define('saas.view.document.vendor.FormPanel', {
-    extend: 'saas.view.core.baseform.FormPanel',
-    xtype: 'document-vendor-formpanel',
-    controller: 'document-vendor-formpanel',
-    viewModel: 'document-vendor-formpanel',
-
-    //工具类
-    FormUtil: Ext.create('saas.util.FormUtil'),
-    BaseUtil: Ext.create('saas.util.BaseUtil'),
-
-    //基础属性
-    layout: 'fit',
-    autoScroll: true,
-    border: 1,
-    bodyPadding: 5,
-
-    fieldDefaults: {
-        margin: '0 5 5 0',
-        labelAlign: 'right',
-        labelWidth: 90,
-        blankText: '该字段不能为空'
-    },
-
-    //字段属性
-    _title:'供应商管理',
-    _dataUrl:'http://192.168.253.41:9480/api/document/vendor/getVendorsByCondition',
-    _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',
-                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/vendor/FormPanelModel.js

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

+ 116 - 0
frontend/saas-web/app/view/document/vendor/list/FormPanel.js

@@ -0,0 +1,116 @@
+Ext.define('saas.view.document.vendor.list.FormPanel', {
+    extend: 'saas.view.core.baseform.FormPanel',
+    xtype: 'vendor-list-formpanel',
+    controller: 'vendor-list-formpanel',
+    viewModel: 'vendor-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: '该字段不能为空'
+    },
+
+    searchField:[{
+        xtype : "remotecombo", 
+        storeUrl:"http://192.168.253.31:9480/vendorkind/getCombo",
+        name : "ve_type", 
+        emptyText : "请选择供应商类型", 
+        allowBlank : true, 
+        queryMode: 'local',
+        displayField: 'display',
+        valueField: 'value',
+        columnWidth : 0.25,
+        etc:{
+            vendorkind:{
+                keyField:'id',
+                dataField:'vk_name',
+                reqUrl:'http://192.168.253.31:9480/vendorkind/save',
+                delUrl:'http://192.168.253.31:9480/vendorkind/delete'
+            }
+        },
+        addHandler:function(b){
+            var form = this.ownerCmp.ownerCt.ownerCt;
+            this.dialog = form.getController().getView().add({
+                xtype: 'document-kind-childwin',
+                bind: {
+                    title: '新增供应商类型'
+                },
+                dataKind:'vendorkind',
+                belong:this.ownerCmp.etc['vendorkind'],
+                _parent:form,
+                record:null,
+                session: true
+            });
+            this.dialog.show();
+        }  
+    }],
+
+    //字段属性
+    _formXtype:'vendor-panel-formpanel',
+    _title:'供应商资料',
+    _dataUrl:'http://192.168.253.58:9480/vendor/list',
+    _deleteUrl:'http://192.168.253.58:9480/vendor/delete/',
+    _batchOpenUrl:'http://192.168.253.58:9480/vendor/batchOpen',
+    _batchCloseUrl:'http://192.168.253.58:9480/vendor/batchClose',
+    _batchDeleteUrl:'http://192.168.253.58:9480/vendor/batchDelete',
+
+    initComponent: function () {
+        var me = this;
+        Ext.apply(me, {
+            items: [{
+                idField: 'id',
+                codeField: 've_code',
+                name : "baseGrid", 
+                xtype : "core-baseform-gridpanel", 
+                layout:'fit',
+                dataUrl:me._dataUrl,
+                columns : [{
+                    text : "供应商id", 
+                    width : 0, 
+                    dataIndex : "id", 
+                    xtype : "numbercolumn", 
+                },{
+                    text : "供应商编号", 
+                    width : 200.0, 
+                    dataIndex : "ve_code", 
+                    xtype : "", 
+                }, 
+                {
+                    text : "供应商名称", 
+                    dataIndex : "ve_name", 
+                    width : 120.0, 
+                    xtype : "", 
+                }, 
+                {
+                    text : "供应商状态", 
+                    dataIndex : "ve_status", 
+                    width : 120.0, 
+                    xtype : ""
+                }, 
+                {
+                    text : "供应商UU", 
+                    dataIndex : "ve_uu", 
+                    width : 120.0, 
+                    xtype : "",
+                }, 
+                {
+                    text : "默认供应商联系人", 
+                    dataIndex : "vc_name", 
+                    flex : 1.0, 
+                    xtype : "",
+                }]
+            }]
+        });
+        me.callParent(arguments);
+    }
+});

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

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

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

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

+ 258 - 0
frontend/saas-web/app/view/document/vendor/panel/FormController.js

@@ -0,0 +1,258 @@
+Ext.define('saas.view.document.vendor.panel.FormController', {
+    extend: 'saas.view.core.form.FormPanelController',
+    alias: 'controller.vendor-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
+                        }]
+                    }) ;   
+
+                }
+            }
+        });
+
+    },
+
+    auditBtnClick: function() {
+        var me = this,
+        form = me.getView(),
+        statusCodeField = form._statusCodeField,
+        viewModel = me.getViewModel(),
+        status = viewModel.data['form'][statusCodeField];
+        status == 'OPEN' ? me.unAudit() : me.audit();
+    },
+
+    audit: function(){
+        var me = this,
+        form = this.getView(),
+        viewModel = me.getViewModel();
+        
+        me.BaseUtil.request({
+            url: form._openUrl+'/'+viewModel.data['form'].id,
+            params: '',
+            method: 'POST',
+        })
+        .then(function(res) {
+            var localJson = new Ext.decode(res.responseText);
+            if(localJson.success){
+                Ext.Msg.alert('提示','启用成功');
+                form.initId = localJson.data.id;
+                form.FormUtil.loadData(form);
+                viewModel.set('base.editable', false);
+            }
+        })
+        .catch(function() {
+            Ext.Msg.alert('提示','启用失败');
+        });
+    },
+    unAudit: function() {
+        var me = this,
+        form = this.getView(),
+        viewModel = me.getViewModel();
+        
+        me.BaseUtil.request({
+            url: form._closeUrl+'/'+viewModel.data['form'].id,
+            params: '',
+            method: 'POST',
+        })
+        .then(function(res) {
+            var localJson = new Ext.decode(res.responseText);
+            if(localJson.success){
+                Ext.Msg.alert('提示','禁用成功');
+                form.initId = localJson.data.id;
+                form.FormUtil.loadData(form);
+                viewModel.set('base.editable', false);
+            }
+        })
+        .catch(function() {
+            Ext.Msg.alert('提示','禁用失败');
+        });
+    }
+});

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

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

+ 283 - 0
frontend/saas-web/app/view/document/vendor/panel/FormPanel.js

@@ -0,0 +1,283 @@
+Ext.define('saas.view.document.vendor.panel.FormPanel', {
+    extend: 'saas.view.core.form.FormPanel',
+    xtype: 'vendor-panel-formpanel',
+
+    controller: 'vendor-panel-formpanel',
+    viewModel: 'vendor-panel-formpanel',
+    
+    caller:'Vendor',
+
+    //字段属性
+    _title:'供应商资料',
+    _idField: 'id',
+    _codeField: 've_code',
+    _statusField: 've_status',
+    _statusCodeField: 've_statuscode',
+    _readUrl:'http://192.168.253.58:9480/vendor/read/',
+    _saveUrl:'http://192.168.253.58:9480/vendor/save',
+    _openUrl:'http://192.168.253.58:9480/vendor/open',
+    _closeUrl:'http://192.168.253.58:9480/vendor/close',
+    _deleteUrl:'http://192.168.253.58:9480/vendor/delete/',
+    initId:0,
+
+    defaultItems: [{
+        xtype: 'hidden',
+        name: 'id',
+        fieldLabel: 'id',
+        allowBlank: true,
+        columnWidth: 0.25
+    },{
+        xtype: 'textfield',
+        name: 've_name',
+        fieldLabel: '供应商名称',
+        allowBlank: false,
+        columnWidth: 0.25
+    },{
+        xtype: 'textfield',
+        name: 've_code',
+        fieldLabel: '供应商编号',
+        allowBlank: true,
+        columnWidth: 0.25
+    },{
+        xtype: 'textfield',
+        name: 've_status',
+        fieldLabel: '状态',
+        allowBlank: true,
+        columnWidth: 0.25
+    },{
+        xtype: 'hidden',
+        name: 've_statuscode',
+        fieldLabel: '状态码',
+        allowBlank: true,
+        columnWidth: 0.25
+    },{
+        xtype : "remotecombo", 
+        storeUrl:"http://192.168.253.31:9480/vendorkind/getCombo",
+        name : "ve_type", 
+        fieldLabel : "供应商类型", 
+        allowBlank : true, 
+        queryMode: 'local',
+        displayField: 'display',
+        valueField: 'value',
+        columnWidth : 0.25,
+        etc:{
+            vendorkind:{
+                keyField:'id',
+                dataField:'vk_name',
+                reqUrl:'http://192.168.253.31:9480/vendorkind/save',
+                delUrl:'http://192.168.253.31:9480/vendorkind/delete'
+            }
+        },
+        addHandler:function(b){
+            var form = this.ownerCmp.ownerCt;
+            this.dialog = form.getController().getView().add({
+                xtype: 'document-kind-childwin',
+                bind: {
+                    title: '新增供应商类型'
+                },
+                dataKind:'vendorkind',
+                belong:this.ownerCmp.etc['vendorkind'],
+                _parent:form,
+                record:null,
+                session: true
+            });
+            this.dialog.show();
+        }
+    },{
+        format : "Y-m-d",
+        xtype : "datefield", 
+        name : "createTime", 
+        fieldLabel : "创建时间", 
+        allowBlank : true, 
+        columnWidth : 0.25
+    },{
+        format : "Y-m-d", 
+        xtype : "datefield", 
+        name : "ve_begindate", 
+        fieldLabel : "期初日期", 
+        allowBlank : true, 
+        columnWidth : 0.25  
+    },{ 
+        xtype : "numberfield", 
+        hideTrigger:true,
+        name : "ve_beginaramount", 
+        fieldLabel : "期初应收", 
+        allowBlank : true, 
+        columnWidth : 0.25
+    },{ 
+        xtype : "numberfield", 
+        hideTrigger:true,
+        name : "ve_beginprerecamount", 
+        fieldLabel : "期初预收", 
+        allowBlank : true, 
+        columnWidth : 0.25    
+    },{ 
+        xtype : "numberfield", 
+        hideTrigger:true,
+        name : "ve_promisedays", 
+        fieldLabel : "承付天数", 
+        allowBlank : true, 
+        columnWidth : 0.25      
+    },{
+        xtype : "numberfield", 
+        name : "ve_taxrate", 
+        fieldLabel : "税率", 
+        allowBlank : true, 
+        columnWidth : 0.25   
+    },{
+        xtype : "numberfield", 
+        name : "ve_ta", 
+        fieldLabel : "应收款余额", 
+        allowBlank : true, 
+        readOnly:true,
+        editable:false,
+        columnWidth : 0.25     
+    },{
+        xtype:'textfield',
+        name : "ve_uu", 
+        fieldLabel : "供应商UU", 
+        allowBlank : true, 
+        columnWidth : 0.25
+    },{  
+        format : "Y-m-d",
+        xtype : "datefield", 
+        name : "updateTime", 
+        fieldLabel : "更新时间", 
+        allowBlank : true, 
+        columnWidth : 0.25
+    }, {
+        xtype : "detailGridField", 
+        _detnoColumn:  'vc_detno',
+        storeModel:'saas.model.document.vendorcontact',
+        _deleteDetailUrl:'http://192.168.253.228:9480/vendor/deletecontact/',
+        columns : [
+            {
+                text : "序号", 
+                dataIndex : "vc_detno", 
+                width : 100, 
+                xtype : "numbercolumn",
+                align : 'center',
+                format:'0',
+                summaryType: 'count',
+                summaryRenderer: function(value, summaryData, dataIndex) {
+                    return Ext.String.format('合计: {0}条', value);
+                },
+            },
+            {
+                text : "ID", 
+                dataIndex : "id", 
+                width : 0, 
+                xtype : "numbercolumn"
+            },
+            {
+                text : "关联ID", 
+                dataIndex : "vc_veid", 
+                width : 0, 
+                xtype : "numbercolumn"
+            },
+            {
+                text : "联系人", 
+                editor : {
+                    xtype : "textfield"
+                },
+                dataIndex : "vc_name", 
+                width : 120.0, 
+                xtype : "", 
+                items : null
+            },
+            {
+                text : "电话", 
+                editor : {
+                    xtype : "textfield"
+                },
+                dataIndex : "vc_tel", 
+                width : 120.0, 
+                xtype : "", 
+                items : null
+            },
+            {
+                text : "微信/QQ", 
+                editor : {
+                    xtype : "textfield"
+                },
+                dataIndex : "vc_qq", 
+                width : 120.0, 
+                xtype : "", 
+                items : null
+            },
+            {
+                text : "邮箱", 
+                editor : {
+                    xtype : "textfield"
+                },
+                dataIndex : "vc_email", 
+                width : 120.0, 
+                xtype : "", 
+                items : null
+            },
+            {
+                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 : "vc_default", 
+                xtype : "",
+                renderer: function (v, m, r) {
+                    if(v=='0'){
+                        return '';
+                    }else if(v=='1'){
+                        return '是';
+                    }
+                    return v;
+                }
+            }]
+        }
+    ],
+
+    /**
+     * 一些初始化viewModel的方法
+     */
+    initViewModel: function() {
+        var me = this,
+        codeField = me._codeField,
+        statusField = me._statusField,
+        statusCodeField = me._statusCodeField,
+        viewModel = me.getViewModel();
+        
+        viewModel.set('form.' + codeField, '--------------');
+        viewModel.set('form.createTime', new Date());
+        viewModel.set('form.updateTime', new Date());
+
+        if(statusCodeField) {
+            var o = {};
+            o['auditBtnText'] = {
+                bind: '{form.' + statusCodeField + '}',
+                get: function(value) {
+                    viewModel.set('form.' + statusField, value == 'OPEN' ? '启用' : '禁用');
+                    return value == 'OPEN' ? '禁用' : '启用'
+                }
+            };
+            viewModel.setFormulas(o);
+            viewModel.set('form.' + statusCodeField, "OPEN");
+        }else {
+            viewModel.set('auditBtnText', "禁用");
+        }
+    }
+});

+ 1 - 2
frontend/saas-web/app/view/test/order/FormController.js

@@ -8,7 +8,6 @@ Ext.define('saas.view.test.order.FormController', {
             "field[name=combo]":{
                 beforerender:function(f){
                     f.addHandler=me.addCombo;
-
                 }
             },
             //主表单选放大镜模板
@@ -30,7 +29,7 @@ Ext.define('saas.view.test.order.FormController', {
                             field:'ve_name',width:100
                         }],
                         //联想查询条件
-                        dbCondition:"CONCAT(ve_code, ve_name) like '{0}%'",
+                        //dbCondition:"CONCAT(ve_code, ve_name) like '{0}%'",
                         //放大镜窗口字段
                         dbSearchFields:[{
                             xtype : "textfield", 

+ 11 - 7
frontend/saas-web/resources/json/navigation.json

@@ -160,12 +160,14 @@
     "items": [{
         "text": "基础资料",
         "items": [{
+            "id":"customer-list-formpanel",
             "text": "客户资料",
             "viewType": "customer-list-formpanel",
             "leaf": true
         }, {
+            "id":"vendor-list-formpanel",
             "text": "供应商管理",
-            "viewType": "document-vendor-formpanel",
+            "viewType": "vendor-list-formpanel",
             "leaf": true
         }, {
             "text": "商品管理",
@@ -180,8 +182,9 @@
             "viewType": "mainlist",
             "leaf": true
         }, {
+            "id":"other-bankinformation",
             "text": "账户管理",
-            "viewType": "mainlist",
+            "viewType": "other-bankinformation",
             "leaf": true
         }, {
             "text": "发货地址管理",
@@ -195,26 +198,27 @@
     }, {
         "text": "辅助资料",
         "items": [{
+            "id":"document-kind",
             "text": "客户类别",
             "viewType": "document-kind",
             "leaf": true
         }, {
+            "id":"document-kind",
             "text": "供应商类别",
             "viewType": "document-kind",
             "leaf": true
         }, {
+            "id":"document-kind",
             "text": "商品类别",
             "viewType": "document-kind",
             "leaf": true
         }, {
-            "text": "支出类别",
-            "viewType": "document-kind",
-            "leaf": true
-        }, {
-            "text": "收入类别",
+            "id":"document-kind",
+            "text": "收支类别",
             "viewType": "document-kind",
             "leaf": true
         }, {
+            "id":"other-productbrand",
             "text": "物料品牌",
             "viewType": "other-productbrand",
             "leaf": true