var easImporter = JavaImporter();
easImporter.importPackage(Packages.com.kingdee.bos.ctrl.extendcontrols)
;easImporter.importPackage(Packages.com.kingdee.bos.metadata.entity)
;easImporter.importPackage(Packages.com.kingdee.bos.metadata.query.util)
;easImporter.importPackage(Packages.com.kingdee.bos.util);
easImporter.importPackage(Packages.com.kingdee.bos.metadata.query.util);
easImporter.importPackage(Packages.com.kingdee.bos.ctrl.kdf.table);
easImporter.importPackage(Packages.com.kingdee.bos.ctrl.extendcontrols);
easImporter.importPackage(Packages.com.kingdee.bos.metadata.entity);
easImporter.importPackage(Packages.java.lang);
easImporter.importPackage(Packages.com.kingdee.eas.basedata.person);
easImporter.importPackage(Packages.com.kingdee.bos.ctrl.extendcontrols)
;easImporter.importPackage(Packages.com.kingdee.bos.metadata.entity)
;easImporter.importPackage(Packages.com.kingdee.bos.metadata.query.util)
;easImporter.importPackage(Packages.com.kingdee.bos.util);
easImporter.importPackage(Packages.com.kingdee.bos.metadata.query.util);
easImporter.importPackage(Packages.com.kingdee.bos.ctrl.kdf.table);
easImporter.importPackage(Packages.com.kingdee.bos.ctrl.extendcontrols);
easImporter.importPackage(Packages.com.kingdee.bos.metadata.entity);
easImporter.importPackage(Packages.java.lang);
easImporter.importPackage(Packages.com.kingdee.eas.common.client);
easImporter.importPackage(Packages.com.kingdee.bos.ui.face);
with(easImporter)
{
//分录f7过滤
var entry = pluginCtx.getKDTable("kdtEntries");//获取表格
var filterInfo = new FilterInfo();//过滤filterInfo
var entityViewInfo = new EntityViewInfo();
filterInfo.getFilterItems().add(new FilterItemInfo("isLeaf",'1')); //取末级
filterInfo.getFilterItems().add(new FilterItemInfo("isEnabled",'1')); //取末级
entityViewInfo.setFilter(filterInfo);
var bizPromptBox = new KDBizPromptBox(); //new F7
bizPromptBox.setQueryInfo("com.kingdee.eas.fdc.basedata.app.CurProjectQuery"); //Query
bizPromptBox.setEditable(true);
bizPromptBox.setDisplayFormat("$name$");
bizPromptBox.setEditFormat("$number$");
bizPromptBox.setCommitFormat("$number$");
bizPromptBox.setEntityViewInfo(entityViewInfo);
entry.getColumn("curProjects").setEditor(new KDTDefaultCellEditor(bizPromptBox));
var prmtlxPerson= pluginCtx.getKDBizPromptBox("prmtlxPerson");
prmtlxPerson.addDataChangeListener(function (event){
if(prmtlxPerson.getValue()!=null){
var personInfo = pluginCtx.getKDBizPromptBox("prmtlxPerson").getValue();
pluginCtx.getKDTextField("txttelPhone").setText(personInfo.getCell());
}
});
var ui=pluginCtx.getUI();
F7XRHelper.personF7(ui, pluginCtx.getKDBizPromptBox("prmtsqPerson"));//将人员构建成左树右表
if(pluginCtx.getOprtState() == OprtState.ADDNEW){
var personinfo=SysContext.getSysContext().getCurrentUserInfo().getPerson();
pluginCtx.getKDBizPromptBox("prmtsqPerson").setValue(personinfo);
var gkdeparment= PersonXRHelper.getPosiMemByDeptUser(personinfo);
pluginCtx.getKDBizPromptBox("prmtsqDeparment").setValue(gkdeparment);
}
var roadMap = pluginCtx.getKDBizPromptBox("prmtcgContract");
var okkDButton= pluginCtx.getKDButton("viewContract");
okkDButton.addActionListener(function(event){
if(roadMap.getValue()!=null){
var uiContext = new UIContext(this);
var id =roadMap.getValue().getId();
uiContext.put("ID", id);
var uiWindow = com.kingdee.bos.ui.face.UIFactory.createUIFactory("com.kingdee.eas.base.uiframe.client.UINewFrameFactory").create("com.kingdee.eas.scm.sm.pur.client.PurContractEditUI", uiContext, null, OprtState.VIEW);
uiWindow.show();
}
});
}
推荐阅读