|
@@ -0,0 +1,72 @@
|
|
|
|
+package fi.em.editPlugin;
|
|
|
|
+
|
|
|
|
+import kd.bos.dataentity.entity.DynamicObject;
|
|
|
|
+import kd.bos.dataentity.entity.DynamicObjectCollection;
|
|
|
|
+import kd.bos.exception.KDBizException;
|
|
|
|
+import kd.bos.form.CloseCallBack;
|
|
|
|
+import kd.bos.form.FormShowParameter;
|
|
|
|
+import kd.bos.form.ShowType;
|
|
|
|
+import kd.bos.form.events.AfterDoOperationEventArgs;
|
|
|
|
+import kd.bos.list.plugin.AbstractListPlugin;
|
|
|
|
+import kd.sdk.plugin.Plugin;
|
|
|
|
+
|
|
|
|
+public class BusinessProcessingEditPlugin extends AbstractListPlugin implements Plugin {
|
|
|
|
+ public static String btn_NOTICE = "fkf"; //操作
|
|
|
|
+ public static String btn_NOTICES = "skf"; //操作
|
|
|
|
+ public static String nckd_agentparameterf7 = "nckd_agentparameterf7";//动因参数动态列表
|
|
|
|
+ private static String bos_org = "bos_org"; //组织金额标识
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void afterDoOperation(AfterDoOperationEventArgs e) {
|
|
|
|
+ String operateKey = e.getOperateKey();
|
|
|
|
+ if (btn_NOTICE.equals(e.getOperateKey())) { //切换付款方
|
|
|
|
+ Object value = this.getModel().getValue("costcompany");//获取当前单据费用公司
|
|
|
|
+ DynamicObjectCollection expenseentryentityWait = this.getModel().getEntryEntity("expenseentryentity_wait");
|
|
|
|
+ DynamicObject dynamicObject = expenseentryentityWait.get(0);
|
|
|
|
+ DynamicObject entrycostcompanyWait = dynamicObject.getDynamicObject("entrycostcompany_wait");
|
|
|
|
+ if(entrycostcompanyWait==null){
|
|
|
|
+ throw new KDBizException("待摊明细分录为空!");
|
|
|
|
+ }
|
|
|
|
+ String orgnumber = entrycostcompanyWait.getString("number");//公司编码
|
|
|
|
+ String orgid = entrycostcompanyWait.getString("id");//公司id
|
|
|
|
+ if (orgnumber == null){
|
|
|
|
+ throw new KDBizException("付费承担公司为空!");
|
|
|
|
+ }
|
|
|
|
+ showParameter(nckd_agentparameterf7, btn_NOTICE,orgnumber,orgid);//调用弹出页面
|
|
|
|
+ }else if (btn_NOTICES.equals(e.getOperateKey())) { //切换收款方
|
|
|
|
+ Object value = this.getModel().getValue("costcompany");//获取当前单据费用公司
|
|
|
|
+ DynamicObjectCollection expenseentryentityWait = this.getModel().getEntryEntity("expenseentryentity_wait");
|
|
|
|
+ DynamicObject dynamicObject = expenseentryentityWait.get(0);
|
|
|
|
+ DynamicObject entrycostcompanyWait = dynamicObject.getDynamicObject("entrycostcompany_wait");
|
|
|
|
+ if(entrycostcompanyWait==null){
|
|
|
|
+ throw new KDBizException("待摊明细分录为空!");
|
|
|
|
+ }
|
|
|
|
+ String orgnumber = entrycostcompanyWait.getString("number");//公司编码
|
|
|
|
+ String orgid = entrycostcompanyWait.getString("id");//公司id
|
|
|
|
+ if (orgnumber == null){
|
|
|
|
+ throw new KDBizException("付费承担公司为空!");
|
|
|
|
+ }
|
|
|
|
+ showParameter(nckd_agentparameterf7, btn_NOTICE,orgnumber,orgid);//调用弹出页面
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public void showParameter(String formId, String actionId,String orgnumber,String orgid) {
|
|
|
|
+ //创建弹出页面对象,FormShowParameter表示弹出页面为动态表单
|
|
|
|
+ FormShowParameter ShowParameter = new FormShowParameter();
|
|
|
|
+ //ListShowParameter ShowParameter = new ListShowParameter();
|
|
|
|
+ ShowParameter.setCustomParam("orgnumber", orgnumber);
|
|
|
|
+ ShowParameter.setCustomParam("orgid", orgid);
|
|
|
|
+ //设置弹出页面的编码
|
|
|
|
+ ShowParameter.setFormId(formId);
|
|
|
|
+// ShowParameter.setCaption();
|
|
|
|
+ //设置弹出页面标题
|
|
|
|
+ ShowParameter.setCaption("动因参数选择");
|
|
|
|
+ //设置页面关闭回调方法
|
|
|
|
+ //CloseCallBack参数:回调插件,回调标识 btnok
|
|
|
|
+ ShowParameter.setCloseCallBack(new CloseCallBack(this, actionId));
|
|
|
|
+ //设置弹出页面打开方式,支持模态,新标签等
|
|
|
|
+ ShowParameter.getOpenStyle().setShowType(ShowType.Modal);
|
|
|
|
+ //弹出页面对象赋值给父页面
|
|
|
|
+ this.getView().showForm(ShowParameter);
|
|
|
|
+ }
|
|
|
|
+}
|