1 line
16 KiB
Plaintext
1 line
16 KiB
Plaintext
<!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 () {
|
||
|
||
var nowDate=new Date()
|
||
|
||
var year=nowDate.getFullYear()
|
||
var month=nowDate.getMonth()+1
|
||
var day=nowDate.getDate()
|
||
if('${bean.inputTime}'=='')
|
||
{
|
||
var fullYear=year+'-'+month+'-'+day
|
||
$("#inputTime").val(fullYear)
|
||
}
|
||
|
||
//登记时间
|
||
$("#inputTime").datepicker({
|
||
language: 'zh-CN',
|
||
autoclose: true,
|
||
todayHighlight: true,
|
||
format: 'yyyy-mm-dd',
|
||
});
|
||
typeConditionDropDownList();
|
||
});
|
||
|
||
//下拉范例,不用删掉
|
||
function typeConditionDropDownList() {
|
||
var select_Data = jQuery.parseJSON('${typeConditionDropDownList}');
|
||
console.log(select_Data);
|
||
var select_3 = $("#liquidWasteType").select2({
|
||
data: select_Data,
|
||
cache: false,
|
||
placeholder: '请选择',//默认文字提示
|
||
// allowClear: true,//允许清空
|
||
escapeMarkup: function (markup) {
|
||
return markup;
|
||
}, // 自定义格式化防止xss注入
|
||
language: "zh-CN",
|
||
minimumInputLength: 0,
|
||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||
formatResult: function formatRepo(repo) {
|
||
return repo.text;
|
||
}, // 函数用来渲染结果
|
||
formatSelection: function formatRepoSelection(repo) {
|
||
return repo.text;
|
||
} // 函数用于呈现当前的选择
|
||
});
|
||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'});
|
||
//单选赋值
|
||
select_3.val('${bean.liquidWasteType}').trigger("change");
|
||
|
||
}
|
||
|
||
//保存
|
||
function updateFun() {
|
||
//console.log($("#editForm").serialize());
|
||
$("#editForm").bootstrapValidator('validate');//提交验证
|
||
if ($("#editForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||
var formData = new FormData($("#editForm")[0]);
|
||
$.ajax({
|
||
url: ext.contextPath + '/whp/liquidWasteDispose/WhpLiquidWasteDispose/update.do',
|
||
type: 'POST',
|
||
data: formData,
|
||
async: false,
|
||
cache: false,
|
||
contentType: false,
|
||
processData: false,
|
||
dataType: 'json',
|
||
success: function (data) {
|
||
// console.log(data)
|
||
if (data.code == 1) {
|
||
$("#table").bootstrapTable('refresh');
|
||
closeModal('subModal');
|
||
} else {
|
||
showAlert('d', '保存失败!' + data.msg);
|
||
}
|
||
},
|
||
error: function (data) {
|
||
}
|
||
});
|
||
}
|
||
}
|
||
|
||
//入库
|
||
function updateSaveFun() {
|
||
$("#editForm").data("bootstrapValidator").updateStatus("createUserName","NOT_VALIDATED", null).validateField("createUserName");
|
||
$("#editForm").data("bootstrapValidator").updateStatus("transportUserName","NOT_VALIDATED", null).validateField("transportUserName");
|
||
$("#editForm").data("bootstrapValidator").updateStatus("repositionUserName","NOT_VALIDATED", null).validateField("repositionUserName");
|
||
$("#editForm").bootstrapValidator('validate');//提交验证
|
||
if ($("#editForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||
var formData = new FormData($("#editForm")[0]);
|
||
$.ajax({
|
||
url: ext.contextPath + '/whp/liquidWasteDispose/WhpLiquidWasteDispose/updateInput.do',
|
||
type: 'POST',
|
||
data: formData,
|
||
async: false,
|
||
cache: false,
|
||
contentType: false,
|
||
processData: false,
|
||
dataType: 'json',
|
||
success: function (data) {
|
||
// console.log(data)
|
||
if (data.code == 1) {
|
||
$("#table").bootstrapTable('refresh');
|
||
closeModal('subModal');
|
||
} else {
|
||
showAlert('d', '保存失败!' + data.msg);
|
||
}
|
||
},
|
||
error: function (data) {
|
||
}
|
||
});
|
||
}
|
||
}
|
||
|
||
$("#editForm").bootstrapValidator({
|
||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||
fields: {
|
||
liquidWasteType: {validators: {notEmpty: {message: '废液代码及名称不能为空'}}},
|
||
inputTime: {trigger:"change",validators: {notEmpty: {message: '入库日期不能为空'}}},
|
||
source: {validators: {notEmpty: {message: '废物来源不能为空'}}},
|
||
number: {validators: {notEmpty: {message: '数量不能为空'}}},
|
||
containerType: {validators: {notEmpty: {message: '容器材质不能为空'}}},
|
||
capacity: {validators: {notEmpty: {message: '容量不能为空'}}},
|
||
location: {validators: {notEmpty: {message: '废物存放位置不能为空'}}},
|
||
createUserName: {validators: {notEmpty: {message: '登记人姓名不能为空'}}},
|
||
transportUserName: {validators: {notEmpty: {message: '废物运送经办人名称不能为空'}}},
|
||
repositionUserName: {validators: {notEmpty: {message: '废物贮存经办人名称不能为空'}}},
|
||
}
|
||
});
|
||
|
||
//登记人
|
||
function selectCreateUser() {
|
||
$.post(ext.contextPath + '/user/userForOneSelect.do',
|
||
{formId: "editForm", hiddenId: "createUserId", textId: "createUserName"},
|
||
function (data) {
|
||
$("#user4SelectDiv").html(data);
|
||
openModal('user4SelectModal');
|
||
});
|
||
};
|
||
|
||
//废物运送经办人
|
||
function selectTransportUser() {
|
||
$.post(ext.contextPath + '/user/userForOneSelect.do',
|
||
{formId: "editForm", hiddenId: "transportUserId", textId: "transportUserName"},
|
||
function (data) {
|
||
$("#user4SelectDiv").html(data);
|
||
openModal('user4SelectModal');
|
||
});
|
||
};
|
||
|
||
//废物贮藏经办人
|
||
function selectRepositionUser() {
|
||
$.post(ext.contextPath + '/user/userForOneSelect.do',
|
||
{formId: "editForm", hiddenId: "repositionUserId", textId: "repositionUserName"},
|
||
function (data) {
|
||
$("#user4SelectDiv").html(data);
|
||
openModal('user4SelectModal');
|
||
});
|
||
};
|
||
|
||
function checklog() {
|
||
|
||
stopBubbleDefaultEvent();
|
||
$.post(ext.contextPath + '/whp/liquidWasteDispose/WhpLiquidWasteDisposeLog/doDisPoseLogList.do', {disposeId: '${bean.id}'}, function (data) {
|
||
$("#logCheckDiv").html(data);
|
||
openModal('checkLogSubModal');
|
||
});
|
||
|
||
}
|
||
|
||
</script>
|
||
<div class="modal fade" id="subModal">
|
||
<div class="modal-dialog modal-lg" style="width: 1200px;">
|
||
<div class="modal-content">
|
||
<div class="modal-header">
|
||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||
<span aria-hidden="true">×</span></button>
|
||
<h4 class="modal-title">修改废液登记</h4>
|
||
</div>
|
||
<div class="modal-body">
|
||
<div class="row">
|
||
<div class="col-md-12 col-xs-13">
|
||
<!-- 新增界面formid强制为editForm -->
|
||
<form class="form-horizontal" id="editForm" enctype="multipart/form-data">
|
||
<div id="alertDiv"></div>
|
||
<%-- <input type="hidden" name="id" value="${user.id }" />--%>
|
||
<!-- 界面提醒div强制id为alertdiv -->
|
||
|
||
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">* 废液代码及名称:</label>
|
||
<div class="col-sm-4">
|
||
<input type="hidden" name="id" id="id" class="form-control" value="${bean.id}">
|
||
<select style="width: 100%" name="liquidWasteType" id="liquidWasteType"
|
||
class="form-control" value="${bean.liquidWasteType}"></select>
|
||
</div>
|
||
|
||
<label class="col-sm-2 control-label">* 废物来源:</label>
|
||
<div class="col-sm-4">
|
||
<input type="text" name="source" id="source" class="form-control"
|
||
value="${bean.source}">
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">* 数量:</label>
|
||
<div class="col-sm-4">
|
||
<input type="text" name="number" id="number" class="form-control"
|
||
value="${bean.number}">
|
||
</div>
|
||
|
||
<label class="col-sm-2 control-label">* 容器材质:</label>
|
||
<div class="col-sm-4">
|
||
<input type="text" name="containerType" id="containerType"
|
||
class="form-control" value="${bean.containerType}">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">* 容量:</label>
|
||
<div class="col-sm-4">
|
||
<input type="text" name="capacity" id="capacity" class="form-control"
|
||
value="${bean.capacity}">
|
||
</div>
|
||
<label class="col-sm-2 control-label">* 废物存放位置:</label>
|
||
<div class="col-sm-4"><input type="text" name="location" id="location"
|
||
class="form-control" value="${bean.location}">
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">* 登记人姓名:</label>
|
||
<div class="col-sm-4"><input type="text" name="createUserName" id="createUserName"
|
||
onclick="selectCreateUser()"
|
||
class="form-control" value="${bean.createUserName}">
|
||
<input type="hidden" name="createUserId" id="createUserId"
|
||
class="form-control" value="${bean.createUserId }">
|
||
</div>
|
||
<label class="col-sm-2 control-label">* 登记时间:</label>
|
||
<div class="col-sm-4"><input type="text" name="createTime" id="createTime"
|
||
class="form-control" value="${bean.createTime.substring(0,10)}"></div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">* 废物运送经办人名称:</label>
|
||
<div class="col-sm-4">
|
||
<input type="text" name="transportUserName" id="transportUserName"
|
||
class="form-control" value="${bean.transportUserName}"
|
||
onclick="selectTransportUser()">
|
||
<input type="hidden" name="transportUserId" id="transportUserId"
|
||
class="form-control" value="${bean.transportUserId}">
|
||
</div>
|
||
|
||
<label class="col-sm-2 control-label">* 废物贮存经办人名称:</label>
|
||
<div class="col-sm-4">
|
||
<input type="text" name="repositionUserName"
|
||
id="repositionUserName" class="form-control"
|
||
value="${cu.caption}" onclick="selectRepositionUser()">
|
||
<input type="hidden" name="repositionUserId" id="repositionUserId"
|
||
class="form-control" value="${cu.id}">
|
||
</div>
|
||
</div>
|
||
|
||
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">* 入库日期:</label>
|
||
<div class="col-sm-4">
|
||
<div class="input-group date">
|
||
<div class="input-group-addon">
|
||
<i class="fa fa-calendar"></i>
|
||
</div>
|
||
<input type="text" id="inputTime" name="inputTime"
|
||
value="${fn:substring(bean.inputTime,0,10)}" placeholder="请选择.."/>
|
||
</div>
|
||
</div>
|
||
<label class="col-sm-2 control-label">* 目前登记容量:</label>
|
||
<div class="col-sm-4">
|
||
<input type="text" name="currentNumber" id="currentNumber"
|
||
class="" value="${bean.currentNumber}" style="width: 60px"
|
||
><label style="position: absolute;float: right;margin-left: 10px;size: 18px;">L</label>
|
||
<input type="hidden" name="lastNumber" id="lastNumber"
|
||
class="form-control" value="${bean.currentNumber}">
|
||
</div>
|
||
|
||
</div>
|
||
</form>
|
||
</div>
|
||
</div>
|
||
|
||
</div>
|
||
<div class="modal-footer">
|
||
<button type="button" class="btn btn-default " data-dismiss="modal">关闭
|
||
</button>
|
||
<button type="button" class="btn btn-primary " style="margin-left: 10px"
|
||
onclick="updateFun()">保存
|
||
</button>
|
||
<button type="button" class="btn btn-primary " style="margin-left: 10px"
|
||
onclick="checklog()">查看登记记录
|
||
</button>
|
||
<button type="button" class="btn btn-primary " style="margin-left: 10px"
|
||
onclick="updateSaveFun()">入库
|
||
</button>
|
||
</div>
|
||
</div>
|
||
<!-- /.modal-content -->
|
||
</div>
|
||
<!-- /.modal-dialog -->
|
||
</div>
|
||
|
||
|
||
|
||
|