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