function initGantt(){loadScript("../myjs/gantt.js");gantt.config.scale_unit="month";gantt.config.date_scale="%F, %Y";gantt.config.scale_height=50;gantt.config.subscales=[{unit:"day",step:1,date:"%j, %D"}];gantt.config.xml_date="%Y-%m-%d %H:%i:%s";gantt.init("gantt_here");$("#submitquery").click(function(e){refreshBoard()});$("#buyerselect").click(function(e){refreshSales()});refreshBoard();initBuyers();refreshSales();return"项目看板"}function initBuyers(){$("#buyerselect").html("");$.post("queryReport",{type:"buyers"},function(e){var t=JSON.parse(e);if(t["msg"]==="ok"){document.getElementById("buyerselect").options.add(new Option("",""));t.buyers.forEach(function(e){var t=new Option(e,e);document.getElementById("buyerselect").options.add(t)})}})}function refreshSales(){$("#billselect").html("");var e=$("#buyerselect").val();$.post("queryReport",{type:"sales",buyer:e},function(e){var t=JSON.parse(e);if(t["msg"]==="ok"){document.getElementById("billselect").options.add(new Option("",""));t.sales.forEach(function(e){var t=new Option(e,e);document.getElementById("billselect").options.add(t)})}})}function refreshBoard(){var e=$("#buyerselect").val();var t=$("#billselect").val();if(e!==null&&e!==""||t!==null&&t!==""){gantt.message({text:e+" "+t,expire:3e3})}$.post("queryReport",{type:getQueryString("type"),buyer:e,sale:t},function(e){var t=JSON.parse(e);if(t["msg"]!=="ok"){BootstrapDialog.show({title:"提示",message:t["msg"]})}else{gantt.clearAll();gantt.load(t.jsonfile,"json")}})}