var type = "";
var startTime = "";
var endTime = "";
var cid = "";
var clumn = "";
$(function () {
//绔欏唴鎼滅储
$(".top-menu").slide({
type: "menu",
titCell: ".download",
targetCell: ".drop",
effect: "slideDown",
delayTime: 300,
triggerTime: 0,
returnDefault: true,
defaultIndex: false
});
$(".datasz-split").on("click", function (e) {
if ($(".datasz-split").hasClass("datasz-split-open")) {
$(".datasz-side").css({
"display": "none"
});
$(".datasz-split").removeClass("datasz-split-open");
$(".datasz-main").addClass("show");
} else {
$(".datasz-side").css({
"display": "block"
});
$(this).addClass("datasz-split-open");
$(".datasz-main").removeClass("show");
}
});
layui.use(['form'], function () {
var form = layui.form;
//鏈堝害鎼滅储鍖哄煙寮€濮
var startYear = 2014;
var currentYear = moment().get("year");
var currentMonth = moment().get("month");
currentMonth = currentMonth <= 9 ? '0' + currentMonth : currentMonth
var MstimeTemplate = ""
for (var i = currentYear; i >= startYear; i--) {
MstimeTemplate += ""
for (var i = Year; i <= currentYear; i++) {
MetimeTemplate += "";
ele.append(optionStr);
}
//绉婚櫎select涓墍鏈夐」 璧嬩簣鍒濆鍊
function removeEle(ele) {
ele.find("option").remove();
var optionStar = "";
ele.append(optionStar);
}
var YstimeText,
YetimeText,
optItem;
//閫夊畾骞翠唤鍚 灏嗚骞翠唤鐨勬暟鎹鍙栬拷鍔犱笂
form.on("select(Ystime)", function (data) {
YstimeText = data.value;
$.each(YdateList, function (i, item) {
if (YstimeText == item.value) {
optItem = i;
return optItem;
}
});
removeEle(Yetime);
$.each(YdateList[optItem].YetimeList, function (i, item) {
addEle(Yetime, item.value, item.name);
})
//閲嶆柊娓叉煋select
form.render('select');
});
//骞村害鎼滅储鍖哄煙缁撴潫
});
indexType("M");
indexType("Y");
// getMdata("M", startTime, endTime, 632, 1); 棣栨鍔犺浇锛屾斁鍦╥ndexType閲
// getYdata("Y", startTime, endTime, 606, 1);
$("#MsearchBtn").click(function () {
var M_etime_mm = $("#Metime-mm").val();
var M_etime = "";
var M_type = $("#Mtype").val();
var M_stime = $("#Mstime").val() + $("#Mstime-mm").val();
var M_cid = $(this).attr("datakey");
if (M_etime_mm == "" || M_etime_mm == null) {
M_etime = $("#Metime").val();
} else {
M_etime = $("#Metime").val() + M_etime_mm;
}
console.log(M_type, M_stime, M_etime, M_cid);
getMdata(M_type, M_stime, M_etime, M_cid, 1);
});
$("#YsearchBtn").click(function () {
var Y_type = $("#Ytype").val();
var Y_stime = $("#Ystime").val();
var Y_etime = $("#Yetime").val();
var Y_cid = $(this).attr("datakey");
getYdata(Y_type, Y_stime, Y_etime, Y_cid, 1);
});
});
/*鎸囨爣鍒楄〃*/
function indexType(type) {
$.ajax({
url: "/szinf/consult/tjj/gxzblibjk",
data: {
type: type
},
type: "post",
async: false,
success: function (data) {
data = JSON.parse(data);
var html = "";
if (data.response.code == 0) {
if (data.datalist != null && data.datalist.length > 0) {
$.each(data.datalist, function (index, item) {
if (index < 1) {
$("#" + type + "zbmc").html(item.zbmc);
$("#" + type + "searchBtn").attr("datakey", item.id);
}
html += "
" + item.zbmc + "";
$("#" + type).html(html);
$("#" + type + " li").first().addClass("current");
$("#" + type + " li").click(function () {
var _title = $(this).find("a").attr("title");
var _id = $(this).find("a").attr("id");
var _type = $(this).find("a").attr("datatype");
$(this).addClass("current").siblings().removeClass("current");;
$("#" + type + "zbmc").html(_title);
$("#" + type + "searchBtn").attr("datakey", _id);
if (_type == "M") {
getMdata(_type, startTime, endTime, _id, 1);
} else if (_type == "Y") {
getYdata(_type, startTime, endTime, _id, 1);
}
});
});
// 棣栨鍔犺浇
$("#" + type + " li").first().click();
} else {
}
}
}
});
}
/*杩涘害鏁板垪琛?/
var jindu_zbz_unit="";
function getMdata(type, startTime, endTime, cid, clumn) {
$.ajax({
type: 'POST', //鐢≒OST鏂瑰紡浼犺緭
dataType: 'JSON', //鏁版嵁鏍煎紡:JSON
url: "/szinf/consult/tjj/getjddata",
data: {
typeStr: type,
startTimeStr: startTime,
endTimeStr: endTime,
munueNumStr: cid,
clumNumStr: clumn,
},
success: function (data) {
var MDatas = data.data.reverse();
jindu_zbz_unit = MDatas[0].ajldw;
console.log("MDatas",MDatas)
if (MDatas != null && MDatas.length > 0) {
if (cid == "586" || cid == "691" || cid == "692" || cid == "693" || cid == "735" || cid == "736" || cid == "737"|| cid == "738" || cid == "739" || cid == "740" || cid == "741" || cid == "742") {
console.log(1)
var _Mhtml = "";
var _Mhtml_mod = $("");
var _Mhtml_table = $("");
var _Mhtml_tbody = $("");
var jindu_char_data = [];
$.each(MDatas, function (Mindex, Mitem) {
if (Mindex >= 0) {
_Mhtml = $("鏃堕棿 | " + Mitem.zbmc + " |
---|
" + Mitem.avtype + "(" + Mitem.ajldw + ") |
---|
");
}
if (Mitem.avalue != null && Mitem.avalue != "" && Mitem.avalue != "0.0") {
var _Mhtml_tr = $("" + Mitem.bgqStr + " | " + Mitem.avalue + " |
");
$(_Mhtml_tbody).append(_Mhtml_tr);
var charItem = {
name: Mitem.bgqStr,
v1: Mitem.avalue
};
jindu_char_data.push(charItem);
}
});
$(_Mhtml_table).append(_Mhtml_tbody);
$(_Mhtml_mod).append(_Mhtml_table);
$(_Mhtml).append(_Mhtml_mod);
$("#Mdata").html(_Mhtml);
LoadScroll();
jindu_char2(jindu_char_data);
} else {
console.log(2)
var Mhtml = "";
var Mhtml_mod = $("");
var Mhtml_table = $("");
var Mhtml_tbody = $("");
var jindu_char_data = [];
$.each(MDatas, function (Mindex, Mitem) {
console.log()
var _value = Mitem.avalue;
var _arr = _value.split(",");
if (Mindex >= 0) {
Mhtml = $("鏃堕棿 | " + Mitem.zbmc + " |
---|
绱鎸囨爣鍊?" + Mitem.ajldw + ") | 绱澧炲箙(%) |
---|
");
console.log("111",Mhtml)
}
if (_arr[0] != null && _arr[0] != "" && _arr[0] != "0.00" && _arr[0] != "0" && _arr[0] != "-0.00") {
var Mhtml_tr = $("" + Mitem.bgqStr + " | " + _arr[0] + " | " + _arr[1] + " |
");
$(Mhtml_tbody).append(Mhtml_tr);
var charItem = {
name: Mitem.bgqStr,
v1: _arr[0],
v2: _arr[1]
};
jindu_char_data.push(charItem);
}
});
console.log(jindu_char_data)
$(Mhtml_table).append(Mhtml_tbody);
$(Mhtml_mod).append(Mhtml_table);
$(Mhtml).append(Mhtml_mod);
console.log("Mhtml_table",Mhtml_table)
console.log("Mhtml_tbody",Mhtml_tbody)
console.log("Mhtml_mod",Mhtml_mod)
console.log("Mhtml_table",Mhtml_table)
console.log("Mhtml",Mhtml)
if(cid=='673'){
$(Mhtml).append('