239 lines
9.7 KiB
Plaintext
239 lines
9.7 KiB
Plaintext
|
|
<%@ page language="java" pageEncoding="UTF-8" %>
|
|||
|
|
<%@page import="com.sipai.entity.report.RptCreate" %>
|
|||
|
|
<% request.setAttribute("Status_Start", RptCreate.Status_Start); %>
|
|||
|
|
<% request.setAttribute("Status_Finish", RptCreate.Status_Finish); %>
|
|||
|
|
|
|||
|
|
<%@page import="com.sipai.entity.report.RptInfoSet" %>
|
|||
|
|
<% request.setAttribute("Checkst_Yes", RptInfoSet.Checkst_Yes); %>
|
|||
|
|
<% request.setAttribute("Checkst_No", RptInfoSet.Checkst_No); %>
|
|||
|
|
|
|||
|
|
|
|||
|
|
<style type="text/css">
|
|||
|
|
|
|||
|
|
</style>
|
|||
|
|
<script type="text/javascript">
|
|||
|
|
|
|||
|
|
//仅保存
|
|||
|
|
function dosave() {
|
|||
|
|
$("#subForm").bootstrapValidator('validate');//提交验证
|
|||
|
|
if ($("#subForm").data('bootstrapValidator').isValid()) {
|
|||
|
|
//获取验证结果,如果成功,执行下面代码
|
|||
|
|
$.post(ext.contextPath + "/report/rptCreate/doupdate.do", $("#subForm").serialize(), function (data) {
|
|||
|
|
if (data.res == 1) {
|
|||
|
|
$("#table").bootstrapTable('refresh');
|
|||
|
|
closeModal("subModal");
|
|||
|
|
|
|||
|
|
//提示是否重新生成
|
|||
|
|
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) {
|
|||
|
|
//生成方法
|
|||
|
|
docreat();
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
} else if (data.res == 0) {
|
|||
|
|
showAlert('d', '保存失败');
|
|||
|
|
} else {
|
|||
|
|
showAlert('d', data.res);
|
|||
|
|
}
|
|||
|
|
}, 'json');
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//重新生成
|
|||
|
|
function docreat() {
|
|||
|
|
$("#subForm").bootstrapValidator('validate');//提交验证
|
|||
|
|
if ($("#subForm").data('bootstrapValidator').isValid()) {
|
|||
|
|
//获取验证结果,如果成功,执行下面代码
|
|||
|
|
$.post(ext.contextPath + "/report/rptCreate/dosave.do", $("#subForm").serialize(), function (data) {
|
|||
|
|
if (data.res == 1) {
|
|||
|
|
$("#table").bootstrapTable('refresh');
|
|||
|
|
closeModal("subModal");
|
|||
|
|
} else if (data.res == 0) {
|
|||
|
|
showAlert('d', '保存失败');
|
|||
|
|
} else {
|
|||
|
|
showAlert('d', data.res);
|
|||
|
|
}
|
|||
|
|
}, 'json');
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//提交
|
|||
|
|
function dosubmit() {
|
|||
|
|
$("#status").val('${Status_Start}');
|
|||
|
|
// $('#subForm').data('bootstrapValidator')
|
|||
|
|
// .updateStatus('checkusername', 'NOT_VALIDATED', null)
|
|||
|
|
// .validateField('checkusername');
|
|||
|
|
$.post(ext.contextPath + "/report/rptCreate/startProcess.do", $("#subForm").serialize(), function (data) {
|
|||
|
|
if (data.res == 1) {
|
|||
|
|
$("#table").bootstrapTable('refresh');
|
|||
|
|
closeModal('subModal');
|
|||
|
|
} else if (data.res == 0) {
|
|||
|
|
showAlert('d', '保存失败');
|
|||
|
|
} else if (data.res == 2) {
|
|||
|
|
showAlert('d', '未检测到报表审核流程,请先部署报表审核流程!');
|
|||
|
|
} else {
|
|||
|
|
showAlert('d', data.res);
|
|||
|
|
}
|
|||
|
|
}, 'json');
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
$("#subForm").bootstrapValidator({
|
|||
|
|
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
|||
|
|
fields: {
|
|||
|
|
rptdt: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '日期不能为空'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
inputuserName: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '负责人不能为空'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
var showUser4AuditSelectsFun = function () {
|
|||
|
|
var userIds = $("#checkuser").val();
|
|||
|
|
$.post(ext.contextPath + '/user/userForSelectByCompany.do', {
|
|||
|
|
formId: "subForm",
|
|||
|
|
hiddenId: "checkuser",
|
|||
|
|
textId: "checkusername",
|
|||
|
|
userIds: userIds
|
|||
|
|
}, function (data) {
|
|||
|
|
$("#user4SelectDiv").html(data);
|
|||
|
|
openModal("user4SelectModal");
|
|||
|
|
});
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
/*$('#rptdt').datepicker({
|
|||
|
|
language: 'zh-CN',
|
|||
|
|
autoclose: true,
|
|||
|
|
todayHighlight: true,
|
|||
|
|
format: 'yyyy-mm-dd',
|
|||
|
|
}).on('hide', function (e) {
|
|||
|
|
$('#subForm').data('bootstrapValidator')
|
|||
|
|
.updateStatus('rptdt', 'NOT_VALIDATED', null)
|
|||
|
|
.validateField('rptdt');
|
|||
|
|
});*/
|
|||
|
|
|
|||
|
|
$.ajax({
|
|||
|
|
url: ext.contextPath + '/report/rptInfoSet/getInfo.do', // 获取表格数据的url
|
|||
|
|
async: true,
|
|||
|
|
data: {
|
|||
|
|
id: '${rptCreate.rptsetId}'
|
|||
|
|
},
|
|||
|
|
success: function (data) {
|
|||
|
|
var data = eval('(' + data + ')');
|
|||
|
|
switch (data[0].checkst) {
|
|||
|
|
case '${Checkst_Yes}':
|
|||
|
|
$('#checkDiv').attr("style", "display:block;")
|
|||
|
|
break;
|
|||
|
|
case '${Checkst_No}':
|
|||
|
|
$('#checkDiv').attr("style", "display:none;")
|
|||
|
|
break;
|
|||
|
|
default:
|
|||
|
|
//
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
</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">×</span></button>
|
|||
|
|
<h4 class="modal-title">修改</h4>
|
|||
|
|
</div>
|
|||
|
|
<div class="modal-body">
|
|||
|
|
<!-- 新增界面formid强制为subForm -->
|
|||
|
|
<form class="form-horizontal" id="subForm" autocomplete="off">
|
|||
|
|
<!-- 界面提醒div强制id为alertDiv -->
|
|||
|
|
<div id="alertDiv"></div>
|
|||
|
|
<input type="hidden" name="id" id="id" value="${rptCreate.id}"/>
|
|||
|
|
<input type="hidden" id="unitId" name="unitId" value="${rptCreate.unitId}"/>
|
|||
|
|
<input type="hidden" id="rptsetId" name="rptsetId" value="${rptCreate.rptsetId}"/>
|
|||
|
|
<input type="hidden" id="status" name="status" value=""/>
|
|||
|
|
|
|||
|
|
<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" class="form-control" id="rptdt" name="rptdt" style="width: 132px;"
|
|||
|
|
value="${rptCreate.rptdt}" readonly>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<label class="col-sm-2 control-label">负责人</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<input type="text" class="form-control" id="inputuserName" name="inputuserName"
|
|||
|
|
value="${rptCreate.inputusername}" readonly/>
|
|||
|
|
<input type="hidden" id="inputuser" name="inputuser" value="${rptCreate.inputuser}"/>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">备注</label>
|
|||
|
|
<div class="col-sm-10">
|
|||
|
|
<textarea class="form-control" id="memo" name="memo"
|
|||
|
|
placeholder="备注">${rptCreate.memo}</textarea>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="form-group" id="checkDiv">
|
|||
|
|
<label class="col-sm-2 control-label">*审核人</label>
|
|||
|
|
<div class="col-sm-6">
|
|||
|
|
<input type="text" class="form-control" id="checkusername" name="checkusername"
|
|||
|
|
placeholder="点击选择"
|
|||
|
|
value="${rptCreate.checkusername}" onclick="showUser4AuditSelectsFun();">
|
|||
|
|
<input id="checkuser" name="checkuser" type="hidden"
|
|||
|
|
value="${rptCreate.checkuser}"/>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</form>
|
|||
|
|
</div>
|
|||
|
|
<div class="modal-footer">
|
|||
|
|
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
|||
|
|
<%--<button type="button" class="btn btn-primary" onclick="dosave()">保存</button>--%>
|
|||
|
|
<%--<button type="button" class="btn btn-primary" onclick="docreat()">重新生成</button>--%>
|
|||
|
|
<button type="button" class="btn btn-primary" onclick="dosave()">重新生成</button>
|
|||
|
|
<button type="button" class="btn btn-primary" onclick="dosubmit()">提交</button>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<!-- /.modal-content -->
|
|||
|
|
</div>
|
|||
|
|
<!-- /.modal-dialog -->
|
|||
|
|
</div>
|