Browse Source

供应商对账单

zhuth 7 years ago
parent
commit
6938df27ba

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

@@ -250,13 +250,15 @@ Ext.define('saas.view.core.report.ReportPanel', {
                             value: defaultCondition
                         });
                     }
-                    Ext.apply(store.proxy.extraParams, {
+
+                    var params = me.applyParams({
                         number: store.exportNumber?store.exportNumber:op._page,
                         size: store.exportPageSize?store.exportPageSize:store.pageSize,
                         mode: 'DETAIL',
                         condition: JSON.stringify(condition),
                         calculateFields: JSON.stringify(summarys)
                     });
+                    Ext.apply(store.proxy.extraParams, params);
     
                 }
             }
@@ -349,25 +351,23 @@ Ext.define('saas.view.core.report.ReportPanel', {
                 });
             }
             // 设置model绑定
-            if(!ignore) {
-                if(bind) {
-                    if(!Ext.isString(bind)) {
-                        bind = name;
-                        Ext.apply(bind, {
-                            value: '{form.' + bind + '}'
-                        });
-                    }else {
-                        bind = name;
-                        item.bind = '{form.' + bind + '}';
-                    }
+            if(bind) {
+                if(!Ext.isString(bind)) {
+                    bind = name;
+                    Ext.apply(bind, {
+                        value: '{form.' + bind + '}'
+                    });
                 }else {
                     bind = name;
                     item.bind = '{form.' + bind + '}';
                 }
-                // 设置默认值
-                if(defaultValue) {
-                    viewModel.set('form.' + bind, defaultValue);
-                }
+            }else {
+                bind = name;
+                item.bind = '{form.' + bind + '}';
+            }
+            // 设置默认值
+            if(defaultValue) {
+                viewModel.set('form.' + bind, defaultValue);
             }
         });
 
@@ -477,4 +477,8 @@ Ext.define('saas.view.core.report.ReportPanel', {
 
         return conditionValue;
     },
+
+    applyParams: function(p) {
+        return p;
+    }
 });

+ 150 - 112
frontend/saas-web/app/view/money/report/VendorCheck.js

@@ -11,129 +11,167 @@ Ext.define('saas.view.money.report.VendorCheck', {
     listUrl: '/api/money/report/vendorCheck',
     defaultCondition: null,
     reportTitle: '供应商对账单',
-    QueryWidth:0.25,
+    QueryWidth:0.2,
     autoLoad:false,
     //筛选:供应商、日期(必填)
     searchItems: [ {
         xtype: 'vendorDbfindTrigger',
         name: 'pi_vendname',
         fieldLabel: '供应商名称',
-        columnWidth: 0.25,
+        columnWidth: 0.2,
         allowBlank:false,
+    }, {
+        xtype: 'monthdatefield',
+        name: 'ym',
+        fieldLabel: '期初日期',
+        columnWidth: 0.2
     }, {
         xtype: 'condatefield',
         name: 'pi_date',
         fieldLabel: '单据日期',
-        columnWidth: 0.5
+        columnWidth: 0.4
+    }],
+
+    reportColumns: [{
+        text: 'id',
+        dataIndex: 'pi_id',
+        hidden: true
+    }, {
+        text: '单号',
+        dataIndex: 'pi_inoutno',
+        width: 150
+    }, {
+        text: '单据类型',
+        dataIndex: 'pi_class',
+        width: 110
+    }, {
+        text: '单据日期',
+        dataIndex: 'pi_date',
+        xtype:'datecolumn',
+        width: 110
+    }, {
+        text: '序号',
+        dataIndex: 'pd_pdno',
+        width: 80
+    },{
+        text:'供应商编号',
+        dataIndex:'pi_vendcode',
+        width: 150
+    },{
+        text:'供应商名称',
+        dataIndex:'pi_vendname',
+        width: 200
+    },{
+        text: '物料编号',
+        dataIndex: 'pr_code',
+        width: 150
+    }, {
+        text: '物料名称',
+        dataIndex: 'pr_detail',
+        width: 200
+    }, {
+        text: '物料规格',
+        dataIndex: 'pr_spec',
+        width: 150
+    }, {
+        text: '单位',
+        dataIndex: 'pd_unit',
+        width: 80
+    }, {
+        text: '采购数量',
+        xtype: 'numbercolumn',
+        dataIndex: 'qty',
+        xtype: 'numbercolumn',
+        width: 110,
+        // 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);
+        // },
+        // 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: 'pd_orderprice',
+        xtype: 'numbercolumn',
+        width: 110
+    }, {
+        text: '税率',
+        dataIndex: 'pd_taxrate',
+        xtype: 'numbercolumn',
+        width: 80
+    }, {
+        text: '金额',
+        xtype: 'numbercolumn',
+        dataIndex: 'pd_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);
+        // }
+    }, {
+        text: '不含税单价',
+        dataIndex: 'pd_netprice',
+        xtype: 'numbercolumn',
+        width: 110
+    }, {
+        text: '不含税金额',
+        dataIndex: 'pd_nettotal',
+        xtype: 'numbercolumn',
+        width: 110
+    }, {
+        text: '备注',
+        dataIndex: 'pd_remark',
+        width: 250
+    }, {
+        text: '期初应付',
+        dataIndex: 'beginamount',
+        hidden: true,
+        width: 0,
+        summaryType: 'cus',
+    }, {
+        text: '本期发生',
+        dataIndex: 'nowamount',
+        hidden: true,
+        width: 0,
+        summaryType: 'cus',
+    }, {
+        text: '本期付款',
+        dataIndex: 'nowpay',
+        hidden: true,
+        width: 0,
+        summaryType: 'cus',
+    }, {
+        text: '本期结余',
+        dataIndex: 'nowbalance',
+        hidden: true,
+        width: 0,
+        summaryType: 'cus',
     }],
+    applyParams: function(p) {
+        var me = this,
+        viewModel = me.getViewModel(),
+        formData = viewModel.get('form'),
+        ym = formData.ym;
 
-    reportColumns: [
-        {
-            text: 'id',
-            dataIndex: 'pi_id',
-            hidden: true
-        }, {
-            text: '单号',
-            dataIndex: 'pi_inoutno',
-            width: 150
-        }, {
-            text: '单据类型',
-            dataIndex: 'pi_class',
-            width: 110
-        }, {
-            text: '单据日期',
-            dataIndex: 'pi_date',
-            xtype:'datecolumn',
-            width: 110
-        }, {
-            text: '序号',
-            dataIndex: 'pd_pdno',
-            width: 80
-        },{
-            text:'供应商编号',
-            dataIndex:'pi_vendcode',
-            width: 150
-        },{
-            text:'供应商名称',
-            dataIndex:'pi_vendname',
-            width: 200
-        },{
-            text: '物料编号',
-            dataIndex: 'pr_code',
-            width: 150
-        }, {
-            text: '物料名称',
-            dataIndex: 'pr_detail',
-            width: 200
-        }, {
-            text: '物料规格',
-            dataIndex: 'pr_spec',
-            width: 150
-        }, {
-            text: '单位',
-            dataIndex: 'pd_unit',
-            width: 80
-        }, {
-            text: '采购数量',
-            xtype: 'numbercolumn',
-            dataIndex: 'qty',
-            xtype: 'numbercolumn',
-            width: 110,
-            // 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);
-            // },
-            // 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: 'pd_orderprice',
-            xtype: 'numbercolumn',
-            width: 110
-        }, {
-            text: '税率',
-            dataIndex: 'pd_taxrate',
-            xtype: 'numbercolumn',
-            width: 80
-        }, {
-            text: '金额',
-            xtype: 'numbercolumn',
-            dataIndex: 'pd_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);
-            // }
-        }, {
-            text: '不含税单价',
-            dataIndex: 'pd_netprice',
-            xtype: 'numbercolumn',
-            width: 110
-        }, {
-            text: '不含税金额',
-            dataIndex: 'pd_nettotal',
-            xtype: 'numbercolumn',
-            width: 110
-        }, {
-            text: '备注',
-            dataIndex: 'pd_remark',
-            width: 250
-        }]
+        return Ext.Object.merge(p, {
+            ym: ym
+        });
+    }
 });

+ 8 - 3
frontend/saas-web/ext/packages/ux/src/feature/MySummary.js

@@ -63,8 +63,13 @@ Ext.define('Ext.ux.feature.MySummary', {
                             '<tbody>',
                                 '<tr>',
                                     '<tpl for=".">',
-                                    '<td class="x-grid-cell x-grid-td x-grid-cell-numbercolumn-1526 x-unselectable x-mysummary-item">' +
-                                        '<div class="x-grid-cell-inner x-mysummary-item-cell">{label}({typeLabel}): {value}</div>' +
+                                    '<td class="x-grid-cell x-grid-td x-grid-cell-numbercolumn-1526 x-unselectable x-mysummary-item">',
+                                        '<div class="x-grid-cell-inner x-mysummary-item-cell">{label}',
+                                            '<tpl if="typeLabel">',
+                                            '({typeLabel})',
+                                            '</tpl>',
+                                            ': {value}',
+                                        '</div>',
                                     '</td>',
                                     '</tpl>',
                                 '</tr>',
@@ -107,7 +112,7 @@ Ext.define('Ext.ux.feature.MySummary', {
                     name: c.dataIndex,
                     label: c.text,
                     type: c.summaryType,
-                    typeLabel: typeLabels[c.summaryType],
+                    typeLabel: c.summaryType ? typeLabels[c.summaryType] : '',
                     value: c.summaryValue || 0
                 });
             }