758 lines
35 KiB
Plaintext
758 lines
35 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 doEditPatrolCamera = function() {
|
|||
|
|
var allTableData = $("#table_patrolCamera").bootstrapTable('getData');
|
|||
|
|
var patrolCameraIds="";
|
|||
|
|
$.each(allTableData,function(index,item){
|
|||
|
|
if(patrolCameraIds!=""){
|
|||
|
|
patrolCameraIds+=",";
|
|||
|
|
}
|
|||
|
|
patrolCameraIds+=item.CameraId;
|
|||
|
|
})
|
|||
|
|
$.post(ext.contextPath + '/equipment/showCameraForPatrolPlanSelects.do', {equipmentIds:patrolEquipmentIds,
|
|||
|
|
bizId:'${param.bizId}'} , function(data) {
|
|||
|
|
$("#subDiv_Camera").html(data);
|
|||
|
|
openModal('equipment4SelectModal');
|
|||
|
|
});
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
//配置设备
|
|||
|
|
function doPatrolCamera(){
|
|||
|
|
var allTableData = $("#table_patrolCamera").bootstrapTable('getData');
|
|||
|
|
var cameraIds = "";
|
|||
|
|
$.each(allTableData, function (index, item) {
|
|||
|
|
if (cameraIds != "") {
|
|||
|
|
cameraIds += ",";
|
|||
|
|
}
|
|||
|
|
cameraIds += item.camera.id;
|
|||
|
|
})
|
|||
|
|
$.post(ext.contextPath + '/work/camera/getCameraIdsForSelect.do', {
|
|||
|
|
cameraIds: cameraIds,
|
|||
|
|
bizId: '${patrolPlan.unitId}',processSectionId: ''
|
|||
|
|
}, function (data) {
|
|||
|
|
$("#subDiv_Camera").html(data);
|
|||
|
|
openModal('cameraModal');
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
var doFinishSelectPatrolPoint = function (data) {
|
|||
|
|
// $.post(ext.contextPath + '/timeEfficiency/patrolPlan/updatePatrolPoints.do', {
|
|||
|
|
$.post(ext.contextPath + '/timeEfficiency/patrolPoint/saveRoutePointForPlan.do', {
|
|||
|
|
patrolPlanId: '${patrolPlan.id}',
|
|||
|
|
patrolPointIds: data
|
|||
|
|
}, function (data) {
|
|||
|
|
console.log(data);
|
|||
|
|
if (data.result) {
|
|||
|
|
doRefreshPatrolPoints();
|
|||
|
|
}
|
|||
|
|
}, 'json');
|
|||
|
|
};
|
|||
|
|
var doRefreshPatrolPoints = function () {
|
|||
|
|
$("#table_patrolCamera").bootstrapTable('refresh');
|
|||
|
|
$("#table_patrolPoint").bootstrapTable('refresh');
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
var doEditPatrolPoint = function () {
|
|||
|
|
var allTableData = $("#table_patrolPoint").bootstrapTable('getData');
|
|||
|
|
var patrolPointIds = "";
|
|||
|
|
$.each(allTableData, function (index, item) {
|
|||
|
|
if (patrolPointIds != "") {
|
|||
|
|
patrolPointIds += ",";
|
|||
|
|
}
|
|||
|
|
patrolPointIds += item.patrolPointId;
|
|||
|
|
})
|
|||
|
|
$.post(ext.contextPath + '/timeEfficiency/patrolPoint/patrolPointForSelect.do', {
|
|||
|
|
patrolPointIds: patrolPointIds,
|
|||
|
|
bizId: '${patrolPlan.unitId}',
|
|||
|
|
processSectionId: $('#processSectionId').val(),
|
|||
|
|
patrolType:'${param.patrolType}'
|
|||
|
|
}, function (data) {
|
|||
|
|
$("#subDiv_PatroPoint").html(data);
|
|||
|
|
openModal('patroPointModal');
|
|||
|
|
});
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
//根据工艺段,巡检点选取设备的保存方法
|
|||
|
|
var doFinishSelectEquipment= function(data) {
|
|||
|
|
$.post(ext.contextPath + '/timeEfficiency/patrolPlan/saveCameras.do', {patrolPlanId:'${patrolPlan.id}',
|
|||
|
|
patrolCameraIds:data} , function(data) {
|
|||
|
|
if(data.code){
|
|||
|
|
doRefreshPatrolCameras();
|
|||
|
|
}
|
|||
|
|
},'json');
|
|||
|
|
};
|
|||
|
|
var deletePatrolCameraFun = function (id) {
|
|||
|
|
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 + '/timeEfficiency/patrolPlan/dodeleteCamera.do', {id: id}, function (data) {
|
|||
|
|
var datastr = eval('(' + data + ')');
|
|||
|
|
if (datastr.code == 1) {
|
|||
|
|
$("#table_patrolCamera").bootstrapTable('refresh');
|
|||
|
|
} else {
|
|||
|
|
showAlert('d', '删除失败', 'mainAlertdiv');
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
var deletePatrolPointFun = function (id) {
|
|||
|
|
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 + '/timeEfficiency/patrolPoint/dodelete4PatrolPlan.do', {id: id}, function (data) {
|
|||
|
|
var datastr = eval('(' + data + ')');
|
|||
|
|
if (datastr.code == 1) {
|
|||
|
|
$("#table_patrolPoint").bootstrapTable('refresh');
|
|||
|
|
} else {
|
|||
|
|
showAlert('d', '删除失败', 'mainAlertdiv');
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
//直接选取设备的保存方法
|
|||
|
|
function doFinishSelectCamera() {
|
|||
|
|
var datas = "";
|
|||
|
|
$.each(selectionIds, function (index, item) {
|
|||
|
|
if (datas != "") {
|
|||
|
|
datas += ",";
|
|||
|
|
}
|
|||
|
|
datas += item;
|
|||
|
|
});
|
|||
|
|
$.post(ext.contextPath + '/timeEfficiency/patrolPlan/saveCameras.do', {patrolPlanId:'${patrolPlan.id}',
|
|||
|
|
patrolCameraIds:datas} , function(data) {
|
|||
|
|
if(data.code){
|
|||
|
|
doRefreshPatrolCameras();
|
|||
|
|
}
|
|||
|
|
},'json');
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
var doRefreshPatrolCameras= function() {
|
|||
|
|
$("#table_patrolCamera").bootstrapTable('refresh');
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
function doupdate() {
|
|||
|
|
|
|||
|
|
//保存前先赋值班组
|
|||
|
|
var val = $('#_deptIds').val();
|
|||
|
|
var rolestr = "";
|
|||
|
|
if(val!=null && val!=''){
|
|||
|
|
$.each(val, function (index, value, array) {
|
|||
|
|
if (rolestr != "") {
|
|||
|
|
rolestr += ","
|
|||
|
|
}
|
|||
|
|
rolestr += value;
|
|||
|
|
})
|
|||
|
|
$('#deptIds').val(rolestr);//赋值班组
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
$("#subForm").bootstrapValidator('validate');//提交验证
|
|||
|
|
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
|||
|
|
var param = $("#subForm").serialize() + '&releaseModal=' + releaseModal;
|
|||
|
|
$.post(ext.contextPath + "/timeEfficiency/patrolPlan/update.do", param, 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: {
|
|||
|
|
name: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '名称不能为空'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
duration: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '巡检时长不能为空'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
timeInterval: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '巡检间隔不能为空'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
patrolContent: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '巡检内容不能为空'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
var releaseModal = '${PatrolPlan_Daily}';//默认每日下发
|
|||
|
|
$(function () {
|
|||
|
|
|
|||
|
|
//初始化班组
|
|||
|
|
refreshSelect();
|
|||
|
|
|
|||
|
|
$('#sdt').timepicker({
|
|||
|
|
showMeridian: false
|
|||
|
|
}).on('hide', function (e) {
|
|||
|
|
//当日期选择框关闭时,执行刷新校验
|
|||
|
|
$('#subForm').data('bootstrapValidator')
|
|||
|
|
.updateStatus('sdt', 'NOT_VALIDATED', null)
|
|||
|
|
.validateField('sdt');
|
|||
|
|
});
|
|||
|
|
//日期格式需对齐,不然会不准
|
|||
|
|
$('#edt').timepicker({
|
|||
|
|
showMeridian: false
|
|||
|
|
}).on('hide', function (e) {
|
|||
|
|
//当日期选择框关闭时,执行刷新校验
|
|||
|
|
$('#subForm').data('bootstrapValidator')
|
|||
|
|
.updateStatus('edt', 'NOT_VALIDATED', null)
|
|||
|
|
.validateField('edt');
|
|||
|
|
});
|
|||
|
|
$.post(ext.contextPath + "/timeEfficiency/patrolArea/getPatrolArea4Select.do", { bizId: '${patrolPlan.bizId}' }, function (data) {
|
|||
|
|
var selelct = $("#patrolAreaId").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('${patrolPlan.patrolAreaId}').trigger("change");
|
|||
|
|
fixSelect2ToForm('patrolAreaId');
|
|||
|
|
}, 'json');
|
|||
|
|
$('#colorContainer').colorpicker({ format: null });
|
|||
|
|
|
|||
|
|
$("#weekRegister").select2({
|
|||
|
|
placeholder: '请选择',//默认文字提示
|
|||
|
|
allowClear: true,//允许清空
|
|||
|
|
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
|||
|
|
language: "zh-CN",
|
|||
|
|
minimumInputLength: 0,
|
|||
|
|
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
|||
|
|
multiple: true,
|
|||
|
|
formatResult: function formatRepo(repo) { return repo.text; }, // 函数用来渲染结果
|
|||
|
|
formatSelection: function formatRepoSelection(repo) { return repo.text; } // 函数用于呈现当前的选择
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
//下发模式具体内容控制器
|
|||
|
|
document.getElementById('weekDiv').style.display = 'none';
|
|||
|
|
document.getElementById('monthDiv').style.display = 'none';
|
|||
|
|
$('input[type=radio][name=optionsRadiosinline]').change(function () {
|
|||
|
|
if (this.value == '${PatrolPlan_Weekly}') {
|
|||
|
|
document.getElementById('weekDiv').style.display = 'block';
|
|||
|
|
document.getElementById('monthDiv').style.display = 'none';
|
|||
|
|
releaseModal = '${PatrolPlan_Weekly}';
|
|||
|
|
} else if (this.value == '${PatrolPlan_Monthly}') {
|
|||
|
|
document.getElementById('weekDiv').style.display = 'none';
|
|||
|
|
document.getElementById('monthDiv').style.display = 'block';
|
|||
|
|
releaseModal = '${PatrolPlan_Monthly}';
|
|||
|
|
} else {
|
|||
|
|
document.getElementById('weekDiv').style.display = 'none';
|
|||
|
|
document.getElementById('monthDiv').style.display = 'none';
|
|||
|
|
releaseModal = '${PatrolPlan_Daily}';
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
//下发内容初次加载器
|
|||
|
|
if ("${patrolPlan.releaseModal }" == "${PatrolPlan_Weekly}") {
|
|||
|
|
document.getElementById('weekDiv').style.display = 'block';
|
|||
|
|
document.getElementById('monthDiv').style.display = 'none';
|
|||
|
|
releaseModal = '${PatrolPlan_Weekly}';
|
|||
|
|
$("#weeklyRadio").attr("checked","checked");
|
|||
|
|
$("#dailyRadio").removeAttr("checked");
|
|||
|
|
$("#monthlyRadio").removeAttr("checked");
|
|||
|
|
//周多选框
|
|||
|
|
var weekItems = '${patrolPlan.weekRegister}'.split(',');
|
|||
|
|
$("#weekRegister").val(weekItems).trigger("change");
|
|||
|
|
} else if ("${patrolPlan.releaseModal }" == '${PatrolPlan_Monthly}') {
|
|||
|
|
document.getElementById('weekDiv').style.display = 'none';
|
|||
|
|
document.getElementById('monthDiv').style.display = 'block';
|
|||
|
|
releaseModal = '${PatrolPlan_Monthly}';
|
|||
|
|
$("#monthlyRadio").attr("checked","checked");
|
|||
|
|
$("#dailyRadio").removeAttr("checked");
|
|||
|
|
$("#weeklyRadio").removeAttr("checked");
|
|||
|
|
} else {
|
|||
|
|
document.getElementById('weekDiv').style.display = 'none';
|
|||
|
|
document.getElementById('monthDiv').style.display = 'none';
|
|||
|
|
releaseModal = '${PatrolPlan_Daily}';
|
|||
|
|
$("#dailyRadio").attr("checked","checked");
|
|||
|
|
$("#monthlyRadio").removeAttr("checked");
|
|||
|
|
$("#weeklyRadio").removeAttr("checked");
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
//日期格式需对齐,不然会不准
|
|||
|
|
$("#table_patrolCamera").bootstrapTable({ // 对应table标签的id
|
|||
|
|
url: ext.contextPath + '/timeEfficiency/patrolPlan/getCameras.do', // 获取表格数据的url
|
|||
|
|
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
|||
|
|
striped: true, //表格显示条纹,默认为false
|
|||
|
|
pagination: true, // 在表格底部显示分页组件,默认false
|
|||
|
|
pageList: [10, 20,50], // 设置页面可以显示的数据条数
|
|||
|
|
pageSize: 50, // 页面数据条数
|
|||
|
|
pageNumber: 1, // 首页页码
|
|||
|
|
sidePagination: 'client', // 设置为服务器端分页
|
|||
|
|
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
|||
|
|
return {
|
|||
|
|
rows: params.limit, // 每页要显示的数据条数
|
|||
|
|
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
|||
|
|
sort: params.sort, // 要排序的字段
|
|||
|
|
order: params.order,
|
|||
|
|
patrolPlanId: '${patrolPlan.id}'
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
responseHandler: function(res){
|
|||
|
|
return res.result
|
|||
|
|
},
|
|||
|
|
sortName: 'id', // 要排序的字段
|
|||
|
|
sortOrder: 'desc', // 排序规则
|
|||
|
|
columns: [
|
|||
|
|
{
|
|||
|
|
field: 'name', // 返回json数据中的name
|
|||
|
|
title: '摄像机名称', // 表格表头显示文字
|
|||
|
|
align: 'center', // 左右居中
|
|||
|
|
valign: 'middle',
|
|||
|
|
width: '45%',
|
|||
|
|
formatter: function (value, row, index) {
|
|||
|
|
return row.camera.name;
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
field: 'url', // 返回json数据中的name
|
|||
|
|
title: '摄像机ip', // 表格表头显示文字
|
|||
|
|
align: 'center', // 左右居中
|
|||
|
|
valign: 'middle',
|
|||
|
|
width: '45%',
|
|||
|
|
formatter: function (value, row, index) {
|
|||
|
|
return row.camera.url;
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
title: "操作",
|
|||
|
|
align: 'center',
|
|||
|
|
valign: 'middle',
|
|||
|
|
width: '10%', // 定义列的宽度,单位为像素px
|
|||
|
|
formatter: function (value, row, index) {
|
|||
|
|
var buts = '';
|
|||
|
|
buts += '<button class="btn btn-default btn-sm" onclick="deletePatrolCameraFun(\'' + row.id + '\')" data-toggle="tooltip" title="删除"><i class="fa fa-trash-o "></i><span class="hidden-md hidden-lg"> 删除</span></button>';
|
|||
|
|
buts = '<div class = "btn-group">' + buts + '</div>';
|
|||
|
|
return buts;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
],
|
|||
|
|
onLoadSuccess: function(){ //加载成功时执行
|
|||
|
|
adjustBootstrapTableView("table_patrolCamera");
|
|||
|
|
},
|
|||
|
|
onLoadError: function(){ //加载失败时执行
|
|||
|
|
console.info("加载数据失败");
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
$("#table_patrolPoint").bootstrapTable({ // 对应table标签的id
|
|||
|
|
url: ext.contextPath + '/timeEfficiency/patrolPoint/getPatrolPointForPlan.do', // 获取表格数据的url
|
|||
|
|
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
|||
|
|
striped: true, //表格显示条纹,默认为false
|
|||
|
|
pagination: true, // 在表格底部显示分页组件,默认false
|
|||
|
|
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
|||
|
|
pageSize: 50, // 页面数据条数
|
|||
|
|
pageNumber: 1, // 首页页码
|
|||
|
|
sidePagination: 'client', // 设置为服务器端分页
|
|||
|
|
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
|||
|
|
return {
|
|||
|
|
rows: params.limit, // 每页要显示的数据条数
|
|||
|
|
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
|||
|
|
sort: params.sort, // 要排序的字段
|
|||
|
|
order: params.order,
|
|||
|
|
planId: '${patrolPlan.id}'
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
// responseHandler: function(res){
|
|||
|
|
// return {
|
|||
|
|
// "rows": res.result
|
|||
|
|
// }
|
|||
|
|
// },
|
|||
|
|
responseHandler: function (res) {
|
|||
|
|
return res.result
|
|||
|
|
},
|
|||
|
|
sortName: 'morder', // 要排序的字段
|
|||
|
|
sortOrder: 'asc', // 排序规则
|
|||
|
|
columns: [
|
|||
|
|
{
|
|||
|
|
field: 'name', // 返回json数据中的name
|
|||
|
|
title: '名称', // 表格表头显示文字
|
|||
|
|
align: 'center', // 左右居中
|
|||
|
|
valign: 'middle',
|
|||
|
|
width: '30%',
|
|||
|
|
formatter: function (value, row, index) {
|
|||
|
|
return row.patrolPoint.name;
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
field: 'processSectionName', // 返回json数据中的name
|
|||
|
|
title: '工艺段', // 表格表头显示文字
|
|||
|
|
align: 'center', // 左右居中
|
|||
|
|
valign: 'middle',
|
|||
|
|
width: '20%',
|
|||
|
|
formatter: function (value, row, index) {
|
|||
|
|
if (row.patrolPoint.processSection != null) {
|
|||
|
|
return row.patrolPoint.processSection.sname;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
field: 'equipmentname', // 返回json数据中的name
|
|||
|
|
title: '巡检内容数', // 表格表头显示文字
|
|||
|
|
align: 'center', // 左右居中
|
|||
|
|
valign: 'middle',
|
|||
|
|
width: '15%',
|
|||
|
|
formatter: function (value, row, index) {
|
|||
|
|
return row.patrolContentNum;
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
field: 'equipmentname', // 返回json数据中的name
|
|||
|
|
title: '填报内容数', // 表格表头显示文字
|
|||
|
|
align: 'center', // 左右居中
|
|||
|
|
valign: 'middle',
|
|||
|
|
width: '15%',
|
|||
|
|
formatter: function (value, row, index) {
|
|||
|
|
return row.measurePointContentNum;
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
field: 'patrolAreaFloor', // 返回json数据中的name
|
|||
|
|
title: '楼层', // 表格表头显示文字
|
|||
|
|
align: 'center', // 左右居中
|
|||
|
|
valign: 'middle',
|
|||
|
|
width: '10%',
|
|||
|
|
formatter: function (value, row, index) {
|
|||
|
|
if (row.patrolAreaFloor != null) {
|
|||
|
|
return row.patrolAreaFloor.name;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
title: "操作",
|
|||
|
|
align: 'center',
|
|||
|
|
valign: 'middle',
|
|||
|
|
width: '10%', // 定义列的宽度,单位为像素px
|
|||
|
|
formatter: function (value, row, index) {
|
|||
|
|
var buts = '';
|
|||
|
|
buts += '<button class="btn btn-default btn-sm" onclick="deletePatrolPointFun(\'' + row.id + '\')" data-toggle="tooltip" title="删除"><i class="fa fa-trash-o "></i><span class="hidden-md hidden-lg"> 删除</span></button>';
|
|||
|
|
buts = '<div class = "btn-group">' + buts + '</div>';
|
|||
|
|
return buts;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
],
|
|||
|
|
onLoadSuccess: function () { //加载成功时执行
|
|||
|
|
adjustBootstrapTableView("table_patrolPoint");
|
|||
|
|
},
|
|||
|
|
onLoadError: function () { //加载失败时执行
|
|||
|
|
console.info("加载数据失败");
|
|||
|
|
},
|
|||
|
|
//当拖拽结束后,整个表格的数据
|
|||
|
|
onReorderRow: function (newData) {
|
|||
|
|
//这里的newData是整个表格数据,数组形式
|
|||
|
|
$.post(ext.contextPath + '/timeEfficiency/patrolPoint/dosort.do', {jsondata: JSON.stringify(newData)},
|
|||
|
|
function (data) {
|
|||
|
|
if (data == 1) {
|
|||
|
|
//$("#table").bootstrapTable('refresh');
|
|||
|
|
} else {
|
|||
|
|
showAlert('d', '数据错误', 'mainAlertdiv');
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
})
|
|||
|
|
|
|||
|
|
//弹窗配置巡检内容及填报内容
|
|||
|
|
function configureFun(patrolPlanId,cameraId){
|
|||
|
|
$.post(ext.contextPath + '/timeEfficiency/patrolPlan/configure4Camera.do', {patrolPlanId:patrolPlanId,cameraId:cameraId,unitId:'${patrolPlan.unitId}'}, function (data) {
|
|||
|
|
$("#subDiv_Configure").html(data);
|
|||
|
|
openModal('subModalConfigure');
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//初始化班组
|
|||
|
|
function refreshSelect() {
|
|||
|
|
$.post(ext.contextPath + "/user/getDeptByBizId4Select.do", { companyId: unitId}, function (data) {
|
|||
|
|
var selelct = $("#_deptIds").select2({
|
|||
|
|
data: data,
|
|||
|
|
placeholder: '请选择',//默认文字提示
|
|||
|
|
allowClear: false,//允许清空
|
|||
|
|
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
|||
|
|
language: "zh-CN",
|
|||
|
|
minimumInputLength: 0,
|
|||
|
|
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
|||
|
|
multiple: true,
|
|||
|
|
formatResult: function formatRepo(repo) { return repo.text; }, // 函数用来渲染结果
|
|||
|
|
formatSelection: function formatRepoSelection(repo) { return repo.text; } // 函数用于呈现当前的选择
|
|||
|
|
});
|
|||
|
|
var roleitems = new Array();
|
|||
|
|
var roles = JSON.parse('${patrolPlanDept}');
|
|||
|
|
for (var i = 0; i < roles.length; i++) {
|
|||
|
|
roleitems.push(roles[i].id);
|
|||
|
|
}
|
|||
|
|
selelct.val(roleitems).trigger("change");
|
|||
|
|
}, 'json');
|
|||
|
|
};
|
|||
|
|
</script>
|
|||
|
|
<div class="modal fade" id="subModal">
|
|||
|
|
<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">
|
|||
|
|
<!-- 新增界面formid强制为subForm -->
|
|||
|
|
<form class="form-horizontal" id="subForm">
|
|||
|
|
<!-- 界面提醒div强制id为alertDiv -->
|
|||
|
|
<div id="alertDiv"></div>
|
|||
|
|
<div class="form-group">
|
|||
|
|
<input name="id" type="hidden" value="${patrolPlan.id}" />
|
|||
|
|
<label class="col-sm-2 control-label">*巡检名称</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<input type="text" class="form-control" id="name" name="name" placeholder="名称"
|
|||
|
|
value='${patrolPlan.name}'>
|
|||
|
|
</div>
|
|||
|
|
<label class="col-sm-2 control-label">启用状态</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<select class="form-control select2" id="active" name="active">
|
|||
|
|
<option value="1" <c:if test="${patrolPlan.active}">selected</c:if>>启用</option>
|
|||
|
|
<option value="0" <c:if test="${!patrolPlan.active}">selected</c:if>>停用</option>
|
|||
|
|
</select>
|
|||
|
|
</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="duration" name="duration" min="0" step="5"
|
|||
|
|
placeholder="分钟" value='${patrolPlan.duration}'>
|
|||
|
|
</div>
|
|||
|
|
<label class="col-sm-2 control-label">*巡检间隔/分钟</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<input type="number" class="form-control" id="timeInterval" name="timeInterval" min="0"
|
|||
|
|
step="5" placeholder="分钟" value='${patrolPlan.timeInterval}'>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">每日起始时间</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<input type="text" class="form-control" id="sdt" name="sdt" placeholder="起始时间"
|
|||
|
|
value="${patrolPlan.sdt.substring(11,16) }">
|
|||
|
|
</div>
|
|||
|
|
<label class="col-sm-2 control-label">每日结束时间</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<input type="text" class="form-control" id="edt" name="edt" placeholder="结束时间"
|
|||
|
|
value="${patrolPlan.edt.substring(11,16) }">
|
|||
|
|
</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="_deptIds" name="_deptIds" style="width: 100%;">
|
|||
|
|
</select>
|
|||
|
|
<input type="hidden" name="deptIds" id="deptIds" value="">
|
|||
|
|
</div>
|
|||
|
|
<label class="col-sm-2 control-label">标记颜色</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<div class="input-group " id="colorContainer">
|
|||
|
|
<input name="color" type="text" class="form-control" value="${patrolPlan.color }">
|
|||
|
|
<div class="input-group-addon">
|
|||
|
|
<i></i>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">下发方式</label>
|
|||
|
|
<div class="col-sm-10">
|
|||
|
|
<label class="radio-inline">
|
|||
|
|
<input type="radio" name="optionsRadiosinline" id="dailyRadio"
|
|||
|
|
value="${PatrolPlan_Daily}"> 每日下发
|
|||
|
|
</label>
|
|||
|
|
<label class="radio-inline">
|
|||
|
|
<input type="radio" name="optionsRadiosinline" id="weeklyRadio"
|
|||
|
|
value="${PatrolPlan_Weekly}"> 每周下发
|
|||
|
|
</label>
|
|||
|
|
<label class="radio-inline">
|
|||
|
|
<input type="radio" name="optionsRadiosinline" id="monthlyRadio"
|
|||
|
|
value="${PatrolPlan_Monthly}"> 每月下发
|
|||
|
|
</label>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<!--每周下发方式-->
|
|||
|
|
<div class="form-group" id="weekDiv"
|
|||
|
|
style="border-radius:4px;border:2px solid cadetblue;padding-top:4px;padding-bottom:4px;margin-left:4px;margin-right:4px">
|
|||
|
|
<label class="col-sm-2 control-label">周间隔</label>
|
|||
|
|
<div class="col-sm-2">
|
|||
|
|
<input type="number" class="form-control" id="weekInterval" name="weekInterval"
|
|||
|
|
placeholder="" min="0" value="${patrolPlan.weekInterval }"
|
|||
|
|
style="border-radius:4px;">
|
|||
|
|
</select>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<label class="col-sm-1 control-label">在</label>
|
|||
|
|
<div class="col-sm-7">
|
|||
|
|
<select class="form-control select2" id="weekRegister" name="weekRegister"
|
|||
|
|
style="width:260px;">
|
|||
|
|
<option value="2">周一</option>
|
|||
|
|
<option value="3">周二</option>
|
|||
|
|
<option value="4">周三</option>
|
|||
|
|
<option value="5">周四</option>
|
|||
|
|
<option value="6">周五</option>
|
|||
|
|
<option value="7">周六</option>
|
|||
|
|
<option value="1">周日</option>
|
|||
|
|
</select>
|
|||
|
|
<label class="control-label">按住ctrl多选</label>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<!--每月下发方式-->
|
|||
|
|
<div class="form-group" id="monthDiv"
|
|||
|
|
style="border-radius:4px;border:2px solid rgb(204, 155, 20);padding-top:4px;padding-bottom:4px;margin-left:4px;margin-right:4px">
|
|||
|
|
<label class="col-sm-3 control-label">每月第</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<input type="number" class="form-control" id="monthRegister" name="monthRegister" min="1"
|
|||
|
|
style="border-radius:4px;width:100%;" value="${patrolPlan.monthRegister }">
|
|||
|
|
</select>
|
|||
|
|
</div>
|
|||
|
|
<label class="col-sm-3 control-label" style="text-align: left">天下发</label>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">*巡检内容</label>
|
|||
|
|
<div class="col-sm-10">
|
|||
|
|
<textarea class="form-control" id="patrolContent" name="patrolContent" rows="3"
|
|||
|
|
placeholder="名称">${patrolPlan.patrolContent }</textarea>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</form>
|
|||
|
|
<div class="box box-primary" >
|
|||
|
|
<ul class="nav nav-tabs" role="tablist">
|
|||
|
|
<li role="presentation" class="active"><a href="#camera" role="tab" data-toggle="tab">关联巡检摄像头</a></li>
|
|||
|
|
<li role="presentation"><a href="#point" role="tab" data-toggle="tab">关联巡检点</a></li>
|
|||
|
|
</ul>
|
|||
|
|
<div class="tab-content">
|
|||
|
|
<div role="tabpanel" class="tab-pane active" id="camera">
|
|||
|
|
<div class="box-header with-border">
|
|||
|
|
<div class="box-tools pull-right">
|
|||
|
|
<a onclick="doPatrolCamera()" class="btn btn-box-tool" data-toggle="tooltip" title="关联巡检摄像头"><i class="glyphicon glyphicon-edit"></i></a>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
<div class="box-body ">
|
|||
|
|
<table id="table_patrolCamera"></table>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div role="tabpanel" class="tab-pane" id="point">
|
|||
|
|
<div class="box-header with-border">
|
|||
|
|
<div class="box-tools pull-right">
|
|||
|
|
<a onclick="doEditPatrolPoint()" class="btn btn-box-tool" data-toggle="tooltip"
|
|||
|
|
title="关联巡检点"><i class="glyphicon glyphicon-edit"></i></a>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="box-body ">
|
|||
|
|
<table id="table_patrolPoint" data-use-row-attr-func="true" data-reorderable-rows="true"></table>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<!-- <div class="box-header with-border">
|
|||
|
|
<h3 class="box-title">关联巡检摄像头</h3>
|
|||
|
|
<div class="box-tools pull-right">
|
|||
|
|
<a onclick="doPatrolCamera()" class="btn btn-box-tool" data-toggle="tooltip" title="编辑"><i class="glyphicon glyphicon-edit"></i></a>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
<div class="box-body ">
|
|||
|
|
<table id="table_patrolCamera"></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="doupdate()" id="btn_save">保存</button>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<!-- /.modal-content -->
|
|||
|
|
</div>
|
|||
|
|
<!-- /.modal-dialog -->
|
|||
|
|
</div>
|