SaleProfit.js 6.0 KB

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