797 lines
42 KiB
Plaintext
797 lines
42 KiB
Plaintext
|
|
<%@page import="com.sipai.entity.equipment.EquipmentCommStr"%>
|
|||
|
|
<%@ page language="java" pageEncoding="UTF-8"%>
|
|||
|
|
<%request.setAttribute("EquipmentLife_Warning", EquipmentCommStr.EquipmentLife_Warning); %>
|
|||
|
|
<%request.setAttribute("EquipmentLife_Alarm", EquipmentCommStr.EquipmentLife_Alarm); %>
|
|||
|
|
<%request.setAttribute("EquipmentLife_All", EquipmentCommStr.EquipmentLife_All); %>
|
|||
|
|
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
|||
|
|
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
|||
|
|
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
|
|||
|
|
<%@ page import="com.sipai.entity.base.ServerObject"%>
|
|||
|
|
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
|
|||
|
|
<%request.setAttribute("UNIT_TYPE_BIZ",com.sipai.tools.CommString.UNIT_TYPE_BIZ);%>
|
|||
|
|
<%request.setAttribute("UNIT_TYPE_COMPANY",com.sipai.tools.CommString.UNIT_TYPE_COMPANY);%>
|
|||
|
|
<%request.setAttribute("UNIT_TYPE_DEPT",com.sipai.tools.CommString.UNIT_TYPE_DEPT);%>
|
|||
|
|
|
|||
|
|
<%request.setAttribute("Flag_Active",com.sipai.tools.CommString.Flag_Active);%>
|
|||
|
|
<%request.setAttribute("Flag_Unactive",com.sipai.tools.CommString.Flag_Unactive);%>
|
|||
|
|
<!DOCTYPE html>
|
|||
|
|
<!-- <html lang="zh-CN"> -->
|
|||
|
|
<!-- BEGIN HEAD -->
|
|||
|
|
|
|||
|
|
<head>
|
|||
|
|
<title><%= ServerObject.atttable.get("TOPTITLE")%></title>
|
|||
|
|
<style type="text/css">
|
|||
|
|
.main-header {
|
|||
|
|
display: none;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.content-header {
|
|||
|
|
display: none;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.main-footer {
|
|||
|
|
display: none;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.select2-container .select2-selection--single {
|
|||
|
|
height: 34px;
|
|||
|
|
line-height: 34px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.select2-selection__arrow {
|
|||
|
|
margin-top: 3px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.table-hover>tbody>tr:hover {
|
|||
|
|
cursor: pointer;
|
|||
|
|
}
|
|||
|
|
</style>
|
|||
|
|
<!-- 引用页头及CSS页-->
|
|||
|
|
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
|||
|
|
<!-- echarts-->
|
|||
|
|
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/echarts/echarts.js"
|
|||
|
|
charset="utf-8"></script>
|
|||
|
|
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/echarts/macarons.js"
|
|||
|
|
charset="utf-8"></script>
|
|||
|
|
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/echarts/ecStat.min.js"
|
|||
|
|
charset="utf-8"></script>
|
|||
|
|
<!-- JavaScript常用函数库-->
|
|||
|
|
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/jutils-master/jutils.min.js"
|
|||
|
|
charset="utf-8"></script>
|
|||
|
|
<script type="text/javascript">
|
|||
|
|
var equipmentid;//设备经济寿命模型全局变量
|
|||
|
|
var equipmentName;//设备经济寿命模型全局变量
|
|||
|
|
var equipmentNumber;//设备经济寿命模型全局变量
|
|||
|
|
var equipmentSpecificationName;//设备经济寿命模型全局变量
|
|||
|
|
var equipmentmodelName;//设备经济寿命模型全局变量
|
|||
|
|
var equipmentmanuFacturer;//设备经济寿命模型全局变量
|
|||
|
|
var equipmentids="";//设备比对模型全局变量
|
|||
|
|
var equipmentNames="";//设备比对模型全局变量
|
|||
|
|
|
|||
|
|
var $table;
|
|||
|
|
var selectionIds = []; //保存选中ids
|
|||
|
|
var selectionNames = []; //保存选中Names
|
|||
|
|
|
|||
|
|
//选中事件操作数组
|
|||
|
|
var union = function(array,ids){
|
|||
|
|
$.each(ids, function (i, id) {
|
|||
|
|
if($.inArray(id,array)==-1){
|
|||
|
|
array[array.length] = id;
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
return array;
|
|||
|
|
};
|
|||
|
|
//取消选中事件操作数组
|
|||
|
|
var difference = function(array,ids){
|
|||
|
|
$.each(ids, function (i, id) {
|
|||
|
|
var index = $.inArray(id,array);
|
|||
|
|
if(index!=-1){
|
|||
|
|
array.splice(index, 1);
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
return array;
|
|||
|
|
};
|
|||
|
|
var _ = {"union":union,"difference":difference};
|
|||
|
|
//表格分页之前处理多选框数据
|
|||
|
|
function responseHandler(res) {
|
|||
|
|
$.each(res.rows, function (i, row) {
|
|||
|
|
row.checkStatus = $.inArray(row.id, selectionIds) != -1; //判断当前行的数据id是否存在与选中的数组,存在则将多选框状态变为true
|
|||
|
|
});
|
|||
|
|
return res;
|
|||
|
|
}
|
|||
|
|
function viewEconomicLifeFun(id,name,number,equipmentSpecificationname,equipmentmodelname,equipmentmanufacturer) {
|
|||
|
|
equipmentid = id;
|
|||
|
|
equipmentName = name;
|
|||
|
|
equipmentNumber = number;
|
|||
|
|
equipmentSpecificationName = equipmentSpecificationname;;//设备经济寿命模型全局变量
|
|||
|
|
equipmentmodelName = equipmentmodelname;;//设备经济寿命模型全局变量
|
|||
|
|
equipmentmanuFacturer = equipmentmanufacturer;;//设备经济寿命模型全局变量
|
|||
|
|
$.post(ext.contextPath + '/valueEngineering/equipmentEvaluate/showEconomicLife4pumpAnalysis.do', {},
|
|||
|
|
function (data) {
|
|||
|
|
$("#economicLifeDiv").html(data);
|
|||
|
|
openModal('economicLifeModal');
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
function viewEconomicLifeContrastFun() {
|
|||
|
|
equipmentids="";//设备比对模型全局变量
|
|||
|
|
equipmentNames="";//设备比对模型全局变量
|
|||
|
|
$.each(selectionIds, function(index, item){
|
|||
|
|
if(equipmentids!=""){
|
|||
|
|
equipmentids+=",";
|
|||
|
|
}
|
|||
|
|
equipmentids+=item;
|
|||
|
|
});
|
|||
|
|
if (equipmentids == "") {
|
|||
|
|
showAlert('d', '请先选择记录', 'mainAlertdiv');
|
|||
|
|
}else{
|
|||
|
|
$.each(selectionNames, function(index, item){
|
|||
|
|
if(equipmentNames!=""){
|
|||
|
|
equipmentNames+=",";
|
|||
|
|
}
|
|||
|
|
equipmentNames+=item;
|
|||
|
|
});
|
|||
|
|
$.post(ext.contextPath + '/valueEngineering/equipmentEvaluate/showEconomicLife4pumpAnalysisContrast.do', {},
|
|||
|
|
function (data) {
|
|||
|
|
$("#economicLifeDiv").html(data);
|
|||
|
|
openModal('economicLifeModal');
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
//表格查询参数
|
|||
|
|
function queryParamsFun(params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
|||
|
|
var searchInfo = {};
|
|||
|
|
searchInfo['rows'] = params.limit;
|
|||
|
|
searchInfo['page'] = params.offset / params.limit + 1;
|
|||
|
|
searchInfo['sort'] = params.sort;
|
|||
|
|
searchInfo['order'] = params.order;
|
|||
|
|
searchInfo['equipmentCardType'] = $("#equipmentCardType").val();
|
|||
|
|
searchInfo['ratedPower'] = $("#ratedPower").val();
|
|||
|
|
searchInfo['likeSea'] = $("#likeSea").val();
|
|||
|
|
searchInfo['unitId'] = unitId;
|
|||
|
|
//设备名称
|
|||
|
|
searchInfo['search_name'] = $("#search_name").val();
|
|||
|
|
searchInfo['processSectionId'] = $("#processSection").val(); //工艺段
|
|||
|
|
searchInfo['equipmentLevel'] = $("#equipmentLevel").val(); //ABC分类
|
|||
|
|
searchInfo['equipmentstatus'] = $("#equipmentstatus").val(); //状态
|
|||
|
|
searchInfo['search_pid1'] = $("#search_pid1").val(); //设备类型
|
|||
|
|
searchInfo['search_pid2'] = $("#search_pid2").val(); //资产类型
|
|||
|
|
searchInfo['equipmentBelong'] = $("#equipmentBelong").val(); //设备所属--常排项目用
|
|||
|
|
searchInfo['isequipcode'] = document.getElementById("isequipcode").value; //用于设备编码筛选
|
|||
|
|
searchInfo['alarmLevel'] = $("#alarmLevel").val(); //用于报警
|
|||
|
|
|
|||
|
|
return searchInfo;
|
|||
|
|
/* return {
|
|||
|
|
rows: params.limit, // 每页要显示的数据条数
|
|||
|
|
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
|||
|
|
sort: params.sort, // 要排序的字段
|
|||
|
|
order: params.order,
|
|||
|
|
search_name: $("#search_name").val(),
|
|||
|
|
companyId: companyId,
|
|||
|
|
alarmLevel: $("#alarmLevel").val(),
|
|||
|
|
equipmentClass: $("#equipmentCardClass").val(),
|
|||
|
|
} */
|
|||
|
|
};
|
|||
|
|
var judgeColor = function (difference) {
|
|||
|
|
if (difference <= 0) {
|
|||
|
|
console.log("<");
|
|||
|
|
return { css: { "background-color": "red" } }
|
|||
|
|
//return { css: { 'background-color': '#FF7F50' } };
|
|||
|
|
} else if (difference > 0 && difference < alarmYears) {
|
|||
|
|
console.log("<>");
|
|||
|
|
return { css: { "background-color": "green" } }
|
|||
|
|
} else {
|
|||
|
|
console.log("yesss" + index);
|
|||
|
|
return {};
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
var dosearch = function () {
|
|||
|
|
$("#table").bootstrapTable('refresh');
|
|||
|
|
};
|
|||
|
|
var companyId = "";
|
|||
|
|
var alarmYears = 1;
|
|||
|
|
$(function () {
|
|||
|
|
if(unitId==null || unitId=='' || unitId==undefined){
|
|||
|
|
unitId = '${unitId}';
|
|||
|
|
}
|
|||
|
|
var flag = IsApp();
|
|||
|
|
if (flag == true) {
|
|||
|
|
|
|||
|
|
} else {
|
|||
|
|
$(".main-header").show();
|
|||
|
|
$(".content-header").show();
|
|||
|
|
$(".main-footer").show();
|
|||
|
|
}
|
|||
|
|
$.post(ext.contextPath + "/user/showCompanySelectTree.do", {}, function (data) {
|
|||
|
|
$('#companySelectTree').html(data);
|
|||
|
|
});
|
|||
|
|
$("#alarmLevel").select2({ minimumResultsForSearch: 10, placeholder: '请选择', allowClear: true }).val("").trigger("change");
|
|||
|
|
fixSelect2ToTool('alarmLevel');
|
|||
|
|
$("#alarmLevel").on("change", function (e) {
|
|||
|
|
dosearch();
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
//工艺段
|
|||
|
|
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId: unitId}, function (data) {
|
|||
|
|
$("#processSection").empty();
|
|||
|
|
var selelct_ = $("#processSection").select2({
|
|||
|
|
data: data,
|
|||
|
|
cache: false,
|
|||
|
|
placeholder: '请选择',//默认文字提示
|
|||
|
|
allowClear: true,//允许清空
|
|||
|
|
escapeMarkup: function (markup) {
|
|||
|
|
return markup;
|
|||
|
|
}, // 自定义格式化防止xss注入
|
|||
|
|
language: "zh-CN",
|
|||
|
|
minimumInputLength: 0,
|
|||
|
|
minimumResultsForSearch: 10,//数据大于10个启用搜索框
|
|||
|
|
formatResult: function formatRepo(repo) {
|
|||
|
|
return repo.text;
|
|||
|
|
}, // 函数用来渲染结果
|
|||
|
|
formatSelection: function formatRepoSelection(repo) {
|
|||
|
|
return repo.text;
|
|||
|
|
} // 函数用于呈现当前的选择
|
|||
|
|
});
|
|||
|
|
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
|
|||
|
|
selelct_.val('').trigger("change");
|
|||
|
|
selelct_.on("change", function (e) {
|
|||
|
|
dosearch();
|
|||
|
|
});
|
|||
|
|
}, 'json');
|
|||
|
|
//abc分类
|
|||
|
|
$.post(ext.contextPath + "/equipment/equipmentLevel/getEquipmentLevel4Select.do", {companyId: companyId}, function (data) {
|
|||
|
|
$("#equipmentLevel").empty();
|
|||
|
|
var selelct_ = $("#equipmentLevel").select2({
|
|||
|
|
data: data,
|
|||
|
|
cache: false,
|
|||
|
|
placeholder: '请选择',//默认文字提示
|
|||
|
|
allowClear: true,//允许清空
|
|||
|
|
escapeMarkup: function (markup) {
|
|||
|
|
return markup;
|
|||
|
|
}, // 自定义格式化防止xss注入
|
|||
|
|
language: "zh-CN",
|
|||
|
|
minimumInputLength: 0,
|
|||
|
|
minimumResultsForSearch: 10,//数据大于10个启用搜索框
|
|||
|
|
formatResult: function formatRepo(repo) {
|
|||
|
|
return repo.text;
|
|||
|
|
}, // 函数用来渲染结果
|
|||
|
|
formatSelection: function formatRepoSelection(repo) {
|
|||
|
|
return repo.text;
|
|||
|
|
} // 函数用于呈现当前的选择
|
|||
|
|
});
|
|||
|
|
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
|
|||
|
|
selelct_.val('').trigger("change");
|
|||
|
|
selelct_.on("change", function (e) {
|
|||
|
|
dosearch();
|
|||
|
|
});
|
|||
|
|
}, 'json');
|
|||
|
|
|
|||
|
|
|
|||
|
|
//设备所属--常排项目用
|
|||
|
|
$.post(ext.contextPath + "/equipment/equipmentBelong/getEquipmentBelong4Select.do", {companyId: unitId}, function (data) {
|
|||
|
|
$("#equipmentBelong").empty();
|
|||
|
|
var selelct_ = $("#equipmentBelong").select2({
|
|||
|
|
data: data,
|
|||
|
|
cache: false,
|
|||
|
|
placeholder: '请选择',//默认文字提示
|
|||
|
|
allowClear: true,//允许清空
|
|||
|
|
escapeMarkup: function (markup) {
|
|||
|
|
return markup;
|
|||
|
|
}, // 自定义格式化防止xss注入
|
|||
|
|
language: "zh-CN",
|
|||
|
|
minimumInputLength: 0,
|
|||
|
|
minimumResultsForSearch: 10,//数据大于10个启用搜索框
|
|||
|
|
formatResult: function formatRepo(repo) {
|
|||
|
|
return repo.text;
|
|||
|
|
}, // 函数用来渲染结果
|
|||
|
|
formatSelection: function formatRepoSelection(repo) {
|
|||
|
|
return repo.text;
|
|||
|
|
} // 函数用于呈现当前的选择
|
|||
|
|
});
|
|||
|
|
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
|
|||
|
|
selelct_.val('').trigger("change");
|
|||
|
|
selelct_.on("change", function (e) {
|
|||
|
|
dosearch();
|
|||
|
|
});
|
|||
|
|
}, 'json');
|
|||
|
|
//状态
|
|||
|
|
$.post(ext.contextPath + "/equipment/equipmentStatusManagement/getEquipmentstatus4Select.do", {companyId: companyId}, function (data) {
|
|||
|
|
$("#equipmentstatus").empty();
|
|||
|
|
var selelct_ = $("#equipmentstatus").select2({
|
|||
|
|
data: data,
|
|||
|
|
cache: false,
|
|||
|
|
placeholder: '请选择',//默认文字提示
|
|||
|
|
allowClear: true,//允许清空
|
|||
|
|
escapeMarkup: function (markup) {
|
|||
|
|
return markup;
|
|||
|
|
}, // 自定义格式化防止xss注入
|
|||
|
|
language: "zh-CN",
|
|||
|
|
minimumInputLength: 0,
|
|||
|
|
minimumResultsForSearch: 10,//数据大于10个启用搜索框
|
|||
|
|
formatResult: function formatRepo(repo) {
|
|||
|
|
return repo.text;
|
|||
|
|
}, // 函数用来渲染结果
|
|||
|
|
formatSelection: function formatRepoSelection(repo) {
|
|||
|
|
return repo.text;
|
|||
|
|
} // 函数用于呈现当前的选择
|
|||
|
|
});
|
|||
|
|
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
|
|||
|
|
selelct_.val('').trigger("change");
|
|||
|
|
selelct_.on("change", function (e) {
|
|||
|
|
dosearch();
|
|||
|
|
});
|
|||
|
|
}, 'json');
|
|||
|
|
//设备类型树-默认泵类
|
|||
|
|
$("#search_pid1").val("1");//-默认泵类
|
|||
|
|
$.post(ext.contextPath + '/equipment/equipmentClass/getEquipmentClassJsonForTree.do', {
|
|||
|
|
ng: '',
|
|||
|
|
unitId: unitId,
|
|||
|
|
classID:'1'
|
|||
|
|
}, function (data) {
|
|||
|
|
//console.log("data",data[0]);
|
|||
|
|
if (data.length == 1 && !data[0].hasOwnProperty("nodes")) {
|
|||
|
|
//当登陆者的pid以下没有子节点时显示单独一个span
|
|||
|
|
$("#search_pid1").val(data[0].id);
|
|||
|
|
$("#companyselect1").hide();
|
|||
|
|
$("#companyName1").text("设备类型:" + data[0].text);
|
|||
|
|
// showtable();
|
|||
|
|
} else if ((data.length == 1 && data.nodes != "") || data.length > 1) {
|
|||
|
|
//第一次加载时赋值
|
|||
|
|
$('#companytree1').treeview({
|
|||
|
|
data: data,
|
|||
|
|
showBorder: false,
|
|||
|
|
showCheckbox: false,
|
|||
|
|
levels: 1
|
|||
|
|
});
|
|||
|
|
$('#companytree1').on('nodeSelected', function (event, data) {
|
|||
|
|
//只能点最底层
|
|||
|
|
$("#search_pid1").val(data.id);
|
|||
|
|
$("#cname_input1").val(data.text);
|
|||
|
|
document.getElementById('company_select1').style.display = "none";
|
|||
|
|
$("ul#company_select1").hide();
|
|||
|
|
$("#table").bootstrapTable('refresh');
|
|||
|
|
});
|
|||
|
|
} else {
|
|||
|
|
//待完善
|
|||
|
|
}
|
|||
|
|
;
|
|||
|
|
}, 'json');
|
|||
|
|
|
|||
|
|
//防止点击树收起下拉框
|
|||
|
|
$("#company_select1").on("click", function (e) {
|
|||
|
|
event.stopPropagation();
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
//点击树之外其他区域收起
|
|||
|
|
$(document).click(function () {
|
|||
|
|
$("#company_select1").hide();
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
|
|||
|
|
//资产类型树
|
|||
|
|
$.post(ext.contextPath + '/equipment/assetClass/getAssetClassJson.do', {ng: ''}, function (data) {
|
|||
|
|
//console.log("data",data[0]);
|
|||
|
|
if (data.length == 1 && !data[0].hasOwnProperty("nodes")) {
|
|||
|
|
//当登陆者的pid以下没有子节点时显示单独一个span
|
|||
|
|
$("#search_pid2").val(data[0].id);
|
|||
|
|
$("#companyselect2").hide();
|
|||
|
|
$("#companyName2").text("资产类型:" + data[0].text);
|
|||
|
|
// showtable();
|
|||
|
|
} else if ((data.length == 1 && data.nodes != "") || data.length > 1) {
|
|||
|
|
//第一次加载时赋值
|
|||
|
|
$('#companytree2').treeview({
|
|||
|
|
data: data,
|
|||
|
|
showBorder: false,
|
|||
|
|
showCheckbox: false,
|
|||
|
|
levels: 1
|
|||
|
|
});
|
|||
|
|
$('#companytree2').on('nodeSelected', function (event, data) {
|
|||
|
|
//只能点最底层
|
|||
|
|
$("#search_pid2").val(data.id);
|
|||
|
|
$("#cname_input2").val(data.text);
|
|||
|
|
document.getElementById('company_select2').style.display = "none";
|
|||
|
|
$("ul#company_select2").hide();
|
|||
|
|
$("#table").bootstrapTable('refresh');
|
|||
|
|
|
|||
|
|
|
|||
|
|
// $("ul#company_select").hide();
|
|||
|
|
});
|
|||
|
|
} else {
|
|||
|
|
//待完善
|
|||
|
|
}
|
|||
|
|
;
|
|||
|
|
}, 'json');
|
|||
|
|
|
|||
|
|
//筛选设备编码
|
|||
|
|
$("#isequipcode").select2({
|
|||
|
|
ajax: {
|
|||
|
|
type: 'POST',
|
|||
|
|
url: ext.contextPath + '/equipment/getListForSelect.do',
|
|||
|
|
dataType: 'json',
|
|||
|
|
delay: 250,
|
|||
|
|
processResults: function (data) {
|
|||
|
|
return {
|
|||
|
|
results: data
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
cache: true
|
|||
|
|
},
|
|||
|
|
placeholder: '全部',//默认文字提示
|
|||
|
|
allowClear: true,//允许清空
|
|||
|
|
escapeMarkup: function (markup) {
|
|||
|
|
return markup;
|
|||
|
|
}, // 自定义格式化防止xss注入
|
|||
|
|
language: "zh-CN",
|
|||
|
|
minimumInputLength: 0,
|
|||
|
|
minimumResultsForSearch: -1,//禁用搜索框
|
|||
|
|
formatResult: function formatRepo(repo) {
|
|||
|
|
return repo.text;
|
|||
|
|
}, // 函数用来渲染结果
|
|||
|
|
formatSelection: function formatRepoSelection(repo) {
|
|||
|
|
return repo.text;
|
|||
|
|
} // 函数用于呈现当前的选择
|
|||
|
|
});
|
|||
|
|
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
|
|||
|
|
//防止点击树收起下拉框
|
|||
|
|
$("#company_select2").on("click", function (e) {
|
|||
|
|
event.stopPropagation();
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
//点击树之外其他区域收起
|
|||
|
|
$(document).click(function () {
|
|||
|
|
$("#company_select2").hide();
|
|||
|
|
});
|
|||
|
|
initFun();
|
|||
|
|
});
|
|||
|
|
//获取报警颜色判断范围
|
|||
|
|
var initFun = function () {
|
|||
|
|
$.post(ext.contextPath + "/valueEngineering/equipmentModel/getActiveModal.do", {}, function (data) {
|
|||
|
|
//console.log(data);
|
|||
|
|
if (data != null && data != "" && data.rows[0].param1 != "") {
|
|||
|
|
alarmYears = data.rows[0].param1;
|
|||
|
|
}
|
|||
|
|
initTableFun();
|
|||
|
|
}, 'json');
|
|||
|
|
}
|
|||
|
|
//加载表格
|
|||
|
|
var initTableFun = function () {
|
|||
|
|
|
|||
|
|
$table = $("#table").bootstrapTable({ // 对应table标签的id
|
|||
|
|
url: ext.contextPath + '/equipment/getEquipmentAgeList.do', // 获取表格数据的url
|
|||
|
|
//cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
|||
|
|
clickToSelect:true,
|
|||
|
|
responseHandler:responseHandler, //在渲染页面数据之前执行的方法,此配置很重要!!!!!!!
|
|||
|
|
striped: true, //表格显示条纹,默认为false
|
|||
|
|
pagination: true, // 在表格底部显示分页组件,默认false
|
|||
|
|
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
|||
|
|
pageSize: 50, // 页面数据条数
|
|||
|
|
pageNumber: 1, // 首页页码
|
|||
|
|
sidePagination: 'server', // 设置为服务器端分页
|
|||
|
|
queryParams: queryParamsFun,
|
|||
|
|
//sortName: 'physical_life_time', // 要排序的字段
|
|||
|
|
//sortOrder: 'asc', // 排序规则
|
|||
|
|
onClickRow: function (row) {//单击行事件,执行查看功能
|
|||
|
|
//console.log(row);
|
|||
|
|
let equipmentSpecification_Name = '';
|
|||
|
|
if(row.equipmentSpecification!=null){
|
|||
|
|
equipmentSpecification_Name = row.equipmentSpecification.name;
|
|||
|
|
}
|
|||
|
|
viewEconomicLifeFun(row.id,row.equipmentname,row.equipmentcardid,
|
|||
|
|
equipmentSpecification_Name,row.equipmentmodelname,row.equipmentmanufacturer);
|
|||
|
|
},
|
|||
|
|
columns: [
|
|||
|
|
{
|
|||
|
|
checkbox: true, // 显示一个勾选框
|
|||
|
|
formatter: function (i,row) { // 每次加载 checkbox 时判断当前 row 的 id 是否已经存在全局 Set() 里
|
|||
|
|
if($.inArray(row.id,Array.from(selectionIds))!=-1){ // 因为 Set是集合,需要先转换成数组
|
|||
|
|
return {
|
|||
|
|
checked : true // 存在则选中
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}, {
|
|||
|
|
field: 'equipmentcardid', // 返回json数据中的name
|
|||
|
|
title: '设备编号', // 表格表头显示文字
|
|||
|
|
align: 'center', // 左右居中
|
|||
|
|
valign: 'middle' // 上下居中
|
|||
|
|
}, {
|
|||
|
|
field: 'equipmentname', // 返回json数据中的name
|
|||
|
|
title: '名称', // 表格表头显示文字
|
|||
|
|
align: 'center', // 左右居中
|
|||
|
|
valign: 'middle' // 上下居中
|
|||
|
|
}, {
|
|||
|
|
field: 'bizName', // 返回json数据中的name
|
|||
|
|
title: '所属厂区', // 表格表头显示文字
|
|||
|
|
align: 'center', // 左右居中
|
|||
|
|
valign: 'middle' // 上下居中
|
|||
|
|
}, {
|
|||
|
|
field: 'equipmentClass.name', // 返回json数据中的name
|
|||
|
|
title: '设备类型', // 表格表头显示文字
|
|||
|
|
align: 'center', // 左右居中
|
|||
|
|
valign: 'middle'
|
|||
|
|
}, {
|
|||
|
|
field: 'equipmentSpecification.name', // 返回json数据中的name
|
|||
|
|
title: '设备规格', // 表格表头显示文字
|
|||
|
|
align: 'center', // 左右居中
|
|||
|
|
valign: 'middle'
|
|||
|
|
}, {
|
|||
|
|
field: 'equipmentmodelname', // 返回json数据中的name
|
|||
|
|
title: '规格型号', // 表格表头显示文字
|
|||
|
|
width: '10%',
|
|||
|
|
align: 'center', // 左右居中
|
|||
|
|
valign: 'middle',
|
|||
|
|
formatter: function (value, row, index) {
|
|||
|
|
if (row.equipmentmodel != null && row.equipmentmodel != '') {
|
|||
|
|
if (row.equipmentTypeNumber != null && row.equipmentTypeNumber != '') {
|
|||
|
|
return "<span style='display: block;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;' title='" + row.equipmentTypeNumber.name + "'>" + row.equipmentTypeNumber.name + "</span>";
|
|||
|
|
}
|
|||
|
|
} else {
|
|||
|
|
return "<span style='display: block;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;' title='" + row.equipmentmodelname + "'>" + row.equipmentmodelname + "</span>";
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
}, {
|
|||
|
|
field: 'equipmentmanufacturer', // 返回json数据中的name
|
|||
|
|
title: '制造厂家', // 表格表头显示文字
|
|||
|
|
width: '8%',
|
|||
|
|
align: 'center', // 左右居中
|
|||
|
|
valign: 'middle',
|
|||
|
|
formatter: function (value, row, index) {
|
|||
|
|
return "<span style='display: block;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;' title='" + row.equipmentmanufacturer + "'>" + row.equipmentmanufacturer + "</span>";
|
|||
|
|
},
|
|||
|
|
class: 'colStyle'
|
|||
|
|
}, {
|
|||
|
|
/* field: 'technicalLifeTime', // 返回json数据中的name
|
|||
|
|
title: '技术寿命时间', // 表格表头显示文字
|
|||
|
|
sortable: true,
|
|||
|
|
align: 'center', // 左右居中
|
|||
|
|
valign: 'middle',
|
|||
|
|
formatter: function (value, row, index) {
|
|||
|
|
if (value != null && value != "") {
|
|||
|
|
return value.substring(0, 10);
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
cellStyle: function (value, row, index) {
|
|||
|
|
if (row.technicalLife != 0 && row.alreadyUsedYears != 0) {
|
|||
|
|
if (row.technicalLife - row.alreadyUsedYears < 0) {
|
|||
|
|
return { css: { "background-color": "#FF7F50" } };
|
|||
|
|
} else if (row.technicalLife - row.alreadyUsedYears >= 0 && row.technicalLife - row.alreadyUsedYears < alarmYears) {
|
|||
|
|
return { css: { "background-color": "#FFD700" } };
|
|||
|
|
} else {
|
|||
|
|
return {};
|
|||
|
|
}
|
|||
|
|
} else {
|
|||
|
|
return {};
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
|
|||
|
|
}, {
|
|||
|
|
field: 'physicalLifeTime', // 返回json数据中的name
|
|||
|
|
title: '物理寿命时间', // 表格表头显示文字
|
|||
|
|
sortable: true,
|
|||
|
|
align: 'center', // 左右居中
|
|||
|
|
valign: 'middle',
|
|||
|
|
formatter: function (value, row, index) {
|
|||
|
|
if (value != null && value != "") {
|
|||
|
|
return value.substring(0, 10);
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
cellStyle: function (value, row, index) {
|
|||
|
|
if (row.physicalLife != 0 && row.alreadyUsedYears != 0) {
|
|||
|
|
if (row.physicalLife - row.alreadyUsedYears < 0) {
|
|||
|
|
return { css: { "background-color": "#FF7F50" } };
|
|||
|
|
} else if (row.physicalLife - row.alreadyUsedYears >= 0 && row.physicalLife - row.alreadyUsedYears < alarmYears) {
|
|||
|
|
return { css: { "background-color": "#FFD700" } };
|
|||
|
|
} else {
|
|||
|
|
return {};
|
|||
|
|
}
|
|||
|
|
} else {
|
|||
|
|
return {};
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
}, { */
|
|||
|
|
field: 'economicLifeTime', // 返回json数据中的name
|
|||
|
|
title: '经济寿命时间', // 表格表头显示文字
|
|||
|
|
sortable: true,
|
|||
|
|
align: 'center', // 左右居中
|
|||
|
|
valign: 'middle',
|
|||
|
|
formatter: function (value, row, index) {
|
|||
|
|
if (value != null && value != "") {
|
|||
|
|
return value.substring(0, 10);
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
cellStyle: function (value, row, index) {
|
|||
|
|
if (row.physicalLife != 0 && row.alreadyUsedYears != 0) {
|
|||
|
|
if (row.economicLife - row.alreadyUsedYears < 0) {
|
|||
|
|
return { css: { "background-color": "#FF7F50" } };
|
|||
|
|
} else if (row.economicLife - row.alreadyUsedYears >= 0 && row.economicLife - row.alreadyUsedYears < alarmYears) {
|
|||
|
|
return { css: { "background-color": "#FFD700" } };
|
|||
|
|
} else {
|
|||
|
|
return {};
|
|||
|
|
}
|
|||
|
|
} else {
|
|||
|
|
return {};
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
}
|
|||
|
|
],
|
|||
|
|
onLoadSuccess: function () { //加载成功时执行
|
|||
|
|
adjustBootstrapTableView("table");
|
|||
|
|
},
|
|||
|
|
onLoadError: function () { //加载失败时执行
|
|||
|
|
console.info("加载数据失败");
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
})
|
|||
|
|
//绑定选中事件、取消事件、全部选中、全部取消
|
|||
|
|
$table.on('check.bs.table check-all.bs.table uncheck.bs.table uncheck-all.bs.table', function (e, rows, obj) {
|
|||
|
|
var ids = $.map(!$.isArray(rows) ? [rows] : rows, function (row) {
|
|||
|
|
return row.id;
|
|||
|
|
});
|
|||
|
|
var names = $.map(!$.isArray(rows) ? [rows] : rows, function (row) {
|
|||
|
|
return row.equipmentname;
|
|||
|
|
});
|
|||
|
|
func = $.inArray(e.type, ['check', 'check-all']) > -1 ? 'union' : 'difference';
|
|||
|
|
selectionIds = _[func](selectionIds, ids);
|
|||
|
|
// console.log(selectionIds);
|
|||
|
|
selectionNames = _[func](selectionNames, names);
|
|||
|
|
//console.log(selectionNames);
|
|||
|
|
|
|||
|
|
if ('check' == e.type) {
|
|||
|
|
obj.parent().addClass("checked");
|
|||
|
|
} else {
|
|||
|
|
obj.parent().removeClass("checked");
|
|||
|
|
}
|
|||
|
|
//adjustBootstrapTableView("table_user");
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
</script>
|
|||
|
|
|
|||
|
|
</head>
|
|||
|
|
|
|||
|
|
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
|||
|
|
<div class="wrapper">
|
|||
|
|
<!-- 引用top -->
|
|||
|
|
<%-- <jsp:include page="/jsp/top.jsp"></jsp:include> --%>
|
|||
|
|
<!-- 菜单栏 -->
|
|||
|
|
<%-- <jsp:include page="/jsp/left.jsp"></jsp:include>--%>
|
|||
|
|
<div class="content-wrapper">
|
|||
|
|
<!-- Content Header (Page header) -->
|
|||
|
|
<section class="content-header">
|
|||
|
|
<h1 id="head_title"></h1>
|
|||
|
|
<ol class="breadcrumb">
|
|||
|
|
<li><a id='head_firstlevel' href="#"><i class="fa fa-dashboard"></i> </a></li>
|
|||
|
|
<!-- <li class="active">Here</li> -->
|
|||
|
|
</ol>
|
|||
|
|
</section>
|
|||
|
|
<!-- Main content -->
|
|||
|
|
<section class="content container-fluid">
|
|||
|
|
<div id="mainAlertdiv"></div>
|
|||
|
|
<div id="economicLifeDiv"></div>
|
|||
|
|
<div class="row">
|
|||
|
|
<div class="col-md-12">
|
|||
|
|
<div class="form-group" style="padding:0;">
|
|||
|
|
<div class="form-group pull-left form-inline" style="width: 100%;margin-left: -1%;">
|
|||
|
|
<div class="input-group input-group-sm pull-left " style="padding-left:15px">
|
|||
|
|
<button type="button" class="btn btn-default btn-sm" onclick="viewEconomicLifeContrastFun();"><i
|
|||
|
|
class="fa fa-check"></i>设备比对
|
|||
|
|
</button>
|
|||
|
|
</div>
|
|||
|
|
<div id="div1" class="input-group input-group-sm pull-left">
|
|||
|
|
<input id="search_pid1" name="search_pid1" type="hidden"/>
|
|||
|
|
<span id="companyName1" style="width:300px;border: none;background: transparent;"></span>
|
|||
|
|
<ul id="companyselect1"
|
|||
|
|
style="list-style-type:none;padding-left:10px;width:400px;">
|
|||
|
|
<li class="dropdown messages-menu">
|
|||
|
|
<!-- Menu toggle button -->
|
|||
|
|
<a href="#" class="dropdown-toggle" data-toggle="dropdown" style="width:80px;"
|
|||
|
|
onclick="document.getElementById('company_select1').style.display = 'block';">
|
|||
|
|
<div class="input-group" style="height: 25px">
|
|||
|
|
<span class="input-group-addon"
|
|||
|
|
style="height:25px;color:#000000;border-top-left-radius: 4px;border-bottom-left-radius: 4px;font-weight:bold">设备类型:</span>
|
|||
|
|
<input class="form-control " id="cname_input1" name="cname_input1"
|
|||
|
|
style="height:28px;border-top-right-radius: 4px;border-bottom-right-radius: 4px;text-align:center;"
|
|||
|
|
readonly/>
|
|||
|
|
</div>
|
|||
|
|
</a>
|
|||
|
|
<ul id="company_select1" class="dropdown-menu" data-stopPropagation="true">
|
|||
|
|
<li>
|
|||
|
|
<div id="companytree1" style="width: 275px;overflow:auto;">
|
|||
|
|
</div>
|
|||
|
|
</li>
|
|||
|
|
</ul>
|
|||
|
|
</li>
|
|||
|
|
</ul>
|
|||
|
|
</div>
|
|||
|
|
<div id="div2" class="input-group input-group-sm pull-left"
|
|||
|
|
style="margin-top: -0.6%;margin-right: 1%;display:none;">
|
|||
|
|
<input id="search_pid2" name="search_pid2" type="hidden"/>
|
|||
|
|
<span id="companyName2" style="width:300px;border: none;background: transparent;"></span>
|
|||
|
|
<ul id="companyselect2"
|
|||
|
|
style="list-style-type:none;padding-left:10px;margin-top:8px;width:400px;">
|
|||
|
|
<li class="dropdown messages-menu">
|
|||
|
|
Menu toggle button
|
|||
|
|
<a href="#" class="dropdown-toggle" data-toggle="dropdown" style="width:80px;"
|
|||
|
|
onclick="document.getElementById('company_select2').style.display = 'block';">
|
|||
|
|
<div class="input-group" style="height: 25px">
|
|||
|
|
<span class="input-group-addon"
|
|||
|
|
style="height:25px;color:#000000;border-top-left-radius: 4px;border-bottom-left-radius: 4px;font-weight:bold">资产类型:</span>
|
|||
|
|
<input class="form-control " id="cname_input2" name="cname_input2"
|
|||
|
|
style="height:28px;border-top-right-radius: 4px;border-bottom-right-radius: 4px;text-align:center;"
|
|||
|
|
readonly/>
|
|||
|
|
</div>
|
|||
|
|
</a>
|
|||
|
|
<ul id="company_select2" class="dropdown-menu" data-stopPropagation="true">
|
|||
|
|
<li>
|
|||
|
|
<div id="companytree2" style="width: 275px;overflow:auto;">
|
|||
|
|
</div>
|
|||
|
|
</li>
|
|||
|
|
</ul>
|
|||
|
|
</li>
|
|||
|
|
</ul>
|
|||
|
|
</div>
|
|||
|
|
<div class="input-group input-group-sm pull-left" style="margin-right: 1%;">
|
|||
|
|
<label class="form-label" style="float: left;line-height: 2;">工艺段:</label>
|
|||
|
|
<select class="form-control select2 " id="processSection" name="processSection"
|
|||
|
|
style="width: 150px;"></select>
|
|||
|
|
</div>
|
|||
|
|
<!--设备所属-常排项目用-->
|
|||
|
|
<div class="input-group input-group-sm pull-left" style="margin-right: 1%;">
|
|||
|
|
<label class="form-label" style="float: left;line-height: 2;">设备所属:</label>
|
|||
|
|
<select class="form-control select2 " id="equipmentBelong" name="equipmentBelong"
|
|||
|
|
style="width: 150px;"></select>
|
|||
|
|
</div>
|
|||
|
|
<div class="form-group pull-right form-inline pull-left">
|
|||
|
|
|
|||
|
|
<div class="input-group input-group-sm" style="width: 250px;float: left;">
|
|||
|
|
<input type="text" id="search_name" name="search_name"
|
|||
|
|
class="form-control pull-right" placeholder="设备编号/设备名称/规格型号/制造厂家">
|
|||
|
|
<div class="input-group-btn">
|
|||
|
|
<button class="btn btn-default" onclick="dosearch();"><i
|
|||
|
|
class="fa fa-search"></i></button>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="col-md-12" style="display:none;">
|
|||
|
|
<div class="input-group input-group-sm pull-left" style="margin-right: 1%;">
|
|||
|
|
<label class="form-label" style="float: left;line-height: 2;">ABC分类:</label>
|
|||
|
|
<select class="form-control select2 " id="equipmentLevel" name="equipmentLevel"
|
|||
|
|
style="width: 100px;"></select>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="input-group input-group-sm pull-left" style="margin-right: 1%;">
|
|||
|
|
<label class="form-label" style="float: left;line-height: 2;">状态:</label>
|
|||
|
|
<select class="form-control select2 " id="equipmentstatus" name="equipmentstatus"
|
|||
|
|
style="width: 100px;"></select>
|
|||
|
|
</div>
|
|||
|
|
<div class="input-group input-group-sm pull-left">
|
|||
|
|
<label class="form-label" style="float: left;line-height: 2;">设备编码:</label>
|
|||
|
|
<select class="form-control select2 pull-left" id="isequipcode" name="isequipcode"
|
|||
|
|
style="width: 120px;" onchange="dosearch()">
|
|||
|
|
</select>
|
|||
|
|
</div>
|
|||
|
|
<div class="input-group input-group-sm pull-left">
|
|||
|
|
<label class="form-label">报警级别:</label>
|
|||
|
|
<select class="form-control select2 " id="alarmLevel" name="alarmLevel"
|
|||
|
|
style="width: 160px;">
|
|||
|
|
<option value="${EquipmentLife_Alarm}">报警
|
|||
|
|
</option>
|
|||
|
|
<option value="${EquipmentLife_Warning}">预警
|
|||
|
|
</option>
|
|||
|
|
<option value="${EquipmentLife_All}">报警+预警
|
|||
|
|
</option>
|
|||
|
|
</select>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<table id="table"></table>
|
|||
|
|
</section>
|
|||
|
|
</div>
|
|||
|
|
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include> --%>
|
|||
|
|
<%-- <jsp:include page="/jsp/side.jsp"></jsp:include> --%>
|
|||
|
|
</div>
|
|||
|
|
</body>
|
|||
|
|
|
|||
|
|
</html>
|