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

190 lines
8.1 KiB
Plaintext
Raw 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 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"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ page import="com.sipai.entity.base.ServerObject"%>
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
<%@page import="com.sipai.entity.work.ProductionIndexPlanNameConfigure"%>
<%@ page import="com.sipai.entity.enums.DayValueEnum" %>
<% request.setAttribute("Type_0", ProductionIndexPlanNameConfigure.Type_0);%>
<% request.setAttribute("Type_1", ProductionIndexPlanNameConfigure.Type_1);%>
<% request.setAttribute("MONTH_VALUE", DayValueEnum.MONTH_VALUE);%>
<% request.setAttribute("AVG_VALUE", DayValueEnum.AVG_VALUE);%>
<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 doupdate() {
$("#subForm").bootstrapValidator('validate');//提交验证
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
$.post(ext.contextPath + "/work/productionIndexPlanNameConfigure/doupdate.do", $("#subForm").serialize(), function(data) {
// console.log(data);
if (data.code == 1) {
initTreeView();
$("#menuBox").html("");
// showAlert('s','保存成功');
}else{
showAlert('d',data.msg);
}
},'json');
}
}
$("#subForm").bootstrapValidator({
live: 'disabled',//验证时机enabled是内容有变化就验证默认disabled和submitted是提交再验证
fields: {
name: {
validators: {
notEmpty: {
message: '名称不能为空'
}
}
},
morder: {
validators: {
notEmpty: {
message: '顺序不能为空'
},
regexp: {
regexp: /^[0-9]*$/,
message: '顺序必须为数字'
}
}
}
}
});
var selectMPint = function() {
$.post(ext.contextPath + '/achievement/acceptanceModelMPoint/showlistForSelect.do', {formId:'subForm',hiddenId:'mpid',textId:'mpname'} , function(data) {
$("#mpSubDiv").html(data);
openModal('mpSubModal');
});
};
var selectMPint2 = function() {
$.post(ext.contextPath + '/achievement/acceptanceModelMPoint/showlistForSelect.do', {formId:'subForm',hiddenId:'mpidPlan',textId:'mpPlanname'} , function(data) {
$("#mpSubDiv").html(data);
openModal('mpSubModal');
});
};
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 + '/work/productionIndexPlanNameConfigure/dodel.do', {id:'${productionIndexPlanNameConfigure.id}'}, function(result) {
// var data= $.parseJSON(result);
if(result.code==1){
initTreeView();
$("#menuBox").html("");
}else{
showAlert('d',result.msg);
}
},'json');
}
});
}
$(function() {
var value='${productionIndexPlanNameConfigure.type}';
if(value=='${Type_1}'){
$('#typeSt').css('display','block');
}else{
$('#typeSt').css('display','none');
}
});
function changeType(){
var value=$('#type').val();
if(value=='${Type_1}'){
$('#typeSt').css('display','block');
}else{
$('#typeSt').css('display','none');
}
}
</script>
<div class="box box-primary" >
<div class="box-header with-border">
<h3 class="box-title">修改</h3>
<div class="box-tools pull-right">
<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>
</div>
</div>
<!-- /.box-header -->
<div class="box-body ">
<form class="form-horizontal" id="subForm">
<!-- 界面提醒div强制id为alertDiv -->
<input type="hidden" name ="id" value="${productionIndexPlanNameConfigure.id }">
<div id="alertDiv"></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" placeholder="指标名称" value="${productionIndexPlanNameConfigure.name}">
</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="${productionIndexPlanNameConfigure.morder}">
</div>
</div>
<div id="typeSt" class="form-group">
<label class="col-sm-2 control-label">数据测量点</label>
<div class="col-sm-4">
<input type="hidden" class="form-control" id="mpid" name ="mpid" value="${productionIndexPlanNameConfigure.mpid}" readonly>
<input type="text" class="form-control" id="mpname" name ="mpname" placeholder="数据测量点" onclick="selectMPint()" value="${productionIndexPlanNameConfigure.mpname}" readonly>
</div>
<label class="col-sm-2 control-label">计划测量点</label>
<div class="col-sm-4">
<input type="hidden" class="form-control" id="mpidPlan" name ="mpidPlan" value="${productionIndexPlanNameConfigure.mpidPlan}" readonly>
<input type="text" class="form-control" id="mpPlanname" name ="mpPlanname" placeholder="计划测量点" onclick="selectMPint2()" value="${productionIndexPlanNameConfigure.mpPlanname}" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">类型</label>
<div class="col-sm-4">
<select id ="type" name="type" class="form-control select2" onchange="changeType();">
<option value="${Type_1}" <c:if test="${productionIndexPlanNameConfigure.type==Type_1}">selected</c:if> >指标名称</option>
<option value="${Type_0}" <c:if test="${productionIndexPlanNameConfigure.type==Type_0}">selected</c:if> >指标类型</option>
</select>
</div>
<label class="col-sm-2 control-label">日指标类型</label>
<div class="col-sm-4">
<select id ="dayValue" name="dayValue" class="form-control select2" onchange="changeType();">
<option value="${MONTH_VALUE.id}" <c:if test="${productionIndexPlanNameConfigure.dayValue==MONTH_VALUE.id}">selected</c:if> >${MONTH_VALUE.name}</option>
<option value="${AVG_VALUE.id}" <c:if test="${productionIndexPlanNameConfigure.dayValue==AVG_VALUE.id}">selected</c:if> >${AVG_VALUE.name}</option>
</select>
</div>
</div>
</form>
</div>
</div>