CustomerCheck.js 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  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. width: 110,
  75. renderer: function(v) {
  76. var arr = (v + '.').split('.');
  77. var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
  78. var format = '0.' + xr.join();
  79. return Ext.util.Format.number(v, format);
  80. }
  81. }, {
  82. text: '单价',
  83. dataIndex: 'pd_orderprice',
  84. xtype: 'numbercolumn',
  85. width: 110,
  86. renderer: function(v) {
  87. var arr = (v + '.').split('.');
  88. var xr = (new Array(arr[1].length > 8 ? 8 : arr[1].length)).fill('0');
  89. var format = '0,000.' + xr.join();
  90. return Ext.util.Format.number(v, format);
  91. }
  92. }, {
  93. text: '税率',
  94. dataIndex: 'pd_taxrate',
  95. xtype: 'numbercolumn',
  96. width: 80,
  97. renderer: function(v) {
  98. return Ext.util.Format.number(v, '0');
  99. }
  100. }, {
  101. text: '金额',
  102. xtype: 'numbercolumn',
  103. width: 110,
  104. dataIndex: 'pd_total',
  105. xtype: 'numbercolumn',
  106. renderer : function(v) {
  107. var arr = (v + '.').split('.');
  108. var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  109. var format = '0,000.' + xr.join();
  110. return Ext.util.Format.number(v, format);
  111. },
  112. // summaryType: 'sum',
  113. // summaryRenderer: function(v) {
  114. // var arr = (v + '.').split('.');
  115. // var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  116. // var format = '0,000.' + xr.join();
  117. // return Ext.util.Format.number(v, format);
  118. // }
  119. }, {
  120. text: '不含税单价',
  121. width: 110,
  122. dataIndex: 'pd_netprice',
  123. xtype: 'numbercolumn',
  124. renderer: function(v) {
  125. var arr = (v + '.').split('.');
  126. var xr = (new Array(arr[1].length > 8 ? 8 : arr[1].length)).fill('0');
  127. var format = '0,000.' + xr.join();
  128. return Ext.util.Format.number(v, format);
  129. }
  130. }, {
  131. text: '不含税金额',
  132. width: 110,
  133. xtype: 'numbercolumn',
  134. dataIndex: 'pd_nettotal',
  135. xtype: 'numbercolumn',
  136. renderer : function(v) {
  137. var arr = (v + '.').split('.');
  138. var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  139. var format = '0,000.' + xr.join();
  140. return Ext.util.Format.number(v, format);
  141. }
  142. // summaryType: 'sum',
  143. // summaryRenderer: function(v) {
  144. // var arr = (v + '.').split('.');
  145. // var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  146. // var format = '0,000.' + xr.join();
  147. // return Ext.util.Format.number(v, format);
  148. // }
  149. }, {
  150. text: '单据类型',
  151. dataIndex: 'pi_class',
  152. width: 110
  153. }, {
  154. text: '期初应收',
  155. dataIndex: 'beginamount',
  156. hidden: true,
  157. width: 0,
  158. summaryType: 'cus',
  159. }, {
  160. text: '增加应收',
  161. dataIndex: 'nowamount',
  162. hidden: true,
  163. width: 0,
  164. summaryType: 'cus',
  165. }, {
  166. text: '增加预收',
  167. dataIndex: 'nowpay',
  168. hidden: true,
  169. width: 0,
  170. summaryType: 'cus',
  171. }, {
  172. text: '应收余额',
  173. dataIndex: 'nowbalance',
  174. hidden: true,
  175. width: 0,
  176. summaryType: 'cus',
  177. }],
  178. listeners: {
  179. afterrender: function(panel) {
  180. panel.setLoadButtonDisabled(true);
  181. },
  182. },
  183. setLoadButtonDisabled: function (disabled) {
  184. var panel = this,
  185. grid = panel.down('grid'),
  186. p = grid.down('pagingtoolbar'),
  187. bs = p.query('button'),
  188. loadButton = Ext.Array.findBy(bs, function (b) {
  189. return b.iconCls == 'x-tbar-loading';
  190. });
  191. if (loadButton) {
  192. loadButton.setDisabled(disabled);
  193. }
  194. },
  195. applyParams: function (p) {
  196. var me = this,
  197. viewModel = me.getViewModel(),
  198. formData = viewModel.get('form'),
  199. ym = formData.ym;
  200. return Ext.Object.merge(p, {
  201. ym: ym
  202. });
  203. }
  204. });