|
|
@@ -1,7 +1,11 @@
|
|
|
package nckd.jimin.jyyy.bd.plugin.workflow;
|
|
|
|
|
|
+import kd.bos.form.IFormView;
|
|
|
+import kd.bos.form.IPageCache;
|
|
|
import kd.bos.workflow.design.plugin.AbstractWorkflowPlugin;
|
|
|
+import kd.bos.workflow.engine.WfUtils;
|
|
|
import java.util.EventObject;
|
|
|
+import static kd.bos.workflow.taskcenter.plugin.util.ApprovalPluginUtil.isPCShow;
|
|
|
|
|
|
/**
|
|
|
* 会签节点审批意见不允许修改
|
|
|
@@ -14,12 +18,36 @@ public class ApprovalPageFieldEnablePlugin extends AbstractWorkflowPlugin {
|
|
|
public void afterBindData(EventObject e) {
|
|
|
super.afterBindData(e);
|
|
|
|
|
|
- String entityName = this.getPageCache().get("entitynumber");
|
|
|
- String curnode = this.getPageCache().get("CURNODE");
|
|
|
+ IFormView view = this.getView();
|
|
|
+ boolean isPcShow = isPCShow(view.getFormShowParameter());
|
|
|
|
|
|
- //控制审批意见锁定:商旅对账单
|
|
|
- if("nckd_bustravelcheckbill".equals(entityName) && curnode.contains("YunzhijiaTask")) {
|
|
|
- this.getView().setEnable(false, "msg_approval");
|
|
|
+ if (!WfUtils.isNullObject(view)) {
|
|
|
+ IPageCache pageCache;
|
|
|
+ String fieldName = "";
|
|
|
+
|
|
|
+ if (isPcShow) {
|
|
|
+ pageCache = view.getPageCache();
|
|
|
+
|
|
|
+ fieldName = "msg_approval";
|
|
|
+ } else {
|
|
|
+ IFormView parentView = view.getParentView();
|
|
|
+ if (WfUtils.isNullObject(parentView)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ pageCache = parentView.getPageCache();
|
|
|
+
|
|
|
+ fieldName = "approvalmsg";
|
|
|
+ }
|
|
|
+
|
|
|
+ String entityName = pageCache.get("entitynumber");
|
|
|
+ String curnode = pageCache.get("CURNODE");
|
|
|
+
|
|
|
+ //控制审批意见锁定:商旅对账单
|
|
|
+ //approvalmsg
|
|
|
+ if (curnode.contains("YunzhijiaTask")
|
|
|
+ && ("nckd_bustravelcheckbill".equals(entityName) || "nckd_bustravelcheckbill_mob".equals(entityName))) {
|
|
|
+ this.getView().setEnable(false, fieldName);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|