eas金蝶dep界面控件基本操作笔记

pluginCtx.getUIContext();获取客户端上下文与后台代码 UIContext map = new UIContext(this); 一致
pluginCtx.getOprtState().equals(“ADDNEW”);//获取页面的状态(如:弹窗、新窗口等等)
pluginCtx.getKDBizPromptBox(“prmtOrderCustomer”).setValue(a);//给单头f7控件赋值其中prmtOrderCustomer为自己页面f7控件的名称
pluginCtx.getKDTable(“detailTable”).getHeadRow(0).getCell(“lot”).setValue(“物流码”);//设置分录列名称
//给分录f7设置默认值
var id=“HYgAAAAHzbZECefw”;
// 获取币别远程接口
var inter = com.kingdee.bos.BOSObjectFactory.createRemoteCommonBOSObject(new com.kingdee.bos.metadata.MetaDataPK(“com.kingdee.eas.basedata.master.material.app.Material”));
// 将id转换为ObjectUuidPK
var pk = new com.kingdee.bos.dao.ormapping.ObjectUuidPK(com.kingdee.bos.util.BOSUuid.read(id));
// 获取id对应的币别对象
var currency= inter.getValue(pk);
//pluginCtx.getKDTable(“kdtEntries”).getCell(0,“material”).setValue(currency);
pluginCtx.getKDTable(“kdtEntries”).getColumn(“material”).getEditor().getComponent().setValue(currency);
pluginCtx.getKDTable(“kdtEntries”).getColumn(“taxPrice”).getEditor().getComponent().setValue(currency);
// KDTable增加鼠标事件监听
pluginCtx.getKDTable(“kdtEntrys”).addKDTMouseListener(function(event,methodName){
if(event.getClickCount() == 2){
} else if(event.getClickCount() == 1){
}
});

// KDTable增加单元格Active事件监听
pluginCtx.getKDTable(“kdtEntrys”).addKDTActiveCellListener(function(event,methodName){
var table = (com.kingdee.bos.ctrl.kdf.table.KDTable)
e.getSource();
var preLine = event.getPrevRowIndex();//当前行到鼠标上一次点击的行数
var line = event.getRowIndex();//当前行号
});

//获取文本框对象
var textFiled= pluginCtx.getKDTextFiled (“textFiled”);
// 添加监听事件
textFiled.addActionListener(function(event){
com.kingdee.eas.util.client.MsgBox.showInfo(“文本框值改变事件”);
});

// 添加焦点事件
textFiled.addFocusListener(function(event, methodName){
com.kingdee.eas.util.client.MsgBox.showInfo(“焦点事件”);
// 获得焦点事件
if(methodName == “focusGained”){
com.kingdee.eas.util.client.MsgBox.showInfo(“获得焦点事件”);
}
// 失去焦点事件
if(methodName == “focusLost”){
com.kingdee.eas.util.client.MsgBox.showInfo(“失去焦点事件”);
}
});

// 添加鼠标事件
textFiled.addMouseListener (function(event, methodName){
com.kingdee.eas.util.client.MsgBox.showInfo(“鼠标事件”);
// 鼠标单击事件
if(methodName == “mouseClicked”){
com.kingdee.eas.util.client.MsgBox.showInfo(“鼠标单击事件”);
}
// 鼠标按下事件
if(methodName == “mousePressed”){
com.kingdee.eas.util.client.MsgBox.showInfo(“鼠标按下事件”);
}
// 鼠标抬起事件
if(methodName == “mouseReleased”){
com.kingdee.eas.util.client.MsgBox.showInfo(“鼠标抬起事件”);
}
// 鼠标滑入事件
if(methodName == “mouseEntered”){
com.kingdee.eas.util.client.MsgBox.showInfo(“鼠标滑入事件”);
}
// 鼠标滑出事件
if(methodName == “mouseExited”){
com.kingdee.eas.util.client.MsgBox.showInfo(“鼠标滑出事件”);
}
});

pluginCtx.getKDTable(“kdtEntrys”).getColumn(“Developmentprojects05”).getEditor().getComponent().setEntityViewInfo(entityViewInfo);给分录设置过滤

//DEP执行java后台的sql接口
var easImporter = JavaImporter();
easImporter.importPackage(Packages.com.kingdee.bos.util);
easImporter.importPackage(Packages.com.kingdee.eas.util);
easImporter.importPackage(Packages.com.kingdee.eas.util.app);
easImporter.importPackage(Packages.com.kingdee.eas.scm.common.util);
easImporter.importPackage(Packages.com.kingdee.bos.dao.query);
//dep导入sql执行的接口
easImporter.importPackage(Packages.com.kingdee.jdbc.rowset);
with(easImporter){
var df=new java.text.SimpleDateFormat(“yyyy-MM-dd”);
var date = new java.util.Date();
var d = java.util.Calendar.getInstance();
var time = date.getTime();
d.setTime(new java.sql.Timestamp(time));
d.add(java.util.Calendar.DAY_OF_MONTH, -30);
var starttime=df.format(d.getTime());
var endtime=df.format(date);
pluginCtx.getKDTextField(“txtJDJFPH”).addFocusListener(function(event, methodName){
if(methodName == “focusGained”){
}
if(methodName == “focusLost”){
var sb = new java.lang.StringBuffer();
sb.append(“select CFJDJFPH from T_SD_SaleOrder where CFJDJFPH =’”+pluginCtx.getKDTextField(“txtJDJFPH”).getText()+"’ and FBIZDATE >=’"+starttime+"’ and FBIZDATE <=’"+endtime+"’" );
var isql=SQLExecutorFactory.getRemoteInstance(sb.toString());
var JDJFPH=null;
var rest = isql.executeSQL();
while(rest.next()){
JDJFPH=rest.getString(1);
}
if(JDJFPH==pluginCtx.getKDTextField(“txtJDJFPH”).getText()){
com.kingdee.eas.util.client.MsgBox.showInfo(“发票号码:”+JDJFPH+" 已经存在,请重新输入!");
pluginCtx.getKDTextField(“txtJDJFPH”).setStringValue("");
}
}
});
}
}

你可能感兴趣的:(eas金蝶dep界面控件基本操作笔记)