first commit
This commit is contained in:
181
WebRoot/jsp/whp/baseinfo/WhpTestItemWorkingConstantEdit.jsp
Normal file
181
WebRoot/jsp/whp/baseinfo/WhpTestItemWorkingConstantEdit.jsp
Normal file
@ -0,0 +1,181 @@
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<%@ 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" %>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
|
||||
.foot {
|
||||
display: flex;
|
||||
padding-left: 50px;
|
||||
}
|
||||
|
||||
/*.layout{*/
|
||||
/* display: flex;*/
|
||||
/* padding-left: 15px;*/
|
||||
/*}*/
|
||||
.form-horizontal {
|
||||
padding-top: 20px;
|
||||
|
||||
}
|
||||
|
||||
.right {
|
||||
margin-left: 50px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
});
|
||||
|
||||
|
||||
//保存
|
||||
function updateconstant() {
|
||||
//console.log($("#constanteditForm").serialize());
|
||||
$("#constanteditForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#constanteditForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
var formData = new FormData($("#constanteditForm")[0]);
|
||||
$.ajax({
|
||||
url: ext.contextPath + '/whp/baseinfo/WhpTestItemWorkingCurve/update.do',
|
||||
type: 'POST',
|
||||
data: formData,
|
||||
async: false,
|
||||
cache: false,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
console.log(data)
|
||||
if (data.code == 1) {
|
||||
|
||||
$("#constanttable").bootstrapTable('refresh');
|
||||
closeModal('constantsubs');
|
||||
} else {
|
||||
showAlert('d', '保存失败!' + data.msg);
|
||||
}
|
||||
},
|
||||
error: function (data) {
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
$("#constanteditForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
formulatype: {validators: {notEmpty: {message: '检测项目不能为空'}}},
|
||||
parmname: {validators: {notEmpty: {message: '检测项目不能为空'}}},
|
||||
default_value: {validators: {notEmpty: {message: '默认值不能为空'}}},
|
||||
exp: {validators: {notEmpty: {message: '公式内容不能为空'}}},
|
||||
sort: {validators: {notEmpty: {message: '顺序不能为空'}}},
|
||||
|
||||
}
|
||||
});
|
||||
function selectmpid() {
|
||||
$.post(ext.contextPath + '/work/mpoint/mpointListSingle4LayerES.do', {
|
||||
// mpids: mpids,
|
||||
mpids: '',
|
||||
fucname: 'ckmpidDone'
|
||||
}, function (data) {
|
||||
$("#mpSelectDiv").html(data);
|
||||
openModal('subModalMpoint');
|
||||
});
|
||||
}
|
||||
|
||||
function ckmpidDone(data) {
|
||||
data = JSON.parse(data);
|
||||
$('#constanteditForm #parmname').val(data[0].parmname);
|
||||
$('#constanteditForm #mpid').val(data[0].mpid);
|
||||
$('#constanteditForm #disname').val(data[0].disname);
|
||||
$('#constanteditForm #unit').val(data[0].unit);
|
||||
$('#constanteditForm #numtail').val(data[0].numtail);
|
||||
closeModal('subModalMpoint');
|
||||
}
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="constantsubs">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<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">
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-xs-13">
|
||||
<!-- 新增界面formid强制为editForm -->
|
||||
<form class="form-horizontal" id="constanteditForm" enctype="multipart/form-data">
|
||||
<div id="alertDiv"></div>
|
||||
<%-- <input type="hidden" name="id" value="${user.id }" />--%>
|
||||
<!-- 界面提醒div强制id为alertdiv -->
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 名称:</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" readonly name="parmname" id="parmname"
|
||||
value="${bean.MPoint.parmname}" placeholder="请点击选择" onclick="selectmpid();" class="form-control">
|
||||
<input type="hidden" readonly name="kpi_id" id="mpid" value="${bean.kpi_id}" class="form-control">
|
||||
<input type="hidden" readonly name="id" id="id" value="${bean.id}"
|
||||
class="form-control">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 简称:</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" value="${bean.MPoint.disname}" readonly name="disname" id="disname" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 单位</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" readonly name="unit" id="umit"
|
||||
value="${bean.MPoint.unit}" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 小数位数:</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" value="${bean.MPoint.numtail}" readonly name="numtail" id="numtail" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 默认值:</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="default_value" id="default_value"
|
||||
value="${bean.default_value}" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 顺序:</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" value="${bean.sort}" name="sort" id="sort" class="form-control">
|
||||
</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 " style="margin-left: 10px"
|
||||
onclick="updateconstant()">保存
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user