161 lines
6.2 KiB
Plaintext
161 lines
6.2 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() {
|
|
// $('#monthtimeId').datepicker({
|
|
// format: 'yyyy-mm',
|
|
// weekStart: 1,
|
|
// autoclose: true,
|
|
// startView: 2,
|
|
// minViewMode: 1,
|
|
// maxViewMode: 2,
|
|
// forceParse: false,
|
|
// language: 'cn'
|
|
// }).on('changeDate',chaDate);
|
|
|
|
// $('#yeartimeId').datepicker({
|
|
// format: 'yyyy',
|
|
// weekStart: 1,
|
|
// autoclose: true,
|
|
// startView: 2,
|
|
// minViewMode: 2,
|
|
// maxViewMode: 2,
|
|
// forceParse: false,
|
|
// language: 'cn'
|
|
// }).on('changeDate',chaDate);
|
|
|
|
doDateType();
|
|
var type=$('#type').val();
|
|
var planDate="";
|
|
if(type=='${Type_Year}'){
|
|
planDate=$('#yeartimeId').val();
|
|
}else if(type=='${Type_Month}'){
|
|
planDate=$('#monthtimeId').val();
|
|
}else if(type=='${Type_Day}'){
|
|
planDate=$('#daytimeId').val();
|
|
}
|
|
var unitId=$('#unitId').val();
|
|
$.post(ext.contextPath + '/work/productionIndexPlanNameData/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-2 control-label\">"+data[i].name+"</label>";
|
|
html+="<div class=\"col-sm-4\">";
|
|
html+="<input type=\"number\" class=\"form-control\" id=\""+data[i].id+"\" name =\"indexData\" value=\""+data[i].value+"\">";
|
|
html+="</div>";
|
|
html+="<label class=\"col-sm-2 control-label\">调整原因</label>";
|
|
html+="<div class=\"col-sm-4\">";
|
|
html+="<input type=\"text\" class=\"form-control\" id=\""+data[i].id+"Remark\" name =\""+data[i].id+"Remark\" >";
|
|
html+="</div>";
|
|
html+="</div>";
|
|
}
|
|
$('#fillIn').html(html);
|
|
}
|
|
},'json');
|
|
});
|
|
|
|
function doDateType(){
|
|
var type=$('#type').val();
|
|
if(type=='${Type_Month}'){
|
|
$("#monthtimeId").attr('type','text');
|
|
$("#yeartimeId").attr('type','hidden');
|
|
$("#daytimeId").attr('type','hidden');
|
|
}else if(type=='${Type_Year}'){
|
|
$("#monthtimeId").attr('type','hidden');
|
|
$("#yeartimeId").attr('type','text');
|
|
$("#daytimeId").attr('type','hidden');
|
|
}else if(type=='${Type_Day}'){
|
|
$("#monthtimeId").attr('type','hidden');
|
|
$("#yeartimeId").attr('type','hidden');
|
|
$("#daytimeId").attr('type','text');
|
|
}
|
|
}
|
|
|
|
function chaDate(){
|
|
}
|
|
|
|
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+",";
|
|
}
|
|
}
|
|
console.log($("#subForm").serialize());
|
|
$.post(ext.contextPath + "/work/productionIndexPlanNameData/doupdate.do",$("#subForm").serialize()+"&planDate="+planDate+"&datas="+datas,function(result) {
|
|
if (result>0) {
|
|
$("#table").bootstrapTable('refresh');
|
|
closeModal('subModal');
|
|
}else{
|
|
showAlert('d','保存失败');
|
|
}
|
|
//打开已打开的子表
|
|
// setTimeout(doExpend, 500);
|
|
},'json');
|
|
}
|
|
|
|
</script>
|
|
<div class="modal fade" id="subModal">
|
|
<div class="modal-dialog" style="width: 800px;">
|
|
<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">
|
|
<!-- 新增界面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-2 control-label">类型</label>
|
|
<div class="col-sm-4">
|
|
<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>
|
|
<label class="col-sm-2 control-label">日期</label>
|
|
<div class="col-sm-4">
|
|
<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>
|