|
|
@ -213,21 +213,20 @@ export default class MultiSpec { |
|
|
|
this.multiSpecData.skuList = this.oldSkuList(newSkuList) |
|
|
|
this.multiSpecData.skuList = this.oldSkuList(newSkuList) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 合并已存在的sku数据
|
|
|
|
// 合并已存在的sku数据
|
|
|
|
oldSkuList (newSkuList) { |
|
|
|
oldSkuList (newSkuList) { |
|
|
|
// const oldSkuList = _.cloneDeep(this.multiSpecData.skuList)
|
|
|
|
// const oldSkuList = _.cloneDeep(this.multiSpecData.skuList)
|
|
|
|
const oldSkuList = this.multiSpecData.skuList.concat() |
|
|
|
const oldSkuList = this.multiSpecData.skuList.concat() |
|
|
|
if (!oldSkuList.length || !newSkuList.length) { |
|
|
|
if (!oldSkuList.length || !newSkuList.length) { |
|
|
|
return newSkuList |
|
|
|
return newSkuList |
|
|
|
} |
|
|
|
} |
|
|
|
console.log(oldSkuList, newSkuList) |
|
|
|
|
|
|
|
for (const index in newSkuList) { |
|
|
|
for (const index in newSkuList) { |
|
|
|
// 查找符合的旧记录
|
|
|
|
// 查找符合的旧记录
|
|
|
|
let oldSkuItem = {} |
|
|
|
let oldSkuItem = {} |
|
|
|
// if (oldSkuList.length === newSkuList.length) {
|
|
|
|
// if (oldSkuList.length === newSkuList.length) {
|
|
|
|
// oldSkuItem = _.cloneDeep(oldSkuList[index])
|
|
|
|
// oldSkuItem = _.cloneDeep(oldSkuList[index])
|
|
|
|
// } else {
|
|
|
|
// } else {
|
|
|
|
oldSkuItem = oldSkuList.find( |
|
|
|
oldSkuItem = oldSkuList.find( |
|
|
|
(item) => |
|
|
|
(item) => |
|
|
|
newSkuList[index].tempId === |
|
|
|
newSkuList[index].tempId === |
|
|
|
((item.goods_props && item.goods_props.length > 0) ? item.goods_props.map((v) => v.value.name).join('_') : item.tempId) |
|
|
|
((item.goods_props && item.goods_props.length > 0) ? item.goods_props.map((v) => v.value.name).join('_') : item.tempId) |
|
|
@ -262,7 +261,6 @@ export default class MultiSpec { |
|
|
|
} |
|
|
|
} |
|
|
|
return newSkuList |
|
|
|
return newSkuList |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 生成sku表格字段名
|
|
|
|
// 生成sku表格字段名
|
|
|
|
buildSkuColumns (rowSpanArr) { |
|
|
|
buildSkuColumns (rowSpanArr) { |
|
|
|
const specList = this.multiSpecData.specList |
|
|
|
const specList = this.multiSpecData.specList |
|
|
|