| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- Ext.QuickTips.init();
- Ext.define('erp.controller.scm.reserve.MonthAccount', {
- extend: 'Ext.app.Controller',
- requires: ['erp.util.BaseUtil'],
- views: ['scm.reserve.MonthAccount'],
- init:function(){
- var me = this;
- this.BaseUtil = Ext.create('erp.util.BaseUtil');
- this.control({
- 'button[id=query]': {
- click: function(btn) {
- me.getArAccount(btn.ownerCt.ownerCt);
- }
- },
- 'grid': {
- itemclick: function(selModel, record) {
- me.loadDetail(selModel.ownerCt.store, record);
- }
- },
- '#info_ym': {
- afterrender: function(f) {
- this.getCurrentMonth(f);
- }
- }
- });
- },
-
- loadDetail:function(store, record){
- var ym = record.get('cm_yearmonth'),
- catecode = record.get('cm_catecode');
-
- this.BaseUtil.onAdd('MADetail_' + ym + '_' + catecode, '明细',
- 'jsps/scm/reserve/monthAccountDetail.jsp?y=' + ym + '&c=' + catecode);
- },
-
- getArAccount: function(form) {
- var me = this;
- Ext.Ajax.request({
- url: basePath + 'scm/reserve/monthAccount.action',
- params: {
- // condition: Ext.encode({chkun: form.down('#chkun').value})
- },
- callback: function(opt, s, r) {
- var rs = Ext.decode(r.responseText);
- if(rs.success) {
- var grid = form.ownerCt.down('gridpanel');
- grid.store.loadData(rs.data);
- me.filterBalance();
- } else if(rs.exceptionInfo) {
- showError(rs.exceptionInfo);
- }
- }
- });
- },
- /**
- * 显示客户明细;
- * 只显示有差额科目
- */
- filterBalance: function() {/*
- var chkbalance = Ext.getCmp('chkbalance'),
- chkdetail = Ext.getCmp('chkdetail');
- console.log(chkbalance);
- var grid = chkbalance.ownerCt.ownerCt.down('gridpanel');
- grid.store.filterBy(function(item) {
- var bool = true;
- if(!chkdetail.value) {
- bool = item.get('isCount');
- }
- if(bool && chkbalance.value) {
- bool = item.get('endbalance') != 0;
- }
- return bool;
- });*/
- },
- getCurrentMonth: function(f) {
- var me = this;
- Ext.Ajax.request({
- url: basePath + 'fa/getMonth.action',
- params: {
- type: 'MONTH-P'
- },
- 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);
- }
- }
- });
- }
- });
|