172 lines
6.9 KiB
Plaintext
172 lines
6.9 KiB
Plaintext
|
|
<%@page import="com.sipai.entity.sparepart.SparePartCommString"%>
|
|||
|
|
<%@ page language="java" pageEncoding="UTF-8"%>
|
|||
|
|
<%request.setAttribute("START", SparePartCommString.STATUS_CHECK_START); %>
|
|||
|
|
<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 dosave() {
|
|||
|
|
$('#subForm').data('bootstrapValidator')
|
|||
|
|
.updateStatus('handler', 'NOT_VALIDATED',null)
|
|||
|
|
.validateField('handler');
|
|||
|
|
$('#subForm').data('bootstrapValidator')
|
|||
|
|
.updateStatus('lastTime', 'NOT_VALIDATED',null)
|
|||
|
|
.validateField('lastTime');
|
|||
|
|
$("#subForm").bootstrapValidator('validate');//提交验证
|
|||
|
|
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
|||
|
|
$.post(ext.contextPath + "/sparepart/stockCheck/save.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: {
|
|||
|
|
lastTime: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '上次盘点月份不能为空'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
nowTime: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '本次盘点月份不能为空'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
handler: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '盘点人不能为空'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
$(function(){
|
|||
|
|
//上次盘点月份
|
|||
|
|
$("#lastTime").datepicker({
|
|||
|
|
language: 'zh-CN',
|
|||
|
|
autoclose: true,
|
|||
|
|
format:'yyyy-mm',
|
|||
|
|
startView: 'months',
|
|||
|
|
maxViewMode:'years',
|
|||
|
|
minViewMode:'months'
|
|||
|
|
});
|
|||
|
|
//本次盘点月份
|
|||
|
|
$("#nowTime").datepicker({
|
|||
|
|
language: 'zh-CN',
|
|||
|
|
autoclose: true,
|
|||
|
|
format:'yyyy-mm',
|
|||
|
|
startView: 'months',
|
|||
|
|
maxViewMode:'years',
|
|||
|
|
minViewMode:'months'
|
|||
|
|
});
|
|||
|
|
$("#nowTime").datepicker('setDate',new Date());
|
|||
|
|
});
|
|||
|
|
//选择入库负责人
|
|||
|
|
var showUser4SelectsFun = function() {
|
|||
|
|
var userIds= $("#handlerId").val();
|
|||
|
|
$.post(ext.contextPath + '/user/userForSelectByStructure.do', {formId:"subForm",hiddenId:"handlerId",textId:"handler",userIds:userIds} , function(data) {
|
|||
|
|
$("#user4SelectDiv").html(data);
|
|||
|
|
openModal("user4SelectModal");
|
|||
|
|
});
|
|||
|
|
};
|
|||
|
|
</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">
|
|||
|
|
<!-- 界面提醒div强制id为alertDiv -->
|
|||
|
|
<div id="alertDiv"></div>
|
|||
|
|
<input name="status" type="hidden" value="${START}"/>
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-3 control-label">所属厂区</label>
|
|||
|
|
<div class="col-sm-6">
|
|||
|
|
<input name="bizId" type="hidden" value="${company.id}"/>
|
|||
|
|
<p class="form-control-static" >${company.name}</p>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-3 control-label">盘点仓库</label>
|
|||
|
|
<div class="col-sm-6">
|
|||
|
|
<input name="warehouseId" type="hidden" value="${warehouse.id}"/>
|
|||
|
|
<p class="form-control-static" >${warehouse.name}</p>
|
|||
|
|
</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" id="id" name ="id" placeholder="名称" value="${id}" readonly>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-3 control-label">*上次盘点月份</label>
|
|||
|
|
<div class="col-sm-6">
|
|||
|
|
<div class="input-group date">
|
|||
|
|
<div class="input-group-addon">
|
|||
|
|
<i class="fa fa-calendar"></i>
|
|||
|
|
</div>
|
|||
|
|
<input type="text" class="form-control" id="lastTime" name="lastTime" style="width: 230px;" placeholder="请选择"/>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-3 control-label">*本次盘点月份</label>
|
|||
|
|
<div class="col-sm-6">
|
|||
|
|
<div class="input-group date">
|
|||
|
|
<div class="input-group-addon">
|
|||
|
|
<i class="fa fa-calendar"></i>
|
|||
|
|
</div>
|
|||
|
|
<input type="text" class="form-control" id="nowTime" name="nowTime" style="width: 230px;" placeholder="请选择"/>
|
|||
|
|
</div>
|
|||
|
|
</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" id="handler" name="handler" placeholder="点击选择" onclick="showUser4SelectsFun();">
|
|||
|
|
<input id="handlerId" name="handlerId" type="hidden" />
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-3 control-label">备注</label>
|
|||
|
|
<div class="col-sm-7">
|
|||
|
|
<textarea class="form-control" rows="2" id ="remark" name ="remark" placeholder="备注..."></textarea>
|
|||
|
|
</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()" id="btn_save">保存</button>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<!-- /.modal-content -->
|
|||
|
|
</div>
|
|||
|
|
<!-- /.modal-dialog -->
|
|||
|
|
</div>
|