SaleProfit.js 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  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. QueryWidth:0.2,
  12. searchItems: [{
  13. xtype: 'textfield',
  14. name: 'pr_detail',
  15. emptyText:'请输入物料编号、品牌、型号或规格',
  16. columnWidth: 0.2,
  17. getCondition: function(value) {
  18. return ' (pr_code like\'%' + value + '%\' or pr_brand like \'%'+value+'%\' or pr_spec like \'%'+value+'%\' or pr_orispeccode like \'%'+value+'%\' ) ';
  19. }
  20. }, {
  21. xtype: 'customerDbfindTrigger',
  22. name: 'sa_custname',
  23. emptyText:'请输入客户编号或名称',
  24. columnWidth: 0.2
  25. }, {
  26. xtype: 'condatefield',
  27. name: 'pi_date',
  28. fieldLabel: '日期',
  29. columnWidth: 0.4
  30. }],
  31. reportModel: 'saas.model.report.SaleProfit',
  32. reportColumns: [
  33. {
  34. text: 'id',
  35. dataIndex: 'sa_id',
  36. hidden: true
  37. }, {
  38. text: '单据日期',
  39. xtype: 'datecolumn',
  40. dataIndex: 'pi_date',
  41. width: 110
  42. }, {
  43. text: '客户名称',
  44. dataIndex: 'sa_custname',
  45. width: 200
  46. }, {
  47. text: '业务员',
  48. dataIndex: 'sa_seller',
  49. width: 80
  50. }, {
  51. text: '单据编号',
  52. dataIndex: 'pd_inoutno',
  53. width: 150
  54. }, {
  55. text: '业务类型',
  56. dataIndex: 'pd_piclass',
  57. width: 100
  58. }, {
  59. text: '物料编号',
  60. dataIndex: 'pr_code',
  61. width: 150
  62. }, {
  63. text: '品牌',
  64. dataIndex: 'pr_brand',
  65. width: 100
  66. }, {
  67. text: '物料名称',
  68. dataIndex: 'pr_detail',
  69. width: 150
  70. }, {
  71. text: '型号',
  72. dataIndex: 'pr_orispeccode',
  73. width: 200
  74. }, {
  75. text: '规格',
  76. dataIndex: 'pr_spec',
  77. width: 200
  78. }, {
  79. text: '数量',
  80. dataIndex: 'pd_outqty',
  81. exportFormat: 'Quantity',
  82. xtype: 'numbercolumn',
  83. width: 110,
  84. renderer : function(v) {
  85. return saas.util.BaseUtil.numberFormat(v, 3, false);
  86. }
  87. }, {
  88. text: '单位',
  89. dataIndex: 'pr_unit',
  90. width: 65
  91. }, {
  92. text: '单价(元)',
  93. dataIndex: 'pd_netprice',
  94. exportFormat: 'Price',
  95. xtype: 'numbercolumn',
  96. width: 120,
  97. renderer: function(v) {
  98. return saas.util.BaseUtil.numberFormat(v, 4, true);
  99. }
  100. }, {
  101. text: '含税单价(元)',
  102. dataIndex: 'pd_sendprice',
  103. exportFormat: 'Price',
  104. xtype: 'numbercolumn',
  105. width: 120,
  106. renderer: function(v) {
  107. return saas.util.BaseUtil.numberFormat(v, 4, true);
  108. }
  109. }, {
  110. text: '金额(元)',
  111. dataIndex: 'pd_nettotal',
  112. xtype: 'numbercolumn',
  113. exportFormat: 'Amount',
  114. renderer: function(v) {
  115. return saas.util.BaseUtil.numberFormat(v, 2, true);
  116. }
  117. }, {
  118. text: '税率(%)',
  119. dataIndex: 'pd_taxrate',
  120. exportFormat: 'Integer',
  121. xtype: 'numbercolumn',
  122. width: 80,
  123. renderer: function (v) {
  124. return saas.util.BaseUtil.numberFormat(v, 2, false);
  125. }
  126. }, {
  127. text: '税额(元)',
  128. exportFormat: 'Amount',
  129. dataIndex: 'pd_ordertotal-pd_nettotal',
  130. xtype: 'numbercolumn',
  131. width:120,
  132. renderer: function(v) {
  133. return saas.util.BaseUtil.numberFormat(v, 2, true);
  134. }
  135. }, {
  136. text: '价税合计(元)',
  137. exportFormat: 'Amount',
  138. dataIndex: 'pd_ordertotal',
  139. xtype: 'numbercolumn',
  140. width:120,
  141. renderer : function(v) {
  142. return saas.util.BaseUtil.numberFormat(v, 2, true);
  143. },
  144. summaryType: 'sum',
  145. summaryLabel: '价税合计',
  146. summaryRenderer: function(v) {
  147. return saas.util.BaseUtil.numberFormat(v, 2, true);
  148. }
  149. }, {
  150. text: '成本单价(元)',
  151. dataIndex: 'pd_price',
  152. exportFormat: 'Price',
  153. xtype: 'numbercolumn',
  154. width:120,
  155. renderer : function(v) {
  156. return saas.util.BaseUtil.numberFormat(v, 4, true);
  157. }
  158. }, {
  159. text: '成本金额(元)',
  160. dataIndex: 'pd_total',
  161. exportFormat: 'Amount',
  162. xtype: 'numbercolumn',
  163. renderer: function(v) {
  164. return saas.util.BaseUtil.numberFormat(v, 2, true);
  165. }
  166. }, {
  167. text: '毛利润(元)',
  168. dataIndex: 'pd_profit',
  169. exportFormat: 'Amount',
  170. xtype: 'numbercolumn',
  171. renderer: function(v) {
  172. return saas.util.BaseUtil.numberFormat(v, 2, true);
  173. },
  174. summaryType: 'sum',
  175. summaryLabel: '毛利润',
  176. summaryRenderer: function(v) {
  177. return saas.util.BaseUtil.numberFormat(v, 2, true);
  178. }
  179. }, {
  180. text: '毛利率(%)',
  181. dataIndex: 'pd_profitpresent',
  182. xtype: 'numbercolumn',
  183. renderer : function(v) {
  184. return saas.util.BaseUtil.numberFormat(v, 2, true);
  185. }
  186. }, {
  187. text : "备注",
  188. dataIndex : "pd_remark",
  189. width : 250
  190. }]
  191. });