|
@@ -10,6 +10,7 @@ let $ = require('yoho-jquery'), |
|
@@ -10,6 +10,7 @@ let $ = require('yoho-jquery'), |
10
|
tip = require('js/plugin/tip'),
|
10
|
tip = require('js/plugin/tip'),
|
11
|
chosePanel = require('js/common/chose-panel-new'),
|
11
|
chosePanel = require('js/common/chose-panel-new'),
|
12
|
loading = require('js/plugin/loading'),
|
12
|
loading = require('js/plugin/loading'),
|
|
|
13
|
+ isModify = false,
|
13
|
dialog = require('js/plugin/dialog');
|
14
|
dialog = require('js/plugin/dialog');
|
14
|
|
15
|
|
15
|
let goodObj = {
|
16
|
let goodObj = {
|
|
@@ -198,6 +199,7 @@ let goodObj = { |
|
@@ -198,6 +199,7 @@ let goodObj = { |
198
|
return;
|
199
|
return;
|
199
|
}
|
200
|
}
|
200
|
self.handle.posting = true;
|
201
|
self.handle.posting = true;
|
|
|
202
|
+ let modeType = isModify ? 1 : 0;
|
201
|
let skuData = self.getSelectGoodData(eles, selectAll);
|
203
|
let skuData = self.getSelectGoodData(eles, selectAll);
|
202
|
|
204
|
|
203
|
|
205
|
|
|
@@ -206,7 +208,8 @@ let goodObj = { |
|
@@ -206,7 +208,8 @@ let goodObj = { |
206
|
type: 'post',
|
208
|
type: 'post',
|
207
|
url: '/cart/index/new/select',
|
209
|
url: '/cart/index/new/select',
|
208
|
data: {
|
210
|
data: {
|
209
|
- skuList: JSON.stringify(skuData)
|
211
|
+ skuList: JSON.stringify(skuData),
|
|
|
212
|
+ modeType: modeType
|
210
|
},
|
213
|
},
|
211
|
complete: () => {
|
214
|
complete: () => {
|
212
|
self.handle.posting = false;
|
215
|
self.handle.posting = false;
|
|
@@ -334,7 +337,7 @@ let goodObj = { |
|
@@ -334,7 +337,7 @@ let goodObj = { |
334
|
} else {
|
337
|
} else {
|
335
|
goodInfo.selected = $this.hasClass('checked') ? 'N' : 'Y';
|
338
|
goodInfo.selected = $this.hasClass('checked') ? 'N' : 'Y';
|
336
|
}
|
339
|
}
|
337
|
- if ($this.hasClass('presale')) {
|
340
|
+ if ($this.hasClass('presale') && isModify) {
|
338
|
goodInfo.selected = 'N';
|
341
|
goodInfo.selected = 'N';
|
339
|
}
|
342
|
}
|
340
|
goodInfo.product_sku = id;
|
343
|
goodInfo.product_sku = id;
|
|
@@ -350,6 +353,7 @@ let goodObj = { |
|
@@ -350,6 +353,7 @@ let goodObj = { |
350
|
if (batch_no) {
|
353
|
if (batch_no) {
|
351
|
goodInfo.batch_no = batch_no;
|
354
|
goodInfo.batch_no = batch_no;
|
352
|
}
|
355
|
}
|
|
|
356
|
+ isModify = false;
|
353
|
return goodInfo;
|
357
|
return goodInfo;
|
354
|
}));
|
358
|
}));
|
355
|
|
359
|
|
|
@@ -396,6 +400,7 @@ let goodObj = { |
|
@@ -396,6 +400,7 @@ let goodObj = { |
396
|
}).done(function(res) {
|
400
|
}).done(function(res) {
|
397
|
if (res && res.code === 200) {
|
401
|
if (res && res.code === 200) {
|
398
|
$(e.delegateTarget).data('id', result.sku.skuId);
|
402
|
$(e.delegateTarget).data('id', result.sku.skuId);
|
|
|
403
|
+ isModify = true;
|
399
|
if (!$(e.delegateTarget).find('.chk.select').hasClass('checked')) {
|
404
|
if (!$(e.delegateTarget).find('.chk.select').hasClass('checked')) {
|
400
|
self.selectGood($(e.delegateTarget).find('.chk.select'));
|
405
|
self.selectGood($(e.delegateTarget).find('.chk.select'));
|
401
|
} else {
|
406
|
} else {
|
|
@@ -475,6 +480,7 @@ let goodObj = { |
|
@@ -475,6 +480,7 @@ let goodObj = { |
475
|
goodNum = parseInt($(e.delegateTarget).find('.good-num').val(), 10);
|
480
|
goodNum = parseInt($(e.delegateTarget).find('.good-num').val(), 10);
|
476
|
let max = parseInt($(e.delegateTarget).find('.good-num').data('max'), 10);
|
481
|
let max = parseInt($(e.delegateTarget).find('.good-num').data('max'), 10);
|
477
|
|
482
|
|
|
|
483
|
+ isModify = true;
|
478
|
if (!$(e.delegateTarget).find('.chk.select').hasClass('checked') && goodNum <= max) {
|
484
|
if (!$(e.delegateTarget).find('.chk.select').hasClass('checked') && goodNum <= max) {
|
479
|
self.handle.posting = false;
|
485
|
self.handle.posting = false;
|
480
|
self.selectGood($(e.delegateTarget).find('.chk.select'));
|
486
|
self.selectGood($(e.delegateTarget).find('.chk.select'));
|