CustomerCheck.js 6.4 KB

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