浏览代码

从表获取数据处理时间类型/部分放大镜配置调整

zhuth 7 年之前
父节点
当前提交
3ea42c051d

+ 12 - 0
frontend/saas-web/app/view/core/dbfind/DbfindGridPanel.js

@@ -8,6 +8,7 @@ Ext.define('saas.view.core.dbfind.DbfindGridPanel', {
 
     initComponent: function() {
         var me = this;
+        me.initColumns();
         if(me.columns){
             var fields = me.columns.map(column => column.dataIndex);
             me.store = Ext.create('Ext.data.Store',{
@@ -124,6 +125,17 @@ Ext.define('saas.view.core.dbfind.DbfindGridPanel', {
         }
     },
 
+    initColumns: function() {
+        var me = this,
+        columns = me.columns || [];
+
+        Ext.Array.each(columns, function(c) {
+            Ext.applyIf(c, {
+                width: 200
+            });
+        });
+    },
+
     /**
      * 获得过滤条件
      */

+ 5 - 0
frontend/saas-web/app/view/core/form/field/DetailGridField.js

@@ -428,6 +428,11 @@ Ext.define('saas.view.core.form.field.DetailGridField', {
                 trueData.push(d);
             }else {
                 if(typeof d.id == "number") {
+                    for(k in d) {
+                        if(Ext.isDate(d[k])) {
+                            d[k] = Ext.Date.format(d[k], 'Y-m-d H:i:s');
+                        }
+                    }
                     trueData.push(d);
                 }
             }

+ 128 - 97
frontend/saas-web/app/view/money/othreceipts/FormPanelController.js

@@ -5,115 +5,146 @@ Ext.define('saas.view.money.othreceipts.FormPanelController', {
         var me = this;
         this.control({
             //放大镜赋值关系 以及 tpl模板
-            'dbfindtrigger[name=or_custname]':{
-                beforerender:function(f){
-                    Ext.apply(f,{
-                        dataUrl:'/api/document/customer/dbfind',
+            'dbfindtrigger[name=or_custname]': {
+                beforerender: function (f) {
+                    Ext.apply(f, {
+                        dataUrl: '/api/document/customer/dbfind',
                         addXtype: 'document-customer-formpanel',
                         addTitle: '客户资料',
-                        dbfinds:[{
-                            from:'id',to:'or_custid'
-                        },{
-                            from:'cu_code',to:'or_custcode'
-                        },{
-                            from:'cu_name',to:'or_custname'
+                        defaultCondition: "cu_statuscode='OPEN'",
+                        dbfinds: [{
+                            from: 'id',
+                            to: 'or_custid'
+                        }, {
+                            from: 'cu_code',
+                            to: 'or_custcode'
+                        }, {
+                            from: 'cu_name',
+                            to: 'or_custname'
+                        }],
+                        dbtpls: [{
+                            field: 'cu_code',
+                            width: 100
+                        }, {
+                            field: 'cu_name',
+                            width: 100
                         }],
-                        dbtpls:[{
-                            field:'cu_code',width:100
-                        },{
-                            field:'cu_name',width:100
+                        dbSearchFields: [{
+                            emptyText: '输入客户编号或客户名称',
+                            xtype: "textfield",
+                            name: "search",
+                            getCondition: function (v) {
+                                return "CONCAT(cu_code, cu_name) like '%" + v + "%'";
+                            },
+                            allowBlank: true,
+                            columnWidth: 0.25
                         }],
-                        dbColumns:[
-                            {
-                                conditionCode:'id',
-                                "text": "客户ID",
-                                "flex": 0,
-                                "dataIndex": "id",
-                                "width": 0,
-                                "xtype": "",
-                                "items": null
-                            },{
-                                conditionCode:'cu_code',
-                                "text": "客户编号",
-                                "flex": 1,
-                                "dataIndex": "cu_code",
-                                "width": 100,
-                                "xtype": "",
-                                "items": null
-                            }, {
-                                conditionCode:'cu_name',
-                                "text": "客户名称",
-                                "flex": 1,
-                                "dataIndex": "cu_name",
-                                "xtype": "",
-                                "items": null
-                            }, {
-                                conditionCode:'cu_type',
-                                "text": "客户类型",
-                                "flex": 1,
-                                "dataIndex": "cu_type",
-                                "width": 200,
-                                "xtype": "",
-                                "items": null
-                            }, {
-                                "text": "业务员编号",
-                                "flex": 1,
-                                "dataIndex": "cu_sellercode",
-                                "width": 100
-                            }, {
-                                "text": "业务员",
-                                "flex": 1,
-                                "dataIndex": "cu_sellername",
-                                "width": 100
-                            }, {
-                                "text": "税率",
-                                "flex": 1,
-                                "dataIndex": "cu_taxrate",
-                                "width": 100
-                            }, {
-                                "text": "承付天数",
-                                "flex": 1,
-                                "dataIndex": "cu_promisedays",
-                                "width": 100
-                            }, {
-                                "text": "额度",
-                                "flex": 1,
-                                "dataIndex": "cu_credit",
-                                "width": 100
-                            }, {
-                                "text": "客户地址",
-                                "flex": 1,
-                                "dataIndex": "ca_address",
-                                "width": 250
-                            }]
-                    }) ;   
+                        dbColumns: [{
+                            conditionCode: 'id',
+                            "text": "客户ID",
+                            "flex": 0,
+                            "dataIndex": "id",
+                            "width": 0,
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            conditionCode: 'cu_code',
+                            "text": "客户编号",
+                            "flex": 1,
+                            "dataIndex": "cu_code",
+                            "width": 100,
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            conditionCode: 'cu_name',
+                            "text": "客户名称",
+                            "flex": 1,
+                            "dataIndex": "cu_name",
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            conditionCode: 'cu_type',
+                            "text": "客户类型",
+                            "flex": 1,
+                            "dataIndex": "cu_type",
+                            "width": 200,
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            "text": "业务员编号",
+                            "flex": 1,
+                            "dataIndex": "cu_sellercode",
+                            "width": 100
+                        }, {
+                            "text": "业务员",
+                            "flex": 1,
+                            "dataIndex": "cu_sellername",
+                            "width": 100
+                        }, {
+                            "text": "税率",
+                            "flex": 1,
+                            "dataIndex": "cu_taxrate",
+                            "width": 100
+                        }, {
+                            "text": "承付天数",
+                            "flex": 1,
+                            "dataIndex": "cu_promisedays",
+                            "width": 100
+                        }, {
+                            "text": "额度",
+                            "flex": 1,
+                            "dataIndex": "cu_credit",
+                            "width": 100
+                        }, {
+                            "text": "客户地址",
+                            "flex": 1,
+                            "dataIndex": "ca_address",
+                            "width": 250
+                        }]
+                    });
 
                 }
-          },
+            },
             //放大镜赋值关系 以及 tpl模板
-            'dbfindtrigger[name=or_bankname]':{
-                beforerender:function(f){
-                    Ext.apply(f,{
-                        dataUrl:'/api/document/bankinformation/list',
-                        dbfinds:[{
-                            from:'bk_bankcode',to:'or_bankcode'
-                        },{
-                            from:'bk_bankname',to:'or_bankname'
-                        },{
-                            from:'id',to:'or_bankid'
-                    }],
-                        dbtpls:[{
-                            field:'bk_bankcode',width:100
-                        },{
-                            field:'bk_bankname',width:100
+            'dbfindtrigger[name=or_bankname]': {
+                beforerender: function (f) {
+                    Ext.apply(f, {
+                        dataUrl: '/api/document/bankinformation/list',
+                        dbfinds: [{
+                            from: 'bk_bankcode',
+                            to: 'or_bankcode'
+                        }, {
+                            from: 'bk_bankname',
+                            to: 'or_bankname'
+                        }, {
+                            from: 'id',
+                            to: 'or_bankid'
                         }],
-                        dbColumns:[{
+                        // defaultCondition: "bk_statuscode='OPEN'",
+                        dbtpls: [{
+                            field: 'bk_bankcode',
+                            width: 100
+                        }, {
+                            field: 'bk_bankname',
+                            width: 100
+                        }],
+                        dbSearchFields: [{
+                            emptyText: '输入银行账户编号或名称',
+                            xtype: "textfield",
+                            name: "search",
+                            getCondition: function (v) {
+                                return "CONCAT(bk_bankcode, bk_bankname) like '%" + v + "%'";
+                            },
+                            allowBlank: true,
+                            columnWidth: 0.25
+                        }],
+                        dbColumns: [{
                             "text": "账户ID",
                             "flex": 0,
                             "dataIndex": "id",
                             "width": 0,
                             "xtype": ""
-                        },{
+                        }, {
                             "text": "账户编号",
                             "flex": 1,
                             "dataIndex": "bk_bankcode",
@@ -144,7 +175,7 @@ Ext.define('saas.view.money.othreceipts.FormPanelController', {
                             "width": 120,
                             "xtype": "datecolumn"
                         }]
-                    }) ;   
+                    });
 
                 }
             }

+ 1 - 2
frontend/saas-web/app/view/money/othreceipts/QueryPanel.js

@@ -80,8 +80,7 @@ Ext.define('saas.view.money.othreceipts.QueryPanel', {
         }, {
             text: '备注',
             dataIndex: 'or_remark',
-            width: 250,
-            flex: 1
+            width: 250
         }],
         relativeColumn: []
     }

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

@@ -29,74 +29,44 @@ Ext.define('saas.view.purchase.purchase.FormPanelController', {
                         dbtplfield:"ve_name",
                         //放大镜窗口字段
                         dbSearchFields:[{
+                            emptyText:'输入供应商编号或名称',
                             xtype : "textfield", 
-                            name : "ve_name", 
-                            fieldLabel : "供应商名称", 
+                            name : "search", 
+                            getCondition: function(v) {
+                                return "CONCAT(ve_code, ve_name) like '%" + v + "%'";
+                            },
+                            allowBlank : true, 
                             columnWidth : 0.25
                         }],
                         //放大镜窗口列表
                         dbColumns:[{
                             "text": "供应商ID",
-                            "flex": 0,
+                            "hidden": true,
                             "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": 50,
-                            "xtype": "",
-                            "items": null
                         },{
                             "text": "税率",
-                            "flex": 0,
                             "dataIndex": "ve_taxrate",
-                            "width": 50,
-                            "xtype": "",
-                            "items": null
                         },{
                             "text": "承付天数",
-                            "flex": 0,
                             "dataIndex": "ve_promisedays",
-                            "width": 50,
-                            "xtype": "",
-                            "items": null
                         },{
                             "text": "纳税人识别号",
-                            "flex": 0,
                             "dataIndex": "ve_nsrzh",
-                            "width": 200,
-                            "xtype": "",
-                            "items": null
                         },{
                             "text": "开户银行",
-                            "flex": 0,
                             "dataIndex": "ve_bankcode",
-                            "width": 200,
-                            "xtype": "",
-                            "items": null
                         },{
                             "text": "银行账户",
-                            "flex": 0,
                             "dataIndex": "ve_bankaccount",
-                            "width": 200,
-                            "xtype": "",
-                            "items": null
                         }]
                     }) ;   
 
@@ -128,8 +98,6 @@ Ext.define('saas.view.purchase.purchase.FormPanelController', {
                         },{
                             from:'pr_spec',to:'pr_spec'
                         }],
-                        //联想查询条件
-                        dbCondition:"CONCAT(pr_code, pr_detail) like '{0}%'",
                         //联想设置
                         dbtpls:[{
                             field:'pr_code',width:100
@@ -141,38 +109,25 @@ Ext.define('saas.view.purchase.purchase.FormPanelController', {
                             emptyText:'输入物料编号或物料名称',
                             xtype : "textfield", 
                             name : "search", 
-                            conditionExpression:"CONCAT(pr_code, pr_detail) like '{0}%'",
+                            getCondition: function(v) {
+                                return "CONCAT(pr_code, pr_detail) like '%"+v+"%'";
+                            },
                             allowBlank : true, 
                             columnWidth : 0.25
                         }],
                         //窗口列设置
                         dbColumns:[{
                             "text": "物料ID",
-                            "flex": 0,
                             "dataIndex": "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
                         }]
                     }) ;   
 

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

@@ -27,6 +27,16 @@ Ext.define('saas.view.sale.sale.FormPanelController', {
                         },{
                             field:'cu_name',width:100
                         }],
+                        dbSearchFields:[{
+                            emptyText:'输入客户编号或客户名称',
+                            xtype : "textfield", 
+                            name : "search", 
+                            getCondition: function(v) {
+                                return "CONCAT(cu_code, cu_name) like '%" + v + "%'";
+                            },
+                            allowBlank : true, 
+                            columnWidth : 0.25
+                        }],
                         dbColumns:[
                             {
                                 conditionCode:'id',

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

@@ -11,6 +11,7 @@ Ext.define('saas.view.sale.saleIn.FormPanelController', {
                         dataUrl:'/api/document/customer/dbfind',
                         addXtype: 'document-customer-formpanel',
                         addTitle: '客户资料',
+                        defaultCondition:"cu_statuscode='OPEN'",
                         dbfinds:[
                             {
                                 from:'id',to:'pi_custid'
@@ -27,6 +28,16 @@ Ext.define('saas.view.sale.saleIn.FormPanelController', {
                         },{
                             field:'cu_name',width:100
                         }],
+                        dbSearchFields:[{
+                            emptyText:'输入客户编号或客户名称',
+                            xtype : "textfield", 
+                            name : "search", 
+                            getCondition: function(v) {
+                                return "CONCAT(cu_code, cu_name) like '%" + v + "%'";
+                            },
+                            allowBlank : true, 
+                            columnWidth : 0.25
+                        }],
                         dbColumns:[
                         {
                             conditionCode:'id',

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

@@ -12,6 +12,7 @@ Ext.define('saas.view.sale.saleout.FormPanelController', {
                         dataUrl:'/api/document/customer/dbfind',
                         addXtype: 'document-customer-formpanel',
                         addTitle: '客户资料',
+                        defaultCondition:"cu_statuscode='OPEN'",
                         dbfinds:[
                         {
                             from:'id',to:'pi_custid'
@@ -28,6 +29,16 @@ Ext.define('saas.view.sale.saleout.FormPanelController', {
                         },{
                             field:'cu_name',width:100
                         }],
+                        dbSearchFields:[{
+                            emptyText:'输入客户编号或客户名称',
+                            xtype : "textfield", 
+                            name : "search", 
+                            getCondition: function(v) {
+                                return "CONCAT(cu_code, cu_name) like '%" + v + "%'";
+                            },
+                            allowBlank : true, 
+                            columnWidth : 0.25
+                        }],
                         dbColumns:[
                             {
                                 "text": "客户ID",