first commit
This commit is contained in:
245
WebRoot/jsp/digitalProcess/dispatchSheetEntryAdd.jsp
Normal file
245
WebRoot/jsp/digitalProcess/dispatchSheetEntryAdd.jsp
Normal file
@ -0,0 +1,245 @@
|
||||
<%@page import="com.sipai.entity.sparepart.SparePartCommString"%>
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%request.setAttribute("CHECK", SparePartCommString.WAREHOUSE_CHECK); %>
|
||||
<%request.setAttribute("START", SparePartCommString.WAREHOUSE_START); %>
|
||||
<%request.setAttribute("STOP", SparePartCommString.WAREHOUSE_STOP); %>
|
||||
<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">
|
||||
function doupdate() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/digitalProcess/digitalTechnologist/dispatchSheetEntrySave.do", $("#subForm").serialize(), function(data) {
|
||||
if (data.res == 1){
|
||||
closeModal('subModal');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
//输入框验证
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
recorddt: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '日期不能为空'
|
||||
},
|
||||
},
|
||||
},
|
||||
dispatchclass: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '调度不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
remark: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '原因不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
function getOutputData(){
|
||||
var jsp_id = 'dispatchOutput';
|
||||
var bizId = unitId;
|
||||
var time = $("#recorddt").val();
|
||||
$.post(ext.contextPath + "/digitalProcess/digitalTechnologist/getOutputData.do",{jsp_id:jsp_id,bizId:bizId,time:time}, function (data) {
|
||||
var res = data.res;
|
||||
if(res.mpvalue!=null && res.mpvalue!=undefined && res.mpvalue!=""){
|
||||
$("#output").val(res.mpvalue);
|
||||
}else{
|
||||
$("#output").val(res);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
function dispatchClass(){
|
||||
var dispatchclass = $("#dispatchclass").val();
|
||||
if(dispatchclass=='out'){
|
||||
$(".dispatch").hide();
|
||||
$(".exit").show();
|
||||
}else{
|
||||
$(".dispatch").show();
|
||||
$(".exit").hide();
|
||||
}
|
||||
}
|
||||
$(function(){
|
||||
$("#recorddt").val(moment().add(0, 'days').format('YYYY-MM-DD HH:mm:ss'));
|
||||
var startdt = moment().add(0, 'days').format('YYYY-MM-DD')+' 08:00';
|
||||
$("#startdt").val(startdt);
|
||||
var enddt = moment().add(1, 'days').format('YYYY-MM-DD')+' 08:00';
|
||||
$("#enddt").val(enddt);
|
||||
getOutputData();
|
||||
$("#recorddt").datetimepicker({
|
||||
language:'zh-CN',
|
||||
format: 'yyyy-mm-dd hh:ii',
|
||||
dateFormat: 'yyyy-mm-dd',//日期显示格式
|
||||
timeFormat: 'HH:mm',//时间显示格式
|
||||
minView: 0,
|
||||
maxView: "year",
|
||||
minuteStep: 1,//分钟间隔1分钟
|
||||
autoclose: true
|
||||
}).on('changeDate', function () {
|
||||
var recorddt = $("#recorddt").val();
|
||||
$("#startdt").val(recorddt.substring(0,10)+' 08:00');
|
||||
$("#enddt").val(getPlusTime(recorddt, "1", "day").substring(0,10)+' 08:00');
|
||||
/*$('#startdt').datetimepicker('setStartDate', recorddt.substring(0,10)+' 08:00');
|
||||
$('#startdt').datetimepicker('setEndDate', getPlusTime(recorddt, "1", "day").substring(0,10)+' 08:00');
|
||||
$('#enddt').datetimepicker('setStartDate', recorddt.substring(0,10)+' 08:00');
|
||||
$('#enddt').datetimepicker('setEndDate', getPlusTime(recorddt, "1", "day").substring(0,10)+' 08:00');*/
|
||||
getOutputData();
|
||||
});
|
||||
$("#startdt").datetimepicker({
|
||||
language:'zh-CN',
|
||||
format: 'yyyy-mm-dd hh:ii',
|
||||
dateFormat: 'yyyy-mm-dd',//日期显示格式
|
||||
timeFormat: 'HH:mm',//时间显示格式
|
||||
startView: "day", //初始化视图是‘年’
|
||||
/*startDate: startdt,
|
||||
endDate: enddt,*/
|
||||
minView: 0,
|
||||
maxView: "year",
|
||||
minuteStep: 1,//分钟间隔1分钟
|
||||
autoclose: true
|
||||
}).on('changeDate', function () {
|
||||
|
||||
});
|
||||
$("#enddt").datetimepicker({
|
||||
language:'zh-CN',
|
||||
format: 'yyyy-mm-dd hh:ii',
|
||||
dateFormat: 'yyyy-mm-dd',//日期显示格式
|
||||
timeFormat: 'HH:mm',//时间显示格式
|
||||
startView: "day", //初始化视图是‘年’
|
||||
/*startDate: startdt,
|
||||
endDate: enddt,*/
|
||||
minView: 0,
|
||||
maxView: "year",
|
||||
minuteStep: 1,//分钟间隔1分钟
|
||||
autoclose: true
|
||||
}).on('changeDate', function () {
|
||||
|
||||
});
|
||||
var selelct_Data= jQuery.parseJSON('[{"id":"reduce","text":"减少"},{"id":"increase","text":"增加"},{"id":"out","text":"退出"}]');
|
||||
var selelct_ = $("#dispatchclass").select2({
|
||||
data: selelct_Data,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) {
|
||||
return markup;
|
||||
}, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo) {
|
||||
return repo.text;
|
||||
}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) {
|
||||
return repo.text;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
|
||||
selelct_.on("change", function (e) {
|
||||
dispatchClass()
|
||||
});
|
||||
$.post(ext.contextPath + "/digitalProcess/digitalTechnologist/getExitremark.do", function (data) {
|
||||
var selelct = $("#exitremark").select2({
|
||||
data: data,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
multiple: true,
|
||||
formatResult: function formatRepo(repo) { return repo.text; }, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) { return repo.text; } // 函数用于呈现当前的选择
|
||||
});
|
||||
}, 'json');
|
||||
})
|
||||
</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">×</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>
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 col-sm-2 control-label">日期</label>
|
||||
<div class="col-md-4 col-sm-10">
|
||||
<input type="text" class="form-control" id="recorddt" name ="recorddt"
|
||||
placeholder="日期" value="${nowDate.substring(0,19)}" readonly>
|
||||
</div>
|
||||
<label class="col-md-2 col-sm-3 control-label">当日原始排产量</label>
|
||||
<label class="col-md-3 col-sm-3 control-label dayOriginalProductionScheduling" style="text-align: center;">
|
||||
<input type="text" class="form-control" id="output" name ="output" placeholder="当日原始排产量" value="">
|
||||
</label>
|
||||
<label class="col-md-1 col-sm-2 control-label text-left">万m³</label>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 col-sm-2 control-label">调度内容</label>
|
||||
<div class="col-md-4 col-sm-2">
|
||||
<select class="form-control select2" id="dispatchclass" name ="dispatchclass" style="width: 100%;">
|
||||
</select>
|
||||
</div>
|
||||
<label class="col-md-2 col-sm-2 control-label text-center dispatch">处理量</label>
|
||||
<div class="col-md-3 col-sm-2 dispatch">
|
||||
<input type="text" class="form-control" id="throughput" name ="throughput" value="0"></div>
|
||||
<label class="col-md-1 col-sm-2 control-label text-left">万m³</label>
|
||||
</div>
|
||||
<div class="form-group exit">
|
||||
<label class="col-md-2 col-sm-2 control-label">退出投运</label>
|
||||
<div class="col-md-10 col-sm-10">
|
||||
<select class="form-control select2" id="exitremark" name="exitremark" style="width: 100%;">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 col-sm-2 control-label">原因</label>
|
||||
<div class="col-md-10 col-sm-10">
|
||||
<textarea class="form-control" rows="3" id ="remark" name ="remark" placeholder="原因..."></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 col-sm-2 control-label">影响开始时间</label>
|
||||
<div class="col-md-4 col-sm-10">
|
||||
<input type="text" class="form-control" id="startdt" name ="startdt" value="${nowDate.substring(0,10)} 08:00" readonly>
|
||||
</div>
|
||||
<label class="col-md-2 col-sm-2 control-label">影响结束时间</label>
|
||||
<div class="col-md-4 col-sm-10">
|
||||
<input type="text" class="form-control" id="enddt" name ="enddt" value="" readonly>
|
||||
</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="doupdate()" id="btn_update">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
Reference in New Issue
Block a user