瀏覽代碼

特殊供应商

zhijiezhao 3 年之前
父節點
當前提交
218546fa75

+ 7 - 0
src/main/java/com/caimei/modules/user/web/NewCmShopController.java

@@ -99,6 +99,13 @@ public class NewCmShopController extends BaseController {
         return "modules/user/cmNewProductShopList";
     }
 
+    @RequestMapping(value = "/special/new/edit")
+    public String specialEdit(NewCmShop newCmShop, HttpServletRequest request, HttpServletResponse response, Model model) {
+        model.addAttribute("shopType",2);
+        return "modules/user/cmNewProductShopEdit";
+    }
+
+
     @RequestMapping(value = "/special/second")
     public String secondList(NewCmShop newCmShop, HttpServletRequest request, HttpServletResponse response, Model model) {
         //二手供应商

+ 0 - 1
src/main/resources/mappings/modules/user/NewCmShopMapper.xml

@@ -89,7 +89,6 @@
 		FROM shop a
 		<include refid="newCmShopJoins"/>
 		<where>
-
 			<if test="name != null and name != ''">
 				AND a.name LIKE concat('%',#{name},'%')
 			</if>

+ 129 - 0
src/main/webapp/WEB-INF/views/modules/user/cmNewProductShopEdit.jsp

@@ -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">
+                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<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>
+                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<button class="addParams" onclick="return false">添加分帐号</button>
+            </td>
+        </tr>
+    </div>
+
+    <div class="form-actions">
+        <input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;
+    </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 += '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input name="splitCodes[' + [productParametersIndex] + '].splitCode" id="splitCode" maxlength="8" placeholder="请输入分帐商户号" type="text" class="input-small"/>&nbsp;';
+        html += '<input name="splitCodes[' + [productParametersIndex] + '].codeRemark" id="codeRemark" maxlength="10" placeholder="请输入账户备注"  type="text"   class="input-small"/>&nbsp;';
+        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>

+ 8 - 4
src/main/webapp/WEB-INF/views/modules/user/cmNewProductShopList.jsp

@@ -169,8 +169,10 @@
 </head>
 <body>
 <ul class="nav nav-tabs">
-		<li class="active"><a href="${ctx}/user/newCmShop/special/new">新品供应商</a></li>
-		<li><a href="${ctx}/user/newCmShop/special/second">二手供应商</a></li>
+		<c:if test="${shopType eq 2}"><li class="active"><a href="${ctx}/user/newCmShop/special/new">新品供应商</a></li></c:if>
+		<c:if test="${shopType eq 3}"><li><a href="${ctx}/user/newCmShop/special/new">新品供应商</a></li></c:if>
+		<c:if test="${shopType eq 3}"><li class="active"><a href="${ctx}/user/newCmShop/special/second">二手供应商</a></li></c:if>
+		<c:if test="${shopType eq 2}"><li><a href="${ctx}/user/newCmShop/special/second">二手供应商</a></li></c:if>
 </ul>
 <form:form id="searchForm" modelAttribute="newCmShop" action="${ctx}/user/newCmShop/special/new" method="post" class="breadcrumb form-search">
 		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
@@ -211,7 +213,7 @@
 				<th>供应商名称</th>
 				<th>联系人</th>
 				<th>手机号</th>
-				<c:if test="${shopType eq 3}>">
+				<c:if test="${shopType eq 3}">
 				<th>收款卡号</th>
 				</c:if>
 				<th>状态</th>
@@ -235,9 +237,11 @@
 				<td>
 					${newCmShop.contractMobile}
 				</td>
+				<c:if test="${shopType eq 3}">
 				<td>
 
 				</td>
+				</c:if>
 				<td>
 					<c:if test="${newCmShop.status eq 3}">
 						<font color="black">待审核</font>
@@ -266,7 +270,7 @@
 					${newCmShop.addTime}
 				</td>
 				<td>
-					<a href="${ctx}/user/newCmShop/form?id=${newCmShop.shopID}&editStatus=1">编辑</a>
+					<a href="${ctx}/user/newCmShop/special/new/edit?id=${newCmShop.shopID}">编辑</a>
 				</td>
 			</tr>
 		</c:forEach>

+ 2 - 2
src/main/webapp/WEB-INF/views/modules/user/newCmShopForm.jsp

@@ -1064,9 +1064,9 @@ function loadTown(curTown) {
 		html += '</div>';
 		$("#addParamsItems").append(html).show();
 		var paramsItemLength = $('.paramsItem').length;
-		if (paramsItemLength === 30) {
+		if (paramsItemLength === 5) {
 			$(this).hide();
-			return
+			return;
 		}
 	});