SaleProfit.js 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. Ext.define('saas.view.sale.report.SaleProfit', {
  2. extend: 'saas.view.core.report.ReportPanel',
  3. xtype: 'sale-report-saleprofit',
  4. controller: 'sale-report-saleprofit',
  5. viewModel: 'sale-report-saleprofit',
  6. viewName: 'sale-report-saleprofit',
  7. groupField: null,
  8. listUrl: '/api/sale/report/saleProfit',
  9. defaultCondition: null,
  10. reportTitle: '销售毛利润表',
  11. //筛选:客户、物料、时间
  12. QueryWidth:0.2,
  13. searchItems: [{
  14. xtype: 'customerDbfindTrigger',
  15. name: 'sa_custname',
  16. fieldLabel: '客户',
  17. columnWidth: 0.2
  18. }, {
  19. xtype: 'productDbfindTrigger',
  20. name: 'pr_detail',
  21. fieldLabel: '物料',
  22. columnWidth: 0.2
  23. }, {
  24. xtype: 'condatefield',
  25. name: 'pi_date',
  26. fieldLabel: '时间',
  27. columnWidth: 0.4
  28. }],
  29. reportColumns: [
  30. {
  31. text: 'id',
  32. dataIndex: 'sa_id',
  33. hidden: true
  34. }, {
  35. text: '客户编号',
  36. dataIndex: 'sa_custcode',
  37. width: 150
  38. }, {
  39. text: '客户名称',
  40. dataIndex: 'sa_custname',
  41. width: 200
  42. }, {
  43. text: '业务员',
  44. dataIndex: 'sa_seller',
  45. width: 110
  46. }, {
  47. text: '单据日期',
  48. xtype: 'datecolumn',
  49. dataIndex: 'sa_date',
  50. width: 110
  51. }, {
  52. text: '单据编号',
  53. dataIndex: 'pd_inoutno',
  54. width: 150
  55. }, {
  56. text: '单据类型',
  57. dataIndex: 'pd_piclass',
  58. width: 110
  59. }, {
  60. text: '物料类别',
  61. dataIndex: 'pr_kind',
  62. width: 110
  63. }, {
  64. text: '物料编号',
  65. dataIndex: 'pr_code',
  66. width: 150
  67. }, {
  68. text: '物料名称',
  69. dataIndex: 'pr_detail',
  70. width: 200
  71. }, {
  72. text: '物料规格',
  73. dataIndex: 'pr_spec',
  74. width: 150
  75. }, {
  76. text: '单位',
  77. dataIndex: 'pr_unit',
  78. width: 110
  79. }, {
  80. text: '数量',
  81. dataIndex: 'pd_outqty',
  82. xtype: 'numbercolumn',
  83. width: 110,
  84. renderer : function(v) {
  85. var arr = (v + '.').split('.');
  86. var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
  87. var format = '0.' + xr.join();
  88. return Ext.util.Format.number(v, format);
  89. }
  90. }, {
  91. text: '单价',
  92. dataIndex: 'pd_sendprice',
  93. xtype: 'numbercolumn',
  94. width: 110,
  95. renderer: function(v) {
  96. var arr = (v + '.').split('.');
  97. var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  98. var format = '0,000.' + xr.join();
  99. return Ext.util.Format.number(v, format);
  100. }
  101. }, {
  102. text: '税率%',
  103. dataIndex: 'pd_taxrate',
  104. xtype: 'numbercolumn',
  105. width: 90,
  106. renderer: function(v) {
  107. return Ext.util.Format.number(v, '0');
  108. }
  109. }, {
  110. text: '含税金额',
  111. dataIndex: 'pd_ordertotal',
  112. xtype: 'numbercolumn',
  113. renderer: 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. dataIndex: 'pd_netprice',
  122. xtype: 'numbercolumn'
  123. }, {
  124. text: '成本单价',
  125. dataIndex: 'pw_costprice',
  126. xtype: 'numbercolumn'
  127. }, {
  128. text: '成本金额',
  129. dataIndex: 'pd_total',
  130. xtype: 'numbercolumn',
  131. renderer: function(v) {
  132. var arr = (v + '.').split('.');
  133. var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  134. var format = '0,000.' + xr.join();
  135. return Ext.util.Format.number(v, format);
  136. }
  137. }, {
  138. text: '毛利润',
  139. dataIndex: 'pd_profit',
  140. xtype: 'numbercolumn',
  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. }, {
  148. text: '毛利率%',
  149. dataIndex: 'pd_profitpresent',
  150. xtype: 'numbercolumn',
  151. renderer : function(v) {
  152. var arr = (v + '.').split('.');
  153. var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  154. var format = '0.' + xr.join();
  155. return Ext.util.Format.number(v, format);
  156. }
  157. }, {
  158. text : "备注",
  159. dataIndex : "pd_remark",
  160. width : 250
  161. }]
  162. });