VendorCheck.js 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  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. listeners: {
  20. beforequery: function(f) {
  21. return !!f.value;
  22. },
  23. change: 'pi_vendname_change'
  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. reportModel: 'saas.model.report.VendorCheck',
  37. reportColumns: [{
  38. text: '单据日期',
  39. dataIndex: 'pi_date',
  40. xtype:'datecolumn',
  41. width: 110
  42. }, {
  43. text: '单号',
  44. dataIndex: 'pi_inoutno',
  45. width: 150
  46. }, {
  47. text: '业务类型',
  48. dataIndex: 'pi_class',
  49. width: 100
  50. }, {
  51. text: '序号',
  52. xtype: 'numbercolumn',
  53. dataIndex: 'pd_pdno',
  54. exportFormat: 'Integer',
  55. width: 65
  56. }, {
  57. text: '物料编号',
  58. dataIndex: 'pr_code',
  59. width: 150
  60. }, {
  61. text: '品牌',
  62. dataIndex: 'pr_brand',
  63. width: 100
  64. }, {
  65. text: '物料名称',
  66. dataIndex: 'pr_detail',
  67. width: 150
  68. }, {
  69. text: '型号',
  70. dataIndex: 'pr_orispeccode',
  71. width: 200
  72. }, {
  73. text: '规格',
  74. dataIndex: 'pr_spec',
  75. width: 200
  76. }, {
  77. text: '数量',
  78. dataIndex: 'qty',
  79. exportFormat: 'Quantity',
  80. xtype: 'numbercolumn',
  81. width: 110,
  82. renderer: function(v) {
  83. return saas.util.BaseUtil.numberFormat(v, 3, true);
  84. }
  85. }, {
  86. text: '单位',
  87. dataIndex: 'pd_unit',
  88. width: 65
  89. }, {
  90. text: '单价(元)',
  91. dataIndex: 'pd_netprice',
  92. exportFormat: 'Price',
  93. xtype: 'numbercolumn',
  94. width: 120,
  95. renderer: function(v) {
  96. return saas.util.BaseUtil.numberFormat(v, 4, true);
  97. }
  98. }, {
  99. text: '含税单价(元)',
  100. dataIndex: 'pd_orderprice',
  101. exportFormat: 'Price',
  102. xtype: 'numbercolumn',
  103. width: 120,
  104. renderer: function(v) {
  105. return saas.util.BaseUtil.numberFormat(v, 4, true);
  106. }
  107. }, {
  108. text: '金额(元)',
  109. dataIndex: 'pd_nettotal',
  110. exportFormat: 'Amount',
  111. xtype: 'numbercolumn',
  112. width: 120,
  113. renderer : function(v) {
  114. return saas.util.BaseUtil.numberFormat(v, 2, true);
  115. },
  116. }, {
  117. text: '税率(%)',
  118. dataIndex: 'pd_taxrate',
  119. exportFormat: 'Amount',
  120. xtype: 'numbercolumn',
  121. width: 80,
  122. renderer : function(v) {
  123. return saas.util.BaseUtil.numberFormat(v, 2, true);
  124. },
  125. }, {
  126. text: '税额(元)',
  127. xtype: 'numbercolumn',
  128. exportFormat: 'Amount',
  129. dataIndex: 'pd_ordertotal-pd_nettotal',
  130. width: 120,
  131. renderer : function(v) {
  132. return saas.util.BaseUtil.numberFormat(v, 2, true);
  133. },
  134. }, {
  135. text: '价税合计(元)',
  136. xtype: 'numbercolumn',
  137. exportFormat: 'Amount',
  138. dataIndex: 'pd_ordertotal',
  139. width: 120,
  140. renderer : function(v) {
  141. return saas.util.BaseUtil.numberFormat(v, 2, true);
  142. },
  143. }],
  144. listeners: {
  145. afterrender: function(panel) {
  146. panel.setLoadButtonDisabled(true);
  147. },
  148. beforequery: function(panel) {
  149. var form = panel.items.items[0];
  150. var values = form.getValues();
  151. var pi_vendname = values.pi_vendname;
  152. if(!pi_vendname) {
  153. saas.util.BaseUtil.showErrorToast('请先选择【<span style="color: red;">供应商名称</span>】');
  154. return false;
  155. }
  156. return true;
  157. }
  158. },
  159. setLoadButtonDisabled: function (disabled) {
  160. var panel = this,
  161. grid = panel.down('grid'),
  162. p = grid.down('pagingtoolbar'),
  163. bs = p.query('button'),
  164. loadButton = Ext.Array.findBy(bs, function (b) {
  165. return b.iconCls == 'x-tbar-loading';
  166. });
  167. if (loadButton) {
  168. loadButton.setDisabled(disabled);
  169. }
  170. },
  171. applyParams: function(p) {
  172. var me = this,
  173. viewModel = me.getViewModel(),
  174. formData = viewModel.get('form'),
  175. ym = formData.ym;
  176. return Ext.Object.merge(p, {
  177. ym: ym
  178. });
  179. }
  180. });