|
@@ -0,0 +1,129 @@
|
|
|
|
+<%@ page contentType="text/html;charset=UTF-8" %>
|
|
|
|
+<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
|
|
|
|
+<html>
|
|
|
|
+<head>
|
|
|
|
+ <title></title>
|
|
|
|
+ <meta name="decorator" content="default"/>
|
|
|
|
+ <script>
|
|
|
|
+
|
|
|
|
+ $(document).ready(function () {
|
|
|
|
+ //$("#name").focus();
|
|
|
|
+ $("#inputForm").validate({
|
|
|
|
+ submitHandler: function (form) {
|
|
|
|
+ loading('正在提交,请稍等...');
|
|
|
|
+ form.submit();
|
|
|
|
+ },
|
|
|
|
+ errorContainer: "#messageBox",
|
|
|
|
+ errorPlacement: function (error, element) {
|
|
|
|
+ $("#messageBox").text("输入有误,请先更正。");
|
|
|
|
+ if (element.is(":checkbox") || element.is(":radio") || element.parent().is(".input-append")) {
|
|
|
|
+ error.appendTo(element.parent().parent());
|
|
|
|
+ } else {
|
|
|
|
+ error.insertAfter(element);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ </script>
|
|
|
|
+</head>
|
|
|
|
+<body>
|
|
|
|
+<ul class="nav nav-tabs">
|
|
|
|
+ <li><a href="${ctx}/user/newCmShop/special/new">新品供应商</a></li>
|
|
|
|
+ <li class="active"><a href="${ctx}/user/newCmShop/special/new">添加新品供应商</a></li>
|
|
|
|
+</ul>
|
|
|
|
+<br/>
|
|
|
|
+<form:form id="inputForm" modelAttribute="newCmShop" action="${ctx}/user/newCmShop/special/new" method="post"
|
|
|
|
+ class="form-horizontal">
|
|
|
|
+ <sys:message content="${message}"/>
|
|
|
|
+
|
|
|
|
+ <div class="control-group">
|
|
|
|
+ <label class="control-label"><font color="red">*</font>供应商名称:</label>
|
|
|
|
+ <div class="controls">
|
|
|
|
+ <form:input path="name" htmlEscape="false" maxlength="15" class="input-medium"/>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="control-group">
|
|
|
|
+ <label class="control-label"><font color="red">*</font>联系人:</label>
|
|
|
|
+ <div class="controls">
|
|
|
|
+ <form:input path="linkMan" htmlEscape="false" maxlength="15" class="input-medium"/>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="control-group">
|
|
|
|
+ <label class="control-label"><font color="red">*</font>手机号:</label>
|
|
|
|
+ <div class="controls">
|
|
|
|
+ <form:input path="contractMobile" htmlEscape="false" type="number" maxlength="15" class="input-medium"/>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="control-group">
|
|
|
|
+ <label class="control-label"><font color="red">*</font>状态:</label>
|
|
|
|
+ <div class="controls">
|
|
|
|
+ <form:select path="status" class="input-medium">
|
|
|
|
+ <form:option value="" label="请选择"/>
|
|
|
|
+ <form:options items="${fns:getDictList('shop_status')}" itemLabel="label" itemValue="value"
|
|
|
|
+ htmlEscape="false"/>
|
|
|
|
+ </form:select>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="control-group">
|
|
|
|
+ <tr>
|
|
|
|
+ <th><b>线上分账账号:</b></th>
|
|
|
|
+ <td colspan="3" class="params">
|
|
|
|
+ <div id="addParamsItems">
|
|
|
|
+ <%--相关参数层--%>
|
|
|
|
+ <input type="hidden" value="${fn:length(newCmShop.splitCodes)}"
|
|
|
|
+ id="productParametersLength">
|
|
|
|
+ <c:forEach items="${newCmShop.splitCodes}" var="item" varStatus="varIndex">
|
|
|
|
+ <div id="paramsItem" class="paramsItem">
|
|
|
|
+ <form:input path="splitCodes[${varIndex.index}].splitCode" id="paramsName"
|
|
|
|
+ maxlength="8" placeholder="请输入分帐商户号" class="input-small"/>
|
|
|
|
+ <form:input path="splitCodes[${varIndex.index}].codeRemark" id="paramsContent"
|
|
|
|
+ maxlength="10" placeholder="请输入账户备注"
|
|
|
|
+ class="input-small"/>
|
|
|
|
+ <span type="button" style="cursor: pointer;color: #0B61A4"
|
|
|
|
+ onclick="deleteParams(this)">删除</span>
|
|
|
|
+ </div>
|
|
|
|
+ </c:forEach>
|
|
|
|
+ </div>
|
|
|
|
+ <button class="addParams" onclick="return false">添加分帐号</button>
|
|
|
|
+ </td>
|
|
|
|
+ </tr>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <div class="form-actions">
|
|
|
|
+ <input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>
|
|
|
|
+ </div>
|
|
|
|
+</form:form>
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+<script>
|
|
|
|
+
|
|
|
|
+ var productParametersIndex = $('#productParametersLength').val() - 1;
|
|
|
|
+ $(".addParams").click(function () {
|
|
|
|
+ var val = $("#paramsName").val();
|
|
|
|
+ // alertx("+++++"+val.length) splitCodes[${varIndex.index}].splitCode
|
|
|
|
+ productParametersIndex++;
|
|
|
|
+ var html = '<div id="paramsItem" class="paramsItem">';
|
|
|
|
+ html += ' <input name="splitCodes[' + [productParametersIndex] + '].splitCode" id="splitCode" maxlength="8" placeholder="请输入分帐商户号" type="text" class="input-small"/> ';
|
|
|
|
+ html += '<input name="splitCodes[' + [productParametersIndex] + '].codeRemark" id="codeRemark" maxlength="10" placeholder="请输入账户备注" type="text" class="input-small"/> ';
|
|
|
|
+ html += '<span type="button" style="cursor: pointer;color: #0B61A4" onclick="deleteParams(this)"">删除</span>';
|
|
|
|
+ html += '</div>';
|
|
|
|
+ $("#addParamsItems").append(html).show();
|
|
|
|
+ var paramsItemLength = $('.paramsItem').length;
|
|
|
|
+ if (paramsItemLength === 5) {
|
|
|
|
+ $(this).hide();
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ //删除相关参数
|
|
|
|
+ function deleteParams(paramsThis) {
|
|
|
|
+ $(paramsThis).parent().remove();
|
|
|
|
+ var paramsItemLength = $('.paramsItem').length;
|
|
|
|
+ if (paramsItemLength < 50) {
|
|
|
|
+ $('.addParams').show();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+</script>
|
|
|
|
+</body>
|
|
|
|
+
|
|
|
|
+</html>
|