|
@@ -0,0 +1,327 @@
|
|
|
|
+<%@ 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 type="text/javascript">
|
|
|
|
+ $(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>
|
|
|
|
+ <style>
|
|
|
|
+ .iconBox{
|
|
|
|
+ font-size: 0;
|
|
|
|
+ }
|
|
|
|
+ .controls .conList{
|
|
|
|
+ display: inline-block;
|
|
|
|
+ margin-right: 15px;
|
|
|
|
+ }
|
|
|
|
+ .conList .btn:nth-of-type(1){
|
|
|
|
+ margin-left: 25px;
|
|
|
|
+ }
|
|
|
|
+ .upload-content {
|
|
|
|
+ margin-top: -70px;
|
|
|
|
+ }
|
|
|
|
+ .upload-content .conList .btn:nth-of-type(1) {
|
|
|
|
+ width: 90px;
|
|
|
|
+ height: 100px;
|
|
|
|
+ border: 2px solid #eee;
|
|
|
|
+ background: #fff;
|
|
|
|
+ position: relative;
|
|
|
|
+ }
|
|
|
|
+ .upload-content .conList .btn:nth-of-type(1)>div {
|
|
|
|
+ position: absolute;
|
|
|
|
+ top: 50%;
|
|
|
|
+ left: 50%;
|
|
|
|
+ transform: translate(-50%, -50%);
|
|
|
|
+ color: #666;
|
|
|
|
+ }
|
|
|
|
+ .upload-content .conList .btn:nth-of-type(1) span {
|
|
|
|
+ font-size: 35px;
|
|
|
|
+ }
|
|
|
|
+ .upload-content .conList .btn:nth-of-type(1) h5 {
|
|
|
|
+ color: #666;
|
|
|
|
+ }
|
|
|
|
+ .cancel-upload {
|
|
|
|
+ background: transparent;
|
|
|
|
+ border: none;
|
|
|
|
+ box-shadow: none;
|
|
|
|
+ position: relative;
|
|
|
|
+ top: -38px;
|
|
|
|
+ left: -25px;
|
|
|
|
+ cursor: pointer;
|
|
|
|
+ z-index: 100;
|
|
|
|
+ }
|
|
|
|
+ .upload-content .conList ol li {
|
|
|
|
+ width: 114px;
|
|
|
|
+ min-height: 80px;
|
|
|
|
+ text-align: center;
|
|
|
|
+ background: #fff;
|
|
|
|
+ position: relative;
|
|
|
|
+ top: 120px;
|
|
|
|
+ margin-left: 2px;
|
|
|
|
+ }
|
|
|
|
+ .hide-pic {
|
|
|
|
+ display: none !important;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ </style>
|
|
|
|
+</head>
|
|
|
|
+<body>
|
|
|
|
+ <ul class="nav nav-tabs">
|
|
|
|
+ <li><a href="${ctx}/zplm/cmBrandAuth/">品牌授权列表</a></li>
|
|
|
|
+ <li class="active"><a href="${ctx}/zplm/cmBrandAuth/form?id=${cmBrandAuth.id}">品牌授权${not empty cmBrandAuth.id?'编辑':'添加'}</a></li>
|
|
|
|
+ </ul><br/>
|
|
|
|
+ <form:form id="inputForm" modelAttribute="cmBrandAuth" action="${ctx}/zplm/cmBrandAuth/save" method="post" class="form-horizontal">
|
|
|
|
+ <form:hidden path="id"/>
|
|
|
|
+ <sys:message content="${message}"/>
|
|
|
|
+ <div class="control-group">
|
|
|
|
+ <label class="control-label"><span class="help-inline"><font color="red">*</font> </span>品牌:</label>
|
|
|
|
+ <div class="controls">
|
|
|
|
+ <form:select path="brandId" class="input-large required" onchange="changeBrand()">
|
|
|
|
+ <form:option value="" label="请选择"/>
|
|
|
|
+ <form:options items="${brandList}" itemLabel="name" itemValue="id"/>
|
|
|
|
+ </form:select>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="control-group">
|
|
|
|
+ <label class="control-label"><span class="help-inline"><font color="red">*</font> </span>产地:</label>
|
|
|
|
+ <div class="controls">
|
|
|
|
+ <form:select path="countryId" class="input-large required">
|
|
|
|
+ <form:option value="" label="请选择"/>
|
|
|
|
+ <form:options items="${countryList}" itemLabel="name" itemValue="countryId"/>
|
|
|
|
+ </form:select>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="control-group iconBox">
|
|
|
|
+ <label class="control-label"><span class="help-inline"><font color="red">*</font> </span>品牌logo:</label>
|
|
|
|
+ <div class="controls upload-content" id="authLogoBox">
|
|
|
|
+ <div class="conList">
|
|
|
|
+ <form:hidden id="authLogo" path="authLogo" htmlEscape="false" maxlength="255" class="input-xlarge required"/>
|
|
|
|
+ <sys:ckfinder input="authLogo" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
|
|
|
|
+ <br>
|
|
|
|
+ <label style="margin-left: 150px">建议图片分辨率128px*88px</label>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="control-group">
|
|
|
|
+ <label class="control-label">防伪链接:</label>
|
|
|
|
+ <div class="controls">
|
|
|
|
+ <form:input path="securityLink" htmlEscape="false" maxlength="255" class="input-xlarge" placeholder="输入官方防伪链接"/>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="control-group">
|
|
|
|
+ <label class="control-label">代理商:</label>
|
|
|
|
+ <div class="controls">
|
|
|
|
+ <input type="radio" name="agentFlag" value="0" onclick="changeAgentFlag()" ${cmBrandAuth.agentFlag eq 0?"checked":""}/>无
|
|
|
|
+ <input type="radio" name="agentFlag" value="1" onclick="changeAgentFlag()" ${cmBrandAuth.agentFlag eq null?"checked":cmBrandAuth.agentFlag eq 1?"checked":""}/>有
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <div id="agentDiv">
|
|
|
|
+ <div class="control-group">
|
|
|
|
+ <label class="control-label"><span class="help-inline"><font color="red">*</font> </span>代理商名称:</label>
|
|
|
|
+ <div class="controls">
|
|
|
|
+ <form:input path="agentName" htmlEscape="false" maxlength="50" class="input-xlarge required" placeholder="输入代理商名称"/>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="control-group">
|
|
|
|
+ <label class="control-label">代理声明:</label>
|
|
|
|
+ <div class="controls">
|
|
|
|
+ <input type="radio" name="statementType" value="1" onclick="changeStatementType()" ${cmBrandAuth.statementType eq null?"checked":cmBrandAuth.statementType eq 1?"checked":""}/>弹窗
|
|
|
|
+ <input type="radio" name="statementType" value="2" onclick="changeStatementType()" ${cmBrandAuth.statementType eq 2?"checked":""} />链接
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="control-group" id="statementContentDiv">
|
|
|
|
+ <label class="control-label"><span class="help-inline"><font color="red">*</font> </span>内容:</label>
|
|
|
|
+ <div class="controls">
|
|
|
|
+ <form:textarea path="statementContent" htmlEscape="false" rows="4" class="input-xxlarge required"/>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="control-group" id="statementLinkDiv">
|
|
|
|
+ <label class="control-label"><span class="help-inline"><font color="red">*</font> </span>链接:</label>
|
|
|
|
+ <div class="controls">
|
|
|
|
+ <form:input path="statementLink" htmlEscape="false" maxlength="255" class="input-xlarge required"/>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <div class="control-group">
|
|
|
|
+ <label class="control-label"><span class="help-inline"><font color="red">*</font> </span>被授权方:</label>
|
|
|
|
+ <div class="controls">
|
|
|
|
+ <form:input path="authParty" htmlEscape="false" maxlength="50" class="input-xlarge required" placeholder="输入被授权方名称"/>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="form-actions">
|
|
|
|
+ <input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>
|
|
|
|
+ <input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
|
|
|
|
+ </div>
|
|
|
|
+ </form:form>
|
|
|
|
+<script type = text/javascript>
|
|
|
|
+ $(function () {
|
|
|
|
+ $('.upload-content .conList .btn:nth-of-type(1)').html('<div><span>+</span><h5>选择图片</h5></div>');
|
|
|
|
+ $('.upload-content .conList .btn:nth-of-type(2)').after('<img class="cancel-upload" src="/static/images/close-btn1.png">').remove();
|
|
|
|
+ $('.upload-content .conList').find('.cancel-upload').hide();
|
|
|
|
+ var observeEle = document.getElementsByClassName('upload-content')[0];
|
|
|
|
+ var MutationObserver = window.MutationObserver || window.WebKitMutationObserver;
|
|
|
|
+ var MutationObserverConfig = {
|
|
|
|
+ childList: true,
|
|
|
|
+ subtree: true,
|
|
|
|
+ characterData: true
|
|
|
|
+ };
|
|
|
|
+ var observer = new MutationObserver(function (mutations) {
|
|
|
|
+ $.each(mutations, function (index, item) {
|
|
|
|
+ if (item.type === 'childList') {
|
|
|
|
+ // 在创建新的 element 时调用
|
|
|
|
+ var target = $(item.target),
|
|
|
|
+ thisWrapper = target.closest('.conList'),
|
|
|
|
+ nextEle = thisWrapper.next();
|
|
|
|
+ thisWrapper.find('li').css('z-index', 99);
|
|
|
|
+ thisWrapper.find('.cancel-upload').show();
|
|
|
|
+ if (nextEle.hasClass('hide-pic')) {
|
|
|
|
+ nextEle.removeClass('hide-pic');
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ });
|
|
|
|
+ observer.observe(observeEle, MutationObserverConfig);
|
|
|
|
+
|
|
|
|
+ $('body').on('click', '.cancel-upload', function () {
|
|
|
|
+ var wrapper = $(this).closest('.conList');
|
|
|
|
+ wrapper.find('li').css('z-index', '-1');
|
|
|
|
+ wrapper.find('input').val('');
|
|
|
|
+ $(this).hide();
|
|
|
|
+ wrapper.removeClass("hide-pic");
|
|
|
|
+ wrapper.parent().append(wrapper.clone());
|
|
|
|
+ wrapper.remove();
|
|
|
|
+ $(".conList").each(function (i, ele) {
|
|
|
|
+ if ($(ele).find("input.input-xlarge").val()) {
|
|
|
|
+ $(ele).next().removeClass("hide-pic")
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ $(window).on("load", function () {
|
|
|
|
+ setTimeout(function () {
|
|
|
|
+ $("#authLogoBox").find("input.input-xlarge").each(function (i, ele) {
|
|
|
|
+ if ($(ele).val()) {
|
|
|
|
+ $(ele).next().find("li").css("z-index", "99");
|
|
|
|
+ $(ele).parents(".conList").find(".cancel-upload").show();
|
|
|
|
+ $(ele).parents(".conList").next().removeClass("hide-pic")
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }, 200);
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+</script>
|
|
|
|
+<script type="text/javascript">
|
|
|
|
+ $(function () {
|
|
|
|
+ changeAgentFlag();
|
|
|
|
+ changeStatementType();
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ //修改有无代理商
|
|
|
|
+ function changeAgentFlag() {
|
|
|
|
+ var agentFlag = $('input[name="agentFlag"]:checked').val();
|
|
|
|
+ if (agentFlag == 0) {
|
|
|
|
+ $("#agentDiv").hide();
|
|
|
|
+ }else {
|
|
|
|
+ $("#agentDiv").show();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ //修改声明类型
|
|
|
|
+ function changeStatementType() {
|
|
|
|
+ var statementType = $('input[name="statementType"]:checked').val();
|
|
|
|
+ if (statementType == 1) {
|
|
|
|
+ $("#statementContentDiv").show();
|
|
|
|
+ $("#statementLinkDiv").hide();
|
|
|
|
+ } else {
|
|
|
|
+ $("#statementContentDiv").hide();
|
|
|
|
+ $("#statementLinkDiv").show();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //修改品牌,品牌logo跟着修改
|
|
|
|
+ function changeBrand() {
|
|
|
|
+ var brandId = $("#brandId").val();
|
|
|
|
+ var url;
|
|
|
|
+ <c:forEach items="${brandList}" var="brand">
|
|
|
|
+ if ('${brand.id}' == brandId){
|
|
|
|
+ url = '${brand.authLogo}';
|
|
|
|
+ $("#authLogoPreview a").attr('href','${brand.authLogo}')
|
|
|
|
+ $("#authLogoPreview img").attr('src','${brand.authLogo}')
|
|
|
|
+ $("#authLogoPreview img").attr('url','${brand.authLogo}')
|
|
|
|
+ }
|
|
|
|
+ </c:forEach>
|
|
|
|
+ if ($("#authLogoPreview a").attr('href') == '') {
|
|
|
|
+ clearLogoImage()
|
|
|
|
+ }else {
|
|
|
|
+ if ($("#authLogoPreview a").attr('href') == undefined){
|
|
|
|
+ $("#authLogoPreview li").append("<a href=\"http://192.168.2.100/group1/M00/00/05/wKgCZGBdlSyAHzPDAAJDl8RXwhI006.png\" target=\"_blank\">\n" +
|
|
|
|
+ "\t\t\t\t\t\t<img src=\"http://192.168.2.100/group1/M00/00/05/wKgCZGBdlSyAHzPDAAJDl8RXwhI006.png\" url=\"http://192.168.2.100/group1/M00/00/05/wKgCZGBdlSyAHzPDAAJDl8RXwhI006.png\" style=\"max-width:100px;max-height:100px;_height:100px;border:0;padding:3px;\">\n" +
|
|
|
|
+ "\t\t\t\t\t\t</a> \n" +
|
|
|
|
+ "\t\t\t\t\t\t<a href=\"javascript:\" onclick=\"authLogoDel(this);\">×</a>")
|
|
|
|
+ $("#authLogoPreview a").attr('href', url);
|
|
|
|
+ $("#authLogoPreview img").attr('src', url);
|
|
|
|
+ $("#authLogoPreview img").attr('url', url);
|
|
|
|
+ if (url == '') {
|
|
|
|
+ clearLogoImage()
|
|
|
|
+ }
|
|
|
|
+ }else {
|
|
|
|
+ var wrapper = $("#authLogoBox .conList");
|
|
|
|
+ var nextEle = wrapper.next();
|
|
|
|
+ wrapper.find('li').css('z-index', 99);
|
|
|
|
+ wrapper.find('.cancel-upload').show();
|
|
|
|
+ if (nextEle.hasClass('hide-pic')) {
|
|
|
|
+ nextEle.removeClass('hide-pic');
|
|
|
|
+ }
|
|
|
|
+ $("#authLogo").val($("#authLogoPreview a").attr('href'));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //清除Logo图片
|
|
|
|
+ function clearLogoImage() {
|
|
|
|
+ var wrapper = $("#authLogoBox .conList");
|
|
|
|
+ wrapper.find('li').css('z-index', '-1');
|
|
|
|
+ wrapper.find('input').val('');
|
|
|
|
+ $('.cancel-upload').hide();
|
|
|
|
+ wrapper.removeClass("hide-pic");
|
|
|
|
+ wrapper.parent().append(wrapper.clone());
|
|
|
|
+ wrapper.remove();
|
|
|
|
+ $(".conList").each(function (i, ele) {
|
|
|
|
+ if ($(ele).find("input.input-xlarge").val()) {
|
|
|
|
+ $(ele).next().removeClass("hide-pic")
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //错误提示
|
|
|
|
+ var errorMsg = "${errorMsg}";
|
|
|
|
+ if(errorMsg){
|
|
|
|
+ alertx(errorMsg);
|
|
|
|
+ }
|
|
|
|
+</script>
|
|
|
|
+</body>
|
|
|
|
+</html>
|