// === EIP4 P4 脚本迁移产出 === // template_id : 7a0ac7a9-32bc-4d32-9231-4d1bbcd86002 // template_name: 造价师注册证 // seq : 2 // 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; 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_COSTENGINEERREGISTERED_ID")?.getValue(); def islogout = id?.getField("ISLOGOUT")?.getValue(); if(islogout == 1){ Notification.show("已经注销!", Type.ERROR_MESSAGE); return; } final pojo = GetServicesFunction.loadPOJO(hr_con_id,"HR_COSTENGINEERREGISTERED",false); if(pojo!=null){ if(pojo.get_Value("ISMAINITEMS") == 1){ Notification.show("如要注销主项注册专业,请注销造价师注册证!", Type.ERROR_MESSAGE); return; } def updateMap=[:]; updateMap["HR_COSTENGINEERREGISTERED_ID"] = hr_con_id; updateMap["ISLOGOUT"] = 1; GetServicesFunction.excuteFlow(updateMap,"HR_COSTENGINEERREGISTERED_LOGOUT"); id?.getField("ISLOGOUT")?.setImmediate(true); setFieldReadOnly(id,"ISLOGOUT",false); id?.getField("ISLOGOUT")?.setValue(1); setFieldReadOnly(id,"ISLOGOUT",true); professionals.setValue(new ArrayList(professionals.getValue())); } } }); professionals?.addButton(but,0); professionals?.showAddButton(false); professionals?.showDeleteButton(false);