first commit
This commit is contained in:
185
WebRoot/jsp/process/libraryProcessManageWorkorderAdd.jsp
Normal file
185
WebRoot/jsp/process/libraryProcessManageWorkorderAdd.jsp
Normal file
@ -0,0 +1,185 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<%@page import="com.sipai.tools.CommString" %>
|
||||
<% request.setAttribute("Flag_Active", CommString.Flag_Active); %>
|
||||
<% request.setAttribute("Flag_Unactive", CommString.Flag_Unactive); %>
|
||||
<style type="text/css">
|
||||
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
|
||||
function dosave() {
|
||||
// $('#subForm').data('bootstrapValidator')
|
||||
// .updateStatus('abnormalName', 'NOT_VALIDATED', null)
|
||||
// .validateField('abnormalName');
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {
|
||||
//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/process/libraryProcessManageWorkorder/dosave.do", $("#subForm").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');
|
||||
}
|
||||
}
|
||||
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
typeId: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '过程控制类别不能为空'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//下拉数据
|
||||
var selectType = $("#libraryProcessManageTypeSelect").select2({minimumResultsForSearch: 10});
|
||||
$.post(ext.contextPath + "/process/libraryProcessManageType/getSelectList.do", {}, function (data) {
|
||||
$("#libraryProcessManageTypeSelect").empty();
|
||||
|
||||
var selelct_ = $("#libraryProcessManageTypeSelect").select2({
|
||||
data: data,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) {
|
||||
return markup;
|
||||
}, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过10个启用搜索框
|
||||
formatResult: function formatRepo(repo) {
|
||||
return repo.text;
|
||||
}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) {
|
||||
return repo.text;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
selelct_.val(data[0].id).trigger("change")
|
||||
}, 'json');
|
||||
|
||||
$("#libraryProcessManageTypeSelect").change(function () {
|
||||
var id = $('#libraryProcessManageTypeSelect').children('option:selected').val();
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: ext.contextPath + "/process/libraryProcessManageType/getSelectList4Id.do",
|
||||
data: {id: id},
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
$('#typeId').val(data[0].id)
|
||||
$('#code').val(data[0].code);
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
$(function(){
|
||||
//安装时间
|
||||
$("#jobDate").datepicker({
|
||||
language: 'zh-CN',
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format:'yyyy-mm-dd',
|
||||
});
|
||||
})
|
||||
|
||||
</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强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm" autocomplete="off">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<input type="hidden" name="id" id="id" value="${id}"/>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*工单号</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="jobNumber" name="jobNumber" placeholder="工单号"
|
||||
value="${jobNumber}" readonly>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*申请日期</label>
|
||||
<div class="col-sm-4">
|
||||
<div class="input-group date">
|
||||
<div class="input-group-addon">
|
||||
<i class="fa fa-calendar"></i>
|
||||
</div>
|
||||
<input type="text" class="form-control" id="jobDate" name="jobDate" style="width: 132px;" value="" placeholder="请选择"/>
|
||||
</div>
|
||||
</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="libraryProcessManageTypeSelect" name="libraryProcessManageTypeSelect"
|
||||
style="width: 170px;"></select>
|
||||
<input type="hidden" class="form-control" id="typeId" name="typeId" value=""/>
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">*过程控制编号</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="code" name="typeCode" value="请选择" readonly/>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*厂区</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="hidden" class="form-control" id="unitId" name="unitId"
|
||||
value="${param.unitId}"/>
|
||||
<input type="text" class="form-control" id="unitName" name="unitName" value="${companyName}"
|
||||
readonly>
|
||||
</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="libraryProcessManageTypeSelect" name="libraryProcessManageTypeSelect"
|
||||
style="width: 170px;"></select>
|
||||
<input type="hidden" name="abnormalName" id="abnormalName" value="${libraryProcessManageWorkorder.abnormalName}">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*异常编号</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="abnormalCode" name="abnormalCode"
|
||||
placeholder="异常编号"
|
||||
value="${libraryProcessManageWorkorder.abnormalCode}">
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">备注</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" id="remarks" name="remarks"
|
||||
placeholder="备注">${libraryProcessManageWorkorder.remarks}</textarea>
|
||||
</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>
|
||||
Reference in New Issue
Block a user