//在自定义标签中this.startTime,this.finishTime无法获取时间,通过下面的js代码可以得到。
var start_date = new Date(this.startTime._d);
var stop_date = new Date(this.finishTime._d);
var start_year = start_date.getFullYear();
var stop_year = stop_date.getFullYear();
var start_month = start_date.getMonth() + 1;
var stop_month = stop_date.getMonth() + 1;
start_month = (start_month < 10) ? "0" + start_month : start_month;
stop_month = (stop_month < 10) ? "0" + stop_month : stop_month;
var start_day = start_date.getDate();
var stop_day = stop_date.getDate();
start_day = (start_day < 10) ? "0" + start_day : start_day;
stop_day = (stop_day < 10) ? "0" + stop_day : stop_day;
var start_date_str = start_year + "/" + start_month + "/" + start_day;
var stop_date_str = stop_year + "/" + stop_month + "/" + stop_day;
//定义要查询的字段需要的SQL语句,this.seriesName表示系列名
var sqlstr1 = "select plan_number from capacity_planning where project = '"+ this.seriesName + "' and start_date = '" + start_date_str + "' and stop_date = '" + stop_date_str + "'";
//调用帆软内置的方法执行SQL语句,然后返回得到的结果
var value = FR.remoteEvaluate('SQL("erp","' + sqlstr + '",1,1)');//erp是数据连接的名称
return value;