ListUi
获取选中id
List ids = getSelectedIdValues();
//获取选中id
var uiCtx=pluginCtx.getUI();
var mode = 0;
var tblMain = pluginCtx.getKDTable("tblMain");
var blockList = tblMain.getSelectManager().getBlocks();
if ((blockList != null) && (blockList.size() == 1)) {
mode = (tblMain.getSelectManager().getBlocks().get(0)).getMode();
}
var selectList = new java.util.ArrayList();
var selectKeyIdFields = null;
var selectRows = com.kingdee.bos.ctrl.kdf.table.util.KDTableUtil.getSelectedRows(tblMain);
var idList = com.kingdee.eas.framework.client.ListUiHelper.getSelectedIdValues(tblMain, "id", selectList, selectKeyIdFields);
var size =idList.size();
com.kingdee.eas.util.client.MsgBox.showInfo("选中条数"+size);
获取所有分录id
int row = tblMain.getRowCount();
for(int i=0;i<row;i++){
IRow rows = tblMain.getRow(i);
String id = rows.getCell("entry.id").getValue().toString();
}
清空分录
this.kdtEntrys.removeRows();//清空分录数据
storeFields();
筛选过滤
EntityViewInfo view = new EntityViewInfo();//视图,用来指定返回哪些数据
FilterInfo filterInfo = new FilterInfo();//过滤条件,相当于where后的条件
filterInfo.getFilterItems().add(new FilterItemInfo("periodType.id", "6yEAAAAABCdfaYmm"));
filterInfo.getFilterItems().add(new FilterItemInfo("number", sb.toString(),CompareType.INCLUDE));
view.setFilter(filterInfo); //筛选条件(不指定时查所有数据)
prmtperiod.setEntityViewInfo(view);
获取单选框的值
this.chknotPosting.getSelectState();
刷新
refreshList();
EditUI
访问数据库
IRowSet rowSet = SQLExecutorFactory.getRemoteInstance("/*dialect*/" + sql).executeSQL();
while (rowSet.next()){
String bigTypeName = rowSet.getString("bigTypeName")
}
boolean fh=SQLFacadeFactory.getRemoteInstance().exeSQL(insertSQL);
获取上下文、登录人、组织公司
Context ctx = WafContext.getInstance().getContext();
//获取当前登录人
UserInfo currentUserInfo = SysContext.getSysContext().getCurrentUserInfo();
//获取控制单元
OrgUnitInfo currentOrgUnit = SysContext.getSysContext().getCurrentOrgUnit();
//获取当前公司
CompanyOrgUnitInfo companyInfo = SysContext.getSysContext().getCurrentFIUnit();
//设置值
OtherIssueBillInfo editData2 = this.editData;
editData2.setAuditor(currentUserInfo);//设置当前登陆人
获取页面控件数据
OtherIssueBillInfo editData2 = this.editData;
表头和分录监听onLoad()
EAS代码添加控件,按钮,添加权限
二开控件如何赋值
editData.put("gsPayAccount", wbzhbh);
loadFields();
刷新
loadFields();
千分位
row.getCell("curPeriodAmt").getStyleAttributes().setNumberFormat("###,###,###,##0.00");
右对齐
row.getCell("curPeriodAmt").getStyleAttributes().setHorizontalAlign(HorizontalAlignment.RIGHT);//设置右对齐
弹框
https://www.cnblogs.com/ketoli/p/17540385.html
int choice = MsgBox.showConfirm2(this,"保存成功");
MsgBox.showInfo("发送成功");
Integer integer = MsgBox.showConfirm2("存在已提交或已审核的冲销凭证是否删除?");
if(0==integer){ com.kingdee.eas.custom.fanwei.fwAffairsFacade.AffairsFacadeFactory.getRemoteInstance().fanRedVoucher("","","","","","");
}else if(2==integer){
}
throw new EASBizException(new NumericExceptionSubItem("2", "拆分比例不能大于100"));
关闭窗口
this.disposeUIWindow();
跳出
com.kingdee.eas.util.SysUtil.abort();//跳出
设置控件不可用,分录不可用
this.contNumber.setVisible(true);//设置控件前面的字是否显示
this.txtNumber.setEnabled(false);//设置输入框是否可编辑
this.txtNumber.setVisible(true);//设置输入框是否显示
this.kdtEntrys.getColumn("propertyType").getStyleAttributes().setLocked(true);
获取编辑界面所有数据
LedMaterialSplitEntryCollection entrys = editData.getEntrys();
访问数据库
String sql = "UPDATE T_AP_PAYREQUESTBILLENTRY SET CFPLANNO = '" + planNo + "' WHERE FPARENTID = '" + id + "'";
logger.error("==sqlTuiSong==" + sql);
ISqlFacade remoteInstance = SqlFacadeFactory.getRemoteInstance();
int j = remoteInstance.executeSql(sql);
获取分录行、设置值、清空分录
com.kingdee.eas.custom.gz.client.ZjqkhzEditUI.initUIContentLayout()
IRow row = this.kdtEntrys.addRow();
row.getCell("bz").setValue("人民币");
row.getCell("cklx").setValue(calObj.get("cklx").toString());//存款类型
kdtEntrys.removeRows();//清空分录
修改扩展字段
import com.kingdee.bos.metadata.entity.SelectorItemCollection;
selectorItemCollection selectorItemCollection = new SelectorItemCollection();
selectorItemCollection.add(new SelectorItemInfo("GSReturnInfo"));
PayRequestBillFactory.getLocalInstance(ctx).updatePartial(payRequestBillInfo2,selectorItemCollection);