SaleProfit.js 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  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, m, r) {
  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: 'pi_currency',
  94. align:'center',
  95. width: 65
  96. }, {
  97. text: '汇率',
  98. dataIndex: 'pi_rate',
  99. width: 80
  100. }, {
  101. text: '单价(元)',
  102. dataIndex: 'pd_netprice',
  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_sendprice',
  112. exportFormat: 'Price',
  113. xtype: 'numbercolumn',
  114. width: 120,
  115. renderer: function(v) {
  116. return saas.util.BaseUtil.numberFormat(v, 4, true);
  117. }
  118. }, {
  119. text: '金额(元)',
  120. dataIndex: 'pd_nettotal',
  121. xtype: 'numbercolumn',
  122. exportFormat: 'Amount',
  123. renderer: function(v) {
  124. return saas.util.BaseUtil.numberFormat(v, 2, true);
  125. }
  126. }, {
  127. text: '税率(%)',
  128. dataIndex: 'pd_taxrate',
  129. exportFormat: 'Integer',
  130. xtype: 'numbercolumn',
  131. width: 80,
  132. renderer: function(v, m, r) {
  133. return saas.util.BaseUtil.numberFormat(v, 2, false);
  134. }
  135. }, {
  136. text: '税额(元)',
  137. exportFormat: 'Amount',
  138. dataIndex: 'pd_ordertotal-pd_nettotal',
  139. xtype: 'numbercolumn',
  140. width:120,
  141. renderer: function(v) {
  142. return saas.util.BaseUtil.numberFormat(v, 2, true);
  143. }
  144. }, {
  145. text: '价税合计(元)',
  146. exportFormat: 'Amount',
  147. dataIndex: 'pd_ordertotal',
  148. xtype: 'numbercolumn',
  149. width:120,
  150. renderer : function(v, m, r) {
  151. return saas.util.BaseUtil.numberFormat(v, 2, true);
  152. },
  153. summaryType: 'sum',
  154. summaryLabel: '价税合计',
  155. summaryRenderer: function(v) {
  156. return saas.util.BaseUtil.numberFormat(v, 2, true);
  157. }
  158. }, {
  159. text: '成本单价(元)',
  160. dataIndex: 'pd_price',
  161. exportFormat: 'Price',
  162. xtype: 'numbercolumn',
  163. width:120,
  164. renderer : function(v, m, r) {
  165. return saas.util.BaseUtil.numberFormat(v, 4, true);
  166. }
  167. }, {
  168. text: '成本金额(元)',
  169. dataIndex: 'pd_total',
  170. exportFormat: 'Amount',
  171. xtype: 'numbercolumn',
  172. renderer: function(v) {
  173. return saas.util.BaseUtil.numberFormat(v, 2, true);
  174. }
  175. }, {
  176. text: '毛利润(元)',
  177. dataIndex: 'pd_profit',
  178. exportFormat: 'Amount',
  179. xtype: 'numbercolumn',
  180. renderer: function(v) {
  181. return saas.util.BaseUtil.numberFormat(v, 2, true);
  182. },
  183. summaryType: 'sum',
  184. summaryLabel: '毛利润',
  185. summaryRenderer: function(v) {
  186. return saas.util.BaseUtil.numberFormat(v, 2, true);
  187. }
  188. }, {
  189. text: '毛利率(%)',
  190. dataIndex: 'pd_profitpresent',
  191. xtype: 'numbercolumn',
  192. renderer : function(v, m, r) {
  193. return saas.util.BaseUtil.numberFormat(v, 2, true);
  194. }
  195. }, {
  196. text : "备注",
  197. dataIndex : "pd_remark",
  198. width : 250
  199. }]
  200. });