153 lines
6.6 KiB
Plaintext
153 lines
6.6 KiB
Plaintext
<%@ page language="java" pageEncoding="UTF-8" %>
|
|
|
|
<style type="text/css">
|
|
|
|
</style>
|
|
<script type="text/javascript">
|
|
|
|
var beginTimeStore = '${meterCheck.inputTime}';
|
|
$(function () {
|
|
//定义locale汉化插件
|
|
beginTimeStore=beginTimeStore.substring(0,16);
|
|
// beginTimeStore = moment().format('YYYY-MM-DD HH:mm');
|
|
var locale = {
|
|
"format": 'YYYY-MM-DD HH:mm',
|
|
"separator": " ~ ",
|
|
"applyLabel": "确定",
|
|
"cancelLabel": "取消",
|
|
"fromLabel": "起始时间",
|
|
"toLabel": "结束时间'",
|
|
"customRangeLabel": "自定义",
|
|
"weekLabel": "W",
|
|
"daysOfWeek": ["日", "一", "二", "三", "四", "五", "六"],
|
|
"monthNames": ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
|
|
"firstDay": 1
|
|
};
|
|
$('#inputTime').daterangepicker({
|
|
"timePicker": true,
|
|
"timePicker24Hour": true,
|
|
// "timePickerIncrement": 10,
|
|
"singleDatePicker": true,
|
|
"locale": locale,
|
|
startDate: beginTimeStore,
|
|
}, function (start, end, label) {
|
|
beginTimeStore = start.format(this.locale.format);
|
|
if (!this.startDate) {
|
|
this.element.val('');
|
|
} else {
|
|
this.element.val(this.startDate.format(this.locale.format));
|
|
}
|
|
|
|
});
|
|
$('#inputTime').val(beginTimeStore);
|
|
|
|
$.post(ext.contextPath + '/process/meterCheckLibrary/getSelectJson.do', {
|
|
unitId: '${meterCheck.unitId}'
|
|
}, function (data) {
|
|
var libraryIdselect = $("#libraryId").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;
|
|
} // 函数用于呈现当前的选择
|
|
});
|
|
libraryIdselect.val('${meterCheck.libraryId}').trigger("change");//设置选中
|
|
}, 'json');
|
|
|
|
})
|
|
|
|
function dosave() {
|
|
$("#subEditForm").bootstrapValidator('validate');//提交验证
|
|
if ($("#subEditForm").data('bootstrapValidator').isValid()) {
|
|
//获取验证结果,如果成功,执行下面代码
|
|
$.post(ext.contextPath + "/process/meterCheck/doupdate.do", $("#subEditForm").serialize(), function (data) {
|
|
if (data.res == 1) {
|
|
$("#table").bootstrapTable('refresh');
|
|
closeModal("subModal");
|
|
} else if (data.res == 0) {
|
|
showAlert('d', '保存失败');
|
|
} else {
|
|
showAlert('d', data.res);
|
|
}
|
|
}, 'json');
|
|
}
|
|
}
|
|
|
|
function selectXj() {
|
|
$.post(ext.contextPath + '/timeEfficiency/patrolRecord/selectRecord.do', {
|
|
// mpids: mpids,
|
|
record: '',
|
|
fucname: 'ckPatrolRecordDone'
|
|
}, function (data) {
|
|
$("#xjSelectDiv").html(data);
|
|
openModal('subModalPatrolRecord');
|
|
});
|
|
}
|
|
|
|
function ckPatrolRecordDone(data) {
|
|
data = JSON.parse(data);
|
|
$('#subEditForm #xjId').val(data[0].id);
|
|
$('#subEditForm #xjname').val(data[0].name);
|
|
}
|
|
|
|
</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强制为subEditForm -->
|
|
<form class="form-horizontal" id="subEditForm" autocomplete="off">
|
|
<!-- 界面提醒div强制id为alertDiv -->
|
|
<div id="alertDiv"></div>
|
|
<input type="hidden" name="id" id="id" value="${meterCheck.id}"/>
|
|
<input type="hidden" name="unitId" id="unitId" value="${meterCheck.unitId}"/>
|
|
|
|
<div class="form-group">
|
|
<label class="col-sm-2 control-label">采样值</label>
|
|
<div class="col-sm-4">
|
|
<input type="text" class="form-control" id="inputValue" name="inputValue" placeholder="采样值"
|
|
value="${meterCheck.inputValue}">
|
|
</div>
|
|
<label class="col-sm-2 control-label">采样时间</label>
|
|
<div class="col-sm-4">
|
|
<input type="text" class="form-control" id="inputTime" name="inputTime" placeholder="采样时间">
|
|
</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="libraryId" name="libraryId"
|
|
style="width: 170px;"></select>
|
|
</div>
|
|
<label class="col-sm-2 control-label">巡检任务</label>
|
|
<div class="col-sm-4">
|
|
<input type="hidden" class="form-control" id="xjId" name="xjId" value="${meterCheck.xjId}">
|
|
<input type="text" class="form-control" id="xjname" name="xjname" placeholder="巡检任务" onclick="selectXj();" value="${meterCheck.xjName}">
|
|
</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> |