// === EIP4 P4 脚本迁移产出 === // template_id : 745c9534-c755-4ef5-bc26-8b78a802ec4a // template_name: 验工月报区间 // seq : 3 // label : FULL_AUTO // 处置 : 全自动改写完成,直接入 P4 转换流水线 //在下拉列表框调用removeAllItems()方法前,应清空下拉列表中的值,之后赋值才能生效 bindField("YEAR",null); bindField("MONTH",null); //--设置年份下拉框默认值-- //获取组件(年份) clearFieldData("YEAR"); def currentYear = GetDefaultValueFunction.currentYear(); //设置开始年份和结束年份 def startYear = currentYear - 4; def endYear = currentYear + 11; for(i in startYear..<endYear){ addFieldOption("YEAR", i, i.toString()); } //--设置月份下拉框默认值-- clearFieldData("MONTH"); def currentMonth = GetDefaultValueFunction.currentMonth(); for(j in 1..12){ addFieldOption("MONTH", j, j.toString()); } //获取当前选中月报区间年份和月份数,赋值至年份、月份下拉列表框 def selMonthReportList = GetServicesFunction.listSelectResult(["PM_MREPORTINTERVAL_ID":getFieldValue("PM_MREPORTINTERVAL_ID")],"PM_MREPORTINTERVAL"); if(selMonthReportList != null){ def selMonthReportMap = selMonthReportList.get(0).toMap(); bindField("YEAR",selMonthReportMap.get("YEAR")); bindField("MONTH",selMonthReportMap.get("MONTH")); }