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

1 line
21 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.

<%@ page import="java.text.DateFormat" %>
<!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 () {
typeConditionDropDownList();
$("#ouputDate").val('${bean.ouputDate}'.replace(/\.+\w*/, ''));
$("#inputTime").val('${bean.inputTime}'.replace(/\.+\w*/, ''));
//登记时间
$("#ouputDate").datetimepicker({
// startDate: date,
language: 'zh-CN',
format: 'yyyy-mm-dd hh:ii:ss',
startView: "month", //初始化视图是‘年’
minView: 1,
maxView: "year",
autoclose: true
// todayBtn: "linked"
});
//入库日期
$("#inputTime").datetimepicker({
// startDate: date,
language: 'zh-CN',
format: 'yyyy-mm-dd hh:ii:ss',
startView: "month", //初始化视图是‘年’
minView: 1,
maxView: "year",
autoclose: true
// todayBtn: "linked"
});
});
//下拉范例,不用删掉
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 updateSaveFun() {
$("#editForm").data("bootstrapValidator").updateStatus("transportUserName","NOT_VALIDATED", null).validateField("transportUserName");
$("#editForm").data("bootstrapValidator").updateStatus("repositionUserName","NOT_VALIDATED", null).validateField("repositionUserName");
$("#editForm").data("bootstrapValidator").updateStatus("outputUserName","NOT_VALIDATED", null).validateField("outputUserName");
$("#editForm").data("bootstrapValidator").updateStatus("outputRepositionUserName","NOT_VALIDATED", null).validateField("outputRepositionUserName");
$("#editForm").bootstrapValidator('validate');//提交验证
if ($("#editForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
var formData = new FormData($("#editForm")[0]);
$.ajax({
url: ext.contextPath + '/whp/liquidWasteDispose/WhpLiquidWasteDispose/updateDispose.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: '废物存放位置不能为空'}}},
transportUserName: {validators: {notEmpty: {message: '废物运送经办人不能为空'}}},
repositionUserName: {validators: {notEmpty: {message: '废物贮存经办人名称不能为空'}}},
outputUserName: {validators: {notEmpty: {message: '废物转移经办人名称不能为空'}}},
ouputDate: {trigger:"change",validators: {notEmpty: {message: '转移日期不能为空'}}},
disposeNumber: {validators: {notEmpty: {message: '转移数量不能为空'}}},
outputLocation: {validators: {notEmpty: {message: '废物去向不能为空'}}},
outputRepositionUserName: {validators: {notEmpty: {message: '废物贮存经办人名称(转移目标)不能为空'}}},
}
});
//出库库贮藏人
function selectOutputUser2() {
$.post(ext.contextPath + '/user/userForOneSelect.do',
{formId: "editForm", hiddenId: "outputRepositionUserId", textId: "outputRepositionUserName"},
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 selectTransportUserChu() {
$.post(ext.contextPath + '/user/userForOneSelect.do',
{formId: "editForm", hiddenId: "repositionUserId", textId: "repositionUserName"},
function (data) {
$("#user4SelectDiv").html(data);
openModal('user4SelectModal');
});
};
//废物转移经办人名称
function selectTransportUserOut() {
$.post(ext.contextPath + '/user/userForOneSelect.do',
{formId: "editForm", hiddenId: "outputUserId", textId: "outputUserName"},
function (data) {
$("#user4SelectDiv").html(data);
openModal('user4SelectModal');
});
};
</script>
<div class="modal fade" id="subModal">
<div class="modal-dialog modal-lg" style="width: 1100px;">
<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">
<div>
<label class="col-sm-2 control-label">* 废液代码及名称:</label>
<div class="col-sm-4"><select name="liquidWasteType" id="liquidWasteType"
class="form-control"
value="${bean.liquidWasteType}"
style="width: 100%"></select>
</div>
</div>
<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>
<%-- <label class="col-sm-2 control-label">* 入库日期:</label>--%>
<%-- <div class="col-sm-4"><input type="text" name="inputTime" id="inputTime"--%>
<%-- class="form-control" value="${bean.inputTime}"></div>--%>
<div class="form-group">
<div>
<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>
</div>
<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>
<div class="form-group">
<div>
<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>
</div>
<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>
<div class="form-group">
<div>
<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>
</div>
<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="${bean.repositionUserName}" onclick="selectTransportUserChu()"/>
<input type="hidden" name="repositionUserId"
id="repositionUserId" class="form-control"
value="${bean.repositionUserId}"/>
</div>
</div>
</div>
<div class="form-group">
<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>
<%-- ${bean.ouputDate}--%>
<input type="text" class="form-control" id="inputTime" name="inputTime"
value="" placeholder="请选择.."/>
</div>
<%-- ${bean.inputTime} --%>
</div>
</div>
<div>
<label class="col-sm-2 control-label">* 废物转移经办人名称:</label>
<div class="col-sm-4">
<input type="text" name="outputUserName" id="outputUserName"
class="form-control" value="${bean.outputUserName}"
onclick="selectTransportUserOut()">
<input type="hidden" name="outputUserId" id="outputUserId"
class="form-control" value="${bean.outputUserId}"/>
</div>
</div>
</div>
<%-- <div class="form-group"><label class="col-sm-2 control-label">* 登记人id</label>--%>
<%-- <div class="col-sm-4"><input type="text" name="createUserId" id="createUserId"--%>
<%-- class="form-control" value="${bean.createUserId}"></div>--%>
<%-- </div>--%>
<%-- <label class="col-sm-2 control-label">* 登记人姓名:</label>--%>
<%-- <div class="col-sm-4"><input type="text" name="createUserName" id="createUserName"--%>
<%-- class="form-control" value="${bean.createUserName}"></div>--%>
<%-- <label class="col-sm-2 control-label">* 废物贮存经办人id</label>--%>
<%-- <div class="col-sm-4"><input type="text" name="repositionUserId" id="repositionUserId"--%>
<%-- class="form-control" value="${bean.repositionUserId}"></div>--%>
<div class="form-group">
<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>
<%-- ${bean.ouputDate}--%>
<input type="text" class="form-control" id="ouputDate" name="ouputDate"
value="" placeholder="请选择.."/>
</div>
</div>
</div>
<div>
<label class="col-sm-2 control-label">* 转移数量:</label>
<div class="col-sm-4"><input type="number" name="disposeNumber" id="disposeNumber" step="0.1"
class="form-control"
value="${bean.number/2}"/></div>
</div>
</div>
<div class="form-group">
<div>
<label class="col-sm-2 control-label">* 废物贮存经办人名称(转移目标)</label>
<div class="col-sm-4"><input type="text" name="outputRepositionUserName"
onclick="selectOutputUser2()"
id="outputRepositionUserName" class="form-control"
value="${bean.outputRepositionUserName}"></div>
<input type="hidden" name="outputRepositionUserId"
id="outputRepositionUserId" class="form-control"
value="${bean.outputRepositionUserId}">
</div>
<div>
<label class="col-sm-2 control-label">* 废物去向:</label>
<div class="col-sm-4"><input type="text" name="outputLocation" id="outputLocation"
class="form-control" value="${bean.outputLocation}">
</div>
</div>
</div>
</div>
<%--
<div class="form-group"><label class="col-sm-2 control-label">* 废物贮存经办人id</label>
<div class="col-sm-4">
</div>
<div class="form-group">
</div>
</form>
</div>
--%>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default " data-dismiss="modal">关闭
</button>
<button type="button" class="btn btn-primary " style="margin-left: 10px"
onclick="updateSaveFun()">保存
</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>