Authored by wangwei

Merge branch 'dev5.3' of http://git.yoho.cn/fe/yohobuy-portal-fe2 into dev5.3

@@ -14,8 +14,9 @@ @@ -14,8 +14,9 @@
14 <td>说明:</td> 14 <td>说明:</td>
15 <td colspan="2"> 15 <td colspan="2">
16 1、上传文件必须是<span style="color:red;">.xlsx</span>文件<br> 16 1、上传文件必须是<span style="color:red;">.xlsx</span>文件<br>
17 - 2、第一行标题栏:<span style="color: #67D267;">SKU|补货</span><br>  
18 - 3、<a href="/ajax/link/batchModifySupply">下载样例</a> 17 + 2、<span style="color:red;">可补货将开启到货通知,不可补货将关闭到货通知</span><br>
  18 + 3、第一行标题栏:<span style="color: #67D267;">SKU|补货</span><br>
  19 + 4、<a href="/ajax/link/batchModifySupply">下载样例</a>
19 </td> 20 </td>
20 </tr> 21 </tr>
21 <tr> 22 <tr>
@@ -40,9 +40,14 @@ module.exports=function(app) { @@ -40,9 +40,14 @@ module.exports=function(app) {
40 /*删除资源位下所有tab*/ 40 /*删除资源位下所有tab*/
41 app.post("/resources/deleteAllResourceByCode","resourceManage_deleteAllResourceByCode"); 41 app.post("/resources/deleteAllResourceByCode","resourceManage_deleteAllResourceByCode");
42 42
  43 + app.post("/resources/updateLock","resourceManage_updateLock");
  44 +
43 /*根据id获取资源内容*/ 45 /*根据id获取资源内容*/
44 app.post("/resources/resContentIndex","resourceManage_resContentIndex"); 46 app.post("/resources/resContentIndex","resourceManage_resContentIndex");
45 47
  48 + /*根据是否可编辑*/
  49 + app.post("/resources/checkLock","resourceManage_checkLock");
  50 +
46 /*添加资源内容*/ 51 /*添加资源内容*/
47 app.post("/resources/addResContent","resourceManage_addResContent"); 52 app.post("/resources/addResContent","resourceManage_addResContent");
48 53
@@ -51,6 +51,14 @@ module.exports={ @@ -51,6 +51,14 @@ module.exports={
51 {name: "code", type: "string"} 51 {name: "code", type: "string"}
52 ] 52 ]
53 }, 53 },
  54 + updateLock:{
  55 + title: "解除锁定",
  56 + url: "/resources/updateLock",
  57 + params: [
  58 + {name: "id", type: "number"},
  59 + {name: "status", type: "number"}
  60 + ]
  61 + },
54 getUrlAction:{ 62 getUrlAction:{
55 title: "获取跳转链接", 63 title: "获取跳转链接",
56 url: "/resources/getUrlAction" 64 url: "/resources/getUrlAction"
@@ -62,6 +70,13 @@ module.exports={ @@ -62,6 +70,13 @@ module.exports={
62 {name: "id", type: "number"} 70 {name: "id", type: "number"}
63 ] 71 ]
64 }, 72 },
  73 + checkLock:{
  74 + title: "查询是否可编辑",
  75 + url: "/resources/checkLock",
  76 + params: [
  77 + {name: "id", type: "number"}
  78 + ]
  79 + },
65 addResContent:{ 80 addResContent:{
66 title: "添加资源内容", 81 title: "添加资源内容",
67 url: "/resources/addResContent", 82 url: "/resources/addResContent",
@@ -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">
@@ -198,7 +198,7 @@ var g=new common.grid({ @@ -198,7 +198,7 @@ var g=new common.grid({
198 } 198 }
199 }, 199 },
200 { 200 {
201 - display:"<label class='red'>厂家颜色、尺码、条码、销售价 必填</label>",render:function(item){ 201 + display:"<label class='red'>厂家颜色、尺码、条码、销售价 必填,可补货将开启到货通知,不可补货将关闭到货通知</label>",render:function(item){
202 if(!item.isAdd&&!g.__gsm.hasOwnProperty(item.__index)){ 202 if(!item.isAdd&&!g.__gsm.hasOwnProperty(item.__index)){
203 g.__gsm[item.__index]=item.goodsSizeList.length; 203 g.__gsm[item.__index]=item.goodsSizeList.length;
204 } 204 }
@@ -10,6 +10,7 @@ require('../../../common/util/datepicker'); @@ -10,6 +10,7 @@ require('../../../common/util/datepicker');
10 var resources = []; 10 var resources = [];
11 var times = []; 11 var times = [];
12 var currIndex = 0; 12 var currIndex = 0;
  13 +var lockStatus = 0;
13 //资源id 14 //资源id
14 var param = location.href.substring(location.href.lastIndexOf("/") + 1); 15 var param = location.href.substring(location.href.lastIndexOf("/") + 1);
15 common.util.__ajax({ 16 common.util.__ajax({
@@ -20,6 +21,13 @@ common.util.__ajax({ @@ -20,6 +21,13 @@ common.util.__ajax({
20 resources = res.data; 21 resources = res.data;
21 console.log(resources); 22 console.log(resources);
22 }, true); 23 }, true);
  24 +common.util.__ajax({
  25 + url: "/resources/updateLock",
  26 + data: {id: param,
  27 + status:1},
  28 + async: false
  29 +}, function (res) {
  30 +}, true);
23 31
24 /*配置模块*/ 32 /*配置模块*/
25 var edit = new common.edit2(".modal-body", { 33 var edit = new common.edit2(".modal-body", {
@@ -68,6 +76,9 @@ var Bll = { @@ -68,6 +76,9 @@ var Bll = {
68 value: "保存", 76 value: "保存",
69 callback: function () { 77 callback: function () {
70 console.log(module.contentData); 78 console.log(module.contentData);
  79 + if(!checkLockStatus()){
  80 + return false;
  81 + }
71 var couponFlag = true; 82 var couponFlag = true;
72 if (Validate[module.contentData.template_name]) { 83 if (Validate[module.contentData.template_name]) {
73 Validate[module.contentData.template_name].forEach(function (item) { 84 Validate[module.contentData.template_name].forEach(function (item) {
@@ -204,6 +215,7 @@ var Bll = { @@ -204,6 +215,7 @@ var Bll = {
204 } 215 }
205 for(var key2 in res.data.brands[key]){ 216 for(var key2 in res.data.brands[key]){
206 var item=res.data.brands[key][key2]; 217 var item=res.data.brands[key][key2];
  218 + if (!item) { continue; }
207 Brand[name] = Brand[name] || []; 219 Brand[name] = Brand[name] || [];
208 Brand[name].push(item); 220 Brand[name].push(item);
209 Bll.Brands1[item.id] = item; 221 Bll.Brands1[item.id] = item;
@@ -296,7 +308,6 @@ function Unique(Array,key) { @@ -296,7 +308,6 @@ function Unique(Array,key) {
296 Bll.__render("#content-list", "content-template", resources[currIndex]); 308 Bll.__render("#content-list", "content-template", resources[currIndex]);
297 Bll.__render(".contents", "template_content_btns", {btns: Button}); 309 Bll.__render(".contents", "template_content_btns", {btns: Button});
298 Bll.__render("#times-list", "times-template", {times:times, selected:0}); 310 Bll.__render("#times-list", "times-template", {times:times, selected:0});
299 -  
300 /*第二部,把楼层数据转化成数组*/ 311 /*第二部,把楼层数据转化成数组*/
301 for(var i = 0; i < resources.length; i++) { 312 for(var i = 0; i < resources.length; i++) {
302 Bll.contentDatas[i] = []; 313 Bll.contentDatas[i] = [];
@@ -440,6 +451,9 @@ $(document).on("change", ".observe", function () { @@ -440,6 +451,9 @@ $(document).on("change", ".observe", function () {
440 451
441 /*删除*/ 452 /*删除*/
442 $(document).on("click", ".del", function () {//删除 453 $(document).on("click", ".del", function () {//删除
  454 + if(!checkLockStatus()){
  455 + return false;
  456 + }
443 var index = $(this).data("index"); 457 var index = $(this).data("index");
444 common.dialog.confirm("警告", 458 common.dialog.confirm("警告",
445 common.util.__template2("是否确认删除?", {}), 459 common.util.__template2("是否确认删除?", {}),
@@ -555,6 +569,7 @@ function secondsToStrDate(seconds) { @@ -555,6 +569,7 @@ function secondsToStrDate(seconds) {
555 return common.util.__dateFormat(t, "yyyy-MM-dd hh:mm:ss"); 569 return common.util.__dateFormat(t, "yyyy-MM-dd hh:mm:ss");
556 } 570 }
557 571
  572 +
558 function dateStrToSeconds(date) { 573 function dateStrToSeconds(date) {
559 if(date) { 574 if(date) {
560 return new Date(date).getTime() / 1000; 575 return new Date(date).getTime() / 1000;
@@ -563,6 +578,23 @@ function dateStrToSeconds(date) { @@ -563,6 +578,23 @@ function dateStrToSeconds(date) {
563 return 0; 578 return 0;
564 } 579 }
565 580
  581 +
  582 +function checkLockStatus(){
  583 + common.util.__ajax({
  584 + url: "/resources/checkLock",
  585 + data: {id: param},
  586 + async: false
  587 + }, function (res) {
  588 + lockStatus = res.data;
  589 + }, true);
  590 + if(lockStatus == '2') {
  591 + common.util.__tip("该资源位已被锁定,不能操作");
  592 + return false;
  593 + }else{
  594 + return true;
  595 + }
  596 +}
  597 +
566 //获取品牌 598 //获取品牌
567 Bll.getBrands(); 599 Bll.getBrands();
568 //打开品牌选择模态 600 //打开品牌选择模态
@@ -641,6 +673,9 @@ $(document).on("click", '.icon-number', function () { @@ -641,6 +673,9 @@ $(document).on("click", '.icon-number', function () {
641 //**********************************************************************************/ 673 //**********************************************************************************/
642 //复制 674 //复制
643 $(document).on("click", "#copyTab", function() { 675 $(document).on("click", "#copyTab", function() {
  676 + if(!checkLockStatus()){
  677 + return false;
  678 + }
644 common.util.__ajax({ 679 common.util.__ajax({
645 url: "/resources/copyResContent", 680 url: "/resources/copyResContent",
646 data: {rId:resources[currIndex].resource.id} 681 data: {rId:resources[currIndex].resource.id}
@@ -650,6 +685,9 @@ $(document).on("click", "#copyTab", function() { @@ -650,6 +685,9 @@ $(document).on("click", "#copyTab", function() {
650 }); 685 });
651 //保存时间 686 //保存时间
652 $(document).on("click", "#saveTime", function() { 687 $(document).on("click", "#saveTime", function() {
  688 + if(!checkLockStatus()){
  689 + return false;
  690 + }
653 if(times[currIndex].status == "进行中") { 691 if(times[currIndex].status == "进行中") {
654 common.util.__tip("进行中的页面不能更改时间"); 692 common.util.__tip("进行中的页面不能更改时间");
655 return false; 693 return false;
@@ -721,6 +759,9 @@ $(document).on("click", "#delTab", function() { @@ -721,6 +759,9 @@ $(document).on("click", "#delTab", function() {
721 759
722 /*保存事件*/ 760 /*保存事件*/
723 $(document).on("click", "#sub_btn", function () { 761 $(document).on("click", "#sub_btn", function () {
  762 + if(!checkLockStatus()){
  763 + return false;
  764 + }
724 var data = { 765 var data = {
725 "content": {}, 766 "content": {},
726 "data_id": {}, 767 "data_id": {},
@@ -47,15 +47,23 @@ var g = new common.grid({ @@ -47,15 +47,23 @@ var g = new common.grid({
47 {display: "分类", name: "sortName"}, 47 {display: "分类", name: "sortName"},
48 {display: "平台", name: "platformName"}, 48 {display: "平台", name: "platformName"},
49 {display: "位置码", name: "code"}, 49 {display: "位置码", name: "code"},
50 - {display: "匹配码", name: "matchCode"},  
51 {display: "创建时间", name: "", render: function(item) { 50 {display: "创建时间", name: "", render: function(item) {
52 return Bll.getLocalTime(item.createTime); 51 return Bll.getLocalTime(item.createTime);
53 }}, 52 }},
  53 + {display: "锁定人", name: "lockPersonName"},
  54 + {display: "锁定时间", name: "",render:function(item){
  55 + if(item.lockPersonName !=''){
  56 + return Bll.getLocalTime(item.lockTime);
  57 + }
  58 + }},
54 {display: "操作", name: "",render: function(item) { 59 {display: "操作", name: "",render: function(item) {
55 var arr = []; 60 var arr = [];
56 arr.push('<a target="_blank" class="btn btn-xs btn-info contentManage" data-index="' + item.__index + '" href="/resource/content/index/' + item.id + '">内容管理</a>'); 61 arr.push('<a target="_blank" class="btn btn-xs btn-info contentManage" data-index="' + item.__index + '" href="/resource/content/index/' + item.id + '">内容管理</a>');
57 arr.push('<a class="btn btn-xs btn-primary add2" data-index="' + item.__index + '">编辑</a>'); 62 arr.push('<a class="btn btn-xs btn-primary add2" data-index="' + item.__index + '">编辑</a>');
58 arr.push('<a class="btn btn-xs btn-danger delbtn" data-index="' + item.__index + '">删除</a>'); 63 arr.push('<a class="btn btn-xs btn-danger delbtn" data-index="' + item.__index + '">删除</a>');
  64 + if(item.lockPersonName !=''){
  65 + arr.push('<a class="btn btn-xs btn-danger updateLockBtn" data-index="' + item.__index + '">解除锁定</a>');
  66 + }
59 return arr.join(""); 67 return arr.join("");
60 }} 68 }}
61 ] 69 ]
@@ -139,4 +147,20 @@ $(document).on("click", ".delbtn", function() { @@ -139,4 +147,20 @@ $(document).on("click", ".delbtn", function() {
139 g.reload(); 147 g.reload();
140 }); 148 });
141 }); 149 });
142 - });  
  150 + });
  151 +
  152 +/**
  153 + * 解除锁定
  154 + */
  155 +$(document).on("click", ".updateLockBtn", function() {
  156 + var item = g.rows[$(this).data("index")];
  157 + common.dialog.confirm("警告", "是否确认解除锁定?",function() {
  158 + common.util.__ajax({
  159 + url: "/resources/updateLock",
  160 + data: {id: item.id,
  161 + status:0}
  162 + }, function () {
  163 + g.reload();
  164 + });
  165 + });
  166 +});
@@ -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"},