Purchase.js 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  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. width: 150
  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. dataIndex: 'pd_prodcode',
  76. width: 150
  77. }, {
  78. text: '物料名称',
  79. dataIndex: 'pr_detail',
  80. width: 200
  81. }, {
  82. text: '物料规格',
  83. dataIndex: 'pr_spec',
  84. width: 150
  85. }, {
  86. text: '品牌',
  87. dataIndex: 'pr_brand',
  88. width: 110
  89. }, {
  90. text: '单位',
  91. dataIndex: 'pr_unit',
  92. width: 80
  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: 'pd_price',
  115. exportFormat: 'Price',
  116. width: 110,
  117. xtype: 'numbercolumn',
  118. renderer: function(v) {
  119. var arr = (v + '.').split('.');
  120. var xr = (new Array(arr[1].length > 8 ? 8 : arr[1].length)).fill('0');
  121. var format = '0,000.' + xr.join('');
  122. return Ext.util.Format.number(v, format);
  123. }
  124. }, {
  125. text: '税率',
  126. dataIndex: 'pd_taxrate',
  127. exportFormat: 'Integer',
  128. width: 80,
  129. xtype: 'numbercolumn',
  130. renderer: function(v) {
  131. return Ext.util.Format.number(v, '0');
  132. }
  133. }, {
  134. text: '金额(元)',
  135. dataIndex: 'pd_total',
  136. exportFormat: 'Amount',
  137. width: 110,
  138. xtype: 'numbercolumn',
  139. renderer: function(v) {
  140. var arr = (v + '.').split('.');
  141. var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  142. var format = '0,000.' + xr.join('');
  143. return Ext.util.Format.number(v, format);
  144. },
  145. summaryType: 'sum',
  146. summaryRenderer: function(v) {
  147. var arr = (v + '.').split('.');
  148. var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  149. var format = '0,000.' + xr.join('');
  150. return Ext.util.Format.number(v, format);
  151. }
  152. }, {
  153. text: '不含税单价(元)',
  154. dataIndex: 'pd_taxprice',
  155. exportFormat: 'Price',
  156. width: 150,
  157. xtype: 'numbercolumn',
  158. renderer: function(v) {
  159. var arr = (v + '.').split('.');
  160. var xr = (new Array(arr[1].length > 8 ? 8 : arr[1].length)).fill('0');
  161. var format = '0,000.' + xr.join('');
  162. return Ext.util.Format.number(v, format);
  163. }
  164. }, {
  165. text: '不含税金额(元)',
  166. exportFormat: 'Amount',
  167. width: 150,
  168. dataIndex: 'pd_taxtotal',
  169. xtype: 'numbercolumn',
  170. renderer: function(v) {
  171. var arr = (v + '.').split('.');
  172. var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  173. var format = '0,000.' + xr.join('');
  174. return Ext.util.Format.number(v, format);
  175. }
  176. }, {
  177. text: '收货数量',
  178. dataIndex: 'pd_pdacceptqty',
  179. exportFormat: 'Quantity',
  180. width: 110,
  181. xtype: 'numbercolumn',
  182. renderer: function(v) {
  183. var arr = (v + '.').split('.');
  184. var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
  185. var format = '0.' + xr.join('');
  186. return Ext.util.Format.number(v, format);
  187. },
  188. summaryType: 'sum',
  189. summaryRenderer: function(v) {
  190. var arr = (v + '.').split('.');
  191. var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
  192. var format = '0.' + xr.join('');
  193. return Ext.util.Format.number(v, format);
  194. }
  195. }, {
  196. text: '收货金额',
  197. dataIndex: 'pd_pdaccepttotal',
  198. exportFormat: 'Amount',
  199. width: 110,
  200. xtype: 'numbercolumn',
  201. renderer: function(v) {
  202. var arr = (v + '.').split('.');
  203. var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  204. var format = '0,000.' + xr.join('');
  205. return Ext.util.Format.number(v, format);
  206. }
  207. }, {
  208. text: '备注',
  209. dataIndex: 'pd_remark',
  210. width: 250
  211. }]
  212. });