VendorCheck.js 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. Ext.define('saas.view.money.report.VendorCheck', {
  2. extend: 'saas.view.core.report.ReportPanel',
  3. xtype: 'monry-report-vendorcheck',
  4. controller: 'money-report-vendorcheck',
  5. viewModel: 'money-report-vendorcheck',
  6. viewName: 'money-report-vendorcheck',
  7. // groupField: null,
  8. listUrl: '/api/money/report/vendorCheck',
  9. defaultCondition: null,
  10. reportTitle: '供应商对账单',
  11. QueryWidth:0.4,
  12. autoLoad:false,
  13. //筛选:供应商、日期(必填)
  14. searchItems: [ {
  15. xtype: 'vendorDbfindTrigger',
  16. name: 'pi_vendname',
  17. fieldLabel: '供应商名称',
  18. columnWidth: 0.2,
  19. allowBlank:false,
  20. listeners: {
  21. beforequery: function(f) {
  22. return !!f.value;
  23. }
  24. }
  25. }, {
  26. // xtype: 'monthdatefield',
  27. // name: 'ym',
  28. // fieldLabel: '期初日期',
  29. // columnWidth: 0.2
  30. // }, {
  31. xtype: 'condatefield',
  32. name: 'pi_date',
  33. fieldLabel: '单据日期',
  34. columnWidth: 0.4
  35. }],
  36. reportColumns: [{
  37. text: 'id',
  38. dataIndex: 'pi_id',
  39. hidden: true
  40. }, {
  41. text: '单据日期',
  42. dataIndex: 'pi_date',
  43. xtype:'datecolumn',
  44. width: 110
  45. }, {
  46. text: '单号',
  47. dataIndex: 'pi_inoutno',
  48. width: 150
  49. }, {
  50. text: '序号',
  51. xtype: 'numbercolumn',
  52. dataIndex: 'pd_pdno',
  53. exportFormat: 'Integer',
  54. width: 80
  55. },{
  56. text:'供应商编号',
  57. dataIndex:'pi_vendcode',
  58. width: 150,
  59. hidden:true
  60. },{
  61. text:'供应商名称',
  62. dataIndex:'pi_vendname',
  63. width: 250,
  64. hidden:true
  65. }, {
  66. text: '物料编号',
  67. width: 150,
  68. dataIndex: 'pr_code'
  69. }, {
  70. text: '品牌',
  71. dataIndex: 'pr_brand',
  72. width: 200
  73. }, {
  74. text: '名称',
  75. dataIndex: 'pr_detail',
  76. width: 200
  77. }, {
  78. text: '型号',
  79. dataIndex: 'pr_orispeccode',
  80. width: 200
  81. }, {
  82. text: '规格',
  83. dataIndex: 'pr_spec',
  84. width: 150
  85. }, {
  86. text: '数量',
  87. dataIndex: 'qty',
  88. exportFormat: 'Quantity',
  89. xtype: 'numbercolumn',
  90. width: 110,
  91. renderer: function(v) {
  92. var arr = (v + '.').split('.');
  93. var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
  94. var format = '0.' + xr.join('');
  95. return Ext.util.Format.number(v, format);
  96. }
  97. }, {
  98. text: '单位',
  99. dataIndex: 'pd_unit',
  100. width: 80
  101. }, {
  102. text: '单价(元)',
  103. dataIndex: 'pd_orderprice',
  104. exportFormat: 'Price',
  105. xtype: 'numbercolumn',
  106. width: 110,
  107. renderer: function(v) {
  108. var arr = (v + '.').split('.');
  109. var xr = (new Array(arr[1].length > 4 ? 4 : arr[1].length)).fill('0');
  110. var format = '0,000.' + xr.join('');
  111. return Ext.util.Format.number(v, format);
  112. }
  113. }, {
  114. text: '税率',
  115. dataIndex: 'pd_taxrate',
  116. exportFormat: 'Integer',
  117. xtype: 'numbercolumn',
  118. width: 80,
  119. renderer: function(v) {
  120. return Ext.util.Format.number(v, '0');
  121. }
  122. }, {
  123. text: '金额(元)',
  124. xtype: 'numbercolumn',
  125. exportFormat: 'Amount',
  126. dataIndex: 'pd_total',
  127. width: 110,
  128. renderer : function(v) {
  129. var arr = (v + '.').split('.');
  130. var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  131. var format = '0,000.' + xr.join('');
  132. return Ext.util.Format.number(v, format);
  133. },
  134. // summaryType: 'sum',
  135. // summaryRenderer: function(v) {
  136. // var arr = (v + '.').split('.');
  137. // var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  138. // var format = '0,000.' + xr.join('');
  139. // return Ext.util.Format.number(v, format);
  140. // }
  141. }, {
  142. text: '不含税单价(元)',
  143. dataIndex: 'pd_netprice',
  144. exportFormat: 'Price',
  145. xtype: 'numbercolumn',
  146. width: 150,
  147. renderer: function(v) {
  148. var arr = (v + '.').split('.');
  149. var xr = (new Array(arr[1].length > 4 ? 4 : arr[1].length)).fill('0');
  150. var format = '0,000.' + xr.join('');
  151. return Ext.util.Format.number(v, format);
  152. }
  153. }, {
  154. text: '不含税金额(元)',
  155. dataIndex: 'pd_nettotal',
  156. exportFormat: 'Amount',
  157. xtype: 'numbercolumn',
  158. width: 150,
  159. renderer : function(v) {
  160. var arr = (v + '.').split('.');
  161. var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  162. var format = '0,000.' + xr.join('');
  163. return Ext.util.Format.number(v, format);
  164. },
  165. }, {
  166. text: '单据类型',
  167. dataIndex: 'pi_class',
  168. width: 110
  169. }, {
  170. text: '期初应付',
  171. dataIndex: 'beginamount',
  172. hidden: true,
  173. width: 0,
  174. summaryType: 'cus',
  175. }, {
  176. text: '增加应付',
  177. dataIndex: 'nowamount',
  178. hidden: true,
  179. width: 0,
  180. summaryType: 'cus',
  181. }, {
  182. text: '增加预付',
  183. dataIndex: 'nowpay',
  184. hidden: true,
  185. width: 0,
  186. summaryType: 'cus',
  187. }, {
  188. text: '应付余额',
  189. dataIndex: 'nowbalance',
  190. hidden: true,
  191. width: 0,
  192. summaryType: 'cus',
  193. }],
  194. listeners: {
  195. afterrender: function(panel) {
  196. panel.setLoadButtonDisabled(true);
  197. },
  198. },
  199. setLoadButtonDisabled: function (disabled) {
  200. var panel = this,
  201. grid = panel.down('grid'),
  202. p = grid.down('pagingtoolbar'),
  203. bs = p.query('button'),
  204. loadButton = Ext.Array.findBy(bs, function (b) {
  205. return b.iconCls == 'x-tbar-loading';
  206. });
  207. if (loadButton) {
  208. loadButton.setDisabled(disabled);
  209. }
  210. },
  211. applyParams: function(p) {
  212. var me = this,
  213. viewModel = me.getViewModel(),
  214. formData = viewModel.get('form'),
  215. ym = formData.ym;
  216. return Ext.Object.merge(p, {
  217. ym: ym
  218. });
  219. }
  220. });