CustomerCheck.js 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  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.2,
  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_inoutno',
  43. width: 150
  44. }, {
  45. text: '单据类型',
  46. dataIndex: 'pi_class',
  47. width: 110
  48. }, {
  49. text: '单据日期',
  50. dataIndex: 'pi_date',
  51. xtype: 'datecolumn',
  52. width: 110
  53. }, {
  54. text: '序号',
  55. dataIndex: 'pd_pdno',
  56. xtype: 'numbercolumn',
  57. width: 80
  58. }, {
  59. text: '物料编号',
  60. width: 150,
  61. dataIndex: 'pr_code'
  62. }, {
  63. text: '物料名称',
  64. dataIndex: 'pr_detail',
  65. width: 200
  66. }, {
  67. text: '物料规格',
  68. dataIndex: 'pr_spec',
  69. width: 150
  70. }, {
  71. text: '单位',
  72. dataIndex: 'pd_unit',
  73. width: 80
  74. }, {
  75. text: '数量',
  76. xtype: 'numbercolumn',
  77. dataIndex: 'qty',
  78. xtype: 'numbercolumn',
  79. width: 110
  80. }, {
  81. text: '单价',
  82. dataIndex: 'pd_orderprice',
  83. xtype: 'numbercolumn',
  84. width: 110
  85. }, {
  86. text: '税率',
  87. dataIndex: 'pd_taxrate',
  88. xtype: 'numbercolumn',
  89. width: 80
  90. }, {
  91. text: '金额',
  92. xtype: 'numbercolumn',
  93. width: 110,
  94. dataIndex: 'pd_total',
  95. xtype: 'numbercolumn',
  96. // renderer : function(v) {
  97. // var arr = (v + '.').split('.');
  98. // var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  99. // var format = '0,000.' + xr.join();
  100. // return Ext.util.Format.number(v, format);
  101. // },
  102. // summaryType: 'sum',
  103. // summaryRenderer: function(v) {
  104. // var arr = (v + '.').split('.');
  105. // var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  106. // var format = '0,000.' + xr.join();
  107. // return Ext.util.Format.number(v, format);
  108. // }
  109. }, {
  110. text: '不含税单价',
  111. width: 110,
  112. dataIndex: 'pd_netprice',
  113. xtype: 'numbercolumn'
  114. }, {
  115. text: '不含税金额',
  116. width: 110,
  117. xtype: 'numbercolumn',
  118. dataIndex: 'pd_nettotal',
  119. xtype: 'numbercolumn',
  120. // renderer : function(v) {
  121. // var arr = (v + '.').split('.');
  122. // var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  123. // var format = '0,000.' + xr.join();
  124. // return Ext.util.Format.number(v, format);
  125. // },
  126. // summaryType: 'sum',
  127. // summaryRenderer: function(v) {
  128. // var arr = (v + '.').split('.');
  129. // var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  130. // var format = '0,000.' + xr.join();
  131. // return Ext.util.Format.number(v, format);
  132. // }
  133. }, {
  134. text: '备注',
  135. dataIndex: 'pd_remark',
  136. width: 250
  137. }, {
  138. text: '期初应收',
  139. dataIndex: 'beginamount',
  140. hidden: true,
  141. width: 0,
  142. summaryType: 'cus',
  143. }, {
  144. text: '本期发生',
  145. dataIndex: 'nowamount',
  146. hidden: true,
  147. width: 0,
  148. summaryType: 'cus',
  149. }, {
  150. text: '本期收款',
  151. dataIndex: 'nowpay',
  152. hidden: true,
  153. width: 0,
  154. summaryType: 'cus',
  155. }, {
  156. text: '本期结余',
  157. dataIndex: 'nowbalance',
  158. hidden: true,
  159. width: 0,
  160. summaryType: 'cus',
  161. }],
  162. listeners: {
  163. afterrender: function(panel) {
  164. panel.setLoadButtonDisabled(true);
  165. },
  166. },
  167. setLoadButtonDisabled: function (disabled) {
  168. var panel = this,
  169. grid = panel.down('grid'),
  170. p = grid.down('pagingtoolbar'),
  171. bs = p.query('button'),
  172. loadButton = Ext.Array.findBy(bs, function (b) {
  173. return b.iconCls == 'x-tbar-loading';
  174. });
  175. if (loadButton) {
  176. loadButton.setDisabled(disabled);
  177. }
  178. },
  179. applyParams: function (p) {
  180. var me = this,
  181. viewModel = me.getViewModel(),
  182. formData = viewModel.get('form'),
  183. ym = formData.ym;
  184. return Ext.Object.merge(p, {
  185. ym: ym
  186. });
  187. }
  188. });