Files
SIPAIIS_WMS_JSSW/WebRoot/jsp/whp/test/WhpSamplingPlanTaskTestConfirmEditConfirm.jsp
2026-01-16 14:13:44 +08:00

575 lines
24 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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