| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- Ext.QuickTips.init();
- Ext.define('erp.controller.fa.fix.MonthAccount', {
- extend: 'Ext.app.Controller',
- requires: ['erp.util.BaseUtil'],
- views: ['fa.fix.MonthAccount'],
- init:function(){
- var me = this;
- this.BaseUtil = Ext.create('erp.util.BaseUtil');
- this.control({
- 'button[id=query]': {
- click: function(btn) {
- me.getAccount(btn.ownerCt.ownerCt);
- }
- },
- '#info_ym': {
- afterrender: function(f) {
- this.getCurrentMonth(f);
- }
- },
- 'checkbox[id=chkbalance]': {
- change: function(f) {
- me.filterBalance();
- }
- }
- });
- },
- getAccount: function(form) {
- var me = this, grid = form.ownerCt.down('gridpanel');
- grid.setLoading(true);
- Ext.Ajax.request({
- url: basePath + 'fa/fix/monthAccount.action',
- params: {
- condition: Ext.encode({chkun: form.down('#chkun').value})
- },
- callback: function(opt, s, r) {
- grid.setLoading(false);
- var rs = Ext.decode(r.responseText);
- if(rs.success) {
- grid.store.loadData(rs.data);
- me.filterBalance();
- } else if(rs.exceptionInfo) {
- showError(rs.exceptionInfo);
- }
- }
- });
- },
- getCurrentMonth: function(f) {
- var me = this;
- Ext.Ajax.request({
- url: basePath + 'fa/getMonth.action',
- params: {
- type: 'MONTH-F'
- },
- callback: function(opt, s, r) {
- var rs = Ext.decode(r.responseText);
- if(rs.data) {
- me.currentMonth = rs.data.PD_DETNO;
- f.setValue(rs.data.PD_DETNO);
- }
- }
- });
- },
- /**
- * 显示客户明细;
- * 只显示有差额科目
- */
- filterBalance: function() {
- var chkbalance = Ext.getCmp('chkbalance');
- var grid = chkbalance.ownerCt.ownerCt.down('gridpanel');
- grid.store.filterBy(function(item) {
- return chkbalance.value ? item.get('enddiff') != 0 : true;
- });
- }
- });
|