VendorCheck.js 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  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. 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_inoutno',
  43. width: 150
  44. }, {
  45. text: '单据类型',
  46. dataIndex: 'pi_class',
  47. width: 110
  48. }, {
  49. text: '单据日期',
  50. dataIndex: 'pi_date',
  51. xtype:'datecolumn',
  52. width: 110
  53. }, {
  54. text: '序号',
  55. dataIndex: 'pd_pdno',
  56. width: 80
  57. },{
  58. text:'供应商编号',
  59. dataIndex:'pi_vendcode',
  60. width: 150,
  61. hidden:true
  62. },{
  63. text:'供应商名称',
  64. dataIndex:'pi_vendname',
  65. width: 200,
  66. hidden:true
  67. },{
  68. text: '物料编号',
  69. dataIndex: 'pr_code',
  70. width: 150
  71. }, {
  72. text: '物料名称',
  73. dataIndex: 'pr_detail',
  74. width: 200
  75. }, {
  76. text: '物料规格',
  77. dataIndex: 'pr_spec',
  78. width: 150
  79. }, {
  80. text: '单位',
  81. dataIndex: 'pd_unit',
  82. width: 80
  83. }, {
  84. text: '采购数量',
  85. xtype: 'numbercolumn',
  86. dataIndex: 'qty',
  87. xtype: 'numbercolumn',
  88. width: 110,
  89. // renderer : 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. // summaryType: 'sum',
  96. // summaryRenderer: function(v) {
  97. // var arr = (v + '.').split('.');
  98. // var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
  99. // var format = '0.' + xr.join();
  100. // return Ext.util.Format.number(v, format);
  101. // }
  102. }, {
  103. text: '单价',
  104. dataIndex: 'pd_orderprice',
  105. xtype: 'numbercolumn',
  106. width: 110
  107. }, {
  108. text: '税率',
  109. dataIndex: 'pd_taxrate',
  110. xtype: 'numbercolumn',
  111. width: 80
  112. }, {
  113. text: '金额',
  114. xtype: 'numbercolumn',
  115. dataIndex: 'pd_total',
  116. xtype: 'numbercolumn',
  117. width: 110,
  118. // renderer : 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. // summaryType: 'sum',
  125. // summaryRenderer: function(v) {
  126. // var arr = (v + '.').split('.');
  127. // var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  128. // var format = '0,000.' + xr.join();
  129. // return Ext.util.Format.number(v, format);
  130. // }
  131. }, {
  132. text: '不含税单价',
  133. dataIndex: 'pd_netprice',
  134. xtype: 'numbercolumn',
  135. width: 110
  136. }, {
  137. text: '不含税金额',
  138. dataIndex: 'pd_nettotal',
  139. xtype: 'numbercolumn',
  140. width: 110
  141. }, {
  142. text: '备注',
  143. dataIndex: 'pd_remark',
  144. width: 250
  145. }, {
  146. text: '期初应付',
  147. dataIndex: 'beginamount',
  148. hidden: true,
  149. width: 0,
  150. summaryType: 'cus',
  151. }, {
  152. text: '本期发生',
  153. dataIndex: 'nowamount',
  154. hidden: true,
  155. width: 0,
  156. summaryType: 'cus',
  157. }, {
  158. text: '本期付款',
  159. dataIndex: 'nowpay',
  160. hidden: true,
  161. width: 0,
  162. summaryType: 'cus',
  163. }, {
  164. text: '本期结余',
  165. dataIndex: 'nowbalance',
  166. hidden: true,
  167. width: 0,
  168. summaryType: 'cus',
  169. }],
  170. listeners: {
  171. afterrender: function(panel) {
  172. panel.setLoadButtonDisabled(true);
  173. },
  174. },
  175. setLoadButtonDisabled: function (disabled) {
  176. var panel = this,
  177. grid = panel.down('grid'),
  178. p = grid.down('pagingtoolbar'),
  179. bs = p.query('button'),
  180. loadButton = Ext.Array.findBy(bs, function (b) {
  181. return b.iconCls == 'x-tbar-loading';
  182. });
  183. if (loadButton) {
  184. loadButton.setDisabled(disabled);
  185. }
  186. },
  187. applyParams: function(p) {
  188. var me = this,
  189. viewModel = me.getViewModel(),
  190. formData = viewModel.get('form'),
  191. ym = formData.ym;
  192. return Ext.Object.merge(p, {
  193. ym: ym
  194. });
  195. }
  196. });