add.html 11.9 KB
<!DOCTYPE HTML>
<html  lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-material-add">
			<div class="form-group">
				<label class="col-sm-3 control-label">存货编码:</label>
				<div class="col-sm-8">
					<input id="code" name="code" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">名称:</label>
				<div class="col-sm-8">
					<input id="name" name="name" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">物料类别:</label>
				<div class="col-sm-8">
					<select id="type" name="type" class="form-control" th:with="materialType=${@dict.getType('materialType')}">
						<option th:each="item : ${materialType}" th:text="${item['dictLabel']}" th:value="${item['dictValue']}"></option>
					</select>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">库区编码:</label>
				<div class="col-sm-8">
					<input id="zoneCode" name="zoneCode" class="form-control" type="text" placeholder="指定该货物只能放在规定库区时填写,否则不填!"/>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">货主:</label>
				<div class="col-sm-8">
					<select id="company" name="company" class="form-control" th:with="list=${@company.selectCompanyByCurrentUserId()}">
                        <option value ="" code="">全部货主</option>
                        <option th:each="item : ${list}" th:text="${item['name']}" th:value="${item['id']}" th:attr = " code = ${item['code']}"></option>
					</select>
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">条码:</label>
				<div class="col-sm-8">
					<input id="barcode" name="barcode" class="form-control" type="text">
				</div>
			</div>
			<!--<div class="form-group">	-->
				<!--<label class="col-sm-3 control-label">条码2:</label>-->
				<!--<div class="col-sm-8">-->
					<!--<input id="barcode2" name="barcode2" class="form-control" type="text">-->
				<!--</div>-->
			<!--</div>-->
			<!--<div class="form-group">	-->
				<!--<label class="col-sm-3 control-label">条码3:</label>-->
				<!--<div class="col-sm-8">-->
					<!--<input id="barcode3" name="barcode3" class="form-control" type="text">-->
				<!--</div>-->
			<!--</div>-->
			<!--<div class="form-group">	-->
				<!--<label class="col-sm-3 control-label">条码4:</label>-->
				<!--<div class="col-sm-8">-->
					<!--<input id="barcode4" name="barcode4" class="form-control" type="text">-->
				<!--</div>-->
			<!--</div>-->
			<!--<div class="form-group">	-->
				<!--<label class="col-sm-3 control-label">类别A:</label>-->
				<!--<div class="col-sm-8">-->
					<!--<input id="classA" name="classA" class="form-control" type="text">-->
				<!--</div>-->
			<!--</div>-->
			<!--<div class="form-group">	-->
				<!--<label class="col-sm-3 control-label">类别B:</label>-->
				<!--<div class="col-sm-8">-->
					<!--<input id="classB" name="classB" class="form-control" type="text">-->
				<!--</div>-->
			<!--</div>-->
			<!--<div class="form-group">	-->
				<!--<label class="col-sm-3 control-label">类别C:</label>-->
				<!--<div class="col-sm-8">-->
					<!--<input id="classC" name="classC" class="form-control" type="text">-->
				<!--</div>-->
			<!--</div>-->
			<div class="form-group">	
				<label class="col-sm-3 control-label">规格:</label>
				<div class="col-sm-8">
					<input id="specification" name="specification" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">品牌:</label>
				<div class="col-sm-8">
					<input id="brand" name="brand" class="form-control" type="text">
				</div>
			</div>
			<!--<div class="form-group">	-->
				<!--<label class="col-sm-3 control-label">尺码:</label>-->
				<!--<div class="col-sm-8">-->
					<!--<input id="size" name="size" class="form-control" type="text">-->
				<!--</div>-->
			<!--</div>-->
			<!--<div class="form-group">	-->
				<!--<label class="col-sm-3 control-label">颜色:</label>-->
				<!--<div class="col-sm-8">-->
					<!--<input id="color" name="color" class="form-control" type="text">-->
				<!--</div>-->
			<!--</div>-->
			<!--<div class="form-group">	-->
				<!--<label class="col-sm-3 control-label">产地:</label>-->
				<!--<div class="col-sm-8">-->
					<!--<input id="placeOfOrigin" name="placeOfOrigin" class="form-control" type="text">-->
				<!--</div>-->
			<!--</div>-->
			<div class="form-group">	
				<label class="col-sm-3 control-label">保质期(天):</label>
				<div class="col-sm-8">
					<input id="daysToExpire" name="daysToExpire" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">临期预警天数:</label>
				<div class="col-sm-8">
					<input id="expiringDays" name="expiringDays" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">收货预警天数:</label>
				<div class="col-sm-8">
					<input id="minShelfLifeDays" name="minShelfLifeDays" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">成本:</label>
				<div class="col-sm-8">
					<input id="costPrice" name="costPrice" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">标价:</label>
				<div class="col-sm-8">
					<input id="listPrice" name="listPrice" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">净价:</label>
				<div class="col-sm-8">
					<input id="netPrice" name="netPrice" class="form-control" type="text">
				</div>
			</div>
			<!--<div class="form-group">	-->
				<!--<label class="col-sm-3 control-label">出入库是否按照 生产日期 来匹配:</label>-->
				<!--<div class="col-sm-8">-->
					<!--<input id="manufactureDate" name="manufactureDate" class="form-control" type="text">-->
				<!--</div>-->
			<!--</div>-->
			<!--<div class="form-group">	-->
				<!--<label class="col-sm-3 control-label">出入库是否按照 入库时间 来匹配:</label>-->
				<!--<div class="col-sm-8">-->
					<!--<input id="receiptDate" name="receiptDate" class="form-control" type="text">-->
				<!--</div>-->
			<!--</div>-->
			<!--<div class="form-group">	-->
				<!--<label class="col-sm-3 control-label">创建时间:</label>-->
				<!--<div class="col-sm-8">-->
					<!--<input id="created" name="created" class="form-control" type="text">-->
				<!--</div>-->
			<!--</div>-->
			<!--<div class="form-group">	-->
				<!--<label class="col-sm-3 control-label">创建用户:</label>-->
				<!--<div class="col-sm-8">-->
					<!--<input id="createdBy" name="createdBy" class="form-control" type="text">-->
				<!--</div>-->
			<!--</div>-->
			<!--<div class="form-group">	-->
				<!--<label class="col-sm-3 control-label">最后修改间:</label>-->
				<!--<div class="col-sm-8">-->
					<!--<input id="lastUpdated" name="lastUpdated" class="form-control" type="text">-->
				<!--</div>-->
			<!--</div>-->
			<!--<div class="form-group">	-->
				<!--<label class="col-sm-3 control-label">更新用户:</label>-->
				<!--<div class="col-sm-8">-->
					<!--<input id="lastUpdatedBy" name="lastUpdatedBy" class="form-control" type="text">-->
				<!--</div>-->
			<!--</div>-->
			<div class="form-group">	
				<label class="col-sm-3 control-label">是否有效:</label>
				<div class="col-sm-8">
					<div class="onoffswitch">
						<input type="checkbox" th:checked="true" class="onoffswitch-checkbox" id="enable" name="enable">
						<label class="onoffswitch-label" for="enable">
							<span class="onoffswitch-inner"></span>
							<span class="onoffswitch-switch"></span>
						</label>
					</div>
				</div>
			</div>
			<!--<div class="form-group">	-->
				<!--<label class="col-sm-3 control-label">是否删除:</label>-->
				<!--<div class="col-sm-8">-->
					<!--<input id="deleted" name="deleted" class="form-control" type="text">-->
				<!--</div>-->
			<!--</div>-->
			<!--<div class="form-group">	-->
				<!--<label class="col-sm-3 control-label">自定义字段1:</label>-->
				<!--<div class="col-sm-8">-->
					<!--<input id="userDef1" name="userDef1" class="form-control" type="text">-->
				<!--</div>-->
			<!--</div>-->
			<!--<div class="form-group">	-->
				<!--<label class="col-sm-3 control-label">自定义字段2:</label>-->
				<!--<div class="col-sm-8">-->
					<!--<input id="userDef2" name="userDef2" class="form-control" type="text">-->
				<!--</div>-->
			<!--</div>-->
			<!--<div class="form-group">	-->
				<!--<label class="col-sm-3 control-label">自定义字段3:</label>-->
				<!--<div class="col-sm-8">-->
					<!--<input id="userDef3" name="userDef3" class="form-control" type="text">-->
				<!--</div>-->
			<!--</div>-->
			<!--<div class="form-group">	-->
				<!--<label class="col-sm-3 control-label">自定义字段4:</label>-->
				<!--<div class="col-sm-8">-->
					<!--<input id="userDef4" name="userDef4" class="form-control" type="text">-->
				<!--</div>-->
			<!--</div>-->
			<!--<div class="form-group">	-->
				<!--<label class="col-sm-3 control-label">自定义字段5:</label>-->
				<!--<div class="col-sm-8">-->
					<!--<input id="userDef5" name="userDef5" class="form-control" type="text">-->
				<!--</div>-->
			<!--</div>-->
			<!--<div class="form-group">	-->
				<!--<label class="col-sm-3 control-label">自定义字段6:</label>-->
				<!--<div class="col-sm-8">-->
					<!--<input id="userDef6" name="userDef6" class="form-control" type="text">-->
				<!--</div>-->
			<!--</div>-->
			<!--<div class="form-group">	-->
				<!--<label class="col-sm-3 control-label">自定义字段7:</label>-->
				<!--<div class="col-sm-8">-->
					<!--<input id="userDef7" name="userDef7" class="form-control" type="text">-->
				<!--</div>-->
			<!--</div>-->
			<!--<div class="form-group">	-->
				<!--<label class="col-sm-3 control-label">自定义字段8:</label>-->
				<!--<div class="col-sm-8">-->
					<!--<input id="userDef8" name="userDef8" class="form-control" type="text">-->
				<!--</div>-->
			<!--</div>-->
			<div class="form-group">
				<div class="form-control-static col-sm-offset-9">
					<button type="submit" class="btn btn-primary">提交</button>
					<button onclick="$.modal.close()" class="btn btn-danger" type="button">关闭</button>
				</div>
			</div>
		</form>
	</div>
    <div th:include="include::footer"></div>
    <script type="text/javascript">
		var prefix = ctx + "general/material"
		$("#form-material-add").validate({
			rules:{
                code:{
					required:true,
				},
                name:{
                    required:true,
                },
                /*zoneCode:{
                    required:true,
                },*/
                barcode:{
                    required:true,
                },
			},
			submitHandler: function(form) {
				// $.operate.save(prefix + "/add", $('#form-material-add').serialize());
                // var tableValue = $.common.getTableValue("#form-material-add");
                // $.operate.save(prefix + "/add", tableValue);
                var tableValue = $("#form-material-add").serialize();
                tableValue = formValueReplace(tableValue, "enable", $("input[name='enable']").is(':checked'));
                tableValue = formValueReplace(tableValue, "companyId", $("#company option:selected").val());
                tableValue = formValueReplace(tableValue, "companyCode", $("#company option:selected").attr("code"));
                $.operate.save(prefix + "/add", tableValue);
			}
		});
	</script>
</body>
</html>