Purchase.js 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. Ext.define('saas.view.purchase.report.Purchase', {
  2. extend: 'saas.view.core.report.ReportPanel',
  3. xtype: 'purchase-report-purchase',
  4. controller: 'purchase-report-purchase',
  5. viewModel: 'purchase-report-purchase',
  6. viewName: 'purchase-report-purchase',
  7. groupField: null,
  8. listUrl: '/api/purchase/report/purchaseDetail',
  9. defaultCondition: null,
  10. reportTitle: '采购明细报表',
  11. QueryWidth:0.2,
  12. //筛选:供应商、日期(必填)、业务状态
  13. searchItems: [ {
  14. xtype: 'vendorDbfindTrigger',
  15. name: 'pu_vendname',
  16. fieldLabel: '供应商名称',
  17. columnWidth: 0.2
  18. }, {
  19. xtype: 'condatefield',
  20. name: 'pu_date',
  21. fieldLabel: '单据日期',
  22. columnWidth: 0.4
  23. }, {
  24. xtype: 'multicombo',
  25. name: 'pu_acceptstatuscode',
  26. fieldLabel: '业务状态',
  27. columnWidth: 0.2,
  28. datas: [
  29. ["TURNIN", "已入库"],
  30. ["UNTURNIN", "未入库"],
  31. ["PART2IN", "部分入库"],
  32. ["CLOSE", "已关闭"]
  33. ]
  34. }],
  35. reportModel: 'saas.model.report.Purchase',
  36. reportColumns: [
  37. {
  38. text: 'id',
  39. dataIndex: 'pu_id',
  40. hidden: true
  41. }, {
  42. text: '采购单号',
  43. dataIndex: 'pu_code',
  44. width: 150
  45. }, {
  46. text: '供应商编号',
  47. dataIndex: 'pu_vendcode',
  48. hidden: true
  49. }, {
  50. text: '供应商名称',
  51. dataIndex: 'pu_vendname',
  52. width: 250
  53. }, {
  54. text: '业务状态',
  55. align: 'center',
  56. dataIndex: 'pu_acceptstatus',
  57. width: 90
  58. }, {
  59. text: '采购员',
  60. dataIndex: 'pu_buyername',
  61. width: 110
  62. }, {
  63. text: '单据日期',
  64. xtype: 'datecolumn',
  65. dataIndex: 'pu_date',
  66. width: 110
  67. }, {
  68. text: '序号',
  69. dataIndex: 'pd_detno',
  70. exportFormat: 'Integer',
  71. xtype: 'numbercolumn',
  72. width: 80
  73. }, {
  74. text: '物料编号',
  75. width: 150,
  76. dataIndex: 'pd_prodcode'
  77. }, {
  78. text: '品牌',
  79. dataIndex: 'pr_brand',
  80. width: 200
  81. }, {
  82. text: '名称',
  83. dataIndex: 'pr_detail',
  84. width: 200
  85. }, {
  86. text: '型号',
  87. dataIndex: 'pr_orispeccode',
  88. width: 200
  89. }, {
  90. text: '规格',
  91. dataIndex: 'pr_spec',
  92. width: 150
  93. }, {
  94. text: '采购数量',
  95. dataIndex: 'pd_qty',
  96. xtype: 'numbercolumn',
  97. exportFormat: 'Quantity',
  98. width: 110,
  99. summaryType: 'sum',
  100. renderer: function(v) {
  101. var arr = (v + '.').split('.');
  102. var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
  103. var format = '0.' + xr.join('');
  104. return Ext.util.Format.number(v, format);
  105. },
  106. summaryRenderer: function(v) {
  107. var arr = (v + '.').split('.');
  108. var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
  109. var format = '0.' + xr.join('');
  110. return Ext.util.Format.number(v, format);
  111. }
  112. }, {
  113. text: '单位',
  114. dataIndex: 'pr_unit',
  115. width: 80
  116. }, {
  117. text: '单价(元)',
  118. dataIndex: 'pd_price',
  119. exportFormat: 'Price',
  120. width: 110,
  121. xtype: 'numbercolumn',
  122. renderer: function(v) {
  123. var arr = (v + '.').split('.');
  124. var xr = (new Array(arr[1].length > 4 ? 4 : arr[1].length)).fill('0');
  125. var format = '0,000.' + xr.join('');
  126. return Ext.util.Format.number(v, format);
  127. }
  128. }, {
  129. text: '税率',
  130. dataIndex: 'pd_taxrate',
  131. exportFormat: 'Integer',
  132. width: 80,
  133. xtype: 'numbercolumn',
  134. renderer: function(v) {
  135. return Ext.util.Format.number(v, '0');
  136. }
  137. }, {
  138. text: '金额(元)',
  139. dataIndex: 'pd_total',
  140. exportFormat: 'Amount',
  141. width: 110,
  142. xtype: 'numbercolumn',
  143. renderer: function(v) {
  144. var arr = (v + '.').split('.');
  145. var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  146. var format = '0,000.' + xr.join('');
  147. return Ext.util.Format.number(v, format);
  148. },
  149. summaryType: 'sum',
  150. summaryRenderer: function(v) {
  151. var arr = (v + '.').split('.');
  152. var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  153. var format = '0,000.' + xr.join('');
  154. return Ext.util.Format.number(v, format);
  155. }
  156. }, {
  157. text: '不含税单价(元)',
  158. dataIndex: 'pd_taxprice',
  159. exportFormat: 'Price',
  160. width: 150,
  161. xtype: 'numbercolumn',
  162. renderer: function(v) {
  163. var arr = (v + '.').split('.');
  164. var xr = (new Array(arr[1].length > 4 ? 4 : arr[1].length)).fill('0');
  165. var format = '0,000.' + xr.join('');
  166. return Ext.util.Format.number(v, format);
  167. }
  168. }, {
  169. text: '不含税金额(元)',
  170. exportFormat: 'Amount',
  171. width: 150,
  172. dataIndex: 'pd_taxtotal',
  173. xtype: 'numbercolumn',
  174. renderer: function(v) {
  175. var arr = (v + '.').split('.');
  176. var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  177. var format = '0,000.' + xr.join('');
  178. return Ext.util.Format.number(v, format);
  179. }
  180. }, {
  181. text: '收货数量',
  182. dataIndex: 'pd_pdacceptqty',
  183. exportFormat: 'Quantity',
  184. width: 110,
  185. xtype: 'numbercolumn',
  186. renderer: function(v) {
  187. var arr = (v + '.').split('.');
  188. var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
  189. var format = '0.' + xr.join('');
  190. return Ext.util.Format.number(v, format);
  191. },
  192. summaryType: 'sum',
  193. summaryRenderer: function(v) {
  194. var arr = (v + '.').split('.');
  195. var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
  196. var format = '0.' + xr.join('');
  197. return Ext.util.Format.number(v, format);
  198. }
  199. }, {
  200. text: '收货金额(元)',
  201. dataIndex: 'pd_pdaccepttotal',
  202. exportFormat: 'Amount',
  203. width: 110,
  204. xtype: 'numbercolumn',
  205. renderer: function(v) {
  206. var arr = (v + '.').split('.');
  207. var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  208. var format = '0,000.' + xr.join('');
  209. return Ext.util.Format.number(v, format);
  210. }
  211. }, {
  212. text: '备注',
  213. dataIndex: 'pd_remark',
  214. width: 250
  215. }]
  216. });