add.html 13.1 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">
					<select id="companyCode" name="companyCode"  class="form-control" th:with="companyList=${@companyService.selectCompanyByCurrentUserId()}">
						<option th:each="company : ${companyList}" th:text="${company['name']}" th:value="${company['code']}"></option>
					</select>
				</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">是否用高托盘(1:是):</label>
				<div class="col-sm-8">
					<input id="isHigh" name="isHigh" 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="spec" name="spec" 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="unit" name="unit" 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=${@materialType.queryType()}">
						<option th:each="item : ${materialType}" th:text="${item['name']}" th:value="${item['code']}"></option>
					</select>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">ABC分类:</label>
				<div class="col-sm-8">
					<input id="abcClass" name="abcClass" 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">
					<select id="locatingRule" name="locatingRule" class="form-control" th:with="list=${@FilterConfigDetailService.queryFilterConfigDetail('locationRule')}">
						<option value="">请选择</option>
						<option th:each="flow : ${list}" th:text="${flow['description']}" th:value="${flow['code']}"></option>
					</select>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">分配规则:</label>
				<div class="col-sm-8">
					<select id="allocationRule" name="allocationRule" class="form-control" th:with="list=${@FilterConfigDetailService.queryFilterConfigDetail('allocationRule')}">
						<option value="">请选择</option>
						<option th:each="flow : ${list}" th:text="${flow['description']}" th:value="${flow['code']}"></option>
					</select>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">补货规则:</label>
				<div class="col-sm-8">
					<select id="replenishmentRule" name="replenishmentRule" class="form-control" th:with="list=${@FilterConfigDetailService.queryFilterConfigDetail('replenishmentRule')}">
						<option value="">请选择</option>
						<option th:each="flow : ${list}" th:text="${flow['description']}" th:value="${flow['code']}"></option>
					</select>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">空货位规则:</label>
				<div class="col-sm-8">
					<select id="emptyLocRule" name="emptyLocRule" class="form-control" th:with="list=${@FilterConfigDetailService.queryFilterConfigDetail('emptyLocRule')}">
						<option value="">请选择</option>
						<option th:each="flow : ${list}" th:text="${flow['description']}" th:value="${flow['code']}"></option>
					</select>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">入库规则:</label>
				<div class="col-sm-8">
					<select id="receivingFlow" name="receivingFlow" class="form-control" th:with="list=${@StatusFlow.flowList('receivingFlow')}">
						<option value="">请选择</option>
						<option th:each="flow : ${list}" th:text="${flow['name']}" th:value="${flow['code']}"></option>
					</select>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">出库流程:</label>
				<div class="col-sm-8">
					<select id="shippingFlow" name="shippingFlow" class="form-control" th:with="list=${@StatusFlow.flowList('shippingFlow')}">
						<option value="">请选择</option>
						<option th:each="flow : ${list}" th:text="${flow['name']}" th:value="${flow['code']}"></option>
					</select>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">属性模板:</label>
				<div class="col-sm-8">
					<input id="attributeTemplateCode" name="attributeTemplateCode" 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="trackSerialNum" name="trackSerialNum" 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="autoGenSerialNum" name="autoGenSerialNum" class="form-control">
						<option value="">请选择</option>
						<option value="0"></option>
						<option value="1"></option>
					</select>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">自动生成序列号表达式:</label>
				<div class="col-sm-8">
					<input id="autoGenSerialNumFormat" name="autoGenSerialNumFormat" 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="snTemplateCode" name="snTemplateCode" 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="version" name="version" 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 + "config/material";
		$("#form-material-add").validate({
			rules:{
                code:{
					required:true,
				},
                name:{
                    required:true,
                },
				daysToExpire:{
					digits:true
				},
				trackSerialNum:{
					digits:true
				},
				autoGenSerialNum:{
					digits:true
				},
				expiringDays:{
					digits:true
				},
				minShelfLifeDays:{
					digits: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, "companyCode", $("#companyCode option:selected").val());
                tableValue = formValueReplace(tableValue, "enable", $("input[name='enable']").is(':checked'));
				tableValue = formValueReplace(tableValue, "receivingFlow", $("#receivingFlow option:selected").val());
				tableValue = formValueReplace(tableValue, "shippingFlow", $("#shippingFlow option:selected").val());
				tableValue = formValueReplace(tableValue, "locatingRule", $("#locatingRule option:selected").val());
				tableValue = formValueReplace(tableValue, "allocationRule", $("#allocationRule option:selected").val());
				tableValue = formValueReplace(tableValue, "replenishmentRule", $("#replenishmentRule option:selected").val());
				tableValue = formValueReplace(tableValue, "emptyLocRule", $("#emptyLocRule option:selected").val());
				tableValue = formValueReplace(tableValue, "pickingRule", $("#pickingRule option:selected").val());
                $.operate.save(prefix + "/add", tableValue);
			}
		});
	</script>
</body>
</html>