Browse Source

代码提交

hy 7 years ago
parent
commit
0238615891

+ 32 - 31
frontend/saas-web/app/view/core/dbfind/DbfindTrigger.js

@@ -167,37 +167,38 @@ Ext.define('saas.view.core.dbfind.DbfindTrigger', {
             var me = f;
             var count = f.store.getCount();
             var dbfinds = me.dbfinds;
-            if(count==1){
-                record = f.store.data.items[0];
-                if(dbfinds&&dbfinds.length>0){
-                    if(me.belong=='grid'){
-                        for (let index = 0; index < dbfinds.length; index++) {
-                            var item = dbfinds[index];
-                            var rec = me.column.ownerCt.ownerCt.selModel.getLastSelected();
-                            var nowRec = me.column.ownerCt.ownerCt.store.getData().getByKey(rec.id);
-                            nowRec.set(item.to,record.get(item.from));
-                            if(me.name==item.to){
-                                me.column.getEditor().setValue(record.get(item.from));
-                            }
-                        }
-                    }else if(me.belong=='form'){
-                        for (let index = 0; index < dbfinds.length; index++) {
-                            var item = dbfinds[index];
-                            var field = me.ownerCt.down('[name='+item.to+']');
-                            if(field){
-                                var val = record.get(item.from);
-                                if(field.xtype=='dbfindtrigger'){
-                                    field.setRawValue(val);
-                                    field.value = val;
-                                    field.lastTriggerValue=val;
-                                }else{
-                                    field.setValue(val);
-                                }    
-                            }
-                        }
-                    }
-                }
-            }else if(count==0){
+            // if(count==1){
+            //     record = f.store.data.items[0];
+            //     if(dbfinds&&dbfinds.length>0){
+            //         if(me.belong=='grid'){
+            //             for (let index = 0; index < dbfinds.length; index++) {
+            //                 var item = dbfinds[index];
+            //                 var rec = me.column.ownerCt.ownerCt.selModel.getLastSelected();
+            //                 var nowRec = me.column.ownerCt.ownerCt.store.getData().getByKey(rec.id);
+            //                 nowRec.set(item.to,record.get(item.from));
+            //                 if(me.name==item.to){
+            //                     me.column.getEditor().setValue(record.get(item.from));
+            //                 }
+            //             }
+            //         }else if(me.belong=='form'){
+            //             for (let index = 0; index < dbfinds.length; index++) {
+            //                 var item = dbfinds[index];
+            //                 var field = me.ownerCt.down('[name='+item.to+']');
+            //                 if(field){
+            //                     var val = record.get(item.from);
+            //                     if(field.xtype=='dbfindtrigger'){
+            //                         field.setRawValue(val);
+            //                         field.value = val;
+            //                         field.lastTriggerValue=val;
+            //                     }else{
+            //                         field.setValue(val);
+            //                     }    
+            //                 }
+            //             }
+            //         }
+            //     }
+            // }else 
+            if(!f.value||f.value==''){
                 if(dbfinds&&dbfinds.length>0){
                     if(me.belong=='grid'){
                         for (let index = 0; index < dbfinds.length; index++) {

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

@@ -212,6 +212,20 @@ Ext.define('saas.view.document.customer.FormPanel', {
                             {"display":"是", "value":'1'},
                             {"display":"否", "value":'0'}
                         ]
+                    },
+                    listeners:{
+                        'change':function(c,newVal,oldVal){
+                            if(newVal=='1'){
+                                var grid = c.ownerCt.column.ownerCt.ownerCt;
+                                var nowId = grid.selModel.lastSelected.id;
+                                var items = grid.store.data.items
+                                for (let index = 0; index < items.length; index++) {
+                                    if(items[index].id!=nowId){
+                                        items[index].set('cc_default',"")
+                                    }
+                                }
+                            }
+                        }
                     }
                 }, 
                 text : "是否默认联系人", 
@@ -268,7 +282,8 @@ Ext.define('saas.view.document.customer.FormPanel', {
             {
                 text : "联系电话", 
                 editor : {
-                    xtype : "textfield"
+                    xtype : "numberfield",
+                    hideTrigger:true,
                 },
                 dataIndex : "ca_phone", 
                 xtype : "", 
@@ -295,9 +310,16 @@ Ext.define('saas.view.document.customer.FormPanel', {
                     },
                     listeners:{
                         'change':function(c,newVal,oldVal){
-                            var grid = c.ownerCt.column.ownerCt.ownerCt;
-                            var nowId = grid.selModel.lastSelected.id;
-                            var items = grid.store.data.items
+                            if(newVal=='1'){
+                                var grid = c.ownerCt.column.ownerCt.ownerCt;
+                                var nowId = grid.selModel.lastSelected.id;
+                                var items = grid.store.data.items
+                                for (let index = 0; index < items.length; index++) {
+                                    if(items[index].id!=nowId){
+                                        items[index].set('ca_default',"")
+                                    }
+                                }
+                            }
                         }
                     }
                 }, 

+ 2 - 2
frontend/saas-web/app/view/document/product/FormController.js

@@ -82,7 +82,7 @@ Ext.define('saas.view.document.product.FormController', {
                         //新增标题
                         addTitle:'仓库资料', 
                         //联想查询条件
-                        dbtplfield:"pr_whcode",
+                        defaultCondition:"wh_statuscode='OPEN'",
                         //联想设置
                         dbtpls:[{
                             field:'wh_code',width:100
@@ -95,7 +95,7 @@ Ext.define('saas.view.document.product.FormController', {
                             xtype : "textfield", 
                             name : "wh_code", 
                             allowBlank : true, 
-                            columnWidth : 0.25,
+                            width:260,
                             getCondition:function(v){
                                 return "wh_code like '%" + v + "%' or wh_description like '%"+ v +"%' or wh_type like '%" + v + "%'";
                             }

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

@@ -166,7 +166,8 @@ Ext.define('saas.view.document.vendor.FormPanel', {
             {
                 text : "电话", 
                 editor : {
-                    xtype : "textfield"
+                    hideTrigger:true,
+                    xtype : "numberfield"
                 },
                 dataIndex : "vc_tel", 
                 xtype : "", 
@@ -205,6 +206,20 @@ Ext.define('saas.view.document.vendor.FormPanel', {
                             {"display":"是", "value":'1'},
                             {"display":"否", "value":'0'}
                         ]
+                    },
+                    listeners:{
+                        'change':function(c,newVal,oldVal){
+                            if(newVal=='1'){
+                                var grid = c.ownerCt.column.ownerCt.ownerCt;
+                                var nowId = grid.selModel.lastSelected.id;
+                                var items = grid.store.data.items
+                                for (let index = 0; index < items.length; index++) {
+                                    if(items[index].id!=nowId){
+                                        items[index].set('vc_default',"")
+                                    }
+                                }
+                            }
+                        }
                     }
                 }, 
                 text : "是否默认联系人", 

+ 1 - 0
frontend/saas-web/app/view/sale/sale/FormPanelController.js

@@ -11,6 +11,7 @@ Ext.define('saas.view.sale.sale.FormPanelController', {
                         dataUrl:'/api/document/customer/dbfind',
                         addXtype: 'document-customer-formpanel',
                         addTitle: '客户资料',
+                        defaultCondition:"cu_statuscode='OPEN'",
                         dbfinds:[
                             {
                                 from:'id',to:'sa_custid'