Ext.define('erp.view.oa.officialDocument.fileManagement.noFile.Form',{ extend: 'Ext.form.Panel', alias: 'widget.erpNoFileFormPanel', id: 'form', region: 'north', frame : true, layout : 'column', autoScroll : true, defaultType : 'textfield', labelSeparator : ':', buttonAlign : 'center', fieldDefaults : { margin : '4 2 4 2', fieldStyle : "background:#FFFAFA;color:#515151;", labelAlign : "right", blankText : $I18N.common.form.blankText }, FormUtil: Ext.create('erp.util.FormUtil'), BaseUtil: Ext.create('erp.util.BaseUtil'), tbar: [{ name: 'query', text: $I18N.common.button.erpQueryButton, iconCls: 'x-button-icon-query', cls: 'x-btn-gray', handler: function(){ var grid = Ext.getCmp('grid'); // var form = Ext.getCmp('form'); var who = getUrlParam('whoami'); var flag = ''; if(contains(who, 'Send', true)){ flag = 'sod_'; } else if(contains(who, 'Receive', true)){ flag = 'rod_'; } else if(contains(who, 'Instruction', true)){ flag = 'in_'; } var condition = " (" + flag +"statuscode='OVERED' AND " + flag + "isfile=0 ) "; if(Ext.getCmp('date').value != null && Ext.getCmp('date').value != ''){ // if(condition == ''){ // condition += " (" + flag + "date " + Ext.getCmp('date').value + ")"; // } else { condition += " AND (" + flag + "date " + Ext.getCmp('date').value + ")"; // } } if(Ext.getCmp('secretlevel').value != null && Ext.getCmp('secretlevel').value != ''){ // if(condition == ''){ // condition += " (" + flag + "secretlevel='" + Ext.getCmp('secretlevel').value + "')"; // } else { condition += " AND (" + flag + "secretlevel='" + Ext.getCmp('secretlevel').value + "')"; // } } if(Ext.getCmp('emergencydegree').value != null && Ext.getCmp('emergencydegree').value != ''){ // if(condition == ''){ // condition += " (" + flag + "emergencydegree='" + Ext.getCmp('emergencydegree').value + "')"; // } else { condition += " AND (" + flag + "emergencydegree='" + Ext.getCmp('emergencydegree').value + "')"; // } } if(Ext.getCmp('title').value != null && Ext.getCmp('title').value != ''){ // if(condition == ''){ // condition += " (" + flag + "title like'%" + Ext.getCmp('title').value + "%')"; // } else { condition += " AND (" + flag + "title like'%" + Ext.getCmp('title').value + "%')"; // } } if(condition != ''){ grid.getCount(who, condition); } else { showError('请填写筛选条件');return; } console.log(condition); } }, '-', { text: $I18N.common.button.erpCloseButton, iconCls: 'x-button-icon-close', cls: 'x-btn-gray', handler: function(){ var main = parent.Ext.getCmp("content-panel"); main.getActiveTab().close(); } }, '->',{ id: 'rod', iconCls: 'group-all', text: "收文", cls: 'x-btn-gray' }, '-', { id: 'sod', iconCls: 'group-all', text: "发文", cls: 'x-btn-gray' }, '-', { id: 'in', iconCls: 'group-all', text: "内部请示", cls: 'x-btn-gray' }], initComponent : function(){ // alert(em_uu + caller); var param = {caller: caller, condition: ''}; this.FormUtil.getItemsAndButtons(this, 'common/singleFormItems.action', param); this.callParent(arguments); }, getGroupDa : function(condition, page, pageSize){ var me = Ext.getCmp('grid'); if(!page){ page = 1; } if(!pageSize){ pageSize = 15; } parent.Ext.getCmp("content-panel").getActiveTab().setLoading(true);//loading... Ext.Ajax.request({//拿到grid的columns url : basePath + url, params: { page: page, pageSize: pageSize, condition: condition }, method : 'post', async: false, callback : function(options, success, response){ // console.log(response); parent.Ext.getCmp("content-panel").getActiveTab().setLoading(false); var res = new Ext.decode(response.responseText); if(res.exceptionInfo){ showError(res.exceptionInfo);return; } if(!res.success){ return; } else { console.log(res.success); dataCount = res.count; me.store.loadData(res.success); } } }); } });