VendorCheck.js 5.4 KB

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