first commit
This commit is contained in:
245
WebRoot/jsp/whp/baseinfo/WhpEquipmentAdd.jsp
Normal file
245
WebRoot/jsp/whp/baseinfo/WhpEquipmentAdd.jsp
Normal file
@ -0,0 +1,245 @@
|
||||
<!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 () {
|
||||
|
||||
initDropDownStatus();
|
||||
});
|
||||
|
||||
function initDropDownStatus() {
|
||||
var select_Data = jQuery.parseJSON('${enableDropDown}');
|
||||
console.log(select_Data);
|
||||
var select_3 = $("#status").select2({
|
||||
data: select_Data,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
// allowClear: true,//允许清空
|
||||
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;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'});
|
||||
|
||||
<%--select_3.val('${kpiDimension.status}').trigger("change");--%>
|
||||
|
||||
|
||||
}
|
||||
|
||||
function addSaveFun() {
|
||||
//console.log($("#addForm").serialize());
|
||||
$("#addForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#addForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
var formData = new FormData($("#addForm")[0]);
|
||||
$.ajax({
|
||||
url: ext.contextPath + "/whp/baseinfo/WhpEquipment/save.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) {
|
||||
|
||||
$("#table").bootstrapTable('refresh');
|
||||
closeModal('subModal');
|
||||
} else {
|
||||
showAlert('d', '保存失败!' + data.msg);
|
||||
}
|
||||
},
|
||||
error: function (data) {
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
$("#addForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
name: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '仪器名称不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
code: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '唯一标识码不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
address: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '存放地址不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
status: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '状态不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
manufacturer: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '厂家不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
model: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '型号不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
specification: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '规格不能为空'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<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强制为addForm -->
|
||||
<form class="form-horizontal" id="addForm" 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-4">
|
||||
<input type="text" name="name" id="name" class="form-control"
|
||||
placeholder="">
|
||||
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">* 唯一标识码:</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" name="code" id="code" class="form-control"
|
||||
placeholder="">
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 存放地址:</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" name="address" id="address" class="form-control"
|
||||
placeholder=""
|
||||
>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">* 厂家:</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" name="manufacturer" id="manufacturer" class="form-control"
|
||||
placeholder=""
|
||||
>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 型号:</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" name="model" id="model" class="form-control"
|
||||
placeholder=""
|
||||
>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label ">* 规格:</label>
|
||||
<div class="col-sm-4 ">
|
||||
<input type="text" name="specification" id="specification" class="form-control"
|
||||
placeholder=""
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
||||
<label class="col-sm-2 control-label ">* 状态:</label>
|
||||
<div class="col-sm-4 ">
|
||||
|
||||
<select class="form-control" name="status" id="status"
|
||||
style="width: 100%">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</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="addSaveFun()">保存
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
239
WebRoot/jsp/whp/baseinfo/WhpEquipmentEdit.jsp
Normal file
239
WebRoot/jsp/whp/baseinfo/WhpEquipmentEdit.jsp
Normal file
@ -0,0 +1,239 @@
|
||||
<!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 () {
|
||||
|
||||
initDropDownStatus();
|
||||
});
|
||||
|
||||
function initDropDownStatus() {
|
||||
var select_Data = jQuery.parseJSON('${enableDropDown}');
|
||||
console.log(select_Data);
|
||||
var select_3 = $("#status").select2({
|
||||
data: select_Data,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
// allowClear: true,//允许清空
|
||||
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;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'});
|
||||
|
||||
select_3.val('${bean.status}').trigger("change");
|
||||
|
||||
|
||||
}
|
||||
|
||||
function updateSaveFun() {
|
||||
//console.log($("#addForm").serialize());
|
||||
$("#addForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#addForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
var formData = new FormData($("#addForm")[0]);
|
||||
$.ajax({
|
||||
url: ext.contextPath + "/whp/baseinfo/WhpEquipment/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) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
closeModal('subModal');
|
||||
} else {
|
||||
showAlert('d', '保存失败!' + data.msg);
|
||||
}
|
||||
},
|
||||
error: function (data) {
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
$("#addForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
name: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '仪器名称不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
code: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '唯一标识码不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
address: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '存放地址不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
status: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '状态不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
manufacturer: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '厂家不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
model: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '型号不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
specification: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '规格不能为空'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<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强制为addForm -->
|
||||
<form class="form-horizontal" id="addForm" 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-4">
|
||||
<input type="hidden" name="id" id="id" class="form-control"
|
||||
placeholder="${bean.id}" value="${bean.id}" >
|
||||
<input type="text" name="name" id="name" class="form-control"
|
||||
placeholder="" value="${bean.name}">
|
||||
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">* 存放地点:</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" name="address" id="address" class="form-control"
|
||||
placeholder=""
|
||||
value="${bean.address} ">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 唯一表示码:</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" name="code" id="code" class="form-control"
|
||||
value="${bean.code}">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">* 厂家:</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" name="manufacturer" id="manufacturer" class="form-control"
|
||||
placeholder="" value="${bean.manufacturer}"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 型号:</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" name="model" id="model" class="form-control"
|
||||
placeholder="" value="${bean.model}"/>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label ">* 规格:</label>
|
||||
<div class="col-sm-4 ">
|
||||
<input type="text" name="specification" id="specification" class="form-control"
|
||||
placeholder="" value="${bean.specification}" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 状态:</label>
|
||||
<div class="col-sm-4 ">
|
||||
|
||||
<select class="form-control" name="status" id="status"
|
||||
style="width: 100%">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</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="updateSaveFun()">保存
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
273
WebRoot/jsp/whp/baseinfo/WhpEquipmentForOneSelect.jsp
Normal file
273
WebRoot/jsp/whp/baseinfo/WhpEquipmentForOneSelect.jsp
Normal file
@ -0,0 +1,273 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<%@ page import="com.sipai.tools.SessionManager" %>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<%@page import="com.sipai.entity.scada.MPoint" %>
|
||||
<%request.setAttribute("Flag_Enable", MPoint.Flag_Enable);%>
|
||||
<%request.setAttribute("Flag_Disable", MPoint.Flag_Disable);%>
|
||||
|
||||
<script type="text/javascript">
|
||||
var doSearchUser = function () {
|
||||
$("#table_Equ").bootstrapTable('refresh');
|
||||
};
|
||||
|
||||
function doselect(dialog, grid) {
|
||||
var checkedItems = $("#table_Equ").bootstrapTable('getSelections');
|
||||
var datas = "";
|
||||
var names = "";
|
||||
console.log(checkedItems)
|
||||
if (checkedItems == "") {
|
||||
showAlert('d', "请选择设备", 'mpoint_mainAlertdiv');
|
||||
} else {
|
||||
$.each(checkedItems, function (index, item) {
|
||||
if (datas == '') {
|
||||
datas = item.id;
|
||||
names = item.name;
|
||||
} else {
|
||||
|
||||
datas += "," + item.id;
|
||||
names += "," + item.name;
|
||||
}
|
||||
|
||||
});
|
||||
$('#${param.formId} #${param.hiddenId}').val(datas);
|
||||
$('#${param.formId} #${param.textId}').val(names);
|
||||
closeModal("equ4SelectModal");
|
||||
/* $.post(ext.contextPath + '/whp/baseinfo/WhpEquipment/getwhpEquipmentByIds.do', {equipmentIds : datas}, function(resp) {
|
||||
console.log(checkedItems)
|
||||
console.log("dddd"+resp);
|
||||
$('#
|
||||
${param.formId} #
|
||||
${param.hiddenId}').val(resp[0].id);
|
||||
$('#
|
||||
${param.formId} #
|
||||
${param.textId}').val(resp[0].name);
|
||||
closeModal("equ4SelectModal");
|
||||
},'json');*/
|
||||
}
|
||||
};
|
||||
|
||||
//显示已经勾选的数据
|
||||
function stateFormatter(value, row, index) {
|
||||
var flag = false;
|
||||
if (row.id == '${equipmentId}') {
|
||||
flag = true;
|
||||
checkedItem = "";
|
||||
}
|
||||
if (flag)
|
||||
return {
|
||||
checked: true//设置选中
|
||||
};
|
||||
return value;
|
||||
}
|
||||
|
||||
function conditionDropDownStatus() {
|
||||
var select_Data = jQuery.parseJSON('${enableDropDown}');
|
||||
var select_3 = $("#statusCondition").select2({
|
||||
data: select_Data,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示educationTypeCondition
|
||||
allowClear: true,//允许清空
|
||||
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;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'});
|
||||
select_3.val('').trigger('change');
|
||||
}
|
||||
|
||||
function conditionDropDownAddress() {
|
||||
var select_Data = jQuery.parseJSON('${addressConditionDropDown}');
|
||||
|
||||
var select_3 = $("#addressCondition").select2({
|
||||
data: select_Data,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示educationTypeCondition
|
||||
allowClear: true,//允许清空
|
||||
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;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'});
|
||||
select_3.val('').trigger('change');
|
||||
}
|
||||
|
||||
var $table;
|
||||
|
||||
function queryParams(params) {
|
||||
|
||||
var temp = {
|
||||
pid: companyId,
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order, // 排序规则
|
||||
likeString: $('#likeString').val(),
|
||||
status: $('#statusCondition').val(),
|
||||
address: $('#addressCondition').val()
|
||||
};
|
||||
/* var status =$('#switchBtn').bootstrapSwitch('state')
|
||||
if(status){
|
||||
temp.checkedIds=getCheckedIds();
|
||||
}
|
||||
*/
|
||||
return temp;
|
||||
}
|
||||
|
||||
var companyId = "";
|
||||
var checkedItem = "";
|
||||
$(function () {
|
||||
|
||||
conditionDropDownStatus();
|
||||
conditionDropDownAddress();
|
||||
$table = $("#table_Equ").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/whp/baseinfo/WhpEquipment/getList.do', // 获取表格数据的url
|
||||
//cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
//clickToSelect:true,
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
singleSelect: false,
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
//responseHandler:responseHandler, //在渲染页面数据之前执行的方法,此配置很重要!!!!!!!
|
||||
queryParams: queryParams,
|
||||
queryParamsType: "limit",
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
/* showColumns: true,
|
||||
showRefresh: true, */
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
}, {
|
||||
field: 'name', // 返回json数据中的name
|
||||
title: '仪器名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},
|
||||
{
|
||||
field: 'code', // 返回json数据中的name
|
||||
title: '唯一标识码', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
|
||||
}, {
|
||||
field: 'address', // 返回json数据中的name
|
||||
title: '存放地址', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'statusName', // 返回json数据中的name
|
||||
title: '状态', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("table_Equ");
|
||||
|
||||
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
//绑定选中事件、取消事件、全部选中、全部取消
|
||||
/* $table.on('check.bs.table check-all.bs.table uncheck.bs.table uncheck-all.bs.table', function (e,rows, obj) {
|
||||
if('check'==e.type){
|
||||
$('#table_Equ .checked').removeClass("checked");
|
||||
obj.parent().addClass("checked");
|
||||
checkedItem = rows;
|
||||
}else{
|
||||
obj.parent().removeClass("checked");
|
||||
checkedItem = "";
|
||||
}
|
||||
});*/
|
||||
});
|
||||
</script>
|
||||
<div class="modal fade" id="equ4SelectModal">
|
||||
<div class="modal-dialog" style="width: 45%">
|
||||
<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" style="width:100%">
|
||||
|
||||
<div id="mpoint_mainAlertdiv"></div>
|
||||
<div id="menu4SelectDiv"></div>
|
||||
<div id="modal-body">
|
||||
<div class="form-inline">
|
||||
<div class="form-group">
|
||||
<div class="form-group pull-right form-inline">
|
||||
<div class="form-group">
|
||||
<label class="form-label">地址:</label>
|
||||
<select class="form-control select2" name="addressCondition" id="addressCondition"
|
||||
style="width:180px;height: 30px">
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-label">状态:</label>
|
||||
<select class="form-control select2" name="statusCondition" id="statusCondition"
|
||||
style="width:180px;height: 30px">
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="text" id="likeString" name="likeString" class="form-control pull-left"
|
||||
placeholder="请输入唯一标识码/仪器名称" style="width:180px;height: 30px">
|
||||
<%-- <button class="btn btn-default" onclick="dosearch();"><i class="fa fa-search"></i>--%>
|
||||
<%-- </button>--%>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<%-- <input type="text" id="search_name_user" name="search_name_user" class="form-control " placeholder="姓名">--%>
|
||||
<button class="btn btn-default" onclick="doSearchUser();"><i
|
||||
class="fa fa-search"></i></button>
|
||||
<div class="input-group-btn">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="table-scrollable">
|
||||
<table class="table table-bordered table-striped" style="overflow:auto;width:100%"
|
||||
id="table_Equ"></table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="doselect()" id="btn_save">确认</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
390
WebRoot/jsp/whp/baseinfo/WhpEquipmentList.jsp
Normal file
390
WebRoot/jsp/whp/baseinfo/WhpEquipmentList.jsp
Normal file
@ -0,0 +1,390 @@
|
||||
<%@ 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.sparepart.SparePartCommString" %>
|
||||
<%request.setAttribute("AUDIT", SparePartCommString.STATUS_STOCK_AUDIT); %>
|
||||
<%request.setAttribute("START", SparePartCommString.STATUS_STOCK_START); %>
|
||||
<%request.setAttribute("FINISH", SparePartCommString.STATUS_STOCK_FINISH); %>
|
||||
<%request.setAttribute("FAIL", SparePartCommString.STATUS_STOCK_FAIL); %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%>
|
||||
</title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<!-- bootstrap switch -->
|
||||
<link rel="stylesheet"
|
||||
href="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css"/>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js"
|
||||
charset="utf-8"></script>
|
||||
<!--bootstrap-edittable 表格行内编辑 -->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/plugins/bootstrap-editable/css/bootstrap-editable.css"/>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/plugins/bootstrap-editable/js/bootstrap-editable.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/plugins/bootstrap-editable/js/bootstrap-table-editable.js"
|
||||
charset="utf-8"></script>
|
||||
<style type="text/css">
|
||||
.main-header {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.content-header {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.main-footer {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
|
||||
.table-hover > tbody > tr:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.input-clear-a {
|
||||
|
||||
color: white;
|
||||
|
||||
}
|
||||
|
||||
.input-content:hover + .input-clear-a {
|
||||
|
||||
color: #d4d4d4;
|
||||
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
conditionDropDownAddress();
|
||||
conditionDropDownStatus();
|
||||
initTableList();
|
||||
});
|
||||
|
||||
var addFun = function () {
|
||||
$("#searchForm").bootstrapValidator('validate');//提交验证
|
||||
$.post(ext.contextPath + '/whp/baseinfo/WhpEquipment/add.do', {unitId: unitId}, function (data) {
|
||||
console.log(data);
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
var editFun = function (id) {
|
||||
// stopBubbleDefaultEvent();
|
||||
// console.log(id,"edit")
|
||||
$.post(ext.contextPath + '/whp/baseinfo/WhpEquipment/edit.do', {id: id}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
var deleteFun = 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 + '/whp/baseinfo/WhpEquipment/deletes.do', {ids: id}, function (data) {
|
||||
if (data.code === 1) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
}, "json");
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
var deletesFun = function () {
|
||||
var checkedItems = $("#table").bootstrapTable('getSelections');
|
||||
var datas = "";
|
||||
$.each(checkedItems, function (index, item) {
|
||||
datas += item.id + ",";
|
||||
});
|
||||
if (datas == "") {
|
||||
showAlert('d', '请先选择记录', 'mainAlertdiv');
|
||||
} else {
|
||||
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 + '/whp/baseinfo/WhpEquipment/deletes.do', {ids: datas}, function (data) {
|
||||
if (data.code == 1) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
}, "json");
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
var dosearch = function () {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
};
|
||||
|
||||
var companyId_rawMaterial = "";
|
||||
|
||||
var initTableList = function () {
|
||||
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/whp/baseinfo/WhpEquipment/getList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
likeString: $('#likeString').val(),
|
||||
status: $('#statusCondition').val(),
|
||||
address: $('#addressCondition').val()
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
//detailView: true,//父子表
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
}, {
|
||||
field: 'name', // 返回json数据中的name
|
||||
title: '仪器名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},
|
||||
{
|
||||
field: 'code', // 返回json数据中的name
|
||||
title: '唯一标识码', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
|
||||
}, {
|
||||
field: 'address', // 返回json数据中的name
|
||||
title: '存放地址', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'statusName', // 返回json数据中的name
|
||||
title: '状态', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 160, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts = '';
|
||||
buts += '<button class="btn btn-default btn-sm" title="编辑" onclick="editFun(\'' + row.id + '\')"><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");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function conditionDropDownStatus() {
|
||||
var select_Data = jQuery.parseJSON('${enableDropDown}');
|
||||
var select_3 = $("#statusCondition").select2({
|
||||
data: select_Data,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示educationTypeCondition
|
||||
allowClear: true,//允许清空
|
||||
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;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'});
|
||||
select_3.val('').trigger('change');
|
||||
}
|
||||
|
||||
function conditionDropDownAddress() {
|
||||
var select_Data = jQuery.parseJSON('${addressConditionDropDown}');
|
||||
|
||||
var select_3 = $("#addressCondition").select2({
|
||||
data: select_Data,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示educationTypeCondition
|
||||
allowClear: true,//允许清空
|
||||
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;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'});
|
||||
select_3.val('').trigger('change');
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<div class="content-wrapper">
|
||||
<section class="content container-fluid">
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="subDiv"></div>
|
||||
<div id="subEditDiv"></div>
|
||||
<div id="subDetailDiv"></div>
|
||||
<div id="PRDetail4SelectsDiv"></div>
|
||||
<div id="user4SelectDiv"></div>
|
||||
<div id="Goods4SelectsDiv"></div>
|
||||
<div id="fileInputDiv"></div>
|
||||
<div id="goodsAddDiv"></div>
|
||||
<div id="equ4SelectDiv"></div>
|
||||
<div id="fault4SelectDiv"></div>
|
||||
<div id="unit4SelectDiv"></div>
|
||||
|
||||
<form id="searchForm">
|
||||
<div>
|
||||
<div class="form-group" style="padding:0;">
|
||||
<div class="btn-group" style="width: 220px;padding-bottom:10px;">
|
||||
|
||||
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="addFun();"
|
||||
style="margin-right: 15px"><i
|
||||
class="fa fa-plus"></i> 新增
|
||||
</button>
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="deletesFun();"><i
|
||||
class="fa fa-trash-o"></i> 删除
|
||||
</button>
|
||||
</div>
|
||||
<div class="form-group pull-right form-inline">
|
||||
<div class="form-group">
|
||||
<label class="form-label">地址:</label>
|
||||
<select class="form-control select2" name="addressCondition" id="addressCondition"
|
||||
style="width:180px;height: 30px">
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-label">状态:</label>
|
||||
<select class="form-control select2" name="statusCondition" id="statusCondition"
|
||||
style="width:180px;height: 30px">
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="input-group input-group-sm" style="width: 250px;">
|
||||
<input type="text" id="likeString" name="likeString" class="form-control pull-right"
|
||||
placeholder="请输入唯一标识码/仪器名称">
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-default" onclick="dosearch();"><i class="fa fa-search"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<table id="table"></table>
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<!-- 文件上传-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/css/fileinput.min.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/fileinput.min.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/locales/zh.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/JS/commonFileUpload.js" charset="utf-8"></script>
|
||||
<!-- 引入daterangepicker-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/daterangepicker.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/moment.min.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/daterangepicker.js"
|
||||
charset="utf-8"></script>
|
||||
</html>
|
||||
216
WebRoot/jsp/whp/baseinfo/WhpLiquidWasteDisposeOrgAdd.jsp
Normal file
216
WebRoot/jsp/whp/baseinfo/WhpLiquidWasteDisposeOrgAdd.jsp
Normal file
@ -0,0 +1,216 @@
|
||||
<!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 () {
|
||||
|
||||
initDropDownStatus();
|
||||
});
|
||||
|
||||
function initDropDownStatus() {
|
||||
var select_Data = jQuery.parseJSON('${enableDropDown}');
|
||||
console.log(select_Data);
|
||||
var select_3 = $("#status").select2({
|
||||
data: select_Data,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
// allowClear: true,//允许清空
|
||||
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;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'});
|
||||
|
||||
<%--select_3.val('${kpiDimension.status}').trigger("change");--%>
|
||||
|
||||
|
||||
}
|
||||
|
||||
function saveFun() {
|
||||
//console.log($("#addForm").serialize());
|
||||
$("#addForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#addForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
var formData = new FormData($("#addForm")[0]);
|
||||
$.ajax({
|
||||
url: ext.contextPath + "/whp/baseinfo/WhpLiquidWasteDisposeOrg/save.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) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
closeModal('subModal');
|
||||
} else {
|
||||
showAlert('d', '保存失败!' + data.msg);
|
||||
}
|
||||
},
|
||||
error: function (data) {
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
$("#addForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
name: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '机构名称不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
address: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '机构地址不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
contactPerson: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '机构联系人不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
contactPhone: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '机构电话不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
status: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '机构电话不能为空'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<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强制为addForm -->
|
||||
<form class="form-horizontal" id="addForm" 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-4">
|
||||
<input type="text" name="name" id="name" class="form-control"
|
||||
placeholder="">
|
||||
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">* 机构地址:</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" name="address" id="address" class="form-control"
|
||||
placeholder=""
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 机构联系人:</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" name="contactPerson" id="contactPerson" class="form-control"
|
||||
placeholder="">
|
||||
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">* 机构电话:</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" name="contactPhone" id="contactPhone" class="form-control"
|
||||
placeholder=""
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label ">* 状态:</label>
|
||||
<div class="col-sm-4 ">
|
||||
|
||||
<select class="form-control" name="status" id="status"
|
||||
style="width: 100%">
|
||||
</select>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</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="saveFun()">保存
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
217
WebRoot/jsp/whp/baseinfo/WhpLiquidWasteDisposeOrgEdit.jsp
Normal file
217
WebRoot/jsp/whp/baseinfo/WhpLiquidWasteDisposeOrgEdit.jsp
Normal file
@ -0,0 +1,217 @@
|
||||
<!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 () {
|
||||
|
||||
initDropDownStatus();
|
||||
});
|
||||
|
||||
function initDropDownStatus() {
|
||||
var select_Data = jQuery.parseJSON('${enableDropDown}');
|
||||
console.log(select_Data);
|
||||
var select_3 = $("#status").select2({
|
||||
data: select_Data,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
// allowClear: true,//允许清空
|
||||
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;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'});
|
||||
|
||||
select_3.val('${bean.status}').trigger("change");
|
||||
|
||||
|
||||
}
|
||||
|
||||
function updateFun() {
|
||||
//console.log($("#editForm").serialize());
|
||||
$("#editForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#editForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
var formData = new FormData($("#editForm")[0]);
|
||||
$.ajax({
|
||||
url: ext.contextPath + "/whp/baseinfo/WhpLiquidWasteDisposeOrg/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) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
closeModal('subModal');
|
||||
} else {
|
||||
showAlert('d', '保存失败!' + data.msg);
|
||||
}
|
||||
},
|
||||
error: function (data) {
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
$("#editForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
name: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '机构名称不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
address: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '机构地址不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
contactPerson: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '机构联系人不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
contactPhone: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '机构电话不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
status: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '机构电话不能为空'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<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="editForm" 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-4">
|
||||
<input type="text" name="name" id="name" class="form-control"
|
||||
placeholder="" value="${bean.name}">
|
||||
<input type="hidden" name="id" id="id" class="form-control"
|
||||
placeholder="" value="${bean.id}">
|
||||
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">* 机构地址:</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" name="address" id="address" class="form-control"
|
||||
placeholder=""
|
||||
value="${bean.address}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 机构联系人:</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" name="contactPerson" id="contactPerson" class="form-control"
|
||||
value="${bean.contactPerson}">
|
||||
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">* 机构电话:</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" name="contactPhone" id="contactPhone" class="form-control"
|
||||
value="${bean.contactPhone}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label ">* 状态:</label>
|
||||
<div class="col-sm-4 ">
|
||||
|
||||
<select class="form-control" name="status" id="status"
|
||||
style="width: 100%">
|
||||
</select>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</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="updateFun()">保存
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
372
WebRoot/jsp/whp/baseinfo/WhpLiquidWasteDisposeOrgList.jsp
Normal file
372
WebRoot/jsp/whp/baseinfo/WhpLiquidWasteDisposeOrgList.jsp
Normal file
@ -0,0 +1,372 @@
|
||||
<%@ 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.sparepart.SparePartCommString" %>
|
||||
<%request.setAttribute("AUDIT", SparePartCommString.STATUS_STOCK_AUDIT); %>
|
||||
<%request.setAttribute("START", SparePartCommString.STATUS_STOCK_START); %>
|
||||
<%request.setAttribute("FINISH", SparePartCommString.STATUS_STOCK_FINISH); %>
|
||||
<%request.setAttribute("FAIL", SparePartCommString.STATUS_STOCK_FAIL); %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%>
|
||||
</title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<!-- bootstrap switch -->
|
||||
<link rel="stylesheet"
|
||||
href="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css"/>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js"
|
||||
charset="utf-8"></script>
|
||||
<!--bootstrap-edittable 表格行内编辑 -->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/plugins/bootstrap-editable/css/bootstrap-editable.css"/>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/plugins/bootstrap-editable/js/bootstrap-editable.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/plugins/bootstrap-editable/js/bootstrap-table-editable.js"
|
||||
charset="utf-8"></script>
|
||||
<style type="text/css">
|
||||
.main-header {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.content-header {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.main-footer {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
|
||||
.table-hover > tbody > tr:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.input-clear-a {
|
||||
|
||||
color: white;
|
||||
|
||||
}
|
||||
|
||||
.input-content:hover + .input-clear-a {
|
||||
|
||||
color: #d4d4d4;
|
||||
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
|
||||
conditionDropDownStatus();
|
||||
initTableList();
|
||||
});
|
||||
|
||||
var addFun = function () {
|
||||
$("#searchForm").bootstrapValidator('validate');//提交验证
|
||||
$.post(ext.contextPath + '/whp/baseinfo/WhpLiquidWasteDisposeOrg/add.do', {unitId: unitId}, function (data) {
|
||||
console.log(data);
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
var editFun = function (id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/whp/baseinfo/WhpLiquidWasteDisposeOrg/edit.do', {id: id}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
||||
var deleteFun = 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 + '/whp/baseinfo/WhpLiquidWasteDisposeOrg/deletes.do', {ids: id}, function (data) {
|
||||
if (data.code === 1) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
}, "json");
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
||||
var deletesFun = function () {
|
||||
var checkedItems = $("#table").bootstrapTable('getSelections');
|
||||
var datas = "";
|
||||
$.each(checkedItems, function (index, item) {
|
||||
datas += item.id + ",";
|
||||
});
|
||||
if (datas == "") {
|
||||
showAlert('d', '请先选择记录', 'mainAlertdiv');
|
||||
} else {
|
||||
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 + '/whp/baseinfo/WhpLiquidWasteDisposeOrg/deletes.do', {ids: datas}, function (data) {
|
||||
if (data.code == 1) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
}, "json");
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
var dosearch = function () {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
};
|
||||
|
||||
var companyId_rawMaterial = "";
|
||||
|
||||
var initTableList = function () {
|
||||
timeRangeEnd = null;
|
||||
timeRangeBegin = null;
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/whp/baseinfo/WhpLiquidWasteDisposeOrg/getList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
likeString: $('#likeString').val(),
|
||||
status: $('#statusCondition').val()
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
//detailView: true,//父子表
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
}, {
|
||||
field: 'name', // 返回json数据中的name
|
||||
title: '机构名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'address', // 返回json数据中的name
|
||||
title: '机构地址', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'contactPerson', // 返回json数据中的name
|
||||
title: '机构联系人', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
|
||||
}, {
|
||||
field: 'contactPhone', // 返回json数据中的name
|
||||
title: '机构电话', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'status', // 返回json数据中的name
|
||||
title: '状态', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter: function (value, row, index) {
|
||||
if (value == '0') {
|
||||
return '禁用';
|
||||
} else {
|
||||
return '启用';
|
||||
}
|
||||
}
|
||||
}, {
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 160, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts = '';
|
||||
buts += '<button class="btn btn-default btn-sm" title="编辑" onclick="editFun(\'' + row.id + '\')"><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");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function conditionDropDownStatus() {
|
||||
var select_Data = jQuery.parseJSON('${enableDropDown}');
|
||||
var select_3 = $("#statusCondition").select2({
|
||||
data: select_Data,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示educationTypeCondition
|
||||
allowClear: true,//允许清空
|
||||
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;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'});
|
||||
select_3.val('').trigger('change');
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<div class="content-wrapper">
|
||||
<section class="content container-fluid">
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="subDiv"></div>
|
||||
<div id="subEditDiv"></div>
|
||||
<div id="subDetailDiv"></div>
|
||||
<div id="PRDetail4SelectsDiv"></div>
|
||||
<div id="user4SelectDiv"></div>
|
||||
<div id="Goods4SelectsDiv"></div>
|
||||
<div id="fileInputDiv"></div>
|
||||
<div id="goodsAddDiv"></div>
|
||||
<div id="equ4SelectDiv"></div>
|
||||
<div id="fault4SelectDiv"></div>
|
||||
<div id="unit4SelectDiv"></div>
|
||||
|
||||
<form id="searchForm">
|
||||
<div>
|
||||
<div class="form-group" style="padding:0;">
|
||||
<div class="btn-group" style="width: 220px;padding-bottom:10px;">
|
||||
|
||||
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="addFun();"
|
||||
style="margin-right: 15px"><i
|
||||
class="fa fa-plus"></i> 新增
|
||||
</button>
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="deletesFun();"><i
|
||||
class="fa fa-trash-o"></i> 删除
|
||||
</button>
|
||||
</div>
|
||||
<div class="form-group pull-right form-inline">
|
||||
<div class="form-group">
|
||||
<label class="form-label">状态:</label>
|
||||
<select class="form-control select2" name="statusCondition" id="statusCondition"
|
||||
style="width:180px;height: 30px">
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="input-group input-group-sm" style="width: 250px;">
|
||||
<input type="text" id="likeString" name="likeString" class="form-control pull-right"
|
||||
placeholder="请输入机构名称/地址/联系人/手机号">
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-default" onclick="dosearch();"><i class="fa fa-search"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<table id="table"></table>
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<!-- 文件上传-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/css/fileinput.min.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/fileinput.min.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/locales/zh.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/JS/commonFileUpload.js" charset="utf-8"></script>
|
||||
<!-- 引入daterangepicker-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/daterangepicker.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/moment.min.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/daterangepicker.js"
|
||||
charset="utf-8"></script>
|
||||
</html>
|
||||
184
WebRoot/jsp/whp/baseinfo/WhpResidualSampleDisposeTypeAdd.jsp
Normal file
184
WebRoot/jsp/whp/baseinfo/WhpResidualSampleDisposeTypeAdd.jsp
Normal file
@ -0,0 +1,184 @@
|
||||
<!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 () {
|
||||
|
||||
initDropDownStatus();
|
||||
});
|
||||
|
||||
function initDropDownStatus() {
|
||||
var select_Data = jQuery.parseJSON('${enableDropDown}');
|
||||
console.log(select_Data);
|
||||
var select_3 = $("#status").select2({
|
||||
data: select_Data,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
// allowClear: true,//允许清空
|
||||
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;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'});
|
||||
|
||||
<%--select_3.val('${kpiDimension.status}').trigger("change");--%>
|
||||
|
||||
|
||||
}
|
||||
|
||||
function addSaveFun() {
|
||||
//console.log($("#addForm").serialize());
|
||||
$("#addForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#addForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
var formData = new FormData($("#addForm")[0]);
|
||||
$.ajax({
|
||||
url: ext.contextPath + "/whp/baseinfo/WhpResidualSampleDisposeType/save.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) {
|
||||
|
||||
$("#table").bootstrapTable('refresh');
|
||||
closeModal('subModal');
|
||||
} else {
|
||||
showAlert('d', '保存失败!' + data.msg);
|
||||
}
|
||||
},
|
||||
error: function (data) {
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
$("#addForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
name: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '余样处置名称不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
remark: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '备注不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
status: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '状态不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<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强制为addForm -->
|
||||
<form class="form-horizontal" id="addForm" 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-4">
|
||||
<input type="text" name="name" id="name" class="form-control"
|
||||
placeholder="">
|
||||
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">* 备注:</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" name="remark" id="remark" class="form-control"
|
||||
placeholder="">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label ">* 状态:</label>
|
||||
<div class="col-sm-4 ">
|
||||
|
||||
<select class="form-control" name="status" id="status"
|
||||
style="width: 100%">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</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="addSaveFun()">保存
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
189
WebRoot/jsp/whp/baseinfo/WhpResidualSampleDisposeTypeEdit.jsp
Normal file
189
WebRoot/jsp/whp/baseinfo/WhpResidualSampleDisposeTypeEdit.jsp
Normal file
@ -0,0 +1,189 @@
|
||||
<!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 () {
|
||||
|
||||
initDropDownStatus();
|
||||
});
|
||||
|
||||
function initDropDownStatus() {
|
||||
var select_Data = jQuery.parseJSON('${enableDropDown}');
|
||||
console.log(select_Data);
|
||||
var select_3 = $("#status").select2({
|
||||
data: select_Data,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
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;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'});
|
||||
|
||||
select_3.val('${bean.status}').trigger("change");
|
||||
|
||||
|
||||
}
|
||||
|
||||
function updateSaveFun() {
|
||||
//console.log($("#editForm").serialize());
|
||||
$("#editForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#editForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
var formData = new FormData($("#editForm")[0]);
|
||||
$.ajax({
|
||||
url: ext.contextPath + "/whp/baseinfo/WhpResidualSampleDisposeType/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) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
closeModal('subModal');
|
||||
} else {
|
||||
showAlert('d', '保存失败!' + data.msg);
|
||||
}
|
||||
},
|
||||
error: function (data) {
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
$("#editForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
name: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '余样处置名称不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
remark: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '备注不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
status: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '状态不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<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="editForm" 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-4">
|
||||
<input type="hidden" name="id" id="id" class="form-control"
|
||||
value="${bean.id}" >
|
||||
<input type="text" name="name" id="name" class="form-control"
|
||||
placeholder="" value="${bean.name}">
|
||||
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">* 备注:</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" name="remark" id="remark" class="form-control"
|
||||
placeholder=""
|
||||
value="${bean.remark} ">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label ">* 状态:</label>
|
||||
<div class="col-sm-4 ">
|
||||
|
||||
<select class="form-control" name="status" id="status"
|
||||
style="width: 100%">
|
||||
</select>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</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="updateSaveFun()">保存
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
378
WebRoot/jsp/whp/baseinfo/WhpResidualSampleDisposeTypeList.jsp
Normal file
378
WebRoot/jsp/whp/baseinfo/WhpResidualSampleDisposeTypeList.jsp
Normal file
@ -0,0 +1,378 @@
|
||||
<%@ 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.sparepart.SparePartCommString" %>
|
||||
<%request.setAttribute("AUDIT", SparePartCommString.STATUS_STOCK_AUDIT); %>
|
||||
<%request.setAttribute("START", SparePartCommString.STATUS_STOCK_START); %>
|
||||
<%request.setAttribute("FINISH", SparePartCommString.STATUS_STOCK_FINISH); %>
|
||||
<%request.setAttribute("FAIL", SparePartCommString.STATUS_STOCK_FAIL); %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%>
|
||||
</title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<!-- bootstrap switch -->
|
||||
<link rel="stylesheet"
|
||||
href="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css"/>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js"
|
||||
charset="utf-8"></script>
|
||||
<!--bootstrap-edittable 表格行内编辑 -->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/plugins/bootstrap-editable/css/bootstrap-editable.css"/>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/plugins/bootstrap-editable/js/bootstrap-editable.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/plugins/bootstrap-editable/js/bootstrap-table-editable.js"
|
||||
charset="utf-8"></script>
|
||||
<style type="text/css">
|
||||
.main-header {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.content-header {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.main-footer {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
|
||||
.table-hover > tbody > tr:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.input-clear-a {
|
||||
|
||||
color: white;
|
||||
|
||||
}
|
||||
|
||||
.input-content:hover + .input-clear-a {
|
||||
|
||||
color: #d4d4d4;
|
||||
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
conditionDropDownStatus();
|
||||
initTableList();
|
||||
});
|
||||
|
||||
var addFun = function () {
|
||||
$("#searchForm").bootstrapValidator('validate');//提交验证
|
||||
$.post(ext.contextPath + '/whp/baseinfo/WhpResidualSampleDisposeType/add.do', {unitId: unitId}, function (data) {
|
||||
console.log(data);
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
var editFun = function (id) {
|
||||
// stopBubbleDefaultEvent();
|
||||
// console.log(id,"edit")
|
||||
$.post(ext.contextPath + '/whp/baseinfo/WhpResidualSampleDisposeType/edit.do', {id: id}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
var deleteFun = 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 + '/whp/baseinfo/WhpResidualSampleDisposeType/deletes.do', {ids: id}, function (data) {
|
||||
if (data.code === 1) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
}, "json");
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
var deletesFun = function () {
|
||||
var checkedItems = $("#table").bootstrapTable('getSelections');
|
||||
var datas = "";
|
||||
$.each(checkedItems, function (index, item) {
|
||||
datas += item.id + ",";
|
||||
});
|
||||
if (datas == "") {
|
||||
showAlert('d', '请先选择记录', 'mainAlertdiv');
|
||||
} else {
|
||||
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 + '/whp/baseinfo/WhpResidualSampleDisposeType/deletes.do', {ids: datas}, function (data) {
|
||||
if (data.code == 1) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
}, "json");
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
var dosearch = function () {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
};
|
||||
|
||||
var companyId_rawMaterial = "";
|
||||
|
||||
var initTableList;
|
||||
initTableList = function () {
|
||||
timeRangeEnd = null;
|
||||
timeRangeBegin = null;
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/whp/baseinfo/WhpResidualSampleDisposeType/getList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
likeString: $('#likeString').val(),
|
||||
status: $('#statusCondition').val()
|
||||
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
//detailView: true,//父子表
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
}, {
|
||||
field: 'name', // 返回json数据中的name
|
||||
title: '处置方式名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},
|
||||
{
|
||||
field: 'remark', // 返回json数据中的name
|
||||
title: '备注', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
|
||||
}, {
|
||||
field: 'statusName', // 返回json数据中的name
|
||||
title: '状态', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 160, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts = '';
|
||||
buts += '<button class="btn btn-default btn-sm" title="编辑" onclick="editFun(\'' + row.id + '\')"><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");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
function conditionDropDownStatus() {
|
||||
var select_Data = jQuery.parseJSON('${enableDropDown}');
|
||||
var select_3 = $("#statusCondition").select2({
|
||||
data: select_Data,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示educationTypeCondition
|
||||
allowClear: true,//允许清空
|
||||
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;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'});
|
||||
select_3.val('').trigger('change');
|
||||
}
|
||||
|
||||
function conditionDropDownAddress() {
|
||||
var select_Data = jQuery.parseJSON('${address}');
|
||||
|
||||
var select_3 = $("#addressInput").select2({
|
||||
data: select_Data,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示educationTypeCondition
|
||||
allowClear: true,//允许清空
|
||||
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;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'});
|
||||
select_3.val('').trigger('change');
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<div class="content-wrapper">
|
||||
<section class="content container-fluid">
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="subDiv"></div>
|
||||
<div id="subEditDiv"></div>
|
||||
<div id="subDetailDiv"></div>
|
||||
<div id="PRDetail4SelectsDiv"></div>
|
||||
<div id="user4SelectDiv"></div>
|
||||
<div id="Goods4SelectsDiv"></div>
|
||||
<div id="fileInputDiv"></div>
|
||||
<div id="goodsAddDiv"></div>
|
||||
<div id="equ4SelectDiv"></div>
|
||||
<div id="fault4SelectDiv"></div>
|
||||
<div id="unit4SelectDiv"></div>
|
||||
|
||||
<form id="searchForm">
|
||||
<div>
|
||||
<div class="form-group" style="padding:0;">
|
||||
<div class="btn-group" style="width: 220px;padding-bottom:10px;">
|
||||
|
||||
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="addFun();"
|
||||
style="margin-right: 15px"><i
|
||||
class="fa fa-plus"></i> 新增
|
||||
</button>
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="deletesFun();"><i
|
||||
class="fa fa-trash-o"></i> 删除
|
||||
</button>
|
||||
</div>
|
||||
<div class="form-group pull-right form-inline">
|
||||
<div class="form-group">
|
||||
<label class="form-label">状态:</label>
|
||||
<select class="form-control select2" name="statusCondition" id="statusCondition"
|
||||
style="width:180px;height: 30px">
|
||||
</select>
|
||||
</div>
|
||||
<div class="input-group input-group-sm" style="width: 250px;">
|
||||
<input type="text" id="likeString" name="likeString" class="form-control pull-right"
|
||||
placeholder="请输入处置方式名称/备注">
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-default" onclick="dosearch();"><i class="fa fa-search"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<table id="table"></table>
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<!-- 文件上传-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/css/fileinput.min.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/fileinput.min.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/locales/zh.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/JS/commonFileUpload.js" charset="utf-8"></script>
|
||||
<!-- 引入daterangepicker-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/daterangepicker.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/moment.min.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/daterangepicker.js"
|
||||
charset="utf-8"></script>
|
||||
</html>
|
||||
338
WebRoot/jsp/whp/baseinfo/WhpSampleCodeAdd.jsp
Normal file
338
WebRoot/jsp/whp/baseinfo/WhpSampleCodeAdd.jsp
Normal file
@ -0,0 +1,338 @@
|
||||
<!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 () {
|
||||
//状态
|
||||
conditionDropDownStatus();
|
||||
//样品类别
|
||||
initDropDownSampleTypeList();
|
||||
//检测项目
|
||||
initDropDowntestItemIds()
|
||||
});
|
||||
|
||||
function showUnit4SelectFun() {
|
||||
$.post(ext.contextPath + '/user/unit4SelectModalLimitedCheck.do', {
|
||||
formId: "addForm",
|
||||
hiddenId: "deptIds",
|
||||
textId: "deptNames",
|
||||
deptIds: $('#deptIds').val()
|
||||
}, function (data) {
|
||||
$("#unit4SelectDiv").html(data);
|
||||
openModal("unit4SelectModal_Limited_Check");
|
||||
});
|
||||
}
|
||||
|
||||
function initDropDowntestItemIds() {
|
||||
var select_Data = []
|
||||
try {
|
||||
select_Data = JSON.parse('${whpTestItemDropDown}');
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
var select_3 = $("#testItemIds").select2({
|
||||
data: select_Data,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
// allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) {
|
||||
return markup;
|
||||
}, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
multiple: true,
|
||||
formatResult: function formatRepo(repo) {
|
||||
return repo.text;
|
||||
}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) {
|
||||
return repo.text;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'});
|
||||
select_3.val('').trigger('change');
|
||||
|
||||
|
||||
}
|
||||
|
||||
function initDropDownSampleTypeList() {
|
||||
console.log('${sampleTypeDropDownList}')
|
||||
var select_Data = []
|
||||
try {
|
||||
select_Data = JSON.parse('${sampleTypeDropDownList}');
|
||||
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
|
||||
var select_3 = $("#typeId").select2({
|
||||
data: select_Data,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
// allowClear: true,//允许清空
|
||||
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;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'});
|
||||
select_3.val('${sampleTypeDefaultId}').trigger('change');
|
||||
}
|
||||
|
||||
function conditionDropDownStatus() {
|
||||
var select_Data = jQuery.parseJSON('${enableDropDown}');
|
||||
var select_3 = $("#status").select2({
|
||||
data: select_Data,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示educationTypeCondition
|
||||
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;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'});
|
||||
select_3.val('1').trigger('change');
|
||||
}
|
||||
|
||||
|
||||
function saveFun() {
|
||||
//console.log($("#addForm").serialize());
|
||||
$("#addForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#addForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
var formData = new FormData($("#addForm")[0]);
|
||||
$.ajax({
|
||||
url: ext.contextPath + "/whp/baseinfo/WhpSampleCode/save.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) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
closeModal('subModal');
|
||||
} else {
|
||||
showAlert('d', '保存失败!' + data.msg);
|
||||
}
|
||||
},
|
||||
error: function (data) {
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function changeDateType() {
|
||||
let val = $('#typeId').val()
|
||||
if (val == null || val == '' || val == undefined) {
|
||||
}else {
|
||||
$.post(ext.contextPath + '/whp/baseinfo/WhpSampleCode/showdept.do', {typeId: val}, function (data) {
|
||||
let obj = JSON.parse(data)
|
||||
$('#deptIds').val(obj.deptIds)
|
||||
$('#deptNames').val(obj.deptNames)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
$("#addForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
typeId: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '样品类别不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
prefix: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '前缀不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
address: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '地点人不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
addressCode: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '地点编号不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
testItemIds: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '检测项目不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
status: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '状态不能为空'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<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强制为addForm -->
|
||||
<form class="form-horizontal" id="addForm" 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-4">
|
||||
<select onchange="changeDateType();" class="form-control" name="typeId" id="typeId"
|
||||
style="width: 100%">
|
||||
</select>
|
||||
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">* 前缀:</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" name="prefix" id="prefix" class="form-control"
|
||||
placeholder=""
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 地点:</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" name="address" id="address" class="form-control"
|
||||
placeholder="">
|
||||
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">* 地点编号:</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" name="addressCode" id="addressCode" class="form-control"
|
||||
placeholder=""
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label ">* 检测项目:</label>
|
||||
<div class="col-sm-4 ">
|
||||
|
||||
<select class="form-control" name="testItemIds" id="testItemIds"
|
||||
style="width: 100%">
|
||||
</select>
|
||||
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">* 采样车间:</label>
|
||||
<div class="col-sm-4">
|
||||
<input id="deptNames" name="deptNames" class="form-control" readonly
|
||||
onclick="showUnit4SelectFun();" placeholder="请点击选择采样车间"/>
|
||||
<input id="deptIds" name="deptIds" type="hidden" class="form-control"/>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label ">* 状态:</label>
|
||||
<div class="col-sm-4 ">
|
||||
|
||||
<select class="form-control" name="status" id="status"
|
||||
style="width: 100%">
|
||||
</select>
|
||||
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">* 是否检测:</label>
|
||||
<div class="col-sm-4">
|
||||
<select id="isTest" name="isTest" class="form-control select2">
|
||||
<option value="1" selected>检测</option>
|
||||
<option value="0">不检测</option>
|
||||
</select>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</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="saveFun()">保存
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
335
WebRoot/jsp/whp/baseinfo/WhpSampleCodeEdit.jsp
Normal file
335
WebRoot/jsp/whp/baseinfo/WhpSampleCodeEdit.jsp
Normal file
@ -0,0 +1,335 @@
|
||||
<!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 () {
|
||||
initDropDowntypeId()
|
||||
initDropDownStatus();
|
||||
initDropDowntestItemIds()
|
||||
});
|
||||
|
||||
function initDropDowntestItemIds() {
|
||||
var select_Data = []
|
||||
try{
|
||||
select_Data =JSON.parse('${whpTestItemDropDown}');
|
||||
}catch (e) {
|
||||
|
||||
}
|
||||
console.log('${whpTestItemDropDown}')
|
||||
var select_3 = $("#testItemIds").select2({
|
||||
data: select_Data,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
// allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) {
|
||||
return markup;
|
||||
}, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
multiple: true,
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo) {
|
||||
return repo.text;
|
||||
}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) {
|
||||
return repo.text;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'});
|
||||
|
||||
var itemsArr = [];
|
||||
var items = '${bean.testItemIds}';
|
||||
itemsArr = items.split(',');
|
||||
select_3.val(itemsArr).trigger("change");
|
||||
|
||||
|
||||
}
|
||||
function initDropDowntypeId() {
|
||||
console.log('${sampleTypeDropDownList}')
|
||||
var select_Data = []
|
||||
try {
|
||||
select_Data = JSON.parse('${sampleTypeDropDownList}');
|
||||
|
||||
}catch (e) {
|
||||
|
||||
}
|
||||
|
||||
var select_3 = $("#typeId").select2({
|
||||
data: select_Data,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
// allowClear: true,//允许清空
|
||||
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;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'});
|
||||
select_3.val('${bean.typeId}').trigger("change");
|
||||
}
|
||||
|
||||
function initDropDownStatus() {
|
||||
var select_Data = jQuery.parseJSON('${enableDropDown}');
|
||||
console.log(select_Data);
|
||||
var select_3 = $("#status").select2({
|
||||
data: select_Data,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
// allowClear: true,//允许清空
|
||||
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;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'});
|
||||
|
||||
select_3.val('${bean.status}').trigger("change");
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
function updateFun() {
|
||||
//console.log($("#editForm").serialize());
|
||||
$("#editForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#editForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
var formData = new FormData($("#editForm")[0]);
|
||||
$.ajax({
|
||||
url: ext.contextPath + "/whp/baseinfo/WhpSampleCode/update.do",
|
||||
type: 'POST',
|
||||
data: formData,
|
||||
async: false,
|
||||
cache: false,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
console.log(data.code)
|
||||
if (data.code == 1) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
closeModal('subModal');
|
||||
} else {
|
||||
showAlert('d', '保存失败!' + data.msg);
|
||||
}
|
||||
},
|
||||
error: function (data) {
|
||||
console.log(data)
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
var showUnit4SelectFun = function () {
|
||||
$.post(ext.contextPath + '/user/unit4SelectModalLimitedCheck.do',
|
||||
{
|
||||
formId: "editForm",
|
||||
hiddenId: "deptIds",
|
||||
textId: "deptNames",
|
||||
deptIds: $('#deptIds').val()
|
||||
}, function (data) {
|
||||
$("#unit4SelectDiv").html(data);
|
||||
openModal("unit4SelectModal_Limited_Check");
|
||||
});
|
||||
};
|
||||
$("#editForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
typeId: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '采样类型不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
prefix: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '前缀不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
address: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '地点人不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
addressCode: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '地点编号不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
testItemIds: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '检测项目不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
status: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '状态不能为空'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<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="editForm" 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-4">
|
||||
<select class="form-control" name="typeId" id="typeId"
|
||||
style="width: 100%">
|
||||
</select>
|
||||
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">* 前缀:</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" name="prefix" id="prefix" class="form-control"
|
||||
placeholder=""
|
||||
value="${bean.prefix}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 地点:</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" name="address" id="address" class="form-control"
|
||||
value="${bean.address}">
|
||||
<input type="hidden" name="id" id="id" class="form-control"
|
||||
value="${bean.id}">
|
||||
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">* 地点编号:</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" name="addressCode" id="addressCode" class="form-control"
|
||||
value="${bean.addressCode}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label ">* 检测项目:</label>
|
||||
<div class="col-sm-4 ">
|
||||
|
||||
<select class="form-control" name="testItemIds" id="testItemIds"
|
||||
style="width: 100%">
|
||||
</select>
|
||||
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">* 采样车间:</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="deptNames" name="deptNames" style="border-radius:4px;background-color: white"
|
||||
onclick="showUnit4SelectFun();" value="${bean.deptNames}" readonly placeholder="请点击选择采样车间"/>
|
||||
|
||||
<input id="deptIds" name="deptIds" type="hidden" value="${bean.deptIds}" />
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label ">* 状态:</label>
|
||||
<div class="col-sm-4 ">
|
||||
|
||||
<select class="form-control" name="status" id="status"
|
||||
style="width: 100%">
|
||||
</select>
|
||||
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">* 是否检测:</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control-isTest" name="isTest" id="isTest" style="width: 69%; height: 30px;border-radius: 5px;border: 1px solid gray;" >
|
||||
|
||||
<option value="1" <c:if test="${bean.isTest==true}"> selected="selected" </c:if> >检测</option>
|
||||
<option value="0" <c:if test="${bean.isTest==false}"> selected="selected" </c:if>>不检测</option>
|
||||
</select>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</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="updateFun()">保存
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
403
WebRoot/jsp/whp/baseinfo/WhpSampleCodeList.jsp
Normal file
403
WebRoot/jsp/whp/baseinfo/WhpSampleCodeList.jsp
Normal file
@ -0,0 +1,403 @@
|
||||
<%@ 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.sparepart.SparePartCommString" %>
|
||||
<%request.setAttribute("AUDIT", SparePartCommString.STATUS_STOCK_AUDIT); %>
|
||||
<%request.setAttribute("START", SparePartCommString.STATUS_STOCK_START); %>
|
||||
<%request.setAttribute("FINISH", SparePartCommString.STATUS_STOCK_FINISH); %>
|
||||
<%request.setAttribute("FAIL", SparePartCommString.STATUS_STOCK_FAIL); %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%>
|
||||
</title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<!-- bootstrap switch -->
|
||||
<link rel="stylesheet"
|
||||
href="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css"/>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js"
|
||||
charset="utf-8"></script>
|
||||
<!--bootstrap-edittable 表格行内编辑 -->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/plugins/bootstrap-editable/css/bootstrap-editable.css"/>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/plugins/bootstrap-editable/js/bootstrap-editable.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/plugins/bootstrap-editable/js/bootstrap-table-editable.js"
|
||||
charset="utf-8"></script>
|
||||
<style type="text/css">
|
||||
.main-header {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.content-header {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.main-footer {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
|
||||
.table-hover > tbody > tr:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.input-clear-a {
|
||||
|
||||
color: white;
|
||||
|
||||
}
|
||||
|
||||
.input-content:hover + .input-clear-a {
|
||||
|
||||
color: #d4d4d4;
|
||||
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
let selectedType = ''
|
||||
$(function () {
|
||||
conditionDropDownStatus();
|
||||
initTableList();
|
||||
inittabletreeList()
|
||||
});
|
||||
|
||||
var addFun = function () {
|
||||
$("#searchForm").bootstrapValidator('validate');//提交验证
|
||||
$.post(ext.contextPath + '/whp/baseinfo/WhpSampleCode/add.do', {unitId: unitId,selectedSampleTypeId:selectedType}, function (data) {
|
||||
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
var editFun = function (id) {
|
||||
// stopBubbleDefaultEvent();
|
||||
// console.log(id,"edit")
|
||||
$.post(ext.contextPath + '/whp/baseinfo/WhpSampleCode/edit.do', {id: id}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
var deleteFun = 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 + '/whp/baseinfo/WhpSampleCode/deletes.do', {ids: id}, function (data) {
|
||||
if (data.code === 1) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
}, "json");
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
var deletesFun = function () {
|
||||
var checkedItems = $("#table").bootstrapTable('getSelections');
|
||||
var datas = "";
|
||||
$.each(checkedItems, function (index, item) {
|
||||
datas += item.id + ",";
|
||||
});
|
||||
if (datas == "") {
|
||||
showAlert('d', '请先选择记录', 'mainAlertdiv');
|
||||
} else {
|
||||
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 + '/whp/baseinfo/WhpSampleCode/deletes.do', {ids: datas}, function (data) {
|
||||
if (data.code == 1) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
}, "json");
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
var dosearch = function () {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
};
|
||||
|
||||
var companyId_rawMaterial = "";
|
||||
|
||||
var inittabletreeList = function () {
|
||||
$('#tabletree').treeview({
|
||||
data: JSON.parse('${sampleTypeDropDown}'),
|
||||
showBordetabletreer: true,
|
||||
levels: 3,
|
||||
});
|
||||
|
||||
$('#tabletree').on('nodeSelected', function (event, node) {
|
||||
selectedType = node.id
|
||||
$("#table").bootstrapTable('refresh');
|
||||
});
|
||||
}
|
||||
var initTableList = function () {
|
||||
$('#tabletree').val()
|
||||
console.log(selectedType)
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/whp/baseinfo/WhpSampleCode/getList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order, // 排序规则
|
||||
status: $('#statusCondition').val(),//状态
|
||||
likeString: $('#likeString').val(),// 名称模糊查询
|
||||
typeId: selectedType,// 树条件
|
||||
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
//detailView: true,//父子表
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
},
|
||||
{
|
||||
field: 'sampleTypeName', // 返回json数据中的name
|
||||
title: '采样类型', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'prefix', // 返回json数据中的name
|
||||
title: '前缀', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'address', // 返回json数据中的name
|
||||
title: '地点', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'addressCode', // 返回json数据中的name
|
||||
title: '地点编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'testItemNames', // 返回json数据中的name
|
||||
title: '检测项目', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'statusName', // 返回json数据中的name
|
||||
title: '状态', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'isTest', // 返回json数据中的name
|
||||
title: '是否检测', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
if (value == true) {
|
||||
return '检测';
|
||||
} else {
|
||||
return '不检测';
|
||||
}
|
||||
}
|
||||
},{
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 160, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts = '';
|
||||
buts += '<button class="btn btn-default btn-sm" title="编辑" onclick="editFun(\'' + row.id + '\')"><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");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function conditionDropDownStatus() {
|
||||
var select_Data = jQuery.parseJSON('${enableDropDown}');
|
||||
var select_3 = $("#statusCondition").select2({
|
||||
data: select_Data,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示educationTypeCondition
|
||||
allowClear: true,//允许清空
|
||||
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;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'});
|
||||
select_3.val('').trigger('change');
|
||||
}
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<div class="content-wrapper">
|
||||
<section class="content container-fluid">
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="subDiv"></div>
|
||||
<div id="subEditDiv"></div>
|
||||
<div id="subDetailDiv"></div>
|
||||
<div id="PRDetail4SelectsDiv"></div>
|
||||
<div id="user4SelectDiv"></div>
|
||||
<div id="Goods4SelectsDiv"></div>
|
||||
<div id="fileInputDiv"></div>
|
||||
<div id="goodsAddDiv"></div>
|
||||
<div id="equ4SelectDiv"></div>
|
||||
<div id="fault4SelectDiv"></div>
|
||||
<div id="unit4SelectDiv"></div>
|
||||
<div>
|
||||
<div style="float: left;width: 20%">
|
||||
<div id="tabletree" style="height:550px;overflow:auto; "></div>
|
||||
</div>
|
||||
<div style="float: right;width:80%">
|
||||
<form id="searchForm">
|
||||
<div>
|
||||
<div class="form-group" style="padding:0;">
|
||||
<div class="btn-group" style="width: 220px;padding-bottom:10px;">
|
||||
|
||||
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="addFun();"
|
||||
style="margin-right: 15px"><i
|
||||
class="fa fa-plus"></i> 新增
|
||||
</button>
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="deletesFun();"><i
|
||||
class="fa fa-trash-o"></i> 删除
|
||||
</button>
|
||||
</div>
|
||||
<div class="form-group pull-right form-inline">
|
||||
<div class="form-group">
|
||||
<label class="form-label">状态:</label>
|
||||
<select class="form-control select2" name="statusCondition" id="statusCondition"
|
||||
style="width:180px;height: 30px">
|
||||
</select>
|
||||
</div>
|
||||
<div class="input-group input-group-sm" style="width: 250px;">
|
||||
<input type="text" id="likeString" name="likeString"
|
||||
class="form-control pull-right"
|
||||
placeholder="请输入前缀/地点">
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-default" onclick="dosearch();"><i
|
||||
class="fa fa-search"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<table id="table"></table>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<!-- 文件上传-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/css/fileinput.min.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/fileinput.min.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/locales/zh.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/JS/commonFileUpload.js" charset="utf-8"></script>
|
||||
<!-- 引入daterangepicker-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/daterangepicker.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/moment.min.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/daterangepicker.js"
|
||||
charset="utf-8"></script>
|
||||
</html>
|
||||
252
WebRoot/jsp/whp/baseinfo/WhpSampleTypeAdd.jsp
Normal file
252
WebRoot/jsp/whp/baseinfo/WhpSampleTypeAdd.jsp
Normal file
@ -0,0 +1,252 @@
|
||||
<!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" %>
|
||||
<%--<script type="text/javascript" src="https://www.jeasyui.cn/jeasyui/easyui/jquery.easyui.min.js" charset="utf-8"></script>--%>
|
||||
|
||||
|
||||
<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 () {
|
||||
|
||||
initDropDownStatus();
|
||||
initDropDownamPlingPeriod();
|
||||
|
||||
});
|
||||
|
||||
function showUnit4SelectFun() {
|
||||
$.post(ext.contextPath + '/user/unit4SelectModalLimitedCheck.do', {
|
||||
formId: "addForm",
|
||||
hiddenId: "deptIds",
|
||||
textId: "deptNames",
|
||||
deptIds: $('#deptIds').val()
|
||||
}, function (data) {
|
||||
$("#unit4SelectDiv").html(data);
|
||||
openModal("unit4SelectModal_Limited_Check");
|
||||
});
|
||||
}
|
||||
|
||||
function initDropDownStatus() {
|
||||
var select_Data = jQuery.parseJSON('${enableDropDown}');
|
||||
console.log(select_Data);
|
||||
var select_3 = $("#status").select2({
|
||||
data: select_Data,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
// allowClear: true,//允许清空
|
||||
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;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'});
|
||||
|
||||
|
||||
|
||||
}
|
||||
function initDropDownamPlingPeriod() {
|
||||
var select_Data = jQuery.parseJSON('${amplingPeriodEnumDropDown}');
|
||||
console.log(select_Data);
|
||||
var select_3 = $("#amplingPeriod").select2({
|
||||
data: select_Data,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
// allowClear: true,//允许清空
|
||||
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;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'});
|
||||
}
|
||||
|
||||
function addSaveFun() {
|
||||
$("#addForm").data("bootstrapValidator").updateStatus("deptNames","NOT_VALIDATED", null).validateField("deptNames");
|
||||
$("#addForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#addForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
var formData = new FormData($("#addForm")[0]);
|
||||
$.ajax({
|
||||
url: ext.contextPath + "/whp/baseinfo/WhpSampleType/save.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) {
|
||||
|
||||
$("#table").bootstrapTable('refresh');
|
||||
closeModal('subModal');
|
||||
} else {
|
||||
showAlert('d', '保存失败!' + data.msg);
|
||||
}
|
||||
},
|
||||
error: function (data) {
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
$("#addForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
name: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '样品名称不能为空!'
|
||||
}
|
||||
}
|
||||
},
|
||||
code: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '编码简称不能为空!'
|
||||
}
|
||||
}
|
||||
},
|
||||
deptNames: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '采样车间不能为空!'
|
||||
}
|
||||
}
|
||||
},
|
||||
status: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '状态不能为空!'
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<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强制为addForm -->
|
||||
<form class="form-horizontal" id="addForm" 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-4">
|
||||
<input type="text" name="name" id="name" class="form-control"
|
||||
placeholder="">
|
||||
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">* 编码简称:</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" name="code" id="code" class="form-control"
|
||||
placeholder="">
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 采样车间:</label>
|
||||
<div class="col-sm-4">
|
||||
<input id="deptNames" name="deptNames" class="form-control" readonly
|
||||
onclick="showUnit4SelectFun();" placeholder="请点击选择采样车间"/>
|
||||
<input id="deptIds" name="deptIds" type="hidden" class="form-control" />
|
||||
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label ">* 状态:</label>
|
||||
<div class="col-sm-4 ">
|
||||
<select class="form-control" name="status" id="status"
|
||||
style="width: 100%">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label"> 间隔类型:</label>
|
||||
<div class="col-sm-4 ">
|
||||
<select class="form-control" name="amplingPeriod" id="amplingPeriod"
|
||||
style="width: 100%">
|
||||
</select>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label"> 间隔时间:</label>
|
||||
<div class="col-sm-4 ">
|
||||
<input type="text" name="intervalDay" id="intervalDay"
|
||||
style="width: 80px" >
|
||||
<label style="position: absolute;float: right;margin-left: 10px;size: 18px;">天</label>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</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="addSaveFun()">保存
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
256
WebRoot/jsp/whp/baseinfo/WhpSampleTypeEdit.jsp
Normal file
256
WebRoot/jsp/whp/baseinfo/WhpSampleTypeEdit.jsp
Normal file
@ -0,0 +1,256 @@
|
||||
<!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 () {
|
||||
initDropDownStatus();
|
||||
initDropDownamPlingPeriod();
|
||||
});
|
||||
|
||||
function initDropDownStatus() {
|
||||
var select_Data = jQuery.parseJSON('${enableDropDown}');
|
||||
console.log(select_Data);
|
||||
|
||||
var select_3 = $("#status").select2({
|
||||
data: select_Data,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
// allowClear: true,//允许清空
|
||||
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;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'});
|
||||
|
||||
select_3.val('${bean.status}').trigger("change");
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
function initDropDownamPlingPeriod() {
|
||||
var select_Data = jQuery.parseJSON('${amplingPeriodEnumDropDown}');
|
||||
console.log(select_Data);
|
||||
var select_3 = $("#amplingPeriod").select2({
|
||||
data: select_Data,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
// allowClear: true,//允许清空
|
||||
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;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'});
|
||||
select_3.val('${bean.amplingPeriod}').trigger("change");
|
||||
}
|
||||
|
||||
function updateSaveFun() {
|
||||
$("#editForm").data("bootstrapValidator").updateStatus("deptNames","NOT_VALIDATED", null).validateField("deptNames");
|
||||
$("#editForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#editForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
var formData = new FormData($("#editForm")[0]);
|
||||
$.ajax({
|
||||
url: ext.contextPath + "/whp/baseinfo/WhpSampleType/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) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
closeModal('subModal');
|
||||
} else {
|
||||
showAlert('d', '保存失败!' + data.msg);
|
||||
}
|
||||
},
|
||||
error: function (data) {
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
$("#editForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
name: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '样品名称不能为空!'
|
||||
}
|
||||
}
|
||||
},
|
||||
code: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '编码简称不能为空!'
|
||||
}
|
||||
}
|
||||
},
|
||||
deptNames: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '采样车间不能为空!'
|
||||
}
|
||||
}
|
||||
},
|
||||
status: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '状态不能为空!'
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
var showUnit4SelectFun = function () {
|
||||
$.post(ext.contextPath + '/user/unit4SelectModalLimitedCheck.do',
|
||||
{
|
||||
formId: "editForm",
|
||||
hiddenId: "deptIds",
|
||||
textId: "deptNames",
|
||||
deptIds: $('#deptIds').val()
|
||||
}, function (data) {
|
||||
$("#unit4SelectDiv").html(data);
|
||||
openModal("unit4SelectModal_Limited_Check");
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<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="editForm" 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-4">
|
||||
<input type="hidden" name="id" id="id" class="form-control"
|
||||
value="${bean.id}"/>
|
||||
<input type="text" name="name" id="name" class="form-control"
|
||||
value="${bean.name}"/>
|
||||
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">* 编码简称:</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" name="code" id="code" class="form-control"
|
||||
value="${bean.code}"/>
|
||||
</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="deptNames" name="deptNames" style="border-radius:4px;background-color: white"
|
||||
onclick="showUnit4SelectFun();" value="${bean.deptNames}" readonly placeholder="请点击选择采样车间"/>
|
||||
|
||||
<input id="deptIds" name="deptIds" type="hidden" value="${bean.deptIds}" />
|
||||
|
||||
</div>
|
||||
<label class="col-sm-2 control-label ">* 状态:</label>
|
||||
<div class="col-sm-4 ">
|
||||
|
||||
<select class="form-control" name="status" id="status"
|
||||
style="width: 100%">
|
||||
</select>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label"> 间隔类型:</label>
|
||||
<div class="col-sm-4 ">
|
||||
<select class="form-control" name="amplingPeriod" id="amplingPeriod"
|
||||
style="width: 100%">
|
||||
</select>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label"> 间隔时间:</label>
|
||||
<div class="col-sm-4 ">
|
||||
<input type="text" name="intervalDay" id="intervalDay" value="${bean.intervalDay}"
|
||||
style="width: 80px">
|
||||
<label style="position: absolute;float: right;margin-left: 10px;size: 18px;">天</label>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</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="updateSaveFun()">保存
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
379
WebRoot/jsp/whp/baseinfo/WhpSampleTypeList.jsp
Normal file
379
WebRoot/jsp/whp/baseinfo/WhpSampleTypeList.jsp
Normal file
@ -0,0 +1,379 @@
|
||||
<%@ 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.sparepart.SparePartCommString" %>
|
||||
<%request.setAttribute("AUDIT", SparePartCommString.STATUS_STOCK_AUDIT); %>
|
||||
<%request.setAttribute("START", SparePartCommString.STATUS_STOCK_START); %>
|
||||
<%request.setAttribute("FINISH", SparePartCommString.STATUS_STOCK_FINISH); %>
|
||||
<%request.setAttribute("FAIL", SparePartCommString.STATUS_STOCK_FAIL); %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%>
|
||||
</title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<!-- bootstrap switch -->
|
||||
<link rel="stylesheet"
|
||||
href="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css"/>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js"
|
||||
charset="utf-8"></script>
|
||||
<!--bootstrap-edittable 表格行内编辑 -->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/plugins/bootstrap-editable/css/bootstrap-editable.css"/>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/plugins/bootstrap-editable/js/bootstrap-editable.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/plugins/bootstrap-editable/js/bootstrap-table-editable.js"
|
||||
charset="utf-8"></script>
|
||||
<style type="text/css">
|
||||
.main-header {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.content-header {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.main-footer {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
|
||||
.table-hover > tbody > tr:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.input-clear-a {
|
||||
|
||||
color: white;
|
||||
|
||||
}
|
||||
|
||||
.input-content:hover + .input-clear-a {
|
||||
|
||||
color: #d4d4d4;
|
||||
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
conditionDropDownStatus();
|
||||
initTableList();
|
||||
});
|
||||
|
||||
var addFun = function () {
|
||||
$("#searchForm").bootstrapValidator('validate');//提交验证
|
||||
$.post(ext.contextPath + '/whp/baseinfo/WhpSampleType/add.do', {unitId: unitId}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
var editFun = function (id) {
|
||||
// stopBubbleDefaultEvent();
|
||||
// console.log(id,"edit")
|
||||
|
||||
$.post(ext.contextPath + '/whp/baseinfo/WhpSampleType/edit.do', {id: id}, function (data) {
|
||||
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
var deleteFun = 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 + '/whp/baseinfo/WhpSampleType/deletes.do', {ids: id}, function (data) {
|
||||
if (data.code === 1) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
}, "json");
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
var deletesFun = function () {
|
||||
var checkedItems = $("#table").bootstrapTable('getSelections');
|
||||
var datas = "";
|
||||
$.each(checkedItems, function (index, item) {
|
||||
datas += item.id + ",";
|
||||
});
|
||||
if (datas == "") {
|
||||
showAlert('d', '请先选择记录', 'mainAlertdiv');
|
||||
} else {
|
||||
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 + '/whp/baseinfo/WhpSampleType/deletes.do', {ids: datas}, function (data) {
|
||||
console.log("shanchu",data)
|
||||
if (data.code == 1) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', data.msg, 'mainAlertdiv');
|
||||
}
|
||||
}, "json");
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
var dosearch = function () {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
};
|
||||
|
||||
var companyId_rawMaterial = "";
|
||||
|
||||
var initTableList = function () {
|
||||
timeRangeEnd = null;
|
||||
timeRangeBegin = null;
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/whp/baseinfo/WhpSampleType/getList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order, // 排序规则
|
||||
status: $('#statusCondition').val(),//状态
|
||||
likeString: $('#likeString').val(), // 模糊查询
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
//detailView: true,//父子表
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
},
|
||||
{
|
||||
field: 'name', // 返回json数据中的name
|
||||
title: '采样类型', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'code', // 返回json数据中的name
|
||||
title: '编码简称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'deptNames', // 返回json数据中的name
|
||||
title: '采样车间', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'amplingPeriodName', // 返回json数据中的name
|
||||
title: '间隔类型', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'intervalDay', // 返回json数据中的name
|
||||
title: '间隔时间', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'statusName', // 返回json数据中的name
|
||||
title: '状态', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
}, {
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 160, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts = '';
|
||||
buts += '<button class="btn btn-default btn-sm" title="编辑" onclick="editFun(\'' + row.id + '\')"><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");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function conditionDropDownStatus() {
|
||||
var select_Data = jQuery.parseJSON('${enableDropDown}');
|
||||
var select_3 = $("#statusCondition").select2({
|
||||
data: select_Data,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示educationTypeCondition
|
||||
allowClear: true,//允许清空
|
||||
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;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'});
|
||||
select_3.val('').trigger('change');
|
||||
}
|
||||
|
||||
function conditionDropDownAddress() {
|
||||
var select_Data = jQuery.parseJSON('${address}');
|
||||
|
||||
var select_3 = $("#addressInput").select2({
|
||||
data: select_Data,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示educationTypeCondition
|
||||
allowClear: true,//允许清空
|
||||
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;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'});
|
||||
select_3.val('').trigger('change');
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<div class="content-wrapper">
|
||||
<section class="content container-fluid">
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="subDiv"></div>
|
||||
<div id="subEditDiv"></div>
|
||||
<div id="subDetailDiv"></div>
|
||||
<div id="PRDetail4SelectsDiv"></div>
|
||||
<div id="user4SelectDiv"></div>
|
||||
<div id="Goods4SelectsDiv"></div>
|
||||
<div id="fileInputDiv"></div>
|
||||
<div id="goodsAddDiv"></div>
|
||||
<div id="equ4SelectDiv"></div>
|
||||
<div id="fault4SelectDiv"></div>
|
||||
<div id="unit4SelectDiv"></div>
|
||||
|
||||
<form id="searchForm">
|
||||
<div>
|
||||
<div class="form-group" style="padding:0;">
|
||||
<div class="btn-group" style="width: 220px;padding-bottom:10px;">
|
||||
|
||||
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="addFun();"
|
||||
style="margin-right: 15px"><i
|
||||
class="fa fa-plus"></i> 新增
|
||||
</button>
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="deletesFun();"><i
|
||||
class="fa fa-trash-o"></i> 删除
|
||||
</button>
|
||||
</div>
|
||||
<div class="form-group pull-right form-inline">
|
||||
<div class="form-group">
|
||||
<label class="form-label">状态:</label>
|
||||
<select class="form-control select2" name="statusCondition" id="statusCondition"
|
||||
style="width:180px;height: 30px">
|
||||
</select>
|
||||
</div>
|
||||
<div class="input-group input-group-sm" style="width: 250px;">
|
||||
<input type="text" id="likeString" name="likeString" class="form-control pull-right"
|
||||
placeholder="请输入编码采样类型或者编码简称">
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-default" onclick="dosearch();"><i class="fa fa-search"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<table id="table"></table>
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
315
WebRoot/jsp/whp/baseinfo/WhpTestItemAdd.jsp
Normal file
315
WebRoot/jsp/whp/baseinfo/WhpTestItemAdd.jsp
Normal file
@ -0,0 +1,315 @@
|
||||
<!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;
|
||||
}
|
||||
|
||||
.form-horizontal {
|
||||
padding-top: 20px;
|
||||
|
||||
}
|
||||
|
||||
.right {
|
||||
margin-left: 50px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
|
||||
initDropDownStatus();
|
||||
// initDropDownequipmentId()
|
||||
});
|
||||
|
||||
function initDropDownequipmentId() {
|
||||
var select_Data = []
|
||||
try {
|
||||
select_Data = JSON.parse('${equipmentDropDown}');
|
||||
|
||||
}catch (e) {
|
||||
|
||||
}
|
||||
console.log('${equipmentDropDown}')
|
||||
var select_3 = $("#equipmentId").select2({
|
||||
data: select_Data,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
// allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) {
|
||||
return markup;
|
||||
}, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
multiple: true,
|
||||
formatResult: function formatRepo(repo) {
|
||||
return repo.text;
|
||||
}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) {
|
||||
return repo.text;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'});
|
||||
select_3.val('').trigger('change');
|
||||
|
||||
|
||||
}
|
||||
function initDropDownStatus() {
|
||||
var select_Data = jQuery.parseJSON('${enableDropDown}');
|
||||
var select_3 = $("#status").select2({
|
||||
data: select_Data,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
// allowClear: true,//允许清空
|
||||
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;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'});
|
||||
select_3.val('1').trigger('change');
|
||||
|
||||
|
||||
}
|
||||
function showUnit4SelectFun() {
|
||||
$.post(ext.contextPath + '/user/unit4SelectModalLimitedCheck.do', {
|
||||
formId: "addForm",
|
||||
hiddenId: "deptIds",
|
||||
textId: "deptNames",
|
||||
deptIds: $('#deptIds').val()
|
||||
}, function (data) {
|
||||
$("#unit4SelectDiv").html(data);
|
||||
openModal("unit4SelectModal_Limited_Check");
|
||||
});
|
||||
}
|
||||
|
||||
function saveFun() {
|
||||
$("#addForm").data("bootstrapValidator").updateStatus("confirmUserName","NOT_VALIDATED", null).validateField("confirmUserName");
|
||||
$("#addForm").data("bootstrapValidator").updateStatus("deptNames","NOT_VALIDATED", null).validateField("deptNames");
|
||||
$("#addForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#addForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
var formData = new FormData($("#addForm")[0]);
|
||||
$.ajax({
|
||||
url: ext.contextPath + "/whp/baseinfo/WhpTestItem/save.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) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
closeModal('subModal');
|
||||
} else {
|
||||
showAlert('d', '保存失败!' + data.msg);
|
||||
}
|
||||
},
|
||||
error: function (data) {
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
$("#addForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
name: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '检测项目不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
equipmentId: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '仪器设备不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
deptNames: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '检测部门不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
confirmUserName: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '检验复核人不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
testAddress: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '测定地点不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
status: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '状态不能为空'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
// 检查人员
|
||||
function selectdutyUser() {
|
||||
$.post(ext.contextPath + '/user/userForOneSelect.do',
|
||||
{
|
||||
formId: "addForm",
|
||||
hiddenId: "confirmUserId",
|
||||
textId: "confirmUserName"
|
||||
},
|
||||
function (data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal('user4SelectModal');
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
|
||||
// 选择设备
|
||||
function selectEquipment() {
|
||||
$.post(ext.contextPath + '/whp/baseinfo/WhpEquipment/WhpEquipmentForOneSelect.do',
|
||||
{
|
||||
formId: "addForm",
|
||||
hiddenId: "equipmentId",
|
||||
textId: "equipmentName"
|
||||
},
|
||||
function (data) {
|
||||
$("#equ4SelectDiv").html(data);
|
||||
openModal('equ4SelectModal');
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<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强制为addForm -->
|
||||
<form class="form-horizontal" id="addForm" 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-4">
|
||||
<input name="bizId" type="hidden" value="${company.id}"/>
|
||||
<p class="form-control-static" >${company.name}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">* 使用试剂:</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" name="reagent" id="reagent" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 检测项目名称:</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" name="name" id="name" class="form-control"
|
||||
placeholder="">
|
||||
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">* 仪器设备:</label>
|
||||
<div class="col-sm-4">
|
||||
<input id="equipmentId" name="equipmentId" type="hidden" value=""/>
|
||||
<input class="form-control" id="equipmentName" name="equipmentName"
|
||||
onclick="selectEquipment();"
|
||||
placeholder="请先选择设备" autocomplete="off">
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 检测部门:</label>
|
||||
<div class="col-sm-4">
|
||||
<%-- <input type="text" name="deptIds" id="deptIds" class="form-control"--%>
|
||||
<%-- placeholder="">--%>
|
||||
<input id="deptNames" name="deptNames" class="form-control" readonly
|
||||
onclick="showUnit4SelectFun();" placeholder="请点击选择检测部门"/>
|
||||
<input id="deptIds" name="deptIds" type="hidden" class="form-control" />
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">* 检验复核人:</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" id="confirmUserName" name="confirmUserName" class="form-control"
|
||||
placeholder="请选择.." readonly onclick="selectdutyUser()" >
|
||||
<input type="hidden" id="confirmUserId" name="confirmUserId" class="form-control"
|
||||
placeholder="请选择.." >
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 测定地点:</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" name="testAddress" id="testAddress" class="form-control">
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label ">* 状态:</label>
|
||||
<div class="col-sm-4 ">
|
||||
|
||||
<select class="form-control" name="status" id="status"
|
||||
style="width: 100%">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</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="saveFun()">保存
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
147
WebRoot/jsp/whp/baseinfo/WhpTestItemBasicAdd.jsp
Normal file
147
WebRoot/jsp/whp/baseinfo/WhpTestItemBasicAdd.jsp
Normal file
@ -0,0 +1,147 @@
|
||||
<!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 BasicaddSaveFun() {
|
||||
//console.log($("#addForm").serialize());
|
||||
$("#BasicaddForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#BasicaddForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
var formData = new FormData($("#BasicaddForm")[0]);
|
||||
$.ajax({
|
||||
url: ext.contextPath + '/whp/baseinfo/WhpTestItemWorkingCurve/save.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) {
|
||||
|
||||
$("#Workingtable").bootstrapTable('refresh');
|
||||
closeModal('constantsubs');
|
||||
} else {
|
||||
showAlert('d', '保存失败!' + data.msg);
|
||||
}
|
||||
},
|
||||
error: function (data) {
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
$("#BasicaddForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
parmname: {validators: {notEmpty: {message: '检测项目不能为空'}}},
|
||||
// unit: {validators: {notEmpty: {message: '简称不能为空'}}},
|
||||
sort: {validators: {notEmpty: {message: '顺序不能为空'}}},
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
</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强制为addForm -->
|
||||
<form class="form-horizontal" id="BasicaddForm" 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" name="name" id="parmname"
|
||||
placeholder="请输入" class="form-control">
|
||||
<input type="hidden" readonly name="mpid" id="mpid" value="1"
|
||||
class="form-control">
|
||||
<input type="hidden" style="width: 100%;" name="formulatype" id="formulatype" value="0" class="form-control">
|
||||
|
||||
<input type="hidden" readonly name="test_item_id" id="test_item_id" value="${test_item_id}"
|
||||
class="form-control">
|
||||
<input type="hidden" readonly name="default_value" id="default_value" value="0"
|
||||
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="unit" id="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" 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="BasicaddSaveFun()">保存
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
147
WebRoot/jsp/whp/baseinfo/WhpTestItemBasicEdit.jsp
Normal file
147
WebRoot/jsp/whp/baseinfo/WhpTestItemBasicEdit.jsp
Normal file
@ -0,0 +1,147 @@
|
||||
<!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 BasicupdataFun() {
|
||||
//console.log($("#addForm").serialize());
|
||||
$("#BasiceditForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#BasiceditForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
var formData = new FormData($("#BasiceditForm")[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) {
|
||||
|
||||
$("#Workingtable").bootstrapTable('refresh');
|
||||
closeModal('constantsubs');
|
||||
} else {
|
||||
showAlert('d', '保存失败!' + data.msg);
|
||||
}
|
||||
},
|
||||
error: function (data) {
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
$("#BasiceditForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
parmname: {validators: {notEmpty: {message: '检测项目不能为空'}}},
|
||||
// disname: {validators: {notEmpty: {message: '简称不能为空'}}},
|
||||
sort: {validators: {notEmpty: {message: '顺序不能为空'}}},
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
</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强制为addForm -->
|
||||
<form class="form-horizontal" id="BasiceditForm" 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" name="name" id="parmname" value="${bean.name}"
|
||||
placeholder="请输入" class="form-control">
|
||||
|
||||
<input type="hidden" style="width: 100%;" name="formulatype" id="formulatype" value="0" class="form-control">
|
||||
|
||||
<input type="hidden" readonly name="test_item_id" id="test_item_id" value="${bean.test_item_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.unit}" name="unit" id="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.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="BasicupdataFun()">保存
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
648
WebRoot/jsp/whp/baseinfo/WhpTestItemEdit.jsp
Normal file
648
WebRoot/jsp/whp/baseinfo/WhpTestItemEdit.jsp
Normal file
@ -0,0 +1,648 @@
|
||||
<!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;
|
||||
}
|
||||
/*.fixed-table-pagination div{
|
||||
display: none;
|
||||
}*/
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
initDropDownstatus();
|
||||
//initDropDownequipmentId()
|
||||
initconstantTableList()
|
||||
initWorkingTableList()
|
||||
});
|
||||
|
||||
function initDropDownequipmentId() {
|
||||
var select_Data = []
|
||||
try {
|
||||
select_Data = JSON.parse('${equipmentDropDown}');
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
var select_3 = $("#equipmentId").select2({
|
||||
data: select_Data,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
// allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) {
|
||||
return markup;
|
||||
}, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
multiple: true,
|
||||
formatResult: function formatRepo(repo) {
|
||||
return repo.text;
|
||||
}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) {
|
||||
return repo.text;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'});
|
||||
select_3.val('${bean.equipmentId}'.split(",")).trigger("change");
|
||||
|
||||
|
||||
}
|
||||
|
||||
function initDropDownstatus() {
|
||||
var select_Data = []
|
||||
try {
|
||||
select_Data = JSON.parse('${enableDropDown}');
|
||||
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
|
||||
var select_3 = $("#status").select2({
|
||||
data: select_Data,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
// allowClear: true,//允许清空
|
||||
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;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'});
|
||||
select_3.val('${bean.status}').trigger("change");
|
||||
}
|
||||
|
||||
var showUnit4SelectFun = function () {
|
||||
$.post(ext.contextPath + '/user/unit4SelectModalLimitedCheck.do',
|
||||
{
|
||||
formId: "editForm",
|
||||
hiddenId: "deptIds",
|
||||
textId: "deptNames",
|
||||
deptIds: $('#deptIds').val()
|
||||
}, function (data) {
|
||||
$("#unit4SelectDiv").html(data);
|
||||
openModal("unit4SelectModal_Limited_Check");
|
||||
});
|
||||
};
|
||||
|
||||
function updateFun() {
|
||||
$("#editForm").data("bootstrapValidator").updateStatus("confirmUserName", "NOT_VALIDATED", null).validateField("confirmUserName");
|
||||
$("#editForm").data("bootstrapValidator").updateStatus("deptNames", "NOT_VALIDATED", null).validateField("deptNames");
|
||||
$("#editForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#editForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
var formData = new FormData($("#editForm")[0]);
|
||||
$.ajax({
|
||||
url: ext.contextPath + "/whp/baseinfo/WhpTestItem/update.do",
|
||||
type: 'POST',
|
||||
data: formData,
|
||||
async: false,
|
||||
cache: false,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
console.log(data.code)
|
||||
if (data.code == 1) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
closeModal('subModal');
|
||||
} else {
|
||||
showAlert('d', '保存失败!' + data.msg);
|
||||
}
|
||||
},
|
||||
error: function (data) {
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
$("#editForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
name: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '检测项目不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
equipmentId: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '仪器设备不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
deptNames: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '检测部门不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
confirmUserName: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '检验复核人不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
testAddress: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '检测项目名称不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
status: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '状态不能为空'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// 检查人员
|
||||
function selectdutyUser() {
|
||||
$.post(ext.contextPath + '/user/userForOneSelect.do',
|
||||
{
|
||||
formId: "editForm",
|
||||
hiddenId: "confirmUserId",
|
||||
textId: "confirmUserName"
|
||||
},
|
||||
function (data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal('user4SelectModal');
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
// 选择设备
|
||||
function selectEquipment() {
|
||||
$.post(ext.contextPath + '/whp/baseinfo/WhpEquipment/WhpEquipmentForOneSelect.do',
|
||||
{
|
||||
formId: "editForm",
|
||||
hiddenId: "equipmentId",
|
||||
textId: "equipmentName"
|
||||
},
|
||||
function (data) {
|
||||
$("#equ4SelectDiv").html(data);
|
||||
openModal('equ4SelectModal');
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
function initconstantTableList() {
|
||||
|
||||
$("#constanttable").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/whp/baseinfo/WhpTestItemWorkingCurve/getList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
likeString: '',
|
||||
status: '',
|
||||
formulatype:'1',
|
||||
test_item_id:'${bean.id}'
|
||||
|
||||
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
//detailView: true,//父子表
|
||||
columns: [
|
||||
{
|
||||
field: 'MPoint.parmname',
|
||||
title: '名称',
|
||||
align: 'center',
|
||||
valign: 'middle'
|
||||
},
|
||||
{
|
||||
field: 'MPoint.disname',
|
||||
title: '简称',
|
||||
align: 'center',
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'MPoint.unit',
|
||||
title: '单位',
|
||||
align: 'center',
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'MPoint.numtail',
|
||||
title: '小数位数',
|
||||
align: 'center',
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'defaultValue',
|
||||
title: '默认值',
|
||||
align: 'center',
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'sort',
|
||||
title: '顺序',
|
||||
align: 'center',
|
||||
valign: 'middle'
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 160, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts = '';
|
||||
buts += '<button class="btn btn-default btn-sm" title="编辑" onclick="constanteditFun(\'' + row.id + '\')"><i class="fa fa-edit"></i><span class="hidden-md hidden-lg"> 编辑</span></button>';
|
||||
buts += '<button class="btn btn-default btn-sm" title="删除" onclick="constantdeleteFun(\'' + 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("constanttable");
|
||||
console.log()
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
});
|
||||
}
|
||||
function initWorkingTableList() {
|
||||
|
||||
$("#Workingtable").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/whp/baseinfo/WhpTestItemWorkingCurve/getList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
likeString: '',
|
||||
status: '',
|
||||
formulatype:'0'+','+'2'+','+'3',
|
||||
test_item_id:'${bean.id}'
|
||||
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
//detailView: true,//父子表
|
||||
columns: [
|
||||
{
|
||||
field: 'MPoint.parmname',
|
||||
title: '名称',
|
||||
align: 'center',
|
||||
valign: 'middle'
|
||||
},
|
||||
{
|
||||
field: 'MPoint.disname',
|
||||
title: '简称',
|
||||
align: 'center',
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'formulaName',
|
||||
title: '公式类型',
|
||||
align: 'center',
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'MPoint.exp',
|
||||
title: '公式内容',
|
||||
align: 'center',
|
||||
valign: 'middle'
|
||||
},{
|
||||
field: 'MPoint.unit',
|
||||
title: '单位',
|
||||
align: 'center',
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'MPoint.numtail',
|
||||
title: '小数位数',
|
||||
align: 'center',
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'sort',
|
||||
title: '顺序',
|
||||
align: 'center',
|
||||
valign: 'middle'
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 160, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts = '';
|
||||
buts += '<button class="btn btn-default btn-sm" title="编辑" onclick="WorkingeditFun(\'' + row.id + '\')"><i class="fa fa-edit"></i><span class="hidden-md hidden-lg"> 编辑</span></button>';
|
||||
buts += '<button class="btn btn-default btn-sm" title="删除" onclick="WorkingdeleteFun(\'' + 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("Workingtable");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
});
|
||||
}
|
||||
//常量删除
|
||||
var constantdeleteFun = 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 + '/whp/baseinfo/WhpTestItemWorkingCurve/deletes.do', {ids: id}, function (data) {
|
||||
if (data.code === 1) {
|
||||
$("#constanttable").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
}, "json");
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
//工作曲线删除
|
||||
var WorkingdeleteFun = 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 + '/whp/baseinfo/WhpTestItemWorkingCurve/deletes.do', {ids: id}, function (data) {
|
||||
if (data.code === 1) {
|
||||
$("#Workingtable").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
}, "json");
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
//常量新增
|
||||
var addconstant = function () {
|
||||
$("#constantsearchForm").bootstrapValidator('validate');//提交验证
|
||||
$.post(ext.contextPath + '/whp/baseinfo/WhpTestItemWorkingCurve/constantadd.do', {unitId: unitId,test_item_id:'${bean.id}'}, function (data) {
|
||||
$("#constantsub").html(data);
|
||||
openModal('constantsubs');
|
||||
});
|
||||
};
|
||||
//常量编辑弹窗
|
||||
var constanteditFun = function (id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/whp/baseinfo/WhpTestItemWorkingCurve/constantedit.do', {id: id}, function (data) {
|
||||
$("#constantsub").html(data);
|
||||
openModal('constantsubs');
|
||||
});
|
||||
};
|
||||
//工作曲线编辑弹窗
|
||||
var WorkingeditFun = function (id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/whp/baseinfo/WhpTestItemWorkingCurve/edit.do', {id: id}, function (data) {
|
||||
$("#constantsub").html(data);
|
||||
openModal('constantsubs');
|
||||
});
|
||||
};
|
||||
//工作曲线新增
|
||||
var addWorking = function () {
|
||||
$("#constantsearchForm").bootstrapValidator('validate');//提交验证
|
||||
$.post(ext.contextPath + '/whp/baseinfo/WhpTestItemWorkingCurve/add.do', {unitId: unitId,test_item_id:'${bean.id}'}, function (data) {
|
||||
$("#constantsub").html(data);
|
||||
openModal('constantsubs');
|
||||
});
|
||||
};
|
||||
//基础描述新增
|
||||
var addBasic = function () {
|
||||
$("#constantsearchForm").bootstrapValidator('validate');//提交验证
|
||||
$.post(ext.contextPath + '/whp/baseinfo/WhpTestItemWorkingCurve/basicadd.do', {unitId: unitId,test_item_id:'${bean.id}'}, function (data) {
|
||||
$("#constantsub").html(data);
|
||||
openModal('constantsubs');
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<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="editForm" 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-4">
|
||||
<input name="bizId" type="hidden" value="${bean.company.id}"/>
|
||||
<p class="form-control-static">${bean.company.name}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">使用试剂:</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" name="reagent" id="reagent" class="form-control"
|
||||
value="${bean.reagent}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 检测项目名称:</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" name="name" id="name" class="form-control"
|
||||
value="${bean.name}">
|
||||
<input type="hidden" name="id" id="id" class="form-control"
|
||||
value="${bean.id}">
|
||||
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">* 仪器设备:</label>
|
||||
<div class="col-sm-4">
|
||||
<input id="equipmentId" name="equipmentId" type="hidden" value="${bean.equipmentId}"/>
|
||||
<input class="form-control" id="equipmentName" name="equipmentNames" value="${bean.equipmentName}"
|
||||
onclick="selectEquipment();"
|
||||
placeholder="请先选择设备" autocomplete="off">
|
||||
</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="deptNames" name="deptNames"
|
||||
style="border-radius:4px;background-color: white"
|
||||
onclick="showUnit4SelectFun();" value="${bean.deptNames}" readonly
|
||||
placeholder="请点击选择采样车间"/>
|
||||
|
||||
<input id="deptIds" name="deptIds" type="hidden" value="${bean.deptIds}"/>
|
||||
<%-- <input type="text" name="deptIds" id="deptIds" class="form-control"--%>
|
||||
<%-- value="${bean.deptIds}">--%>
|
||||
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">* 检验复核人:</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" id="confirmUserName" name="confirmUserName" class="form-control"
|
||||
placeholder="请选择.." readonly onclick="selectdutyUser()"
|
||||
value="${bean.confirmUserName}">
|
||||
<input type="hidden" id="confirmUserId" name="confirmUserId" class="form-control"
|
||||
placeholder="请选择.." value="${bean.confirmUserId}">
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 测定地点:</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" name="testAddress" id="testAddress" class="form-control"
|
||||
value="${bean.testAddress}">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label ">* 状态:</label>
|
||||
<div class="col-sm-4 ">
|
||||
|
||||
<select class="form-control" name="status" id="status"
|
||||
style="width: 100%">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<form id="constantsearchForm">
|
||||
<div style="margin-left: 15px">
|
||||
<span>常量</span>
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="addconstant();"
|
||||
style="margin-left: 15px;margin-bottom: 5px;"><i
|
||||
class="fa fa-plus"></i> 新增
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
<table id="constanttable"></table>
|
||||
<form id="WorkingsearchForm">
|
||||
<div style="margin-left: 15px">
|
||||
<span>工作曲线:</span>
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="addWorking();"
|
||||
style="margin-left: 15px;margin-bottom: 5px;margin-top: 2px"><i
|
||||
class="fa fa-plus"></i> 新增
|
||||
</button>
|
||||
<span style="margin-left: 10px">基础描述:</span>
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="addBasic();"
|
||||
style="margin-left: 15px;margin-bottom: 5px;margin-top: 2px"><i
|
||||
class="fa fa-plus"></i> 新增
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
<table id="Workingtable"></table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</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="updateFun()">保存
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
419
WebRoot/jsp/whp/baseinfo/WhpTestItemList.jsp
Normal file
419
WebRoot/jsp/whp/baseinfo/WhpTestItemList.jsp
Normal file
@ -0,0 +1,419 @@
|
||||
<%@ 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.sparepart.SparePartCommString" %>
|
||||
<%request.setAttribute("AUDIT", SparePartCommString.STATUS_STOCK_AUDIT); %>
|
||||
<%request.setAttribute("START", SparePartCommString.STATUS_STOCK_START); %>
|
||||
<%request.setAttribute("FINISH", SparePartCommString.STATUS_STOCK_FINISH); %>
|
||||
<%request.setAttribute("FAIL", SparePartCommString.STATUS_STOCK_FAIL); %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%>
|
||||
</title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<!-- bootstrap switch -->
|
||||
<link rel="stylesheet"
|
||||
href="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css"/>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js"
|
||||
charset="utf-8"></script>
|
||||
<!--bootstrap-edittable 表格行内编辑 -->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/plugins/bootstrap-editable/css/bootstrap-editable.css"/>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/plugins/bootstrap-editable/js/bootstrap-editable.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/plugins/bootstrap-editable/js/bootstrap-table-editable.js"
|
||||
charset="utf-8"></script>
|
||||
<style type="text/css">
|
||||
.main-header {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.content-header {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.main-footer {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
|
||||
.table-hover > tbody > tr:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.input-clear-a {
|
||||
|
||||
color: white;
|
||||
|
||||
}
|
||||
|
||||
.input-content:hover + .input-clear-a {
|
||||
|
||||
color: #d4d4d4;
|
||||
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
|
||||
conditionDropDownStatus();
|
||||
conditionDropDownOrg();
|
||||
initTableList();
|
||||
});
|
||||
|
||||
var addFun = function () {
|
||||
$("#searchForm").bootstrapValidator('validate');//提交验证
|
||||
$.post(ext.contextPath + '/whp/baseinfo/WhpTestItem/add.do', {unitId: unitId}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
var editFun = function (id) {
|
||||
// stopBubbleDefaultEvent();
|
||||
// console.log(id,"edit")
|
||||
$.post(ext.contextPath + '/whp/baseinfo/WhpTestItem/edit.do', {id: id}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
//工作曲线列表
|
||||
// var settingFun = function (id) {
|
||||
// $.post(ext.contextPath + '/whp/baseinfo/WhpTestItemWorkingCurve/showList.do', {id: id}, function (data) {
|
||||
// $("#subDiv").html(data);
|
||||
// openModal('subModal');
|
||||
// });
|
||||
// };
|
||||
|
||||
var deleteFun = 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 + '/whp/baseinfo/WhpTestItem/deletes.do', {ids: id}, function (data) {
|
||||
if (data.code === 1) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
}, "json");
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
var deletesFun = function () {
|
||||
var checkedItems = $("#table").bootstrapTable('getSelections');
|
||||
var datas = "";
|
||||
$.each(checkedItems, function (index, item) {
|
||||
datas += item.id + ",";
|
||||
});
|
||||
if (datas == "") {
|
||||
showAlert('d', '请先选择记录', 'mainAlertdiv');
|
||||
} else {
|
||||
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 + '/whp/baseinfo/WhpTestItem/deletes.do', {ids: datas}, function (data) {
|
||||
if (data.code == 1) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
}, "json");
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
var dosearch = function () {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
|
||||
};
|
||||
|
||||
var companyId_rawMaterial = "";
|
||||
|
||||
var initTableList = function () {
|
||||
|
||||
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/whp/baseinfo/WhpTestItem/getList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order, // 排序规则
|
||||
status: $('#statusCondition').val(),//状态
|
||||
deptIds: $('#deptIdsCondition').val()&&$('#deptIdsCondition').val()!=''?$('#deptIdsCondition').val().join(','):'', // 部门模糊查询
|
||||
likeString: $('#likeString').val() // 名称模糊查询
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
//detailView: true,//父子表
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
},
|
||||
{
|
||||
field: 'name', // 返回json数据中的name
|
||||
title: '检测项目名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'workingCurveStr', // 返回json数据中的name
|
||||
title: '工作曲线', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'equipmentName', // 返回json数据中的name
|
||||
title: '仪器设备', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'deptNames', // 返回json数据中的name
|
||||
title: '检测部门', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'confirmUserName', // 返回json数据中的name
|
||||
title: '检验复核人', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'testAddress', // 返回json数据中的name
|
||||
title: '测定地点', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'statusName', // 返回json数据中的name
|
||||
title: '状态', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
},{
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 160, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts = '';
|
||||
buts += '<button class="btn btn-default btn-sm" title="编辑" onclick="editFun(\'' + row.id + '\')"><i class="fa fa-edit"></i><span class="hidden-md hidden-lg"> 编辑</span></button>';
|
||||
// buts += '<button class="btn btn-default btn-sm" title="工作曲线" onclick="settingFun(\'' + row.id + '\')"><i class="glyphicon glyphicon-flash"></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");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function conditionDropDownStatus() {
|
||||
var select_Data = jQuery.parseJSON('${enableDropDown}');
|
||||
var select_3 = $("#statusCondition").select2({
|
||||
data: select_Data,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示educationTypeCondition
|
||||
allowClear: true,//允许清空
|
||||
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;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'});
|
||||
select_3.val('').trigger('change');
|
||||
}
|
||||
|
||||
function conditionDropDownOrg() {
|
||||
var select_Data = jQuery.parseJSON('${deptDropDown}');
|
||||
|
||||
var select_3 = $("#deptIdsCondition").select2({
|
||||
data: select_Data,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示educationTypeCondition
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) {
|
||||
return markup;
|
||||
}, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
multiple : true,
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo) {
|
||||
return repo.text;
|
||||
}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) {
|
||||
return repo.text;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'});
|
||||
select_3.val('').trigger('change');
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<div class="content-wrapper">
|
||||
<section class="content container-fluid">
|
||||
<div id="mainAlertdiv"></div>
|
||||
|
||||
<div id="subDiv"></div>
|
||||
<div id="TtemWorking"></div>
|
||||
|
||||
<div id="subEditDiv"></div>
|
||||
<div id="subDetailDiv"></div>
|
||||
<div id="PRDetail4SelectsDiv"></div>
|
||||
<div id="user4SelectDiv"></div>
|
||||
|
||||
<div id="Goods4SelectsDiv"></div>
|
||||
<div id="fileInputDiv"></div>
|
||||
<div id="goodsAddDiv"></div>
|
||||
<div id="equ4SelectDiv"></div>
|
||||
<div id="fault4SelectDiv"></div>
|
||||
<div id="unit4SelectDiv"></div>
|
||||
<div id="constantsub"></div>
|
||||
<div id="mpSelectDiv"></div>
|
||||
|
||||
<form id="searchForm">
|
||||
<div>
|
||||
<div class="form-group" style="padding:0;">
|
||||
<div class="btn-group" style="width: 220px;padding-bottom:10px;">
|
||||
|
||||
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="addFun();"
|
||||
style="margin-right: 15px"><i
|
||||
class="fa fa-plus"></i> 新增
|
||||
</button>
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="deletesFun();"><i
|
||||
class="fa fa-trash-o"></i> 删除
|
||||
</button>
|
||||
</div>
|
||||
<div class="form-group pull-right form-inline">
|
||||
<div class="form-group">
|
||||
<label class="form-label">检测部门:</label>
|
||||
<select class="form-control select2" name="deptIdsCondition" id="deptIdsCondition"
|
||||
style="width:230px;height: 30px">
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-label">状态:</label>
|
||||
<select class="form-control select2" name="statusCondition" id="statusCondition"
|
||||
style="width:180px;height: 30px">
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="input-group input-group-sm" style="width: 250px;">
|
||||
<input type="text" id="likeString" name="likeString" class="form-control pull-right"
|
||||
placeholder="请输入检测项目名称">
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-default" onclick="dosearch();"><i class="fa fa-search"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<table id="table"></table>
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<!-- 文件上传-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/css/fileinput.min.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/fileinput.min.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/locales/zh.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/JS/commonFileUpload.js" charset="utf-8"></script>
|
||||
<!-- 引入daterangepicker-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/daterangepicker.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/moment.min.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/daterangepicker.js"
|
||||
charset="utf-8"></script>
|
||||
</html>
|
||||
295
WebRoot/jsp/whp/baseinfo/WhpTestItemPop.jsp
Normal file
295
WebRoot/jsp/whp/baseinfo/WhpTestItemPop.jsp
Normal file
@ -0,0 +1,295 @@
|
||||
<!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 () {
|
||||
initTableLists();
|
||||
conditionDropDownStatus();
|
||||
conditionDropDownOrg();
|
||||
|
||||
|
||||
});
|
||||
var WhpTestItemPopdosearch = function () {
|
||||
$("#WhpTestItemPoptable").bootstrapTable('refresh');
|
||||
|
||||
};
|
||||
|
||||
function initTableLists() {
|
||||
|
||||
console.log($('#deptIdsCondition').val(),'$(\'#deptIdsCondition\').val()')
|
||||
$("#WhpTestItemPoptable").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/whp/baseinfo/WhpTestItem/getList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
singleSelect: true,
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order, // 排序规则
|
||||
status: $('#statusCondition').val(),//状态
|
||||
deptIds: $('#deptIdsCondition').val() !=null?$('#deptIdsCondition').val().join(','):'', // 部门模糊查询
|
||||
likeString: $('#likeString').val() // 名称模糊查询
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
//detailView: true,//父子表
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
|
||||
},
|
||||
{
|
||||
field: 'name', // 返回json数据中的name
|
||||
title: '检测项目名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'workingCurveStr', // 返回json数据中的name
|
||||
title: '工作曲线', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'equipmentName', // 返回json数据中的name
|
||||
title: '仪器设备', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'deptNames', // 返回json数据中的name
|
||||
title: '检测部门', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'confirmUserName', // 返回json数据中的name
|
||||
title: '检验复核人', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'testAddress', // 返回json数据中的name
|
||||
title: '测定地点', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'statusName', // 返回json数据中的name
|
||||
title: '状态', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("WhpTestItemPoptable");
|
||||
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function conditionDropDownStatus() {
|
||||
var select_Data = jQuery.parseJSON('${enableDropDown}');
|
||||
var select_3 = $("#statusCondition").select2({
|
||||
data: select_Data,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示educationTypeCondition
|
||||
allowClear: true,//允许清空
|
||||
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;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'});
|
||||
select_3.val('').trigger('change');
|
||||
}
|
||||
|
||||
function conditionDropDownOrg() {
|
||||
var select_Data = jQuery.parseJSON('${deptDropDown}');
|
||||
|
||||
var select_3 = $("#deptIdsCondition").select2({
|
||||
data: select_Data,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示educationTypeCondition
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) {
|
||||
return markup;
|
||||
}, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
multiple: true,
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo) {
|
||||
return repo.text;
|
||||
}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) {
|
||||
return repo.text;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'});
|
||||
select_3.val('').trigger('change');
|
||||
}
|
||||
|
||||
//保存
|
||||
function WhpTestItemPopSaveFun() {
|
||||
var checkedItems = $("#WhpTestItemPoptable").bootstrapTable('getSelections');
|
||||
|
||||
var datas = "";
|
||||
$.each(checkedItems, function (index, item) {
|
||||
datas += item.id + ",";
|
||||
});
|
||||
if (datas == "") {
|
||||
showAlert('d', '请先选择记录', 'mainAlertdiv');
|
||||
} else {
|
||||
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) {
|
||||
console.log(checkedItems, 'checkedItems')
|
||||
var data = []
|
||||
checkedItems.map(item => {
|
||||
data.push({
|
||||
id: item.id,
|
||||
name: item.name
|
||||
})
|
||||
})
|
||||
console.log(data[0].id)
|
||||
console.log(data[0].name)
|
||||
$('#${param.formId} #${param.hiddenId}').val(data[0].id);
|
||||
$('#${param.formId} #${param.textId}').val(data[0].name);
|
||||
console.log(data)
|
||||
|
||||
closeModal('whpTestItemPops');
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="whpTestItemPops">
|
||||
<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强制为addForm -->
|
||||
<form id="searchForm">
|
||||
<div>
|
||||
<div class="form-group" style="padding:0;">
|
||||
<div class="form-group pull-right form-inline">
|
||||
<div class="form-group">
|
||||
<label class="form-label">检测部门:</label>
|
||||
<select class="form-control select2" name="deptIdsCondition"
|
||||
id="deptIdsCondition"
|
||||
style="width:230px;height: 30px">
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-label">状态:</label>
|
||||
<select class="form-control select2" name="statusCondition"
|
||||
id="statusCondition"
|
||||
style="width:180px;height: 30px">
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="input-group input-group-sm" style="width: 250px;">
|
||||
<input type="text" id="likeString" name="likeString"
|
||||
class="form-control pull-right"
|
||||
placeholder="请输入检测项目名称">
|
||||
<div class="input-group-btn">
|
||||
<button type="button" class="btn btn-default"
|
||||
onclick="WhpTestItemPopdosearch();">
|
||||
<i class="fa fa-search"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<table id="WhpTestItemPoptable"></table>
|
||||
|
||||
</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="WhpTestItemPopSaveFun()">保存
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
208
WebRoot/jsp/whp/baseinfo/WhpTestItemWorkingConstantAdd.jsp
Normal file
208
WebRoot/jsp/whp/baseinfo/WhpTestItemWorkingConstantAdd.jsp
Normal file
@ -0,0 +1,208 @@
|
||||
<!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 () {
|
||||
|
||||
// initDropDownStatus();
|
||||
});
|
||||
|
||||
//下拉范例,不用删掉
|
||||
function initDropDownStatus() {
|
||||
var select_Data = jQuery.parseJSON('${enableDropDown}');
|
||||
console.log(select_Data);
|
||||
var select_3 = $("#status").select2({
|
||||
data: select_Data,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
// allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) {
|
||||
return markup;
|
||||
}, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0, multiple: true,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo) {
|
||||
return repo.text;
|
||||
}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) {
|
||||
return repo.text;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'});
|
||||
|
||||
|
||||
}
|
||||
|
||||
//保存
|
||||
function addSaveFun() {
|
||||
//console.log($("#addForm").serialize());
|
||||
$("#addForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#addForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
var formData = new FormData($("#addForm")[0]);
|
||||
$.ajax({
|
||||
url: ext.contextPath + '/whp/baseinfo/WhpTestItemWorkingCurve/save.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) {
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
$("#addForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
parmname: {validators: {notEmpty: {message: '检测项目不能为空'}}},
|
||||
default_value: {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);
|
||||
console.log(data,'datadatadatadata')
|
||||
$('#addForm #parmname').val(data[0].parmname);
|
||||
$('#addForm #mpid').val(data[0].mpid);
|
||||
$('#addForm #disname').val(data[0].disname);
|
||||
$('#addForm #unit').val(data[0].unit);
|
||||
$('#addForm #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强制为addForm -->
|
||||
<form class="form-horizontal" id="addForm" 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"
|
||||
placeholder="请点击选择" onclick="selectmpid();" class="form-control">
|
||||
<input type="hidden" readonly name="kpi_id" id="mpid" value=""
|
||||
class="form-control">
|
||||
<input type="hidden" readonly name="formulatype" id="formulatype" value="1"
|
||||
class="form-control">
|
||||
<input type="hidden" readonly name="test_item_id" id="test_item_id" value="${test_item_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" 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"
|
||||
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="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"
|
||||
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="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="addSaveFun()">保存
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
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>
|
||||
1
WebRoot/jsp/whp/baseinfo/WhpTestItemWorkingCurveAdd.jsp
Normal file
1
WebRoot/jsp/whp/baseinfo/WhpTestItemWorkingCurveAdd.jsp
Normal file
File diff suppressed because one or more lines are too long
1
WebRoot/jsp/whp/baseinfo/WhpTestItemWorkingCurveEdit.jsp
Normal file
1
WebRoot/jsp/whp/baseinfo/WhpTestItemWorkingCurveEdit.jsp
Normal file
File diff suppressed because one or more lines are too long
1
WebRoot/jsp/whp/baseinfo/WhpTestItemWorkingCurveList.jsp
Normal file
1
WebRoot/jsp/whp/baseinfo/WhpTestItemWorkingCurveList.jsp
Normal file
File diff suppressed because one or more lines are too long
1
WebRoot/jsp/whp/baseinfo/WhpTestMethodAdd.jsp
Normal file
1
WebRoot/jsp/whp/baseinfo/WhpTestMethodAdd.jsp
Normal file
File diff suppressed because one or more lines are too long
1
WebRoot/jsp/whp/baseinfo/WhpTestMethodEdit.jsp
Normal file
1
WebRoot/jsp/whp/baseinfo/WhpTestMethodEdit.jsp
Normal file
File diff suppressed because one or more lines are too long
1
WebRoot/jsp/whp/baseinfo/WhpTestMethodList.jsp
Normal file
1
WebRoot/jsp/whp/baseinfo/WhpTestMethodList.jsp
Normal file
File diff suppressed because one or more lines are too long
216
WebRoot/jsp/whp/baseinfo/WhpTestOrgAdd.jsp
Normal file
216
WebRoot/jsp/whp/baseinfo/WhpTestOrgAdd.jsp
Normal file
@ -0,0 +1,216 @@
|
||||
<!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 () {
|
||||
|
||||
initDropDownStatus();
|
||||
});
|
||||
|
||||
function initDropDownStatus() {
|
||||
var select_Data = jQuery.parseJSON('${enableDropDown}');
|
||||
console.log(select_Data);
|
||||
var select_3 = $("#status").select2({
|
||||
data: select_Data,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
// allowClear: true,//允许清空
|
||||
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;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'});
|
||||
|
||||
<%--select_3.val('${kpiDimension.status}').trigger("change");--%>
|
||||
|
||||
|
||||
}
|
||||
|
||||
function saveFun() {
|
||||
//console.log($("#addForm").serialize());
|
||||
$("#addForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#addForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
var formData = new FormData($("#addForm")[0]);
|
||||
$.ajax({
|
||||
url: ext.contextPath + "/whp/baseinfo/WhpTestOrg/save.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) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
closeModal('subModal');
|
||||
} else {
|
||||
showAlert('d', '保存失败!' + data.msg);
|
||||
}
|
||||
},
|
||||
error: function (data) {
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
$("#addForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
name: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '机构名称不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
address: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '机构地址不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
contactPerson: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '机构联系人不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
contactPhone: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '机构电话不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
status: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '机构电话不能为空'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<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强制为addForm -->
|
||||
<form class="form-horizontal" id="addForm" 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-4">
|
||||
<input type="text" name="name" id="name" class="form-control"
|
||||
placeholder="">
|
||||
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">* 机构地址:</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" name="address" id="address" class="form-control"
|
||||
placeholder=""
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 机构联系人:</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" name="contactPerson" id="contactPerson" class="form-control"
|
||||
placeholder="">
|
||||
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">* 机构电话:</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" name="contactPhone" id="contactPhone" class="form-control"
|
||||
placeholder=""
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label ">* 状态:</label>
|
||||
<div class="col-sm-4 ">
|
||||
|
||||
<select class="form-control" name="status" id="status"
|
||||
style="width: 100%">
|
||||
</select>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</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="saveFun()">保存
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
217
WebRoot/jsp/whp/baseinfo/WhpTestOrgEdit.jsp
Normal file
217
WebRoot/jsp/whp/baseinfo/WhpTestOrgEdit.jsp
Normal file
@ -0,0 +1,217 @@
|
||||
<!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 () {
|
||||
|
||||
initDropDownStatus();
|
||||
});
|
||||
|
||||
function initDropDownStatus() {
|
||||
var select_Data = jQuery.parseJSON('${enableDropDown}');
|
||||
console.log(select_Data);
|
||||
var select_3 = $("#status").select2({
|
||||
data: select_Data,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
// allowClear: true,//允许清空
|
||||
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;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'});
|
||||
|
||||
select_3.val('${bean.status}').trigger("change");
|
||||
|
||||
|
||||
}
|
||||
|
||||
function updateFun() {
|
||||
//console.log($("#editForm").serialize());
|
||||
$("#editForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#editForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
var formData = new FormData($("#editForm")[0]);
|
||||
$.ajax({
|
||||
url: ext.contextPath + "/whp/baseinfo/WhpTestOrg/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) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
closeModal('subModal');
|
||||
} else {
|
||||
showAlert('d', '保存失败!' + data.msg);
|
||||
}
|
||||
},
|
||||
error: function (data) {
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
$("#editForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
name: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '机构名称不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
address: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '机构地址不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
contactPerson: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '机构联系人不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
contactPhone: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '机构电话不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
status: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '机构电话不能为空'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<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="editForm" 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-4">
|
||||
<input type="text" name="name" id="name" class="form-control"
|
||||
value="${bean.name}">
|
||||
<input type="hidden" name="id" id="id" class="form-control"
|
||||
placeholder="" value="${bean.id}">
|
||||
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">* 机构地址:</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" name="address" id="address" class="form-control"
|
||||
placeholder=""
|
||||
value="${bean.address}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 机构联系人:</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" name="contactPerson" id="contactPerson" class="form-control"
|
||||
value="${bean.contactPerson}">
|
||||
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">* 机构电话:</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" name="contactPhone" id="contactPhone" class="form-control"
|
||||
value="${bean.contactPhone}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label ">* 状态:</label>
|
||||
<div class="col-sm-4 ">
|
||||
|
||||
<select class="form-control" name="status" id="status"
|
||||
style="width: 100%">
|
||||
</select>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</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="updateFun()">保存
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
372
WebRoot/jsp/whp/baseinfo/WhpTestOrgList.jsp
Normal file
372
WebRoot/jsp/whp/baseinfo/WhpTestOrgList.jsp
Normal file
@ -0,0 +1,372 @@
|
||||
<%@ 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.sparepart.SparePartCommString" %>
|
||||
<%request.setAttribute("AUDIT", SparePartCommString.STATUS_STOCK_AUDIT); %>
|
||||
<%request.setAttribute("START", SparePartCommString.STATUS_STOCK_START); %>
|
||||
<%request.setAttribute("FINISH", SparePartCommString.STATUS_STOCK_FINISH); %>
|
||||
<%request.setAttribute("FAIL", SparePartCommString.STATUS_STOCK_FAIL); %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%>
|
||||
</title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<!-- bootstrap switch -->
|
||||
<link rel="stylesheet"
|
||||
href="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css"/>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js"
|
||||
charset="utf-8"></script>
|
||||
<!--bootstrap-edittable 表格行内编辑 -->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/plugins/bootstrap-editable/css/bootstrap-editable.css"/>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/plugins/bootstrap-editable/js/bootstrap-editable.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/plugins/bootstrap-editable/js/bootstrap-table-editable.js"
|
||||
charset="utf-8"></script>
|
||||
<style type="text/css">
|
||||
.main-header {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.content-header {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.main-footer {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
|
||||
.table-hover > tbody > tr:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.input-clear-a {
|
||||
|
||||
color: white;
|
||||
|
||||
}
|
||||
|
||||
.input-content:hover + .input-clear-a {
|
||||
|
||||
color: #d4d4d4;
|
||||
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
|
||||
conditionDropDownStatus();
|
||||
initTableList();
|
||||
});
|
||||
|
||||
var addFun = function () {
|
||||
$("#searchForm").bootstrapValidator('validate');//提交验证
|
||||
$.post(ext.contextPath + '/whp/baseinfo/WhpTestOrg/add.do', {unitId: unitId}, function (data) {
|
||||
console.log(data);
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
var editFun = function (id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/whp/baseinfo/WhpTestOrg/edit.do', {id: id}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
||||
var deleteFun = 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 + '/whp/baseinfo/WhpTestOrg/deletes.do', {ids: id}, function (data) {
|
||||
if (data.code === 1) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
}, "json");
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
||||
var deletesFun = function () {
|
||||
var checkedItems = $("#table").bootstrapTable('getSelections');
|
||||
var datas = "";
|
||||
$.each(checkedItems, function (index, item) {
|
||||
datas += item.id + ",";
|
||||
});
|
||||
if (datas == "") {
|
||||
showAlert('d', '请先选择记录', 'mainAlertdiv');
|
||||
} else {
|
||||
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 + '/whp/baseinfo/WhpTestOrg/deletes.do', {ids: datas}, function (data) {
|
||||
if (data.code == 1) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
}, "json");
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
var dosearch = function () {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
};
|
||||
|
||||
var companyId_rawMaterial = "";
|
||||
|
||||
var initTableList = function () {
|
||||
timeRangeEnd = null;
|
||||
timeRangeBegin = null;
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/whp/baseinfo/WhpTestOrg/getList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
likeString: $('#likeString').val(),
|
||||
status: $('#statusCondition').val()
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
//detailView: true,//父子表
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
}, {
|
||||
field: 'name', // 返回json数据中的name
|
||||
title: '机构名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'address', // 返回json数据中的name
|
||||
title: '机构地址', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'contactPerson', // 返回json数据中的name
|
||||
title: '机构联系人', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
|
||||
}, {
|
||||
field: 'contactPhone', // 返回json数据中的name
|
||||
title: '机构电话', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
} ,{
|
||||
field: 'status', // 返回json数据中的name
|
||||
title: '状态', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter: function (value, row, index) {
|
||||
if (value == '0') {
|
||||
return '禁用';
|
||||
} else {
|
||||
return '启用';
|
||||
}
|
||||
}
|
||||
},{
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 160, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts = '';
|
||||
buts += '<button class="btn btn-default btn-sm" title="编辑" onclick="editFun(\'' + row.id + '\')"><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");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function conditionDropDownStatus() {
|
||||
var select_Data = jQuery.parseJSON('${enableDropDown}');
|
||||
var select_3 = $("#statusCondition").select2({
|
||||
data: select_Data,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示educationTypeCondition
|
||||
allowClear: true,//允许清空
|
||||
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;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'});
|
||||
select_3.val('').trigger('change');
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<div class="content-wrapper">
|
||||
<section class="content container-fluid">
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="subDiv"></div>
|
||||
<div id="subEditDiv"></div>
|
||||
<div id="subDetailDiv"></div>
|
||||
<div id="PRDetail4SelectsDiv"></div>
|
||||
<div id="user4SelectDiv"></div>
|
||||
<div id="Goods4SelectsDiv"></div>
|
||||
<div id="fileInputDiv"></div>
|
||||
<div id="goodsAddDiv"></div>
|
||||
<div id="equ4SelectDiv"></div>
|
||||
<div id="fault4SelectDiv"></div>
|
||||
<div id="unit4SelectDiv"></div>
|
||||
|
||||
<form id="searchForm">
|
||||
<div>
|
||||
<div class="form-group" style="padding:0;">
|
||||
<div class="btn-group" style="width: 220px;padding-bottom:10px;">
|
||||
|
||||
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="addFun();"
|
||||
style="margin-right: 15px"><i
|
||||
class="fa fa-plus"></i> 新增
|
||||
</button>
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="deletesFun();"><i
|
||||
class="fa fa-trash-o"></i> 删除
|
||||
</button>
|
||||
</div>
|
||||
<div class="form-group pull-right form-inline">
|
||||
<div class="form-group">
|
||||
<label class="form-label">状态:</label>
|
||||
<select class="form-control select2" name="statusCondition" id="statusCondition"
|
||||
style="width:180px;height: 30px">
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="input-group input-group-sm" style="width: 250px;">
|
||||
<input type="text" id="likeString" name="likeString" class="form-control pull-right"
|
||||
placeholder="请输入机构名称/地址/联系人/手机号">
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-default" onclick="dosearch();"><i class="fa fa-search"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<table id="table"></table>
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<!-- 文件上传-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/css/fileinput.min.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/fileinput.min.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/locales/zh.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/JS/commonFileUpload.js" charset="utf-8"></script>
|
||||
<!-- 引入daterangepicker-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/daterangepicker.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/moment.min.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/daterangepicker.js"
|
||||
charset="utf-8"></script>
|
||||
</html>
|
||||
Reference in New Issue
Block a user