zhuth 7 жил өмнө
parent
commit
c388e3dde9

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

@@ -244,7 +244,7 @@ Ext.define('saas.view.core.report.ReportPanel', {
                                     c.summaryValue = 0;
                                 }
                             });
-                            return data.data.list.list;
+                            return data.data ? (data.data.list ? data.data.list.list : []) : [];
                         }catch(e) {
                             saas.util.BaseUtil.showErrorToast(e.message);
                         }

+ 79 - 80
frontend/saas-web/app/view/money/report/AccountBalance.js

@@ -11,9 +11,9 @@ Ext.define('saas.view.money.report.AccountBalance', {
     listUrl: '/api/money/report/accountBalance',
     defaultCondition: null,
     reportTitle: '资金账户余额表',
-    QueryWidth:0.25,
+    QueryWidth: 0.25,
     //筛选:账户、日期(必填)
-    searchItems: [ {
+    searchItems: [{
         xtype: 'bandinfoDbfindTrigger',
         name: 'bankname',
         fieldLabel: '账户名称',
@@ -25,82 +25,81 @@ Ext.define('saas.view.money.report.AccountBalance', {
         columnWidth: 0.5
     }],
 
-    reportColumns: [
-         {
-            text: '账户编号',
-            dataIndex: 'bankcode',
-            width: 150
-        }, {
-            text: '账户名称',
-            dataIndex: 'bankname',
-            width: 200
-        }, {
-            text: '日期',
-            dataIndex: 'date',
-            xtype:'datecolumn',
-            width: 110
-        }, {
-            text: '业务类型',
-            dataIndex: 'kind',
-            width: 110
-        },{
-            text:'收入',
-            dataIndex:'inamount',
-            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:'outamount',
-            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: 'thisamount',
-            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);
-            }
-        }, {
-            text: '往来单位',
-            dataIndex: 'bname',
-            width: 150
-        }, {
-            text: '收付款人',
-            dataIndex: 'bmanname',
-            width: 110
-        }, {
-            text: '备注',
-            dataIndex: 'remark',
-            width: 250,
-        }]
+    reportColumns: [{
+        text: '账户编号',
+        dataIndex: 'bankcode',
+        width: 150
+    }, {
+        text: '账户名称',
+        dataIndex: 'bankname',
+        width: 200
+    }, {
+        text: '日期',
+        dataIndex: 'date',
+        xtype: 'datecolumn',
+        width: 110
+    }, {
+        text: '业务类型',
+        dataIndex: 'kind',
+        width: 110
+    }, {
+        text: '收入',
+        dataIndex: 'inamount',
+        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: 'outamount',
+        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: 'thisamount',
+        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);
+        }
+    }, {
+        text: '往来单位',
+        dataIndex: 'bname',
+        width: 150
+    }, {
+        text: '收付款人',
+        dataIndex: 'bmanname',
+        width: 110
+    }, {
+        text: '备注',
+        dataIndex: 'remark',
+        width: 250,
+    }]
 });

+ 64 - 303
frontend/saas-web/app/view/money/report/AccountDetails.js

@@ -1,39 +1,28 @@
 Ext.define('saas.view.money.report.AccountDetails', {
-    extend: 'Ext.grid.Panel',
+    extend: 'saas.view.core.report.ReportPanel',
     xtype: 'monry-report-accountdetails',
 
     controller: 'money-report-accountdetails',
     viewModel: 'money-report-accountdetails',
 
     viewName: 'money-report-accountdetails',
-    autoScroll: true,
-    frame:true,
-    layout:'fit',
-    //工具类
-    FormUtil: Ext.create('saas.util.FormUtil'),
-    BaseUtil: Ext.create('saas.util.BaseUtil'),
 
     // groupField: null,
-    dataUrl: '/api/money/report/accountdetails',
+    listUrl: '/api/money/report/accountdetails',
     defaultCondition: null,
     reportTitle: '核销对账表',
-    QueryWidth:0.25,
+    QueryWidth: 0.2,
     //筛选:客户/供应商、日期、单据类型(必填)
-    tbar: [{
-        width: 150,
+    searchItems: [{
         name: 'sl_code',
         xtype: 'textfield',
-        emptyText : '单号'
-    },{
-        width: 400,
-        name: 'date',
-        xtype: 'condatefield',
-        emptyText : '日期'
+        emptyText: '单号',
+        columnWidth: 0.1
     }, {
         xtype: 'multicombo',
         name: 'sl_kind',
-        fieldLabel: '单据类型',
-        width: 150,
+        emptyText: '单据类型',
+        columnWidth: 0.1,
         datas: [
             ["采购验收单", "采购验收单"],
             ["采购验退单", "采购验退单"],
@@ -45,295 +34,67 @@ Ext.define('saas.view.money.report.AccountDetails', {
             ["其它入库单", "其它入库单"],
             ["其它出库单", "其它出库单"],
             ["调拨单", "调拨单"],
-            ["库存初始化","库存初始化"]
+            ["库存初始化", "库存初始化"]
         ]
     }, {
-        width: 150,
-        name: 'pb_code',
-        xtype: 'textfield',
-        emptyText : '核销单号'
+        name: 'date',
+        xtype: 'condatefield',
+        emptyText: '日期',
+        columnWidth: 0.3
     }, {
-        xtype : "customerDbfindTrigger", 
-        width: 200,
-        name : "cu_name", 
-        fieldLabel : "客户",
-        emptyText:'请输入客户编号或名称'
+    //     name: 'pb_code',
+    //     xtype: 'textfield',
+    //     emptyText: '核销单号',
+    //     columnWidth: 0.1
+    // }, {
+        xtype: "customerDbfindTrigger",
+        name: "cu_name",
+        emptyText: '客户编号/名称',
+        columnWidth: 0.15
     }, {
         xtype: 'vendorDbfindTrigger',
-        width: 200,
         name: 've_name',
-        fieldLabel: '供应商',
-        emptyText :'请输入供应商编号或名称'
+        emptyText: '供应商编号/名称',
+        columnWidth: 0.15
+    }],
+    reportColumns: [{
+        text: 'id',
+        dataIndex: 'pi_id',
+        hidden: true
     }, {
-        cls:'x-formpanel-btn-blue',
-        xtype:'button',
-        text:'查询',
-        listeners: {
-            click:function(b){
-                var grid = b.ownerCt.ownerCt;
-                var tbar = b.ownerCt;
-                grid.condition = '';
-                var items = [];
-                var fields = tbar.items.items.map(f => f.name);
-                Ext.each(fields, function(f, index){
-                    var field = tbar.down('[name='+f+']');
-                    if(field){
-                        items.push(field);
-                    }
-                });
-                grid.condition = grid.getCondition(items);
-                grid.store.loadPage(1);
-            }
-        }
-    },'->'],
-    columns: [
-        {
-            text: 'id',
-            dataIndex: 'pi_id',
-            hidden: true
-        }, {
-            text: '单据编号',
-            dataIndex: 'sl_code',
-            width: 150
-        }, {
-            text: '单据类型',
-            dataIndex: 'sl_kind',
-            width: 110
-        }, {
-            text: '单据日期',
-            dataIndex: 'date',
-            xtype:'datecolumn',
-            width: 110
-        },{
-            text:'供应商名称',
-            dataIndex:'ve_name',
-            width: 200
-        },{
-            text:'客户名称',
-            dataIndex:'cu_name',
-            width: 200
-        },{
-            text:'核销单号',
-            dataIndex:'pb_code',
-            width: 200
-        },{
-            text: '本期核销金额',
-            dataIndex: 'sl_amount',
-            xtype: 'numbercolumn',
-            width: 130,
-            // renderer : function(v) {
-            //     var arr = (v + '.').split('.');
-            //     var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-            //     var format = '0.' + 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 > 3 ? 3 : arr[1].length)).fill('0');
-            //     var format = '0.' + xr.join();
-            //     return Ext.util.Format.number(v, format);
-            // }
-        },{
-            text: '总金额',
-            dataIndex: 'total',
-            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);
-            // }
-        }],
-
-    dbSearchFields: [],
-    condition:'',
-
-    initComponent: function() {
-        var me = this;
-        if(me.columns){
-            var fields = me.columns.map(column => column.dataIndex);
-            me.store = Ext.create('Ext.data.Store',{
-                fields:fields,
-                autoLoad: true,
-                pageSize: 11,
-                data: [],
-                proxy: {
-                    timeout:8000,
-                    type: 'ajax',
-                    url: me.dataUrl,
-                    actionMethods: {
-                        read: 'GET'
-                    },
-                    reader: {
-                        type: 'json',
-                        rootProperty: 'data.list.list',
-                        totalProperty: 'data.list.total',
-                    }
-                },
-                listeners: {
-                    beforeload: function (store, op) {
-                        var condition = me.condition;
-                        if (Ext.isEmpty(condition)) {
-                            condition = "";
-                        }
-                        Ext.apply(store.proxy.extraParams, {
-                            number: op._page,
-                            size: store.pageSize,
-                            condition: JSON.stringify(condition)
-                        });
-                    }
-                }
-            });
-
-            Ext.apply(me, {
-                dockedItems:[{
-                    xtype: 'pagingtoolbar',
-                    dock: 'bottom',
-                    displayInfo: true,
-                    store: me.store
-                }]
-            });
-        }
-        me.callParent(arguments);
-    },
-
-    getGridSelected:function(type){
-        var isErrorSelect = false;
-        var checkField = this.statusCodeField;
-        var me = this,
-            items = me.selModel.getSelection(),
-            data = new Array() ;
-        Ext.each(items, function(item, index){
-            if(!Ext.isEmpty(item.data[me.idField])){
-                var o = new Object();
-                if(me.idField){
-                    o['id'] = item.data[me.idField];
-                }
-                if(me.codeField){
-                    o['code'] = item.data[me.codeField];
-                }
-                if(type&&type==item.data[checkField]){
-                    isErrorSelect = true
-                }
-                data.push(o);
-            }
-        });
-        if(isErrorSelect){
-            return false;
-        }
-        return data;
-    },
-
-    /**
-     * 获得过滤条件
-     */
-    getCondition: function(items) {
-        var me = this,
-            conditions = [];
-
-        for(var i = 0; i < items.length; i++) {
-            var item = items[i];
-            var field = item.name,
-                func = item.getCondition,
-                value = item.value,
-                condition;
-
-            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
-                }
-            }
-            conditions.push(condition);
-        };
-        return conditions;
-    },
-
-    getDefaultFieldType: function(xtype) {
-        var type;
-
-        if(Ext.Array.contains(['numberfield'], xtype)) {
-            type = 'number';
-        }else if(Ext.Array.contains(['datefield', 'condatefield'], xtype)) {
-            type = 'date';
-        }else if(Ext.Array.contains(['combobox', 'multicombo', 'combo', 'radiofield', 'radio'], xtype)) {
-            type = 'enum';
-        }else {
-            type = 'string';
-        }
-
-        return type;
-    },
-
-    getDefaultFieldOperation: function(xtype) {
-        var operation;
-
-        if(Ext.Array.contains(['numberfield'], xtype)) {
-            operation = '=';
-        }else if(Ext.Array.contains(['datefield'], xtype)) {
-            operation = '=';
-        }else if(Ext.Array.contains(['condatefield'], xtype)) {
-            operation = 'between';
-        }else if(Ext.Array.contains(['combobox', 'multicombo', 'combo'], xtype)) {
-            operation = 'in';
-        }else {
-            operation = 'like';
-        }
-
-        return operation;
-    },
-
-    /**
-     * 处理部分字段值
-     */
-    getConditionValue: function(xtype, value) {
-        var conditionValue;
-        if(xtype == 'datefield') {
-            conditionValue = Ext.Date.format(new Date(from), 'Y-m-d H:i:s');
-        }else if(xtype == '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') {
-            conditionValue = '\'' + value + '\'';
-        }else if(xtype == 'multicombo') {
-            conditionValue = value.map(function(v) {
-                return '\'' + v.value + '\'';
-            }).join(',');
-        }else {
-            conditionValue = value;
-        }
-
-        return conditionValue;
-    },
-
-    refresh:function(){
-        //debugger
-    }
-
+        text: '单据编号',
+        dataIndex: 'sl_code',
+        width: 150
+    }, {
+        text: '单据类型',
+        dataIndex: 'sl_kind',
+        width: 110
+    }, {
+        text: '单据日期',
+        dataIndex: 'date',
+        xtype: 'datecolumn',
+        width: 110
+    }, {
+        text: '供应商名称',
+        dataIndex: 've_name',
+        width: 200
+    }, {
+        text: '客户名称',
+        dataIndex: 'cu_name',
+        width: 200
+    }, {
+        text: '核销单号',
+        dataIndex: 'pb_code',
+        width: 200
+    }, {
+        text: '本期核销金额',
+        dataIndex: 'sl_amount',
+        xtype: 'numbercolumn',
+        width: 130
+    }, {
+        text: '总金额',
+        dataIndex: 'total',
+        xtype: 'numbercolumn',
+        width: 110
+    }],
 });

+ 1 - 25
frontend/saas-web/app/view/money/report/AccountDetailsController.js

@@ -1,30 +1,6 @@
 Ext.define('saas.view.money.report.AccountDetailsController', {
-    extend: 'saas.view.core.base.BasePanelController',
+    extend: 'saas.view.core.report.ReportPanelController',
     alias: 'controller.money-report-accountdetails',
-    // init: function (form) {
-    //     this.control({
-    //         // 供应商编号
-    //         'dbfindtrigger[name=ve_name]':{
-    //             beforerender:function(f){
-    //                 Ext.apply(f,{
-    //                     dbfinds:[{
-    //                         from:'ve_name',to:'ve_name'
-    //                     }],
-    //                 }) ;
-    //             }
-    //         },
-    //         // 客户编号
-    //         'dbfindtrigger[name=cu_name]':{
-    //             beforerender:function(f){
-    //                 Ext.apply(f,{
-    //                     dbfinds:[{
-    //                         from:'cu_name',to:'cu_name'
-    //                     }],
-    //                 }) ;
-    //             }
-    //         }
-    //     });
-    // }
 
     init: function (form) {
         var me = this;

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

@@ -1,4 +1,4 @@
 Ext.define('saas.view.money.report.AccountDetailsModel', {
-    extend: 'saas.view.core.base.BasePanelModel',
+    extend: 'saas.view.core.report.ReportPanelModel',
     alias: 'viewmodel.money-report-accountdetails'
 });

+ 106 - 36
frontend/saas-web/app/view/stock/inventory/EditDataList.js

@@ -253,16 +253,15 @@ Ext.define('saas.view.stock.inventory.EditDataList', {
         var me = this;
         if(me.columns){
             var fields = me.columns.map(column => column.dataIndex);
-            me.store = Ext.create('Ext.data.Store',{
-                model:'saas.model.document.stocking',
-                fields:fields,
+            me.store = Ext.create('Ext.data.Store', {
+                fields: fields,
                 autoLoad: true,
-                pageSize: 11,
+                pageSize: 15,
                 data: [],
                 proxy: {
-                    timeout:8000,
                     type: 'ajax',
                     url: me.dataUrl,
+                    timeout: 8000,
                     actionMethods: {
                         read: 'GET'
                     },
@@ -270,6 +269,21 @@ Ext.define('saas.view.stock.inventory.EditDataList', {
                         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{
+                                    saas.util.BaseUtil.showErrorToast('查询失败:' + response.responseJson.message);
+                                }
+                            }
+                        }
                     }
                 },
                 listeners: {
@@ -278,11 +292,6 @@ Ext.define('saas.view.stock.inventory.EditDataList', {
                         if (Ext.isEmpty(condition)) {
                             condition = "";
                         }
-                        // Ext.apply(store.proxy.extraParams, {
-                        //     number: op._page,
-                        //     size: store.pageSize,
-                        //     condition: JSON.stringify(condition)
-                        // });
                         Ext.apply(store.proxy.extraParams, {
                             number: store.exportNumber?store.exportNumber:op._page,
                             size: store.exportPageSize?store.exportPageSize:store.pageSize,
@@ -305,41 +314,100 @@ Ext.define('saas.view.stock.inventory.EditDataList', {
         me.callParent(arguments);
     },
 
+    listeners: {
+        boxready: function(grid, width, height, eOpts) {
+            var store = grid.getStore(),
+            gridBodyBox = grid.body.dom.getBoundingClientRect(),
+            gridBodyBoxHeight = gridBodyBox.height;
+
+            var pageSize = Math.floor(gridBodyBoxHeight / 32);
+
+            store.setPageSize(pageSize);
+        },
+    },
+
      /**
      * 获得过滤条件
      */
-    getCondition: function(items) {
+    getConditions: function(moreQuery) {
         var me = this,
+        formItems = me.queryFormItems,
+        moreQueryFormItems = me.moreQueryFormItems,
+        viewModel = me.getViewModel(),
+        viewModelData = viewModel.getData(),
+        bindItems = viewModelData['form'],
+        moreItems = viewModelData['moreForm'],
+        condition,
         conditions = [];
-        for(var i = 0; i < items.length; i++) {
-            var item = items[i];
-            var field = item.name,
-            func = item.getCondition,
-            value = item.value,
-            condition;
-            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(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(!conditionValue) {
-                    continue;
+                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
+                    }
                 }
-                condition = {
-                    type: type,
-                    field: field,
-                    operation: operation,
-                    value: conditionValue
+                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(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
+                    }
                 }
+                conditions.push(condition);
             }
-            conditions.push(condition);
-        };
+        }
+
         return conditions;
     },
 
@@ -358,6 +426,7 @@ Ext.define('saas.view.stock.inventory.EditDataList', {
 
         return type;
     },
+
     getDefaultFieldOperation: function(xtype) {
         var operation;
 
@@ -375,6 +444,7 @@ Ext.define('saas.view.stock.inventory.EditDataList', {
 
         return operation;
     },
+
     /**
      * 处理部分字段值
      */

+ 107 - 0
frontend/saas-web/app/view/stock/report/DataList.js

@@ -0,0 +1,107 @@
+Ext.define('saas.view.stock.report.DataList', {
+    extend: 'saas.view.core.report.ReportPanel',
+    xtype: 'stock-report-datalist',
+
+    controller: 'stock-report-datalist',
+    viewModel: 'stock-report-datalist',
+
+    viewName: 'stock-report-datalist',
+
+    groupField: null,
+    listUrl: '/api/document/product/ReserveCost',
+    defaultCondition: null,
+    reportTitle: '物料库存数量金额表',
+    QueryWidth:0.2,
+
+    searchItems: [{
+        name: 'pr_code',
+        xtype: 'textfield',
+        emptyText : '物料编号',
+        columnWidth: 0.2
+    },{
+        name: 'pr_detail',
+        xtype: 'textfield',
+        emptyText : '物料名称',
+        columnWidth: 0.2
+    },{
+        name: 'wh_code',
+        xtype: 'textfield',
+        emptyText : '仓库编号',
+        columnWidth: 0.2
+    },{
+        name: 'wh_description',
+        xtype: 'textfield',
+        emptyText : '仓库名称',
+        columnWidth: 0.2
+    }],
+
+    reportColumns : [{
+        text : "物料编号", 
+        width : 150, 
+        dataIndex : "rc_prodCode", 
+        xtype : "", 
+    },{
+        text : "物料名称", 
+        width : 200.0, 
+        dataIndex : "rc_prodDetail", 
+    }, 
+    {
+        text : "物料规格", 
+        dataIndex : "rc_prodSpec", 
+        width : 150.0, 
+    }, 
+    {
+        text : "单位", 
+        dataIndex : "rc_prodUnit", 
+        width : 80.0, 
+    }, 
+    {
+        text : "仓库编号", 
+        dataIndex : "rc_whCode", 
+        width : 150, 
+    }, 
+    {
+        text : "仓库名称", 
+        dataIndex : "rc_whName", 
+        width : 200.0, 
+    }, 
+    {
+        text : "数量",
+        xtype: 'numbercolumn',
+        dataIndex : "rc_number", 
+        width : 110.0, 
+        renderer : function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length>3?3:arr[1].length)).fill('0');
+            var format = '0.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        }
+    }, 
+    {
+        text : "单价",
+        xtype: 'numbercolumn',
+        align: 'end',
+        dataIndex : "rc_price", 
+        width : 110.0, 
+        renderer : function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length>8?8:arr[1].length)).fill('0');
+            var format = '0.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        }
+    }, 
+    {
+        text : "金额", 
+        xtype: 'numbercolumn',
+        dataIndex : "rc_amount", 
+        width : 110.0,
+        renderer : function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length>2?2:arr[1].length)).fill('0');
+            var format = '0.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        },
+    }],
+})
+
+

+ 10 - 0
frontend/saas-web/app/view/stock/report/DataListController.js

@@ -0,0 +1,10 @@
+Ext.define('saas.view.stock.report.DataListController', {
+    extend: 'saas.view.core.report.ReportPanelController',
+    alias: 'controller.stock-report-datalist',
+
+    init: function (form) {
+        var me = this;
+        this.control({
+        });
+    }
+});

+ 4 - 0
frontend/saas-web/app/view/stock/report/DataListlModel.js

@@ -0,0 +1,4 @@
+Ext.define('saas.view.stock.report.DataListModel', {
+    extend: 'saas.view.core.report.ReportPanelModel',
+    alias: 'viewmodel.stock-report-datalist'
+});

+ 0 - 312
frontend/saas-web/app/view/stock/stockamount/DataList.js

@@ -1,312 +0,0 @@
-/**
- * Created by zhouy on 2018/10/18.
- */
-Ext.define('saas.view.stock.stockamount.DataList', {
-    extend: 'Ext.grid.Panel',
-    xtype: 'stock-stockamount-datalist',
-    controller: 'stock-stockamount-datalist',
-    viewModel: 'stock-stockamount-datalist',
-    autoScroll: true,
-    frame:true,
-    layout:'fit',
-    //工具类
-    FormUtil: Ext.create('saas.util.FormUtil'),
-    BaseUtil: Ext.create('saas.util.BaseUtil'),
-    dataUrl:'/api/document/product/ReserveCost',                 
-
-    tbar: [{
-        width: 150,
-        name: 'pr_code',
-        xtype: 'textfield',
-        emptyText : '物料编号'
-    },{
-        width: 200,
-        name: 'pr_detail',
-        xtype: 'textfield',
-        emptyText : '物料名称'
-    },{
-        width: 150,
-        name: 'wh_code',
-        xtype: 'textfield',
-        emptyText : '仓库编号'
-    },{
-        width: 200,
-        name: 'wh_description',
-        xtype: 'textfield',
-        emptyText : '仓库名称'
-    },{
-        cls:'x-formpanel-btn-blue',
-        xtype:'button',
-        text:'查询',
-        listeners: {
-            click:function(b){
-                var grid = b.ownerCt.ownerCt;
-                var tbar = b.ownerCt;
-                grid.condition = '';
-                var items = [];
-                var fields = tbar.items.items.map(f => f.name);
-                Ext.each(fields, function(f, index){
-                    var field = tbar.down('[name='+f+']');
-                    if(field){
-                        items.push(field);
-                    }
-                });
-                grid.condition = grid.getCondition(items);
-                grid.store.loadPage(1);
-            }
-        }
-    },'->'],
-
-    columns : [{
-        text : "物料编号", 
-        width : 150, 
-        dataIndex : "rc_prodCode", 
-        xtype : "", 
-    },{
-        text : "物料名称", 
-        width : 200.0, 
-        dataIndex : "rc_prodDetail", 
-    }, 
-    {
-        text : "物料规格", 
-        dataIndex : "rc_prodSpec", 
-        width : 150.0, 
-    }, 
-    {
-        text : "单位", 
-        dataIndex : "rc_prodUnit", 
-        width : 80.0, 
-    }, 
-    {
-        text : "仓库编号", 
-        dataIndex : "rc_whCode", 
-        width : 150, 
-    }, 
-    {
-        text : "仓库名称", 
-        dataIndex : "rc_whName", 
-        width : 200.0, 
-    }, 
-    {
-        text : "数量",
-        xtype: 'numbercolumn',
-        dataIndex : "rc_number", 
-        width : 110.0, 
-        renderer : function(v) {
-            var arr = (v + '.').split('.');
-            var xr = (new Array(arr[1].length>3?3:arr[1].length)).fill('0');
-            var format = '0.' + xr.join();
-            return Ext.util.Format.number(v, format);
-        }
-    }, 
-    {
-        text : "单价",
-        xtype: 'numbercolumn',
-        align: 'end',
-        dataIndex : "rc_price", 
-        width : 110.0, 
-        renderer : function(v) {
-            var arr = (v + '.').split('.');
-            var xr = (new Array(arr[1].length>8?8:arr[1].length)).fill('0');
-            var format = '0.' + xr.join();
-            return Ext.util.Format.number(v, format);
-        }
-    }, 
-    {
-        text : "金额", 
-        xtype: 'numbercolumn',
-        dataIndex : "rc_amount", 
-        width : 110.0,
-        renderer : function(v) {
-            var arr = (v + '.').split('.');
-            var xr = (new Array(arr[1].length>2?2:arr[1].length)).fill('0');
-            var format = '0.' + xr.join();
-            return Ext.util.Format.number(v, format);
-        },
-    }],
-
-    dbSearchFields: [],
-    condition:'',
-
-    initComponent: function() {
-        var me = this;
-        if(me.columns){
-            var fields = me.columns.map(column => column.dataIndex);
-            me.store = Ext.create('Ext.data.Store',{
-                fields:fields,
-                autoLoad: true,
-                pageSize: 11,
-                data: [],
-                proxy: {
-                    timeout:8000,
-                    type: 'ajax',
-                    url: me.dataUrl,
-                    actionMethods: {
-                        read: 'GET'
-                    },
-                    reader: {
-                        type: 'json',
-                        rootProperty: 'data.list',
-                        totalProperty: 'data.total',
-                    }
-                },
-                listeners: {
-                    beforeload: function (store, op) {
-                        var condition = me.condition;
-                        if (Ext.isEmpty(condition)) {
-                            condition = "";
-                        }
-                        Ext.apply(store.proxy.extraParams, {
-                            number: op._page,
-                            size: store.pageSize,
-                            condition: JSON.stringify(condition)
-                        });
-                    }
-                }
-            });
-
-            Ext.apply(me, {
-                dockedItems:[{
-                    xtype: 'pagingtoolbar',
-                    dock: 'bottom',
-                    displayInfo: true,
-                    store: me.store
-                }]
-            });
-        }
-        me.callParent(arguments);
-    },
-
-    getGridSelected:function(type){
-        var isErrorSelect = false;
-        var checkField = this.statusCodeField;
-        var me = this,
-        items = me.selModel.getSelection(),
-        data = new Array() ;
-        Ext.each(items, function(item, index){
-            if(!Ext.isEmpty(item.data[me.idField])){
-                var o = new Object();
-                if(me.idField){
-                    o['id'] = item.data[me.idField];
-                }
-                if(me.codeField){
-                    o['code'] = item.data[me.codeField];
-                }
-                if(type&&type==item.data[checkField]){
-                    isErrorSelect = true
-                }
-                data.push(o);
-            }
-        });
-        if(isErrorSelect){
-            return false;
-        }
-		return data;
-    },
-
-    /**
-     * 获得过滤条件
-     */
-    getCondition: function(items) {
-        var me = this,
-        conditions = [];
-
-        for(var i = 0; i < items.length; i++) {
-            var item = items[i];
-            var field = item.name,
-            func = item.getCondition,
-            value = item.value,
-            condition;
-
-            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
-                }
-            }
-            conditions.push(condition);
-        };
-        return conditions;
-    },
-
-    getDefaultFieldType: function(xtype) {
-        var type;
-
-        if(Ext.Array.contains(['numberfield'], xtype)) {
-            type = 'number';
-        }else if(Ext.Array.contains(['datefield', 'condatefield'], xtype)) {
-            type = 'date';
-        }else if(Ext.Array.contains(['combobox', 'multicombo', 'combo', 'radiofield', 'radio'], xtype)) {
-            type = 'enum';
-        }else {
-            type = 'string';
-        }
-
-        return type;
-    },
-
-    getDefaultFieldOperation: function(xtype) {
-        var operation;
-
-        if(Ext.Array.contains(['numberfield'], xtype)) {
-            operation = '=';
-        }else if(Ext.Array.contains(['datefield'], xtype)) {
-            operation = '=';
-        }else if(Ext.Array.contains(['condatefield'], xtype)) {
-            operation = 'between';
-        }else if(Ext.Array.contains(['combobox', 'multicombo', 'combo'], xtype)) {
-            operation = 'in';
-        }else {
-            operation = 'like';
-        }
-
-        return operation;
-    },
-
-    /**
-     * 处理部分字段值
-     */
-    getConditionValue: function(xtype, value) {
-        var conditionValue;
-        if(xtype == 'datefield') {
-            conditionValue = Ext.Date.format(new Date(from), 'Y-m-d H:i:s');
-        }else if(xtype == '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') {
-            conditionValue = '\'' + value + '\'';
-        }else if(xtype == 'multicombo') {
-            conditionValue = value.map(function(v) {
-                return '\'' + v.value + '\'';
-            }).join(',');
-        }else {
-            conditionValue = value;
-        }
-
-        return conditionValue;
-    },
-
-    refresh:function(){
-        //debugger
-    }
-
-})
-
-

+ 0 - 10
frontend/saas-web/app/view/stock/stockamount/DataListController.js

@@ -1,10 +0,0 @@
-Ext.define('saas.view.stock.stockamount.DataListController', {
-    extend: 'saas.view.core.base.BasePanelController',
-    alias: 'controller.stock-stockamount-datalist',
-
-    init: function (form) {
-        var me = this;
-        this.control({
-        });
-    }
-});

+ 0 - 4
frontend/saas-web/app/view/stock/stockamount/DataListlModel.js

@@ -1,4 +0,0 @@
-Ext.define('saas.view.stock.stockamount.DataListModel', {
-    extend: 'saas.view.core.base.BasePanelModel',
-    alias: 'viewmodel.stock-stockamount-datalist'
-});

+ 2 - 2
frontend/saas-web/resources/json/navigation.json

@@ -110,8 +110,8 @@
             "viewType": "stock-report-prodinoutCount"
         }, {
             "text": "物料库存数量金额表",
-            "id":"stock-stockamount-datalist",
-            "viewType": "stock-stockamount-datalist"
+            "id":"stock-report-datalist",
+            "viewType": "stock-report-datalist"
         }]
     }]
 }, {