表单插件常用代码(自用)

String name = e.getProperty().getName();   //获取单据体值变化的属性名称
int rowIndex = e.getChangeSet()[0].getRowIndex(); //获取单据体值变化的行
long orgId = RequestContext.get().getOrgId(); //获取当前登录组织
long orgId = RequestContext.get().getOrgId(); //获取当前登录用户
String billNo = CodeRuleServiceHelper.getNumber(BdBatchConstant.FORMBILLID, info, null); //获取单据编码
String[] billnos = CodeRuleServiceHelper.getBatchNumber(BdBatchConstant.FORMBILLID, info, null,5);//批量获取单据编码
this.getView().invokeOperation("refresh"); //调用刷新按钮
this.getView().setEnable(false,new String[]{"name", "number}); //控件是否可编辑
this.getView().setVisible(Boolean.FALSE, new String[]{ZB_PIGFARM, ZB_PIGFIELD}); //隐藏
((FieldEdit) this.getControl(ZB_PIGFARM)).setMustInput(false); //设置必录
 
HashMap<String, Object> itemMap = new HashMap<>();          
itemMap.put(ClientProperties.Editable, true); //设置文本是否可编辑的属性          
itemMap.put(ClientProperties.ShowEditButton, true); //设置文本是否展示点击按钮的属性        
fieldMap.put(ClientProperties.BackColor, "green"); //设置背景色
this.getView().updateView("控件名称"); //刷新指定控件
fieldMap.put("item", itemMap);   //把属性添加到控件中
this.getView().updateControlMetadata("kdec_textfield", fieldMap);  //同步指定元数据到文本控件 

this.getView().openUrl("https://vip.kingdee.com/");//跳转url

附件默认地址:https://xxx/ierp/attachment/downloadImage/hbnfxm/2050322118578545664/202509/pulic/imageList/80ilu4/1000064002.jpg

//设置日期格式
this.getView().updateControlMetadata(CommonRptConst.SBT_STARTDATE, MapUtil.of(ClientProperties.Item, MapUtil.of(ClientProperties.Mask, "YYYY-MM")));
//设置日期范围
DateRangeEdit endDateControl = this.getControl(DimTplConst.SEARCHDATERANGE);
endDateControl.setMaxDate(curDate);

int rowIndex = this.getModel()getEntryCurrentRowIndex("key")    //获取焦点行索引
int entryRowCount = this.getModel().getEntryRowCount("key"); //获取总行数 
this.getModel().deleteEntryData("key"); //删除行
this.getModel().deleteEntryRow("key", rowIndex); //删除制定行
this.getModel().createNewEntryRow("key"); //新增行
this.getModel().batchCreateNewEntryRow("key", rows); //批量新增行

EntryGrid entryGrid = this.getControl("treeentryentity"); //设置单据体指定行的背景色 
entryGrid.setRowBackcolor("yellow", new int[]{0}); //设置单据体指定单元格的背景色 
ArrayList<CellStyle> cellStyles = new ArrayList<>(); 
CellStyle cellStyle = new CellStyle(); 
cellStyle.setFieldKey("textfield1"); 
cellStyle.setRow(0); cellStyle.setBackColor("blue"); 
cellStyles.add(cellStyle); 
entryGrid.setCellStyle(cellStyles);

//多选基础资料

DynamicObjectCollection collection = dynamicObjects[0].getDynamicObjectCollection(TechniqueConst.SBT_ABSORB_MODE);
for (DynamicObject object : collection) {
    if (modelid.length() > 0) {
        modelid.append(",");
        modelName.append(",");
    }
    DynamicObject mode = object.getDynamicObject("fbasedataid");
    modelid.append(mode.getString(BaseFieldConst.ID));
    modelName.append(mode.getString(BaseFieldConst.NAME));
}

                
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值