679 lines
23 KiB
Plaintext
679 lines
23 KiB
Plaintext
// 今日风险
|
|
function loadTodayRiskAjax() {
|
|
let url = dataUrl + 'proteam/pot/city/getCityMaps';
|
|
let params = {
|
|
'isSup': user.isSup,
|
|
'orgId': user.orgId
|
|
};
|
|
ajaxRequest(url, "POST", params, true, function () {
|
|
}, function (result) {
|
|
if (result.code === 200) {
|
|
setRiskNum(result);
|
|
} else if (result.code === 500) {
|
|
layer.alert(result.msg, { icon: 2 })
|
|
} else if (result.code === 401) {
|
|
logout(1);
|
|
}
|
|
}, function (xhr) {
|
|
|
|
});
|
|
|
|
// 风险等级数量赋值
|
|
function setRiskNum(obj) {
|
|
let num2 = obj.two, num3 = obj.three, num4 = obj.four, num5 = obj.five;
|
|
$('#twoRiskNum').html(num2);
|
|
$('#threeRiskNum').html(num3);
|
|
$('#fourRiskNum').html(num4);
|
|
$('#fiveRiskNum').html(num5);
|
|
}
|
|
}
|
|
|
|
// 今日施工计划
|
|
function loadTodayTaskAjax(type) {
|
|
let url = '';
|
|
let params = {};
|
|
if (checkIndex === 0) {
|
|
url = dataUrl + 'proteam/pot/stag/getTodayTask';
|
|
params = {
|
|
'isSup': user.isSup,
|
|
'orgId': user.orgId,
|
|
'userId': user.userId
|
|
};
|
|
} else if (checkIndex === 1 || checkIndex === 2) {
|
|
url = dataUrl + 'proteam/pot/workPermit/getWorkPermitAndXhList';
|
|
params = {
|
|
'isSup': user.isSup,
|
|
'currentUserOrgId': user.orgId,
|
|
'type': checkIndex + '',
|
|
'status': ''
|
|
};
|
|
}
|
|
ajaxRequest(url, "POST", params, true, function () {
|
|
}, function (result) {
|
|
if (result.code === 200) {
|
|
setTabData(result.data);
|
|
} else if (result.code === 500) {
|
|
|
|
} else if (result.code === 401) {
|
|
logout(1);
|
|
}
|
|
}, function (xhr) {
|
|
|
|
});
|
|
|
|
function setTabData(dataList) {
|
|
let html = '';
|
|
if (checkIndex === 0) {
|
|
if (dataList && dataList.length > 0) {
|
|
$.each(dataList, function (index, item) {
|
|
html += '<tr>' +
|
|
'<td>' + (index + 1) + '</td>' +
|
|
'<td>' + item.buildCode + '</td>' +
|
|
'<td data-mtpis="' + item.bidName + '">' + item.bidName + '</td>' +
|
|
'<td data-mtpis="' + item.ticketNo + '">' + item.ticketNo + '</td>' +
|
|
'<td>' + setRiskLevelColor(item.riskLevel) + '</td>' +
|
|
'<td>' + setEarlyWarningStatus(item.earlyWarningStatus) + '</td>' +
|
|
'<td>' + setBallStauts(item.ballStatus) + '</td>' +
|
|
'<td>' + item.proStatus + '</td>' +
|
|
'</tr>'
|
|
})
|
|
} else {
|
|
html += '<tr>' +
|
|
'<td colspan = "8">无数据</td>' +
|
|
'</tr>'
|
|
}
|
|
$('#todayTaskTable tr:not(:first)').remove();
|
|
$('#todayTaskTable tbody').empty().append(html);
|
|
} else if (checkIndex === 1) {
|
|
if (dataList && dataList.length > 0) {
|
|
$.each(dataList, function (index, item) {
|
|
html += '<tr>' +
|
|
'<td>' + (index + 1) + '</td>' +
|
|
'<td>' + item.ticketNo + '</td>' +
|
|
'<td>' + item.projectName + '</td>' +
|
|
'<td>' + setRiskLevelColor(item.riskLevel) + '</td>' +
|
|
'<td>' + item.status + '</td>' +
|
|
'</tr>'
|
|
})
|
|
} else {
|
|
html += '<tr>' +
|
|
'<td colspan = "5">无数据</td>' +
|
|
'</tr>'
|
|
}
|
|
$('#zyxkTable tr:not(:first)').remove();
|
|
$('#zyxkTable tbody').empty().append(html);
|
|
} else if (checkIndex === 2) {
|
|
if (dataList && dataList.length > 0) {
|
|
$.each(dataList, function (index, item) {
|
|
html += '<tr>' +
|
|
'<td>' + (index + 1) + '</td>' +
|
|
'<td>' + item.ticketNo + '</td>' +
|
|
'<td>' + item.projectName + '</td>' +
|
|
'<td>' + setRiskLevelColor(item.riskLevel) + '</td>' +
|
|
'<td>' + item.workManager + '</td>' +
|
|
'<td>已结束</td>' +
|
|
'<td>' + item.status + '</td>' +
|
|
'</tr>'
|
|
})
|
|
} else {
|
|
html += '<tr>' +
|
|
'<td colspan = "7">无数据</td>' +
|
|
'</tr>'
|
|
}
|
|
$('#fxxhTable tr:not(:first)').remove();
|
|
$('#fxxhTable tbody').empty().append(html);
|
|
}
|
|
}
|
|
|
|
// 设置预警状态
|
|
function setEarlyWarningStatus(earlyWarningStatus) {
|
|
let html = '';
|
|
if (earlyWarningStatus) {
|
|
let earlyWarningStatusArr = earlyWarningStatus.split(',');
|
|
$.each(earlyWarningStatusArr, function (index, item) {
|
|
if (item) {
|
|
var itemss = item.split("@");
|
|
if (itemss.length > 1) {
|
|
html += '<p style="color: green;">' + itemss[0] + '</p>';
|
|
} else {
|
|
html += '<p style="color: #FF5D5D;">' + item + '</p>';
|
|
}
|
|
|
|
|
|
}
|
|
})
|
|
} else {
|
|
html = '<span style="color: #14B93B">正常施工</span>'
|
|
}
|
|
return html;
|
|
}
|
|
|
|
// 设置球机状态
|
|
function setBallStauts(ballStatus) {
|
|
let html = '';
|
|
if (ballStatus) {
|
|
if (ballStatus === '1') {
|
|
html += '<img src="../../img/common-icon/ball-online.png">'
|
|
} else {
|
|
html += '<img src="../../img/common-icon/ball-offline.png">'
|
|
|
|
}
|
|
}
|
|
return html;
|
|
}
|
|
}
|
|
|
|
// 违章信息数量
|
|
function loadVoiNumAjax() {
|
|
let url = dataUrl + 'proteam/pot/stag/getVoiNum';
|
|
let params = {
|
|
'isSup': user.isSup,
|
|
'orgId': user.orgId,
|
|
'userId': user.userId,
|
|
'type': (checkIndex2 + 1) + ''
|
|
};
|
|
ajaxRequest(url, "POST", params, true, function () {
|
|
}, function (result) {
|
|
if (result.code === 200) {
|
|
setVoiNum(result.data);
|
|
} else if (result.code === 500) {
|
|
|
|
} else if (result.code === 401) {
|
|
logout(1);
|
|
}
|
|
}, function (xhr) {
|
|
|
|
});
|
|
function setVoiNum(dataList) {
|
|
|
|
let num = 0, num2 = 0;
|
|
if (dataList[0] < 100) {
|
|
num = dataList[0];
|
|
} else {
|
|
num = '99+'
|
|
}
|
|
if (dataList[1] < 100) {
|
|
num2 = dataList[1];
|
|
} else {
|
|
num2 = '99+'
|
|
}
|
|
let earlyModule = document.querySelector('#early-module1');
|
|
earlyModule.setAttribute('data-notification', num);
|
|
let earlyModule2 = document.querySelector('#early-module2');
|
|
earlyModule2.setAttribute('data-notification', num2);
|
|
}
|
|
}
|
|
|
|
// 违章信息
|
|
function loadVoiAjax() {
|
|
let url = dataUrl + 'proteam/pot/stag/getVoiList';
|
|
let params = {
|
|
'isSup': user.isSup,
|
|
'orgId': user.orgId,
|
|
'userId': user.userId,
|
|
'type': (checkIndex2 + 1) + ''
|
|
};
|
|
ajaxRequest(url, "POST", params, true, function () {
|
|
}, function (result) {
|
|
if (result.code === 200) {
|
|
setTabData2(result.data);
|
|
} else if (result.code === 500) {
|
|
|
|
} else if (result.code === 401) {
|
|
logout(1);
|
|
}
|
|
}, function (xhr) {
|
|
|
|
});
|
|
function setTabData2(dataList) {
|
|
let html = '';
|
|
if (checkIndex2 === 0) {
|
|
if (dataList && dataList.length > 0) {
|
|
$.each(dataList, function (index, item) {
|
|
html += '<tr voiId="' + item.id + '" id="tr-' + (item.id) + '">' +
|
|
'<td>' + (index + 1) + '</td>' +
|
|
'<td>' + item.org + '</td>' +
|
|
'<td data-mtpis="' + item.proName + '">' + item.proName + '</td>' +
|
|
'<td>' + setRiskLevelColor(item.riskLevel) + '</td>' +
|
|
'<td>' + item.type + '</td>' +
|
|
'<td>' + setLevelId(item.levelId) + '</td>' +
|
|
'<td>' + item.createTime + '</td>' +
|
|
'<td>' + item.status + '</td>' +
|
|
'<td class="opera">' + setRoleAuth(item) + '</td>' +
|
|
'</tr>'
|
|
})
|
|
} else {
|
|
html += '<tr>' +
|
|
'<td colspan = "9">无数据</td>' +
|
|
'</tr>'
|
|
}
|
|
$('#economizeTable tr:not(:first)').remove();
|
|
$('#economizeTable tbody').empty().append(html);
|
|
} else if (checkIndex2 === 1) {
|
|
if (dataList && dataList.length > 0) {
|
|
$.each(dataList, function (index, item) {
|
|
html += '<tr voiId="' + item.id + '" id="tr-' + (item.id) + '">' +
|
|
'<td>' + (index + 1) + '</td>' +
|
|
'<td>' + item.org + '</td>' +
|
|
'<td data-mtpis="' + item.proName + '">' + item.proName + '</td>' +
|
|
'<td>' + setRiskLevelColor(item.riskLevel) + '</td>' +
|
|
'<td>' + item.type + '</td>' +
|
|
'<td>' + setLevelId(item.levelId) + '</td>' +
|
|
'<td>' + item.createTime + '</td>' +
|
|
'<td>' + item.status + '</td>' +
|
|
'<td class="opera">' + setRoleAuth(item) + '</td>' +
|
|
'</tr>'
|
|
})
|
|
} else {
|
|
html += '<tr>' +
|
|
'<td colspan = "9">无数据</td>' +
|
|
'</tr>'
|
|
}
|
|
$('#cityTable tr:not(:first)').remove();
|
|
$('#cityTable tbody').empty().append(html);
|
|
}
|
|
}
|
|
}
|
|
|
|
// 设置违章类型
|
|
function setLevelId(levelId) {
|
|
if (levelId === '严重违章') {
|
|
return '<span style="color: #ff5d5d;">' + levelId + '</span>';
|
|
}
|
|
return '<span>' + levelId + '</span>';
|
|
}
|
|
|
|
// 设置角色权限
|
|
function setRoleAuth(d) {
|
|
let html = '',
|
|
supType = d.supType === '1' || !d.supType ? true : false;
|
|
|
|
// 通知单
|
|
if (supType && d.voiStatus !== '6' && d.voiStatus !== '7' && d.voiStatus !== '8') {
|
|
html += "<a onclick=\"noticeSheet('" + d.id + "','" + d.classId + "')\">通知单</a>"
|
|
}
|
|
// 查看 -值班员权限
|
|
if ((user.isSup === '2' && (d.voiStatus === '7' || d.voiStatus === '8')) || (user.isSup === '1' && (d.voiStatus === '8' || d.voiStatus === '7'))) {
|
|
html += "<a onclick=\"noticeSheet2('" + d.id + "','" + d.classId + "','2')\">查看</a>"
|
|
}
|
|
|
|
// 下发审核-值长权限
|
|
if ((user.isSup === '1' && isShiftSup) || (user.isSup === '1' && (user.nickName === '!jysp' || user.nickName === 'jysp'))) {
|
|
if (supType && d.voiStatus === '7') {
|
|
html += "<a onclick=\"noticeSheet2('" + d.id + "','" + d.classId + "','1',this)\">审核</a>";
|
|
}
|
|
}
|
|
|
|
// 回撤 - 违章单整改归档后设置 - 值长/运维管理员 权限
|
|
if (supType && d.voiStatus === '5' && ((user.isSup === '1' && isShiftSup) || ((user.nickName === '!jysp' || user.nickName === 'jysp')))) {
|
|
let result = compareTime(getNowDate2(), d.recTime);
|
|
if (!result) html += "<a onclick=\"reback('" + d.id + "')\">回撤</a>";
|
|
}
|
|
|
|
// 驳回修改 - 值班员权限
|
|
if (user.isSup === '2' && supType && d.voiStatus === '8') {
|
|
html += "<a onclick=\"editData2('" + d.id + "',this)\">驳回修改</a>";
|
|
}
|
|
|
|
// 撤销 - 值班员权限
|
|
if (user.isSup === '2' && (d.voiStatus === '7')) {
|
|
html += "<a onclick=\"delData('" + d.id + "','1','2')\">撤销</a>";
|
|
}
|
|
|
|
// 地市整改审核 - 值班员权限
|
|
if (user.isSup === '2' && supType && (d.voiStatus === '2' || d.voiStatus === '4')) {
|
|
html += "<a onclick=\"openRectification('" + d.id + "','" + d.classId + "','2',this)\">审核</a>";
|
|
}
|
|
|
|
// 地市整改 - 地市权限
|
|
if (supType && user.isSup === '3' && (d.voiStatus === '1' || d.voiStatus === '3')) {
|
|
// 值班员下发
|
|
html += "<a onclick=\"openRectification('" + d.id + "','" + d.classId + "','1',this)\">整改</a>"
|
|
} else if (!supType && user.isSup === '3' && d.voiStatus === '1') {
|
|
// 地市自查
|
|
html += "<a onclick=\"openRectification('" + d.id + "','" + d.classId + "','3',this)\">整改</a>"
|
|
}
|
|
|
|
// 详情
|
|
if (d.voiStatus !== '1' && d.voiStatus !== '7' && d.voiStatus !== '8') {
|
|
html += "<a onclick=\"viewData('" + d.id + "')\">详情</a>";
|
|
}
|
|
|
|
// 删除 - 运维管理员 (值班员下违章单)
|
|
if (supType && (user.nickName === '!jysp' || user.nickName === 'jysp')) {
|
|
if (supType && d.voiStatus === '1') {
|
|
// 违章单未处理删除
|
|
html += "<a onclick=\"delData('" + d.id + "','1','1')\">删除</a>";
|
|
} else if (supType && d.voiStatus === '5') {
|
|
// 违章单整改已归档删除
|
|
html += "<a onclick=\"delData('" + d.id + "','2','1')\">删除</a>";
|
|
}
|
|
} else if (!supType && (user.nickName === '!jysp' || user.nickName === 'jysp')) { // 删除 - 运维管理员 (地市自查下违章单)
|
|
if (!supType && d.voiStatus === '1') {
|
|
// 违章单未处理删除
|
|
html += "<a onclick=\"delData('" + d.id + "','1','1')\">删除</a>";
|
|
} else if (!supType && d.voiStatus === '5') {
|
|
// 违章单整改已归档删除
|
|
html += "<a onclick=\"delData('" + d.id + "','2','1')\">删除</a>";
|
|
}
|
|
}
|
|
return html;
|
|
}
|
|
|
|
// 当前时间 小于整改完成时间 有回撤
|
|
function compareTime(time, time2) {
|
|
let timestamp = new Date(time).getTime();
|
|
let timestamp2 = new Date(time2).getTime();
|
|
return (timestamp - timestamp2) > 86400000 * 3;
|
|
}
|
|
|
|
// 根据ID获取违章信息
|
|
function loadVoiDataByIdAjax(id) {
|
|
let url = dataUrl + 'proteam/pot/stag/getVoiDataById';
|
|
let params = {
|
|
'id': id,
|
|
};
|
|
ajaxRequest(url, "POST", params, true, function () {
|
|
}, function (result) {
|
|
if (result.code === 200) {
|
|
setTrData(result.data);
|
|
} else if (result.code === 500) {
|
|
|
|
} else if (result.code === 401) {
|
|
logout(1);
|
|
}
|
|
}, function (xhr) {
|
|
|
|
});
|
|
|
|
function setTrData(item) {
|
|
if (item.status === '申诉成功已归档' || item.status === '整改已归档') {
|
|
loadVoiNumAjax();
|
|
loadVoiAjax();
|
|
} else {
|
|
checkObj.find('td').eq(1).html(item.org);
|
|
checkObj.find('td').eq(2).html(item.proName).attr('data-mtpis', item.proName);
|
|
checkObj.find('td').eq(3).html(setRiskLevelColor(item.riskLevel));
|
|
checkObj.find('td').eq(4).html(item.type);
|
|
checkObj.find('td').eq(5).html(setLevelId(item.levelId));
|
|
checkObj.find('td').eq(6).html(item.createTime);
|
|
checkObj.find('td').eq(7).html(item.status);
|
|
checkObj.find('td').eq(8).html(setRoleAuth(item));
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 今日施工计划 数量
|
|
function loadWorkPlanNumAjax() {
|
|
let url = dataUrl + 'proteam/pot/stag/getWorkPlan';
|
|
let params = {
|
|
'isSup': user.isSup,
|
|
'orgId': user.orgId
|
|
};
|
|
ajaxRequest(url, "POST", params, true, function () {
|
|
}, function (result) {
|
|
if (result.code === 200) {
|
|
setWorkPlanNum(result);
|
|
} else if (result.code === 500) {
|
|
layer.alert(result.msg, { icon: 2 })
|
|
} else if (result.code === 401) {
|
|
logout(1);
|
|
}
|
|
}, function (xhr) {
|
|
|
|
});
|
|
function setWorkPlanNum(obj) {
|
|
let num2 = obj.planNum, num3 = obj.sgNum;
|
|
$('#planNum').html(num2);
|
|
$('#yzxNum').html(num3);
|
|
}
|
|
|
|
}
|
|
|
|
// 今日施工计划
|
|
function loadWorkPlanAjax(type) {
|
|
let url = dataUrl + 'proteam/pot/stag/getWorkPlanList';
|
|
let params = {
|
|
'isSup': user.isSup,
|
|
'orgId': user.orgId,
|
|
'type': type
|
|
};
|
|
ajaxRequest(url, "POST", params, true, function () {
|
|
}, function (result) {
|
|
if (result.code === 200) {
|
|
setTabData3(result.data);
|
|
} else if (result.code === 500) {
|
|
|
|
} else if (result.code === 401) {
|
|
logout(1);
|
|
}
|
|
}, function (xhr) {
|
|
|
|
});
|
|
|
|
function setTabData3(dataList) {
|
|
let html = '';
|
|
if (dataList && dataList.length > 0) {
|
|
$.each(dataList, function (index, item) {
|
|
html += '<tr>' +
|
|
'<td>' + (index + 1) + '</td>' +
|
|
'<td data-mtpis="' + item.proName + '">' + item.proName + '</td>' +
|
|
'<td>' + setRiskLevelColor(item.riskLevel) + '</td>' +
|
|
'<td data-mtpis="' + item.jobTeam + '">' + item.jobTeam + '</td>' +
|
|
'<td data-mtpis="' + item.jobLx + '">' + item.jobLx + '</td>' +
|
|
'<td></td>' +
|
|
'</tr>'
|
|
})
|
|
} else {
|
|
html += '<tr>' +
|
|
'<td colspan = "5">无数据</td>' +
|
|
'</tr>'
|
|
}
|
|
$('#workPlanTable tr:not(:first)').remove();
|
|
$('#workPlanTable tbody').empty().append(html);
|
|
}
|
|
|
|
}
|
|
|
|
// 报岗
|
|
function loadJobApplicationAjax() {
|
|
let url = dataUrl + 'proteam/pot/stag/isJobApplication';
|
|
let params = {
|
|
'orgId': user.orgId
|
|
};
|
|
ajaxRequest(url, "POST", params, true, function () {
|
|
}, function (result) {
|
|
if (result.code === 200) {
|
|
setJobApplication(result.data);
|
|
} else if (result.code === 500) {
|
|
layer.alert(result.msg, { icon: 2 })
|
|
setEarlyNumByType(null);
|
|
} else if (result.code === 401) {
|
|
logout(1);
|
|
}
|
|
}, function (xhr) {
|
|
setEarlyNumByType(null);
|
|
});
|
|
|
|
// 设置报岗状态
|
|
function setJobApplication(data) {
|
|
if (data === 1) {
|
|
$('#bg-div img').attr('src', '../../img/staging/ybg.png')
|
|
$('#bg-div img').removeAttr('data-mtpis');
|
|
$('#bg-div img').off("click");
|
|
$('#bg-div p').eq(0).html('今日已报岗');
|
|
$('#bg-div p').eq(1).html(getNowTime());
|
|
} else if (data === 0) {
|
|
$('#bg-div img').attr('src', '../../img/staging/wbg.png')
|
|
$('#bg-div img').attr('data-mtpis', '点击进行报岗')
|
|
$('#bg-div img').css('cursor', 'pointer');
|
|
$('#bg-div p').eq(0).html('今日未报岗');
|
|
$('#bg-div p').eq(1).html(getNowTime());
|
|
$('#bg-div img').on('click', jobApplication)
|
|
}
|
|
}
|
|
}
|
|
|
|
// 报岗
|
|
function jobApplication() {
|
|
layer.confirm('<p style="color:#000;text-align:center;font-size:20px;">是否报岗?</p>', { title: '操作提示', move: false, area: ['300px', '200px'] }, function (index) {
|
|
layer.close(index);
|
|
let url = dataUrl + 'proteam/sys/problem/addBgData';
|
|
let params = {
|
|
'isSup': user.isSup,
|
|
'orgId': user.orgId,
|
|
'userId': user.userId,
|
|
'loginName': user.nickName
|
|
};
|
|
ajaxRequest(url, "POST", params, true, function () {
|
|
}, function (result) {
|
|
console.log(result);
|
|
if (result.code == '200') {
|
|
layer.msg(result.msg, { icon: 1 })
|
|
loadJobApplicationAjax();
|
|
} else if (result.code == '201') {
|
|
layer.alert(result.msg, { icon: 2 })
|
|
} else if (result.code == '401') {
|
|
logout(1);
|
|
}
|
|
}, function (xhr) {
|
|
|
|
});
|
|
});
|
|
}
|
|
|
|
|
|
|
|
// 今日施工队伍
|
|
function loadWorkTeamAjax() {
|
|
let url = dataUrl + 'proteam/pot/stag/getWorkTeamList';
|
|
let params = {
|
|
'isSup': user.isSup,
|
|
'orgId': user.orgId
|
|
};
|
|
ajaxRequest(url, "POST", params, true, function () {
|
|
}, function (result) {
|
|
if (result.code === 200) {
|
|
setTabData4(result.data);
|
|
} else if (result.code === 500) {
|
|
layer.alert(result.msg, { icon: 2 })
|
|
} else if (result.code === 401) {
|
|
logout(1);
|
|
}
|
|
}, function (xhr) {
|
|
|
|
});
|
|
|
|
// 今日施工队伍赋值
|
|
function setTabData4(dataList) {
|
|
let html = '';
|
|
if (dataList && dataList.length > 0) {
|
|
$.each(dataList, function (index, item) {
|
|
html += '<tr>' +
|
|
'<td>' + (index + 1) + '</td>' +
|
|
'<td>' + transformNull(item.teamName) + '</td>' +
|
|
'<td>' + transformNull(item.fzrName) + '<br>' + transformNull(item.phone) + '</td>' +
|
|
'<td>' + item.dayNum + '</td>' +
|
|
'<td><div class="class-rate-demo-theme" lay-options="{value: ' + parseInt(item.zhpj) / 2 + '}"></div></td>' +
|
|
'<td>' + setTeamLabel(item.labName) + '</td>' +
|
|
'<td>' + setWorkTeamStatus(item.status) + '</td>' +
|
|
'</tr>'
|
|
})
|
|
} else {
|
|
html += '<tr>' +
|
|
'<td colspan = "7">无数据</td>' +
|
|
'</tr>'
|
|
}
|
|
$('#workTeamTable tr:not(:first)').remove();
|
|
$('#workTeamTable tbody').empty().append(html);
|
|
rate.render({
|
|
elem: '.class-rate-demo-theme',
|
|
readonly: true,
|
|
theme: '#1E9FFF', // 自定义主题色
|
|
half: true
|
|
});
|
|
}
|
|
|
|
// 班组状态
|
|
function setWorkTeamStatus(value) {
|
|
if (value === '01') {
|
|
return '开工'
|
|
} else if (value === '02') {
|
|
return '暂停'
|
|
} else if (value === '03') {
|
|
return '作业中'
|
|
}else if (value === '04') {
|
|
return '完工'
|
|
}else{
|
|
return '开工了'
|
|
}
|
|
}
|
|
|
|
// 班组标签
|
|
function setTeamLabel(value) {
|
|
if (!value) {
|
|
return '';
|
|
}
|
|
let html = '<div class="layout" style="flex-wrap: wrap;">';
|
|
const arr = value.split(',');
|
|
let result = {};
|
|
arr.forEach(str => {
|
|
if(str){
|
|
if (result[str]) {
|
|
result[str]++;
|
|
} else {
|
|
result[str] = 1;
|
|
}
|
|
}
|
|
});
|
|
for (let key in result) {
|
|
html += '<button style="display:block;margin:5px 5px 5px 0;padding: 0 3px;font-size:13px;" class="layui-btn layui-btn-primary layui-btn-sm layui-border-blue">' + key + ' ' + result[key] + '</button>'
|
|
}
|
|
html += '</div>'
|
|
return html;
|
|
}
|
|
}
|
|
|
|
// 预警信息
|
|
function loadEarlyNumAjax() {
|
|
let url = dataUrl + 'proteam/pot/city/getEarMaps';
|
|
let params = {
|
|
'isSup': user.isSup,
|
|
'orgId': user.orgId
|
|
};
|
|
ajaxRequest(url, "POST", params, true, function () {
|
|
}, function (result) {
|
|
console.log(result)
|
|
if (result.code === 200) {
|
|
setEarlyNumByType(result);
|
|
} else if (result.code === 500) {
|
|
layer.alert(result.msg, { icon: 2 })
|
|
setEarlyNumByType(null);
|
|
} else if (result.code === 401) {
|
|
logout(1);
|
|
}
|
|
}, function (xhr) {
|
|
setEarlyNumByType(null);
|
|
});
|
|
|
|
// 预警提醒数量赋值
|
|
function setEarlyNumByType(data) {
|
|
if (data) {
|
|
$('#early_module1').html(data.one);
|
|
$('#early_module2').html(data.two);
|
|
$('#early_module3').html(data.three);
|
|
$('#early_module4').html(data.four);
|
|
$('#early_module5').html(data.five);
|
|
$('#early_module6').html(data.six);
|
|
$('#early_module7').html(data.seven);
|
|
|
|
} else {
|
|
for (let i = 1; i <= 7; i++) {
|
|
$('#early_module' + (i) + '').html(0);
|
|
}
|
|
}
|
|
}
|
|
|
|
} |