Files
SIPAIIS_WMS_JSSW/WebRoot/jsp/sparepart/channelsEdit.jsp

150 lines
6.2 KiB
Plaintext
Raw Normal View History

2026-01-16 14:13:44 +08:00
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<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">
var showChannels4SelectFun = function() {
$.post(ext.contextPath + '/sparepart/channels/showList4Select.do', {formId:"subForm",hiddenId:"pid",textId:"pname"} , function(data) {
$("#fault4SelectDiv").html(data);
openModal('fault4SelectModal');
});
};
function doupdate() {
$("#subForm").bootstrapValidator('validate');//提交验证
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
$.post(ext.contextPath + "/sparepart/channels/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');
}
}
function dodel() {
swal({
text: "您确定要删除此记录?",
dangerMode: true,
buttons: {
cancel: {
text: "取消",
value: null,
visible: true,
className: "btn btn-default btn-sm",
closeModal: true,
},
confirm: {
text: "确定",
value: true,
visible: true,
className: "btn btn-danger btn-sm",
closeModal: true
}
}
})
.then(function(willDelete) {
if (willDelete) {
$.post(ext.contextPath + '/sparepart/channels/delete.do', $("#subForm").serialize(), function(data) {
if(data>0){
initTreeView();
}else{
showAlert('d','删除失败');
}
},'json');
}
});
}
//输入框验证
$("#subForm").bootstrapValidator({
live: 'disabled',//验证时机enabled是内容有变化就验证默认disabled和submitted是提交再验证
fields: {
id: {
notEmpty: {
message: '编号不能为空'
},
},
name: {
notEmpty: {
message: '名称不能为空'
},
},
}
});
</script>
<div class="box box-primary" >
<div class="box-header with-border">
<h3 class="box-title">编辑</h3>
<div class="box-tools pull-right">
<c:if test="${channels.source==0}">
<a onclick="doupdate()" class="btn btn-box-tool" data-toggle="tooltip" title="保存"><i class="glyphicon glyphicon-floppy-disk"></i></a>
<a onclick="dodel()" class="btn btn-box-tool" data-toggle="tooltip" title="删除"><i class="glyphicon glyphicon-trash"></i></a>
</c:if>
</div>
</div>
<!-- /.box-header -->
<div class="box-body ">
<!-- 新增界面formid强制为subForm -->
<form class="form-horizontal" id="subForm">
<!-- 界面提醒div强制id为alertDiv -->
<div id="alertDiv"></div>
<div id="fault4SelectDiv"></div>
<div class="form-group">
<label class="col-sm-2 control-label">*列资渠道</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="name" name ="name"
value="${channels.name}">
</div>
<label class="col-sm-2 control-label">上级菜单</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="pname" name ="pname" placeholder="上级菜单" onclick="showChannels4SelectFun();" value="${channels.pname}">
<input id="pid" name="pid" type="hidden" value="${channels.pid}"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">*编号</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="id" name ="id" value="${channels.id}">
</div>
<label class="col-sm-2 control-label">顺序</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="morder" name ="morder" placeholder="顺序" value="${channels.morder}">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">启用</label>
<div class="col-sm-4">
<select class="form-control" id="active" name ="active" style="width: 270px;">
<option <c:if test="${channels.active==true}">selected</c:if> value= true>可用</option>
<option <c:if test="${channels.active==false}">selected</c:if> value= false>审核中</option>
</select>
</div>
<label class="col-sm-2 control-label">数据来源</label>
<div class="col-sm-4">
<c:if test="${channels.source==0}"><p class="form-control-static" >自建</p></c:if>
<c:if test="${channels.source==1}"><p class="form-control-static" >外接(工程管理)</p></c:if>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">描述</label>
<div class="col-sm-10">
<textarea class="form-control" rows="2" id ="describe" name ="describe" placeholder="描述...">${channels.describe}</textarea>
</div>
</div>
</form>
</div>
</div>