CustomerCheck.js 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  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. listeners: {
  20. beforequery: function(f) {
  21. return !!f.value;
  22. },
  23. change: 'pi_custname_change'
  24. }
  25. }, {
  26. xtype: 'condatefield',
  27. name: 'pi_date',
  28. fieldLabel: '单据日期',
  29. columnWidth: 0.4
  30. }],
  31. reportModel: 'saas.model.report.CustomerCheck',
  32. reportColumns: [{
  33. text: '单据日期',
  34. dataIndex: 'pi_date',
  35. xtype: 'datecolumn',
  36. width: 110
  37. }, {
  38. text: '单号',
  39. dataIndex: 'pi_inoutno',
  40. width: 150
  41. }, {
  42. text: '业务类型',
  43. dataIndex: 'pi_class',
  44. width: 100
  45. }, {
  46. text: '序号',
  47. dataIndex: 'pd_pdno',
  48. exportFormat: 'Integer',
  49. xtype: 'numbercolumn',
  50. width: 65
  51. }, {
  52. text: '物料编号',
  53. width: 150,
  54. dataIndex: 'pr_code'
  55. }, {
  56. text: '品牌',
  57. dataIndex: 'pr_brand',
  58. width: 100
  59. }, {
  60. text: '名称',
  61. dataIndex: 'pr_detail',
  62. width: 150
  63. }, {
  64. text: '型号',
  65. dataIndex: 'pr_orispeccode',
  66. width: 200
  67. }, {
  68. text: '规格',
  69. dataIndex: 'pr_spec',
  70. width: 200
  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_unit',
  86. width: 65
  87. }, {
  88. text: '单价(元)',
  89. dataIndex: 'pd_netprice',
  90. exportFormat: 'Price',
  91. xtype: 'numbercolumn',
  92. width: 120,
  93. renderer: function(v) {
  94. var arr = (v + '.').split('.');
  95. var xr = (new Array(arr[1].length > 4 ? 4 : arr[1].length)).fill('0');
  96. var format = '0,000.' + xr.join('');
  97. return Ext.util.Format.number(v, format);
  98. }
  99. }, {
  100. text: '含税单价(元)',
  101. dataIndex: 'pd_orderprice',
  102. exportFormat: 'Price',
  103. xtype: 'numbercolumn',
  104. width: 120,
  105. renderer: function(v) {
  106. var arr = (v + '.').split('.');
  107. var xr = (new Array(arr[1].length > 4 ? 4 : arr[1].length)).fill('0');
  108. var format = '0,000.' + xr.join('');
  109. return Ext.util.Format.number(v, format);
  110. }
  111. }, {
  112. text: '金额(元)',
  113. xtype: 'numbercolumn',
  114. exportFormat: 'Amount',
  115. width: 120,
  116. dataIndex: 'pd_nettotal',
  117. renderer : 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. dataIndex: 'pd_taxrate',
  126. exportFormat: 'Integer',
  127. xtype: 'numbercolumn',
  128. width: 80,
  129. renderer: function(v) {
  130. return Ext.util.Format.number(v, '0');
  131. }
  132. }, {
  133. text: '税额(元)',
  134. width: 120,
  135. xtype: 'numbercolumn',
  136. exportFormat: 'Amount',
  137. dataIndex: 'pd_ordertotal-pd_nettotal',
  138. renderer : function(v) {
  139. var arr = (v + '.').split('.');
  140. var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  141. var format = '0,000.' + xr.join('');
  142. return Ext.util.Format.number(v, format);
  143. }
  144. }, {
  145. text: '价税合计(元)',
  146. width: 120,
  147. xtype: 'numbercolumn',
  148. exportFormat: 'Amount',
  149. dataIndex: 'pd_ordertotal',
  150. renderer : function(v) {
  151. var arr = (v + '.').split('.');
  152. var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  153. var format = '0,000.' + xr.join('');
  154. return Ext.util.Format.number(v, format);
  155. }
  156. }],
  157. listeners: {
  158. afterrender: function(panel) {
  159. panel.setLoadButtonDisabled(true);
  160. },
  161. beforequery: function(panel) {
  162. var form = panel.items.items[0];
  163. var values = form.getValues();
  164. var pi_custname = values.pi_custname;
  165. if(!pi_custname) {
  166. saas.util.BaseUtil.showErrorToast('请先选择【<span style="color: red;">客户名称</span>】');
  167. return false;
  168. }
  169. return true;
  170. }
  171. },
  172. setLoadButtonDisabled: function (disabled) {
  173. var panel = this,
  174. grid = panel.down('grid'),
  175. p = grid.down('pagingtoolbar'),
  176. bs = p.query('button'),
  177. loadButton = Ext.Array.findBy(bs, function (b) {
  178. return b.iconCls == 'x-tbar-loading';
  179. });
  180. if (loadButton) {
  181. loadButton.setDisabled(disabled);
  182. }
  183. },
  184. applyParams: function (p) {
  185. var me = this,
  186. viewModel = me.getViewModel(),
  187. formData = viewModel.get('form'),
  188. ym = formData.ym;
  189. return Ext.Object.merge(p, {
  190. ym: ym
  191. });
  192. }
  193. });