248 lines
11 KiB
Plaintext
248 lines
11 KiB
Plaintext
<%@page import="com.sipai.entity.sparepart.SparePartCommString"%>
|
||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||
<%request.setAttribute("START", SparePartCommString.STATUS_STOCK_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">
|
||
//流程审核文件上传所需参数
|
||
var masterId_process = '${id}';//业务Id
|
||
var tbName_process = 'TB_Process_UploadFile'; //数据表
|
||
var nameSpace_process ='ProcessUploadFile';//保存文件夹
|
||
var status = 'delete';//有删除权限
|
||
|
||
function dosave() {
|
||
$('#subForm').data('bootstrapValidator')
|
||
.updateStatus('userName', 'NOT_VALIDATED',null)
|
||
.validateField('userName');
|
||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||
$.post(ext.contextPath + "/sparepart/outStocksectionRecord/save.do", $("#subForm").serialize(), function(data) {
|
||
if (data.res == 1){
|
||
closeModal('subModal');
|
||
$("#table").bootstrapTable('refresh');
|
||
//editFun('${id}');
|
||
}else if(data.res == 0){
|
||
showAlert('d','保存失败');
|
||
}else{
|
||
showAlert('d',data.res);
|
||
}
|
||
},'json');
|
||
}
|
||
}
|
||
//输入框验证
|
||
$("#subForm").bootstrapValidator({
|
||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||
fields: {
|
||
outDate: {
|
||
validators: {
|
||
notEmpty: {
|
||
message: '领用日期不能为空'
|
||
}
|
||
}
|
||
},
|
||
warehouseId: {
|
||
validators: {
|
||
notEmpty: {
|
||
message: '所出仓库不能为空'
|
||
}
|
||
}
|
||
},
|
||
inhouseId: {
|
||
validators: {
|
||
notEmpty: {
|
||
message: '领入仓库不能为空'
|
||
}
|
||
}
|
||
},
|
||
userName: {
|
||
validators: {
|
||
notEmpty: {
|
||
message: '领用人不能为空'
|
||
}
|
||
}
|
||
},
|
||
}
|
||
});
|
||
$(function(){
|
||
//初始化文件显示
|
||
getFileList_process();
|
||
//选择部门
|
||
$.post(ext.contextPath + "/user/getDeptByBizId4Select.do", {companyId:'${company.id}'}, function(data) {
|
||
var selelct = $("#deptId").select2({
|
||
data: data,
|
||
placeholder:'请选择',//默认文字提示
|
||
allowClear: false,//允许清空
|
||
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;} // 函数用于呈现当前的选择
|
||
});
|
||
selelct.val('').trigger("change");
|
||
},'json');
|
||
//选择所出仓库
|
||
$.post(ext.contextPath + "/sparepart/warehouse/getWarehouseForSelectByCompanyId.do", {companyId:"${company.id}"}, function(data) {
|
||
var selelct =$("#warehouseId").select2({
|
||
data: data,
|
||
placeholder:'请选择',//默认文字提示
|
||
allowClear: false,//允许清空
|
||
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;} // 函数用于呈现当前的选择
|
||
});
|
||
selelct.val('').trigger("change");
|
||
},'json');
|
||
//选择领入仓库
|
||
$.post(ext.contextPath + "/sparepart/outStocksectionRecord/showinhouseIdForSelects.do", {companyId:"${company.id}"}, function(data) {
|
||
var selelct =$("#inhouseId").select2({
|
||
data: data,
|
||
placeholder:'请选择',//默认文字提示
|
||
allowClear: false,//允许清空
|
||
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;} // 函数用于呈现当前的选择
|
||
});
|
||
selelct.val('').trigger("change");
|
||
},'json');
|
||
//采购时间
|
||
$("#outDate").datepicker({
|
||
language: 'zh-CN',
|
||
autoclose: true,
|
||
todayHighlight: true,
|
||
format:'yyyy-mm-dd',
|
||
});
|
||
$("#outDate").datepicker('setDate',new Date());
|
||
});
|
||
//选择入库负责人
|
||
var showUser4SelectsFun = function() {
|
||
var userIds= $("#userId").val();
|
||
$.post(ext.contextPath + '/user/userForSelectByStructure.do', {formId:"subForm",hiddenId:"userId",textId:"userName",userIds:userIds} , function(data) {
|
||
$("#user4SelectDiv").html(data);
|
||
openModal("user4SelectModal");
|
||
});
|
||
};
|
||
//选择入库审核人
|
||
var showUser4AuditSelectsFun = function() {
|
||
var userIds= $("#auditManId").val();
|
||
$.post(ext.contextPath + '/user/userForSelectByStructure.do', {formId:"subForm",hiddenId:"auditManId",textId:"auditManName",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-2 control-label">所属厂区</label>
|
||
<div class="col-sm-10">
|
||
<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-2 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-2 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="outDate" name="outDate" style="width: 230px;" placeholder="请选择"/>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">*所出仓库</label>
|
||
<div class="col-sm-6">
|
||
<select class="form-control select2" id="warehouseId" name="warehouseId" style="width: 270px;" ></select>
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">*领入仓库</label>
|
||
<div class="col-sm-6">
|
||
<select class="form-control select2" id="inhouseId" name="inhouseId" style="width: 270px;" ></select>
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">票据单号</label>
|
||
<div class="col-sm-6">
|
||
<input type="text" class="form-control" id="billNumber" name ="billNumber" placeholder="票据单号" value="">
|
||
</div>
|
||
</div>
|
||
<!-- <div class="form-group">
|
||
<label class="col-sm-2 control-label">*领用部门</label>
|
||
<div class="col-sm-6">
|
||
<select class="form-control select2" id="deptId" name ="deptId" style="width: 270px;">
|
||
</select>
|
||
</div>
|
||
</div> !-->
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">*领用人</label>
|
||
<div class="col-sm-6">
|
||
<input type="text" class="form-control" id="userName" name="userName" placeholder="点击选择" onclick="showUser4SelectsFun();">
|
||
<input id="userId" name="userId" type="hidden" />
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">审核人</label>
|
||
<div class="col-sm-6">
|
||
<input type="text" class="form-control" id="auditManName" name="auditManName" placeholder="点击选择" onclick="showUser4AuditSelectsFun();">
|
||
<input id="auditManId" name="auditManId" type="hidden" />
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">备注</label>
|
||
<div class="col-sm-10">
|
||
<textarea class="form-control" rows="2" id ="remark" name ="remark" placeholder="备注..."></textarea>
|
||
</div>
|
||
</div>
|
||
<!-- 文件上传,显示 -->
|
||
<div class="form-group" style="margin:8px">
|
||
<label class="col-sm-2 control-label"></label>
|
||
<button type="button" class="btn btn-default btn-file" onclick="fileinput_process()" id="btn_save"><i class="fa fa-paperclip"></i>上传文件</button>
|
||
</div>
|
||
<div id="fileArea">
|
||
</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>
|