|
@@ -0,0 +1,104 @@
|
|
|
+package q1k2.study.hr.plugin.list.train.req;
|
|
|
+
|
|
|
+import kd.bos.entity.datamodel.events.PackageDataEvent;
|
|
|
+import kd.bos.form.control.EntryGrid;
|
|
|
+import kd.bos.form.control.OperationColumn;
|
|
|
+import kd.bos.form.events.BeforeCreateListColumnsArgs;
|
|
|
+import kd.bos.form.events.BeforeCreateListDataProviderArgs;
|
|
|
+import kd.bos.form.operatecol.OperationColItem;
|
|
|
+import kd.bos.list.BillList;
|
|
|
+import kd.bos.list.IListColumn;
|
|
|
+import kd.bos.list.ListGridView;
|
|
|
+import kd.bos.list.ListOperationColumn;
|
|
|
+import kd.bos.list.column.ListOperationColumnDesc;
|
|
|
+import kd.bos.list.plugin.AbstractListPlugin;
|
|
|
+import kd.sdk.plugin.Plugin;
|
|
|
+
|
|
|
+import java.util.EventObject;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 标准单据列表插件
|
|
|
+ */
|
|
|
+public class TrainReqListPlugin extends AbstractListPlugin implements Plugin {
|
|
|
+
|
|
|
+ @Override
|
|
|
+
|
|
|
+ public void initialize() {
|
|
|
+
|
|
|
+ BillList entryGrid = this.getControl(AbstractListPlugin.BILLLISTID);
|
|
|
+
|
|
|
+ entryGrid.addPackageDataListener(pkEvent -> {
|
|
|
+
|
|
|
+ Object status = pkEvent.getRowData().get("billstatus");
|
|
|
+
|
|
|
+ if (pkEvent.getSource() instanceof ListOperationColumnDesc
|
|
|
+
|
|
|
+ && "q1k2_listoperationcolumna".equalsIgnoreCase(((ListOperationColumnDesc) pkEvent.getSource()).getKey())) {
|
|
|
+
|
|
|
+ List<OperationColItem> operationColItems = (List<OperationColItem >) pkEvent.getFormatValue();
|
|
|
+
|
|
|
+ for (OperationColItem operationColItem : operationColItems) {
|
|
|
+ if ((("modify".equalsIgnoreCase(operationColItem.getOperationKey()))
|
|
|
+ || ("audit".equalsIgnoreCase(operationColItem.getOperationKey()))
|
|
|
+ )) {
|
|
|
+ if(("unsubmit".equalsIgnoreCase(operationColItem.getOperationKey())) && "C".equals(status)) {
|
|
|
+ operationColItem.setVisible(false);
|
|
|
+ operationColItem.setLocked(true);
|
|
|
+ }else if("B".equals(status)){
|
|
|
+ operationColItem.setVisible(false);
|
|
|
+ operationColItem.setLocked(true);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ });
|
|
|
+
|
|
|
+ super.initialize();
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void beforeCreateListColumns(BeforeCreateListColumnsArgs args) {
|
|
|
+ super.beforeCreateListColumns(args);
|
|
|
+ ((ListOperationColumn) args.getListColumn("q1k2_listoperationcolumna")).getOperationColItems();
|
|
|
+ //((BillList)this.getControl(AbstractListPlugin.BILLLISTID)).getRowData(0,1);
|
|
|
+ // TODO 在此添加业务逻辑
|
|
|
+ }
|
|
|
+ @Override
|
|
|
+ public void beforeCreateListDataProvider(BeforeCreateListDataProviderArgs args) {
|
|
|
+ super.beforeCreateListDataProvider(args);
|
|
|
+ // TODO 在此添加业务逻辑
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * @description:
|
|
|
+ * 界面初始化或刷新,新建表单数据包成功,并给字段填写了默认值之后,触发此事件。
|
|
|
+ * 新增时初始化消毒等级
|
|
|
+ * @author: lhbj
|
|
|
+ * @date: 11/4/2024 下午6:16
|
|
|
+ * @param: e
|
|
|
+ * @return:void
|
|
|
+ **/
|
|
|
+ @Override
|
|
|
+ public void afterCreateNewData(EventObject e) {
|
|
|
+ super.afterCreateNewData(e);
|
|
|
+
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * @description:
|
|
|
+ * 插件可以在此事件,根据各字段值数据,重新设置控件、字段的可用、可见性等。
|
|
|
+ *
|
|
|
+ * 不要在此事件,修改字段值。
|
|
|
+ * @author: lhbj
|
|
|
+ * @date: 11/4/2024 下午7:00
|
|
|
+ * @param: e
|
|
|
+ * @return:void
|
|
|
+ **/
|
|
|
+ @Override
|
|
|
+ public void afterBindData(EventObject e) {
|
|
|
+ super.afterBindData(e);
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+}
|