Files
SIPAIIS_WMS_JSSW/WebRoot/jsp/achievement/acceptanceModelCreateRecordAdd.jsp

153 lines
5.9 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"%>
<style type="text/css">
.select2-container .select2-selection--single{
height:34px;
line-height: 34px;
}
.select2-selection__arrow{
margin-top:3px;
}
</style>
<script type="text/javascript">
var beginTimeStore1 = '';
function initDate1() {
//定义locale汉化插件
beginTimeStore1 = moment().subtract(0, 'days').format('YYYY-MM-DD');
var locale = {
"format": 'YYYY-MM-DD',
"separator": " ~ ",
"applyLabel": "确定",
"cancelLabel": "取消",
"fromLabel": "起始时间",
"toLabel": "结束时间'",
"customRangeLabel": "自定义",
"weekLabel": "W",
"daysOfWeek": ["日", "一", "二", "三", "四", "五", "六"],
"monthNames": ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
"firstDay": 1
};
$('#reservationtime1').daterangepicker({
"singleDatePicker":true,
"locale": locale,
//汉化按钮部分
ranges: {
// '今日': [moment(), moment().subtract(-1, 'days')],
'昨日': [moment().subtract(1, 'days'), moment()],
'最近7日': [moment().subtract(6, 'days'), moment().subtract(-1, 'days')],
'本月': [moment().startOf('month'), moment().endOf('month').subtract(-1, 'days')],
'上月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month').subtract(-1, 'days')]
},
startDate: beginTimeStore1
}, function(start, end, label) {
beginTimeStore1 = start.format(this.locale.format);
if(!this.startDate){
this.element.val('');
}else{
this.element.val(this.startDate.format(this.locale.format));
}
});
$('#reservationtime1').val(beginTimeStore1);
};
$(function() {
initDate1();
});
$("#subForm").bootstrapValidator({
live: 'disabled',//验证时机enabled是内容有变化就验证默认disabled和submitted是提交再验证
fields: {
showname: {
validators: {
notEmpty: {
message: '名称不能为空'
}
}
},
reservationtime1: {
validators: {
notEmpty: {
message: '日期不能为空'
}
}
}
}
});
function doRecordSave(){
var showname=$('#showname').val();
$("#subForm").bootstrapValidator('validate');//提交验证
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
$('#saveB').attr('onclick','');
$('#saveB').text('加载中...');
$.post(ext.contextPath + "/achievement/acceptanceModelCreate/saveExcelData.do",{pid:'${param.pid}',unitId:unitId,sdt:beginTimeStore1,showname:showname,id:'${id}'}, function(data) {
if (data.code == 1) {
closeModal('subModal');
$("#table").bootstrapTable('refresh');
$.ajax({
type : "GET",
url : ext.contextPath + "/achievement/acceptanceModelCreate/saveOutput.do?pid=${id}&modelId=${param.pid}&unitId="+unitId+"&sdt="+beginTimeStore1,
async: false,
globle:false,
success : function(data){
}
});
// $.post(ext.contextPath + "/achievement/acceptanceModelCreate/saveOutput.do",{pid:'${param.pid}',unitId:unitId,sdt:beginTimeStore1}, function(data) {
// },'json');
}else if(data.code == 0){
$('#saveB').attr('onclick','doRecordSave()');
$('#saveB').text('保存');
showAlert('d',data.msg);
}else{
$('#saveB').attr('onclick','doRecordSave()');
$('#saveB').text('保存');
showAlert('d',data.msg);
}
},'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 -->
<div id="alertDiv"></div>
<input type="hidden" id="id" name ="id" value="${id}" >
<div class="form-group">
<label class="col-sm-3 control-label">*名称</label>
<div class="col-sm-6">
<input type="text" class="form-control" id="showname" name ="showname" placeholder="名称" >
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">*日期</label>
<div class="col-sm-6">
<input type="text" class="form-control pull-left" id="reservationtime1" name="reservationtime1" >
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
<button id="saveB" type="button" class="btn btn-primary" onclick="doRecordSave()" id="btn_save">保存</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>