<!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-stockAllocation-edit" th:object="${wmsStockAllocation}">
            <input name="allocationId" th:field="*{allocationId}" type="hidden">
            <input name="outStorageId"  th:field="*{outStorageId}" type="hidden" id="outStorageId" >
            <input name="enterStorageId" th:field="*{enterStorageId}" type="hidden" id="enterStorageId" >
            <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="${wmsStockAllocation.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="form-control-static" th:text="${wmsStockAllocation.outStorageName}"></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="form-control-static" th:text="${#dates.format(wmsStockAllocation.allocationDate, 'yyyy-MM-dd')}" ></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="form-control-static" th:text="${wmsStockAllocation.enterStorageName}"></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="form-control-static" th:text="${wmsStockAllocation.allocationBy}"></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/stockAllocation";
        var prefixStock = ctx + "crm/stock";
        var prefixStockProduct = ctx + "crm/stockProduct";
        $("#form-stockAllocation-edit").validate({
            focusCleanup: true
        });
        $("input[name='allocationDate']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
        
        $(function() {
		    var options = {
			    url: prefixStockProduct + "/list",
	            queryParams:{
	            	'opId':[[${allocationId}]],
	            	'type':2
	            },
                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: '仓库库存数量',
		            width:40
		        },
		        {
		            field: 'productNum2',
		            align: 'center',
		            title: '调拨数量'
		        }]
		    };
		    $.table.init(options);
		});        
    </script>
</body>
</html>