|
|
@@ -880,6 +880,7 @@
|
|
|
</div>
|
|
|
<script>
|
|
|
var id = {$id};
|
|
|
+ var lucky_id = {$lucky_id};
|
|
|
new Vue({
|
|
|
el: '#app',
|
|
|
data: {
|
|
|
@@ -1447,6 +1448,7 @@
|
|
|
return that.showMsg(res.msg);
|
|
|
});
|
|
|
},
|
|
|
+
|
|
|
handleSubmit:function () {
|
|
|
var that = this, cate_id = $('input[name="cate_id"]').val();
|
|
|
if (cate_id != '') {
|
|
|
@@ -1454,7 +1456,11 @@
|
|
|
}
|
|
|
if (!that.formData.cate_id.length) {
|
|
|
return that.showMsg('请选择商品分类');
|
|
|
+ } else if (that.formData.cate_id.length > 1) {
|
|
|
+ return that.showMsg('商品不能属于多个分类');
|
|
|
}
|
|
|
+ var is_lucky = that.formData.cate_id[0] == lucky_id;
|
|
|
+
|
|
|
if (!that.formData.temp_id) {
|
|
|
return that.showMsg('请选择运费模板');
|
|
|
}
|
|
|
@@ -1472,6 +1478,9 @@
|
|
|
if (!that.formData.slider_image.length) {
|
|
|
return that.showMsg('请填选择商品轮播图');
|
|
|
}
|
|
|
+ if (is_lucky && that.formData.spec_type == 0) {
|
|
|
+ return that.showMsg('幸运2021 必须为多规格');
|
|
|
+ }
|
|
|
if (that.formData.spec_type == 0) {
|
|
|
if (!that.formData.attr.pic) {
|
|
|
return that.showMsg('请选择单规则图片');
|
|
|
@@ -1503,6 +1512,23 @@
|
|
|
};
|
|
|
that.formData.attrs = [attr];
|
|
|
} else {
|
|
|
+ if(is_lucky && !that.formData.items.find(function(val) {
|
|
|
+ if (val.value == '幸运' && val.detail.length == 2 &&
|
|
|
+ val.detail[0] == '20' && val.detail[1] == '21') {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ })) {
|
|
|
+ return that.showMsg('缺少[幸运]规格或格式不正确');
|
|
|
+ }
|
|
|
+
|
|
|
+ if(!is_lucky && that.formData.items.find(function(val) {
|
|
|
+ if (val.value == '幸运') {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ })) {
|
|
|
+ return that.showMsg('非 幸运2021 使用了[幸运]规格');
|
|
|
+ }
|
|
|
+
|
|
|
if (!that.formData.attrs.length) {
|
|
|
return that.showMsg('请添加多规格属性');
|
|
|
}
|