// 表格点击事件
function onclick(e) {
if ($(this).get(0).nodeName ==
"TD"&&$(this).get(0).innerText!="Total") {
var tr1 = this.parentNode.parentNode.parentNode;
var columnsName = "";
var test = tr1.childNodes[0].innerText.split("\n");
if ((navigator.userAgent.indexOf("Safari") > 0 ||
navigator.userAgent.indexOf("Chrome") > 0) && test[0] !=
"\r") {
columnsName =
tr1.childNodes[0].innerText.split("\n")[this.cellIndex];
} else if ((navigator.userAgent.indexOf("Gecko") > 0 ||
navigator.userAgent.indexOf("Edge") > 0) && test[0] ==
"\r") {
columnsName =
tr1.childNodes[0].innerText.split("\n")[this.cellIndex * 4 +
2];
} else if (navigator.userAgent.indexOf("Firefox") > 0
&& test[0] != "\r") {
columnsName =
tr1.childNodes[0].innerText.split("\n")[this.cellIndex * 2];
}
if (columnsName == "Geo") {
$("#geo").multiselect('deselect', $("#geo").val());
$("#geo").multiselect('select',
$(this).get(0).innerText);
$("#geo_option").val($(this).get(0).innerText);
geoChange(columnsName);
loadDate();
} else if (columnsName == "Subgeo") {
$("#region").multiselect('deselect',
$("#region").val());
$("#region").multiselect('select',
$(this).get(0).innerText);
$("#region_option").val($(this).get(0).innerText);
geoChange(columnsName);
loadDate();
} else if (columnsName == "Brand") {
$("#brand").multiselect('deselect', $("#brand").val());
$("#brand").multiselect('select',
$(this).get(0).innerText);
$("#brand_option").val($(this).get(0).innerText);
geoChange(columnsName);
loadDate();
} else if (columnsName == "Plant Type") {
$("#plantType").multiselect('deselect',
$("#plantType").val());
$("#plantType").multiselect('select',
$(this).get(0).innerText);
$("#plantType_option").val($(this).get(0).innerText);
geoChange(columnsName);
loadDate();
} else if (columnsName == "Country") {
$("#country").multiselect('deselect',
$("#country").val());
$("#country").multiselect('select',
$(this).get(0).innerText);
$("#country_option").val($(this).get(0).innerText);
loadDate();
} else if (columnsName == "Family") {
$("#family").multiselect('deselect',
$("#family").val());
$("#family").multiselect('select',
$(this).get(0).innerText);
$("#family_option").val($(this).get(0).innerText);
loadDate();
} else if (columnsName == "Plant") {
$("#plant").multiselect('deselect', $("#plant").val());
$("#plant").multiselect('select',
$(this).get(0).innerText);
$("#plant_option").val($(this).get(0).innerText);
loadDate();
} else {
return false
}
}
}
// 表格点击事件级联查询
function geoChange(columnsName) {
var urlparam = "";
var dataparam = {};
var selectId = "";
if (columnsName == "Geo") {
urlparam = "/api/backlog/regbygeos";
dataparam.geo = $("#geo_option").val();
selectId = "#region";
}
if (columnsName == "Subgeo") {
urlparam = "/api/backlog/coubygeosandregs";
dataparam.geo = $("#geo_option").val();
dataparam.subgeo = $("#region_option").val();
selectId = "#country";
}
if (columnsName == "Brand") {
urlparam = "/api/backlog/fambybras";
dataparam.brand = $("#brand_option").val();
selectId = "#family";
}
if (columnsName == "Plant Type") {
urlparam = "/api/backlog/plantbytypes";
dataparam.plantType = $("#plantType").val();
selectId = "#plant";
}
$.ajax({
contentType : "application/json; charset=utf-8",
async: false,
type : "POST",
url : urlparam,
dataType : "json",
data : JSON.stringify(dataparam),
success : function(result) {
var data = result.data;
$(selectId).empty();
if (columnsName == "Geo") {
$("