Browse Source

字段不可编辑使用readonly

zhuth 7 years ago
parent
commit
2edacbc55d

+ 1 - 1
frontend/saas-web/app/Application.scss

@@ -109,7 +109,7 @@ body.launching {
   }
 }
 
-.x-form-item-default.x-item-disabled {
+.x-form-item-default.x-form-readonly {
   opacity: 1;
 
   .x-form-item-label-default {

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

@@ -373,8 +373,8 @@ Ext.define('saas.view.core.form.FormPanel', {
         });
 
         Ext.Array.each(items, function(item) {
-            if(typeof item.setEditable == 'function') {
-                typeof item.setDisabled == 'function' && item.setDisabled(!able);
+            if(typeof item.setReadOnly  == 'function') {
+               item.setReadOnly (!able);
             }
         });
     },

+ 4 - 7
frontend/saas-web/app/view/stock/otherIn/QueryPanel.js

@@ -31,28 +31,25 @@ Ext.define('saas.view.stock.otherIn.QueryPanel', {
     }, {
         xtype: 'textfield',
         name: 'pi_vendcode',
-        bind: '{pi_vendcode}',
         fieldLabel: '供应商编号',
         allowBlank: true,
         hidden:true,
         columnWidth: 0.25
     }, {
-        xtype: 'textfield',
+        xtype: 'dbfindtrigger',
         name: 'pi_vendname',
-        bind: '{pi_vendname}',
         fieldLabel: '供应商名称',
         allowBlank: true,
         columnWidth: 0.25
     }, {
-        xtype: 'dbfindtrigger',
+        xtype: 'textfield',
         name: 'pd_prodcode',
-        bind: '{pd_prodcode}',
         fieldLabel: '物料编号',
+        hidden: true,
         showDetail: true
     }, {
-        xtype: 'textfield',
+        xtype: 'dbfindtrigger',
         name: 'pr_detail',
-        bind: '{pr_detail}',
         fieldLabel: '物料名称',
         showDetail: true
     }, {

+ 8 - 7
frontend/saas-web/app/view/stock/otherIn/QueryPanelController.js

@@ -6,16 +6,16 @@ Ext.define('saas.view.stock.otherIn.QueryPanelController', {
         var me = this;
         this.control({
             //放大镜赋值关系 以及 tpl模板
-            'dbfindtrigger[name=pu_vendname]':{
+            'dbfindtrigger[name=pi_vendname]':{
                 beforerender:function(f){
                     Ext.apply(f,{
                         dataUrl:'/api/document/vendor/list',
                         addXtype: 'document-vendor-formpanel',
                         addTitle: '供应商资料',
                         dbfinds:[{
-                            from:'ve_code',to:'pu_vendcode'
+                            from:'ve_code',to:'pi_vendcode'
                         },{
-                            from:'ve_name',to:'pu_vendname'
+                            from:'ve_name',to:'pi_vendname'
                         }],
                         dbtpls:[{
                             field:'ve_code',width:100
@@ -77,8 +77,8 @@ Ext.define('saas.view.stock.otherIn.QueryPanelController', {
 
                 }
             },
-            //放大镜赋值关系 以及 tpl模板
-            'dbfindtrigger[name=pd_prodcode]':{
+            // 物料名称
+            'dbfindtrigger[name=pr_detail]':{
                 beforerender:function(f){
                     Ext.apply(f,{
                         conditionCode:'pr_code',
@@ -87,7 +87,8 @@ Ext.define('saas.view.stock.otherIn.QueryPanelController', {
                         addTitle: '物料资料',
                         dbfinds:[{
                             from:'pr_code',to:'pd_prodcode',
-                            from:'pr_unit',to:'pd_unit'
+                        }, {
+                            from:'pr_detail',to:'pr_detail'
                         }],
                         dbtpls:[{
                             field:'pr_code',width:100
@@ -166,7 +167,7 @@ Ext.define('saas.view.stock.otherIn.QueryPanelController', {
                             "text": "L/T",
                             "dataIndex": "pr_leadtime",
                             "width": 100,
-                        }]
+                        }]   
                     }) ;   
 
                 }