const checkedSkuItems = await this.$refs.selectSku.onSelect()//新添加的数据
const orderDetails = deepClone(this.editShipOrderform.items)//已存在的数据列表
let repeatSkuIds = []//重复的数据
for (const index in orderDetails) {
const itemSku = checkedSkuItems.find(newItem => {
return orderDetails[index].skuId === newItem.skuId
})
if (itemSku) {
repeatSkuIds.push(itemSku.skuId)
if (orderDetails[index].id) {
this.editShipOrderform.deleteItemsIds.push(orderDetails[index].id)
}
orderDetails.splice(index, 1, itemSku)
}
}
const newSkuItems = checkedSkuItems.filter(newItem => {
return !repeatSkuIds.includes(newItem.skuId)
})