PayDetail.js 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. Ext.define('saas.view.money.report.PayDetail', {
  2. extend: 'saas.view.core.report.ReportPanel',
  3. xtype: 'monry-report-paydetail',
  4. controller: 'money-report-paydetail',
  5. viewModel: 'money-report-paydetail',
  6. viewName: 'money-report-paydetail',
  7. groupField:'pd_vendname',
  8. groupHeaderTpl: '供应商名称: {[values.rows[0].data.pd_vendname]}',
  9. listUrl: '/api/money/report/payDetail',
  10. defaultCondition: null,
  11. reportTitle: '应付账款明细表',
  12. QueryWidth:0.25,
  13. allowPaging: false,
  14. //筛选:供应商、日期(必填)
  15. searchItems: [ {
  16. xtype: 'vendorDbfindTrigger',
  17. name: 'pd_vendname',
  18. fieldLabel: '供应商名称',
  19. columnWidth: 0.25
  20. }, {
  21. xtype: 'conmonthfield',
  22. name: 'pd_ym',
  23. fieldLabel: '期间',
  24. columnWidth: 0.5
  25. }],
  26. reportColumns: [{
  27. text: '单据日期',
  28. xtype: 'datecolumn',
  29. dataIndex: 'pd_date',
  30. width: 110
  31. }, {
  32. text: '单号',
  33. dataIndex: 'pd_code',
  34. width: 150
  35. }, {
  36. text: '业务类型',
  37. dataIndex: 'pd_kind',
  38. width: 100
  39. },{
  40. text: '采购员',
  41. dataIndex: 'pd_buyername',
  42. width: 80
  43. },{
  44. text: '增加应付',
  45. xtype: 'numbercolumn',
  46. exportFormat: 'Amount',
  47. dataIndex: 'pd_addpay',
  48. width: 120,
  49. renderer : function(v) {
  50. return saas.util.BaseUtil.numberFormat(v, 2, true);
  51. },
  52. summaryType: 'sum',
  53. summaryRenderer: function(v) {
  54. return saas.util.BaseUtil.numberFormat(v, 2, true);
  55. }
  56. }, {
  57. text: '增加预付',
  58. xtype: 'numbercolumn',
  59. exportFormat: 'Amount',
  60. dataIndex: 'pd_addpre',
  61. width: 120,
  62. renderer : function(v) {
  63. return saas.util.BaseUtil.numberFormat(v, 2, true);
  64. },
  65. summaryType: 'sum',
  66. summaryRenderer: function(v) {
  67. return saas.util.BaseUtil.numberFormat(v, 2, true);
  68. }
  69. }, {
  70. text: '应付余额(元)',
  71. xtype: 'numbercolumn',
  72. exportFormat: 'Amount',
  73. dataIndex: 'pd_remain',
  74. width: 120,
  75. renderer : function(v) {
  76. return saas.util.BaseUtil.numberFormat(v, 2, true);
  77. },
  78. summaryType: 'customize_last',
  79. summaryRenderer: function(v) {
  80. return saas.util.BaseUtil.numberFormat(v, 2, true);
  81. },
  82. mySummaryRenderer: function(grid, column, datas) {
  83. var store = grid.store,
  84. dataIndex = column.dataIndex,
  85. groupField = store.getGroupField(),
  86. count = datas.length,
  87. data = datas,
  88. lasts = {},
  89. keys = [],
  90. arr = [];
  91. for(var i = 0; i < count; i++) {
  92. var d = data[i];
  93. var n = Number(d[dataIndex]);
  94. var v = isNaN(n) ? 0 : n;
  95. var gv = d[groupField];
  96. lasts[gv] = v;
  97. }
  98. keys = Ext.Object.getAllKeys(lasts);
  99. arr = keys.map(function(key) {
  100. return lasts[key];
  101. });
  102. return Ext.Array.sum(arr);
  103. }
  104. }, {
  105. dataIndex: '',
  106. flex: 1
  107. }]
  108. });