...
|
...
|
@@ -10,6 +10,7 @@ let $ = require('yoho-jquery'), |
|
|
tip = require('js/plugin/tip'),
|
|
|
chosePanel = require('js/common/chose-panel-new'),
|
|
|
loading = require('js/plugin/loading'),
|
|
|
isModify = false,
|
|
|
dialog = require('js/plugin/dialog');
|
|
|
|
|
|
let goodObj = {
|
...
|
...
|
@@ -198,6 +199,7 @@ let goodObj = { |
|
|
return;
|
|
|
}
|
|
|
self.handle.posting = true;
|
|
|
let modeType = isModify ? 1 : 0;
|
|
|
let skuData = self.getSelectGoodData(eles, selectAll);
|
|
|
|
|
|
|
...
|
...
|
@@ -206,7 +208,8 @@ let goodObj = { |
|
|
type: 'post',
|
|
|
url: '/cart/index/new/select',
|
|
|
data: {
|
|
|
skuList: JSON.stringify(skuData)
|
|
|
skuList: JSON.stringify(skuData),
|
|
|
modeType: modeType
|
|
|
},
|
|
|
complete: () => {
|
|
|
self.handle.posting = false;
|
...
|
...
|
@@ -334,7 +337,7 @@ let goodObj = { |
|
|
} else {
|
|
|
goodInfo.selected = $this.hasClass('checked') ? 'N' : 'Y';
|
|
|
}
|
|
|
if ($this.hasClass('presale')) {
|
|
|
if ($this.hasClass('presale') && isModify) {
|
|
|
goodInfo.selected = 'N';
|
|
|
}
|
|
|
goodInfo.product_sku = id;
|
...
|
...
|
@@ -350,6 +353,7 @@ let goodObj = { |
|
|
if (batch_no) {
|
|
|
goodInfo.batch_no = batch_no;
|
|
|
}
|
|
|
isModify = false;
|
|
|
return goodInfo;
|
|
|
}));
|
|
|
|
...
|
...
|
@@ -396,6 +400,7 @@ let goodObj = { |
|
|
}).done(function(res) {
|
|
|
if (res && res.code === 200) {
|
|
|
$(e.delegateTarget).data('id', result.sku.skuId);
|
|
|
isModify = true;
|
|
|
if (!$(e.delegateTarget).find('.chk.select').hasClass('checked')) {
|
|
|
self.selectGood($(e.delegateTarget).find('.chk.select'));
|
|
|
} else {
|
...
|
...
|
@@ -475,6 +480,7 @@ let goodObj = { |
|
|
goodNum = parseInt($(e.delegateTarget).find('.good-num').val(), 10);
|
|
|
let max = parseInt($(e.delegateTarget).find('.good-num').data('max'), 10);
|
|
|
|
|
|
isModify = true;
|
|
|
if (!$(e.delegateTarget).find('.chk.select').hasClass('checked') && goodNum <= max) {
|
|
|
self.handle.posting = false;
|
|
|
self.selectGood($(e.delegateTarget).find('.chk.select'));
|
...
|
...
|
|