hy il y a 7 ans
Parent
commit
a115271a10

+ 98 - 5
frontend/saas-web/app/view/core/dbfind/MultiDbfindTrigger.js

@@ -34,7 +34,6 @@ Ext.define('saas.view.core.dbfind.MultiDbfindTrigger', {
     		var sfield='';
             var dbfinds=me.dbfinds;
             var dbtpls=me.dbtpls;
-            var dbCondition = me.dbCondition.replace(new RegExp("\\{0}","g"), queryString);
     		me.lastQueryValue=queryString;
             if(queryString.trim()==''){
                 me.collapse( );
@@ -50,7 +49,7 @@ Ext.define('saas.view.core.dbfind.MultiDbfindTrigger', {
                             if(i==0){
                                 span=span+'<span style="width:'+dbtpls[i].width+'px;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;float:left;">{'+dbtpls[i].field+'}</span>';//display:block;
                             }else{
-                                span=span+'<span style="width:'+dbtpls[i].width+'px;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;float:left;">{'+dbtpls[i].field+'}</span>';
+                                span=span+'<span style="padding:0 0 0 20px;width:'+dbtpls[i].width+'px;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;float:left;">{'+dbtpls[i].field+'}</span>';
                             }
                             if(dbtpls[i].dbField=="true"){
                                 me.searchFieldArray=dbtpls[i].field;
@@ -75,12 +74,41 @@ Ext.define('saas.view.core.dbfind.MultiDbfindTrigger', {
                     }
                 }
                 //加载数据
-                var data;
+                var data,dbCondition=[];
+                if(me.dbfinds){
+                    var dbtplcondition = "";
+                    for (let index = 0; index < dbfinds.length; index++) {
+                        var item = dbfinds[index].from;
+                        if(!dbfinds[index].ignore){
+                            dbtplcondition+= "upper("+item+") like '%"+queryString.toUpperCase()+"%' or ";
+                        }
+                    }
+                    dbtplcondition = "(" + dbtplcondition.substring(0,dbtplcondition.length-4) + ")";
+                    if(dbtplcondition.length>0){
+                        dbCondition = [{
+                            type: 'condition',
+                            value:dbtplcondition
+                        }];
+                    }
+                }
+                //添加默认条件
+                if(me.defaultCondition) {
+                    dbCondition.push({
+                        type: 'condition',
+                        value: me.defaultCondition
+                    });
+                }
                 Ext.Ajax.request({
                     url: me.dataUrl,
                     params: {
-                        keyword:dbCondition
+                        number: 1,
+                        size: 10,
+                        condition:JSON.stringify(dbCondition),
+                        page: 1,
+                        start: 0,
+                        limit: 10
                     },
+                    method: 'GET',
                     success: function(response, opts) {
                         data = Ext.decode(response.responseText);
                         data = data.data.list;
@@ -88,7 +116,8 @@ Ext.define('saas.view.core.dbfind.MultiDbfindTrigger', {
                             me.store.loadData(data,false);
                             me.expand();
                         }else{
-                            me.collapse( );
+                            me.store.removeAll();
+                            me.collapse();
                         }
                     },
                     failure: function(response, opts) {}
@@ -138,6 +167,70 @@ Ext.define('saas.view.core.dbfind.MultiDbfindTrigger', {
     },
 
     listeners: {
+        blur:function(f,e){
+            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(!f.value||f.value==''){
+                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,'');
+                            if(me.name==item.to){
+                                me.column.getEditor().setValue('');
+                            }
+                        }
+                    }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){
+                                if(field.xtype=='dbfindtrigger'){
+                                    field.setValue(null);
+                                    field.lastTriggerValue=null;
+                                }else{
+                                    field.setValue(null);
+                                }    
+                            }
+                        }
+                    }
+                }
+            }
+        },
         select:function(combo,record,eOpts){
             var me = combo;
             var dbfinds = me.dbfinds;

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

@@ -89,34 +89,62 @@ Ext.define('saas.view.document.customer.FormPanel', {
         name : "cu_beginaramount", 
         fieldLabel : "期初应收", 
         allowBlank : true, 
-        columnWidth : 0.25
+        columnWidth : 0.25,
+        decimalPrecision: 8,
+        minValue:0,
+        renderer : function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length)).fill('0');
+            var format = '0.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        },
     },{ 
         xtype : "numberfield", 
         hideTrigger:true,
         name : "cu_beginprerecamount", 
         fieldLabel : "期初预收", 
         allowBlank : true, 
-        columnWidth : 0.25    
+        columnWidth : 0.25,
+        decimalPrecision: 8,
+        minValue:0,
+        renderer : function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length)).fill('0');
+            var format = '0.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        },   
     },{
         xtype : "numberfield", 
         name : "cu_taxrate", 
         fieldLabel : "税率", 
         allowBlank : false, 
-        columnWidth : 0.25   
+        columnWidth : 0.25,
+        minValue:0,
+        maxValue:100,
     },{ 
         xtype : "numberfield", 
         hideTrigger:true,
         name : "cu_promisedays", 
         fieldLabel : "承付天数", 
         allowBlank : true, 
-        columnWidth : 0.25        
+        columnWidth : 0.25,
+        decimalPrecision:0,
+        minValue:0
     },{
         xtype : "numberfield", 
         hideTrigger:true,
         name : "cu_credit", 
         fieldLabel : "额度", 
         allowBlank : true, 
-        columnWidth : 0.25
+        columnWidth : 0.25,
+        decimalPrecision: 8,
+        minValue:0,
+        renderer : function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length)).fill('0');
+            var format = '0.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        },
     },{
         xtype : "textfield", 
         name : "cu_sellername", 
@@ -127,30 +155,24 @@ Ext.define('saas.view.document.customer.FormPanel', {
         allowBlank : true, 
         columnWidth : 0.25
     },{
-        xtype : "textfield", 
-        name : "cu_1", 
-        fieldLabel : "纳税人识别号", 
         ignore:true,
-        editable:false,
-        readOnly:true,
+        xtype : "hidden", 
+        name : "cu_nsrzh", 
+        fieldLabel : "纳税人识别号", 
         allowBlank : true, 
         columnWidth : 0.25
     },{
-        xtype : "textfield", 
-        name : "cu_2", 
-        fieldLabel : "开户银行", 
         ignore:true,
-        editable:false,
-        readOnly:true,
+        xtype : "hidden", 
+        name : "cu_bankaccount", 
+        fieldLabel : "开户银行", 
         allowBlank : true, 
         columnWidth : 0.25
     },{
-        xtype : "textfield", 
-        name : "cu_3", 
-        fieldLabel : "银行账户", 
         ignore:true,
-        editable:false,
-        readOnly:true,
+        xtype : "hidden",  
+        name : "cu_bankcode", 
+        fieldLabel : "银行账户", 
         allowBlank : true, 
         columnWidth : 0.25
     },{
@@ -168,7 +190,15 @@ Ext.define('saas.view.document.customer.FormPanel', {
         allowBlank : true, 
         readOnly:true,
         ignore:true,
-        columnWidth : 0.25
+        columnWidth : 0.25,
+        decimalPrecision: 8,
+        minValue:0,
+        renderer : function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length)).fill('0');
+            var format = '0.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        },
     },{
         xtype : "datefield", 
         name : "createTime", 
@@ -246,7 +276,6 @@ Ext.define('saas.view.document.customer.FormPanel', {
             {
                 editor : {
                     displayField : "display", 
-                    editable:false,
                     format : "", 
                     hideTrigger : false, 
                     maxLength : 100.0, 

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

@@ -12,6 +12,8 @@ Ext.define('saas.view.document.product.FormController', {
                         dataUrl:'/api/document/vendor/getVendorsByCondition',
                         //赋值 
                         dbfinds:[{
+                            from:'id',to:'pr_vendid'
+                        },{
                             from:'ve_code',to:'pr_vendcode'
                         },{
                             from:'ve_name',to:'pr_vendname'
@@ -41,7 +43,7 @@ Ext.define('saas.view.document.product.FormController', {
                         dbColumns:[{
                             "text": "供应商ID",
                             "flex": 0,
-                            "dataIndex": "ve_id",
+                            "dataIndex": "id",
                             "width": 0,
                             "xtype": "",
                         },{
@@ -74,6 +76,8 @@ Ext.define('saas.view.document.product.FormController', {
                         dataUrl:'/api/document/warehouse/list',
                         //放大镜赋值设置
                         dbfinds:[{
+                            from:'id',to:'pr_whid',ignore:true
+                        },{
                             from:'wh_code',to:'pr_whcode'
                         },{
                             from:'wh_description',to:'pr_whname'
@@ -105,7 +109,7 @@ Ext.define('saas.view.document.product.FormController', {
                         dbColumns:[{
                             "text": "ID",
                             "flex": 0,
-                            "dataIndex": "wh_id",
+                            "dataIndex": "id",
                             "width": 0,
                             "xtype": "",
                         },{

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

@@ -157,7 +157,21 @@ Ext.define('saas.view.document.product.FormPanel', {
         allowBlank : true, 
         columnWidth : 0.25
     },{
-        xtype : "dbfindtrigger",   
+        xtype : "hidden", 
+        name : "pr_vendid", 
+        bind : "{pr_vendid}", 
+        fieldLabel : "供应商ID", 
+        allowBlank : true, 
+        columnWidth : 0
+    },{
+        xtype : "hidden", 
+        name : "pr_whid", 
+        bind : "{pr_whid}", 
+        fieldLabel : "仓库ID", 
+        allowBlank : true, 
+        columnWidth : 0
+    },{  
+        xtype : "dbfindtrigger",     
         name : "pr_whcode", 
         bind : "{pr_whcode}", 
         fieldLabel : "仓库编号", 
@@ -175,7 +189,15 @@ Ext.define('saas.view.document.product.FormPanel', {
         name : "pr_standardprice", 
         fieldLabel : "标准单价", 
         allowBlank : true, 
-        columnWidth : 0.25
+        columnWidth : 0.25,
+        decimalPrecision: 8,
+        minValue:0,
+        renderer : function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length)).fill('0');
+            var format = '0.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        },
     },{
         ignore:true,
         readOnly:true,

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

@@ -97,28 +97,48 @@ Ext.define('saas.view.document.vendor.FormPanel', {
         name : "ve_beginapamount", 
         fieldLabel : "期初应付", 
         allowBlank : true, 
-        columnWidth : 0.25
+        columnWidth : 0.25,
+        decimalPrecision: 8,
+        minValue:0,
+        renderer : function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length)).fill('0');
+            var format = '0.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        },
     },{ 
         xtype : "numberfield", 
         hideTrigger:true, 
         name : "ve_beginprepayamount", 
         fieldLabel : "期初预付", 
         allowBlank : true, 
-        columnWidth : 0.25    
+        columnWidth : 0.25,
+        decimalPrecision: 8,
+        minValue:0,
+        renderer : function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length)).fill('0');
+            var format = '0.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        },    
     },{
         xtype : "numberfield", 
         name : "ve_taxrate", 
         hideTrigger:true,
         fieldLabel : "税率", 
         allowBlank : false, 
-        columnWidth : 0.25   
+        columnWidth : 0.25,
+        minValue:0,  
+        maxValue:100,
     },{ 
         xtype : "numberfield", 
         hideTrigger:true,
         name : "ve_promisedays", 
         fieldLabel : "承付天数", 
         allowBlank : true, 
-        columnWidth : 0.25      
+        columnWidth : 0.25,
+        minValue:0,
+        decimalPrecision: 0, 
     },{
         xtype : "textfield", 
         name : "ve_nsrzh", 
@@ -159,7 +179,15 @@ Ext.define('saas.view.document.vendor.FormPanel', {
         allowBlank : true, 
         readOnly:true,
         ignore:true,
-        columnWidth : 0.25  
+        columnWidth : 0.25,
+        decimalPrecision: 8,
+        minValue:0,
+        renderer : function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length)).fill('0');
+            var format = '0.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        },  
     }, {
         xtype : "detailGridField", 
         storeModel:'saas.model.document.vendorcontact',

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

@@ -158,7 +158,7 @@ Ext.define('saas.view.purchase.purchase.FormPanelController', {
                             "width": 100,
                         }, {
                             "text": "单位",
-                            "dataIndex": "pr_spec",
+                            "dataIndex": "pr_unit",
                             "width": 100,
                         }, {
                             "text": "最新采购单价",

+ 1 - 1
frontend/saas-web/app/view/purchase/purchaseIn/FormPanelController.js

@@ -157,7 +157,7 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanelController', {
                             "width": 100,
                         }, {
                             "text": "单位",
-                            "dataIndex": "pr_spec",
+                            "dataIndex": "pr_unit",
                             "width": 100,
                         },{
                             "text": "仓库id",

+ 1 - 1
frontend/saas-web/app/view/purchase/purchaseOut/FormPanelController.js

@@ -156,7 +156,7 @@ Ext.define('saas.view.purchase.purchaseOut.FormPanelController', {
                             "width": 100,
                         }, {
                             "text": "单位",
-                            "dataIndex": "pr_spec",
+                            "dataIndex": "pr_unit",
                             "width": 100,
                         },{
                             "text": "仓库id",

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

@@ -156,7 +156,7 @@ Ext.define('saas.view.sale.sale.FormPanelController', {
                             "width": 100,
                         }, {
                             "text": "单位",
-                            "dataIndex": "pr_spec",
+                            "dataIndex": "pr_unit",
                             "width": 100,
                         },{
                             "text": "仓库id",

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

@@ -156,7 +156,7 @@ Ext.define('saas.view.sale.saleIn.FormPanelController', {
                             "width": 100,
                         }, {
                             "text": "单位",
-                            "dataIndex": "pr_spec",
+                            "dataIndex": "pr_unit",
                             "width": 100,
                         },{
                             "text": "仓库id",

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

@@ -154,7 +154,7 @@ Ext.define('saas.view.sale.saleout.FormPanelController', {
                             "width": 100,
                         }, {
                             "text": "单位",
-                            "dataIndex": "pr_spec",
+                            "dataIndex": "pr_unit",
                             "width": 100,
                         },{
                             "text": "仓库id",

+ 1 - 1
frontend/saas-web/app/view/stock/appropriationInOut/FormPanelController.js

@@ -223,7 +223,7 @@ Ext.define('saas.view.stock.appropriationInOut.FormPanelController', {
                             "width": 100,
                         }, {
                             "text": "单位",
-                            "dataIndex": "pr_spec",
+                            "dataIndex": "pr_unit",
                             "width": 100,
                         },{
                             "text": "仓库id",

+ 1 - 1
frontend/saas-web/app/view/stock/make/FormPanelController.js

@@ -219,7 +219,7 @@ Ext.define('saas.view.stock.make.FormPanelController', {
                             "width": 100,
                         }, {
                             "text": "单位",
-                            "dataIndex": "pr_spec",
+                            "dataIndex": "pr_unit",
                             "width": 100,
                         },{
                             "text": "仓库id",

+ 1 - 1
frontend/saas-web/app/view/stock/otherIn/FormPanelController.js

@@ -230,7 +230,7 @@ Ext.define('saas.view.stock.otherIn.FormPanelController', {
                             "width": 100,
                         }, {
                             "text": "单位",
-                            "dataIndex": "pr_spec",
+                            "dataIndex": "pr_unit",
                             "width": 100,
                         },{
                             "text": "仓库id",

+ 1 - 1
frontend/saas-web/app/view/stock/otherOut/FormPanelController.js

@@ -218,7 +218,7 @@ Ext.define('saas.view.stock.otherOut.FormPanelController', {
                             "width": 100,
                         }, {
                             "text": "单位",
-                            "dataIndex": "pr_spec",
+                            "dataIndex": "pr_unit",
                             "width": 100,
                         },{
                             "text": "仓库id",

+ 4 - 0
frontend/saas-web/app/view/sys/config/FormPanel.js

@@ -147,5 +147,9 @@ Ext.define('saas.view.sys.config.FormPanel', {
         });
 
         me.callParent(arguments);
+    },
+
+    refresh:function(){
+        this.ownerCt.setTitle('参数设置')
     }
 });

+ 1 - 1
frontend/saas-web/app/view/sys/finish/DataList.js

@@ -272,7 +272,7 @@ Ext.define('saas.view.sys.finish.DataList', {
     },
 
     refresh:function(){
-        //debugger
+        this.ownerCt.setTitle('结账/反结账')
     }
 
 });