CustomerCheck.js 5.6 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. emptyText: '请输入客户名称',
  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. align: 'center',
  44. dataIndex: 'pi_class',
  45. width: 100
  46. }, {
  47. text: '序号',
  48. align: 'center',
  49. dataIndex: 'pd_pdno',
  50. exportFormat: 'Integer',
  51. xtype: 'numbercolumn',
  52. width: 65
  53. }, {
  54. text: '物料编号',
  55. width: 150,
  56. dataIndex: 'pr_code'
  57. }, {
  58. text: '品牌',
  59. dataIndex: 'pr_brand',
  60. width: 100
  61. }, {
  62. text: '物料名称',
  63. dataIndex: 'pr_detail',
  64. width: 150
  65. }, {
  66. text: '型号',
  67. dataIndex: 'pr_orispeccode',
  68. width: 200
  69. }, {
  70. text: '规格',
  71. dataIndex: 'pr_spec',
  72. width: 200
  73. }, {
  74. text: '数量',
  75. xtype: 'numbercolumn',
  76. exportFormat: 'Quantity',
  77. dataIndex: 'qty',
  78. width: 110,
  79. renderer: function(v) {
  80. return saas.util.BaseUtil.numberFormat(v, 3, false);
  81. }
  82. }, {
  83. text: '单位',
  84. dataIndex: 'pd_unit',
  85. width: 65
  86. }, {
  87. text: '单价(元)',
  88. dataIndex: 'pd_netprice',
  89. exportFormat: 'Price',
  90. xtype: 'numbercolumn',
  91. width: 120,
  92. renderer: function(v) {
  93. return saas.util.BaseUtil.numberFormat(v, 4, true);
  94. }
  95. }, {
  96. text: '含税单价(元)',
  97. dataIndex: 'pd_sendprice',
  98. exportFormat: 'Price',
  99. xtype: 'numbercolumn',
  100. width: 120,
  101. renderer: function(v) {
  102. return saas.util.BaseUtil.numberFormat(v, 4, true);
  103. }
  104. }, {
  105. text: '金额(元)',
  106. xtype: 'numbercolumn',
  107. exportFormat: 'Amount',
  108. width: 120,
  109. dataIndex: 'pd_nettotal',
  110. renderer : function(v) {
  111. return saas.util.BaseUtil.numberFormat(v, 2, true);
  112. },
  113. }, {
  114. text: '税率(%)',
  115. dataIndex: 'pd_taxrate',
  116. exportFormat: 'Integer',
  117. xtype: 'numbercolumn',
  118. width: 80,
  119. renderer: function(v) {
  120. return saas.util.BaseUtil.numberFormat(v, 2, false);
  121. }
  122. }, {
  123. text: '税额(元)',
  124. width: 120,
  125. xtype: 'numbercolumn',
  126. exportFormat: 'Amount',
  127. dataIndex: 'pd_ordertotal-pd_nettotal',
  128. renderer : function(v) {
  129. var arr = (v + '.').split('.');
  130. var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  131. var format = '0,000.' + xr.join('');
  132. return Ext.util.Format.number(v, format);
  133. },
  134. summaryType: 'sum',
  135. summaryLabel: '税额',
  136. summaryRenderer: function(v) {
  137. return saas.util.BaseUtil.numberFormat(v, 2, true);
  138. }
  139. }, {
  140. text: '价税合计(元)',
  141. width: 120,
  142. xtype: 'numbercolumn',
  143. exportFormat: 'Amount',
  144. dataIndex: 'pd_ordertotal',
  145. renderer : function(v) {
  146. var arr = (v + '.').split('.');
  147. var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  148. var format = '0,000.' + xr.join('');
  149. return Ext.util.Format.number(v, format);
  150. },
  151. summaryType: 'sum',
  152. summaryLabel: '价税合计',
  153. summaryRenderer: function(v) {
  154. return saas.util.BaseUtil.numberFormat(v, 2, true);
  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. });