CustomerCheck.js 6.2 KB

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