MonthAccount.js 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  1. Ext.define('erp.view.fa.arp.MonthAccount',{
  2. extend: 'Ext.Viewport',
  3. layout: 'anchor',
  4. hideBorders: true,
  5. initComponent : function(){
  6. var me = this;
  7. Ext.apply(me, {
  8. items: [{
  9. xtype: 'form',
  10. anchor: '100% 10%',
  11. bodyStyle: 'background:#f1f1f1',
  12. layout: 'column',
  13. defaults: {
  14. xtype: 'displayfield',
  15. columnWidth: .2
  16. },
  17. items: [{
  18. fieldLabel: '期间',
  19. margin: '0 0 0 8',
  20. id: 'info_ym',
  21. value: Ext.Date.format(new Date(), 'Ym')
  22. },{
  23. fieldLabel: '核算类别',
  24. value: '供应商'
  25. },{
  26. xtype: 'checkbox',
  27. id: 'chkdetail',
  28. boxLabel: '显示供应商明细',
  29. checked: true
  30. },{
  31. xtype: 'checkbox',
  32. id: 'chkun',
  33. boxLabel: '包括未记账凭证'
  34. },{
  35. xtype: 'checkbox',
  36. id: 'chkbalance',
  37. boxLabel: '只显示有差额科目'
  38. }],
  39. buttonAlign: 'center',
  40. buttons: [{
  41. name: 'query',
  42. id: 'query',
  43. text: $I18N.common.button.erpQueryButton,
  44. iconCls: 'x-button-icon-query',
  45. cls: 'x-btn-gray',
  46. margin: '0 4 0 0'
  47. },{
  48. name: 'export',
  49. text: $I18N.common.button.erpExportButton,
  50. iconCls: 'x-button-icon-excel',
  51. cls: 'x-btn-gray',
  52. handler: function(btn){
  53. var grid = btn.ownerCt.ownerCt.ownerCt.down("#apMonthAccountGrid");
  54. Ext.create('erp.util.BaseUtil').exportGrid(grid,'应付对账检查');
  55. }
  56. },{
  57. text: $I18N.common.button.erpCloseButton,
  58. iconCls: 'x-button-icon-close',
  59. cls: 'x-btn-gray',
  60. margin: '0 4 0 0',
  61. handler: function(){
  62. var main = parent.Ext.getCmp("content-panel");
  63. main.getActiveTab().close();
  64. }
  65. }]
  66. },{
  67. xtype: 'grid',
  68. id:'apMonthAccountGrid',
  69. anchor: '100% 90%',
  70. columnLines: true,
  71. columns: [{
  72. text: '期间',
  73. cls: 'x-grid-header-1',
  74. dataIndex: 'am_yearmonth',
  75. xtype: 'numbercolumn',
  76. format: '0',
  77. width: 80
  78. },{
  79. text: '类型',
  80. cls: 'x-grid-header-1',
  81. dataIndex: 'am_catecode',
  82. width: 110
  83. },{
  84. text: '供应商编号',
  85. cls: 'x-grid-header-1',
  86. dataIndex: 'am_asscode',
  87. width: 120
  88. },{
  89. text: '供应商名称',
  90. cls: 'x-grid-header-1',
  91. dataIndex: 'am_assname',
  92. width: 180
  93. },{
  94. text: '币别',
  95. cls: 'x-grid-header-1',
  96. dataIndex: 'am_currency',
  97. width: 60,
  98. tdCls: 'cell-split'
  99. },{
  100. text: '期初余额',
  101. cls: 'x-grid-header-1',
  102. columns: [{
  103. text: '应付系统',
  104. cls: 'x-grid-header-1',
  105. dataIndex: 'vm_beginbalance',
  106. xtype: 'numbercolumn',
  107. format: '0,000.000',
  108. align: 'right',
  109. width: 120
  110. },{
  111. text: '总账系统',
  112. cls: 'x-grid-header-1',
  113. dataIndex: 'am_beginbalance',
  114. xtype: 'numbercolumn',
  115. format: '0,000.000',
  116. align: 'right',
  117. width: 120
  118. },{
  119. text: '差额',
  120. cls: 'x-grid-header-1',
  121. dataIndex: 'beginbalance',
  122. align: 'right',
  123. width: 120,
  124. tdCls: 'cell-split',
  125. renderer: function(val, meta, record) {
  126. val = record.get('vm_beginbalance') - record.get('am_beginbalance');
  127. if(record.get('beginbalance') != val) {
  128. record.set('beginbalance', val);
  129. }
  130. return val == 0 ? '' : Ext.util.Format.number(val, '0,000.000');
  131. }
  132. }]
  133. },{
  134. text: '本期借方发生',
  135. cls: 'x-grid-header-1',
  136. columns: [{
  137. text: '应付系统',
  138. cls: 'x-grid-header-1',
  139. dataIndex: 'vm_nowdebit',
  140. xtype: 'numbercolumn',
  141. format: '0,000.000',
  142. align: 'right',
  143. width: 120
  144. },{
  145. text: '总账系统',
  146. cls: 'x-grid-header-1',
  147. dataIndex: 'am_nowdebit',
  148. xtype: 'numbercolumn',
  149. format: '0,000.000',
  150. align: 'right',
  151. width: 120
  152. },{
  153. text: '差额',
  154. cls: 'x-grid-header-1',
  155. dataIndex: 'nowdebit',
  156. align: 'right',
  157. width: 120,
  158. tdCls: 'cell-split',
  159. renderer: function(val, meta, record) {
  160. val = record.get('vm_nowdebit') - record.get('am_nowdebit');
  161. if(record.get('nowdebit') != val) {
  162. record.set('nowdebit', val);
  163. }
  164. return val == 0 ? '' : Ext.util.Format.number(val, '0,000.000');
  165. }
  166. }]
  167. },{
  168. text: '本期贷方发生',
  169. cls: 'x-grid-header-1',
  170. columns: [{
  171. text: '应付系统',
  172. cls: 'x-grid-header-1',
  173. dataIndex: 'vm_nowcredit',
  174. xtype: 'numbercolumn',
  175. format: '0,000.000',
  176. align: 'right',
  177. width: 120
  178. },{
  179. text: '总账系统',
  180. cls: 'x-grid-header-1',
  181. dataIndex: 'am_nowcredit',
  182. xtype: 'numbercolumn',
  183. format: '0,000.000',
  184. align: 'right',
  185. width: 120
  186. },{
  187. text: '差额',
  188. cls: 'x-grid-header-1',
  189. dataIndex: 'nowcredit',
  190. align: 'right',
  191. width: 120,
  192. tdCls: 'cell-split',
  193. renderer: function(val, meta, record) {
  194. val = record.get('vm_nowcredit') - record.get('am_nowcredit');
  195. if(record.get('nowcredit') != val) {
  196. record.set('nowcredit', val);
  197. }
  198. return val == 0 ? '' : Ext.util.Format.number(val, '0,000.000');
  199. }
  200. }]
  201. },{
  202. text: '期末余额',
  203. cls: 'x-grid-header-1',
  204. columns: [{
  205. text: '应付系统',
  206. cls: 'x-grid-header-1',
  207. dataIndex: 'vm_endbalance',
  208. xtype: 'numbercolumn',
  209. format: '0,000.000',
  210. align: 'right',
  211. width: 120
  212. },{
  213. text: '总账系统',
  214. cls: 'x-grid-header-1',
  215. dataIndex: 'am_endbalance',
  216. xtype: 'numbercolumn',
  217. format: '0,000.000',
  218. align: 'right',
  219. width: 120
  220. },{
  221. text: '差额',
  222. cls: 'x-grid-header-1',
  223. dataIndex: 'endbalance',
  224. align: 'right',
  225. width: 120,
  226. renderer: function(val, meta, record) {
  227. val = record.get('vm_endbalance') - record.get('am_endbalance');
  228. val = Math.abs(val) < 0.001 ? 0 : val;
  229. if(record.get('endbalance') != val) {
  230. record.set('endbalance', val);
  231. }
  232. return val == 0 ? '' : Ext.util.Format.number(val, '0,000.000');
  233. }
  234. }]
  235. }],
  236. store: Ext.create('Ext.data.Store', {
  237. fields: [{
  238. name: 'isCount', type: 'bool'
  239. },{
  240. name: 'am_yearmonth', type: 'number'
  241. },{
  242. name: 'am_catecode', type: 'string'
  243. },{
  244. name: 'am_asscode', type: 'string'
  245. },{
  246. name: 'am_assname', type: 'string'
  247. },{
  248. name: 'am_currency', type: 'string'
  249. },{
  250. name: 'am_beginbalance', type: 'number'
  251. },{
  252. name: 'vm_beginbalance', type: 'number'
  253. },{
  254. name: 'beginbalance', type: 'number'
  255. },{
  256. name: 'am_nowdebit', type: 'number'
  257. },{
  258. name: 'vm_nowdebit', type: 'number'
  259. },{
  260. name: 'nowdebit', type: 'number'
  261. },{
  262. name: 'am_nowcredit', type: 'number'
  263. },{
  264. name: 'vm_nowcredit', type: 'number'
  265. },{
  266. name: 'nowcredit', type: 'number'
  267. },{
  268. name: 'am_endbalance', type: 'number'
  269. },{
  270. name: 'vm_endbalance', type: 'number'
  271. },{
  272. name: 'endbalance', type: 'number'
  273. }],
  274. viewConfig: {
  275. getRowClass: function(record) {
  276. return record.get('isCount') ? 'isCount' : null;
  277. }
  278. }
  279. })
  280. }]
  281. });
  282. me.callParent(arguments);
  283. }
  284. });