VendorCheck.js 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  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.2,
  12. autoLoad:false,
  13. //筛选:供应商、日期(必填)
  14. searchItems: [ {
  15. xtype: 'vendorDbfindTrigger',
  16. name: 'pi_vendname',
  17. fieldLabel: '供应商名称',
  18. columnWidth: 0.2,
  19. allowBlank:false
  20. }, {
  21. xtype: 'monthdatefield',
  22. name: 'ym',
  23. fieldLabel: '期初日期',
  24. columnWidth: 0.2
  25. }, {
  26. xtype: 'condatefield',
  27. name: 'pi_date',
  28. fieldLabel: '单据日期',
  29. columnWidth: 0.4
  30. }],
  31. reportColumns: [{
  32. text: 'id',
  33. dataIndex: 'pi_id',
  34. hidden: true
  35. }, {
  36. text: '单号',
  37. dataIndex: 'pi_inoutno',
  38. width: 150
  39. }, {
  40. text: '单据类型',
  41. dataIndex: 'pi_class',
  42. width: 110
  43. }, {
  44. text: '单据日期',
  45. dataIndex: 'pi_date',
  46. xtype:'datecolumn',
  47. width: 110
  48. }, {
  49. text: '序号',
  50. dataIndex: 'pd_pdno',
  51. width: 80
  52. },{
  53. text:'供应商编号',
  54. dataIndex:'pi_vendcode',
  55. width: 150
  56. },{
  57. text:'供应商名称',
  58. dataIndex:'pi_vendname',
  59. width: 200
  60. },{
  61. text: '物料编号',
  62. dataIndex: 'pr_code',
  63. width: 150
  64. }, {
  65. text: '物料名称',
  66. dataIndex: 'pr_detail',
  67. width: 200
  68. }, {
  69. text: '物料规格',
  70. dataIndex: 'pr_spec',
  71. width: 150
  72. }, {
  73. text: '单位',
  74. dataIndex: 'pd_unit',
  75. width: 80
  76. }, {
  77. text: '采购数量',
  78. xtype: 'numbercolumn',
  79. dataIndex: 'qty',
  80. xtype: 'numbercolumn',
  81. width: 110,
  82. // renderer : function(v) {
  83. // var arr = (v + '.').split('.');
  84. // var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
  85. // var format = '0.' + xr.join();
  86. // return Ext.util.Format.number(v, format);
  87. // },
  88. // summaryType: 'sum',
  89. // summaryRenderer: function(v) {
  90. // var arr = (v + '.').split('.');
  91. // var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
  92. // var format = '0.' + xr.join();
  93. // return Ext.util.Format.number(v, format);
  94. // }
  95. }, {
  96. text: '单价',
  97. dataIndex: 'pd_orderprice',
  98. xtype: 'numbercolumn',
  99. width: 110
  100. }, {
  101. text: '税率',
  102. dataIndex: 'pd_taxrate',
  103. xtype: 'numbercolumn',
  104. width: 80
  105. }, {
  106. text: '金额',
  107. xtype: 'numbercolumn',
  108. dataIndex: 'pd_total',
  109. xtype: 'numbercolumn',
  110. width: 110,
  111. // renderer : function(v) {
  112. // var arr = (v + '.').split('.');
  113. // var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  114. // var format = '0,000.' + xr.join();
  115. // return Ext.util.Format.number(v, format);
  116. // },
  117. // summaryType: 'sum',
  118. // summaryRenderer: function(v) {
  119. // var arr = (v + '.').split('.');
  120. // var xr = (new Array(arr[1].length > 2 ? 2 : 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_netprice',
  127. xtype: 'numbercolumn',
  128. width: 110
  129. }, {
  130. text: '不含税金额',
  131. dataIndex: 'pd_nettotal',
  132. xtype: 'numbercolumn',
  133. width: 110
  134. }, {
  135. text: '备注',
  136. dataIndex: 'pd_remark',
  137. width: 250
  138. }, {
  139. text: '期初应付',
  140. dataIndex: 'beginamount',
  141. hidden: true,
  142. width: 0,
  143. summaryType: 'cus',
  144. }, {
  145. text: '本期发生',
  146. dataIndex: 'nowamount',
  147. hidden: true,
  148. width: 0,
  149. summaryType: 'cus',
  150. }, {
  151. text: '本期付款',
  152. dataIndex: 'nowpay',
  153. hidden: true,
  154. width: 0,
  155. summaryType: 'cus',
  156. }, {
  157. text: '本期结余',
  158. dataIndex: 'nowbalance',
  159. hidden: true,
  160. width: 0,
  161. summaryType: 'cus',
  162. }],
  163. listeners: {
  164. afterrender: function(panel) {
  165. panel.setLoadButtonDisabled(true);
  166. },
  167. },
  168. setLoadButtonDisabled: function (disabled) {
  169. var panel = this,
  170. grid = panel.down('grid'),
  171. p = grid.down('pagingtoolbar'),
  172. bs = p.query('button'),
  173. loadButton = Ext.Array.findBy(bs, function (b) {
  174. return b.iconCls == 'x-tbar-loading';
  175. });
  176. if (loadButton) {
  177. loadButton.setDisabled(disabled);
  178. }
  179. },
  180. applyParams: function(p) {
  181. var me = this,
  182. viewModel = me.getViewModel(),
  183. formData = viewModel.get('form'),
  184. ym = formData.ym;
  185. return Ext.Object.merge(p, {
  186. ym: ym
  187. });
  188. }
  189. });