data.forEach((item) => {
if (this.isRepetition(item)) {
this.goodsData.checkdData.unshift({
...item,
id: item.category || item.id,
bid: this.bidUse,
suggestes: {
suggested: null,
rangeStart: null,
rangeEnd: null
}
})
}
})
if (this.isBatch == true) {
this.$emit('change', this.getData(), 'checkAll')
return
}
this.goodsSelectedLoading = true
const res = await this.getTargetsBidFn(this.getData())
this.getTargetsBidRec(res)
},
// 定位去重;
isRepetition(item) {
const data = JSON.parse(JSON.stringify(this.goodsData.checkdData))
if (
!data.find((el) => {
delete el.bid
delete el.suggest_param
delete el.suggestes
if(this.moduleType === 'sd'){delete el.id}
return JSON.stringify(el) == JSON.stringify(item)
})
) {
// 无重复
return true
}
else {
// 有重复
return false
}
},