217 lines
8.3 KiB
Plaintext
217 lines
8.3 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 patrolPointId = '${param.patrolPointId}';
|
|
var patrolPlanId = '${param.patrolPlanId}';
|
|
var unitId = '${param.unitId}';
|
|
|
|
//获取巡检内容树
|
|
$.post(ext.contextPath + "/timeEfficiency/patrolContents/getPatrolContents.do", {pid: patrolPointId}, function (data) {
|
|
var obj = eval('(' + data + ')');
|
|
// console.log(obj.result.length == 0);
|
|
|
|
var dataStr = obj.result;
|
|
if(obj.result.length == 0){
|
|
dataStr = '无巡检内容,可在 “巡检内容” 菜单中进行配置 ';
|
|
layer.msg(dataStr, {
|
|
offset: '10', //上边距
|
|
});
|
|
}else{
|
|
$('#tree1').treeview({
|
|
showCheckbox: true,
|
|
data: dataStr,
|
|
hierarchicalCheck: true,//级联勾选
|
|
onRendered: function (event, nodes) {
|
|
setTimeout("selectNodeLeft();", "10");
|
|
},
|
|
onNodeSelected: function (event, data) { // 选中事件
|
|
//点击显示巡检内容详情
|
|
layer.open({
|
|
type: 0,
|
|
title: '巡检内容详情',
|
|
shadeClose: true,//是否点击区域外关闭
|
|
offset: '200px',
|
|
closeBtn: 0,//是否显示关闭按钮
|
|
content: data.contentsDetail
|
|
});
|
|
},
|
|
onNodeUnselected: function (event, data) { // 取消选中事件
|
|
|
|
}
|
|
});
|
|
}
|
|
});
|
|
|
|
|
|
//获取填报内容树
|
|
$.post(ext.contextPath + "/timeEfficiency/patrolMeasurePointPlan/getMeasurePointByPatrolPoint.do", {
|
|
patrolPointId: patrolPointId,
|
|
unitId: unitId
|
|
}, function (data) {
|
|
var obj = eval('(' + data + ')');
|
|
|
|
var dataStr = obj.result;
|
|
if(obj.result.length == 0){
|
|
dataStr = '无填报内容,可在 “巡检点” 菜单中 “编辑页面” 进行关联巡检点 ';
|
|
layer.msg(dataStr, {
|
|
offset: '10', //上边距
|
|
});
|
|
}else{
|
|
$('#tree2').treeview({
|
|
showCheckbox: true,
|
|
data: dataStr,
|
|
hierarchicalCheck: true,//级联勾选
|
|
onRendered: function (event, nodes) {
|
|
setTimeout("selectNodeRight();", "10");
|
|
}
|
|
});
|
|
}
|
|
});
|
|
|
|
//左边巡检内容的 回显函数
|
|
function selectNodeLeft() {
|
|
$.post(ext.contextPath + "/timeEfficiency/patrolContentsPlan/getPatrolContentsPlan.do", {
|
|
patrolPointId: patrolPointId,
|
|
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]) {
|
|
$('#tree1').treeview('toggleNodeChecked', [node[k], {silent: true}]);
|
|
}
|
|
}
|
|
}
|
|
});
|
|
}
|
|
|
|
//右边填报内容的 回显函数
|
|
function selectNodeRight() {
|
|
$.post(ext.contextPath + "/timeEfficiency/patrolMeasurePointPlan/getMeasurePointByPatrolPlan.do", {
|
|
patrolPointId: patrolPointId,
|
|
patrolPlanId: patrolPlanId,
|
|
unitId: unitId
|
|
}, function (data) {
|
|
var obj = eval('(' + data + ')');
|
|
for (i = 0, len = obj.result.length; i < len; i++) {
|
|
var node = $('#tree2').treeview('findNodes', [obj.result[i], 'id']);
|
|
for (var k = 0; k < node.length; k++) {
|
|
if (node[k].id == obj.result[i]) {
|
|
$('#tree2').treeview('toggleNodeChecked', [node[k], {silent: true}]);
|
|
}
|
|
}
|
|
}
|
|
});
|
|
}
|
|
|
|
function doupdateforconfigure() {
|
|
var checkedtree1 = $('#tree1').treeview('getChecked');
|
|
var params = [];
|
|
$.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);
|
|
});
|
|
|
|
$.ajax({
|
|
url: ext.contextPath + "/timeEfficiency/patrolContentsPlan/saveByPatrolPlan.do",
|
|
type: "post",
|
|
data: {"jsonStr": JSON.stringify(params), "patrolPlanId": patrolPlanId, "patrolPointId": patrolPointId},
|
|
dataType: "json",
|
|
async: false,
|
|
success: function (data) {
|
|
//不刷新避免计算过早 下面保存完填报内容后刷新
|
|
//$("#table_patrolPoint").bootstrapTable('refresh');
|
|
}
|
|
});
|
|
|
|
|
|
var checkedtree2 = $('#tree2').treeview('getChecked');
|
|
var params2 = [];
|
|
$.each(checkedtree2, function (index, item) {
|
|
var param2 = {};
|
|
param2.id = item.id;
|
|
param2.text = item.text;
|
|
param2.type = item.type;
|
|
if (item.data != undefined) {
|
|
param2.data = item.data;
|
|
}
|
|
params2.push(param2);
|
|
});
|
|
|
|
$.ajax({
|
|
url: ext.contextPath + "/timeEfficiency/patrolMeasurePointPlan/saveByPatrolPlan.do",
|
|
type: "post",
|
|
data: {
|
|
"jsonStr": JSON.stringify(params2),
|
|
"patrolPlanId": patrolPlanId,
|
|
"patrolPointId": patrolPointId,
|
|
"unitId": unitId
|
|
},
|
|
dataType: "json",
|
|
async: false,
|
|
success: function (data) {
|
|
$("#table_patrolPoint").bootstrapTable('refresh');
|
|
}
|
|
});
|
|
|
|
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">
|
|
<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" style="margin-top: -10px;">
|
|
巡检内容
|
|
</div>
|
|
<div class="col-sm-6" style="margin-top: -10px;">
|
|
填报内容
|
|
</div>
|
|
</div>
|
|
<div class="col-sm-12">
|
|
<div class="col-sm-6" style="margin-top: 10px;">
|
|
<div id="tree1"></div>
|
|
</div>
|
|
<div class="col-sm-6" style="margin-top: 10px;">
|
|
<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>
|
|
</div>
|
|
</div> |