first commit

This commit is contained in:
2026-01-16 14:13:44 +08:00
commit 903ff8d495
34603 changed files with 8585054 additions and 0 deletions

View 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>

View 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">&times;</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>

View 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>

View 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">&times;</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>

View 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">&times;</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>

View 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>

View File

@ -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">&times;</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>

View File

@ -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">&times;</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>

View 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">&times;</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>

View 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">&times;</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>

View 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'>&nbsp;&nbsp;<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">&times;</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>

View 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">&times;</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>

View 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">&times;</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>

View 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>

View 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">&times;</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>

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