275 lines
9.9 KiB
Plaintext
275 lines
9.9 KiB
Plaintext
|
|
<%@ 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>
|
|||
|
|
<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 doEditMPoint = function () {
|
|||
|
|
var allTableData = $("#table_mPoint").bootstrapTable('getData');
|
|||
|
|
var mPointIds = "";
|
|||
|
|
$.each(allTableData, function (index, item) {
|
|||
|
|
if (mPointIds != "") {
|
|||
|
|
mPointIds += ",";
|
|||
|
|
}
|
|||
|
|
mPointIds += item.mPoint.mpointcode;
|
|||
|
|
})
|
|||
|
|
$.post(ext.contextPath + '/work/mpoint/patroPointMPointForSelect.do', {
|
|||
|
|
mPointIds: mPointIds,
|
|||
|
|
bizId: '${param.bizId}', processSectionId: $('#processSectionId').val()
|
|||
|
|
}, function (data) {
|
|||
|
|
$("#subDiv_PatroPoint").html(data);
|
|||
|
|
openModal('patroPointModal');
|
|||
|
|
});
|
|||
|
|
};
|
|||
|
|
var doFinishSelectMPoint = function (data) {
|
|||
|
|
$.post(ext.contextPath + '/timeEfficiency/patrolPoint/updateMPoints.do', {
|
|||
|
|
patrolPointId: '${patrolPointId}',
|
|||
|
|
mPointIds: data
|
|||
|
|
}, function (data) {
|
|||
|
|
if (data.res) {
|
|||
|
|
doRefreshMPoints();
|
|||
|
|
}
|
|||
|
|
}, 'json');
|
|||
|
|
};
|
|||
|
|
var doRefreshMPoints = function () {
|
|||
|
|
$("#table_mPoint").bootstrapTable('refresh');
|
|||
|
|
};
|
|||
|
|
//设备页面跳转
|
|||
|
|
var doEditEquipmentCard = function () {
|
|||
|
|
var allTableData = $("#table_equipmentCard").bootstrapTable('getData');
|
|||
|
|
var equipmentCardIds = "";
|
|||
|
|
$.each(allTableData, function (index, item) {
|
|||
|
|
if (equipmentCardIds != "") {
|
|||
|
|
equipmentCardIds += ",";
|
|||
|
|
}
|
|||
|
|
equipmentCardIds += item.equipmentCard.id;
|
|||
|
|
})
|
|||
|
|
$.post(ext.contextPath + '/equipment/patroPointEquipmentCardForSelect.do', {
|
|||
|
|
equipmentCardIds: equipmentCardIds,
|
|||
|
|
bizId: '${param.bizId}', processSectionId: $('#processSectionId').val()
|
|||
|
|
}, function (data) {
|
|||
|
|
$("#subDiv_PatroPoint").html(data);
|
|||
|
|
openModal('patroPointModal');
|
|||
|
|
});
|
|||
|
|
};
|
|||
|
|
var doFinishSelectEquipmentCard = function (data) {
|
|||
|
|
$.post(ext.contextPath + '/timeEfficiency/patrolPoint/updateEquipmentCards.do', {
|
|||
|
|
patrolPointId: '${patrolPointId}',
|
|||
|
|
equipmentCardIds: data
|
|||
|
|
}, function (data) {
|
|||
|
|
if (data.res) {
|
|||
|
|
doRefreshEquipmentCards();
|
|||
|
|
}
|
|||
|
|
}, 'json');
|
|||
|
|
};
|
|||
|
|
var doRefreshEquipmentCards = function () {
|
|||
|
|
$("#table_equipmentCard").bootstrapTable('refresh');
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
function dosave() {
|
|||
|
|
$('#subForm').data('bootstrapValidator')
|
|||
|
|
.updateStatus('areaName', 'NOT_VALIDATED', null)
|
|||
|
|
.validateField('areaName');
|
|||
|
|
$("#subForm").bootstrapValidator('validate');//提交验证
|
|||
|
|
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
|||
|
|
$.post(ext.contextPath + "/timeEfficiency/patrolPoint/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: {
|
|||
|
|
name: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '名称不能为空'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
processSectionId: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '所属工艺段不能为空'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
areaName: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '所在区域不能为空'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
patrolContent: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '巡检内容不能为空'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
//获取巡检区域
|
|||
|
|
var selectAreaFun = function () {
|
|||
|
|
$.post(ext.contextPath + '/timeEfficiency/patrolPoint/selectAreaLayer.do', {
|
|||
|
|
|
|||
|
|
}, function (data) {
|
|||
|
|
$("#areaSubDiv").html(data);
|
|||
|
|
openModal('areaSubModal');
|
|||
|
|
});
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
$(function () {
|
|||
|
|
//获取工艺段
|
|||
|
|
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId: '${param.bizId}'}, function (data) {
|
|||
|
|
$("#processSectionId").empty();
|
|||
|
|
var selelct_ = $("#processSectionId").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('${patrolPoint.processSectionId}').trigger("change");
|
|||
|
|
}, 'json');
|
|||
|
|
|
|||
|
|
//任务属性
|
|||
|
|
var selelct_pointCode = $("#pointCode").select2({
|
|||
|
|
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
|||
|
|
});
|
|||
|
|
selelct_pointCode.val('${patrolPoint.pointCode}').trigger("change");
|
|||
|
|
|
|||
|
|
//启用状态
|
|||
|
|
var selelct_active = $("#active").select2({
|
|||
|
|
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
|||
|
|
});
|
|||
|
|
selelct_active.val('${patrolPoint.active}').trigger("change");
|
|||
|
|
|
|||
|
|
})
|
|||
|
|
</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" enctype="multipart/form-data">
|
|||
|
|
<!-- 界面提醒div强制id为alertDiv -->
|
|||
|
|
<div id="alertDiv"></div>
|
|||
|
|
<input name="id" type="hidden" value="${patrolPoint.id}"/>
|
|||
|
|
<input name="bizId" type="hidden" value="${patrolPoint.bizId}"/>
|
|||
|
|
<input name="unitId" type="hidden" value="${patrolPoint.bizId}"/>
|
|||
|
|
<input name="type" type="hidden" value="S"/>
|
|||
|
|
<input type="hidden" class="form-control" id="status" name="status" value="${Status_Edit}">
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">*名称</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<input type="text" id="name" name="name" class="form-control pull-right" placeholder="名称" value="${patrolPoint.name}">
|
|||
|
|
</div>
|
|||
|
|
<label class="col-sm-2 control-label">所属厂区</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<input type="text" id="companyName" name="companyName" class="form-control pull-right"
|
|||
|
|
placeholder="所属厂区"
|
|||
|
|
value="${companyName}" readonly="true"></input>
|
|||
|
|
</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="processSectionId" name="processSectionId"
|
|||
|
|
style="width: 100%"></select>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<label class="col-sm-2 control-label">*所在区域</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<input type="text" class="form-control" id="areaName" name="areaName"
|
|||
|
|
onclick="selectAreaFun()" placeholder="点击选择" value="${areaName}">
|
|||
|
|
<input type="hidden" class="form-control" id="areaId" name="areaId" value="${patrolPoint.areaId}">
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">*巡检内容</label>
|
|||
|
|
<div class="col-sm-10">
|
|||
|
|
<textarea class="form-control" rows="3" id="patrolContent" name="patrolContent"
|
|||
|
|
placeholder="巡检内容...">${patrolPoint.patrolContent}</textarea>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">任务属性</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<select type="text" id="pointCode" style="width: 100%;" name="pointCode">
|
|||
|
|
<option value="0">区域点</option>
|
|||
|
|
<option value="1">安全用具</option>
|
|||
|
|
<option value="2">消防器具</option>
|
|||
|
|
</select>
|
|||
|
|
</div>
|
|||
|
|
<label class="col-sm-2 control-label">启用状态</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<select type="text" id="active" style="width: 100%;" name="active">
|
|||
|
|
<option value="1">启用</option>
|
|||
|
|
<option value="0">禁用</option>
|
|||
|
|
</select>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">备注</label>
|
|||
|
|
<div class="col-sm-10">
|
|||
|
|
<textarea class="form-control" rows="3" id="remark" name="remark"
|
|||
|
|
placeholder="备注...">${patrolPoint.remark}</textarea>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</form>
|
|||
|
|
|
|||
|
|
</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="dosave()">保存</button>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<!-- /.modal-content -->
|
|||
|
|
</div>
|
|||
|
|
<!-- /.modal-dialog -->
|
|||
|
|
</div>
|