653 lines
30 KiB
Plaintext
653 lines
30 KiB
Plaintext
<%@ page language="java" pageEncoding="UTF-8" %>
|
||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
|
||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
|
||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
|
||
<%@ page import="com.sipai.entity.base.ServerObject" %>
|
||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security" %>
|
||
|
||
<!DOCTYPE html>
|
||
|
||
<style type="text/css">
|
||
.select2-container .select2-selection--single {
|
||
height: 34px;
|
||
line-height: 34px;
|
||
}
|
||
|
||
.select2-selection__arrow {
|
||
margin-top: 3px;
|
||
}
|
||
|
||
.foot {
|
||
display: flex;
|
||
padding-left: 50px;
|
||
}
|
||
|
||
|
||
.form-horizontal {
|
||
padding-top: 20px;
|
||
|
||
}
|
||
|
||
.has-error .checkbox, .has-error .checkbox-inline, .has-error .control-label, .has-error .help-block, .has-error .radio, .has-error .radio-inline, .has-error.checkbox label, .has-error.checkbox-inline label, .has-error.radio label, .has-error.radio-inline labe {
|
||
color: #ffffff;
|
||
}
|
||
|
||
.form-group.has-error .help-block {
|
||
color: #ffffff;
|
||
}
|
||
|
||
.help-block {
|
||
color: #ffffff;
|
||
}
|
||
|
||
.select2-container--default .select2-selection--single {
|
||
border: none;
|
||
}
|
||
|
||
.select2-container--default .select2-selection--single, .select2-selection .select2-selection--single {
|
||
border: none;
|
||
}
|
||
|
||
.select2-container--default .select2-selection--single .select2-selection__arrow b {
|
||
border: none;
|
||
border-style: unset
|
||
}
|
||
|
||
.select2-container--default.select2-container--disabled .select2-selection--single {
|
||
background-color: #FFFFFF;
|
||
}
|
||
|
||
.right {
|
||
margin-left: 50px;
|
||
}
|
||
|
||
.buttonclass {
|
||
background-color: #ffffff;
|
||
color: black;
|
||
border-color: gray;
|
||
height: 30px;
|
||
width: 52px;
|
||
}
|
||
.modal-footer{
|
||
padding: 0;
|
||
}
|
||
</style>
|
||
<script type="text/javascript">
|
||
var basiCurveslist;//基础描述
|
||
var processCurveslist;//过程公式
|
||
var contantCurveslist;//常量
|
||
var curve;//结果公式
|
||
var bean;//样品信息
|
||
var confirmStr;
|
||
$(function () {
|
||
|
||
initconfirm();
|
||
inittest();
|
||
|
||
});
|
||
|
||
|
||
function initconfirm() {
|
||
confirmStr=
|
||
" <input type=\"hidden\" name=\"testDate\" id=\"testDate\" class=\"form-control\" value=\"${confirm.testDate}\">" +
|
||
" <input type=\"hidden\" name=\"temperature\" id=\"temperature\" class=\"form-control\" value=\"${confirm.temperature}\">" +
|
||
" <input type=\"hidden\" name=\"reagent\" id=\"reagent\" class=\"form-control\" value=\"${confirm.reagent}\">" +
|
||
" <input type=\"hidden\" name=\"equipmentId\" id=\"equipmentId\" class=\"form-control\" value=\"${confirm.equipmentId}\">" +
|
||
" <input type=\"hidden\" name=\"equipmentCode\" id=\"equipmentCode\" class=\"form-control\" value=\"${confirm.equipmentCode}\">" +
|
||
" <input type=\"hidden\" name=\"testConfirmId\" id=\"testConfirmId\" class=\"form-control\" value=\"${confirm.id}\">" +
|
||
" <input type=\"hidden\" name=\"testAddress\" id=\"testAddress\" class=\"form-control\" value=\"${confirm.testAddress}\">" ;
|
||
}
|
||
function initbtn(type){
|
||
var btndtr="";
|
||
btndtr+="<button type=\"button\" class=\"btn btn-default \" data-dismiss=\"modal\">关闭 </button> " ;
|
||
/*if(type==0)
|
||
{
|
||
btndtr+=" <button type=\"button\" class=\"btn btn-primary \" style=\"margin-left: 10px\" onclick=\"updataList7()\">保存并提交 </button> "
|
||
}else{*/
|
||
|
||
|
||
btndtr+= " <button type=\"button\" class=\"btn btn-primary \" style=\"margin-left: 10px\" onclick=\"updataList6()\">保存 </button> "
|
||
// }
|
||
$("#btndiv").html(btndtr);
|
||
|
||
}
|
||
var listcount;
|
||
|
||
function inittest() {
|
||
|
||
$.ajax({
|
||
url: ext.contextPath + "/whp/test/WhpSamplingPlanTaskTestItem/doNextedit.do?id=${itemid}&unitId=${unitId}",
|
||
type: 'POST',
|
||
|
||
async: false,
|
||
cache: false,
|
||
contentType: false,
|
||
processData: false,
|
||
dataType: 'json',
|
||
success: function (data) {
|
||
if (data.code==0)
|
||
{
|
||
inintdata(data)
|
||
listcount=data.listcount;
|
||
initbtn(data.listcount)
|
||
}else{
|
||
// closeModal('subEdit');
|
||
|
||
}
|
||
},
|
||
error: function (data) {
|
||
// console.log(data+"fffff")
|
||
}
|
||
});
|
||
|
||
}
|
||
function nexttest() {
|
||
|
||
var formData = new FormData($("#editForm")[0]);
|
||
$.ajax({
|
||
url: ext.contextPath + "/whp/test/WhpSamplingPlanTaskTestItem/doNextedit.do",
|
||
type: 'POST',
|
||
data: formData,
|
||
async: false,
|
||
cache: false,
|
||
contentType: false,
|
||
processData: false,
|
||
dataType: 'json',
|
||
success: function (data) {
|
||
if (data.code==0)
|
||
{
|
||
inintdata(data)
|
||
listcount=data.listcount;
|
||
initbtn(data.listcount)
|
||
}else{
|
||
closeModal('subEdit');
|
||
|
||
}
|
||
},
|
||
error: function (data) {
|
||
// console.log(data+"fffff")
|
||
}
|
||
});
|
||
|
||
}
|
||
|
||
|
||
function inintdata(data){
|
||
basiCurveslist=data.basiCurveslist;//基础描述
|
||
processCurveslist=data.processCurveslist;//过程公式
|
||
contantCurveslist=data.contantCurveslist;//常量
|
||
curve=data.curve;//结果公式
|
||
bean=data.bean;//样品信息
|
||
let htmlstr="";
|
||
|
||
htmlstr +="<form class=\"form-horizontal\" id=\"editForm\" enctype=\"multipart/form-data\">"+
|
||
" <div id=\"alertDiv\"></div>" +
|
||
" <!-- 界面提醒div强制id为alertdiv -->" +
|
||
// confirmStr+
|
||
" <input type=\"hidden\" name=\"id\" id=\"id\" class=\"form-control\" value=\""+bean.id+"\">" +
|
||
" <input type=\"hidden\" name=\"planCode\" id=\"planCode\" class=\"form-control\"" +
|
||
" value=\""+bean.planCode+"\">" +
|
||
" <input type=\"hidden\" name=\"sampleCode\" id=\"sampleCode\" class=\"form-control\"" +
|
||
" value=\""+bean.sampleCode+"\">" +
|
||
" <input type=\"hidden\" name=\"testItemId\" id=\"testItemId\" class=\"form-control\"" +
|
||
" value=\""+bean.testItemId+"\">" +
|
||
" <input type=\"hidden\" name=\"unitId\" id=\"unitId\" class=\"form-control\"" +
|
||
" value=\""+unitId+"\">" +
|
||
" <div class=\"form-group\">" +
|
||
" <label class=\"col-sm-2 control-label\"> 采样单编号</label>" +
|
||
" <div class=\"col-sm-2\">" +
|
||
" <p class=\"form-control-static\">"+bean.planCode+"</p>" +
|
||
" </div>" +
|
||
" <label class=\"col-sm-2 control-label\"> 检测项目</label>" +
|
||
" <div class=\"col-sm-2\">" +
|
||
" <p class=\"form-control-static\">"+bean.testItemName+"</p>" +
|
||
" </div>" +
|
||
" <label class=\"col-sm-2 control-label\"> 结果公式</label>" +
|
||
" <div class=\"col-sm-2\">" +
|
||
" <p class=\"form-control-static\">"+bean.workCurveName+"</p>" +
|
||
" </div>" +
|
||
" </div>" +
|
||
" <div class=\"form-group\">" +
|
||
" <label class=\"col-sm-2 control-label\"> 样品编号</label>" +
|
||
" <div class=\"col-sm-2\">" +
|
||
" <p class=\"form-control-static\">"+bean.sampleCode+"</p>" +
|
||
" </div>" +
|
||
" </div>" ;
|
||
|
||
htmlstr +=" <div class=\"form-group\" id=\"cont\">" ;
|
||
for (var i=0;i<basiCurveslist.length; i++){
|
||
|
||
htmlstr +=" <label style=\"margin-top: 13px;\"" +
|
||
" class=\"col-sm-2 control-label\">"+basiCurveslist[i].name+"</label>" +
|
||
" <div class=\"col-sm-2\">" +
|
||
" <input id=\"contantid_"+basiCurveslist[i].id+"\"" +
|
||
" name=\"basicCurvelist["+i+"].calculated_value\" type=\"text\"" +
|
||
" value=\""+basiCurveslist[i].default_value+"\" required=\"true\"" +
|
||
" style=\"margin-top: 15px\" class=\"form-control\"/>" +
|
||
" <input id=\"contantvalue_"+basiCurveslist[i].id+"\"" +
|
||
" name=\"basicCurvelist["+i+"].working_curve_id\" type=\"hidden\"" +
|
||
" style=\"margin-top: 1px\" value=\""+basiCurveslist[i].id+"\" class=\"form-control\"/>" +
|
||
" <input id=\"contantvalue_"+basiCurveslist[i].id+"\" name=\"basicCurvelist["+i+"].id\"" +
|
||
" type=\"hidden\"" +
|
||
" style=\"margin-top: 15px\" value=\""+basiCurveslist[i].taskitemCureid+"\"" +
|
||
" class=\"form-control\"/>" +
|
||
" <span style=\"margin-left: 12em;margin-top: -2em;position: absolute\">"+basiCurveslist[i].unit+"</span>" +
|
||
" </div>" ;
|
||
|
||
}
|
||
|
||
htmlstr += " </div>" +
|
||
" <div class=\"form-group\">" +
|
||
" <label class=\"col-sm-2 control-label\"> 常量:</label>" +
|
||
" </div>" +
|
||
" <div class=\"form-group\">" ;
|
||
/// console.log("contantCurveslist",contantCurveslist)
|
||
for (var i=0;i<contantCurveslist.length;i++)
|
||
{
|
||
|
||
htmlstr += " <label style=\"margin-top: 13px;\"" +
|
||
" class=\"col-sm-2 control-label\">"+contantCurveslist[i].mPoint.disname+"</label>" +
|
||
" <div class=\"col-sm-2\">" +
|
||
" <input id=\"contantid_"+contantCurveslist[i].id+"\"" +
|
||
" name=\"contantCurvelist["+i+"].parmvalue\" type=\"text\"" +
|
||
" value=\""+contantCurveslist[i].default_value+"\" required=\"true\"" +
|
||
" style=\"margin-top: 15px\" class=\"form-control\"/>" +
|
||
" <input id=\"contantvalue_"+contantCurveslist[i].id+"\"" +
|
||
" name=\"contantCurvelist["+i+"].mpointcode\" type=\"hidden\"" +
|
||
" value=\""+contantCurveslist[i].mPoint.mpointcode+"\" class=\"form-control\"/>" +
|
||
" <input id=\"contantvalue_"+contantCurveslist[i].id+"\" name=\"contantCurvelist["+i+"].id\"" +
|
||
" type=\"hidden\" value=\""+contantCurveslist[i].taskitemCureid+"\"" +
|
||
" class=\"form-control\"/>" +
|
||
contantCurveslist[i].mPoint.unit +
|
||
" </div>" ;
|
||
|
||
}
|
||
|
||
|
||
htmlstr += " </div>" ;
|
||
//console.log("processCurveslist",processCurveslist)
|
||
for(var i=0;i<processCurveslist.length;i++)
|
||
{
|
||
htmlstr += // " <form class=\"form-horizontal\" id=\"processcurve"+i+"\" enctype=\"multipart/form-data\">" +
|
||
" <div class=\"form-group\">" +
|
||
" <label class=\"col-sm-4 control-label\"" +
|
||
" style=\"text-align: left\" >"+processCurveslist[i].mPoint.disname+":</label>" +
|
||
" <input type=\"hidden\" class=\"form-control\"" +
|
||
" name=\"processCurveslist["+i+"].mpointcode\"" +
|
||
" value=\""+processCurveslist[i].mPoint.mpointcode+"\"/>" +
|
||
" </div>" +
|
||
" <div class=\"form-group\">" ;
|
||
|
||
|
||
for(var j=0;j<processCurveslist[i].mPoint.mPointPropSource.length;j++)
|
||
{
|
||
var formuitem=processCurveslist[i].mPoint.mPointPropSource[j];
|
||
htmlstr += " <label class=\"col-sm-2 control-label\">"+formuitem.indexDetails+"</label>" +
|
||
" <div class=\"col-sm-2\">" +
|
||
" <input type=\"text\" class=\"form-control\" required=\"true\"" +
|
||
" id=\"processCurveslist["+i+"].PointFormulalist["+j+"].id\"" +
|
||
" name=\"processCurveslist["+i+"].mPointFormulalist["+j+"].MPoint.parmvalue\"" +
|
||
" value=\""+formuitem.mPoint.parmvalue+"\"/>" +
|
||
" <input type=\"hidden\" class=\"form-control\"" +
|
||
" name=\"processCurveslist["+i+"].mPointFormulalist["+j+"].mpid\"" +
|
||
" value=\""+formuitem.mpid+"\"/>" +
|
||
" </div>" ;
|
||
}
|
||
|
||
|
||
htmlstr += " <label class=\"col-sm-2 control-label\" style=\"color: blue\"> "+processCurveslist[i].mPoint.disname+"</label>" +
|
||
" <div class=\"col-sm-2 modal-footer\" >" +
|
||
" <input type=\"text\" class=\"form-control\" id=\""+processCurveslist[i].mPoint.mpointcode+"\"" +
|
||
// " required=\"true\"" +
|
||
" name=\"processCurveslist["+i+"].parmvalue\" style=\"width: 64%;margin-left: 1em;\"" +
|
||
" value=\""+processCurveslist[i].mPoint.parmvalue+" \"/>" +
|
||
|
||
" </div>" +
|
||
" </div>";
|
||
}
|
||
// console.log("curve",curve)
|
||
for(var i=0;i<curve.length;i++)
|
||
{
|
||
var item=curve[i];
|
||
|
||
htmlstr +=
|
||
" <div class=\"form-group\">" +
|
||
" <label class=\"col-sm-4 control-label\" style=\"text-align: left\">"+item.mPoint.disname +" :</label>" +
|
||
" <input type=\"hidden\" class=\"form-control\"" +
|
||
" name=\"curves["+i+"].mpointcode\"" +
|
||
" value=\""+item.mPoint.mpointcode+"\"/>" +
|
||
" </div>" +
|
||
" <div class=\"form-group\">" ;
|
||
|
||
for(var j=0;j<item.mPoint.mPointPropSource.length;j++)
|
||
{
|
||
var formuitem=item.mPoint.mPointPropSource[j];
|
||
|
||
htmlstr += " <label class=\"col-sm-2 control-label\">"+formuitem.indexDetails+"</label>" +
|
||
" <div class=\"col-sm-2\">" +
|
||
" <input type=\"text\" class=\"form-control\"" +
|
||
" id=\"curves["+i+"].PointFormulalist["+j+"].id\"" +
|
||
" required=\"true\"" +
|
||
" name=\"curves["+i+"].mPointFormulalist["+j+"].MPoint.parmvalue\"" +
|
||
" value=\""+formuitem.mPoint.parmvalue+"\"/>" +
|
||
" <input type=\"hidden\" class=\"form-control\"" +
|
||
" name=\"curves["+i+"].mPointFormulalist["+j+"].mpid\"" +
|
||
" value=\""+formuitem.mpid+"\"/>" +
|
||
" </div>" ;
|
||
|
||
}
|
||
htmlstr += " <label class=\"col-sm-2 control-label\" style=\"color: blue\"> "+item.mPoint.disname+"</label>" +
|
||
" <div class=\"col-sm-2 modal-footer\" >" +
|
||
" <input type=\"text\" class=\"form-control\" id=\""+item.mPoint.mpointcode+"\" style=\"width: 64%;margin-left: 1em;\" required=\"true\"" +
|
||
" name=\"curves["+i+"].parmvalue\"" +
|
||
" value=\""+item.mPoint.parmvalue+" \"/>" +
|
||
" <button type=\"button\" onclick=\"formulaClick()\"" +
|
||
" class=\"btn btn-primary buttonclass\" style=\" margin-top: -4em;\">计算" +
|
||
" </button>" +
|
||
" </div>" +
|
||
" </div>" ;
|
||
|
||
}
|
||
htmlstr+= " </form>" ;
|
||
|
||
//替换
|
||
var reg = new RegExp("undefined","g");
|
||
htmlstr = htmlstr.replace(reg,"");
|
||
$("#contdiv").html(htmlstr);
|
||
|
||
}
|
||
function updataList6() {
|
||
|
||
//var process =processCurveslist;
|
||
//console.log(process);
|
||
// var jsonObj = $.parseJSON(process);
|
||
// var formids = "#editForm";
|
||
|
||
// var curves = curve;
|
||
|
||
// console.log("formids=="+formids);
|
||
$("#editForm").bootstrapValidator('validate');//提交验证
|
||
if ($("#editForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||
var formData = new FormData($("#editForm")[0]);
|
||
|
||
/*
|
||
|
||
for (var i = 0; i < process.length; i++) {
|
||
|
||
var datapre = new FormData($("#processcurve" + i)[0]);
|
||
for (var key of datapre.keys()) {
|
||
//console.log(datapre.get(key))
|
||
formData.set(key, datapre.get(key));
|
||
}
|
||
|
||
}
|
||
|
||
for (var i = 0; i < curves.length; i++) {
|
||
|
||
var datapre = new FormData($("#curveeditForm" + i)[0]);
|
||
|
||
for (var key of datapre.keys()) {
|
||
// console.log(datapre.get(key))
|
||
formData.set(key, datapre.get(key));
|
||
}
|
||
|
||
}
|
||
*/
|
||
|
||
$.ajax({
|
||
url: ext.contextPath + "/whp/test/WhpSamplingPlanTaskTestItem/updateResult.do",
|
||
type: 'POST',
|
||
data: formData,
|
||
async: false,
|
||
cache: false,
|
||
contentType: false,
|
||
processData: false,
|
||
dataType: 'json',
|
||
success: function (data) {
|
||
console.log(data)
|
||
},
|
||
error: function (data) {
|
||
// console.log(data+"fffff")
|
||
}
|
||
});
|
||
|
||
$.ajax({
|
||
url: ext.contextPath + "/whp/test/WhpSamplingPlanTaskTestItem/update.do",
|
||
type: 'POST',
|
||
data: formData,
|
||
async: false,
|
||
cache: false,
|
||
contentType: false,
|
||
processData: false,
|
||
dataType: 'json',
|
||
success: function (data) {
|
||
// console.log(data)
|
||
if (data.code == 1) {
|
||
$("#tableFunList1").bootstrapTable('refresh');
|
||
closeModal('subEdit');
|
||
//nexttest();
|
||
} else {
|
||
showAlert('d', '保存失败!' + data.msg);
|
||
}
|
||
},
|
||
error: function (data) {
|
||
// console.log(data+"fffff")
|
||
}
|
||
});
|
||
}
|
||
}
|
||
function updataList7() {
|
||
|
||
//var process =processCurveslist;
|
||
//console.log(process);
|
||
// var jsonObj = $.parseJSON(process);
|
||
//var formids = "#editForm";
|
||
|
||
//var curves = curve;
|
||
|
||
// console.log("formids=="+formids);
|
||
$("#editForm").bootstrapValidator('validate');//提交验证
|
||
if ($("#editForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||
var formData = new FormData($("#editForm")[0]);
|
||
|
||
/*
|
||
for (var i = 0; i < process.length; i++) {
|
||
|
||
var datapre = new FormData($("#processcurve" + i)[0]);
|
||
for (var key of datapre.keys()) {
|
||
//console.log(datapre.get(key))
|
||
formData.set(key, datapre.get(key));
|
||
}
|
||
|
||
}
|
||
|
||
for (var i = 0; i < curves.length; i++) {
|
||
|
||
var datapre = new FormData($("#curveeditForm" + i)[0]);
|
||
|
||
for (var key of datapre.keys()) {
|
||
// console.log(datapre.get(key))
|
||
formData.set(key, datapre.get(key));
|
||
}
|
||
|
||
}*/
|
||
|
||
$.ajax({
|
||
url: ext.contextPath + "/whp/test/WhpSamplingPlanTaskTestItem/updateResult.do",
|
||
type: 'POST',
|
||
data: formData,
|
||
async: false,
|
||
cache: false,
|
||
contentType: false,
|
||
processData: false,
|
||
dataType: 'json',
|
||
success: function (data) {
|
||
console.log(data)
|
||
},
|
||
error: function (data) {
|
||
// console.log(data+"fffff")
|
||
}
|
||
});
|
||
|
||
$.ajax({
|
||
url: ext.contextPath + "/whp/test/WhpSamplingPlanTaskTestItem/updatesubmint.do",
|
||
type: 'POST',
|
||
data: formData,
|
||
async: false,
|
||
cache: false,
|
||
contentType: false,
|
||
processData: false,
|
||
dataType: 'json',
|
||
success: function (data) {
|
||
// console.log(data)
|
||
if (data.code == 1) {
|
||
//刷新样品 列表
|
||
//$("#tableFunList1").bootstrapTable('refresh');
|
||
|
||
closeModal('subEdit');
|
||
//刷新 我的任务列表
|
||
$("#tableTask").bootstrapTable('refresh');
|
||
closeModal('subModal1');
|
||
|
||
} else {
|
||
showAlert('d', '保存失败!' + data.msg);
|
||
}
|
||
},
|
||
error: function (data) {
|
||
// console.log(data+"fffff")
|
||
}
|
||
});
|
||
}
|
||
}
|
||
|
||
/* function calculateClick(formid) {
|
||
$("#"+formid).bootstrapValidator('validate');//提交验证
|
||
if ($("#"+formid).data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||
var formData = new FormData($("#"+formid)[0]);
|
||
// var formData1 = new FormData($("#editForm1")[0]);
|
||
// var formData2 = new FormData($("#editForm2")[0]);
|
||
// var forlist=formData+formData1+formData2
|
||
console.log(formData,'forlistforlist')
|
||
$.ajax({
|
||
url: ext.contextPath + "/whp/test/WhpSamplingPlanTaskTestItem/update.do",
|
||
type: 'POST',
|
||
data: formData,
|
||
async: false,
|
||
cache: false,
|
||
contentType: false,
|
||
processData: false,
|
||
dataType: 'json',
|
||
success: function (data) {
|
||
// console.log(data)
|
||
if (data.code == 1) {
|
||
// $("#tableFunList1").bootstrapTable('refresh');
|
||
// closeModal('subEdit');
|
||
} else {
|
||
showAlert('d', '保存失败!' + data.msg);
|
||
}
|
||
},
|
||
error: function (data) {
|
||
}
|
||
});
|
||
}
|
||
}*/
|
||
function formulaClick() {
|
||
$("#editForm").bootstrapValidator('validate');//提交验证
|
||
if ($("#editForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||
|
||
|
||
/* $("#" + formid).bootstrapValidator('validate');//提交验证
|
||
if ($("#" + formid).data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||
var formData = new FormData($("#" + formid)[0]);
|
||
*/
|
||
var formData = new FormData($("#editForm")[0]);
|
||
|
||
|
||
/* for (var key of contantData.keys()) {
|
||
|
||
formData.set(key, contantData.get(key));
|
||
}
|
||
console.log("in")*/
|
||
$.ajax({
|
||
url: ext.contextPath + "/whp/test/WhpSamplingPlanTaskTestItem/getJSResult.do",
|
||
type: 'POST',
|
||
data: formData,
|
||
async: false,
|
||
cache: false,
|
||
contentType: false,
|
||
processData: false,
|
||
dataType: 'json',
|
||
success: function (data) {
|
||
console.log(data)
|
||
if(data.length>0){
|
||
for (let i = 0; i < data.length; i++) {
|
||
let content = data[i];
|
||
$("#"+content.mpid).val(content.value);
|
||
}
|
||
}
|
||
//
|
||
// $("#"+data.mpid).val(data.value)
|
||
},
|
||
error: function (data) {
|
||
}
|
||
});
|
||
|
||
$.ajax({
|
||
url: ext.contextPath + "/whp/test/WhpSamplingPlanTaskTestItem/update.do",
|
||
type: 'POST',
|
||
data: formData,
|
||
async: false,
|
||
cache: false,
|
||
contentType: false,
|
||
processData: false,
|
||
dataType: 'json',
|
||
success: function (data) {
|
||
// console.log(data)
|
||
if (data.code == 1) {
|
||
// $("#tableFunList1").bootstrapTable('refresh');
|
||
// closeModal('subEdit');
|
||
} else {
|
||
showAlert('d', '保存失败!' + data.msg);
|
||
}
|
||
},
|
||
error: function (data) {
|
||
}
|
||
});
|
||
// }
|
||
}
|
||
}
|
||
|
||
|
||
</script>
|
||
<div class="modal fade" id="subEdit">
|
||
<div class="modal-dialog " style="width: 75%">
|
||
<div class="modal-content">
|
||
<div class="modal-header">
|
||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||
<span aria-hidden="true">×</span></button>
|
||
<h4 class="modal-title">检测数据填写</h4>
|
||
</div>
|
||
<div class="modal-body">
|
||
<div class="row">
|
||
<div class="col-md-11 col-xs-13" id="contdiv">
|
||
<!-- 检测内容 -->
|
||
|
||
|
||
</div>
|
||
</div>
|
||
|
||
</div>
|
||
<div class="modal-footer" style="padding: 15px" id="btndiv">
|
||
<!-- 检测按钮 -->
|
||
|
||
</div>
|
||
</div>
|
||
<!-- /.modal-content -->
|
||
</div>
|
||
<!-- /.modal-dialog -->
|
||
</div>
|
||
|
||
|
||
|
||
|