149 lines
6.7 KiB
Plaintext
149 lines
6.7 KiB
Plaintext
<%@ page language="java" pageEncoding="UTF-8"%>
|
||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||
<script type="text/javascript">
|
||
var companyId = $("#companyId").val();
|
||
$(function() {
|
||
var selelct_ =$("#processsectionid").select2({
|
||
data: null,
|
||
placeholder:'请选择',//默认文字提示
|
||
allowClear: true,//允许清空
|
||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||
language: "zh-CN",
|
||
minimumInputLength: 0,
|
||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||
});
|
||
$("#processsectionid").empty();
|
||
// $("#table").bootstrapTable('refresh', {data:null});
|
||
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'});
|
||
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId:$("#companyId").val()}, function(data) {
|
||
$("#processsectionid").empty();
|
||
var selelct_ =$("#processsectionid").select2({
|
||
data: data,
|
||
cache : false,
|
||
placeholder:'请选择',//默认文字提示
|
||
allowClear: true,//允许清空
|
||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||
language: "zh-CN",
|
||
minimumInputLength: 0,
|
||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||
formatResult: function formatRepo(repo){return repo.id;}, // 函数用来渲染结果
|
||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||
});
|
||
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'})
|
||
selelct_.val('${ps.processsectionid}').trigger("change");
|
||
/* selelct_.on("change",function(e){
|
||
$("#processSection").val($("#processSection").select2("data")[0].id);
|
||
}); */
|
||
},'json');
|
||
});
|
||
var selectPS = function(pid) {
|
||
$.post(ext.contextPath + '/user/processSection/showlistForSelect.do', {pid:pid} , function(data) {
|
||
$("#psSubDiv").html(data);
|
||
openModal('psSubModal');
|
||
});
|
||
};
|
||
|
||
|
||
|
||
function doupdate() {
|
||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||
$.post(ext.contextPath + "/work/scadaPic/updatePS.do", $("#subForm").serialize(), function(data) {
|
||
if (data.res == 1) {
|
||
closeModal('subModal');
|
||
showPS();
|
||
//$("#table").bootstrapTable('refresh');
|
||
|
||
}else if(data.res == 0){
|
||
showAlert('d','更新失败');
|
||
}else{
|
||
showAlert('d',data.res);
|
||
}
|
||
},'json');
|
||
}
|
||
|
||
}
|
||
|
||
$("#subForm").bootstrapValidator({
|
||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||
fields: {
|
||
equipid: {
|
||
validators: {
|
||
notEmpty: {
|
||
message: '设备不能为空'
|
||
}
|
||
}
|
||
},
|
||
}
|
||
});
|
||
</script>
|
||
|
||
<div class="modal fade" id="subModal">
|
||
<div class="modal-dialog modal-md">
|
||
<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强制id为alertDiv -->
|
||
<div id="alertDiv"></div>
|
||
|
||
<div class="modal-body">
|
||
|
||
<!-- 新增界面formid强制为subForm -->
|
||
<form class="form-horizontal" id="subForm">
|
||
|
||
<input name="containerwidth" type="hidden" value="${param.containerwidth}"/>
|
||
<input name="containerheight" type="hidden" value="${param.containerheight}"/>
|
||
<input name="pid" type="hidden" value="${param.pid}"/>
|
||
<input name="companyId" id="companyId" type="hidden" value="${param.companyId}"/>
|
||
<input name="id" id="id" type="hidden" value="${ps.id}"/>
|
||
<div class="form-group">
|
||
<label class="col-sm-3 control-label">工艺名称</label>
|
||
<div class="col-sm-7">
|
||
<select class="form-control select2 " id="processsectionid" name ="processsectionid" style="width: 220px;"></select>
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-sm-3 control-label">posx</label>
|
||
<div class="col-sm-7">
|
||
<input type="text" class="form-control" id="posx" name ="posx" value="${ps.posx }">
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-sm-3 control-label">posy</label>
|
||
<div class="col-sm-7">
|
||
<input type="text" class="form-control" id="posy" name ="posy" value="${ps.posy }" >
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-sm-3 control-label">宽度</label>
|
||
<div class="col-sm-7">
|
||
<input type="text" class="form-control" id="width" name ="width" value="${ps.width }" >
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-sm-3 control-label">高度</label>
|
||
<div class="col-sm-7">
|
||
<input type="text" class="form-control" id="height" name ="height" value="${ps.height }" >
|
||
</div>
|
||
</div>
|
||
<!-- <div class="form-group">
|
||
<label class="col-sm-3 control-label">图片</label>
|
||
<div class="col-sm-7" id="pic">
|
||
</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="doupdate()" id="btn_save">保存</button>
|
||
</div>
|
||
</div>
|
||
<!-- /.modal-content -->
|
||
</div>
|
||
<!-- /.modal-dialog -->
|
||
</div>
|