NC65审批流“可编辑的单据属性”

2019-11-26  本文已影响0人  把酒对牛
需求

客户需要在审批流中的某一环节对单据进行修改。

方案

系统提供了单据“可编辑单据属性”和“可用按钮”的配置。

IPFWorkflowQry workflowQry = NCLocator.getInstance().lookup(IPFWorkflowQry.class);
// 判断是否存在审批流实例
boolean hasFlowInstance = workflowQry.isApproveFlowStartup(
    bill.getParentVO().getKey(),
    trantypecode);
if (!hasFlowInstance) {
    return ;
}
// 判断是否当前审批人
boolean isCheckman = workflowQry.isCheckman(
    bill.getParentVO().getKey(),trantypecode,
    AppContext.getInstance().getPkUser());
if (!isCheckman) {
    return ;
}
// 获取当前可编辑字段
IWorkflowService service = NCLocator.getInstance().lookup(IWorkflowService.class);
@SuppressWarnings("unchecked")
List<String> props = service.getEditablePreoperties(
    AppContext.getInstance().getPkUser(), trantypecode,
    bill.getParentVO().getKey(),
    WorkflowTypeEnum.Approveflow.getIntValue());
// 只放开指定字段的编辑
BillCardPanel cardPanel = this.getEditor().getBillCardPanel();
cardPanel.setEnabled(false);
if (MMValueCheck.isNotEmpty(this.props)) {
    for (String prop : this.props) {
        cardPanel.getHeadItem(prop).setEnabled(true);
    }
}
效果

实施可以自由配置审批流中单据的编辑,开发不需要频繁更改代码。

上一篇 下一篇

猜你喜欢

热点阅读