first commit
This commit is contained in:
389
WebRoot/jsp/process/decisionExpertBaseEdit.jsp
Normal file
389
WebRoot/jsp/process/decisionExpertBaseEdit.jsp
Normal file
@ -0,0 +1,389 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<%@page import="com.sipai.entity.process.DecisionExpertBase" %>
|
||||
<%request.setAttribute("Type_structure", DecisionExpertBase.Type_structure); %>
|
||||
<%request.setAttribute("Type_content", DecisionExpertBase.Type_content); %>
|
||||
|
||||
<%@page import="com.sipai.entity.process.DecisionExpertBaseText" %>
|
||||
<%request.setAttribute("Type_alarmmax", DecisionExpertBaseText.Type_alarmmax); %>
|
||||
<%request.setAttribute("Type_alarmmin", DecisionExpertBaseText.Type_alarmmin); %>
|
||||
<%request.setAttribute("Type_halarmmax", DecisionExpertBaseText.Type_halarmmax); %>
|
||||
<%request.setAttribute("Type_lalarmmin", DecisionExpertBaseText.Type_lalarmmin); %>
|
||||
|
||||
<style type="text/css">
|
||||
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
|
||||
$(function () {
|
||||
if ('${decisionExpertBase.id}' != '') {
|
||||
$('#entity').css('display', 'block');
|
||||
}
|
||||
$('#type').select2({minimumResultsForSearch: 10}).val('${decisionExpertBase.type}').trigger('change');
|
||||
if ('${decisionExpertBase.type}' == '${Type_content}') {
|
||||
$('#tab').css('display', 'block');
|
||||
$("#table_Text").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/process/decisionExpertBaseText/getJson.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [15], // 设置页面可以显示的数据条数
|
||||
pageSize: 15, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: "client", //分页方式:client客户端分页,server服务端分页(*)
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
pid: '${decisionExpertBase.id}',
|
||||
}
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
field: 'type', // 返回json数据中的name
|
||||
title: '类型', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter: function (value, row, index) {
|
||||
if (value == '${Type_alarmmax}') {
|
||||
return '上限';
|
||||
} else if (value == '${Type_alarmmin}') {
|
||||
return '下限';
|
||||
} else if (value == '${Type_halarmmax}') {
|
||||
return '上极限';
|
||||
} else if (value == '${Type_lalarmmin}') {
|
||||
return '下极限';
|
||||
}
|
||||
}
|
||||
}, {
|
||||
field: 'value', // 返回json数据中的name
|
||||
title: '限值', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'text', // 返回json数据中的name
|
||||
title: '决策建议', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 120, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts = "";
|
||||
|
||||
buts += '<button class="btn btn-default btn-sm" title="编辑" onclick="editTextFun(\'' + '${decisionExpertBase.id}' + '\',\'' + row.type + '\')"><i class="fa fa-edit"></i><span class="hidden-md hidden-lg"> 编辑</span></button>';
|
||||
// buts+='<button class="btn btn-default btn-sm" title="删除" onclick="deleteFun(\''+row.id+'\')"><i class="fa fa fa-trash-o"></i><span class="hidden-md hidden-lg">删除</span></button';
|
||||
|
||||
buts = '<div class="btn-group" >' + buts + '</div>';
|
||||
return buts;
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("table_Text");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
// onClickRow: function (row) {
|
||||
// showMPCurveView(row.id, row.bizid);
|
||||
// }
|
||||
});
|
||||
} else {
|
||||
$('#tab2').css('display', 'block');
|
||||
$("#table_AllText").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/process/decisionExpertBaseText/getJsonTextAll.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [15], // 设置页面可以显示的数据条数
|
||||
pageSize: 15, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: "client", //分页方式:client客户端分页,server服务端分页(*)
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
pid: '${decisionExpertBase.id}',
|
||||
search_code: $('#search_code').val(),
|
||||
search_name: $('#search_name').val(),
|
||||
}
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
field: 'name', // 返回json数据中的name
|
||||
title: '名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
width: '15%'
|
||||
},
|
||||
{
|
||||
field: 'mpointcode', // 返回json数据中的name
|
||||
title: '测量点', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
width: '15%'
|
||||
},
|
||||
{
|
||||
field: 'mainrole', // 返回json数据中的name
|
||||
title: '主要作用', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},
|
||||
{
|
||||
field: 'type', // 返回json数据中的name
|
||||
title: '类型', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
width: '15%',
|
||||
formatter: function (value, row, index) {
|
||||
if (value == '${Type_alarmmax}') {
|
||||
return '上限';
|
||||
} else if (value == '${Type_alarmmin}') {
|
||||
return '下限';
|
||||
} else if (value == '${Type_halarmmax}') {
|
||||
return '上极限';
|
||||
} else if (value == '${Type_lalarmmin}') {
|
||||
return '下极限';
|
||||
}
|
||||
}
|
||||
}, {
|
||||
field: 'value', // 返回json数据中的name
|
||||
title: '限值', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
width: '10%'
|
||||
}, {
|
||||
field: 'text', // 返回json数据中的name
|
||||
title: '决策建议', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
width: '25%'
|
||||
},
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("table_Text");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
// onClickRow: function (row) {
|
||||
// showMPCurveView(row.id, row.bizid);
|
||||
// }
|
||||
});
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
function editTextFun(pid, type) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/process/decisionExpertBaseText/doedit.do', {
|
||||
pid: pid,
|
||||
type: type
|
||||
}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
}
|
||||
|
||||
function doNamesearch() {
|
||||
$("#table_AllText").bootstrapTable('refresh');
|
||||
}
|
||||
function doCodesearch() {
|
||||
$("#table_AllText").bootstrapTable('refresh');
|
||||
}
|
||||
|
||||
function doMainsave() {
|
||||
$("#subMainForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subMainForm").data('bootstrapValidator').isValid()) {
|
||||
//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/process/decisionExpertBase/doupdate.do", $("#subMainForm").serialize(), function (data) {
|
||||
if (data.code == 1) {
|
||||
initTreeView();
|
||||
} else if (data.code == 0) {
|
||||
showAlert('d', data.msg);
|
||||
} else {
|
||||
showAlert('d', data.code);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
}
|
||||
|
||||
$("#subMainForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
name: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '名称不能为空'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var dodel = function (id) {
|
||||
stopBubbleDefaultEvent();
|
||||
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 + '/process/decisionExpertBase/dodelete.do', {id: '${decisionExpertBase.id}'}, function (data) {
|
||||
if (data.code == 1) {
|
||||
initTreeView();
|
||||
} else {
|
||||
showAlert('d', data.msg, 'mainAlertdiv');
|
||||
}
|
||||
}, 'json');
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
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);
|
||||
$('#subMainForm #mpid').val(data[0].mpid);
|
||||
closeModal('subModalMpoint');
|
||||
}
|
||||
|
||||
</script>
|
||||
<div class="box box-primary">
|
||||
|
||||
<div div id="entity" class="box box-primary" style="display: none">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">修改</h3>
|
||||
|
||||
<div class="box-tools pull-right">
|
||||
<a onclick="doMainsave()" 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="subMainForm" autocomplete="off">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<input type="hidden" name="id" id="id" value="${param.id}"/>
|
||||
<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="${decisionExpertBase.name}">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">类型</label>
|
||||
<div class="col-sm-4">
|
||||
<select id="type" name="type" class="form-control select2">
|
||||
<option value="${Type_structure}">结构</option>
|
||||
<option value="${Type_content}">内容</option>
|
||||
</select>
|
||||
</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="mpid" name="mpid" placeholder="测量点"
|
||||
value="${decisionExpertBase.mpid}" onclick="selectmpid();">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">顺序</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="morder" name="morder" placeholder="顺序"
|
||||
value="${decisionExpertBase.morder}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">主要作用</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea type="text" style="height: 80px;" class="form-control" id="mainrole"
|
||||
name="mainrole" placeholder="主要作用">${decisionExpertBase.mainrole}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="tab" class="box box-primary" style="display: none">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">决策内容</h3>
|
||||
<div class="box-tools pull-right">
|
||||
<%-- <a onclick="doTextAdd()" class="btn btn-box-tool" data-toggle="tooltip" title="删除"><i class="glyphicon glyphicon-minus"></i></a>--%>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body ">
|
||||
<table id="table_Text"></table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="tab2" class="box box-primary" style="display: none">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">决策内容</h3>
|
||||
<div class="box-tools pull-right">
|
||||
|
||||
<div class="form-group" style="padding:0;">
|
||||
<div class="form-group pull-right form-inline" >
|
||||
<div class="input-group input-group-sm" style="width: 250px;">
|
||||
<input type="text" id="search_code" name="search_code" class="form-control pull-right" placeholder="名称">
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-default" onclick="doCodesearch();"><i class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-group input-group-sm" style="width: 250px;">
|
||||
<input type="text" id="search_name" name="search_name" class="form-control pull-right" placeholder="决策内容">
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-default" onclick="doNamesearch();"><i class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body ">
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane active" id="tab_1">
|
||||
<!-- <div class="table-responsive">
|
||||
<table id="table"></table>
|
||||
</div> -->
|
||||
<table id="table"></table>
|
||||
</div>
|
||||
<!-- /.tab-pane -->
|
||||
<div class="tab-pane" id="tab_2">
|
||||
</div>
|
||||
<!-- /.tab-pane -->
|
||||
</div>
|
||||
<table id="table_AllText"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
Reference in New Issue
Block a user