📄 dc0060.js
字号:
{ xtype:"fieldset", title:this.resourceBundle.FieldsetTitle.Terms||"Terms",autoHeight:true,collapsible: true,width:"90%",items:[ this.fields.get("DATE_REQUESTED"),this.fields.get("DATE_PROMISED"),this.fields.get("DATE_DELIVERED")]});
this.layoutItems.add("Quantity",
{ xtype:"fieldset", title:this.resourceBundle.FieldsetTitle.Quantity||"Quantity",autoHeight:true,collapsible: true,width:"90%",items:[ this.fields.get("QTY_INVOICED"),this.fields.get("QTY_DELIVERED"),this.fields.get("QTY_RESERVED")]});
this.layoutItems.add("C2",
{ layout:"form",columnWidth:.4, items:[ this.layoutItems.get("Quantity"),this.layoutItems.get("Terms"),this.layoutItems.get("Notes")]});
this.layoutItems.add("Price",
{ xtype:"fieldset", title:this.resourceBundle.FieldsetTitle.Price||"Price",autoHeight:true,collapsible: true,width:"90%",items:[ this.fields.get("PRICE"),this.fields.get("CURRENCY_CODE"),this.fields.get("DISCOUNT"),this.fields.get("DISCOUNT_TYPE"),this.fields.get("RAW_NET_AMOUNT"),this.fields.get("NET_AMOUNT")]});
this.layoutItems.add("Product",
{ xtype:"fieldset", title:this.resourceBundle.FieldsetTitle.Product||"Product",autoHeight:true,collapsible: true,width:"90%",items:[ this.fields.get("ID"),this.fields.get("SORDER_ID"),this.fields.get("LINE_NR"),this.fields.get("PRODUCT_ID"),this.fields.get("PRODUCT_NAME"),this.fields.get("QTY_ORDERED"),this.fields.get("UOM_CODE"),this.fields.get("QTY")]});
this.layoutItems.add("C1",
{ layout:"form",columnWidth:.6, items:[ this.layoutItems.get("Product"),this.layoutItems.get("Price")]});
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:"DC0060F"
,firstFocusFieldName:"PRODUCT_NAME"
,toolbarConfig:"STANDARD"
});
N21.DataComp.DC0060F.superclass.initComponent.apply(this, arguments);
}
,onRender:function() {
N21.DataComp.DC0060F.superclass.onRender.apply(this, arguments);
}
,newDataRecord:function() {
return new this.dataRecordMeta({_p_record_status:"insert"
,SORDER_ID:""
,ID:""
,LINE_NR:""
,PRODUCT_ID:""
,PRODUCT_NAME:""
,QTY_ORDERED:""
,UOM_CODE:""
,QTY:""
,PRICE:""
,CURRENCY_CODE:""
,DISCOUNT:""
,DISCOUNT_TYPE:""
,RAW_NET_AMOUNT:""
,NET_AMOUNT:""
,QTY_INVOICED:""
,QTY_DELIVERED:""
,QTY_RESERVED:""
,DATE_REQUESTED:""
,DATE_PROMISED:""
,DATE_DELIVERED:""
,NOTES:""});
}
,change_PRICE:function(fld, newVal, oldVal) {
this.calcRawNetAmount();
this.calcNetAmount();
}
,change_QTY:function(fld, newVal, oldVal) {
this.calcRawNetAmount();
this.calcNetAmount();
}
,change_QTY_ORDERED:function(fld, newVal, oldVal) {
if (Ext.isEmpty( this.getFieldValue("QTY") )) {
this.setFieldValue("QTY", newVal );
}
}
,calcNetAmount:function() {
if (!Ext.isEmpty(this.getFieldValue("PRICE") )
&& !Ext.isEmpty(this.getFieldValue("QTY") ) ) {
this.setFieldValue("NET_AMOUNT", this.getFieldValue("PRICE") * this.getFieldValue("QTY"));
}
}
,calcRawNetAmount:function() {
if (!Ext.isEmpty(this.getFieldValue("PRICE") )
&& !Ext.isEmpty(this.getFieldValue("QTY") ) ) {
this.setFieldValue("RAW_NET_AMOUNT", this.getFieldValue("PRICE") * this.getFieldValue("QTY"));
}
}
});
Ext.reg("DC0060F", N21.DataComp.DC0060F);
/**
* DataControl: Grid with Edit Form
* Code: DC0060
* Title: Sales order lines
*/
Ext.ns("N21.DataComp");
N21.DataComp.DC0060 = Ext.extend(N21.Base.GridEditForm, {
initComponent:function() {
Ext.apply(this, {
autoScroll:false
,layout:"border"
,dataComponentName:"DC0060"
,masterName:"DC0060G"
,detailName:"DC0060F"
,mdLayout:"card"
,border: false
,items: [
{
xtype:"panel"
,layout:"card"
,id:"MDTab"
,region:"center"
,defaults:{layout:"fit"}
,activeItem:0
,tabPosition: "bottom"
,items: [{
xtype: "DC0060G"
,id: "DC0060G"
,height:350
},{
xtype:"DC0060F"
,id:"DC0060F"
,height:350
,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.DC0060.superclass.initComponent.apply(this, arguments);
}
});
Ext.reg("DC0060", N21.DataComp.DC0060);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -