// === EIP4 P4 脚本迁移产出 === // template_id : fb51a8c9-3bd4-4517-b19f-74edcc34f8f7 // template_name: 发薪/扣款计划 // seq : 1 // label : HARD // 硬 S3 原因 : 动态创建 Vaadin Button(无法自动改写形态) // 处置 : 原文保留,进人工排期(amis dialog/service 重写) import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickListener; import com.vaadin.ui.Notification; import com.vaadin.ui.Notification.Type; import com.vaadin.ui.Button.ClickEvent; Button button = new Button("生成明细"); def mgroup = group; button.addClickListener(new ClickListener() { @Override public void buttonClick(ClickEvent event) { def totalmoney = getFieldValue("TOTALMONEY"); def monthsize = getFieldValue("MONTHSIZE"); def monthspace = getFieldValue("MONTHSPACE"); def startmonth = getFieldValue("STARTMONTH"); def startyear = getFieldValue("STARTYEAR"); if(monthsize == null){ Notification.show("请输入月数!", Type.ERROR_MESSAGE); return; } if(monthspace == null){ Notification.show("请输入间隔月数!", Type.ERROR_MESSAGE); return; } if(startyear == null){ Notification.show("请输入开始年!", Type.ERROR_MESSAGE); return; } if(startmonth == null){ Notification.show("请输入开始月!", Type.ERROR_MESSAGE); return; } if(totalmoney == null){ Notification.show("请输入总额!", Type.ERROR_MESSAGE); return; } if(monthspace >=12){ Notification.show("间隔月数要小于12!", Type.ERROR_MESSAGE); return; } if(totalmoney >0){ def m = totalmoney/monthsize; def details = []; def syear = startyear; def smonth = startmonth; for(int i=0;i12){ smonth=1; syear++; } } if(details.size()>0){ bindField("PLANDETAILS",details) } } } }) group.getField("ADDDETAIL")?.parent?.addComponent(button);