|
@@ -88,16 +88,16 @@
|
|
|
</head>
|
|
|
<body>
|
|
|
<ul class="nav nav-tabs">
|
|
|
- <li><a href="${ctx}/zplm/cmBrandAuthorization/">品牌授权列表</a></li>
|
|
|
- <li class="active"><a href="${ctx}/zplm/cmBrandAuthorization/form?id=${cmBrandAuthorization.id}">品牌授权${not empty cmBrandAuthorization.id?'编辑':'添加'}</a></li>
|
|
|
+ <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="cmBrandAuthorization" action="${ctx}/zplm/cmBrandAuthorization/save" method="post" class="form-horizontal">
|
|
|
+ <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">*品牌:</label>
|
|
|
<div class="controls">
|
|
|
- <form:select path="brandId" class="input-medium ">
|
|
|
+ <form:select path="brandId" class="input-medium required" onchange="changeBrand()">
|
|
|
<form:option value="" label="请选择"/>
|
|
|
<form:options items="${brandList}" itemLabel="name" itemValue="id"/>
|
|
|
</form:select>
|
|
@@ -106,7 +106,7 @@
|
|
|
<div class="control-group">
|
|
|
<label class="control-label">*产地:</label>
|
|
|
<div class="controls">
|
|
|
- <form:select path="countryId" class="input-medium ">
|
|
|
+ <form:select path="countryId" class="input-medium required">
|
|
|
<form:option value="" label="请选择"/>
|
|
|
<form:options items="${countryList}" itemLabel="name" itemValue="countryId"/>
|
|
|
</form:select>
|
|
@@ -114,10 +114,10 @@
|
|
|
</div>
|
|
|
<div class="control-group iconBox">
|
|
|
<label class="control-label">*品牌logo:</label>
|
|
|
- <div class="controls upload-content" id="brandLogoBox">
|
|
|
+ <div class="controls upload-content" id="authLogoBox">
|
|
|
<div class="conList">
|
|
|
- <form:hidden id="brandLogo" path="brandLogo" htmlEscape="false" maxlength="255" class="input-xlarge"/>
|
|
|
- <sys:ckfinder input="brandLogo" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
|
|
|
+ <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">建议图片分辨率252px*252px</label>
|
|
|
</div>
|
|
@@ -126,14 +126,14 @@
|
|
|
<div class="control-group">
|
|
|
<label class="control-label">防伪链接:</label>
|
|
|
<div class="controls">
|
|
|
- <form:input path="securityLink" htmlEscape="false" maxlength="255" class="input-xlarge "/>
|
|
|
+ <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">
|
|
|
- <form:radiobutton path="agentFlag" value="0" label="无" onclick="changeAgentFlag()"/>
|
|
|
- <form:radiobutton path="agentFlag" value="1" label="有" checked="true" onclick="changeAgentFlag()"/>
|
|
|
+ <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>
|
|
|
|
|
@@ -141,26 +141,26 @@
|
|
|
<div class="control-group">
|
|
|
<label class="control-label">*代理商名称:</label>
|
|
|
<div class="controls">
|
|
|
- <form:input path="agentName" htmlEscape="false" maxlength="50" class="input-xlarge "/>
|
|
|
+ <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">
|
|
|
- <form:radiobutton path="statementType" value="1" label="弹窗" checked="true" onclick="changeStatementType()"/>
|
|
|
- <form:radiobutton path="statementType" value="2" label="链接" onclick="changeStatementType()"/>
|
|
|
+ <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">*内容:</label>
|
|
|
<div class="controls">
|
|
|
- <form:textarea path="statementContent" htmlEscape="false" rows="4" class="input-xxlarge "/>
|
|
|
+ <form:textarea path="statementContent" htmlEscape="false" rows="4" class="input-xxlarge required"/>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="control-group" id="statementLinkDiv">
|
|
|
<label class="control-label">*链接:</label>
|
|
|
<div class="controls">
|
|
|
- <form:input path="statementLink" htmlEscape="false" maxlength="255" class="input-xlarge "/>
|
|
|
+ <form:input path="statementLink" htmlEscape="false" maxlength="255" class="input-xlarge required"/>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -168,7 +168,7 @@
|
|
|
<div class="control-group">
|
|
|
<label class="control-label">*被授权方:</label>
|
|
|
<div class="controls">
|
|
|
- <form:input path="authorizedParty" htmlEscape="false" maxlength="50" class="input-xlarge "/>
|
|
|
+ <form:input path="authParty" htmlEscape="false" maxlength="50" class="input-xlarge required" placeholder="输入被授权方名称"/>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="form-actions">
|
|
@@ -205,32 +205,34 @@
|
|
|
});
|
|
|
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 () {
|
|
|
- $("#brandLogo").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);
|
|
|
- });
|
|
|
- });
|
|
|
+ $('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 () {
|
|
@@ -248,6 +250,8 @@
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
//修改声明类型
|
|
|
function changeStatementType() {
|
|
|
var statementType = $('input[name="statementType"]:checked').val();
|
|
@@ -259,6 +263,63 @@
|
|
|
$("#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);
|
|
|
+ }
|
|
|
+ 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>
|