Files
SIPAIIS_WMS_JSSW/WebRoot/jsp/work/productionIndexDataEdit.jsp
2026-01-16 14:13:44 +08:00

106 lines
4.5 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.work.ProductionIndexPlanNameData"%>
<% request.setAttribute("Type_Year", ProductionIndexPlanNameData.Type_Year);%>
<% request.setAttribute("Type_Month", ProductionIndexPlanNameData.Type_Month);%>
<% request.setAttribute("Type_Day", ProductionIndexPlanNameData.Type_Day);%>
<script type="text/javascript">
$(function() {
var type=$('#type').val();
var planDate=$('#monthtimeId').val();
var unitId=$('#unitId').val();
$.post(ext.contextPath + '/work/productionIndexData/getEditDataJson.do', {type:type,planDate:planDate,unitId:unitId},function(data) {
if(data.length>0){
var html="";
for(var i=0;i<data.length;i++){
html+="<div class=\"form-group\">";
html+="<label class=\"col-sm-4 control-label\">"+data[i].name+"</label>";
html+="<div class=\"col-sm-6\">";
html+="<input type=\"number\" class=\"form-control\" id=\""+data[i].id+"\" name =\"indexData\" value=\""+data[i].value+"\">";
html+="</div>";
html+="</div>";
}
$('#fillIn').html(html);
}
},'json');
});
function doSave() {
var type=$('#type').val();
var planDate="";
if(type=='${Type_Month}'){
planDate=$('#monthtimeId').val();
}
if(type=='${Type_Year}'){
planDate=$('#yeartimeId').val();
}
if(type=='${Type_Day}'){
planDate=$('#daytimeId').val();
}
var datas="";
var obj=$('#fillIn').find("input");
for(var i=0;i<obj.length;i++){
if(obj[i].name=="indexData"){
datas+=obj[i].id+":"+obj[i].value+",";
// datas+=obj[i].value+",";
}
}
$.post(ext.contextPath + "/work/productionIndexData/doupdate.do",$("#subForm").serialize()+"&planDate="+planDate+"&datas="+datas,function(result) {
if (result>0) {
dosearch();
closeModal('subModal');
}else{
showAlert('d','保存失败');
}
},'json');
}
</script>
<div class="modal fade" id="subModal">
<div class="modal-dialog">
<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 -->
<input type="hidden" class="form-control" id="unitId" name ="unitId" value="${param.unitId}">
<div id="alertDiv"></div>
<div class="form-group">
<label class="col-sm-4 control-label">类型</label>
<div class="col-sm-6">
<input type="hidden" class="form-control" id="type" name ="type" value="${param.type}">
<input type="text" <c:if test="${param.type==Type_Day}"> value="日指标"</c:if> class="form-control" id="typeName" name ="typeName" <c:if test="${param.type==Type_Month}"> value="月度指标"</c:if><c:if test="${param.type==Type_Year}"> value="年度指标"</c:if> readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">日期</label>
<div class="col-sm-6">
<input class="form-control date-picker" id="monthtimeId" name="monthtimeId" autocomplete="off" type="text" value="${param.planDate}" readonly/>
<input class="form-control date-picker" id="yeartimeId" name="yeartimeId" autocomplete="off" type="hidden" value="${param.planDate}" readonly/>
<input class="form-control date-picker" id="daytimeId" name="daytimeId" autocomplete="off" type="hidden" value="${param.planDate}" readonly/>
</div>
</div>
<div id="fillIn"></div>
</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="doSave()" id="btn_save">保存</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>