|
@@ -229,9 +229,23 @@ export default {
|
|
},
|
|
},
|
|
// 获取品牌数据
|
|
// 获取品牌数据
|
|
getBrandList () {
|
|
getBrandList () {
|
|
|
|
+ const _this = this
|
|
productBrandQuery({}).then(res => {
|
|
productBrandQuery({}).then(res => {
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
- this.brandList = res.data
|
|
|
|
|
|
+ _this.brandList = res.data
|
|
|
|
+ if (_this.chooseData && _this.chooseData.length > 0) {
|
|
|
|
+ const checkedList = []
|
|
|
|
+ _this.chooseData.map(item => {
|
|
|
|
+ checkedList.push(item.goodsSn)
|
|
|
|
+ })
|
|
|
|
+ this.brandList.map(item => {
|
|
|
|
+ if (checkedList.includes(item.brandSn)) {
|
|
|
|
+ item.checked = true
|
|
|
|
+ } else {
|
|
|
|
+ item.checked = false
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
this.brandList = []
|
|
this.brandList = []
|
|
}
|
|
}
|
|
@@ -266,20 +280,7 @@ export default {
|
|
})
|
|
})
|
|
} else {
|
|
} else {
|
|
const _this = this
|
|
const _this = this
|
|
- const checkedList = []
|
|
|
|
- _this.chooseData.map(item => {
|
|
|
|
- checkedList.push(item.goodsSn)
|
|
|
|
- })
|
|
|
|
- this.brandList.map(item => {
|
|
|
|
- if (checkedList.includes(item.brandSn)) {
|
|
|
|
- item.checked = true
|
|
|
|
- } else {
|
|
|
|
- item.checked = false
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- if (this.brandList.length == 0) {
|
|
|
|
- this.getBrandList()
|
|
|
|
- }
|
|
|
|
|
|
+ _this.getBrandList()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|