⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dc0020.js

📁 extjs+oracle+ erpcrm
💻 JS
📖 第 1 页 / 共 2 页
字号:
       this.fields.add("LINE_NO", new Ext.form.TextField ({xtype: "textfield",name:"LINE_NO",id:"DC0020F_LINE_NO",dataIndex:"LINE_NO",width:80,allowBlank:false,labelSeparator:":*" ,fieldLabel: this.resourceBundle.FieldLabel.LINE_NO||"Line_no",insert_allowed:true,update_allowed:true})   );
       this.fields.add("IINVITEM_ID", new Ext.form.Hidden ({xtype: "hidden",name:"IINVITEM_ID",id:"DC0020F_IINVITEM_ID",dataIndex:"IINVITEM_ID",width:100,allowBlank:true,fieldLabel: this.resourceBundle.FieldLabel.IINVITEM_ID||"Invitem_id",insert_allowed:true,update_allowed:true})   );

       this.layoutItems.add("Cost",
             { xtype:"fieldset", title:this.resourceBundle.FieldsetTitle.Cost||"Cost",autoHeight:true,collapsible: true,width:"90%",items:[ this.fields.get("PRICE"),this.fields.get("CURRENCY"),this.fields.get("NET_AMOUNT"),this.fields.get("TAX_ID"),this.fields.get("TAX_NAME"),this.fields.get("TAX_RATE"),this.fields.get("TAX_AMOUNT")]});
       this.layoutItems.add("Notes",
             { xtype:"fieldset", title:this.resourceBundle.FieldsetTitle.Notes||"Notes",autoHeight:true,collapsible: true,labelWidth:1,width:"90%",items:[ this.fields.get("NOTES")]});
       this.layoutItems.add("C2",
             { layout:"form",columnWidth:.5, items:[ this.layoutItems.get("Cost"),this.layoutItems.get("Notes")]}); 
       this.layoutItems.add("Product",
             { xtype:"fieldset", title:this.resourceBundle.FieldsetTitle.Product||"Product",autoHeight:true,collapsible: true,width:"90%",items:[ this.fields.get("PROD_ID"),this.fields.get("PROD_CODE"),this.fields.get("PROD_NAME"),this.fields.get("SALES_ACCT"),this.fields.get("QUANTITY"),this.fields.get("QUANTITY_UNIT"),this.fields.get("ORIG_PRICE"),this.fields.get("ORIG_CURRENCY"),this.fields.get("CURRENCY_XRATE")]});
       this.layoutItems.add("C1",
             { layout:"form",columnWidth:.5, items:[ this.fields.get("ID"),this.fields.get("IINV_ID"),this.fields.get("LINE_NO"),this.fields.get("IINVITEM_ID"),this.layoutItems.get("Product")]}); 


       Ext.apply(this, {
           items:[this.fields.get("_p_record_status"),this.layoutItems.get("C1"),this.layoutItems.get("C2")]
          ,border:false
          ,layout:"column"
          ,defaults:{labelWidth:110}
          ,frame:true
          ,width: "100%"
          ,dataComponentName:"DC0020F"
          ,firstFocusFieldName:"PROD_CODE"
          ,toolbarConfig:"STANDARD"
        });

        
       N21.DataComp.DC0020F.superclass.initComponent.apply(this, arguments);
     }

    ,onRender:function() {
       N21.DataComp.DC0020F.superclass.onRender.apply(this, arguments);
     }

    ,newDataRecord:function() {
       return new this.dataRecordMeta({_p_record_status:"insert"
              ,IINV_ID:""
              ,ID:""
              ,PROD_CODE:""
              ,PROD_ID:""
              ,PROD_NAME:""
              ,SALES_ACCT:""
              ,QUANTITY:""
              ,QUANTITY_UNIT:""
              ,ORIG_PRICE:""
              ,ORIG_CURRENCY:""
              ,CURRENCY_XRATE:""
              ,PRICE:""
              ,CURRENCY:""
              ,NET_AMOUNT:""
              ,TAX_NAME:""
              ,TAX_RATE:""
              ,TAX_ID:""
              ,TAX_AMOUNT:""
              ,NOTES:""
              ,LINE_NO:""
              ,CREATEDON:""
              ,CREATEDBY:""
              ,MODIFIEDON:""
              ,MODIFIEDBY:""
              ,IINVITEM_ID:""});
     }

  ,change_CURRENCY_XRATE:function(fld, newVal, oldVal) {
    if ( !Ext.isEmpty(newVal) &&  !Ext.isEmpty(this.getFieldValue("ORIG_PRICE"))   ) {
      this.setFieldValue("PRICE", this.getFieldValue("ORIG_PRICE") * newVal );
 }
   }

  ,change_NET_AMOUNT:function(fld, newVal, oldVal) {
    if ( !Ext.isEmpty(newVal) &&  !Ext.isEmpty(this.getFieldValue("TAX_RATE"))   ) {
      this.setFieldValue("TAX_AMOUNT", this.getFieldValue("NET_AMOUNT") *  this.getFieldValue("TAX_RATE"));
 } else { 
  this.setFieldValue("TAX_AMOUNT", "" );      
 }
   }

  ,change_PRICE:function(fld, newVal, oldVal) {
    if ( !Ext.isEmpty(newVal) &&  !Ext.isEmpty(this.getFieldValue("QUANTITY"))   ) {
      this.setFieldValue("NET_AMOUNT", this.getFieldValue("PRICE") *  this.getFieldValue("QUANTITY"));
 }
   }

  ,change_QUANTITY:function(fld, newVal, oldVal) {
    if ( !Ext.isEmpty(newVal) &&  !Ext.isEmpty(this.getFieldValue("PRICE"))   ) {
      this.setFieldValue("NET_AMOUNT", this.getFieldValue("PRICE") *  this.getFieldValue("QUANTITY"));
 }
   }

  ,change_TAX_RATE:function(fld, newVal, oldVal) {
    if ( !Ext.isEmpty(this.getFieldValue("TAX_RATE")) ) {
   if ( !Ext.isEmpty(this.getFieldValue("NET_AMOUNT")) ) {
      this.setFieldValue("TAX_AMOUNT", this.getFieldValue("TAX_RATE") *  this.getFieldValue("NET_AMOUNT"));
    } 
 } else { 
  this.setFieldValue("TAX_AMOUNT", "" );      
 }
   }


  });
  Ext.reg("DC0020F", N21.DataComp.DC0020F);

/** 
 * DataControl: Grid with Edit Form
 * Code: DC0020
 * Title: Issued invoice items
 */ 

  Ext.ns("N21.DataComp");
  N21.DataComp.DC0020 = Ext.extend(N21.Base.GridEditForm, {

     initComponent:function() {
       Ext.apply(this, {
           autoScroll:false
          ,layout:"border"
          ,dataComponentName:"DC0020"
          ,masterName:"DC0020G"
          ,detailName:"DC0020F"
          ,mdLayout:"card"
          ,border: false
          ,items: [
              {
                xtype:"panel"
               ,layout:"card"
               ,id:"MDTab"
               ,region:"center"
               ,defaults:{layout:"fit"}
               ,activeItem:0
               ,tabPosition: "bottom"
               ,items: [{
                            xtype: "DC0020G"
                           ,id: "DC0020G"
                           ,height:180
                       },{
                           xtype:"DC0020F"
                          ,id:"DC0020F"
                          ,height:180
                          ,frame:true
                          ,autoScroll:true
                          ,layout:"form"
                       }]
             }

            ]
          ,tbar: new Array(
          new Ext.Toolbar.Button({  id:"tlb_FILTER"  ,xtype:"button" ,cls:"x-btn-icon" ,icon:"_static/icon/g_rec_src.png" ,tooltip:"Apply filter" ,handler: this.executeQuery ,scope :this})
          ,new Ext.Toolbar.Separator()
          ,new Ext.Toolbar.Button({  id:"tlb_SAVE"  ,xtype:"button" ,cls:"x-btn-icon" ,icon:"_static/icon/g_rec_commit.png" ,tooltip:"Save changes <Ctrl+S>" ,handler: this.commitForm ,scope :this})
          ,new Ext.Toolbar.Button({  id:"tlb_NEW"  ,xtype:"button" ,cls:"x-btn-icon" ,icon:"_static/icon/g_rec_new.png" ,tooltip:"Create new record <Ctrl+N>" ,handler: this.createNewRecord ,scope :this})
          ,new Ext.Toolbar.Button({  id:"tlb_DELETE"  ,xtype:"button" ,cls:"x-btn-icon" ,icon:"_static/icon/g_rec_del.png" ,tooltip:"Delete record <Ctrl+D>" ,handler: this.deleteRecord ,scope :this})
          ,new Ext.Toolbar.Separator()
          ,new Ext.Toolbar.Button({  id:"tlb_LIST_EDITOR_MODE"  ,xtype:"button" ,cls:"x-btn-icon" ,icon:"_static/icon/g_rec_upd.png" ,tooltip:"Editor<Enter>, List<Ctrl+Q>" ,handler: this.toggleEditMode ,scope :this})
          ,new Ext.Toolbar.Button({  id:"tlb_REFRESH_RECORD"  ,xtype:"button" ,cls:"x-btn-icon" ,icon:"_static/icon/g_rec_refresh.gif" ,tooltip:"Refresh record" ,handler: this.reloadRecord ,scope :this})
          ,new Ext.Toolbar.Separator()
          ,new Ext.Toolbar.Button({  id:"tlb_PREV_REC"  ,xtype:"button" ,cls:"x-btn-icon" ,icon:"_static/icon/f_rec_prev.gif" ,tooltip:"Previous record" ,handler: this.goToPrevRecord ,scope :this})
          ,new Ext.Toolbar.Button({  id:"tlb_NEXT_REC"  ,xtype:"button" ,cls:"x-btn-icon" ,icon:"_static/icon/f_rec_next.gif" ,tooltip:"Next record" ,handler: this.goToNextRecord ,scope :this})
          ,new Ext.Toolbar.Separator()
          ,new Ext.Toolbar.Button({  id:"tlb_PRINT"  ,xtype:"button" ,cls:"x-btn-icon" ,icon:"_static/icon/print.png" ,tooltip:"Print list" ,handler: this.exportList ,scope :this})
          )
        }); 

       N21.DataComp.DC0020.superclass.initComponent.apply(this, arguments);
     } 
  });
  Ext.reg("DC0020", N21.DataComp.DC0020);



⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -