first commit
This commit is contained in:
1087
WebRoot/jsp/whp/HYSHomePage.jsp
Normal file
1087
WebRoot/jsp/whp/HYSHomePage.jsp
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,453 @@
|
||||
<%@ 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 () {
|
||||
conditionDropDownUnit();
|
||||
conditionDropDownType();
|
||||
conditionDropDownMethod();
|
||||
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/sample/WhpSampleManagement/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: 'code', // 返回json数据中的name
|
||||
title: '采样单编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},
|
||||
{
|
||||
field: 'sampleNo', // 返回json数据中的name
|
||||
title: '样品编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
|
||||
}, {
|
||||
field: 'typeName', // 返回json数据中的name
|
||||
title: '采样类型', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'number', // 返回json数据中的name
|
||||
title: '剩余数量', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'unit', // 返回json数据中的name
|
||||
title: '单位', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},
|
||||
{
|
||||
field: 'registerPerson', // 返回json数据中的name
|
||||
title: '登记人', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
|
||||
}, {
|
||||
field: 'method', // 返回json数据中的name
|
||||
title: '处置方式', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'date', // 返回json数据中的name
|
||||
title: '处置时间', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'statusName', // 返回json数据中的name
|
||||
title: '状态', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'examinePerson', // 返回json数据中的name
|
||||
title: '审核人', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'examineDate', // 返回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 conditionDropDownMethod() {
|
||||
var select_Data = jQuery.parseJSON('${method}');
|
||||
var select_3 = $("#method").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 conditionDropDownType() {
|
||||
var select_Data = jQuery.parseJSON('${type}');
|
||||
|
||||
var select_3 = $("#type").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 conditionDropDownUnit() {
|
||||
var select_Data = jQuery.parseJSON('${unit}');
|
||||
|
||||
var select_3 = $("#unit").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="type" id="type"
|
||||
style="width:180px;height: 30px">
|
||||
</select>
|
||||
<label class="form-label">处置方式:</label>
|
||||
<select class="form-control select2" name="method" id="method"
|
||||
style="width:180px;height: 30px">
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-label">单位:</label>
|
||||
<select class="form-control select2" name="unit" id="unit"
|
||||
style="width:180px;height: 30px">
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="input-group input-group-sm" style="width: 250px;">
|
||||
<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>
|
||||
270
WebRoot/jsp/whp/SampleManagement/WhpResidualSampleEdit.jsp
Normal file
270
WebRoot/jsp/whp/SampleManagement/WhpResidualSampleEdit.jsp
Normal file
@ -0,0 +1,270 @@
|
||||
<!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;
|
||||
}
|
||||
|
||||
.sampleAmountView {
|
||||
color: black;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
conditionDropDownStatus();
|
||||
if('${bean.residualSampleAmount}'=='')
|
||||
{
|
||||
var Amount = '${bean.sampleAmount}' / 2;
|
||||
$('#residualSampleAmount').val(Amount);
|
||||
}else{
|
||||
$('#residualSampleAmount').val('${bean.residualSampleAmount}');
|
||||
}
|
||||
|
||||
var statusShow = '${bean.sampleState}' == 0 ? 'g' : 'ml';
|
||||
$('#showSt').val(statusShow);
|
||||
//要求报告日期
|
||||
$("#disposeTime").datepicker({
|
||||
language: 'zh-CN',
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'yyyy-mm-dd',
|
||||
});
|
||||
|
||||
if('${bean.disposeTime}'=='')
|
||||
{
|
||||
$("#disposeTime").datepicker('setDate',new Date())
|
||||
}
|
||||
|
||||
if('${bean.recordUserId}'=='')
|
||||
{
|
||||
$("#recordUserName").val('${cu.caption}');
|
||||
$("#recordUserId").val('${cu.id}');
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
function updateSaveFun() {
|
||||
$("#editForm").data("bootstrapValidator").updateStatus("recordUserName","NOT_VALIDATED", null).validateField("recordUserName");
|
||||
|
||||
$("#editForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#editForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
var formData = new FormData($("#editForm")[0]);
|
||||
$.ajax({
|
||||
url: ext.contextPath + "/whp/sample/ResidualSampleManagement/update.do",
|
||||
type: 'POST',
|
||||
data: formData,
|
||||
async: false,
|
||||
cache: false,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
if (data.code == 1) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
closeModal('subModal');
|
||||
} else {
|
||||
showAlert('d', '保存失败!' + data.msg);
|
||||
}
|
||||
},
|
||||
error: function (data) {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
// 登记人
|
||||
function selectdutyUser() {
|
||||
$.post(ext.contextPath + '/user/userForOneSelect.do',
|
||||
{
|
||||
formId: "editForm",
|
||||
hiddenId: "recordUserId",
|
||||
textId: "recordUserName"
|
||||
},
|
||||
function (data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal('user4SelectModal');
|
||||
});
|
||||
};
|
||||
|
||||
function conditionDropDownStatus() {
|
||||
var select_Data = jQuery.parseJSON('${disposeTypeDropDownList}');
|
||||
var select_3 = $("#disposeTypeId").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('${bean.disposeTypeId}').trigger('change');
|
||||
}
|
||||
$("#editForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
residualSampleAmount: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '剩余数量不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
disposeTypeId: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '处置方式不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
recordUserName: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '登记人不能为空'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog " style="width: 65%">
|
||||
<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 -->
|
||||
|
||||
<input type="hidden" name="id" id="id" class="form-control" value="${bean.id}">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label"> 采样单编号:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${bean.planCode}</p>
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">* 样品编号:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${bean.sampleCode}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 采样类型:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${bean.sampleTypeName}</p>
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">* 剩余数量:</label>
|
||||
<div class="col-sm-2">
|
||||
<input class="form-control" type="text" id="residualSampleAmount"
|
||||
name="residualSampleAmount"
|
||||
value="">
|
||||
</div>
|
||||
<div class="col-sm-2">
|
||||
<input class="form-control" type="text" id="showSt" disabled="disabled"
|
||||
value="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 处置方式:</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control select2" name="disposeTypeId"
|
||||
id="disposeTypeId"
|
||||
style="width:100%;height: 30px;">
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">* 处置时间:</label>
|
||||
<div class="col-sm-4">
|
||||
<div class="input-group date">
|
||||
<div class="input-group-addon">
|
||||
<i class="fa fa-calendar"></i>
|
||||
</div>
|
||||
<input type="text" class="form-control" id="disposeTime" name="disposeTime"
|
||||
value="${bean.disposeTime.substring(0,10)} "/>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 登记人:</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" id="recordUserName" name="recordUserName" class="form-control"
|
||||
placeholder="请选择.." readonly onclick="selectdutyUser()"
|
||||
value="${bean.recordUserName}"/>
|
||||
<input type="hidden" id="recordUserId" name="recordUserId" class="form-control"
|
||||
placeholder="请选择.." value="${bean.recordUserId}"/>
|
||||
</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>
|
||||
|
||||
|
||||
|
||||
|
||||
515
WebRoot/jsp/whp/SampleManagement/WhpResidualSampleList.jsp
Normal file
515
WebRoot/jsp/whp/SampleManagement/WhpResidualSampleList.jsp
Normal file
@ -0,0 +1,515 @@
|
||||
<%@ 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 () {
|
||||
var datetimeEnd;
|
||||
var datetimeBegin;
|
||||
// conditionDropDownUnit();
|
||||
conditionDropDownType();
|
||||
conditionDropDownMethod();
|
||||
|
||||
/*
|
||||
$("#disposeTimeCondition").datepicker({
|
||||
// startDate: date,
|
||||
language: 'zh-CN',
|
||||
format: 'yyyy-mm-dd',
|
||||
startView: "month", //初始化视图是‘年’
|
||||
minView: 1,
|
||||
maxView: "year",
|
||||
autoclose: true
|
||||
// todayBtn: "linked"
|
||||
});
|
||||
*/
|
||||
initDate();
|
||||
$('#disposeTimeCondition').val('');
|
||||
initTableList();
|
||||
|
||||
});
|
||||
|
||||
//对Date的扩展,将 Date 转化为指定格式的String
|
||||
//月(M)、日(d)、小时(h)、分(m)、秒(s)、季度(q) 可以用 1-2 个占位符,
|
||||
//年(y)可以用 1-4 个占位符,毫秒(S)只能用 1 个占位符(是 1-3 位的数字)
|
||||
Date.prototype.Format = function (fmt) {
|
||||
var o = {
|
||||
"M+": this.getMonth() + 1, //月份
|
||||
"d+": this.getDate(), //日
|
||||
"H+": this.getHours(), //小时
|
||||
"m+": this.getMinutes(), //分
|
||||
"s+": this.getSeconds(), //秒
|
||||
"q+": Math.floor((this.getMonth() + 3) / 3), //季度
|
||||
"S": this.getMilliseconds() //毫秒
|
||||
};
|
||||
if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
|
||||
for (var k in o)
|
||||
if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
|
||||
return fmt;
|
||||
}
|
||||
|
||||
function initDate() {
|
||||
var locale = {
|
||||
"format": 'YYYY-MM-DD ',
|
||||
"separator": " ~ ",
|
||||
"applyLabel": "确定",
|
||||
"cancelLabel": "取消",
|
||||
"fromLabel": "起始时间",
|
||||
"toLabel": "结束时间'",
|
||||
"customRangeLabel": "自定义",
|
||||
"weekLabel": "W",
|
||||
"daysOfWeek": ["日", "一", "二", "三", "四", "五", "六"],
|
||||
"monthNames": ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
|
||||
"firstDay": 1
|
||||
};
|
||||
var oldreservationtime1 = "${param.oldreservationtime1}";
|
||||
if (oldreservationtime1 != "" && oldreservationtime1.length > 0) {
|
||||
datetimeBegin = oldreservationtime1.substring(0, 16);
|
||||
datetimeEnd = oldreservationtime1.substring(19, 36);
|
||||
$('#disposeTimeCondition').val(oldreservationtime1);
|
||||
} else {
|
||||
datetimeBegin = moment().subtract(3, 'days').format('YYYY-MM-DD');
|
||||
datetimeEnd = moment().subtract(0, 'days').format('YYYY-MM-DD');
|
||||
$('#disposeTimeCondition').val(datetimeBegin + locale.separator + datetimeEnd);
|
||||
}
|
||||
|
||||
$('#disposeTimeCondition').daterangepicker({
|
||||
|
||||
"locale": locale,
|
||||
|
||||
startDate: datetimeBegin,
|
||||
endDate: datetimeEnd
|
||||
}, function (start, end, label) {
|
||||
datetimeBegin = start.format(this.locale.format);
|
||||
datetimeEnd = end.format(this.locale.format);
|
||||
|
||||
});
|
||||
|
||||
};
|
||||
var datedelete = function () {
|
||||
$('#disposeTimeCondition').val('');
|
||||
datetimeEnd = null;
|
||||
datetimeBegin = null;
|
||||
};
|
||||
|
||||
|
||||
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/sample/ResidualSampleManagement/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 () {
|
||||
datetimeEnd = null;
|
||||
datetimeBegin = null;
|
||||
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/whp/sample/ResidualSampleManagement/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(),
|
||||
sampleTypeId: $('#sampleTypeCondition').val(),
|
||||
// status: $('#sampleStatecondition').val(),
|
||||
disposeTypeId: $('#disposeTypeCondition').val(),
|
||||
// disposeTime: $('#disposeTimeCondition').val()
|
||||
|
||||
disposeTimeBegin: datetimeBegin,
|
||||
disposeTimeEnd: datetimeEnd,
|
||||
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
//detailView: true,//父子表
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
}, {
|
||||
field: 'planCode', // 返回json数据中的name
|
||||
title: '采样单编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},
|
||||
{
|
||||
field: 'sampleCode', // 返回json数据中的name
|
||||
title: '样品编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
|
||||
}, {
|
||||
field: 'sampleTypeName', // 返回json数据中的name
|
||||
title: '采样类型', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'residualSampleAmount', // 返回json数据中的name
|
||||
title: '剩余数量', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'unit', // 返回json数据中的name
|
||||
title: '单位', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},
|
||||
{
|
||||
field: 'recordUserName', // 返回json数据中的name
|
||||
title: '登记人', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
|
||||
}, {
|
||||
field: 'disposeTypeName', // 返回json数据中的name
|
||||
title: '处置方式', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'disposeTime', // 返回json数据中的name
|
||||
title: '处置时间', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',// 上下居中
|
||||
formatter: function (value) {
|
||||
return value.substring(0, 10);
|
||||
}
|
||||
},
|
||||
{
|
||||
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 = '<div class="btn-group" >' + buts + '</div>';
|
||||
return buts;
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function conditionDropDownMethod() {
|
||||
var select_Data = jQuery.parseJSON('${disposeTypeDropDown}');
|
||||
var select_3 = $("#disposeTypeCondition").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 conditionDropDownType() {
|
||||
var select_Data = jQuery.parseJSON('${sampleTypeDropDown}');
|
||||
|
||||
var select_3 = $("#sampleTypeCondition").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;">
|
||||
</div>
|
||||
<div class="form-group pull-right form-inline">
|
||||
<div class="form-group">
|
||||
<label class="form-label">样品类别:</label>
|
||||
<select class="form-control select2" name="sampleTypeCondition" id="sampleTypeCondition"
|
||||
style="width:180px;height: 30px">
|
||||
</select>
|
||||
<label class="form-label">处置方式:</label>
|
||||
<select class="form-control select2" name="disposeTypeCondition"
|
||||
id="disposeTypeCondition"
|
||||
style="width:180px;height: 30px">
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-label">处置时间:</label>
|
||||
<div class="input-group input-group-sm" style="width: 200px;">
|
||||
<input type="text" autocomplete="off" class="form-control pull-right"
|
||||
style="height: 30px; width: 240px; border-radius: 4px;"
|
||||
id="disposeTimeCondition"
|
||||
placeholder="请选择处置时间范围">
|
||||
<a class="glyphicon glyphicon-remove btn form-control-feedback input-clear-a"
|
||||
style="pointer-events: auto;"
|
||||
onclick="datedelete()"></a>
|
||||
</div>
|
||||
<%--
|
||||
<input class="form-control" type="text" id="disposeTimeCondition"
|
||||
name="disposeTimeCondition" placeholder="请选择"/>
|
||||
|
||||
--%>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<input class="form-control" type="text" placeholder="模糊查询" id="likeString"
|
||||
name="likeString"/>
|
||||
</div>
|
||||
|
||||
<div class="input-group input-group-sm" style="width: 33px;">
|
||||
<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>
|
||||
202
WebRoot/jsp/whp/SamplingManagement/WhpSamolePlanAdd.jsp
Normal file
202
WebRoot/jsp/whp/SamplingManagement/WhpSamolePlanAdd.jsp
Normal file
@ -0,0 +1,202 @@
|
||||
<!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 () {
|
||||
initDropDowntestItemIds()
|
||||
console.log("${param.testItemId}",'2222222222')
|
||||
});
|
||||
|
||||
|
||||
function savedatalist() {
|
||||
//console.log($("#addFormlist").serialize());
|
||||
$("#addFormlist").bootstrapValidator('validate');//提交验证
|
||||
if ($("#addFormlist").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
var formData = new FormData($("#addFormlist")[0]);
|
||||
|
||||
$.ajax({
|
||||
url: ext.contextPath + "/whp/plan/WhpSamplingPlanItem/save.do",
|
||||
type: 'POST',
|
||||
data: formData,
|
||||
async: false,
|
||||
cache: false,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
if (data.code == 1) {
|
||||
$("#tablelist").bootstrapTable('refresh');
|
||||
closeModal('workingModal');
|
||||
} else {
|
||||
showAlert('d', '保存失败!' + data.msg);
|
||||
}
|
||||
},
|
||||
error: function (data) {
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
$("#addFormlist").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
code: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '样品编号不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
address: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '地点不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
testing: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '是否检测不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
itemId: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '检测项目不能为空'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
function initDropDowntestItemIds() {
|
||||
var select_Data = []
|
||||
try{
|
||||
select_Data =JSON.parse('${whpTestItemDropDown}');
|
||||
}catch (e) {
|
||||
|
||||
}
|
||||
var select_3 = $("#itemId").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'});
|
||||
|
||||
|
||||
|
||||
}
|
||||
</script>
|
||||
<div class="modal fade" id="workingModal">
|
||||
<div class="modal-dialog" style="width: 40%">
|
||||
<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强制为addFormlist -->
|
||||
<form class="form-horizontal" id="addFormlist" 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="code" id="code" class="form-control"
|
||||
placeholder="">
|
||||
<input type="hidden" name="testItemId" id="testItemId" class="form-control"
|
||||
placeholder="" value="${param.testItemId}">
|
||||
|
||||
</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">
|
||||
<select id="testing" name="testing" class="form-control select2">
|
||||
<option value="1" selected>是</option>
|
||||
<option value="0">否</option>
|
||||
</select>
|
||||
<%-- <input type="text" name="testing" id="testing" class="form-control"--%>
|
||||
<%-- placeholder="">--%>
|
||||
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label ">* 检测项目:</label>
|
||||
<div class="col-sm-4 ">
|
||||
|
||||
<select class="form-control" name="itemId" id="itemId"
|
||||
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="savedatalist()">保存
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
290
WebRoot/jsp/whp/SamplingManagement/WhpSamolePlanList.jsp
Normal file
290
WebRoot/jsp/whp/SamplingManagement/WhpSamolePlanList.jsp
Normal file
@ -0,0 +1,290 @@
|
||||
<!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;
|
||||
}
|
||||
|
||||
.hidden {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.select2-container--default.select2-container--focus .select2-selection--multiple {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.select2-container--default.select2-container--focus .select2-selection--multiple, .select2-container--default .select2-search--dropdown .select2-search__field {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.select2-container--default.select2-container--focus .select2-selection--multiple {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.select2-container--default .select2-selection--multiple {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.select2-container--default .select2-selection--multiple {
|
||||
border: none;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
// initTableListw()
|
||||
initTableListFun()
|
||||
console.log('${param.id}', '1111111111')
|
||||
});
|
||||
<%--var WorkingeditFun = function (id) {--%>
|
||||
<%-- $.post(ext.contextPath + '/whp/baseinfo/WhpTestItemWorkingCurve/edit.do', {--%>
|
||||
<%-- id: id,--%>
|
||||
<%-- testItemId: '${param.id}'--%>
|
||||
<%-- }, function (data) {--%>
|
||||
<%-- $("#TtemWorking").html(data);--%>
|
||||
<%-- openModal('workingModal');--%>
|
||||
<%-- });--%>
|
||||
<%--};--%>
|
||||
var addlistFun = function (id) {
|
||||
$("#searchForm").bootstrapValidator('validate');//提交验证
|
||||
$.post(ext.contextPath + '/whp/plan/WhpSamplingPlanItem/add.do', {
|
||||
unitId: unitId,
|
||||
testItemId: '${param.id}'
|
||||
}, function (data) {
|
||||
$("#TtemWorking").html(data);
|
||||
openModal('workingModal');
|
||||
});
|
||||
};
|
||||
var selectChange = function (val, id, index) {
|
||||
console.log(val, "val")
|
||||
console.log(id, "id")
|
||||
console.log(index, "index")
|
||||
let values = $('.form-controlSE').eq(index).val()
|
||||
console.log(values)
|
||||
$.ajax({
|
||||
url: ext.contextPath + "/whp/plan/WhpSamplingPlanItem/update.do?id="+id,
|
||||
type: 'POST',
|
||||
data: values,
|
||||
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) {
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
};
|
||||
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) {
|
||||
$("#tablelist").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
}, "json");
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
function selectFun() {
|
||||
var select_Data = jQuery.parseJSON('${whpTestItemDropDown}');
|
||||
|
||||
var select_3 = $(".form-controlSE").each((index, item) => {
|
||||
console.log(item)
|
||||
// if($(item)) {
|
||||
$(item).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'});
|
||||
// }
|
||||
})
|
||||
}
|
||||
function initTableListFun() {
|
||||
$("#tablelist").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/whp/plan/WhpSamplingPlanItem/getList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
||||
pageSize: 100000000, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
testItemId: '${param.id}',
|
||||
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
//detailView: true,//父子表
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
}, {
|
||||
field: 'code', // 返回json数据中的name
|
||||
title: '样品编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'address', // 返回json数据中的name
|
||||
title: '地点', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'testing', // 返回json数据中的name
|
||||
title: '是否检测', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
|
||||
}, {
|
||||
field: 'itemId', // 返回json数据中的name
|
||||
title: '检测项目', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter: function (value, row, index) {
|
||||
return '<select class="form-controlSE" name="itemId" id="itemId\'' + index + '\'" onchange="selectChange(\'' + value + '\',\'' + row.id + '\',' + index + ')" style="width: 100%"></select>'
|
||||
}
|
||||
}
|
||||
// , {
|
||||
// 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="PlanviewFun(\'' + row.id + '\')"><i class="fa fa-eye"></i><span class="hidden-md hidden-lg"> 详情</span></button>';
|
||||
//
|
||||
// buts = '<div class="btn-group" >' + buts + '</div>';
|
||||
// return buts;
|
||||
// }
|
||||
// }
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("tablelist");
|
||||
selectFun()
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
</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">
|
||||
<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="addlistFun();"
|
||||
style="margin-right: 15px"><i
|
||||
class="fa fa-plus"></i> 新增
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<table id="tablelist"></table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default " data-dismiss="modal">关闭
|
||||
</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
166
WebRoot/jsp/whp/SamplingManagement/WhpSamolePlanView.jsp
Normal file
166
WebRoot/jsp/whp/SamplingManagement/WhpSamolePlanView.jsp
Normal file
@ -0,0 +1,166 @@
|
||||
<!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;
|
||||
|
||||
}
|
||||
|
||||
.select2-container--default .select2-selection--single {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.select2-container--default .select2-selection--single, .select2-selection .select2-selection--single {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.select2-container--default .select2-selection--single .select2-selection__arrow b {
|
||||
border: none;
|
||||
border-style: unset
|
||||
}
|
||||
|
||||
.select2-container--default.select2-container--disabled .select2-selection--single {
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
.right {
|
||||
margin-left: 50px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
|
||||
typeConditionDropDownList();
|
||||
});
|
||||
|
||||
//下拉范例,不用删掉
|
||||
function typeConditionDropDownList() {
|
||||
var select_Data = jQuery.parseJSON('${typeConditionDropDownList}');
|
||||
console.log(select_Data);
|
||||
var select_3 = $("#liquidWasteType").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.liquidWasteType}').trigger("change");
|
||||
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog " style="width: 65%">
|
||||
<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 -->
|
||||
|
||||
<input type="hidden" name="id" id="id" class="form-control" value="${bean.id}">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 采样单编号:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${bean.code}</p>
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">* 地点:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${bean.address}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 采样时间:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${bean.testing}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">* 采样人:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${bean.repotDate}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 现场采样情况:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${bean.typeName}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">* 样品外观:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${bean.typeName}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 样品状态:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${bean.typeName}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">* 样品数量:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${bean.typeName}</p>
|
||||
</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>
|
||||
|
||||
|
||||
|
||||
|
||||
756
WebRoot/jsp/whp/SamplingManagement/WhpSamplingTaskList.jsp
Normal file
756
WebRoot/jsp/whp/SamplingManagement/WhpSamplingTaskList.jsp
Normal file
@ -0,0 +1,756 @@
|
||||
<%@ 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">
|
||||
var timeEnd;
|
||||
var timeBegin;
|
||||
var datetimeEnd;
|
||||
var datetimeBegin;
|
||||
var timeRangeEnd;
|
||||
var timeRangeBegin;
|
||||
$(function () {
|
||||
|
||||
statusConditonDropDown();
|
||||
typeConditonDropDown();
|
||||
initTableList();
|
||||
//入库日期
|
||||
// $("#inputTimeSelect").datetimepicker({
|
||||
// // startDate: date,
|
||||
// language: 'zh-CN',
|
||||
// format: 'yyyy-mm-dd hh:ii:ss',
|
||||
// startView: "month", //初始化视图是‘年’
|
||||
// minView: 1,
|
||||
// maxView: "year",
|
||||
// autoclose: true
|
||||
// // todayBtn: "linked"
|
||||
// });
|
||||
initDate2()
|
||||
initDate3()
|
||||
initDate1()
|
||||
$('#reservationtimeD').val('');
|
||||
$('#repotDate').val('');
|
||||
$('#date').val('');
|
||||
});
|
||||
//对Date的扩展,将 Date 转化为指定格式的String
|
||||
//月(M)、日(d)、小时(h)、分(m)、秒(s)、季度(q) 可以用 1-2 个占位符,
|
||||
//年(y)可以用 1-4 个占位符,毫秒(S)只能用 1 个占位符(是 1-3 位的数字)
|
||||
Date.prototype.Format = function (fmt) {
|
||||
var o = {
|
||||
"M+": this.getMonth() + 1, //月份
|
||||
"d+": this.getDate(), //日
|
||||
"H+": this.getHours(), //小时
|
||||
"m+": this.getMinutes(), //分
|
||||
"s+": this.getSeconds(), //秒
|
||||
"q+": Math.floor((this.getMonth() + 3) / 3), //季度
|
||||
"S": this.getMilliseconds() //毫秒
|
||||
};
|
||||
if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
|
||||
for (var k in o)
|
||||
if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
|
||||
return fmt;
|
||||
}
|
||||
|
||||
function initDate3() {
|
||||
var locale = {
|
||||
"format": 'YYYY-MM-DD ',
|
||||
"separator": " ~ ",
|
||||
"applyLabel": "确定",
|
||||
"cancelLabel": "取消",
|
||||
"fromLabel": "起始时间",
|
||||
"toLabel": "结束时间'",
|
||||
"customRangeLabel": "自定义",
|
||||
"weekLabel": "W",
|
||||
"daysOfWeek": ["日", "一", "二", "三", "四", "五", "六"],
|
||||
"monthNames": ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
|
||||
"firstDay": 1
|
||||
};
|
||||
var oldreservationtime1 = "${param.oldreservationtime1}";
|
||||
if (oldreservationtime1 != "" && oldreservationtime1.length > 0) {
|
||||
datetimeBegin = oldreservationtime1.substring(0, 16);
|
||||
datetimeEnd = oldreservationtime1.substring(19, 36);
|
||||
$('#date').val(oldreservationtime1);
|
||||
} else {
|
||||
datetimeBegin = moment().subtract(3, 'days').format('YYYY-MM-DD');
|
||||
datetimeEnd = moment().subtract(0, 'days').format('YYYY-MM-DD');
|
||||
$('#date').val(datetimeBegin + locale.separator + datetimeEnd);
|
||||
}
|
||||
|
||||
$('#date').daterangepicker({
|
||||
|
||||
"locale": locale,
|
||||
//汉化按钮部分
|
||||
// ranges: {
|
||||
// // '今日': [moment(), moment().subtract(-1, 'days')],
|
||||
// '昨日': [moment().subtract(1, 'days'), moment()],
|
||||
// '最近7日': [moment().subtract(6, 'days'), moment().subtract(-1, 'days')],
|
||||
// '本月': [moment().startOf('month'), moment().endOf('month').subtract(-1, 'days')],
|
||||
// '上月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month').subtract(-1, 'days')]
|
||||
// },
|
||||
startDate: datetimeBegin,
|
||||
endDate: datetimeEnd
|
||||
}, function (start, end, label) {
|
||||
datetimeBegin = start.format(this.locale.format);
|
||||
datetimeEnd = end.format(this.locale.format);
|
||||
|
||||
});
|
||||
|
||||
};
|
||||
var datedelete = function () {
|
||||
$('#date').val('');
|
||||
datetimeEnd = null;
|
||||
datetimeBegin = null;
|
||||
};
|
||||
|
||||
function initDate2() {
|
||||
var locale = {
|
||||
"format": 'YYYY-MM-DD ',
|
||||
"separator": " ~ ",
|
||||
"applyLabel": "确定",
|
||||
"cancelLabel": "取消",
|
||||
"fromLabel": "起始时间",
|
||||
"toLabel": "结束时间'",
|
||||
"customRangeLabel": "自定义",
|
||||
"weekLabel": "W",
|
||||
"daysOfWeek": ["日", "一", "二", "三", "四", "五", "六"],
|
||||
"monthNames": ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
|
||||
"firstDay": 1
|
||||
};
|
||||
var oldreservationtime1 = "${param.oldreservationtime1}";
|
||||
if (oldreservationtime1 != "" && oldreservationtime1.length > 0) {
|
||||
timeBegin = oldreservationtime1.substring(0, 16);
|
||||
timeEnd = oldreservationtime1.substring(19, 36);
|
||||
$('#repotDate').val(oldreservationtime1);
|
||||
} else {
|
||||
timeBegin = moment().subtract(3, 'days').format('YYYY-MM-DD');
|
||||
timeEnd = moment().subtract(0, 'days').format('YYYY-MM-DD');
|
||||
$('#repotDate').val(timeBegin + locale.separator + timeEnd);
|
||||
}
|
||||
|
||||
$('#repotDate').daterangepicker({
|
||||
|
||||
"locale": locale,
|
||||
startDate: timeBegin,
|
||||
endDate: timeEnd
|
||||
}, function (start, end, label) {
|
||||
timeBegin = start.format(this.locale.format);
|
||||
timeEnd = end.format(this.locale.format);
|
||||
|
||||
});
|
||||
|
||||
};
|
||||
var timedelete = function () {
|
||||
$('#repotDate').val('');
|
||||
timeEnd = null;
|
||||
timeBegin = null;
|
||||
};
|
||||
|
||||
function initDate1() {
|
||||
var locale = {
|
||||
"format": 'YYYY-MM-DD',
|
||||
"separator": " ~ ",
|
||||
"applyLabel": "确定",
|
||||
"cancelLabel": "取消",
|
||||
"fromLabel": "起始时间",
|
||||
"toLabel": "结束时间'",
|
||||
"customRangeLabel": "自定义",
|
||||
"weekLabel": "W",
|
||||
"daysOfWeek": ["日", "一", "二", "三", "四", "五", "六"],
|
||||
"monthNames": ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
|
||||
"firstDay": 1
|
||||
};
|
||||
var oldreservationtime1 = "${param.oldreservationtime1}";
|
||||
if (oldreservationtime1 != "" && oldreservationtime1.length > 0) {
|
||||
timeRangeBegin = oldreservationtime1.substring(0, 16);
|
||||
timeRangeEnd = oldreservationtime1.substring(19, 36);
|
||||
$('#reservationtimeD').val(oldreservationtime1);
|
||||
} else {
|
||||
timeRangeBegin = moment().subtract(3, 'days').format('YYYY-MM-DD');
|
||||
timeRangeEnd = moment().subtract(0, 'days').format('YYYY-MM-DD');
|
||||
$('#reservationtimeD').val(timeRangeBegin + locale.separator + timeRangeEnd);
|
||||
}
|
||||
|
||||
$('#reservationtimeD').daterangepicker({
|
||||
|
||||
"locale": locale,
|
||||
|
||||
startDate: timeRangeBegin,
|
||||
endDate: timeRangeEnd
|
||||
}, function (start, end, label) {
|
||||
timeRangeBegin = start.format(this.locale.format);
|
||||
timeRangeEnd = end.format(this.locale.format);
|
||||
|
||||
});
|
||||
|
||||
};
|
||||
var timedel = function () {
|
||||
$('#reservationtimeD').val('');
|
||||
timeRangeEnd = null;
|
||||
timeRangeBegin = null;
|
||||
};
|
||||
// 导出和打印
|
||||
var printerFun = function () {
|
||||
stopBubbleDefaultEvent();
|
||||
// {typeCondition: typeCondition},
|
||||
// var typeCondition=$('#typeCondition').val()
|
||||
$.post(ext.contextPath + '/whp/liquidWasteDispose/WhpLiquidWasteDispose/preview.do', function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
//编辑弹窗
|
||||
var editFun = function (id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/whp/plan/WhpSamplingTask/edit.do', {id: id}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
//接单弹窗
|
||||
var scheduingFun = function (id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/whp/plan/WhpSamplingTask/edit.do', {id: id}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
//详情弹窗
|
||||
var viewFun = function (id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/whp/plan/WhpSamplingTask/view.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/liquidWasteDispose/WhpLiquidWasteDispose/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/liquidWasteDispose/WhpLiquidWasteDispose/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 initTableList = function () {
|
||||
timeEnd = null;
|
||||
timeBegin = null;
|
||||
datetimeEnd = null;
|
||||
datetimeBegin = null;
|
||||
timeRangeEnd = null;
|
||||
timeRangeBegin = null;
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/whp/plan/WhpSamplingTask/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,
|
||||
timeRangeBegin: timeRangeBegin,
|
||||
timeRangeEnd: timeRangeEnd,
|
||||
timeEnd: timeEnd,
|
||||
timeEnd: timeEnd,
|
||||
datetimeEnd: datetimeEnd,
|
||||
datetimeEnd: datetimeEnd,
|
||||
address: $('#address').val(),
|
||||
person: $('#person').val(),
|
||||
code: $('#code').val()
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
//detailView: true,//父子表
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
},
|
||||
{
|
||||
field: 'code',
|
||||
title: '采样单编号',
|
||||
align: 'center',
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'date',
|
||||
title: '计划采样日期',
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
formatter: function (value) {
|
||||
return value.replace(/\.+\w*/, '')
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'type',
|
||||
title: '采样类型',
|
||||
align: 'center',
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'reportDate',
|
||||
title: '要求报告日期',
|
||||
align: 'center',
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'SampleNo',
|
||||
title: '样品编号',
|
||||
align: 'center',
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'address',
|
||||
title: '地点',
|
||||
align: 'center',
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'person',
|
||||
title: '采样人',
|
||||
align: 'center',
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'collectionDate',
|
||||
title: '采样时间',
|
||||
align: 'center',
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'status',
|
||||
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="printerFun(\'' + row.id + '\')"><i class="glyphicon glyphicon-print"></i><span class="hidden-md hidden-lg"> 编辑</span></button>';
|
||||
buts += '<button class="btn btn-default btn-sm" title="接单" onclick="scheduingFun(\'' + 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="viewFun(\'' + row.id + '\')"><i class="fa fa-eye"></i><span class="hidden-md hidden-lg">详情</span></button>';
|
||||
|
||||
// 已处置的不能编辑删除
|
||||
// if (row.status == 1) {
|
||||
// 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>';
|
||||
// }
|
||||
// if (row.status == 2) {
|
||||
// buts += '<button class="btn btn-default btn-sm" title="详情" onclick="viewFun(\'' + row.id + '\')"><i class="fa fa-eye"></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 statusConditonDropDown() {
|
||||
var select_Data = JSON.parse('${status}');
|
||||
var select_3 = $("#status").select2({
|
||||
data: select_Data,
|
||||
cache: false,
|
||||
placeholder: '全部',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
multiple: 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('').trigger('change');
|
||||
}
|
||||
|
||||
function typeConditonDropDown() {
|
||||
var select_Data = JSON.parse('${type}');
|
||||
var select_3 = $("#type").select2({
|
||||
data: select_Data,
|
||||
cache: false,
|
||||
placeholder: '全部',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
multiple: 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('').trigger('change');
|
||||
}
|
||||
|
||||
|
||||
//function filtrateSome() {
|
||||
// var showType = ""
|
||||
// if (showType == true) {
|
||||
//document.getElementById("showBtnSearch").disabled = true
|
||||
// showType = false;
|
||||
// } else {
|
||||
//document.getElementById("showBtnSearch").disabled = false
|
||||
// showType = true;
|
||||
// }
|
||||
|
||||
//}
|
||||
</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>
|
||||
</div>
|
||||
<div class="form-group pull-right form-inline">
|
||||
<div class="form-group">
|
||||
<label class="form-label">任务状态:</label>
|
||||
<select class="form-control select2" name="status" id="status"
|
||||
style="width:180px;height: 30px">
|
||||
<option value=" " selected="true">全部</option>
|
||||
</select>
|
||||
<label class="form-label">地点:</label>
|
||||
<input type="text" id="address" name="address" class="form-control pull-right"
|
||||
placeholder="请输入">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-label">采样人:</label>
|
||||
<input type="text" id="person" name="person" class="form-control "
|
||||
placeholder="请输入">
|
||||
<label class="form-label">计划采样日期:</label>
|
||||
<div class="input-group input-group-sm" style="width: 200px;">
|
||||
<input type="text" autocomplete="off" class="form-control pull-right"
|
||||
style="height: 30px; width: 240px; border-radius: 4px;" id="date"
|
||||
placeholder="请选择计划采样日期范围">
|
||||
<a class="glyphicon glyphicon-remove btn form-control-feedback input-clear-a"
|
||||
style="pointer-events: auto;"
|
||||
onclick="datedelete()"></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-group input-group-sm">
|
||||
<div class="input-group-btn">
|
||||
<%-- <button class="btn btn-default" onclick="dosearch();"><i class="fa fa-search"></i>--%>
|
||||
<%-- </button>--%>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group pull-right form-inline">
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-label">采样单编号:</label>
|
||||
<input type="text" class="form-control" id="code" name="code"
|
||||
value="" placeholder="请输入.."/>
|
||||
<label class="form-label">采样类型:</label>
|
||||
<select class="form-control select2" name="type" id="type"
|
||||
style="width:180px;height: 30px">
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-label">采样时间:</label>
|
||||
<div class="input-group input-group-sm" style="width: 200px;">
|
||||
<input type="text" autocomplete="off" class="form-control pull-left"
|
||||
style="height: 30px; width: 240px; border-radius: 4px;" id="reservationtimeD"
|
||||
placeholder="请选择采样时间范围">
|
||||
<a class="glyphicon glyphicon-remove btn form-control-feedback input-clear-a"
|
||||
style="pointer-events: auto;"
|
||||
onclick="timedel()"></a>
|
||||
</div>
|
||||
<label class="form-label">要求报告日期:</label>
|
||||
<div class="input-group input-group-sm" style="width: 200px;">
|
||||
<input type="text" autocomplete="off" class="form-control pull-left"
|
||||
style="height: 30px; width: 240px; border-radius: 4px;" id="repotDate"
|
||||
placeholder="请选择要求报告日期范围">
|
||||
<a class="glyphicon glyphicon-remove btn form-control-feedback input-clear-a"
|
||||
style="pointer-events: auto;"
|
||||
onclick="timedelete()"></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-group input-group-sm">
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-default" onclick="dosearch();"><i class="fa fa-search"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%-- <div class="form-group pull-right form-inline">--%>
|
||||
<%-- <div class="form-group">--%>
|
||||
<%-- <label class="form-label">任务状态:</label>--%>
|
||||
<%-- <select class="form-control select2" name="status" id="status"--%>
|
||||
<%-- style="width:180px;height: 30px">--%>
|
||||
<%-- <option value=" " selected="true">全部</option>--%>
|
||||
<%-- </select>--%>
|
||||
<%-- <label class="form-label">地点:</label>--%>
|
||||
<%-- <input type="text" id="address" name="address" class="form-control pull-right"--%>
|
||||
<%-- placeholder="请输入">--%>
|
||||
<%-- </div>--%>
|
||||
<%-- <div class="form-group">--%>
|
||||
<%-- <label class="form-label">采样人:</label>--%>
|
||||
<%-- <input type="text" id="person" name="person" class="form-control "--%>
|
||||
<%-- placeholder="请输入">--%>
|
||||
<%-- <label class="form-label">计划采样日期:</label>--%>
|
||||
<%-- <div class="input-group input-group-sm" style="width: 200px;">--%>
|
||||
<%-- <input type="text" autocomplete="off" class="form-control pull-right"--%>
|
||||
<%-- style="height: 30px; width: 240px; border-radius: 4px;" id="date"--%>
|
||||
<%-- placeholder="请选择要求报告日期范围">--%>
|
||||
<%-- <a class="glyphicon glyphicon-remove btn form-control-feedback input-clear-a"--%>
|
||||
<%-- style="pointer-events: auto;"--%>
|
||||
<%-- onclick="datedelete()"></a>--%>
|
||||
<%-- </div>--%>
|
||||
<%-- </div>--%>
|
||||
<%-- <button onclick="filtrateSome()">更多筛选</button>--%>
|
||||
<%-- <div class="form-group">--%>
|
||||
|
||||
<%-- <div id="showBtnSearch">--%>
|
||||
<%-- <label class="form-label">采样单编号:</label>--%>
|
||||
<%-- <input type="text" class="form-control" id="code" name="code"--%>
|
||||
<%-- value="" placeholder="请输入.."/>--%>
|
||||
<%-- <label class="form-label">采样类型:</label>--%>
|
||||
<%-- <select class="form-control select2" name="type" id="type"--%>
|
||||
<%-- style="width:180px;height: 30px">--%>
|
||||
<%-- </select>--%>
|
||||
<%-- <label class="form-label">采样时间:</label>--%>
|
||||
<%-- <div class="input-group input-group-sm" style="width: 200px;">--%>
|
||||
<%-- <input type="text" autocomplete="off" class="form-control pull-left"--%>
|
||||
<%-- style="height: 30px; width: 240px; border-radius: 4px;" id="reservationtimeD"--%>
|
||||
<%-- placeholder="请选择计划采样日期范围">--%>
|
||||
<%-- <a class="glyphicon glyphicon-remove btn form-control-feedback input-clear-a"--%>
|
||||
<%-- style="pointer-events: auto;"--%>
|
||||
<%-- onclick="timedel()"></a>--%>
|
||||
<%-- </div>--%>
|
||||
<%-- <label class="form-label">要求报告日期:</label>--%>
|
||||
<%-- <div class="input-group input-group-sm" style="width: 200px;">--%>
|
||||
<%-- <input type="text" autocomplete="off" class="form-control pull-left"--%>
|
||||
<%-- style="height: 30px; width: 240px; border-radius: 4px;" id="repotDate"--%>
|
||||
<%-- placeholder="请选择要求报告日期范围">--%>
|
||||
<%-- <a class="glyphicon glyphicon-remove btn form-control-feedback input-clear-a"--%>
|
||||
<%-- style="pointer-events: auto;"--%>
|
||||
<%-- onclick="timedelete()"></a>--%>
|
||||
<%-- </div>--%>
|
||||
<%-- </div>--%>
|
||||
<%-- </div>--%>
|
||||
<%-- <div class="input-group input-group-sm" style="width: 250px;">--%>
|
||||
<%-- <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>
|
||||
|
||||
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>
|
||||
@ -0,0 +1 @@
|
||||
<!DOCTYPE html
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,254 @@
|
||||
<!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" %>
|
||||
<%String serverPath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort();%>
|
||||
<%String contextPath = request.getContextPath();%>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
|
||||
|
||||
});
|
||||
|
||||
function updateSaveFun() {
|
||||
console.log(11111)
|
||||
|
||||
var paramString ="";
|
||||
// paramString = "liquidWasteType=" + $('#typeCondition').val()
|
||||
paramString = "status=${disposeQuery.status}&likeString=${disposeQuery.likeString}&liquidWasteType=${disposeQuery.liquidWasteType}";
|
||||
/*// var status = $('#statusCondition').val();
|
||||
var status = 1;
|
||||
if (status != null) {
|
||||
paramString =paramString+ "&status=" + status
|
||||
}
|
||||
// var likeString = "$('#likeString').val();"
|
||||
var likeString = "";
|
||||
if (likeString != null && likeString != '') {
|
||||
paramString = paramString+"&likeString=" + likeString
|
||||
}*/
|
||||
|
||||
console.log(paramString,${disposeQuery.liquidWasteType})
|
||||
window.open(ext.contextPath + "/whp/liquidWasteDispose/WhpLiquidWasteDispose/export.do?" + paramString);
|
||||
|
||||
|
||||
|
||||
/*$.ajax({
|
||||
url: ext.contextPath + '/whp/liquidWasteDispose/WhpLiquidWasteDispose/export.do?' + paramString,
|
||||
type: 'POST',
|
||||
|
||||
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 printSaveFun(myDiv) {
|
||||
$('#printContext').show();
|
||||
var printHtml = document.getElementById(myDiv).innerHTML;
|
||||
var wind = window.open("", "newwin", "width=1650,height=565,top=80,left=80,toolbar=no,scrollbars=yes,menubar=no");
|
||||
var link = document.createElement('link');
|
||||
link.type = 'text/css';
|
||||
link.rel = 'stylesheet';
|
||||
link.href = '<%=serverPath%><%=contextPath%>/plugins/bootstrap-ext/dist/bootstrap.min.css';
|
||||
wind.document.head.appendChild(link);
|
||||
wind.document.body.innerHTML = printHtml;
|
||||
wind.print(/*{scale:0.5}*/);
|
||||
wind.close();
|
||||
// $('#printContext').hide();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog" style="width: 85%">
|
||||
<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 id="printContext">
|
||||
|
||||
<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;
|
||||
|
||||
}
|
||||
|
||||
.select2-container--default .select2-selection--single {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.select2-container--default .select2-selection--single, .select2-selection .select2-selection--single {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.select2-container--default .select2-selection--single .select2-selection__arrow b {
|
||||
border: none;
|
||||
border-style: unset
|
||||
}
|
||||
|
||||
.select2-container--default.select2-container--disabled .select2-selection--single {
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
.right {
|
||||
margin-left: 50px;
|
||||
}
|
||||
|
||||
.sampling {
|
||||
margin: 0 auto;
|
||||
border-collapse: collapse;
|
||||
/* border: 0.5px solid black; */
|
||||
width: 1000px;
|
||||
}
|
||||
|
||||
.sampling th {
|
||||
text-align: center;
|
||||
font-size: 30px;
|
||||
line-height: 80px;
|
||||
}
|
||||
|
||||
.sampling td {
|
||||
border: 0.5px solid black;
|
||||
line-height: 2em;
|
||||
word-wrap: break-word;
|
||||
word-break: break-all;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.sampling .content {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.sampling .title {
|
||||
font-weight: bold;
|
||||
}
|
||||
.content .title{
|
||||
|
||||
|
||||
}
|
||||
|
||||
.sampling .indent {
|
||||
/* text-indent: 1em; */
|
||||
padding: 2px 5px;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
<div class="modal-body">
|
||||
|
||||
<table>
|
||||
<table class="sampling" style="width:1050px;">
|
||||
<tr>
|
||||
<th colspan="16">
|
||||
白龙港污水处理厂化验室危废储存记录表
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="border: 0 solid white" colspan="8">
|
||||
废物代码及名称:${liquidWasteTypeNameLIN} </td>
|
||||
<%-- liquidWasteTypeName--%>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="8" class="indent" style="text-align: center">入库情况</td>
|
||||
|
||||
<td colspan="8" class="indent" style="text-align: center">转移情况</td>
|
||||
</tr>
|
||||
|
||||
<tr class="content title">
|
||||
<td colspan="1">入库日期</td>
|
||||
<td colspan="1">废物来源</td>
|
||||
<td colspan="1">数量</td>
|
||||
<td colspan="1">容器材质</td>
|
||||
<td colspan="1">容量</td>
|
||||
<td colspan="1">废物存<br/>放位置</td>
|
||||
<td colspan="1">废物运<br/>送经办</td>
|
||||
<td colspan="1">废物贮<br/>存经办</td>
|
||||
<td colspan="1">转移日期</td>
|
||||
<td colspan="1">数量</td>
|
||||
<td colspan="2">废物去向</td>
|
||||
<td colspan="2">废物贮<br/>存经办</td>
|
||||
<td colspan="2">废物转<br/>移经办</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<c:forEach items="${bean}" var="item">
|
||||
<tr>
|
||||
<td class="content" colspan="1" width="8%">${fn:substring(item.inputTime,0,10)}</td>
|
||||
<td class="content" colspan="1" width="6.25%">${item.source}</td>
|
||||
<td class="content" colspan="1" width="5%">${item.number}</td>
|
||||
<td class="content" colspan="1" width="6.25%">${item.containerType}</td>
|
||||
<td class="content" colspan="1" width="6.25%">${item.capacity}</td>
|
||||
<td class="content" colspan="1" width="6.25%">${item.location}</td>
|
||||
<td class="content" colspan="1" width="6.25%">${item.transportUserName}</td>
|
||||
<td class="content" colspan="1" width="6.25%">${item.repositionUserName}</td>
|
||||
<td class="content" colspan="1" width="8%">${fn:substring(item.ouputDate,0,10)}</td>
|
||||
<td class="content" colspan="1" width="5%">${item.disposeNumber}</td>
|
||||
<td class="content" colspan="2" width="12.5%">${item.outputLocation}</td>
|
||||
<td class="content" colspan="2" width="8%">${item.outputRepositionUserName}</td>
|
||||
<td class="content" colspan="2" width="6.25%">${item.outputUserName}</td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
|
||||
|
||||
</table>
|
||||
|
||||
</table>
|
||||
</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>
|
||||
<button type="button" class="btn btn-primary " style="margin-left: 10px"
|
||||
onclick="printSaveFun('printContext')">打印
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
461
WebRoot/jsp/whp/plan/WhpSamplingPlanAdd.jsp
Normal file
461
WebRoot/jsp/whp/plan/WhpSamplingPlanAdd.jsp
Normal file
@ -0,0 +1,461 @@
|
||||
<!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;
|
||||
}
|
||||
|
||||
.form-checkbox {
|
||||
height: 23px;
|
||||
width: 23px;
|
||||
display: block;
|
||||
position: absolute;
|
||||
margin-top: 6px;
|
||||
margin-left: 13px;
|
||||
z-index: 9999;
|
||||
}
|
||||
|
||||
.table-hover > tbody > tr:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.input-clear-a {
|
||||
|
||||
color: white;
|
||||
|
||||
}
|
||||
|
||||
.input-content:hover + .input-clear-a {
|
||||
|
||||
color: #d4d4d4;
|
||||
|
||||
}
|
||||
.table-hover > tbody > tr:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.input-clear-a {
|
||||
|
||||
color: white;
|
||||
|
||||
}
|
||||
|
||||
.input-content:hover + .input-clear-a {
|
||||
|
||||
color: #d4d4d4;
|
||||
|
||||
}
|
||||
.labb::after{
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
background: red;
|
||||
}
|
||||
|
||||
.labb {
|
||||
border: 1px solid gray;
|
||||
padding: 5px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
initTime()
|
||||
$('#AutomaticTime').val('');
|
||||
//计划采样日期
|
||||
$("#date").datepicker({
|
||||
language: 'zh-CN',
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'yyyy-mm-dd',
|
||||
});
|
||||
//要求报告日期
|
||||
$("#reportDate").datepicker({
|
||||
language: 'zh-CN',
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'yyyy-mm-dd',
|
||||
});
|
||||
conditionDropDowntype()
|
||||
initTable2()
|
||||
|
||||
});
|
||||
|
||||
//浏览列表内容刷新
|
||||
function tableChange() {
|
||||
$("#tableFun").bootstrapTable('refresh');
|
||||
|
||||
}
|
||||
|
||||
//采样车间刷新
|
||||
function deptChange() {
|
||||
var type = $("#sampleTypeId").val();
|
||||
$.get(ext.contextPath + "/whp/baseinfo/WhpSampleType/getOne?id=" + type, function (data) {
|
||||
$("#deptIds").val(data.result.deptIds);
|
||||
$("#deptNames").val(data.result.deptNames);
|
||||
}, 'json');
|
||||
}
|
||||
|
||||
function conditionDropDowntype() {
|
||||
|
||||
var selelct_1Data = jQuery.parseJSON('${type}');
|
||||
var selelct_1 = $("#sampleTypeId").select2({
|
||||
data: selelct_1Data,
|
||||
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'});
|
||||
// selelct_1.val('').trigger("change");
|
||||
selelct_1.on("change", function (e) {
|
||||
deptChange();
|
||||
tableChange();
|
||||
});
|
||||
selelct_1.val(selelct_1Data[0].id).trigger("change")
|
||||
}
|
||||
|
||||
function saveFun() {
|
||||
|
||||
$("#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/plan/WhpSamplingPlan/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: {
|
||||
sampleTypeId: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '采样类型不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
deptNames: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '采样车间不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
date: {
|
||||
trigger:"change",
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '计划采样日期不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
reportDate: {
|
||||
trigger:"change",
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '要求报告日期不能为空'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
//对Date的扩展,将 Date 转化为指定格式的String
|
||||
//月(M)、日(d)、小时(h)、分(m)、秒(s)、季度(q) 可以用 1-2 个占位符,
|
||||
//年(y)可以用 1-4 个占位符,毫秒(S)只能用 1 个占位符(是 1-3 位的数字)
|
||||
Date.prototype.Format = function (fmt) {
|
||||
var o = {
|
||||
"M+": this.getMonth() + 1, //月份
|
||||
"d+": this.getDate(), //日
|
||||
"H+": this.getHours(), //小时
|
||||
"m+": this.getMinutes(), //分
|
||||
"s+": this.getSeconds(), //秒
|
||||
"q+": Math.floor((this.getMonth() + 3) / 3), //季度
|
||||
"S": this.getMilliseconds() //毫秒
|
||||
};
|
||||
if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
|
||||
for (var k in o)
|
||||
if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
|
||||
return fmt;
|
||||
}
|
||||
|
||||
function initTime() {
|
||||
var locale = {
|
||||
"format": 'YYYY-MM-DD',
|
||||
"separator": " ~ ",
|
||||
"applyLabel": "确定",
|
||||
"cancelLabel": "取消",
|
||||
"fromLabel": "起始时间",
|
||||
"toLabel": "结束时间'",
|
||||
"customRangeLabel": "自定义",
|
||||
"weekLabel": "W",
|
||||
"daysOfWeek": ["日", "一", "二", "三", "四", "五", "六"],
|
||||
"monthNames": ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
|
||||
"firstDay": 1
|
||||
};
|
||||
var oldreservationtime1 = "${param.oldreservationtime1}";
|
||||
if (oldreservationtime1 != "" && oldreservationtime1.length > 0) {
|
||||
strDate = oldreservationtime1.substring(0, 16);
|
||||
endDate = oldreservationtime1.substring(19, 36);
|
||||
$('#AutomaticTime').val(oldreservationtime1);
|
||||
} else {
|
||||
strDate = moment().subtract(3, 'days').format('YYYY-MM-DD HH:mm');
|
||||
endDate = moment().subtract(0, 'days').format('YYYY-MM-DD HH:mm');
|
||||
$('#AutomaticTime').val(strDate + locale.separator + endDate);
|
||||
}
|
||||
|
||||
$('#AutomaticTime').daterangepicker({
|
||||
"timePicker": true,
|
||||
"timePicker24Hour": true,
|
||||
"linkedCalendars": false,
|
||||
"autoUpdateInput": false,
|
||||
"timePickerIncrement": 10,
|
||||
"locale": locale,
|
||||
//汉化按钮部分
|
||||
// ranges: {
|
||||
// // '今日': [moment(), moment().subtract(-1, 'days')],
|
||||
// '昨日': [moment().subtract(1, 'days'), moment()],
|
||||
// '最近7日': [moment().subtract(6, 'days'), moment().subtract(-1, 'days')],
|
||||
// '本月': [moment().startOf('month'), moment().endOf('month').subtract(-1, 'days')],
|
||||
// '上月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month').subtract(-1, 'days')]
|
||||
// },
|
||||
startDate: strDate,
|
||||
endDate: endDate
|
||||
}, function (start, end, label) {
|
||||
strDate = start.format(this.locale.format);
|
||||
endDate = end.format(this.locale.format);
|
||||
if (!this.startDate) {
|
||||
this.element.val('');
|
||||
} else {
|
||||
this.element.val(this.startDate.format(this.locale.format) + this.locale.separator + this.endDate.format(this.locale.format));
|
||||
}
|
||||
});
|
||||
|
||||
};
|
||||
var datedel = function () {
|
||||
$('#AutomaticTime').val('');
|
||||
strDate = null;
|
||||
endDate = null;
|
||||
};
|
||||
|
||||
function initTable2() {
|
||||
var type = $("#sampleTypeId").val();
|
||||
if (type == null || type === '') {
|
||||
return;
|
||||
}
|
||||
$("#tableFun").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,
|
||||
typeId: $("#sampleTypeId").val(),
|
||||
status: 1
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
//detailView: true,//父子表
|
||||
columns: [
|
||||
{
|
||||
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: 'isTest', // 返回json数据中的name
|
||||
title: '是否检测', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
if (value == true) {
|
||||
return '检测';
|
||||
} else {
|
||||
return '不检测';
|
||||
}
|
||||
}
|
||||
}, {
|
||||
field: 'testItemNames', // 返回json数据中的name
|
||||
title: '检测项目', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
},
|
||||
{
|
||||
field: 'deptNames', // 返回json数据中的name
|
||||
title: '采样车间', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function timedelete() {
|
||||
|
||||
}
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog " style="width: 70%">
|
||||
<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 class="form-control" name="sampleTypeId" id="sampleTypeId"
|
||||
style="width: 100%">
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<%-- <label class="col-sm-2 control-label">* 采样车间:</label>--%>
|
||||
<%-- <div class="col-sm-4">--%>
|
||||
<%-- <input type="text" name="deptNames" id="deptNames" class="form-control"--%>
|
||||
<%-- placeholder="">--%>
|
||||
<%-- <input type="hidden" name="deptIds" id="deptIds" class="form-control"--%>
|
||||
<%-- placeholder="">--%>
|
||||
<%-- </div>--%>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 计划采样日期:</label>
|
||||
<div class="col-sm-4">
|
||||
<div class="input-group date">
|
||||
<div class="input-group-addon">
|
||||
<i class="fa fa-calendar"></i>
|
||||
</div>
|
||||
<input type="text" class="form-control" id="date" name="date"
|
||||
placeholder="请选择.." autocomplete="off"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">* 要求报告日期:</label>
|
||||
<div class="col-sm-4">
|
||||
<div class="input-group date">
|
||||
<div class="input-group-addon">
|
||||
<i class="fa fa-calendar"></i>
|
||||
</div>
|
||||
<input type="text" class="form-control" id="reportDate" name="reportDate"
|
||||
placeholder="请选择.." autocomplete="off"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</form>
|
||||
<table id="tableFun"></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="saveFun()">保存
|
||||
</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
707
WebRoot/jsp/whp/plan/WhpSamplingPlanEdit.jsp
Normal file
707
WebRoot/jsp/whp/plan/WhpSamplingPlanEdit.jsp
Normal file
@ -0,0 +1,707 @@
|
||||
<!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;
|
||||
}
|
||||
|
||||
.form-checkbox {
|
||||
height: 23px;
|
||||
width: 23px;
|
||||
display: block;
|
||||
position: absolute;
|
||||
margin-top: 6px;
|
||||
margin-left: 13px;
|
||||
z-index: 9999;
|
||||
}
|
||||
|
||||
.table-hover > tbody > tr:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.input-clear-a {
|
||||
|
||||
color: white;
|
||||
|
||||
}
|
||||
|
||||
.input-clear-b {
|
||||
|
||||
color: grey;
|
||||
|
||||
}
|
||||
|
||||
.input-content:hover + .input-clear-a {
|
||||
|
||||
color: #d4d4d4;
|
||||
|
||||
}
|
||||
|
||||
.input-content:hover + .input-clear-b {
|
||||
|
||||
color: #d4d4d4;
|
||||
|
||||
}
|
||||
|
||||
.labb {
|
||||
border: 1px solid gray;
|
||||
padding: 5px;
|
||||
border-radius: 5px;
|
||||
display: block;
|
||||
padding-right: 25px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
conditionDropDowntype();
|
||||
|
||||
$("#date").datepicker({
|
||||
language: 'zh-CN',
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'yyyy-mm-dd',
|
||||
});
|
||||
$("#reportDate").datepicker({
|
||||
language: 'zh-CN',
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'yyyy-mm-dd',
|
||||
});
|
||||
// 自动下发截止日期
|
||||
$("#autoplanEndDate").datepicker({
|
||||
language: 'zh-CN',
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'yyyy-mm-dd',
|
||||
});
|
||||
|
||||
initTable2();
|
||||
|
||||
$('#table2').bootstrapTable({
|
||||
onClickCell: function (field, value, row, $element) {
|
||||
selectFun()
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
function showPeriodNo() {
|
||||
var type = $("#type").val();
|
||||
|
||||
$.post(ext.contextPath + "/whp/plan/WhpSamplingPlan/periodNoList.do?typeId=" + type, function (data) {
|
||||
|
||||
var dataVal = []
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
dataVal.push(data[i].text)
|
||||
}
|
||||
$("#dept").val(dataVal)
|
||||
}, 'json');
|
||||
}
|
||||
|
||||
function conditionDropDowntype() {
|
||||
var selelct_1Data = jQuery.parseJSON('${type}');
|
||||
var selelct_1 = $("#sampleTypeId").select2({
|
||||
data: selelct_1Data,
|
||||
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'});
|
||||
selelct_1.val('${bean.sampleTypeId}').trigger("change");
|
||||
selelct_1.on("change", function (e) {
|
||||
deptChange();
|
||||
tableChange();
|
||||
});
|
||||
// selelct_1.val(selelct_1Data[0].id).trigger("change")
|
||||
}
|
||||
|
||||
//采样车间刷新
|
||||
function deptChange() {
|
||||
var type = $("#sampleTypeId").val();
|
||||
$.get(ext.contextPath + "/whp/baseinfo/WhpSampleType/getOne?id=" + type, function (data) {
|
||||
$("#deptIds").val(data.result.deptIds);
|
||||
$("#deptNames").val(data.result.deptNames);
|
||||
}, 'json');
|
||||
}
|
||||
|
||||
//浏览列表内容刷新
|
||||
function tableChange() {
|
||||
$("#table2").bootstrapTable('refresh');
|
||||
|
||||
}
|
||||
|
||||
var selectChange1 = function (val, id, index) {
|
||||
let values = $('.form-control-isTest').eq(index).val()
|
||||
console.log(values)
|
||||
$.ajax({
|
||||
url: ext.contextPath + "/whp/plan/WhpSamplingPlanTask/isTest.do?id=" + id + '&isTest=' + $('.form-control-isTest').eq(index).val(),
|
||||
type: 'POST',
|
||||
data: values,
|
||||
async: false,
|
||||
cache: false,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
// console.log(data)
|
||||
// if (data.code == 1) {
|
||||
// showAlert('S', '修改成功!' + data.msg);
|
||||
// } else {
|
||||
// showAlert('d', '修改失败!' + data.msg);
|
||||
// }
|
||||
},
|
||||
error: function (data) {
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var deleteDFun = 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/plan/WhpSamplingPlanTask/dodeletes.do', {ids: id}, function (data) {
|
||||
$("#table2").bootstrapTable('refresh');
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
function initTable2() {
|
||||
var type = $("#sampleTypeId").val();
|
||||
if (type == null || type === '') {
|
||||
return;
|
||||
}
|
||||
|
||||
$("#table2").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/whp/plan/WhpSamplingPlanTask/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,
|
||||
planCode: '${bean.code}',
|
||||
status: 0
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
//detailView: true,//父子表
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
},
|
||||
{
|
||||
field: 'sampleCode', // 返回json数据中的name
|
||||
title: '样品编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'sampleAddress', // 返回json数据中的name
|
||||
title: '地点', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'deptNames', // 返回json数据中的name
|
||||
title: '采样车间', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'isTest', // 返回json数据中的name
|
||||
title: '是否检测', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
|
||||
return '<select class="form-control-isTest select2" name="isTest" id="isTest\'' + index + '\'" onchange="selectChange1(\'' + value + '\',\'' + row.id + '\',' + index + ')" style="width: 69%; width: 69%;height: 30px;border-radius: 5px;border: 1px solid gray;" value="' + value + '" > ' +
|
||||
'<option value="1" ' + (value === true ? 'selected' : '') + '>检测</option> <option value="0" ' + (value === false ? 'selected' : '') + '>不检测</option>' +
|
||||
'</select>'
|
||||
}
|
||||
}, {
|
||||
field: 'testItemJson', // 返回json数据中的name
|
||||
title: '检测项目', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
|
||||
return '<select class="form-controlSE-testItemJson select2" name="testItemJson" onchange="selectChange(\'' + value + '\',\'' + row.id + '\',' + index + ')" style="width: 100%" value=""></select>'
|
||||
}
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 60, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts = '';
|
||||
// buts += '<button class="btn btn-default btn-sm" title="平行飞样" onclick="addPXFY(\'' + row.id + '\')"><i class="fa fa-plus"></i><span class="hidden-md hidden-lg"> 平行飞样</span></button>';
|
||||
buts += '<button class="btn btn-default btn-sm" title="删除" onclick="deleteDFun(\'' + 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 (data) { //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
if (data.rows) {
|
||||
data.rows.forEach((row, index) => {
|
||||
var select_Data = []
|
||||
try {
|
||||
select_Data = JSON.parse('${whpTestItemDropDown}');
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
$('.form-controlSE-testItemJson').eq(index).select2({
|
||||
data: select_Data,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示educationTypeCondition
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) {
|
||||
return markup;
|
||||
}, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
multiple: true,
|
||||
formatResult: function formatRepo(repo) {
|
||||
return repo.text;
|
||||
}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) {
|
||||
return repo.text;
|
||||
} // 函数用于呈现当前的选择
|
||||
})
|
||||
|
||||
console.log("row.testItemIds", row.testItemIds)
|
||||
|
||||
$('.form-controlSE-testItemJson').eq(index).val(row.testItemIds.split(',')).trigger("change");
|
||||
$('.form-controlSE-testItemJson').eq(index).on('change', (data) => {
|
||||
let testTtemIds = $('.form-controlSE-testItemJson').eq(index).val();
|
||||
$.ajax({
|
||||
url: ext.contextPath + "/whp/plan/WhpSamplingPlanTask/testItems.do?id=" + row.id + '&testItemIds=' + (testTtemIds ? testTtemIds.join(',') : ''),
|
||||
type: 'POST',
|
||||
async: false,
|
||||
cache: false,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
// console.log(data)
|
||||
// if (data.code == 1) {
|
||||
// showAlert('S', '保存成功!' + data.msg);
|
||||
// } else {
|
||||
// showAlert('d', '保存失败!' + data.msg);
|
||||
// }
|
||||
},
|
||||
error: function (data) {
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// selectFun()
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function addPXFY(id) {
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: ext.contextPath + "/whp/plan/WhpSamplingPlanTask/addPXFY.do",
|
||||
async: false,
|
||||
globle: false,
|
||||
data: {
|
||||
id: id
|
||||
},
|
||||
dataType: 'json',
|
||||
error: function () {
|
||||
return false;
|
||||
},
|
||||
success: function (data) {
|
||||
if (data.code == 1) {
|
||||
$("#table2").bootstrapTable('refresh');
|
||||
} else if (data.code == 0) {
|
||||
showAlert('d', data.msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function updateFun() {
|
||||
$("#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/plan/WhpSamplingPlan/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) {
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function submitFun() {
|
||||
$("#editForm").data("bootstrapValidator").updateStatus("deptNames", "NOT_VALIDATED", null).validateField("deptNames");
|
||||
$("#editForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#editForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
var formData = new FormData($("#editForm")[0]);
|
||||
if (!formData.get("isAutoPlan")) {
|
||||
formData.set("isAutoPlan", 0)
|
||||
} else {
|
||||
formData.set("isAutoPlan", 1)
|
||||
|
||||
}
|
||||
$.ajax({
|
||||
url: ext.contextPath + "/whp/plan/WhpSamplingPlan/submit.do",
|
||||
type: 'POST',
|
||||
data: formData,
|
||||
async: false,
|
||||
cache: false,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
dataType: 'json',
|
||||
success: function (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: {
|
||||
code: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '采样单编号不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
sampleTypeId: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '采样类型不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
date: {
|
||||
trigger: "change",
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '计划采样日期不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
reportDate: {
|
||||
trigger: "change",
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '要求报告日期不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
deptNames: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '采样车间不能为空'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
//对Date的扩展,将 Date 转化为指定格式的String
|
||||
|
||||
//月(M)、日(d)、小时(h)、分(m)、秒(s)、季度(q) 可以用 1-2 个占位符,
|
||||
//年(y)可以用 1-4 个占位符,毫秒(S)只能用 1 个占位符(是 1-3 位的数字)
|
||||
Date.prototype.Format = function (fmt) {
|
||||
var o = {
|
||||
"M+": this.getMonth() + 1, //月份
|
||||
"d+": this.getDate(), //日
|
||||
"H+": this.getHours(), //小时
|
||||
"m+": this.getMinutes(), //分
|
||||
"s+": this.getSeconds(), //秒
|
||||
"q+": Math.floor((this.getMonth() + 3) / 3), //季度
|
||||
"S": this.getMilliseconds() //毫秒
|
||||
};
|
||||
if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
|
||||
for (var k in o)
|
||||
if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
|
||||
return fmt;
|
||||
}
|
||||
|
||||
function deletesFunD() {
|
||||
var checkedItems = $("#table2").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/plan/WhpSamplingPlanTask/dodeletes.do', {ids: datas}, function (data) {
|
||||
if (data.code == 1) {
|
||||
$("#table2").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
}, "json");
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog " style="width: 70%">
|
||||
<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="code" id="code" class="form-control"
|
||||
readonly value="${bean.code}">
|
||||
<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">
|
||||
<select class="form-control" name="sampleTypeId" id="sampleTypeId" readonly
|
||||
disabled="true" style="width: 100%;height: 34px">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 计划采样日期:</label>
|
||||
<div class="col-sm-4">
|
||||
<div class="input-group date">
|
||||
<div class="input-group-addon">
|
||||
<i class="fa fa-calendar"></i>
|
||||
</div>
|
||||
<input type="text" class="form-control" id="date" name="date"
|
||||
value="${bean.date.substring(0,10)} " autocomplete="off"/>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">* 要求报告日期:</label>
|
||||
<div class="col-sm-4">
|
||||
<div class="input-group date">
|
||||
<div class="input-group-addon">
|
||||
<i class="fa fa-calendar"></i>
|
||||
</div>
|
||||
<input type="text" class="form-control" id="reportDate" name="reportDate"
|
||||
value="${bean.reportDate.substring(0,10)}" placeholder="请选择.."
|
||||
autocomplete="off"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<%-- <div class="form-group">--%>
|
||||
<%-- <label class="col-sm-2 control-label ">* 采样车间:</label>--%>
|
||||
<%-- <div class="col-sm-4 ">--%>
|
||||
|
||||
<%-- <input type="text" name="deptNames" id="deptNames" class="form-control"--%>
|
||||
<%-- value="${bean.deptNames} " placeholder="">--%>
|
||||
<%-- <input type="hidden" name="deptIds" id="deptIds" class="form-control"--%>
|
||||
<%-- value="${bean.deptIds} " placeholder="">--%>
|
||||
|
||||
<%-- </div>--%>
|
||||
<%-- </div>--%>
|
||||
<div class="form-group">
|
||||
<input type="checkbox" class="form-checkbox" value="1" name="isAutoPlan" id="isAutoPlan"
|
||||
style="margin-left: 19px;margin-top: 7px;"/>
|
||||
<label class="col-sm-2 control-label">自动下发采样计划:</label>
|
||||
<div class="col-sm-4">
|
||||
<div class="input-group date">
|
||||
<div class="input-group-addon">
|
||||
<i class="fa fa-calendar"></i>
|
||||
</div>
|
||||
<input type="text" class="form-control" id="autoplanEndDate"
|
||||
name="autoplanEndDate"
|
||||
placeholder="请选择.." autocomplete="off"/>
|
||||
</div>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">间隔类型: </label>
|
||||
<div class="col-sm-4">
|
||||
<div class="input-group">
|
||||
<input type="text" readonly value="${bean.samplingPeriodName}"
|
||||
class="form-control"/>
|
||||
<input type="hidden" readonly value="${bean.samplingPeriodCode}"
|
||||
class="form-control" id="amplingPeriod" name="amplingPeriod"/>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
|
||||
<label class="col-sm-2 control-label">间隔时间: </label>
|
||||
<div class="col-sm-4">
|
||||
<div class="input-group">
|
||||
<input type="text" readonly value="${bean.intervalDay}" class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="btn-group" style="width: 220px;padding-bottom:10px;">
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="deletesFunD();"><i
|
||||
class="fa fa-trash-o"></i> 删除
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<table id="table2"></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>
|
||||
<button type="button" class="btn btn-primary " style="margin-left: 10px"
|
||||
onclick="submitFun()">下发
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
653
WebRoot/jsp/whp/plan/WhpSamplingPlanList.jsp
Normal file
653
WebRoot/jsp/whp/plan/WhpSamplingPlanList.jsp
Normal file
@ -0,0 +1,653 @@
|
||||
<%@ 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">
|
||||
var timeEnd;
|
||||
var timeBegin;
|
||||
var timeRangeEnd;
|
||||
var timeRangeBegin;
|
||||
$(function () {
|
||||
conditionDropDowntype();
|
||||
conditionDropDownstatus();
|
||||
conditionDropDownisAutoPlanStatus();
|
||||
initTableList();
|
||||
initDate1();
|
||||
initDate2();
|
||||
$('#reservationtimeD').val('');
|
||||
$('#repotDateFun').val('');
|
||||
timeEnd = null;
|
||||
timeBegin = null;
|
||||
timeRangeEnd = null;
|
||||
timeRangeBegin = null;
|
||||
});
|
||||
//对Date的扩展,将 Date 转化为指定格式的String
|
||||
//月(M)、日(d)、小时(h)、分(m)、秒(s)、季度(q) 可以用 1-2 个占位符,
|
||||
//年(y)可以用 1-4 个占位符,毫秒(S)只能用 1 个占位符(是 1-3 位的数字)
|
||||
Date.prototype.Format = function (fmt) {
|
||||
var o = {
|
||||
"M+": this.getMonth() + 1, //月份
|
||||
"d+": this.getDate(), //日
|
||||
"H+": this.getHours(), //小时
|
||||
"m+": this.getMinutes(), //分
|
||||
"s+": this.getSeconds(), //秒
|
||||
"q+": Math.floor((this.getMonth() + 3) / 3), //季度
|
||||
"S": this.getMilliseconds() //毫秒
|
||||
};
|
||||
if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
|
||||
for (var k in o)
|
||||
if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
|
||||
return fmt;
|
||||
}
|
||||
|
||||
function initDate2() {
|
||||
var locale = {
|
||||
"format": 'YYYY-MM-DD ',
|
||||
"separator": " ~ ",
|
||||
"applyLabel": "确定",
|
||||
"cancelLabel": "取消",
|
||||
"fromLabel": "起始时间",
|
||||
"toLabel": "结束时间'",
|
||||
"customRangeLabel": "自定义",
|
||||
"weekLabel": "W",
|
||||
"daysOfWeek": ["日", "一", "二", "三", "四", "五", "六"],
|
||||
"monthNames": ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
|
||||
"firstDay": 1
|
||||
};
|
||||
var oldreservationtime1 = "${param.oldreservationtime1}";
|
||||
if (oldreservationtime1 != "" && oldreservationtime1.length > 0) {
|
||||
timeBegin = oldreservationtime1.substring(0, 16);
|
||||
timeEnd = oldreservationtime1.substring(19, 36);
|
||||
$('#repotDateFun').val(oldreservationtime1);
|
||||
} else {
|
||||
timeBegin = moment().subtract(3, 'days').format('YYYY-MM-DD');
|
||||
timeEnd = moment().subtract(0, 'days').format('YYYY-MM-DD');
|
||||
// $('#repotDateFun').val(timeBegin + locale.separator + timeEnd);
|
||||
}
|
||||
|
||||
// $('#repotDateFun').daterangepicker({
|
||||
// "timePicker": true,
|
||||
// "timePicker24Hour": true,
|
||||
// "linkedCalendars": false,
|
||||
// "autoUpdateInput": false,
|
||||
// "timePickerIncrement": 10,
|
||||
// "locale": locale,
|
||||
// //汉化按钮部分
|
||||
// // ranges: {
|
||||
// // // '今日': [moment(), moment().subtract(-1, 'days')],
|
||||
// // '昨日': [moment().subtract(1, 'days'), moment()],
|
||||
// // '最近7日': [moment().subtract(6, 'days'), moment().subtract(-1, 'days')],
|
||||
// // '本月': [moment().startOf('month'), moment().endOf('month').subtract(-1, 'days')],
|
||||
// // '上月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month').subtract(-1, 'days')]
|
||||
// // },
|
||||
// startDate: timeBegin,
|
||||
// endDate: timeEnd
|
||||
// }, function (start, end, label) {
|
||||
//
|
||||
// timeBegin = start.format(this.locale.format);
|
||||
// timeEnd = end.format(this.locale.format);
|
||||
// if (!this.startDate) {
|
||||
// this.element.val('');
|
||||
// } else {
|
||||
// this.element.val(this.startDate.format(this.locale.format) + this.locale.separator + this.endDate.format(this.locale.format));
|
||||
// }
|
||||
// });
|
||||
// $('#repotDateFun').on('apply.daterangepicker', function(ev, picker) {
|
||||
// console.log(11111111111,ev, picker)
|
||||
// });
|
||||
|
||||
$('#repotDateFun').daterangepicker({
|
||||
"locale": locale,
|
||||
"startDate": timeBegin,
|
||||
"endDate": timeEnd
|
||||
}, function (start, end, label) {
|
||||
timeBegin = start.format(this.locale.format);
|
||||
timeEnd = end.format(this.locale.format);
|
||||
});
|
||||
|
||||
};
|
||||
var timedelete = function () {
|
||||
$('#repotDateFun').val('');
|
||||
timeEnd = null;
|
||||
timeBegin = null;
|
||||
};
|
||||
|
||||
function initDate1() {
|
||||
var locale = {
|
||||
"format": 'YYYY-MM-DD',
|
||||
"separator": " ~ ",
|
||||
"applyLabel": "确定",
|
||||
"cancelLabel": "取消",
|
||||
"fromLabel": "起始时间",
|
||||
"toLabel": "结束时间'",
|
||||
"customRangeLabel": "自定义",
|
||||
"weekLabel": "W",
|
||||
"daysOfWeek": ["日", "一", "二", "三", "四", "五", "六"],
|
||||
"monthNames": ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
|
||||
"firstDay": 1
|
||||
};
|
||||
var oldreservationtime1 = "${param.oldreservationtime1}";
|
||||
if (oldreservationtime1 != "" && oldreservationtime1.length > 0) {
|
||||
timeRangeBegin = oldreservationtime1.substring(0, 16);
|
||||
timeRangeEnd = oldreservationtime1.substring(19, 36);
|
||||
$('#reservationtimeD').val(oldreservationtime1);
|
||||
} else {
|
||||
timeRangeBegin = moment().subtract(3, 'days').format('YYYY-MM-DD');
|
||||
timeRangeEnd = moment().subtract(0, 'days').format('YYYY-MM-DD');
|
||||
$('#reservationtimeD').val(timeRangeBegin + locale.separator + timeRangeEnd);
|
||||
}
|
||||
|
||||
$('#reservationtimeD').daterangepicker({
|
||||
// "timePicker": true,
|
||||
// "timePicker24Hour": true,
|
||||
// "linkedCalendars": false,
|
||||
// "autoUpdateInput": false,
|
||||
// "timePickerIncrement": 10,
|
||||
"locale": locale,
|
||||
startDate: timeRangeBegin,
|
||||
endDate: timeRangeEnd
|
||||
}, function (start, end, label) {
|
||||
timeRangeBegin = start.format(this.locale.format);
|
||||
timeRangeEnd = end.format(this.locale.format);
|
||||
});
|
||||
|
||||
};
|
||||
var timedel = function () {
|
||||
$('#reservationtimeD').val('');
|
||||
timeRangeEnd = null;
|
||||
timeRangeBegin = null;
|
||||
};
|
||||
var addFun = function () {
|
||||
$("#searchForm").bootstrapValidator('validate');//提交验证
|
||||
$.post(ext.contextPath + '/whp/plan/WhpSamplingPlan/add.do', {unitId: unitId}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
//详情弹窗
|
||||
var viewFun = function (id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/whp/plan/WhpSamplingPlan/view.do', {id: id}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
//样品列表
|
||||
var settingFun = function (id) {
|
||||
$.post(ext.contextPath + '/whp/plan/WhpSamplingPlanItem/showList.do', {id: id}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
//编辑页面
|
||||
var editFun = function (id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/whp/plan/WhpSamplingPlan/edit.do', {id: id}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
// 打印
|
||||
var printFun = function (id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/whp/plan/WhpSamplingPlan/print.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/plan/WhpSamplingPlan/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/plan/WhpSamplingPlan/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 () {
|
||||
timeEnd = null;
|
||||
timeBegin = null;
|
||||
timeRangeEnd = null;
|
||||
timeRangeBegin = null;
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/whp/plan/WhpSamplingPlan/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,
|
||||
dateBegin: timeRangeBegin,
|
||||
dateEnd: timeRangeEnd,
|
||||
reportDateBegin: timeBegin,
|
||||
reportDateEnd: timeEnd,
|
||||
status: $('#status').val(),
|
||||
isAutoPlan: $('#isAutoPlanStatus').val(),
|
||||
sampleTypeId: $('#sampleTypeIdForListQuery').val()
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
//detailView: true,//父子表
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
},
|
||||
{
|
||||
field: 'isAutoPlan', // 返回json数据中的name
|
||||
title: '是否自动下发', // 表格表头显示文字
|
||||
width: 50,
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter: function (value, row, index) {
|
||||
if (value == 1) {
|
||||
return '√';
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
field: 'code', // 返回json数据中的name
|
||||
title: '采样单编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',// 上下居中
|
||||
formatter: function (value, row) {
|
||||
|
||||
if (row.playType == 1) {
|
||||
return '(车间)' + value;
|
||||
} else {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
}, {
|
||||
field: 'date', // 返回json数据中的name
|
||||
title: '计划采样日期', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter: function (value, row, index) {
|
||||
return value.substring(0, 10);
|
||||
}
|
||||
}, {
|
||||
field: 'sampleTypeName', // 返回json数据中的name
|
||||
title: '采样类型', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
|
||||
}, {
|
||||
field: 'reportDate', // 返回json数据中的name
|
||||
title: '要求报告日期', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter: function (value, row, index) {
|
||||
return value.substring(0, 10);
|
||||
}
|
||||
}, {
|
||||
field: 'statusName', // 返回json数据中的name
|
||||
title: '计划状态', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter: function (value, row, index) {
|
||||
if (row.statusName.includes("超时预警")) {
|
||||
return '<span style="color:red">' + value + '</span>'
|
||||
} else {
|
||||
return value
|
||||
}
|
||||
}
|
||||
|
||||
}, {
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 160, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts = '';
|
||||
if (row.status == 1) {
|
||||
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>';
|
||||
} else {
|
||||
buts += '<button class="btn btn-default btn-sm" title="详情" onclick="viewFun(\'' + row.id + '\')"><i class="fa fa-eye"></i><span class="hidden-md hidden-lg"> 详情</span></button>';
|
||||
buts += '<button class="btn btn-default btn-sm" title="打印" onclick="printFun(\'' + row.id + '\')"><i class="glyphicon glyphicon-print"></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('${status}');
|
||||
var select_3 = $("#status").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 conditionDropDownisAutoPlanStatus() {
|
||||
var select_Data = jQuery.parseJSON('${isAutoPlanStatus}');
|
||||
var select_3 = $("#isAutoPlanStatus").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 conditionDropDowntype() {
|
||||
var select_Data = jQuery.parseJSON('${type}');
|
||||
var select_3 = $("#sampleTypeIdForListQuery").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="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>
|
||||
|
||||
<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="sampleTypeIdForListQuery"
|
||||
id="sampleTypeIdForListQuery"
|
||||
style="width:150px;height: 30px">
|
||||
</select>
|
||||
<label class="form-label">计划状态:</label>
|
||||
<select class="form-control select2" name="status" id="status"
|
||||
style="width:150px;height: 30px">
|
||||
</select>
|
||||
<label class="form-label">自动下发:</label>
|
||||
<select class="form-control select2" id ="isAutoPlanStatus" name="isAutoPlanStatus"
|
||||
style="width:150px;height: 30px">
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-label">计划采样日期:</label>
|
||||
<div class="input-group input-group-sm" style="width: 200px;">
|
||||
<input type="text" autocomplete="off" class="form-control pull-left"
|
||||
style="height: 30px; width: 240px; border-radius: 4px;" id="reservationtimeD"
|
||||
placeholder="请选择计划采样日期范围">
|
||||
<a class="glyphicon glyphicon-remove btn form-control-feedback input-clear-a"
|
||||
style="pointer-events: auto;"
|
||||
onclick="timedel()"></a>
|
||||
</div>
|
||||
<label class="form-label">要求报告日期:</label>
|
||||
<div class="input-group input-group-sm" style="width: 200px;">
|
||||
<input type="text" autocomplete="off" class="form-control pull-left"
|
||||
style="height: 30px; width: 240px; border-radius: 4px;" id="repotDateFun"
|
||||
placeholder="请选择要求报告日期范围">
|
||||
<a class="glyphicon glyphicon-remove btn form-control-feedback input-clear-a"
|
||||
style="pointer-events: auto;"
|
||||
onclick="timedelete()"></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="input-group input-group-sm">
|
||||
<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>
|
||||
283
WebRoot/jsp/whp/plan/WhpSamplingPlanPrint.jsp
Normal file
283
WebRoot/jsp/whp/plan/WhpSamplingPlanPrint.jsp
Normal file
@ -0,0 +1,283 @@
|
||||
<%--<%String serverPath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort();%>--%>
|
||||
<%--<%String contextPath = request.getContextPath();%>--%>
|
||||
|
||||
|
||||
<!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" %>
|
||||
<%String serverPath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort();%>
|
||||
<%String contextPath = request.getContextPath();%>
|
||||
<style type="text/css">
|
||||
table.wTable {
|
||||
margin-top: 15px;
|
||||
/*border-collapse:collapse;*/
|
||||
/*border:1px solid #aaa;*/
|
||||
width: 100%;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
table.wTable th {
|
||||
vertical-align: baseline;
|
||||
padding: 5px 15px 5px 6px;
|
||||
background-color: #3F3F3F;
|
||||
border: 1px solid #3F3F3F;
|
||||
text-align: left;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
table.wTable td {
|
||||
vertical-align: text-top;
|
||||
padding: 6px 15px 6px 6px;
|
||||
border: 1px solid #aaa;
|
||||
}
|
||||
|
||||
table.wTable tr:nth-child(odd) {
|
||||
background-color: #F5F5F5;
|
||||
}
|
||||
|
||||
table.wTable tr:nth-child(even) {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
|
||||
|
||||
});
|
||||
|
||||
function updateSaveFun() {
|
||||
console.log(11111)
|
||||
|
||||
var paramString = ""
|
||||
// paramString = "liquidWasteType=" + $('#typeCondition').val()
|
||||
paramString = "liquidWasteType=" + "全部";
|
||||
// var status = $('#statusCondition').val();
|
||||
var status = 1;
|
||||
if (status != null) {
|
||||
paramString = "&status=" + status
|
||||
}
|
||||
// var likeString = "$('#likeString').val();"
|
||||
var likeString = "";
|
||||
if (likeString != null && likeString != '') {
|
||||
paramString = "&likeString=" + likeString
|
||||
}
|
||||
// window.open(ext.contextPath + "/whp/liquidWasteDispose/WhpLiquidWasteDispose/export.do?" + paramString);
|
||||
|
||||
|
||||
$.ajax({
|
||||
url: ext.contextPath + '/whp/liquidWasteDispose/WhpLiquidWasteDispose/export.do?' + paramString,
|
||||
type: 'POST',
|
||||
|
||||
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 printSaveFun(myDiv) {
|
||||
$('#printContext').show();
|
||||
/* var printHtml = document.getElementById(myDiv).innerHTML;
|
||||
var wind = window.open("", "newwin", "width=1550,height=565,top=80,left=80,toolbar=no,scrollbars=yes,menubar=no");
|
||||
var link = document.createElement('link');
|
||||
link.type = 'text/css';
|
||||
link.rel = 'stylesheet';
|
||||
link.href = '
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<%=serverPath%><%=contextPath%>/plugins/bootstrap-ext/dist/bootstrap.min.css';
|
||||
wind.document.head.appendChild(link);
|
||||
wind.document.body.innerHTML = printHtml;
|
||||
wind.print();
|
||||
wind.close();
|
||||
*/
|
||||
|
||||
var win = window.open('', 'printwindow', "width=1550,height=565,top=80,left=80,toolbar=no,scrollbars=yes,menubar=no");
|
||||
win.document.write('<html><head><link rel="stylesheet" type="text/css" href="<%=serverPath%><%=contextPath%>/plugins/bootstrap-ext/dist/bootstrap.min.css"></head><body>');
|
||||
win.document.write($("#printContext").html());
|
||||
win.document.write('</body></html>');
|
||||
win.print();
|
||||
win.close();
|
||||
|
||||
// $('#printContext').hide();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog" style="width: 85%">
|
||||
<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 id="printContext">
|
||||
<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;*/
|
||||
/*}*/
|
||||
|
||||
|
||||
.sampling {
|
||||
margin: 0 auto;
|
||||
border-collapse: collapse;
|
||||
/* border: 0.5px solid black; */
|
||||
width: 1000px;
|
||||
}
|
||||
|
||||
.sampling th {
|
||||
text-align: center;
|
||||
font-size: 32px;
|
||||
line-height: 80px;
|
||||
}
|
||||
|
||||
.sampling td {
|
||||
border: 0.5px solid black;
|
||||
line-height: 2em;
|
||||
word-wrap: break-word;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.sampling .content {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.sampling .title {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.sampling .indent {
|
||||
/* text-indent: 1em; */
|
||||
padding: 2px 5px;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
<div class="modal-body">
|
||||
<%-- --%>
|
||||
<h2 style="text-align: center">${data.header}</h2>
|
||||
<h3 style="text-align: center">采样单</h3>
|
||||
<h4 style="text-align: right;padding-right: 8em">编号:${data.sn}</h4>
|
||||
<table>
|
||||
<table class="sampling">
|
||||
<tr>
|
||||
<td colspan="4" class="title">采样单编号</td>
|
||||
<td colspan="4" class="indent">${bean.code}</td>
|
||||
<td colspan="4" class="hidden" style="display: none;">${bean.id}</td>
|
||||
<td colspan="4" class="title">采样类型</td>
|
||||
<td colspan="4" class="indent">${bean.sampleTypeName}</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="4" class="title">计划采样日期</td>
|
||||
<td colspan="4" class="indent">${bean.date.substring(0,10)}</td>
|
||||
<td colspan="4" class="title">要求报告日期</td>
|
||||
<td colspan="4" class="indent">${bean.reportDate.substring(0,10)}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="4" class="title">采样人</td>
|
||||
<td colspan="4" class="indent">${data.samplingUserNameStr}</td>
|
||||
<td colspan="4" class="title">收样人</td>
|
||||
<td colspan="4" class="indent">${bean.acceptUserName}</td>
|
||||
</tr>
|
||||
<tr class="content title">
|
||||
<td colspan="1">序号</td>
|
||||
<td colspan="3">样品编号</td>
|
||||
<td colspan="2">地点</td>
|
||||
<td colspan="2">是否检测</td>
|
||||
<td colspan="4">检测项目</td>
|
||||
<%-- <td colspan="2">采样人</td>--%>
|
||||
<td colspan="2">采样日期</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<c:forEach items="${taskList}" var="item" varStatus="status">
|
||||
<tr>
|
||||
<td class="content" colspan="1" width="6.25%">${status.count}</td>
|
||||
<td class="content" colspan="3" width="18.75%">${item.sampleCode}</td>
|
||||
<td class="indent" colspan="2" width="12.5%">${item.sampleAddress}</td>
|
||||
<td class="content" colspan="2"
|
||||
width="12.5%">${item.isTest ? '√' : '×'}</td>
|
||||
<td class="indent" colspan="4" width="25%">${item.testItemIds}</td>
|
||||
<%-- <td class="content" colspan="2" width="12.5%">${item.samplingUserName}</td>--%>
|
||||
<td class="content" colspan="2"
|
||||
width="12.5%">${item.samplingTime.substring(0,10)}</td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
|
||||
|
||||
</table>
|
||||
|
||||
<table class="sampling" id="wTable" bordercolor="black"
|
||||
border="1" cellpadding="0" cellpadding="2" width="70%" style="border-top: none">
|
||||
<%-- <thead>--%>
|
||||
<%-- <tr>--%>
|
||||
<%-- <th><h4 style="text-align: left;"> 备注:</h4></th>--%>
|
||||
<%-- </tr>--%>
|
||||
<%-- </thead>--%>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<div contenteditable="true">${data.remark}</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</table>
|
||||
|
||||
|
||||
</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="printSaveFun('printContext')">打印
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
533
WebRoot/jsp/whp/plan/WhpSamplingPlanTaskEdit.jsp
Normal file
533
WebRoot/jsp/whp/plan/WhpSamplingPlanTaskEdit.jsp
Normal file
@ -0,0 +1,533 @@
|
||||
<!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;
|
||||
}
|
||||
.form-checkbox {
|
||||
height: 23px;
|
||||
width: 23px;
|
||||
display: block;
|
||||
position: absolute;
|
||||
margin-top: 6px;
|
||||
margin-left: 13px;
|
||||
z-index: 9999;
|
||||
}
|
||||
.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 () {
|
||||
$("#samplingTime").datepicker({
|
||||
language: 'zh-CN',
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'yyyy-mm-dd',
|
||||
});
|
||||
if('${bean.samplingTime.substring(0,10)}'=='')
|
||||
{
|
||||
$("#samplingTime").datepicker('setDate', new Date());
|
||||
}
|
||||
|
||||
samplingEnvConditionDropDownList()
|
||||
sampleAppearanceConditionDropDownList()
|
||||
sampleSupernatantDropDownlist();
|
||||
sampleNatureDropDownList();
|
||||
conditionDropDowntype()
|
||||
deptChange();
|
||||
});
|
||||
|
||||
//样品状态
|
||||
function conditionDropDowntype() {
|
||||
var selelct_1Data = jQuery.parseJSON('${sampleStateDropDown}');
|
||||
var selelct_1 = $("#sampleState").select2({
|
||||
data: selelct_1Data,
|
||||
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'});
|
||||
|
||||
if('${bean.sampleState}'!='')
|
||||
{
|
||||
selelct_1.val('${bean.sampleState}').trigger("change");
|
||||
}else{
|
||||
selelct_1.val('1').trigger("change");
|
||||
|
||||
}
|
||||
selelct_1.on("change", function (e) {
|
||||
deptChange();
|
||||
});
|
||||
|
||||
// selelct_1.val(selelct_1Data[1].id).trigger("change")
|
||||
}
|
||||
|
||||
//样品数量刷新
|
||||
function deptChange() {
|
||||
var type = $("#sampleState").val();
|
||||
if (type==1){
|
||||
$("#sampleAmountunit").text('ml')
|
||||
$("#unit").val('ml')
|
||||
} else {
|
||||
$("#sampleAmountunit").text('g')
|
||||
$("#unit").val('g')
|
||||
}
|
||||
}
|
||||
//现场采样情况
|
||||
function samplingEnvConditionDropDownList() {
|
||||
var select_Data = jQuery.parseJSON('${samplingPlanTaskEnvDropDown}');
|
||||
console.log(select_Data);
|
||||
var select_3 = $("#samplingEnv").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'});
|
||||
//单选赋值
|
||||
if ('${bean.samplingEnv}'=='')
|
||||
{
|
||||
select_3.val('0').trigger("change");
|
||||
}else{
|
||||
select_3.val('${bean.samplingEnv}').trigger("change");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
//样品外观
|
||||
function sampleAppearanceConditionDropDownList() {
|
||||
var select_Data = jQuery.parseJSON('${sampleAppearanceDropDown}');
|
||||
console.log(select_Data);
|
||||
var select_3 = $("#sampleAppearance").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'});
|
||||
//单选赋值
|
||||
if('${bean.sampleAppearance}'=='')
|
||||
{
|
||||
select_3.val('1').trigger("change");
|
||||
}else{
|
||||
|
||||
select_3.val('${bean.sampleAppearance}').trigger("change");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
//上清液
|
||||
function sampleSupernatantDropDownlist() {
|
||||
var select_Data = jQuery.parseJSON('${sampleSupernatantDropDown}');
|
||||
|
||||
var select_3 = $("#sampleSupernatant").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'});
|
||||
//单选赋值
|
||||
if('${bean.sampleSupernatant}'=='')
|
||||
{
|
||||
select_3.val('2').trigger("change");
|
||||
}else{
|
||||
|
||||
select_3.val('${bean.sampleSupernatant}').trigger("change");
|
||||
}
|
||||
|
||||
|
||||
} //性质
|
||||
function sampleNatureDropDownList() {
|
||||
var select_Data = jQuery.parseJSON('${sampleNatureDropDown}');
|
||||
|
||||
var select_3 = $("#sampleNature").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'});
|
||||
//单选赋值
|
||||
if('${bean.sampleNature}'=='')
|
||||
{
|
||||
select_3.val('').trigger("change");
|
||||
}else{
|
||||
|
||||
select_3.val('${bean.sampleNature}').trigger("change");
|
||||
}
|
||||
}
|
||||
function updateFun() {
|
||||
$("#editForm").data("bootstrapValidator").updateStatus("samplingUserName","NOT_VALIDATED", null).validateField("samplingUserName");
|
||||
$("#editForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#editForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
var formData = new FormData($("#editForm")[0]);
|
||||
$.ajax({
|
||||
url: ext.contextPath + "/whp/plan/WhpSamplingPlanTask/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) {
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
function submitFun() {
|
||||
//console.log($("#editForm").serialize());
|
||||
$("#editForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#editForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
var formData = new FormData($("#editForm")[0]);
|
||||
$.ajax({
|
||||
url: ext.contextPath + "/whp/plan/WhpSamplingPlanTask/submit.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) {
|
||||
if('${param.inSt}'!=null&&'${param.inSt}'=='homePage'){
|
||||
$("#table4").bootstrapTable('refresh');
|
||||
}else{
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}
|
||||
closeModal('subModal');
|
||||
} else {
|
||||
showAlert('d', '保存失败!' + data.msg);
|
||||
}
|
||||
},
|
||||
error: function (data) {
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
$("#editForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
sampleCode: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '样品编号不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
sampleAddress: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '地点不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
samplingEnv: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '现场采样情况不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
sampleAppearance: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '样品外观不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
sampleAmount: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '样品数量不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
samplingUserName: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '采样人不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
samplingTime: {
|
||||
trigger:"change",
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '采样时间不能为空'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
// 采样人
|
||||
function selectdutyUser() {
|
||||
$.post(ext.contextPath + '/user/userForOneSelect.do',
|
||||
{
|
||||
formId: "editForm",
|
||||
hiddenId: "samplingUserId",
|
||||
textId: "samplingUserName"
|
||||
},
|
||||
function (data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal('user4SelectModal');
|
||||
});
|
||||
|
||||
};
|
||||
</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="sampleCode" id="sampleCode" class="form-control"
|
||||
readonly value="${bean.sampleCode}">
|
||||
<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="sampleAddress" id="sampleAddress" class="form-control"
|
||||
value="${bean.sampleAddress} " 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="samplingEnv" id="samplingEnv"
|
||||
style="width: 100%;height: 34px">
|
||||
</select>
|
||||
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">* 样品外观:</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control" name="sampleAppearance" id="sampleAppearance"
|
||||
style="width: 100%;height: 34px">
|
||||
</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="sampleSupernatant" id="sampleSupernatant"
|
||||
style="width: 100%;height: 34px">
|
||||
</select>
|
||||
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">* 性质:</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control" name="sampleNature" id="sampleNature"
|
||||
style="width: 100%;height: 34px">
|
||||
</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="sampleState" id="sampleState"
|
||||
style="width: 100%;height: 34px">
|
||||
</select>
|
||||
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label ">* 样品数量:</label>
|
||||
<div class="col-sm-4 " >
|
||||
|
||||
<input type="text" name="sampleAmount" id="sampleAmount"
|
||||
<c:if test="${bean.sampleAmount!=null}">value="${bean.sampleAmount}" </c:if> <c:if test="${bean.sampleAmount==null}">value="1000" </c:if> style="width: 60%" placeholder="">
|
||||
<input type="hidden" name="unit" id="unit" >
|
||||
|
||||
<label name="sampleAmountunit" id="sampleAmountunit"
|
||||
style="position: absolute;float: right;margin-left: 10px;size: 18px;"></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label ">* 采样人:</label>
|
||||
<div class="col-sm-4 ">
|
||||
<input type="text" id="samplingUserName" name="samplingUserName" class="form-control"
|
||||
placeholder="请选择.." ondblclick="selectdutyUser()" value="${bean.samplingUserName}">
|
||||
<input type="hidden" id="samplingUserId" name="samplingUserId" class="form-control"
|
||||
placeholder="请选择.." value="${bean.samplingUserId}" >
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label ">* 采样时间:</label>
|
||||
<div class="col-sm-4 ">
|
||||
|
||||
<div class="input-group date">
|
||||
<div class="input-group-addon">
|
||||
<i class="fa fa-calendar"></i>
|
||||
</div>
|
||||
<input type="text" class="form-control" id="samplingTime" name="samplingTime"
|
||||
value="${bean.samplingTime.substring(0,10)} " />
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
||||
<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>
|
||||
<button type="button" class="btn btn-primary " style="margin-left: 10px"
|
||||
onclick="submitFun()">提交样品登记
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
1
WebRoot/jsp/whp/plan/WhpSamplingPlanTaskList.jsp
Normal file
1
WebRoot/jsp/whp/plan/WhpSamplingPlanTaskList.jsp
Normal file
File diff suppressed because one or more lines are too long
1
WebRoot/jsp/whp/plan/WhpSamplingPlanTaskListForTest.jsp
Normal file
1
WebRoot/jsp/whp/plan/WhpSamplingPlanTaskListForTest.jsp
Normal file
File diff suppressed because one or more lines are too long
211
WebRoot/jsp/whp/plan/WhpSamplingPlanTaskShowConfirm.jsp
Normal file
211
WebRoot/jsp/whp/plan/WhpSamplingPlanTaskShowConfirm.jsp
Normal file
@ -0,0 +1,211 @@
|
||||
<!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;
|
||||
|
||||
}
|
||||
|
||||
.select2-container--default .select2-selection--single {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.select2-container--default .select2-selection--single, .select2-selection .select2-selection--single {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.select2-container--default .select2-selection--single .select2-selection__arrow b {
|
||||
border: none;
|
||||
border-style: unset
|
||||
}
|
||||
|
||||
.select2-container--default.select2-container--disabled .select2-selection--single {
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
.right {
|
||||
margin-left: 50px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
initTable2();
|
||||
});
|
||||
|
||||
function initTable2() {
|
||||
|
||||
$("#table2").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/whp/plan/WhpSamplingPlanTask/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,
|
||||
planCode: '${bean.planCode}',
|
||||
status: 1
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
//detailView: true,//父子表
|
||||
columns: [
|
||||
{
|
||||
field: 'sampleCode', // 返回json数据中的name
|
||||
title: '样品编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'sampleAddress', // 返回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 '×';
|
||||
}
|
||||
}
|
||||
|
||||
}, {
|
||||
field: 'testItemNames', // 返回json数据中的name
|
||||
title: '检测项目', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
|
||||
}
|
||||
|
||||
],
|
||||
onLoadSuccess: function (data) { //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
// selectFun()
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
});
|
||||
}
|
||||
function SavedataFun() {
|
||||
// console.log($("#addForm").serialize());
|
||||
$("#addForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#addForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
var formData = new FormData($("#addForm")[0]);
|
||||
$.ajax({
|
||||
url: ext.contextPath + "/whp/plan/WhpSamplingPlanTask/confirm.do",
|
||||
type: 'POST',
|
||||
data: formData,
|
||||
async: false,
|
||||
cache: false,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
|
||||
if (data.code == 1) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
closeModal('subModal');
|
||||
} else {
|
||||
showAlert('d', '保存失败!' + data.msg);
|
||||
}
|
||||
},
|
||||
error: function (data) {
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog " style="width: 65%">
|
||||
<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="addForm" enctype="multipart/form-data">
|
||||
<div id="alertDiv"></div>
|
||||
<%-- <input type="hidden" name="id" value="${user.id }" />--%>
|
||||
<!-- 界面提醒div强制id为alertdiv -->
|
||||
|
||||
<input type="hidden" name="id" id="id" class="form-control" value="${bean.id}">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 样品编号:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${bean.sampleCode}</p>
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">* 采样车间:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${bean.deptNames}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 计划采样日期:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${bean.planDate.substring(0,10)}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">* 要求报告日期:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${bean.reportDate.substring(0,10)}</p>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<table id="table2"></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="SavedataFun()">确定
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
324
WebRoot/jsp/whp/plan/WhpSamplingPlanTaskView.jsp
Normal file
324
WebRoot/jsp/whp/plan/WhpSamplingPlanTaskView.jsp
Normal file
@ -0,0 +1,324 @@
|
||||
<!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;
|
||||
|
||||
}
|
||||
|
||||
.select2-container--default .select2-selection--single {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.select2-container--default .select2-selection--single, .select2-selection .select2-selection--single {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.select2-container--default .select2-selection--single .select2-selection__arrow b {
|
||||
border: none;
|
||||
border-style: unset
|
||||
}
|
||||
|
||||
.select2-container--default.select2-container--disabled .select2-selection--single {
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
.right {
|
||||
margin-left: 50px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
|
||||
samplingEnvConditionDropDownList()
|
||||
sampleAppearanceConditionDropDownList()
|
||||
sampleSupernatantDropDownlist();
|
||||
sampleNatureDropDownList();
|
||||
conditionDropDowntype()
|
||||
});
|
||||
//样品状态
|
||||
function conditionDropDowntype() {
|
||||
var selelct_1Data = jQuery.parseJSON('${sampleStateDropDown}');
|
||||
var selelct_1 = $("#sampleState").select2({
|
||||
data: selelct_1Data,
|
||||
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'});
|
||||
selelct_1.val('${bean.sampleState}').trigger("change");
|
||||
selelct_1.on("change", function (e) {
|
||||
deptChange();
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
//样品数量刷新
|
||||
function deptChange() {
|
||||
var type = $("#sampleState").val();
|
||||
if (type==1){
|
||||
$("#sampleAmountunit").text('ml')
|
||||
} else {
|
||||
$("#sampleAmountunit").text('g')
|
||||
}
|
||||
}
|
||||
//现场采样情况
|
||||
function samplingEnvConditionDropDownList() {
|
||||
var select_Data = jQuery.parseJSON('${samplingPlanTaskEnvDropDown}');
|
||||
console.log(select_Data);
|
||||
var select_3 = $("#samplingEnv").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.samplingEnv}').trigger("change");
|
||||
|
||||
}
|
||||
//样品外观
|
||||
function sampleAppearanceConditionDropDownList() {
|
||||
var select_Data = jQuery.parseJSON('${sampleAppearanceDropDown}');
|
||||
console.log(select_Data);
|
||||
var select_3 = $("#sampleAppearance").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.sampleAppearance}').trigger("change");
|
||||
|
||||
}
|
||||
|
||||
//上清液
|
||||
function sampleSupernatantDropDownlist() {
|
||||
var select_Data = jQuery.parseJSON('${sampleSupernatantDropDown}');
|
||||
|
||||
var select_3 = $("#sampleSupernatant").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'});
|
||||
//单选赋值
|
||||
if('${bean.sampleSupernatant}'=='')
|
||||
{
|
||||
select_3.val('').trigger("change");
|
||||
}else{
|
||||
|
||||
select_3.val('${bean.sampleSupernatant}').trigger("change");
|
||||
}
|
||||
|
||||
|
||||
} //性质
|
||||
function sampleNatureDropDownList() {
|
||||
var select_Data = jQuery.parseJSON('${sampleNatureDropDown}');
|
||||
|
||||
var select_3 = $("#sampleNature").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'});
|
||||
//单选赋值
|
||||
if('${bean.sampleNature}'=='')
|
||||
{
|
||||
select_3.val('').trigger("change");
|
||||
}else{
|
||||
|
||||
select_3.val('${bean.sampleNature}').trigger("change");
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog " style="width: 65%">
|
||||
<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 -->
|
||||
|
||||
<input type="hidden" name="id" id="id" class="form-control" value="${bean.id}">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 样品编号:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${bean.sampleCode}</p>
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">* 地点:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${bean.sampleAddress}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 现场采样情况:</label>
|
||||
<div class="col-sm-4">
|
||||
|
||||
<select class="form-control" name="samplingEnv" id="samplingEnv"
|
||||
disabled="true" style="width: 100%;height: 34px">
|
||||
</select>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">* 样品外观:</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control" name="sampleAppearance" id="sampleAppearance"
|
||||
disabled="true" style="width: 100%;height: 34px">
|
||||
</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="sampleSupernatant" id="sampleSupernatant"
|
||||
disabled="true" style="width: 100%;height: 34px">
|
||||
</select>
|
||||
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">* 性质:</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control" name="sampleNature" id="sampleNature"
|
||||
disabled="true" style="width: 100%;height: 34px">
|
||||
</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="sampleState" id="sampleState"
|
||||
disabled="true" style="width: 100%;height: 34px">
|
||||
</select>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">* 样品数量:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static" style="width: 13%; float: left;">${bean.sampleAmount}</p>
|
||||
|
||||
<label name="sampleAmountunit" id="sampleAmountunit"
|
||||
style="padding-top: 7px;">${bean.unit} </label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 采样人:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${bean.samplingUserName}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">* 采样时间:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${bean.samplingTime.substring(0,10)}</p>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default " data-dismiss="modal">关闭
|
||||
</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
278
WebRoot/jsp/whp/plan/WhpSamplingPlanView.jsp
Normal file
278
WebRoot/jsp/whp/plan/WhpSamplingPlanView.jsp
Normal file
@ -0,0 +1,278 @@
|
||||
<!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;
|
||||
|
||||
}
|
||||
|
||||
.select2-container--default .select2-selection--single {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.select2-container--default .select2-selection--single, .select2-selection .select2-selection--single {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.select2-container--default .select2-selection--single .select2-selection__arrow b {
|
||||
border: none;
|
||||
border-style: unset
|
||||
}
|
||||
|
||||
.select2-container--default.select2-container--disabled .select2-selection--single {
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
.right {
|
||||
margin-left: 50px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
var plan;
|
||||
$(function () {
|
||||
<%--plan = ${bean}--%>
|
||||
conditionDropDowntype();
|
||||
initTable3()
|
||||
});
|
||||
|
||||
var cancelFun = 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 (val) {
|
||||
if (val) {
|
||||
console.log()
|
||||
$.post(ext.contextPath + '/whp/plan/WhpSamplingPlan/docancel.do', {id: '${bean.id}'}, function (data) {
|
||||
if (data.code === 1) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
closeModal('subModal');
|
||||
} else {
|
||||
showAlert('d', '撤销失败', + data.msg);
|
||||
}
|
||||
}, "json");
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
function conditionDropDowntype() {
|
||||
var selelct_1Data = jQuery.parseJSON('${type}');
|
||||
var selelct_1 = $("#sampleTypeId").select2({
|
||||
data: selelct_1Data,
|
||||
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'});
|
||||
selelct_1.val('${bean.sampleTypeId}').trigger("change");
|
||||
selelct_1.on("change", function (e) {
|
||||
/*if (data99.deptId !== undefined) {
|
||||
$("#rhistorytable").bootstrapTable('refresh');
|
||||
}*/
|
||||
});
|
||||
//selelct_1.val('${bean.code}').trigger("change")
|
||||
}
|
||||
|
||||
|
||||
function initTable3() {
|
||||
// var type = $("#sampleTypeId").val();
|
||||
// if (type == null || type === '') {
|
||||
// return;
|
||||
// }
|
||||
|
||||
$("#table3").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/whp/plan/WhpSamplingPlanTask/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,
|
||||
planCode: '${bean.code}'
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
//detailView: true,//父子表
|
||||
columns: [
|
||||
{
|
||||
field: 'sampleCode', // 返回json数据中的name
|
||||
title: '样品编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'sampleAddress', // 返回json数据中的name
|
||||
title: '地点', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
},{
|
||||
field: 'deptNames', // 返回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 '×';
|
||||
}
|
||||
}
|
||||
}, {
|
||||
field: 'testItemNames', // 返回json数据中的name
|
||||
title: '检测项目', // 表格表头显示文字
|
||||
align: 'center' // 左右居中
|
||||
|
||||
}
|
||||
],
|
||||
|
||||
|
||||
onLoadSuccess: function (data) { //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog " style="width: 65%">
|
||||
<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 -->
|
||||
|
||||
<input type="hidden" name="id" id="id" class="form-control" value="${bean.id}">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 采样单编号:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${bean.code}</p>
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">* 计划采样日期:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${bean.date.substring(0,10)}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 采样类型:</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control" name="sampleTypeId" id="sampleTypeId"
|
||||
disabled="true" style="width: 100%;height: 34px">
|
||||
</select>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">* 要求报告日期:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${bean.reportDate.substring(0,10)}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<%-- <label class="col-sm-2 control-label">* 采样车间:</label>--%>
|
||||
<%-- <div class="col-sm-4">--%>
|
||||
<%-- <p class="form-control-static">${bean.deptNames}</p>--%>
|
||||
<%-- </div>--%>
|
||||
<label class="col-sm-2 control-label"></label>
|
||||
<div class="col-sm-4">
|
||||
<c:if test='${bean.isAutoPlan == 1}'>
|
||||
<button type="button" class="btn btn-default " data-dismiss="modal"
|
||||
onclick="cancelFun()">采样任务撤销
|
||||
</button>
|
||||
</c:if>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<table id="table3"></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="updateSaveFun()">保存
|
||||
</button>--%>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
446
WebRoot/jsp/whp/plan/WhpSamplingPlanWorkAdd.jsp
Normal file
446
WebRoot/jsp/whp/plan/WhpSamplingPlanWorkAdd.jsp
Normal file
@ -0,0 +1,446 @@
|
||||
<!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;
|
||||
}
|
||||
|
||||
.form-checkbox {
|
||||
height: 23px;
|
||||
width: 23px;
|
||||
display: block;
|
||||
position: absolute;
|
||||
margin-top: 6px;
|
||||
margin-left: 13px;
|
||||
z-index: 9999;
|
||||
}
|
||||
|
||||
.table-hover > tbody > tr:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.input-clear-a {
|
||||
|
||||
color: white;
|
||||
|
||||
}
|
||||
|
||||
.input-content:hover + .input-clear-a {
|
||||
|
||||
color: #d4d4d4;
|
||||
|
||||
}
|
||||
.table-hover > tbody > tr:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.input-clear-a {
|
||||
|
||||
color: white;
|
||||
|
||||
}
|
||||
|
||||
.input-content:hover + .input-clear-a {
|
||||
|
||||
color: #d4d4d4;
|
||||
|
||||
}
|
||||
.labb::after{
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
background: red;
|
||||
}
|
||||
|
||||
.labb {
|
||||
border: 1px solid gray;
|
||||
padding: 5px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
initTime()
|
||||
$('#AutomaticTime').val('');
|
||||
//计划采样日期
|
||||
$("#date").datepicker({
|
||||
language: 'zh-CN',
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'yyyy-mm-dd',
|
||||
});
|
||||
//要求报告日期
|
||||
$("#reportDate").datepicker({
|
||||
language: 'zh-CN',
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'yyyy-mm-dd',
|
||||
});
|
||||
conditionDropDowntype()
|
||||
initTable2()
|
||||
|
||||
});
|
||||
|
||||
//浏览列表内容刷新
|
||||
function tableChange() {
|
||||
$("#tableFun").bootstrapTable('refresh');
|
||||
|
||||
}
|
||||
|
||||
//采样车间刷新
|
||||
function deptChange() {
|
||||
var type = $("#sampleTypeId").val();
|
||||
$.get(ext.contextPath + "/whp/baseinfo/WhpSampleType/getOne?id=" + type, function (data) {
|
||||
$("#deptIds").val(data.result.deptIds);
|
||||
$("#deptNames").val(data.result.deptNames);
|
||||
}, 'json');
|
||||
}
|
||||
|
||||
function conditionDropDowntype() {
|
||||
|
||||
var selelct_1Data = jQuery.parseJSON('${type}');
|
||||
var selelct_1 = $("#sampleTypeId").select2({
|
||||
data: selelct_1Data,
|
||||
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'});
|
||||
// selelct_1.val('').trigger("change");
|
||||
selelct_1.on("change", function (e) {
|
||||
deptChange();
|
||||
tableChange();
|
||||
});
|
||||
selelct_1.val(selelct_1Data[0].id).trigger("change")
|
||||
}
|
||||
|
||||
function saveFun() {
|
||||
|
||||
$("#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/plan/WhpSamplingPlan/workSave.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: {
|
||||
sampleTypeId: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '采样类型不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
deptNames: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '采样车间不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
date: {
|
||||
trigger:"change",
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '计划采样日期不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
reportDate: {
|
||||
trigger:"change",
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '要求报告日期不能为空'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
//对Date的扩展,将 Date 转化为指定格式的String
|
||||
//月(M)、日(d)、小时(h)、分(m)、秒(s)、季度(q) 可以用 1-2 个占位符,
|
||||
//年(y)可以用 1-4 个占位符,毫秒(S)只能用 1 个占位符(是 1-3 位的数字)
|
||||
Date.prototype.Format = function (fmt) {
|
||||
var o = {
|
||||
"M+": this.getMonth() + 1, //月份
|
||||
"d+": this.getDate(), //日
|
||||
"H+": this.getHours(), //小时
|
||||
"m+": this.getMinutes(), //分
|
||||
"s+": this.getSeconds(), //秒
|
||||
"q+": Math.floor((this.getMonth() + 3) / 3), //季度
|
||||
"S": this.getMilliseconds() //毫秒
|
||||
};
|
||||
if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
|
||||
for (var k in o)
|
||||
if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
|
||||
return fmt;
|
||||
}
|
||||
|
||||
function initTime() {
|
||||
var locale = {
|
||||
"format": 'YYYY-MM-DD',
|
||||
"separator": " ~ ",
|
||||
"applyLabel": "确定",
|
||||
"cancelLabel": "取消",
|
||||
"fromLabel": "起始时间",
|
||||
"toLabel": "结束时间'",
|
||||
"customRangeLabel": "自定义",
|
||||
"weekLabel": "W",
|
||||
"daysOfWeek": ["日", "一", "二", "三", "四", "五", "六"],
|
||||
"monthNames": ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
|
||||
"firstDay": 1
|
||||
};
|
||||
var oldreservationtime1 = "${param.oldreservationtime1}";
|
||||
if (oldreservationtime1 != "" && oldreservationtime1.length > 0) {
|
||||
strDate = oldreservationtime1.substring(0, 16);
|
||||
endDate = oldreservationtime1.substring(19, 36);
|
||||
$('#AutomaticTime').val(oldreservationtime1);
|
||||
} else {
|
||||
strDate = moment().subtract(3, 'days').format('YYYY-MM-DD HH:mm');
|
||||
endDate = moment().subtract(0, 'days').format('YYYY-MM-DD HH:mm');
|
||||
$('#AutomaticTime').val(strDate + locale.separator + endDate);
|
||||
}
|
||||
|
||||
$('#AutomaticTime').daterangepicker({
|
||||
"timePicker": true,
|
||||
"timePicker24Hour": true,
|
||||
"linkedCalendars": false,
|
||||
"autoUpdateInput": false,
|
||||
"timePickerIncrement": 10,
|
||||
"locale": locale,
|
||||
//汉化按钮部分
|
||||
// ranges: {
|
||||
// // '今日': [moment(), moment().subtract(-1, 'days')],
|
||||
// '昨日': [moment().subtract(1, 'days'), moment()],
|
||||
// '最近7日': [moment().subtract(6, 'days'), moment().subtract(-1, 'days')],
|
||||
// '本月': [moment().startOf('month'), moment().endOf('month').subtract(-1, 'days')],
|
||||
// '上月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month').subtract(-1, 'days')]
|
||||
// },
|
||||
startDate: strDate,
|
||||
endDate: endDate
|
||||
}, function (start, end, label) {
|
||||
strDate = start.format(this.locale.format);
|
||||
endDate = end.format(this.locale.format);
|
||||
if (!this.startDate) {
|
||||
this.element.val('');
|
||||
} else {
|
||||
this.element.val(this.startDate.format(this.locale.format) + this.locale.separator + this.endDate.format(this.locale.format));
|
||||
}
|
||||
});
|
||||
|
||||
};
|
||||
var datedel = function () {
|
||||
$('#AutomaticTime').val('');
|
||||
strDate = null;
|
||||
endDate = null;
|
||||
};
|
||||
|
||||
function initTable2() {
|
||||
var type = $("#sampleTypeId").val();
|
||||
if (type == null || type === '') {
|
||||
return;
|
||||
}
|
||||
$("#tableFun").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,
|
||||
typeId: $("#sampleTypeId").val(),
|
||||
status: 1
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
//detailView: true,//父子表
|
||||
columns: [
|
||||
{
|
||||
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',
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function timedelete() {
|
||||
|
||||
}
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog " style="width: 70%">
|
||||
<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 class="form-control" name="sampleTypeId" id="sampleTypeId"
|
||||
style="width: 100%">
|
||||
</select>
|
||||
<input type="hidden" name="playType" id="playType" class="form-control"
|
||||
value="1">
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">* 采样车间:</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" name="deptNames" id="deptNames" class="form-control"
|
||||
placeholder="">
|
||||
<input type="hidden" name="deptIds" id="deptIds" class="form-control"
|
||||
placeholder="">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 计划采样日期:</label>
|
||||
<div class="col-sm-4">
|
||||
<div class="input-group date">
|
||||
<div class="input-group-addon">
|
||||
<i class="fa fa-calendar"></i>
|
||||
</div>
|
||||
<input type="text" class="form-control" id="date" name="date"
|
||||
placeholder="请选择.." autocomplete="off"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">* 要求报告日期:</label>
|
||||
<div class="col-sm-4">
|
||||
<div class="input-group date">
|
||||
<div class="input-group-addon">
|
||||
<i class="fa fa-calendar"></i>
|
||||
</div>
|
||||
<input type="text" class="form-control" id="reportDate" name="reportDate"
|
||||
placeholder="请选择.." autocomplete="off"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</form>
|
||||
<table id="tableFun"></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="saveFun()">保存
|
||||
</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
655
WebRoot/jsp/whp/plan/WhpSamplingPlanWorkEdit.jsp
Normal file
655
WebRoot/jsp/whp/plan/WhpSamplingPlanWorkEdit.jsp
Normal file
@ -0,0 +1,655 @@
|
||||
<!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;
|
||||
}
|
||||
|
||||
.form-checkbox {
|
||||
height: 23px;
|
||||
width: 23px;
|
||||
display: block;
|
||||
position: absolute;
|
||||
margin-top: 6px;
|
||||
margin-left: 13px;
|
||||
z-index: 9999;
|
||||
}
|
||||
|
||||
.table-hover > tbody > tr:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.input-clear-a {
|
||||
|
||||
color: white;
|
||||
|
||||
}
|
||||
|
||||
.input-clear-b {
|
||||
|
||||
color: grey;
|
||||
|
||||
}
|
||||
|
||||
.input-content:hover + .input-clear-a {
|
||||
|
||||
color: #d4d4d4;
|
||||
|
||||
}
|
||||
|
||||
.input-content:hover + .input-clear-b {
|
||||
|
||||
color: #d4d4d4;
|
||||
|
||||
}
|
||||
|
||||
.labb {
|
||||
border: 1px solid gray;
|
||||
padding: 5px;
|
||||
border-radius: 5px;
|
||||
display: block;
|
||||
padding-right: 25px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
conditionDropDowntype();
|
||||
|
||||
$("#date").datepicker({
|
||||
language: 'zh-CN',
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'yyyy-mm-dd',
|
||||
});
|
||||
$("#reportDate").datepicker({
|
||||
language: 'zh-CN',
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'yyyy-mm-dd',
|
||||
});
|
||||
|
||||
initTable2();
|
||||
|
||||
$('#table2').bootstrapTable({
|
||||
onClickCell: function (field, value, row, $element) {
|
||||
selectFun()
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
function showPeriodNo() {
|
||||
var type = $("#type").val();
|
||||
|
||||
$.post(ext.contextPath + "/whp/plan/WhpSamplingPlan/periodNoList.do?typeId=" + type, function (data) {
|
||||
|
||||
var dataVal = []
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
dataVal.push(data[i].text)
|
||||
}
|
||||
$("#dept").val(dataVal)
|
||||
}, 'json');
|
||||
}
|
||||
|
||||
function conditionDropDowntype() {
|
||||
var selelct_1Data = jQuery.parseJSON('${type}');
|
||||
var selelct_1 = $("#sampleTypeId").select2({
|
||||
data: selelct_1Data,
|
||||
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'});
|
||||
selelct_1.val('${bean.sampleTypeId}').trigger("change");
|
||||
selelct_1.on("change", function (e) {
|
||||
deptChange();
|
||||
tableChange();
|
||||
});
|
||||
// selelct_1.val(selelct_1Data[0].id).trigger("change")
|
||||
}
|
||||
|
||||
//采样车间刷新
|
||||
function deptChange() {
|
||||
var type = $("#sampleTypeId").val();
|
||||
$.get(ext.contextPath + "/whp/baseinfo/WhpSampleType/getOne?id=" + type, function (data) {
|
||||
$("#deptIds").val(data.result.deptIds);
|
||||
$("#deptNames").val(data.result.deptNames);
|
||||
}, 'json');
|
||||
}
|
||||
|
||||
//浏览列表内容刷新
|
||||
function tableChange() {
|
||||
$("#table2").bootstrapTable('refresh');
|
||||
|
||||
}
|
||||
|
||||
|
||||
var selectChange1 = function (val, id, index) {
|
||||
let values = $('.form-control-isTest').eq(index).val()
|
||||
|
||||
$.ajax({
|
||||
url: ext.contextPath + "/whp/plan/WhpSamplingPlanTask/isTest.do?id=" + id + '&isTest=' +$('.form-control-isTest').eq(index).val(),
|
||||
type: 'POST',
|
||||
data: values,
|
||||
async: false,
|
||||
cache: false,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
// console.log(data)
|
||||
// if (data.code == 1) {
|
||||
// showAlert('S', '修改成功!' + data.msg);
|
||||
// } else {
|
||||
// showAlert('d', '修改失败!' + data.msg);
|
||||
// }
|
||||
},
|
||||
error: function (data) {
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
/*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/plan/WhpSamplingPlanTask/dodeletes.do', {ids : id}, function(data) {
|
||||
if(data==1){
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
*/
|
||||
|
||||
|
||||
function initTable2() {
|
||||
var type = $("#sampleTypeId").val();
|
||||
if (type == null || type === '') {
|
||||
return;
|
||||
}
|
||||
|
||||
$("#table2").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/whp/plan/WhpSamplingPlanTask/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,
|
||||
planCode: '${bean.code}',
|
||||
planType:1 //,
|
||||
//status: 0
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
//detailView: true,//父子表
|
||||
columns: [
|
||||
{
|
||||
field: 'sampleCode', // 返回json数据中的name
|
||||
title: '样品编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' ,// 上下居中
|
||||
formatter:function(value,row,index,field){
|
||||
var span=document.createElement('span');
|
||||
span.setAttribute('title',"采样人:"+row.samplingUserName+"(采样时间:"+row.samplingTime.substring(0,10)+";备注:"+row.notes+")");
|
||||
span.innerHTML=value;
|
||||
return span.outerHTML;
|
||||
}
|
||||
}, {
|
||||
field: 'sampleAddress', // 返回json数据中的name
|
||||
title: '地点', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'isTest', // 返回json数据中的name
|
||||
title: '是否检测', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
|
||||
return '<select class="form-control-isTest select2" name="isTest" id="isTest\'' + index + '\'" onchange="selectChange1(\'' + value + '\',\'' + row.id + '\',' + index + ')" style="width: 69%; width: 69%;height: 30px;border-radius: 5px;border: 1px solid gray;" value="'+value+'" > ' +
|
||||
'<option value="1" '+(value===true?'selected':'')+'>检测</option> <option value="0" '+ (value===false?'selected':'')+'>不检测</option>' +
|
||||
'</select>'
|
||||
}
|
||||
}, {
|
||||
field: 'isSample', // 返回json数据中的name
|
||||
title: '是否采样', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter:function (value,row,index) {
|
||||
|
||||
if (value==1)
|
||||
{
|
||||
|
||||
return '<a class="btn btn-primary btn-sm btn-flat" onclick="editFun1(\'' + row.id + '\')">已采样</a>';
|
||||
// return '<a claass="btn btn-default btn-sm" title="" onclick="editFun(\'' + row.id + '\')"><i class="fa fa-edit"></i><span class="hidden-md hidden-lg"> 已采样</span></>';
|
||||
}else{
|
||||
return '<a class="btn btn-primary btn-sm btn-flat" onclick="editFun1(\'' + row.id + '\')">未采样</a>';
|
||||
/* return '<a class="btn btn-default btn-sm" title="" onclick="editFun(\'' + row.id + '\')"><i class="fa fa-edit"></i><span class="hidden-md hidden-lg"> 未采样</span></a>';*/
|
||||
}
|
||||
}
|
||||
}, {
|
||||
field: 'testItemJson', // 返回json数据中的name
|
||||
title: '检测项目', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
|
||||
return '<select class="form-controlSE-testItemJson select2" name="testItemJson" onchange="selectChange(\'' + value + '\',\'' + row.id + '\',' + index + ')" style="width: 100%" value=""></select>'
|
||||
}
|
||||
}
|
||||
|
||||
],
|
||||
onLoadSuccess: function (data) { //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
if(data.rows){
|
||||
data.rows.forEach((row,index)=>{
|
||||
var select_Data = []
|
||||
try{
|
||||
select_Data =JSON.parse('${whpTestItemDropDown}');
|
||||
}catch (e) {
|
||||
|
||||
}
|
||||
$('.form-controlSE-testItemJson').eq(index).select2({
|
||||
data:select_Data,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示educationTypeCondition
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) {
|
||||
return markup;
|
||||
}, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
multiple: true,
|
||||
formatResult: function formatRepo(repo) {
|
||||
return repo.text;
|
||||
}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) {
|
||||
return repo.text;
|
||||
} // 函数用于呈现当前的选择
|
||||
})
|
||||
|
||||
console.log("row.testItemIds",row.testItemIds)
|
||||
|
||||
$('.form-controlSE-testItemJson').eq(index).val(row.testItemIds.split(',')).trigger("change");
|
||||
$('.form-controlSE-testItemJson').eq(index).on('change',(data)=>{
|
||||
let testTtemIds = $('.form-controlSE-testItemJson').eq(index).val();
|
||||
$.ajax({
|
||||
url: ext.contextPath + "/whp/plan/WhpSamplingPlanTask/testItems.do?id=" + row.id + '&testItemIds='+(testTtemIds?testTtemIds.join(','):''),
|
||||
type: 'POST',
|
||||
async: false,
|
||||
cache: false,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
// console.log(data)
|
||||
// if (data.code == 1) {
|
||||
// showAlert('S', '保存成功!' + data.msg);
|
||||
// } else {
|
||||
// showAlert('d', '保存失败!' + data.msg);
|
||||
// }
|
||||
},
|
||||
error: function (data) {
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// selectFun()
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function updateFun() {
|
||||
$("#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/plan/WhpSamplingPlan/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) {
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
function submitFun() {
|
||||
$("#editForm").data("bootstrapValidator").updateStatus("deptNames","NOT_VALIDATED", null).validateField("deptNames");
|
||||
$("#editForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#editForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
var formData = new FormData($("#editForm")[0]);
|
||||
var allrows = $("#table2").bootstrapTable('getData');
|
||||
var falg=true;
|
||||
for(let i=0;i<allrows.length;i++)
|
||||
{
|
||||
if(allrows[i].isSample==0&&allrows[i].isTest==true)
|
||||
{
|
||||
falg=false;
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
if(!falg)
|
||||
{
|
||||
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) {
|
||||
console.log("willDelete",willDelete)
|
||||
if (willDelete) {
|
||||
submint(formData);
|
||||
}
|
||||
});
|
||||
|
||||
}else{
|
||||
submint(formData);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var submint=function(formData){
|
||||
stopBubbleDefaultEvent();
|
||||
console.log("提交")
|
||||
$.ajax({
|
||||
url: ext.contextPath + "/whp/plan/WhpSamplingPlan/workSubmit.do",
|
||||
type: 'POST',
|
||||
data: formData,
|
||||
async: false,
|
||||
cache: false,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
dataType: 'json',
|
||||
success: function (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: {
|
||||
code: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '采样单编号不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
sampleTypeId: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '采样类型不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
date: {
|
||||
trigger:"change",
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '计划采样日期不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
reportDate: {
|
||||
trigger:"change",
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '要求报告日期不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
deptNames: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '采样车间不能为空'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
//对Date的扩展,将 Date 转化为指定格式的String
|
||||
|
||||
//月(M)、日(d)、小时(h)、分(m)、秒(s)、季度(q) 可以用 1-2 个占位符,
|
||||
//年(y)可以用 1-4 个占位符,毫秒(S)只能用 1 个占位符(是 1-3 位的数字)
|
||||
Date.prototype.Format = function (fmt) {
|
||||
var o = {
|
||||
"M+": this.getMonth() + 1, //月份
|
||||
"d+": this.getDate(), //日
|
||||
"H+": this.getHours(), //小时
|
||||
"m+": this.getMinutes(), //分
|
||||
"s+": this.getSeconds(), //秒
|
||||
"q+": Math.floor((this.getMonth() + 3) / 3), //季度
|
||||
"S": this.getMilliseconds() //毫秒
|
||||
};
|
||||
if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
|
||||
for (var k in o)
|
||||
if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
|
||||
return fmt;
|
||||
}
|
||||
|
||||
|
||||
//编辑弹窗
|
||||
var editFun1 = function (id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/whp/plan/WhpSamplingPlanTask/workEdit.do', {id: id}, function (data) {
|
||||
$("#taskEidtsub").html(data);
|
||||
openModal('subSampModal');
|
||||
});
|
||||
};
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog " style="width: 70%">
|
||||
<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="code" id="code" class="form-control"
|
||||
readonly value="${bean.code}">
|
||||
<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">
|
||||
<select class="form-control" name="sampleTypeId" id="sampleTypeId" readonly
|
||||
disabled="true" style="width: 100%;height: 34px">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 计划采样日期:</label>
|
||||
<div class="col-sm-4">
|
||||
<div class="input-group date">
|
||||
<div class="input-group-addon">
|
||||
<i class="fa fa-calendar"></i>
|
||||
</div>
|
||||
<input type="text" class="form-control" id="date" name="date"
|
||||
value="${bean.date.substring(0,10)} "/>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">* 要求报告日期:</label>
|
||||
<div class="col-sm-4">
|
||||
<div class="input-group date">
|
||||
<div class="input-group-addon">
|
||||
<i class="fa fa-calendar"></i>
|
||||
</div>
|
||||
<input type="text" class="form-control" id="reportDate" name="reportDate"
|
||||
value="${bean.reportDate.substring(0,10)}" placeholder="请选择.."/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label ">* 采样车间:</label>
|
||||
<div class="col-sm-4 ">
|
||||
|
||||
<input type="text" name="deptNames" id="deptNames" class="form-control"
|
||||
value="${bean.deptNames} " placeholder="">
|
||||
<input type="hidden" name="deptIds" id="deptIds" class="form-control"
|
||||
value="${bean.deptIds} " placeholder="">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
<table id="table2"></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>
|
||||
<button type="button" class="btn btn-primary " style="margin-left: 10px"
|
||||
onclick="submitFun()">提交采样
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
604
WebRoot/jsp/whp/plan/WhpSamplingPlanWorkList.jsp
Normal file
604
WebRoot/jsp/whp/plan/WhpSamplingPlanWorkList.jsp
Normal file
@ -0,0 +1,604 @@
|
||||
<%@ 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">
|
||||
var timeEnd;
|
||||
var timeBegin;
|
||||
var timeRangeEnd;
|
||||
var timeRangeBegin;
|
||||
$(function () {
|
||||
conditionDropDowntype();
|
||||
conditionDropDownstatus();
|
||||
initTableList();
|
||||
initDate1();
|
||||
initDate2();
|
||||
$('#reservationtimeD').val('');
|
||||
$('#repotDateFun').val('');
|
||||
timeEnd = null;
|
||||
timeBegin = null;
|
||||
timeRangeEnd = null;
|
||||
timeRangeBegin = null;
|
||||
});
|
||||
//对Date的扩展,将 Date 转化为指定格式的String
|
||||
//月(M)、日(d)、小时(h)、分(m)、秒(s)、季度(q) 可以用 1-2 个占位符,
|
||||
//年(y)可以用 1-4 个占位符,毫秒(S)只能用 1 个占位符(是 1-3 位的数字)
|
||||
Date.prototype.Format = function (fmt) {
|
||||
var o = {
|
||||
"M+": this.getMonth() + 1, //月份
|
||||
"d+": this.getDate(), //日
|
||||
"H+": this.getHours(), //小时
|
||||
"m+": this.getMinutes(), //分
|
||||
"s+": this.getSeconds(), //秒
|
||||
"q+": Math.floor((this.getMonth() + 3) / 3), //季度
|
||||
"S": this.getMilliseconds() //毫秒
|
||||
};
|
||||
if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
|
||||
for (var k in o)
|
||||
if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
|
||||
return fmt;
|
||||
}
|
||||
|
||||
function initDate2() {
|
||||
var locale = {
|
||||
"format": 'YYYY-MM-DD ',
|
||||
"separator": " ~ ",
|
||||
"applyLabel": "确定",
|
||||
"cancelLabel": "取消",
|
||||
"fromLabel": "起始时间",
|
||||
"toLabel": "结束时间'",
|
||||
"customRangeLabel": "自定义",
|
||||
"weekLabel": "W",
|
||||
"daysOfWeek": ["日", "一", "二", "三", "四", "五", "六"],
|
||||
"monthNames": ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
|
||||
"firstDay": 1
|
||||
};
|
||||
var oldreservationtime1 = "${param.oldreservationtime1}";
|
||||
if (oldreservationtime1 != "" && oldreservationtime1.length > 0) {
|
||||
timeBegin = oldreservationtime1.substring(0, 16);
|
||||
timeEnd = oldreservationtime1.substring(19, 36);
|
||||
$('#repotDateFun').val(oldreservationtime1);
|
||||
} else {
|
||||
timeBegin = moment().subtract(3, 'days').format('YYYY-MM-DD');
|
||||
timeEnd = moment().subtract(0, 'days').format('YYYY-MM-DD');
|
||||
// $('#repotDateFun').val(timeBegin + locale.separator + timeEnd);
|
||||
}
|
||||
|
||||
// $('#repotDateFun').daterangepicker({
|
||||
// "timePicker": true,
|
||||
// "timePicker24Hour": true,
|
||||
// "linkedCalendars": false,
|
||||
// "autoUpdateInput": false,
|
||||
// "timePickerIncrement": 10,
|
||||
// "locale": locale,
|
||||
// //汉化按钮部分
|
||||
// // ranges: {
|
||||
// // // '今日': [moment(), moment().subtract(-1, 'days')],
|
||||
// // '昨日': [moment().subtract(1, 'days'), moment()],
|
||||
// // '最近7日': [moment().subtract(6, 'days'), moment().subtract(-1, 'days')],
|
||||
// // '本月': [moment().startOf('month'), moment().endOf('month').subtract(-1, 'days')],
|
||||
// // '上月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month').subtract(-1, 'days')]
|
||||
// // },
|
||||
// startDate: timeBegin,
|
||||
// endDate: timeEnd
|
||||
// }, function (start, end, label) {
|
||||
//
|
||||
// timeBegin = start.format(this.locale.format);
|
||||
// timeEnd = end.format(this.locale.format);
|
||||
// if (!this.startDate) {
|
||||
// this.element.val('');
|
||||
// } else {
|
||||
// this.element.val(this.startDate.format(this.locale.format) + this.locale.separator + this.endDate.format(this.locale.format));
|
||||
// }
|
||||
// });
|
||||
// $('#repotDateFun').on('apply.daterangepicker', function(ev, picker) {
|
||||
// console.log(11111111111,ev, picker)
|
||||
// });
|
||||
|
||||
$('#repotDateFun').daterangepicker({
|
||||
"locale": locale,
|
||||
"startDate": timeBegin,
|
||||
"endDate": timeEnd
|
||||
}, function(start, end, label) {
|
||||
timeBegin = start.format(this.locale.format);
|
||||
timeEnd = end.format(this.locale.format);
|
||||
});
|
||||
|
||||
};
|
||||
var timedelete = function () {
|
||||
$('#repotDateFun').val('');
|
||||
timeEnd = null;
|
||||
timeBegin = null;
|
||||
};
|
||||
|
||||
function initDate1() {
|
||||
var locale = {
|
||||
"format": 'YYYY-MM-DD',
|
||||
"separator": " ~ ",
|
||||
"applyLabel": "确定",
|
||||
"cancelLabel": "取消",
|
||||
"fromLabel": "起始时间",
|
||||
"toLabel": "结束时间'",
|
||||
"customRangeLabel": "自定义",
|
||||
"weekLabel": "W",
|
||||
"daysOfWeek": ["日", "一", "二", "三", "四", "五", "六"],
|
||||
"monthNames": ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
|
||||
"firstDay": 1
|
||||
};
|
||||
var oldreservationtime1 = "${param.oldreservationtime1}";
|
||||
if (oldreservationtime1 != "" && oldreservationtime1.length > 0) {
|
||||
timeRangeBegin = oldreservationtime1.substring(0, 16);
|
||||
timeRangeEnd = oldreservationtime1.substring(19, 36);
|
||||
$('#reservationtimeD').val(oldreservationtime1);
|
||||
} else {
|
||||
timeRangeBegin = moment().subtract(3, 'days').format('YYYY-MM-DD');
|
||||
timeRangeEnd = moment().subtract(0, 'days').format('YYYY-MM-DD');
|
||||
$('#reservationtimeD').val(timeRangeBegin + locale.separator + timeRangeEnd);
|
||||
}
|
||||
|
||||
$('#reservationtimeD').daterangepicker({
|
||||
// "timePicker": true,
|
||||
// "timePicker24Hour": true,
|
||||
// "linkedCalendars": false,
|
||||
// "autoUpdateInput": false,
|
||||
// "timePickerIncrement": 10,
|
||||
"locale": locale,
|
||||
startDate: timeRangeBegin,
|
||||
endDate: timeRangeEnd
|
||||
}, function (start, end, label) {
|
||||
timeRangeBegin = start.format(this.locale.format);
|
||||
timeRangeEnd = end.format(this.locale.format);
|
||||
});
|
||||
|
||||
};
|
||||
var timedel = function () {
|
||||
$('#reservationtimeD').val('');
|
||||
timeRangeEnd = null;
|
||||
timeRangeBegin = null;
|
||||
};
|
||||
var addFun = function () {
|
||||
$("#searchForm").bootstrapValidator('validate');//提交验证
|
||||
$.post(ext.contextPath + '/whp/plan/WhpSamplingPlan/doWorkadd.do', {unitId: unitId}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
//详情弹窗
|
||||
var viewFun = function (id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/whp/plan/WhpSamplingPlan/view.do', {id: id}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
//样品列表
|
||||
var settingFun = function (id) {
|
||||
$.post(ext.contextPath + '/whp/plan/WhpSamplingPlanItem/showList.do', {id: id}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
//编辑页面
|
||||
var editFun = function (id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/whp/plan/WhpSamplingPlan/workEdit.do', {id: id}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
// 打印
|
||||
var printFun = function (id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/whp/plan/WhpSamplingPlan/print.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/plan/WhpSamplingPlan/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/plan/WhpSamplingPlan/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 () {
|
||||
timeEnd = null;
|
||||
timeBegin = null;
|
||||
timeRangeEnd = null;
|
||||
timeRangeBegin = null;
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/whp/plan/WhpSamplingPlan/getWorkList.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,
|
||||
dateBegin: timeRangeBegin,
|
||||
dateEnd: timeRangeEnd,
|
||||
reportDateBegin: timeBegin,
|
||||
reportDateEnd: timeEnd,
|
||||
status: $('#status').val(),
|
||||
sampleTypeId: $('#sampleTypeIdForListQuery').val()
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
//detailView: true,//父子表
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
}, {
|
||||
field: 'code', // 返回json数据中的name
|
||||
title: '采样单编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter: function (value, row, index) {
|
||||
return '(车间)'+value;
|
||||
}
|
||||
}, {
|
||||
field: 'date', // 返回json数据中的name
|
||||
title: '计划采样日期', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter: function (value, row, index) {
|
||||
return value.substring(0, 10);
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'sampleTypeName', // 返回json数据中的name
|
||||
title: '采样类型', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
|
||||
}, {
|
||||
field: 'reportDate', // 返回json数据中的name
|
||||
title: '要求报告日期', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter: function (value, row, index) {
|
||||
return value.substring(0, 10);
|
||||
}
|
||||
}, {
|
||||
field: 'statusName', // 返回json数据中的name
|
||||
title: '计划状态', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter: function (value, row, index) {
|
||||
if (row.statusName.includes("超时预警")) {
|
||||
return '<span style="color:red">' + value + '</span>'
|
||||
} else {
|
||||
return value
|
||||
}
|
||||
}
|
||||
|
||||
}, {
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 160, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts = '';
|
||||
|
||||
if (row.status == 3) {
|
||||
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>';
|
||||
} else {
|
||||
buts += '<button class="btn btn-default btn-sm" title="详情" onclick="viewFun(\'' + row.id + '\')"><i class="fa fa-eye"></i><span class="hidden-md hidden-lg"> 详情</span></button>';
|
||||
buts += '<button class="btn btn-default btn-sm" title="打印" onclick="printFun(\'' + row.id + '\')"><i class="glyphicon glyphicon-print"></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('${status}');
|
||||
var select_3 = $("#status").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 conditionDropDowntype() {
|
||||
var select_Data = jQuery.parseJSON('${type}');
|
||||
var select_3 = $("#sampleTypeIdForListQuery").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="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="taskEidtsub"></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="sampleTypeIdForListQuery" id="sampleTypeIdForListQuery"
|
||||
style="width:180px;height: 30px">
|
||||
</select>
|
||||
<label class="form-label">计划状态:</label>
|
||||
<select class="form-control select2" name="status" id="status"
|
||||
style="width:180px;height: 30px">
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-label">计划采样日期:</label>
|
||||
<div class="input-group input-group-sm" style="width: 200px;">
|
||||
<input type="text" autocomplete="off" class="form-control pull-left"
|
||||
style="height: 30px; width: 240px; border-radius: 4px;" id="reservationtimeD"
|
||||
placeholder="请选择计划采样日期范围">
|
||||
<a class="glyphicon glyphicon-remove btn form-control-feedback input-clear-a"
|
||||
style="pointer-events: auto;"
|
||||
onclick="timedel()"></a>
|
||||
</div>
|
||||
<label class="form-label">要求报告日期:</label>
|
||||
<div class="input-group input-group-sm" style="width: 200px;">
|
||||
<input type="text" autocomplete="off" class="form-control pull-left"
|
||||
style="height: 30px; width: 240px; border-radius: 4px;" id="repotDateFun"
|
||||
placeholder="请选择要求报告日期范围">
|
||||
<a class="glyphicon glyphicon-remove btn form-control-feedback input-clear-a"
|
||||
style="pointer-events: auto;"
|
||||
onclick="timedelete()"></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="input-group input-group-sm">
|
||||
<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>
|
||||
497
WebRoot/jsp/whp/plan/WhpSamplingPlanWorkTaskEdit.jsp
Normal file
497
WebRoot/jsp/whp/plan/WhpSamplingPlanWorkTaskEdit.jsp
Normal file
@ -0,0 +1,497 @@
|
||||
<!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;
|
||||
}
|
||||
.form-checkbox {
|
||||
height: 23px;
|
||||
width: 23px;
|
||||
display: block;
|
||||
position: absolute;
|
||||
margin-top: 6px;
|
||||
margin-left: 13px;
|
||||
z-index: 9999;
|
||||
}
|
||||
.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 () {
|
||||
$("#samplingTime").datepicker({
|
||||
language: 'zh-CN',
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'yyyy-mm-dd',
|
||||
});
|
||||
if('${bean.samplingTime.substring(0,10)}'=='')
|
||||
{
|
||||
$("#samplingTime").datepicker('setDate', new Date());
|
||||
}
|
||||
|
||||
samplingEnvConditionDropDownList()
|
||||
sampleAppearanceConditionDropDownList()
|
||||
sampleSupernatantDropDownlist();
|
||||
sampleNatureDropDownList();
|
||||
conditionDropDowntype()
|
||||
deptChange();
|
||||
});
|
||||
|
||||
//样品状态
|
||||
function conditionDropDowntype() {
|
||||
var selelct_1Data = jQuery.parseJSON('${sampleStateDropDown}');
|
||||
var selelct_1 = $("#sampleState").select2({
|
||||
data: selelct_1Data,
|
||||
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'});
|
||||
|
||||
if('${bean.sampleState}'!='')
|
||||
{
|
||||
selelct_1.val('${bean.sampleState}').trigger("change");
|
||||
}else{
|
||||
selelct_1.val('1').trigger("change");
|
||||
|
||||
}
|
||||
selelct_1.on("change", function (e) {
|
||||
deptChange();
|
||||
});
|
||||
|
||||
// selelct_1.val(selelct_1Data[1].id).trigger("change")
|
||||
}
|
||||
|
||||
//样品数量刷新
|
||||
function deptChange() {
|
||||
var type = $("#sampleState").val();
|
||||
if (type==1){
|
||||
$("#sampleAmountunit").text('ml')
|
||||
$("#unit").val('ml')
|
||||
} else {
|
||||
$("#sampleAmountunit").text('g')
|
||||
$("#unit").val('g')
|
||||
}
|
||||
}
|
||||
//现场采样情况
|
||||
function samplingEnvConditionDropDownList() {
|
||||
var select_Data = jQuery.parseJSON('${samplingPlanTaskEnvDropDown}');
|
||||
console.log(select_Data);
|
||||
var select_3 = $("#samplingEnv").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'});
|
||||
//单选赋值
|
||||
if ('${bean.samplingEnv}'=='')
|
||||
{
|
||||
select_3.val('0').trigger("change");
|
||||
}else{
|
||||
select_3.val('${bean.samplingEnv}').trigger("change");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
//样品外观
|
||||
function sampleAppearanceConditionDropDownList() {
|
||||
var select_Data = jQuery.parseJSON('${sampleAppearanceDropDown}');
|
||||
console.log(select_Data);
|
||||
var select_3 = $("#sampleAppearance").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'});
|
||||
//单选赋值
|
||||
if('${bean.sampleAppearance}'=='')
|
||||
{
|
||||
select_3.val('1').trigger("change");
|
||||
}else{
|
||||
|
||||
select_3.val('${bean.sampleAppearance}').trigger("change");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
//上清液
|
||||
function sampleSupernatantDropDownlist() {
|
||||
var select_Data = jQuery.parseJSON('${sampleSupernatantDropDown}');
|
||||
|
||||
var select_3 = $("#sampleSupernatant").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'});
|
||||
//单选赋值
|
||||
if('${bean.sampleSupernatant}'=='')
|
||||
{
|
||||
select_3.val('2').trigger("change");
|
||||
}else{
|
||||
|
||||
select_3.val('${bean.sampleSupernatant}').trigger("change");
|
||||
}
|
||||
|
||||
|
||||
} //性质
|
||||
function sampleNatureDropDownList() {
|
||||
var select_Data = jQuery.parseJSON('${sampleNatureDropDown}');
|
||||
|
||||
var select_3 = $("#sampleNature").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'});
|
||||
//单选赋值
|
||||
if('${bean.sampleNature}'=='')
|
||||
{
|
||||
select_3.val('').trigger("change");
|
||||
}else{
|
||||
|
||||
select_3.val('${bean.sampleNature}').trigger("change");
|
||||
}
|
||||
}
|
||||
function updateFun1() {
|
||||
$("#editSampleForm").data("bootstrapValidator").updateStatus("samplingUserName","NOT_VALIDATED", null).validateField("samplingUserName");
|
||||
$("#editSampleForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#editSampleForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
var formData = new FormData($("#editSampleForm")[0]);
|
||||
$.ajax({
|
||||
url: ext.contextPath + "/whp/plan/WhpSamplingPlanTask/workUpdate.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) {
|
||||
$("#table2").bootstrapTable('refresh');
|
||||
closeModal('subSampModal');
|
||||
} else {
|
||||
showAlert('d', '保存失败!' + data.msg);
|
||||
}
|
||||
},
|
||||
error: function (data) {
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
$("#editSampleForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
sampleCode: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '样品编号不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
sampleAddress: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '地点不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
samplingEnv: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '现场采样情况不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
sampleAppearance: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '样品外观不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
sampleAmount: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '样品数量不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
samplingUserName: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '采样人不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
samplingTime: {
|
||||
trigger:"change",
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '采样时间不能为空'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
// 采样人
|
||||
function selectdutyUser() {
|
||||
$.post(ext.contextPath + '/user/userForOneSelect.do',
|
||||
{
|
||||
formId: "editSampleForm",
|
||||
hiddenId: "samplingUserId",
|
||||
textId: "samplingUserName"
|
||||
},
|
||||
function (data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal('user4SelectModal');
|
||||
});
|
||||
|
||||
};
|
||||
</script>
|
||||
<div class="modal fade" id="subSampModal">
|
||||
<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强制为editSampleForm -->
|
||||
<form class="form-horizontal" id="editSampleForm" 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="sampleCode" id="sampleCode" class="form-control"
|
||||
readonly value="${bean.sampleCode}">
|
||||
<input type="hidden" name="id" id="id" class="form-control"
|
||||
placeholder="" value="${bean.id}">
|
||||
<input type="hidden" name="isSample" id="isSample" class="form-control"
|
||||
placeholder="" value="1" >
|
||||
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">* 地点:</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" name="sampleAddress" id="sampleAddress" class="form-control"
|
||||
value="${bean.sampleAddress} " 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="samplingEnv" id="samplingEnv"
|
||||
style="width: 100%;height: 34px">
|
||||
</select>
|
||||
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">* 样品外观:</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control" name="sampleAppearance" id="sampleAppearance"
|
||||
style="width: 100%;height: 34px">
|
||||
</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="sampleSupernatant" id="sampleSupernatant"
|
||||
style="width: 100%;height: 34px">
|
||||
</select>
|
||||
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">* 性质:</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control" name="sampleNature" id="sampleNature"
|
||||
style="width: 100%;height: 34px">
|
||||
</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="sampleState" id="sampleState"
|
||||
style="width: 100%;height: 34px">
|
||||
</select>
|
||||
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label ">* 样品数量:</label>
|
||||
<div class="col-sm-4 " >
|
||||
|
||||
<input type="text" name="sampleAmount" id="sampleAmount"
|
||||
<c:if test="${bean.sampleAmount!=null}">value="${bean.sampleAmount}" </c:if> <c:if test="${bean.sampleAmount==null}">value="1000" </c:if> style="width: 60%" placeholder="">
|
||||
<input type="hidden" name="unit" id="unit" >
|
||||
|
||||
<label name="sampleAmountunit" id="sampleAmountunit"
|
||||
style="position: absolute;float: right;margin-left: 10px;size: 18px;"></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label ">* 采样人:</label>
|
||||
<div class="col-sm-4 ">
|
||||
<input type="text" id="samplingUserName" name="samplingUserName" class="form-control"
|
||||
placeholder="请选择.." ondblclick="selectdutyUser()" value="${bean.samplingUserName}">
|
||||
<input type="hidden" id="samplingUserId" name="samplingUserId" class="form-control"
|
||||
placeholder="请选择.." value="${bean.samplingUserId}" >
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label ">* 采样时间:</label>
|
||||
<div class="col-sm-4 ">
|
||||
|
||||
<div class="input-group date">
|
||||
<div class="input-group-addon">
|
||||
<i class="fa fa-calendar"></i>
|
||||
</div>
|
||||
<input type="text" class="form-control" id="samplingTime" name="samplingTime"
|
||||
value="${bean.samplingTime.substring(0,10)} " />
|
||||
</div>
|
||||
|
||||
</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="notes" name="notes"
|
||||
value="${bean.notes} " />
|
||||
</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="updateFun1()">保存
|
||||
</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
229
WebRoot/jsp/whp/sample/ResidualSampleDisposeEdit.jsp
Normal file
229
WebRoot/jsp/whp/sample/ResidualSampleDisposeEdit.jsp
Normal file
@ -0,0 +1,229 @@
|
||||
<!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;
|
||||
}
|
||||
|
||||
.sampleAmountView {
|
||||
color: black;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var Amount = '${bean.residualSampleAmount}' // 2;
|
||||
var statusShow = '${bean.sampleState}' == 0 ? 'g' : 'ml';
|
||||
// $('#AmountShow').innerHTML = Amount + statusShow;
|
||||
document.getElementById("AmountShow").innerHTML = Amount + statusShow;
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
function updateSaveFun() {
|
||||
$("#editForm").data("bootstrapValidator").updateStatus("auditUserName","NOT_VALIDATED", null).validateField("auditUserName");
|
||||
$("#editForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#editForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
var formData = new FormData($("#editForm")[0]);
|
||||
$.ajax({
|
||||
url: ext.contextPath + "/whp/sample/ResidualSampleDispose/pass.do",
|
||||
type: 'POST',
|
||||
data: formData,
|
||||
async: false,
|
||||
cache: false,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
if (data.code == 1) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
closeModal('subModal');
|
||||
} else {
|
||||
showAlert('d', '保存失败!' + data.msg);
|
||||
}
|
||||
},
|
||||
error: function (data) {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function goBackFun() {
|
||||
$("#editForm").data("bootstrapValidator").updateStatus("auditUserName","NOT_VALIDATED", null).validateField("auditUserName");
|
||||
$("#editForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#editForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
var formData = new FormData($("#editForm")[0]);
|
||||
$.ajax({
|
||||
url: ext.contextPath + "/whp/sample/ResidualSampleDispose/notPass.do",
|
||||
type: 'POST',
|
||||
data: formData,
|
||||
async: false,
|
||||
cache: false,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
if (data.code == 1) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
closeModal('subModal');
|
||||
} else {
|
||||
showAlert('d', '保存失败!' + data.msg);
|
||||
}
|
||||
},
|
||||
error: function (data) {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
// 登记人
|
||||
function selectdutyUser() {
|
||||
$.post(ext.contextPath + '/user/userForOneSelect.do',
|
||||
{
|
||||
formId: "editForm",
|
||||
hiddenId: "auditUserId",
|
||||
textId: "auditUserName"
|
||||
},
|
||||
function (data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal('user4SelectModal');
|
||||
});
|
||||
};
|
||||
|
||||
$("#editForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
auditUserName: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '审核人不能为空'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog " style="width: 65%">
|
||||
<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 -->
|
||||
|
||||
<input type="hidden" name="id" id="id" class="form-control" value="${bean.id}">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label"> 采样单编号:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${bean.planCode}</p>
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">* 样品编号:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${bean.sampleCode}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 采样类型:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${bean.sampleTypeName}</p>
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">* 剩余数量:</label>
|
||||
<div class="col-sm-4">
|
||||
<%-- <p class="form-control-static" id="AmountShow">${bean.residualSampleAmount}</p>--%>
|
||||
<p class="form-control-static" id="AmountShow"></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 登记人:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${bean.recordUserName}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">* 处置方式:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${bean.disposeTypeName}</p>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 处置时间:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${bean.disposeTime.substring(0,10)}</p>
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">* 审核人:</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" id="auditUserName" name="auditUserName" class="form-control"
|
||||
placeholder="请选择.." readonly onclick="selectdutyUser()"
|
||||
value="${bean.recordUserName}"/>
|
||||
<input type="hidden" id="auditUserId" name="auditUserId" class="form-control"
|
||||
placeholder="请选择.." value="${bean.auditUserId}"/>
|
||||
</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-default " style="margin-left: 10px" onclick="goBackFun()">回退
|
||||
</button>
|
||||
<button type="button" class="btn btn-primary " style="margin-left: 10px"
|
||||
onclick="updateSaveFun()">通过
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
157
WebRoot/jsp/whp/sample/ResidualSampleDisposeView.jsp
Normal file
157
WebRoot/jsp/whp/sample/ResidualSampleDisposeView.jsp
Normal file
@ -0,0 +1,157 @@
|
||||
<!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;
|
||||
}
|
||||
|
||||
.sampleAmountView {
|
||||
color: black;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var Amount = '${bean.residualSampleAmount}' / 2;
|
||||
var statusShow = '${bean.sampleState}' == 0 ? 'g' : 'ml';
|
||||
// $('#AmountShow').innerHTML = Amount + statusShow;
|
||||
document.getElementById("AmountShow").innerHTML = Amount + statusShow;
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog " style="width: 65%">
|
||||
<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 -->
|
||||
|
||||
<input type="hidden" name="id" id="id" class="form-control" value="${bean.id}">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label"> 采样单编号:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${bean.planCode}</p>
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">* 样品编号:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${bean.sampleCode}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 采样类型:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${bean.sampleTypeName}</p>
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">* 剩余数量:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static" id="AmountShow"></p>
|
||||
</div>
|
||||
|
||||
<%--
|
||||
<div class="col-sm-2">
|
||||
<input class="form-control" type="text" id="residualSampleAmount"
|
||||
name="residualSampleAmount"
|
||||
value="">
|
||||
</div>
|
||||
<div class="col-sm-2">
|
||||
<input class="form-control" type="text" id="showSt" disabled="disabled"
|
||||
value="">
|
||||
</div>
|
||||
--%>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 登记人:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${bean.recordUserName}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">* 处置方式:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${bean.disposeTypeName}</p>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 处置时间:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${bean.disposeTime}</p>
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">* 审核人:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${bean.auditUserName}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 审核时间:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${bean.auditTime}</p>
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">* 状态:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${bean.disposeStatus}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default " data-dismiss="modal">关闭
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
1
WebRoot/jsp/whp/sample/WhpResidualSampleDisposeList.jsp
Normal file
1
WebRoot/jsp/whp/sample/WhpResidualSampleDisposeList.jsp
Normal file
File diff suppressed because one or more lines are too long
1
WebRoot/jsp/whp/sample/WhpSampleRepositoryList.jsp
Normal file
1
WebRoot/jsp/whp/sample/WhpSampleRepositoryList.jsp
Normal file
File diff suppressed because one or more lines are too long
189
WebRoot/jsp/whp/sample/WhpSampleRepositoryView.jsp
Normal file
189
WebRoot/jsp/whp/sample/WhpSampleRepositoryView.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;
|
||||
|
||||
}
|
||||
|
||||
.select2-container--default .select2-selection--single {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.select2-container--default .select2-selection--single, .select2-selection .select2-selection--single {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.select2-container--default .select2-selection--single .select2-selection__arrow b {
|
||||
border: none;
|
||||
border-style: unset
|
||||
}
|
||||
|
||||
.select2-container--default.select2-container--disabled .select2-selection--single {
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
.right {
|
||||
margin-left: 50px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog " style="width: 65%">
|
||||
<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 -->
|
||||
|
||||
<input type="hidden" name="id" id="id" class="form-control" value="${bean.id}">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 采样单编号:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${bean.planCode}</p>
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">* 样品编号:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${bean.sampleCode}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 样品类别:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${bean.sampleTypeName}</p>
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">* 地点:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${bean.sampleAddress}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 现场采样情况:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${bean.samplingCondition}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">* 样品外观:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${bean.sampleAppearanceName}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
||||
<label class="col-sm-2 control-label">* 上清液:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${bean.smpleSupernatantName}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">* 性质:</label>
|
||||
<div class="col-sm-4">
|
||||
|
||||
<p class="form-control-static">${bean.sampleNatureName}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 样品状态:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${bean.sampleStateName}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">* 样品数量:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static" style="width: 13%; float: left;">${bean.sampleAmount}</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 采样人:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${bean.samplingUserName}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">* 采样时间:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${bean.samplingTime.substring(0,10)}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 是否余样处置:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${bean.disposeStatusName}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">* 剩余数量:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${bean.residualSampleAmount}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 登记人:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${bean.recordUserName}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">* 处置方式:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${bean.disposeTypeName}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 处置时间:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${fn:substring(bean.disposeTime,0,10)}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">* 审核人:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${bean.auditUserName}</p>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default " data-dismiss="modal">关闭
|
||||
</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
728
WebRoot/jsp/whp/test/WhpSamplingPlanTaskConfirmList.jsp
Normal file
728
WebRoot/jsp/whp/test/WhpSamplingPlanTaskConfirmList.jsp
Normal file
@ -0,0 +1,728 @@
|
||||
<%@ 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">
|
||||
var timeEnd;
|
||||
var timeBegin;
|
||||
var timeRangeEnd;
|
||||
var timeRangeBegin;
|
||||
var timerepotEnd;
|
||||
var timerepotBegin;
|
||||
var timedataEnd;
|
||||
var timedataBegin;
|
||||
let selectedType = ''
|
||||
$(function () {
|
||||
conditionDropDownStatus()
|
||||
inittabletreeList()
|
||||
conditionDropDownstatusName()
|
||||
initTableList();
|
||||
initDate1();
|
||||
initDate2();
|
||||
initDate3();
|
||||
initDate4();
|
||||
$('#reservationtimeD').val('');
|
||||
$('#repotDateFun').val('');
|
||||
$('#datatime').val('');
|
||||
$('#repotDate').val('');
|
||||
timeEnd = null;
|
||||
timeBegin = null;
|
||||
timeRangeEnd = null;
|
||||
timeRangeBegin = null;
|
||||
timerepotEnd = null;
|
||||
timerepotBegin = null;
|
||||
timedataEnd = null;
|
||||
timedataBegin = null;
|
||||
});
|
||||
var dosearch = function () {
|
||||
inittabletreeList()
|
||||
};
|
||||
var dosearchList = function () {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
|
||||
};
|
||||
var companyId_rawMaterial = "";
|
||||
//
|
||||
var inittabletreeList = function () {
|
||||
$.post(ext.contextPath + '/whp/test/WhpSamplingPlanTaskTestConfirm/TestItemTree.do?testItemName=' + $('#testItemNameCondition').val(), function (data) {
|
||||
$('#tabletree').treeview({
|
||||
data: JSON.parse(data).result,
|
||||
showBorder: true,
|
||||
levels: 3,
|
||||
});
|
||||
|
||||
$('#tabletree').on('nodeSelected', function (event, node) {
|
||||
selectedType = node.id
|
||||
initTableList(node.id)
|
||||
$("#table").bootstrapTable('refresh');
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function initTableList(treeId) {
|
||||
timeEnd = null;
|
||||
timeBegin = null;
|
||||
timeRangeEnd = null;
|
||||
timeRangeBegin = null;
|
||||
$('#tabletree').val()
|
||||
console.log(selectedType)
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/whp/test/WhpSamplingPlanTaskTestConfirm/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, // 排序规则
|
||||
planDateBegin: timeRangeBegin,
|
||||
planDateEnd: timeRangeEnd,
|
||||
reportDateBegin: timeBegin,
|
||||
reportDateEnd: timeEnd,
|
||||
status: $('#statuscondition').val(),//状态
|
||||
sampleTypeId: $('#sampleTypeName').val(),// 名称模糊查询
|
||||
// typeId: treeId,// 树条件
|
||||
testItemId: selectedType,// 树条件
|
||||
confirmUserId: '${loginUserId}',
|
||||
statustype:1
|
||||
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
//detailView: true,//父子表
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
},
|
||||
{
|
||||
field: 'planCode', // 返回json数据中的name
|
||||
title: '采样单编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'sampleTypeName', // 返回json数据中的name
|
||||
title: '采样单类型', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'planDate', // 返回json数据中的name
|
||||
title: '计划采样日期', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter:function(value){
|
||||
return value&&value.substring(0,10);
|
||||
}
|
||||
}, {
|
||||
field: 'reportDate', // 返回json数据中的name
|
||||
title: '要求报告日期', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter:function(value){
|
||||
if (!value){
|
||||
return value
|
||||
}
|
||||
return value.substring(0,10);
|
||||
}
|
||||
}, {
|
||||
field: 'samplingTaskNumber', // 返回json数据中的name
|
||||
title: '样品任务数', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'testItemName', // 返回json数据中的name
|
||||
title: '检测项目', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'equipmentName', // 返回json数据中的name
|
||||
title: '检测仪器', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'testUserName', // 返回json数据中的name
|
||||
title: '检测人', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'testDate', // 返回json数据中的name
|
||||
title: '检测日期', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter:function(value){
|
||||
return value.substring(0,10);
|
||||
}
|
||||
}, {
|
||||
field: 'confirmUserName', // 返回json数据中的name
|
||||
title: '复核人', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'confirmDate', // 返回json数据中的name
|
||||
title: '复核日期', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter:function(value){
|
||||
return value.substring(0,10);
|
||||
}
|
||||
}, {
|
||||
field: 'statusName', // 返回json数据中的name
|
||||
title: '任务状态', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
if (row.statusName.includes("超时预警")) {
|
||||
return '<span style="color:red">' + value + '</span>'
|
||||
} else {
|
||||
return value
|
||||
}
|
||||
}
|
||||
}, {
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 160, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
|
||||
var buts = '';
|
||||
// if(row.status<5)
|
||||
// {
|
||||
|
||||
buts += '<button class="btn btn-default btn-sm" title="复核" onclick="confirmFun(\'' + row.id + '\')"><i class="fa fa-check-circle"></i><span class="hidden-md hidden-lg"> 复核</span></button>';
|
||||
buts += '<button class="btn btn-default btn-sm" title="详情" onclick="viewFun(\'' + row.id + '\')"><i class="fa fa-eye"></i><span class="hidden-md hidden-lg">详情</span></button>';
|
||||
|
||||
// }else{
|
||||
|
||||
// buts += '<button class="btn btn-default btn-sm" title="详情" onclick="viewFun(\'' + row.id + '\')"><i class="fa fa-eye"></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("加载数据失败");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
var confirmFun = function (id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/whp/test/WhpSamplingPlanTaskTestConfirm/confirmShow.do', {id: id}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
var viewFun = function (id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/whp/test/WhpSamplingPlanTaskTestConfirm/view.do', {id: id}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
function conditionDropDownStatus() {
|
||||
var select_Data = jQuery.parseJSON('${sampleTypeDropDown}');
|
||||
var select_3 = $("#sampleTypeName").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 conditionDropDownstatusName() {
|
||||
var select_Data1 = jQuery.parseJSON('${StatusDropDown}');
|
||||
var select_4 = $("#statuscondition").select2({
|
||||
data: select_Data1,
|
||||
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_4.val('4').trigger('change');
|
||||
}
|
||||
|
||||
//对Date的扩展,将 Date 转化为指定格式的String
|
||||
//月(M)、日(d)、小时(h)、分(m)、秒(s)、季度(q) 可以用 1-2 个占位符,
|
||||
//年(y)可以用 1-4 个占位符,毫秒(S)只能用 1 个占位符(是 1-3 位的数字)
|
||||
Date.prototype.Format = function (fmt) {
|
||||
var o = {
|
||||
"M+": this.getMonth() + 1, //月份
|
||||
"d+": this.getDate(), //日
|
||||
"H+": this.getHours(), //小时
|
||||
"m+": this.getMinutes(), //分
|
||||
"s+": this.getSeconds(), //秒
|
||||
"q+": Math.floor((this.getMonth() + 3) / 3), //季度
|
||||
"S": this.getMilliseconds() //毫秒
|
||||
};
|
||||
if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
|
||||
for (var k in o)
|
||||
if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
|
||||
return fmt;
|
||||
}
|
||||
|
||||
// 要求报告日期
|
||||
function initDate2() {
|
||||
var locale = {
|
||||
"format": 'YYYY-MM-DD ',
|
||||
"separator": " ~ ",
|
||||
"applyLabel": "确定",
|
||||
"cancelLabel": "取消",
|
||||
"fromLabel": "起始时间",
|
||||
"toLabel": "结束时间'",
|
||||
"customRangeLabel": "自定义",
|
||||
"weekLabel": "W",
|
||||
"daysOfWeek": ["日", "一", "二", "三", "四", "五", "六"],
|
||||
"monthNames": ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
|
||||
"firstDay": 1
|
||||
};
|
||||
var oldreservationtime1 = "${param.oldreservationtime1}";
|
||||
if (oldreservationtime1 != "" && oldreservationtime1.length > 0) {
|
||||
timeBegin = oldreservationtime1.substring(0, 16);
|
||||
timeEnd = oldreservationtime1.substring(19, 36);
|
||||
$('#repotDateFun').val(oldreservationtime1);
|
||||
} else {
|
||||
timeBegin = moment().subtract(3, 'days').format('YYYY-MM-DD');
|
||||
timeEnd = moment().subtract(0, 'days').format('YYYY-MM-DD');
|
||||
$('#repotDateFun').val(timeBegin + locale.separator + timeEnd);
|
||||
}
|
||||
|
||||
$('#repotDateFun').daterangepicker({
|
||||
"locale": locale,
|
||||
|
||||
startDate: timeBegin,
|
||||
endDate: timeEnd
|
||||
}, function (start, end, label) {
|
||||
timeBegin = start.format(this.locale.format);
|
||||
timeEnd = end.format(this.locale.format);
|
||||
});
|
||||
|
||||
};
|
||||
var timedelete = function () {
|
||||
$('#repotDateFun').val('');
|
||||
timeEnd = null;
|
||||
timeBegin = null;
|
||||
};
|
||||
|
||||
// 计划采样日期
|
||||
function initDate1() {
|
||||
var locale = {
|
||||
"format": 'YYYY-MM-DD',
|
||||
"separator": " ~ ",
|
||||
"applyLabel": "确定",
|
||||
"cancelLabel": "取消",
|
||||
"fromLabel": "起始时间",
|
||||
"toLabel": "结束时间'",
|
||||
"customRangeLabel": "自定义",
|
||||
"weekLabel": "W",
|
||||
"daysOfWeek": ["日", "一", "二", "三", "四", "五", "六"],
|
||||
"monthNames": ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
|
||||
"firstDay": 1
|
||||
};
|
||||
var oldreservationtime1 = "${param.oldreservationtime1}";
|
||||
if (oldreservationtime1 != "" && oldreservationtime1.length > 0) {
|
||||
timeRangeBegin = oldreservationtime1.substring(0, 16);
|
||||
timeRangeEnd = oldreservationtime1.substring(19, 36);
|
||||
$('#reservationtimeD').val(oldreservationtime1);
|
||||
} else {
|
||||
timeRangeBegin = moment().subtract(3, 'days').format('YYYY-MM-DD');
|
||||
timeRangeEnd = moment().subtract(0, 'days').format('YYYY-MM-DD');
|
||||
$('#reservationtimeD').val(timeRangeBegin + locale.separator + timeRangeEnd);
|
||||
}
|
||||
|
||||
$('#reservationtimeD').daterangepicker({
|
||||
"locale": locale,
|
||||
startDate: timeRangeBegin,
|
||||
endDate: timeRangeEnd
|
||||
}, function (start, end, label) {
|
||||
timeRangeBegin = start.format(this.locale.format);
|
||||
timeRangeEnd = end.format(this.locale.format);
|
||||
});
|
||||
|
||||
};
|
||||
var timedel = function () {
|
||||
$('#reservationtimeD').val('');
|
||||
timeRangeEnd = null;
|
||||
timeRangeBegin = null;
|
||||
};
|
||||
|
||||
function initDate3() {
|
||||
var locale = {
|
||||
"format": 'YYYY-MM-DD ',
|
||||
"separator": " ~ ",
|
||||
"applyLabel": "确定",
|
||||
"cancelLabel": "取消",
|
||||
"fromLabel": "起始时间",
|
||||
"toLabel": "结束时间'",
|
||||
"customRangeLabel": "自定义",
|
||||
"weekLabel": "W",
|
||||
"daysOfWeek": ["日", "一", "二", "三", "四", "五", "六"],
|
||||
"monthNames": ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
|
||||
"firstDay": 1
|
||||
};
|
||||
var oldreservationtime1 = "${param.oldreservationtime1}";
|
||||
if (oldreservationtime1 != "" && oldreservationtime1.length > 0) {
|
||||
timerepotBegin = oldreservationtime1.substring(0, 16);
|
||||
timerepotEnd = oldreservationtime1.substring(19, 36);
|
||||
$('#repotDate').val(oldreservationtime1);
|
||||
} else {
|
||||
timerepotBegin = moment().subtract(3, 'days').format('YYYY-MM-DD');
|
||||
timerepotEnd = moment().subtract(0, 'days').format('YYYY-MM-DD');
|
||||
$('#repotDate').val(timerepotBegin + locale.separator + timerepotEnd);
|
||||
}
|
||||
|
||||
$('#repotDate').daterangepicker({
|
||||
"locale": locale,
|
||||
startDate: timerepotBegin,
|
||||
endDate: timerepotEnd
|
||||
}, function (start, end, label) {
|
||||
timerepotBegin = start.format(this.locale.format);
|
||||
timerepotEnd = end.format(this.locale.format);
|
||||
});
|
||||
|
||||
};
|
||||
var timedelete1 = function () {
|
||||
$('#repotDate').val('');
|
||||
timerepotBegin = null;
|
||||
timerepotEnd = null;
|
||||
};
|
||||
|
||||
function initDate4() {
|
||||
var locale = {
|
||||
"format": 'YYYY-MM-DD',
|
||||
"separator": " ~ ",
|
||||
"applyLabel": "确定",
|
||||
"cancelLabel": "取消",
|
||||
"fromLabel": "起始时间",
|
||||
"toLabel": "结束时间'",
|
||||
"customRangeLabel": "自定义",
|
||||
"weekLabel": "W",
|
||||
"daysOfWeek": ["日", "一", "二", "三", "四", "五", "六"],
|
||||
"monthNames": ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
|
||||
"firstDay": 1
|
||||
};
|
||||
var oldreservationtime1 = "${param.oldreservationtime1}";
|
||||
if (oldreservationtime1 != "" && oldreservationtime1.length > 0) {
|
||||
timedataBegin = oldreservationtime1.substring(0, 16);
|
||||
timedataEnd = oldreservationtime1.substring(19, 36);
|
||||
$('#datatime').val(oldreservationtime1);
|
||||
} else {
|
||||
timedataBegin = moment().subtract(3, 'days').format('YYYY-MM-DD');
|
||||
timedataEnd = moment().subtract(0, 'days').format('YYYY-MM-DD');
|
||||
$('#datatime').val(timedataBegin + locale.separator + timedataEnd);
|
||||
}
|
||||
|
||||
$('#datatime').daterangepicker({
|
||||
"locale": locale,
|
||||
startDate: timedataBegin,
|
||||
endDate: timedataEnd
|
||||
}, function (start, end, label) {
|
||||
timedataBegin = start.format(this.locale.format);
|
||||
timedataEnd = end.format(this.locale.format);
|
||||
});
|
||||
|
||||
};
|
||||
var timedel1 = function () {
|
||||
$('#datatime').val('');
|
||||
timedataEnd = null;
|
||||
timedataBegin = null;
|
||||
};
|
||||
//批量复核弹窗
|
||||
var confirmBatchFun = 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/test/WhpSamplingPlanTaskTestConfirm/acceptBatch.do', {ids: datas}, function (data) {
|
||||
if (data.code == 1) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '接单失败', 'mainAlertdiv');
|
||||
}
|
||||
}, "json");
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
</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 style="width: 100%">
|
||||
<input type="text" id="testItemNameCondition" name="testItemNameCondition"
|
||||
class="form-control pull-left"
|
||||
placeholder="搜索检测项目" style="width: calc(100% - 40px)">
|
||||
<div class="input-group-btn" style="width: 40px">
|
||||
<button class="btn btn-default" onclick="dosearch();"><i class="fa fa-search"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div id="tabletree" style="height:550px;overflow:auto; " ></div>
|
||||
</div>
|
||||
<div style="float: right;width:80%">
|
||||
|
||||
<div class="tab-content no-padding">
|
||||
<div class="chart tab-pane active" id="tab1"
|
||||
style="position: relative; padding:5px;">
|
||||
<div class="box-header with-border">
|
||||
<ul style="list-style-type:none;padding-left:0px;margin-bottom:5px;">
|
||||
<!-- Menu toggle button -->
|
||||
<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="confirmBatchFun();"
|
||||
style="margin-right: 15px"><i
|
||||
class="fa fa-plus"></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="sampleTypeName"
|
||||
id="sampleTypeName"
|
||||
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">
|
||||
<label class="form-label">计划采样日期:</label>
|
||||
<div class="input-group input-group-sm" style="width: 200px;">
|
||||
<input type="text" autocomplete="off"
|
||||
class="form-control pull-left"
|
||||
style="height: 30px; width: 240px; border-radius: 4px;"
|
||||
id="reservationtimeD"
|
||||
placeholder="请选择计划采样日期范围">
|
||||
<a class="glyphicon glyphicon-remove btn form-control-feedback input-clear-a"
|
||||
style="pointer-events: auto;"
|
||||
onclick="timedel()"></a>
|
||||
</div>
|
||||
<label class="form-label">要求报告日期:</label>
|
||||
<div class="input-group input-group-sm" style="width: 200px;">
|
||||
<input type="text" autocomplete="off"
|
||||
class="form-control pull-left"
|
||||
style="height: 30px; width: 240px; border-radius: 4px;"
|
||||
id="repotDateFun"
|
||||
placeholder="请选择要求报告日期范围">
|
||||
<a class="glyphicon glyphicon-remove btn form-control-feedback input-clear-a"
|
||||
style="pointer-events: auto;"
|
||||
onclick="timedelete()"></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-group input-group-sm" style="width: 37px;">
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-default" onclick="dosearchList();"><i
|
||||
class="fa fa-search"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<table id="table"></table>
|
||||
<div id="searchHiddenDiv" style="display: none;width: 100%;">
|
||||
</div>
|
||||
</ul>
|
||||
<div class="box-tools">
|
||||
<!-- <button type="button" class="btn btn-box-tool" onclick="addFun();"><i class="fa fa-plus"></i>
|
||||
</button> -->
|
||||
</div>
|
||||
</div>
|
||||
<div id="mptableTop" class="box-body no-padding" style="display: none;">
|
||||
|
||||
</div>
|
||||
<div id="singleBizDivTop" class="box-body no-padding" style="display: none;">
|
||||
<%-- <div id="singleBizDiv"--%>
|
||||
<%-- style="float: left;width: 100%;height: 100%;overflow:auto;"></div>--%>
|
||||
</div>
|
||||
</div>
|
||||
<%-- style="position: relative; padding:5px;overflow:hidden"--%>
|
||||
</div>
|
||||
|
||||
</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>
|
||||
863
WebRoot/jsp/whp/test/WhpSamplingPlanTaskEditForTest.jsp
Normal file
863
WebRoot/jsp/whp/test/WhpSamplingPlanTaskEditForTest.jsp
Normal file
@ -0,0 +1,863 @@
|
||||
<!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;
|
||||
}
|
||||
|
||||
.sampleAmountView {
|
||||
color: black;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
initTableViewList();
|
||||
$("#acceptDate").datepicker({
|
||||
language: 'zh-CN',
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'yyyy-mm-dd',
|
||||
});
|
||||
$("#acceptDate").datepicker('setDate',new Date());
|
||||
$('#repotDateFun').val('');
|
||||
conditionDropDowntestOrgId()
|
||||
|
||||
$("#uAccord").hide();
|
||||
$("#nAccord").hide();
|
||||
$("#Accord").hide();
|
||||
if ('${bean.sampleTypeName}'==="外送样"){
|
||||
$("#uAccord").show();
|
||||
$("#nAccord").show();
|
||||
$("#Accord").show();
|
||||
}
|
||||
initdata();
|
||||
});
|
||||
|
||||
function initdata() {
|
||||
if ('${bean.acceptUserName}'=='')
|
||||
{
|
||||
$("#acceptUserName").val('${cu.caption}');
|
||||
$("#acceptUserId").val('${cu.id}');
|
||||
}
|
||||
|
||||
}
|
||||
function initTableViewList() {
|
||||
|
||||
$("#tableView").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/whp/plan/WhpSamplingPlanTask/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,
|
||||
planCode: '${bean.code}'
|
||||
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
//detailView: true,//父子表
|
||||
columns: [
|
||||
|
||||
{
|
||||
field: 'sampleCode', // 返回json数据中的name
|
||||
title: '样品编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter:function(value,row,index,field){
|
||||
var span=document.createElement('span');
|
||||
if(row.playType==1)
|
||||
{
|
||||
span.setAttribute('title',"采样人:"+row.samplingUserName+"(采样时间:"+row.samplingTime.substring(0,10)+")");
|
||||
|
||||
}else{
|
||||
span.setAttribute('title',"采样人:"+row.samplingUserName+"(采样时间:"+row.samplingTime.substring(0,10)+";备注: "+row.notes+")");
|
||||
|
||||
}
|
||||
|
||||
span.innerHTML=value;
|
||||
return span.outerHTML;
|
||||
}
|
||||
|
||||
}, {
|
||||
field: 'sampleAddress', // 返回json数据中的name
|
||||
title: '地点', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'sampleState',
|
||||
title: '样品状态',
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
return '<select class="form-control-sampleState select2" name="sampleState" id="sampleState\'' + index + '\'" onchange="selectChange1(\'' + value + '\',\'' + row.id + '\',' + index + ')" style="width: 99%;height: 30px;border-radius: 5px;border: 1px solid gray;" value="' + value + '" /> '
|
||||
}
|
||||
}, {
|
||||
field: 'sampleAppearance',
|
||||
title: '样品外观',
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
return '<select class="form-control-sampleAppearance select2" name="sampleAppearance" id="sampleAppearance\'' + index + '\'" onchange="selectChange1(\'' + value + '\',\'' + row.id + '\',' + index + ')" style="width: 99%;height: 30px;border-radius: 5px;border: 1px solid gray;" value="' + value + '" /> '
|
||||
}
|
||||
|
||||
}, {
|
||||
field: 'sampleSupernatant',
|
||||
title: '样品上清液',
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
return '<select class="form-control-sampleSupernatant select2" name="sampleSupernatant" id="sampleSupernatant\'' + index + '\'" onchange="selectChange2(\'' + value + '\',\'' + row.id + '\',' + index + ')" style="width: 99%;height: 30px;border-radius: 5px;border: 1px solid gray;" value="' + value + '" /> '
|
||||
}
|
||||
|
||||
}, {
|
||||
field: 'sampleNature',
|
||||
title: '样品性质',
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
return '<select class="form-control-sampleNature select2" name="sampleNature" id="sampleNature\'' + index + '\'" onchange="selectChange3(\'' + value + '\',\'' + row.id + '\',' + index + ')" style="width: 99%;height: 30px;border-radius: 5px;border: 1px solid gray;" value="' + value + '" /> '
|
||||
}
|
||||
|
||||
},{
|
||||
field: 'isTest', // 返回json数据中的name
|
||||
title: '是否检测', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
|
||||
return '<select class="form-control-isTest select2" name="isTest" id="isTest\'' + index + '\'" onchange="selectChange1(\'' + value + '\',\'' + row.id + '\',' + index + ')" style="width: 69%; width: 69%;height: 30px;border-radius: 5px;border: 1px solid gray;" value="'+value+'" > ' +
|
||||
'<option value="1" '+(value===true?'selected':'')+'>检测</option> <option value="0" '+ (value===false?'selected':'')+'>不检测</option>' +
|
||||
'</select>'
|
||||
}
|
||||
}, {
|
||||
field: 'sampleAmount',
|
||||
title: '样品数量',
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
|
||||
return initCell(row.id, "sampleAmount", "text", "样品数量", value);
|
||||
}
|
||||
}, {
|
||||
field: 'unit',
|
||||
title: '单位',
|
||||
align: 'center',
|
||||
valign: 'middle'
|
||||
|
||||
}, {
|
||||
field: 'statusName',
|
||||
title: '状态',
|
||||
align: 'center',
|
||||
valign: 'middle'
|
||||
},
|
||||
{
|
||||
field: 'testItemJson', // 返回json数据中的name
|
||||
title: '检测项目', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
|
||||
return '<select class="form-controlSE-testItemJson select2" name="testItemJson" onchange="selectChange(\'' + value + '\',\'' + row.id + '\',' + index + ')" style="width: 100%" value=""></select>'
|
||||
}
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 160, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts = '';
|
||||
if (row.status == 4) {
|
||||
buts += '<button class="btn btn-default btn-sm" title="回退" onclick="combackFun(\'' + row.id + '\')"><span > 回退 </span></button>';
|
||||
}
|
||||
|
||||
buts = '<div class="btn-group" >' + buts + '</div>';
|
||||
return buts;
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function (data) { //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
|
||||
if (data.rows) {
|
||||
multipleChoice(data.rows)
|
||||
sampleStateChoice(data.rows)
|
||||
sampleAppearanceChoice(data.rows)
|
||||
sampleSupernatantChoice(data.rows)
|
||||
sampleNatureChoice(data.rows)
|
||||
tableAContent(data.rows)
|
||||
}
|
||||
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
var selectChange1 = function (val, id, index) {
|
||||
let values = $('.form-control-isTest').eq(index).val()
|
||||
console.log(values)
|
||||
$.ajax({
|
||||
url: ext.contextPath + "/whp/plan/WhpSamplingPlanTask/isTest.do?id=" + id + '&isTest=' +$('.form-control-isTest').eq(index).val(),
|
||||
type: 'POST',
|
||||
data: values,
|
||||
async: false,
|
||||
cache: false,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
// console.log(data)
|
||||
// if (data.code == 1) {
|
||||
// showAlert('S', '修改成功!' + data.msg);
|
||||
// } else {
|
||||
// showAlert('d', '修改失败!' + data.msg);
|
||||
// }
|
||||
},
|
||||
error: function (data) {
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
};
|
||||
|
||||
function multipleChoice(rows) {
|
||||
rows.forEach((row, index) => {
|
||||
console.log(JSON.parse(row.testItemJson))
|
||||
var select_Data = []
|
||||
try{
|
||||
select_Data =JSON.parse('${whpTestItemDropDown}');
|
||||
}catch (e) {
|
||||
|
||||
}
|
||||
$('.form-controlSE-testItemJson').eq(index).select2({
|
||||
data: select_Data,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示educationTypeCondition
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) {
|
||||
return markup;
|
||||
}, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
multiple: true,
|
||||
formatResult: function formatRepo(repo) {
|
||||
return repo.text;
|
||||
}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) {
|
||||
return repo.text;
|
||||
} // 函数用于呈现当前的选择
|
||||
})
|
||||
|
||||
|
||||
$('.form-controlSE-testItemJson').eq(index).val(row.testItemIds.split(",")).trigger("change");
|
||||
$('.form-controlSE-testItemJson').eq(index).on('change', (data) => {
|
||||
console.log($('.form-controlSE-testItemJson').eq(index).val())
|
||||
// console.log(row)
|
||||
let testTtemIds = $('.form-controlSE-testItemJson').eq(index).val()
|
||||
$.ajax({
|
||||
url: ext.contextPath + "/whp/plan/WhpSamplingPlanTask/testItems.do?id=" + row.id + '&testItemIds=' + (testTtemIds ? testTtemIds.join(',') : ''),
|
||||
type: 'POST',
|
||||
async: false,
|
||||
cache: false,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
// console.log(data)
|
||||
// if (data.code == 1) {
|
||||
// showAlert('S', '保存成功!' + data.msg);
|
||||
// } else {
|
||||
// showAlert('d', '保存失败!' + data.msg);
|
||||
// }
|
||||
},
|
||||
error: function (data) {
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
function sampleStateChoice(rows) {
|
||||
rows.forEach((row, index) => {
|
||||
console.log(JSON.parse('${sampleStateDropDown}'))
|
||||
$('.form-control-sampleState').eq(index).select2({
|
||||
data: JSON.parse('${sampleStateDropDown}'),
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示educationTypeCondition
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) {
|
||||
return markup;
|
||||
}, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
multiple: false,
|
||||
formatResult: function formatRepo(repo) {
|
||||
return repo.text;
|
||||
}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) {
|
||||
return repo.text;
|
||||
} // 函数用于呈现当前的选择
|
||||
})
|
||||
|
||||
|
||||
$('.form-control-sampleState').eq(index).val(JSON.parse(row.sampleState)).trigger("change");
|
||||
$('.form-control-sampleState').eq(index).on('change', (data) => {
|
||||
console.log($('.form-control-sampleState').eq(index).val())
|
||||
// console.log(row)
|
||||
let sampleStateIds = $('.form-control-sampleState').eq(index).val()
|
||||
$.ajax({
|
||||
url: ext.contextPath + "/whp/plan/WhpSamplingPlanTask/state.do?id=" + row.id + '&state=' + (sampleStateIds ? sampleStateIds : ''),
|
||||
type: 'POST',
|
||||
async: false,
|
||||
cache: false,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
// console.log(data)
|
||||
// if (data.code == 1) {
|
||||
// showAlert('S', '保存成功!' + data.msg);
|
||||
// } else {
|
||||
// showAlert('d', '保存失败!' + data.msg);
|
||||
// }
|
||||
},
|
||||
error: function (data) {
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
})
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
function sampleAppearanceChoice(rows) {
|
||||
rows.forEach((row, index) => {
|
||||
console.log(JSON.parse('${sampleAppearanceDropDown}'))
|
||||
$('.form-control-sampleAppearance').eq(index).select2({
|
||||
data: JSON.parse('${sampleAppearanceDropDown}'),
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示educationTypeCondition
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) {
|
||||
return markup;
|
||||
}, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
multiple: false,
|
||||
formatResult: function formatRepo(repo) {
|
||||
return repo.text;
|
||||
}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) {
|
||||
return repo.text;
|
||||
} // 函数用于呈现当前的选择
|
||||
})
|
||||
|
||||
|
||||
$('.form-control-sampleAppearance').eq(index).val(JSON.parse(row.sampleAppearance)).trigger("change");
|
||||
$('.form-control-sampleAppearance').eq(index).on('change', (data) => {
|
||||
console.log($('.form-control-sampleAppearance').eq(index).val())
|
||||
// console.log(row)
|
||||
let sampleAppearanceIds = $('.form-control-sampleAppearance').eq(index).val()
|
||||
$.ajax({
|
||||
url: ext.contextPath + "/whp/plan/WhpSamplingPlanTask/appearance.do?id=" + row.id + '&appearance=' + (sampleAppearanceIds ? sampleAppearanceIds : ''),
|
||||
type: 'POST',
|
||||
async: false,
|
||||
cache: false,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
// console.log(data)
|
||||
// if (data.code == 1) {
|
||||
// showAlert('S', '保存成功!' + data.msg);
|
||||
// } else {
|
||||
// showAlert('d', '保存失败!' + data.msg);
|
||||
// }
|
||||
},
|
||||
error: function (data) {
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
})
|
||||
})
|
||||
|
||||
}
|
||||
function sampleSupernatantChoice(rows) {
|
||||
rows.forEach((row, index) => {
|
||||
console.log(JSON.parse('${sampleSupernatantDropDown}'))
|
||||
$('.form-control-sampleSupernatant').eq(index).select2({
|
||||
data: JSON.parse('${sampleSupernatantDropDown}'),
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示educationTypeCondition
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) {
|
||||
return markup;
|
||||
}, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
multiple: false,
|
||||
formatResult: function formatRepo(repo) {
|
||||
return repo.text;
|
||||
}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) {
|
||||
return repo.text;
|
||||
} // 函数用于呈现当前的选择
|
||||
})
|
||||
|
||||
|
||||
$('.form-control-sampleSupernatant').eq(index).val(JSON.parse(row.sampleSupernatant)).trigger("change");
|
||||
$('.form-control-sampleSupernatant').eq(index).on('change', (data) => {
|
||||
console.log($('.form-control-sampleSupernatant').eq(index).val())
|
||||
|
||||
let sampleSupernatantIds = $('.form-control-sampleSupernatant').eq(index).val()
|
||||
$.ajax({
|
||||
url: ext.contextPath + "/whp/plan/WhpSamplingPlanTask/supernatant.do?id=" + row.id + '&supernatant=' + (sampleSupernatantIds ? sampleSupernatantIds : ''),
|
||||
type: 'POST',
|
||||
async: false,
|
||||
cache: false,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
// console.log(data)
|
||||
// if (data.code == 1) {
|
||||
// showAlert('S', '保存成功!' + data.msg);
|
||||
// } else {
|
||||
// showAlert('d', '保存失败!' + data.msg);
|
||||
// }
|
||||
},
|
||||
error: function (data) {
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
})
|
||||
})
|
||||
|
||||
}
|
||||
function sampleNatureChoice(rows) {
|
||||
rows.forEach((row, index) => {
|
||||
console.log(JSON.parse('${sampleNatureDropDown}'))
|
||||
$('.form-control-sampleNature').eq(index).select2({
|
||||
data: JSON.parse('${sampleNatureDropDown}'),
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示educationTypeCondition
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) {
|
||||
return markup;
|
||||
}, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
multiple: false,
|
||||
formatResult: function formatRepo(repo) {
|
||||
return repo.text;
|
||||
}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) {
|
||||
return repo.text;
|
||||
} // 函数用于呈现当前的选择
|
||||
})
|
||||
|
||||
// console.log(JSON.parse(row.testItemJson).map(item => item.id).join(','))
|
||||
console.log(JSON.parse(row.sampleNature), "sampleNature")
|
||||
// console.log(JSON.parse(row.testItemJson).map(item=>item.id),'4444444444')
|
||||
// return
|
||||
$('.form-control-sampleNature').eq(index).val(JSON.parse(row.sampleNature)).trigger("change");
|
||||
$('.form-control-sampleNature').eq(index).on('change', (data) => {
|
||||
console.log($('.form-control-sampleNature').eq(index).val())
|
||||
// console.log(row)
|
||||
let sampleNatureIds = $('.form-control-sampleNature').eq(index).val()
|
||||
$.ajax({
|
||||
url: ext.contextPath + "/whp/plan/WhpSamplingPlanTask/nature.do?id=" + row.id + '&nature=' + (sampleNatureIds ? sampleNatureIds : ''),
|
||||
type: 'POST',
|
||||
async: false,
|
||||
cache: false,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
// console.log(data)
|
||||
// if (data.code == 1) {
|
||||
// showAlert('S', '保存成功!' + data.msg);
|
||||
// } else {
|
||||
// showAlert('d', '保存失败!' + data.msg);
|
||||
// }
|
||||
},
|
||||
error: function (data) {
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
})
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
// 编辑表格
|
||||
function initCell(id, name, dataTyp, dataTitle, value) {
|
||||
|
||||
if (value === undefined || value == null || value == "") {
|
||||
value = '';
|
||||
}
|
||||
|
||||
return '<a href="#" class="tableAClass" name="' + name + '" sample-amount="' + dataTyp + '" sample-pk="' + id + '" sample-title="' + dataTitle + '" style="text-decoration: none;border: none;outline: none;line-height: 47px">' + value + '</a>'
|
||||
// return "<a href=\"#\" name=\""+name+"\" data-type=\""+dataType+"\" data-pk=\"" + id + "\" data-title=\""+dataTitle+"\">" + value + "</a>"
|
||||
}
|
||||
|
||||
function tableAContent(rows) {
|
||||
console.log(rows, "table")
|
||||
rows.forEach((row, index) => {
|
||||
$("#tableView a").editable({
|
||||
emptytext: '点击开始填写',
|
||||
emptyclass: 'sampleAmountView',
|
||||
url: function (params) {
|
||||
console.log(params, "sample")
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: ext.contextPath + '/whp/plan/WhpSamplingPlanTask/amount.do?id=' + row.id + "&amount=" + params.value,
|
||||
dataType: 'JSON',
|
||||
success: function (data, textStatus, jqXHR) {
|
||||
|
||||
// alert('保存成功!');
|
||||
},
|
||||
error: function (res) {
|
||||
// alert("error");
|
||||
|
||||
if (res.status == 400) {
|
||||
showAlert('d', '输入有误,请检查输入', 'mainAlertdiv')
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
type: 'text'
|
||||
});
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
function selectChange2(val, id, index) {
|
||||
}
|
||||
function selectChange3(val, id, index) {
|
||||
}
|
||||
|
||||
// 检验审核人
|
||||
function selectdutyUser() {
|
||||
$.post(ext.contextPath + '/user/userForOneSelect.do',
|
||||
{
|
||||
formId: "editForm",
|
||||
hiddenId: "auditUserId",
|
||||
textId: "auditUserName"
|
||||
},
|
||||
function (data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal('user4SelectModal');
|
||||
});
|
||||
};
|
||||
|
||||
function selectdutyUser1() {
|
||||
$.post(ext.contextPath + '/user/userForOneSelect.do',
|
||||
{
|
||||
formId: "editForm",
|
||||
hiddenId: "acceptUserId",
|
||||
textId: "acceptUserName"
|
||||
},
|
||||
function (data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal('user4SelectModal');
|
||||
});
|
||||
};
|
||||
var combackFun = function (id) {
|
||||
$.ajax({
|
||||
url: ext.contextPath + "/whp/plan/WhpSamplingPlanTask/reject.do?id=" + id,
|
||||
type: 'POST',
|
||||
async: false,
|
||||
cache: false,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
if (data.code == 1) {
|
||||
$("#tableView").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '回退失败!' + data.msg);
|
||||
}
|
||||
},
|
||||
error: function (data) {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function updateSaveFun() {
|
||||
$("#editForm").data("bootstrapValidator").updateStatus("auditUserName","NOT_VALIDATED", null).validateField("auditUserName");
|
||||
$("#editForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#editForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
var formData = new FormData($("#editForm")[0]);
|
||||
$.ajax({
|
||||
url: ext.contextPath + "/whp/test/WhpSamplingPlanTaskAudit/update.do",
|
||||
type: 'POST',
|
||||
data: formData,
|
||||
async: false,
|
||||
cache: false,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
if (data.code == 1) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
closeModal('subModal');
|
||||
} else {
|
||||
showAlert('d', '保存失败!' + data.msg);
|
||||
}
|
||||
},
|
||||
error: function (data) {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function issueSaveFun() {
|
||||
$("#editForm").data("bootstrapValidator").updateStatus("auditUserName","NOT_VALIDATED", null).validateField("auditUserName");
|
||||
$("#editForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#editForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
var formData = new FormData($("#editForm")[0]);
|
||||
$.ajax({
|
||||
url: ext.contextPath + "/whp/test/WhpSamplingPlanTaskAudit/submit.do?id=" + $("#id").val(),
|
||||
type: 'POST',
|
||||
async: false,
|
||||
cache: false,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
dataType: 'json',
|
||||
success: function (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: {
|
||||
auditUserName: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '检验审核人不能为空'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function conditionDropDowntestOrgId() {
|
||||
var select_Data = jQuery.parseJSON('${sampleTestOrgDropDown}');
|
||||
console.log(select_Data);
|
||||
var select_3 = $("#testOrgId").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.on("change", function (e) {
|
||||
deptChange();
|
||||
});
|
||||
select_3.val(select_Data[0].id).trigger("change")
|
||||
|
||||
}
|
||||
|
||||
//采样车间刷新
|
||||
function deptChange() {
|
||||
var type = $("#testOrgId").val();
|
||||
console.log(type,'+++++++++++++++')
|
||||
$.get(ext.contextPath + "/whp/baseinfo/WhpTestOrg/getById.do?id=" + type, function (data) {
|
||||
if (type!=null){
|
||||
$("#address").val(data.result.address);
|
||||
$("#contactPerson").val(data.result.contactPerson);
|
||||
$("#contactPhone").val(data.result.contactPhone);
|
||||
}else {
|
||||
$("#address").val('');
|
||||
$("#contactPerson").val('');
|
||||
$("#contactPhone").val('');
|
||||
}
|
||||
|
||||
}, 'json');
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog " style="width: 80%">
|
||||
<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 -->
|
||||
|
||||
<input type="hidden" name="id" id="id" class="form-control" value="${bean.id}">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 采样单编号:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${bean.code}</p>
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">* 采样类型:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static" id="sampleTypeName">${bean.sampleTypeName}</p>
|
||||
<%-- <input type="text" name="sampleTypeName" id="sampleTypeName" class="form-control"--%>
|
||||
<%-- value="${bean.sampleTypeName}" readonly >--%>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 需求报告日期:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${fn:substring(bean.reportDate,0,10)}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">* 检验审核人:</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" id="auditUserName" name="auditUserName" class="form-control"
|
||||
placeholder="请选择.." readonly onclick="selectdutyUser()"
|
||||
value="${bean.auditUserName}">
|
||||
<input type="hidden" id="auditUserId" name="auditUserId" class="form-control"
|
||||
placeholder="请选择.." value="${bean.auditUserId}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 收样人:</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" id="acceptUserName" name="acceptUserName" class="form-control"
|
||||
placeholder="请选择.." readonly onclick="selectdutyUser1()"
|
||||
value="${bean.acceptUserName}">
|
||||
<input type="hidden" id="acceptUserId" name="acceptUserId" class="form-control"
|
||||
placeholder="请选择.." value="${bean.acceptUserId}">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">* 收样日期:</label>
|
||||
<div class="col-sm-4">
|
||||
<div class="input-group date">
|
||||
<div class="input-group-addon">
|
||||
<i class="fa fa-calendar"></i>
|
||||
</div>
|
||||
<input type="text" class="form-control" id="acceptDate" name="acceptDate"
|
||||
value="${bean.acceptDate.substring(0,10)}" placeholder="请选择.."/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" id="uAccord" >
|
||||
<label class="col-sm-2 control-label">* 委派检测机构:</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control" name="testOrgId" id="testOrgId"
|
||||
style="width: 100%">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" id="nAccord" >
|
||||
<label class="col-sm-2 control-label">* 机构地址:</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" id="address" name="address" class="form-control"
|
||||
placeholder="" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" id="Accord" >
|
||||
<label class="col-sm-2 control-label">* 机构联系人:</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" id="contactPerson" name="contactPerson" class="form-control"
|
||||
placeholder="" readonly>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">* 机构电话:</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" id="contactPhone" name="contactPhone" class="form-control"
|
||||
placeholder="" readonly>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<table id="tableView"></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="updateSaveFun()">保存
|
||||
</button>
|
||||
<button type="button" class="btn btn-primary " style="margin-left: 10px"
|
||||
onclick="issueSaveFun()">下发
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
490
WebRoot/jsp/whp/test/WhpSamplingPlanTaskListForAudit.jsp
Normal file
490
WebRoot/jsp/whp/test/WhpSamplingPlanTaskListForAudit.jsp
Normal file
@ -0,0 +1,490 @@
|
||||
<%@ 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">
|
||||
var timeEnd;
|
||||
var timeBegin;
|
||||
var timeRangeEnd;
|
||||
var timeRangeBegin;
|
||||
$(function () {
|
||||
conditionDropDowntype();
|
||||
conditionDropDownstatus();
|
||||
initTableList();
|
||||
initDate1();
|
||||
initDate2();
|
||||
$('#reservationtimeD').val('');
|
||||
$('#repotDateFun').val('');
|
||||
timeEnd = null;
|
||||
timeBegin = null;
|
||||
timeRangeEnd = null;
|
||||
timeRangeBegin = null;
|
||||
});
|
||||
//对Date的扩展,将 Date 转化为指定格式的String
|
||||
//月(M)、日(d)、小时(h)、分(m)、秒(s)、季度(q) 可以用 1-2 个占位符,
|
||||
//年(y)可以用 1-4 个占位符,毫秒(S)只能用 1 个占位符(是 1-3 位的数字)
|
||||
Date.prototype.Format = function (fmt) {
|
||||
var o = {
|
||||
"M+": this.getMonth() + 1, //月份
|
||||
"d+": this.getDate(), //日
|
||||
"H+": this.getHours(), //小时
|
||||
"m+": this.getMinutes(), //分
|
||||
"s+": this.getSeconds(), //秒
|
||||
"q+": Math.floor((this.getMonth() + 3) / 3), //季度
|
||||
"S": this.getMilliseconds() //毫秒
|
||||
};
|
||||
if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
|
||||
for (var k in o)
|
||||
if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
|
||||
return fmt;
|
||||
}
|
||||
|
||||
function initDate2() {
|
||||
var locale = {
|
||||
"format": 'YYYY-MM-DD ',
|
||||
"separator": " ~ ",
|
||||
"applyLabel": "确定",
|
||||
"cancelLabel": "取消",
|
||||
"fromLabel": "起始时间",
|
||||
"toLabel": "结束时间'",
|
||||
"customRangeLabel": "自定义",
|
||||
"weekLabel": "W",
|
||||
"daysOfWeek": ["日", "一", "二", "三", "四", "五", "六"],
|
||||
"monthNames": ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
|
||||
"firstDay": 1
|
||||
};
|
||||
var oldreservationtime1 = "${param.oldreservationtime1}";
|
||||
if (oldreservationtime1 != "" && oldreservationtime1.length > 0) {
|
||||
timeBegin = oldreservationtime1.substring(0, 16);
|
||||
timeEnd = oldreservationtime1.substring(19, 36);
|
||||
$('#repotDateFun').val(oldreservationtime1);
|
||||
} else {
|
||||
timeBegin = moment().subtract(3, 'days').format('YYYY-MM-DD');
|
||||
timeEnd = moment().subtract(0, 'days').format('YYYY-MM-DD');
|
||||
$('#repotDateFun').val(timeBegin + locale.separator + timeEnd);
|
||||
}
|
||||
|
||||
$('#repotDateFun').daterangepicker({
|
||||
"locale": locale,
|
||||
|
||||
startDate: timeBegin,
|
||||
endDate: timeEnd
|
||||
}, function (start, end, label) {
|
||||
timeBegin = start.format(this.locale.format);
|
||||
timeEnd = end.format(this.locale.format);
|
||||
|
||||
});
|
||||
|
||||
};
|
||||
var timedelete = function () {
|
||||
$('#repotDateFun').val('');
|
||||
timeEnd = null;
|
||||
timeBegin = null;
|
||||
};
|
||||
|
||||
function initDate1() {
|
||||
var locale = {
|
||||
"format": 'YYYY-MM-DD',
|
||||
"separator": " ~ ",
|
||||
"applyLabel": "确定",
|
||||
"cancelLabel": "取消",
|
||||
"fromLabel": "起始时间",
|
||||
"toLabel": "结束时间'",
|
||||
"customRangeLabel": "自定义",
|
||||
"weekLabel": "W",
|
||||
"daysOfWeek": ["日", "一", "二", "三", "四", "五", "六"],
|
||||
"monthNames": ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
|
||||
"firstDay": 1
|
||||
};
|
||||
var oldreservationtime1 = "${param.oldreservationtime1}";
|
||||
if (oldreservationtime1 != "" && oldreservationtime1.length > 0) {
|
||||
timeRangeBegin = oldreservationtime1.substring(0, 16);
|
||||
timeRangeEnd = oldreservationtime1.substring(19, 36);
|
||||
$('#reservationtimeD').val(oldreservationtime1);
|
||||
} else {
|
||||
timeRangeBegin = moment().subtract(3, 'days').format('YYYY-MM-DD');
|
||||
timeRangeEnd = moment().subtract(0, 'days').format('YYYY-MM-DD');
|
||||
$('#reservationtimeD').val(timeRangeBegin + locale.separator + timeRangeEnd);
|
||||
}
|
||||
|
||||
$('#reservationtimeD').daterangepicker({
|
||||
"locale": locale,
|
||||
startDate: timeRangeBegin,
|
||||
endDate: timeRangeEnd
|
||||
}, function (start, end, label) {
|
||||
timeRangeBegin = start.format(this.locale.format);
|
||||
timeRangeEnd = end.format(this.locale.format);
|
||||
});
|
||||
|
||||
};
|
||||
var timedel = function () {
|
||||
$('#reservationtimeD').val('');
|
||||
timeRangeEnd = null;
|
||||
timeRangeBegin = null;
|
||||
};
|
||||
//详情弹窗
|
||||
var viewFun = function (id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/whp/test/WhpSamplingPlanAudit/view.do', {id: id}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
//编辑页面
|
||||
var pawnFun = function (id) {
|
||||
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/whp/test/WhpSamplingPlanAudit/edit.do', {id: id}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
var dosearch = function () {
|
||||
console.log("status1",$('#status1').val())
|
||||
$("#table").bootstrapTable('refresh');
|
||||
};
|
||||
|
||||
var companyId_rawMaterial = "";
|
||||
|
||||
var initTableList = function () {
|
||||
timeEnd = null;
|
||||
timeBegin = null;
|
||||
timeRangeEnd = null;
|
||||
timeRangeBegin = null;
|
||||
// console.log("status",$('#status').val())
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/whp/test/WhpSamplingPlanAudit/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,
|
||||
dateBegin: timeRangeBegin,
|
||||
dateEnd: timeRangeEnd,
|
||||
reportDateBegin: timeBegin,
|
||||
reportDateEnd: timeEnd,
|
||||
status: $('#status1').val(),
|
||||
sampleTypeId: $('#sampleTypeId').val()
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
//detailView: true,//父子表
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
}, {
|
||||
field: 'code', // 返回json数据中的name
|
||||
title: '采样单编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' ,// 上下居中
|
||||
formatter:function (value,row) {
|
||||
|
||||
if(row.playType==1)
|
||||
{
|
||||
return '(车间)'+value;
|
||||
}else{
|
||||
return value;
|
||||
}
|
||||
}
|
||||
}, {
|
||||
field: 'sampleTypeName', // 返回json数据中的name
|
||||
title: '采样类型', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
|
||||
}, {
|
||||
field: 'date', // 返回json数据中的name
|
||||
title: '计划采样日期', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter: function (value, row, index) {
|
||||
return value.substring(0, 10);
|
||||
}
|
||||
}, {
|
||||
field: 'reportDate', // 返回json数据中的name
|
||||
title: '要求报告日期', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter: function (value, row, index) {
|
||||
return value.substring(0, 10);
|
||||
}
|
||||
}, {
|
||||
field: 'taskNumber', // 返回json数据中的name
|
||||
title: '样品任务数', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
}, {
|
||||
field: 'auditUserName', // 返回json数据中的name
|
||||
title: '审核人', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
}, {
|
||||
field: 'auditTime', // 返回json数据中的name
|
||||
title: '审核日期', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter:function(value,row,index)
|
||||
{
|
||||
return value.substring(0, 10);
|
||||
|
||||
}
|
||||
}, {
|
||||
field: 'statusName', // 返回json数据中的name
|
||||
title: '计划状态', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter: function (value, row, index) {
|
||||
if (row.statusName.includes("超时预警")) {
|
||||
return '<span style="color:red">' + value + '</span>'
|
||||
} else {
|
||||
return value
|
||||
}
|
||||
}
|
||||
}, {
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 160, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts = '';
|
||||
if(status==7)
|
||||
{
|
||||
buts += '<button class="btn btn-default btn-sm" title="详情" onclick="viewFun(\'' + row.id + '\')"><i class="fa fa-eye"></i><span class="hidden-md hidden-lg"> 详情</span></button>';
|
||||
|
||||
}else{
|
||||
buts += '<button class="btn btn-default btn-sm" title="编辑" onclick="pawnFun(\'' + row.id + '\')"><i class="glyphicon glyphicon-pawn"></i><span class="hidden-md hidden-lg"> 编辑</span></button>';
|
||||
|
||||
buts += '<button class="btn btn-default btn-sm" title="详情" onclick="viewFun(\'' + row.id + '\')"><i class="fa fa-eye"></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('${statusDropDown}');
|
||||
var select_3 = $("#status1").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('6').trigger('change');
|
||||
}
|
||||
|
||||
function conditionDropDowntype() {
|
||||
var select_Data = jQuery.parseJSON('${sampleTypeDropDown}');
|
||||
var select_3 = $("#sampleTypeId").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="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>
|
||||
|
||||
<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="sampleTypeId" id="sampleTypeId"
|
||||
style="width:180px;height: 30px">
|
||||
</select>
|
||||
<label class="form-label">计划状态:</label>
|
||||
<select class="form-control select2" name="status" id="status1"
|
||||
style="width:180px;height: 30px">
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-label">计划采样日期:</label>
|
||||
<div class="input-group input-group-sm" style="width: 200px;">
|
||||
<input type="text" autocomplete="off" class="form-control pull-left"
|
||||
style="height: 30px; width: 240px; border-radius: 4px;" id="reservationtimeD"
|
||||
placeholder="请选择计划采样日期范围">
|
||||
<a class="glyphicon glyphicon-remove btn form-control-feedback input-clear-a"
|
||||
style="pointer-events: auto;"
|
||||
onclick="timedel()"></a>
|
||||
</div>
|
||||
<label class="form-label">要求报告日期:</label>
|
||||
<div class="input-group input-group-sm" style="width: 200px;">
|
||||
<input type="text" autocomplete="off" class="form-control pull-left"
|
||||
style="height: 30px; width: 240px; border-radius: 4px;" id="repotDateFun"
|
||||
placeholder="请选择要求报告日期范围">
|
||||
<a class="glyphicon glyphicon-remove btn form-control-feedback input-clear-a"
|
||||
style="pointer-events: auto;"
|
||||
onclick="timedelete()"></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="input-group input-group-sm">
|
||||
<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>
|
||||
436
WebRoot/jsp/whp/test/WhpSamplingPlanTaskListForAuditEdit.jsp
Normal file
436
WebRoot/jsp/whp/test/WhpSamplingPlanTaskListForAuditEdit.jsp
Normal file
@ -0,0 +1,436 @@
|
||||
<!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 () {
|
||||
initTableViewList1();
|
||||
$("#auditTime").datepicker({
|
||||
language: 'zh-CN',
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'yyyy-mm-dd',
|
||||
});
|
||||
initDropDownStatus();
|
||||
|
||||
});
|
||||
|
||||
//编辑弹窗
|
||||
var Editlist = function (id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/whp/test/WhpSamplingPlanTaskTestItem/edit.do', {itemid: id,unitId:unitId,edittype:1}, function (data) {
|
||||
$("#TtemWorking").html(data);
|
||||
openModal('subEdit');
|
||||
});
|
||||
};
|
||||
function initTableViewList1() {
|
||||
|
||||
$("#tableFunList1").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/whp/test/WhpSamplingPlanTaskTestItem/getListByplanId.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,
|
||||
planId: '${bean.id}'
|
||||
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
//detailView: true,//父子表
|
||||
columns: [
|
||||
|
||||
{
|
||||
field: 'sampleCode', // 返回json数据中的name
|
||||
title: '样品编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'sampleAddress', // 返回json数据中的name
|
||||
title: '地点', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'sampleState',
|
||||
title: '样品状态',
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
if (value==0){
|
||||
return'固体'
|
||||
}else {
|
||||
return'液体'
|
||||
}
|
||||
}
|
||||
}, {
|
||||
field: 'sampleAppearance',
|
||||
title: '样品外观',
|
||||
align: 'center',
|
||||
valign: 'middle'
|
||||
|
||||
|
||||
}, {
|
||||
field: 'sampleSupernatant',
|
||||
title: '样品上清液',
|
||||
align: 'center',
|
||||
valign: 'middle'
|
||||
|
||||
|
||||
}, {
|
||||
field: 'sampleNature',
|
||||
title: '样品性质',
|
||||
align: 'center',
|
||||
valign: 'middle'
|
||||
|
||||
|
||||
},{
|
||||
field: 'sampleAmount',
|
||||
title: '样品数量',
|
||||
align: 'center',
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'testItemName', // 返回json数据中的name
|
||||
title: '检测项目', // 表格表头显示文字
|
||||
align: 'center' // 左右居中
|
||||
|
||||
}, {
|
||||
field: 'testUserName', // 返回json数据中的name
|
||||
title: '检测人', // 表格表头显示文字
|
||||
align: 'center' // 左右居中
|
||||
|
||||
}, {
|
||||
field: 'testDate', // 返回json数据中的name
|
||||
title: '检测日期', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
formatter:function (value, row, index){
|
||||
return value.substring(0,10);
|
||||
}
|
||||
|
||||
}, {
|
||||
field: 'confirmUserName', // 返回json数据中的name
|
||||
title: '复核人', // 表格表头显示文字
|
||||
align: 'center' // 左右居中
|
||||
|
||||
}, {
|
||||
field: 'confirmDate', // 返回json数据中的name
|
||||
title: '复核日期', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
formatter:function (value, row, index){
|
||||
return value.substring(0,10);
|
||||
}
|
||||
|
||||
}, {
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 160, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts="";
|
||||
if(row.istestid!='')
|
||||
{
|
||||
buts += '<button class="btn btn-default btn-sm" title="编辑" onclick="Editlist(\'' + row.id + '\')"><i class="fa fa-edit"></i><span class="hidden-md hidden-lg"> 编辑</span></button>';
|
||||
buts = '<div class="btn-group" >' + buts + '</div>';
|
||||
}
|
||||
|
||||
|
||||
return buts;
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function (data) { //加载成功时执行
|
||||
adjustBootstrapTableView("tableFunList1");
|
||||
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
});
|
||||
}
|
||||
function updataList() {
|
||||
$("#auditEditForm").data("bootstrapValidator").updateStatus("auditUserName","NOT_VALIDATED", null).validateField("auditUserName");
|
||||
$("#auditEditForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#auditEditForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
var formData = new FormData($("#auditEditForm")[0]);
|
||||
$.ajax({
|
||||
url: ext.contextPath + "/whp/test/WhpSamplingPlanAudit/update.do",
|
||||
type: 'POST',
|
||||
data: formData,
|
||||
async: false,
|
||||
cache: false,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
|
||||
if (data.code == 1) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
closeModal('subModal');
|
||||
} else {
|
||||
showAlert('d', '保存失败!' + data.msg);
|
||||
}
|
||||
},
|
||||
error: function (data) {
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
function updataFunList() {
|
||||
$("#auditEditForm").data("bootstrapValidator").updateStatus("auditUserName","NOT_VALIDATED", null).validateField("auditUserName");
|
||||
$("#auditEditForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#auditEditForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
var formData = new FormData($("#auditEditForm")[0]);
|
||||
$.ajax({
|
||||
url: ext.contextPath + "/whp/test/WhpSamplingPlanAudit/submit.do",
|
||||
type: 'POST',
|
||||
data: formData,
|
||||
async: false,
|
||||
cache: false,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
|
||||
if (data.code == 1) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
closeModal('subModal');
|
||||
} else {
|
||||
showAlert('d', '保存失败!' + data.msg);
|
||||
}
|
||||
},
|
||||
error: function (data) {
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
function initDropDownStatus() {
|
||||
var select_Data = jQuery.parseJSON('${auditStatusDropDown}');
|
||||
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 selectdutyUser() {
|
||||
$.post(ext.contextPath + '/user/userForOneSelect.do',
|
||||
{
|
||||
formId: "auditEditForm",
|
||||
hiddenId: "auditUserId",
|
||||
textId: "auditUserName"
|
||||
},
|
||||
function (data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal('user4SelectModal');
|
||||
});
|
||||
|
||||
};
|
||||
$("#auditEditForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
auditUserName: {
|
||||
trigger:"change",
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '审核人不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
auditTime: {
|
||||
trigger:"change",
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '审核日期不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
auditAdvice: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '审核意见不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
status: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '审核结果不能为空'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog " style="width: 65%">
|
||||
<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强制为auditEditForm -->
|
||||
<form class="form-horizontal" id="auditEditForm" enctype="multipart/form-data">
|
||||
<div id="alertDiv"></div>
|
||||
<%-- <input type="hidden" name="id" value="${user.id }" />--%>
|
||||
<!-- 界面提醒div强制id为alertdiv -->
|
||||
|
||||
<input type="hidden" name="id" id="id" class="form-control" value="${bean.id}">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 采样单编号:</label>
|
||||
<div class="col-sm-2">
|
||||
<p class="form-control-static">${bean.code}</p>
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">* 采样类型:</label>
|
||||
<div class="col-sm-2">
|
||||
<p class="form-control-static">${bean.sampleTypeName}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">* 计划采样日期:</label>
|
||||
<div class="col-sm-2">
|
||||
<p class="form-control-static">${bean.date.substring(0,10)}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 需求报告日期:</label>
|
||||
<div class="col-sm-2">
|
||||
<p class="form-control-static">${bean.reportDate.substring(0,10)}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">* 样品任务数:</label>
|
||||
<div class="col-sm-2">
|
||||
<p class="form-control-static">${bean.taskNumber}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 收样人:</label>
|
||||
<div class="col-sm-2">
|
||||
<p class="form-control-static">${bean.acceptUserName}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">* 收样日期:</label>
|
||||
<div class="col-sm-2">
|
||||
<p class="form-control-static">${bean.acceptDate.substring(0,10)}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 审核人:</label>
|
||||
<div class="col-sm-2">
|
||||
<input type="text" id="auditUserName" name="auditUserName" class="form-control"
|
||||
placeholder="请选择.." readonly onclick="selectdutyUser()" value="${bean.auditUserName}">
|
||||
<input type="hidden" id="auditUserId" name="auditUserId" class="form-control"
|
||||
placeholder="请选择.." value="${bean.auditUserId}" >
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">* 审核日期:</label>
|
||||
<div class="col-sm-2">
|
||||
<div class="input-group date">
|
||||
<div class="input-group-addon">
|
||||
<i class="fa fa-calendar"></i>
|
||||
</div>
|
||||
<input type="text" class="form-control" id="auditTime" name="auditTime"
|
||||
value="${bean.auditTime.substring(0,10)}" placeholder="请选择.."/>
|
||||
</div>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">* 审核结果:</label>
|
||||
<div class="col-sm-2">
|
||||
<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-10">
|
||||
<input type="text" class="form-control" id="auditAdvice" name="auditAdvice"
|
||||
value="${bean.auditAdvice} " />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</form>
|
||||
<table id="tableFunList1"></table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer" style="padding: 15px">
|
||||
<button type="button" class="btn btn-default " data-dismiss="modal">关闭
|
||||
</button>
|
||||
<button type="button" class="btn btn-primary " style="margin-left: 10px"
|
||||
onclick="updataList()">保存
|
||||
</button>
|
||||
<button type="button" class="btn btn-primary " style="margin-left: 10px"
|
||||
onclick="updataFunList()">保存并提交
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
275
WebRoot/jsp/whp/test/WhpSamplingPlanTaskListForAuditView.jsp
Normal file
275
WebRoot/jsp/whp/test/WhpSamplingPlanTaskListForAuditView.jsp
Normal file
@ -0,0 +1,275 @@
|
||||
<!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;
|
||||
|
||||
}
|
||||
|
||||
.select2-container--default .select2-selection--single {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.select2-container--default .select2-selection--single, .select2-selection .select2-selection--single {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.select2-container--default .select2-selection--single .select2-selection__arrow b {
|
||||
border: none;
|
||||
border-style: unset
|
||||
}
|
||||
|
||||
.select2-container--default.select2-container--disabled .select2-selection--single {
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
.right {
|
||||
margin-left: 50px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
initTableViewList();
|
||||
|
||||
});
|
||||
// 催办
|
||||
// var press = function (id) {
|
||||
// };
|
||||
|
||||
//详情弹窗
|
||||
var viewFunList = function (id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/whp/test/WhpSamplingPlanTaskTestItem/view.do', {id: id,unitId:unitId}, function (data) {
|
||||
$("#TtemWorking").html(data);
|
||||
openModal('TtemWorView');
|
||||
});
|
||||
};
|
||||
function initTableViewList() {
|
||||
|
||||
$("#tableView").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/whp/test/WhpSamplingPlanTaskTestItem/getListByplanId.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,
|
||||
planId: '${bean.id}'
|
||||
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
//detailView: true,//父子表
|
||||
columns: [
|
||||
|
||||
{
|
||||
field: 'sampleCode', // 返回json数据中的name
|
||||
title: '样品编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'sampleAddress', // 返回json数据中的name
|
||||
title: '地点', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'sampleState',
|
||||
title: '样品状态',
|
||||
align: 'center',
|
||||
valign: 'middle'
|
||||
|
||||
}, {
|
||||
field: 'sampleAppearance',
|
||||
title: '样品外观',
|
||||
align: 'center',
|
||||
valign: 'middle'
|
||||
|
||||
|
||||
}, {
|
||||
field: 'sampleSupernatant',
|
||||
title: '样品上清液',
|
||||
align: 'center',
|
||||
valign: 'middle'
|
||||
|
||||
|
||||
}, {
|
||||
field: 'sampleNature',
|
||||
title: '样品性质',
|
||||
align: 'center',
|
||||
valign: 'middle'
|
||||
|
||||
|
||||
}, {
|
||||
field: 'sampleAmount',
|
||||
title: '样品数量',
|
||||
align: 'center',
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'testItemName', // 返回json数据中的name
|
||||
title: '检测项目', // 表格表头显示文字
|
||||
align: 'center' // 左右居中
|
||||
|
||||
}, {
|
||||
field: 'testUserName', // 返回json数据中的name
|
||||
title: '检测人', // 表格表头显示文字
|
||||
align: 'center' // 左右居中
|
||||
|
||||
}, {
|
||||
field: 'testDate', // 返回json数据中的name
|
||||
title: '检测日期', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
formatter:function (value, row, index){
|
||||
return value.substring(0,10);
|
||||
}
|
||||
|
||||
}, {
|
||||
field: 'confirmUserName', // 返回json数据中的name
|
||||
title: '复核人', // 表格表头显示文字
|
||||
align: 'center' // 左右居中
|
||||
|
||||
}, {
|
||||
field: 'confirmDate', // 返回json数据中的name
|
||||
title: '复核日期', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
formatter:function (value, row, index){
|
||||
return value.substring(0,10);
|
||||
}
|
||||
|
||||
}, {
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 160, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts = '';
|
||||
if(row.istestid!='') {
|
||||
// buts += '<button class="btn btn-default btn-sm" title="催办" onclick="press(\'' + 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="viewFunList(\'' + row.id + '\')"><i class="fa fa-eye"></i><span class="hidden-md hidden-lg"> 详情</span></button>';
|
||||
but修改采样类型s = '<div class="btn-group" >' + buts + '</div>';
|
||||
}
|
||||
return buts;
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function (data) { //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog " style="width: 65%">
|
||||
<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 -->
|
||||
|
||||
<input type="hidden" name="id" id="id" class="form-control" value="${bean.id}">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 采样单编号:</label>
|
||||
<div class="col-sm-2">
|
||||
<p class="form-control-static">${bean.code}</p>
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">* 采样类型:</label>
|
||||
<div class="col-sm-2">
|
||||
<p class="form-control-static">${bean.sampleTypeName}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">* 计划采样日期:</label>
|
||||
<div class="col-sm-2">
|
||||
<p class="form-control-static">${bean.date.substring(0,10)}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 需求报告日期:</label>
|
||||
<div class="col-sm-2">
|
||||
<p class="form-control-static">${bean.reportDate.substring(0,10)}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">* 样品任务数:</label>
|
||||
<div class="col-sm-2">
|
||||
<p class="form-control-static">${bean.taskNumber}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 收样人:</label>
|
||||
<div class="col-sm-2">
|
||||
<p class="form-control-static">${bean.acceptUserName}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">* 收样日期:</label>
|
||||
<div class="col-sm-2">
|
||||
<p class="form-control-static">${bean.acceptDate.substring(0,10)}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</form>
|
||||
<table id="tableView"></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="updateSaveFun()">保存--%>
|
||||
<%-- </button>--%>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
566
WebRoot/jsp/whp/test/WhpSamplingPlanTaskListForTest.jsp
Normal file
566
WebRoot/jsp/whp/test/WhpSamplingPlanTaskListForTest.jsp
Normal file
@ -0,0 +1,566 @@
|
||||
<%@ 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">
|
||||
var timeEnd;
|
||||
var timeBegin;
|
||||
var datetimeEnd;
|
||||
var datetimeBegin;
|
||||
var timeRangeEnd;
|
||||
var timeRangeBegin;
|
||||
$(function () {
|
||||
statusConditonDropDown();
|
||||
sampleTypeConditonDropDown();
|
||||
//initDate2()
|
||||
initDate3()
|
||||
initDate1()
|
||||
$('#reportDateCondition').val('');
|
||||
$('#dateCondition').val('');
|
||||
initTableList();
|
||||
});
|
||||
//对Date的扩展,将 Date 转化为指定格式的String
|
||||
//月(M)、日(d)、小时(h)、分(m)、秒(s)、季度(q) 可以用 1-2 个占位符,
|
||||
//年(y)可以用 1-4 个占位符,毫秒(S)只能用 1 个占位符(是 1-3 位的数字)
|
||||
Date.prototype.Format = function (fmt) {
|
||||
var o = {
|
||||
"M+": this.getMonth() + 1, //月份
|
||||
"d+": this.getDate(), //日
|
||||
"H+": this.getHours(), //小时
|
||||
"m+": this.getMinutes(), //分
|
||||
"s+": this.getSeconds(), //秒
|
||||
"q+": Math.floor((this.getMonth() + 3) / 3), //季度
|
||||
"S": this.getMilliseconds() //毫秒
|
||||
};
|
||||
if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
|
||||
for (var k in o)
|
||||
if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
|
||||
return fmt;
|
||||
}
|
||||
|
||||
function initDate3() {
|
||||
var locale = {
|
||||
"format": 'YYYY-MM-DD ',
|
||||
"separator": " ~ ",
|
||||
"applyLabel": "确定",
|
||||
"cancelLabel": "取消",
|
||||
"fromLabel": "起始时间",
|
||||
"toLabel": "结束时间'",
|
||||
"customRangeLabel": "自定义",
|
||||
"weekLabel": "W",
|
||||
"daysOfWeek": ["日", "一", "二", "三", "四", "五", "六"],
|
||||
"monthNames": ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
|
||||
"firstDay": 1
|
||||
};
|
||||
var oldreservationtime1 = "${param.oldreservationtime1}";
|
||||
if (oldreservationtime1 != "" && oldreservationtime1.length > 0) {
|
||||
datetimeBegin = oldreservationtime1.substring(0, 16);
|
||||
datetimeEnd = oldreservationtime1.substring(19, 36);
|
||||
$('#dateCondition').val(oldreservationtime1);
|
||||
} else {
|
||||
datetimeBegin = moment().subtract(3, 'days').format('YYYY-MM-DD');
|
||||
datetimeEnd = moment().subtract(0, 'days').format('YYYY-MM-DD');
|
||||
$('#dateCondition').val(datetimeBegin + locale.separator + datetimeEnd);
|
||||
}
|
||||
|
||||
$('#dateCondition').daterangepicker({
|
||||
"locale": locale,
|
||||
startDate: datetimeBegin,
|
||||
endDate: datetimeEnd
|
||||
}, function (start, end, label) {
|
||||
datetimeBegin = start.format(this.locale.format);
|
||||
datetimeEnd = end.format(this.locale.format);
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
function initDate1(){
|
||||
var locale = {
|
||||
"format": 'YYYY-MM-DD ',
|
||||
"separator": " ~ ",
|
||||
"applyLabel": "确定",
|
||||
"cancelLabel": "取消",
|
||||
"fromLabel": "起始时间",
|
||||
"toLabel": "结束时间'",
|
||||
"customRangeLabel": "自定义",
|
||||
"weekLabel": "W",
|
||||
"daysOfWeek": ["日", "一", "二", "三", "四", "五", "六"],
|
||||
"monthNames": ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
|
||||
"firstDay": 1
|
||||
};
|
||||
var oldreservationtime1 = "${param.oldreservationtime1}";
|
||||
if (oldreservationtime1 != "" && oldreservationtime1.length > 0) {
|
||||
timeBegin = oldreservationtime1.substring(0, 16);
|
||||
timeEnd = oldreservationtime1.substring(19, 36);
|
||||
|
||||
} else {
|
||||
timeBegin = moment().subtract(3, 'days').format('YYYY-MM-DD');
|
||||
timeEnd = moment().subtract(0, 'days').format('YYYY-MM-DD');
|
||||
}
|
||||
$('#reportDateCondition').daterangepicker({
|
||||
"locale": locale,
|
||||
startDate: timeBegin,
|
||||
endDate: timeEnd
|
||||
}, function (start, end, label) {
|
||||
timeBegin = start.format(this.locale.format);
|
||||
timeEnd = end.format(this.locale.format);
|
||||
});
|
||||
|
||||
};
|
||||
var timedelete = function () {
|
||||
$('#reportDateCondition').val('');
|
||||
timeEnd = null;
|
||||
timeBegin = null;
|
||||
};
|
||||
var timedeleteData = function () {
|
||||
$('#dateCondition').val('');
|
||||
datetimeEnd = null;
|
||||
datetimeBegin = null;
|
||||
};
|
||||
|
||||
|
||||
|
||||
/* var timedel = function () {
|
||||
$('#reservationtimeD').val('');
|
||||
timeRangeEnd = null;
|
||||
timeRangeBegin = null;
|
||||
};*/
|
||||
|
||||
//编辑弹窗
|
||||
var editFun = function (id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/whp/test/WhpSamplingPlanTaskAudit/edit.do', {id: id}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
//详情弹窗
|
||||
var viewFun = function (id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/whp/test/WhpSamplingPlanTaskAudit/view.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/liquidWasteDispose/WhpLiquidWasteDispose/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/liquidWasteDispose/WhpLiquidWasteDispose/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 initTableList = function () {
|
||||
timeEnd = null;
|
||||
timeBegin = null;
|
||||
datetimeEnd = null;
|
||||
datetimeBegin = null;
|
||||
timeRangeEnd = null;
|
||||
timeRangeBegin = null;
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/whp/test/WhpSamplingPlanTaskAudit/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,
|
||||
reportDateBegin: timeBegin,
|
||||
reportDateEnd: timeEnd,
|
||||
dateBegin: datetimeBegin,
|
||||
dateEnd: datetimeEnd,
|
||||
sampleTypeId: $("#sampleTypeCondition").val(),
|
||||
// status: $('#statusCondition').val()
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
//detailView: true,//父子表
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
},
|
||||
{
|
||||
field: 'code',
|
||||
title: '采样单编号',
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
formatter:function (value,row) {
|
||||
|
||||
if(row.playType==1)
|
||||
{
|
||||
return '(车间)'+value;
|
||||
}else{
|
||||
return value;
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'sampleTypeName',
|
||||
title: '采样类型',
|
||||
align: 'center',
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'date',
|
||||
title: '采样日期',
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
formatter:function(value){
|
||||
return value.substring(0,10);
|
||||
}
|
||||
}, {
|
||||
field: 'reportDate',
|
||||
title: '要求报告日期',
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
formatter:function(value){
|
||||
return value.substring(0,10);
|
||||
}
|
||||
}, {
|
||||
field: 'taskNumber',
|
||||
title: '样品数量',
|
||||
align: 'center',
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'statusName',
|
||||
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="viewFun(\'' + row.id + '\')"><i class="fa fa-eye"></i><span class="hidden-md hidden-lg">详情</span></button>';
|
||||
|
||||
// 已处置的不能编辑删除
|
||||
// if (row.status == 1) {
|
||||
// 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>';
|
||||
// }
|
||||
// if (row.status == 2) {
|
||||
// buts += '<button class="btn btn-default btn-sm" title="详情" onclick="viewFun(\'' + row.id + '\')"><i class="fa fa-eye"></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 statusConditonDropDown() {
|
||||
var select_Data = JSON.parse('${statusDropDown}');
|
||||
var select_3 = $("#statusCondition").select2({
|
||||
data: select_Data,
|
||||
cache: false,
|
||||
placeholder: '全部',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
multiple: 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('').trigger('change');
|
||||
}
|
||||
|
||||
//采样类型
|
||||
function sampleTypeConditonDropDown() {
|
||||
var select_Data1 = JSON.parse('${sampleTypeDropDown}');
|
||||
var select_4 = $("#sampleTypeCondition").select2({
|
||||
data: select_Data1,
|
||||
cache: false,
|
||||
placeholder: '全部',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
multiple: 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_4.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>
|
||||
</div>
|
||||
--%>
|
||||
<div class="form-group pull-right form-inline">
|
||||
<div class="form-group">
|
||||
<label class="form-label">采样类型:</label>
|
||||
<select class="form-control select2" name="sampleTypeCondition" id="sampleTypeCondition"
|
||||
style="width:180px;height: 30px">
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-label">计划采样日期:</label>
|
||||
<div class="input-group input-group-sm" style="width: 200px;">
|
||||
<input type="text" autocomplete="off" class="form-control pull-right"
|
||||
style="height: 30px; width: 240px; border-radius: 4px;" id="dateCondition"
|
||||
placeholder="请选择计划采样日期范围">
|
||||
<a class="glyphicon glyphicon-remove btn form-control-feedback input-clear-a"
|
||||
style="pointer-events: auto;"
|
||||
onclick="timedeleteData()"></a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<label class="form-label">要求报告日期:</label>
|
||||
<div class="input-group input-group-sm" style="width: 200px;">
|
||||
<input type="text" autocomplete="off" class="form-control pull-right"
|
||||
style="height: 30px; width: 240px; border-radius: 4px;" id="reportDateCondition"
|
||||
placeholder="请选择要求日期范围">
|
||||
<a class="glyphicon glyphicon-remove btn form-control-feedback input-clear-a"
|
||||
style="pointer-events: auto;"
|
||||
onclick="timedelete()"></a>
|
||||
</div>
|
||||
<div class="input-group input-group-sm" style="width: 100px;">
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-default" onclick="dosearch();"><i class="fa fa-search"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<table id="table"></table>
|
||||
|
||||
</form>
|
||||
|
||||
</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>
|
||||
|
||||
@ -0,0 +1,237 @@
|
||||
<!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;
|
||||
|
||||
}
|
||||
|
||||
.select2-container--default .select2-selection--single {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.select2-container--default .select2-selection--single, .select2-selection .select2-selection--single {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.select2-container--default .select2-selection--single .select2-selection__arrow b {
|
||||
border: none;
|
||||
border-style: unset
|
||||
}
|
||||
|
||||
.select2-container--default.select2-container--disabled .select2-selection--single {
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
.right {
|
||||
margin-left: 50px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
var initTableData2 = function () {
|
||||
$("#Plantable").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/whp/test/WhpSamplingPlanTaskTestItem/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, // 排序规则
|
||||
testConfirmId: '${bean.id}'
|
||||
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
//detailView: true,//父子表
|
||||
columns: [
|
||||
{
|
||||
field: 'sampleCode', // 返回json数据中的name
|
||||
title: '样品编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'sampleAddress', // 返回json数据中的name
|
||||
title: '地点', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'sampingDate', // 返回json数据中的name
|
||||
title: '采样日期', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter:function(value){
|
||||
return value.substring(0,10);
|
||||
}
|
||||
|
||||
}, {
|
||||
field: 'sampleState', // 返回json数据中的name
|
||||
title: '样品状态', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'sampleAppearance', // 返回json数据中的name
|
||||
title: '样品外观', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
},{
|
||||
field: 'sampleSupernatant', // 返回json数据中的name
|
||||
title: '样品上清液', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'sampleNature', // 返回json数据中的name
|
||||
title: '样品性质', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
},{
|
||||
field: 'sampleAmount', // 返回json数据中的name
|
||||
title: '样品数量', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
},{
|
||||
field: 'unit', // 返回json数据中的name
|
||||
title: '单位', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("Plantable");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
});
|
||||
}
|
||||
$(function () {
|
||||
initTableData2()
|
||||
console.log('${bean.id}','8888888888888')
|
||||
});
|
||||
|
||||
|
||||
function SavedataFun() {
|
||||
// console.log($("#addForm").serialize());
|
||||
$("#addForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#addForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
var formData = new FormData($("#addForm")[0]);
|
||||
$.ajax({
|
||||
url: ext.contextPath + "/whp/test/WhpSamplingPlanTaskTestConfirm/accept.do",
|
||||
type: 'POST',
|
||||
data: formData,
|
||||
async: false,
|
||||
cache: false,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
|
||||
if (data.code == 1) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
$("#table2").bootstrapTable('refresh');
|
||||
closeModal('subModal');
|
||||
} else {
|
||||
showAlert('d', '保存失败!' + data.msg);
|
||||
}
|
||||
},
|
||||
error: function (data) {
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog " style="width: 65%">
|
||||
<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="addForm" enctype="multipart/form-data">
|
||||
<div id="alertDiv"></div>
|
||||
<%-- <input type="hidden" name="id" value="${user.id }" />--%>
|
||||
<!-- 界面提醒div强制id为alertdiv -->
|
||||
|
||||
<input type="hidden" name="id" id="id" class="form-control" value="${bean.id}">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 采样单编号:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${bean.planCode}</p>
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">* 采样单类型:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${bean.sampleTypeName}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 样品任务数:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${bean.samplingTaskNumber}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">* 要求报告日期:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${bean.reportDate.substring(0,10)}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 检测项目:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${bean.testItemName}</p>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<table id="Plantable"></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="SavedataFun()">接单
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
@ -0,0 +1,574 @@
|
||||
<!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;
|
||||
|
||||
}
|
||||
|
||||
.select2-container--default .select2-selection--single {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.select2-container--default .select2-selection--single, .select2-selection .select2-selection--single {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.select2-container--default .select2-selection--single .select2-selection__arrow b {
|
||||
border: none;
|
||||
border-style: unset
|
||||
}
|
||||
|
||||
.select2-container--default.select2-container--disabled .select2-selection--single {
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
.right {
|
||||
margin-left: 50px;
|
||||
}
|
||||
|
||||
.sampleAmountView {
|
||||
color: black;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
initTableViewList();
|
||||
$("#confirmDate").datepicker({
|
||||
// startDate: date,
|
||||
language: 'zh-CN',
|
||||
format: 'yyyy-mm-dd',
|
||||
startView: "month", //初始化视图是‘年’
|
||||
minView: 1,
|
||||
maxView: "year",
|
||||
autoclose: true
|
||||
// todayBtn: "linked"
|
||||
});
|
||||
if('${bean.confirmDate}'=='')
|
||||
{
|
||||
$("#confirmDate").datepicker('setDate',new Date());
|
||||
|
||||
}
|
||||
conditionDropDownStatus()
|
||||
conditionDropDownmethod()
|
||||
|
||||
|
||||
});
|
||||
|
||||
function initTableViewList() {
|
||||
var tablehead=${tableheaders}
|
||||
$("#tableFunList1").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/whp/test/WhpSamplingPlanTaskTestItem/getListyp.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,
|
||||
testConfirmId: '${bean.id}',
|
||||
unitId:unitId
|
||||
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
//detailView: true,//父子表
|
||||
columns: [
|
||||
{
|
||||
field: 'sampleCode', // 返回json数据中的name
|
||||
title: '样品编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
|
||||
},
|
||||
...tablehead,
|
||||
{
|
||||
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 = '<div class="btn-group" >' + buts + '</div>';
|
||||
return buts;
|
||||
}
|
||||
}
|
||||
|
||||
],
|
||||
|
||||
onLoadSuccess: function (data) { //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//列表编辑弹窗
|
||||
var editFun = function (id) {
|
||||
stopBubbleDefaultEvent();
|
||||
|
||||
|
||||
$.post(ext.contextPath + '/whp/test/WhpSamplingPlanTaskTestItem/edit.do',
|
||||
{
|
||||
itemid: id,
|
||||
unitId:unitId,
|
||||
edittype:1
|
||||
}, function (data) {
|
||||
$("#subEditDiv").html(data);
|
||||
openModal('subEdit');
|
||||
});
|
||||
};
|
||||
// 编辑表格
|
||||
function initCell(id, name, dataTyp, dataTitle, value) {
|
||||
|
||||
if (value === undefined || value == null || value == "") {
|
||||
value = '';
|
||||
}
|
||||
|
||||
return '<a href="#" class="tableAClass" name="' + name + '" sample-amount="' + dataTyp + '" sample-pk="' + id + '" sample-title="' + dataTitle + '" style="text-decoration: none;border: none;outline: none;line-height: 47px">' + value + '</a>'
|
||||
// return "<a href=\"#\" name=\""+name+"\" data-type=\""+dataType+"\" data-pk=\"" + id + "\" data-title=\""+dataTitle+"\">" + value + "</a>"
|
||||
}
|
||||
|
||||
function tableAContent(rows) {
|
||||
console.log(rows, "table")
|
||||
rows.forEach((row, index) => {
|
||||
$("#tableFunList1 a").editable({
|
||||
emptytext: '点击开始填写',
|
||||
emptyclass: 'sampleAmountView',
|
||||
url: function (params) {
|
||||
console.log(params, "sample")
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: ext.contextPath + '/whp/plan/WhpSamplingPlanTask/amount.do?id=' + row.id + "&amount=" + params.value,
|
||||
dataType: 'JSON',
|
||||
success: function (data, textStatus, jqXHR) {
|
||||
|
||||
// alert('保存成功!');
|
||||
},
|
||||
error: function (res) {
|
||||
// alert("error");
|
||||
|
||||
if (res.status == 400) {
|
||||
showAlert('d', '输入有误,请检查输入', 'mainAlertdiv')
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
type: 'text'
|
||||
});
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
|
||||
function selectChange1(val, id, index) {
|
||||
}
|
||||
|
||||
// 检验审核人
|
||||
function selectdutyUser() {
|
||||
$.post(ext.contextPath + '/user/userForOneSelect.do',
|
||||
{
|
||||
formId: "confirmEditForm",
|
||||
hiddenId: "auditUserId",
|
||||
textId: "auditUserName"
|
||||
},
|
||||
function (data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal('user4SelectModal');
|
||||
});
|
||||
};
|
||||
var combackFun = function (id) {
|
||||
$.ajax({
|
||||
url: ext.contextPath + "/whp/plan/WhpSamplingPlanTask/reject.do?id=" + id,
|
||||
type: 'POST',
|
||||
async: false,
|
||||
cache: false,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
if (data.code == 1) {
|
||||
$("#tableFunList1").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '回退失败!' + data.msg);
|
||||
}
|
||||
},
|
||||
error: function (data) {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function updateSaveFun() {
|
||||
$("#confirmEditForm").data("bootstrapValidator").updateStatus("confirmUserName","NOT_VALIDATED", null).validateField("confirmUserName");
|
||||
$("#confirmEditForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#confirmEditForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
var formData = new FormData($("#confirmEditForm")[0]);
|
||||
$.ajax({
|
||||
url: ext.contextPath + "/whp/test/WhpSamplingPlanTaskTestConfirm/update.do",
|
||||
type: 'POST',
|
||||
data: formData,
|
||||
async: false,
|
||||
cache: false,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
if (data.code == 1) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
closeModal('subModal');
|
||||
} else {
|
||||
showAlert('d', '保存失败!' + data.msg);
|
||||
}
|
||||
},
|
||||
error: function (data) {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function submitSaveFun() {
|
||||
$("#confirmEditForm").data("bootstrapValidator").updateStatus("confirmUserName","NOT_VALIDATED", null).validateField("confirmUserName");
|
||||
$("#confirmEditForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#confirmEditForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
var formData = new FormData($("#confirmEditForm")[0]);
|
||||
$.ajax({
|
||||
url: ext.contextPath + "/whp/test/WhpSamplingPlanTaskTestConfirm/confirm.do",
|
||||
type: 'POST',
|
||||
data: formData,
|
||||
async: false,
|
||||
cache: false,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
if (data.code == 1) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
closeModal('subModal');
|
||||
} else {
|
||||
showAlert('d', '保存失败!' + data.msg);
|
||||
}
|
||||
},
|
||||
error: function (data) {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function issueSaveFun() {
|
||||
$("#confirmEditForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#confirmEditForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
var formData = new FormData($("#confirmEditForm")[0]);
|
||||
$.ajax({
|
||||
url: ext.contextPath + "/whp/test/WhpSamplingPlanTaskAudit/submit.do?id=" + $("#id").val(),
|
||||
type: 'POST',
|
||||
async: false,
|
||||
cache: false,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
if (data.code == 1) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
closeModal('subModal');
|
||||
} else {
|
||||
showAlert('d', '下发失败!' + data.msg);
|
||||
}
|
||||
},
|
||||
error: function (data) {
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// 检验审核人
|
||||
function selectdutyUser() {
|
||||
$.post(ext.contextPath + '/user/userForOneSelect.do',
|
||||
{
|
||||
formId: "confirmEditForm",
|
||||
hiddenId: "confirmUserId",
|
||||
textId: "confirmUserName"
|
||||
},
|
||||
function (data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal('user4SelectModal');
|
||||
});
|
||||
};
|
||||
|
||||
function conditionDropDownStatus() {
|
||||
var select_Data = jQuery.parseJSON('${confirmStatusDropDown}');
|
||||
var select_3 = $("#status").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', 'border': '1px solid black'});
|
||||
select_3.val('${bean.status}').trigger('change');
|
||||
}
|
||||
//方法依据下拉
|
||||
function conditionDropDownmethod() {
|
||||
var select_Data = jQuery.parseJSON('${itemMethodDropDown}');
|
||||
var select_3 = $("#method").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('${bean.method}').trigger("change");
|
||||
}
|
||||
$("#confirmEditForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
confirmUserName: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '复核人不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
confirmDate: {
|
||||
trigger:"change",
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '复核日期不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
status: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '复核结果不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
confirmAdvice: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '复核意见不能为空'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog " style="width: 80%">
|
||||
<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强制为confirmEditForm -->
|
||||
<form class="form-horizontal" id="confirmEditForm" enctype="multipart/form-data">
|
||||
<div id="alertDiv"></div>
|
||||
<%-- <input type="hidden" name="id" value="${user.id }" />--%>
|
||||
<!-- 界面提醒div强制id为alertdiv -->
|
||||
|
||||
<input type="hidden" name="id" id="id" class="form-control" value="${bean.id}">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label"> 采样单编号:</label>
|
||||
<div class="col-sm-2">
|
||||
<p class="form-control-static">${bean.planCode}</p>
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label"> 采样类型:</label>
|
||||
<div class="col-sm-2">
|
||||
<p class="form-control-static">${bean.sampleTypeName}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label"> 检测项目:</label>
|
||||
<div class="col-sm-2">
|
||||
<p class="form-control-static">${bean.testItemName}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 检测人员:</label>
|
||||
<div class="col-sm-2">
|
||||
<p class="form-control-static">${bean.testUserName}</p>
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">* 检测日期:</label>
|
||||
<div class="col-sm-2">
|
||||
<p class="form-control-static">${fn:substring(bean.testDate,0,10)}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 室温(℃):</label>
|
||||
<div class="col-sm-2">
|
||||
<p class="form-control-static">${bean.temperature}</p>
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label"> 使用试剂:</label>
|
||||
<div class="col-sm-2">
|
||||
<p class="form-control-static">${bean.reagent}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label"> 方法依据:</label>
|
||||
<div class="col-sm-2">
|
||||
<input type="text" style="width: 100%;border: none" disabled="true" name="method" id="method" >
|
||||
|
||||
<%-- <p class="form-control-static">${bean.method}</p>--%>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 工作曲线:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${bean.workCurveName}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" >
|
||||
<c:forEach items="${bean.contantworkingCurveVoslist}" var="item" varStatus="status">
|
||||
|
||||
<label style="" class="col-sm-2 control-label">${item.MPoint.parmname}</label>
|
||||
<div class="col-sm-2">
|
||||
<p class="form-control-static">${item.default_value}${item.MPoint.unit}</p>
|
||||
</div>
|
||||
|
||||
</c:forEach>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label"> 仪器名称:</label>
|
||||
<div class="col-sm-2">
|
||||
<p class="form-control-static">${bean.equipmentName}</p>
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">* 仪器编号:</label>
|
||||
<div class="col-sm-2">
|
||||
<p class="form-control-static">${bean.equipmentCode}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">* 测定地点:</label>
|
||||
<div class="col-sm-2">
|
||||
<p class="form-control-static">${bean.testAddress}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label"> 复核人:</label>
|
||||
<div class="col-sm-2">
|
||||
<%-- <p class="form-control-static">${bean.confirmUserName}</p>--%>
|
||||
<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>
|
||||
|
||||
<label class="col-sm-2 control-label"> 复核日期:</label>
|
||||
<div class="col-sm-2">
|
||||
<div class="input-group date">
|
||||
<div class="input-group-addon">
|
||||
<i class="fa fa-calendar"></i>
|
||||
</div>
|
||||
<input class="form-control" type="text" id="confirmDate" name="confirmDate"
|
||||
value="${bean.confirmDate}">
|
||||
</div>
|
||||
<%-- <p class="form-control-static">${bean.confirmDate}</p>--%>
|
||||
|
||||
</div>
|
||||
<label class="col-sm-2 control-label"> 复核结果:</label>
|
||||
<div class="col-sm-2">
|
||||
<%-- <p class="form-control-static">${bean.sampleTypeName}</p>--%>
|
||||
<input type="text" style="width: 100%;" name="status" id="status"
|
||||
class="form-control">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
||||
<label class="col-sm-2 control-label"> 复核意见:</label>
|
||||
<div class="col-sm-10">
|
||||
<%-- <p class="form-control-static">${bean.sampleTypeName}</p>--%>
|
||||
<textarea class="form-control" id="confirmAdvice" name="confirmAdvice"
|
||||
>${bean.confirmAdvice}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</form>
|
||||
<table id="tableFunList1"></table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer" style="padding: 15px">
|
||||
<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>
|
||||
<button type="button" class="btn btn-primary " style="margin-left: 10px"
|
||||
onclick="submitSaveFun()">保存并提交
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
734
WebRoot/jsp/whp/test/WhpSamplingPlanTaskTestConfirmEditTest.jsp
Normal file
734
WebRoot/jsp/whp/test/WhpSamplingPlanTaskTestConfirmEditTest.jsp
Normal file
@ -0,0 +1,734 @@
|
||||
<!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">
|
||||
|
||||
// {
|
||||
// field: 'containerCode', // 返回json数据中的name
|
||||
// title: '容器编号', // 表格表头显示文字
|
||||
// align: 'center', // 左右居中
|
||||
// valign: 'middle',
|
||||
// colspan: 1,
|
||||
// rowspan: 2
|
||||
// }, {
|
||||
// title: '容器重', // 表格表头显示文字
|
||||
// align: 'center', // 左右居中
|
||||
// valign: 'middle',
|
||||
// colspan: 3,
|
||||
// rowspan: 1
|
||||
// }, {
|
||||
// title: '容器重+被测物重M2(g)', // 表格表头显示文字
|
||||
// align: 'center', // 左右居中
|
||||
// valign: 'middle',
|
||||
// colspan: 3,
|
||||
// rowspan: 1
|
||||
// }, {
|
||||
// field: 'diffValue', // 返回json数据中的name
|
||||
// title: '差值(g)M2-M1', // 表格表头显示文字
|
||||
// align: 'center', // 左右居中
|
||||
// valign: 'middle',
|
||||
// colspan: 1,
|
||||
// rowspan: 2
|
||||
// }, {
|
||||
// field: 'resultValue', // 返回json数据中的name
|
||||
// title: '结果(mg/L)', // 表格表头显示文字
|
||||
// align: 'center', // 左右居中
|
||||
// valign: 'middle',
|
||||
// colspan: 1,
|
||||
// rowspan: 2
|
||||
// },
|
||||
function initTableData1() {
|
||||
|
||||
var tablehead = ${tableheaders}
|
||||
|
||||
$("#tableFunList1").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/whp/test/WhpSamplingPlanTaskTestItem/getListyp.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, // 排序规则
|
||||
testConfirmId: '${bean.id}',
|
||||
unitId: unitId
|
||||
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
//detailView: true,//父子表
|
||||
columns: [
|
||||
{
|
||||
field: 'sampleCode', // 返回json数据中的name
|
||||
title: '样品编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
|
||||
},
|
||||
...tablehead,
|
||||
{
|
||||
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="addPXFY(\'' + row.id + '\')"><i class="fa fa-plus"></i><span class="hidden-md hidden-lg"> 平行飞样</span></button>';
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
],
|
||||
// [{
|
||||
// field: 'containerWeightFirst', // 返回json数据中的name
|
||||
// title: '第一次', // 表格表头显示文字
|
||||
// align: 'center', // 左右居中
|
||||
// valign: 'middle'
|
||||
// }, {
|
||||
// field: 'containerWeightSecond', // 返回json数据中的name
|
||||
// title: '第二次', // 表格表头显示文字
|
||||
// align: 'center', // 左右居中
|
||||
// valign: 'middle'
|
||||
// }, {
|
||||
// field: 'containerWeightFinal', // 返回json数据中的name
|
||||
// title: '最终值', // 表格表头显示文字
|
||||
// align: 'center', // 左右居中
|
||||
// valign: 'middle'
|
||||
// }, {
|
||||
// field: 'allWeightFirst', // 返回json数据中的name
|
||||
// title: '第一次', // 表格表头显示文字
|
||||
// align: 'center', // 左右居中
|
||||
// valign: 'middle'
|
||||
// }, {
|
||||
// field: 'allWeightSecond', // 返回json数据中的name
|
||||
// title: '第二次', // 表格表头显示文字
|
||||
// align: 'center', // 左右居中
|
||||
// valign: 'middle'
|
||||
// }, {
|
||||
// field: 'allWeightFinal', // 返回json数据中的name
|
||||
// title: '最终值', // 表格表头显示文字
|
||||
// align: 'center', // 左右居中
|
||||
// valign: 'middle'
|
||||
// }]
|
||||
|
||||
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("tableFunList1");
|
||||
<%--console.log('${bean}')--%>
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function addPXFY(id) {
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: ext.contextPath + "/whp/test/WhpSamplingPlanTaskTestItem/addPXFY.do",
|
||||
async: false,
|
||||
globle: false,
|
||||
data: {
|
||||
id: id,
|
||||
testConfirmId: '${bean.id}'
|
||||
},
|
||||
dataType: 'json',
|
||||
error: function () {
|
||||
return false;
|
||||
},
|
||||
success: function (data) {
|
||||
if (data.code == 1) {
|
||||
$("#tableFunList1").bootstrapTable('refresh');
|
||||
} else if (data.code == 0) {
|
||||
showAlert('d', data.msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(function () {
|
||||
<%--console.log(${tableheaders});--%>
|
||||
|
||||
initTableData1()
|
||||
|
||||
|
||||
// var name = $("#status").val();
|
||||
// if (name===2){
|
||||
// $("#confirm").show();
|
||||
// }else {
|
||||
// $("#confirm").hide();
|
||||
// }
|
||||
conditionDropDownmethod()
|
||||
conditionDropDownequipmentName()
|
||||
|
||||
var nowDate = new Date()
|
||||
var year = nowDate.getFullYear()
|
||||
var month = nowDate.getMonth() + 1
|
||||
var day = nowDate.getDate()
|
||||
var fullYear = year + '-' + month + '-' + day
|
||||
$("#testDate").val(fullYear)
|
||||
//计划采样日期
|
||||
$("#testDate").datepicker({
|
||||
language: 'zh-CN',
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'yyyy-mm-dd',
|
||||
});
|
||||
|
||||
});
|
||||
//列表编辑弹窗
|
||||
var editFun = function (id) {
|
||||
$("#addForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#addForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/whp/test/WhpSamplingPlanTaskTestItem/edit.do', {
|
||||
itemid: id,
|
||||
unitId: unitId,
|
||||
testDate: $("#testDate").val(),
|
||||
temperature: $("#temperature").val(),
|
||||
reagent: $("#reagent").val(),
|
||||
equipmentId: $("#equipmentId").val(),
|
||||
equipmentCode: $("#equipmentCode").val(),
|
||||
testAddress: $("#testAddress").val(),
|
||||
id: '${bean.id}',
|
||||
edittype: 0
|
||||
}, function (data) {
|
||||
$("#subEditDiv").html(data);
|
||||
openModal('subEdit');
|
||||
});
|
||||
}
|
||||
};
|
||||
//删除
|
||||
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/test/WhpSamplingPlanTaskTestItem/deletes.do', {ids: id}, function (data) {
|
||||
if (data.code === 1) {
|
||||
$("#tableFunList1").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
}, "json");
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
function updataList() {
|
||||
// console.log($("#addForm").serialize());
|
||||
$("#addForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#addForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
var formData = new FormData($("#addForm")[0]);
|
||||
|
||||
$.ajax({
|
||||
url: ext.contextPath + "/whp/test/WhpSamplingPlanTaskTestConfirm/update.do",
|
||||
type: 'POST',
|
||||
data: formData,
|
||||
async: false,
|
||||
cache: false,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
|
||||
if (data.code == 1) {
|
||||
$("#tableTask").bootstrapTable('refresh');
|
||||
// closeModal('subModal');
|
||||
closeModal('subModal1');
|
||||
|
||||
//ininnext();
|
||||
|
||||
} else {
|
||||
showAlert('d', '保存失败!' + data.msg);
|
||||
}
|
||||
},
|
||||
error: function (data) {
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function updataFunList() {
|
||||
// console.log($("#addForm").serialize());
|
||||
$("#addForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#addForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
var formData = new FormData($("#addForm")[0]);
|
||||
|
||||
$.ajax({
|
||||
url: ext.contextPath + "/whp/test/WhpSamplingPlanTaskTestConfirm/submit.do",
|
||||
type: 'POST',
|
||||
data: formData,
|
||||
async: false,
|
||||
cache: false,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
|
||||
if (data.code == 1) {
|
||||
$("#tableTask").bootstrapTable('refresh');
|
||||
closeModal('subModal1');
|
||||
|
||||
} else {
|
||||
showAlert('d', '保存失败!' + data.msg);
|
||||
}
|
||||
},
|
||||
error: function (data) {
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
//方法依据下拉
|
||||
function conditionDropDownmethod() {
|
||||
var select_Data = jQuery.parseJSON('${itemMethodDropDown}');
|
||||
var select_3 = $("#method").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('${bean.method}').trigger("change");
|
||||
}
|
||||
|
||||
//仪器名称下拉
|
||||
function conditionDropDownequipmentName() {
|
||||
|
||||
var selelct_1Data = jQuery.parseJSON('${equipmentDropDown}');
|
||||
console.log('${equipmentDropDown}')
|
||||
<%--console.log('${bean}')--%>
|
||||
var selelct_1 = $("#equipmentId").select2({
|
||||
data: selelct_1Data,
|
||||
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'});
|
||||
// selelct_1.val('').trigger("change");
|
||||
selelct_1.on("change", function (e) {
|
||||
deptChange();
|
||||
});
|
||||
selelct_1.val(selelct_1Data[0].id).trigger("change")
|
||||
}
|
||||
|
||||
//仪器编号刷新
|
||||
function deptChange() {
|
||||
var type = $("#equipmentId").val();
|
||||
$.get(ext.contextPath + "/whp/baseinfo/WhpEquipment/getOne?id=" + type, function (data) {
|
||||
|
||||
$("#equipmentCode").val(data.result.code);
|
||||
$("#equipmentName").val(data.result.name);
|
||||
}, 'json');
|
||||
}
|
||||
|
||||
//审核结果
|
||||
function typeConditionDropDownList() {
|
||||
var select_Data = jQuery.parseJSON('${workCurveDropDown}');
|
||||
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 saveContantVal(id, itemid) {
|
||||
var contval = $("#contantid_" + itemid).val();
|
||||
|
||||
$.ajax({
|
||||
url: ext.contextPath + "/whp/test/WhpTaskItemCurve/update.do?id=" + id + "&calculated_value=" + contval + '&plan_code=${bean.planCode}&working_curve_id=' + itemid,
|
||||
type: 'POST',
|
||||
|
||||
async: false,
|
||||
cache: false,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
|
||||
|
||||
},
|
||||
error: function (data) {
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
$("#addForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
samplingDate: {
|
||||
trigger: "change",
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '检测日期不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
temperature: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '室温不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
reagent: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '使用试剂不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
// method: {
|
||||
// validators: {
|
||||
// notEmpty: {
|
||||
// message: '方法依据不能为空'
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
/* workCurveName: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '工作曲线不能为空'
|
||||
}
|
||||
}
|
||||
},*/
|
||||
equipmentId: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '仪器名称不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
equipmentCode: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '仪器编号不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
testAddress: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '测定地点不能为空'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModal1">
|
||||
<div class="modal-dialog " style="width: 80%">
|
||||
<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-11 col-xs-13">
|
||||
<!-- 新增界面formid强制为editForm -->
|
||||
<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 -->
|
||||
|
||||
<input type="hidden" name="id" id="id" class="form-control" value="${bean.id}">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 采样单编号:</label>
|
||||
<div class="col-sm-2">
|
||||
<p class="form-control-static">${bean.planCode}</p>
|
||||
<input name="planCode" type="hidden"
|
||||
style="margin-top: 15px" value="${bean.planCode}" class="form-control"/>
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">* 采样单类型:</label>
|
||||
<div class="col-sm-2">
|
||||
<p class="form-control-static">${bean.sampleTypeName}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">* 检测项目:</label>
|
||||
<div class="col-sm-2">
|
||||
<p class="form-control-static">${bean.testItemName}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 检测人员:</label>
|
||||
<div class="col-sm-2">
|
||||
<p class="form-control-static">${bean.testUserName}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">* 检测日期:</label>
|
||||
<div class="col-sm-2 ">
|
||||
<div class="input-group date">
|
||||
<div class="input-group-addon">
|
||||
<i class="fa fa-calendar"></i>
|
||||
</div>
|
||||
<input type="text" class="form-control" id="testDate" name="testDate"
|
||||
value="${bean.samplingDate.substring(0,10)} "/>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 室温(℃):</label>
|
||||
<div class="col-sm-2">
|
||||
<input type="text" class="form-control" id="temperature" name="temperature"
|
||||
value="${bean.temperature} "/>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">* 使用试剂:</label>
|
||||
<div class="col-sm-2">
|
||||
<input type="text" class="form-control" id="reagent" name="reagent"
|
||||
value="${bean.reagent} "/>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">* 方法依据:</label>
|
||||
<div class="col-sm-2">
|
||||
<input type="text" style="width: 100%;" name="method" id="method"
|
||||
class="form-control">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*工作曲线:</label>
|
||||
<div class="col-sm-10">
|
||||
<input id="workCurveName" name="workCurveName" type="text" readonly
|
||||
value="${bean.workCurveName}" class="form-control"/>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group" id="cont">
|
||||
<c:forEach items="${bean.contantworkingCurveVoslist}" var="item" varStatus="status">
|
||||
|
||||
<label style="margin-top: 13px;"
|
||||
class="col-sm-2 control-label">${item.MPoint.parmname}</label>
|
||||
<div class="col-sm-2">
|
||||
<input id="contantid_${item.id}"
|
||||
name="contantCurvelist[${status.index}].calculated_value" type="text"
|
||||
value="${item.default_value}"
|
||||
style="margin-top: 15px" class="form-control"
|
||||
onblur="saveContantVal('${item.taskitemCureid}','${item.id}')"/>
|
||||
<input id="contantvalue_${item.id}"
|
||||
name="contantCurvelist[${status.index}].working_curve_id" type="hidden"
|
||||
style="margin-top: 1px" value="${item.id}" class="form-control"/>
|
||||
<input id="contantvalue_${item.id}" name="contantCurvelist[${status.index}].id"
|
||||
type="hidden"
|
||||
style="margin-top: 15px" value="${item.taskitemCureid}"
|
||||
class="form-control"/>
|
||||
${item.MPoint.unit}
|
||||
</div>
|
||||
|
||||
</c:forEach>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 仪器名称:</label>
|
||||
<div class="col-sm-2">
|
||||
<select class="form-control select2" name="equipmentId"
|
||||
id="equipmentId"
|
||||
style="width:176px;height: 30px">
|
||||
</select>
|
||||
<input id="equipmentName" name="equipmentName" type="hidden" class="form-control"/>
|
||||
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">* 仪器编号:</label>
|
||||
<div class="col-sm-2">
|
||||
<input type="text" class="form-control" id="equipmentCode" name="equipmentCode"
|
||||
value="${bean.equipmentCode} "/>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">* 测定地点:</label>
|
||||
<div class="col-sm-2">
|
||||
<input type="text" class="form-control" id="testAddress" name="testAddress"
|
||||
value="${bean.testAddress} "/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<c:if test="${bean.confirmDate!=''}">
|
||||
<div class="form-group" id="confirm">
|
||||
<label class="col-sm-2 control-label">* 复核人:</label>
|
||||
<div class="col-sm-2">
|
||||
<p class="form-control-static"> ${bean.confirmUserName}</p>
|
||||
<input type="hidden" class="form-control" id="confirmUserId"
|
||||
name="confirmUserId"
|
||||
value="${bean.confirmUserId} "/>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">* 复核日期:</label>
|
||||
<div class="col-sm-2 ">
|
||||
<p class="form-control-static">${bean.confirmDate.substring(0,10)}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">* 复核结果:</label>
|
||||
<div class="col-sm-2">
|
||||
<input type="text" class="form-control" id="status" name="status"
|
||||
value="${bean.status}" readonly style="border: none"/>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">* 复核意见:</label>
|
||||
<div class="col-sm-2">
|
||||
<input type="text" class="form-control" id="confirmAdvice" name="confirmAdvice"
|
||||
value="${bean.confirmAdvice} " style="border: none"/>
|
||||
<%-- <p class="form-control-static">${bean.status}</p>--%>
|
||||
</div>
|
||||
</div>
|
||||
</c:if>
|
||||
<c:if test="${bean.confirmDate==''}">
|
||||
|
||||
<div class="form-group" id="confirm">
|
||||
<label class="col-sm-2 control-label">* 复核人:</label>
|
||||
<div class="col-sm-2">
|
||||
<p class="form-control-static"></p>
|
||||
<input type="hidden" class="form-control" id="" name="confirmUserId"
|
||||
value="${bean.confirmUserId} "/>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">* 复核日期:</label>
|
||||
<div class="col-sm-2 ">
|
||||
<p class="form-control-static"></p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">* 复核结果:</label>
|
||||
<div class="col-sm-2">
|
||||
<p class="form-control-static"></p>
|
||||
<input type="hidden" class="form-control" name="status"
|
||||
value="${bean.status}" readonly style="border: none"/>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">* 复核意见:</label>
|
||||
<div class="col-sm-2">
|
||||
<p class="form-control-static"></p>
|
||||
<%-- <p class="form-control-static">${bean.status}</p>--%>
|
||||
</div>
|
||||
</div>
|
||||
</c:if>
|
||||
</form>
|
||||
<table id="tableFunList1"></table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer" style="padding: 15px">
|
||||
<button type="button" class="btn btn-default " data-dismiss="modal">关闭
|
||||
</button>
|
||||
<button type="button" class="btn btn-primary " style="margin-left: 10px"
|
||||
onclick="updataList()">保存
|
||||
</button>
|
||||
<button type="button" class="btn btn-primary " style="margin-left: 10px"
|
||||
onclick="updataFunList()">保存并提交
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
435
WebRoot/jsp/whp/test/WhpSamplingPlanTaskTestConfirmViewTest.jsp
Normal file
435
WebRoot/jsp/whp/test/WhpSamplingPlanTaskTestConfirmViewTest.jsp
Normal file
@ -0,0 +1,435 @@
|
||||
<!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;
|
||||
|
||||
}
|
||||
|
||||
.select2-container--default .select2-selection--single {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.select2-container--default .select2-selection--single, .select2-selection .select2-selection--single {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.select2-container--default .select2-selection--single .select2-selection__arrow b {
|
||||
border: none;
|
||||
border-style: unset
|
||||
}
|
||||
|
||||
.select2-container--default.select2-container--disabled .select2-selection--single {
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
.right {
|
||||
margin-left: 50px;
|
||||
}
|
||||
|
||||
.sampleAmountView {
|
||||
color: black;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
// console.log(${bean.method})
|
||||
initTableViewList();
|
||||
|
||||
$("#confirmDate").datetimepicker({
|
||||
// startDate: date,
|
||||
language: 'zh-CN',
|
||||
format: 'yyyy-mm-dd',
|
||||
startView: "month", //初始化视图是‘年’
|
||||
minView: 1,
|
||||
maxView: "year",
|
||||
autoclose: true
|
||||
// todayBtn: "linked"
|
||||
});
|
||||
|
||||
conditionDropDownStatus()
|
||||
conditionDropDownmethod()
|
||||
|
||||
});
|
||||
|
||||
function initTableViewList() {
|
||||
var tableheadview = ${tableheaders}
|
||||
$("#tableView").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/whp/test/WhpSamplingPlanTaskTestItem/getListyp.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,
|
||||
testConfirmId: '${bean.id}',
|
||||
unitId: unitId
|
||||
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
//detailView: true,//父子表
|
||||
columns: [{
|
||||
field: 'sampleCode', // 返回json数据中的name
|
||||
title: '样品编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
|
||||
},
|
||||
...tableheadview
|
||||
],
|
||||
|
||||
onLoadSuccess: function (data) { //加载成功时执行
|
||||
adjustBootstrapTableView("tableView");
|
||||
|
||||
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function selectChange1(val, id, index) {
|
||||
}
|
||||
|
||||
// 检验审核人
|
||||
function selectdutyUser() {
|
||||
$.post(ext.contextPath + '/user/userForOneSelect.do',
|
||||
{
|
||||
formId: "editForm",
|
||||
hiddenId: "auditUserId",
|
||||
textId: "auditUserName"
|
||||
},
|
||||
function (data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal('user4SelectModal');
|
||||
});
|
||||
};
|
||||
|
||||
function updateSaveFun() {
|
||||
$("#editForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#editForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
var formData = new FormData($("#editForm")[0]);
|
||||
$.ajax({
|
||||
url: ext.contextPath + "/whp/test/WhpSamplingPlanTaskTestConfirm/update.do",
|
||||
type: 'POST',
|
||||
data: formData,
|
||||
async: false,
|
||||
cache: false,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
if (data.code == 1) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
closeModal('subModal');
|
||||
} else {
|
||||
showAlert('d', '保存失败!' + data.msg);
|
||||
}
|
||||
},
|
||||
error: function (data) {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function submitSaveFun() {
|
||||
$("#editForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#editForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
var formData = new FormData($("#editForm")[0]);
|
||||
$.ajax({
|
||||
url: ext.contextPath + "/whp/test/WhpSamplingPlanTaskTestConfirm/confirm.do",
|
||||
type: 'POST',
|
||||
data: formData,
|
||||
async: false,
|
||||
cache: false,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
if (data.code == 1) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
closeModal('subModal');
|
||||
} else {
|
||||
showAlert('d', '保存失败!' + data.msg);
|
||||
}
|
||||
},
|
||||
error: function (data) {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
// 检验审核人
|
||||
function selectdutyUser() {
|
||||
$.post(ext.contextPath + '/user/userForOneSelect.do',
|
||||
{
|
||||
formId: "editForm",
|
||||
hiddenId: "confirmUserId",
|
||||
textId: "confirmUserName"
|
||||
},
|
||||
function (data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal('user4SelectModal');
|
||||
});
|
||||
};
|
||||
|
||||
//方法依据下拉
|
||||
function conditionDropDownmethod() {
|
||||
var select_Data = jQuery.parseJSON('${itemMethodDropDown}');
|
||||
var select_3 = $("#method").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('${bean.method}').trigger("change");
|
||||
}
|
||||
|
||||
function conditionDropDownStatus() {
|
||||
var select_Data = jQuery.parseJSON('${confirmStatusDropDown}');
|
||||
var select_3 = $("#status").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('${bean.status}').trigger('change');
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog " style="width: 80%">
|
||||
<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 -->
|
||||
|
||||
<input type="hidden" name="id" id="id" class="form-control" value="${bean.id}">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label"> 采样单编号:</label>
|
||||
<div class="col-sm-2">
|
||||
<p class="form-control-static">${bean.planCode}</p>
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label"> 采样类型:</label>
|
||||
<div class="col-sm-2">
|
||||
<p class="form-control-static">${bean.sampleTypeName}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label"> 检测项目:</label>
|
||||
<div class="col-sm-2">
|
||||
<p class="form-control-static">${bean.testItemName}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 检测人员:</label>
|
||||
<div class="col-sm-2">
|
||||
<p class="form-control-static">${bean.testUserName}</p>
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">* 检测日期:</label>
|
||||
<div class="col-sm-2">
|
||||
<p class="form-control-static">${bean.testDate.substring(0,10)}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 室温(℃):</label>
|
||||
<div class="col-sm-2">
|
||||
<p class="form-control-static">${bean.temperature}</p>
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">使用试剂:</label>
|
||||
<div class="col-sm-2">
|
||||
<p class="form-control-static">${bean.reagent}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label"> 方法依据:</label>
|
||||
<div class="col-sm-2">
|
||||
<%-- <p class="form-control-static">${bean.method}</p>--%>
|
||||
|
||||
<input type="text" style="width: 100%;border: none;" disabled="true" name="method"
|
||||
id="method">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 工作曲线:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${bean.workCurveName}</p>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-group" id="cont">
|
||||
<c:forEach items="${bean.contantworkingCurveVoslist}" var="item" varStatus="status">
|
||||
|
||||
<label style=""
|
||||
class="col-sm-2 control-label">${item.MPoint.parmname}</label>
|
||||
<div class="col-sm-2">
|
||||
<p class="form-control-static">${item.default_value} ${item.MPoint.unit}</p>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</c:forEach>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">状态:</label>
|
||||
<div class="col-sm-2">
|
||||
<%-- <p class="form-control-static">${bean.sampleTypeName}</p>--%>
|
||||
<select class="form-control select2" name="status"
|
||||
id="status"
|
||||
disabled="disabled"
|
||||
style="width:180px;height: 30px">
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">仪器名称:</label>
|
||||
<div class="col-sm-2">
|
||||
<p class="form-control-static">${bean.equipmentName}</p>
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">* 仪器编号:</label>
|
||||
<div class="col-sm-2">
|
||||
<p class="form-control-static">${bean.equipmentCode}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">* 测定地点:</label>
|
||||
<div class="col-sm-2">
|
||||
<p class="form-control-static">${bean.testAddress}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">复核人:</label>
|
||||
<div class="col-sm-2">
|
||||
<p class="form-control-static">${bean.confirmUserName}</p>
|
||||
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">复核日期:</label>
|
||||
<div class="col-sm-2">
|
||||
<p class="form-control-static">${bean.confirmDate.substring(0,10)}</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
||||
<label class="col-sm-2 control-label">复核意见:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${bean.confirmAdvice}</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">审核人:</label>
|
||||
<div class="col-sm-2">
|
||||
<p class="form-control-static">${plan.auditUserName}</p>
|
||||
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">审核日期:</label>
|
||||
<div class="col-sm-2">
|
||||
<p class="form-control-static">${plan.auditTime.substring(0,10)}</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
||||
<label class="col-sm-2 control-label">审核意见:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${plan.auditAdvice}</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</form>
|
||||
<table id="tableView"></table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer" style="padding: 15px">
|
||||
<button type="button" class="btn btn-default " data-dismiss="modal">关闭
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
|
||||
739
WebRoot/jsp/whp/test/WhpSamplingPlanTaskTestItemEdit.jsp
Normal file
739
WebRoot/jsp/whp/test/WhpSamplingPlanTaskTestItemEdit.jsp
Normal file
@ -0,0 +1,739 @@
|
||||
<%@ 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="java.math.BigDecimal" %>
|
||||
<!DOCTYPE html>
|
||||
|
||||
<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;
|
||||
|
||||
}
|
||||
|
||||
.has-error .checkbox, .has-error .checkbox-inline, .has-error .control-label, .has-error .help-block, .has-error .radio, .has-error .radio-inline, .has-error.checkbox label, .has-error.checkbox-inline label, .has-error.radio label, .has-error.radio-inline labe {
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.form-group.has-error .help-block {
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.help-block {
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.select2-container--default .select2-selection--single {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.select2-container--default .select2-selection--single, .select2-selection .select2-selection--single {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.select2-container--default .select2-selection--single .select2-selection__arrow b {
|
||||
border: none;
|
||||
border-style: unset
|
||||
}
|
||||
|
||||
.select2-container--default.select2-container--disabled .select2-selection--single {
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
.right {
|
||||
margin-left: 50px;
|
||||
}
|
||||
|
||||
.buttonclass {
|
||||
background-color: #ffffff;
|
||||
color: black;
|
||||
border-color: gray;
|
||||
/* height: 30px;*/
|
||||
width: 58px;
|
||||
}
|
||||
|
||||
.modal-footer {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#progressBar {
|
||||
width: 100%;
|
||||
height: 10px;
|
||||
background-color: #f2f2f2;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#progressBar .bar {
|
||||
height: 100%;
|
||||
background: #007bff;
|
||||
position: absolute;
|
||||
width: 0;
|
||||
transition: width 0.3s ease;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
var basiCurveslist;//基础描述
|
||||
var processCurveslist;//过程公式
|
||||
var contantCurveslist;//常量
|
||||
var curve;//结果公式
|
||||
var bean;//样品信息
|
||||
var confirmStr;
|
||||
var submitNum = 0;
|
||||
|
||||
$(function () {
|
||||
|
||||
initconfirm();
|
||||
inittest();
|
||||
|
||||
});
|
||||
|
||||
function showWaitTipFn() {//显示加载进度条
|
||||
$(".loadingWord").css({'display': 'block'});
|
||||
$(".showbox").stop(true).animate({'margin-top': '300px', 'opacity': '1'}, 200);
|
||||
}
|
||||
|
||||
function hideWaitTipFn() {//隐藏进度条
|
||||
$(".loadingWord").css({'display': 'none'});
|
||||
$(".showbox").stop(true).animate({'margin-top': '250px', 'opacity': '0'}, 400);
|
||||
}
|
||||
|
||||
// 模拟长时间处理的操作
|
||||
function simulateLongOperation() {
|
||||
var progressBar = document.getElementById("progressBar");
|
||||
var bar = progressBar.querySelector(".bar");
|
||||
|
||||
progressBar.style.display = "block";
|
||||
bar.style.width = "0";
|
||||
|
||||
var totalProgress = 100; // 总进度
|
||||
var currentProgress = 0; // 当前进度
|
||||
|
||||
var intervalId = setInterval(function () {
|
||||
if (currentProgress >= totalProgress) {
|
||||
progressBar.style.display = "none";
|
||||
clearInterval(intervalId);
|
||||
} else {
|
||||
currentProgress++;
|
||||
bar.style.width = (currentProgress / totalProgress * 100) + "%";
|
||||
}
|
||||
}, 5);
|
||||
}
|
||||
|
||||
function loadData(dataId) {
|
||||
var str = "< img src='WebRoot/IMG/img_v2_b66251dc-e249-45f3-b3c7-d47e709a52fg.gif'> <font color=red>数据加载中...</font>";
|
||||
if (dataId != "") {
|
||||
document.getElementById(dataId).innerHTML = str;
|
||||
}
|
||||
}
|
||||
|
||||
function initconfirm() {
|
||||
confirmStr =
|
||||
" <input type=\"hidden\" name=\"testDate\" id=\"testDate\" class=\"form-control\" value=\"${confirm.testDate}\">" +
|
||||
" <input type=\"hidden\" name=\"temperature\" id=\"temperature\" class=\"form-control\" value=\"${confirm.temperature}\">" +
|
||||
" <input type=\"hidden\" name=\"reagent\" id=\"reagent\" class=\"form-control\" value=\"${confirm.reagent}\">" +
|
||||
" <input type=\"hidden\" name=\"equipmentId\" id=\"equipmentId\" class=\"form-control\" value=\"${confirm.equipmentId}\">" +
|
||||
" <input type=\"hidden\" name=\"equipmentCode\" id=\"equipmentCode\" class=\"form-control\" value=\"${confirm.equipmentCode}\">" +
|
||||
" <input type=\"hidden\" name=\"testConfirmId\" id=\"testConfirmId\" class=\"form-control\" value=\"${confirm.id}\">" +
|
||||
" <input type=\"hidden\" name=\"testAddress\" id=\"testAddress\" class=\"form-control\" value=\"${confirm.testAddress}\">";
|
||||
}
|
||||
|
||||
function initbtn(type) {
|
||||
var btndtr = "";
|
||||
// data-dismiss="modal"
|
||||
btndtr += "<button type=\"button\" class=\"btn btn-default \" onclick='closeModel()' >关闭 </button> ";
|
||||
if (type == 0) {
|
||||
btndtr += " <button type=\"button\" class=\"btn btn-primary \" style=\"margin-left: 10px\" onclick=\"updataList7()\">保存并提交 </button> "
|
||||
} else {
|
||||
|
||||
|
||||
btndtr += " <button type=\"button\" class=\"btn btn-primary \" style=\"margin-left: 10px\" onclick=\"updataList6()\">保存 </button> "
|
||||
}
|
||||
$("#btndiv").html(btndtr);
|
||||
|
||||
}
|
||||
|
||||
var listcount;
|
||||
|
||||
function inittest() {
|
||||
|
||||
$.ajax({
|
||||
url: ext.contextPath + "/whp/test/WhpSamplingPlanTaskTestItem/doNextedit.do?id=${itemid}&unitId=${unitId}",
|
||||
type: 'POST',
|
||||
|
||||
async: false,
|
||||
cache: false,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
if (data.code == 0) {
|
||||
inintdata(data)
|
||||
listcount = data.listcount;
|
||||
initbtn(data.listcount)
|
||||
} else {
|
||||
// closeModal('subEdit');
|
||||
|
||||
}
|
||||
},
|
||||
error: function (data) {
|
||||
// console.log(data+"fffff")
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function nexttest() {
|
||||
|
||||
var formData = new FormData($("#editForm")[0]);
|
||||
$.ajax({
|
||||
url: ext.contextPath + "/whp/test/WhpSamplingPlanTaskTestItem/doNextedit.do",
|
||||
type: 'POST',
|
||||
data: formData,
|
||||
async: false,
|
||||
async: false,
|
||||
cache: false,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
if (data.code == 0) {
|
||||
inintdata(data)
|
||||
listcount = data.listcount;
|
||||
initbtn(data.listcount)
|
||||
} else {
|
||||
closeModal('subEdit');
|
||||
|
||||
}
|
||||
},
|
||||
error: function (data) {
|
||||
// console.log(data+"fffff")
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
function inintdata(data) {
|
||||
basiCurveslist = data.basiCurveslist;//基础描述
|
||||
processCurveslist = data.processCurveslist;//过程公式
|
||||
contantCurveslist = data.contantCurveslist;//常量
|
||||
curve = data.curve;//结果公式
|
||||
bean = data.bean;//样品信息
|
||||
let htmlstr = "";
|
||||
|
||||
htmlstr += "<form class=\"form-horizontal\" id=\"editForm\" enctype=\"multipart/form-data\">" +
|
||||
" <div id=\"alertDiv\"></div>" +
|
||||
" <!-- 界面提醒div强制id为alertdiv -->" +
|
||||
confirmStr +
|
||||
" <input type=\"hidden\" name=\"id\" id=\"id\" class=\"form-control\" value=\"" + bean.id + "\">" +
|
||||
" <input type=\"hidden\" name=\"planCode\" id=\"planCode\" class=\"form-control\"" +
|
||||
" value=\"" + bean.planCode + "\">" +
|
||||
" <input type=\"hidden\" name=\"sampleCode\" id=\"sampleCode\" class=\"form-control\"" +
|
||||
" value=\"" + bean.sampleCode + "\">" +
|
||||
" <input type=\"hidden\" name=\"testItemId\" id=\"testItemId\" class=\"form-control\"" +
|
||||
" value=\"" + bean.testItemId + "\">" +
|
||||
" <input type=\"hidden\" name=\"unitId\" id=\"unitId\" class=\"form-control\"" +
|
||||
" value=\"" + unitId + "\">" +
|
||||
" <div class=\"form-group\">" +
|
||||
" <label class=\"col-sm-2 control-label\"> 采样单编号</label>" +
|
||||
" <div class=\"col-sm-2\">" +
|
||||
" <p class=\"form-control-static\">" + bean.planCode + "</p>" +
|
||||
" </div>" +
|
||||
" <label class=\"col-sm-2 control-label\"> 检测项目</label>" +
|
||||
" <div class=\"col-sm-2\">" +
|
||||
" <p class=\"form-control-static\">" + bean.testItemName + "</p>" +
|
||||
" </div>" +
|
||||
" <label class=\"col-sm-2 control-label\"> 结果公式</label>" +
|
||||
" <div class=\"col-sm-2\">" +
|
||||
" <p class=\"form-control-static\">" + bean.workCurveName + "</p>" +
|
||||
" </div>" +
|
||||
" </div>" +
|
||||
" <div class=\"form-group\">" +
|
||||
" <label class=\"col-sm-2 control-label\"> 样品编号</label>" +
|
||||
" <div class=\"col-sm-2\">" +
|
||||
" <p class=\"form-control-static\">" + bean.sampleCode + "</p>" +
|
||||
" </div>" +
|
||||
" </div>";
|
||||
|
||||
htmlstr += " <div class=\"form-group\" id=\"cont\">";
|
||||
for (var i = 0; i < basiCurveslist.length; i++) {
|
||||
|
||||
htmlstr += " <label style=\"margin-top: 13px;\"" +
|
||||
" class=\"col-sm-2 control-label\">" + basiCurveslist[i].name + "</label>" +
|
||||
" <div class=\"col-sm-2\">" +
|
||||
" <input id=\"contantid_" + basiCurveslist[i].id + "\"" +
|
||||
" name=\"basicCurvelist[" + i + "].calculated_value\" type=\"text\"" +
|
||||
" value=\"" + basiCurveslist[i].default_value + "\" required=\"true\"" +
|
||||
" style=\"margin-top: 15px\" class=\"form-control\"/>" +
|
||||
" <input id=\"contantvalue_" + basiCurveslist[i].id + "\"" +
|
||||
" name=\"basicCurvelist[" + i + "].working_curve_id\" type=\"hidden\"" +
|
||||
" style=\"margin-top: 1px\" value=\"" + basiCurveslist[i].id + "\" class=\"form-control\"/>" +
|
||||
" <input id=\"contantvalue_" + basiCurveslist[i].id + "\" name=\"basicCurvelist[" + i + "].id\"" +
|
||||
" type=\"hidden\"" +
|
||||
" style=\"margin-top: 15px\" value=\"" + basiCurveslist[i].taskitemCureid + "\"" +
|
||||
" class=\"form-control\"/>" +
|
||||
" <span style=\"margin-left: 12em;margin-top: -2em;position: absolute\">" + basiCurveslist[i].unit + "</span>" +
|
||||
" </div>";
|
||||
|
||||
}
|
||||
// 有数据才显示
|
||||
let length = contantCurveslist.length;
|
||||
if (length > 0) {
|
||||
htmlstr += " </div>" +
|
||||
" <div class=\"form-group\" >" +
|
||||
" <label class=\"col-sm-2 control-label\"> 常量:</label>" +
|
||||
" </div>" +
|
||||
" <div class=\"form-group\">";
|
||||
}
|
||||
|
||||
console.log("contantCurveslistcontantCurveslistcontantCurveslist", contantCurveslist)
|
||||
for (var i = 0; i < contantCurveslist.length; i++) {
|
||||
contantCurveslist[i].default_value = contantCurveslist[i].defaultValue
|
||||
|
||||
|
||||
htmlstr += " <label style=\"margin-top: 13px;\"" +
|
||||
" class=\"col-sm-2 control-label\">" + contantCurveslist[i].mPoint.disname + "</label>" +
|
||||
" <div class=\"col-sm-2\">" +
|
||||
" <input id=\"contantid_" + contantCurveslist[i].id + "\"" +
|
||||
" name=\"contantCurvelist[" + i + "].parmvalue\" type=\"text\"" +
|
||||
" value=\"" + contantCurveslist[i].default_value + "\" required=\"true\"" +
|
||||
" style=\"margin-top: 15px\" class=\"form-control\"/>" +
|
||||
" <input id=\"contantvalue_" + contantCurveslist[i].id + "\"" +
|
||||
" name=\"contantCurvelist[" + i + "].mpointcode\" type=\"hidden\"" +
|
||||
" value=\"" + contantCurveslist[i].mPoint.mpointcode + "\" class=\"form-control\"/>" +
|
||||
" <input id=\"contantvalue_" + contantCurveslist[i].id + "\" name=\"contantCurvelist[" + i + "].id\"" +
|
||||
" type=\"hidden\" value=\"" + contantCurveslist[i].taskitemCureid + "\"" +
|
||||
" class=\"form-control\"/>" +
|
||||
contantCurveslist[i].mPoint.unit +
|
||||
" </div>";
|
||||
|
||||
}
|
||||
|
||||
|
||||
htmlstr += " </div>";
|
||||
console.log("processCurveslist", processCurveslist)
|
||||
for (var i = 0; i < processCurveslist.length; i++) {
|
||||
htmlstr += // " <form class=\"form-horizontal\" id=\"processcurve"+i+"\" enctype=\"multipart/form-data\">" +
|
||||
" <div class=\"form-group\">" +
|
||||
" <label class=\"col-sm-4 control-label\"" +
|
||||
" style=\"text-align: left\" >" + processCurveslist[i].mPoint.disname + ":</label>" +
|
||||
" <input type=\"hidden\" class=\"form-control\"" +
|
||||
" name=\"processCurveslist[" + i + "].mpointcode\"" +
|
||||
" value=\"" + processCurveslist[i].mPoint.mpointcode + "\"/>" +
|
||||
" </div>" +
|
||||
" <div class=\"form-group\">";
|
||||
|
||||
// 泥样取样体积
|
||||
for (var j = 0; j < processCurveslist[i].mPoint.mPointPropSource.length; j++) {
|
||||
var formuitem = processCurveslist[i].mPoint.mPointPropSource[j];
|
||||
formuitem.mPoint.parmvalue = formuitem.mPoint.parmvalueStr
|
||||
htmlstr += " <label class=\"col-sm-2 control-label\">" + formuitem.indexDetails + "</label>" +
|
||||
" <div class=\"col-sm-2\">" +
|
||||
" <input type=\"text\" class=\"form-control " + formuitem.mPoint.mpointid + " \" required=\"true\"" +
|
||||
" id=\"processCurveslist[" + i + "].PointFormulalist[" + j + "].id\"" +
|
||||
" name=\"processCurveslist[" + i + "].mPointFormulalist[" + j + "].MPoint.parmvalueStr\"" +
|
||||
" value=\"" + formuitem.mPoint.parmvalueStr + "\" onchange=\"changeValue('processCurveslist[" + i + "].PointFormulalist[" + j + "].id','" + formuitem.mPoint.mpointid + "')\"/>" +
|
||||
" <input type=\"hidden\" class=\"form-control\"" +
|
||||
" name=\"processCurveslist[" + i + "].mPointFormulalist[" + j + "].mpid\"" +
|
||||
" value=\"" + formuitem.mpid + "\"/>" +
|
||||
" </div>";
|
||||
}
|
||||
|
||||
|
||||
htmlstr += " <label class=\"col-sm-2 control-label\" style=\"color: blue\"> " + processCurveslist[i].mPoint.disname + "</label>" +
|
||||
" <div class=\"col-sm-2 modal-footer\" >" +
|
||||
" <input type=\"text\" class=\"form-control\" id=\"" + processCurveslist[i].mPoint.mpointcode + "\"" +
|
||||
// " required=\"true\"" +
|
||||
" name=\"processCurveslist[" + i + "].default_value\" style=\"width: 64%;margin-left: 1em;\"" +
|
||||
" value=\"" + processCurveslist[i].mPoint.remark + " \"/>" +
|
||||
|
||||
" </div>" +
|
||||
" </div>";
|
||||
}
|
||||
console.log("curve", curve)
|
||||
for (var i = 0; i < curve.length; i++) {
|
||||
var item = curve[i];
|
||||
|
||||
htmlstr +=
|
||||
" <div class=\"form-group\">" +
|
||||
" <label class=\"col-sm-4 control-label\" style=\"text-align: left\">" + item.mPoint.disname + " :</label>" +
|
||||
" <input type=\"hidden\" class=\"form-control\"" +
|
||||
" name=\"curves[" + i + "].mpointcode\"" +
|
||||
" value=\"" + item.mPoint.mpointcode + "\"/>" +
|
||||
" </div>" +
|
||||
" <div class=\"form-group\">";
|
||||
|
||||
|
||||
for (var j = 0; j < item.mPoint.mPointPropSource.length; j++) {
|
||||
var formuitem = item.mPoint.mPointPropSource[j];
|
||||
|
||||
htmlstr += " <label class=\"col-sm-2 control-label\">" + formuitem.indexDetails + "</label>" +
|
||||
" <div class=\"col-sm-2\">" +
|
||||
" <input type=\"text\" class=\"form-control\"" +
|
||||
" id=\"curves[" + i + "].PointFormulalist[" + j + "].id\"" +
|
||||
" required=\"true\"" +
|
||||
" name=\"curves[" + i + "].mPointFormulalist[" + j + "].MPoint.parmvalueStr\"" +
|
||||
" value=\"" + formuitem.mPoint.parmvalueStr + "\"/>" +
|
||||
" <input type=\"hidden\" class=\"form-control\"" +
|
||||
" name=\"curves[" + i + "].mPointFormulalist[" + j + "].mpid\"" +
|
||||
" value=\"" + formuitem.mpid + "\"/>" +
|
||||
" </div>";
|
||||
|
||||
}
|
||||
// 结果
|
||||
htmlstr += " <label class=\"col-sm-2 control-label\" style=\"color: blue\"> " + item.mPoint.disname + "</label>" +
|
||||
" <div class=\"col-sm-2 modal-footer\" >" +
|
||||
" <input type=\"text\" class=\"form-control\" id=\"" + item.mPoint.mpointcode + "\" style=\"width: 64%;margin-left: 1em;\"" +
|
||||
" name=\"curves[" + i + "].parmvalueStr\"" +
|
||||
" value=\"" + item.mPoint.parmvalueStr + " \"/>" +
|
||||
" <button id=\"jisuan\" + type=\"button\" onclick=\"formulaClick()\"" +
|
||||
" class=\"btn btn-primary buttonclass\" style=\" margin-top: -4em;margin-left: 10em;\">计 算" +
|
||||
" </button>" +
|
||||
|
||||
" </div>" +
|
||||
" </div>";
|
||||
|
||||
|
||||
}
|
||||
htmlstr += " </form>";
|
||||
|
||||
//替换
|
||||
var reg = new RegExp("undefined", "g");
|
||||
htmlstr = htmlstr.replace(reg, "");
|
||||
$("#contdiv").html(htmlstr);
|
||||
|
||||
|
||||
// for (var j = 0; j < processCurveslist[i].mPoint.mPointPropSource.length; j++) {
|
||||
// var formuitem = processCurveslist[i].mPoint.mPointPropSource[j];
|
||||
// $("." + formuitem.mPoint.mpointid).on("change", function () {
|
||||
// console.log($(this).val())
|
||||
// })
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
function changeValue(id, mpointid) {
|
||||
// console.log(mpointid)
|
||||
// console.log(id)
|
||||
// console.log(document.getElementById(id).value)
|
||||
$("."+mpointid).val(document.getElementById(id).value)
|
||||
}
|
||||
|
||||
function closeModel() {
|
||||
$("#tableFunList1").bootstrapTable('refresh');
|
||||
|
||||
closeModal('subEdit');
|
||||
closeModal('subModal1');
|
||||
$.post(ext.contextPath + '/whp/test/WhpSamplingPlanTaskTestConfirm/showTest.do', {id: bean.testConfirmId}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
// debugger;
|
||||
openModal('subModal1');
|
||||
});
|
||||
}
|
||||
|
||||
function updataList6() {
|
||||
|
||||
//var process =processCurveslist;
|
||||
//console.log(process);
|
||||
// var jsonObj = $.parseJSON(process);
|
||||
// var formids = "#editForm";
|
||||
|
||||
// var curves = curve;
|
||||
|
||||
// console.log("formids=="+formids);
|
||||
$("#editForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#editForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
var formData = new FormData($("#editForm")[0]);
|
||||
|
||||
|
||||
/*for (var i = 0; i < process.length; i++) {
|
||||
|
||||
var datapre = new FormData($("#processcurve" + i)[0]);
|
||||
for (var key of datapre.keys()) {
|
||||
//console.log(datapre.get(key))
|
||||
formData.set(key, datapre.get(key));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
for (var i = 0; i < curves.length; i++) {
|
||||
|
||||
var datapre = new FormData($("#curveeditForm" + i)[0]);
|
||||
|
||||
for (var key of datapre.keys()) {
|
||||
// console.log(datapre.get(key))
|
||||
formData.set(key, datapre.get(key));
|
||||
}
|
||||
|
||||
}
|
||||
*/
|
||||
$.ajax({
|
||||
url: ext.contextPath + "/whp/test/WhpSamplingPlanTaskTestItem/updateResult.do",
|
||||
type: 'POST',
|
||||
data: formData,
|
||||
async: false,
|
||||
cache: false,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
console.log(data)
|
||||
},
|
||||
error: function (data) {
|
||||
// console.log(data+"fffff")
|
||||
}
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
url: ext.contextPath + "/whp/test/WhpSamplingPlanTaskTestItem/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) {
|
||||
$("#tableFunList1").bootstrapTable('refresh');
|
||||
// closeModal('subEdit');
|
||||
nexttest();
|
||||
} else {
|
||||
showAlert('d', '保存失败!' + data.msg);
|
||||
}
|
||||
},
|
||||
error: function (data) {
|
||||
// console.log(data+"fffff")
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function updataList7() {
|
||||
|
||||
// var process =processCurveslist;
|
||||
//console.log(process);
|
||||
// var jsonObj = $.parseJSON(process);
|
||||
// var formids = "#editForm";
|
||||
|
||||
//var curves = curve;
|
||||
|
||||
// console.log("formids=="+formids);
|
||||
$("#editForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#editForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
var formData = new FormData($("#editForm")[0]);
|
||||
|
||||
|
||||
/* for (var i = 0; i < process.length; i++) {
|
||||
|
||||
var datapre = new FormData($("#processcurve" + i)[0]);
|
||||
for (var key of datapre.keys()) {
|
||||
//console.log(datapre.get(key))
|
||||
formData.set(key, datapre.get(key));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
for (var i = 0; i < curves.length; i++) {
|
||||
|
||||
var datapre = new FormData($("#curveeditForm" + i)[0]);
|
||||
|
||||
for (var key of datapre.keys()) {
|
||||
// console.log(datapre.get(key))
|
||||
formData.set(key, datapre.get(key));
|
||||
}
|
||||
|
||||
}*/
|
||||
|
||||
$.ajax({
|
||||
url: ext.contextPath + "/whp/test/WhpSamplingPlanTaskTestItem/updateResult.do",
|
||||
type: 'POST',
|
||||
data: formData,
|
||||
async: false,
|
||||
cache: false,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
console.log(data)
|
||||
},
|
||||
error: function (data) {
|
||||
// console.log(data+"fffff")
|
||||
}
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
url: ext.contextPath + "/whp/test/WhpSamplingPlanTaskTestItem/updatesubmint.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) {
|
||||
//刷新样品 列表
|
||||
//$("#tableFunList1").bootstrapTable('refresh');
|
||||
|
||||
closeModal('subEdit');
|
||||
//刷新 我的任务列表
|
||||
$("#tableTask").bootstrapTable('refresh');
|
||||
closeModal('subModal1');
|
||||
|
||||
} else {
|
||||
showAlert('d', '保存失败!' + data.msg);
|
||||
}
|
||||
},
|
||||
error: function (data) {
|
||||
// console.log(data+"fffff")
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/* function calculateClick(formid) {
|
||||
$("#"+formid).bootstrapValidator('validate');//提交验证
|
||||
if ($("#"+formid).data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
var formData = new FormData($("#"+formid)[0]);
|
||||
// var formData1 = new FormData($("#editForm1")[0]);
|
||||
// var formData2 = new FormData($("#editForm2")[0]);
|
||||
// var forlist=formData+formData1+formData2
|
||||
console.log(formData,'forlistforlist')
|
||||
$.ajax({
|
||||
url: ext.contextPath + "/whp/test/WhpSamplingPlanTaskTestItem/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) {
|
||||
// $("#tableFunList1").bootstrapTable('refresh');
|
||||
// closeModal('subEdit');
|
||||
} else {
|
||||
showAlert('d', '保存失败!' + data.msg);
|
||||
}
|
||||
},
|
||||
error: function (data) {
|
||||
}
|
||||
});
|
||||
}
|
||||
}*/
|
||||
function formulaClick(val) {
|
||||
// showWaitTipFn()
|
||||
$("#editForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#editForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
var formData = new FormData($("#editForm")[0]);
|
||||
$('#jisuan').hide();
|
||||
setTimeout(function () {
|
||||
$.ajax({
|
||||
url: ext.contextPath + "/whp/test/WhpSamplingPlanTaskTestItem/getJSResult.do",
|
||||
type: 'POST',
|
||||
data: formData,
|
||||
async: false,
|
||||
cache: false,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
dataType: 'json',
|
||||
beforeSend: function () {
|
||||
// simulateLongOperation()
|
||||
},
|
||||
success: function (data) {
|
||||
console.log(data)
|
||||
// hideWaitTipFn()
|
||||
if (data.length > 0) {
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
let content = data[i];
|
||||
$("#" + content.mpid).val(content.value);
|
||||
}
|
||||
}
|
||||
// $("#"+data.mpid).val(data.value)
|
||||
$('#jisuan').show();
|
||||
},
|
||||
error: function (data) {
|
||||
$('#jisuan').show();
|
||||
}
|
||||
});
|
||||
}, 500);
|
||||
|
||||
$.ajax({
|
||||
url: ext.contextPath + "/whp/test/WhpSamplingPlanTaskTestItem/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) {
|
||||
// $("#tableFunList1").bootstrapTable('refresh');
|
||||
// closeModal('subEdit');
|
||||
} else {
|
||||
showAlert('d', '保存失败!' + data.msg);
|
||||
}
|
||||
},
|
||||
error: function (data) {
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subEdit">
|
||||
<div class="modal-dialog " style="width: 75%">
|
||||
<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-11 col-xs-13" id="contdiv">
|
||||
<!-- 检测内容 -->
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer" style="padding: 15px" id="btndiv">
|
||||
<!-- 检测按钮 -->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
652
WebRoot/jsp/whp/test/WhpSamplingPlanTaskTestItemEdit2.jsp
Normal file
652
WebRoot/jsp/whp/test/WhpSamplingPlanTaskTestItemEdit2.jsp
Normal file
@ -0,0 +1,652 @@
|
||||
<%@ 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" %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<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;
|
||||
|
||||
}
|
||||
|
||||
.has-error .checkbox, .has-error .checkbox-inline, .has-error .control-label, .has-error .help-block, .has-error .radio, .has-error .radio-inline, .has-error.checkbox label, .has-error.checkbox-inline label, .has-error.radio label, .has-error.radio-inline labe {
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.form-group.has-error .help-block {
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.help-block {
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.select2-container--default .select2-selection--single {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.select2-container--default .select2-selection--single, .select2-selection .select2-selection--single {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.select2-container--default .select2-selection--single .select2-selection__arrow b {
|
||||
border: none;
|
||||
border-style: unset
|
||||
}
|
||||
|
||||
.select2-container--default.select2-container--disabled .select2-selection--single {
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
.right {
|
||||
margin-left: 50px;
|
||||
}
|
||||
|
||||
.buttonclass {
|
||||
background-color: #ffffff;
|
||||
color: black;
|
||||
border-color: gray;
|
||||
height: 30px;
|
||||
width: 52px;
|
||||
}
|
||||
.modal-footer{
|
||||
padding: 0;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
var basiCurveslist;//基础描述
|
||||
var processCurveslist;//过程公式
|
||||
var contantCurveslist;//常量
|
||||
var curve;//结果公式
|
||||
var bean;//样品信息
|
||||
var confirmStr;
|
||||
$(function () {
|
||||
|
||||
initconfirm();
|
||||
inittest();
|
||||
|
||||
});
|
||||
|
||||
|
||||
function initconfirm() {
|
||||
confirmStr=
|
||||
" <input type=\"hidden\" name=\"testDate\" id=\"testDate\" class=\"form-control\" value=\"${confirm.testDate}\">" +
|
||||
" <input type=\"hidden\" name=\"temperature\" id=\"temperature\" class=\"form-control\" value=\"${confirm.temperature}\">" +
|
||||
" <input type=\"hidden\" name=\"reagent\" id=\"reagent\" class=\"form-control\" value=\"${confirm.reagent}\">" +
|
||||
" <input type=\"hidden\" name=\"equipmentId\" id=\"equipmentId\" class=\"form-control\" value=\"${confirm.equipmentId}\">" +
|
||||
" <input type=\"hidden\" name=\"equipmentCode\" id=\"equipmentCode\" class=\"form-control\" value=\"${confirm.equipmentCode}\">" +
|
||||
" <input type=\"hidden\" name=\"testConfirmId\" id=\"testConfirmId\" class=\"form-control\" value=\"${confirm.id}\">" +
|
||||
" <input type=\"hidden\" name=\"testAddress\" id=\"testAddress\" class=\"form-control\" value=\"${confirm.testAddress}\">" ;
|
||||
}
|
||||
function initbtn(type){
|
||||
var btndtr="";
|
||||
btndtr+="<button type=\"button\" class=\"btn btn-default \" data-dismiss=\"modal\">关闭 </button> " ;
|
||||
/*if(type==0)
|
||||
{
|
||||
btndtr+=" <button type=\"button\" class=\"btn btn-primary \" style=\"margin-left: 10px\" onclick=\"updataList7()\">保存并提交 </button> "
|
||||
}else{*/
|
||||
|
||||
|
||||
btndtr+= " <button type=\"button\" class=\"btn btn-primary \" style=\"margin-left: 10px\" onclick=\"updataList6()\">保存 </button> "
|
||||
// }
|
||||
$("#btndiv").html(btndtr);
|
||||
|
||||
}
|
||||
var listcount;
|
||||
|
||||
function inittest() {
|
||||
|
||||
$.ajax({
|
||||
url: ext.contextPath + "/whp/test/WhpSamplingPlanTaskTestItem/doNextedit.do?id=${itemid}&unitId=${unitId}",
|
||||
type: 'POST',
|
||||
|
||||
async: false,
|
||||
cache: false,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
if (data.code==0)
|
||||
{
|
||||
inintdata(data)
|
||||
listcount=data.listcount;
|
||||
initbtn(data.listcount)
|
||||
}else{
|
||||
// closeModal('subEdit');
|
||||
|
||||
}
|
||||
},
|
||||
error: function (data) {
|
||||
// console.log(data+"fffff")
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
function nexttest() {
|
||||
|
||||
var formData = new FormData($("#editForm")[0]);
|
||||
$.ajax({
|
||||
url: ext.contextPath + "/whp/test/WhpSamplingPlanTaskTestItem/doNextedit.do",
|
||||
type: 'POST',
|
||||
data: formData,
|
||||
async: false,
|
||||
cache: false,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
if (data.code==0)
|
||||
{
|
||||
inintdata(data)
|
||||
listcount=data.listcount;
|
||||
initbtn(data.listcount)
|
||||
}else{
|
||||
closeModal('subEdit');
|
||||
|
||||
}
|
||||
},
|
||||
error: function (data) {
|
||||
// console.log(data+"fffff")
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
function inintdata(data){
|
||||
basiCurveslist=data.basiCurveslist;//基础描述
|
||||
processCurveslist=data.processCurveslist;//过程公式
|
||||
contantCurveslist=data.contantCurveslist;//常量
|
||||
curve=data.curve;//结果公式
|
||||
bean=data.bean;//样品信息
|
||||
let htmlstr="";
|
||||
|
||||
htmlstr +="<form class=\"form-horizontal\" id=\"editForm\" enctype=\"multipart/form-data\">"+
|
||||
" <div id=\"alertDiv\"></div>" +
|
||||
" <!-- 界面提醒div强制id为alertdiv -->" +
|
||||
// confirmStr+
|
||||
" <input type=\"hidden\" name=\"id\" id=\"id\" class=\"form-control\" value=\""+bean.id+"\">" +
|
||||
" <input type=\"hidden\" name=\"planCode\" id=\"planCode\" class=\"form-control\"" +
|
||||
" value=\""+bean.planCode+"\">" +
|
||||
" <input type=\"hidden\" name=\"sampleCode\" id=\"sampleCode\" class=\"form-control\"" +
|
||||
" value=\""+bean.sampleCode+"\">" +
|
||||
" <input type=\"hidden\" name=\"testItemId\" id=\"testItemId\" class=\"form-control\"" +
|
||||
" value=\""+bean.testItemId+"\">" +
|
||||
" <input type=\"hidden\" name=\"unitId\" id=\"unitId\" class=\"form-control\"" +
|
||||
" value=\""+unitId+"\">" +
|
||||
" <div class=\"form-group\">" +
|
||||
" <label class=\"col-sm-2 control-label\"> 采样单编号</label>" +
|
||||
" <div class=\"col-sm-2\">" +
|
||||
" <p class=\"form-control-static\">"+bean.planCode+"</p>" +
|
||||
" </div>" +
|
||||
" <label class=\"col-sm-2 control-label\"> 检测项目</label>" +
|
||||
" <div class=\"col-sm-2\">" +
|
||||
" <p class=\"form-control-static\">"+bean.testItemName+"</p>" +
|
||||
" </div>" +
|
||||
" <label class=\"col-sm-2 control-label\"> 结果公式</label>" +
|
||||
" <div class=\"col-sm-2\">" +
|
||||
" <p class=\"form-control-static\">"+bean.workCurveName+"</p>" +
|
||||
" </div>" +
|
||||
" </div>" +
|
||||
" <div class=\"form-group\">" +
|
||||
" <label class=\"col-sm-2 control-label\"> 样品编号</label>" +
|
||||
" <div class=\"col-sm-2\">" +
|
||||
" <p class=\"form-control-static\">"+bean.sampleCode+"</p>" +
|
||||
" </div>" +
|
||||
" </div>" ;
|
||||
|
||||
htmlstr +=" <div class=\"form-group\" id=\"cont\">" ;
|
||||
for (var i=0;i<basiCurveslist.length; i++){
|
||||
|
||||
htmlstr +=" <label style=\"margin-top: 13px;\"" +
|
||||
" class=\"col-sm-2 control-label\">"+basiCurveslist[i].name+"</label>" +
|
||||
" <div class=\"col-sm-2\">" +
|
||||
" <input id=\"contantid_"+basiCurveslist[i].id+"\"" +
|
||||
" name=\"basicCurvelist["+i+"].calculated_value\" type=\"text\"" +
|
||||
" value=\""+basiCurveslist[i].default_value+"\" required=\"true\"" +
|
||||
" style=\"margin-top: 15px\" class=\"form-control\"/>" +
|
||||
" <input id=\"contantvalue_"+basiCurveslist[i].id+"\"" +
|
||||
" name=\"basicCurvelist["+i+"].working_curve_id\" type=\"hidden\"" +
|
||||
" style=\"margin-top: 1px\" value=\""+basiCurveslist[i].id+"\" class=\"form-control\"/>" +
|
||||
" <input id=\"contantvalue_"+basiCurveslist[i].id+"\" name=\"basicCurvelist["+i+"].id\"" +
|
||||
" type=\"hidden\"" +
|
||||
" style=\"margin-top: 15px\" value=\""+basiCurveslist[i].taskitemCureid+"\"" +
|
||||
" class=\"form-control\"/>" +
|
||||
" <span style=\"margin-left: 12em;margin-top: -2em;position: absolute\">"+basiCurveslist[i].unit+"</span>" +
|
||||
" </div>" ;
|
||||
|
||||
}
|
||||
|
||||
htmlstr += " </div>" +
|
||||
" <div class=\"form-group\">" +
|
||||
" <label class=\"col-sm-2 control-label\"> 常量:</label>" +
|
||||
" </div>" +
|
||||
" <div class=\"form-group\">" ;
|
||||
/// console.log("contantCurveslist",contantCurveslist)
|
||||
for (var i=0;i<contantCurveslist.length;i++)
|
||||
{
|
||||
|
||||
htmlstr += " <label style=\"margin-top: 13px;\"" +
|
||||
" class=\"col-sm-2 control-label\">"+contantCurveslist[i].mPoint.disname+"</label>" +
|
||||
" <div class=\"col-sm-2\">" +
|
||||
" <input id=\"contantid_"+contantCurveslist[i].id+"\"" +
|
||||
" name=\"contantCurvelist["+i+"].parmvalue\" type=\"text\"" +
|
||||
" value=\""+contantCurveslist[i].default_value+"\" required=\"true\"" +
|
||||
" style=\"margin-top: 15px\" class=\"form-control\"/>" +
|
||||
" <input id=\"contantvalue_"+contantCurveslist[i].id+"\"" +
|
||||
" name=\"contantCurvelist["+i+"].mpointcode\" type=\"hidden\"" +
|
||||
" value=\""+contantCurveslist[i].mPoint.mpointcode+"\" class=\"form-control\"/>" +
|
||||
" <input id=\"contantvalue_"+contantCurveslist[i].id+"\" name=\"contantCurvelist["+i+"].id\"" +
|
||||
" type=\"hidden\" value=\""+contantCurveslist[i].taskitemCureid+"\"" +
|
||||
" class=\"form-control\"/>" +
|
||||
contantCurveslist[i].mPoint.unit +
|
||||
" </div>" ;
|
||||
|
||||
}
|
||||
|
||||
|
||||
htmlstr += " </div>" ;
|
||||
//console.log("processCurveslist",processCurveslist)
|
||||
for(var i=0;i<processCurveslist.length;i++)
|
||||
{
|
||||
htmlstr += // " <form class=\"form-horizontal\" id=\"processcurve"+i+"\" enctype=\"multipart/form-data\">" +
|
||||
" <div class=\"form-group\">" +
|
||||
" <label class=\"col-sm-4 control-label\"" +
|
||||
" style=\"text-align: left\" >"+processCurveslist[i].mPoint.disname+":</label>" +
|
||||
" <input type=\"hidden\" class=\"form-control\"" +
|
||||
" name=\"processCurveslist["+i+"].mpointcode\"" +
|
||||
" value=\""+processCurveslist[i].mPoint.mpointcode+"\"/>" +
|
||||
" </div>" +
|
||||
" <div class=\"form-group\">" ;
|
||||
|
||||
|
||||
for(var j=0;j<processCurveslist[i].mPoint.mPointPropSource.length;j++)
|
||||
{
|
||||
var formuitem=processCurveslist[i].mPoint.mPointPropSource[j];
|
||||
htmlstr += " <label class=\"col-sm-2 control-label\">"+formuitem.indexDetails+"</label>" +
|
||||
" <div class=\"col-sm-2\">" +
|
||||
" <input type=\"text\" class=\"form-control\" required=\"true\"" +
|
||||
" id=\"processCurveslist["+i+"].PointFormulalist["+j+"].id\"" +
|
||||
" name=\"processCurveslist["+i+"].mPointFormulalist["+j+"].MPoint.parmvalue\"" +
|
||||
" value=\""+formuitem.mPoint.parmvalue+"\"/>" +
|
||||
" <input type=\"hidden\" class=\"form-control\"" +
|
||||
" name=\"processCurveslist["+i+"].mPointFormulalist["+j+"].mpid\"" +
|
||||
" value=\""+formuitem.mpid+"\"/>" +
|
||||
" </div>" ;
|
||||
}
|
||||
|
||||
|
||||
htmlstr += " <label class=\"col-sm-2 control-label\" style=\"color: blue\"> "+processCurveslist[i].mPoint.disname+"</label>" +
|
||||
" <div class=\"col-sm-2 modal-footer\" >" +
|
||||
" <input type=\"text\" class=\"form-control\" id=\""+processCurveslist[i].mPoint.mpointcode+"\"" +
|
||||
// " required=\"true\"" +
|
||||
" name=\"processCurveslist["+i+"].parmvalue\" style=\"width: 64%;margin-left: 1em;\"" +
|
||||
" value=\""+processCurveslist[i].mPoint.parmvalue+" \"/>" +
|
||||
|
||||
" </div>" +
|
||||
" </div>";
|
||||
}
|
||||
// console.log("curve",curve)
|
||||
for(var i=0;i<curve.length;i++)
|
||||
{
|
||||
var item=curve[i];
|
||||
|
||||
htmlstr +=
|
||||
" <div class=\"form-group\">" +
|
||||
" <label class=\"col-sm-4 control-label\" style=\"text-align: left\">"+item.mPoint.disname +" :</label>" +
|
||||
" <input type=\"hidden\" class=\"form-control\"" +
|
||||
" name=\"curves["+i+"].mpointcode\"" +
|
||||
" value=\""+item.mPoint.mpointcode+"\"/>" +
|
||||
" </div>" +
|
||||
" <div class=\"form-group\">" ;
|
||||
|
||||
for(var j=0;j<item.mPoint.mPointPropSource.length;j++)
|
||||
{
|
||||
var formuitem=item.mPoint.mPointPropSource[j];
|
||||
|
||||
htmlstr += " <label class=\"col-sm-2 control-label\">"+formuitem.indexDetails+"</label>" +
|
||||
" <div class=\"col-sm-2\">" +
|
||||
" <input type=\"text\" class=\"form-control\"" +
|
||||
" id=\"curves["+i+"].PointFormulalist["+j+"].id\"" +
|
||||
" required=\"true\"" +
|
||||
" name=\"curves["+i+"].mPointFormulalist["+j+"].MPoint.parmvalue\"" +
|
||||
" value=\""+formuitem.mPoint.parmvalue+"\"/>" +
|
||||
" <input type=\"hidden\" class=\"form-control\"" +
|
||||
" name=\"curves["+i+"].mPointFormulalist["+j+"].mpid\"" +
|
||||
" value=\""+formuitem.mpid+"\"/>" +
|
||||
" </div>" ;
|
||||
|
||||
}
|
||||
htmlstr += " <label class=\"col-sm-2 control-label\" style=\"color: blue\"> "+item.mPoint.disname+"</label>" +
|
||||
" <div class=\"col-sm-2 modal-footer\" >" +
|
||||
" <input type=\"text\" class=\"form-control\" id=\""+item.mPoint.mpointcode+"\" style=\"width: 64%;margin-left: 1em;\" required=\"true\"" +
|
||||
" name=\"curves["+i+"].parmvalue\"" +
|
||||
" value=\""+item.mPoint.parmvalue+" \"/>" +
|
||||
" <button type=\"button\" onclick=\"formulaClick()\"" +
|
||||
" class=\"btn btn-primary buttonclass\" style=\" margin-top: -4em;\">计算" +
|
||||
" </button>" +
|
||||
" </div>" +
|
||||
" </div>" ;
|
||||
|
||||
}
|
||||
htmlstr+= " </form>" ;
|
||||
|
||||
//替换
|
||||
var reg = new RegExp("undefined","g");
|
||||
htmlstr = htmlstr.replace(reg,"");
|
||||
$("#contdiv").html(htmlstr);
|
||||
|
||||
}
|
||||
function updataList6() {
|
||||
|
||||
//var process =processCurveslist;
|
||||
//console.log(process);
|
||||
// var jsonObj = $.parseJSON(process);
|
||||
// var formids = "#editForm";
|
||||
|
||||
// var curves = curve;
|
||||
|
||||
// console.log("formids=="+formids);
|
||||
$("#editForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#editForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
var formData = new FormData($("#editForm")[0]);
|
||||
|
||||
/*
|
||||
|
||||
for (var i = 0; i < process.length; i++) {
|
||||
|
||||
var datapre = new FormData($("#processcurve" + i)[0]);
|
||||
for (var key of datapre.keys()) {
|
||||
//console.log(datapre.get(key))
|
||||
formData.set(key, datapre.get(key));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
for (var i = 0; i < curves.length; i++) {
|
||||
|
||||
var datapre = new FormData($("#curveeditForm" + i)[0]);
|
||||
|
||||
for (var key of datapre.keys()) {
|
||||
// console.log(datapre.get(key))
|
||||
formData.set(key, datapre.get(key));
|
||||
}
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
$.ajax({
|
||||
url: ext.contextPath + "/whp/test/WhpSamplingPlanTaskTestItem/updateResult.do",
|
||||
type: 'POST',
|
||||
data: formData,
|
||||
async: false,
|
||||
cache: false,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
console.log(data)
|
||||
},
|
||||
error: function (data) {
|
||||
// console.log(data+"fffff")
|
||||
}
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
url: ext.contextPath + "/whp/test/WhpSamplingPlanTaskTestItem/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) {
|
||||
$("#tableFunList1").bootstrapTable('refresh');
|
||||
closeModal('subEdit');
|
||||
//nexttest();
|
||||
} else {
|
||||
showAlert('d', '保存失败!' + data.msg);
|
||||
}
|
||||
},
|
||||
error: function (data) {
|
||||
// console.log(data+"fffff")
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
function updataList7() {
|
||||
|
||||
//var process =processCurveslist;
|
||||
//console.log(process);
|
||||
// var jsonObj = $.parseJSON(process);
|
||||
//var formids = "#editForm";
|
||||
|
||||
//var curves = curve;
|
||||
|
||||
// console.log("formids=="+formids);
|
||||
$("#editForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#editForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
var formData = new FormData($("#editForm")[0]);
|
||||
|
||||
/*
|
||||
for (var i = 0; i < process.length; i++) {
|
||||
|
||||
var datapre = new FormData($("#processcurve" + i)[0]);
|
||||
for (var key of datapre.keys()) {
|
||||
//console.log(datapre.get(key))
|
||||
formData.set(key, datapre.get(key));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
for (var i = 0; i < curves.length; i++) {
|
||||
|
||||
var datapre = new FormData($("#curveeditForm" + i)[0]);
|
||||
|
||||
for (var key of datapre.keys()) {
|
||||
// console.log(datapre.get(key))
|
||||
formData.set(key, datapre.get(key));
|
||||
}
|
||||
|
||||
}*/
|
||||
|
||||
$.ajax({
|
||||
url: ext.contextPath + "/whp/test/WhpSamplingPlanTaskTestItem/updateResult.do",
|
||||
type: 'POST',
|
||||
data: formData,
|
||||
async: false,
|
||||
cache: false,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
console.log(data)
|
||||
},
|
||||
error: function (data) {
|
||||
// console.log(data+"fffff")
|
||||
}
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
url: ext.contextPath + "/whp/test/WhpSamplingPlanTaskTestItem/updatesubmint.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) {
|
||||
//刷新样品 列表
|
||||
//$("#tableFunList1").bootstrapTable('refresh');
|
||||
|
||||
closeModal('subEdit');
|
||||
//刷新 我的任务列表
|
||||
$("#tableTask").bootstrapTable('refresh');
|
||||
closeModal('subModal1');
|
||||
|
||||
} else {
|
||||
showAlert('d', '保存失败!' + data.msg);
|
||||
}
|
||||
},
|
||||
error: function (data) {
|
||||
// console.log(data+"fffff")
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/* function calculateClick(formid) {
|
||||
$("#"+formid).bootstrapValidator('validate');//提交验证
|
||||
if ($("#"+formid).data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
var formData = new FormData($("#"+formid)[0]);
|
||||
// var formData1 = new FormData($("#editForm1")[0]);
|
||||
// var formData2 = new FormData($("#editForm2")[0]);
|
||||
// var forlist=formData+formData1+formData2
|
||||
console.log(formData,'forlistforlist')
|
||||
$.ajax({
|
||||
url: ext.contextPath + "/whp/test/WhpSamplingPlanTaskTestItem/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) {
|
||||
// $("#tableFunList1").bootstrapTable('refresh');
|
||||
// closeModal('subEdit');
|
||||
} else {
|
||||
showAlert('d', '保存失败!' + data.msg);
|
||||
}
|
||||
},
|
||||
error: function (data) {
|
||||
}
|
||||
});
|
||||
}
|
||||
}*/
|
||||
function formulaClick() {
|
||||
$("#editForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#editForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
|
||||
|
||||
/* $("#" + formid).bootstrapValidator('validate');//提交验证
|
||||
if ($("#" + formid).data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
var formData = new FormData($("#" + formid)[0]);
|
||||
*/
|
||||
var formData = new FormData($("#editForm")[0]);
|
||||
|
||||
|
||||
/* for (var key of contantData.keys()) {
|
||||
|
||||
formData.set(key, contantData.get(key));
|
||||
}
|
||||
console.log("in")*/
|
||||
$.ajax({
|
||||
url: ext.contextPath + "/whp/test/WhpSamplingPlanTaskTestItem/getJSResult.do",
|
||||
type: 'POST',
|
||||
data: formData,
|
||||
async: false,
|
||||
cache: false,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
console.log(data)
|
||||
if(data.length>0){
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
let content = data[i];
|
||||
$("#"+content.mpid).val(content.value);
|
||||
}
|
||||
}
|
||||
//
|
||||
// $("#"+data.mpid).val(data.value)
|
||||
},
|
||||
error: function (data) {
|
||||
}
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
url: ext.contextPath + "/whp/test/WhpSamplingPlanTaskTestItem/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) {
|
||||
// $("#tableFunList1").bootstrapTable('refresh');
|
||||
// closeModal('subEdit');
|
||||
} else {
|
||||
showAlert('d', '保存失败!' + data.msg);
|
||||
}
|
||||
},
|
||||
error: function (data) {
|
||||
}
|
||||
});
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subEdit">
|
||||
<div class="modal-dialog " style="width: 75%">
|
||||
<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-11 col-xs-13" id="contdiv">
|
||||
<!-- 检测内容 -->
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer" style="padding: 15px" id="btndiv">
|
||||
<!-- 检测按钮 -->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
233
WebRoot/jsp/whp/test/WhpSamplingPlanTaskTestItemView.jsp
Normal file
233
WebRoot/jsp/whp/test/WhpSamplingPlanTaskTestItemView.jsp
Normal file
@ -0,0 +1,233 @@
|
||||
<!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: 15 px;
|
||||
/ /
|
||||
}
|
||||
|
||||
/
|
||||
.form-horizontal {
|
||||
padding-top: 20px;
|
||||
|
||||
}
|
||||
|
||||
.select2-container--default .select2-selection--single {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.select2-container--default .select2-selection--single, .select2-selection .select2-selection--single {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.select2-container--default .select2-selection--single .select2-selection__arrow b {
|
||||
border: none;
|
||||
border-style: unset
|
||||
}
|
||||
|
||||
.select2-container--default.select2-container--disabled .select2-selection--single {
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
.right {
|
||||
margin-left: 50px;
|
||||
}
|
||||
|
||||
.buttonclass {
|
||||
background-color: #ffffff;
|
||||
color: black;
|
||||
border-color: gray;
|
||||
height: 30px;
|
||||
width: 52px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
});
|
||||
function updataList6() {
|
||||
$("#editForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#editForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
var formData = new FormData($("#editForm")[0]);
|
||||
$.ajax({
|
||||
url: ext.contextPath + "",
|
||||
type: 'POST',
|
||||
data: formData,
|
||||
async: false,
|
||||
cache: false,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
// console.log(data)
|
||||
if (data.code == 1) {
|
||||
$("#tableFunList1").bootstrapTable('refresh');
|
||||
closeModal('subEdit');
|
||||
} else {
|
||||
showAlert('d', '保存失败!' + data.msg);
|
||||
}
|
||||
},
|
||||
error: function (data) {
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<div class="modal fade" id="TtemWorView">
|
||||
<div class="modal-dialog " style="width:75%">
|
||||
<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-11 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 -->
|
||||
|
||||
<input type="hidden" name="id" id="id" class="form-control" value="${bean.id}">
|
||||
<input type="hidden" name="planCode" id="planCode" class="form-control" value="${bean.planCode}">
|
||||
<input type="hidden" name="sampleCode" id="sampleCode" class="form-control" value="${bean.sampleCode}">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label"> 采样单编号</label>
|
||||
<div class="col-sm-2">
|
||||
<p class="form-control-static">${bean.planCode}</p>
|
||||
|
||||
</div>
|
||||
<label class="col-sm-2 control-label"> 检测项目</label>
|
||||
<div class="col-sm-2">
|
||||
<p class="form-control-static">${bean.testItemName}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label"> 结果公式</label>
|
||||
<div class="col-sm-2">
|
||||
<p class="form-control-static">${bean.workCurveName}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label"> 样品编号</label>
|
||||
<div class="col-sm-2">
|
||||
<p class="form-control-static">${bean.sampleCode}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" id="cont">
|
||||
<c:forEach items="${basiCurveslist}" var="item" varStatus="status">
|
||||
|
||||
<label style="margin-top: 13px;"
|
||||
class="col-sm-2 control-label">${item.name}</label>
|
||||
<div class="col-sm-2">
|
||||
<p class="form-control-static"> ${item.default_value}
|
||||
${item.unit}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</c:forEach>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label"> 常量:</label>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<c:forEach items="${contantCurveslist}" var="item" varStatus="status">
|
||||
|
||||
<label style=""
|
||||
class="col-sm-2 control-label">${item.MPoint.parmname}</label>
|
||||
<div class="col-sm-2">
|
||||
<p class="form-control-static"> ${item.default_value} ${item.MPoint.unit}</p>
|
||||
</div>
|
||||
|
||||
</c:forEach>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<c:forEach items="${processCurveslist}" var="item" varStatus="status">
|
||||
<form class="form-horizontal" id="processcurve${status.index}"
|
||||
enctype="multipart/form-data">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" style="margin-left: -9em;">${item.MPoint.disname}</label>
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
||||
<c:forEach items="${item.MPoint.mPointPropSource}" var="formuitem" varStatus="formustatus">
|
||||
<label class="col-sm-2 control-label">${formuitem.indexDetails}</label>
|
||||
<div class="col-sm-2">
|
||||
<p class="form-control-static">${formuitem.mPoint.parmvalue}</p>
|
||||
</div>
|
||||
|
||||
</c:forEach>
|
||||
<label class="col-sm-2 control-label"> ${item.MPoint.disname}</label>
|
||||
<div class="col-sm-2">
|
||||
<p class="form-control-static"> ${item.MPoint.parmvalue}</p>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</c:forEach>
|
||||
<c:forEach items="${curve}" var="item" varStatus="status">
|
||||
<form class="form-horizontal" id="curveeditForm${status.index}"
|
||||
enctype="multipart/form-data">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label">${item.MPoint.disname}</label>
|
||||
|
||||
</div>
|
||||
<div class="form-group" >
|
||||
|
||||
<c:forEach items="${item.MPoint.mPointPropSource}" var="formuitem"
|
||||
varStatus="formustatus">
|
||||
<label class="col-sm-2 control-label">${formuitem.indexDetails}</label>
|
||||
<div class="col-sm-2">
|
||||
<p class="form-control-static">${formuitem.mPoint.parmvalue}</p>
|
||||
</div>
|
||||
</c:forEach>
|
||||
<label class="col-sm-2 control-label"> ${item.MPoint.disname}</label>
|
||||
<div class="col-sm-2">
|
||||
<p class="form-control-static"> ${item.MPoint.parmvalue}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</c:forEach>
|
||||
|
||||
|
||||
</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="updataList6()">保存--%>
|
||||
<%-- </button>--%>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
931
WebRoot/jsp/whp/test/WhpSamplingPlanTaskTestTask.jsp
Normal file
931
WebRoot/jsp/whp/test/WhpSamplingPlanTaskTestTask.jsp
Normal file
@ -0,0 +1,931 @@
|
||||
<%@ 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">
|
||||
var timeEnd;
|
||||
var timeBegin;
|
||||
var timeRangeEnd;
|
||||
var timeRangeBegin;
|
||||
var timerepotEnd;
|
||||
var timerepotBegin;
|
||||
var timedataEnd;
|
||||
var timedataBegin;
|
||||
let selectedType = ''
|
||||
$(function () {
|
||||
conditionDropDownStatus()
|
||||
inittabletreeList()
|
||||
conditionDropDownsampleTypeName()
|
||||
conditionDropDownstatusName()
|
||||
tabFun(0)
|
||||
// initTableList();
|
||||
// initTableData()
|
||||
initDate1();
|
||||
initDate2();
|
||||
initDate3();
|
||||
|
||||
initDate4();
|
||||
$('#reservationtimeD').val('');
|
||||
$('#repotDateFun').val('');
|
||||
$('#datatime').val('');
|
||||
$('#repotDate').val('');
|
||||
timeEnd = null;
|
||||
timeBegin = null;
|
||||
timeRangeEnd = null;
|
||||
timeRangeBegin = null;
|
||||
timerepotEnd = null;
|
||||
timerepotBegin = null;
|
||||
timedataEnd = null;
|
||||
timedataBegin = null;
|
||||
});
|
||||
var dosearch = function () {
|
||||
|
||||
inittabletreeList()
|
||||
|
||||
};
|
||||
var dosearchTest = function () {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
};
|
||||
var dosearchTask = function () {
|
||||
$("#tableTask").bootstrapTable('refresh');
|
||||
};
|
||||
var companyId_rawMaterial = "";
|
||||
//
|
||||
var inittabletreeList = function () {
|
||||
var name = $("#testItemName").val();
|
||||
$.post(ext.contextPath + '/whp/test/WhpSamplingPlanTaskTestConfirm/TestItemTree.do?testItemName='+name, function (data) {
|
||||
$('#tabletree').treeview({
|
||||
data: JSON.parse(data).result,
|
||||
showBorder: true,
|
||||
levels: 3,
|
||||
});
|
||||
$('#tabletree').on('nodeSelected', function (event, node) {
|
||||
selectedType = node.id
|
||||
$("#table").bootstrapTable('refresh');
|
||||
$("#tableTask").bootstrapTable('refresh');
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
//接单弹窗
|
||||
var confirmFun = function (id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/whp/test/WhpSamplingPlanTaskTestConfirm/acceptShow.do', {id: id}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
var initTableList = function () {
|
||||
timeEnd = null;
|
||||
timeBegin = null;
|
||||
timeRangeEnd = null;
|
||||
timeRangeBegin = null;
|
||||
// $('#tabletree').val()
|
||||
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/whp/test/WhpSamplingPlanTaskTestConfirm/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, // 排序规则
|
||||
planDateBegin: timeRangeBegin,
|
||||
planDateEnd: timeRangeEnd,
|
||||
reportDateBegin: timeBegin,
|
||||
reportDateEnd: timeEnd,
|
||||
status: 0,//状态
|
||||
testItemId: selectedType,// 树条件
|
||||
sampleTypeId: $('#sampleTypeId').val()
|
||||
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
//detailView: true,//父子表
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
},
|
||||
{
|
||||
field: 'planCode', // 返回json数据中的name
|
||||
title: '采样单编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'sampleTypeName', // 返回json数据中的name
|
||||
title: '采样单类型', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'planDate', // 返回json数据中的name
|
||||
title: '计划采样日期', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value) {
|
||||
return value.substring(0, 10);
|
||||
}
|
||||
}, {
|
||||
field: 'testItemName', // 返回json数据中的name
|
||||
title: '检测项目', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value) {
|
||||
return value.substring(0, 10);
|
||||
}
|
||||
}, {
|
||||
field: 'reportDate', // 返回json数据中的name
|
||||
title: '要求报告日期', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value) {
|
||||
return value.substring(0, 10);
|
||||
}
|
||||
}, {
|
||||
field: 'samplingTaskNumber', // 返回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="confirmFun(\'' + row.id + '\')"><i class="glyphicon glyphicon-flash"></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("加载数据失败");
|
||||
}
|
||||
});
|
||||
}
|
||||
//撤销
|
||||
var revocation = 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/test/WhpSamplingPlanTaskTestConfirm/back.do', {id: id}, function (data) {
|
||||
if (data.code === 1) {
|
||||
$("#tableTask").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '撤销失败', 'mainAlertdiv');
|
||||
}
|
||||
}, "json");
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
//检测弹窗
|
||||
var detection = function (id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/whp/test/WhpSamplingPlanTaskTestConfirm/showTest.do', {id: id}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
// debugger;
|
||||
openModal('subModal1');
|
||||
});
|
||||
};
|
||||
//详情弹窗
|
||||
var viewFun = function (id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/whp/test/WhpSamplingPlanTaskTestConfirm/view.do', {id: id}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
var initTableData = function () {
|
||||
timerepotEnd = null;
|
||||
timerepotBegin = null;
|
||||
timedataEnd = null;
|
||||
timedataBegin = null;
|
||||
$('#tabletree').val()
|
||||
console.log(selectedType)
|
||||
$("#tableTask").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/whp/test/WhpSamplingPlanTaskTestConfirm/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, // 排序规则
|
||||
reportDateBegin: timerepotBegin,
|
||||
reportDateEnd: timerepotEnd,
|
||||
planDateBegin: timedataBegin,
|
||||
planDateEnd: timedataEnd
|
||||
,
|
||||
testUserId: '${loginUserId}',
|
||||
testItemId: selectedType,
|
||||
sampleTypeId: $('#sampleTypeId1').val(),
|
||||
status: $('#status1').val()
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
//detailView: true,//父子表
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
},
|
||||
{
|
||||
field: 'planCode', // 返回json数据中的name
|
||||
title: '采样单编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'sampleTypeName', // 返回json数据中的name
|
||||
title: '采样单类型', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'planDate', // 返回json数据中的name
|
||||
title: '计划采样日期', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value) {
|
||||
return value.substring(0, 10);
|
||||
}
|
||||
}, {
|
||||
field: 'reportDate', // 返回json数据中的name
|
||||
title: '要求报告日期', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value) {
|
||||
return value.substring(0, 10);
|
||||
}
|
||||
}, {
|
||||
field: 'samplingTaskNumber', // 返回json数据中的name
|
||||
title: '样品任务数量', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'testItemName', // 返回json数据中的name
|
||||
title: '检测项目', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'equipmentName', // 返回json数据中的name
|
||||
title: '检测仪器', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'testUserName', // 返回json数据中的name
|
||||
title: '检测人', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'confirmUserName', // 返回json数据中的name
|
||||
title: '复核人', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'confirmDate', // 返回json数据中的name
|
||||
title: '复核日期', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value) {
|
||||
return value.substring(0, 10);
|
||||
}
|
||||
}, {
|
||||
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="revocation(\'' + row.id + '\')"><i class="glyphicon glyphicon-share-alt"></i><span class="hidden-md hidden-lg"> 撤销</span></button>';
|
||||
buts += '<button class="btn btn-default btn-sm" title="检测" onclick="detection(\'' + row.id + '\')"><i class="glyphicon glyphicon-play"></i><span class="hidden-md hidden-lg"> 检测</span></button>';
|
||||
buts += '<button class="btn btn-default btn-sm" title="详情" onclick="viewFun(\'' + row.id + '\')"><i class="fa fa-eye"></i><span class="hidden-md hidden-lg"> 详情</span></button>';
|
||||
|
||||
buts = '<div class="btn-group" >' + buts + '</div>';
|
||||
return buts;
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("tableTask");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function conditionDropDownStatus() {
|
||||
var select_Data = jQuery.parseJSON('${sampleTypeDropDown}');
|
||||
var select_3 = $("#sampleTypeId").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 conditionDropDownsampleTypeName() {
|
||||
var select_Data = jQuery.parseJSON('${sampleTypeDropDown}');
|
||||
var select_3 = $("#sampleTypeId1").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 conditionDropDownstatusName() {
|
||||
var select_Data = jQuery.parseJSON('${StatusDropDown}');
|
||||
var select_3 = $("#status1").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('1').trigger('change');
|
||||
}
|
||||
//对Date的扩展,将 Date 转化为指定格式的String
|
||||
//月(M)、日(d)、小时(h)、分(m)、秒(s)、季度(q) 可以用 1-2 个占位符,
|
||||
//年(y)可以用 1-4 个占位符,毫秒(S)只能用 1 个占位符(是 1-3 位的数字)
|
||||
Date.prototype.Format = function (fmt) {
|
||||
var o = {
|
||||
"M+": this.getMonth() + 1, //月份
|
||||
"d+": this.getDate(), //日
|
||||
"H+": this.getHours(), //小时
|
||||
"m+": this.getMinutes(), //分
|
||||
"s+": this.getSeconds(), //秒
|
||||
"q+": Math.floor((this.getMonth() + 3) / 3), //季度
|
||||
"S": this.getMilliseconds() //毫秒
|
||||
};
|
||||
if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
|
||||
for (var k in o)
|
||||
if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
|
||||
return fmt;
|
||||
}
|
||||
|
||||
function initDate2() {
|
||||
var locale = {
|
||||
"format": 'YYYY-MM-DD ',
|
||||
"separator": " ~ ",
|
||||
"applyLabel": "确定",
|
||||
"cancelLabel": "取消",
|
||||
"fromLabel": "起始时间",
|
||||
"toLabel": "结束时间'",
|
||||
"customRangeLabel": "自定义",
|
||||
"weekLabel": "W",
|
||||
"daysOfWeek": ["日", "一", "二", "三", "四", "五", "六"],
|
||||
"monthNames": ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
|
||||
"firstDay": 1
|
||||
};
|
||||
var oldreservationtime1 = "${param.oldreservationtime1}";
|
||||
if (oldreservationtime1 != "" && oldreservationtime1.length > 0) {
|
||||
timeBegin = oldreservationtime1.substring(0, 16);
|
||||
timeEnd = oldreservationtime1.substring(19, 36);
|
||||
$('#repotDateFun').val(oldreservationtime1);
|
||||
} else {
|
||||
timeBegin = moment().subtract(3, 'days').format('YYYY-MM-DD');
|
||||
timeEnd = moment().subtract(0, 'days').format('YYYY-MM-DD');
|
||||
$('#repotDateFun').val(timeBegin + locale.separator + timeEnd);
|
||||
}
|
||||
|
||||
$('#repotDateFun').daterangepicker({
|
||||
"locale": locale,
|
||||
startDate: timeBegin,
|
||||
endDate: timeEnd
|
||||
}, function (start, end, label) {
|
||||
timeBegin = start.format(this.locale.format);
|
||||
timeEnd = end.format(this.locale.format);
|
||||
});
|
||||
|
||||
};
|
||||
var timedelete = function () {
|
||||
$('#repotDateFun').val('');
|
||||
timeEnd = null;
|
||||
timeBegin = null;
|
||||
};
|
||||
|
||||
function initDate1() {
|
||||
var locale = {
|
||||
"format": 'YYYY-MM-DD',
|
||||
"separator": " ~ ",
|
||||
"applyLabel": "确定",
|
||||
"cancelLabel": "取消",
|
||||
"fromLabel": "起始时间",
|
||||
"toLabel": "结束时间'",
|
||||
"customRangeLabel": "自定义",
|
||||
"weekLabel": "W",
|
||||
"daysOfWeek": ["日", "一", "二", "三", "四", "五", "六"],
|
||||
"monthNames": ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
|
||||
"firstDay": 1
|
||||
};
|
||||
var oldreservationtime1 = "${param.oldreservationtime1}";
|
||||
if (oldreservationtime1 != "" && oldreservationtime1.length > 0) {
|
||||
timeRangeBegin = oldreservationtime1.substring(0, 16);
|
||||
timeRangeEnd = oldreservationtime1.substring(19, 36);
|
||||
$('#reservationtimeD').val(oldreservationtime1);
|
||||
} else {
|
||||
timeRangeBegin = moment().subtract(3, 'days').format('YYYY-MM-DD');
|
||||
timeRangeEnd = moment().subtract(0, 'days').format('YYYY-MM-DD');
|
||||
$('#reservationtimeD').val(timeRangeBegin + locale.separator + timeRangeEnd);
|
||||
}
|
||||
|
||||
$('#reservationtimeD').daterangepicker({
|
||||
"locale": locale,
|
||||
startDate: timeRangeBegin,
|
||||
endDate: timeRangeEnd
|
||||
}, function (start, end, label) {
|
||||
timeRangeBegin = start.format(this.locale.format);
|
||||
timeRangeEnd = end.format(this.locale.format);
|
||||
});
|
||||
|
||||
};
|
||||
var timedel = function () {
|
||||
$('#reservationtimeD').val('');
|
||||
timeRangeEnd = null;
|
||||
timeRangeBegin = null;
|
||||
};
|
||||
function initDate3() {
|
||||
var locale = {
|
||||
"format": 'YYYY-MM-DD ',
|
||||
"separator": " ~ ",
|
||||
"applyLabel": "确定",
|
||||
"cancelLabel": "取消",
|
||||
"fromLabel": "起始时间",
|
||||
"toLabel": "结束时间'",
|
||||
"customRangeLabel": "自定义",
|
||||
"weekLabel": "W",
|
||||
"daysOfWeek": ["日", "一", "二", "三", "四", "五", "六"],
|
||||
"monthNames": ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
|
||||
"firstDay": 1
|
||||
};
|
||||
var oldreservationtime1 = "${param.oldreservationtime1}";
|
||||
if (oldreservationtime1 != "" && oldreservationtime1.length > 0) {
|
||||
timerepotBegin = oldreservationtime1.substring(0, 16);
|
||||
timerepotEnd = oldreservationtime1.substring(19, 36);
|
||||
$('#repotDate').val(oldreservationtime1);
|
||||
} else {
|
||||
timerepotBegin = moment().subtract(3, 'days').format('YYYY-MM-DD');
|
||||
timerepotEnd = moment().subtract(0, 'days').format('YYYY-MM-DD');
|
||||
$('#repotDate').val(timerepotBegin + locale.separator + timerepotEnd);
|
||||
}
|
||||
|
||||
$('#repotDate').daterangepicker({
|
||||
"locale": locale,
|
||||
startDate: timerepotBegin,
|
||||
endDate: timerepotEnd
|
||||
}, function (start, end, label) {
|
||||
timerepotBegin = start.format(this.locale.format);
|
||||
timerepotEnd = end.format(this.locale.format);
|
||||
|
||||
});
|
||||
|
||||
};
|
||||
var timedelete1 = function () {
|
||||
$('#repotDate').val('');
|
||||
timerepotBegin = null;
|
||||
timerepotEnd = null;
|
||||
};
|
||||
|
||||
function initDate4() {
|
||||
var locale = {
|
||||
"format": 'YYYY-MM-DD',
|
||||
"separator": " ~ ",
|
||||
"applyLabel": "确定",
|
||||
"cancelLabel": "取消",
|
||||
"fromLabel": "起始时间",
|
||||
"toLabel": "结束时间'",
|
||||
"customRangeLabel": "自定义",
|
||||
"weekLabel": "W",
|
||||
"daysOfWeek": ["日", "一", "二", "三", "四", "五", "六"],
|
||||
"monthNames": ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
|
||||
"firstDay": 1
|
||||
};
|
||||
var oldreservationtime1 = "${param.oldreservationtime1}";
|
||||
if (oldreservationtime1 != "" && oldreservationtime1.length > 0) {
|
||||
timedataBegin = oldreservationtime1.substring(0, 16);
|
||||
timedataEnd = oldreservationtime1.substring(19, 36);
|
||||
$('#datatime').val(oldreservationtime1);
|
||||
} else {
|
||||
timedataBegin = moment().subtract(3, 'days').format('YYYY-MM-DD');
|
||||
timedataEnd = moment().subtract(0, 'days').format('YYYY-MM-DD');
|
||||
$('#datatime').val(timedataBegin + locale.separator + timedataEnd);
|
||||
}
|
||||
|
||||
$('#datatime').daterangepicker({
|
||||
"locale": locale,
|
||||
startDate: timedataBegin,
|
||||
endDate: timedataEnd
|
||||
}, function (start, end, label) {
|
||||
timedataBegin = start.format(this.locale.format);
|
||||
timedataEnd = end.format(this.locale.format);
|
||||
});
|
||||
|
||||
};
|
||||
var timedel1 = function () {
|
||||
$('#datatime').val('');
|
||||
timedataEnd = null;
|
||||
timedataBegin = null;
|
||||
};
|
||||
//批量接单弹窗
|
||||
var confirmBatchFun = 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/test/WhpSamplingPlanTaskTestConfirm/acceptBatch.do', {ids: datas}, function (data) {
|
||||
if (data.code == 1) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '接单失败', 'mainAlertdiv');
|
||||
}
|
||||
}, "json");
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
function tabFun(type) {
|
||||
if(type===0){
|
||||
initTableList()
|
||||
}else {
|
||||
initTableData()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
</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 style="width: 100%">
|
||||
|
||||
<input type="text" id="testItemName" name="testItemName" class="form-control pull-left"
|
||||
placeholder="搜索检测项目" style="width: calc(100% - 40px)">
|
||||
<div class="input-group-btn" style="width: 40px">
|
||||
<button type="button" class="btn btn-default" onclick="dosearch();"><i class="fa fa-search"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="tabletree" style="height:550px;overflow:auto;width: 100% "></div>
|
||||
</div>
|
||||
<div style="float: right;width:80%">
|
||||
<ul class="nav nav-tabs" id="myTab">
|
||||
<li id="tabli1" class="active"><a href="#tab1" data-toggle="tab" onclick="tabFun(0)"
|
||||
index="0" aria-expanded="true">接单</a></li>
|
||||
<li id="tabli2" class=""><a href="#tab2" data-toggle="tab" index="1" id="taba2"
|
||||
onclick="tabFun(1)" aria-expanded="true">我的任务</a></li>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content no-padding">
|
||||
<div class="chart tab-pane active" id="tab1"
|
||||
style="position: relative; padding:5px;">
|
||||
<div class="box-header with-border">
|
||||
<ul style="list-style-type:none;padding-left:0px;margin-bottom:5px;">
|
||||
<!-- Menu toggle button -->
|
||||
<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="confirmBatchFun();"
|
||||
style="margin-right: 15px"><i
|
||||
class="fa fa-plus"></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="sampleTypeId"
|
||||
id="sampleTypeId"
|
||||
style="width:180px;height: 30px">
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-label">计划采样日期:</label>
|
||||
<div class="input-group input-group-sm" style="width: 200px;">
|
||||
<input type="text" autocomplete="off" class="form-control pull-left"
|
||||
style="height: 30px; width: 240px; border-radius: 4px;" id="reservationtimeD"
|
||||
placeholder="请选择计划采样日期范围">
|
||||
<a class="glyphicon glyphicon-remove btn form-control-feedback input-clear-a"
|
||||
style="pointer-events: auto;"
|
||||
onclick="timedel()"></a>
|
||||
</div>
|
||||
<label class="form-label">要求报告日期:</label>
|
||||
<div class="input-group input-group-sm" style="width: 200px;">
|
||||
<input type="text" autocomplete="off" class="form-control pull-left"
|
||||
style="height: 30px; width: 240px; border-radius: 4px;" id="repotDateFun"
|
||||
placeholder="请选择要求报告日期范围">
|
||||
<a class="glyphicon glyphicon-remove btn form-control-feedback input-clear-a"
|
||||
style="pointer-events: auto;"
|
||||
onclick="timedelete()"></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-group input-group-sm" style="width: 37px;">
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-default" onclick="dosearchTest();"><i
|
||||
class="fa fa-search"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<table id="table"></table>
|
||||
<div id="searchHiddenDiv" style="display: none;width: 100%;">
|
||||
</div>
|
||||
</ul>
|
||||
<div class="box-tools">
|
||||
<!-- <button type="button" class="btn btn-box-tool" onclick="addFun();"><i class="fa fa-plus"></i>
|
||||
</button> -->
|
||||
</div>
|
||||
</div>
|
||||
<div id="mptableTop" class="box-body no-padding" style="display: none;">
|
||||
|
||||
</div>
|
||||
<div id="singleBizDivTop" class="box-body no-padding" style="display: none;">
|
||||
<%-- <div id="singleBizDiv"--%>
|
||||
<%-- style="float: left;width: 100%;height: 100%;overflow:auto;"></div>--%>
|
||||
</div>
|
||||
</div>
|
||||
<%-- style="position: relative; padding:5px;overflow:hidden"--%>
|
||||
<div class=" tab-pane" id="tab2">
|
||||
<div>
|
||||
<form id="searForm">
|
||||
<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="confirmBatchFun();"
|
||||
style="margin-right: 15px"><i
|
||||
class="fa fa-plus"></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="sampleTypeId1"
|
||||
id="sampleTypeId1"
|
||||
style="width:180px;height: 30px">
|
||||
</select>
|
||||
<label class="form-label">任务状态:</label>
|
||||
<select class="form-control select2" name="status"
|
||||
id="status1"
|
||||
style="width:180px;height: 30px">
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-label">计划采样日期:</label>
|
||||
<div class="input-group input-group-sm" style="width: 200px;">
|
||||
<input type="text" autocomplete="off" class="form-control pull-left"
|
||||
style="height: 30px; width: 240px; border-radius: 4px;" id="datatime"
|
||||
placeholder="请选择计划采样日期范围">
|
||||
<a class="glyphicon glyphicon-remove btn form-control-feedback input-clear-a"
|
||||
style="pointer-events: auto;"
|
||||
onclick="timedel1()"></a>
|
||||
</div>
|
||||
<label class="form-label">要求报告日期:</label>
|
||||
<div class="input-group input-group-sm" style="width: 200px;">
|
||||
<input type="text" autocomplete="off" class="form-control pull-left"
|
||||
style="height: 30px; width: 240px; border-radius: 4px;" id="repotDate"
|
||||
placeholder="请选择要求报告日期范围">
|
||||
<a class="glyphicon glyphicon-remove btn form-control-feedback input-clear-a"
|
||||
style="pointer-events: auto;"
|
||||
onclick="timedelete1()"></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-group input-group-sm" style="width: 37px;">
|
||||
<div class="input-group-btn">
|
||||
<button type="button" class="btn btn-default" onclick="dosearchTask();"><i
|
||||
class="fa fa-search"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<table id="tableTask"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</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>
|
||||
209
WebRoot/jsp/whp/test/WhpSamplingPlanTaskView.jsp
Normal file
209
WebRoot/jsp/whp/test/WhpSamplingPlanTaskView.jsp
Normal file
@ -0,0 +1,209 @@
|
||||
<!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;
|
||||
|
||||
}
|
||||
|
||||
.select2-container--default .select2-selection--single {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.select2-container--default .select2-selection--single, .select2-selection .select2-selection--single {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.select2-container--default .select2-selection--single .select2-selection__arrow b {
|
||||
border: none;
|
||||
border-style: unset
|
||||
}
|
||||
|
||||
.select2-container--default.select2-container--disabled .select2-selection--single {
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
.right {
|
||||
margin-left: 50px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
initTableViewList();
|
||||
|
||||
});
|
||||
|
||||
function initTableViewList() {
|
||||
|
||||
$("#tableView").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/whp/plan/WhpSamplingPlanTask/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,
|
||||
planCode: '${bean.code}'
|
||||
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
//detailView: true,//父子表
|
||||
columns: [
|
||||
|
||||
{
|
||||
field: 'sampleCode', // 返回json数据中的name
|
||||
title: '样品编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'sampleAddress', // 返回json数据中的name
|
||||
title: '地点', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'sampleState',
|
||||
title: '样品状态',
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
if (value==0){
|
||||
return'固体'
|
||||
}else {
|
||||
return'液体'
|
||||
}
|
||||
}
|
||||
}, {
|
||||
field: 'sampleAppearance',
|
||||
title: '样品外观',
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
if (value==0){
|
||||
return'清澈'
|
||||
}else {
|
||||
return'浑浊'
|
||||
}
|
||||
}
|
||||
|
||||
}, {
|
||||
field: 'sampleAmount',
|
||||
title: '样品数量',
|
||||
align: 'center',
|
||||
valign: 'middle'
|
||||
},{
|
||||
field: 'unit',
|
||||
title: '单位',
|
||||
align: 'center',
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'testItemNames', // 返回json数据中的name
|
||||
title: '检测项目', // 表格表头显示文字
|
||||
align: 'center' // 左右居中
|
||||
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function (data) { //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog " style="width: 65%">
|
||||
<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 -->
|
||||
|
||||
<input type="hidden" name="id" id="id" class="form-control" value="${bean.id}">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 采样单编号:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${bean.code}</p>
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">* 采样类型:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${bean.sampleTypeName}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">* 需求报告日期:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${bean.reportDate.substring(0,10)}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">* 检验审核人:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${bean.auditUserName}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</form>
|
||||
<table id="tableView"></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="updateSaveFun()">保存--%>
|
||||
<%-- </button>--%>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
1
WebRoot/jsp/whp/test/WhpTaskItemCurveAdd.jsp
Normal file
1
WebRoot/jsp/whp/test/WhpTaskItemCurveAdd.jsp
Normal file
File diff suppressed because one or more lines are too long
1
WebRoot/jsp/whp/test/WhpTaskItemCurveEdit.jsp
Normal file
1
WebRoot/jsp/whp/test/WhpTaskItemCurveEdit.jsp
Normal file
File diff suppressed because one or more lines are too long
1
WebRoot/jsp/whp/test/WhpTaskItemCurveList.jsp
Normal file
1
WebRoot/jsp/whp/test/WhpTaskItemCurveList.jsp
Normal file
File diff suppressed because one or more lines are too long
194
WebRoot/jsp/whp/text/Test.jsp
Normal file
194
WebRoot/jsp/whp/text/Test.jsp
Normal file
@ -0,0 +1,194 @@
|
||||
<%@page import="com.sipai.entity.base.ServerObject" %>
|
||||
<%@ 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" %>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security" %>
|
||||
|
||||
<%String serverPath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort();%>
|
||||
<%String contextPath = request.getContextPath();%>
|
||||
|
||||
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%>
|
||||
</title>
|
||||
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<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;*/
|
||||
/*}*/
|
||||
|
||||
|
||||
.sampling {
|
||||
margin: 0 auto;
|
||||
border-collapse: collapse;
|
||||
/* border: 0.5px solid black; */
|
||||
width: 1000px;
|
||||
}
|
||||
|
||||
.sampling th {
|
||||
text-align: center;
|
||||
font-size: 32px;
|
||||
line-height: 80px;
|
||||
}
|
||||
|
||||
.sampling td {
|
||||
border: 0.5px solid black;
|
||||
line-height: 2em;
|
||||
word-wrap: break-word;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.sampling .content {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.sampling .title {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.sampling .indent {
|
||||
/* text-indent: 1em; */
|
||||
padding: 2px 5px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
function printSaveFun(myDiv) {
|
||||
$('#printContext').show();
|
||||
var printHtml = document.getElementById(myDiv).innerHTML;
|
||||
var wind = window.open("", "newwin", "width=1550,height=565,top=80,left=80,toolbar=no,scrollbars=yes,menubar=no");
|
||||
var link = document.createElement('link');
|
||||
link.type = 'text/css';
|
||||
link.rel = 'stylesheet';
|
||||
link.href = '<%=serverPath%><%=contextPath%>/plugins/bootstrap-ext/dist/bootstrap.min.css';
|
||||
wind.document.head.appendChild(link);
|
||||
wind.document.body.innerHTML = printHtml;
|
||||
wind.print();
|
||||
wind.close();
|
||||
// $('#printContext').hide();
|
||||
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div class="wrapper">
|
||||
<!-- 引用top -->
|
||||
<%-- <jsp:include page="/jsp/top.jsp"></jsp:include> --%>
|
||||
<!-- 菜单栏 -->
|
||||
<%-- <jsp:include page="/jsp/left.jsp"></jsp:include> --%>
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<section class="content-header">
|
||||
<h1 id="head_title"></h1>
|
||||
<ol class="breadcrumb">
|
||||
<li><a id='head_firstlevel' href="#"><i class="fa fa-dashboard"></i> </a></li>
|
||||
<!-- <li class="active">Here</li> -->
|
||||
</ol>
|
||||
</section>
|
||||
<!-- Main content -->
|
||||
<section class="content container-fluid">
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="subDiv"></div>
|
||||
<div id="menu4SelectDiv"></div>
|
||||
<div>
|
||||
<div class="form-group form-inline" style="padding:0;height: 15px;">
|
||||
<div class="form-group orm-inline">
|
||||
<div class="input-group input-group-sm " style="padding: 0px 10px">
|
||||
<div class="wyb-excel" id="printContext" style="width:100%;margin: 0 auto;">
|
||||
<table class="sampling">
|
||||
<tr>
|
||||
<th colspan="16">
|
||||
采样单
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="4" class="title">采样单编号</td>
|
||||
<td colspan="4" class="indent">${id}</td>
|
||||
<td colspan="4" class="title">采样类型</td>
|
||||
<td colspan="4" class="indent">${type}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="4" class="title">计划采样日期</td>
|
||||
<td colspan="4" class="indent">${planDate}</td>
|
||||
<td colspan="4" class="title">要求报告日期</td>
|
||||
<td colspan="4" class="indent">${date}</td>
|
||||
</tr>
|
||||
<tr class="content title">
|
||||
<td colspan="1">序号</td>
|
||||
<td colspan="3">样品编号</td>
|
||||
<td colspan="2">地点</td>
|
||||
<td colspan="2">是否检测</td>
|
||||
<td colspan="4">检测项目</td>
|
||||
<td colspan="2">采样人</td>
|
||||
<td colspan="2">采样日期</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<c:forEach items="${list}" var="item">
|
||||
<tr>
|
||||
<td class="content" colspan="1" width="6.25%">${item.id}</td>
|
||||
<td class="content" colspan="3" width="18.75%">${item.name}</td>
|
||||
<td class="indent" colspan="2" width="12.5%">${item.address}</td>
|
||||
<td class="content" colspan="2"
|
||||
width="12.5%">${item.status ? '√' : '×'}</td>
|
||||
<td class="indent" colspan="4" width="25%">${item.content}</td>
|
||||
<td class="content" colspan="2" width="12.5%">${item.user}</td>
|
||||
<td class="content" colspan="2" width="12.5%">${item.date}</td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
|
||||
|
||||
</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="printSaveFun('printContext')">打印
|
||||
</button>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
|
||||
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include> --%>
|
||||
<%-- <jsp:include page="/jsp/side.jsp"></jsp:include> --%>
|
||||
</div>
|
||||
</body>
|
||||
<!-- 引入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>
|
||||
512
WebRoot/jsp/whp/text/Watch.jsp
Normal file
512
WebRoot/jsp/whp/text/Watch.jsp
Normal file
@ -0,0 +1,512 @@
|
||||
<%@ 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 () {
|
||||
|
||||
statusConditonDropDown();
|
||||
typeConditionDropDown();
|
||||
initTableList();
|
||||
//入库日期
|
||||
$("#inputTimeSelect").datetimepicker({
|
||||
// startDate: date,
|
||||
language: 'zh-CN',
|
||||
format: 'yyyy-mm-dd hh:ii:ss',
|
||||
startView: "month", //初始化视图是‘年’
|
||||
minView: 1,
|
||||
maxView: "year",
|
||||
autoclose: true
|
||||
// todayBtn: "linked"
|
||||
});
|
||||
});
|
||||
//导出和打印
|
||||
var exportFun = function () {
|
||||
var paramString = ""
|
||||
paramString = "liquidWasteType=" + $('#typeCondition').val()
|
||||
var status = $('#statusCondition').val();
|
||||
if (status != null) {
|
||||
paramString = "&status=" + status
|
||||
}
|
||||
var likeString = $('#likeString').val();
|
||||
if (likeString != null && likeString != '') {
|
||||
paramString = "&likeString=" + likeString
|
||||
}
|
||||
window.open(ext.contextPath + "/whp/liquidWasteDispose/WhpLiquidWasteDispose/export.do?" + paramString);
|
||||
};
|
||||
// 导出和打印
|
||||
var exportDialogFun = function () {
|
||||
stopBubbleDefaultEvent();
|
||||
// {typeCondition: typeCondition},
|
||||
// var typeCondition=$('#typeCondition').val()
|
||||
$.post(ext.contextPath + '/whp/liquidWasteDispose/WhpLiquidWasteDispose/preview.do', function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
//编辑弹窗
|
||||
var editFun = function (id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/whp/liquidWasteDispose/WhpLiquidWasteDispose/editDispose.do', {id: id}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
//详情弹窗
|
||||
var viewFun = function (id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/whp/liquidWasteDispose/WhpLiquidWasteDispose/viewDispose.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/liquidWasteDispose/WhpLiquidWasteDispose/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/liquidWasteDispose/WhpLiquidWasteDispose/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 initTableList = function () {
|
||||
timeRangeEnd = null;
|
||||
timeRangeBegin = null;
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/whp/liquidWasteDispose/WhpLiquidWasteDispose/getListDispose.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,
|
||||
inputTime: $('#inputTimeSelect').val(),
|
||||
likeString: $('#likeString').val(),
|
||||
status: $('#statusCondition').val(),
|
||||
liquidWasteType: $('#typeCondition').val()
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
//detailView: true,//父子表
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
},
|
||||
{
|
||||
field: 'liquidWasteTypeName',
|
||||
title: '采样单编号',
|
||||
align: 'center',
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'inputTime', title: '计划采样日期', align: 'center', valign: 'middle',
|
||||
formatter: function (value) {
|
||||
return value.replace(/\.+\w*/, '')
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'source',
|
||||
title: '采样类型',
|
||||
align: 'center',
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'number', title: '要求报告日期', align: 'center', valign: 'middle'
|
||||
}, {
|
||||
field: 'containerType',
|
||||
title: '样品编号',
|
||||
align: 'center',
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'capacity', title: '地点', align: 'center', valign: 'middle'
|
||||
}, {
|
||||
field: 'location',
|
||||
title: '采样人',
|
||||
align: 'center',
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'transportUserName',
|
||||
title: '采样时间',
|
||||
align: 'center',
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'repositionUserName',
|
||||
title: '任务状态',
|
||||
align: 'center',
|
||||
valign: 'middle'
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 160, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts = '';
|
||||
// 已处置的不能编辑删除
|
||||
if (row.status == 1) {
|
||||
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>';
|
||||
}
|
||||
if (row.status == 2) {
|
||||
buts += '<button class="btn btn-default btn-sm" title="详情" onclick="viewFun(\'' + row.id + '\')"><i class="fa fa-eye"></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 statusConditonDropDown() {
|
||||
var select_Data = JSON.parse('${statusConditionDropDown}');
|
||||
var select_3 = $("#statusCondition").select2({
|
||||
data: select_Data,
|
||||
cache: false,
|
||||
placeholder: '全部',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
multiple: 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('').trigger('change');
|
||||
}
|
||||
|
||||
//废液代码及名称
|
||||
function typeConditionDropDown() {
|
||||
var select_Data = JSON.parse('${typeConditionDropDown}');
|
||||
var select_3 = $("#typeCondition").select2({
|
||||
data: select_Data,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
// allowClear: true,//允许清空
|
||||
multiple: 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'});
|
||||
// var temp = $("#typeCondition option:eq(1)").val();
|
||||
// $("#typeCondition").attr('value', temp);
|
||||
/* $("#typeCondition").selectpicker('render');*/
|
||||
// select_3.val('').trigger('change');
|
||||
|
||||
}
|
||||
|
||||
|
||||
function filtrateSome() {
|
||||
var showType = ""
|
||||
if (showType == true) {
|
||||
document.getElementById("showBtnSearch").disabled = true
|
||||
showType = false;
|
||||
} else {
|
||||
document.getElementById("showBtnSearch").disabled = false
|
||||
showType = true;
|
||||
}
|
||||
|
||||
}
|
||||
</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="exportFun();"
|
||||
style="margin-right: 15px"><i
|
||||
class="fa fa-plus"></i> 导出和打印
|
||||
</button>
|
||||
--%>
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="exportDialogFun();"
|
||||
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="typeCondition" id="typeCondition"
|
||||
style="width:180px;height: 30px">
|
||||
<option value=" " selected="true">全部</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-label">地点:</label>
|
||||
|
||||
<div class="input-group date">
|
||||
<div class="input-group-addon">
|
||||
<i class="fa fa-calendar"></i>
|
||||
</div>
|
||||
<input type="text" class="form-control" id="inputTimeSelect" name="inputTimeSelect"
|
||||
value="" placeholder="请选择.."/>
|
||||
</div>
|
||||
|
||||
<label class="form-label">采样人:</label>
|
||||
<select class="form-control select2" name="statusCondition" id="statusCondition"
|
||||
style="width:180px;height: 30px">
|
||||
</select>
|
||||
<label class="form-label">计划采样日期:</label>
|
||||
<select class="form-control select2" name="statusCondition" id="statusCondition"
|
||||
style="width:180px;height: 30px">
|
||||
</select>
|
||||
|
||||
<button onclick="filtrateSome()">更多筛选</button>
|
||||
|
||||
<div id="showBtnSearch">
|
||||
<label class="form-label">采样类型:</label>
|
||||
<input type="text" class="form-control" id="inputTimeSelect" name="inputTimeSelect"
|
||||
value="" placeholder="请输入.."/>
|
||||
<label class="form-label">采样类型:</label>
|
||||
<select class="form-control select2" name="statusCondition" id="statusCondition"
|
||||
style="width:180px;height: 30px">
|
||||
</select>
|
||||
<label class="form-label">采样时间:</label>
|
||||
<select class="form-control select2" name="statusCondition" id="statusCondition"
|
||||
style="width:180px;height: 30px">
|
||||
</select>
|
||||
<label class="form-label">要求报告日期:</label>
|
||||
<select class="form-control select2" name="statusCondition" id="statusCondition"
|
||||
style="width:180px;height: 30px">
|
||||
</select>
|
||||
</div>
|
||||
</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