Przeglądaj źródła

Merge remote-tracking branch 'origin/dev' into dev

heqinwei 7 lat temu
rodzic
commit
af52c34fc1

+ 82 - 94
frontend/saas-web/app/view/core/query/QueryPanel.js

@@ -146,120 +146,99 @@ Ext.define('saas.view.core.query.QueryPanel', {
     /**
      * 获得过滤条件
      */
-    getConditions: function(moreQuery) {
+    getConditions: function() {
         var me = this,
-        formItems = me.queryFormItems,
-        moreQueryFormItems = me.moreQueryFormItems,
+        formItems = me.items.items[0].items.items,
         viewModel = me.getViewModel(),
         viewModelData = viewModel.getData(),
         bindItems = viewModelData['form'],
-        moreItems = viewModelData['moreForm'],
         condition,
         conditions = [];
 
-        if(moreQuery) {
-            for(k in moreItems) {
-                var item = Ext.Array.findBy(moreQueryFormItems, function(i) {
-                    return i.name == k;
-                });
-                var field = item.name,
-                func = item.getCondition,
-                value = moreItems[k],
-                condition;
-    
-                if(value&&value!=''){
-                    if(typeof func == 'function') {
-                        condition = {
-                            type: 'condition',
-                            value: func(value)
-                        }
-                    }else {
-                        var xtype = item.xtype || 'textfield',
-                        type = item.fieldType || me.getDefaultFieldType(xtype),
-                        operation = item.operation || me.getDefaultFieldOperation(xtype),
-                        conditionValue = me.getConditionValue(xtype, value);
-            
-                        if(!conditionValue) {
-                            continue;
-                        }
-                        condition = {
-                            type: type,
-                            field: field,
-                            operation: operation,
-                            value: conditionValue
-                        }
+        for(k in bindItems) {
+            var item = Ext.Array.findBy(formItems, function(i) {
+                return i.name == k;
+            });
+            var field = item.name,
+            func = item.getCondition,
+            value = bindItems[k],
+            condition;
+
+            if(value&&value!=''){
+                if(typeof func == 'function') {
+                    condition = {
+                        type: 'condition',
+                        value: func(value)
                     }
-                    conditions.push(condition);
-                }
-            }
-        }else {
-            for(k in bindItems) {
-                var item = Ext.Array.findBy(formItems, function(i) {
-                    return i.name == k;
-                });
-                var field = item.name,
-                func = item.getCondition,
-                value = bindItems[k],
-                condition;
-    
-                if(value&&value!=''){
-                    if(typeof func == 'function') {
-                        condition = {
-                            type: 'condition',
-                            value: func(value)
-                        }
-                    }else {
-                        var xtype = item.xtype || 'textfield',
-                        type = item.fieldType || me.getDefaultFieldType(xtype),
-                        operation = item.operation || me.getDefaultFieldOperation(xtype),
-                        conditionValue = me.getConditionValue(xtype, value);
-            
-                        if(!conditionValue) {
-                            continue;
-                        }
-                        condition = {
-                            type: type,
-                            field: field,
-                            operation: operation,
-                            value: conditionValue
-                        }
+                }else {
+                    var type = item.fieldType || me.getDefaultFieldType(item),
+                    operation = item.operation || me.getDefaultFieldOperation(item),
+                    conditionValue = me.getConditionValue(item, value);
+        
+                    if(!conditionValue) {
+                        continue;
+                    }
+                    condition = {
+                        type: type,
+                        field: field,
+                        operation: operation,
+                        value: conditionValue
                     }
-                    conditions.push(condition);
                 }
+                conditions.push(condition);
             }
         }
 
         return conditions;
     },
 
-    getDefaultFieldType: function(xtype) {
-        var type;
+    /**
+     * 只要arr1和arr2中存在相同项即返回真
+     */
+    isContainsAny: function (arr1, arr2) {
+        for (var i = 0; i < arr2.length; i++) {
+            var a2 = arr2[i];
+            if (!!arr1.find(function (a1) {
+                    return a1 == a2
+                })) {
+                return true;
+            }
+        }
+        return false;
+    },
 
-        if(Ext.Array.contains(['numberfield'], xtype)) {
+    getDefaultFieldType: function (field) {
+        var me = this,
+            xtypes = field.getXTypes().split('/'),
+            type;
+
+        if (me.isContainsAny(xtypes, ['numberfield'])) {
             type = 'number';
-        }else if(Ext.Array.contains(['datefield', 'condatefield'], xtype)) {
+        } else if (me.isContainsAny(xtypes, ['datefield', 'condatefield', 'conmonthfield'])) {
             type = 'date';
-        }else if(Ext.Array.contains(['combobox', 'multicombo', 'combo', 'radiofield', 'radio'], xtype)) {
+        } else if (me.isContainsAny(xtypes, ['dbfindtrigger'])) {
+            type = 'enum';
+        } else if (me.isContainsAny(xtypes, ['combobox', 'multicombo', 'combo', 'radiofield', 'radio'])) {
             type = 'enum';
-        }else {
+        } else {
             type = 'string';
         }
 
         return type;
     },
 
-    getDefaultFieldOperation: function(xtype) {
-        var operation;
+    getDefaultFieldOperation: function (field) {
+        var me = this,
+            xtypes = field.getXTypes().split('/'),
+            operation;
 
-        if(Ext.Array.contains(['numberfield'], xtype)) {
-            operation = '=';
-        }else if(Ext.Array.contains(['datefield'], xtype)) {
+        if (me.isContainsAny(xtypes, ['numberfield', 'datefield', 'dbfindtrigger'])) {
             operation = '=';
-        }else if(Ext.Array.contains(['condatefield'], xtype)) {
+        } else if (me.isContainsAny(xtypes, ['condatefield', 'conmonthfield'])) {
             operation = 'between';
-        }else if(Ext.Array.contains(['combobox', 'multicombo', 'combo'], xtype)) {
+        } else if (me.isContainsAny(xtypes, ['multidbfindtrigger', 'combobox', 'multicombo', 'combo'])) {
             operation = 'in';
-        }else {
+        } else {
             operation = 'like';
         }
 
@@ -269,22 +248,31 @@ Ext.define('saas.view.core.query.QueryPanel', {
     /**
      * 处理部分字段值
      */
-    getConditionValue: function(xtype, value) {
-        var conditionValue;
-        if(xtype == 'datefield') {
+    getConditionValue: function (field, value) {
+        var me = this,
+            xtypes = field.getXTypes().split('/'),
+            conditionValue;
+        if (me.isContainsAny(xtypes, ['datefield'])) {
             conditionValue = Ext.Date.format(new Date(from), 'Y-m-d H:i:s');
-        }else if(xtype == 'condatefield') {
+        } else if (me.isContainsAny(xtypes, ['conmonthfield'])) {
             var from = value.from,
-            to = value.to;
+                to = value.to;
+
+            conditionValue = from + ',' + to;
+        } else if (me.isContainsAny(xtypes, ['condatefield'])) {
+            var from = value.from,
+                to = value.to;
 
             conditionValue = Ext.Date.format(new Date(from), 'Y-m-d 00:00:00') + ',' + Ext.Date.format(new Date(to), 'Y-m-d 23:59:59');
-        }else if(xtype == 'combobox' || xtype == 'combo') {
+        } else if (me.isContainsAny(xtypes, ['dbfindtrigger'])) {
+            conditionValue = value;
+        } else if (me.isContainsAny(xtypes, ['combobox', 'combo'])) {
             conditionValue = '\'' + value + '\'';
-        }else if(xtype == 'multicombo') {
-            conditionValue = value.map(function(v) {
+        } else if (me.isContainsAny(xtypes, ['multicombo'])) {
+            conditionValue = value.map ? value.map(function (v) {
                 return '\'' + v.value + '\'';
-            }).join(',');
-        }else {
+            }).join(',') : '';
+        } else {
             conditionValue = value;
         }
 

+ 3 - 2
frontend/saas-web/app/view/core/report/ReportPanel.js

@@ -164,7 +164,8 @@ Ext.define('saas.view.core.report.ReportPanel', {
             ftype: 'groupingsummary',
             hideGroupedHeader: false,
             enableGroupingMenu: false,
-            collapsible: false
+            collapsible: false,
+            groupHeaderTpl: me.groupHeaderTpl || '{columnName}: {name}'
         }];
 
         if (me.showMySummary) {
@@ -533,7 +534,7 @@ Ext.define('saas.view.core.report.ReportPanel', {
         } else if (me.isContainsAny(xtypes, ['datefield', 'condatefield', 'conmonthfield'])) {
             type = 'date';
         } else if (me.isContainsAny(xtypes, ['dbfindtrigger'])) {
-            type = 'string';
+            type = 'enum';
         } else if (me.isContainsAny(xtypes, ['combobox', 'multicombo', 'combo', 'radiofield', 'radio'])) {
             type = 'enum';
         } else {

+ 42 - 0
frontend/saas-web/app/view/document/address/DataList.js

@@ -7,6 +7,7 @@ Ext.define('saas.view.document.address.DataList', {
     viewModel: 'document-address-datalist',
     defaultType:'address',
     windowType:'document-address-window',
+    _openUrl:'api/',
     tbar: ['->',{
         xtype:'button',
         text:'新增',
@@ -26,6 +27,47 @@ Ext.define('saas.view.document.address.DataList', {
                 text: '地址名称',
                 dataIndex: 'ad_address',
                 flex: 1
+            },{
+                text: '采购默认地址',
+                dataIndex: 'ad_default',
+                width:160,
+                xtype: 'actioncolumn',
+                align : 'center',
+                items: [{
+                    iconCls:'',
+                    getClass: function(v, meta, rec) {
+                        if(rec.get('ad_default')==1){
+                            return 'x-grid-checkcolumn-checked-btn';
+                        }else{
+                            return 'x-grid-checkcolumn-btn';
+                        }
+                    },
+                    handler: function(view, rowIndex, colIndex) {
+                        var rec = view.getStore().getAt(rowIndex);
+                        var type=rec.get('ad_default')==1?true:false;
+                        if(type){
+                            saas.util.BaseUtil.showErrorToast('请启用其它未设置的地址');
+                            return;
+                        }
+                        // 启用
+                        var form = this.ownerCt.ownerCt.ownerCt;
+                        var grid = this.ownerCt.ownerCt;
+                        saas.util.BaseUtil.request({
+                            url: form._openUrl+'/'+rec.get('id'),
+                            method: 'POST',
+                        })
+                        .then(function(localJson) {
+                            if(localJson.success){
+                                saas.util.BaseUtil.showSuccessToast('操作成功');
+                                grid.store.load();
+                            }
+                        })
+                        .catch(function(res) {
+                            console.error(res);
+                            saas.util.BaseUtil.showErrorToast('操作失败: ' + res.message);
+                        });
+                    }
+                }]
             }],
             keyField:'id',
             reqUrl: '/api/document/address/save',

+ 2 - 1
frontend/saas-web/app/view/document/address/DataListModel.js

@@ -8,7 +8,8 @@ Ext.define('saas.view.document.address.DataListModel', {
         address: {
             fields:[
                 {name: 'id', type: 'int'},
-                {name: 'ad_address',  type: 'string'}
+                {name: 'ad_address',  type: 'string'},
+                {name: 'ad_default',  type: 'int'}
             ],
             proxy: {
                 type: 'ajax',

+ 2 - 1
frontend/saas-web/app/view/money/report/AccountBalance.js

@@ -7,7 +7,8 @@ Ext.define('saas.view.money.report.AccountBalance', {
 
     viewName: 'money-report-accountbalance',
 
-    groupField: 'bankname',
+    groupField: 'bankcode',
+    groupHeaderTpl: '账户名称: {[values.rows[0].data.bankname]}',
     listUrl: '/api/money/report/accountBalance',
     defaultCondition: null,
     reportTitle: '账户收支明细表',

+ 2 - 1
frontend/saas-web/app/view/money/report/OtherIODetail.js

@@ -10,7 +10,8 @@ Ext.define('saas.view.money.report.OtherIODetail', {
 
     viewName: 'money-report-otheriodetail',
 
-    groupField: 'bl_bankname',
+    groupField: 'bl_bankcode',
+    groupHeaderTpl: '资金账户: {[values.rows[0].data.bankname]}',
     listUrl: '/api/money/report/otheriodetail',
     defaultCondition: null,
     reportTitle: '其他收支明细表',

+ 118 - 118
frontend/saas-web/app/view/money/report/PayDetail.js

@@ -6,7 +6,8 @@ Ext.define('saas.view.money.report.PayDetail', {
     viewModel: 'money-report-paydetail',
     viewName: 'money-report-paydetail',
 
-    groupField:'pd_vendname',
+    groupField:'pd_vendcode',
+    groupHeaderTpl: '供应商名称: {[values.rows[0].data.pd_vendcode]}',
     listUrl: '/api/money/report/payDetail',
     defaultCondition: null,
     reportTitle: '应付账款明细表',
@@ -26,125 +27,124 @@ Ext.define('saas.view.money.report.PayDetail', {
         columnWidth: 0.5
     }],
 
-    reportColumns: [
-        {
-            text: 'id',
-            dataIndex: 'pd_id',
-            hidden: true
-        }, {
-            text: '单据日期',
-            xtype: 'datecolumn',
-            dataIndex: 'pd_date',
-            width: 110
-        }, {
-            text: '单号',
-            dataIndex: 'pd_code',
-            width: 150
-        }, {
-            text: '单据类型',
-            dataIndex: 'pd_kind',
-            width: 110
-        }, {
-            text:'供应商编号',
-            dataIndex:'pd_vendcode',
-            width: 150,
-            hidden: true
-        },{
-            text:'供应商名称',
-            width: 200,
-            dataIndex:'pd_vendname',
-            hidden: true
-        },{
-            text: '采购员',
-            dataIndex: 'pd_buyername',
-            width: 110
-        },{
-            text: '增加应付',
-            xtype: 'numbercolumn',
-            dataIndex: 'pd_addpay',
-            xtype: 'numbercolumn',
-            width: 180,
-            renderer : function(v) {
-                var arr = (v + '.').split('.');
-                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                var format = '0,000.' + xr.join();
-                return Ext.util.Format.number(v, format);
-            },
-            summaryType: 'sum',
-            summaryRenderer: function(v) {
-                var arr = (v + '.').split('.');
-                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                var format = '0,000.' + xr.join();
-                return Ext.util.Format.number(v, format);
-            }
-        }, {
-            text: '增加预付',
-            xtype: 'numbercolumn',
-            dataIndex: 'pd_addpre',
-            xtype: 'numbercolumn',
-            width: 180,
-            renderer : function(v) {
-                var arr = (v + '.').split('.');
-                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                var format = '0,000.' + xr.join();
-                return Ext.util.Format.number(v, format);
-            },
-            summaryType: 'sum',
-            summaryRenderer: function(v) {
-                var arr = (v + '.').split('.');
-                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                var format = '0,000.' + xr.join();
-                return Ext.util.Format.number(v, format);
-            }
-        }, {
-            text: '应付余额',
-            xtype: 'numbercolumn',
-            dataIndex: 'pd_remain',
-            xtype: 'numbercolumn',
-            width: 110,
-            renderer : function(v) {
-                var arr = (v + '.').split('.');
-                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                var format = '0,000.' + xr.join();
-                return Ext.util.Format.number(v, format);
-            },
-            summaryType: 'last',
-            summaryRenderer: function(v) {
-                var arr = (v + '.').split('.');
-                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                var format = '0,000.' + xr.join();
-                return Ext.util.Format.number(v, format);
-            },
-            mySummaryRenderer: function(grid, column, datas) {
-                var store = grid.store,
-                dataIndex = column.dataIndex,
-                groupField = store.getGroupField(),
-                count = datas.length,
-                data = datas,
-                lasts = {},
-                keys = [],
-                arr = [];
+    reportColumns: [{
+        text: 'id',
+        dataIndex: 'pd_id',
+        hidden: true
+    }, {
+        text: '单据日期',
+        xtype: 'datecolumn',
+        dataIndex: 'pd_date',
+        width: 110
+    }, {
+        text: '单号',
+        dataIndex: 'pd_code',
+        width: 150
+    }, {
+        text: '单据类型',
+        dataIndex: 'pd_kind',
+        width: 110
+    }, {
+        text:'供应商编号',
+        dataIndex:'pd_vendcode',
+        width: 150,
+        hidden: true
+    },{
+        text:'供应商名称',
+        width: 200,
+        dataIndex:'pd_vendname',
+        hidden: true
+    },{
+        text: '采购员',
+        dataIndex: 'pd_buyername',
+        width: 110
+    },{
+        text: '增加应付',
+        xtype: 'numbercolumn',
+        dataIndex: 'pd_addpay',
+        xtype: 'numbercolumn',
+        width: 180,
+        renderer : function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+            var format = '0,000.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        },
+        summaryType: 'sum',
+        summaryRenderer: function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+            var format = '0,000.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        }
+    }, {
+        text: '增加预付',
+        xtype: 'numbercolumn',
+        dataIndex: 'pd_addpre',
+        xtype: 'numbercolumn',
+        width: 180,
+        renderer : function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+            var format = '0,000.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        },
+        summaryType: 'sum',
+        summaryRenderer: function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+            var format = '0,000.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        }
+    }, {
+        text: '应付余额',
+        xtype: 'numbercolumn',
+        dataIndex: 'pd_remain',
+        xtype: 'numbercolumn',
+        width: 110,
+        renderer : function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+            var format = '0,000.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        },
+        summaryType: 'last',
+        summaryRenderer: function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+            var format = '0,000.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        },
+        mySummaryRenderer: function(grid, column, datas) {
+            var store = grid.store,
+            dataIndex = column.dataIndex,
+            groupField = store.getGroupField(),
+            count = datas.length,
+            data = datas,
+            lasts = {},
+            keys = [],
+            arr = [];
 
-                for(var i = 0; i < count; i++) {
-                    var d = data[i];
-                    var n = Number(d[dataIndex]);
-                    var v = isNaN(n) ? 0 : n;
+            for(var i = 0; i < count; i++) {
+                var d = data[i];
+                var n = Number(d[dataIndex]);
+                var v = isNaN(n) ? 0 : n;
 
-                    lasts[groupField] = v;
-                }
+                lasts[groupField] = v;
+            }
 
-                keys = Ext.Object.getAllKeys(lasts);
-                arr = keys.map(function(key) {
-                    return lasts[key];
-                });
+            keys = Ext.Object.getAllKeys(lasts);
+            arr = keys.map(function(key) {
+                return lasts[key];
+            });
 
-                return Ext.Array.sum(arr);
-            }
-        }, {
-            text: '供应商名称',
-            dataIndex: 'pd_vendname',
-            hidden:true
-        }, {
-            flex: 1
-        }]
+            return Ext.Array.sum(arr);
+        }
+    }, {
+        text: '供应商名称',
+        dataIndex: 'pd_vendname',
+        hidden:true
+    }, {
+        flex: 1
+    }]
 });

+ 124 - 124
frontend/saas-web/app/view/money/report/RecDetail.js

@@ -7,7 +7,8 @@ Ext.define('saas.view.money.report.RecDetail', {
 
     viewName: 'money-report-recdetail',
 
-    groupField: 'rd_custname',
+    groupField: 'rd_custcode',
+    groupHeaderTpl: '客户名称: {[values.rows[0].data.rd_custname]}',
     listUrl: '/api/money/report/recDetail',
     defaultCondition: null,
     reportTitle: '应收账款明细',
@@ -27,131 +28,130 @@ Ext.define('saas.view.money.report.RecDetail', {
         columnWidth: 0.5
     }],
 
-    reportColumns: [
-        {
-            text: 'id',
-            dataIndex: 'rd_id',
-            hidden: true
-        }, {
-            text: '单据日期',
-            xtype: 'datecolumn',
-            dataIndex: 'rd_date',
-            width: 110
-        }, {
-            text: '单号',
-            dataIndex: 'rd_code',
-            width: 150
-        }, {
-            text: '单据类型',
-            dataIndex: 'rd_kind',
-            width: 110
-        },{
-            text: '客户编号',
-            dataIndex: 'pi_custcode',
-            width: 150,
-            hidden: true
-        }, {
-            text: '客户名称',
-            dataIndex: 'pi_custname',
-            width: 200,
-            hidden: true
-        },{
-            text: '业务员',
-            dataIndex: 'rd_sellername',
-            width: 110
-        }, {
-            text: '序号',
-            dataIndex: 'rd_detno',
-            xtype: 'numbercolumn',
-            width: 80,
-            hidden: true
-        },{
-            text:'增加应收',
-            dataIndex:'rd_addrec',
-            xtype: 'numbercolumn',
-            width: 110,
-            renderer : function(v) {
-                var arr = (v + '.').split('.');
-                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                var format = '0,000.' + xr.join();
-                return Ext.util.Format.number(v, format);
-            },
-            summaryType: 'sum',
-            summaryRenderer: function(v) {
-                var arr = (v + '.').split('.');
-                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                var format = '0,000.' + xr.join();
-                return Ext.util.Format.number(v, format);
-            }
-        },{
-            text:'增加预收',
-            xtype: 'numbercolumn',
-            dataIndex:'rd_addpre',
-            xtype: 'numbercolumn',
-            width: 180,
-            renderer : function(v) {
-                var arr = (v + '.').split('.');
-                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                var format = '0,000.' + xr.join();
-                return Ext.util.Format.number(v, format);
-            },
-            summaryType: 'sum',
-            summaryRenderer: function(v) {
-                var arr = (v + '.').split('.');
-                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                var format = '0,000.' + xr.join();
-                return Ext.util.Format.number(v, format);
-            }
-        },{
-            text: '应收余额',
-            xtype: 'numbercolumn',
-            dataIndex: 'rd_remain',
-            xtype: 'numbercolumn',
-            width: 110,
-            renderer : function(v) {
-                var arr = (v + '.').split('.');
-                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                var format = '0,000.' + xr.join();
-                return Ext.util.Format.number(v, format);
-            },
-            summaryType: 'last',
-            summaryRenderer: function(v) {
-                var arr = (v + '.').split('.');
-                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                var format = '0,000.' + xr.join();
-                return Ext.util.Format.number(v, format);
-            },
-            mySummaryRenderer: function(grid, column, datas) {
-                datas = datas || [];
-                var store = grid.store,
-                dataIndex = column.dataIndex,
-                groupField = store.getGroupField(),
-                count = datas.length,
-                data = datas,
-                lasts = {},
-                keys = [],
-                arr = [];
+    reportColumns: [{
+        text: 'id',
+        dataIndex: 'rd_id',
+        hidden: true
+    }, {
+        text: '单据日期',
+        xtype: 'datecolumn',
+        dataIndex: 'rd_date',
+        width: 110
+    }, {
+        text: '单号',
+        dataIndex: 'rd_code',
+        width: 150
+    }, {
+        text: '单据类型',
+        dataIndex: 'rd_kind',
+        width: 110
+    },{
+        text: '客户编号',
+        dataIndex: 'pi_custcode',
+        width: 150,
+        hidden: true
+    }, {
+        text: '客户名称',
+        dataIndex: 'pi_custname',
+        width: 200,
+        hidden: true
+    },{
+        text: '业务员',
+        dataIndex: 'rd_sellername',
+        width: 110
+    }, {
+        text: '序号',
+        dataIndex: 'rd_detno',
+        xtype: 'numbercolumn',
+        width: 80,
+        hidden: true
+    },{
+        text:'增加应收',
+        dataIndex:'rd_addrec',
+        xtype: 'numbercolumn',
+        width: 110,
+        renderer : function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+            var format = '0,000.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        },
+        summaryType: 'sum',
+        summaryRenderer: function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+            var format = '0,000.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        }
+    },{
+        text:'增加预收',
+        xtype: 'numbercolumn',
+        dataIndex:'rd_addpre',
+        xtype: 'numbercolumn',
+        width: 180,
+        renderer : function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+            var format = '0,000.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        },
+        summaryType: 'sum',
+        summaryRenderer: function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+            var format = '0,000.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        }
+    },{
+        text: '应收余额',
+        xtype: 'numbercolumn',
+        dataIndex: 'rd_remain',
+        xtype: 'numbercolumn',
+        width: 110,
+        renderer : function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+            var format = '0,000.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        },
+        summaryType: 'last',
+        summaryRenderer: function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+            var format = '0,000.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        },
+        mySummaryRenderer: function(grid, column, datas) {
+            datas = datas || [];
+            var store = grid.store,
+            dataIndex = column.dataIndex,
+            groupField = store.getGroupField(),
+            count = datas.length,
+            data = datas,
+            lasts = {},
+            keys = [],
+            arr = [];
 
-                for(var i = 0; i < count; i++) {
-                    var d = data[i];
-                    var n = Number(d[dataIndex]);
-                    var v = isNaN(n) ? 0 : n;
+            for(var i = 0; i < count; i++) {
+                var d = data[i];
+                var n = Number(d[dataIndex]);
+                var v = isNaN(n) ? 0 : n;
 
-                    lasts[groupField] = v;
-                }
+                lasts[groupField] = v;
+            }
 
-                keys = Ext.Object.getAllKeys(lasts);
-                arr = keys.map(function(key) {
-                    return lasts[key];
-                });
+            keys = Ext.Object.getAllKeys(lasts);
+            arr = keys.map(function(key) {
+                return lasts[key];
+            });
 
-                return Ext.Array.sum(arr);
-            }
-        }, {
-            text: '客户名称',
-            dataIndex: 'rd_custname',
-            hidden:true
-        }, {
-            flex: 1
-        }]
+            return Ext.Array.sum(arr);
+        }
+    }, {
+        text: '客户名称',
+        dataIndex: 'rd_custname',
+        hidden:true
+    }, {
+        flex: 1
+    }]
 });

+ 29 - 27
frontend/saas-web/app/view/money/report/TotalPayDetail.js

@@ -41,10 +41,17 @@ Ext.define('saas.view.money.report.TotalPayDetail', {
         text: '供应商名称',
         dataIndex: 'vm_vendname',
         width: 200,
-    }, {text: '期初预付',
-    xtype: 'numbercolumn',
-    dataIndex: 'vm_beginpreamount',
-    width: 150
+    }, {
+        text: '期初预付',
+        xtype: 'numbercolumn',
+        dataIndex: 'vm_beginpreamount',
+        width: 150,
+        renderer: function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+            var format = '0,000.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        }
     },{
         text: '期初应付',
         xtype: 'numbercolumn',
@@ -70,11 +77,7 @@ Ext.define('saas.view.money.report.TotalPayDetail', {
     }, {
         text: '本期核销',
         xtype: 'numbercolumn',
-
         dataIndex: 'vm_nowpayamount',
-        width: 150,
-
-        dataIndex: 'vm_nowpreamount',
         width: 110,
         renderer: function(v) {
             var arr = (v + '.').split('.');
@@ -83,25 +86,24 @@ Ext.define('saas.view.money.report.TotalPayDetail', {
             return Ext.util.Format.number(v, format);
         }
     }, {
-            text: '预付余额',
-            dataIndex: 'vm_endpreamount',
-            xtype: 'numbercolumn',
-            width: 110,
-            renderer : function(v) {
-                var arr = (v + '.').split('.');
-                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                var format = '0,000.' + xr.join();
-                return Ext.util.Format.number(v, format);
-            },
-            summaryType: 'sum',
-            summaryRenderer: function(v) {
-                var arr = (v + '.').split('.');
-                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                var format = '0,000.' + xr.join();
-                return Ext.util.Format.number(v, format);
-            }
-            },
-        {
+        text: '预付余额',
+        dataIndex: 'vm_endpreamount',
+        xtype: 'numbercolumn',
+        width: 110,
+        renderer : function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+            var format = '0,000.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        },
+        summaryType: 'sum',
+        summaryRenderer: function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+            var format = '0,000.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        }
+    },{
         text: '应付余额',
         dataIndex: 'vm_endamount',
         xtype: 'numbercolumn',

+ 22 - 9
frontend/saas-web/app/view/money/report/TotalRecDetail.js

@@ -42,10 +42,17 @@ Ext.define('saas.view.money.report.TotalRecDetail', {
         dataIndex: 'cm_custname',
         width: 200,
     }, {
-            text: '期初预收',
-            dataIndex: 'cm_beginpreamount',
-            width: 150
-        },{
+        text: '期初预收',
+        dataIndex: 'cm_beginpreamount',
+        xtype: 'numbercolumn',
+        width: 150,
+        renderer: function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+            var format = '0,000.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        }
+    },{
         text: '期初应收',
         dataIndex: 'cm_beginamount',
         xtype: 'numbercolumn',
@@ -79,11 +86,17 @@ Ext.define('saas.view.money.report.TotalRecDetail', {
             return Ext.util.Format.number(v, format);
         }
     }, {
-            text: '预收余额',
-            xtype: 'numbercolumn',
-            dataIndex: 'cm_endpreamount',
-            width: 150
-        }, {
+        text: '预收余额',
+        xtype: 'numbercolumn',
+        dataIndex: 'cm_endpreamount',
+        width: 150,
+        renderer: function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+            var format = '0,000.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        }
+    }, {
         text: '应收余额',
         dataIndex: 'cm_endamount',
         xtype: 'numbercolumn',

+ 3 - 1
frontend/saas-web/app/view/purchase/report/PurchasePay.js

@@ -7,7 +7,8 @@ Ext.define('saas.view.purchase.report.PurchasePay', {
 
     viewName: 'purchase-report-purchasepay',
 //按供应商分组 付款金额合计
-    groupField: 'pu_vendname',
+    groupField: 'pu_vendcode',
+    groupHeaderTpl: '供应商名称: {[values.rows[0].data.pu_vendname]}',
     listUrl: '/api/purchase/report/purchasePay',
     defaultCondition: null,
     reportTitle: '采购付款一览表',
@@ -36,6 +37,7 @@ Ext.define('saas.view.purchase.report.PurchasePay', {
         width: 150
     }, {
         text: '供应商编号',
+        id: 'pu_vendcode',
         dataIndex: 'pu_vendcode',
         width: 150
     }, {

+ 2 - 1
frontend/saas-web/app/view/sale/report/SaleRec.js

@@ -7,7 +7,8 @@ Ext.define('saas.view.sale.report.SaleRec', {
 
     viewName: 'sale-report-salerec',
 
-    groupField: 'rb_custname',
+    groupField: 'rb_custcode',
+    groupHeaderTpl: '客户名称: {[values.rows[0].data.rd_custname]}',
     listUrl: '/api/sale/report/saleRec',
     defaultCondition: null,
     reportTitle: '销售收款报表',

+ 2 - 1
frontend/saas-web/app/view/stock/report/Prodiodetail.js

@@ -8,6 +8,7 @@ Ext.define('saas.view.stock.report.Prodiodetail', {
     viewName: 'stock-report-prodiodetail',
   //  按物料分组
     groupField: 'pd_prodcode',
+    groupHeaderTpl: '物料名称: {[values.rows[0].data.pr_detail]}',
     listUrl: '/api/storage/report/prodioDetail',
     defaultCondition: null,
     reportTitle: '物料出入库明细表',
@@ -22,7 +23,7 @@ Ext.define('saas.view.stock.report.Prodiodetail', {
         emptyText:'输入单号,订单号或物料编号',
         columnWidth: 0.2,
         getCondition:function(v){
-            return "pd_prodcode='"+v+"' or pi_inoutno='"+v+"' or pd_ordercode='"+v+"'";
+            return "(upper(pd_prodcode) like '%" + v.toUpperCase() + "%' or upper(pi_inoutno) like '%" + v.toUpperCase() + "%' or upper(pd_ordercode) like '%" + v.toUpperCase() + "%')";
         }
     },{
         xtype: 'multicombo',

+ 17 - 0
frontend/saas-web/app/view/sys/account/DataList.js

@@ -168,6 +168,23 @@ Ext.define('saas.view.sys.account.DataList', {
                         type: 'json',
                         rootProperty: 'data.list',
                         totalProperty: 'data.total',
+                    },
+                    listeners: {
+                        exception: function(proxy, response, operation, eOpts) {
+                            if(operation.success) {
+                                if(response.timedout) {
+                                    saas.util.BaseUtil.showErrorToast('请求超时');
+                                }
+                            }else {
+                                if(response.timedout) {
+                                    saas.util.BaseUtil.showErrorToast('请求超时');
+                                }else{
+                                    if(proxy.showPowerMessage){
+                                        saas.util.BaseUtil.showErrorToast('查询失败:' + response.responseJson?response.responseJson.message:'请求超时');
+                                    }
+                                }
+                            }
+                        }
                     }
                 },
                 listeners: {

+ 9 - 0
frontend/saas-web/app/view/sys/manager/FormPanel.js

@@ -54,4 +54,13 @@ Ext.define('saas.view.sys.manager.FormPanel', {
         this.ownerCt.setTitle('系统管理');
     },
 
+    listeners:{
+        tabchange: function ( tabPanel, newCard, oldCard, eOpts ) {
+            if(newCard.xtype=='sys-account-datalist'){
+                newCard.store.proxy.showPowerMessage = true;
+                newCard.store.load();
+            }
+        }
+    }
+
 });

+ 15 - 0
frontend/saas-web/app/view/sys/power/GroupGrid.js

@@ -198,6 +198,21 @@ Ext.define('saas.view.sys.power.GroupGrid', {
                 reader: {
                     type: 'json',
                     rootProperty: 'data',
+                },
+                listeners: {
+                    exception: function(proxy, response, operation, eOpts) {
+                        if(operation.success) {
+                            if(response.timedout) {
+                                saas.util.BaseUtil.showErrorToast('请求超时');
+                            }
+                        }else {
+                            if(response.timedout) {
+                                saas.util.BaseUtil.showErrorToast('请求超时');
+                            }else{
+                                saas.util.BaseUtil.showErrorToast('查询失败:' + response.responseJson?response.responseJson.message:'请求超时');
+                            }
+                        }
+                    }
                 }
             },
             listeners:{

+ 5 - 5
frontend/saas-web/app/view/sys/power/TreePanel.js

@@ -26,7 +26,7 @@ Ext.define('saas.view.sys.power.TreePanel', {
             width: 28,
             iconCls: 'x-hidden icon x-fa fa-plus',
             getClass: function(v, meta, rec) {
-                if(rec.get('type')=='0'){
+                if(rec.get('type')==0){
                     return 'x-hidden icon x-fa fa-key';
                 }else if(rec.get('leaf')){
                      return 'x-hidden icon x-fa fa-pencil';
@@ -43,7 +43,7 @@ Ext.define('saas.view.sys.power.TreePanel', {
             width: 36,
             iconCls: 'x-hidden icon x-fa fa-trash-o',
             getClass: function(v, meta, rec) {
-                if(rec.get('type')=='0'){
+                if(rec.get('type')==0){
                     return '';
                 }else if(rec.get('leaf')){
                      return 'x-hidden icon x-fa fa-trash-o';
@@ -90,10 +90,10 @@ Ext.define('saas.view.sys.power.TreePanel', {
                 var grid = view.ownerCt.ownerCt.query('power-grid')[0];
                 grid.initId = id;
                 grid.store.load();
-                if(record.get('type')&&record.get('type')=='0'){
+                if(record.get('type')==0){
                     grid.dockedItems.items[1].down('[name=savepower]').setDisabled(true)
                 }
-                if(record.get('type')&&record.get('type')=='1'){
+                if(record.get('type')==1){
                     grid.dockedItems.items[1].down('[name=savepower]').setDisabled(false)
                 }
             }
@@ -158,7 +158,7 @@ Ext.define('saas.view.sys.power.TreePanel', {
         this.dialog.show();
     },
     deleteItem:function(rec){
-        if(rec&&(rec.get('type')=='0'||!rec.get('leaf'))){
+        if(rec&&(rec.get('type')==0||!rec.get('leaf'))){
             return;
         }
         var me = this;