// === EIP4 P4 脚本迁移产出 === // template_id : 2cceb83c-4079-43e4-b7b7-c395fd68cbbc // template_name: 建造师注册证 // seq : 6 // label : HARD // 硬 S3 原因 : 动态创建 Vaadin 组件 // 处置 : 原文保留,进人工排期(amis dialog/service 重写) import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; import com.vaadin.ui.Notification; import com.vaadin.ui.Notification.Type; import com.vaadin.data.Property.ValueChangeListener; import com.vaadin.data.Property.ValueChangeEvent; import com.dsasp.client.viewframework.listener.ConfirmDialogListener; import com.vaadin.ui.Link; import com.vaadin.server.ExternalResource; import com.vaadin.ui.Label; def url = group.getField("CARDURL"); if(url.getValue()!= null){ Link link = new Link("信息链接", new ExternalResource(url.getValue())); link.setTargetName("_blank"); url.setVisible(false); url.parent?.addComponent(link); } final def professionals = group.getField("PROFESSIONALS"); final Button but = new Button("注销"); final Object table = professionals?.table; table?.setImmediate(true); final group1 = group; but?.addClickListener(new ClickListener() { public void buttonClick(ClickEvent event) { def id = table?.getValue(); if (id == null){ Notification.show("请选择一条记录!", Type.ERROR_MESSAGE); return; } def hr_con_id = id?.getField("HR_CONSTRUCTORREGISTERED_ID")?.getValue(); def islogout = id?.getField("ISLOGOUT")?.getValue(); if(islogout){ Notification.show("已经注销!", Type.ERROR_MESSAGE); return; } final pojo = GetServicesFunction.loadPOJO(hr_con_id,"HR_CONSTRUCTORREGISTERED",false); if(pojo!=null){ if(pojo.get_Value("ISMAINITEMS")){ Notification.show("如要注销主项注册专业,请注销建造师注册证!", Type.ERROR_MESSAGE); return; } def updateMap=[:]; updateMap["HR_CONSTRUCTORREGISTERED_ID"] = hr_con_id; updateMap["ISLOGOUT"] = 1; GetServicesFunction.excuteFlow(updateMap,"HR_CONSTRUCTORREGISTERED_LOGOUT"); id?.getField("ISLOGOUT")?.setImmediate(true); setFieldReadOnly(id,"ISLOGOUT",false); id?.getField("ISLOGOUT")?.setValue(true); setFieldReadOnly(id,"ISLOGOUT",true); professionals.setValue(new ArrayList(professionals.getValue())); } } }); professionals?.addButton(but,0); professionals?.showAddButton(false); professionals?.showDeleteButton(false);