Authored by mali

尺码可修改

@@ -506,10 +506,10 @@ @@ -506,10 +506,10 @@
506 } 506 }
507 }); 507 });
508 508
509 - $(document).on('click', '.group-size input', function() { 509 + $(document).on('click', '.group-size input', function(item) {
510 var colorName = goodsName = ''; 510 var colorName = goodsName = '';
511 511
512 - if (that.productId) { 512 + if (that.productId && $(item).attr('exist') == 'true') {
513 $.messager.alert('操作提示', '尺码不可修改!'); 513 $.messager.alert('操作提示', '尺码不可修改!');
514 return false; 514 return false;
515 } 515 }
@@ -585,6 +585,12 @@ @@ -585,6 +585,12 @@
585 } else { 585 } else {
586 editImage = 1; 586 editImage = 1;
587 } 587 }
  588 +
  589 + $('.group-size input:checked').each(function(index, item) {
  590 + if ($(item).attr('exist') != 'true') {
  591 + sizeIdList.push(+$(item).val());
  592 + }
  593 + });
588 } else { 594 } else {
589 editImage = 1; 595 editImage = 1;
590 $('.group-size input:checked').each(function(index, item) { 596 $('.group-size input:checked').each(function(index, item) {
@@ -661,6 +667,7 @@ @@ -661,6 +667,7 @@
661 return false; 667 return false;
662 } 668 }
663 } else { 669 } else {
  670 + ajaxData.sizeIdList = sizeIdList;
664 ajaxData.id = that.detailData.id; 671 ajaxData.id = that.detailData.id;
665 ajaxData.goodsId = that.detailData.goodsId; 672 ajaxData.goodsId = that.detailData.goodsId;
666 } 673 }
@@ -764,7 +771,7 @@ @@ -764,7 +771,7 @@
764 }); */ 771 }); */
765 for ( var i = 0; i <that.detailData.sizeIdList.length; i++){ 772 for ( var i = 0; i <that.detailData.sizeIdList.length; i++){
766 item = that.detailData.sizeIdList[i]; 773 item = that.detailData.sizeIdList[i];
767 - $('.group-size label[data-id=' + item + '] input').attr('checked','true'); 774 + $('.group-size label[data-id=' + item + '] input').attr('checked','true').attr('exist','true');
768 that.colorSizeTableData.rows.push({ 775 that.colorSizeTableData.rows.push({
769 colorName: $('.group-color li[data-id='+that.detailData.colorId+']').text(), 776 colorName: $('.group-color li[data-id='+that.detailData.colorId+']').text(),
770 goodsName: that.detailData.goodsName, 777 goodsName: that.detailData.goodsName,