Files
SIPAIIS_WMS_JSSW/WebRoot/jsp/report/rptDayLogEdit.jsp

322 lines
14 KiB
Plaintext
Raw Permalink Normal View History

2026-01-16 14:13:44 +08:00
<%@ 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/fmt" prefix="fmt" %>
<%@ 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;
}
.control-label-overflow{
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
</style>
<script type="text/javascript">
function dosave() {
var jsonStr = '${rptDayLog}';
jsonStr = jsonStr.replaceAll(/\n/g,"\\n").replaceAll(/\r/g,"\\r")
var jsonObject= jQuery.parseJSON(jsonStr);
delete jsonObject.user.sql;
delete jsonObject.user.where;
delete jsonObject.user.roles;
jsonObject.rptdt=$("#rptdt").val();
jsonObject.id=$("#id").val();
jsonObject.memo=$("#memo").val();
jsonObject.others=$("#others").val();
jsonObject.status="未提交";
for(var i in jsonObject.mPointList){//mPointHistoryList
jsonObject.mPointHistoryList[i].parmvalue=$("#id"+i).val();
}
var jsonstr =JSON.stringify(jsonObject);
$.post(ext.contextPath + "/report/RptDayLog/dosave.do",{json:jsonstr}, function(data) {
if (data.code == 1){
closeModal("subModal");
$("#table").bootstrapTable('refresh');
showAlert('s', '保存成功','mainAlertdiv');
}else if(data.code == 0){
showAlert('d','保存失败');
}else{
showAlert('d',data.msg);
}
},'json');
}
function dosubmit() {
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) {
var jsonStr = '${rptDayLog}';
jsonStr = jsonStr.replaceAll(/\n/g,"\\n").replaceAll(/\r/g,"\\r")
var jsonObject= jQuery.parseJSON(jsonStr);
delete jsonObject.user.sql;
delete jsonObject.user.where;
delete jsonObject.user.roles;
if(jsonObject.checkuser!=null){
delete jsonObject.checkuser.sql;
delete jsonObject.checkuser.where;
delete jsonObject.checkuser.roles;
}
jsonObject.rptdt=$("#rptdt").val();
jsonObject.id=$("#id").val();
jsonObject.memo=$("#memo").val();
jsonObject.others=$("#others").val();
jsonObject.status="未提交";
for(var i in jsonObject.mPointList){//mPointHistoryList
jsonObject.mPointHistoryList[i].parmvalue=$("#id"+i).val();
}
var jsonstr =JSON.stringify(jsonObject);
$.post(ext.contextPath + "/report/RptDayLog/dosave.do",{json:jsonstr}, function(data) {
if (data.code == 1){
var id = $("#id").val();
var rptdeptId = $("#rptdeptId").val();
$.post(ext.contextPath + "/report/RptDayLog/dosubmit.do",{id:id,rptdeptId:rptdeptId}, function(data) {
if (data.code == 1){
closeModal("subModal");
$("#table").bootstrapTable('refresh');
showAlert('s','提交成功','mainAlertdiv');
}else if(data.code == 0){
showAlert('d','提交失败');
}else{
showAlert('d',data.msg);
}
},'json');
}else if(data.code == 0){
showAlert('d','保存失败');
}else{
showAlert('d',data.msg);
}
},'json');
}
});
}
//显示悬浮层
function show(event,lastvalue,Unit,NumTail){
var data_text="当前值:"+lastvalue+"<br/>单位:"+Unit+"<br/>小数位:"+NumTail;
var showbox=$('<div>'+data_text+'</div>').css({
width:'135px',
padding:'2px 5px',
position:'absolute',
top:-12,
left:140,
color:'#000000',
border:'1px solid #000000',
borderRadius:'5px',
background: '#ffffe0',
'z-index':9999
}).addClass("showbox");
showbox.insertAfter(event);
}
//隐藏悬浮层
function hide(event){
$(".showbox").remove();
}
//初始化选择框
var refreshActiveSelect = function() {
var jsonStr = '${rptDayLog}';
jsonStr = jsonStr.replaceAll(/\n/g,"\\n").replaceAll(/\r/g,"\\r")
var jsonObject= jQuery.parseJSON(jsonStr);
for(var i in jsonObject.mPointList){
if (jsonObject.mPointList[i].valuemeaningFlag) {
var select = $("#id"+i).select2({
theme: "classic",
data: null,
placeholder:'请选择',//默认文字提示
allowClear: true,//允许清空
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
language: "zh-CN",
minimumInputLength: 0,
minimumResultsForSearch: 10,//数据超过十个启用搜索框
});
select.val(jsonObject.mPointList[i].parmvalue).trigger("change");
}
}
};
$(function () {
refreshActiveSelect();
//填报日期选择
var type = $("#dateType").val();
createDatetimepicker ('rptdt',type)
//填报日期选择
// var date = new Date();
/* $("#rptdt").datetimepicker({
// startDate: date,
language:'zh-CN',
format: 'yyyy-mm-dd hh:ii:ss',
startView: "month", //初始化视图是‘年’
minView: 1,
maxView: "year",
autoclose: true
// todayBtn: "linked"
}); */
// $(".timecheck").datetimepicker({
// bootcssVer:3, //bootstrap-datetimepickerbootstrap v3但这个插件使用的时候并没有和V3相匹配仍然调用的是bootstrap V2的图标 把bootcssVer的值直接设为3否则datetimepicker不会显示出上、下个月的箭头
// format: 'yyyy-mm-dd HH:mm',
// minView: 'day',//设置时间选择为年月日 去掉时分秒选择
// todayBtn: true, //如果此值为true 或 "linked",则在日期时间选择器组件的底部显示一个 "Today" 按钮用以选择当前日期。如果是true的话"Today" 按钮仅仅将视图转到当天的日期,如果是"linked",当天日期将会被选中。
// language: 'zh-CN',
// autoclose: true, //当选择一个日期之后是否立即关闭此日期时间选择器。
// keyboardNavigation: true, //是否允许通过方向键改变日期。
// forceParse: true, //当选择器关闭的时候,是否强制解析输入框中的值。
// todayHighlight: 1 //如果为true, 高亮当前日期
// })
})
</script>
<div class="modal fade" id="subModal">
<div class="modal-dialog modal-lg">
<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">
<!-- 新增界面formid强制为subForm -->
<form class="form-horizontal" id="subForm">
<!-- 界面提醒div强制id为alertDiv -->
<div id="alertDiv"></div>
<!-- <input type="hidden" id="bizId" name="bizId" value="${patrolContents.bizId}">
<input type="hidden" id="unitId" name="unitId" value="${patrolContents.unitId}">
<input type="hidden" id="pid" name="pid" value="${patrolContents.pid}">
<input type="hidden" id="patrolContentsType" name="patrolContentsType" value="${patrolContents.patrolContentsType}"> -->
<input type="hidden" id="id" name="id" value="${rptDayLog.id}">
<input type="hidden" id="dateType" name="dateType" value="${rptDayLog.type}">
<input type="hidden" id="rptdeptId" name="rptdeptId" value="${rptDayLog.rptdeptId}">
<div class="form-group">
<label class="col-sm-3 control-label">填报日期</label>
<div class="col-sm-3">
<input type="text" class="form-control" id="rptdt" name ="rptdt" value="${rptDayLog.rptdt}"readOnly>
</div>
<i class="fa fa-question-circle" aria-hidden="true" title="按Tab键切换光标"></i>
</div>
<c:forEach items="${rptDayLog.mPointList}" var="item" varStatus="i">
<c:if test="${(i.index % 2) == 0}"><!-- 单数 -->
<div class="form-group">
</c:if>
<c:if test="${!item.valuemeaningFlag}"><!-- 填值 -->
<label class="col-sm-3 control-label control-label-overflow" title="${item.parmname}">
${item.parmname}
<c:if test="${item.explain!=''}">
<i class="fa fa-question-circle" aria-hidden="true" title="${item.explain}"></i>
</c:if>
</label>
<div class="col-sm-2">
<c:set var="numTail" value="${item.NumTail}" />
<c:set var="drop" value="." />
<c:if test="${fn:containsIgnoreCase(numTail, drop)}">
<c:set var="dropNum" value="${fn:indexOf(numTail, drop)}" />
<c:set var="numTail" value="${fn:substring(numTail, dropNum+1, fn:length(numTail))}" />
<c:set var="numTail" value="${fn:length(numTail)}" />
</c:if>
<fmt:formatNumber type="number" var="parmvalue" value="${item.parmvalue}" groupingUsed="false" maxFractionDigits="${numTail}"/>
<input type="number" onfocus="show(this,'${item.lastvalue}','${item.Unit}','${item.NumTail}')" onblur="hide(this)" class="form-control" id="id${i.index}"
name ="name${i.index}" value="${parmvalue}">
</div>
<!-- <fmt:formatNumber type="number" value="${item.parmvalue}" pattern="${item.NumTail}"/> -->
<label class="col-sm-1 control-label"
style="text-align:left;padding-left: 0px;">${item.Unit}</label>
</c:if>
<c:if test="${item.valuemeaningFlag}"><!-- 选择 -->
<label class="col-sm-3 control-label control-label-overflow" title="${item.parmname}">
${item.parmname}
<c:if test="${item.explain!=''}">
<i class="fa fa-question-circle" aria-hidden="true" title="${item.explain}"></i>
</c:if>
</label>
<div class="col-sm-3">
<select id= "id${i.index}" name="name${i.index}" class="form-control select2" style="width:100%;">
<c:forEach items="${item.valuemeaningArray}" var="valuemeaningItem" varStatus="i1">
<c:choose>
<c:when test="${item.parmvalue==valuemeaningItem.zhi}">
<option value="${valuemeaningItem.zhi}" selected>${valuemeaningItem.mingcheng}</option>
</c:when>
<c:otherwise>
<option value="${valuemeaningItem.zhi}">${valuemeaningItem.mingcheng}</option>
</c:otherwise>
</c:choose>
</c:forEach>
</select>
</div>
</c:if>
<c:if test="${(i.index % 2) == 1}"><!-- 双数 -->
</div>
</c:if>
<c:if test="${(i.index % 2) == 0&&i.last}"><!-- 单数最后一个 -->
</div>
</c:if>
</c:forEach>
<div class="form-group">
<label class="col-sm-3 control-label">其他参数</label>
<div class="col-sm-9">
<textarea class="form-control" rows="3" id="others" name="others" placeholder="">${rptDayLog.others}</textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">备注</label>
<div class="col-sm-9">
<textarea class="form-control" rows="3" id="memo" name="memo" placeholder="">${rptDayLog.memo}</textarea>
</div>
</div>
<c:if test="${rptDayLog.reviewComments!=null && rptDayLog.reviewComments!=''}">
<div class="form-group">
<label class="col-sm-3 control-label">审批意见</label>
<div class="col-sm-9">
<textarea class="form-control" rows="3" id="reviewComments" name="reviewComments" placeholder=""
readonly>${rptDayLog.reviewComments}</textarea>
</div>
</div>
</c:if>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" onclick="dosubmit()" id="btn_submit">提交</button>
<c:if test="${rptDayLog.status=='未提交'|| rptDayLog.status=='已退回'}"><!-- 填值 -->
<button type="button" class="btn btn-primary" onclick="dosave()" id="btn_save">保存</button>
</c:if>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>