Files
SIPAIIS_WMS_JSSW/WebRoot/jsp/user/processSectionAdd.jsp
2026-01-16 14:13:44 +08:00

152 lines
6.5 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<%@page import="com.sipai.entity.user.ExtSystem"%>
<%@ page language="java" import="java.util.*" 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"%>
<% request.setAttribute("RequestMode", ExtSystem.RequestMode); %>
<% request.setAttribute("SystemType", ExtSystem.SystemType); %>
<style type="text/css">
.select2-container .select2-selection--single{
height:34px;
line-height: 34px;
}
.select2-selection__arrow{
margin-top:3px;
}
</style>
<script type="text/javascript">
$(function() {
$.post(ext.contextPath + "/user/processSection/getProcessSectionType4Selectall.do", {companyId:'${company.id}'}, function(data) {
$("#processSectionTypeId").empty();
var selelct_ =$("#processSectionTypeId").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('').trigger("change");
},'json');
})
function dosave() {
$("#subForm").bootstrapValidator('validate');//提交验证
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
$.post(ext.contextPath + "/user/processSection/save.do", $("#subForm").serialize(), function(data) {
if (data.res == 1) {
$("#subModal").modal("hide");
$("#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: '名称不能为空'
}
}
},
sname: {
validators: {
notEmpty: {
message: '简称不能为空'
}
}
},
code: {
validators: {
notEmpty: {
message: '编号不能为空'
}
}
},
}
});
</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">&times;</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>
<input id ="id" name="id" type="hidden" value="${processSection.id}"/>
<!-- 界面提醒div强制id为alertdiv -->
<div class="form-group">
<label class="col-sm-2 control-label">*名称</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="name" name ="name" placeholder="名称" value="${processSection.name}">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">*简称</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="sname" name ="sname" placeholder="名称" value="${processSection.sname}">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">*编号</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="code" name ="code" placeholder="编号" value="${processSection.code}">
</div>
</div>
<!-- <div class="form-group">
<label class="col-sm-2 control-label">所属公司</label>
<div class="col-sm-10">
<input name="pid" type="hidden" value="${company.id}"/>
<p class="form-control-static" >${company.name}</p>
</div>
</div> -->
<div class="form-group">
<label class="col-sm-2 control-label">所属工艺类型</label>
<div class="col-sm-10">
<select class="form-control select2" id="processSectionTypeId" name ="processSectionTypeId" style="width: 220px;">
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">顺序</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="morder" name ="morder" placeholder="顺序" style="width: 220px;" value="${processSection.morder}">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">启用状态</label>
<div class="col-sm-10">
<select class="form-control select2 " id="active" name ="active" style="width: 220px;">
<option value="true" >启用</option>
<option value="false" >停用</option>
</select>
</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>