Merge branch 'dev_店铺装修优化_15353' into grey
# Conflicts: # dist/yohobuy-portal-fe/5.0.2/index.min.css # dist/yohobuy-portal-fe/5.0.2/jquery/SNS.ShareOrderAudit.js # dist/yohobuy-portal-fe/5.0.2/jquery/activity.yohocoin.Index.js # dist/yohobuy-portal-fe/5.0.2/jquery/baserule.CateSize.js # dist/yohobuy-portal-fe/5.0.2/jquery/baserule.CateSizeAttr.js # dist/yohobuy-portal-fe/5.0.2/jquery/baserule.Porattr.js # dist/yohobuy-portal-fe/5.0.2/jquery/brand.Edit.js # dist/yohobuy-portal-fe/5.0.2/jquery/goods.basegoods.Index.js # dist/yohobuy-portal-fe/5.0.2/jquery/goods.netsale.Edit.js # dist/yohobuy-portal-fe/5.0.2/jquery/goods.netsale.Index.js # dist/yohobuy-portal-fe/5.0.2/jquery/goods.productdesc.Index.js # dist/yohobuy-portal-fe/5.0.2/jquery/goods.yohoCoin.Audit.js # dist/yohobuy-portal-fe/5.0.2/jquery/goods.yohoCoin.Index.js # dist/yohobuy-portal-fe/5.0.2/jquery/guang.articleCategory.Index.js # dist/yohobuy-portal-fe/5.0.2/jquery/guang.author.Index.js # dist/yohobuy-portal-fe/5.0.2/jquery/guang.brandConcern.Index.js # dist/yohobuy-portal-fe/5.0.2/jquery/guang.comment.Index.js # dist/yohobuy-portal-fe/5.0.2/jquery/guang.info.Edit.js # dist/yohobuy-portal-fe/5.0.2/jquery/guang.info.Index.js # dist/yohobuy-portal-fe/5.0.2/jquery/guang.plusStar.Index.js # dist/yohobuy-portal-fe/5.0.2/jquery/guang.plusStarCategory.Index.js # dist/yohobuy-portal-fe/5.0.2/jquery/guang.tag.Index.js # dist/yohobuy-portal-fe/5.0.2/jquery/guang.tagCategory.Index.js # dist/yohobuy-portal-fe/5.0.2/jquery/help.Category.js # dist/yohobuy-portal-fe/5.0.2/jquery/help.Content.js # dist/yohobuy-portal-fe/5.0.2/jquery/index.js # dist/yohobuy-portal-fe/5.0.2/jquery/libs.js # dist/yohobuy-portal-fe/5.0.2/jquery/marketing.BrandCoupon.Index.js # dist/yohobuy-portal-fe/5.0.2/jquery/marketing.CouponList.AddOrUpdate.js # dist/yohobuy-portal-fe/5.0.2/jquery/marketing.CouponList.Index.js # dist/yohobuy-portal-fe/5.0.2/jquery/marketing.CouponSend.Index.js # dist/yohobuy-portal-fe/5.0.2/jquery/marketing.CouponSend.PublicCoupon.js # dist/yohobuy-portal-fe/5.0.2/jquery/marketing.CouponSend.Send.js # dist/yohobuy-portal-fe/5.0.2/jquery/marketing.CouponSend.SendHistory.js # dist/yohobuy-portal-fe/5.0.2/jquery/marketing.CouponSend.UseHistory.js # dist/yohobuy-portal-fe/5.0.2/jquery/marketing.LimitCode.Edit.js # dist/yohobuy-portal-fe/5.0.2/jquery/marketing.LimitCode.Index.js # dist/yohobuy-portal-fe/5.0.2/jquery/marketing.LimitCode.Info.js # dist/yohobuy-portal-fe/5.0.2/jquery/marketing.ProductPool.Index.js # dist/yohobuy-portal-fe/5.0.2/jquery/marketing.PromotionCode.Edit.js # dist/yohobuy-portal-fe/5.0.2/jquery/marketing.PromotionCode.Index.js # dist/yohobuy-portal-fe/5.0.2/jquery/marketing.QueryCoupon.Index.js # dist/yohobuy-portal-fe/5.0.2/jquery/marketing.Vip.Add.js # dist/yohobuy-portal-fe/5.0.2/jquery/marketing.Vip.Index.js # dist/yohobuy-portal-fe/5.0.2/jquery/operations.activitytemplate.Edit.js # dist/yohobuy-portal-fe/5.0.2/jquery/operations.activitytemplate.Index.js # dist/yohobuy-portal-fe/5.0.2/jquery/operations.activitytemplate.Product.js # dist/yohobuy-portal-fe/5.0.2/jquery/operations.category.Edit.js # dist/yohobuy-portal-fe/5.0.2/jquery/operations.category.Index.js # dist/yohobuy-portal-fe/5.0.2/jquery/operations.couponActivity.Add.js # dist/yohobuy-portal-fe/5.0.2/jquery/operations.couponActivity.Edit.js # dist/yohobuy-portal-fe/5.0.2/jquery/operations.couponActivity.Index.js # dist/yohobuy-portal-fe/5.0.2/jquery/operations.couponSend.Index.js # dist/yohobuy-portal-fe/5.0.2/jquery/operations.entrance.Index.js # dist/yohobuy-portal-fe/5.0.2/jquery/operations.generateLinks.Batch.js # dist/yohobuy-portal-fe/5.0.2/jquery/operations.generateLinks.Index.js # dist/yohobuy-portal-fe/5.0.2/jquery/operations.hotRankTag.Index.js # dist/yohobuy-portal-fe/5.0.2/jquery/operations.hotsuggest.Index.js # dist/yohobuy-portal-fe/5.0.2/jquery/operations.icon.Index.js # dist/yohobuy-portal-fe/5.0.2/jquery/operations.limit.Edit.js # dist/yohobuy-portal-fe/5.0.2/jquery/operations.limit.Index.js # dist/yohobuy-portal-fe/5.0.2/jquery/operations.notice.Index.js # dist/yohobuy-portal-fe/5.0.2/jquery/operations.officialAccounts.Edit.js # dist/yohobuy-portal-fe/5.0.2/jquery/operations.officialAccounts.Index.js # dist/yohobuy-portal-fe/5.0.2/jquery/operations.payment.Index.js # dist/yohobuy-portal-fe/5.0.2/jquery/operations.productSingleDay.Index.js # dist/yohobuy-portal-fe/5.0.2/jquery/operations.salecategory.Edit.js # dist/yohobuy-portal-fe/5.0.2/jquery/operations.salecategory.Index.js # dist/yohobuy-portal-fe/5.0.2/jquery/operations.salecategory.TagMgmt.js # dist/yohobuy-portal-fe/5.0.2/jquery/operations.shopsVersionUpdate.Index.js # dist/yohobuy-portal-fe/5.0.2/jquery/operations.staticFile.Index.js # dist/yohobuy-portal-fe/5.0.2/jquery/operations.subject.Index.js # dist/yohobuy-portal-fe/5.0.2/jquery/operations.suggest.Index.js # dist/yohobuy-portal-fe/5.0.2/jquery/operations.version.Index.js # dist/yohobuy-portal-fe/5.0.2/jquery/operations.webshare.Edit.js # dist/yohobuy-portal-fe/5.0.2/jquery/operations.webshare.Index.js # dist/yohobuy-portal-fe/5.0.2/jquery/operations.ziplist.Index.js # dist/yohobuy-portal-fe/5.0.2/jquery/resource.platformManage.Index.js # dist/yohobuy-portal-fe/5.0.2/jquery/resource.resourceManage.ContentManage.js # dist/yohobuy-portal-fe/5.0.2/jquery/resource.resourceManage.Index.js # dist/yohobuy-portal-fe/5.0.2/jquery/resource.resourceSortManage.Index.js # dist/yohobuy-portal-fe/5.0.2/jquery/searchWords.HotBrand.Index.js # dist/yohobuy-portal-fe/5.0.2/jquery/searchWords.SearchWords.Index.js # dist/yohobuy-portal-fe/5.0.2/jquery/shootMeter.MeterSize.Add.js # dist/yohobuy-portal-fe/5.0.2/jquery/shootMeter.MeterSize.Index.js # dist/yohobuy-portal-fe/5.0.2/jquery/shootMeter.Model.Index.js # dist/yohobuy-portal-fe/5.0.2/jquery/shootMeter.ProPhoto.Index.js # dist/yohobuy-portal-fe/5.0.2/jquery/shootMeter.ShootRequire.Index.js # dist/yohobuy-portal-fe/5.0.2/jquery/shootMeter.TryInfo.Batch.js # dist/yohobuy-portal-fe/5.0.2/jquery/shootMeter.TryInfo.Index.js # dist/yohobuy-portal-fe/5.0.2/jquery/shootMeter.TryModel.Index.js # dist/yohobuy-portal-fe/5.0.2/jquery/shop.Administrator.js # dist/yohobuy-portal-fe/5.0.2/jquery/shop.Decoration.js # dist/yohobuy-portal-fe/5.0.2/jquery/shop.DecorationBLK.js # dist/yohobuy-portal-fe/5.0.2/jquery/shop.DecorationList.js # dist/yohobuy-portal-fe/5.0.2/jquery/shop.Edit.js # dist/yohobuy-portal-fe/5.0.2/jquery/shop.Index.js # dist/yohobuy-portal-fe/5.0.2/jquery/shop.Info.js # dist/yohobuy-portal-fe/5.0.2/jquery/shop.ShopCategory.Batch.js # dist/yohobuy-portal-fe/5.0.2/jquery/shop.ShopCategory.Edit.js # dist/yohobuy-portal-fe/5.0.2/jquery/shop.ShopCategory.Index.js # dist/yohobuy-portal-fe/5.0.2/jquery/shop.ShopCategory.Info.js # dist/yohobuy-portal-fe/5.0.2/jquery/shop.batch.importShopsPromote.js # dist/yohobuy-portal-fe/5.0.2/jquery/supplier.Edit.js # dist/yohobuy-portal-fe/5.0.2/jquery/supplier.Index.js # dist/yohobuy-portal-fe/5.0.2/jquery/supplier.Info.js # server/controllers/goods.basegoods.js # server/controllers/goods.netsale.js # server/controllers/goods.priceManage.js # server/controllers/resource.resource.js # server/controllers/searchWords.index.js # server/controllers/shop.shopCategory.js # server/index.js # server/interfaces/common.upload.js # server/interfaces/goods.netsale.js # server/interfaces/goods.price.js # server/interfaces/resource.resource.js # server/interfaces/searchWords.index.js # server/interfaces/shop.shopCategory.js # server/views/operations/notice/Index.html # server/views/resource/__partail/jiangming.html # server/views/resource/__partail/taoyu.html # server/views/resource/__partail/taoyu2.html # server/views/resource/__partail/weiqingting.html # server/views/resource/resourceManage/Index.html # server/views/searchWords/SearchWords/Index.html
Showing
8 changed files
with
115 additions
and
18 deletions
@@ -24,4 +24,7 @@ module.exports = function (app){ | @@ -24,4 +24,7 @@ module.exports = function (app){ | ||
24 | 24 | ||
25 | //根据品牌选择供应商 | 25 | //根据品牌选择供应商 |
26 | app.post("/supplier/storeadmin/supplierlist","shopAdministrator_selectSupplierByBrandId"); | 26 | app.post("/supplier/storeadmin/supplierlist","shopAdministrator_selectSupplierByBrandId"); |
27 | + | ||
28 | + // 查询店铺管理员列表,筛选框 | ||
29 | + app.post("/supplier/storeadmin/adminList", "shopAdministrator_getAllShopAdminProfile"); | ||
27 | } | 30 | } |
@@ -6,7 +6,9 @@ module.exports={ | @@ -6,7 +6,9 @@ module.exports={ | ||
6 | url:"/ShopsAdminRest/getShopsAdminList", | 6 | url:"/ShopsAdminRest/getShopsAdminList", |
7 | params:[ | 7 | params:[ |
8 | {name: 'page', type: 'Number'}, | 8 | {name: 'page', type: 'Number'}, |
9 | - {name: 'size', type: 'Number'} | 9 | + {name: 'size', type: 'Number'}, |
10 | + {name: 'shopsId', type: 'Number'}, | ||
11 | + {name: 'adminPid', type: 'Number'} | ||
10 | ] | 12 | ] |
11 | }, | 13 | }, |
12 | 14 | ||
@@ -46,6 +48,11 @@ module.exports={ | @@ -46,6 +48,11 @@ module.exports={ | ||
46 | {name:"brandId",type:"Number"} | 48 | {name:"brandId",type:"Number"} |
47 | ] | 49 | ] |
48 | }, | 50 | }, |
51 | + | ||
52 | + getAllShopAdminProfile:{ | ||
53 | + title: "获取所有的店铺管理员信息", | ||
54 | + url: "/ShopsAdminRest/getAllShopAdminProfile" | ||
55 | + } | ||
49 | } | 56 | } |
50 | } | 57 | } |
51 | 58 |
@@ -6,6 +6,24 @@ | @@ -6,6 +6,24 @@ | ||
6 | <a class="add btn btn-success"><i class="fa fa-plus"></i> 创建店铺管理员关系</a> | 6 | <a class="add btn btn-success"><i class="fa fa-plus"></i> 创建店铺管理员关系</a> |
7 | </div> | 7 | </div> |
8 | <input type="hidden" id="url" value="/supplier/storeadmin/indexPage"> | 8 | <input type="hidden" id="url" value="/supplier/storeadmin/indexPage"> |
9 | + <div class="panel-body"> | ||
10 | + <div class="row"> | ||
11 | + <div class="panel-col2"> | ||
12 | + <select name="shop-name" id="shop-name" style="width: 280px;" tabindex="-1" title="" class="form-control"> | ||
13 | + <option value="-1">请选择店铺</option> | ||
14 | + </select> | ||
15 | + </div> | ||
16 | + <div class="panel-col2"> | ||
17 | + <select name="admin-name" id="admin-name" style="width: 280px;" tabindex="-1" title="" class="form-control"> | ||
18 | + <option value="-1">请选择管理员</option> | ||
19 | + </select> | ||
20 | + </div> | ||
21 | + <div class="panel-col2"> | ||
22 | + <a id="filter-btn" href="javascript:;" class="btn btn-info">筛选</a> | ||
23 | + <a id="all-btn" href="" class="btn btn-info">全部</a> | ||
24 | + </div> | ||
25 | + </div> | ||
26 | + </div> | ||
9 | <div class="panel panel-primary-head"> | 27 | <div class="panel panel-primary-head"> |
10 | <div id="basicTable_wrapper" class="dataTables_wrapper no-footer"> | 28 | <div id="basicTable_wrapper" class="dataTables_wrapper no-footer"> |
11 | <div class="dataTables_length" id="basicTable"></div> | 29 | <div class="dataTables_length" id="basicTable"></div> |
@@ -43,7 +43,7 @@ | @@ -43,7 +43,7 @@ | ||
43 | aria-describedby="basic-addon2" required> | 43 | aria-describedby="basic-addon2" required> |
44 | <span class="input-group-addon" id="basic-addon2">.yohobuy.com</span> | 44 | <span class="input-group-addon" id="basic-addon2">.yohobuy.com</span> |
45 | </div> | 45 | </div> |
46 | - <p style="margin-top: 10px"><span class="red">注:1. 4-32个字符;2. 只能填英文、数字和破折号-,不区分大小写,不能以破折号开头或者结尾</span></p> | 46 | + <p style="margin-top: 10px"><span class="red">注:1. 1-32个字符;2. 只能填英文、数字和破折号-,不区分大小写,不能以破折号开头或者结尾</span></p> |
47 | </div> | 47 | </div> |
48 | </div> | 48 | </div> |
49 | <div class="form-group"> | 49 | <div class="form-group"> |
@@ -3,12 +3,23 @@ | @@ -3,12 +3,23 @@ | ||
3 | var $ = require('jquery'), | 3 | var $ = require('jquery'), |
4 | common=require('../../common/common'); | 4 | common=require('../../common/common'); |
5 | 5 | ||
6 | + // 筛选项 | ||
7 | + new common.dropDown({el:"#shop-name",ajax:"shopsRest"}); | ||
8 | + selectAllManagerInfo(); | ||
9 | + | ||
6 | var g=new common.grid({ | 10 | var g=new common.grid({ |
7 | el:'#basicTable', | 11 | el:'#basicTable', |
12 | + parms: function() { | ||
13 | + return { | ||
14 | + 'shopsId': common.util.__input('shop-name'), | ||
15 | + 'adminPid': common.util.__input('admin-name') | ||
16 | + } | ||
17 | + }, | ||
8 | columns:[ | 18 | columns:[ |
9 | {display:"ID",name:"id"}, | 19 | {display:"ID",name:"id"}, |
10 | {display:"店铺名称",name:"shopName"}, | 20 | {display:"店铺名称",name:"shopName"}, |
11 | {display:"店铺管理员",name:"adminName"}, | 21 | {display:"店铺管理员",name:"adminName"}, |
22 | + {display:"部门",name:"deptName"}, | ||
12 | {display:"创建时间",name:"createTime"}, | 23 | {display:"创建时间",name:"createTime"}, |
13 | {display:"更新时间",name:"updateTime"}, | 24 | {display:"更新时间",name:"updateTime"}, |
14 | {display:"操作",name:"",render:function(item){ | 25 | {display:"操作",name:"",render:function(item){ |
@@ -51,7 +62,11 @@ var $ = require('jquery'), | @@ -51,7 +62,11 @@ var $ = require('jquery'), | ||
51 | if(+item.pid==eqid){ | 62 | if(+item.pid==eqid){ |
52 | $option.attr("selected","selected"); | 63 | $option.attr("selected","selected"); |
53 | } | 64 | } |
54 | - $option.html(item.truename); | 65 | + var content = item.truename; |
66 | + if(item.deptName) { | ||
67 | + content += '(' + item.deptName +')'; | ||
68 | + } | ||
69 | + $option.html(content); | ||
55 | $("#manager-name").append($option); | 70 | $("#manager-name").append($option); |
56 | }) | 71 | }) |
57 | }; | 72 | }; |
@@ -91,7 +106,7 @@ var $ = require('jquery'), | @@ -91,7 +106,7 @@ var $ = require('jquery'), | ||
91 | $('#identity-type').on('change',function(){ | 106 | $('#identity-type').on('change',function(){ |
92 | Bll.selectManagerName($(this).val()); | 107 | Bll.selectManagerName($(this).val()); |
93 | }); | 108 | }); |
94 | - } | 109 | + } |
95 | } | 110 | } |
96 | $('#basicTable').on('click', '.delete', function() { | 111 | $('#basicTable').on('click', '.delete', function() { |
97 | var item=g.rows[$(this).data("index")]; | 112 | var item=g.rows[$(this).data("index")]; |
@@ -114,3 +129,34 @@ var $ = require('jquery'), | @@ -114,3 +129,34 @@ var $ = require('jquery'), | ||
114 | }); | 129 | }); |
115 | 130 | ||
116 | 131 | ||
132 | +function selectAllManagerInfo() { | ||
133 | + common.util.__ajax({ | ||
134 | + url: '/supplier/storeadmin/adminList' | ||
135 | + }, function(res) { | ||
136 | + $('#admin-name').html('<option value="">请选择管理员</option>'); | ||
137 | + if(res.data&&res.data.length>0){ | ||
138 | + $.each(res.data,function(index,item){ | ||
139 | + var $option=$("<option></option>"); | ||
140 | + $option.attr("value",item.pid); | ||
141 | + var content = item.truename; | ||
142 | + // 将"真实姓名"为空的数据排除 | ||
143 | + if(content === undefined || content.length === 0) { | ||
144 | + return; | ||
145 | + } | ||
146 | + | ||
147 | + if(item.deptName) { | ||
148 | + content += '(' + item.deptName +')'; | ||
149 | + } | ||
150 | + $option.html(content); | ||
151 | + $("#admin-name").append($option); | ||
152 | + }) | ||
153 | + }; | ||
154 | + new common.dropDown({el:"#admin-name"}); | ||
155 | + }, true); | ||
156 | +} | ||
157 | + | ||
158 | +$(document).on('click', '#filter-btn', function() { | ||
159 | + g.reload(1); | ||
160 | +}); | ||
161 | + | ||
162 | + |
@@ -49,11 +49,13 @@ var g = new common.grid({ | @@ -49,11 +49,13 @@ var g = new common.grid({ | ||
49 | render: function(item) { | 49 | render: function(item) { |
50 | console.log(item); | 50 | console.log(item); |
51 | if (item.brands instanceof Array && item.brands.length > 0) { | 51 | if (item.brands instanceof Array && item.brands.length > 0) { |
52 | - var html = ''; | 52 | + var brandArr = []; |
53 | $.each(item.brands, function(i, value) { | 53 | $.each(item.brands, function(i, value) { |
54 | - html += value.brandName + '<br>'; | 54 | + if($.inArray(value.brandName, brandArr) === -1) { |
55 | + brandArr.push(value.brandName); | ||
56 | + } | ||
55 | }); | 57 | }); |
56 | - return html; | 58 | + return '<p>' + brandArr.join('</p><p>') + '</p>'; |
57 | } else { | 59 | } else { |
58 | return ''; | 60 | return ''; |
59 | } | 61 | } |
@@ -276,7 +276,7 @@ e.on("validate", function() { | @@ -276,7 +276,7 @@ e.on("validate", function() { | ||
276 | if(shopDomainVal) { | 276 | if(shopDomainVal) { |
277 | var shopDomainPattern = new RegExp("^[a-zA-Z0-9]([a-zA-Z0-9-])*[a-zA-Z0-9]$"); | 277 | var shopDomainPattern = new RegExp("^[a-zA-Z0-9]([a-zA-Z0-9-])*[a-zA-Z0-9]$"); |
278 | 278 | ||
279 | - if(shopDomainVal.length < 4 || shopDomainVal.length > 32) { | 279 | + if(shopDomainVal.length < 1 || shopDomainVal.length > 32) { |
280 | return "店铺域名输入有误!"; | 280 | return "店铺域名输入有误!"; |
281 | } | 281 | } |
282 | 282 | ||
@@ -289,7 +289,7 @@ e.on("validate", function() { | @@ -289,7 +289,7 @@ e.on("validate", function() { | ||
289 | e.init(); | 289 | e.init(); |
290 | 290 | ||
291 | var submit=function(callback){ | 291 | var submit=function(callback){ |
292 | - e.submit($("#storeForm").attr("action"),function(option){ | 292 | + var result = e.submit($("#storeForm").attr("action"),function(option){ |
293 | option.data=$.extend({},option.data,_arr); | 293 | option.data=$.extend({},option.data,_arr); |
294 | option.data.shopIntro = UMshopintro.getContent(); | 294 | option.data.shopIntro = UMshopintro.getContent(); |
295 | console.log(option.data); | 295 | console.log(option.data); |
@@ -301,24 +301,38 @@ var submit=function(callback){ | @@ -301,24 +301,38 @@ var submit=function(callback){ | ||
301 | },'growl-success'); | 301 | },'growl-success'); |
302 | }else{ | 302 | }else{ |
303 | e.$tip(res.message); | 303 | e.$tip(res.message); |
304 | + $(".btn-cun").removeAttr("disabled"); | ||
305 | + $(".btn-success").removeAttr("disabled"); | ||
304 | } | 306 | } |
305 | return false; | 307 | return false; |
306 | }, | 308 | }, |
307 | option.error=function(res){ | 309 | option.error=function(res){ |
308 | e.$tip("提交失败"); | 310 | e.$tip("提交失败"); |
311 | + $(".btn-cun").removeAttr("disabled"); | ||
312 | + $(".btn-success").removeAttr("disabled"); | ||
309 | } | 313 | } |
310 | callback&&callback(option.data); | 314 | callback&&callback(option.data); |
311 | }); | 315 | }); |
316 | + | ||
317 | + // 发生校验错误 | ||
318 | + if(result === false) { | ||
319 | + $(".btn-cun").removeAttr("disabled"); | ||
320 | + $(".btn-success").removeAttr("disabled"); | ||
321 | + } | ||
312 | }; | 322 | }; |
313 | 323 | ||
314 | //提交 | 324 | //提交 |
315 | $(".btn-success").click(function(){ | 325 | $(".btn-success").click(function(){ |
326 | + // 为防止同时触发 "提交审核" 和 "暂存",对按钮做灰化处理 | ||
327 | + $(".btn-cun").attr("disabled", true); | ||
316 | submit(function(item){ | 328 | submit(function(item){ |
317 | item.onCheck=1; | 329 | item.onCheck=1; |
318 | }); | 330 | }); |
319 | }); | 331 | }); |
320 | //暂存 | 332 | //暂存 |
321 | $(".btn-cun").click(function(){ | 333 | $(".btn-cun").click(function(){ |
334 | + // 为防止同时触发 "提交审核" 和 "暂存",对按钮做灰化处理 | ||
335 | + $(".btn-success").attr("disabled", true); | ||
322 | submit(function(item){ | 336 | submit(function(item){ |
323 | item.onCheck=0; | 337 | item.onCheck=0; |
324 | }); | 338 | }); |
@@ -16,26 +16,30 @@ var t = new common.tab({ | @@ -16,26 +16,30 @@ var t = new common.tab({ | ||
16 | g.options.columns[1].name = "shopsName"; | 16 | g.options.columns[1].name = "shopsName"; |
17 | g.options.columns[2] = { | 17 | g.options.columns[2] = { |
18 | display: "包含品牌", name: "brands", render: function (item) { | 18 | display: "包含品牌", name: "brands", render: function (item) { |
19 | - var str = ''; | 19 | + var brandArr = []; |
20 | if (item.brands) { | 20 | if (item.brands) { |
21 | $.each(item.brands, function (index, a) { | 21 | $.each(item.brands, function (index, a) { |
22 | - str += '<p>' + a.brandName + '</p>'; | 22 | + if($.inArray(a.brandName, brandArr) === -1) { |
23 | + brandArr.push(a.brandName); | ||
24 | + } | ||
23 | }); | 25 | }); |
24 | } | 26 | } |
25 | - return str; | 27 | + return '<p>' + brandArr.join('</p><p>') + '</p>'; |
26 | } | 28 | } |
27 | }; | 29 | }; |
28 | } else { | 30 | } else { |
29 | g.options.columns[1].name = "shopName"; | 31 | g.options.columns[1].name = "shopName"; |
30 | g.options.columns[2] = { | 32 | g.options.columns[2] = { |
31 | display: "包含品牌", name: "shopRelationList", render: function (item) { | 33 | display: "包含品牌", name: "shopRelationList", render: function (item) { |
32 | - var str = ''; | 34 | + var brandArr = []; |
33 | if (item.shopRelationList) { | 35 | if (item.shopRelationList) { |
34 | $.each(item.shopRelationList, function (index, a) { | 36 | $.each(item.shopRelationList, function (index, a) { |
35 | - str += '<p>' + a.brandName + '</p>'; | 37 | + if($.inArray(a.brandName, brandArr) === -1) { |
38 | + brandArr.push(a.brandName); | ||
39 | + } | ||
36 | }); | 40 | }); |
37 | } | 41 | } |
38 | - return str; | 42 | + return '<p>' + brandArr.join('</p><p>') + '</p>'; |
39 | } | 43 | } |
40 | }; | 44 | }; |
41 | 45 | ||
@@ -78,13 +82,16 @@ var g = new common.grid({ | @@ -78,13 +82,16 @@ var g = new common.grid({ | ||
78 | {display: "店铺名称", name: "shopName"}, | 82 | {display: "店铺名称", name: "shopName"}, |
79 | { | 83 | { |
80 | display: "包含品牌", name: "shopRelationList", render: function (item) { | 84 | display: "包含品牌", name: "shopRelationList", render: function (item) { |
81 | - var str = ''; | 85 | + var brandArr = []; |
82 | if (item.shopRelationList) { | 86 | if (item.shopRelationList) { |
83 | $.each(item.shopRelationList, function (index, a) { | 87 | $.each(item.shopRelationList, function (index, a) { |
84 | - str += '<p>' + a.brandName + '</p>'; | 88 | + if($.inArray(a.brandName, brandArr) === -1) { |
89 | + brandArr.push(a.brandName); | ||
90 | + } | ||
85 | }); | 91 | }); |
86 | } | 92 | } |
87 | - return str; | 93 | + |
94 | + return '<p>' + brandArr.join('</p><p>') + '</p>'; | ||
88 | } | 95 | } |
89 | }, | 96 | }, |
90 | {display: "创建时间", name: "createTime"}, | 97 | {display: "创建时间", name: "createTime"}, |
-
Please register or login to post a comment