|
|
|
@ -77,6 +77,16 @@ |
|
|
|
flex-wrap: wrap; |
|
|
|
min-width: 0; |
|
|
|
} |
|
|
|
.goods-attribute-delete { |
|
|
|
flex: 0 0 auto; |
|
|
|
width: 60px; |
|
|
|
height: 30px; |
|
|
|
line-height: 30px; |
|
|
|
color: #ed4014; |
|
|
|
border: none; |
|
|
|
background: transparent; |
|
|
|
cursor: pointer; |
|
|
|
} |
|
|
|
.goods-attribute-value { |
|
|
|
margin: 0 6px 6px 0; |
|
|
|
padding: 0 8px; |
|
|
|
@ -329,7 +339,7 @@ |
|
|
|
<Col span="24"> |
|
|
|
<FormItem label="商品属性" class="form-noheight"> |
|
|
|
<div class="goods-attribute-list"> |
|
|
|
<div v-for="(value,key) in Array.from(addGoodsForm.attributeList1)" :key="key" class="goods-attribute-row"> |
|
|
|
<div v-for="(value,key) in Array.from(addGoodsForm.attributeList1)" :key="value[0]" class="goods-attribute-row"> |
|
|
|
<div class="goods-attribute-canbuy"> |
|
|
|
<span>可选:</span> |
|
|
|
<Input v-model="value[1].canbuy" type="number" placeholder="1" @on-change="onCanbuyChange(value[0], value[1].canbuy)" /> |
|
|
|
@ -340,6 +350,7 @@ |
|
|
|
{{item}} |
|
|
|
</span> |
|
|
|
</div> |
|
|
|
<button type="button" class="goods-attribute-delete" @click.stop.prevent="deleteGoodsAttribute(value[0])">删除</button> |
|
|
|
</div> |
|
|
|
<div @click="checkSpec('shuxing')" style="width: 80px;height: 30px;text-align: center;line-height: 30px;background: #008ba0;color:#fff;"> |
|
|
|
选择属性 |
|
|
|
@ -1064,6 +1075,19 @@ |
|
|
|
this.addGoodsForm.attributeList1.set(categoryName, entry) |
|
|
|
} |
|
|
|
}, |
|
|
|
deleteGoodsAttribute(attributeName){ |
|
|
|
const source = this.addGoodsForm.attributeList1 |
|
|
|
let entries = [] |
|
|
|
if (source instanceof Map) { |
|
|
|
entries = Array.from(source) |
|
|
|
} else if (source && typeof source === "object") { |
|
|
|
entries = Object.entries(source) |
|
|
|
} |
|
|
|
const attributeListMap = new Map(entries.filter(item => item[0] != attributeName)) |
|
|
|
this.$set(this.addGoodsForm, "attributeList1", attributeListMap) |
|
|
|
this.attrValueArr = (this.attrValueArr || []).filter(item => item.parentName != attributeName) |
|
|
|
this.$forceUpdate() |
|
|
|
}, |
|
|
|
isRequestSuccess(res) { |
|
|
|
return res && (res.success || res.code == 200); |
|
|
|
}, |
|
|
|
|