Browse Source

Merge branch 'dev' of ssh://10.10.100.21/source/saas-platform into dev

zhoudw 7 years ago
parent
commit
e530278f29

+ 29 - 3
frontend/saas-web/app/view/core/form/FormPanel.js

@@ -111,7 +111,8 @@ Ext.define('saas.view.core.form.FormPanel', {
                 }, {
                     xtype: 'button',
                     bind: {
-                        text: '{auditBtnText}'
+                        text: '{auditBtnText}',
+                        hidden:'{!showAuditBtn}'
                     },
                     handler: "auditBtnClick",
 
@@ -137,11 +138,13 @@ Ext.define('saas.view.core.form.FormPanel', {
 
         if (statusCodeField) {
             var o = {};
-            o['auditBtnText'] = {
+            o['bindEditable'] = {
                 bind: '{' + statusCodeField + '}',
                 get: function(value) {
                     viewModel.set(statusField, value == 'AUDITED' ? '已审核' : '未审核');
-                    return value == 'AUDITED' ? '反审核' : '审核'
+                    viewModel.set('auditBtnText', value == 'AUDITED' ? '反审核' : '审核');
+                    me.setEditable(value != 'AUDITED');
+                    return value;
                 }
             };
             viewModel.setFormulas(o);
@@ -250,4 +253,27 @@ Ext.define('saas.view.core.form.FormPanel', {
         });
         viewModel.set('base.bindFields', bindFields);
     },
+    setEditable: function(able) {
+        var me = this,
+        viewModel = me.getViewModel(),
+        items = me.getForm().getFields().items;
+
+        var detailGrids = me.query('detailGridField');
+
+        Ext.Array.each(detailGrids, function(g) {
+            var columns = g.columns;
+            Ext.Array.each(columns, function(c) {
+                var e = c.getEditor();
+                if(e) {
+                    typeof e.setDisabled == 'function' && e.setDisabled(!able);
+                }
+            });
+        });
+
+        Ext.Array.each(items, function(item) {
+            if(typeof item.setEditable == 'function') {
+                typeof item.setDisabled == 'function' && item.setDisabled(!able);
+            }
+        });
+    }
 });

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

@@ -189,7 +189,7 @@ Ext.define('saas.view.core.form.FormPanelController', {
                     form.initId = localJson.data.id;
                 }
                 form.FormUtil.loadData(form);
-                viewModel.set('base.editable', false);
+                form.setEditable(false);
                 showToast('审核成功');
             }
         })

+ 2 - 0
frontend/saas-web/app/view/core/form/FormPanelModel.js

@@ -9,6 +9,8 @@ Ext.define('saas.view.core.form.FormPanelModel', {
             editable: true, // 单据是否可编辑
             codeEditable: false, // 单据编号是否可编辑
         },
+        auditBtnText: '审核', // 审核按钮默认text
+        showAuditBtn: true, // 显示审核、反审核按钮
         detailBindeFields: [], // 从表绑定列
         detailStore: null, // 从表store
     },

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

@@ -32,7 +32,7 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
             store: Ext.create('Ext.data.Store', {
                 fields: me.getFields(),
                 autoLoad: true,
-                pageSize: 15,
+                pageSize: 5,
                 data: [],
                 proxy: {
                     type: 'ajax',

+ 7 - 0
frontend/saas-web/app/view/core/query/QueryPanel.js

@@ -281,5 +281,12 @@ Ext.define('saas.view.core.query.QueryPanel', {
         }
 
         return detailModel ? 'DETAIL' : 'MAIN';
+    },
+    
+    refresh: function() {
+        var me = this;
+        queryGrid = me.down('core-query-querygridpanel');
+
+        queryGrid.store.reload();
     }
 });

+ 10 - 1
frontend/saas-web/app/view/core/tab/Controller.js

@@ -13,7 +13,16 @@ Ext.define('saas.view.core.tab.Controller', {
         };
         Ext.apply(view, viewConfig);
 
-        tab.add(view);
+        tab.tabView = tab.add(view);
     },
 
+    onTabChange: function() {
+        var me = this,
+        tab = me.getView(),
+        tabView = tab.tabView;
+
+        if(typeof tabView.refresh == 'function') {
+            tabView.refresh();
+        }
+    }
 });

+ 5 - 1
frontend/saas-web/app/view/core/tab/Panel.js

@@ -2,5 +2,9 @@ Ext.define('saas.view.core.tab.Panel', {
     extend: 'Ext.panel.Panel',
     xtype: 'core-tab-panel',
     controller: 'core-tab-controller',
-    layout: 'fit'
+    layout: 'fit',
+    
+    listeners: {
+        activate: 'onTabChange'
+    }
 });

+ 7 - 7
frontend/saas-web/app/view/document/customer/BasePanel.js

@@ -7,7 +7,7 @@ Ext.define('saas.view.document.customer.BasePanel', {
 
     searchField:[{
         xtype : "remotecombo", 
-        storeUrl:basePath+'ducument/customerkind/getCombo',
+        storeUrl:basePath+'document/customerkind/getCombo',
         name : "cu_type", 
         emptyText : "请选择客户类型", 
         allowBlank : true, 
@@ -19,8 +19,8 @@ Ext.define('saas.view.document.customer.BasePanel', {
             customerkind:{
                 keyField:'id',
                 dataField:'ck_name',
-                reqUrl:basePath+'ducument/customerkind/save',
-                delUrl:basePath+'ducument/customerkind/delete'
+                reqUrl:basePath+'document/customerkind/save',
+                delUrl:basePath+'document/customerkind/delete'
             }
         },
         addHandler:function(b){
@@ -44,14 +44,14 @@ Ext.define('saas.view.document.customer.BasePanel', {
     _formXtype:'document-customer-formpanel',
     _title:'客户资料',
     // _dataUrl:basePath+'ducument/customer/list',
-    _batchOpenUrl:basePath+'ducument/customer/batchOpen',
-    _batchCloseUrl:basePath+'ducument/customer/batchClose',
-    _batchDeleteUrl:basePath+'ducument/customer/batchDelete',
+    _batchOpenUrl:basePath+'document/customer/batchOpen',
+    _batchCloseUrl:basePath+'document/customer/batchClose',
+    _batchDeleteUrl:basePath+'document/customer/batchDelete',
 
     gridConfig: {
         idField: 'id',
         codeField: 'cu_code',
-        dataUrl: basePath+'ducument/customer/list',
+        dataUrl: basePath+'document/customer/list',
         columns : [{
             text : "客户id", 
             width : 0, 

+ 12 - 1
frontend/saas-web/app/view/document/customer/FormModel.js

@@ -2,5 +2,16 @@ Ext.define('saas.view.document.customer.FormModel', {
     extend: 'saas.view.core.form.FormPanelModel',
     alias: 'viewmodel.document-customer-formpanel',
 
-    
+    data: {
+        id: 0
+    },
+
+    formulas:{
+        showAuditBtn:{
+            bind:'{id}',
+            get:function(value){
+                return value;
+            }
+        }
+    }
 });

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

@@ -13,11 +13,11 @@ Ext.define('saas.view.document.customer.FormPanel', {
     _codeField: 'cu_code',
     _statusField: 'cu_status',
     _statusCodeField: 'cu_statuscode',
-    _readUrl:basePath+'ducument/customer/read/',
-    _saveUrl:basePath+'ducument/customer/save',
-    _openUrl:basePath+'ducument/customer/open',
-    _closeUrl:basePath+'ducument/customer/close',
-    _deleteUrl:basePath+'ducument/customer/delete/',
+    _readUrl:basePath+'document/customer/read/',
+    _saveUrl:basePath+'document/customer/save',
+    _openUrl:basePath+'document/customer/open',
+    _closeUrl:basePath+'document/customer/close',
+    _deleteUrl:basePath+'document/customer/delete/',
     initId:0,
 
     defaultItems: [{
@@ -52,7 +52,7 @@ Ext.define('saas.view.document.customer.FormPanel', {
         columnWidth: 0.25
     },{
         xtype : "remotecombo", 
-        storeUrl:basePath+'ducument/customerkind/getCombo',
+        storeUrl:basePath+'document/customerkind/getCombo',
         name : "cu_type", 
         fieldLabel : "客户类型", 
         allowBlank : true, 
@@ -64,8 +64,8 @@ Ext.define('saas.view.document.customer.FormPanel', {
             customerkind:{
                 keyField:'id',
                 dataField:'ck_name',
-                reqUrl:basePath+'ducument/customerkind/save',
-                delUrl:basePath+'ducument/customerkind/delete'
+                reqUrl:basePath+'document/customerkind/save',
+                delUrl:basePath+'document/customerkind/delete'
             }
         },
         addHandler:function(b){
@@ -149,7 +149,7 @@ Ext.define('saas.view.document.customer.FormPanel', {
         xtype : "detailGridField", 
         detnoColumn:  'cc_detno',
         storeModel:'saas.model.document.customercontact',
-        deleteDetailUrl:basePath+'ducument/customer/deletecontact/',
+        deleteDetailUrl:basePath+'document/customer/deletecontact/',
         columns : [
             {
                 text : "ID", 
@@ -240,7 +240,7 @@ Ext.define('saas.view.document.customer.FormPanel', {
         xtype : "detailGridField", 
         detnoColumn:  'ca_detno',
         storeModel:'saas.model.document.customeraddress',
-        deleteDetailUrl:basePath+'ducument/customer/deleteaddress/',
+        deleteDetailUrl:basePath+'document/customer/deleteaddress/',
         columns : [
             {
                 text : "ID", 

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

@@ -168,7 +168,6 @@ Ext.define('saas.view.document.kind.Kind', {
                     tooltip: '锁定',
                     iconCls:'',
                     getClass: function(v, meta, rec) {
-                        debugger
                         if(rec.get('wh_statuscode')=='OPEN'){
                             this.items[0].tooltip = '不启用';
                             return 'x-grid-checkcolumn-checked';

+ 12 - 1
frontend/saas-web/app/view/document/product/FormModel.js

@@ -2,5 +2,16 @@ Ext.define('saas.view.document.product.FormModel', {
     extend: 'saas.view.core.form.FormPanelModel',
     alias: 'viewmodel.document-product-formpanel',
 
-    
+    data: {
+        id: 0
+    },
+
+    formulas:{
+        showAuditBtn:{
+            bind:'{id}',
+            get:function(value){
+                return value;
+            }
+        }
+    }
 });

+ 6 - 6
frontend/saas-web/app/view/document/product/FormPanel.js

@@ -85,7 +85,7 @@ Ext.define('saas.view.document.product.FormPanel', {
         }
     },{
         xtype : "remotecombo", 
-        storeUrl:basePath+'ducument/product/getProdUnit',
+        storeUrl:basePath+'document/product/getProdUnit',
         name : "pr_unit", 
         bind : "{pr_unit}", 
         fieldLabel : "物料单位", 
@@ -98,8 +98,8 @@ Ext.define('saas.view.document.product.FormPanel', {
             produnit:{
                 keyField:'id',
                 dataField:'vk_name',
-                reqUrl:basePath+'ducument/produnit/save',
-                delUrl:basePath+'ducument/produnit/delete'
+                reqUrl:basePath+'document/produnit/save',
+                delUrl:basePath+'document/produnit/delete'
             }
         },
         addHandler:function(b){
@@ -119,7 +119,7 @@ Ext.define('saas.view.document.product.FormPanel', {
         }
     },{
         xtype : "remotecombo", 
-        storeUrl:basePath+'ducument/product/getProdBrand',
+        storeUrl:basePath+'document/product/getProdBrand',
         name : "pr_brand", 
         bind : "{pr_brand}", 
         fieldLabel : "物料品牌", 
@@ -132,8 +132,8 @@ Ext.define('saas.view.document.product.FormPanel', {
             productbrand:{
                 keyField:'id',
                 dataField:'pb_name',
-                reqUrl:basePath+'ducument/productbrand/save',
-                delUrl:basePath+'ducument/productbrand/delete'
+                reqUrl:basePath+'document/productbrand/save',
+                delUrl:basePath+'document/productbrand/delete'
             }
         },
         addHandler:function(b){

+ 8 - 8
frontend/saas-web/app/view/document/vendor/BasePanel.js

@@ -6,7 +6,7 @@ Ext.define('saas.view.document.vendor.BasePanel', {
 
     searchField:[{
         xtype : "remotecombo", 
-        storeUrl:basePath+'ducument/vendorkind/getCombo',
+        storeUrl:basePath+'document/vendorkind/getCombo',
         name : "ve_type", 
         emptyText : "请选择供应商类型", 
         allowBlank : true, 
@@ -18,8 +18,8 @@ Ext.define('saas.view.document.vendor.BasePanel', {
             vendorkind:{
                 keyField:'id',
                 dataField:'vk_name',
-                reqUrl:basePath+'ducument/vendorkind/save',
-                delUrl:basePath+'ducument/vendorkind/delete'
+                reqUrl:basePath+'document/vendorkind/save',
+                delUrl:basePath+'document/vendorkind/delete'
             }
         },
         addHandler:function(b){
@@ -43,15 +43,15 @@ Ext.define('saas.view.document.vendor.BasePanel', {
     _formXtype:'document-vendor-formpanel',
     _title:'供应商资料',
     // _dataUrl:basePath+'ducument/vendor/list',
-    _deleteUrl:basePath+'ducument/vendor/delete/',
-    _batchOpenUrl:basePath+'ducument/vendor/batchOpen',
-    _batchCloseUrl:basePath+'ducument/vendor/batchClose',
-    _batchDeleteUrl:basePath+'ducument/vendor/batchDelete',
+    _deleteUrl:basePath+'document/vendor/delete/',
+    _batchOpenUrl:basePath+'document/vendor/batchOpen',
+    _batchCloseUrl:basePath+'document/vendor/batchClose',
+    _batchDeleteUrl:basePath+'document/vendor/batchDelete',
 
     gridConfig: {
         idField: 'id',
         codeField: 've_code',
-        dataUrl: basePath+'ducument/vendor/list',
+        dataUrl: basePath+'document/vendor/list',
         columns : [{
             text : "供应商id", 
             width : 0, 

+ 12 - 1
frontend/saas-web/app/view/document/vendor/FormModel.js

@@ -2,5 +2,16 @@ Ext.define('saas.view.document.vendor.FormModel', {
     extend: 'saas.view.core.form.FormPanelModel',
     alias: 'viewmodel.document-vendor-formpanel',
 
-    
+    data: {
+        id: 0
+    },
+
+    formulas:{
+        showAuditBtn:{
+            bind:'{id}',
+            get:function(value){
+                return value;
+            }
+        }
+    }
 });

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

@@ -13,11 +13,11 @@ Ext.define('saas.view.document.vendor.FormPanel', {
     _codeField: 've_code',
     _statusField: 've_status',
     _statusCodeField: 've_statuscode',
-    _readUrl:basePath+'ducument/vendor/read/',
-    _saveUrl:basePath+'ducument/vendor/save',
-    _openUrl:basePath+'ducument/vendor/open',
-    _closeUrl:basePath+'ducument/vendor/close',
-    _deleteUrl:basePath+'ducument/vendor/delete/',
+    _readUrl:basePath+'document/vendor/read/',
+    _saveUrl:basePath+'document/vendor/save',
+    _openUrl:basePath+'document/vendor/open',
+    _closeUrl:basePath+'document/vendor/close',
+    _deleteUrl:basePath+'document/vendor/delete/',
     initId:0,
 
     defaultItems: [{
@@ -52,7 +52,7 @@ Ext.define('saas.view.document.vendor.FormPanel', {
         columnWidth: 0.25
     },{
         xtype : "remotecombo", 
-        storeUrl:basePath+'ducument/vendorkind/getCombo',
+        storeUrl:basePath+'document/vendorkind/getCombo',
         name : "ve_type", 
         fieldLabel : "供应商类型", 
         allowBlank : true, 
@@ -64,8 +64,8 @@ Ext.define('saas.view.document.vendor.FormPanel', {
             vendorkind:{
                 keyField:'id',
                 dataField:'vk_name',
-                reqUrl:basePath+'ducument/vendorkind/save',
-                delUrl:basePath+'ducument/vendorkind/delete'
+                reqUrl:basePath+'document/vendorkind/save',
+                delUrl:basePath+'document/vendorkind/delete'
             }
         },
         addHandler:function(b){
@@ -149,7 +149,7 @@ Ext.define('saas.view.document.vendor.FormPanel', {
         xtype : "detailGridField", 
         detnoColumn:  'vc_detno',
         storeModel:'saas.model.document.vendorcontact',
-        _deleteDetailUrl:basePath+'ducument/vendor/deleteContact/',
+        deleteDetailUrl:basePath+'document/vendor/deleteContact/',
         columns : [
             {
                 text : "ID", 

+ 3 - 3
frontend/saas-web/app/view/money/othreceipts/FormPanel.js

@@ -78,7 +78,7 @@ Ext.define('saas.view.money.othreceipts.FormPanel', {
                 items : null,
                 editor : {
                     xtype : "remotecombo", 
-                    storeUrl:basePath+'ducument/fundinoutType/list',
+                    storeUrl:basePath+'document/fundinoutType/list',
                     name : "ord_type", 
                     fieldLabel : "收入类别", 
                     allowBlank : true, 
@@ -90,8 +90,8 @@ Ext.define('saas.view.money.othreceipts.FormPanel', {
                         inoutkind:{
                             keyField:'id',
                             dataField:'ft_name',
-                            reqUrl:basePath+'ducument/fundinoutType/save',
-                            delUrl:basePath+'ducument/fundinoutType/delete'
+                            reqUrl:basePath+'document/fundinoutType/save',
+                            delUrl:basePath+'document/fundinoutType/delete'
                         }
                     },
                     addHandler:function(b){

+ 3 - 3
frontend/saas-web/app/view/money/othspendings/FormPanel.js

@@ -78,7 +78,7 @@ Ext.define('saas.view.money.othspendings.FormPanel', {
                 items : null,
                 editor : {
                     xtype : "remotecombo", 
-                    storeUrl:basePath+'ducument/fundinoutType/list',
+                    storeUrl:basePath+'document/fundinoutType/list',
                     name : "osd_type", 
                     fieldLabel : "支出类别", 
                     allowBlank : true, 
@@ -90,8 +90,8 @@ Ext.define('saas.view.money.othspendings.FormPanel', {
                         inoutkind:{
                             keyField:'id',
                             dataField:'ft_name',
-                            reqUrl:basePath+'ducument/fundinoutType/save',
-                            delUrl:basePath+'ducument/fundinoutType/delete'
+                            reqUrl:basePath+'document/fundinoutType/save',
+                            delUrl:basePath+'document/fundinoutType/delete'
                         }
                     },
                     addHandler:function(b){