188 lines
6.8 KiB
Plaintext
188 lines
6.8 KiB
Plaintext
|
|
<%@ page language="java" pageEncoding="UTF-8"%>
|
|||
|
|
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
|||
|
|
<% request.setAttribute("PatrolPlan_Weekly", com.sipai.entity.timeefficiency.TimeEfficiencyCommStr.PatrolPlan_Weekly); %>
|
|||
|
|
<% request.setAttribute("PatrolPlan_Daily", com.sipai.entity.timeefficiency.TimeEfficiencyCommStr.PatrolPlan_Daily); %>
|
|||
|
|
<% request.setAttribute("PatrolPlan_Monthly", com.sipai.entity.timeefficiency.TimeEfficiencyCommStr.PatrolPlan_Monthly); %>
|
|||
|
|
<!-- 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>
|
|||
|
|
<script type="text/javascript">
|
|||
|
|
|
|||
|
|
var equipmentId = '${param.equipmentId}';
|
|||
|
|
var patrolPlanId = '${param.patrolPlanId}';
|
|||
|
|
var unitId = '${param.unitId}';
|
|||
|
|
|
|||
|
|
//获取巡检内容树
|
|||
|
|
$.post(ext.contextPath + "/timeEfficiency/patrolContents/getPatrolContents4Equipment.do",{pid:equipmentId},function(data){
|
|||
|
|
var obj = eval('(' + data + ')');
|
|||
|
|
//console.log(obj);
|
|||
|
|
$('#tree1').treeview({
|
|||
|
|
showCheckbox: true,
|
|||
|
|
data: obj.result,
|
|||
|
|
hierarchicalCheck:true,//级联勾选
|
|||
|
|
onRendered: function(event, nodes) {
|
|||
|
|
setTimeout("selectNodeLeft();","10");
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
//获取填报内容树
|
|||
|
|
$.post(ext.contextPath + "/timeEfficiency/patrolMeasurePointPlan/getMeasurePointByEquipment.do",{equipmentId:equipmentId,unitId:unitId},function(data){
|
|||
|
|
var obj = eval('(' + data + ')');
|
|||
|
|
console.log(obj);
|
|||
|
|
$('#tree2').treeview({
|
|||
|
|
showCheckbox: true,
|
|||
|
|
data: obj.result,
|
|||
|
|
hierarchicalCheck:true,//级联勾选
|
|||
|
|
onRendered: function(event, nodes) {
|
|||
|
|
setTimeout("selectNodeRight();","10");
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
//左边巡检内容的 回显函数
|
|||
|
|
function selectNodeLeft(){
|
|||
|
|
$.post(ext.contextPath + "/timeEfficiency/patrolContentsPlan/getPatrolContentsPlan4Equipment.do",{equipmentId:equipmentId,patrolPlanId:patrolPlanId},function(data){
|
|||
|
|
var obj = eval('(' + data + ')');
|
|||
|
|
for(i = 0, len = obj.result.length; i < len; i++) {
|
|||
|
|
var node =$('#tree1').treeview('findNodes', [obj.result[i], 'id']);
|
|||
|
|
for(var k = 0; k < node.length; k++) {
|
|||
|
|
if(node[k].id == obj.result[i].patrolContentsId){
|
|||
|
|
$('#tree1').treeview('toggleNodeChecked', [ node[k], { silent: true } ]);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//右边填报内容的 回显函数
|
|||
|
|
function selectNodeRight(){
|
|||
|
|
$.post(ext.contextPath + "/timeEfficiency/patrolMeasurePointPlan/getEquipmentMPointByPatrolPlan.do",{unitId:unitId,equipmentId:equipmentId,patrolPlanId:patrolPlanId},function(data){
|
|||
|
|
var obj = eval('(' + data + ')');
|
|||
|
|
console.log(obj);
|
|||
|
|
for(i = 0, len = obj.result.length; i < len; i++) {
|
|||
|
|
var node =$('#tree2').treeview('findNodes', [obj.result[i].mPoint.id, 'id']);
|
|||
|
|
console.log(node);
|
|||
|
|
for(var k = 0; k < node.length; k++) {
|
|||
|
|
if(node[k].id == obj.result[i].mPoint.id){
|
|||
|
|
$('#tree2').treeview('toggleNodeChecked', [ node[k], { silent: true } ]);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// $('#tree2').treeview({
|
|||
|
|
// data: getTree(), // 获取数据节点
|
|||
|
|
// levels: 5,//节点层级数
|
|||
|
|
// color: "#000",//每一级通用的 节点字体颜色
|
|||
|
|
// backColor: "#fff",//每一级通用的 节点字背景色
|
|||
|
|
// onhoverColor: "orange",//选中浮动颜色
|
|||
|
|
// borderColor: "red",//设置组件的边框颜色; 设置showBorder为false,如果你不想要一个可见的边框
|
|||
|
|
// showBorder: false,
|
|||
|
|
// showTags: true,//是否在每个节点的右侧显示标签。 其值必须在每个节点的数据结构中提供
|
|||
|
|
// highlightSelected: true,//是否突出显示选定的节点
|
|||
|
|
// selectedColor: "#fff",//设置选定节点的前景色
|
|||
|
|
// selectedBackColor: "darkorange",//设置选定节点的背景色
|
|||
|
|
// showCheckbox: true,//选择框显示
|
|||
|
|
// onNodeChecked: nodeChecked,
|
|||
|
|
// onNodeUnchecked: nodeUnchecked
|
|||
|
|
// });
|
|||
|
|
|
|||
|
|
function doupdateforconfigure(){
|
|||
|
|
var checkedtree1 = $('#tree1').treeview('getChecked');
|
|||
|
|
var params = [];
|
|||
|
|
var datas="";
|
|||
|
|
$.each(checkedtree1,function(index,item){
|
|||
|
|
datas+=item.id+",";
|
|||
|
|
var param = {};
|
|||
|
|
param.id = item.id;
|
|||
|
|
param.text = item.text;
|
|||
|
|
param.type = item.type;
|
|||
|
|
if(item.data != undefined){
|
|||
|
|
param.data = item.data;
|
|||
|
|
}
|
|||
|
|
params.push(param);
|
|||
|
|
});
|
|||
|
|
// $.post(ext.contextPath + "/timeEfficiency/patrolContentsPlan/saveByPatrolPlan.do", {jsonStr: JSON.stringify(params),patrolPlanId:patrolPlanId,equipmentCardId:equipmentCardId},
|
|||
|
|
// function(data){
|
|||
|
|
|
|||
|
|
// });
|
|||
|
|
$.ajax({
|
|||
|
|
url: ext.contextPath + "/timeEfficiency/patrolContentsPlan/saveEquipmetPatrolContentsByPatrolPlan.do",
|
|||
|
|
type: "post",
|
|||
|
|
data: {"ids": datas,"patrol_plan_id":patrolPlanId,"equipment_id":equipmentId},
|
|||
|
|
dataType: "json",
|
|||
|
|
async:false,
|
|||
|
|
success: function (data) {
|
|||
|
|
//alert('保存成功!');
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
var checkedtree2 = $('#tree2').treeview('getChecked');
|
|||
|
|
var params2 = "";
|
|||
|
|
$.each(checkedtree2,function(index,item){
|
|||
|
|
params2+=item.id;
|
|||
|
|
params2+=",";
|
|||
|
|
});
|
|||
|
|
$.post(ext.contextPath + "/timeEfficiency/patrolMeasurePointPlan/saveEquipmentMPointByPatrolPlan.do", {ids:params2,patrol_plan_id:patrolPlanId,equipment_id:equipmentId,unitId:unitId},function(data){
|
|||
|
|
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
closeModal('subModalConfigure')
|
|||
|
|
$("#table_patrolPoint").bootstrapTable('refresh');
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
</script>
|
|||
|
|
|
|||
|
|
<div class="modal fade" id="subModalConfigure">
|
|||
|
|
<div class="modal-dialog modal-lg">
|
|||
|
|
<div class="modal-content">
|
|||
|
|
<div class="modal-header">
|
|||
|
|
|
|||
|
|
<!-- <form class="form-horizontal" id="treeStr" enctype="multipart/form-data">
|
|||
|
|
<input name="jsonStr" id="jsonStr" type="hidden" value="" />
|
|||
|
|
</form> -->
|
|||
|
|
|
|||
|
|
<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 class="col-sm-12">
|
|||
|
|
<div class="col-sm-6">
|
|||
|
|
巡检内容
|
|||
|
|
</div>
|
|||
|
|
<div class="col-sm-6">
|
|||
|
|
填报内容
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="col-sm-12">
|
|||
|
|
<div class="col-sm-6">
|
|||
|
|
<div id="tree1"></div>
|
|||
|
|
</div>
|
|||
|
|
<div class="col-sm-6">
|
|||
|
|
<div id="tree2"></div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="col-sm-12">
|
|||
|
|
|
|||
|
|
</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="doupdateforconfigure()" id="btn_save">保存</button>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<!-- /.modal-content -->
|
|||
|
|
</div>
|
|||
|
|
<!-- /.modal-dialog -->
|
|||
|
|
</div>
|