| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- Ext.QuickTips.init();
- Ext.define('erp.controller.oa.officialDocument.fileManagement.agency.New', {
- extend: 'Ext.app.Controller',
- FormUtil: Ext.create('erp.util.FormUtil'),
- BaseUtil: Ext.create('erp.util.BaseUtil'),
- views:[
- 'oa.officialDocument.fileManagement.agency.New','core.form.Panel',
- 'core.button.Save','core.button.Close','core.button.Update','core.button.Delete',
- 'core.trigger.TextAreaTrigger','core.trigger.DbfindTrigger'
- ],
- init:function(){
- var me = this;
- this.control({
- 'erpSaveButton': {
- click: function(btn){
- this.FormUtil.beforeSave(this);
- }
- },
- 'erpUpdateButton': {
- click: function(btn){
- this.FormUtil.onUpdate(this);
- }
- },
- 'erpDeleteButton': {
- click: function(btn){
- me.FormUtil.onDelete((Ext.getCmp('ay_id').value));
- }
- },
- 'erpCloseButton': {
- click: function(btn){
- parent.window.location.href = parent.window.location.href;
- this.FormUtil.beforeClose(this);
- }
- },
- 'button[id=delete]': {
- click: function(){
- me.vastDelete();
- }
- }
- });
- },
- getForm: function(btn){
- return btn.ownerCt.ownerCt;
- },
-
- openTab : function (panel,id){
- var o = (typeof panel == "string" ? panel : id || panel.id);
- var main = parent.Ext.getCmp("content-panel");
- var tab = main.getComponent(o);
- if (tab) {
- main.setActiveTab(tab);
- } else if(typeof panel!="string"){
- panel.id = o;
- var p = main.add(panel);
- main.setActiveTab(p);
- }
- },
- vastDelete: function(){
- var grid = Ext.getCmp('grid');
- var records = grid.selModel.getSelection();
- if(records.length > 0){
- var id = new Array();
- Ext.each(records, function(record, index){
- id[index] = record.data[keyField];
- });
- var main = parent.Ext.getCmp("content-panel");
- main.getActiveTab().setLoading(true);//loading...
- Ext.Ajax.request({
- url : basePath + 'common/vastDelete.action',
- params: {
- caller: caller,
- id: id
- },
- method : 'post',
- callback : function(options,success,response){
- main.getActiveTab().setLoading(false);
- var localJson = new Ext.decode(response.responseText);
- if(localJson.exceptionInfo){
- showError(localJson.exceptionInfo);
- return "";
- }
- if(localJson.success){
- Ext.Msg.alert("提示", "删除成功!", function(){
- window.location.href = window.location.href;
- });
- }
- }
- });
- }
- }
- });
|