VendorCheck.js 5.8 KB

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