Browse Source

代码提交

hy 7 years ago
parent
commit
ece1ac9ca8

+ 105 - 0
frontend/saas-web/app/view/core/baseform/FormPanelController.js

@@ -6,7 +6,16 @@ Ext.define('saas.view.core.baseform.FormPanelController', {
     FormUtil: Ext.create('saas.util.FormUtil'),
 
     query: function() {
+        var form = this.view;
         var grid = this.view.down('[name=baseGrid]');
+        grid.condition = '';
+        var fields = form.searchField.map(f => f.name);
+        var items = [];
+        Ext.each(fields, function(f, index){
+            var field = form.dockedItems.items[0].down('[name='+f+']');
+            items.push(field);
+        });
+        grid.condition = this.getCondition(items);
         grid.store.loadPage(1);
     },
 
@@ -14,5 +23,101 @@ Ext.define('saas.view.core.baseform.FormPanelController', {
         var form = this.getView();
         var id = form.xtype + '_add';
         openTab(form.xtype,'新增' + form._title,id);
+    },
+
+    getCondition: function(items) {
+        var me = this,
+        conditions = [];
+
+        for(var i = 0; i < items.length; i++) {
+            var item = items[i];
+            var field = item.name,
+            func = item.getCondition,
+            value = item.value,
+            condition;
+
+            if(typeof func == 'function') {
+                condition = {
+                    type: 'condition',
+                    value: func(value)
+                }
+            }else {
+                var xtype = item.xtype || 'textfield',
+                type = item.fieldType || me.getDefaultFieldType(xtype),
+                operation = item.operation || me.getDefaultFieldOperation(xtype),
+                conditionValue = me.getConditionValue(xtype, value);
+    
+                if(!conditionValue) {
+                    continue;
+                }
+                condition = {
+                    type: type,
+                    field: field,
+                    operation: operation,
+                    value: conditionValue
+                }
+            }
+            conditions.push(condition);
+        };
+        return conditions;
+    },
+
+    getDefaultFieldType: function(xtype) {
+        var type;
+
+        if(Ext.Array.contains(['numberfield'], xtype)) {
+            type = 'number';
+        }else if(Ext.Array.contains(['datefield', 'condatefield'], xtype)) {
+            type = 'date';
+        }else if(Ext.Array.contains(['combobox', 'multicombo', 'combo', 'radiofield', 'radio'], xtype)) {
+            type = 'enum';
+        }else {
+            type = 'string';
+        }
+
+        return type;
+    },
+
+    getDefaultFieldOperation: function(xtype) {
+        var operation;
+
+        if(Ext.Array.contains(['numberfield'], xtype)) {
+            operation = '=';
+        }else if(Ext.Array.contains(['datefield'], xtype)) {
+            operation = '=';
+        }else if(Ext.Array.contains(['condatefield'], xtype)) {
+            operation = 'between';
+        }else if(Ext.Array.contains(['combobox', 'multicombo', 'combo'], xtype)) {
+            operation = 'in';
+        }else {
+            operation = 'like';
+        }
+
+        return operation;
+    },
+
+    /**
+     * 处理部分字段值
+     */
+    getConditionValue: function(xtype, value) {
+        var conditionValue;
+        if(xtype == 'datefield') {
+            conditionValue = Ext.Date.format(new Date(from), 'Y-m-d h:i:s');
+        }else if(xtype == 'condatefield') {
+            var from = value.from,
+            to = value.to;
+
+            conditionValue = Ext.Date.format(new Date(from), 'Y-m-d 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 conditionValue;
     }
 });

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

@@ -40,12 +40,12 @@ Ext.define('saas.view.core.baseform.GridPanel', {
                     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)
                         });
                     }
                 }

+ 4 - 3
frontend/saas-web/app/view/document/customer/panel/FormController.js

@@ -201,11 +201,12 @@ Ext.define('saas.view.document.customer.panel.FormController', {
     },
 
     auditBtnClick: function() {
+        debugger
         var me = this,
         form = me.getView(),
         statusCodeField = form._statusCodeField,
         viewModel = me.getViewModel(),
-        status = viewModel.data['form'][statusCodeField];
+        status = viewModel.data[statusCodeField];
         status == 'OPEN' ? me.unAudit() : me.audit();
     },
 
@@ -215,7 +216,7 @@ Ext.define('saas.view.document.customer.panel.FormController', {
         viewModel = me.getViewModel();
         
         me.BaseUtil.request({
-            url: form._openUrl+'/'+viewModel.data['form'].id,
+            url: form._openUrl+'/'+viewModel.data.id,
             params: '',
             method: 'POST',
         })
@@ -238,7 +239,7 @@ Ext.define('saas.view.document.customer.panel.FormController', {
         viewModel = me.getViewModel();
         
         me.BaseUtil.request({
-            url: form._closeUrl+'/'+viewModel.data['form'].id,
+            url: form._closeUrl+'/'+viewModel.data.id,
             params: '',
             method: 'POST',
         })

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

@@ -147,7 +147,7 @@ Ext.define('saas.view.document.customer.panel.FormPanel', {
         columnWidth : 0.25
     }, {
         xtype : "detailGridField", 
-        _detnoColumn:  'cc_detno',
+        detnoColumn:  'cc_detno',
         storeModel:'saas.model.document.customercontact',
         _deleteDetailUrl:'http://192.168.253.228:9480/customer/deletecontact/',
         columns : [
@@ -250,7 +250,7 @@ Ext.define('saas.view.document.customer.panel.FormPanel', {
             }]
     } ,{
         xtype : "detailGridField", 
-        _detnoColumn:  'ca_detno',
+        detnoColumn:  'ca_detno',
         storeModel:'saas.model.document.customeraddress',
         _deleteDetailUrl:'http://192.168.253.228:9480/customer/deleteaddress/',
         columns : [
@@ -367,14 +367,14 @@ Ext.define('saas.view.document.customer.panel.FormPanel', {
         if(statusCodeField) {
             var o = {};
             o['auditBtnText'] = {
-                bind: '{form.' + statusCodeField + '}',
+                bind: '{' + statusCodeField + '}',
                 get: function(value) {
-                    viewModel.set('form.' + statusField, value == 'OPEN' ? '启用' : '禁用');
+                    viewModel.set(statusField, value == 'OPEN' ? '启用' : '禁用');
                     return value == 'OPEN' ? '禁用' : '启用'
                 }
             };
             viewModel.setFormulas(o);
-            viewModel.set('form.' + statusCodeField, "OPEN");
+            viewModel.set(statusCodeField, "OPEN");
         }else {
             viewModel.set('auditBtnText', "禁用");
         }

+ 109 - 0
frontend/saas-web/app/view/document/product/list/FormPanel.js

@@ -0,0 +1,109 @@
+Ext.define('saas.view.document.product.list.FormPanel', {
+    extend: 'saas.view.core.baseform.FormPanel',
+    xtype: 'product-list-formpanel',
+    controller: 'product-list-formpanel',
+    viewModel: 'product-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/producttype/getCombo",
+        name : "pr_type", 
+        emptyText : "请选择物料类型", 
+        allowBlank : true, 
+        queryMode: 'local',
+        displayField: 'display',
+        valueField: 'value',
+        columnWidth : 0.25,
+        etc:{
+            producttype:{
+                keyField:'id',
+                dataField:'pr_name',
+                reqUrl:'http://192.168.253.31:9480/producttype/save',
+                delUrl:'http://192.168.253.31:9480/producttype/delete'
+            }
+        },
+        addHandler:function(b){
+            var form = this.ownerCmp.ownerCt.ownerCt;
+            this.dialog = form.getController().getView().add({
+                xtype: 'document-kind-childwin',
+                bind: {
+                    title: '新增物料类型'
+                },
+                dataKind:'producttype',
+                belong:this.ownerCmp.etc['producttype'],
+                _parent:form,
+                record:null,
+                session: true
+            });
+            this.dialog.show();
+        }  
+    }],
+
+    //字段属性
+    _formXtype:'product-panel-formpanel',
+    _title:'物料资料',
+    _dataUrl:'http://192.168.253.31:9480/product/list',
+    _batchOpenUrl:'http://192.168.253.31:9480/product/batchOpen',
+    _batchCloseUrl:'http://192.168.253.31:9480/product/batchClose',
+    _batchDeleteUrl:'http://192.168.253.31:9480/product/batchDelete',
+
+    initComponent: function () {
+        var me = this;
+        Ext.apply(me, {
+            items: [{
+                idField: 'id',
+                codeField: 'pr_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 : "pr_code", 
+                    xtype : "", 
+                }, 
+                {
+                    text : "物料名称", 
+                    dataIndex : "pr_name", 
+                    width : 120.0, 
+                    xtype : "", 
+                }, 
+                {
+                    text : "状态", 
+                    dataIndex : "pr_status", 
+                    width : 120.0, 
+                    xtype : ""
+                }, 
+                {
+                    text : "物料种类", 
+                    dataIndex : "pr_type", 
+                    width : 120.0, 
+                    xtype : "",
+                }]
+            }]
+        });
+        me.callParent(arguments);
+    }
+});

+ 11 - 0
frontend/saas-web/app/view/document/product/list/FormPanelController.js

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

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

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

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

@@ -0,0 +1,258 @@
+Ext.define('saas.view.document.product.panel.FormController', {
+    extend: 'saas.view.core.form.FormPanelController',
+    alias: 'controller.product-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[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.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.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/product/panel/FormModel.js

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

+ 131 - 0
frontend/saas-web/app/view/document/product/panel/FormPanel.js

@@ -0,0 +1,131 @@
+Ext.define('saas.view.document.product.panel.FormPanel', {
+    extend: 'saas.view.core.form.FormPanel',
+    xtype: 'product-panel-formpanel',
+
+    controller: 'product-panel-formpanel',
+    viewModel: 'product-panel-formpanel',
+    
+    caller:'Product',
+
+    //字段属性
+    _title:'物料资料',
+    _idField: 'id',
+    _codeField: 'pr_code',
+    _statusField: 'pr_status',
+    _statusCodeField: 'pr_statuscode',
+    _readUrl:'http://192.168.253.31:9480/product/read/',
+    _saveUrl:'http://192.168.253.31:9480/product/save',
+    _openUrl:'http://192.168.253.31:9480/product/open',
+    _closeUrl:'http://192.168.253.31:9480/product/close',
+    _deleteUrl:'http://192.168.253.31:9480/product/delete/',
+    initId:0,
+
+    defaultItems: [{
+        xtype: 'hidden',
+        name: 'id',
+        fieldLabel: 'id',
+        allowBlank: true,
+        columnWidth: 0.25
+    },{
+        xtype: 'textfield',
+        name: 'pr_name',
+        fieldLabel: '物料名称',
+        allowBlank: false,
+        columnWidth: 0.25
+    },{
+        xtype: 'textfield',
+        name: 'pr_code',
+        fieldLabel: '物料编号',
+        allowBlank: true,
+        columnWidth: 0.25
+    },{
+        xtype: 'textfield',
+        name: 'pr_status',
+        fieldLabel: '状态',
+        allowBlank: true,
+        columnWidth: 0.25
+    },{
+        xtype: 'hidden',
+        name: 'pr_statuscode',
+        fieldLabel: '状态码',
+        allowBlank: true,
+        columnWidth: 0.25
+    },{
+        xtype : "remotecombo", 
+        storeUrl:"http://192.168.253.31:9480/producttype/getCombo",
+        name : "pr_type", 
+        fieldLabel : "物料类型", 
+        allowBlank : true, 
+        queryMode: 'local',
+        displayField: 'display',
+        valueField: 'value',
+        columnWidth : 0.25,
+        etc:{
+            producttype:{
+                keyField:'id',
+                dataField:'pr_name',
+                reqUrl:'http://192.168.253.31:9480/producttype/save',
+                delUrl:'http://192.168.253.31:9480/producttype/delete'
+            }
+        },
+        addHandler:function(b){
+            var form = this.ownerCmp.ownerCt;
+            this.dialog = form.getController().getView().add({
+                xtype: 'document-kind-childwin',
+                bind: {
+                    title: '新增物料类型'
+                },
+                dataKind:'producttype',
+                belong:this.ownerCmp.etc['producttype'],
+                _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 : "updateTime", 
+        fieldLabel : "更新时间", 
+        allowBlank : true, 
+        columnWidth : 0.25
+    }],
+
+    /**
+     * 一些初始化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: '{' + statusCodeField + '}',
+                get: function(value) {
+                    viewModel.set(statusField, value == 'OPEN' ? '启用' : '禁用');
+                    return value == 'OPEN' ? '禁用' : '启用'
+                }
+            };
+            viewModel.setFormulas(o);
+            viewModel.set(statusCodeField, "OPEN");
+        }else {
+            viewModel.set('auditBtnText', "禁用");
+        }
+    }
+});

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

@@ -58,11 +58,11 @@ Ext.define('saas.view.document.vendor.list.FormPanel', {
     //字段属性
     _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',
+    _dataUrl:'http://192.168.253.31:9480/vendor/list',
+    _deleteUrl:'http://192.168.253.31:9480/vendor/delete/',
+    _batchOpenUrl:'http://192.168.253.31:9480/vendor/batchOpen',
+    _batchCloseUrl:'http://192.168.253.31:9480/vendor/batchClose',
+    _batchDeleteUrl:'http://192.168.253.31:9480/vendor/batchDelete',
 
     initComponent: function () {
         var me = this;

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

@@ -139,7 +139,7 @@ Ext.define('saas.view.document.vendor.panel.FormController', {
                 beforerender:function(f){
                     Ext.apply(f,{
                         //数据接口
-                        dataUrl:'http://192.168.253.41:9480/api/document/product/getProductsByCondition',
+                        dataUrl:'http://192.168.253.31:9480/api/document/product/getProductsByCondition',
                         //放大镜赋值设置
                         dbfinds:[{
                             from:'pr_code',to:'pd_prodcode'
@@ -205,7 +205,7 @@ Ext.define('saas.view.document.vendor.panel.FormController', {
         form = me.getView(),
         statusCodeField = form._statusCodeField,
         viewModel = me.getViewModel(),
-        status = viewModel.data['form'][statusCodeField];
+        status = viewModel.data[statusCodeField];
         status == 'OPEN' ? me.unAudit() : me.audit();
     },
 
@@ -215,7 +215,7 @@ Ext.define('saas.view.document.vendor.panel.FormController', {
         viewModel = me.getViewModel();
         
         me.BaseUtil.request({
-            url: form._openUrl+'/'+viewModel.data['form'].id,
+            url: form._openUrl+'/'+viewModel.data.id,
             params: '',
             method: 'POST',
         })
@@ -238,7 +238,7 @@ Ext.define('saas.view.document.vendor.panel.FormController', {
         viewModel = me.getViewModel();
         
         me.BaseUtil.request({
-            url: form._closeUrl+'/'+viewModel.data['form'].id,
+            url: form._closeUrl+'/'+viewModel.data.id,
             params: '',
             method: 'POST',
         })

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

@@ -13,11 +13,11 @@ Ext.define('saas.view.document.vendor.panel.FormPanel', {
     _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/',
+    _readUrl:'http://192.168.253.31:9480/vendor/read/',
+    _saveUrl:'http://192.168.253.31:9480/vendor/save',
+    _openUrl:'http://192.168.253.31:9480/vendor/open',
+    _closeUrl:'http://192.168.253.31:9480/vendor/close',
+    _deleteUrl:'http://192.168.253.31:9480/vendor/delete/',
     initId:0,
 
     defaultItems: [{
@@ -147,9 +147,9 @@ Ext.define('saas.view.document.vendor.panel.FormPanel', {
         columnWidth : 0.25
     }, {
         xtype : "detailGridField", 
-        _detnoColumn:  'vc_detno',
+        detnoColumn:  'vc_detno',
         storeModel:'saas.model.document.vendorcontact',
-        _deleteDetailUrl:'http://192.168.253.228:9480/vendor/deletecontact/',
+        _deleteDetailUrl:'http://192.168.253.31:9480/vendor/deletecontact/',
         columns : [
             {
                 text : "序号", 
@@ -268,14 +268,14 @@ Ext.define('saas.view.document.vendor.panel.FormPanel', {
         if(statusCodeField) {
             var o = {};
             o['auditBtnText'] = {
-                bind: '{form.' + statusCodeField + '}',
+                bind: '{' + statusCodeField + '}',
                 get: function(value) {
-                    viewModel.set('form.' + statusField, value == 'OPEN' ? '启用' : '禁用');
+                    viewModel.set(statusField, value == 'OPEN' ? '启用' : '禁用');
                     return value == 'OPEN' ? '禁用' : '启用'
                 }
             };
             viewModel.setFormulas(o);
-            viewModel.set('form.' + statusCodeField, "OPEN");
+            viewModel.set(statusCodeField, "OPEN");
         }else {
             viewModel.set('auditBtnText', "禁用");
         }

+ 5 - 6
frontend/saas-web/resources/json/navigation.json

@@ -163,20 +163,19 @@
             "id":"vendor-list-formpanel",
             "text": "供应商资料",
             "viewType": "vendor-list-formpanel",
+            "addType":"vendor-panel-formpanel",
             "leaf": true
         }, {
             "id":"customer-list-formpanel",
             "text": "客户资料",
             "viewType": "customer-list-formpanel",
+            "addType":"customer-panel-formpanel",
             "leaf": true
         }, {
-            "id":"customer-list-formpanel",
-            "text": "客户资料",
-            "viewType": "customer-list-formpanel",
-            "leaf": true
-        }, {
+            "id":"product-list-formpanel",
             "text": "物料资料",
-            "viewType": "mainlist",
+            "viewType": "product-list-formpanel",
+            "addType":"product-panel-formpanel",
             "leaf": true
         }, {
             "text": "仓库资料",