<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('详情入库管理')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-stockEnter-edit" th:object="${wmsStockEnter}">
            <input name="enterId" th:field="*{enterId}" type="hidden">
            <input name="storageId" type="hidden" id="storageId"  th:field="*{storageId}"/>
        	<h4 class="form-header h4">入库信息</h4>
        	<div class="row">       
                <div class="col-sm-6">  
		            <div class="form-group">
		                <label class="col-sm-4 control-label">标题：</label>
		                <div class="col-sm-8">
							<div class="form-control-static" th:text="${wmsStockEnter.title}"></div>
	                	</div>   	
		            </div> 
                </div>      
                <div class="col-sm-6">  
		            <div class="form-group">    
		                <label class="col-sm-4 control-label">仓库：</label>
		                <div class="col-sm-8">
		                	<div class="input-group">
								<div class="form-control-static" th:text="${wmsStockEnter.storage.storageName}"></div>
							</div>
		                </div>
		            </div>
                </div> 
            </div>  
            <div class="row">       
                <div class="col-sm-6">  
		            <div class="form-group">    
		                <label class="col-sm-4 control-label">入库日期：</label>
		                <div class="col-sm-8">
		                    <div class="input-group date">
		                        <div class="form-control-static" th:text="${#dates.format(wmsStockEnter.enterDate, 'yyyy-MM-dd')}" ></div>
		                    </div>
		                </div>
		            </div>
                </div>      
                <div class="col-sm-6">              
		            <div class="form-group">    
		                <label class="col-sm-4 control-label">负责人：</label>
		                <div class="col-sm-8">               
		                    <div class="input-group">
								<div class="form-control-static" th:text="${wmsStockEnter.enterBy}"></div>
							</div>
		                </div>
		            </div>
                </div> 
            </div>  
            
            <h4 class="form-header h4">产品信息</h4>
            <div class="row">
                <div class="col-sm-12">
                    <div class="col-sm-12 select-table table-striped">
					    <table id="bootstrap-table"></table>
					</div>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script  th:inline="javascript">
        var prefix = ctx + "crm/stockEnter";
        var prefixStockProduct = ctx + "crm/stockProduct";
        $("#form-stockEnter-edit").validate({
            focusCleanup: true
        });
        
        
        $(function() {
		    var options = {
			        url: prefixStockProduct + "/list",
			        sortName: "sort",
			        sortOrder: "desc",
		            queryParams:{
		            	'opId':[[${enterId}]],
		            	'type':0
		            },
	                pagination: false,
			        showSearch: false,
	                showRefresh: false,
	                showToggle: false,
	                showColumns: false,
			        columns: [
			        {
			        	field: 'index',
			        	align: 'center',
			        	title: "序号",
	                    formatter: function (value, row, index) {
	                    	var columnIndex = $.common.sprintf("<input type='hidden' name='index' value='%s'>", $.table.serialNumber(index));
	                    	return columnIndex + $.table.serialNumber(index);
	                    }
	                },
			        {
			            field: 'productId',
			            align: 'center',
			            title: '产品ID',
			            width:40
			        },
			        {
			            field: 'productName',
			            align: 'center',
			            title: '产品名称'
			        },
			        {
			            field: 'productNum1',
			            align: 'center',
			            title: '入库数量'
			        }]
			    };
			    $.table.init(options);
			});
    </script>
</body>
</html>