| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- Ext.QuickTips.init();
- Ext.define('erp.controller.scm.purchase.Country', {
- extend: 'Ext.app.Controller',
- FormUtil: Ext.create('erp.util.FormUtil'),
- BaseUtil: Ext.create('erp.util.BaseUtil'),
- views:[
- 'scm.purchase.Country','core.form.Panel','core.button.Add','core.button.Save','core.button.Close',
- 'core.button.Update','core.button.Delete','core.trigger.TextAreaTrigger',
- 'core.form.YnField'
- ],
- init:function(){
- var me = this;
- this.control({
- 'erpSaveButton': {
- click: function(btn){
- var form = me.getForm(btn);
- if(Ext.getCmp(form.codeField).value == null || Ext.getCmp(form.codeField).value == ''){
- me.BaseUtil.getRandomNumber();//自动添加编号
- }
- this.FormUtil.beforeSave(this);
- }
- },
- 'erpCloseButton': {
- click: function(btn){
- this.FormUtil.beforeClose(this);
- }
- },
- 'erpUpdateButton': {
- click: function(btn){
- this.FormUtil.onUpdate(this);
- }
- },
- 'erpDeleteButton': {
- click: function(btn){
- me.FormUtil.onDelete(Ext.getCmp('co_id').value);
- }
- },
- 'erpAddButton': {
- click: function(){
- me.FormUtil.onAdd('addContry', '新增国家', 'jsps/scm/purchase/country.jsp');
- }
- },
- });
- },
- getForm: function(btn){
- return btn.ownerCt.ownerCt;
- }
- });
|