CustomerCheck.js 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. Ext.define('saas.view.money.report.CustomerCheckCheck', {
  2. extend: 'saas.view.core.report.ReportPanel',
  3. xtype: 'monry-report-customercheck',
  4. controller: 'money-report-customercheck',
  5. viewModel: 'money-report-customercheck',
  6. viewName: 'money-report-customercheck',
  7. // groupField: 'pi_custname',
  8. listUrl: '/api/money/report/customercheck',
  9. defaultCondition: null,
  10. reportTitle: '客户对账单',
  11. QueryWidth: 0.4,
  12. autoLoad: false,
  13. //筛选:客户、日期(必填)
  14. searchItems: [{
  15. xtype: 'customerDbfindTrigger',
  16. name: 'pi_custname',
  17. fieldLabel: '客户名称',
  18. columnWidth: 0.2,
  19. allowBlank: false,
  20. listeners: {
  21. beforequery: function(f) {
  22. return !!f.value;
  23. }
  24. }
  25. }, {
  26. // xtype: 'monthdatefield',
  27. // name: 'ym',
  28. // fieldLabel: '期初日期',
  29. // columnWidth: 0.2
  30. // }, {
  31. xtype: 'condatefield',
  32. name: 'pi_date',
  33. fieldLabel: '单据日期',
  34. columnWidth: 0.4
  35. }],
  36. reportColumns: [{
  37. text: 'id',
  38. dataIndex: 'pi_id',
  39. hidden: true
  40. }, {
  41. text: '单据日期',
  42. dataIndex: 'pi_date',
  43. xtype: 'datecolumn',
  44. width: 110
  45. }, {
  46. text: '单号',
  47. dataIndex: 'pi_inoutno',
  48. width: 150
  49. }, {
  50. text: '序号',
  51. dataIndex: 'pd_pdno',
  52. xtype: 'numbercolumn',
  53. width: 80
  54. }, {
  55. text: '物料编号',
  56. width: 150,
  57. dataIndex: 'pr_code'
  58. }, {
  59. text: '物料名称',
  60. dataIndex: 'pr_detail',
  61. width: 200
  62. }, {
  63. text: '物料规格',
  64. dataIndex: 'pr_spec',
  65. width: 150
  66. }, {
  67. text: '单位',
  68. dataIndex: 'pd_unit',
  69. width: 80
  70. }, {
  71. text: '数量',
  72. xtype: 'numbercolumn',
  73. dataIndex: 'qty',
  74. xtype: 'numbercolumn',
  75. width: 110
  76. }, {
  77. text: '单价',
  78. dataIndex: 'pd_orderprice',
  79. xtype: 'numbercolumn',
  80. width: 110
  81. }, {
  82. text: '税率',
  83. dataIndex: 'pd_taxrate',
  84. xtype: 'numbercolumn',
  85. width: 80
  86. }, {
  87. text: '金额',
  88. xtype: 'numbercolumn',
  89. width: 110,
  90. dataIndex: 'pd_total',
  91. xtype: 'numbercolumn',
  92. // renderer : function(v) {
  93. // var arr = (v + '.').split('.');
  94. // var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  95. // var format = '0,000.' + xr.join();
  96. // return Ext.util.Format.number(v, format);
  97. // },
  98. // summaryType: 'sum',
  99. // summaryRenderer: function(v) {
  100. // var arr = (v + '.').split('.');
  101. // var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  102. // var format = '0,000.' + xr.join();
  103. // return Ext.util.Format.number(v, format);
  104. // }
  105. }, {
  106. text: '不含税单价',
  107. width: 110,
  108. dataIndex: 'pd_netprice',
  109. xtype: 'numbercolumn'
  110. }, {
  111. text: '不含税金额',
  112. width: 110,
  113. xtype: 'numbercolumn',
  114. dataIndex: 'pd_nettotal',
  115. xtype: 'numbercolumn',
  116. // renderer : function(v) {
  117. // var arr = (v + '.').split('.');
  118. // var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  119. // var format = '0,000.' + xr.join();
  120. // return Ext.util.Format.number(v, format);
  121. // },
  122. // summaryType: 'sum',
  123. // summaryRenderer: function(v) {
  124. // var arr = (v + '.').split('.');
  125. // var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  126. // var format = '0,000.' + xr.join();
  127. // return Ext.util.Format.number(v, format);
  128. // }
  129. }, {
  130. text: '单据类型',
  131. dataIndex: 'pi_class',
  132. width: 110
  133. }, {
  134. text: '期初应收',
  135. dataIndex: 'beginamount',
  136. hidden: true,
  137. width: 0,
  138. summaryType: 'cus',
  139. }, {
  140. text: '增加应收',
  141. dataIndex: 'nowamount',
  142. hidden: true,
  143. width: 0,
  144. summaryType: 'cus',
  145. }, {
  146. text: '增加预收',
  147. dataIndex: 'nowpay',
  148. hidden: true,
  149. width: 0,
  150. summaryType: 'cus',
  151. }, {
  152. text: '应收余额',
  153. dataIndex: 'nowbalance',
  154. hidden: true,
  155. width: 0,
  156. summaryType: 'cus',
  157. }],
  158. listeners: {
  159. afterrender: function(panel) {
  160. panel.setLoadButtonDisabled(true);
  161. },
  162. },
  163. setLoadButtonDisabled: function (disabled) {
  164. var panel = this,
  165. grid = panel.down('grid'),
  166. p = grid.down('pagingtoolbar'),
  167. bs = p.query('button'),
  168. loadButton = Ext.Array.findBy(bs, function (b) {
  169. return b.iconCls == 'x-tbar-loading';
  170. });
  171. if (loadButton) {
  172. loadButton.setDisabled(disabled);
  173. }
  174. },
  175. applyParams: function (p) {
  176. var me = this,
  177. viewModel = me.getViewModel(),
  178. formData = viewModel.get('form'),
  179. ym = formData.ym;
  180. return Ext.Object.merge(p, {
  181. ym: ym
  182. });
  183. }
  184. });