<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/webpage/include/taglib.jsp"%>
<html>
<head>
	<title>借用管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
        var validateForm;

        $(document).ready(function() {

            if($("#backState").val()=="0"){
                $("#backState").val("未归还");
            }else if(($("#backState").val()=="1")){
                $("#backState").val("已归还")
            }else if(($("#backState").val()=="2")){
                $("#backState").val("归还中")
            }
           /* laydate.render({
                elem: '#borrowDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎，因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
                event: 'focus', //响应事件。如果没有传入event，则按照默认的click
                type : 'date'
            });*/

        });

	</script>
</head>
<body>
<div class="single-form">
	<div class="container view-form">
		<form:form id="inputForm" modelAttribute="workBorrowBack" action="${ctx}/workborrowmangement/workBorrowMangement/save" method="post" class="form-horizontal">
			<form:hidden path="id"/>
			<div class="form-group layui-row first lw8">
				<div class="form-group-label"><h2>基础信息</h2></div>
				<div class="layui-item layui-col-sm6">
					<label class="layui-form-label"><span class="require-item">*</span>借用人：</label>
					<div class="layui-input-block">
						<form:input id="borrower" path="workBorrowMangement.userName" readonly="true" htmlEscape="false" class="form-control  layui-input"/>
					</div>
				</div>
				<div class="layui-item layui-col-sm6">
					<label class="layui-form-label"><span class="require-item">*</span>借用编号：</label>
					<div class="layui-input-block">
						<div class="input-group">
							<form:input path="workBorrowMangement.number" htmlEscape="false"  readonly="true"  class="form-control  layui-input"/>
							<span class="input-group-btn">
                                <label class="form-status"><c:choose><c:when test="${not empty workBorrowBack.workBorrowMangement.state}">${fns:getDictLabel(workBorrowBack.workBorrowMangement.state, 'audit_state', '')}</c:when><c:otherwise>新添</c:otherwise></c:choose></label>
                             </span>
						</div>
					</div>
				</div>
				<div class="layui-item layui-col-sm6">
					<label class="layui-form-label"><span class="require-item">*</span>借用日期：</label>
					<div class="layui-input-block">
						<input id="borrowDate" name="workBorrowMangement.borrowDate"  readonly="readonly" type="text"  maxlength="20" class="laydate-icondate form-control layer-date  layui-input laydate-icon"
							   value="<fmt:formatDate value="${workBorrowBack.workBorrowMangement.borrowDate}" pattern="yyyy-MM-dd"/>"/>
					</div>
				</div>
				<div class="layui-item layui-col-sm6">
					<label class="layui-form-label"><span class="require-item">*</span>借用部门：</label>
					<div class="layui-input-block">
						<form:input id="officeName" readonly="true" path="workBorrowMangement.officeName" htmlEscape="false" class="form-control   layui-input"/>
					</div>
				</div>
				<div class="layui-item layui-col-sm12  with-textarea">
					<label class="layui-form-label">借用事由：</label>
					<div class="layui-input-block">
						<form:textarea path="workBorrowMangement.borrowFor" cssStyle="resize: none" htmlEscape="false" rows="4"    maxlength="255" class="form-control "/>
					</div>
				</div>
			</div>
			<div class="form-group layui-row first lw8">
				<div class="form-group-label"><h2>借用详情</h2></div>
				<div class="layui-item layui-col-sm6">
					<label class="layui-form-label  double-line"><span class="require-item">*</span>固定资产编号：</label>
					<div class="layui-input-block">
						<form:input id="assetsNumber" path="workBorrowMangement.assetsNumber" readonly="true" htmlEscape="false" class="form-control required layui-input"/>
					</div>
				</div>
				<div class="layui-item layui-col-sm6">
					<label class="layui-form-label"><span class="require-item">*</span>物品名称：</label>
					<div class="layui-input-block">
						<form:input id="itemName" readonly="true" path="workBorrowMangement.itemName" htmlEscape="false" class="form-control layui-input"/>
					</div>
				</div>
				<div class="layui-item layui-col-sm6">
					<label class="layui-form-label"><span class="require-item">*</span>物品分类：</label>
					<div class="layui-input-block">
						<form:input id="itemType" readonly="true" path="workBorrowMangement.itemType" htmlEscape="false" class="form-control layui-input"/>
					</div>
				</div>
				<div class="layui-item layui-col-sm6">
					<label class="layui-form-label"><span class="require-item">*</span>物品编号：</label>
					<div class="layui-input-block">
						<form:input id="itemNumber" readonly="true" path="workBorrowMangement.itemNumber" htmlEscape="false" class="form-control  layui-input "/>
					</div>
				</div>
				<div class="layui-item layui-col-sm6">
					<label class="layui-form-label"><span class="require-item">*</span>规格型号：</label>
					<div class="layui-input-block">
						<form:input id="itemModel" readonly="true" path="workBorrowMangement.itemModel" htmlEscape="false" class="form-control layui-input "/>
					</div>
				</div>
				<div class="layui-item layui-col-sm6">
					<label class="layui-form-label"><span class="require-item">*</span>计量单位：</label>
					<div class="layui-input-block">
						<form:input id="itemPrimaryUnit" readonly="true" path="workBorrowMangement.itemPrimaryUnit" htmlEscape="false" class="form-control  layui-input "/>
					</div>
				</div>
				<div class="layui-item layui-col-sm12  ">
					<label class="layui-form-label">归还状态：</label>
					<div class="layui-input-block">
						<form:input id="backState" readonly="true" path="workBorrowMangement.backState" htmlEscape="false" class="form-control  layui-input "/>
					</div>
				</div>
			</div>
			<div class="form-group layui-row page-end"></div>
		</form:form>
	</div>
</div>
</body>
</html>