// === EIP4 P4 脚本迁移产出 === // template_id : 7a0ac7a9-32bc-4d32-9231-4d1bbcd86002 // template_name: 造价师注册证 // seq : 3 // label : PARTIAL // 余留模式 : raw .table 组件访问; 残留字段句柄链(未覆盖动词) // 处置 : 大部分已自动改写,余留行人工补全(见作业单) import com.vaadin.ui.Link; import com.vaadin.server.ExternalResource; import com.vaadin.ui.Label; final def professionals = group.getField("PROFESSIONALS"); final Object table = professionals?.table; table?.setImmediate(true); final group1 = group; addFieldButton("PROFESSIONALS", "注销", { def id = table?.getValue(); if (id == null){ showToast("请选择一条记录!", Type.ERROR_MESSAGE); return; } def hr_con_id = id?.getField("HR_COSTENGINEERREGISTERED_ID")?.getValue(); def islogout = id?.getField("ISLOGOUT")?.getValue(); if(islogout == 1){ showToast("已经注销!", Type.ERROR_MESSAGE); return; } final pojo = GetServicesFunction.loadPOJO(hr_con_id,"HR_COSTENGINEERREGISTERED",false); if(pojo!=null){ if(pojo.get_Value("ISMAINITEMS") == 1){ showToast("如要注销主项注册专业,请注销造价师注册证!", 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())); } }, 0) professionals?.showAddButton(false); professionals?.showDeleteButton(false);