|
@@ -23,7 +23,12 @@
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="商品规格:" :rules='[{ required: true, message: "请选择商品规格", trigger: "blur" }]'>
|
|
|
+ <el-form-item
|
|
|
+ label="商品规格:"
|
|
|
+ :rules="[
|
|
|
+ { required: true, message: '请选择商品规格', trigger: 'blur' },
|
|
|
+ ]"
|
|
|
+ >
|
|
|
<el-card shadow="never" class="cardBg">
|
|
|
<div v-for="(productAttr, idx) in selectProductAttr">
|
|
|
{{ productAttr.name }}:
|
|
@@ -231,8 +236,11 @@
|
|
|
<el-button size="medium" @click="handlePrev"
|
|
|
>上一步,填写商品促销</el-button
|
|
|
>
|
|
|
- <el-button type="primary" size="medium" @click="handleNext"
|
|
|
+ <!-- <el-button type="primary" size="medium" @click="handleNext"
|
|
|
>下一步,选择商品关联</el-button
|
|
|
+ > -->
|
|
|
+ <el-button type="primary" size="medium" @click="handleFinishCommit"
|
|
|
+ >完成,提交商品</el-button
|
|
|
>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
@@ -342,7 +350,7 @@ export default {
|
|
|
mounted() {
|
|
|
console.log(this.value.skuStockList);
|
|
|
this.handleEditCreated();
|
|
|
- this.getProductAttrCateList()
|
|
|
+ this.getProductAttrCateList();
|
|
|
},
|
|
|
watch: {
|
|
|
productId: function (newValue) {
|
|
@@ -749,6 +757,24 @@ export default {
|
|
|
this.mergeProductAttrPics();
|
|
|
this.$emit("nextStep");
|
|
|
},
|
|
|
+
|
|
|
+ handleFinishCommit() {
|
|
|
+ if (
|
|
|
+ !this.value.skuStockList ||
|
|
|
+ this.value.skuStockList.length <= 0 ||
|
|
|
+ !(this.value.skuStockList[0].price + "") ||
|
|
|
+ !(this.value.skuStockList[0].stock + "") ||
|
|
|
+ !(this.value.skuStockList[0].lowStock + "") ||
|
|
|
+ !(this.value.skuStockList[0].skuCode + "")
|
|
|
+ ) {
|
|
|
+ this.$message.error("请编辑商品规格");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ this.mergeProductAttrValue();
|
|
|
+ this.mergeProductAttrPics();
|
|
|
+ this.$emit("finishCommit", this.isEdit);
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|