<!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-stockCheck-edit" th:object="${wmsStockCheck}">
            <input name="checkId" th:field="*{checkId}" 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="${wmsStockCheck.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="${wmsStockCheck.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(wmsStockCheck.checkDate, '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="${wmsStockCheck.checkBy}"></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/stockCheck";
        var prefixStockProduct = ctx + "crm/stockProduct";
        $("#form-stockCheck-edit").validate({
            focusCleanup: true
        });
        
        $("input[name='checkDate']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
        
        $(function() {
		    var options = {
			    url: prefixStockProduct + "/list",
	            queryParams:{
	            	'opId':[[${checkId}]],
	            	'type':3
	            },
                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>