|
@@ -23,7 +23,7 @@
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="商品规格:">
|
|
|
+ <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 }}:
|
|
@@ -330,8 +330,6 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
skuStockList() {
|
|
|
-
|
|
|
-
|
|
|
// if (this.value&&this.value.skuStockList[0]&&this.value.skuStockList[0].productId){
|
|
|
// console.log('调用')
|
|
|
|
|
@@ -342,15 +340,15 @@ export default {
|
|
|
},
|
|
|
created() {},
|
|
|
mounted() {
|
|
|
- console.log(this.value.skuStockList)
|
|
|
+ console.log(this.value.skuStockList);
|
|
|
this.handleEditCreated();
|
|
|
},
|
|
|
watch: {
|
|
|
productId: function (newValue) {
|
|
|
// if (!this.isEdit) return;
|
|
|
- if (this.hasEditCreated) return;
|
|
|
- if(!newValue) return
|
|
|
- this.handleEditCreated();
|
|
|
+ if (this.hasEditCreated) return;
|
|
|
+ if (!newValue) return;
|
|
|
+ this.handleEditCreated();
|
|
|
},
|
|
|
},
|
|
|
methods: {
|
|
@@ -737,10 +735,10 @@ export default {
|
|
|
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.value.skuStockList[0].price + "") ||
|
|
|
+ !(this.value.skuStockList[0].stock + "") ||
|
|
|
+ !(this.value.skuStockList[0].lowStock + "") ||
|
|
|
+ !(this.value.skuStockList[0].skuCode + "")
|
|
|
) {
|
|
|
this.$message.error("请编辑商品规格");
|
|
|
return;
|