first commit
This commit is contained in:
304
WebRoot/jsp/valueEngineering/compareAdd.jsp
Normal file
304
WebRoot/jsp/valueEngineering/compareAdd.jsp
Normal file
@ -0,0 +1,304 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
|
||||
//选择条件后生成对比数据
|
||||
var createCompareFun = function () {
|
||||
var checkedItems = $("#equipmentTable").bootstrapTable('getAllSelections');
|
||||
//console.info(checkedItems)
|
||||
if(checkedItems!= null && checkedItems!=""){
|
||||
var models="";
|
||||
var ids ="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
if(models!=""){
|
||||
models+=",";
|
||||
}
|
||||
models+=item.equipmentmodel;
|
||||
if(ids!=""){
|
||||
ids+=",";
|
||||
}
|
||||
ids += item.id;
|
||||
});
|
||||
$("#model").val(models);
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + '/valueEngineering/equipmentEvaluate/createCompareData.do',$("#subForm").serialize(),function (result) {
|
||||
if (result.res > 0){
|
||||
closeModal('subModal');
|
||||
data = result.rows;
|
||||
selectEquipmentIds = ids;
|
||||
finishSelectFun();
|
||||
}else if(result.res == 0){
|
||||
showAlert('d','没有找到对比数据','alertDiv');
|
||||
data = "";
|
||||
clearAllTable();
|
||||
}else{
|
||||
showAlert('d',data.res,'alertDiv');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}else{
|
||||
showAlert('d','未选择设备','alertDiv');
|
||||
}
|
||||
};
|
||||
|
||||
//表格查询参数
|
||||
function queryParamsFun(params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
equipmentClassId : $("#classId").val(),
|
||||
specification: $("#specification").val(),
|
||||
useTime : $("#useTime").val(),
|
||||
}
|
||||
};
|
||||
//清除选择
|
||||
var clearFun = function(){
|
||||
$("#useTime").select2({language: "zh-CN",minimumResultsForSearch: 10,placeholder:'请选择'}).val('').trigger("change");
|
||||
$("#classId").select2({language: "zh-CN",minimumResultsForSearch: 10,placeholder:'请选择'}).val('').trigger("change");
|
||||
$("#specification").select2({language: "zh-CN",minimumResultsForSearch: 10,placeholder:'请选择'}).val('').trigger("change");
|
||||
dosearch();
|
||||
}
|
||||
var dosearch = function() {
|
||||
$("#equipmentTable").bootstrapTable('refresh');
|
||||
};
|
||||
//选择规格
|
||||
var selectSpecification = function(){
|
||||
$.post(ext.contextPath + "/valueEngineering/equipmentEvaluate/getEquipmentSpecificationForSelect.do",{
|
||||
companyId: '${param.companyId}',equipmentClassId: $("#classId").val()
|
||||
}, function(data) {
|
||||
var selelct_s =$("#specification").select2({
|
||||
data : data ,
|
||||
placeholder:'请先选择类型',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||
});
|
||||
selelct_s.val('${specification}').trigger("change");
|
||||
initFun();
|
||||
selelct_s.on("change",function(e){
|
||||
dosearch();
|
||||
});
|
||||
},'json');
|
||||
}
|
||||
//选择设备类型及已用年限
|
||||
var selectClassIdFun = function(){
|
||||
//选择设备类型
|
||||
$.post(ext.contextPath + "/equipment/equipmentClass/getEquipmentClassForSelect.do", {
|
||||
class_pid:'1,12'
|
||||
}, function(data) {
|
||||
$("#classId").empty();
|
||||
var selelct =$("#classId").select2({
|
||||
data: data,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||
});
|
||||
selelct.val('${classId}').trigger("change");
|
||||
selectSpecification();
|
||||
selelct.on("change",function(){
|
||||
//var equipmentClassId = $(this).val();
|
||||
$("#specification").empty();
|
||||
selectSpecification();
|
||||
});
|
||||
},'json');
|
||||
}
|
||||
//显示已经勾选的数据
|
||||
function stateFormatter(value, row, index) {
|
||||
var flag=false;
|
||||
console.info(selectEquipmentIds)
|
||||
$.each(selectEquipmentIds.split(','), function(index, item){
|
||||
if(row.id == item){
|
||||
flag=true;
|
||||
checkedItem = row;
|
||||
}
|
||||
});
|
||||
if (flag)
|
||||
return {
|
||||
checked : true//设置选中
|
||||
};
|
||||
|
||||
return value;
|
||||
}
|
||||
//初始化表格
|
||||
var initFun = function(){
|
||||
$("#equipmentTable").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/valueEngineering/equipmentEvaluate/getEquipmentList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20,50], // 设置页面可以显示的数据条数
|
||||
pageSize: 50, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams:queryParamsFun,
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
formatter: stateFormatter
|
||||
},/* {
|
||||
field: 'id', // 返回json数据中的name
|
||||
title: '统一编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'equipmentname', // 返回json数据中的name
|
||||
title: '名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},*/{
|
||||
field: 'equipmentTypeNumber.name', // 返回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'
|
||||
},
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("equipmentTable");
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
})
|
||||
}
|
||||
$(function(){
|
||||
//选择已用年限
|
||||
$.post(ext.contextPath + "/equipment/equipmentUseAge/getEquipmentUseAgeForSelect.do", {}, function(data) {
|
||||
var select_u =$("#useTime").select2({
|
||||
data: data,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||
});
|
||||
select_u.val('${useTime}').trigger("change");
|
||||
select_u.on("change",function(){
|
||||
dosearch();
|
||||
})
|
||||
},'json');
|
||||
selectClassIdFun();
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
classId: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '设备类型不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
specification: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '设备规格不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
useTime: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '已用年限不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">添加对比</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<div class="form-group">
|
||||
<input type="hidden" id="model" name="model">
|
||||
<label class="col-sm-2 control-label">已用年限</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control select2" id="useTime"
|
||||
name ="useTime" style="width: 170px;">
|
||||
<!-- <option value="0">1-3年</option>
|
||||
<option value="1">3-5年</option>
|
||||
<option value="2">5-7年</option>
|
||||
<option value="3">7年以上</option> -->
|
||||
</select>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">设备类型</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control select2" id="classId"
|
||||
name ="classId" style="width: 170px;">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">规格</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control select2" id="specification"
|
||||
name ="specification" style="width: 170px;">
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-sm-2">
|
||||
<button type="button" class="btn btn-info" onclick="clearFun()" id="btn_save">清除选择</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<div class="box box-primary" >
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">设备型号列表</h3>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body ">
|
||||
<table id="equipmentTable"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="createCompareFun()" id="btn_save">确定</button>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
</div>
|
||||
220
WebRoot/jsp/valueEngineering/economicLife.jsp
Normal file
220
WebRoot/jsp/valueEngineering/economicLife.jsp
Normal file
@ -0,0 +1,220 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<script type="text/javascript">
|
||||
option = {
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'cross',
|
||||
label: {
|
||||
backgroundColor: '#283b56'
|
||||
}
|
||||
}
|
||||
},
|
||||
grid: {
|
||||
left: '10%',
|
||||
right: '10%',
|
||||
bottom: '10%',
|
||||
top: '10%',
|
||||
},
|
||||
legend: {
|
||||
left: 'center',
|
||||
itemGap: 50,
|
||||
textStyle: {
|
||||
fontSize: 20
|
||||
},
|
||||
data: ['年等额总成本', '设备年等额运行成本', '等额资产恢复成本']
|
||||
},
|
||||
dataZoom: {
|
||||
show: false,
|
||||
start: 0,
|
||||
end: 100
|
||||
},
|
||||
xAxis: [
|
||||
{
|
||||
name: '年份',
|
||||
position: 'bottom',
|
||||
type: 'category',
|
||||
axisTick: {
|
||||
show: false,
|
||||
},
|
||||
boundaryGap: true,
|
||||
data: []
|
||||
}
|
||||
],
|
||||
yAxis: [{
|
||||
type: 'value',
|
||||
//inverse: true,
|
||||
name: '成本',
|
||||
//namelocation: 'end',
|
||||
scale: true,
|
||||
axisTick: {
|
||||
show: true,
|
||||
},
|
||||
splitLine: {
|
||||
show: true
|
||||
},
|
||||
//max: 1200,
|
||||
min: 0,
|
||||
data: [],
|
||||
|
||||
boundaryGap: [0.2, 0.2]
|
||||
}],
|
||||
series: [
|
||||
{
|
||||
name: '年等额总成本',
|
||||
type: 'line',//line
|
||||
smooth: true, //平滑曲线显示
|
||||
itemStyle: {
|
||||
color: '#4F81BD',
|
||||
borderWidth: 1,
|
||||
},
|
||||
lineStyle: {
|
||||
width: 3,
|
||||
},
|
||||
markLine: {
|
||||
data: [
|
||||
{
|
||||
type: 'min',
|
||||
value: '最小值',
|
||||
}
|
||||
]
|
||||
},
|
||||
markPoint: {
|
||||
data: []
|
||||
},
|
||||
data: []
|
||||
},
|
||||
{
|
||||
name: '设备年等额运行成本',
|
||||
type: 'line',
|
||||
smooth: true, //平滑曲线显示
|
||||
itemStyle: {
|
||||
color: '#C0504D',
|
||||
borderWidth: 1,
|
||||
},
|
||||
lineStyle: {
|
||||
width: 3,
|
||||
},
|
||||
data: (function () {
|
||||
var res = [];
|
||||
var len = 12;
|
||||
while (len--) {
|
||||
res.push(Math.round(Math.random() * 10));
|
||||
}
|
||||
return res;
|
||||
})()
|
||||
}, {
|
||||
name: '等额资产恢复成本',
|
||||
type: 'line',
|
||||
smooth: true, //平滑曲线显示
|
||||
itemStyle: {
|
||||
color: '#99BB58',
|
||||
borderWidth: 1,
|
||||
},
|
||||
lineStyle: {
|
||||
width: 3,
|
||||
},
|
||||
data: (function () {
|
||||
var res = [];
|
||||
var len = 12;
|
||||
while (len--) {
|
||||
res.push(Math.round(Math.random() * 10));
|
||||
}
|
||||
return res;
|
||||
})()
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
//等额资产恢复成本
|
||||
function getRecoverCost(data) {
|
||||
var res = [];
|
||||
for (var len = 0; len < data.length; len++) {
|
||||
//res.push((data[len] / (len + 1)).toFixed(2));
|
||||
res.push((data[len]).toFixed(2));
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
//设备年等额运行成本
|
||||
function getRunCost(data) {
|
||||
var res = [];
|
||||
for (var len = 0; len < data.length; len++) {
|
||||
//res.push((data[len] / (len + 1)).toFixed(2));
|
||||
res.push((data[len]).toFixed(2));
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
//年等额总成本
|
||||
function getTotalCost(runResult, recoverResult) {
|
||||
var res = [];
|
||||
for (var len = 0; len < runResult.length; len++) {
|
||||
var run = runResult[len];
|
||||
var recover = recoverResult[len];
|
||||
res.push((run + recover).toFixed(2));
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
//经济寿命标注
|
||||
function economicLifeYear(runResult, recoverResult, xAis) {
|
||||
var xMark;
|
||||
var yMark;
|
||||
var value;
|
||||
for (var len = 0; len < runResult.length; len++) {
|
||||
var run = runResult[len];
|
||||
var recover = recoverResult[len];
|
||||
var x = xAis[len];
|
||||
if (len == 0) {
|
||||
xMark = len;
|
||||
value = x;
|
||||
yMark = (run + recover).toFixed(2);
|
||||
}
|
||||
if (parseFloat((run + recover).toFixed(2)) < parseFloat(yMark)) {
|
||||
xMark = len;
|
||||
value = x;
|
||||
yMark = (run + recover).toFixed(2);
|
||||
}
|
||||
}
|
||||
return [{ xAxis: xMark, yAxis: yMark, value: '最小值:' + value + '年' }];
|
||||
}
|
||||
|
||||
//获取折线图数据
|
||||
function getChartData() {
|
||||
$.post(ext.contextPath + '/valueEngineering/equipmentEvaluate/getEconomicLifeLineChart.do', { id: equipmentid }, function (result) {
|
||||
//console.log(result);
|
||||
result = JSON.parse(result);
|
||||
if (result != "") {
|
||||
var lifeChart = echarts.init(document.getElementById('eLifeDiv'));
|
||||
option.xAxis[0].data = result.xAis;
|
||||
option.series[0].data = getTotalCost(result.runCost, result.recoverCost);//年等额总成本
|
||||
option.series[1].data = getRunCost(result.runCost);//设备年等额运行成本
|
||||
option.series[2].data = getRecoverCost(result.recoverCost);//等额资产恢复成本
|
||||
option.series[0].markPoint.data = economicLifeYear(result.runCost, result.recoverCost, result.xAis);
|
||||
//console.log(option);
|
||||
//console.log(lifeChart);
|
||||
lifeChart.setOption(option);
|
||||
}
|
||||
});
|
||||
}
|
||||
$(function () {
|
||||
getChartData();
|
||||
})
|
||||
</script>
|
||||
<div class="modal fade" id="economicLifeModal">
|
||||
<div class="modal-dialog modal-lg" id="sub">
|
||||
<div class="modal-content" id="content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">设备经济寿命曲线</h4>
|
||||
</div>
|
||||
<div class="modal-body" style="overflow-x:auto;">
|
||||
<div id="eLifeDiv" style="height:500px;width:850px"></div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
552
WebRoot/jsp/valueEngineering/economicLife4fanAnalysis.jsp
Normal file
552
WebRoot/jsp/valueEngineering/economicLife4fanAnalysis.jsp
Normal file
@ -0,0 +1,552 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<script type="text/javascript">
|
||||
option = {
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'cross',
|
||||
label: {
|
||||
backgroundColor: '#283b56'
|
||||
}
|
||||
}
|
||||
},
|
||||
grid: {
|
||||
left: '10%',
|
||||
right: '10%',
|
||||
bottom: '10%',
|
||||
top: '10%',
|
||||
},
|
||||
legend: {
|
||||
left: 'center',
|
||||
itemGap: 50,
|
||||
textStyle: {
|
||||
fontSize: 20
|
||||
},
|
||||
data: ['年等额总成本', '设备年等额运行成本', '等额资产恢复成本']
|
||||
},
|
||||
dataZoom: {
|
||||
show: false,
|
||||
start: 0,
|
||||
end: 100
|
||||
},
|
||||
xAxis: [
|
||||
{
|
||||
name: '年份',
|
||||
position: 'bottom',
|
||||
type: 'category',
|
||||
axisTick: {
|
||||
show: false,
|
||||
},
|
||||
boundaryGap: true,
|
||||
data: []
|
||||
}
|
||||
],
|
||||
yAxis: [{
|
||||
type: 'value',
|
||||
//inverse: true,
|
||||
name: '成本',
|
||||
//namelocation: 'end',
|
||||
scale: true,
|
||||
axisTick: {
|
||||
show: true,
|
||||
},
|
||||
splitLine: {
|
||||
show: true
|
||||
},
|
||||
//max: 1200,
|
||||
min: 0,
|
||||
data: [],
|
||||
|
||||
boundaryGap: [0.2, 0.2]
|
||||
}],
|
||||
series: [
|
||||
{
|
||||
name: '年等额总成本',
|
||||
type: 'line',//line
|
||||
smooth: true, //平滑曲线显示
|
||||
itemStyle: {
|
||||
color: '#4F81BD',
|
||||
borderWidth: 1,
|
||||
},
|
||||
lineStyle: {
|
||||
width: 3,
|
||||
},
|
||||
markLine: {
|
||||
data: [
|
||||
{
|
||||
type: 'min',
|
||||
value: '最小值',
|
||||
}
|
||||
]
|
||||
},
|
||||
markPoint: {
|
||||
data: []
|
||||
},
|
||||
data: []
|
||||
},
|
||||
{
|
||||
name: '设备年等额运行成本',
|
||||
type: 'line',
|
||||
smooth: true, //平滑曲线显示
|
||||
itemStyle: {
|
||||
color: '#C0504D',
|
||||
borderWidth: 1,
|
||||
},
|
||||
lineStyle: {
|
||||
width: 3,
|
||||
},
|
||||
data: (function () {
|
||||
var res = [];
|
||||
var len = 12;
|
||||
while (len--) {
|
||||
res.push(Math.round(Math.random() * 10));
|
||||
}
|
||||
return res;
|
||||
})()
|
||||
}, {
|
||||
name: '等额资产恢复成本',
|
||||
type: 'line',
|
||||
smooth: true, //平滑曲线显示
|
||||
itemStyle: {
|
||||
color: '#99BB58',
|
||||
borderWidth: 1,
|
||||
},
|
||||
lineStyle: {
|
||||
width: 3,
|
||||
},
|
||||
data: (function () {
|
||||
var res = [];
|
||||
var len = 12;
|
||||
while (len--) {
|
||||
res.push(Math.round(Math.random() * 10));
|
||||
}
|
||||
return res;
|
||||
})()
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
//等额资产恢复成本
|
||||
function getRecoverCost(data) {
|
||||
var res = [];
|
||||
for (var len = 0; len < data.length; len++) {
|
||||
//res.push((data[len] / (len + 1)).toFixed(2));
|
||||
res.push((data[len]).toFixed(2));
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
//设备年等额运行成本
|
||||
function getRunCost(data) {
|
||||
var res = [];
|
||||
for (var len = 0; len < data.length; len++) {
|
||||
//res.push((data[len] / (len + 1)).toFixed(2));
|
||||
res.push((data[len]).toFixed(2));
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
//年等额总成本
|
||||
function getTotalCost(runResult, recoverResult) {
|
||||
var res = [];
|
||||
for (var len = 0; len < runResult.length; len++) {
|
||||
var run = runResult[len];
|
||||
var recover = recoverResult[len];
|
||||
res.push((run + recover).toFixed(2));
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
//经济寿命标注
|
||||
function economicLifeYear(runResult, recoverResult, xAis) {
|
||||
var xMark;
|
||||
var yMark;
|
||||
var value;
|
||||
for (var len = 0; len < runResult.length; len++) {
|
||||
var run = runResult[len];
|
||||
var recover = recoverResult[len];
|
||||
var x = xAis[len];
|
||||
if (len == 0) {
|
||||
xMark = len;
|
||||
value = x;
|
||||
yMark = (run + recover).toFixed(2);
|
||||
}
|
||||
if (parseFloat((run + recover).toFixed(2)) < parseFloat(yMark)) {
|
||||
xMark = len;
|
||||
value = x;
|
||||
yMark = (run + recover).toFixed(2);
|
||||
}
|
||||
}
|
||||
return [{ xAxis: xMark, yAxis: yMark, value: '最小值:' + value + '年' }];
|
||||
}
|
||||
|
||||
//获取折线图数据
|
||||
function getChartData() {
|
||||
$.post(ext.contextPath + '/valueEngineering/equipmentEvaluate/getEconomicLifeLineChart.do', { id: equipmentid }, function (result) {
|
||||
//console.log(result);
|
||||
result = JSON.parse(result);
|
||||
if (result != "") {
|
||||
var lifeChart = echarts.init(document.getElementById('eLifeDiv'));
|
||||
option.xAxis[0].data = result.xAis;
|
||||
option.series[0].data = getTotalCost(result.runCost, result.recoverCost);//年等额总成本
|
||||
option.series[1].data = getRunCost(result.runCost);//设备年等额运行成本
|
||||
option.series[2].data = getRecoverCost(result.recoverCost);//等额资产恢复成本
|
||||
option.series[0].markPoint.data = economicLifeYear(result.runCost, result.recoverCost, result.xAis);
|
||||
//console.log(option);
|
||||
//console.log(lifeChart);
|
||||
lifeChart.setOption(option);
|
||||
}
|
||||
});
|
||||
}
|
||||
//获取>泵性能曲线-总
|
||||
function getChartData_pumpAll(id,title,data_xAxis,data) {
|
||||
var option = {
|
||||
title: {
|
||||
text: title,
|
||||
x:'center',
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'axis'
|
||||
},
|
||||
legend: {
|
||||
data: [title],
|
||||
x:'left',
|
||||
top:'25px',
|
||||
},
|
||||
grid: {
|
||||
left: '3%',
|
||||
right: '4%',
|
||||
bottom: '3%',
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
boundaryGap: false,
|
||||
data: data_xAxis
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value'
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: title,
|
||||
type: 'line',
|
||||
data: data
|
||||
}
|
||||
]
|
||||
};
|
||||
var lifeChart = echarts.init(document.getElementById(id));
|
||||
lifeChart.setOption(option,true);
|
||||
}
|
||||
//获取泵性能曲线-分项
|
||||
function getChartData_pump(id,data,data2,title) {
|
||||
|
||||
// See https://github.com/ecomfe/echarts-stat
|
||||
var myRegression = ecStat.regression('polynomial', data);
|
||||
myRegression.points.sort(function(a, b) {
|
||||
return a[0] - b[0];
|
||||
});
|
||||
var myRegression2 = ecStat.regression('polynomial', data2.reverse());
|
||||
|
||||
myRegression2.points.sort(function(a, b) {
|
||||
return a[0] - b[0];
|
||||
});
|
||||
|
||||
var option = {
|
||||
title: {
|
||||
text: title,
|
||||
left: 'center'
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'cross'
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
data: ['实际', '标准'],
|
||||
x:'right'
|
||||
},
|
||||
xAxis: {
|
||||
type: 'value',
|
||||
splitLine: {
|
||||
lineStyle: {
|
||||
type: 'dashed'
|
||||
}
|
||||
},
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value',
|
||||
splitLine: {
|
||||
lineStyle: {
|
||||
type: 'dashed'
|
||||
}
|
||||
}
|
||||
},
|
||||
series: [{
|
||||
name: '实际scatter',
|
||||
type: 'scatter',
|
||||
emphasis: {
|
||||
label: {
|
||||
show: true,
|
||||
position: 'left',
|
||||
color: 'blue',
|
||||
fontSize: 16
|
||||
}
|
||||
},
|
||||
data: data
|
||||
}, {
|
||||
name: '实际',
|
||||
type: 'line',
|
||||
showSymbol: false,
|
||||
smooth: true,
|
||||
data: myRegression.points,
|
||||
markPoint: {
|
||||
itemStyle: {
|
||||
color: 'transparent'
|
||||
},
|
||||
label: {
|
||||
show: false,
|
||||
position: 'left',
|
||||
formatter: myRegression.expression,
|
||||
color: '#333',
|
||||
fontSize: 14
|
||||
},
|
||||
data: [{
|
||||
coord: myRegression.points[myRegression.points.length - 1]
|
||||
}]
|
||||
}
|
||||
},{
|
||||
name: '标准scatter',
|
||||
type: 'scatter',
|
||||
emphasis: {
|
||||
label: {
|
||||
show: true,
|
||||
position: 'left',
|
||||
color: 'green',
|
||||
fontSize: 16
|
||||
}
|
||||
},
|
||||
data: data2
|
||||
}, {
|
||||
name: '标准',
|
||||
type: 'line',
|
||||
showSymbol: false,
|
||||
smooth: true,
|
||||
data: myRegression2.points,
|
||||
markPoint: {
|
||||
itemStyle: {
|
||||
color: 'transparent'
|
||||
},
|
||||
label: {
|
||||
show: false,
|
||||
position: 'left',
|
||||
formatter: myRegression2.expression,
|
||||
color: '#333',
|
||||
fontSize: 14
|
||||
},
|
||||
data: [{
|
||||
coord: myRegression2.points[myRegression2.points.length - 1]
|
||||
}]
|
||||
}
|
||||
}]
|
||||
};
|
||||
var lifeChart = echarts.init(document.getElementById(id));
|
||||
lifeChart.setOption(option);
|
||||
}
|
||||
$(function () {
|
||||
/* $("#enddate").datepicker({
|
||||
language: 'zh-CN',
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format:'yyyy-mm-dd',
|
||||
})
|
||||
$("#startdate").datepicker({
|
||||
language: 'zh-CN',
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format:'yyyy-mm-dd',
|
||||
}) */
|
||||
$("#enddate").datetimepicker({
|
||||
language:'zh-CN',
|
||||
format: 'yyyy-mm-dd hh:ii',
|
||||
dateFormat: 'yyyy-mm-dd',//日期显示格式
|
||||
timeFormat: 'HH:mm',//时间显示格式
|
||||
startView: "day", //初始化视图是‘年’
|
||||
minView: 0,
|
||||
maxView: "year",
|
||||
minuteStep: 1,//分钟间隔1分钟
|
||||
autoclose: true
|
||||
}).on('changeDate', function () {
|
||||
|
||||
});
|
||||
$("#startdate").datetimepicker({
|
||||
language:'zh-CN',
|
||||
format: 'yyyy-mm-dd hh:ii',
|
||||
dateFormat: 'yyyy-mm-dd',//日期显示格式
|
||||
timeFormat: 'HH:mm',//时间显示格式
|
||||
startView: "day", //初始化视图是‘年’
|
||||
minView: 0,
|
||||
maxView: "year",
|
||||
minuteStep: 1,//分钟间隔1分钟
|
||||
autoclose: true
|
||||
}).on('changeDate', function () {
|
||||
|
||||
});
|
||||
$("#myModalLabel").html(equipmentName+"("+equipmentNumber+")");
|
||||
getData();
|
||||
getChartData();
|
||||
})
|
||||
function getData() {
|
||||
var timeType = $("#timeType").val();
|
||||
var num = $("#num").val();
|
||||
var startdate = $("#startdate").val();
|
||||
var enddate = $("#enddate").val();
|
||||
$.post(ext.contextPath + '/valueEngineering/equipmentEvaluate/getFanAnalysisChartData.do',
|
||||
{ id: equipmentid,timeType:timeType,num:num,startdate:startdate,enddate:enddate }, function (result) {
|
||||
result = JSON.parse(result);
|
||||
if (result != "") {
|
||||
var data = result;
|
||||
var flow_xAxis = data.flow_xAxis;
|
||||
var power_xAxis = data.power_xAxis;
|
||||
var lift_xAxis = data.lift_xAxis;
|
||||
var efficiency_xAxis = data.efficiency_xAxis;
|
||||
var data_flow = data.flow_actual;//当前风量_实际
|
||||
var data_power = data.power_actual;//出口风压_实际
|
||||
var data_lift = data.lift_actual;//电机电流_实际
|
||||
var data_efficiency = data.efficiency_actual;//风机效率_实际
|
||||
var data_flow_standard = data.flow_standard;//当前风量_标准
|
||||
var data_power_standard = data.power_standard;//出口风压_标准
|
||||
var data_lift_standard = data.lift_standard;//电机电流_标准
|
||||
var data_efficiency_standard = data.efficiency_standard;//风机效率_标准
|
||||
var pneumatics_xAxis = data.pneumatics_xAxis;
|
||||
var input_xAxis = data.input_xAxis;
|
||||
var data_pneumatics = data.pneumatics_actual;//电机电流_标准
|
||||
var data_input = data.input_actual;//风机效率_标准
|
||||
getChartData_pumpAll('flow','当前风量曲线(M3/h)',flow_xAxis,data_flow);
|
||||
getChartData_pumpAll('power','出口风压曲线(Kpa)',power_xAxis,data_power);
|
||||
getChartData_pumpAll('lift','电机电流曲线(A)',lift_xAxis,data_lift);
|
||||
getChartData_pumpAll('efficiency','风机效率曲线(%)',efficiency_xAxis,data_efficiency);
|
||||
getChartData_pumpAll('pneumatics','气动消耗功率曲线(kW)',pneumatics_xAxis,data_pneumatics);
|
||||
getChartData_pumpAll('input','电机输入功率曲线(kW)',input_xAxis,data_input);
|
||||
var data_lift_actual_item = [];
|
||||
var data_lift_standard_item = [];
|
||||
var data_power_actual_item = [];
|
||||
var data_power_standard_item = [];
|
||||
var data_efficiency_actual_item = [];
|
||||
var data_efficiency_standard_item = [];
|
||||
if(data_flow!=null && data_flow.length>0){
|
||||
for(var a=0;a<data_flow.length;a++){
|
||||
if(a<data_lift.length){
|
||||
data_lift_actual_item[a] = [data_flow[a],data_lift[a]];
|
||||
}/* else{
|
||||
data_lift_actual_item[a] = [data_flow[a],0];
|
||||
} */
|
||||
if(a<data_power.length){
|
||||
data_power_actual_item[a] = [data_flow[a],data_power[a]];
|
||||
}/* else{
|
||||
data_power_actual_item[a] = [data_flow[a],0];
|
||||
} */
|
||||
if(a<data_efficiency.length){
|
||||
data_efficiency_actual_item[a] = [data_flow[a],data_efficiency[a]];
|
||||
}/* else{
|
||||
data_efficiency_actual_item[a] = [data_flow[a],0];
|
||||
} */
|
||||
}
|
||||
}
|
||||
if(data_flow_standard!=null && data_flow_standard.length>0){
|
||||
for(var a=0;a<data_flow_standard.length;a++){
|
||||
if(a<data_lift_standard.length){
|
||||
data_lift_standard_item[a] = [data_flow_standard[a],data_lift_standard[a]];
|
||||
}/* else{
|
||||
data_lift_standard_item[a] = [data_flow_standard[a],0];
|
||||
} */
|
||||
if(a<data_power_standard.length){
|
||||
data_power_standard_item[a] = [data_flow_standard[a],data_power_standard[a]];
|
||||
}/* else{
|
||||
data_power_standard_item[a] = [data_flow_standard[a],0];
|
||||
} */
|
||||
if(a<data_efficiency_standard.length){
|
||||
data_efficiency_standard_item[a] = [data_flow_standard[a],data_efficiency_standard[a]];
|
||||
}/* else{
|
||||
data_efficiency_standard_item[a] = [data_flow_standard[a],0];
|
||||
} */
|
||||
}
|
||||
}
|
||||
/* getChartData_pump('pump_lift',data_lift_actual_item,data_lift_standard_item,'电机电流曲线(A)');
|
||||
getChartData_pump('pump_power',data_power_actual_item,data_power_standard_item,'出口风压曲线(Kpa)');
|
||||
getChartData_pump('pump_efficiency',data_efficiency_actual_item,data_efficiency_standard_item,'风机效率曲线(%)'); */
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<div class="modal fade" id="economicLifeModal">
|
||||
<div class="modal-dialog modal-xlg" id="sub">
|
||||
<div class="modal-content nav-tabs-custom" id="content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title pull-right" id="myModalLabel" style="margin: 0 10px;"></h4>
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="active"><a href="#tab_1" data-toggle="tab">风机性能曲线</a></li>
|
||||
<li><a href="#tab_2" data-toggle="tab">设备经济寿命曲线</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="modal-body" style="overflow-x:auto;">
|
||||
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane active" id="tab_1">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-2">
|
||||
<select class="form-control " id="timeType" name="timeType" onchange ="getData();"
|
||||
style="width: 150px;">
|
||||
<option value="2">月数据</option>
|
||||
<option value="1">日数据</option>
|
||||
<option value="0" selected>实时数据</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-5 col-sm-2">
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">开始时间</div>
|
||||
<input type="text" class="form-control" id="startdate" name ="startdate" value="${fn:substring(startdate,0,16)}" >
|
||||
<div class="input-group-addon">结束时间</div>
|
||||
<input type="text" class="form-control" id="enddate" name ="enddate" value="${fn:substring(enddate,0,16)}" >
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-1 col-sm-2">
|
||||
<a role="button" class="btn btn-primary" href="javascript:;" onclick="getData();" >刷新</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div id="flow" style="float:left;height:320px;width:370px"></div>
|
||||
<div id="lift" style="float:left;height:320px;width:370px"></div>
|
||||
<div id="power" style="float:left;height:320px;width:370px"></div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div id="efficiency" style="float:left;height:320px;width:370px"></div>
|
||||
<div id="pneumatics" style="float:left;height:320px;width:370px"></div>
|
||||
<div id="input" style="float:left;height:320px;width:370px"></div>
|
||||
</div>
|
||||
<!-- <div class="col-md-5">
|
||||
<div id="pump_lift" style="height:220px;width:450px"></div>
|
||||
<div id="pump_power" style="height:220px;width:450px"></div>
|
||||
<div id="pump_efficiency" style="height:220px;width:450px"></div>
|
||||
</div> -->
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- /.tab-pane -->
|
||||
<div class="tab-pane" id="tab_2">
|
||||
<div id="eLifeDiv" style="height:500px;width:850px"></div>
|
||||
</div>
|
||||
<!-- /.tab-pane -->
|
||||
</div>
|
||||
<!-- /.tab-content -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
932
WebRoot/jsp/valueEngineering/economicLife4pumpAnalysis.jsp
Normal file
932
WebRoot/jsp/valueEngineering/economicLife4pumpAnalysis.jsp
Normal file
@ -0,0 +1,932 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<script type="text/javascript">
|
||||
option = {
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'cross',
|
||||
label: {
|
||||
backgroundColor: '#283b56'
|
||||
}
|
||||
}
|
||||
},
|
||||
grid: {
|
||||
left: '10%',
|
||||
right: '10%',
|
||||
bottom: '10%',
|
||||
top: '10%',
|
||||
},
|
||||
legend: {
|
||||
left: 'center',
|
||||
itemGap: 50,
|
||||
textStyle: {
|
||||
fontSize: 20
|
||||
},
|
||||
data: ['年等额总成本', '设备年等额运行成本', '等额资产恢复成本']
|
||||
},
|
||||
dataZoom: {
|
||||
show: false,
|
||||
start: 0,
|
||||
end: 100
|
||||
},
|
||||
xAxis: [
|
||||
{
|
||||
name: '年份',
|
||||
position: 'bottom',
|
||||
type: 'category',
|
||||
axisTick: {
|
||||
show: false,
|
||||
},
|
||||
boundaryGap: true,
|
||||
data: []
|
||||
}
|
||||
],
|
||||
yAxis: [{
|
||||
type: 'value',
|
||||
//inverse: true,
|
||||
name: '成本',
|
||||
//namelocation: 'end',
|
||||
scale: true,
|
||||
axisTick: {
|
||||
show: true,
|
||||
},
|
||||
splitLine: {
|
||||
show: true
|
||||
},
|
||||
//max: 1200,
|
||||
min: 0,
|
||||
data: [],
|
||||
|
||||
boundaryGap: [0.2, 0.2]
|
||||
}],
|
||||
series: [
|
||||
{
|
||||
name: '年等额总成本',
|
||||
type: 'line',//line
|
||||
smooth: true, //平滑曲线显示
|
||||
itemStyle: {
|
||||
color: '#4F81BD',
|
||||
borderWidth: 1,
|
||||
},
|
||||
lineStyle: {
|
||||
width: 3,
|
||||
},
|
||||
markLine: {
|
||||
data: [
|
||||
{
|
||||
type: 'min',
|
||||
value: '最小值',
|
||||
}
|
||||
]
|
||||
},
|
||||
markPoint: {
|
||||
data: []
|
||||
},
|
||||
data: []
|
||||
},
|
||||
{
|
||||
name: '设备年等额运行成本',
|
||||
type: 'line',
|
||||
smooth: true, //平滑曲线显示
|
||||
itemStyle: {
|
||||
color: '#C0504D',
|
||||
borderWidth: 1,
|
||||
},
|
||||
lineStyle: {
|
||||
width: 3,
|
||||
},
|
||||
data: (function () {
|
||||
var res = [];
|
||||
var len = 12;
|
||||
while (len--) {
|
||||
res.push(Math.round(Math.random() * 10));
|
||||
}
|
||||
return res;
|
||||
})()
|
||||
}, {
|
||||
name: '等额资产恢复成本',
|
||||
type: 'line',
|
||||
smooth: true, //平滑曲线显示
|
||||
itemStyle: {
|
||||
color: '#99BB58',
|
||||
borderWidth: 1,
|
||||
},
|
||||
lineStyle: {
|
||||
width: 3,
|
||||
},
|
||||
data: (function () {
|
||||
var res = [];
|
||||
var len = 12;
|
||||
while (len--) {
|
||||
res.push(Math.round(Math.random() * 10));
|
||||
}
|
||||
return res;
|
||||
})()
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
//等额资产恢复成本
|
||||
function getRecoverCost(data) {
|
||||
var res = [];
|
||||
for (var len = 0; len < data.length; len++) {
|
||||
//res.push((data[len] / (len + 1)).toFixed(2));
|
||||
res.push((data[len]).toFixed(2));
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
//设备年等额运行成本
|
||||
function getRunCost(data) {
|
||||
var res = [];
|
||||
for (var len = 0; len < data.length; len++) {
|
||||
//res.push((data[len] / (len + 1)).toFixed(2));
|
||||
res.push((data[len]).toFixed(2));
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
//年等额总成本
|
||||
function getTotalCost(runResult, recoverResult) {
|
||||
var res = [];
|
||||
for (var len = 0; len < runResult.length; len++) {
|
||||
var run = runResult[len];
|
||||
var recover = recoverResult[len];
|
||||
res.push((run + recover).toFixed(2));
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
//经济寿命标注
|
||||
function economicLifeYear(runResult, recoverResult, xAis) {
|
||||
var xMark;
|
||||
var yMark;
|
||||
var value;
|
||||
for (var len = 0; len < runResult.length; len++) {
|
||||
var run = runResult[len];
|
||||
var recover = recoverResult[len];
|
||||
var x = xAis[len];
|
||||
if (len == 0) {
|
||||
xMark = len;
|
||||
value = x;
|
||||
yMark = (run + recover).toFixed(2);
|
||||
}
|
||||
if (parseFloat((run + recover).toFixed(2)) < parseFloat(yMark)) {
|
||||
xMark = len;
|
||||
value = x;
|
||||
yMark = (run + recover).toFixed(2);
|
||||
}
|
||||
}
|
||||
return [{ xAxis: xMark, yAxis: yMark, value: '最小值:' + value + '年' }];
|
||||
}
|
||||
|
||||
//获取折线图数据
|
||||
function getChartData() {
|
||||
$.post(ext.contextPath + '/valueEngineering/equipmentEvaluate/getEconomicLifeLineChart.do', { id: equipmentid }, function (result) {
|
||||
//console.log(result);
|
||||
result = JSON.parse(result);
|
||||
if (result != "") {
|
||||
var lifeChart = echarts.init(document.getElementById('eLifeDiv'));
|
||||
option.xAxis[0].data = result.xAis;
|
||||
option.series[0].data = getTotalCost(result.runCost, result.recoverCost);//年等额总成本
|
||||
option.series[1].data = getRunCost(result.runCost);//设备年等额运行成本
|
||||
option.series[2].data = getRecoverCost(result.recoverCost);//等额资产恢复成本
|
||||
option.series[0].markPoint.data = economicLifeYear(result.runCost, result.recoverCost, result.xAis);
|
||||
//console.log(option);
|
||||
//console.log(lifeChart);
|
||||
lifeChart.setOption(option);
|
||||
}
|
||||
});
|
||||
}
|
||||
//获取>泵性能曲线-总
|
||||
function getChartData_pumpAll(id,title,data_xAxis,data,legendData,selected) {
|
||||
var option = {
|
||||
title: {
|
||||
text: title,
|
||||
x:'center',
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'axis'
|
||||
},
|
||||
toolbox: {
|
||||
show: true,
|
||||
feature: {
|
||||
dataZoom: {
|
||||
yAxisIndex: 'none'
|
||||
},
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
type: 'scroll',
|
||||
data: legendData,
|
||||
x:'left',
|
||||
top:'25px',
|
||||
selected: selected
|
||||
},
|
||||
grid: {
|
||||
left: '3%',
|
||||
right: '4%',
|
||||
bottom: '3%',
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
boundaryGap: false,
|
||||
data: data_xAxis
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value'
|
||||
},
|
||||
series: data
|
||||
};
|
||||
var lifeChart = echarts.init(document.getElementById(id));
|
||||
lifeChart.setOption(option,true);
|
||||
}
|
||||
//获取泵性能曲线-分项
|
||||
function getChartData_pump(id,data,data2,title) {
|
||||
|
||||
// See https://github.com/ecomfe/echarts-stat
|
||||
var myRegression = ecStat.regression('polynomial', data);
|
||||
myRegression.points.sort(function(a, b) {
|
||||
return a[0] - b[0];
|
||||
});
|
||||
var myRegression2 = ecStat.regression('polynomial', data2.reverse());
|
||||
|
||||
myRegression2.points.sort(function(a, b) {
|
||||
return a[0] - b[0];
|
||||
});
|
||||
|
||||
var option = {
|
||||
title: {
|
||||
text: title,
|
||||
left: 'center'
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'cross'
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
data: ['实际', '出厂'],
|
||||
x:'right',
|
||||
selected: {
|
||||
// 选中
|
||||
'出厂': true,
|
||||
// 不选中
|
||||
'实际': false
|
||||
}
|
||||
},
|
||||
xAxis: {
|
||||
type: 'value',
|
||||
splitLine: {
|
||||
lineStyle: {
|
||||
type: 'dashed'
|
||||
}
|
||||
},
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value',
|
||||
splitLine: {
|
||||
lineStyle: {
|
||||
type: 'dashed'
|
||||
}
|
||||
}
|
||||
},
|
||||
series: [{
|
||||
name: '实际scatter',
|
||||
type: 'scatter',
|
||||
emphasis: {
|
||||
label: {
|
||||
show: true,
|
||||
position: 'left',
|
||||
color: 'blue',
|
||||
fontSize: 16
|
||||
}
|
||||
},
|
||||
data: data
|
||||
}, {
|
||||
name: '实际',
|
||||
type: 'line',
|
||||
showSymbol: false,
|
||||
smooth: true,
|
||||
data: myRegression.points,
|
||||
markPoint: {
|
||||
itemStyle: {
|
||||
color: 'transparent'
|
||||
},
|
||||
label: {
|
||||
show: false,
|
||||
position: 'left',
|
||||
formatter: myRegression.expression,
|
||||
color: '#333',
|
||||
fontSize: 14
|
||||
},
|
||||
data: [{
|
||||
coord: myRegression.points[myRegression.points.length - 1]
|
||||
}]
|
||||
}
|
||||
},{
|
||||
name: '出厂scatter',
|
||||
type: 'scatter',
|
||||
emphasis: {
|
||||
label: {
|
||||
show: true,
|
||||
position: 'left',
|
||||
color: 'green',
|
||||
fontSize: 16
|
||||
}
|
||||
},
|
||||
data: data2
|
||||
}, {
|
||||
name: '出厂',
|
||||
type: 'line',
|
||||
showSymbol: false,
|
||||
smooth: true,
|
||||
data: myRegression2.points,
|
||||
markPoint: {
|
||||
itemStyle: {
|
||||
color: 'transparent'
|
||||
},
|
||||
label: {
|
||||
show: false,
|
||||
position: 'left',
|
||||
formatter: myRegression2.expression,
|
||||
color: '#333',
|
||||
fontSize: 14
|
||||
},
|
||||
data: [{
|
||||
coord: myRegression2.points[myRegression2.points.length - 1]
|
||||
}]
|
||||
}
|
||||
}]
|
||||
};
|
||||
var lifeChart = echarts.init(document.getElementById(id));
|
||||
lifeChart.setOption(option);
|
||||
}
|
||||
function charts_bars_new(id,title,data,legendData) {
|
||||
var option = {
|
||||
title: {
|
||||
text: title,
|
||||
x:'left',
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'shadow'
|
||||
}
|
||||
},
|
||||
grid: [{
|
||||
right: '60%'
|
||||
},{
|
||||
left: '40%'
|
||||
}],
|
||||
legend: {
|
||||
data: legendData,
|
||||
x:'right',
|
||||
},
|
||||
xAxis: [
|
||||
{
|
||||
type: 'category',
|
||||
data: ['单耗(kWh/t)']
|
||||
},
|
||||
{
|
||||
type: 'category',
|
||||
data: ['运行次数(次)', '运行时间(h)'],
|
||||
gridIndex: 1,
|
||||
}
|
||||
],
|
||||
yAxis: [
|
||||
{
|
||||
type: 'value',
|
||||
axisLine: {
|
||||
show: true,
|
||||
},
|
||||
splitLine: {
|
||||
show: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'value',
|
||||
position: 'right',
|
||||
axisLine: {
|
||||
show: true,
|
||||
},
|
||||
splitLine: {
|
||||
show: false,
|
||||
},
|
||||
gridIndex: 1,
|
||||
}
|
||||
],
|
||||
series: data
|
||||
};
|
||||
var lifeChart = echarts.init(document.getElementById(id));
|
||||
lifeChart.setOption(option);
|
||||
}
|
||||
$(function () {
|
||||
/* $("#enddate").datepicker({
|
||||
language: 'zh-CN',
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format:'yyyy-mm-dd',
|
||||
})
|
||||
$("#startdate").datepicker({
|
||||
language: 'zh-CN',
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format:'yyyy-mm-dd',
|
||||
})
|
||||
$("#enddate_consumption").datepicker({
|
||||
language: 'zh-CN',
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format:'yyyy-mm-dd',
|
||||
})
|
||||
$("#startdate_consumption").datepicker({
|
||||
language: 'zh-CN',
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format:'yyyy-mm-dd',
|
||||
})*/
|
||||
|
||||
//填报日期选择
|
||||
$("#enddate").datetimepicker({
|
||||
language:'zh-CN',
|
||||
format: 'yyyy-mm-dd hh:ii',
|
||||
dateFormat: 'yyyy-mm-dd',//日期显示格式
|
||||
timeFormat: 'HH:mm',//时间显示格式
|
||||
startView: "day", //初始化视图是‘年’
|
||||
minView: 0,
|
||||
maxView: "year",
|
||||
minuteStep: 1,//分钟间隔1分钟
|
||||
autoclose: true
|
||||
}).on('changeDate', function () {
|
||||
|
||||
});
|
||||
$("#startdate").datetimepicker({
|
||||
language:'zh-CN',
|
||||
format: 'yyyy-mm-dd hh:ii',
|
||||
dateFormat: 'yyyy-mm-dd',//日期显示格式
|
||||
timeFormat: 'HH:mm',//时间显示格式
|
||||
startView: "day", //初始化视图是‘年’
|
||||
minView: 0,
|
||||
maxView: "year",
|
||||
minuteStep: 1,//分钟间隔1分钟
|
||||
autoclose: true
|
||||
}).on('changeDate', function () {
|
||||
|
||||
});
|
||||
$("#enddate_consumption").datetimepicker({
|
||||
language:'zh-CN',
|
||||
format: 'yyyy-mm-dd hh:ii',
|
||||
dateFormat: 'yyyy-mm-dd',//日期显示格式
|
||||
timeFormat: 'HH:mm',//时间显示格式
|
||||
startView: "day", //初始化视图是‘年’
|
||||
minView: 0,
|
||||
maxView: "year",
|
||||
minuteStep: 1,//分钟间隔1分钟
|
||||
autoclose: true
|
||||
}).on('changeDate', function () {
|
||||
|
||||
});
|
||||
$("#startdate_consumption").datetimepicker({
|
||||
language:'zh-CN',
|
||||
format: 'yyyy-mm-dd hh:ii',
|
||||
dateFormat: 'yyyy-mm-dd',//日期显示格式
|
||||
timeFormat: 'HH:mm',//时间显示格式
|
||||
startView: "day", //初始化视图是‘年’
|
||||
minView: 0,
|
||||
maxView: "year",
|
||||
minuteStep: 1,//分钟间隔1分钟
|
||||
autoclose: true
|
||||
}).on('changeDate', function () {
|
||||
|
||||
});
|
||||
|
||||
$("#enddate_consumption_DH").datepicker({
|
||||
language: 'zh-CN',
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format:'yyyy-mm-dd',
|
||||
})
|
||||
$("#startdate_consumption_DH").datepicker({
|
||||
language: 'zh-CN',
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format:'yyyy-mm-dd',
|
||||
})
|
||||
var htmlStr = equipmentName+"("+equipmentNumber;
|
||||
if(equipmentSpecificationName!=null && equipmentSpecificationName!="" && equipmentSpecificationName!=undefined){
|
||||
htmlStr += ","+equipmentSpecificationName;
|
||||
}
|
||||
if(equipmentmodelName!=null && equipmentmodelName!="" && equipmentmodelName!=undefined){
|
||||
htmlStr += ","+equipmentmodelName;
|
||||
}
|
||||
if(equipmentmanuFacturer!=null && equipmentmanuFacturer!="" && equipmentmanuFacturer!=undefined){
|
||||
htmlStr += ","+equipmentmanuFacturer;
|
||||
}
|
||||
htmlStr += ")";
|
||||
$("#myModalLabel").html(htmlStr);
|
||||
getData();
|
||||
getChartData();
|
||||
/* getConsumptionData();
|
||||
getConsumptionData_DH(); */
|
||||
})
|
||||
function getData() {
|
||||
var timeType = $("#timeType").val();
|
||||
var num = $("#num").val();
|
||||
var startdate = $("#startdate").val();
|
||||
var enddate = $("#enddate").val();
|
||||
var pumpMultiple = $("#pumpMultiple").val();
|
||||
|
||||
$.post(ext.contextPath + '/valueEngineering/equipmentEvaluate/getPumpAnalysisChartData.do',
|
||||
{ id: equipmentid,timeType:timeType,num:num,startdate:startdate,enddate:enddate,pumpMultiple:pumpMultiple }, function (result) {
|
||||
result = JSON.parse(result);
|
||||
console.log(result);
|
||||
if (result != "") {
|
||||
var flow_xAxis = [];
|
||||
var power_xAxis = [];
|
||||
var lift_xAxis = [];
|
||||
var efficiency_xAxis = [];
|
||||
var tons_xAxis = [];
|
||||
var data_flow = [];
|
||||
var data_power = [];//功率_实际
|
||||
var data_lift = [];//扬程_实际
|
||||
var data_efficiency = [];//效率_实际
|
||||
var data_level = [];//青标液位_实际
|
||||
var data_tons = [];//
|
||||
var legend_flow = [];
|
||||
var legend_power = [];//功率_实际
|
||||
var legend_lift = [];//扬程_实际
|
||||
var legend_efficiency = [];//效率_实际
|
||||
var legend_level = [];//青标液位_实际
|
||||
var legend_tons = [];
|
||||
var selected_flow = {};
|
||||
var selected_power = {};//功率_实际
|
||||
var selected_lift = {};//扬程_实际
|
||||
var selected_efficiency = {};//效率_实际
|
||||
var selected_level = {};//青标液位_实际
|
||||
var selected_tons = {};
|
||||
|
||||
|
||||
var data_flow_standard = [];//流量_出厂
|
||||
var data_power_standard = [];//功率_出厂
|
||||
var data_lift_standard = [];//扬程_出厂
|
||||
var data_efficiency_standard = [];//效率_出厂
|
||||
var data_lift_actual_item = [];
|
||||
var data_lift_standard_item = [];
|
||||
var data_power_actual_item = [];
|
||||
var data_power_standard_item = [];
|
||||
var data_efficiency_actual_item = [];
|
||||
var data_efficiency_standard_item = [];
|
||||
for(var i=0;i<result.length;i++){
|
||||
var data = result[i];
|
||||
flow_xAxis = data.flow_xAxis;
|
||||
power_xAxis = data.power_xAxis;
|
||||
lift_xAxis = data.lift_xAxis;
|
||||
efficiency_xAxis = data.efficiency_xAxis;
|
||||
tons_xAxis = data.tons_xAxis;
|
||||
legend_flow[i]=data.equipmentCardName+"流量";
|
||||
legend_power[i]=data.equipmentCardName+"功率";
|
||||
|
||||
legend_lift.push(data.equipmentCardName+"扬程",data.equipmentCardName+"青标液位",data.equipmentCardName+"压力");
|
||||
legend_efficiency[i]=data.equipmentCardName+"效率";
|
||||
legend_level[i]=data.equipmentCardName+"青标液位";
|
||||
legend_tons[i]=data.equipmentCardName+"单耗";
|
||||
|
||||
selected_flow[data.equipmentCardName+"流量"]=true;
|
||||
selected_power[data.equipmentCardName+"功率"]=true;
|
||||
selected_lift[data.equipmentCardName+"扬程"]=true;
|
||||
selected_lift[data.equipmentCardName+"青标液位"]=false;
|
||||
selected_lift[data.equipmentCardName+"压力"]=false;
|
||||
selected_efficiency[data.equipmentCardName+"效率"]=true;
|
||||
selected_level[data.equipmentCardName+"青标液位"]=true;
|
||||
selected_tons[data.equipmentCardName+"单耗"]=true;
|
||||
|
||||
data_flow.push({
|
||||
name: data.equipmentCardName+"流量",
|
||||
type: 'line',
|
||||
data: data.flow_actual
|
||||
});
|
||||
data_power.push({
|
||||
name: data.equipmentCardName+"功率",
|
||||
type: 'line',
|
||||
data: data.power_actual
|
||||
});
|
||||
data_lift.push({
|
||||
name: data.equipmentCardName+"扬程",
|
||||
type: 'line',
|
||||
data: data.lift_actual
|
||||
});
|
||||
data_efficiency.push({
|
||||
name: data.equipmentCardName+"效率",
|
||||
type: 'line',
|
||||
data: data.efficiency_actual
|
||||
});
|
||||
data_lift.push({
|
||||
name: data.equipmentCardName+"青标液位",
|
||||
type: 'line',
|
||||
data: data.level_actual
|
||||
});
|
||||
data_lift.push({
|
||||
name: data.equipmentCardName+"压力",
|
||||
type: 'line',
|
||||
data: data.pressure_actual
|
||||
});
|
||||
data_tons.push({
|
||||
name: data.equipmentCardName+"功率",
|
||||
type: 'line',
|
||||
data: data.tons_actual
|
||||
});
|
||||
data_flow_standard = data.flow_standard;//流量_出厂
|
||||
data_power_standard = data.power_standard;//功率_出厂
|
||||
data_lift_standard = data.lift_standard;//扬程_出厂
|
||||
data_efficiency_standard = data.efficiency_standard;//效率_出厂
|
||||
//流量_实际
|
||||
if(data.flow_actual!=null && data.flow_actual.length>0){
|
||||
|
||||
for(var a=0;a<data.flow_actual.length;a++){
|
||||
if(a<data.lift_actual.length){
|
||||
data_lift_actual_item.push([data.flow_actual[a],data.lift_actual[a]]);
|
||||
}/* else{
|
||||
data_lift_actual_item[a] = [data_flow[a],0];
|
||||
} */
|
||||
if(a<data.power_actual.length){
|
||||
data_power_actual_item.push([data.flow_actual[a],data.power_actual[a]]);
|
||||
}/* else{
|
||||
data_power_actual_item[a] = [data_flow[a],0];
|
||||
} */
|
||||
if(a<data.efficiency_actual.length){
|
||||
data_efficiency_actual_item.push([data.flow_actual[a],data.efficiency_actual[a]]);
|
||||
}/* else{
|
||||
data_efficiency_actual_item[a] = [data_flow[a],0];
|
||||
} */
|
||||
}
|
||||
}
|
||||
if(data_flow_standard!=null && data_flow_standard.length>0){
|
||||
for(var a=0;a<data_flow_standard.length;a++){
|
||||
if(a<data_lift_standard.length){
|
||||
data_lift_standard_item[a] = [data_flow_standard[a],data_lift_standard[a]];
|
||||
}/* else{
|
||||
data_lift_standard_item[a] = [data_flow_standard[a],0];
|
||||
} */
|
||||
if(a<data_power_standard.length){
|
||||
data_power_standard_item[a] = [data_flow_standard[a],data_power_standard[a]];
|
||||
}/* else{
|
||||
data_power_standard_item[a] = [data_flow_standard[a],0];
|
||||
} */
|
||||
if(a<data_efficiency_standard.length){
|
||||
data_efficiency_standard_item[a] = [data_flow_standard[a],data_efficiency_standard[a]];
|
||||
}/* else{
|
||||
data_efficiency_standard_item[a] = [data_flow_standard[a],0];
|
||||
} */
|
||||
}
|
||||
}
|
||||
}
|
||||
getChartData_pumpAll('flow','流量曲线(m³/h)',flow_xAxis,data_flow,legend_flow,selected_flow);
|
||||
getChartData_pumpAll('power','单耗曲线(KWh/t/m)',tons_xAxis,data_tons,legend_tons,selected_tons);
|
||||
//getChartData_pumpAll('power','功率曲线(kW)',power_xAxis,data_power,legend_power,selected_power);
|
||||
getChartData_pumpAll('lift','扬程(m)、青标液位(m)、压力曲线',lift_xAxis,data_lift,legend_lift,selected_lift);
|
||||
getChartData_pumpAll('efficiency','效率曲线(%)',efficiency_xAxis,data_efficiency,legend_efficiency,selected_efficiency);
|
||||
getChartData_pump('pump_lift',data_lift_actual_item,data_lift_standard_item,'扬程曲线(m)');
|
||||
//getChartData_pump('pump_power',data_power_actual_item,data_power_standard_item,'功率曲线');
|
||||
getChartData_pump('pump_efficiency',data_efficiency_actual_item,data_efficiency_standard_item,'效率曲线(%)');
|
||||
}
|
||||
});
|
||||
}
|
||||
function getConsumptionData() {
|
||||
var timeType = $("#timeType_consumption").val();
|
||||
var num = $("#num_consumption").val();
|
||||
var startdate = $("#startdate_consumption").val();
|
||||
var enddate = $("#enddate_consumption").val();
|
||||
var pumpMultiple = $("#pumpMultiple_consumption").val();
|
||||
$.post(ext.contextPath + '/valueEngineering/equipmentEvaluate/getPumpAnalysisChartData.do',
|
||||
{ id: equipmentid,timeType:timeType,num:num,startdate:startdate,enddate:enddate,pumpMultiple:pumpMultiple }, function (result) {
|
||||
result = JSON.parse(result);
|
||||
if (result != "") {
|
||||
var flow_xAxis = [];
|
||||
var lift_xAxis = [];
|
||||
var tons_xAxis = [];
|
||||
var data_flow = [];
|
||||
var data_tons = [];//功率_实际
|
||||
var data_lift = [];//扬程_实际
|
||||
var legend_flow = [];
|
||||
var legend_tons = [];//功率_实际
|
||||
var legend_lift = [];//扬程_实际
|
||||
|
||||
var flow_xAxis = [];
|
||||
var lift_xAxis = [];
|
||||
var tons_xAxis = [];
|
||||
var data_flow = [];//流量_实际
|
||||
var data_lift = [];//扬程_实际
|
||||
var data_tons = [];//单耗_实际
|
||||
for(var i=0;i<result.length;i++){
|
||||
var data = result[i];
|
||||
flow_xAxis = data.flow_xAxis;
|
||||
lift_xAxis = data.lift_xAxis;
|
||||
tons_xAxis = data.tons_xAxis;
|
||||
legend_flow[i]=data.equipmentCardName+"流量";
|
||||
legend_lift[i]=data.equipmentCardName+"扬程";
|
||||
legend_tons[i]=data.equipmentCardName+"单耗";
|
||||
data_flow[i]={
|
||||
name: data.equipmentCardName+"流量",
|
||||
type: 'line',
|
||||
data: data.flow_actual
|
||||
}
|
||||
data_lift[i]={
|
||||
name: data.equipmentCardName+"扬程",
|
||||
type: 'line',
|
||||
data: data.lift_actual
|
||||
}
|
||||
data_tons[i]={
|
||||
name: data.equipmentCardName+"单耗",
|
||||
type: 'line',
|
||||
data: data.tons_actual
|
||||
}
|
||||
}
|
||||
getChartData_pumpAll('flow_consumption','流量曲线(m³/h)',flow_xAxis,data_flow,legend_flow);
|
||||
getChartData_pumpAll('lift_consumption','扬程曲线(m)',lift_xAxis,data_lift,legend_lift);
|
||||
getChartData_pumpAll('tons_consumption','单耗曲线(KWh/t/m)',tons_xAxis,data_tons,legend_tons);
|
||||
}
|
||||
});
|
||||
}
|
||||
function getConsumptionData_DH() {
|
||||
var startdate = $("#startdate_consumption_DH").val();
|
||||
var enddate = $("#enddate_consumption_DH").val();
|
||||
var pumpMultiple = $("#pumpMultiple_consumption_DH").val();
|
||||
$.post(ext.contextPath + '/valueEngineering/equipmentEvaluate/getPumpAnalysisDHChartData.do',
|
||||
{ selectionModels: equipmentid,startdate:startdate,enddate:enddate,unitId:unitId,pumpMultiple:pumpMultiple },
|
||||
function (result) {
|
||||
result = JSON.parse(result);
|
||||
if (result != "") {
|
||||
var datas = [];
|
||||
var legendData = [];
|
||||
for(var i=0;i<result.length;i++){
|
||||
var data = result[i];
|
||||
var equipmentCard =JSON.parse(data.equipmentCard);
|
||||
legendData[i]=equipmentCard.equipmentcardid;
|
||||
|
||||
datas.push({
|
||||
name: equipmentCard.equipmentcardid,
|
||||
type: 'bar',
|
||||
data: [data.actual[0]]
|
||||
});
|
||||
datas.push({
|
||||
name: equipmentCard.equipmentcardid,
|
||||
type: 'bar',
|
||||
xAxisIndex: 1,
|
||||
yAxisIndex: 1,
|
||||
data: [data.actual[1],data.actual[2]]
|
||||
});
|
||||
}
|
||||
/* charts_bars('tons_consumption_DH','单耗分析',datas,legendData) */
|
||||
charts_bars_new('tons_consumption_DH','单耗分析',datas,legendData);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
</script>
|
||||
<div class="modal fade" id="economicLifeModal">
|
||||
<div class="modal-dialog modal-xlg" id="sub">
|
||||
<div class="modal-content nav-tabs-custom" id="content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title pull-right" id="myModalLabel" style="margin: 0 10px;"></h4>
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="active"><a href="#tab_1" data-toggle="tab">泵性能曲线</a></li>
|
||||
<li><a href="#tab_2" data-toggle="tab">设备经济寿命曲线</a></li>
|
||||
<!-- <li><a href="#tab_3" data-toggle="tab">吨水每米单耗</a></li>
|
||||
<li><a href="#tab_4" data-toggle="tab">单耗分析</a></li> -->
|
||||
</ul>
|
||||
</div>
|
||||
<div class="modal-body" style="overflow-x:auto;">
|
||||
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane active" id="tab_1">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-2">
|
||||
<select class="form-control " id="timeType" name="timeType" onchange ="getData();"
|
||||
style="width: 150px;">
|
||||
<!-- <option value="2">月数据</option> -->
|
||||
<!-- <option value="1">日数据</option> -->
|
||||
<option value="0" selected>实时数据</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<select class="form-control " id="pumpMultiple" name="pumpMultiple" onchange ="getData();"
|
||||
style="width: 150px;">
|
||||
<option value="" selected>全部</option>
|
||||
<option value="0" selected>单泵</option>
|
||||
<option value="1">满负荷</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-5 col-sm-2">
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">开始时间</div>
|
||||
<input type="text" class="form-control" id="startdate" name ="startdate" value="${fn:substring(startdate,0,16)}" >
|
||||
<div class="input-group-addon">结束时间</div>
|
||||
<input type="text" class="form-control" id="enddate" name ="enddate" value="${fn:substring(enddate,0,16)}" >
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-1 col-sm-2">
|
||||
<a role="button" class="btn btn-primary" href="javascript:;" onclick="getData();" >刷新</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-7">
|
||||
<div id="flow" style="float:left;height:320px;width:325px"></div>
|
||||
<div id="lift" style="float:left;height:320px;width:325px"></div>
|
||||
<div id="power" style="float:left;height:320px;width:325px"></div>
|
||||
<div id="efficiency" style="float:left;height:320px;width:325px"></div>
|
||||
</div>
|
||||
<div class="col-md-5">
|
||||
<div id="pump_lift" style="height:220px;width:450px"></div>
|
||||
<!-- <div id="pump_power" style="height:220px;width:450px"></div> -->
|
||||
<div id="pump_efficiency" style="height:220px;width:450px"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- /.tab-pane -->
|
||||
<div class="tab-pane" id="tab_2">
|
||||
<div id="eLifeDiv" style="height:670px;width:850px"></div>
|
||||
</div>
|
||||
<!-- /.tab-pane -->
|
||||
<div class="tab-pane" id="tab_3">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-2">
|
||||
<select class="form-control " id="timeType_consumption" name="timeType_consumption" onchange ="getConsumptionData();"
|
||||
style="width: 150px;">
|
||||
<!-- <option value="2">月数据</option> -->
|
||||
<!-- <option value="1">日数据</option> -->
|
||||
<option value="0" selected>实时数据</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<select class="form-control " id="pumpMultiple_consumption" name="pumpMultiple_consumption" onchange ="getConsumptionData();"
|
||||
style="width: 150px;">
|
||||
<option value="">全部</option>
|
||||
<option value="0" selected>单泵</option>
|
||||
<option value="1">满负荷</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-5 col-sm-2">
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">开始时间</div>
|
||||
<input type="text" class="form-control" id="startdate_consumption" name ="startdate_consumption" value="${fn:substring(startdate,0,16)}" >
|
||||
<div class="input-group-addon">结束时间</div>
|
||||
<input type="text" class="form-control" id="enddate_consumption" name ="enddate_consumption" value="${fn:substring(enddate,0,16)}" >
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-1 col-sm-2">
|
||||
<a role="button" class="btn btn-primary" href="javascript:;" onclick="getConsumptionData();" >刷新</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div id="tons_consumption" style="float:left;height:640px;width:380px"></div>
|
||||
<div id="flow_consumption" style="float:left;height:640px;width:380px"></div>
|
||||
<div id="lift_consumption" style="float:left;height:640px;width:380px"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.tab-pane -->
|
||||
<div class="tab-pane" id="tab_4">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-5 col-sm-2">
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">开始时间</div>
|
||||
<input type="text" class="form-control" id="startdate_consumption_DH" name ="startdate_consumption_DH" value="${fn:substring(startdate,0,10)}" >
|
||||
<div class="input-group-addon">结束时间</div>
|
||||
<input type="text" class="form-control" id="enddate_consumption_DH" name ="enddate_consumption_DH" value="${fn:substring(enddate,0,10)}" >
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<select class="form-control " id="pumpMultiple_consumption_DH" name="pumpMultiple_consumption_DH" onchange ="getConsumptionData_DH();"
|
||||
style="width: 150px;">
|
||||
<option value="" >全部</option>
|
||||
<option value="0" selected>单泵</option>
|
||||
<option value="1">满负荷</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-1 col-sm-2">
|
||||
<a role="button" class="btn btn-primary" href="javascript:;" onclick="getConsumptionData_DH();" >刷新</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div id="tons_consumption_DH" style="float:left;height:640px;width:1100px"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.tab-pane -->
|
||||
</div>
|
||||
<!-- /.tab-content -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
@ -0,0 +1,699 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<script type="text/javascript">
|
||||
//获取>泵性能曲线-总
|
||||
function getChartData_pumpAll(id,title,xAxis,data,legendData,selected) {
|
||||
var lifeChart = echarts.getInstanceByDom(document.getElementById(id)); //有的话就获取已有echarts实例的DOM节点。
|
||||
if (lifeChart != null) { // 如果存在,就进行销毁。
|
||||
lifeChart.dispose();
|
||||
}
|
||||
var option = {
|
||||
title: {
|
||||
text: title,
|
||||
x:'center',
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'axis'
|
||||
},
|
||||
toolbox: {
|
||||
show: true,
|
||||
feature: {
|
||||
dataZoom: {
|
||||
yAxisIndex: 'none'
|
||||
},
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
type: 'scroll',
|
||||
data: legendData,
|
||||
x:'left',
|
||||
top:'25px',
|
||||
selected: selected
|
||||
},
|
||||
grid: {
|
||||
left: '3%',
|
||||
right: '4%',
|
||||
bottom: '3%',
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
data:xAxis,
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value'
|
||||
},
|
||||
series: data
|
||||
};
|
||||
lifeChart = echarts.init(document.getElementById(id));
|
||||
lifeChart.setOption(option,true);
|
||||
}
|
||||
//获取泵性能曲线-分项
|
||||
function getChartData_pump(id,data,data2,title) {
|
||||
|
||||
// See https://github.com/ecomfe/echarts-stat
|
||||
var myRegression = ecStat.regression('polynomial', data);
|
||||
myRegression.points.sort(function(a, b) {
|
||||
return a[0] - b[0];
|
||||
});
|
||||
var myRegression2 = ecStat.regression('polynomial', data2.reverse());
|
||||
|
||||
myRegression2.points.sort(function(a, b) {
|
||||
return a[0] - b[0];
|
||||
});
|
||||
|
||||
var option = {
|
||||
title: {
|
||||
text: title,
|
||||
left: 'center'
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'cross'
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
data: ['实际', '标准'],
|
||||
x:'right'
|
||||
},
|
||||
xAxis: {
|
||||
type: 'value',
|
||||
splitLine: {
|
||||
lineStyle: {
|
||||
type: 'dashed'
|
||||
}
|
||||
},
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value',
|
||||
splitLine: {
|
||||
lineStyle: {
|
||||
type: 'dashed'
|
||||
}
|
||||
}
|
||||
},
|
||||
series: [{
|
||||
name: '实际scatter',
|
||||
type: 'scatter',
|
||||
emphasis: {
|
||||
label: {
|
||||
show: true,
|
||||
position: 'left',
|
||||
color: 'blue',
|
||||
fontSize: 16
|
||||
}
|
||||
},
|
||||
data: data
|
||||
}, {
|
||||
name: '实际',
|
||||
type: 'line',
|
||||
showSymbol: false,
|
||||
smooth: true,
|
||||
data: myRegression.points,
|
||||
markPoint: {
|
||||
itemStyle: {
|
||||
color: 'transparent'
|
||||
},
|
||||
label: {
|
||||
show: false,
|
||||
position: 'left',
|
||||
formatter: myRegression.expression,
|
||||
color: '#333',
|
||||
fontSize: 14
|
||||
},
|
||||
data: [{
|
||||
coord: myRegression.points[myRegression.points.length - 1]
|
||||
}]
|
||||
}
|
||||
},{
|
||||
name: '标准scatter',
|
||||
type: 'scatter',
|
||||
emphasis: {
|
||||
label: {
|
||||
show: true,
|
||||
position: 'left',
|
||||
color: 'green',
|
||||
fontSize: 16
|
||||
}
|
||||
},
|
||||
data: data2
|
||||
}, {
|
||||
name: '标准',
|
||||
type: 'line',
|
||||
showSymbol: false,
|
||||
smooth: true,
|
||||
data: myRegression2.points,
|
||||
markPoint: {
|
||||
itemStyle: {
|
||||
color: 'transparent'
|
||||
},
|
||||
label: {
|
||||
show: false,
|
||||
position: 'left',
|
||||
formatter: myRegression2.expression,
|
||||
color: '#333',
|
||||
fontSize: 14
|
||||
},
|
||||
data: [{
|
||||
coord: myRegression2.points[myRegression2.points.length - 1]
|
||||
}]
|
||||
}
|
||||
}]
|
||||
};
|
||||
var lifeChart = echarts.init(document.getElementById(id));
|
||||
lifeChart.setOption(option);
|
||||
}
|
||||
|
||||
function charts_bars_new(id,title,data,legendData) {
|
||||
var option = {
|
||||
title: {
|
||||
text: title,
|
||||
x:'left',
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'shadow'
|
||||
}
|
||||
},
|
||||
grid: [{
|
||||
right: '60%'
|
||||
},{
|
||||
left: '40%'
|
||||
}],
|
||||
legend: {
|
||||
data: legendData,
|
||||
x:'right',
|
||||
},
|
||||
xAxis: [
|
||||
{
|
||||
type: 'category',
|
||||
data: ['单耗(kWh/t)']
|
||||
},
|
||||
{
|
||||
type: 'category',
|
||||
data: ['运行次数(次)', '运行时间(h)'],
|
||||
gridIndex: 1,
|
||||
}
|
||||
],
|
||||
yAxis: [
|
||||
{
|
||||
type: 'value',
|
||||
axisLine: {
|
||||
show: true,
|
||||
},
|
||||
splitLine: {
|
||||
show: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'value',
|
||||
position: 'right',
|
||||
axisLine: {
|
||||
show: true,
|
||||
},
|
||||
splitLine: {
|
||||
show: false,
|
||||
},
|
||||
gridIndex: 1,
|
||||
}
|
||||
],
|
||||
series: data
|
||||
};
|
||||
var lifeChart = echarts.init(document.getElementById(id));
|
||||
lifeChart.setOption(option);
|
||||
}
|
||||
$(function () {
|
||||
/* $("#enddate").datepicker({
|
||||
language: 'zh-CN',
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format:'yyyy-mm-dd',
|
||||
})
|
||||
$("#startdate").datepicker({
|
||||
language: 'zh-CN',
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format:'yyyy-mm-dd',
|
||||
})
|
||||
|
||||
$("#enddate_consumption").datepicker({
|
||||
language: 'zh-CN',
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format:'yyyy-mm-dd',
|
||||
})
|
||||
$("#startdate_consumption").datepicker({
|
||||
language: 'zh-CN',
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format:'yyyy-mm-dd',
|
||||
})*/
|
||||
|
||||
$("#enddate").datetimepicker({
|
||||
language:'zh-CN',
|
||||
format: 'yyyy-mm-dd hh:ii',
|
||||
dateFormat: 'yyyy-mm-dd',//日期显示格式
|
||||
timeFormat: 'HH:mm',//时间显示格式
|
||||
startView: "day", //初始化视图是‘年’
|
||||
minView: 0,
|
||||
maxView: "year",
|
||||
minuteStep: 1,//分钟间隔1分钟
|
||||
autoclose: true
|
||||
}).on('changeDate', function () {
|
||||
|
||||
});
|
||||
$("#startdate").datetimepicker({
|
||||
language:'zh-CN',
|
||||
format: 'yyyy-mm-dd hh:ii',
|
||||
dateFormat: 'yyyy-mm-dd',//日期显示格式
|
||||
timeFormat: 'HH:mm',//时间显示格式
|
||||
startView: "day", //初始化视图是‘年’
|
||||
minView: 0,
|
||||
maxView: "year",
|
||||
minuteStep: 1,//分钟间隔1分钟
|
||||
autoclose: true
|
||||
}).on('changeDate', function () {
|
||||
|
||||
});
|
||||
$("#enddate_consumption").datetimepicker({
|
||||
language:'zh-CN',
|
||||
format: 'yyyy-mm-dd hh:ii',
|
||||
dateFormat: 'yyyy-mm-dd',//日期显示格式
|
||||
timeFormat: 'HH:mm',//时间显示格式
|
||||
startView: "day", //初始化视图是‘年’
|
||||
minView: 0,
|
||||
maxView: "year",
|
||||
minuteStep: 1,//分钟间隔1分钟
|
||||
autoclose: true
|
||||
}).on('changeDate', function () {
|
||||
|
||||
});
|
||||
$("#startdate_consumption").datetimepicker({
|
||||
language:'zh-CN',
|
||||
format: 'yyyy-mm-dd hh:ii',
|
||||
dateFormat: 'yyyy-mm-dd',//日期显示格式
|
||||
timeFormat: 'HH:mm',//时间显示格式
|
||||
startView: "day", //初始化视图是‘年’
|
||||
minView: 0,
|
||||
maxView: "year",
|
||||
minuteStep: 1,//分钟间隔1分钟
|
||||
autoclose: true
|
||||
}).on('changeDate', function () {
|
||||
|
||||
});
|
||||
$("#enddate_consumption_DH").datepicker({
|
||||
language: 'zh-CN',
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format:'yyyy-mm-dd',
|
||||
})
|
||||
$("#startdate_consumption_DH").datepicker({
|
||||
language: 'zh-CN',
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format:'yyyy-mm-dd',
|
||||
})
|
||||
var htmlStr = equipmentNames;
|
||||
$("#myModalLabel").html(htmlStr);
|
||||
getData();
|
||||
/* getConsumptionData();
|
||||
getConsumptionData_DH(); */
|
||||
})
|
||||
function getData() {
|
||||
var timeType = $("#timeType").val();
|
||||
var num = $("#num").val();
|
||||
var startdate = $("#startdate").val();
|
||||
var enddate = $("#enddate").val();
|
||||
var pumpMultiple = $("#pumpMultiple").val();
|
||||
$.post(ext.contextPath + '/valueEngineering/equipmentEvaluate/getPumpAnalysisContrastChartData.do',
|
||||
{ id: equipmentids,timeType:timeType,num:num,startdate:startdate,enddate:enddate,pumpMultiple:pumpMultiple }, function (datas) {
|
||||
var data = JSON.parse(datas);
|
||||
console.log(data);
|
||||
var result = data.dataList;
|
||||
var xAxisList = data.xAxisList;
|
||||
if (result != "") {
|
||||
var data_flow = [];
|
||||
var data_power = [];//功率_实际
|
||||
var data_lift = [];//扬程_实际
|
||||
var data_efficiency = [];//效率_实际
|
||||
var data_level = [];//青标液位_实际
|
||||
var legend_flow = [];
|
||||
var legend_power = [];//功率_实际
|
||||
var legend_lift = [];//扬程_实际
|
||||
var legend_efficiency = [];//效率_实际
|
||||
var legend_level = [];//青标液位_实际
|
||||
var selected_flow = {};
|
||||
var selected_power = {};//功率_实际
|
||||
var selected_lift = {};//扬程_实际
|
||||
var selected_efficiency = {};//效率_实际
|
||||
var selected_level = {};//青标液位_实际
|
||||
var selected_tons = {};//青标液位_实际
|
||||
var legend_tons = [];//功率_实际
|
||||
var data_tons = [];//单耗_实际
|
||||
|
||||
var data_flow_standard = [];//流量_标准
|
||||
var data_power_standard = [];//功率_标准
|
||||
var data_lift_standard = [];//扬程_标准
|
||||
var data_efficiency_standard = [];//效率_标准
|
||||
var data_lift_actual_item = [];
|
||||
var data_lift_standard_item = [];
|
||||
var data_power_actual_item = [];
|
||||
var data_power_standard_item = [];
|
||||
var data_efficiency_actual_item = [];
|
||||
var data_efficiency_standard_item = [];
|
||||
for(var i=0;i<result.length;i++){
|
||||
var data = result[i];
|
||||
legend_flow[i]=data.equipmentCardName+"流量";
|
||||
legend_power[i]=data.equipmentCardName+"功率";
|
||||
|
||||
legend_lift.push(data.equipmentCardName+"扬程",data.equipmentCardName+"青标液位",data.equipmentCardName+"压力");
|
||||
legend_efficiency[i]=data.equipmentCardName+"效率";
|
||||
legend_level[i]=data.equipmentCardName+"青标液位";
|
||||
legend_tons[i]=data.equipmentCardName+"单耗";
|
||||
|
||||
selected_flow[data.equipmentCardName+"流量"]=true;
|
||||
selected_power[data.equipmentCardName+"功率"]=true;
|
||||
selected_lift[data.equipmentCardName+"扬程"]=true;
|
||||
selected_lift[data.equipmentCardName+"青标液位"]=false;
|
||||
selected_lift[data.equipmentCardName+"压力"]=false;
|
||||
selected_efficiency[data.equipmentCardName+"效率"]=true;
|
||||
selected_level[data.equipmentCardName+"青标液位"]=true;
|
||||
selected_tons[data.equipmentCardName+"单耗"]=true;
|
||||
data_flow.push({
|
||||
name: data.equipmentCardName+"流量",
|
||||
type: 'line',
|
||||
data: data.flow_actual
|
||||
});
|
||||
data_power.push({
|
||||
name: data.equipmentCardName+"功率",
|
||||
type: 'line',
|
||||
data: data.power_actual
|
||||
});
|
||||
data_lift.push({
|
||||
name: data.equipmentCardName+"扬程",
|
||||
type: 'line',
|
||||
data: data.lift_actual
|
||||
});
|
||||
data_efficiency.push({
|
||||
name: data.equipmentCardName+"效率",
|
||||
type: 'line',
|
||||
data: data.efficiency_actual
|
||||
});
|
||||
data_lift.push({
|
||||
name: data.equipmentCardName+"青标液位",
|
||||
type: 'line',
|
||||
data: data.level_actual
|
||||
});
|
||||
data_lift.push({
|
||||
name: data.equipmentCardName+"压力",
|
||||
type: 'line',
|
||||
data: data.pressure_actual
|
||||
});
|
||||
data_tons[i]={
|
||||
name: data.equipmentCardName+"单耗",
|
||||
type: 'line',
|
||||
data: data.tons_actual
|
||||
}
|
||||
data_flow_standard = data.flow_standard;//流量_标准
|
||||
data_power_standard = data.power_standard;//功率_标准
|
||||
data_lift_standard = data.lift_standard;//扬程_标准
|
||||
data_efficiency_standard = data.efficiency_standard;//效率_标准
|
||||
//流量_实际
|
||||
if(data.flow_actual!=null && data.flow_actual.length>0){
|
||||
for(var a=0;a<data.flow_actual.length;a++){
|
||||
if(a<data.lift_actual.length){
|
||||
data_lift_actual_item.push([data.flow_actual[a][1],data.lift_actual[a][1]]);
|
||||
}/* else{
|
||||
data_lift_actual_item[a] = [data_flow[a],0];
|
||||
} */
|
||||
if(a<data.power_actual.length){
|
||||
data_power_actual_item.push([data.flow_actual[a][1],data.power_actual[a][1]]);
|
||||
}/* else{
|
||||
data_power_actual_item[a] = [data_flow[a],0];
|
||||
} */
|
||||
if(a<data.efficiency_actual.length){
|
||||
data_efficiency_actual_item.push([data.flow_actual[a][1],data.efficiency_actual[a][1]]);
|
||||
}/* else{
|
||||
data_efficiency_actual_item[a] = [data_flow[a],0];
|
||||
} */
|
||||
}
|
||||
}
|
||||
if(data_flow_standard!=null && data_flow_standard.length>0){
|
||||
for(var a=0;a<data_flow_standard.length;a++){
|
||||
if(a<data_lift_standard.length){
|
||||
data_lift_standard_item[a] = [data_flow_standard[a],data_lift_standard[a]];
|
||||
}/* else{
|
||||
data_lift_standard_item[a] = [data_flow_standard[a],0];
|
||||
} */
|
||||
if(a<data_power_standard.length){
|
||||
data_power_standard_item[a] = [data_flow_standard[a],data_power_standard[a]];
|
||||
}/* else{
|
||||
data_power_standard_item[a] = [data_flow_standard[a],0];
|
||||
} */
|
||||
if(a<data_efficiency_standard.length){
|
||||
data_efficiency_standard_item[a] = [data_flow_standard[a],data_efficiency_standard[a]];
|
||||
}/* else{
|
||||
data_efficiency_standard_item[a] = [data_flow_standard[a],0];
|
||||
} */
|
||||
}
|
||||
}
|
||||
}
|
||||
getChartData_pumpAll('flow','流量曲线(m³/h)',xAxisList,data_flow,legend_flow,selected_flow);
|
||||
getChartData_pumpAll('power','单耗曲线(KWh/t/m)',xAxisList,data_tons,legend_tons,selected_tons);
|
||||
//getChartData_pumpAll('power','功率曲线(kW)',xAxisList,data_power,legend_power,selected_power);
|
||||
getChartData_pumpAll('lift','扬程(m)、青标液位(m)、压力曲线',xAxisList,data_lift,legend_lift,selected_lift);
|
||||
getChartData_pumpAll('efficiency','效率曲线(%)',xAxisList,data_efficiency,legend_efficiency,selected_efficiency);
|
||||
//getChartData_pump('pump_lift',data_lift_actual_item,data_lift_standard_item,'扬程曲线(m)');
|
||||
//getChartData_pump('pump_power',data_power_actual_item,data_power_standard_item,'功率曲线');
|
||||
//getChartData_pump('pump_efficiency',data_efficiency_actual_item,data_efficiency_standard_item,'效率曲线(%)');
|
||||
}
|
||||
});
|
||||
}
|
||||
function getConsumptionData() {
|
||||
var timeType = $("#timeType_consumption").val();
|
||||
var num = $("#num_consumption").val();
|
||||
var startdate = $("#startdate_consumption").val();
|
||||
var enddate = $("#enddate_consumption").val();
|
||||
var pumpMultiple = $("#pumpMultiple_consumption").val();
|
||||
$.post(ext.contextPath + '/valueEngineering/equipmentEvaluate/getPumpAnalysisContrastChartData.do',
|
||||
{ id: equipmentids,timeType:timeType,num:num,startdate:startdate,enddate:enddate,pumpMultiple:pumpMultiple }, function (datas) {
|
||||
var data = JSON.parse(datas);
|
||||
console.log(data);
|
||||
var result = data.dataList;
|
||||
var xAxisList = data.xAxisList;
|
||||
if (result != "") {
|
||||
var legend_flow = [];
|
||||
var legend_tons = [];//功率_实际
|
||||
var legend_lift = [];//扬程_实际
|
||||
var data_flow = [];//流量_实际
|
||||
var data_lift = [];//扬程_实际
|
||||
var data_tons = [];//单耗_实际
|
||||
for(var i=0;i<result.length;i++){
|
||||
var data = result[i];
|
||||
legend_flow[i]=data.equipmentCardName+"流量";
|
||||
legend_lift[i]=data.equipmentCardName+"扬程";
|
||||
legend_tons[i]=data.equipmentCardName+"单耗";
|
||||
data_flow[i]={
|
||||
name: data.equipmentCardName+"流量",
|
||||
type: 'line',
|
||||
data: data.flow_actual
|
||||
}
|
||||
data_lift[i]={
|
||||
name: data.equipmentCardName+"扬程",
|
||||
type: 'line',
|
||||
data: data.lift_actual
|
||||
}
|
||||
data_tons[i]={
|
||||
name: data.equipmentCardName+"单耗",
|
||||
type: 'line',
|
||||
data: data.tons_actual
|
||||
}
|
||||
}
|
||||
getChartData_pumpAll('flow_consumption','流量曲线(m³/h)',xAxisList,data_flow,legend_flow);
|
||||
getChartData_pumpAll('lift_consumption','扬程曲线(m)',xAxisList,data_lift,legend_lift);
|
||||
getChartData_pumpAll('tons_consumption','单耗曲线(KWh/t/m)',xAxisList,data_tons,legend_tons);
|
||||
}
|
||||
});
|
||||
}
|
||||
function getConsumptionData_DH() {
|
||||
var startdate = $("#startdate_consumption_DH").val();
|
||||
var enddate = $("#enddate_consumption_DH").val();
|
||||
var pumpMultiple = $("#pumpMultiple_consumption_DH").val();
|
||||
$.post(ext.contextPath + '/valueEngineering/equipmentEvaluate/getPumpAnalysisDHChartData.do',
|
||||
{ selectionModels: equipmentids,startdate:startdate,enddate:enddate,unitId:unitId,pumpMultiple:pumpMultiple },
|
||||
function (result) {
|
||||
result = JSON.parse(result);
|
||||
if (result != "") {
|
||||
var datas = [];
|
||||
var legendData = [];
|
||||
for(var i=0;i<result.length;i++){
|
||||
var data = result[i];
|
||||
var equipmentCard =JSON.parse(data.equipmentCard);
|
||||
legendData[i]=equipmentCard.equipmentcardid;
|
||||
|
||||
datas.push({
|
||||
name: equipmentCard.equipmentcardid,
|
||||
type: 'bar',
|
||||
data: [data.actual[0]]
|
||||
});
|
||||
datas.push({
|
||||
name: equipmentCard.equipmentcardid,
|
||||
type: 'bar',
|
||||
xAxisIndex: 1,
|
||||
yAxisIndex: 1,
|
||||
data: [data.actual[1],data.actual[2]]
|
||||
});
|
||||
}
|
||||
/* charts_bars('tons_consumption_DH','单耗分析',datas,legendData) */
|
||||
charts_bars_new('tons_consumption_DH','单耗分析',datas,legendData);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
</script>
|
||||
<div class="modal fade" id="economicLifeModal">
|
||||
<div class="modal-dialog modal-xlg" id="sub">
|
||||
<div class="modal-content nav-tabs-custom" id="content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title pull-right" id="myModalLabel" style="margin: 0 10px;"></h4>
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="active"><a href="#tab_1" data-toggle="tab">泵性能曲线</a></li>
|
||||
<!-- <li><a href="#tab_3" data-toggle="tab">吨水每米单耗</a></li>
|
||||
<li><a href="#tab_4" data-toggle="tab">单耗分析</a></li> -->
|
||||
</ul>
|
||||
</div>
|
||||
<div class="modal-body" style="overflow-x:auto;">
|
||||
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane active" id="tab_1">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-2">
|
||||
<select class="form-control " id="timeType" name="timeType" onchange ="getData();"
|
||||
style="width: 150px;">
|
||||
<!-- <option value="2">月数据</option> -->
|
||||
<!-- <option value="1">日数据</option> -->
|
||||
<option value="0" selected>实时数据</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<select class="form-control " id="pumpMultiple" name="pumpMultiple" onchange ="getData();"
|
||||
style="width: 150px;">
|
||||
<option value="">全部</option>
|
||||
<option value="0" selected>单泵</option>
|
||||
<option value="1">满负荷</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-5 col-sm-2">
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">开始时间</div>
|
||||
<input type="text" class="form-control" id="startdate" name ="startdate" value="${fn:substring(startdate,0,16)}" >
|
||||
<div class="input-group-addon">结束时间</div>
|
||||
<input type="text" class="form-control" id="enddate" name ="enddate" value="${fn:substring(enddate,0,16)}" >
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-1 col-sm-2">
|
||||
<a role="button" class="btn btn-primary" href="javascript:;" onclick="getData();" >刷新</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div id="flow" style="float:left;height:320px;width:500px"></div>
|
||||
<div id="lift" style="float:left;height:320px;width:500px"></div>
|
||||
<div id="power" style="float:left;height:320px;width:500px"></div>
|
||||
<div id="efficiency" style="float:left;height:320px;width:500px"></div>
|
||||
</div>
|
||||
<!--<div class="col-md-7">
|
||||
<div id="flow" style="float:left;height:320px;width:325px"></div>
|
||||
<div id="lift" style="float:left;height:320px;width:325px"></div>
|
||||
<div id="power" style="float:left;height:320px;width:325px"></div>
|
||||
<div id="efficiency" style="float:left;height:320px;width:325px"></div>
|
||||
</div>
|
||||
<div class="col-md-5">
|
||||
<div id="pump_lift" style="height:220px;width:450px"></div>
|
||||
<div id="pump_power" style="height:220px;width:450px"></div>
|
||||
<div id="pump_efficiency" style="height:220px;width:450px"></div>
|
||||
</div> -->
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- /.tab-pane -->
|
||||
<div class="tab-pane" id="tab_3">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-2">
|
||||
<select class="form-control " id="timeType_consumption" name="timeType_consumption" onchange ="getConsumptionData();"
|
||||
style="width: 150px;">
|
||||
<!-- <option value="2">月数据</option> -->
|
||||
<!-- <option value="1">日数据</option> -->
|
||||
<option value="0" selected>实时数据</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<select class="form-control " id="pumpMultiple_consumption" name="pumpMultiple_consumption" onchange ="getConsumptionData();"
|
||||
style="width: 150px;">
|
||||
<option value="">全部</option>
|
||||
<option value="0" selected>单泵</option>
|
||||
<option value="1">满负荷</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-5 col-sm-2">
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">开始时间</div>
|
||||
<input type="text" class="form-control" id="startdate_consumption" name ="startdate_consumption" value="${fn:substring(startdate,0,16)}" >
|
||||
<div class="input-group-addon">结束时间</div>
|
||||
<input type="text" class="form-control" id="enddate_consumption" name ="enddate_consumption" value="${fn:substring(enddate,0,16)}" >
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-1 col-sm-2">
|
||||
<a role="button" class="btn btn-primary" href="javascript:;" onclick="getConsumptionData();" >刷新</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div id="tons_consumption" style="float:left;height:640px;width:380px"></div>
|
||||
<div id="flow_consumption" style="float:left;height:640px;width:380px"></div>
|
||||
<div id="lift_consumption" style="float:left;height:640px;width:380px"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.tab-pane -->
|
||||
<div class="tab-pane" id="tab_4">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-5 col-sm-2">
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">开始时间</div>
|
||||
<input type="text" class="form-control" id="startdate_consumption_DH" name ="startdate_consumption_DH" value="${fn:substring(startdate,0,10)}" >
|
||||
<div class="input-group-addon">结束时间</div>
|
||||
<input type="text" class="form-control" id="enddate_consumption_DH" name ="enddate_consumption_DH" value="${fn:substring(enddate,0,10)}" >
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<select class="form-control " id="pumpMultiple_consumption_DH" name="pumpMultiple_consumption_DH" onchange ="getConsumptionData_DH();"
|
||||
style="width: 150px;">
|
||||
<option value="" >全部</option>
|
||||
<option value="0" selected>单泵</option>
|
||||
<option value="1">满负荷</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-1 col-sm-2">
|
||||
<a role="button" class="btn btn-primary" href="javascript:;" onclick="getConsumptionData_DH();" >刷新</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div id="tons_consumption_DH" style="float:left;height:640px;width:1100px"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.tab-pane -->
|
||||
</div>
|
||||
<!-- /.tab-content -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
@ -0,0 +1,469 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<script type="text/javascript">
|
||||
//获取>泵性能曲线-总
|
||||
function getChartData_pumpAll(id,title,data_xAxis,data,legendData) {
|
||||
var option = {
|
||||
title: {
|
||||
text: title,
|
||||
x:'center',
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'axis'
|
||||
},
|
||||
legend: {
|
||||
data: legendData,
|
||||
x:'left',
|
||||
top:'25px',
|
||||
},
|
||||
grid: {
|
||||
left: '3%',
|
||||
right: '4%',
|
||||
bottom: '3%',
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
boundaryGap: false,
|
||||
data: data_xAxis
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value'
|
||||
},
|
||||
series: data
|
||||
};
|
||||
var lifeChart = echarts.init(document.getElementById(id));
|
||||
lifeChart.setOption(option,true);
|
||||
}
|
||||
//获取泵性能曲线-分项
|
||||
function getChartData_pump(id,data,data2,title) {
|
||||
|
||||
// See https://github.com/ecomfe/echarts-stat
|
||||
var myRegression = ecStat.regression('polynomial', data);
|
||||
myRegression.points.sort(function(a, b) {
|
||||
return a[0] - b[0];
|
||||
});
|
||||
var myRegression2 = ecStat.regression('polynomial', data2.reverse());
|
||||
|
||||
myRegression2.points.sort(function(a, b) {
|
||||
return a[0] - b[0];
|
||||
});
|
||||
|
||||
var option = {
|
||||
title: {
|
||||
text: title,
|
||||
left: 'center'
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'cross'
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
data: ['实际', '标准'],
|
||||
x:'right'
|
||||
},
|
||||
xAxis: {
|
||||
type: 'value',
|
||||
splitLine: {
|
||||
lineStyle: {
|
||||
type: 'dashed'
|
||||
}
|
||||
},
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value',
|
||||
splitLine: {
|
||||
lineStyle: {
|
||||
type: 'dashed'
|
||||
}
|
||||
}
|
||||
},
|
||||
series: [{
|
||||
name: '实际scatter',
|
||||
type: 'scatter',
|
||||
emphasis: {
|
||||
label: {
|
||||
show: true,
|
||||
position: 'left',
|
||||
color: 'blue',
|
||||
fontSize: 16
|
||||
}
|
||||
},
|
||||
data: data
|
||||
}, {
|
||||
name: '实际',
|
||||
type: 'line',
|
||||
showSymbol: false,
|
||||
smooth: true,
|
||||
data: myRegression.points,
|
||||
markPoint: {
|
||||
itemStyle: {
|
||||
color: 'transparent'
|
||||
},
|
||||
label: {
|
||||
show: false,
|
||||
position: 'left',
|
||||
formatter: myRegression.expression,
|
||||
color: '#333',
|
||||
fontSize: 14
|
||||
},
|
||||
data: [{
|
||||
coord: myRegression.points[myRegression.points.length - 1]
|
||||
}]
|
||||
}
|
||||
},{
|
||||
name: '标准scatter',
|
||||
type: 'scatter',
|
||||
emphasis: {
|
||||
label: {
|
||||
show: true,
|
||||
position: 'left',
|
||||
color: 'green',
|
||||
fontSize: 16
|
||||
}
|
||||
},
|
||||
data: data2
|
||||
}, {
|
||||
name: '标准',
|
||||
type: 'line',
|
||||
showSymbol: false,
|
||||
smooth: true,
|
||||
data: myRegression2.points,
|
||||
markPoint: {
|
||||
itemStyle: {
|
||||
color: 'transparent'
|
||||
},
|
||||
label: {
|
||||
show: false,
|
||||
position: 'left',
|
||||
formatter: myRegression2.expression,
|
||||
color: '#333',
|
||||
fontSize: 14
|
||||
},
|
||||
data: [{
|
||||
coord: myRegression2.points[myRegression2.points.length - 1]
|
||||
}]
|
||||
}
|
||||
}]
|
||||
};
|
||||
var lifeChart = echarts.init(document.getElementById(id));
|
||||
lifeChart.setOption(option);
|
||||
}
|
||||
$(function () {
|
||||
/* $("#enddate_consumption").datepicker({
|
||||
language: 'zh-CN',
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format:'yyyy-mm-dd',
|
||||
})
|
||||
$("#startdate_consumption").datepicker({
|
||||
language: 'zh-CN',
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format:'yyyy-mm-dd',
|
||||
}) */
|
||||
$("#enddate_consumption").datetimepicker({
|
||||
language:'zh-CN',
|
||||
format: 'yyyy-mm-dd hh:ii',
|
||||
dateFormat: 'yyyy-mm-dd',//日期显示格式
|
||||
timeFormat: 'HH:mm',//时间显示格式
|
||||
startView: "day", //初始化视图是‘年’
|
||||
minView: 0,
|
||||
maxView: "year",
|
||||
minuteStep: 1,//分钟间隔1分钟
|
||||
autoclose: true
|
||||
}).on('changeDate', function () {
|
||||
|
||||
});
|
||||
$("#startdate_consumption").datetimepicker({
|
||||
language:'zh-CN',
|
||||
format: 'yyyy-mm-dd hh:ii',
|
||||
dateFormat: 'yyyy-mm-dd',//日期显示格式
|
||||
timeFormat: 'HH:mm',//时间显示格式
|
||||
startView: "day", //初始化视图是‘年’
|
||||
minView: 0,
|
||||
maxView: "year",
|
||||
minuteStep: 1,//分钟间隔1分钟
|
||||
autoclose: true
|
||||
}).on('changeDate', function () {
|
||||
|
||||
});
|
||||
$("#enddate_consumption_DH").datepicker({
|
||||
language: 'zh-CN',
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format:'yyyy-mm-dd',
|
||||
})
|
||||
$("#startdate_consumption_DH").datepicker({
|
||||
language: 'zh-CN',
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format:'yyyy-mm-dd',
|
||||
})
|
||||
var htmlStr = "";
|
||||
$.each(selectionModels, function(index, item){
|
||||
if(htmlStr!=""){
|
||||
htmlStr+=",";
|
||||
}
|
||||
htmlStr+=item.specificationName+"("+item.equipmentmanufacturer+")";
|
||||
});
|
||||
$("#myModalLabel").html(htmlStr);
|
||||
getConsumptionData();
|
||||
getConsumptionData_DH();
|
||||
})
|
||||
function getConsumptionData() {
|
||||
var timeType = $("#timeType_consumption").val();
|
||||
var num = $("#num_consumption").val();
|
||||
var startdate = $("#startdate_consumption").val();
|
||||
var enddate = $("#enddate_consumption").val();
|
||||
var pumpMultiple = $("#pumpMultiple_consumption").val();
|
||||
$.post(ext.contextPath + '/valueEngineering/equipmentEvaluate/getPumpAnalysisModelChartData.do',
|
||||
{ selectionModels: JSON.stringify(selectionModels),timeType:timeType,num:num,startdate:startdate,enddate:enddate,unitId:unitId,pumpMultiple:pumpMultiple }, function (result) {
|
||||
result = JSON.parse(result);
|
||||
console.log(result);
|
||||
if (result != "") {
|
||||
var tons_xAxis = [];
|
||||
var data_tons = [];//单耗_实际
|
||||
var legend_tons = [];//单耗_实际
|
||||
var tons_xAxis = [];
|
||||
var data_tons = [];//单耗_实际
|
||||
for(var i=0;i<result.length;i++){
|
||||
var data = result[i];
|
||||
if(data.tons_xAxis.length>tons_xAxis.length){
|
||||
tons_xAxis = data.tons_xAxis;
|
||||
}
|
||||
legend_tons[i]=data.equipmentCardName+"单耗";
|
||||
data_tons[i]={
|
||||
name: data.equipmentCardName+"单耗",
|
||||
type: 'line',
|
||||
data: data.tons_actual
|
||||
}
|
||||
}
|
||||
getChartData_pumpAll('tons_consumption','单耗曲线(KWh/t)',tons_xAxis,data_tons,legend_tons);
|
||||
}
|
||||
});
|
||||
}
|
||||
function getConsumptionData_DH() {
|
||||
var startdate = $("#startdate_consumption_DH").val();
|
||||
var enddate = $("#enddate_consumption_DH").val();
|
||||
var pumpMultiple = $("#pumpMultiple_consumption_DH").val();
|
||||
$.post(ext.contextPath + '/valueEngineering/equipmentEvaluate/getPumpAnalysisDHModelChartData.do',
|
||||
{ selectionModels: JSON.stringify(selectionModels),startdate:startdate,enddate:enddate,unitId:unitId,pumpMultiple:pumpMultiple },
|
||||
function (result) {
|
||||
result = JSON.parse(result);
|
||||
console.log(result);
|
||||
if (result != "") {
|
||||
var datas = [];
|
||||
var legendData = [];
|
||||
for(var i=0;i<result.length;i++){
|
||||
var data = result[i];
|
||||
var equipmentCard =JSON.parse(data.equipmentCard);
|
||||
legendData[i]=equipmentCard.equipmentcardid;
|
||||
/* datas[i]={
|
||||
name: equipmentCard.equipmentcardid,
|
||||
type: 'bar',
|
||||
data: data.actual
|
||||
} */
|
||||
datas.push({
|
||||
name: equipmentCard.equipmentcardid,
|
||||
type: 'bar',
|
||||
data: [data.actual[0]]
|
||||
});
|
||||
datas.push({
|
||||
name: equipmentCard.equipmentcardid,
|
||||
type: 'bar',
|
||||
xAxisIndex: 1,
|
||||
yAxisIndex: 1,
|
||||
data: [data.actual[1],data.actual[2]]
|
||||
});
|
||||
}
|
||||
/* charts_bars('tons_consumption_DH','单耗分析',datas,legendData) */
|
||||
charts_bars_new('tons_consumption_DH','单耗分析',datas,legendData);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
function charts_bars(id,title,data,legendData) {
|
||||
var option = {
|
||||
title: {
|
||||
text: title,
|
||||
x:'center',
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'shadow'
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
data: legendData,
|
||||
x:'left',
|
||||
},
|
||||
grid: {
|
||||
left: '3%',
|
||||
right: '4%',
|
||||
bottom: '3%',
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
data: ['单耗(kWh/t)', '运行次数(次)', '运行时间(h)']
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value',
|
||||
},
|
||||
series: data,
|
||||
};
|
||||
var lifeChart = echarts.init(document.getElementById(id));
|
||||
lifeChart.setOption(option);
|
||||
}
|
||||
function charts_bars_new(id,title,data,legendData) {
|
||||
var option = {
|
||||
title: {
|
||||
text: title,
|
||||
x:'left',
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'shadow'
|
||||
}
|
||||
},
|
||||
grid: [{
|
||||
right: '60%'
|
||||
},{
|
||||
left: '40%'
|
||||
}],
|
||||
legend: {
|
||||
data: legendData,
|
||||
x:'right',
|
||||
},
|
||||
xAxis: [
|
||||
{
|
||||
type: 'category',
|
||||
data: ['单耗(kWh/t)']
|
||||
},
|
||||
{
|
||||
type: 'category',
|
||||
data: ['运行次数(次)', '运行时间(h)'],
|
||||
gridIndex: 1,
|
||||
}
|
||||
],
|
||||
yAxis: [
|
||||
{
|
||||
type: 'value',
|
||||
axisLine: {
|
||||
show: true,
|
||||
},
|
||||
splitLine: {
|
||||
show: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'value',
|
||||
position: 'right',
|
||||
axisLine: {
|
||||
show: true,
|
||||
},
|
||||
splitLine: {
|
||||
show: false,
|
||||
},
|
||||
gridIndex: 1,
|
||||
}
|
||||
],
|
||||
series: data
|
||||
};
|
||||
var lifeChart = echarts.init(document.getElementById(id));
|
||||
lifeChart.setOption(option);
|
||||
}
|
||||
</script>
|
||||
<div class="modal fade" id="economicLifeModal">
|
||||
<div class="modal-dialog modal-xlg" id="sub">
|
||||
<div class="modal-content nav-tabs-custom" id="content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title pull-right" id="myModalLabel" style="margin: 0 10px;"></h4>
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="active"><a href="#tab_3" data-toggle="tab">吨水电耗</a></li>
|
||||
<li><a href="#tab_4" data-toggle="tab">单耗分析</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="modal-body" style="overflow-x:auto;">
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane active" id="tab_3">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-2">
|
||||
<select class="form-control " id="timeType_consumption" name="timeType_consumption" onchange ="getConsumptionData();"
|
||||
style="width: 150px;">
|
||||
<option value="2">月数据</option>
|
||||
<option value="1">日数据</option>
|
||||
<option value="0" selected>实时数据</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<select class="form-control " id="pumpMultiple_consumption" name="pumpMultiple_consumption" onchange ="getConsumptionData();"
|
||||
style="width: 150px;">
|
||||
<option value="" selected>全部</option>
|
||||
<option value="0">单泵</option>
|
||||
<option value="1">多泵</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-5 col-sm-2">
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">开始时间</div>
|
||||
<input type="text" class="form-control" id="startdate_consumption" name ="startdate_consumption" value="${fn:substring(startdate,0,16)}" >
|
||||
<div class="input-group-addon">结束时间</div>
|
||||
<input type="text" class="form-control" id="enddate_consumption" name ="enddate_consumption" value="${fn:substring(enddate,0,16)}" >
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-1 col-sm-2">
|
||||
<a role="button" class="btn btn-primary" href="javascript:;" onclick="getConsumptionData();" >刷新</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div id="tons_consumption" style="float:left;height:640px;width:1100px"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.tab-pane -->
|
||||
<div class="tab-pane" id="tab_4">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-5 col-sm-2">
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">开始时间</div>
|
||||
<input type="text" class="form-control" id="startdate_consumption_DH" name ="startdate_consumption_DH" value="${fn:substring(startdate,0,10)}" >
|
||||
<div class="input-group-addon">结束时间</div>
|
||||
<input type="text" class="form-control" id="enddate_consumption_DH" name ="enddate_consumption_DH" value="${fn:substring(enddate,0,10)}" >
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<select class="form-control " id="pumpMultiple_consumption_DH" name="pumpMultiple_consumption_DH" onchange ="getConsumptionData_DH();"
|
||||
style="width: 150px;">
|
||||
<option value="" selected>全部</option>
|
||||
<option value="0">单泵</option>
|
||||
<option value="1">多泵</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-1 col-sm-2">
|
||||
<a role="button" class="btn btn-primary" href="javascript:;" onclick="getConsumptionData_DH();" >刷新</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div id="tons_consumption_DH" style="float:left;height:640px;width:1100px"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.tab-pane -->
|
||||
</div>
|
||||
<!-- /.tab-content -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
686
WebRoot/jsp/valueEngineering/economicView.jsp
Normal file
686
WebRoot/jsp/valueEngineering/economicView.jsp
Normal file
@ -0,0 +1,686 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@page import="com.sipai.entity.maintenance.MaintenanceCommString"%>
|
||||
<%@page import="com.sipai.entity.maintenance.MaintenanceDetail"%>
|
||||
<%request.setAttribute("MAINTENANCE_TYPE_REPAIR",MaintenanceCommString.MAINTENANCE_TYPE_REPAIR);%>
|
||||
<%request.setAttribute("Status_Start",MaintenanceDetail.Status_Start);%>
|
||||
<%request.setAttribute("Status_Finish",MaintenanceDetail.Status_Finish);%>
|
||||
<%request.setAttribute("Status_Wait",MaintenanceDetail.Status_Wait);%>
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/CSS/circularRing.css" />
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
//根据父页面选择的TAB切换此页面tab
|
||||
function chooseTab() {
|
||||
switch (tabN) {
|
||||
case 'commCompare':
|
||||
$('#myTab a[href="#tab1"]').tab('show');
|
||||
break;
|
||||
case 'table2':
|
||||
//table2Data = data;
|
||||
break;
|
||||
case 'economicCompare':
|
||||
$('#myTab a[href="#tab1"]').tab('show');
|
||||
break;
|
||||
case 'efficiencyCompare':
|
||||
$('#myTab a[href="#efficiencyTab"]').tab('show');
|
||||
break;
|
||||
case 'qualityCompare':
|
||||
$('#myTab a[href="#qualityTab"]').tab('show');
|
||||
break;
|
||||
// case 'evaluateCompare':
|
||||
// $('#myTab a[href="#evaluateTab"]').tab('show');
|
||||
// break;
|
||||
default:
|
||||
$('#myTab a[href="#tab1"]').tab('show');
|
||||
break;
|
||||
}
|
||||
}
|
||||
//获取折线图数据
|
||||
function getRankChartData() {
|
||||
$.post(ext.contextPath + '/valueEngineering/equipmentEvaluate/getRankLineChart.do', { id:data[viewno].id }, function (result) {
|
||||
result = JSON.parse(result);
|
||||
if(result != ""){
|
||||
var rankChart = echarts.init(document.getElementById('rankDiv'));
|
||||
optionRank.xAxis[0].data = result[0].datetime;
|
||||
optionRank.series[0].data = result[0].value;
|
||||
optionRank.series[1].data = result[1].value;
|
||||
optionRank.series[2].data = result[2].value;
|
||||
optionRank.series[3].data = result[3].value;
|
||||
rankChart.setOption(optionRank);//得分走势
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//选择设备,
|
||||
var selectEquipmentCard = function () {
|
||||
$.post(ext.contextPath + '/valueEngineering/equipmentEvaluate/showEquipmentCardForEvalueSelect.do', {equipmentId: $("#equipid").val(),ids:'${param.ids}' }, function (data) {
|
||||
$("#emSubDiv").html(data);
|
||||
openModal('emSubModal');
|
||||
});
|
||||
};
|
||||
var equipmentId = $("#equipid").val();
|
||||
//单个设备的维护详情
|
||||
var viewMaintainFun = function () {
|
||||
$.post(ext.contextPath + '/valueEngineering/equipmentEvaluate/viewMaintainDetail.do', { equipmentId: equipmentId}, function (data) {
|
||||
$("#faultBox").html(data);
|
||||
});
|
||||
//动态添加模态框尾部,否则关闭按钮会上移
|
||||
$(".modal-footer").remove();
|
||||
var foot ='<div class="modal-footer">'+
|
||||
'<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>'+
|
||||
'</div> ';
|
||||
$("#content").append(foot);
|
||||
}
|
||||
//单个设备的维修详情
|
||||
var viewRepairFun = function () {
|
||||
$.post(ext.contextPath + '/valueEngineering/equipmentEvaluate/viewRepairDetail.do', { equipmentId: equipmentId}, function (data) {
|
||||
$("#faultBox").html(data);
|
||||
});
|
||||
//动态添加模态框尾部,否则关闭按钮会上移
|
||||
$(".modal-footer").remove();
|
||||
var foot ='<div class="modal-footer">'+
|
||||
'<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>'+
|
||||
'</div> ';
|
||||
$("#content").append(foot);
|
||||
}
|
||||
//单个设备使用费用
|
||||
var viewUsedFun = function () {
|
||||
$.post(ext.contextPath + '/valueEngineering/equipmentEvaluate/viewEnergyMoney.do', { equipmentId: equipmentId}, function (data) {
|
||||
$("#faultBox").html(data);
|
||||
});
|
||||
//动态添加模态框尾部,否则关闭按钮会上移
|
||||
$(".modal-footer").remove();
|
||||
var foot ='<div class="modal-footer">'+
|
||||
'<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>'+
|
||||
'</div> ';
|
||||
$("#content").append(foot);
|
||||
}
|
||||
//单个设备的设备增加值
|
||||
var viewIncreaseValueFun = function () {
|
||||
$.post(ext.contextPath + '/valueEngineering/equipmentEvaluate/viewIncreaseValue.do', { equipmentId: equipmentId}, function (data) {
|
||||
$("#faultBox").html(data);
|
||||
});
|
||||
//动态添加模态框尾部,否则关闭按钮会上移
|
||||
$(".modal-footer").remove();
|
||||
var foot ='<div class="modal-footer">'+
|
||||
'<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>'+
|
||||
'</div> ';
|
||||
$("#content").append(foot);
|
||||
}
|
||||
//选择设备后刷新设备的费用信息
|
||||
var refreshEquipmentDataFun = function(){
|
||||
$.post(ext.contextPath + '/valueEngineering/equipmentEvaluate/getEquipmentCost.do', { equipmentId: equipmentId}, function (result) {
|
||||
$("#LCC").val(result.LCC)
|
||||
$("#purchaseMoney").val(result.purchaseMoney)
|
||||
$("#residualMoney").val(result.residualMoney)
|
||||
$("#runMoney").val(result.runMoney)
|
||||
$("#faultBox").html("");
|
||||
},'json')
|
||||
}
|
||||
|
||||
var initFun = function () {
|
||||
var option = {
|
||||
/* tooltip: {
|
||||
trigger: 'item',
|
||||
formatter: "{a} <br/>{b}: {c} ({d}%)"
|
||||
}, */
|
||||
color:['#00F5FF', '#00F5FF','#00F5FF','#00F5FF','#00F5FF','#00F5FF','#00F5FF','#00F5FF','#00F5FF','#00F5FF','#00F5FF','#00F5FF'],
|
||||
/* legend: {
|
||||
orient: 'vertical',
|
||||
x: 'left',
|
||||
data:['直达','营销广告','搜索引擎','邮件营销','联盟广告','视频广告','百度','谷歌','必应','其他']
|
||||
}, */
|
||||
series: [
|
||||
|
||||
{
|
||||
|
||||
type:'pie',
|
||||
selectedMode: 'single',
|
||||
radius: ['40%', '85%'],
|
||||
name: '',
|
||||
data:[
|
||||
{value:1, name:'维护'},
|
||||
{value:1, name:'维修'},
|
||||
{value:1, name:'改造'},
|
||||
{value:1, name:'更新'},
|
||||
{value:1, name:'报废'},
|
||||
{value:1, name:'规划'},
|
||||
{value:1, name:'设计'},
|
||||
{value:1, name:'制造'},
|
||||
{value:1, name:'选型'},
|
||||
{value:1, name:'购置'},
|
||||
{value:1, name:'安装'},
|
||||
{value:1, name:'使用'}
|
||||
],
|
||||
label: {
|
||||
normal: {
|
||||
position: 'inner',
|
||||
textStyle: {
|
||||
fontSize: 18
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
labelLine: {
|
||||
normal: {
|
||||
show: false
|
||||
}
|
||||
},
|
||||
itemStyle:{
|
||||
normal: {
|
||||
color: "#B9D3EE"//默认显示的颜色
|
||||
},
|
||||
emphasis :{//高亮状态时显示不同颜色
|
||||
color: "#EE8262"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
var width;
|
||||
var flag = IsPC(); //true为PC端,false为手机端
|
||||
if (flag==true){
|
||||
width=$("#sub").width()*0.5-100;
|
||||
}else{
|
||||
width=$(window).width()*0.75;
|
||||
}
|
||||
var chart = document.getElementById("div1");
|
||||
console.log(width);
|
||||
|
||||
//chart.style.width = $("#chartdiv").width();
|
||||
//chart.style.height = 250+'px';
|
||||
$("#div1").height(width);
|
||||
$("#div1").width(width);
|
||||
|
||||
var chartData = echarts.init(chart);
|
||||
|
||||
//setTimeout(function(){
|
||||
chartData.setOption(option);
|
||||
//设置默认选中高亮部分
|
||||
chartData.dispatchAction({
|
||||
type: 'highlight',
|
||||
seriesIndex: 1,
|
||||
dataIndex: 0
|
||||
});
|
||||
var index = -1; highlightIndex = 0;
|
||||
chartData.on('click', function (param) {
|
||||
switch(param.name){
|
||||
case '维护':
|
||||
viewMaintainFun();
|
||||
break;
|
||||
case '维修':
|
||||
viewRepairFun();
|
||||
break;
|
||||
case '改造':
|
||||
viewIncreaseValueFun();
|
||||
break;
|
||||
case '使用':
|
||||
viewUsedFun();
|
||||
break;
|
||||
case '安装':
|
||||
var addA ='<div class="col-lg-4 col-xs-4" style="text-align:left">'+
|
||||
'<label class="form-label">安装费用</label>'+
|
||||
'</div>'+
|
||||
'<div class="col-lg-7 col-xs-6" style="text-align:left">'+
|
||||
'<input type="text" class="form-control" name="" value= 0.00 style="text-align:center" readonly>'+
|
||||
'</div>'+
|
||||
'<div class="col-lg-1 col-xs-1">'+
|
||||
'<label>元</label>'+
|
||||
'</div>'
|
||||
$("#faultBox").html("");
|
||||
$("#addInput").empty();
|
||||
$("#addInput").append(addA);
|
||||
break;
|
||||
case '购置':
|
||||
var addB ='<div class="col-lg-4 col-xs-4" style="text-align:left">'+
|
||||
'<label class="form-label">购置费用</label>'+
|
||||
'</div>'+
|
||||
'<div class="col-lg-7 col-xs-6" style="text-align:left">'+
|
||||
'<input type="text" class="form-control" name="" value= 0.00 style="text-align:center" readonly>'+
|
||||
'</div>'+
|
||||
'<div class="col-lg-1 col-xs-1">'+
|
||||
'<label>元</label>'+
|
||||
'</div>'
|
||||
$("#faultBox").html("");
|
||||
$("#addInput").empty();
|
||||
$("#addInput").append(addB);
|
||||
break;
|
||||
case '选型':
|
||||
var addC ='<div class="col-lg-4 col-xs-4" style="text-align:left">'+
|
||||
'<label class="form-label">选型费用</label>'+
|
||||
'</div>'+
|
||||
'<div class="col-lg-7 col-xs-6" style="text-align:left">'+
|
||||
'<input type="text" class="form-control" name="" value= 0.00 style="text-align:center" readonly>'+
|
||||
'</div>'+
|
||||
'<div class="col-lg-1 col-xs-1">'+
|
||||
'<label>元</label>'+
|
||||
'</div>'
|
||||
$("#faultBox").html("");
|
||||
$("#addInput").empty();
|
||||
$("#addInput").append(addC);
|
||||
break;
|
||||
case '制造':
|
||||
var addD ='<div class="col-lg-4 col-xs-4" style="text-align:left">'+
|
||||
'<label class="form-label">制造费用</label>'+
|
||||
'</div>'+
|
||||
'<div class="col-lg-7 col-xs-6" style="text-align:left">'+
|
||||
'<input type="text" class="form-control" name="" value= 0.00 style="text-align:center" readonly>'+
|
||||
'</div>'+
|
||||
'<div class="col-lg-1 col-xs-1">'+
|
||||
'<label>元</label>'+
|
||||
'</div>'
|
||||
$("#faultBox").html("");
|
||||
$("#addInput").empty();
|
||||
$("#addInput").append(addD);
|
||||
break;
|
||||
case '设计':
|
||||
var addE ='<div class="col-lg-4 col-xs-4" style="text-align:left">'+
|
||||
'<label class="form-label">设计费用</label>'+
|
||||
'</div>'+
|
||||
'<div class="col-lg-7 col-xs-6" style="text-align:left">'+
|
||||
'<input type="text" class="form-control" name="" value= 0.00 style="text-align:center" readonly>'+
|
||||
'</div>'+
|
||||
'<div class="col-lg-1 col-xs-1">'+
|
||||
'<label>元</label>'+
|
||||
'</div>'
|
||||
$("#faultBox").html("");
|
||||
$("#addInput").empty();
|
||||
$("#addInput").append(addE);
|
||||
break;
|
||||
case '规划':
|
||||
var addF ='<div class="col-lg-4 col-xs-4" style="text-align:left">'+
|
||||
'<label class="form-label">规划费用</label>'+
|
||||
'</div>'+
|
||||
'<div class="col-lg-7 col-xs-6" style="text-align:left">'+
|
||||
'<input type="text" class="form-control" name="" value= 0.00 style="text-align:center" readonly>'+
|
||||
'</div>'+
|
||||
'<div class="col-lg-1 col-xs-1">'+
|
||||
'<label>元</label>'+
|
||||
'</div>'
|
||||
$("#faultBox").html("");
|
||||
$("#addInput").empty();
|
||||
$("#addInput").append(addF);
|
||||
break;
|
||||
case '报废':
|
||||
|
||||
break;
|
||||
case '更新':
|
||||
var addG ='<div class="col-lg-4 col-xs-4" style="text-align:left">'+
|
||||
'<label class="form-label">更新费用</label>'+
|
||||
'</div>'+
|
||||
'<div class="col-lg-7 col-xs-6" style="text-align:left">'+
|
||||
'<input type="text" class="form-control" name="" value= 0.00 style="text-align:center" readonly>'+
|
||||
'</div>'+
|
||||
'<div class="col-lg-1 col-xs-1">'+
|
||||
'<label>元</label>'+
|
||||
'</div>'
|
||||
$("#faultBox").html("");
|
||||
$("#addInput").empty();
|
||||
$("#addInput").append(addG);
|
||||
break;
|
||||
}
|
||||
//点击后显示或取消高亮状态
|
||||
if (param.dataIndex != index) {
|
||||
highlightIndex = 1;
|
||||
index = param.dataIndex;
|
||||
chartData.dispatchAction({ type: 'highlight', seriesIndex: 0, dataIndex: param.dataIndex });//选中高亮
|
||||
for (var i = 0; i < 12; i++) {
|
||||
if (i != index) {
|
||||
chartData.dispatchAction({ type: 'downplay', seriesIndex: 0, dataIndex: i });//取消高亮
|
||||
}
|
||||
}
|
||||
} else {
|
||||
highlightIndex = 0;
|
||||
datagridType = '';
|
||||
chartData.dispatchAction({ type: 'downplay', seriesIndex: 0, dataIndex: index });//取消高亮
|
||||
index = -1
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
//该类设备的评分
|
||||
$("#economicScoreId").html(data[viewno].economicScore.toFixed(2));
|
||||
$("#effiScoreId").html(data[viewno].efficiencyScore.toFixed(2));
|
||||
$("#qualScoreId").html(data[viewno].qualityScore.toFixed(2));
|
||||
$("#tab1").height($("#div1").height()+$("#faultBox").height()+100);
|
||||
$("#bing2").css({ "background-color": "red" });
|
||||
chooseTab();
|
||||
getRankChartData();
|
||||
var starBarChart = echarts.init(document.getElementById('starBarDiv'));
|
||||
starBarChart.setOption(optionStarBar);//评分布局
|
||||
$('#star').rater('', { style: 'basic', curvalue: 4.9 });
|
||||
|
||||
$("#efficiencyTable").bootstrapTable({ // 对应table标签的id
|
||||
//url: ext.contextPath + '/equipment/getList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
||||
pageSize: 50, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
//queryParams:queryParamsFun,
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
columns: [
|
||||
/* {
|
||||
checkbox: true, // 显示一个勾选框
|
||||
}, */
|
||||
{
|
||||
field: 'date', // 返回json数据中的name
|
||||
title: '时间', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'lastTime', // 返回json数据中的name
|
||||
title: '时长', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 120, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts = "";
|
||||
buts += '<button class="btn btn-default btn-sm" title="查看详情" onclick="viewEconomicFun(\'' + row.id + '\')"><i class="fa fa-file-text-o"></i><span class="hidden-md hidden-lg">查看详情</span></button>';
|
||||
buts = '<div class="btn-group" >' + buts + '</div>';
|
||||
return buts;
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("table2");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
});
|
||||
|
||||
$("#qualityTable").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/maintenance/getMaintenanceDetailList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
//pageList: [3,20,50], // 设置页面可以显示的数据条数
|
||||
pageSize: 3, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
//search_code: '${param.companyId}',
|
||||
equipmentId: equipmentId,
|
||||
type:'${MAINTENANCE_TYPE_REPAIR}',
|
||||
}
|
||||
},
|
||||
/* onClickRow:function(row){
|
||||
viewDetailFun(row.id);
|
||||
}, */
|
||||
columns: [
|
||||
/* {
|
||||
checkbox: true, // 显示一个勾选框
|
||||
}, */
|
||||
{
|
||||
field: 'problemcontent', // 返回json数据中的name
|
||||
title: '维修内容', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'insdt', // 返回json数据中的name
|
||||
title: '时间', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'stopTime', // 返回json数据中的name
|
||||
title: '停机时间/h', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter: function (value, row, index) {
|
||||
switch (row.status) {
|
||||
case '${Status_Finish}':
|
||||
var stdt = new Date(row.insdt.replace(/\-/g, "/"));
|
||||
var eddt = new Date(row.actualFinishDate.replace(/\-/g, "/"));
|
||||
return (parseInt(eddt - stdt) / 1000 / 60).toFixed(2);
|
||||
default:
|
||||
return '未完成';
|
||||
}
|
||||
|
||||
return buts;
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("qualityTable");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
})
|
||||
/* var foot ='<div class="modal-footer">'+
|
||||
'<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>'+
|
||||
'</div> ';
|
||||
$("#content").append(foot); */
|
||||
};
|
||||
$(function(){
|
||||
initFun();
|
||||
var foot ='<div class="modal-footer">'+
|
||||
'<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>'+
|
||||
'</div> ';
|
||||
$("#content").append(foot);
|
||||
})
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog modal-lg" id="sub">
|
||||
<div class="modal-content" id="content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">设备指标详情</h4>
|
||||
</div>
|
||||
<div class="modal-body" >
|
||||
<!--tab导航栏 -->
|
||||
<div class="nav-tabs-custom">
|
||||
|
||||
<ul class="nav nav-tabs" id="myTab">
|
||||
<li><a href="#tab1" data-toggle="tab" index="0"
|
||||
onclick="">经济指标</a></li>
|
||||
<li><a href="#efficiencyTab" data-toggle="tab" index="1"
|
||||
onclick="">效率指标</a></li>
|
||||
<li><a href="#qualityTab" data-toggle="tab" index="2" onclick="">质量指标</a>
|
||||
</li>
|
||||
<!-- <li><a href="#evaluateTab" data-toggle="tab" index="3" onclick="">口碑评价</a>
|
||||
</li>
|
||||
<li><a href="#rankTab" data-toggle="tab" index="4" onclick="">得分走势</a></li>
|
||||
-->
|
||||
<!-- 选择设备 -->
|
||||
<div class="form-group form-inline pull-right" >
|
||||
<label class="form-label">选择设备:</label>
|
||||
<input id="equipid" name="equipmentId" type="hidden" value="${param.id}" />
|
||||
<input class="form-control" autocomplete="off" id="equipname" name="equipname"
|
||||
style="height:34px; width:200px" onclick="selectEquipmentCard()" placeholder="点击选择设备" value="${param.name}">
|
||||
<!-- <button class="btn btn-default" onclick="dosearch();"><i class="fa fa-search"></i></button> -->
|
||||
</div>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content no-padding">
|
||||
<!-- Morris chart - Sales -->
|
||||
<!--设备经济指标tab -->
|
||||
<div class="tab-pane" id="tab1" style="position: relative; padding:5px;height:1000px]">
|
||||
<div style="margin-top:30px;" class="col-lg-6 col-xs-12"
|
||||
id="div2">
|
||||
<div class="col-lg-12 col-xs-12 ">
|
||||
<label class="form-label" style="font-size:30px">经济得分</label> <span
|
||||
id="economicScoreId"
|
||||
style="color:#0000FF;font-size:30px;margin-left:50px"></span>
|
||||
</div>
|
||||
<div class="col-lg-12 col-xs-12 ">
|
||||
<div class="col-lg-3 col-xs-3">
|
||||
<label style="font-size:20px">LCC =</label>
|
||||
</div>
|
||||
<div class="col-lg-6 col-xs-7">
|
||||
<input type="text" class="form-control" id="LCC" name=""
|
||||
value="${LCC}" readonly>
|
||||
</div>
|
||||
<div class="col-lg-1 col-xs-1">
|
||||
<label>元</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-12 col-xs-12" style="margin-top:20px">
|
||||
<label style="color:#A9A9A9;">生命周期成本LCC=投资成本IC+运行故障成本(OC+FC)+报废成本DC</label>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-12 col-xs-12 " style="margin-top:20px">
|
||||
<div class="col-lg-4 col-xs-4">
|
||||
<label class="form-label" style="text-align:left">前期管理费</label>
|
||||
</div>
|
||||
<div class="col-lg-7 col-xs-6" style="text-align:left">
|
||||
<input type="text" class="form-control" id="purchaseMoney" name=""
|
||||
value="${purchaseMoney}" style="text-align:center" readonly>
|
||||
</div>
|
||||
<div class="col-lg-1 col-xs-1">
|
||||
<label>元</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-12 col-xs-12 " style="margin-top:20px">
|
||||
<div class="col-lg-4 col-xs-4" style="text-align:left">
|
||||
<label class="form-label">运行维修费</label>
|
||||
</div>
|
||||
<div class="col-lg-7 col-xs-6" style="text-align:left">
|
||||
<input type="text" class="form-control" id="runMoney" name=""
|
||||
value="${runMoney}" style="text-align:center"
|
||||
readonly>
|
||||
</div>
|
||||
<div class="col-lg-1 col-xs-1">
|
||||
<label>元</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-12 col-xs-12 " style="margin-top:20px">
|
||||
<div class="col-lg-4 col-xs-4" style="text-align:left">
|
||||
<label class="form-label">轮换报废费</label>
|
||||
</div>
|
||||
<div class="col-lg-7 col-xs-6" style="text-align:left">
|
||||
<input type="text" class="form-control" id="residualMoney" name=""
|
||||
value="${residualMoney}" style="text-align:center" readonly>
|
||||
</div>
|
||||
<div class="col-lg-1 col-xs-1">
|
||||
<label>元</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-12 col-xs-12 " id = "addInput" style="margin-top:20px">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="col-lg-6 col-xs-12" id="div1"
|
||||
style="padding-top:50px"></div>
|
||||
<div class="col-lg-12 col-xs-12" id="faultBox">
|
||||
|
||||
</div>
|
||||
<br />
|
||||
</div>
|
||||
<!-- 效率评分 -->
|
||||
<div class="tab-pane" id="efficiencyTab" style="position: relative; padding:5px;">
|
||||
<div class="form-group" style="margin-top:30px;height:45px">
|
||||
<label class="col-lg-4 col-xs-12 control-label" style="font-size:30px">效率得分</label>
|
||||
<div class="col-lg-8 col-xs-12">
|
||||
<label id="effiScoreId" style="color:#0000FF;font-size:30px"></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" style="height:40px;margin-left:10px">
|
||||
<label class="col-lg-4 col-xs-12 control-label" style="font-size:20px">瞬时流量</label>
|
||||
<div class="col-lg-8 col-xs-12">
|
||||
<label id="" style="font-size:20px;font-weight:bold" >${equipmentProp.instantFlow} m3/h</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" style="height:40px;margin-left:10px">
|
||||
<label class="col-lg-4 col-xs-12 control-label" style="font-size:20px">运行总时间</label>
|
||||
<div class="col-lg-8 col-xs-12">
|
||||
<label id="" style="font-size:20px;font-weight:bold" >${equipmentProp.runTime} h</label>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<!--<table id="efficiencyTable"></table>-->
|
||||
</div>
|
||||
<div class="tab-pane" id="qualityTab" style="position: relative; padding:5px;">
|
||||
<div class="form-group" style="margin-top:30px;height:45px">
|
||||
<label class="col-lg-4 col-xs-12 control-label" style="font-size:30px">质量得分</label>
|
||||
<div class="col-lg-8 col-xs-12">
|
||||
<label id="qualScoreId" style="color:#0000FF;font-size:30px"></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" style="height:40px;margin-left:10px">
|
||||
<label class="col-lg-3 col-xs-12 control-label" style="font-size:20px">故障次数</label>
|
||||
<div class="col-lg-9 col-xs-12">
|
||||
<label id="" style="font-size:20px;font-weight:bold" >${equipmentProp.faultNumber}次</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" style="height:40px;margin-left:10px">
|
||||
<label class="col-lg-3 col-xs-12 control-label" style="font-size:20px">完好率</label>
|
||||
<div class="col-lg-9 col-xs-12">
|
||||
<label id="" style="font-size:20px;font-weight:bold">${equipmentProp.intactRate}%</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" style="height:40px;margin-left:10px">
|
||||
<label class="col-lg-3 col-xs-12 control-label" style="font-size:20px">维修次数累计</label>
|
||||
<div class="col-lg-9 col-xs-12">
|
||||
<splabelan id="" style="font-size:20px;font-weight:bold">${equipmentProp.repairNumber}次</label>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<table id="qualityTable"></table>
|
||||
</div>
|
||||
|
||||
<!-- 口碑评分 -->
|
||||
<div class="tab-pane" id="evaluateTab" style="position: relative; padding:5px;">
|
||||
<div class="form-group col-lg-4" style="margin-top:30px;width:300px;height:60px">
|
||||
<label class="col-sm-4 control-label"
|
||||
style="color:#0000FF;font-size:40px;font-weight: unset">4.9</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="col-xs-12">
|
||||
<label id="star"></label>
|
||||
</div>
|
||||
<div class="col-xs-12">
|
||||
<label style="color:#95ACC5;font-size: 20px">40384人评价</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="starBarDiv" style="height:200px;width:350px"></div>
|
||||
<div class="form-group col-lg-12 col-xs-12" style="margin-left:10px;margin-top:50px">
|
||||
<div class="col-sm-3 col-xs-12">
|
||||
<label class=" control-label" style="font-size:20px">评价详情</label>
|
||||
</div>
|
||||
<div class="col-sm-9 col-xs-12">
|
||||
<div class="btn-group" style="width: 220px;">
|
||||
<button type="button" class="btn btn-default btn-sm" onclick=""><i
|
||||
class="fa fa-plus"></i>添加评价</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--生成区-->
|
||||
<!-- <div class="form-group" style="margin-top:8px;border-top: 1px solid #BBB4BE;">
|
||||
<label></label>
|
||||
</div> -->
|
||||
</div>
|
||||
|
||||
<!-- 排名走势 -->
|
||||
<div class="tab-pane" id="rankTab" style="overflow-x:auto;position: relative; padding:5px;">
|
||||
<br />
|
||||
<div id="rankDiv" style="height:500px;width:850px"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
87
WebRoot/jsp/valueEngineering/energyView.jsp
Normal file
87
WebRoot/jsp/valueEngineering/energyView.jsp
Normal file
@ -0,0 +1,87 @@
|
||||
<%@page import="com.sipai.entity.maintenance.MaintenanceDetail"%>
|
||||
<%@page import="com.sipai.entity.maintenance.MaintenanceCommString"%>
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ 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"%>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
|
||||
$(function() {
|
||||
$("#table_energy").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/valueEngineering/equipmentEvaluate/getEnergyList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20,50], // 设置页面可以显示的数据条数
|
||||
pageSize: 50, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
equipmentId:'${param.equipmentId}'
|
||||
}
|
||||
},
|
||||
sortName: 'insdt', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
title: '序号',//标题 可不加
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter: function (value, row, index){
|
||||
return index+1;
|
||||
}
|
||||
},{
|
||||
field: 'parmvalue', // 返回json数据中的name
|
||||
title: '费用(元)', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'insdt', // 返回json数据中的name
|
||||
title: '日期', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
return value.substring(0,10);
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table_energy");
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
})
|
||||
});
|
||||
</script>
|
||||
<div class="box box-primary" >
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">设备能耗费用</h3>
|
||||
<%-- <div class="pull-right form-inline">
|
||||
<span>增加价值累计</span>
|
||||
<input type="text" class="form-control" style="width:100px" id="increaseValue" name="" value="${increaseValue}" readonly>
|
||||
<span>元</span>
|
||||
</div> --%>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body ">
|
||||
<table id="table_energy"></table>
|
||||
</div>
|
||||
</div>
|
||||
242
WebRoot/jsp/valueEngineering/equipmentCardForEvalueSelect.jsp
Normal file
242
WebRoot/jsp/valueEngineering/equipmentCardForEvalueSelect.jsp
Normal file
@ -0,0 +1,242 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@page import="java.util.Date" %>
|
||||
<%@page import="java.text.SimpleDateFormat" %>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
|
||||
<script type="text/javascript">
|
||||
var checkedItem="";
|
||||
function doselect(status) {
|
||||
if(checkedItem!= null && checkedItem!=""){
|
||||
console.info(status)
|
||||
//选择设备后弹出指标详情页面
|
||||
if(status ==='first'){
|
||||
$.post(ext.contextPath + '/valueEngineering/equipmentEvaluate/viewEconomic.do', {ids:'${ids}',id:checkedItem.id,
|
||||
name:checkedItem.equipmentname}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
closeModal("emSubModal");
|
||||
}else{
|
||||
$('#equipid' ).val(checkedItem.id);
|
||||
$('#equipname').val(checkedItem.equipmentname);
|
||||
$('#processSectionId' ).val(checkedItem.processsectionid);
|
||||
$('#processectionname').val(checkedItem.processSection.name);
|
||||
closeModal("emSubModal");
|
||||
initFun();
|
||||
refreshEquipmentDataFun();
|
||||
}
|
||||
}else{
|
||||
showAlert('d','尚未选择设备!','alertDiv_MaintainPlanSelect');
|
||||
}
|
||||
};
|
||||
var $table;
|
||||
//显示已经勾选的数据
|
||||
function stateFormatter(value, row, index) {
|
||||
var flag=false;
|
||||
if(row.id=='${equipmentId}'){
|
||||
flag=true;
|
||||
checkedItem = row;
|
||||
}
|
||||
if (flag)
|
||||
return {
|
||||
checked : true//设置选中
|
||||
};
|
||||
return value;
|
||||
}
|
||||
var dosearchTable_equ = function() {
|
||||
$("#table_equ").bootstrapTable('refresh');
|
||||
};
|
||||
var companyId = '${param.companyId}';
|
||||
$(function() {
|
||||
|
||||
$("#search_equName").keyup(function(){
|
||||
if (event.keyCode == 13) {
|
||||
event.preventDefault();
|
||||
//回车查询
|
||||
dosearchTable_equ();
|
||||
event.stopPropagation();
|
||||
}
|
||||
})
|
||||
//$("#processSection1").empty();
|
||||
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'});
|
||||
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId:companyId}, function(data) {
|
||||
$("#processSection1").empty();
|
||||
console.info("qq"+companyId)
|
||||
var selelct_ =$("#processSection1").select2({
|
||||
data: data,
|
||||
cache : false,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 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){
|
||||
dosearchTable_equ();
|
||||
});
|
||||
},'json');
|
||||
|
||||
$table = $("#table_equ").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/equipment/getList.do', // 获取表格数据的url
|
||||
clickToSelect:true,
|
||||
singleSelect:true,
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20], // 设置页面可以显示的数据条数
|
||||
pageSize: 20, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
//responseHandler:responseHandler, //在渲染页面数据之前执行的方法,此配置很重要!!!!!!!
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
equipmentName : $('#search_equName').val(),
|
||||
//companyId: companyId,
|
||||
pSectionId: $("#processSection1").val(),
|
||||
checkedIds:'${ids}'
|
||||
}
|
||||
},
|
||||
queryParamsType: "limit",
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
/* onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
viewFun(row.id);
|
||||
}, */
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
formatter: stateFormatter
|
||||
},{
|
||||
field: 'equipmentcardid', // 返回json数据中的name
|
||||
title: '设备编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},/* {
|
||||
field: 'equipmentcardid', // 返回json数据中的name
|
||||
title: '厂内编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, */{
|
||||
field: 'equipmentname', // 返回json数据中的name
|
||||
title: '名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},/* {
|
||||
field: 'company.name', // 返回json数据中的name
|
||||
title: '所属厂区', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, */{
|
||||
field: 'processSection.name', // 返回json数据中的name
|
||||
title: '工艺段', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'equipmentClass.name', // 返回json数据中的name
|
||||
title: '设备类型', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
},{
|
||||
field: 'equipmentTypeNumber.name', // 返回json数据中的name
|
||||
title: '设备型号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
},{
|
||||
field: 'equipmentLevel.levelname', // 返回json数据中的name
|
||||
title: '设备级别', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
},/* {
|
||||
field: 'equipmentstatus', // 返回json数据中的name
|
||||
title: '状态', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
switch (value){
|
||||
case '0' :
|
||||
return "禁用";
|
||||
case '1' :
|
||||
return "启用";
|
||||
default :
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}, */
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table_equ");
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
//绑定选中事件、取消事件、全部选中、全部取消
|
||||
$table.on('check.bs.table check-all.bs.table uncheck.bs.table uncheck-all.bs.table', function (e,rows, obj) {
|
||||
if('check'==e.type){
|
||||
$('#table_equ .checked').removeClass("checked");
|
||||
obj.parent().addClass("checked");
|
||||
checkedItem = rows;
|
||||
}else{
|
||||
obj.parent().removeClass("checked");
|
||||
checkedItem = "";
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<div class="modal fade" id="emSubModal" >
|
||||
<div class="modal-dialog modal-md" >
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">选择设备</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div id="alertDiv_MaintainPlanSelect"></div>
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="menu4SelectDiv"></div>
|
||||
<div id="modal-body">
|
||||
<div class="form-group form-inline" >
|
||||
<div class="form-group form-inline">
|
||||
<div class="form-group ">
|
||||
<label class="form-label">工艺段</label>
|
||||
<select class="form-control select2 " id="processSection1" name ="processSection1" style="width: 220px;"></select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group pull-right" >
|
||||
<div class="input-group input-group-sm pull-left" style="width: 220px;margin-left:10px">
|
||||
<input type="text" id="search_equName" name="search_equName" class="form-control pull-right" placeholder="设备名称">
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-default" onclick="dosearchTable_equ();"><i class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-scrollable">
|
||||
<table class="table table-bordered table-striped" style="overflow:auto;width:100%" id="table_equ"></table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="doselect('${status}')" id="btn_save">确定</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
119
WebRoot/jsp/valueEngineering/equipmentDepreciationAdd.jsp
Normal file
119
WebRoot/jsp/valueEngineering/equipmentDepreciationAdd.jsp
Normal file
@ -0,0 +1,119 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
function dosave() {
|
||||
$('#subForm').data('bootstrapValidator')
|
||||
.updateStatus('equipname', 'NOT_VALIDATED',null)
|
||||
.validateField('equipname');
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/valueEngineering/equipmentDepreciation/save.do", $("#subForm").serialize(), function(data) {
|
||||
if (data.res == 1){
|
||||
closeModal('subModal');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
//输入框验证
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
equipname: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '折旧设备不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
/* yearDepreciationRate: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '年折旧率不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
monthDepreciationRate: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '月折旧率不能为空'
|
||||
}
|
||||
}
|
||||
}, */
|
||||
}
|
||||
});
|
||||
//选择保养的设备,根据厂区id选择厂内设备
|
||||
var selectEquipmentCard = function() {
|
||||
$.post(ext.contextPath + '/equipment/showEquipmentCardForSelect.do', {companyId:'${company.id}', equipmentId:$("#equipid").val()} ,
|
||||
function(data) {
|
||||
$("#emSubDiv").html(data);
|
||||
openModal('emSubModal');
|
||||
});
|
||||
};
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">新增设备折旧</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*所属厂区</label>
|
||||
<div class="col-sm-4">
|
||||
<input name="bizId" id="bizId" type="hidden" value="${company.id}"/>
|
||||
<p class="form-control-static" >${company.name}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*折旧设备</label>
|
||||
<div class="col-sm-4">
|
||||
<input id="equipid" name="equipmentId" type="hidden" value="" />
|
||||
<input class="form-control" id="equipname" name ="equipname" autocomplete="off"
|
||||
onclick="selectEquipmentCard()" placeholder="请点击选择" readonly>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">工艺段</label>
|
||||
<div class="col-sm-4">
|
||||
<input id="processSectionId" name="processSectionId" type="hidden" value="" />
|
||||
<input type="text" class="form-control" id="processectionname" placeholder="工艺段" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="form-group">
|
||||
<label class="col-sm-2 control-label">*年折旧率</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="yearDepreciationRate" name ="yearDepreciationRate" placeholder="年折旧率" min="0" value=0.00 step="0.01" >
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*月折旧率</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="monthDepreciationRate" name ="monthDepreciationRate" placeholder="月折旧率" min="0" value=0.0000 step="0.0001" >
|
||||
</div>
|
||||
</div> -->
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="dosave()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
119
WebRoot/jsp/valueEngineering/equipmentDepreciationEdit.jsp
Normal file
119
WebRoot/jsp/valueEngineering/equipmentDepreciationEdit.jsp
Normal file
@ -0,0 +1,119 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
function doupdate() {
|
||||
$('#subForm').data('bootstrapValidator')
|
||||
.updateStatus('equipname', 'NOT_VALIDATED',null)
|
||||
.validateField('equipname');
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/valueEngineering/equipmentDepreciation/update.do", $("#subForm").serialize(), function(data) {
|
||||
if (data.res == 1){
|
||||
closeModal('subModal');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
//输入框验证
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
equipname: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '折旧设备不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
/* yearDepreciationRate: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '年折旧率不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
monthDepreciationRate: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '月折旧率不能为空'
|
||||
}
|
||||
}
|
||||
}, */
|
||||
}
|
||||
});
|
||||
//选择保养的设备,根据厂区id选择厂内设备
|
||||
var selectEquipmentCard = function() {
|
||||
$.post(ext.contextPath + '/equipment/showEquipmentCardForSelect.do', {companyId:'${equipmentCard.bizid}', equipmentId:$("#equipid").val()} ,
|
||||
function(data) {
|
||||
$("#emSubDiv").html(data);
|
||||
openModal('emSubModal');
|
||||
});
|
||||
};
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">编辑设备折旧</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<input id="id" name="id" type="hidden" value="${equipmentCardProp.id}" />
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*所属厂区</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static" >${equipmentCardProp.company.name}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*折旧设备</label>
|
||||
<div class="col-sm-4">
|
||||
<input id="equipid" name="equipmentId" type="hidden" value="${equipmentCardProp.equipmentId}" />
|
||||
<input class="form-control" id="equipname" name ="equipname" autocomplete="off" value="${equipmentCardProp.equipmentCard.equipmentname}"
|
||||
onclick="selectEquipmentCard()" placeholder="请点击选择" readonly>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">工艺段</label>
|
||||
<div class="col-sm-4">
|
||||
<input id="processSectionId" name="processSectionId" type="hidden" value="${equipmentCardProp.processSectionId}" />
|
||||
<input type="text" class="form-control" id="processectionname" placeholder="工艺段" value="${equipmentCardProp.processSection.name}" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<%-- <div class="form-group">
|
||||
<label class="col-sm-2 control-label">*年折旧率</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="yearDepreciationRate" name ="yearDepreciationRate" placeholder="年折旧率" min="0" value="${equipmentDep.yearDepreciationRate}" step="0.01" >
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*月折旧率</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="monthDepreciationRate" name ="monthDepreciationRate" placeholder="月折旧率" min="0" value="${equipmentDep.monthDepreciationRate}" step="0.0001" >
|
||||
</div>
|
||||
</div> --%>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="doupdate()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
414
WebRoot/jsp/valueEngineering/equipmentDepreciationList.jsp
Normal file
414
WebRoot/jsp/valueEngineering/equipmentDepreciationList.jsp
Normal file
@ -0,0 +1,414 @@
|
||||
<%@page import="com.sipai.tools.CommString"%>
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ 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"%>
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%></title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<!-- bootstrap switch -->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js" charset="utf-8"></script>
|
||||
<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>
|
||||
<script type="text/javascript">
|
||||
var addFun = function() {
|
||||
if (companyId == "") {//获取验证结果,如果成功,执行下面代码
|
||||
showAlert('d','请先选择厂区','mainAlertdiv');
|
||||
}else{
|
||||
$.post(ext.contextPath + '/valueEngineering/equipmentDepreciation/add.do', {companyId:companyId} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
var editFun = function(id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/valueEngineering/equipmentDepreciation/edit.do', {id:id} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
var viewFun = function(id){
|
||||
$.post(ext.contextPath + '/valueEngineering/equipmentDepreciation/view.do', {id:id} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
var deleteFun = function(id) {
|
||||
stopBubbleDefaultEvent();
|
||||
swal({
|
||||
text: "您确定要删除此记录?",
|
||||
dangerMode: true,
|
||||
buttons: {
|
||||
cancel: {
|
||||
text: "取消",
|
||||
value: null,
|
||||
visible: true,
|
||||
className: "btn btn-default btn-sm",
|
||||
closeModal: true,
|
||||
},
|
||||
confirm: {
|
||||
text: "确定",
|
||||
value: true,
|
||||
visible: true,
|
||||
className: "btn btn-danger btn-sm",
|
||||
closeModal: true
|
||||
}
|
||||
}
|
||||
})
|
||||
.then(function(willDelete){
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/valueEngineering/equipmentDepreciation/delete.do', {id : id}, function(data) {
|
||||
if(data==1){
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var deletesFun = function() {
|
||||
var checkedItems = $("#table").bootstrapTable('getSelections');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.id+",";
|
||||
});
|
||||
if(datas==""){
|
||||
showAlert('d','请先选择记录','mainAlertdiv');
|
||||
}else{
|
||||
swal({
|
||||
text: "您确定要删除此记录?",
|
||||
dangerMode: true,
|
||||
buttons: {
|
||||
cancel: {
|
||||
text: "取消",
|
||||
value: null,
|
||||
visible: true,
|
||||
className: "btn btn-default btn-sm",
|
||||
closeModal: true,
|
||||
},
|
||||
confirm: {
|
||||
text: "确定",
|
||||
value: true,
|
||||
visible: true,
|
||||
className: "btn btn-danger btn-sm",
|
||||
closeModal: true
|
||||
}
|
||||
}
|
||||
})
|
||||
.then(function(willDelete) {
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/valueEngineering/equipmentDepreciation/deletes.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
var companyId = "";
|
||||
$(function() {
|
||||
var flag = IsApp();
|
||||
if (flag==true){
|
||||
|
||||
}else{
|
||||
$(".main-header").show();
|
||||
$(".content-header").show();
|
||||
$(".main-footer").show();
|
||||
}
|
||||
//简易公司combotree
|
||||
$.post(ext.contextPath + '/user/getUnitForTree.do', { ng: '' }, function (data) {
|
||||
if (data.length == 1 && !data[0].hasOwnProperty("nodes")) {
|
||||
//当登陆者的pid以下没有子节点时显示单独一个span
|
||||
$("#search_pid").val(data[0].id);
|
||||
$("#companyselect").hide();
|
||||
$("#companyName").text("公司: " + data[0].text);
|
||||
companyId = data[0].id;
|
||||
initFun();
|
||||
} else if ((data.length == 1 && data.nodes != "") || data.length > 1) {
|
||||
//第一次加载时赋值
|
||||
$("#search_pid").val(data[0].id);
|
||||
$("#cname_input").val(data[0].text);
|
||||
companyId = data[0].id;
|
||||
initFun();
|
||||
//$table.bootstrapTable('refresh');//异步加载重新刷新,待修改
|
||||
$('#companytree').treeview({
|
||||
data: data,
|
||||
showBorder: false,
|
||||
levels: 3,
|
||||
});
|
||||
$('#companytree').on('nodeSelected', function (event, data) {
|
||||
$("#search_pid").val(data.id);
|
||||
$("#cname_input").val(data.text);
|
||||
document.getElementById('ul_tree').style.display = "none";
|
||||
companyId= data.id;
|
||||
initFun();
|
||||
});
|
||||
} else {
|
||||
//待完善
|
||||
};
|
||||
}, 'json');
|
||||
//防止点击树的+号收起下拉框
|
||||
$("#ul_tree").on("click", function (e) {
|
||||
event.stopPropagation();
|
||||
});
|
||||
//点击空白隐藏树
|
||||
$(document).click(function (e) {
|
||||
var divTree = $('#ul_tree'); // 设置目标区域
|
||||
if (!divTree.is(e.target) && divTree.has(e.target).length === 0) {
|
||||
divTree.hide()
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
var dosearch = function() {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
};
|
||||
|
||||
var initFun = function(){
|
||||
//选择工艺段
|
||||
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId:companyId}, 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,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||
});
|
||||
selelct_.val('').trigger("change");
|
||||
selelct_.on("change",function(e){
|
||||
dosearch();
|
||||
});
|
||||
},'json');
|
||||
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/valueEngineering/equipmentDepreciation/getList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10,20,50], // 设置页面可以显示的数据条数
|
||||
pageSize: 50, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
companyId:companyId,
|
||||
pSectionId:$('#processSection').val(),
|
||||
search_name: $('#search_name').val()
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
viewFun(row.id);
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
},{
|
||||
field: 'equipmentcardid', // 返回json数据中的name
|
||||
title: '设备编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'equipmentname', // 返回json数据中的name
|
||||
title: '设备名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'equipmentCardProp.purchaseMoney', // 返回json数据中的name
|
||||
title: '设备资产原值(元)', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'equipmentCardProp.yearDepreciationRate', // 返回json数据中的name
|
||||
title: '年折旧率', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) { // 上下居中
|
||||
var str = Number(value*100).toFixed(2);
|
||||
str+="%";
|
||||
return str;
|
||||
}
|
||||
},{
|
||||
field: 'equipmentCardProp.yearDepreciation', // 返回json数据中的name
|
||||
title: '年折旧额(元)', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'equipmentCardProp.monthDepreciationRate', // 返回json数据中的name
|
||||
title: '月折旧率', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter: function (value, row, index) { // 上下居中
|
||||
var str = Number(value*100).toFixed(2);
|
||||
str+="%";
|
||||
return str;
|
||||
}
|
||||
},{
|
||||
field: 'equipmentCardProp.monthDepreciation', // 返回json数据中的name
|
||||
title: '月折旧额(元)', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'equipmentCardProp.totalDepreciation', // 返回json数据中的name
|
||||
title: '累计折旧(元)', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},{
|
||||
field: 'equipmentCardProp.increaseValue', // 返回json数据中的name
|
||||
title: '设备价值增加(元)', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},{
|
||||
field: 'equipmentCardProp.currentValue', // 返回json数据中的name
|
||||
title: '当前价值(元)', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},/* {
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 120, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts= '';
|
||||
buts+= '<security:authorize buttonUrl="valueEngineering/equipmentDepreciation/edit.do">';
|
||||
buts+= '<button class="btn btn-default btn-sm" title="编辑" onclick="editFun(\'' + row.id + '\')"><i class="fa fa-edit"></i><span class="hidden-md hidden-lg"> 编辑</span></button>';
|
||||
buts+= '</security:authorize>';
|
||||
|
||||
buts+= '<security:authorize buttonUrl="valueEngineering/equipmentDepreciation/delete.do">';
|
||||
buts+='<button class="btn btn-default btn-sm" title="删除" onclick="deleteFun(\''+row.id+'\')"><i class="fa fa fa-trash-o"></i><span class="hidden-md hidden-lg">删除</span></button';
|
||||
buts+= '</security:authorize>';
|
||||
|
||||
buts='<div class="btn-group" >'+buts+'</div>';
|
||||
return buts;
|
||||
}
|
||||
} */
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
</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="subDiv"></div>
|
||||
<div id="emSubDiv"></div>
|
||||
<div >
|
||||
<div class="form-group " style="margin-bottom:10px;">
|
||||
<input id="search_pid" name="search_pid" type="hidden" />
|
||||
<span id="companyName" style="height:31px;color:#000000;border-top-left-radius: 4px;border-bottom-left-radius: 4px;font-weight:bold"></span>
|
||||
</div>
|
||||
<ul id="companyselect" style="list-style-type:none;padding-left:0px;width:300px;">
|
||||
<li class="dropdown" style="width:300px;">
|
||||
<!-- Menu toggle button -->
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown"
|
||||
style="width:300px;" onclick="document.getElementById('ul_tree').style.display = 'block';">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon"
|
||||
style="height:31px;color:#000000;border-top-left-radius: 4px;border-bottom-left-radius: 4px;font-weight:bold">公司:</span>
|
||||
<input class="form-control " id="cname_input" name="cname_input"
|
||||
style="height:31px;width: 220px;border-top-right-radius: 4px;border-bottom-right-radius: 4px;"
|
||||
readonly />
|
||||
</div><!-- /input-group -->
|
||||
</a>
|
||||
<ul id="ul_tree" class="dropdown-menu" data-stopPropagation="true">
|
||||
<li class="header">
|
||||
<div id="companytree" style="width: 275px;overflow:auto;"></div>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<%-- <div class="btn-group" style="width: 220px;padding-bottom:10px;">
|
||||
<security:authorize buttonUrl="valueEngineering/equipmentDepreciation/add.do">
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="addFun();"><i class="fa fa-plus"></i> 新增</button>
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="deletesFun();"><i class="fa fa-trash-o"></i> 删除</button>
|
||||
</security:authorize>
|
||||
</div> --%>
|
||||
<div class="form-group form-inline pull-right" style="padding:0;">
|
||||
<label class="form-label">工艺段</label>
|
||||
<select class="form-control select2 " id="processSection" name ="processSection" style="width: 160px;">
|
||||
</select>
|
||||
<div class="form-group" >
|
||||
<div class="input-group input-group-sm" style="width: 250px;">
|
||||
<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>
|
||||
<table id="table"></table>
|
||||
</div>
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include> --%>
|
||||
<%-- <jsp:include page="/jsp/side.jsp"></jsp:include> --%>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
106
WebRoot/jsp/valueEngineering/equipmentDepreciationView.jsp
Normal file
106
WebRoot/jsp/valueEngineering/equipmentDepreciationView.jsp
Normal file
@ -0,0 +1,106 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
$("#monthDepreciationRate").html(Number('${equipmentCard.equipmentCardProp.monthDepreciationRate}'*100).toFixed(2)+"%");
|
||||
$("#monthDepreciation").html(Number('${equipmentCard.equipmentCardProp.monthDepreciation}').toFixed(2));
|
||||
$("#yearDepreciationRate").html(Number('${equipmentCard.equipmentCardProp.yearDepreciationRate}'*100).toFixed(2)+"%");
|
||||
$("#yearDepreciation").html(Number('${equipmentCard.equipmentCardProp.yearDepreciation}').toFixed(2));
|
||||
$("#totalDepreciation").html(Number('${equipmentCard.equipmentCardProp.totalDepreciation}').toFixed(2));
|
||||
$("#currentValue").html(Number('${equipmentCard.equipmentCardProp.currentValue}').toFixed(2));
|
||||
$("#purchaseMoney").html(Number('${equipmentCard.equipmentCardProp.purchaseMoney}').toFixed(2));
|
||||
$("#increaseValue").html(Number('${equipmentCard.equipmentCardProp.increaseValue}').toFixed(2));
|
||||
})
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">查看设备折旧信息</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<input id="id" name="id" type="hidden" value="${equipmentCardProp.id}" />
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">所属厂区</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static" >${equipmentCard.company.name}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">工艺段</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static" >${equipmentCard.processSection.name}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">设备编号</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static" >${equipmentCard.equipmentcardid}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">设备名称</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static" >${equipmentCard.equipmentname}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">设备资产原值(元)</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static" id="purchaseMoney" >${equipmentCardProp.purchaseMoney}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">设备价值增加(元)</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static" id="increaseValue">${equipmentCardProp.increaseValue}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">年折旧率</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static" id="yearDepreciationRate" >${equipmentCardProp.yearDepreciationRate}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">年折旧额(元)</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static" id="yearDepreciation">${equipmentCardProp.yearDepreciation}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">月折旧率</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static" id="monthDepreciationRate">${equipmentCardProp.monthDepreciationRate}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">月折旧额(元)</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static" id="monthDepreciation">${equipmentCardProp.monthDepreciation}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">累计折旧(元)</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static" id="totalDepreciation">${equipmentCardProp.totalDepreciation}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">当前价值(元)</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static" id="currentValue">${equipmentCardProp.currentValue}</p>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
606
WebRoot/jsp/valueEngineering/equipmentEvalueList.jsp
Normal file
606
WebRoot/jsp/valueEngineering/equipmentEvalueList.jsp
Normal file
@ -0,0 +1,606 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ 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"%>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
|
||||
<head>
|
||||
<title><%=ServerObject.atttable.get("TOPTITLE")%></title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<style>
|
||||
.main-header{display:none;}
|
||||
.content-header{display:none;}
|
||||
.main-footer{display:none;}
|
||||
#downloadPDF{display:none;}
|
||||
.CommentPanel {
|
||||
border-radius: 10px;
|
||||
border: 2px solid #426AB2;
|
||||
margin: auto;
|
||||
margin-top: 5px;
|
||||
margin-bottom: 5px;
|
||||
width: 80%;
|
||||
}
|
||||
</style>
|
||||
<!-- bootstrap switch -->
|
||||
<link rel="stylesheet"
|
||||
href="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css" />
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js"
|
||||
charset="utf-8"></script>
|
||||
<!-- 对比构建表格以及线图js -->
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/JS/comparePage.js" charset="utf-8"></script>
|
||||
<!-- 文件上传-->
|
||||
<link rel="stylesheet"
|
||||
href="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/css/fileinput.min.css" />
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/fileinput.min.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/locales/zh.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
//当前日期
|
||||
var mydate = new Date();
|
||||
var nowDate=mydate.toLocaleDateString();
|
||||
//添加对比设备
|
||||
var addFun = function () {
|
||||
var equipmentIds = "";
|
||||
var tabData = $("#" + tabN).bootstrapTable('getData');
|
||||
$.each(tabData, function (index, item) {
|
||||
if (equipmentIds != "") {
|
||||
equipmentIds += ",";
|
||||
}
|
||||
equipmentIds += item.id;
|
||||
});
|
||||
$.post(ext.contextPath + '/valueEngineering/equipmentEvaluate/showEquipmentForEvaluateSelects.do', { companyId: companyId, equipmentIds: equipmentIds }, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('equipment4SelectModal');
|
||||
});
|
||||
};
|
||||
//添加对比设备类型
|
||||
var addCompareFun = function () {
|
||||
/* var equipmentIds = "";
|
||||
var tabData = $("#" + tabN).bootstrapTable('getData');
|
||||
$.each(tabData, function (index, item) {
|
||||
if (equipmentIds != "") {
|
||||
equipmentIds += ",";
|
||||
}
|
||||
equipmentIds += item.id;
|
||||
}); */
|
||||
$.post(ext.contextPath + '/valueEngineering/equipmentEvaluate/addEquipmentClassForCompare.do', {data:JSON.stringify(data),ids:selectEquipmentIds}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
//生成pdf报表
|
||||
var downloadPDF= function () {
|
||||
if(data == null || data == ""){
|
||||
showAlert('d','没有对比数据!','mainAlertdiv');
|
||||
return;
|
||||
}else{
|
||||
var pdfName = "";
|
||||
switch (tabN) {
|
||||
case 'commCompare':
|
||||
pdfName = "综合对比报表";
|
||||
break;
|
||||
case 'economicCompare':
|
||||
pdfName = "经济对比报表";
|
||||
break;
|
||||
case 'efficiencyCompare':
|
||||
pdfName = "效率对比报表";
|
||||
break;
|
||||
case 'qualityCompare':
|
||||
pdfName = "质量对比报表";
|
||||
break;
|
||||
case 'evaluateCompare':
|
||||
pdfName = "口碑对比报表";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
swal({
|
||||
text: "您确定要生成"+pdfName+"?",
|
||||
dangerMode: true,
|
||||
buttons: {
|
||||
cancel: {
|
||||
text: "取消",
|
||||
value: null,
|
||||
visible: true,
|
||||
className: "btn btn-default btn-sm",
|
||||
closeModal: true,
|
||||
},
|
||||
confirm: {
|
||||
text: "确定",
|
||||
value: true,
|
||||
visible: true,
|
||||
className: "btn btn-danger btn-sm",
|
||||
closeModal: true
|
||||
}
|
||||
}
|
||||
}).then(function(willDelete) {
|
||||
if (willDelete) {
|
||||
$("#"+tabN).find("tr:last").hide();//隐藏表格最后一行
|
||||
var tdNumber = document.getElementById(tabN).rows.item(0).cells.length; //列数
|
||||
$("#"+tabN).find("tr").find("td:eq("+tdNumber+")").hide();//隐藏表格最后一列
|
||||
//新增一行表头,用于报表表头
|
||||
var addTr = '<tr id = "titleId"><td colspan="'+tdNumber+'" style="text-align: center; vertical-align: middle;">'+pdfName+'('+nowDate+')</td>';
|
||||
$("#"+tabN).prepend(addTr)
|
||||
//获取表格父级元素id,用于打印的内容
|
||||
var divId = $("#"+tabN).parent().attr('id');
|
||||
var targetDom = $("#"+divId);
|
||||
//把需要导出的pdf内容clone一份,这样对它进行转换、微调等操作时才不会影响原来界面
|
||||
var copyDom = targetDom.clone();
|
||||
//新的div宽高跟原来一样,高度设置成自适应,这样才能完整显示节点中的所有内容(比如说表格滚动条中的内容)
|
||||
copyDom.width(targetDom.width()*1.5 + "px");
|
||||
copyDom.height(targetDom.height() + "px");
|
||||
$('body').append(copyDom);//ps:这里一定要先把copyDom append到body下,不然会导致图标为空
|
||||
//生成导出的表格数据后,去掉增加的行列,使界面恢复原貌
|
||||
$("#"+tabN).find("tr:last").show();//显示最后一行
|
||||
$("#"+tabN).find("tr").find("td:eq("+tdNumber+")").show();//显示最后一列;
|
||||
$("#titleId").remove();
|
||||
// 将 表格 渲染成 canvas
|
||||
html2canvas(copyDom, {
|
||||
background: '#FF1493',
|
||||
onrendered: function (canvas) {
|
||||
var imgData = canvas.toDataURL('image/jpeg',1.0);
|
||||
var img = new Image();
|
||||
img.src = imgData;
|
||||
//根据图片的尺寸设置pdf的规格,要在图片加载成功时执行,之所以要*0.225是因为比例问题
|
||||
img.onload = function () {
|
||||
//此处需要注意,pdf横置和竖置两个属性,需要根据宽高的比例来调整,不然会出现显示不完全的问题
|
||||
if (this.width > this.height) {
|
||||
var doc = new jsPDF('l', 'mm', [this.width * 0.225, this.height * 0.225]);
|
||||
} else {
|
||||
var doc = new jsPDF('p', 'mm', [this.width * 0.225, this.height * 0.225]);
|
||||
}
|
||||
doc.addImage(imgData, 'jpeg', 0, 0, this.width * 0.225, this.height * 0.225);
|
||||
//根据下载保存成不同的文件名
|
||||
doc.save(pdfName+nowDate+'.pdf');
|
||||
};
|
||||
//删除复制出来的div
|
||||
copyDom.remove();
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
//表格加载的数据
|
||||
var data;
|
||||
//查看详情时选中的data序数
|
||||
var viewno;
|
||||
//已选择的设备id
|
||||
var selectEquipmentIds="";
|
||||
//查看详情时的该条评价数据
|
||||
var evaluateObject;
|
||||
//标识当前页面显示的tab
|
||||
var tabN = "commCompare";
|
||||
var tabFun = function (tab) {
|
||||
tabN = tab;
|
||||
finishSelectFun();
|
||||
};
|
||||
//清空
|
||||
var clearAllTable = function () {
|
||||
$('#commCompare').html('<tr><td style="text-align: center; vertical-align: middle;">没有找到匹配的记录</td></tr>');
|
||||
$('#economicCompare').html('<tr><td style="text-align: center; vertical-align: middle;">没有找到匹配的记录</td></tr>');
|
||||
$('#efficiencyCompare').html('<tr><td style="text-align: center; vertical-align: middle;">没有找到匹配的记录</td></tr>');
|
||||
$('#qualityCompare').html('<tr><td style="text-align: center; vertical-align: middle;">没有找到匹配的记录</td></tr>');
|
||||
$('#evaluateCompare').html('<tr><td style="text-align: center; vertical-align: middle;">没有找到匹配的记录</td></tr>');
|
||||
};
|
||||
//选择设备后的数据赋值给当前表格
|
||||
var finishSelectFun = function () {
|
||||
if (data != null && data != "") {
|
||||
switch (tabN) {
|
||||
case 'commCompare':
|
||||
$('#commCompare').html("");//清空内容
|
||||
buildCommCompareTable(data);//构建表格
|
||||
break;
|
||||
case 'economicCompare':
|
||||
$('#economicCompare').html("");//清空内容
|
||||
buildEconCompareTable(data);//构建表格
|
||||
break;
|
||||
case 'efficiencyCompare':
|
||||
$('#efficiencyCompare').html("");//清空内容
|
||||
buildEffiCompareTable(data);//构建表格
|
||||
break;
|
||||
case 'qualityCompare':
|
||||
$('#qualityCompare').html("");//清空内容
|
||||
buildQualCompareTable(data);//构建表格
|
||||
break;
|
||||
case 'evaluateCompare':
|
||||
//$('#evaluateCompare').html("");//清空内容
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
//对比查看详情界面,先选择设备,再弹出设备指标详情页面
|
||||
var viewDetailFun = function (i) {
|
||||
viewno = i;
|
||||
//console.log(data[0]);
|
||||
$.post(ext.contextPath + '/valueEngineering/equipmentEvaluate/showEquipmentCardForEvalueSelect.do', {equipmentData : JSON.stringify(data[i]),companyId:companyId}, function (data) {
|
||||
$("#emSubDiv").html(data);
|
||||
openModal('emSubModal');
|
||||
});
|
||||
};
|
||||
|
||||
var companyId = "";
|
||||
var starArray = [[4.4, 3.2, 2.9], [4.4, 3.2, 2.9], [4.4, 3.2, 2.9]];
|
||||
$(function () {
|
||||
var flag = IsApp();
|
||||
if (flag==true){
|
||||
|
||||
}else{
|
||||
$(".main-header").show();
|
||||
$(".content-header").show();
|
||||
$(".main-footer").show();
|
||||
$("#downloadPDF").show();
|
||||
}
|
||||
$.post(ext.contextPath + "/user/getSearchBizsByUserId4Select.do", {}, function (data) {
|
||||
var selelct = $("#search_code").select2({
|
||||
data: data,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo) { return repo.text; }, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) { return repo.text; } // 函数用于呈现当前的选择
|
||||
});
|
||||
selelct.on("change", function (e) {
|
||||
|
||||
});
|
||||
if (data.length == 1) {
|
||||
//选择厂区为一个厂时隐藏选择框
|
||||
selelct.val(data[0].id).trigger("change");
|
||||
companyId = data[0].id;
|
||||
$("#search_code").next().css("display", "none");
|
||||
$("#company").text($("#search_code").text());
|
||||
} else {
|
||||
selelct.val("").trigger("change");
|
||||
$("#company").css("display", "none");
|
||||
};
|
||||
$(".select2-selection--single").css({ 'height': '30px', 'paddingTop': '4px' });
|
||||
}, 'json');
|
||||
for (var i = 0; i < 3; i++) {
|
||||
for (var j = 0; j < 2; j++) {
|
||||
$('#star' + i + j).rater('', { style: 'inline', curvalue: starArray[i][j] });
|
||||
}
|
||||
}
|
||||
$('#inline1').rater('', { style: 'inline', curvalue: 3.2 });
|
||||
})
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<!-- 引用top -->
|
||||
<%--<jsp:include page="/jsp/side.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="subDiv"></div>
|
||||
<div id="menu4SelectDiv"></div>
|
||||
<div id="emSubDiv"></div>
|
||||
<div id="maintainDiv"></div>
|
||||
<div>
|
||||
<!--<div class="form-group form-inline">
|
||||
<div class="form-group">
|
||||
<label class="form-label" id="companylabel">水厂:</label>
|
||||
<label class="form-label" id="company"
|
||||
style="width:180px;border: none;background: transparent;"></label>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<select class="form-control select2 " id="search_code" name="search_code"
|
||||
style="width: 220px;"></select>
|
||||
</div>
|
||||
</div>-->
|
||||
<div class="form-group" style="padding:0;">
|
||||
<div class="btn-group" style="width: 220px;padding-bottom:10px;">
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="addCompareFun();"><i
|
||||
class="fa fa-plus"></i>添加对比</button>
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="downloadPDF();" id="downloadPDF"><i
|
||||
class="fa fa-file-pdf-o"></i>生成报表</button>
|
||||
<!-- <button type="button" class="btn btn-default btn-sm" onclick="deletesFun();"><i class="fa fa-trash-o"></i> 删除</button> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="nav-tabs-custom">
|
||||
<ul class="nav nav-tabs" id="compareTab">
|
||||
<li class="active"><a href="#commCompareTab" data-toggle="tab" index="0"
|
||||
onclick="tabFun('commCompare')">综合对比</a></li>
|
||||
<li><a href="#economicCompareTab" data-toggle="tab" index="1"
|
||||
onclick="tabFun('economicCompare')">经济对比</a></li>
|
||||
<li><a href="#efficiencyCompareTab" data-toggle="tab" index="2"
|
||||
onclick="tabFun('efficiencyCompare')">效率对比</a></li>
|
||||
<li><a href="#qualityCompareTab" data-toggle="tab" index="3"
|
||||
onclick="tabFun('qualityCompare')">质量对比</a></li>
|
||||
<!-- <li><a href="#evaluateCompareTab" data-toggle="tab" index="4"
|
||||
onclick="tabFun('evaluateCompare')">口碑对比</a></li> -->
|
||||
</ul>
|
||||
<div class="tab-content no-padding">
|
||||
<!-- Morris chart - Sales -->
|
||||
<div class="tab-pane active" id="commCompareTab" style="position: relative; padding:5px;">
|
||||
<table id="commCompare" class="table table-hover table-striped" style="width:100%;background-color: #FCFCFC">
|
||||
<tr>
|
||||
<td style="text-align: center; vertical-align: middle;">请添加对比条件</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="tab-pane" id="economicCompareTab" style="position: relative; padding:5px;">
|
||||
<table id="economicCompare" class="table table-hover table-striped" style="width:100%;background-color:#FCFCFC">
|
||||
<tr>
|
||||
<td style="text-align: center; vertical-align: middle;">请添加对比条件</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="tab-pane" id="efficiencyCompareTab" style="position: relative; padding:5px;">
|
||||
<table id="efficiencyCompare" class="table table-hover table-striped" style="width:100%;background-color:#FCFCFC">
|
||||
<tr>
|
||||
<td style="text-align: center; vertical-align: middle;">请添加对比条件</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="tab-pane" id="qualityCompareTab" style="position: relative; padding:5px;">
|
||||
<table id="qualityCompare" class="table table-hover table-striped" style="width:100%;background-color:#FCFCFC">
|
||||
<tr>
|
||||
<td style="text-align: center; vertical-align: middle;">请添加对比条件</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="tab-pane" id="evaluateCompareTab" style="position: relative; padding:5px;">
|
||||
<table id="evaluateCompare" class="table table-hover table-striped" style="width:100%;background-color: #FCFCFC">
|
||||
<tr style="width:100%">
|
||||
<th style="background-color:#CCCCCC;text-align: center; vertical-align: middle; ">序号
|
||||
</td>
|
||||
<th style="background-color:#CCCCCC;text-align: center; vertical-align: middle;">1
|
||||
</th>
|
||||
<th style="background-color:#CCCCCC;text-align: center; vertical-align: middle;">2
|
||||
</th>
|
||||
<th style="background-color:#CCCCCC;text-align: center; vertical-align: middle;">3
|
||||
</th>
|
||||
<th style="background-color:#CCCCCC;text-align: center; vertical-align: middle;">4
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="background-color:#CCCCCC;text-align: center; vertical-align: middle;">
|
||||
设备名称
|
||||
</td>
|
||||
<td style="text-align: center; vertical-align: middle;">水泵</td>
|
||||
<td style="text-align: center; vertical-align: middle;">水泵</td>
|
||||
<td style="text-align: center; vertical-align: middle;">水泵</td>
|
||||
<td rowspan="8" style="text-align: center; vertical-align: middle;">
|
||||
<button type="button" class="btn btn-default btn-lg"
|
||||
onclick="addCompareFun();">添加</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="background-color:#CCCCCC;text-align: center; vertical-align: middle;">型号
|
||||
</td>
|
||||
<td style="text-align: center; vertical-align: middle;">SB-1</td>
|
||||
<td style="text-align: center; vertical-align: middle;">SB-1</td>
|
||||
<td style="text-align: center; vertical-align: middle;">SB-1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="background-color:#CCCCCC;text-align: center; vertical-align: middle;">厂家
|
||||
</td>
|
||||
<td style="text-align: center; vertical-align: middle;">西门子</td>
|
||||
<td style="text-align: center; vertical-align: middle;">欧姆龙</td>
|
||||
<td style="text-align: center; vertical-align: middle;">国产</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="background-color:#CCCCCC;text-align: center; vertical-align: middle;">
|
||||
口碑得分
|
||||
</td>
|
||||
<td
|
||||
style="background-color:greenyellow;text-align: center; vertical-align: middle;">
|
||||
8.8</td>
|
||||
<td style="text-align: center; vertical-align: middle;">8.8</td>
|
||||
<td style="text-align: center; vertical-align: middle;">8.2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="background-color:#CCCCCC;text-align: center; vertical-align: middle;">
|
||||
点评标签
|
||||
</td>
|
||||
<td style="text-align: center; vertical-align: middle;">
|
||||
<span class="badge badge-primary">质量好</span>
|
||||
<span class="badge badge-primary">备件不好买</span></td>
|
||||
<td style="text-align: center; vertical-align: middle;">
|
||||
<span class="badge badge-primary">质量好</span></td>
|
||||
<td style="text-align: center; vertical-align: middle;">
|
||||
<span class="badge badge-primary">质量一般</span>
|
||||
<span class="badge badge-primary">备件免费</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="background-color:#CCCCCC;text-align: center; vertical-align: middle;">
|
||||
用户点评
|
||||
</td>
|
||||
<td style="text-align: left; vertical-align: middle;">
|
||||
<div class="CommentPanel">
|
||||
<table>
|
||||
<tr>
|
||||
<td style="width:70%;padding-left:8px;padding-top:3px">
|
||||
<span style="font-size:12px;color:blue">张三</span>
|
||||
</td>
|
||||
<td>
|
||||
<span id="star00"></span>
|
||||
<span
|
||||
style="color:#FFAC2C;font-size:10px;margin-top:3px">3.5</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" style="padding-left:4px;padding:5px 12px 3px 12px">
|
||||
<span>还可以,挺好用,质量好</span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="CommentPanel">
|
||||
<table>
|
||||
<tr>
|
||||
<td style="width:70%;padding-left:8px;padding-top:3px">
|
||||
<span style="font-size:12px;color:blue">李四</span>
|
||||
</td>
|
||||
<td>
|
||||
<span id="star01"></span>
|
||||
<span
|
||||
style="color:#FFAC2C;font-size:10px;margin-top:3px">3.5</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" style="padding-left:4px;padding:5px 12px 3px 12px">
|
||||
<span>关键质量好,不过价格贵了点</span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</td>
|
||||
<td style="text-align: left; vertical-align: middle;">
|
||||
<div class="CommentPanel">
|
||||
<table>
|
||||
<tr>
|
||||
<td style="width:70%;padding-left:8px;padding-top:3px">
|
||||
<span style="font-size:12px;color:blue">张三</span>
|
||||
</td>
|
||||
<td>
|
||||
<span id="star10"></span>
|
||||
<span
|
||||
style="color:#FFAC2C;font-size:10px;margin-top:3px">3.5</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" style="padding-left:4px;padding:5px 12px 3px 12px">
|
||||
<span>还可以,挺好用,质量好</span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="CommentPanel">
|
||||
<table>
|
||||
<tr>
|
||||
<td style="width:70%;padding-left:8px;padding-top:3px">
|
||||
<span style="font-size:12px;color:blue">李四</span>
|
||||
</td>
|
||||
<td>
|
||||
<span id="star11"></span>
|
||||
<span
|
||||
style="color:#FFAC2C;font-size:10px;margin-top:3px">3.5</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" style="padding-left:4px;padding:5px 12px 3px 12px">
|
||||
<span>关键质量好,不过价格贵了点</span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</td>
|
||||
<td style="text-align: left; vertical-align: middle;">
|
||||
<div class="CommentPanel">
|
||||
<table>
|
||||
<tr>
|
||||
<td style="width:70%;padding-left:8px;padding-top:5px">
|
||||
<span style="font-size:12px;color:blue">张三</span>
|
||||
</td>
|
||||
<td>
|
||||
<span id="star20"></span>
|
||||
<span
|
||||
style="color:#FFAC2C;font-size:10px;margin-top:8px">3.5</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" style="padding-left:4px;padding:5px 12px 5px 12px">
|
||||
<span>还可以,挺好用,质量好</span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="CommentPanel">
|
||||
<table>
|
||||
<tr>
|
||||
<td style="width:70%;padding-left:8px;padding-top:3px">
|
||||
<span style="font-size:12px;color:blue">李四</span>
|
||||
</td>
|
||||
<td>
|
||||
<span id="star21"></span>
|
||||
<span
|
||||
style="color:#FFAC2C;font-size:10px;margin-top:3px">3.5</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" style="padding-left:4px;padding:5px 12px 3px 12px">
|
||||
<span>关键质量好,不过价格贵了点</span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td style="background-color:#CCCCCC"></td>
|
||||
<td align="center">
|
||||
<button type="button" class="btn btn-default btn-sm"
|
||||
onclick="viewDetailFun();">查看详情</button>
|
||||
</td>
|
||||
<td align="center">
|
||||
<button type="button" class="btn btn-default btn-sm"
|
||||
onclick="viewDetailFun();">查看详情</button>
|
||||
</td>
|
||||
<td align="center">
|
||||
<button type="button" class="btn btn-default btn-sm"
|
||||
onclick="viewDetailFun();">查看详情</button>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include>
|
||||
<jsp:include page="/jsp/side.jsp"></jsp:include>--%>
|
||||
</div>
|
||||
</body>
|
||||
<!-- 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>
|
||||
<!-- 引入daterangepicker-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/daterangepicker.css" />
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/moment.min.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/daterangepicker.js"
|
||||
charset="utf-8"></script>
|
||||
<!-- 前端表格导出pdf -->
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/jspdf/html2canvas-0.4.1.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/jspdf/jspdf.min.js"
|
||||
charset="utf-8"></script>
|
||||
<!-- 星级评分-->
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/JS/jquery.rater.packed.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/CSS/rater.css" media="screen" />
|
||||
|
||||
</html>
|
||||
176
WebRoot/jsp/valueEngineering/equipmentModelAdd.jsp
Normal file
176
WebRoot/jsp/valueEngineering/equipmentModelAdd.jsp
Normal file
@ -0,0 +1,176 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@page import="com.sipai.tools.CommString"%>
|
||||
<%request.setAttribute("Active_False", CommString.Active_False); %>
|
||||
<%request.setAttribute("Active_True", CommString.Active_True); %>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
var val = 1-parseFloat($("#x1").val())-parseFloat($("#x2").val());
|
||||
$("#x3").val( val.Fix(2));
|
||||
})
|
||||
function dosave() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
setTimeout(function(){
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/valueEngineering/equipmentModel/save.do", $("#subForm").serialize(), function(data) {
|
||||
console.log($("#subForm").serialize());
|
||||
if (data.res == 1){
|
||||
closeModal('subModal');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','保存失败','alertDiv');
|
||||
}else{
|
||||
showAlert('d',data.res,'alertDiv');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}, 100);
|
||||
|
||||
}
|
||||
//输入框验证
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
x1: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '经济指标权重不能为空'
|
||||
},
|
||||
},
|
||||
},
|
||||
x2: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '效率指标权重不能为空'
|
||||
},
|
||||
},
|
||||
},
|
||||
x3: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '质量指标权重不能为空'
|
||||
},
|
||||
},
|
||||
},
|
||||
gama: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '残值率不能为空'
|
||||
},
|
||||
},
|
||||
},
|
||||
param1: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '报警时限(年)不能为空'
|
||||
},
|
||||
},
|
||||
},
|
||||
param2: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '设备物理寿命(年)不能为空'
|
||||
},
|
||||
},
|
||||
},
|
||||
param3: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '设备技术寿命(年)不能为空'
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
function domoney(txtvalue) {
|
||||
var value=1-parseFloat($("#x1").val())-parseFloat($("#x2").val());
|
||||
$("#x3").val(value.toFixed(2));
|
||||
}
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">新增设备评价模型</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*经济指标权重</label>
|
||||
<div class="col-sm-6">
|
||||
<input class="form-control" id="x1" name="x1" type="number" step="0.01" maxlength="4" min="0" value="0.00" onkeyup="domoney(this.value)"
|
||||
onblur="domoney(this.value)">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*效率指标权重</label>
|
||||
<div class="col-sm-6">
|
||||
<input class="form-control" id="x2" name="x2" type="number" step="0.01" min="0" maxlength="4" value="0.00" onkeyup="domoney(this.value)"
|
||||
onblur="domoney(this.value)">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*质量指标权重</label>
|
||||
<div class="col-sm-6">
|
||||
<input class="form-control" id="x3" name="x3" type="number" step="0.01" min="0" maxlength="4">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*残值率</label>
|
||||
<div class="col-sm-6">
|
||||
<input class="form-control" id="gama" name="gama" type="number" value="0.05" min="0" type="text" step="0.01" maxlength="4">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*报警时限(年)</label>
|
||||
<div class="col-sm-6">
|
||||
<input class="form-control" id="param1" name="param1" type="number" min="0" value="0" type="text" step="0.1" maxlength="4">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*设备物理寿命(年)</label>
|
||||
<div class="col-sm-6">
|
||||
<input class="form-control" id="param2" name="param2" type="number" min="0" value="0" type="text" step="0.1" maxlength="4">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*设备技术寿命(年)</label>
|
||||
<div class="col-sm-6">
|
||||
<input class="form-control" id="param3" name="param3" type="number" min="0" value="0" type="text" step="0.1" maxlength="4">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">状态</label>
|
||||
<div class="col-sm-6">
|
||||
<select id= "status" name="status" class="form-control select2">
|
||||
<option value="${Active_True}">启用</option>
|
||||
<option value="${Active_False}">禁用</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default " data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="dosave()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
304
WebRoot/jsp/valueEngineering/equipmentModelEdit.jsp
Normal file
304
WebRoot/jsp/valueEngineering/equipmentModelEdit.jsp
Normal file
@ -0,0 +1,304 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@page import="com.sipai.tools.CommString"%>
|
||||
<%@page import="com.sipai.entity.valueEngineering.EquipmentModel"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%request.setAttribute("Active_False", CommString.Active_False); %>
|
||||
<%request.setAttribute("Active_True", CommString.Active_True); %>
|
||||
<%request.setAttribute("Flag_Reset_Param1", EquipmentModel.Flag_Reset_Param1); %>
|
||||
<%request.setAttribute("Flag_Reset_Param2", EquipmentModel.Flag_Reset_Param2); %>
|
||||
<%request.setAttribute("Flag_Reset_Param3", EquipmentModel.Flag_Reset_Param3); %>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
//初始化启用状态选择框
|
||||
var refreshActiveSelect = function() {
|
||||
var select = $("#status").select2({
|
||||
data: null,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
});
|
||||
select.val('${equipmentModel.status}').trigger("change");
|
||||
|
||||
};
|
||||
$(function(){
|
||||
refreshActiveSelect();
|
||||
})
|
||||
function doupdate() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
setTimeout(function(){
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/valueEngineering/equipmentModel/update.do",$("#subForm").serialize(), function(data) {
|
||||
console.log($("#subForm").serialize());
|
||||
if (data.res == 1){
|
||||
closeModal('subModal');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','保存失败','alertDiv');
|
||||
}else{
|
||||
showAlert('d',data.res,'alertDiv');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}, 100);
|
||||
|
||||
}
|
||||
//残值率重置
|
||||
function doresetGama() {
|
||||
var flag = $("#gama").data("flag");
|
||||
var value = $("#gama").val();
|
||||
var id = $("#id").val();
|
||||
setTimeout(function(){
|
||||
showAlert('s','正在重置','alertDiv');
|
||||
$.post(ext.contextPath + "/valueEngineering/equipmentModel/reset.do", {flag:flag,id:id,value:value}, function(data) {
|
||||
console.log($("#subForm").serialize());
|
||||
|
||||
if (data.res == 1){
|
||||
/* closeModal('subModal');
|
||||
$("#table").bootstrapTable('refresh'); */
|
||||
$.post(ext.contextPath + "/valueEngineering/equipmentModel/update.do",$("#subForm").serialize(), function(data) {
|
||||
console.log($("#subForm").serialize());
|
||||
if (data.res == 1){
|
||||
closeModal('subModal');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','保存失败','alertDiv');
|
||||
}else{
|
||||
showAlert('d',data.res,'alertDiv');
|
||||
}
|
||||
},'json');
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','重置失败','alertDiv');
|
||||
}else{
|
||||
showAlert('d',data.res,'alertDiv');
|
||||
}
|
||||
},'json');
|
||||
}, 100);
|
||||
}
|
||||
//设备物理寿命设置
|
||||
function doresetParam2() {
|
||||
var flag = $("#param2").data("flag");
|
||||
var value = $("#param2").val();
|
||||
var id = $("#id").val();
|
||||
setTimeout(function(){
|
||||
showAlert('s','正在重置','alertDiv');
|
||||
$.post(ext.contextPath + "/valueEngineering/equipmentModel/reset.do", {flag:flag,id:id,value:value}, function(data) {
|
||||
console.log($("#subForm").serialize());
|
||||
if (data.res == 1){
|
||||
/* closeModal('subModal');
|
||||
$("#table").bootstrapTable('refresh'); */
|
||||
$.post(ext.contextPath + "/valueEngineering/equipmentModel/update.do",$("#subForm").serialize(), function(data) {
|
||||
console.log($("#subForm").serialize());
|
||||
if (data.res == 1){
|
||||
closeModal('subModal');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','保存失败','alertDiv');
|
||||
}else{
|
||||
showAlert('d',data.res,'alertDiv');
|
||||
}
|
||||
},'json');
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','重置失败','alertDiv');
|
||||
}else{
|
||||
showAlert('d',data.res,'alertDiv');
|
||||
}
|
||||
},'json');
|
||||
}, 100);
|
||||
}
|
||||
//设备技术寿命重置
|
||||
function doresetParam3() {
|
||||
var flag = $("#param3").data("flag");
|
||||
var value = $("#param3").val();
|
||||
var id = $("#id").val();
|
||||
setTimeout(function(){
|
||||
showAlert('s','正在重置','alertDiv');
|
||||
$.post(ext.contextPath + "/valueEngineering/equipmentModel/reset.do", {flag:flag,id:id,value:value}, function(data) {
|
||||
console.log($("#subForm").serialize());
|
||||
if (data.res == 1){
|
||||
/* closeModal('subModal');
|
||||
$("#table").bootstrapTable('refresh'); */
|
||||
$.post(ext.contextPath + "/valueEngineering/equipmentModel/update.do",$("#subForm").serialize(), function(data) {
|
||||
console.log($("#subForm").serialize());
|
||||
if (data.res == 1){
|
||||
closeModal('subModal');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','保存失败','alertDiv');
|
||||
}else{
|
||||
showAlert('d',data.res,'alertDiv');
|
||||
}
|
||||
},'json');
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','重置失败','alertDiv');
|
||||
}else{
|
||||
showAlert('d',data.res,'alertDiv');
|
||||
}
|
||||
},'json');
|
||||
}, 100);
|
||||
}
|
||||
//输入框验证
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
x1: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '经济指标权重不能为空'
|
||||
},
|
||||
},
|
||||
},
|
||||
x2: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '效率指标权重不能为空'
|
||||
},
|
||||
},
|
||||
},
|
||||
x3: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '质量指标权重不能为空'
|
||||
},
|
||||
},
|
||||
},
|
||||
gama: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '残值率不能为空'
|
||||
},
|
||||
},
|
||||
},
|
||||
param1: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '报警时限(年)不能为空'
|
||||
},
|
||||
},
|
||||
},
|
||||
param2: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '设备技术寿命(年)不能为空'
|
||||
},
|
||||
},
|
||||
},
|
||||
param3: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '设备技术寿命(年)不能为空'
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
function domoney(txtvalue) {
|
||||
var value=1-parseFloat($("#x1").val())-parseFloat($("#x2").val());
|
||||
$("#x3").val(value.toFixed(2));
|
||||
}
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">编辑设备评价模型</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<input class="form-control" name="id" type="hidden" value="${equipmentModel.id }">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*经济指标权重</label>
|
||||
<div class="col-sm-6">
|
||||
<input class="form-control" id="x1" name="x1" type="number" step="0.01" maxlength="4" value="${equipmentModel.x1 }" min="0" onkeyup="domoney(this.value)"
|
||||
onblur="domoney(this.value)">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*效率指标权重</label>
|
||||
<div class="col-sm-6">
|
||||
<input class="form-control" id="x2" name="x2" type="number" step="0.01" maxlength="4" value="${equipmentModel.x2 }" min="0" onkeyup="domoney(this.value)"
|
||||
onblur="domoney(this.value)">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*质量指标权重</label>
|
||||
<div class="col-sm-6">
|
||||
<input class="form-control" id="x3" name="x3" type="number" step="0.01" maxlength="4" min="0" value="${equipmentModel.x3 }">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*残值率</label>
|
||||
<div class="col-sm-6">
|
||||
<input class="form-control" id="gama" name="gama" type="number" step="0.01" maxlength="4" min="0" data-flag="${Flag_Reset_Param1}" value="${equipmentModel.gama }">
|
||||
</div>
|
||||
<c:if test="${equipmentModel.status == Active_True }">
|
||||
<div class="col-sm-1">
|
||||
<button type="button" class=" btn btn-primary" onclick="doresetGama()" id="btn_save">重置所有设备</button>
|
||||
</div>
|
||||
</c:if>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*报警时限(年)</label>
|
||||
<div class="col-sm-6 ">
|
||||
<input class="form-control " id="param1" name="param1" type="number" step="0.1" maxlength="4" min="0" value="${equipmentModel.param1 }">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*设备物理寿命(年)</label>
|
||||
<div class="col-sm-6 ">
|
||||
<input class="form-control " id="param2" name="param2" type="number" step="0.1" maxlength="4" min="0" data-flag="${Flag_Reset_Param2}" value="${equipmentModel.param2 }">
|
||||
</div>
|
||||
<c:if test="${equipmentModel.status == Active_True }">
|
||||
<div class="col-sm-1">
|
||||
<button type="button" class=" btn btn-primary" onclick="doresetParam2()" id="btn_save">重置所有设备</button>
|
||||
</div>
|
||||
</c:if>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*设备技术寿命(年)</label>
|
||||
<div class="col-sm-6 ">
|
||||
<input class="form-control " id="param3" name="param3" type="number" step="0.1" maxlength="4" min="0" data-flag="${Flag_Reset_Param3}" value="${equipmentModel.param3 }">
|
||||
</div>
|
||||
<c:if test="${equipmentModel.status == Active_True }">
|
||||
<div class="col-sm-1">
|
||||
<button type="button" class=" btn btn-primary" onclick="doresetParam3()" id="btn_save">重置所有设备</button>
|
||||
</div>
|
||||
</c:if>
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">状态</label>
|
||||
<div class="col-sm-6">
|
||||
<select id= "status" name="status" class="form-control select2">
|
||||
<option value="${Active_True}">启用</option>
|
||||
<option value="${Active_False}">禁用</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default " data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="doupdate()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
346
WebRoot/jsp/valueEngineering/equipmentModelList.jsp
Normal file
346
WebRoot/jsp/valueEngineering/equipmentModelList.jsp
Normal file
@ -0,0 +1,346 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ 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"%>
|
||||
<%@page import="com.sipai.tools.CommString"%>
|
||||
<%request.setAttribute("Active_False", CommString.Active_False); %>
|
||||
<%request.setAttribute("Active_True", CommString.Active_True); %>
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%></title>
|
||||
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
var companyId = "";
|
||||
|
||||
var addFun = function() {
|
||||
$.post(ext.contextPath + '/valueEngineering/equipmentModel/add.do', {} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
var editFun = function(id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/valueEngineering/equipmentModel/edit.do', {id:id} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
var viewFun = function(id){
|
||||
$.post(ext.contextPath + '/valueEngineering/equipmentModel/view.do', {id:id} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
var deleteFun = function(id) {
|
||||
stopBubbleDefaultEvent();
|
||||
swal({
|
||||
text: "您确定要删除此记录?",
|
||||
dangerMode: true,
|
||||
buttons: {
|
||||
cancel: {
|
||||
text: "取消",
|
||||
value: null,
|
||||
visible: true,
|
||||
className: "btn btn-default btn-sm",
|
||||
closeModal: true,
|
||||
},
|
||||
confirm: {
|
||||
text: "确定",
|
||||
value: true,
|
||||
visible: true,
|
||||
className: "btn btn-danger btn-sm",
|
||||
closeModal: true
|
||||
}
|
||||
}
|
||||
})
|
||||
.then(willDelete =>{
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/valueEngineering/equipmentModel/delete.do', {id : id}, function(data) {
|
||||
if(data==1){
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
//删除多条资产类型数据
|
||||
var deletesFun = function() {
|
||||
var checkedItems = $("#table").bootstrapTable('getSelections');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.id+",";
|
||||
});
|
||||
if(datas==""){
|
||||
showAlert('d','请先选择记录','mainAlertdiv');
|
||||
}else{
|
||||
swal({
|
||||
text: "您确定要删除此记录?",
|
||||
dangerMode: true,
|
||||
buttons: {
|
||||
cancel: {
|
||||
text: "取消",
|
||||
value: null,
|
||||
visible: true,
|
||||
className: "btn btn-default btn-sm",
|
||||
closeModal: true,
|
||||
},
|
||||
confirm: {
|
||||
text: "确定",
|
||||
value: true,
|
||||
visible: true,
|
||||
className: "btn btn-danger btn-sm",
|
||||
closeModal: true
|
||||
}
|
||||
}
|
||||
})
|
||||
.then(function(willDelete) {
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/valueEngineering/equipmentModel/deletes.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
var dosearch = function() {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
};
|
||||
|
||||
|
||||
|
||||
$(function() {
|
||||
$.post(ext.contextPath + "/user/getSearchBizsByUserId4Select.do", {}, function(data) {
|
||||
if(data.length == 1){
|
||||
//选择厂区为一个厂时隐藏选择框
|
||||
$("#search_code").css("display", "none");
|
||||
$("#company").text(data[0].text);
|
||||
companyId=data[0].id;
|
||||
dosearch();
|
||||
}else{
|
||||
$("#company").css("display", "none");
|
||||
var selelct=$("#search_code").select2({
|
||||
data : data ,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 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");
|
||||
refreshSelect();
|
||||
selelct.on("change",function(e){
|
||||
companyId= $(this).val();
|
||||
dosearch();
|
||||
refreshSelect();
|
||||
});
|
||||
}
|
||||
},'json');
|
||||
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/valueEngineering/equipmentModel/getlist.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20,50], // 设置页面可以显示的数据条数
|
||||
pageSize: 50, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
search_name : $('#search_name').val(),
|
||||
companyId: companyId,
|
||||
}
|
||||
},
|
||||
sortName: 'x1', // 要排序的字段
|
||||
sortOrder: 'asc', // 排序规则
|
||||
onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
viewFun(row.id);
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
},{
|
||||
field: 'x1', // 返回json数据中的name
|
||||
title: '经济指标权重', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'x2', // 返回json数据中的name
|
||||
title: '效率指标权重', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'x3', // 返回json数据中的name
|
||||
title: '质量指标权重', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'gama', // 返回json数据中的name
|
||||
title: '残值率', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'param1', // 返回json数据中的name
|
||||
title: '报警时限(年)', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'param2', // 返回json数据中的name
|
||||
title: '设备物理寿命(年)', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'param3', // 返回json数据中的name
|
||||
title: '设备技术寿命(年)', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'status', // 返回json数据中的name
|
||||
title: '状态', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter: function (value) {
|
||||
if(value == '${Active_True}'){
|
||||
return '启用';
|
||||
}else{
|
||||
return '禁用';
|
||||
}
|
||||
}
|
||||
},{
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 120, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts="";
|
||||
buts+= '<security:authorize buttonUrl="valueEngineering/equipmentModel/edit.do">';
|
||||
buts+= '<button class="btn btn-default btn-sm" title="编辑" onclick="editFun(\'' + row.id + '\')"><i class="fa fa-edit"></i><span class="hidden-md hidden-lg"> 编辑</span></button>';
|
||||
buts+= '</security:authorize>';
|
||||
|
||||
buts+= '<security:authorize buttonUrl="valueEngineering/equipmentModel/delete.do">';
|
||||
buts+='<button class="btn btn-default btn-sm" title="删除" onclick="deleteFun(\''+row.id+'\')"><i class="fa fa fa-trash-o"></i><span class="hidden-md hidden-lg">删除</span></button';
|
||||
buts+= '</security:authorize>';
|
||||
|
||||
buts='<div class="btn-group" >'+buts+'</div>';
|
||||
return buts;
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
|
||||
});
|
||||
</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="subDiv"></div>
|
||||
<div id="mpSubDiv"></div>
|
||||
<div >
|
||||
<!-- <div class="form-group">
|
||||
<label class="form-label" id="companylabel">水厂:</label>
|
||||
<label class="form-label" id="company" style="width:180px;border: none;background: transparent;" ></label>
|
||||
<select class="form-control select2 " id="search_code" name ="search_code" style="width: 220px;"></select>
|
||||
</div> -->
|
||||
<div class="form-group form-inline" style="padding:0;">
|
||||
<div class="form-group form-inline">
|
||||
<div class="form-group form-inline">
|
||||
<div class="btn-group" style="width: 220px;padding-bottom:10px;">
|
||||
<security:authorize buttonUrl="work/scadaPic/add.do">
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="addFun();"><i class="fa fa-plus"></i> 新增</button>
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="deletesFun();"><i class="fa fa-trash-o"></i> 删除</button>
|
||||
</security:authorize>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table id="table"></table>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include> --%>
|
||||
<%-- <jsp:include page="/jsp/side.jsp"></jsp:include> --%>
|
||||
</div>
|
||||
</body>
|
||||
<!-- 文件上传-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/css/fileinput.min.css"/>
|
||||
<%-- <script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/fileinput.min.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/locales/zh.js" charset="utf-8"></script> --%>
|
||||
<script type="text/javascript">
|
||||
document.write("<scr"+"ipt src=\"<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/fileinput.min.js\"></sc"+"ript>")
|
||||
document.write("<scr"+"ipt src=\"<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/locales/zh.js\"></sc"+"ript>")
|
||||
</script>
|
||||
<!-- 引入ChartJS-->
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/chart.js/dist/Chart.min.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/chart.js/dist/Chart.bundle.min.js" charset="utf-8"></script>
|
||||
<!-- 引入daterangepicker-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/daterangepicker.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/moment.min.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/daterangepicker.js" charset="utf-8"></script>
|
||||
<!-- 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>
|
||||
</html>
|
||||
367
WebRoot/jsp/valueEngineering/equipmentStatisticsList.jsp
Normal file
367
WebRoot/jsp/valueEngineering/equipmentStatisticsList.jsp
Normal file
@ -0,0 +1,367 @@
|
||||
<%@page import="com.sipai.entity.equipment.EquipmentCard"%>
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%request.setAttribute("Status_OFF", EquipmentCard.Status_OFF); %>
|
||||
<%request.setAttribute("Status_ON", EquipmentCard.Status_ON); %>
|
||||
<%request.setAttribute("Status_Fault", EquipmentCard.Status_Fault); %>
|
||||
<%@ 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);%>
|
||||
|
||||
<%request.setAttribute("Equipment_Level_All",com.sipai.entity.equipment.EquipmentCommStr.Equipment_Level_All);%>
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%></title>
|
||||
<style type="text/css">
|
||||
.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>
|
||||
<script type="text/javascript">
|
||||
var beginTimeStore2 = '';
|
||||
var endTimeStore2 = '';
|
||||
function initDate2() {
|
||||
//定义locale汉化插件
|
||||
beginTimeStore2 = moment().subtract(6, 'days').format('YYYY-MM-DD');
|
||||
endTimeStore2 = moment().subtract(-1, 'days').format('YYYY-MM-DD');
|
||||
var locale = {
|
||||
"format": 'YYYY-MM-DD',
|
||||
"separator": " ~ ",
|
||||
"applyLabel": "确定",
|
||||
"cancelLabel": "取消",
|
||||
"fromLabel": "起始时间",
|
||||
"toLabel": "结束时间'",
|
||||
"customRangeLabel": "自定义",
|
||||
"weekLabel": "W",
|
||||
"daysOfWeek": ["日", "一", "二", "三", "四", "五", "六"],
|
||||
"monthNames": ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月",
|
||||
"九月", "十月", "十一月", "十二月"],
|
||||
"firstDay": 1
|
||||
};
|
||||
$('#reservationtime2').daterangepicker(
|
||||
{
|
||||
"timePicker": false,
|
||||
"timePicker24Hour": false,
|
||||
"linkedCalendars": false,
|
||||
"autoUpdateInput": false,
|
||||
"timePickerIncrement": 10,
|
||||
"locale": locale,
|
||||
//汉化按钮部分
|
||||
ranges: {
|
||||
'今日': [moment(), moment().subtract(-1, 'days')],
|
||||
'昨日': [moment().subtract(1, 'days'), moment()],
|
||||
'最近7日': [moment().subtract(6, 'days'),
|
||||
moment().subtract(-1, 'days')],
|
||||
'本月': [moment().startOf('month'),
|
||||
moment().endOf('month').subtract(-1, 'days')],
|
||||
'上月': [
|
||||
moment().subtract(1, 'month').startOf('month'),
|
||||
moment().subtract(1, 'month').endOf('month')
|
||||
.subtract(-1, 'days')]
|
||||
},
|
||||
startDate: beginTimeStore2,
|
||||
endDate: endTimeStore2
|
||||
},
|
||||
function (start, end, label) {
|
||||
beginTimeStore2 = start.format(this.locale.format);
|
||||
endTimeStore2 = end.format(this.locale.format);
|
||||
if (!this.startDate) {
|
||||
this.element.val('');
|
||||
|
||||
} else {
|
||||
this.element.val(this.startDate
|
||||
.format(this.locale.format)
|
||||
+ this.locale.separator
|
||||
+ this.endDate.format(this.locale.format));
|
||||
}
|
||||
});
|
||||
$('#reservationtime2').val(
|
||||
beginTimeStore2 + locale.separator + endTimeStore2);
|
||||
//$('#reservationtime2').daterangepicker({autoUpdateInput:false})
|
||||
};
|
||||
|
||||
var dosearch = function () {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
};
|
||||
var ids = "";//选中公司/水厂全局
|
||||
$(function () {
|
||||
initDate2();
|
||||
initTreeView();
|
||||
//设备类型搜索
|
||||
$.post(ext.contextPath + "/equipment/equipmentLevel/getEquipmentLevelForSelect.do", {}, function (data) {
|
||||
data.push({id:"${Equipment_Level_All}",text:"全部"});
|
||||
console.log(data);
|
||||
var select = $("#equipmentlevelid").select2({
|
||||
data: data,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
//minimumResultsForSearch: 10,//数据大于10个启用搜索框
|
||||
formatResult: function formatRepo(repo) { return repo.text; }, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) { return repo.text; } // 函数用于呈现当前的选择
|
||||
});
|
||||
select.val('').trigger("change");
|
||||
fixSelect2ToTool('equipmentlevelid');
|
||||
select.on("change", function (e) {
|
||||
dosearch();
|
||||
});
|
||||
}, 'json');
|
||||
});
|
||||
//表格查询参数
|
||||
function queryParamsFun(params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
ids: ids,
|
||||
equipmentLevelId: $("#equipmentlevelid").val(),
|
||||
stdt: beginTimeStore2,
|
||||
eddt: endTimeStore2,
|
||||
}
|
||||
};
|
||||
//厂区选择后,初始化工艺段,加载表格
|
||||
var initFun = function () {
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/valueEngineering/equipmentEvaluate/getCompanyStatistics.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
||||
pageSize: 50, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: queryParamsFun,
|
||||
columns: [
|
||||
{
|
||||
field: 'company.name', // 返回json数据中的name
|
||||
title: '公司/水厂', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
}, {
|
||||
field: 'insdt', // 返回json数据中的name
|
||||
title: '生成时间', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'equipmentLevel.levelname', // 返回json数据中的name
|
||||
title: '设备等级', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter: function (value, row, index) {
|
||||
//console.log(row);
|
||||
if(row.equipmentLevelId == "${Equipment_Level_All}"){
|
||||
return "全部";
|
||||
}else{
|
||||
return value;
|
||||
}
|
||||
},
|
||||
}, {
|
||||
field: 'totalEquipNum', // 返回json数据中的name
|
||||
title: '设备总台数', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'intactEquipNum', // 返回json数据中的name
|
||||
title: '设备完好台数', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'faultEquipNum', // 返回json数据中的name
|
||||
title: '设备故障次数', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
},{
|
||||
field: 'faultRate', // 返回json数据中的name
|
||||
title: '故障率', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
return (1-row.intactRate) * 100 + "%";
|
||||
},
|
||||
}, {
|
||||
field: 'intactRate', // 返回json数据中的name
|
||||
title: '完好率', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
return value * 100 + "%";
|
||||
},
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
var initTreeView = function () {
|
||||
$.post(ext.contextPath + '/user/getUnitForTree_Selected.do', { ng: '' }, function (data) {
|
||||
$('#companytree').treeview({
|
||||
data: data,
|
||||
showBorder: true,
|
||||
showCheckbox: true,
|
||||
levels: 4,
|
||||
onNodeChecked: function (event, node) { //选中节点
|
||||
var selectNodes = $('#companytree').treeview('getChecked');//获取check子节点
|
||||
for (var i = 0; i < selectNodes.length; i++) {
|
||||
if (selectNodes[i].type == '${UNIT_TYPE_BIZ}') {
|
||||
if (i == 0) {
|
||||
ids = selectNodes[i].id;
|
||||
} else {
|
||||
ids += ',' + selectNodes[i].id;
|
||||
}
|
||||
}
|
||||
}
|
||||
//console.log(ids);
|
||||
dosearch();
|
||||
},
|
||||
onNodeUnchecked: function (event, node) { //取消选中节点
|
||||
var selectNodes = $('#companytree').treeview('getChecked');//获取check子节点;
|
||||
for (var i = 0; i < selectNodes.length; i++) {
|
||||
if (selectNodes[i].type == '${UNIT_TYPE_BIZ}') {
|
||||
if (i == 0) {
|
||||
ids = selectNodes[i].id;
|
||||
} else {
|
||||
ids += ',' + selectNodes[i].id;
|
||||
}
|
||||
}
|
||||
}
|
||||
//当取消最后一个选择时清空ids
|
||||
if(selectNodes.length == 0){
|
||||
ids = "";
|
||||
}
|
||||
//console.log(ids);
|
||||
dosearch();
|
||||
}
|
||||
});
|
||||
initFun();
|
||||
}, 'json');
|
||||
};
|
||||
</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 class="row">
|
||||
<div class="col-md-3">
|
||||
<div class="box box-solid">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">公司列表</h3>
|
||||
</div>
|
||||
<div class="box-body no-padding">
|
||||
<div id="companytree" style="height:550px;overflow:auto; "></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
<!-- <form id="searchForm"> -->
|
||||
<!-- <div class="form-group form-inline">
|
||||
<div class="form-group">
|
||||
<label class="form-label" id="companylabel">水厂:</label>
|
||||
<label class="form-label" id="company" style="width:180px;border: none;background: transparent;" ></label>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<select class="form-control select2 " id="search_code" name ="search_code" style="width: 220px;"></select>
|
||||
</div>-->
|
||||
<!--<div class="form-group " style="margin-bottom:10px;">
|
||||
<input id="search_code" name="search_code" type="hidden" />
|
||||
<span id="companyName" style="width:220px;border: none;background: transparent;"></span>
|
||||
</div> -->
|
||||
<div class="form-group pull-right form-inline">
|
||||
<div class="input-group input-group-sm">
|
||||
<label class="form-label">设备等级:</label>
|
||||
<select class="form-control select2 " id="equipmentlevelid" name="equipmentlevelid"
|
||||
style="width: 160px;"></select>
|
||||
</div>
|
||||
<div class="input-group input-group-sm" >
|
||||
<input type="text" class="form-control " id="reservationtime2" style="width:160px">
|
||||
<div class="input-group-btn pull-left">
|
||||
<button type="button" class="btn btn-default" onclick="dosearch();"><i
|
||||
class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<table id="table"></table>
|
||||
<!-- </form> -->
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include> --%>
|
||||
<%-- <jsp:include page="/jsp/side.jsp"></jsp:include> --%>
|
||||
</div>
|
||||
</body>
|
||||
<%-- <script type="text/javascript">
|
||||
document.write("<scr"+"ipt src=\"<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/fileinput.min.js\">
|
||||
</sc"+"ript>")
|
||||
document.write("<scr"+"ipt src=\"<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/locales/zh.js\">
|
||||
</sc"+"ript>") </script> --%>
|
||||
<!-- 引入ChartJS-->
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/chart.js/dist/Chart.min.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/chart.js/dist/Chart.bundle.min.js"
|
||||
charset="utf-8"></script>
|
||||
<!-- 引入daterangepicker-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/daterangepicker.css" />
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/moment.min.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/daterangepicker.js"
|
||||
charset="utf-8"></script>
|
||||
<!-- 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>
|
||||
<!-- bootstrap switch -->
|
||||
<link rel="stylesheet"
|
||||
href="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css" />
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js"
|
||||
charset="utf-8"></script>
|
||||
|
||||
</html>
|
||||
94
WebRoot/jsp/valueEngineering/increaseValueView.jsp
Normal file
94
WebRoot/jsp/valueEngineering/increaseValueView.jsp
Normal file
@ -0,0 +1,94 @@
|
||||
<%@page import="com.sipai.entity.maintenance.MaintenanceDetail"%>
|
||||
<%@page import="com.sipai.entity.maintenance.MaintenanceCommString"%>
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ 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"%>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
|
||||
$(function() {
|
||||
//关联设备价值增加
|
||||
$("#table_increaseValue").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/equipment/equipmentIncreaseValue/getList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20,50], // 设置页面可以显示的数据条数
|
||||
pageSize: 50, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
equipmentId:'${param.equipmentId}'
|
||||
//search_name : $('#search_name').val(),
|
||||
|
||||
}
|
||||
},
|
||||
sortName: 'insdt', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
/* onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
viewEquipmentCardFun(row.id);
|
||||
}, */
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
},{
|
||||
field: 'equipmentname', // 返回json数据中的name
|
||||
title: '设备名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'increaseValue', // 返回json数据中的name
|
||||
title: '设备价值增加(元)', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'insdt', // 返回json数据中的name
|
||||
title: '日期', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
return value.substring(0,10);
|
||||
/* return '<i class="fa fa-edit" onclick="editFun()(\'' + row.id + '\')></i>'; */
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table_increaseValue");
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
})
|
||||
});
|
||||
</script>
|
||||
<div class="box box-primary" >
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">设备价值增加</h3>
|
||||
<div class="pull-right form-inline">
|
||||
<span>增加价值累计</span>
|
||||
<input type="text" class="form-control" style="width:100px" id="increaseValue" name="" value="${increaseValue}" readonly>
|
||||
<span>元</span>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body ">
|
||||
<table id="table_increaseValue"></table>
|
||||
</div>
|
||||
</div>
|
||||
115
WebRoot/jsp/valueEngineering/maintainView.jsp
Normal file
115
WebRoot/jsp/valueEngineering/maintainView.jsp
Normal file
@ -0,0 +1,115 @@
|
||||
<%@page import="com.sipai.entity.maintenance.MaintenanceDetail"%>
|
||||
<%@page import="com.sipai.entity.maintenance.MaintenanceCommString"%>
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ 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("Status_Finish",MaintenanceDetail.Status_Finish);%>
|
||||
<%request.setAttribute("MAINTENANCE_TYPE_MAINTAIN",MaintenanceCommString.MAINTENANCE_TYPE_MAINTAIN);%>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
|
||||
/* var viewDetailFun = function(id) {
|
||||
$.post(ext.contextPath + '/maintenance/showMaintenanceDetailView.do', {id:id} , function(data) {
|
||||
$("#maintainDiv").html(data);
|
||||
openModal('maintenanceDetailModal');
|
||||
});
|
||||
}; */
|
||||
//计算设备总的维护费用
|
||||
/* var getTotalMoney = function(){
|
||||
var checkedItems = $("#maintainTable").bootstrapTable('getData');
|
||||
var totalMoney = 0;
|
||||
$.each(checkedItems, function(index, item){
|
||||
totalMoney=totalMoney+item.actualMoney;
|
||||
});
|
||||
$("#maintainMoney").val(totalMoney);
|
||||
} */
|
||||
$(function() {
|
||||
$("#maintainTable").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/maintenance/getMaintenanceDetailList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
//pageList: [3,20,50], // 设置页面可以显示的数据条数
|
||||
pageSize: 3, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
//search_code: '${param.companyId}',
|
||||
equipmentId:'${param.equipmentId}',
|
||||
type:'${MAINTENANCE_TYPE_MAINTAIN}',
|
||||
status:'${Status_Finish}'
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
/* onClickRow:function(row){
|
||||
viewDetailFun(row.id);
|
||||
}, */
|
||||
columns: [
|
||||
{
|
||||
title: '序号',//标题 可不加
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter: function (value, row, index) {
|
||||
return index+1;
|
||||
}
|
||||
},{
|
||||
field: 'problemcontent', // 返回json数据中的name
|
||||
title: '保养内容', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'insdt', // 返回json数据中的name
|
||||
title: '时间', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter:function(value,row,index){
|
||||
return value.substring(0,19);
|
||||
}
|
||||
},{
|
||||
field: 'actualMoney', // 返回json数据中的name
|
||||
title: '费用', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("maintainTable");
|
||||
console.info("加载数据成功");
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
})
|
||||
});
|
||||
</script>
|
||||
<div class="box box-primary" >
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">维护履历</h3>
|
||||
<div class="pull-right form-inline">
|
||||
<span>维护费用累计</span>
|
||||
<input type="text" class="form-control" style="width:100px" id="maintainMoney" name="" value="${maintainMoney}" readonly>
|
||||
<span>元</span>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body ">
|
||||
<table id="maintainTable"></table>
|
||||
</div>
|
||||
</div>
|
||||
115
WebRoot/jsp/valueEngineering/repairView.jsp
Normal file
115
WebRoot/jsp/valueEngineering/repairView.jsp
Normal file
@ -0,0 +1,115 @@
|
||||
<%@page import="com.sipai.entity.maintenance.MaintenanceDetail"%>
|
||||
<%@page import="com.sipai.entity.maintenance.MaintenanceCommString"%>
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ 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("Status_Finish",MaintenanceDetail.Status_Finish);%>
|
||||
<%request.setAttribute("MAINTENANCE_TYPE_REPAIR",MaintenanceCommString.MAINTENANCE_TYPE_REPAIR);%>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
|
||||
/* var viewDetailFun = function(id) {
|
||||
$.post(ext.contextPath + '/maintenance/showMaintenanceDetailView.do', {id:id} , function(data) {
|
||||
$("#maintainDiv").html(data);
|
||||
openModal('maintenanceDetailModal');
|
||||
});
|
||||
}; */
|
||||
//计算设备总的维护费用
|
||||
/* var getTotalMoney = function(){
|
||||
var checkedItems = $("#maintainTable").bootstrapTable('getData');
|
||||
var totalMoney = 0;
|
||||
$.each(checkedItems, function(index, item){
|
||||
totalMoney=totalMoney+item.actualMoney;
|
||||
});
|
||||
$("#maintainMoney").val(totalMoney);
|
||||
} */
|
||||
$(function() {
|
||||
$("#repairTable").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/maintenance/getMaintenanceDetailList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
//pageList: [3,20,50], // 设置页面可以显示的数据条数
|
||||
pageSize: 3, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
//search_code: '${param.companyId}',
|
||||
equipmentId:'${param.equipmentId}',
|
||||
type:'${MAINTENANCE_TYPE_REPAIR}',
|
||||
status:'${Status_Finish}'
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
/* onClickRow:function(row){
|
||||
viewDetailFun(row.id);
|
||||
}, */
|
||||
columns: [
|
||||
{
|
||||
title: '序号',//标题 可不加
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter: function (value, row, index) {
|
||||
return index+1;
|
||||
}
|
||||
},{
|
||||
field: 'problemcontent', // 返回json数据中的name
|
||||
title: '维修内容', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'insdt', // 返回json数据中的name
|
||||
title: '时间', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter:function(value,row,index){
|
||||
return value.substring(0,19);
|
||||
}
|
||||
},{
|
||||
field: 'actualMoney', // 返回json数据中的name
|
||||
title: '费用', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("repairTable");
|
||||
console.info("加载数据成功");
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
})
|
||||
});
|
||||
</script>
|
||||
<div class="box box-primary" >
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">维修履历</h3>
|
||||
<div class="pull-right form-inline">
|
||||
<span>维修费用累计</span>
|
||||
<input type="text" class="form-control" style="width:100px" id="maintainMoney" name="" value="${repairMoney}" readonly>
|
||||
<span>元</span>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body ">
|
||||
<table id="repairTable"></table>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user