"+
"
" +
"
"+title+"
" +
// "×" +
"
" +
"
"+
"
" +
"
您的License授权码将于" +
content+
"过期,请尽快更新
"+
"
"
);
}
//关闭提示
function pop_close(){
$('#pop_div').fadeOut(400);
};
//倒计时函数
var licennseTimer = window.setTimeout("pop_close()",6000);
//license 函数
function updateSysLicense() {
var req = {
orgId: fn.getOrgId(),
};
var licenseAjax = {
method: "post",
url: dataUrl.util.querySysLicense(),
data: JSON.stringify(req),
contentType: 'application/json; charset=utf-8',
dataType: 'json',
success: function (res) {
if (res.code == '8888') {
var ext=res.data.ext
if(res.data.noteFlag){
licensepopInit("提示",ext);
$('#pop_div').fadeIn(400);
}
} else {
console.log(res);
}
}
};
sysAjax(licenseAjax);
};
updateSysLicense();
//获取获取和时间状态
function userName() {
$('#welcome-msg').text(fn.getUserName() + ' , ' + welcome())
};
function welcome() {
var date = new Date();
var hour = date.getHours();
if (hour < 6) {
return "凌晨好!"
} else if (hour < 9) {
return "早上好!"
} else if (hour < 12) {
return "上午好!"
} else if (hour < 14) {
return "中午好!"
} else if (hour < 18) {
return "下午好!"
} else if (hour < 22) {
return "晚上好!"
} else {
return "夜里好!"
}
}
//获取请求URL中的参数
function getQueryString(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
var r = window.location.search.substr(1).match(reg);
if (r != null) return unescape(r[2]);
return null;
}
//首页数据刷新
function indexDataRefresh(plNos, plNos1, plNos2) {
if (undefined == plNos || null == plNos || plNos.length <= 0) {
var selectData = $("#parktype").val();
//如果plNos不传,从下拉框中获取.
plNos = JSON.parse(selectData);
}
//获取停车场数量
getParkNums(plNos, plNos1, plNos2);
//获取泊位数量以及占用率-总的
getBerthNumAndOccupyRate(plNos, 0);
//获取泊位数量以及占用率-路侧
getBerthNumAndOccupyRate(plNos1, 1);
//获取泊位数量以及占用率-封闭
getBerthNumAndOccupyRate(plNos2, 2);
// //获取今日总收入-总的
// getTodayInCome(plNos,0);
// //获取今日总收入-路侧
// getTodayInCome(plNos1,1);
// //获取今日总收入-封闭
// getTodayInCome(plNos2,2);
//获取收费员人数-总的
getChargerNumFromDuty(plNos, 0);
//获取收费员人数-路侧
getChargerNumFromDuty(plNos1, 1);
//获取收费员人数-封闭
getChargerNumFromDuty(plNos2, 2);
//设备数量-总的
// getDeviceNums(null,0);//只查路侧
//设备数量-路侧
// getDeviceNums(null,1);
//设备数量-封闭
// getDeviceNums([-1],2);
//查询停车场实时运行情况数据-收入概况&占用率概况
queryParkRealTimeDatasByPlNos(plNos);
//查询近七日收入
incomeTrendCharts(plNos, 7);
//查询停车场收入
// queryParkIncomeDatas(plNos);
}
//获取停车场数量
function getParkNums(plNos, plNos1, plNos2) {
// $("#parkNum").html(plNos.length);
setTimeout(function () {
$('#parkNum').html(plNos.length);
}, 10);
$("#parkNumLC").html(plNos1.length);
$("#parkNumFB").html(plNos2.length);
if (plNos.indexOf(-1) == 0) {
$("#parkNum").html(0);
}
if (plNos1.indexOf(-1) == 0) {
$("#parkNumLC").html(0);
}
if (plNos2.indexOf(-1) == 0) {
$("#parkNumFB").html(0);
}
}
function moneyFomatter(value) {
if (value == null) {
return "0.00";
} else {
return (value / 100).toFixed(2);
}
}
//今日收入-按路侧、封闭进行区分
function getTodayInCome(plNos, plType) {
var req = {
sysCode: sysComm.sysCode,
plNos: plNos,
};
var inComeAjax = {
method: "post",
url: dataUrl.util.queryChargerIncomeByPlNos(),
data: JSON.stringify(req),
contentType: 'application/json; charset=utf-8',
dataType: 'json',
success: function (res) {
if (res.code == '8888') {
var data = res.data;
if (plType == 0) {
$("#income").html(moneyFomatter(data.allIncome));
} else if (plType == 1) {
$("#incomeLC").html(moneyFomatter(data.allIncome));
} else if (plType == 2) {
$("#incomeFB").html(moneyFomatter(data.allIncome));
}
} else {
console.log(res);
}
}
};
sysAjax(inComeAjax);
};
//收费员人数-按路侧、封闭进行区分
function getChargerNum(plNos, plType) {
var req = {
sysCode: sysComm.sysCode,
chargerType: 0,//收费员
plNos: plNos,
};
var inComeAjax = {
method: "post",
url: dataUrl.util.queryEmployeeNumByPlNo(),
data: JSON.stringify(req),
contentType: 'application/json; charset=utf-8',
dataType: 'json',
success: function (res) {
if (res.code == '8888') {
var data = res.data;
if (plType == 0) {
setTimeout(function () {
$("#chargerNum").html(data);
}, 10);
} else if (plType == 1) {
$("#chargerNumLC").html(data);
} else if (plType == 2) {
$("#chargerNumFB").html(data);
}
} else {
console.log(res);
}
}
};
sysAjax(inComeAjax);
};
//收费员人数-按路侧、封闭进行区分(以排班为准)
function getChargerNumFromDuty(plNos, plType) {
var chargers = fn.getChargers(plNos);
//应武警要求,市政账号 路侧车场加一个收费员
if (fn.getUserId() == '10146') {
if (plType == 0) {
setTimeout(function () {
$("#chargerNum").html(chargers.length + 1);
}, 10);
} else if (plType == 1) {
$("#chargerNumLC").html(chargers.length + 1);
} else if (plType == 2) {
$("#chargerNumFB").html(chargers.length);
}
} else {
if (plType == 0) {
setTimeout(function () {
$("#chargerNum").html(chargers.length);
}, 10);
} else if (plType == 1) {
$("#chargerNumLC").html(chargers.length);
} else if (plType == 2) {
$("#chargerNumFB").html(chargers.length);
}
}
};
//获取泊位数量以及占用率-按路侧、封闭进行区分
function getBerthNumAndOccupyRate(plNos, plType) {
if (fn.getUserId() == '10146') {
getBerthNumForShizhengchu(plType);
return;
}
var req = {
sysCode: sysComm.sysCode,
plNos: plNos,
};
var berthAjax = {
method: "post",
url: dataUrl.util.queryParkRealTimeDatasByPlNos(),
data: JSON.stringify(req),
contentType: 'application/json; charset=utf-8',
dataType: 'json',
success: function (res) {
if (res.code == '8888') {
var data = res.data;
if (plType == 0) {
//空余泊位数
var berthFreeNum = data.berthFreeNum;
//总泊位数
var berthTotalNum = data.berthNum;
if (berthFreeNum == null || berthFreeNum == undefined || berthFreeNum == '') {
berthFreeNum = 0;
}
if (berthTotalNum == null || berthTotalNum == undefined || berthTotalNum == '') {
berthTotalNum = 0;
}
//占用车位数
$("#park_current_berthNum").text(parseInt(berthTotalNum) - parseInt(berthFreeNum));
//总车位数
$("#park_current_berthTotalNum").text(parseInt(berthTotalNum));
$("#berthNum").html(data.berthNum);
$("#turnoverNum").html((data.outCarNum / (data.berthNum < 1 ? 1 : data.berthNum)).toFixed(2));
} else {
var berthNum = data.berthNum;
var berthFreeNum = data.berthFreeNum;
var occupyRate = ((berthNum - berthFreeNum) * 100 / (berthNum < 1 ? 1 : berthNum)).toFixed(2);
if (plType == 1) {
$("#occupyRateLC").html(berthNum);
$("#turnoverNumLC").html((data.outCarNum / (berthNum < 1 ? 1 : berthNum)).toFixed(2));
} else if (plType == 2) {
$("#occupyRateFB").html(berthNum);
$("#turnoverNumFB").html((data.outCarNum / (berthNum < 1 ? 1 : berthNum)).toFixed(2));
}
}
} else {
console.log(res);
}
}
};
sysAjax(berthAjax);
};
//市政处 泊位数特殊处理
function getBerthNumForShizhengchu(plType) {
debugger;
var ziyingplNos = [];
var feiziyingPlNos = [];
var allPlNos = [];
//1:自营,2:非自营,3:全部 默认自营1
var resultParkLot = fn.getParkLot(1);
$.each(resultParkLot, function (index, item) {
if(plType == 0 ||item.type == plType){
ziyingplNos.push(item.code);
}
});
resultParkLot = fn.getParkLot(2);
$.each(resultParkLot, function (index, item) {
if(plType == 0 ||item.type == plType){
feiziyingPlNos.push(item.code);
}
})
resultParkLot = fn.getParkLot(3);
$.each(resultParkLot, function (index, item) {
if(plType == 0 ||item.type == plType){
allPlNos.push(item.code);
}
})
var ziyingData = {};
var feiziyingData = {};
var allData = {};
var req = {
sysCode: sysComm.sysCode,
plNos: ziyingplNos,
};
var berthAjax = {
method: "post",
url: dataUrl.util.queryParkRealTimeDatasByPlNos(),
data: JSON.stringify(req),
contentType: 'application/json; charset=utf-8',
dataType: 'json',
async: false,
success: function (res) {
if (res.code == '8888') {
ziyingData = res.data;
} else {
console.log(res);
}
}
};
sysAjax(berthAjax);
req = {
sysCode: sysComm.sysCode,
plNos: feiziyingPlNos,
};
berthAjax = {
method: "post",
url: dataUrl.util.queryParkRealTimeDatasByPlNos(),
data: JSON.stringify(req),
contentType: 'application/json; charset=utf-8',
dataType: 'json',
async: false,
success: function (res) {
if (res.code == '8888') {
feiziyingData = res.data;
} else {
console.log(res);
}
}
};
sysAjax(berthAjax);
req = {
sysCode: sysComm.sysCode,
plNos: allPlNos,
};
berthAjax = {
method: "post",
url: dataUrl.util.queryParkRealTimeDatasByPlNos(),
data: JSON.stringify(req),
contentType: 'application/json; charset=utf-8',
dataType: 'json',
async: false,
success: function (res) {
if (res.code == '8888') {
allData = res.data;
} else {
console.log(res);
}
}
};
sysAjax(berthAjax);
if (plType == 0) {
//空余泊位数
var berthFreeNum = allData.berthFreeNum;
//总泊位数
var berthTotalNum = allData.berthNum;
if (berthFreeNum == null || berthFreeNum == undefined || berthFreeNum == '') {
berthFreeNum = 0;
}
if (berthTotalNum == null || berthTotalNum == undefined || berthTotalNum == '') {
berthTotalNum = 0;
}
//占用车位数
$("#park_current_berthNum").text(parseInt(berthTotalNum) - parseInt(berthFreeNum));
//总车位数
$("#park_current_berthTotalNum").text(parseInt(berthTotalNum));
$("#berthNum").html(allData.berthNum);
$("#turnoverNum").html((allData.outCarNum / (allData.berthNum < 1 ? 1 : allData.berthNum)).toFixed(2));
} else {
var berthNum = allData.berthNum;
var berthFreeNum = allData.berthFreeNum;
var occupyRate = ((berthNum - berthFreeNum) * 100 / (berthNum < 1 ? 1 : berthNum)).toFixed(2);
var html = (allData.berthNum==undefined?'0':allData.berthNum) +'(运营:'+(ziyingData.berthNum==undefined?'0':ziyingData.berthNum)+";非运营:"+(feiziyingData.berthNum==undefined?'0':feiziyingData.berthNum)+")";
if (plType == 1) {
// var html = '总泊位:'+allData.berthNum +'/运营:'+ziyingData.berthNum+"/非运营:"+feiziyingData.berthNum;
$("#occupyRateLC").html(html);
$("#turnoverNumLC").html((allData.outCarNum / (berthNum < 1 ? 1 : berthNum)).toFixed(2));
} else if (plType == 2) {
$("#occupyRateFB").html(html);
$("#turnoverNumFB").html((allData.outCarNum / (berthNum < 1 ? 1 : berthNum)).toFixed(2));
}
}
}
//获取设备数量以及占用率-按路侧、封闭进行区分
function getDeviceNums(plNos, plType) {
var req = {
sysCode: sysComm.sysCode,
plNos: plNos,
eqpTypes: [-1]
};
var berthAjax = {
method: "post",
url: dataUrl.util.statisticParkLotEqpCountByPlNos(),
data: JSON.stringify(req),
contentType: 'application/json; charset=utf-8',
dataType: 'json',
success: function (res) {
// console.log(res);
var ydata = ['地磁', 'PDA', '视频桩'];
var seriesdata = [0, 0, 0];//在线
var serieserrordata = [0, 0, 0];//掉线
var totalDevice = 0;//总共设备
var onLineDevice = 0;//在线设备
if (res.data != null) {
$("[data-toggle='tooltip']").tooltip({delay: {show: 500, hide: 100},});
for (var i = 0; i < res.data.length; i++) {
totalDevice += Number(res.data[i].eqpNum);
//eqpType 1:地磁 2:POS机
if (res.data[i].eqpType == 1) {//地磁
//eqpState 设备状态:1-掉线,0-在线
if (res.data[i].eqpState == 0) {
seriesdata[0] = res.data[i].eqpNum;
onLineDevice += res.data[i].eqpNum;
} else {
serieserrordata[0] += res.data[i].eqpNum;
}
} else if (res.data[i].eqpType == 9) {//pos机
if (res.data[i].eqpState == 0) {
seriesdata[1] = res.data[i].eqpNum;
onLineDevice += res.data[i].eqpNum;
} else {
serieserrordata[1] += res.data[i].eqpNum;
}
}
}
//填写数据
if (plType == 0) {
setTimeout(function () {
$("#deviceNum").html(totalDevice);
}, 10);
} else {
var occupyRate = ((onLineDevice) * 100 / (totalDevice < 1 ? 1 : totalDevice)).toFixed(2);
if (plType == 1) {
$("#deviceNumLC").html(totalDevice);
$("#deviceNumLCTitle").attr('data-original-title', "地磁" + (seriesdata[0] + serieserrordata[0]) + "个,PDA" + (seriesdata[1] + serieserrordata[1]) + "个");
} else if (plType == 2) {
$("#deviceNumFB").html(totalDevice);
}
}
} else {
console.log(res);
}
}
};
sysAjax(berthAjax);
};
//查询停车场实时运行情况数据-收入概况&占用率概况
function queryParkRealTimeDatasByPlNos(plNos) {
var req = {
sysCode: sysComm.sysCode,
plNos: plNos,
};
var realTimeAjax = {
method: "post",
url: dataUrl.util.queryParkRealTimeDatasByPlNos(),
data: JSON.stringify(req),
contentType: 'application/json; charset=utf-8',
dataType: 'json',
success: function (res) {
if (res.code == '8888') {
var data = res.data;
if (data != null) {
drawIncomeDatas(data.allIncome, data.allCashIncome, data.allWxIncome, data.allAliIncome, data.allBalanceIncome, data.escapeFee);
drawOccupyDatas(data.inCarNum, data.outCarNum, data.parkInsideNum, (data.parkInsideNum) - (data.parkVipInsideNum), data.parkVipInsideNum, data.berthFreeNum, data.berthNum);
}
} else {
console.log(res);
}
}
};
sysAjax(realTimeAjax);
};
//收入概况
function drawIncomeDatas(allIncome, allCashIncome, allWxIncome, allAliIncome, allBalanceIncome, escapeFee) {
// $("#parkCashIncome").html(moneyFomatter(allCashIncome));
// $("#parkWxIncome").html(moneyFomatter(allWxIncome));
// $("#parkAliIncome").html(moneyFomatter(allAliIncome));
// $("#parkBalanceIncome").html(moneyFomatter(allBalanceIncome));
$("#parkIncome").html(moneyFomatter(allIncome));
$("#parkIncome").attr('title', moneyFomatter(allIncome));
$("#escapeFee").html(moneyFomatter(escapeFee));
$("#escapeFee").attr('title', moneyFomatter(escapeFee));
allIncome = (allIncome < 1 ? 1 : allIncome);
var cashRate = (allCashIncome * 100 / allIncome).toFixed(2);
var wxRate = (allWxIncome * 100 / allIncome).toFixed(2);
var aliRate = (allAliIncome * 100 / allIncome).toFixed(2);
var balanceRate = (allBalanceIncome * 100 / allIncome).toFixed(2);
$(".pos-abs.pay-way-scale").eq(0).css("width", wxRate + '%');
$(".pos-abs.pay-way-scale").eq(1).css("width", aliRate + '%');
$(".pos-abs.pay-way-scale").eq(2).css("width", balanceRate + '%');
$(".pos-abs.pay-way-scale").eq(3).css("width", cashRate + '%');
$("#weixin-title").attr('title', moneyFomatter(allWxIncome) + '元');
$("#alipay-title").attr('title', moneyFomatter(allAliIncome) + '元');
$("#yy-title").attr('title', moneyFomatter(allBalanceIncome) + '元');
$("#xj-title").attr('title', moneyFomatter(allCashIncome) + '元');
$("[data-toggle='tooltip']").tooltip({
delay: {show: 500, hide: 100},
});
//逃逸金额
// var escapeRate = (escapeFee*100/(allIncome<1?1:allIncome)).toFixed(2);
// TYJEcharts = echarts.init(document.getElementById('tyje-echarts'));
// var TYJEoption = {
// color:['#0D9BFF','#D7D7D7'],
// title:{
// text:escapeRate+'%',
// textStyle:{
// color:'#4a4a4a',
// fontSize:'24',
// align:'middle',
// verticalAlign:'middle',
// },
// left:'center',
// top:'middle',
// },
// tooltip: {
// trigger: 'item',
// show:false,
// formatter: "{a}